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
27e9d81737ee92eb1f9951abaface84d95d30ff8
diff --git a/jquery.nette-ajax.js b/jquery.nette-ajax.js index <HASH>..<HASH> 100644 --- a/jquery.nette-ajax.js +++ b/jquery.nette-ajax.js @@ -70,10 +70,12 @@ var nette = function () { this.init = function (load, loadContext) { if (typeof load == 'function') { + this.ext('n:init', null); this.ext('n:init', { load: load, }, loadContext); } else if (typeof load == 'object') { + this.ext('n:init', null); this.ext('n:init', load, loadContext); } else if (load !== undefined) { throw 'Argument of init() can be function or function-hash only.';
Calling init() with callbacks overrides automatic behavior (exception)
vojtech-dobes_nette.ajax.js
train
js
6cd53cbc39cb7eabc50c5538e6cf620c9a5450ab
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,14 +9,13 @@ if not on_rtd: "numpy", "pyicu", "fuzzywuzzy", - "sphinxcontrib-napoleon", "python-Levenshtein", # Remove this if colormath bug #51 is resolved "networkx", + "sphinx>=1.3b2", ] else: install_requires = [ - "sphinxcontrib-napoleon", "mock", ]
packaging: Remove 'napoleon' dependency As of <I>, 'napoleon' is included in Sphinx itself.
solute_python-tint
train
py
cd637c2ee41572c8a5708c40dcf62656a4da813a
diff --git a/bika/lims/browser/batch.py b/bika/lims/browser/batch.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/batch.py +++ b/bika/lims/browser/batch.py @@ -45,4 +45,19 @@ class BatchAnalysisRequestsView(AnalysisRequestsView): class BatchSamplesView(SamplesView): def __init__(self, context, request): super(BatchSamplesView, self).__init__(context, request) - self.contentFilter['getBatchUID'] = self.context.UID() + self.view_url = self.context.absolute_url() + "/samples" + if 'path' in self.contentFilter: + del(self.contentFilter['path']) + + def contentsMethod(self, contentFilter): + tool = getToolByName(self.context, self.catalog) + state = [x for x in self.review_states if x['id'] == self.review_state][0] + for k,v in state['contentFilter'].items(): + self.contentFilter[k] = v + tool_samples = tool(contentFilter) + samples = {} + for sample in (p.getObject() for p in tool_samples): + for ar in sample.getAnalysisRequests(): + if ar.getBatchUID() == self.context.UID(): + samples[sample.getId()] = sample + return samples.values()
Batch: Show correct list of samples in batch samples view
senaite_senaite.core
train
py
ee4e0010f77c149b015364af3e8688bcab50219f
diff --git a/lib/nodejs/sclang.js b/lib/nodejs/sclang.js index <HASH>..<HASH> 100644 --- a/lib/nodejs/sclang.js +++ b/lib/nodejs/sclang.js @@ -273,8 +273,8 @@ SCLang.prototype.initInterpreter = function() { this.once('interpreterLoaded', function() { deferred.resolve(self); }); - this.write('thisProcess.interpreter.executeFile("' + path + '")', null, true); + this.write('thisProcess.interpreter.executeFile("' + path + '");\n', }; /** @@ -308,7 +308,7 @@ SCLang.prototype.interpret = function(code, nowExecutingPath, asString) { scode; scode = 'Library.at(\\supercolliderjs, \\interpret).value(' + args + - ');"SUPERCOLLIDERJS.interpreted".postln;'; + ');"SUPERCOLLIDERJS.interpreted".postln;\n'; // register listener this.calls[guid] = deferred;
fix interpret for <I>.x which always requires a \n
crucialfelix_supercolliderjs
train
js
fb6635868f7ce521fa80bcfdc999275f665aba6f
diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/service/ClientSession.java b/aeron-cluster/src/main/java/io/aeron/cluster/service/ClientSession.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/service/ClientSession.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/service/ClientSession.java @@ -169,6 +169,11 @@ public class ClientSession this.isClosing = true; } + void resetClosing() + { + isClosing = false; + } + void disconnect() { CloseHelper.close(responsePublication); diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceAgent.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceAgent.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceAgent.java @@ -419,6 +419,7 @@ class ClusteredServiceAgent implements Agent, Cluster if (Role.LEADER == role) { session.connect(aeron); + session.resetClosing(); } else {
[Java] Reset closing status on client session in service on role change to leader so they can be closed in new term if the attempt happened just before leadership change.
real-logic_aeron
train
java,java
076e5c80a573e2ec9f38d20177761b2b0900c13e
diff --git a/src/Node/Directory.php b/src/Node/Directory.php index <HASH>..<HASH> 100644 --- a/src/Node/Directory.php +++ b/src/Node/Directory.php @@ -11,7 +11,7 @@ use React\Filesystem\ObjectStreamSink; use React\Promise\Deferred; use React\Promise\FulfilledPromise; -class Directory implements DirectoryInterface, GenericOperationInterface +class Directory implements DirectoryInterface { use GenericOperationTrait; diff --git a/src/Node/File.php b/src/Node/File.php index <HASH>..<HASH> 100644 --- a/src/Node/File.php +++ b/src/Node/File.php @@ -14,7 +14,7 @@ use React\Promise\FulfilledPromise; use React\Promise\RejectedPromise; use React\Stream\BufferedSink; -class File implements FileInterface, GenericOperationInterface +class File implements FileInterface { use GenericOperationTrait; diff --git a/src/Node/NodeInterface.php b/src/Node/NodeInterface.php index <HASH>..<HASH> 100644 --- a/src/Node/NodeInterface.php +++ b/src/Node/NodeInterface.php @@ -2,7 +2,7 @@ namespace React\Filesystem\Node; -interface NodeInterface +interface NodeInterface extends GenericOperationInterface { const DS = DIRECTORY_SEPARATOR;
Moved GenericOperationInterface implements to NodeInterface
reactphp_filesystem
train
php,php,php
fd7bdf791436c912783a53bd235d409e226c5e75
diff --git a/libs/Gustav/Cache/Filesystem/Cache.php b/libs/Gustav/Cache/Filesystem/Cache.php index <HASH>..<HASH> 100755 --- a/libs/Gustav/Cache/Filesystem/Cache.php +++ b/libs/Gustav/Cache/Filesystem/Cache.php @@ -237,7 +237,7 @@ class Cache implements ICache { if($this->_deleted === true) { throw CacheException::fileDeleted($this->_fileName); } - if($force !== true && $this->_deleted === false) { //not changed... + if($force !== true && $this->_updated === false) { //not changed... return; }
Fixed bug with ignoring saving process of changed cache files
GustavSoftware_Cache
train
php
bb3b928d0db5b9f0a54133c812d5d5d5d53bd4b6
diff --git a/openquake/db/models.py b/openquake/db/models.py index <HASH>..<HASH> 100644 --- a/openquake/db/models.py +++ b/openquake/db/models.py @@ -642,6 +642,9 @@ class ModelContent(djm.Model): content_type = djm.TextField() last_update = djm.DateTimeField(editable=False, default=datetime.utcnow) + class Meta: # pylint: disable=C0111,W0232 + db_table = 'uiapi\".\"model_content' + class Input2job(djm.Model): '''
Added missing site_model schema declaration
gem_oq-engine
train
py
15e78453c74ded0b0ea12022172250d8acbe9aea
diff --git a/insights/client/data_collector.py b/insights/client/data_collector.py index <HASH>..<HASH> 100644 --- a/insights/client/data_collector.py +++ b/insights/client/data_collector.py @@ -204,7 +204,7 @@ class DataCollector(object): raise LookupError logger.warn("WARNING: Skipping patterns defined in blacklist configuration") except LookupError: - logger.debug('Patterns section of remove.conf is empty.') + logger.debug('Patterns section of blacklist configuration is empty.') for c in conf['commands']: # remember hostname archive path @@ -272,13 +272,14 @@ class DataCollector(object): and archive files. """ if self.config.obfuscate: + if rm_conf and rm_conf.get('keywords'): + logger.warn("WARNING: Skipping keywords defined in blacklist configuration") cleaner = SOSCleaner(quiet=True) clean_opts = CleanOptions( self.config, self.archive.tmp_dir, rm_conf, self.hostname_path) cleaner.clean_report(clean_opts, self.archive.archive_dir) if clean_opts.keyword_file is not None: os.remove(clean_opts.keyword_file.name) - logger.warn("WARNING: Skipping keywords found in remove.conf") if self.config.output_dir: # return the entire soscleaner dir # see additions to soscleaner.SOSCleaner.clean_report
messaging fixes for blacklist (#<I>) * messaging fixes for blacklist
RedHatInsights_insights-core
train
py
bac069dc32928bb87dc8a802404851579ac9d540
diff --git a/lib/chamber/version.rb b/lib/chamber/version.rb index <HASH>..<HASH> 100644 --- a/lib/chamber/version.rb +++ b/lib/chamber/version.rb @@ -1,3 +1,3 @@ class Chamber - VERSION = '1.0.0' + VERSION = '1.0.1' end
Version Bump to <I>
thekompanee_chamber
train
rb
ed2cf8c1949ee5e1e8edb8813c02eb9b58dbe641
diff --git a/yandextank/aggregator/tank_aggregator.py b/yandextank/aggregator/tank_aggregator.py index <HASH>..<HASH> 100644 --- a/yandextank/aggregator/tank_aggregator.py +++ b/yandextank/aggregator/tank_aggregator.py @@ -79,9 +79,7 @@ class TankAggregator(object): self.stats) self.stats_drain.start() else: - raise PluginImplementationError( - "Generator must pass a Reader and a StatsReader" - " to Aggregator before starting test") + logger.warning("Generator not found. Generator must provide a reader and a stats_reader interface") def _collect_data(self): """ diff --git a/yandextank/core/tankcore.py b/yandextank/core/tankcore.py index <HASH>..<HASH> 100644 --- a/yandextank/core/tankcore.py +++ b/yandextank/core/tankcore.py @@ -244,7 +244,7 @@ class TankCore(object): gen = self.get_plugin_of_type(GeneratorPlugin) # aggregator except KeyError: - logger.warning("Load generator not found:", exc_info=True) + logger.warning("Load generator not found") gen = GeneratorPlugin() aggregator = TankAggregator(gen) self._job = Job(monitoring_plugin=mon,
fix autoclean: no exception when generator not found
yandex_yandex-tank
train
py,py
f9840d58c80b635b6ff08b2bae3d0180a1e9beaf
diff --git a/__init__.py b/__init__.py index <HASH>..<HASH> 100755 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ class SculptDebugMiddleware(object): if settings.SCULPT_DUMP_SQL or settings.SCULPT_DUMP_SESSION or settings.SCULPT_DUMP_REQUESTS: if self.date_request_started != None: elapsed_time = (datetime.datetime.utcnow() - self.date_request_started).total_seconds() - print '==== REQUEST TIME: %s %.3fs %s' % (request.method, elapsed_time, request.META['RAW_URI']) + print '==== REQUEST TIME: %s %.3fs %s' % (request.method, elapsed_time, request.META['RAW_URI'] if 'RAW_URI' in request.META else request.META['PATH_INFO']) if settings.SCULPT_DUMP_SQL: print '==== SQL QUERIES ===='
Fix for Django's dumb test server which doesn't set all ENV variables.
damienjones_sculpt-debug
train
py
1fbb39601931d4f72f59b06e4ca3771c2a36125f
diff --git a/app/models/manager_refresh/inventory_collection.rb b/app/models/manager_refresh/inventory_collection.rb index <HASH>..<HASH> 100644 --- a/app/models/manager_refresh/inventory_collection.rb +++ b/app/models/manager_refresh/inventory_collection.rb @@ -308,7 +308,7 @@ module ManagerRefresh @builder_params = builder_params @name = name || association - raise "You have to pass either :name or :association argument to InventoryCollection.new" if @name.blank? + raise "You have to pass either :name or :association argument to .new of #{self}" if @name.blank? @inventory_object_attributes = inventory_object_attributes
Reformulate the exception to contain a pointer to the IC object Reformulate the exception to contain a pointer to the IC object (transferred from ManageIQ/manageiq@<I>ffe<I>ba<I>ccb7cc5ded3a<I>a1eca<I>fa)
ManageIQ_inventory_refresh
train
rb
eb4a8e13c0cf81b6ebc4087e01cd22af4680a165
diff --git a/app/SymfonyStandard/RootPackageInstallSubscriber.php b/app/SymfonyStandard/RootPackageInstallSubscriber.php index <HASH>..<HASH> 100644 --- a/app/SymfonyStandard/RootPackageInstallSubscriber.php +++ b/app/SymfonyStandard/RootPackageInstallSubscriber.php @@ -18,11 +18,6 @@ use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler; class RootPackageInstallSubscriber implements EventSubscriberInterface { - public static function installAcmeDemoBundle(CommandEvent $event) - { - ScriptHandler::installAcmeDemoBundle($event); - } - public static function setupNewDirectoryStructure(CommandEvent $event) { ScriptHandler::defineDirectoryStructure($event); @@ -33,7 +28,6 @@ class RootPackageInstallSubscriber implements EventSubscriberInterface return array( ScriptEvents::POST_INSTALL_CMD => array( array('setupNewDirectoryStructure', 512), - array('installAcmeDemoBundle', 0) ), ); }
Removed AcmeDemoBundle
symfony_symfony-standard
train
php
8c44ecdea6e1debe1c3ae7eade3d08f2ea9d608c
diff --git a/lib/rjr/messages/response.rb b/lib/rjr/messages/response.rb index <HASH>..<HASH> 100644 --- a/lib/rjr/messages/response.rb +++ b/lib/rjr/messages/response.rb @@ -78,7 +78,7 @@ class Response def parse_headers(request) request.keys.select { |k| - !['jsonrpc', 'id', 'method', 'params'].include?(k) + !['jsonrpc', 'id', 'method', 'result', 'error'].include?(k) }.each { |k| @headers[k] = request[k] } end
Fix json fields ignored in response header analysis Recent refactoring exposed a bug where response headers were not being set properly
movitto_rjr
train
rb
046e1aacd140b59c81fce7cd11565303357503e8
diff --git a/src/components/widgets/DateTimePicker.js b/src/components/widgets/DateTimePicker.js index <HASH>..<HASH> 100644 --- a/src/components/widgets/DateTimePicker.js +++ b/src/components/widgets/DateTimePicker.js @@ -140,11 +140,11 @@ export default class DateTimePicker extends Component { }); } - onTimeUpdate() { + onTimeUpdate(value) { const {time: currentTime, date: currentDate} = this.parseDateTime(this.props.value); - const isValidTime = isDateTime(testDate + ' ' + this.state.timeValue); + const isValidTime = isDateTime(testDate + ' ' + value); - if (this.state.timeValue === '') { + if (value === '') { this.setState({ timeInputClassName: 'datetimepicker-container-time-input', timeValue: currentTime, @@ -153,7 +153,7 @@ export default class DateTimePicker extends Component { } if (isValidTime) { - this.props.onChange(currentDate + ' ' + this.state.timeValue); + this.props.onChange(currentDate + ' ' + value); } }
make onTimeUpdate code follow what onDateUpdate does
plotly_react-chart-editor
train
js
adb6166b5570e567fa31ea98d623fc0892be9bf5
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -441,10 +441,14 @@ module.exports.NULL = binding.types.Null.NULL; * TODO: remove for 4.0 */ +function processSassDeprecationMessage() { + console.log('Deprecation warning: `process.sass` is an undocumented internal that will be removed in future versions of Node Sass.'); +} + process.sass = process.sass || { - versionInfo: module.exports.info, - binaryName: sass.getBinaryName(), - binaryUrl: sass.getBinaryUrl(), - binaryPath: sass.getBinaryPath(), - getBinaryPath: sass.getBinaryPath, + get versionInfo() { processSassDeprecationMessage(); return module.exports.info; }, + get binaryName() { processSassDeprecationMessage(); return sass.getBinaryName(); }, + get binaryUrl() { processSassDeprecationMessage(); return sass.getBinaryUrl(); }, + get binaryPath() { processSassDeprecationMessage(); return sass.getBinaryPath(); }, + get getBinaryPath() { processSassDeprecationMessage(); return sass.getBinaryPath; }, };
Ouptut a deprecation warning to stdout when using process.sass This is an undocumented internal API that will be removed. Access `process.sass` will produce the following warning. >Deprecation warning: `process.sass` is an undocumented internal that will be removed in future versions of Node Sass.
sass_node-sass
train
js
46c122d45c9d62261b8e29dcf315740d39b752b9
diff --git a/server/src/test/java/org/cloudfoundry/identity/uaa/test/HoneycombAuditEventTestListener.java b/server/src/test/java/org/cloudfoundry/identity/uaa/test/HoneycombAuditEventTestListener.java index <HASH>..<HASH> 100644 --- a/server/src/test/java/org/cloudfoundry/identity/uaa/test/HoneycombAuditEventTestListener.java +++ b/server/src/test/java/org/cloudfoundry/identity/uaa/test/HoneycombAuditEventTestListener.java @@ -29,11 +29,13 @@ public class HoneycombAuditEventTestListener<T extends ApplicationEvent> extends super.handleEvent(applicationEvent); this.events.removeIf(event -> { - honeycombEventFactory.createEvent() - .addField("auditEvent", event.getClass().getSimpleName()) - .addField("eventSource", event.toString()) - .addField("testName", testRunning) - .send(); + try { + honeycombEventFactory.createEvent() + .addField("auditEvent", event.getClass().getSimpleName()) + .addField("eventSource", event.toString()) + .addField("testName", testRunning) + .send(); + } catch(Exception _) {} return true; }); }
Allow tests to run without having to provide honeycomb environment params
cloudfoundry_uaa
train
java
6078fba9410918baa486ca008cc9e3ba066c03ec
diff --git a/pandas/core/series.py b/pandas/core/series.py index <HASH>..<HASH> 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2310,7 +2310,9 @@ copy : boolean, default False df = DataFrame.from_csv(path, header=header, index_col=index_col, sep=sep, parse_dates=parse_dates, encoding=encoding) - return df.ix[:, 0] + result = df.ix[:, 0] + result.index.name = result.name = None + return result def to_csv(self, path, index=True, sep=",", na_rep='', header=False, index_label=None, mode='w', nanRep=None, encoding=None): diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py index <HASH>..<HASH> 100644 --- a/pandas/tests/test_series.py +++ b/pandas/tests/test_series.py @@ -1879,6 +1879,8 @@ class TestSeries(unittest.TestCase, CheckNameIntegration): self.series.to_csv('_foo') series = Series.from_csv('_foo') + self.assert_(series.name is None) + self.assert_(series.index.name is None) assert_series_equal(self.series, series) outfile = open('_foo', 'w')
BUG: return nameless Series and index from from_csv
pandas-dev_pandas
train
py,py
f8cb49130e100e91807962b5db53872c33019097
diff --git a/temperusb/cli.py b/temperusb/cli.py index <HASH>..<HASH> 100644 --- a/temperusb/cli.py +++ b/temperusb/cli.py @@ -24,8 +24,11 @@ def parse_args(): default='1') args = parser.parse_args() - args.sensor_ids = list(range(args.sensor_count)) if args.sensor_ids == 'all' \ - else [int(args.sensor_ids)] + if args.sensor_ids == 'all': + args.sensor_ids = range(args.sensor_count) + else: + args.sensor_ids = [int(args.sensor_ids)] + return args
Break-out inline conditional to multiple lines (more obvious)
padelt_temper-python
train
py
a5268cb89d1d2a0515052b7765b10ac2e523a0dd
diff --git a/lib/levels/nested.js b/lib/levels/nested.js index <HASH>..<HASH> 100644 --- a/lib/levels/nested.js +++ b/lib/levels/nested.js @@ -1,3 +1,5 @@ +'use strict'; + var INHERIT = require('inherit'), PATH = require('../path'), Level = require('../level').Level, diff --git a/lib/levels/project.js b/lib/levels/project.js index <HASH>..<HASH> 100644 --- a/lib/levels/project.js +++ b/lib/levels/project.js @@ -1,3 +1,5 @@ +'use strict'; + exports.baseLevelPath = require.resolve('./simple'); exports.getTypes = function() { diff --git a/lib/levels/simple.js b/lib/levels/simple.js index <HASH>..<HASH> 100644 --- a/lib/levels/simple.js +++ b/lib/levels/simple.js @@ -1,3 +1,5 @@ +'use strict'; + var INHERIT = require('inherit'), Level = require('../level').Level, U = require('../util'); @@ -114,7 +116,7 @@ exports.Level = INHERIT(Level, { block: block, suffix: suffix, tech: this.suffixToTech[suffix] - } + }; file = file.substring(0, dot);
Fix jshint errors in lib/levels/
bem-archive_bem-tools
train
js,js,js
009ede7b56a901f07c69c3613e540415f367f0aa
diff --git a/holoviews/streams.py b/holoviews/streams.py index <HASH>..<HASH> 100644 --- a/holoviews/streams.py +++ b/holoviews/streams.py @@ -314,7 +314,7 @@ class Selection1D(Stream): A stream representing a 1D selection of objects by their index. """ - index = param.List(default=[], doc=""" + index = param.List(default=[], constant=True, doc=""" Indices into a 1D datastructure.""")
Declared index parameter of Selection1D stream as constant
pyviz_holoviews
train
py
cfab34852103f5a6ed6c08e7146838de4de30e23
diff --git a/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java b/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java index <HASH>..<HASH> 100644 --- a/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java +++ b/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java @@ -20,6 +20,7 @@ import grails.util.Environment; import grails.util.GrailsNameUtils; import groovy.lang.Closure; +import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Map; @@ -52,7 +53,7 @@ import org.springframework.web.servlet.ModelAndView; * @since 2.0 */ @SuppressWarnings("rawtypes") -public class ControllersApi extends CommonWebApi { +public class ControllersApi extends CommonWebApi implements Serializable { private static final String RENDER_METHOD_NAME = "render"; private static final String BIND_DATA_METHOD = "bindData";
fix for GPWEBFLOW-<I> "putting a command object in flow scope causes NotSerializableException, even when command object is Serializable"
grails_grails-core
train
java
15eb069195f67978c70b219f87c95886201a0f3b
diff --git a/lib/fog/vcloud/compute.rb b/lib/fog/vcloud/compute.rb index <HASH>..<HASH> 100644 --- a/lib/fog/vcloud/compute.rb +++ b/lib/fog/vcloud/compute.rb @@ -300,7 +300,7 @@ module Fog # Use this to set the Authorization header for login def authorization_header - "Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}" + "Basic #{Base64.strict_encode64("#{@username}:#{@password}")}" end # Actually do the request
Use strict base encoding otherwise breaks for very large org names.
fog_fog
train
rb
9d2f3fbc27fe11d8dd2e7bc1b27249c7f8f007ee
diff --git a/lib/bson/ordered_hash.rb b/lib/bson/ordered_hash.rb index <HASH>..<HASH> 100644 --- a/lib/bson/ordered_hash.rb +++ b/lib/bson/ordered_hash.rb @@ -30,7 +30,7 @@ module BSON when BSON::OrderedHash keys == other.keys && values == other.values else - !other.nil? && keys.size == other.keys.size && keys.all? {|x| self[x] == other[x] } + super end rescue false
Call super in BSON::OrderedHash#== instead of doing the comparison in Ruby. This has a notable performance impact for large hashes.
mongodb_mongo-ruby-driver
train
rb
2ed35e287d7f8ba59d35e0edc503216146df2c18
diff --git a/Swat/SwatTextareaEditor.php b/Swat/SwatTextareaEditor.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTextareaEditor.php +++ b/Swat/SwatTextareaEditor.php @@ -18,9 +18,12 @@ require_once 'Swat/SwatYUI.php'; */ class SwatTextareaEditor extends SwatTextarea { + // {{{ class constants + const MODE_VISUAL = 1; const MODE_SOURCE = 2; + // }}} // {{{ public properties /** @@ -103,7 +106,7 @@ class SwatTextareaEditor extends SwatTextarea $value = htmlspecialchars($value); $div_tag = new SwatHtmlTag('div'); - $div_tag->class = 'swat-textarea-container'; + $div_tag->class = 'swat-textarea-editor-container'; $div_tag->open(); $textarea_tag = new SwatHtmlTag('textarea');
Add folding and use a separate container class name for visual editor container. svn commit r<I>
silverorange_swat
train
php
d25af75cbf7a9cc7c46a62ed6960a9005eba0af6
diff --git a/app/models/fae/option.rb b/app/models/fae/option.rb index <HASH>..<HASH> 100644 --- a/app/models/fae/option.rb +++ b/app/models/fae/option.rb @@ -18,7 +18,7 @@ module Fae def self.instance # there will be only one row, and its ID must be '1' begin - find(1) + first rescue ActiveRecord::RecordNotFound # slight race condition here, but it will only happen once row = Option.new({title: 'My FINE Admin'})
fixed Singleton instance check to accomidate the case where Option with the id of 1 is deleted.
wearefine_fae
train
rb
fc5910ffe770eca0f5faf16f4dad5cf9517e7e6f
diff --git a/lib/deliver/app_metadata_screenshots.rb b/lib/deliver/app_metadata_screenshots.rb index <HASH>..<HASH> 100644 --- a/lib/deliver/app_metadata_screenshots.rb +++ b/lib/deliver/app_metadata_screenshots.rb @@ -119,8 +119,12 @@ module Deliver self.clear_all_screenshots(language) Dir.glob(resulting_path, File::FNM_CASEFOLD).sort.each do |path| + # When frameit is enabled, we only want to upload the framed screenshots if use_framed - next unless path.include?"_framed." + # Except for Watch screenshots, they are okay without _framed + if AppScreenshot.new(path).screen_size != AppScreenshot::ScreenSize::IOS_APPLE_WATCH + next unless path.include?"_framed." + end else next if path.include?"_framed." end
Fixed not detecting Watch screenshots when frameit <I> is activated
fastlane_fastlane
train
rb
1e6ca70575e36766226cc7168cb93a360c2a48d3
diff --git a/troposphere/ec2.py b/troposphere/ec2.py index <HASH>..<HASH> 100644 --- a/troposphere/ec2.py +++ b/troposphere/ec2.py @@ -1308,10 +1308,12 @@ class ClientVpnEndpoint(AWSObject): 'ConnectionLogOptions': (ConnectionLogOptions, True), 'Description': (basestring, False), 'DnsServers': ([basestring], False), + 'SecurityGroupIds': ([basestring], False), 'ServerCertificateArn': (basestring, True), 'SplitTunnel': (boolean, False), 'TagSpecifications': ([TagSpecifications], False), 'TransportProtocol': (basestring, False), + 'VpcId': (basestring, False), 'VpnPort': (validate_clientvpnendpoint_vpnport, False), }
adding AWS::EC2::ClientVpnEndpoint properties, per March <I>, <I> update
cloudtools_troposphere
train
py
189c3de1ef7438e27153cdb0f4e6aeced6f8616f
diff --git a/moment.js b/moment.js index <HASH>..<HASH> 100644 --- a/moment.js +++ b/moment.js @@ -1059,7 +1059,7 @@ }, toJSON : function () { - return this.utc().format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + return moment(this).utc().format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); }, toArray : function () {
Fixed missing cloning of moment in toJSON method
moment_moment
train
js
7dd2d4c497fd17366ff689f3d8a7ef08e87b4fc4
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index <HASH>..<HASH> 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -297,6 +297,8 @@ support representative. return 6 elif pkgname[0] == "7": return 7 + elif pkgname[0] == "8": + return 8 except Exception: pass return False
[redhat] Update policy to identify RHEL 8 Now that RHEL 8 Beta is out, update the redhat policy dist_version to be able to properly set the version. Resolves: #<I>
sosreport_sos
train
py
f9f4f8e8c63956e5a73501500ae5c57625391b8d
diff --git a/tests/pychimeratest.py b/tests/pychimeratest.py index <HASH>..<HASH> 100644 --- a/tests/pychimeratest.py +++ b/tests/pychimeratest.py @@ -3,10 +3,11 @@ import os import sys +from glob import glob import pytest from pychimera import patch_environ, enable_chimera if __name__ == '__main__': patch_environ() enable_chimera() - pytest.main(sys.argv[1:]) \ No newline at end of file + pytest.main([a for arg in sys.argv[1:] for a in glob(arg)])
tests: windows cmd does not process wildcards so glob it in Python always
insilichem_pychimera
train
py
6b7fd29a344b1ddaa02ebd5319a3bb6877ed14e7
diff --git a/ui/src/components/img/QImg.js b/ui/src/components/img/QImg.js index <HASH>..<HASH> 100644 --- a/ui/src/components/img/QImg.js +++ b/ui/src/components/img/QImg.js @@ -64,6 +64,14 @@ export default Vue.extend({ url () { return this.currentSrc || this.placeholderSrc || void 0 + }, + + attrs () { + const att = { role: 'img' } + if (this.alt !== void 0) { + att['aria-label'] = this.alt + } + return att } }, @@ -221,10 +229,7 @@ export default Vue.extend({ render (h) { return h('div', { staticClass: 'q-img overflow-hidden', - attrs: this.alt !== void 0 ? { - role: 'img', - 'aria-label': this.alt - } : null, + attrs: this.attrs, on: this.$listeners }, [ h('div', {
fix(QImg): always render "role" attribute
quasarframework_quasar
train
js
7fe361ee06b2dc5ef06a574a57bd5a7c8227f14e
diff --git a/test/label.js b/test/label.js index <HASH>..<HASH> 100644 --- a/test/label.js +++ b/test/label.js @@ -147,4 +147,23 @@ describe('seraph#label', function() { done(); }); }); + + it('should delete a label from a node', function(done) { + var label = uniqn(); + db.save({ name: 'Jon' }, function(err, node) { + assert(!err); + assert(node.id); + db.label(node, label, function(err) { + assert(!err, err); + db.removeLabel(node, label, function(err) { + assert(!err); + db.nodesWithLabel(label, function(err, results) { + assert(!err); + assert(results.length == 0); + done(); + }); + }); + }); + }); + }); });
labels: added test for removing a label from a node
brikteknologier_seraph
train
js
e114e060285556e9927c78bbc96229b5beac4054
diff --git a/empire/pkg/awsutil/awsutil.go b/empire/pkg/awsutil/awsutil.go index <HASH>..<HASH> 100644 --- a/empire/pkg/awsutil/awsutil.go +++ b/empire/pkg/awsutil/awsutil.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "strings" ) @@ -17,7 +18,7 @@ type Request struct { func (r *Request) String() string { body, err := formatJSON(strings.NewReader(r.Body)) if err != nil { - panic(err) + body = r.Body } return fmt.Sprintf("Operation: %s\nBody: %s", r.Operation, body) } @@ -47,11 +48,16 @@ func NewHandler(m map[Request]Response) *Handler { } func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - body, err := formatJSON(r.Body) + raw, err := ioutil.ReadAll(r.Body) if err != nil { panic(err) } + body, err := formatJSON(r.Body) + if err != nil { + body = string(raw) + } + match := Request{ Operation: r.Header.Get("X-Amz-Target"), Body: body,
Allow awsutil.Handler to fallback to raw io unable to json parse
remind101_empire
train
go
9785349d702c5173cc80591b8461758635fb9b72
diff --git a/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php b/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php index <HASH>..<HASH> 100644 --- a/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php +++ b/tests/ProxyManagerTest/Functional/FatalPreventionFunctionalTest.php @@ -48,7 +48,7 @@ echo 'SUCCESS: ' . %s; PHP; /** - * Verifies that lazy loading ghost will work with all given classes + * Verifies that lazy loading ghost creation will work with all given classes * * @param string $className a valid (existing/autoloadable) class name *
Minor docblock fixes/clarifications
Ocramius_ProxyManager
train
php
3abe2b78699b9c31c9442ed1202c8a5dc1a0041d
diff --git a/lib/Seafile/Resource/Directory.class.php b/lib/Seafile/Resource/Directory.class.php index <HASH>..<HASH> 100644 --- a/lib/Seafile/Resource/Directory.class.php +++ b/lib/Seafile/Resource/Directory.class.php @@ -131,4 +131,30 @@ class Directory extends AbstractResource return $response->getStatusCode() === 201; } + + /** + * Remove a directory + * + * @param LibraryType $library Library instance + * @param String $directoryPath Directory path + * @return bool + */ + public function rmdir(LibraryType $library, $directoryPath) { + $uri = sprintf( + '%s/repos/%s/dir/?p=%s', + $this->clipUri($this->client->getConfig('base_uri')), + $library->id, + rtrim($directoryPath, '/') + ); + + $response = $this->client->request( + 'DELETE', + $uri, + [ + 'headers' => ['Accept' => 'application/json'], + ] + ); + + return $response->getStatusCode() === 200; + } }
Added rmdir function to remove directories.
rene-s_Seafile-PHP-SDK
train
php
7bf5fb07ad8ab1c6202614283b59ccf4e8ec37d2
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index <HASH>..<HASH> 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -17,6 +17,7 @@ module ActionMailer #:nodoc: # class Notifier < ActionMailer::Base # def signup_notification(recipient) # recipients recipient.email_address_with_name + # bcc ["[email protected]", "Order Watcher <[email protected]>"] # from "[email protected]" # subject "New account information" # body :account => recipient
ActionMailer::Base - add example of multiple recipients and make the format of addresses obvious
rails_rails
train
rb
5b66b14214798910b96e87c280ed6c2ad04bcdba
diff --git a/cert/lib/cert/version.rb b/cert/lib/cert/version.rb index <HASH>..<HASH> 100644 --- a/cert/lib/cert/version.rb +++ b/cert/lib/cert/version.rb @@ -1,3 +1,3 @@ module Cert - VERSION = "1.4.4" + VERSION = "1.4.5" end
[cert] Version bump to <I> (#<I>)
fastlane_fastlane
train
rb
2c2116193d829e7dafc471fdb41e435b0f602801
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -159,7 +159,8 @@ setup( 'Sphinx<=1.6.7', 'nbsphinx', 'numpydoc', - 'recommonmark' + 'recommonmark', + 'seaborn' ]}, python_requires='>=2.7',
adding seaborn as extra 'dev' dependency (since examples are used in docs). Fixes #<I>
econ-ark_HARK
train
py
a941c4869a081151c051c05ec8e64c1fb4c438a7
diff --git a/machina/apps/feeds/feeds.py b/machina/apps/feeds/feeds.py index <HASH>..<HASH> 100644 --- a/machina/apps/feeds/feeds.py +++ b/machina/apps/feeds/feeds.py @@ -43,7 +43,7 @@ class LastTopicsFeed(Feed): Forum.objects.all(), request.user) def items(self): - return Topic.objects.filter(forum__in=self.forums).order_by('-updated') + return Topic.objects.filter(forum__in=self.forums, approved=True).order_by('-updated') def item_pubdate(self, item): return item.created
Topics feed updated to not embed non-approved topics
ellmetha_django-machina
train
py
2259474f2a35a3fec1e224720b1edb63b3692e96
diff --git a/pypsa/io.py b/pypsa/io.py index <HASH>..<HASH> 100644 --- a/pypsa/io.py +++ b/pypsa/io.py @@ -597,10 +597,11 @@ def _import_from_importer(network, importer, basename, skip_time=False): ##https://docs.python.org/3/tutorial/datastructures.html#comparing-sequences-and-other-types if pypsa_version is None or pypsa_version < current_pypsa_version: logger.warning(dedent(""" - Importing PyPSA from older version of PyPSA than current version {}. + Importing PyPSA from older version of PyPSA than current version. Please read the release notes at https://pypsa.org/doc/release_notes.html - carefully to prepare your network for import. - """).format(network.pypsa_version)) + carefully to prepare your network for import. + Currently used PyPSA version {}, imported network file PyPSA version {}. + """).format(current_pypsa_version, pypsa_version)) importer.pypsa_version = pypsa_version importer.current_pypsa_version = current_pypsa_version
Include both current and imported network file PyPSA version for convenience. (#<I>)
PyPSA_PyPSA
train
py
53ee8f569a703138344d29351e5387490850374a
diff --git a/classes/Routing/RoutingProvider.php b/classes/Routing/RoutingProvider.php index <HASH>..<HASH> 100644 --- a/classes/Routing/RoutingProvider.php +++ b/classes/Routing/RoutingProvider.php @@ -33,7 +33,8 @@ class RoutingProvider extends AbstractProvider ? $container->resolve($eventDispatcher) : null; $config = $this->app->getConfig(); - $cachePath = $config ? $config->get('path.route_cache') : null; + $cachePath = ($config && !$config->get('app.debug')) ? + $config->get('path.route_cache') : null; return new Router( $container->resolve('Autarky\Routing\Invoker'),
don't cache routes if app.debug is true
autarky_framework
train
php
f558a399b84a1cb47fd9a4b91e257c87621b3be2
diff --git a/lib/qipowl/core/bowler.rb b/lib/qipowl/core/bowler.rb index <HASH>..<HASH> 100644 --- a/lib/qipowl/core/bowler.rb +++ b/lib/qipowl/core/bowler.rb @@ -119,6 +119,7 @@ module Qipowl::Bowlers curr_sect.delete key self.class.const_get("ENCLOSURES_TAGS").delete key + self.class.const_get("ENTITIES")[section.to_sym].delete key self.class.class_eval %Q{ remove_method :#{key.bowl}
Weird bug in previous commit(s): entity removal now works.
mudasobwa_qipowl
train
rb
e54c61e8529f3f5d84ae888a6d3e7d49862d7098
diff --git a/lib/heroku/command/buildpacks.rb b/lib/heroku/command/buildpacks.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/command/buildpacks.rb +++ b/lib/heroku/command/buildpacks.rb @@ -25,7 +25,7 @@ module Heroku::Command display("#{app} has no Buildpack URL set.") else styled_header("#{app} Buildpack URL#{app_buildpacks.size > 1 ? 's' : ''}") - display_buildpacks(app_buildpacks.map{|bp| bp["buildpack"]["url"]}) + display_buildpacks(app_buildpacks.map{|bp| bp["buildpack"]["url"]}, "") end end @@ -193,12 +193,12 @@ module Heroku::Command display_buildpack_change(buildpack_urls, action) end - def display_buildpacks(buildpacks) + def display_buildpacks(buildpacks, indent=" ") if (buildpacks.size == 1) display(buildpacks.first) else buildpacks.each_with_index do |bp, i| - display(" #{i+1}. #{bp}") + display("#{indent}#{i+1}. #{bp}") end end end
Improved indentation of buildpacks output
heroku_legacy-cli
train
rb
bc797bda6bc8b5116203314b1acc5455e9e5aa1a
diff --git a/mod/jodd-wot/src/jodd/lagarto/adapter/htmlstapler/HtmlStaplerBundlesManager.java b/mod/jodd-wot/src/jodd/lagarto/adapter/htmlstapler/HtmlStaplerBundlesManager.java index <HASH>..<HASH> 100644 --- a/mod/jodd-wot/src/jodd/lagarto/adapter/htmlstapler/HtmlStaplerBundlesManager.java +++ b/mod/jodd-wot/src/jodd/lagarto/adapter/htmlstapler/HtmlStaplerBundlesManager.java @@ -373,6 +373,13 @@ public class HtmlStaplerBundlesManager { } else { localFile += FileNameUtil.getPath(actionPath) + '/' + src; } + + // trim link parameters, if any + int qmndx = localFile.indexOf('?'); + if (qmndx != -1) { + localFile = localFile.substring(0, qmndx); + } + content = FileUtil.readString(localFile); } else { // download local resource
fixing bug when local resource file has parameters
oblac_jodd
train
java
e4be08a955c393516ffe0f47ca09cc8233d98108
diff --git a/lib/Importer.js b/lib/Importer.js index <HASH>..<HASH> 100644 --- a/lib/Importer.js +++ b/lib/Importer.js @@ -349,19 +349,21 @@ class Importer { ].join(' '); const command = `${findCommand} | ${egrepCommand}`; - // TODO switch from spawnSync to spawn so we can start processing the - // stream as it comes in. - const child = childProcess.spawnSync(command); - - if (child.error) { - throw child.error; + // TODO switch to spawn so we can start processing the stream as it comes + // in. + let out = ''; + let err = ''; + try { + out = String(childProcess.execSync(command)); + } catch (error) { + err = String(error.stderr); } - if (child.stderr) { - throw new Error(child.stderr); + if (err !== '') { + throw new Error(err); } - child.output.forEach((f) => { + out.split('\n').forEach((f) => { // TODO: it looks like we process empty strings here too (f === '') if (this.config.get('excludes').some( (globPattern) => minimatch(f, globPattern))) {
Temporarily switch to execSync when finding files spawnSync was failing with a ENOENT error every time. I didn't have time to dig in to this, so I'm just switching to execSync that I know works in the meantime.
Galooshi_import-js
train
js
0c3b35da42777c7bdfe6be5f0d084ce40a4c1d15
diff --git a/src/js/pannellum.js b/src/js/pannellum.js index <HASH>..<HASH> 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -2051,7 +2051,7 @@ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) { if (workingHfov !== undefined) { config.hfov = workingHfov; } - fireEvent('scenechange'); + fireEvent('scenechange', sceneId); load(); }
Send the sceneId to 'scenechange' event
mpetroff_pannellum
train
js
2e4ae9fcfb572bb8f94932d45cb40468fc00d478
diff --git a/interfaces/Stringable.php b/interfaces/Stringable.php index <HASH>..<HASH> 100644 --- a/interfaces/Stringable.php +++ b/interfaces/Stringable.php @@ -10,7 +10,8 @@ * but not necessarily the format of the string. * * The preferred method to use is the explicit {@see self::toString()}. Implementations should alias the implicit, - * magic method to its explicit counterpart, so that overriding only requires the modification of one method. + * magic method to its explicit counterpart, so that overriding only requires the modification of one method, but + * should wrap the call in a try/catch block to ensure conformity with PHP's standard handling of __toString(). * * @package Nyx\Core * @version 0.1.0 @@ -23,12 +24,16 @@ interface Stringable /** * Returns the string representation of the object. * + * Note: This method MAY throw exceptions. + * * @return string */ public function toString() : string; /** * {@see self::toString()} + * + * Note: This method MUST NOT throw exceptions, opposite to the explicit self::toString() method. */ public function __toString() : string; }
[Core] Stringable: Implicit __toString() must not throw exceptions, while the explicit toString() may throw them.
unyx_core
train
php
b5609cd9ca7dc2910e24df915537a60c51509028
diff --git a/lib/smart_paginate/version.rb b/lib/smart_paginate/version.rb index <HASH>..<HASH> 100644 --- a/lib/smart_paginate/version.rb +++ b/lib/smart_paginate/version.rb @@ -1,3 +1,3 @@ module SmartPaginate - VERSION = "0.2.1".freeze + VERSION = "0.2.2".freeze end
Update version to <I>.
ppostma_smart_paginate
train
rb
18e5a088eecf371bf06c7ff61e08cafcccbd7d27
diff --git a/tests/test_ls.py b/tests/test_ls.py index <HASH>..<HASH> 100644 --- a/tests/test_ls.py +++ b/tests/test_ls.py @@ -1,4 +1,5 @@ from pathlib import Path +import re from pew._utils import invoke_pew as invoke @@ -17,7 +18,7 @@ def test_get_site_packages_dir(workon_home): def test_lssitepackages(workon_home): invoke('new', 'env', '-d') pkgs = invoke('in', 'env', 'pew', 'lssitepackages').out - assert 'easy_install' in pkgs + assert re.search(r'setuptools-((\d+\.)+)dist-info', pkgs) invoke('rm', 'env')
Replace easy_install with setuptools in test_lssitepackages The easy_install top-level model and the easy_install console script have been removed in setuptools <I>+: <URL>
berdario_pew
train
py
f50f9cb2785c3a1076a35c1fc5986417d4075406
diff --git a/plugins/database/cassandra/cassandra_test.go b/plugins/database/cassandra/cassandra_test.go index <HASH>..<HASH> 100644 --- a/plugins/database/cassandra/cassandra_test.go +++ b/plugins/database/cassandra/cassandra_test.go @@ -253,6 +253,9 @@ func TestCassandra_RevokeUser(t *testing.T) { } func TestCassandra_RotateRootCredentials(t *testing.T) { + if os.Getenv("TRAVIS") != "true" { + t.SkipNow() + } cleanup, address, port := prepareCassandraTestContainer(t) defer cleanup()
only run cassandra RotateRootCred test when in Travis (#<I>)
hashicorp_vault
train
go
69d18539fb4f394ca45d1116a521084c83ea21b5
diff --git a/icekit_events/migrations/0012_auto_20160706_1606.py b/icekit_events/migrations/0012_auto_20160706_1606.py index <HASH>..<HASH> 100644 --- a/icekit_events/migrations/0012_auto_20160706_1606.py +++ b/icekit_events/migrations/0012_auto_20160706_1606.py @@ -24,6 +24,6 @@ class Migration(migrations.Migration): # No-op: I haven't yet found a way to make this reversible in the # way you would expect without unique constraint DB errors, whereas # it works (according to unit tests at least) with a no-op. - "", + "UPDATE django_content_type SET app_label=app_label WHERE app_label='NONE!'", ), ]
Make migration reverse no-op a valid SQL query When using a PostgreSQL database with Django <I> empty reverse query statements in DB migrations cause an error, so we replace the empty no-op statement with a valid query that still does nothing so the reverse migration will work in this case. This problem doesn't seem to affect Django <I>, which must be smarter about accepted but not actually running empty statements in DB migrations.
ic-labs_django-icekit
train
py
98406fbe52f6f2998d17b1096ef8f28e982b1521
diff --git a/src/store.js b/src/store.js index <HASH>..<HASH> 100644 --- a/src/store.js +++ b/src/store.js @@ -53,6 +53,8 @@ export class Store { this._highlightPreTag = '<em>'; this._highlightPostTag = '</em>'; + this._cacheEnabled = true; + this.algoliaHelper = helper; } @@ -355,11 +357,25 @@ export class Store { }; } - // Todo: find a better name for this function. refresh() { + if (this._cacheEnabled === false) { + this.clearCache(); + } this._helper.search(); } + enableCache() { + this._cacheEnabled = true; + } + + disableCache() { + this._cacheEnabled = false; + } + + clearCache() { + this.algoliaClient.clearCache(); + } + waitUntilInSync() { return new Promise((resolve, reject) => { if (this._helper.hasPendingRequests() === false) {
feat(store): add methods to interact with cache Closes: #<I>
algolia_vue-instantsearch
train
js
aae06c476a8362a632ec400f8fd817e7a2192f71
diff --git a/output/recorder.go b/output/recorder.go index <HASH>..<HASH> 100644 --- a/output/recorder.go +++ b/output/recorder.go @@ -172,7 +172,7 @@ func (r *Recorder) doSave(msg *models.Message) { } } -func (r *Recorder) close(msg *models.Message) error { +func (r *Recorder) close() { r.session.Close() r.session = nil r.collection = nil
trying harder to get more stability in recorder
cswank_gogadgets
train
go
b776411b50b805737e874575172c87937169fb14
diff --git a/bin/release.py b/bin/release.py index <HASH>..<HASH> 100755 --- a/bin/release.py +++ b/bin/release.py @@ -374,6 +374,7 @@ def release(): # Step 2: Update version in tagged files prettyprint("Step 2: Updating version number in source files", Levels.INFO) + maven_clean() update_versions(version) prettyprint("Step 2: Complete", Levels.INFO) diff --git a/bin/utils.py b/bin/utils.py index <HASH>..<HASH> 100755 --- a/bin/utils.py +++ b/bin/utils.py @@ -392,6 +392,11 @@ class DryRunUploader(DryRun): def upload(self, fr, to, type): self.copy(fr, "%s/%s/%s" % (self.location_root, type, to)) +def maven_clean(): + """Cleans the distribution in the current working dir""" + mvn_command = ["mvn","-Passembly","clean"] + subprocess.check_call(mvn_command) + def maven_build_distribution(version): """Builds the distribution in the current working dir""" mvn_commands = [["clean", "install", "-Passembly"],["deploy","-Passembly","-DskipTests"]]
Updated build to clean before changing the POMs
ModeShape_modeshape
train
py,py
103798878752a45a337413ce0b8f42961583f34c
diff --git a/admin/index.php b/admin/index.php index <HASH>..<HASH> 100644 --- a/admin/index.php +++ b/admin/index.php @@ -52,6 +52,13 @@ error("The PHP server variable 'file_uploads' is not turned On - $documentationlink"); } + if (empty($CFG->prefix) && $CFG->dbtype != 'mysql') { //Enforce prefixes for everybody but mysql + error('$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')'); + } + + if ($CFG->dbtype == 'oci8po' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc + error('$CFG->prefix maximum allowed length for Oracle DBs is 2cc.'); + } /// Check that config.php has been edited
Now admin/index.php checks for proper prefixes (MDL-<I>) Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
a64914de4c41473c4bfecec1c69cfc931ccb6281
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -75,10 +75,11 @@ module ActionDispatch def build_host_url(options) protocol = options[:protocol] host = options[:host] + port = options[:port] if match = host.match(HOST_REGEXP) protocol ||= match[1] unless protocol == false host = match[2] - options[:port] = match[3] unless options.key?(:port) + port = match[3] unless options.key? :port end protocol = normalize_protocol protocol @@ -91,7 +92,7 @@ module ActionDispatch end result << host - normalize_port(options[:port], protocol) { |port| + normalize_port(port, protocol) { |port| result << ":#{port}" }
pull the port out of the options hash once
rails_rails
train
rb
38b88e3936773a638baaf4faa0c2e6f6c35ea54e
diff --git a/src/Expose/Filter.php b/src/Expose/Filter.php index <HASH>..<HASH> 100644 --- a/src/Expose/Filter.php +++ b/src/Expose/Filter.php @@ -26,7 +26,7 @@ class Filter * Filter tag set * @var array */ - private $tags = null; + private $tags = array(); /** * Filter impact rating @@ -58,8 +58,9 @@ class Filter } foreach ($data as $index => $value) { if ($index == 'tags' && !is_array($value)) { - // normalize to an array - $value->tag = (!is_array($value->tag)) ? array($value->tag) : $value->tag; + if (isset($value->tag)) { + $value = (!is_array($value->tag)) ? array($value->tag) : $value->tag; + } } $this->$index = $value; } @@ -94,7 +95,7 @@ class Filter */ public function getTags() { - return (isset($this->tags->tag)) ? $this->tags->tag : array(); + return (isset($this->tags)) ? $this->tags : array(); } /** @@ -105,10 +106,7 @@ class Filter */ public function setTags($tags) { - if (!isset($this->tags)) { - $this->tags = new \stdClass(); - } - $this->tags->tag = $tags; + $this->tags = $tags; return $this; }
fixing the "tags" value to no longer use the weird object stuff
enygma_expose
train
php
c8eab0c3d64688d7c068904dd6a5cdab06ebabf5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -4,9 +4,20 @@ from setuptools import setup # type: ignore __version__ = "1.1.3" + +def get_long_description(): + """ + Return the README. + """ + with open("README.md", encoding="utf8") as f: + return f.read() + + setup( name="cowpy", description="A cowsay clone for python in one file.", + long_description=get_long_description(), + long_description_content_type="text/markdown", author="Jeff Buttars", author_email="[email protected]", url="https://github.com/jeffbuttars/cowpy",
Add long description to setup.py
jeffbuttars_cowpy
train
py
fef91767a6e77ce5762067ea0436e3ad798edbc9
diff --git a/src/bezier/_geometric_intersection.py b/src/bezier/_geometric_intersection.py index <HASH>..<HASH> 100644 --- a/src/bezier/_geometric_intersection.py +++ b/src/bezier/_geometric_intersection.py @@ -27,6 +27,7 @@ or the speedup. """ +import atexit import itertools import numpy as np @@ -1199,4 +1200,6 @@ else: _curve_intersection_speedup.from_linearized_low_level) bbox_line_intersect = _curve_intersection_speedup.bbox_line_intersect all_intersections = _all_intersections_cython + atexit.register( + _curve_intersection_speedup.free_all_intersections_workspace) # pylint: enable=invalid-name
Adding `atexit` hook for `free_all_intersections_workspace()`.
dhermes_bezier
train
py
b6590f6a046a1a8fd4e1068dc511a4db29430c36
diff --git a/Tests/Functional/Entity/User.php b/Tests/Functional/Entity/User.php index <HASH>..<HASH> 100644 --- a/Tests/Functional/Entity/User.php +++ b/Tests/Functional/Entity/User.php @@ -72,11 +72,16 @@ class User implements UserInterface $this->email = $email; } + public function getUserIdentifier(): string + { + return $this->getUsername(); + } + public function eraseCredentials() { } - public function getRoles() + public function getRoles(): array { return []; }
Update User class to support UserInterface
hackzilla_TicketBundle
train
php
6fd0f1136f89ff1172c532a4acbdf5790600ce00
diff --git a/lib/cloudstack-cli/commands/volume.rb b/lib/cloudstack-cli/commands/volume.rb index <HASH>..<HASH> 100644 --- a/lib/cloudstack-cli/commands/volume.rb +++ b/lib/cloudstack-cli/commands/volume.rb @@ -82,15 +82,25 @@ class Volume < CloudstackCli::Base end say "Creating volume #{name} " - client.create_volume(options) + job = client.create_volume(options).merge(sync: true) say " OK.", :green - sleep 2 - invoke "volume:show", [name], options + + # attach the new volume if a vm is profided and not a sapshot + if options[:virtual_machine] && options[:snapshot] == nil + sleep 2 + say "Attach volume #{name} to VM #{options[:virtual_machine]} " + client.attach_volume( + id: job['volume']['id'], + virtualmachineid: options[:virtual_machine_id], + sync: true + ) + say " OK.", :green + end end desc "attach NAME", "attach volume to VM" option :project, desc: 'project of volume' - option :virtual_machine, desc: 'project of volume' + option :virtual_machine, desc: 'virtual machine of volume' def attach(name) resolve_project resolve_virtual_machine
attach volume after creation if vm instance is provided
niwo_cloudstack-cli
train
rb
ffaa1743cbbb0460130a232cfec3bb427f27a8e7
diff --git a/pyemma/_base/progress/reporter.py b/pyemma/_base/progress/reporter.py index <HASH>..<HASH> 100644 --- a/pyemma/_base/progress/reporter.py +++ b/pyemma/_base/progress/reporter.py @@ -205,3 +205,7 @@ class ProgressReporter(object): pg._eta.eta_epoch = 0 _show_progressbar(pg, description=self._prog_rep_descriptions[stage]) _hide_progressbar(pg) + + # unpickleable + def __getstate__(self): + return {}
[progress repoter] do not save state
markovmodel_PyEMMA
train
py
610cf9da96726605f6bef7f276bcd7a97f4939e7
diff --git a/actionpack/test/controller/spec_type_test.rb b/actionpack/test/controller/spec_type_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/spec_type_test.rb +++ b/actionpack/test/controller/spec_type_test.rb @@ -3,7 +3,7 @@ require "abstract_unit" class ApplicationController < ActionController::Base; end class ModelsController < ApplicationController; end -class SpecTypeTest < ActiveSupport::TestCase +class ActionControllerSpecTypeTest < ActiveSupport::TestCase def assert_controller actual assert_equal ActionController::TestCase, actual end diff --git a/actionpack/test/template/spec_type_test.rb b/actionpack/test/template/spec_type_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/template/spec_type_test.rb +++ b/actionpack/test/template/spec_type_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' -class SpecTypeTest < ActiveSupport::TestCase +class ActionViewSpecTypeTest < ActiveSupport::TestCase def assert_view actual assert_equal ActionView::TestCase, actual end
remove method redefinition warnings actionpack/test/template/spec_type_test.rb:<I>: warning: method redefined; discarding old test_spec_type_wont_match_non_space_characters actionpack/test/controller/spec_type_test.rb:<I>: warning: previous definition of test_spec_type_wont_match_non_space_characters was here
rails_rails
train
rb,rb
c3aa0dfe9f541954bd748cf42fd203f009048e7d
diff --git a/packages/zefir/lib/router/define-match.js b/packages/zefir/lib/router/define-match.js index <HASH>..<HASH> 100644 --- a/packages/zefir/lib/router/define-match.js +++ b/packages/zefir/lib/router/define-match.js @@ -2,18 +2,21 @@ import React from 'react' import {Redirect, Route} from 'react-router-dom' import connect from '../utils/connect' -const defineMatch = (shouldRender, redirectTo) => { +const defineMatch = (shouldRender) => { const DefinedMatch = ({ component, + exact, + path, ...rest }) => ( <Route - {...rest} + path={path} + exact={exact} render={props => ( shouldRender(rest) ? renderComponent(component, props) : rest.redirect - ? renderRedirect(redirectTo, props.location) + ? renderRedirect(rest.redirect, props.location) : null )} /> @@ -28,7 +31,7 @@ function renderRedirect (pathname, from) { ) } -function renderComponent (component, props) { +function renderComponent (component, {history, location, match, ...props}) { const Component = connect(component) return (
refactor(router): clean up props
eyedea-io_zefir
train
js
ecb0a68afe1b872a8e2639cfe4d3294005056e0b
diff --git a/ipmitool_test.go b/ipmitool_test.go index <HASH>..<HASH> 100644 --- a/ipmitool_test.go +++ b/ipmitool_test.go @@ -58,7 +58,7 @@ func newToolMock(output string, rc int) *toolMock { panic(err) } // just enough to test exec related code paths - file.WriteString("#!/bin/bash\n") + file.WriteString("#!/usr/bin/env bash\n") file.WriteString(fmt.Sprintf("echo -n '%s'\n", output)) if rc != 0 { file.WriteString("echo 'Mock Failure' 1>&2\n")
Make ipmitool_test.go work on NixOS
vmware_goipmi
train
go
9f60b950c3d2a254d2eb431bc8609f326f42e80d
diff --git a/lib/Sabre/DAV/Property/ResponseList.php b/lib/Sabre/DAV/Property/ResponseList.php index <HASH>..<HASH> 100644 --- a/lib/Sabre/DAV/Property/ResponseList.php +++ b/lib/Sabre/DAV/Property/ResponseList.php @@ -115,8 +115,10 @@ class ResponseList extends DAV\Property { list(,$statusCode,) = explode(' ', $status, 3); + $usedPropertyMap = $statusCode == '200' ? $propertyMap : []; + // Parsing 'prop' - $properties[$statusCode] = DAV\XMLUtil::parseProperties($xPropstat->item($ii), $propertyMap); + $properties[$statusCode] = DAV\XMLUtil::parseProperties($xPropstat->item($ii), $usedPropertyMap); }
Applied change for Issue #<I> on master branch.
sabre-io_dav
train
php
ee3bfa82bb8ab018ab864aeb38df0a0245771797
diff --git a/src/main/java/org/dasein/cloud/aws/platform/RDS.java b/src/main/java/org/dasein/cloud/aws/platform/RDS.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dasein/cloud/aws/platform/RDS.java +++ b/src/main/java/org/dasein/cloud/aws/platform/RDS.java @@ -1674,6 +1674,8 @@ public class RDS extends AbstractRelationalDatabaseSupport<AWSCloud> { try { for( String securityGroupId : securityGroups ) { if( securityGroupId.equals(providerDatabaseId) ) { + try { Thread.sleep(15000L); } + catch( InterruptedException ignore ) { } try { removeSecurityGroup(securityGroupId); }
FB#<I> – Removing database firewalls
dasein-cloud_dasein-cloud-aws
train
java
39b5c534abb1ae3b6903345f15a1eafafb8c6dca
diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index <HASH>..<HASH> 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -453,8 +453,18 @@ func selectDriver(existing *config.ClusterConfig) registry.DriverState { } // Default to looking at the new driver parameter - if viper.GetString("driver") != "" { - ds := driver.Status(viper.GetString("driver")) + if d := viper.GetString("driver"); d != "" { + if vmd := viper.GetString("vm-driver"); vmd != "" { + // Output a warning + warning := `Both driver={{.driver}} and vm-driver={{.vmd}} have been set. + + Since vm-driver is deprecated, minikube will default to driver={{.driver}}. + + If vm-driver is set in the global config, please run "minikube config unset vm-driver" to resolve this warning. + ` + out.T(out.Warning, warning, out.V{"driver": d, "vmd": vmd}) + } + ds := driver.Status(d) out.T(out.Sparkle, `Using the {{.driver}} driver based on user configuration`, out.V{"driver": ds.String()}) return ds }
Add warning if both vm-driver and driver are specified
kubernetes_minikube
train
go
1b2e201d7f77a8e4b1f992e20494e3a2b991f0ba
diff --git a/TYPO3.Flow/Classes/TYPO3/Flow/Cache/Backend/RedisBackend.php b/TYPO3.Flow/Classes/TYPO3/Flow/Cache/Backend/RedisBackend.php index <HASH>..<HASH> 100644 --- a/TYPO3.Flow/Classes/TYPO3/Flow/Cache/Backend/RedisBackend.php +++ b/TYPO3.Flow/Classes/TYPO3/Flow/Cache/Backend/RedisBackend.php @@ -147,7 +147,9 @@ class RedisBackend extends AbstractBackend implements TaggableBackendInterface, */ public function has($entryIdentifier) { - return $this->redis->exists($this->buildKey('entry:' . $entryIdentifier)); + // exists returned TRUE or FALSE in phpredis versions < 4.0.0, now it returns the number of keys + $existsResult = $this->redis->exists($this->buildKey('entry:' . $entryIdentifier)); + return $existsResult === true || $existsResult > 0; } /**
BUGFIX: Adjust has() to phpredis >= <I> The `exists()` method returned TRUE or FALSE in phpredis versions < <I>, now it returns the number of keys tested that do exist.
neos_flow-development-collection
train
php
376ebef91b14dfb1bd403f3ae4032acda568b517
diff --git a/code/formfields/EventInvitationField.php b/code/formfields/EventInvitationField.php index <HASH>..<HASH> 100644 --- a/code/formfields/EventInvitationField.php +++ b/code/formfields/EventInvitationField.php @@ -216,6 +216,8 @@ class EventInvitationField extends FormField { ); } + Requirements::clear(); + $response = new SS_HTTPResponse(Convert::array2json($result)); $response->addHeader('Content-Type', 'application/json'); return $response; @@ -239,6 +241,8 @@ class EventInvitationField extends FormField { ); } + Requirements::clear(); + $response = new SS_HTTPResponse(Convert::array2json($result)); $response->addHeader('Content-Type', 'application/json'); return $response;
bugfix - ajax request to loadfromtime() and loadfromgroup() was getting Requirements js which breaks the invitations popup when in livemode
registripe_registripe-core
train
php
6736b3b32de38404447a4839b305dc6b6f7c0d2c
diff --git a/tests/test_bulk.py b/tests/test_bulk.py index <HASH>..<HASH> 100644 --- a/tests/test_bulk.py +++ b/tests/test_bulk.py @@ -16,27 +16,6 @@ class LocalizedBulkTestCase(TestCase): @staticmethod def test_localized_bulk_insert(): - """Tests that bulk inserts work properly when using - a :see:LocalizedField in the model.""" - - model = get_fake_model( - 'BulkInsertModel', - { - 'name': LocalizedField(), - 'score': models.IntegerField() - } - ) - - objects = model.objects.bulk_create([ - model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), - model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), - model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) - ]) - - assert model.objects.all().count() == 3 - - @staticmethod - def test_localized_slug_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model."""
Simplify test case for bulk_create
SectorLabs_django-localized-fields
train
py
de478b90392cb7fbb4bdb0aeff6f94d61847531a
diff --git a/src/ExceptionHandler.php b/src/ExceptionHandler.php index <HASH>..<HASH> 100644 --- a/src/ExceptionHandler.php +++ b/src/ExceptionHandler.php @@ -26,6 +26,20 @@ class ExceptionHandler extends Handler use ExceptionHandlerTrait; /** + * The exception config. + * + * @var array + */ + protected $config; + + /** + * The container instance. + * + * @var \Illuminate\Contracts\Container\Container + */ + protected $container; + + /** * A list of the exception types that should not be reported. * * @var string[]
Added the needed properties to the L5 handler
GrahamCampbell_Laravel-Exceptions
train
php
da107a99fcacf1a56605b2332d49eb5507630b75
diff --git a/TYPO3.Flow/Classes/Core/Bootstrap.php b/TYPO3.Flow/Classes/Core/Bootstrap.php index <HASH>..<HASH> 100644 --- a/TYPO3.Flow/Classes/Core/Bootstrap.php +++ b/TYPO3.Flow/Classes/Core/Bootstrap.php @@ -191,7 +191,7 @@ final class Bootstrap { $this->initializeObjectManager(); $this->initializeSystemLogger(); - $this->initializeLockManager(); +# $this->initializeLockManager(); if ($this->siteLocked === TRUE) return; $this->initializePackages();
[-FEATURE] FLOW3 (Core): For now disabled the Lock Manager which caused too much hassle for the developers in Development context. Will enable it again once it is more mature. Original-Commit-Hash: e9a0f4de<I>a7a<I>c<I>d<I>f<I>e<I>fc0d
neos_flow-development-collection
train
php
73e6ba84899eff92e8393bac0e5491a7ecf1c9f7
diff --git a/packages/core/lib/segments/attributes/aws.js b/packages/core/lib/segments/attributes/aws.js index <HASH>..<HASH> 100644 --- a/packages/core/lib/segments/attributes/aws.js +++ b/packages/core/lib/segments/attributes/aws.js @@ -31,7 +31,7 @@ Aws.prototype.init = function init(res, serviceName) { this.id_2 = res.extendedRequestId; } - this.addData(capturer.capture(serviceName, res)); + this.addData(capturer.capture(serviceName.toLowerCase(), res)); }; Aws.prototype.addData = function addData(data) {
Translate service name to lower case (#<I>)
aws_aws-xray-sdk-node
train
js
da5f181c7e9c21e5a370e880f1a32d0a18c0b824
diff --git a/src/main/java/com/ecwid/consul/v1/catalog/model/CatalogRegistration.java b/src/main/java/com/ecwid/consul/v1/catalog/model/CatalogRegistration.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/ecwid/consul/v1/catalog/model/CatalogRegistration.java +++ b/src/main/java/com/ecwid/consul/v1/catalog/model/CatalogRegistration.java @@ -203,6 +203,9 @@ public class CatalogRegistration { @SerializedName("NodeMeta") private Map<String, String> nodeMeta; + @SerializedName("SkipNodeUpdate") + private boolean skipNodeUpdate; + public String getDatacenter() { return datacenter; } @@ -259,6 +262,15 @@ public class CatalogRegistration { this.nodeMeta = nodeMeta; } + public boolean isSkipNodeUpdate() { + return skipNodeUpdate; + } + + public CatalogRegistration setSkipNodeUpdate(boolean skipNodeUpdate) { + this.skipNodeUpdate = skipNodeUpdate; + return this; + } + @Override public String toString() { return "CatalogRegistration{" + @@ -269,6 +281,7 @@ public class CatalogRegistration { ", check=" + check + ", writeRequest=" + writeRequest + ", nodeMeta=" + nodeMeta + + ", skipNodeUpdate=" + skipNodeUpdate + '}'; } }
#<I> Add SkipNodeUpdate support
Ecwid_consul-api
train
java
c46103d2188b6460b51a448831577875473bb4e8
diff --git a/hwd/wrapper.py b/hwd/wrapper.py index <HASH>..<HASH> 100644 --- a/hwd/wrapper.py +++ b/hwd/wrapper.py @@ -29,3 +29,38 @@ class Wrapper: @property def system_path(self): return self.device.sys_path + + @property + def devid(self): + d = self.device + vend_id = d.get('ID_VENDOR_ID') + model_id = d.get('ID_MODEL_ID') + return (vend_id, model_id) + + @property + def model(self): + return self.get_first([ + 'ID_MODEL_FROM_DATABASE', + 'ID_MODEL', + 'ID_MODEL_ID']) + + @property + def vendor(self): + return self.get_first([ + 'ID_OUI_FROM_DATABASE', + 'ID_VENDOR_FROM_DATAASE', + 'ID_VENDOR', + 'ID_VENDOR_ID']) + + @property + def node(self): + return self.device.device_node + + def get_first(self, keys, default=None): + """ For given keys, return value for first key that isn't none """ + d = self.device + for k in keys: + v = d.get(k) + if v: + return v + return default
Added properties for accessing common device data
Othernet-Project_hwd
train
py
8149a4826c7bfbd5714c9da68b46124979569647
diff --git a/models/classes/task/migration/service/QueueMigrationService.php b/models/classes/task/migration/service/QueueMigrationService.php index <HASH>..<HASH> 100644 --- a/models/classes/task/migration/service/QueueMigrationService.php +++ b/models/classes/task/migration/service/QueueMigrationService.php @@ -50,7 +50,7 @@ class QueueMigrationService extends ConfigurableService } if ($config->isProcessAll()) { - $config = $configFactory->spawn($config, $filter); + $config = $spawnService->spawn($config, $filter); if ($config) { $report->add(
fix broken QueueMigrationService by changing to spawnService
oat-sa_tao-core
train
php
db1fab1692e2763d77da6b3413fdf577ba93a577
diff --git a/geomdl/operations.py b/geomdl/operations.py index <HASH>..<HASH> 100644 --- a/geomdl/operations.py +++ b/geomdl/operations.py @@ -610,9 +610,10 @@ def split_curve(obj, param, **kwargs): for _ in range(0, temp_obj.degree + 1): curve2_kv.insert(0, param) - # Control points (use private variable due to differences between rational and non-rational curve) - curve1_ctrlpts = temp_obj._control_points[0:ks + r] - curve2_ctrlpts = temp_obj._control_points[ks + r - 1:] + # Control points (use Pw if rational) + cpts = temp_obj.ctrlptsw if obj.rational else temp_obj.ctrlpts + curve1_ctrlpts = cpts[0:ks + r] + curve2_ctrlpts = cpts[ks + r - 1:] # Create a new curve for the first half curve1 = temp_obj.__class__()
Use getters instead of private vars in split curve
orbingol_NURBS-Python
train
py
ce5625f51ab02ead7c7d7807bbd93cf1d2b88e05
diff --git a/lib/declarative/heritage.rb b/lib/declarative/heritage.rb index <HASH>..<HASH> 100644 --- a/lib/declarative/heritage.rb +++ b/lib/declarative/heritage.rb @@ -1,3 +1,5 @@ +require "declarative/deep_dup" + module Declarative class Heritage < Array # Record inheritable assignments for replay in an inheriting class. diff --git a/lib/declarative/schema.rb b/lib/declarative/schema.rb index <HASH>..<HASH> 100644 --- a/lib/declarative/schema.rb +++ b/lib/declarative/schema.rb @@ -1,6 +1,6 @@ -require "declarative" require "declarative/definitions" require "declarative/defaults" +require "declarative/heritage" module Declarative # Include this to maintain inheritable, nested schemas with ::defaults and
Fix warning about circular require ``` declarative-<I>/lib/declarative.rb:5: warning: loading in progress, circular require considered harmful ```
apotonick_declarative
train
rb,rb
d2327196bf28b3f0e0590f8bfdd9e8314c515a90
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -4,9 +4,10 @@ module.exports = function(source) { this.cacheable(false); if (markoCompiler.compileForBrowser) { - return markoCompiler.compileForBrowser(source, this.resourcePath, { + var compiled = markoCompiler.compileForBrowser(source, this.resourcePath, { writeToDisk: false }); + return compiled.code; } else { return markoCompiler.compile(source, this.resourcePath, { writeToDisk: false
Updated to latest compileForBrowser API
marko-js_marko-loader
train
js
b49e830e3a1c04ed194500506dc63de0912e728d
diff --git a/src/Leevel/Http/Response.php b/src/Leevel/Http/Response.php index <HASH>..<HASH> 100644 --- a/src/Leevel/Http/Response.php +++ b/src/Leevel/Http/Response.php @@ -107,14 +107,6 @@ class Response extends BaseResponse } /** - * 获取 COOKIE. - */ - public function getCookies(): array - { - return $this->headers->getCookies(); - } - - /** * 取回 JSON 数据. * * @return mixed
refactor(http): refactor response
hunzhiwange_framework
train
php
adef6bd2e33447f0297938afa111cfca8f2e8dc1
diff --git a/lib/core/src/client/preview/start.js b/lib/core/src/client/preview/start.js index <HASH>..<HASH> 100644 --- a/lib/core/src/client/preview/start.js +++ b/lib/core/src/client/preview/start.js @@ -316,9 +316,8 @@ export default function start(render, { decorateStory } = {}) { reqs = [loadable]; } - let currentExports; + let currentExports = new Set(); if (reqs) { - currentExports = new Set(); reqs.forEach(req => { req.keys().forEach(filename => { const fileExports = req(filename); @@ -326,7 +325,16 @@ export default function start(render, { decorateStory } = {}) { }); }); } else { - currentExports = new Set(loadable()); + const exported = loadable(); + if (Array.isArray(exported) && !exported.find(obj => !obj.default)) { + currentExports = new Set(exported); + } else if (exported) { + logger.warn( + `Loader function passed to 'configure' should return void or an array of module exports. Received: ${JSON.stringify( + exported + )}` + ); + } } const removed = [...previousExports].filter(exp => !currentExports.has(exp));
Core: Make load by function more strict with warning
storybooks_storybook
train
js
e596703bf7c732658b858baa0cd10fc599e48bb3
diff --git a/client/assets/scripts/services/search.js b/client/assets/scripts/services/search.js index <HASH>..<HASH> 100644 --- a/client/assets/scripts/services/search.js +++ b/client/assets/scripts/services/search.js @@ -146,7 +146,7 @@ module.exports = [ } // Prioritize exact match - if (config.exactMatch) { + if (config.exactMatch && config.searchField.name) { match = _.findIndex(list, function (item) { return self.query.toLowerCase() === item.name.toLowerCase(); });
Exact match should work with "name" field only
rakuten-frontend_bower-browser
train
js
68bd2738f9917ce43a6b132df63c6832dbf4ff77
diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index <HASH>..<HASH> 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -762,7 +762,9 @@ def to_datetime( If parsing succeeded. Return type depends on input: - - list-like: DatetimeIndex + - list-like: + - DatetimeIndex, if timezone naive or aware with the same timezone + - Index of object dtype, if timezone aware with mixed time offsets - Series: Series of datetime64 dtype - scalar: Timestamp
Updated the return type section of to_datetime (#<I>) * Updated the return type section of to_datetime to include list-like mixed timezone inputs * updated the Returns section * updated the Return section as suggested by mroeschke * removed the extra line in my previous commit * Update pandas/core/tools/datetimes.py
pandas-dev_pandas
train
py
f74aba99b0d40207cf41798242c483e891172f35
diff --git a/grimoire/ocean/elastic.py b/grimoire/ocean/elastic.py index <HASH>..<HASH> 100644 --- a/grimoire/ocean/elastic.py +++ b/grimoire/ocean/elastic.py @@ -224,17 +224,20 @@ class ElasticOcean(object): } ''' % (date_field, from_date) + order_field = 'metadata__updated_on' + query = """ { "query": { "bool": { "must": [%s] } - } + }, + "sort": { "%s": { "order": "asc" }} } - """ % (filters) + """ % (filters, order_field) - # logging.debug("%s %s" % (url, query)) + # logging.debug("%s %s", url, query) r = self.requests.post(url, data=query)
[enrich] Get raw items ordered by update_time to enrich them so incremental enrichment works when enrichment process fails and it is restarted.
chaoss_grimoirelab-elk
train
py
180ae24a2e2de2c6042cd8fbf7d5c0535b85c7aa
diff --git a/src/mol.js b/src/mol.js index <HASH>..<HASH> 100644 --- a/src/mol.js +++ b/src/mol.js @@ -786,7 +786,7 @@ function shouldIntroduceTraceBreak(aaStretch, prevResidue, thisResidue) { } function addNonEmptyTrace(traces, trace) { - if (trace.length() === 0) { + if (trace.length() < 2) { return; } traces.push(trace);
only add traces longer than one residue
biasmv_pv
train
js
e7d6a7ce81057187d81118a3bbf593fe3b4d3fbf
diff --git a/spec/unit/plugins/aix/virtualization_spec.rb b/spec/unit/plugins/aix/virtualization_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/plugins/aix/virtualization_spec.rb +++ b/spec/unit/plugins/aix/virtualization_spec.rb @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb') +require 'spec_helper' describe Ohai::System, "AIX virtualization plugin" do
Use spec_helper directly rather than long relative pathname
chef_ohai
train
rb
5ca56b00970af1bdac0b29fdc24a81ee388b7843
diff --git a/src/main/java/org/nlpcn/es4sql/query/AggregationQuery.java b/src/main/java/org/nlpcn/es4sql/query/AggregationQuery.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/nlpcn/es4sql/query/AggregationQuery.java +++ b/src/main/java/org/nlpcn/es4sql/query/AggregationQuery.java @@ -7,6 +7,7 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchType; import org.elasticsearch.client.Client; import org.elasticsearch.index.query.BoolFilterBuilder; +import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -44,8 +45,7 @@ public class AggregationQuery extends Query { if (where != null) { boolFilter = FilterMaker.explan(where); - filter = AggregationBuilders.filter("filter").filter(boolFilter); - request.addAggregation(filter); + request.setQuery(QueryBuilders.filteredQuery(null, boolFilter)); } //
use filtered query insead of aggregation filter when using WHERE and GROUP BY
NLPchina_elasticsearch-sql
train
java
4a56c56857596a4735a2a4def4df306d70290acc
diff --git a/src/Commands/RunCommand.php b/src/Commands/RunCommand.php index <HASH>..<HASH> 100644 --- a/src/Commands/RunCommand.php +++ b/src/Commands/RunCommand.php @@ -58,14 +58,14 @@ class RunCommand extends Command $options = collect($this->option('option') ?? []) ->mapWithKeys(function ($value, $key) { - list($key, $value) = explode('=', $value); + list($key, $value) = explode('=', $value, 2); return ["--$key" => $value]; }) ->merge($this->option('argument') ?? []) ->mapWithKeys(function ($value, $key) { if (!Str::startsWith($key, '--')) { - list($key, $value) = explode('=', $value); + list($key, $value) = explode('=', $value, 2); } return [$key => $value];
Set a limit on explode() (#<I>)
tenancy_multi-tenant
train
php
53fe4b7a0927c28851c0edb74284ce474e30a265
diff --git a/dockermap/map/action/simple.py b/dockermap/map/action/simple.py index <HASH>..<HASH> 100644 --- a/dockermap/map/action/simple.py +++ b/dockermap/map/action/simple.py @@ -218,10 +218,11 @@ class SignalActionGenerator(AbstractActionGenerator): class ImagePullActionGenerator(AbstractActionGenerator): + pull_all_images = False pull_insecure_registry = False - policy_options = ['pull_insecure_regsitry'] + policy_options = ['pull_all_images', 'pull_insecure_regsitry'] def get_state_actions(self, state, **kwargs): - if state.config_id.config_type == ItemType.IMAGE and state.base_state == State.ABSENT: + if state.config_id.config_type == ItemType.IMAGE and (self.pull_all_images or state.base_state == State.ABSENT): return [ItemAction(state, ImageAction.PULL, insecure_registry=self.pull_insecure_registry)]
Added option for pulling all images unconditionally.
merll_docker-map
train
py
65c92f169653b69ad240d2acb2b479e183b3626e
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/ipythonconsole.py +++ b/spyder/plugins/ipythonconsole.py @@ -72,7 +72,7 @@ QTCONSOLE_REQVER = ">=4.2.0" dependencies.add("qtconsole", _("Integrate the IPython console"), required_version=QTCONSOLE_REQVER) -IPYTHON_REQVER = ">=4.0" +IPYTHON_REQVER = ">=4.0;<6.0" if PY2 else ">=4.0" dependencies.add("IPython", _("IPython interactive python environment"), required_version=IPYTHON_REQVER)
Added ipython dependency >=<I>;<<I> for python2
spyder-ide_spyder
train
py
e4fe2ed93d6a715b9545a95b5e8002c003c48599
diff --git a/runcommands/config.py b/runcommands/config.py index <HASH>..<HASH> 100644 --- a/runcommands/config.py +++ b/runcommands/config.py @@ -197,15 +197,12 @@ class RawConfig(OrderedDict): def _iter_dotted(self, root=''): for k in self: - v = self[k] + v = super().__getitem__(k) qualified_k = '.'.join((root, k)) if root else k - if not isinstance(v, RawConfig): - yield qualified_k - elif not v: - yield qualified_k + if isinstance(v, RawConfig) and v: + yield from v._iter_dotted(qualified_k) else: - for qualified_k in v._iter_dotted(qualified_k): - yield qualified_k + yield qualified_k def _to_string(self, flat=False, values_only=False, exclude=(), level=0, root=''): out = []
Improve iteration over dotted config keys - Skip interpolation of values - Use `yield from` to simplify recursive calls - Simplify branching and remove some duplication
wylee_runcommands
train
py
f0c24d9c287973b3be53d8b62f77b783266100c7
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,3 @@ <?php -require_once __DIR__ . '/vendor' . '/autoload.php'; \ No newline at end of file +require_once __DIR__ . '/vendor' . '/autoload.php';
add newline at end of index.php
aliyun_aliyun-oss-php-sdk
train
php
6566b02d546375dc0b2f3ddbaa5f4eb17aa07b53
diff --git a/views/default/toolbar.php b/views/default/toolbar.php index <HASH>..<HASH> 100644 --- a/views/default/toolbar.php +++ b/views/default/toolbar.php @@ -23,7 +23,8 @@ if (window.localStorage) { } EOD; -$url = $panels['request']->getUrl(); +$firstPanel = reset($panels); +$url = $firstPanel->getUrl(); ?> <div id="yii-debug-toolbar" class="yii-debug-toolbar-<?= $position ?>"> <div class="yii-debug-toolbar-block">
use the url of the first panel as link, when toolbar is minimized
yiisoft_yii2-debug
train
php
70b0a7e3d07ec1dfd21cff1b3e6262f92a5d5422
diff --git a/plan/optimizer.go b/plan/optimizer.go index <HASH>..<HASH> 100644 --- a/plan/optimizer.go +++ b/plan/optimizer.go @@ -30,7 +30,7 @@ func Optimize(ctx context.Context, node ast.Node, sb SubQueryBuilder, is infosch if err := InferType(node); err != nil { return nil, errors.Trace(err) } - if !UseNewPlanner { + if _, ok := node.(*ast.SelectStmt); !ok || !UseNewPlanner { if err := logicOptimize(ctx, node); err != nil { return nil, errors.Trace(err) }
let update/delete do old logicOptimize (#<I>)
pingcap_tidb
train
go
3e43789928cfdacfa699c4196f589d68b9b199b9
diff --git a/py/nupic/encoders/base.py b/py/nupic/encoders/base.py index <HASH>..<HASH> 100644 --- a/py/nupic/encoders/base.py +++ b/py/nupic/encoders/base.py @@ -205,14 +205,21 @@ class Encoder(object): pass ############################################################################ - def _getInputValue(self, obj, fieldname): + def _getInputValue(self, obj, fieldName): """ Gets the value of a given field from the input record """ if isinstance(obj, dict): - return obj[fieldname] + if not fieldName in obj: + knownFields = ",".join([key for key in obj.keys() if key[:1] != "_"]) + raise Exception( + "Unknown field name '%s' in input record. Known fields are '%s'." % ( + fieldName, knownFields + ) + ) + return obj[fieldName] else: - return getattr(obj, fieldname) + return getattr(obj, fieldName) ############################################################################ def getEncoderList(self):
Better error from base encoder for bad fields. If a field name that is not within the input fields is attempted to be retreived, an exception is raised instead of a KeyError resulting.
numenta_nupic
train
py
18eb4218c81fb70bffb99c737f4ad5e148d40bd7
diff --git a/allennlp/modules/seq2seq_encoders/intra_sentence_attention.py b/allennlp/modules/seq2seq_encoders/intra_sentence_attention.py index <HASH>..<HASH> 100644 --- a/allennlp/modules/seq2seq_encoders/intra_sentence_attention.py +++ b/allennlp/modules/seq2seq_encoders/intra_sentence_attention.py @@ -141,9 +141,11 @@ class IntraSentenceAttentionEncoder(Seq2SeqEncoder): similarity_function = SimilarityFunction.from_params(params.pop('similarity_function', {})) num_attention_heads = params.pop_int('num_attention_heads', 1) combination = params.pop('combination', '1,2') + output_dim = params.pop_int('output_dim', None) params.assert_empty(cls.__name__) return cls(input_dim=input_dim, projection_dim=projection_dim, similarity_function=similarity_function, num_attention_heads=num_attention_heads, - combination=combination) + combination=combination, + output_dim=output_dim)
fix sentence encoder from params (#<I>)
allenai_allennlp
train
py
59faf88024faa697647dec1ddda045db8038edab
diff --git a/cordova-lib/src/cordova/prepare.js b/cordova-lib/src/cordova/prepare.js index <HASH>..<HASH> 100644 --- a/cordova-lib/src/cordova/prepare.js +++ b/cordova-lib/src/cordova/prepare.js @@ -21,6 +21,7 @@ var cordova_util = require('./util'), ConfigParser = require('cordova-common').ConfigParser, PlatformJson = require('cordova-common').PlatformJson, PluginInfoProvider = require('cordova-common').PluginInfoProvider, + PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger, events = require('cordova-common').events, platforms = require('../platforms/platforms'), PlatformApiPoly = require('../platforms/PlatformApiPoly'), @@ -117,6 +118,13 @@ function preparePlatforms (platformList, projectRoot, options) { var browserify = require('../plugman/browserify'); return browserify(project, platformApi); } + }) + .then(function () { + // Handle edit-config in config.xml + var platformRoot = path.join(projectRoot, 'platforms', platform); + var platformJson = PlatformJson.load(platformRoot, platform); + var munger = new PlatformMunger(platform, platformRoot, platformJson); + munger.add_config_changes(project.projectConfig, /*should_increment=*/true).save_all(); }); }); }));
CB-<I> Handle edit-config in config.xml on prepare This closes #<I>
apache_cordova-lib
train
js