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
77b21da24ae3c2c4c082f2ec5a2073e68b4d5adb
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,16 +16,6 @@ if (process.env.COMPRESS) { ); } -if (process.env.COMPRESS) { - plugins.push( - new webpack.optimize.UglifyJsPlugin({ - compressor: { - warnings: false - } - }) - ); -} - module.exports = { output: { library: 'Potion',
remove duplicate lines in webpack config
jansedivy_potion
train
js
d161f332984c18806dfcb9830d066f9c2167ac8d
diff --git a/src/emailjs-imap-client.js b/src/emailjs-imap-client.js index <HASH>..<HASH> 100644 --- a/src/emailjs-imap-client.js +++ b/src/emailjs-imap-client.js @@ -1828,7 +1828,7 @@ }; }; - var logger = this.options.logger || createLogger(this.logLevel, "emailjs-imap-client@" + this.options.sessionId); + var logger = this.options.logger || createLogger(this.options.sessionId || 1); this.logger = this.client.logger = { // this could become way nicer when node supports the rest operator... debug: function() {
sessionId missing from logs It is vital too see which session owns each log when connected to more than one server
emailjs_emailjs-imap-client
train
js
740119003efdc8fcc8aa19eac27580d93cc9b02b
diff --git a/hearthstone/cardxml.py b/hearthstone/cardxml.py index <HASH>..<HASH> 100644 --- a/hearthstone/cardxml.py +++ b/hearthstone/cardxml.py @@ -151,10 +151,9 @@ class CardXML(object): for tag in STRING_TAGS: value = self.strings[tag] if value: - ElementTree.SubElement( - ret, "Tag", enumID=str(int(tag)), name=tag.name, - type="String", value=str(value) - ) + e = ElementTree.SubElement(ret, "Tag", enumID=str(int(tag)), name=tag.name) + e.attrib["type"] = "String" + e.text = value for tag, value in sorted(self.tags.items()): e = ElementTree.SubElement(ret, "Tag", enumID=str(int(tag)))
cardxml: Write string tag contents as text rather than attribute
HearthSim_python-hearthstone
train
py
39c24a78ea235ee9efcb9db42483118be8f83f80
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ with open('./README.rst') as f: setup( - version="10.2.0", + version="10.2.0rc1", name="swimlane", author="Swimlane", author_email="info@swimlane.com",
change <I> to rc tag (#<I>)
swimlane_swimlane-python
train
py
7bb7c68889c2a2ec1e9aef49b23aff7c1793de9d
diff --git a/ceph_deploy/hosts/suse/uninstall.py b/ceph_deploy/hosts/suse/uninstall.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/hosts/suse/uninstall.py +++ b/ceph_deploy/hosts/suse/uninstall.py @@ -7,7 +7,7 @@ def uninstall(conn, purge=False): 'libcephfs1', 'librados2', 'librbd1', - 'radosgw', + 'ceph-radosgw', ] cmd = [ 'zypper',
suse.uninstall: ceph-deploy purge fails on SUSE. This is because ceph-deploy tries to remove a package that does not exist. To fix this we need to change package name to correct name ceph-radosgw from the old name radosgw.
ceph_ceph-deploy
train
py
03a5dafa87ca70587274863a902f03c0b573caeb
diff --git a/code/media/com_files/js/files.app.js b/code/media/com_files/js/files.app.js index <HASH>..<HASH> 100644 --- a/code/media/com_files/js/files.app.js +++ b/code/media/com_files/js/files.app.js @@ -65,6 +65,9 @@ Files.App = new Class({ clearTimeout(delay); delay = this.setDimensions.delay(200, this); }.bind(this)); + this.grid.addEvent('onAfterRenew', function(){ + this.setDimensions(true); + }.bind(this)); } },
re #<I> thumbnail size forgotten when switching between grid and list layouts
joomlatools_joomlatools-framework
train
js
fdbfa0abbd4942c4acab4dd48161f64df5e3734d
diff --git a/core/Common.php b/core/Common.php index <HASH>..<HASH> 100644 --- a/core/Common.php +++ b/core/Common.php @@ -85,7 +85,6 @@ class Piwik_Common if(defined('PIWIK_TRACKER_MODE') && PIWIK_TRACKER_MODE) { - Zend_Registry::set('db', Piwik_Tracker::getDatabase()); //TODO we can remove these includes when #620 is done require_once "Zend/Exception.php"; require_once "Zend/Loader.php"; @@ -107,7 +106,9 @@ class Piwik_Common require_once "Option.php"; require_once "View.php"; require_once "UpdateCheck.php"; + Zend_Registry::set('db', Piwik_Tracker::getDatabase()); Piwik::createAccessObject(); + Piwik::createConfigObject(); Piwik::setUserIsSuperUser(); $pluginsManager = Piwik_PluginsManager::getInstance(); $pluginsManager->setPluginsToLoad( Zend_Registry::get('config')->Plugins->Plugins->toArray() );
- fixed #<I> due to wrong order in includes when regenerating cache file in piwik.php git-svn-id: <URL>
matomo-org_matomo
train
php
00eba6951aaf932151abe61bb3867516783b38bc
diff --git a/rails/init.rb b/rails/init.rb index <HASH>..<HASH> 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -7,9 +7,9 @@ module Timely def weekdays_field(attribute, options={}) db_field = options[:db_field] || attribute.to_s + '_bit_array' self.composed_of(attribute, - :class_name => "Timely::WeekDays", + :class_name => "::Timely::WeekDays", :mapping => [[db_field, 'weekdays_int']], - :converter => Proc.new {|field| Timely::WeekDays.new(field)} + :converter => Proc.new {|field| ::Timely::WeekDays.new(field)} ) end end
Fixes NameError (uninitialized constant Rails::Plugin::Timely::WeekDays)
sealink_timely
train
rb
672f2c82e9fff9f2f74025770d422a093b5994e8
diff --git a/lib/bibformatadminlib.py b/lib/bibformatadminlib.py index <HASH>..<HASH> 100644 --- a/lib/bibformatadminlib.py +++ b/lib/bibformatadminlib.py @@ -156,6 +156,11 @@ def perform_request_format_template_show(bft, ln=cdslang, code=None, # Look for all existing content_types content_types = bibformat_dblayer.get_existing_content_types() + # Add some standard content types if not already there + standard_content_types = ['text/xml', 'application/rss+xml', 'text/plain', 'text/html'] + content_types.extend([content_type for content_type in standard_content_types + if content_type not in content_types]) + return bibformat_templates.tmpl_admin_format_template_show(ln, format_template['attrs']['name'], format_template['attrs']['description'], code, bft, @@ -1144,7 +1149,7 @@ def get_elements_used_by_template(filename): if not value in format_elements[function_name]['tags']: format_elements[function_name]['tags'].append(value) break - + keys = format_elements.keys() keys.sort() return map(format_elements.get, keys)
Added more content-types by default in content-types list for preview.
inveniosoftware_invenio-formatter
train
py
3546db916c2d3eb6f2994120d9cbfa499828f190
diff --git a/app/config/bootstrap/media.php b/app/config/bootstrap/media.php index <HASH>..<HASH> 100644 --- a/app/config/bootstrap/media.php +++ b/app/config/bootstrap/media.php @@ -39,7 +39,8 @@ Collection::formats('lithium\net\http\Media'); // use lithium\net\http\Media; // // Dispatcher::applyFilter('_callable', function($self, $params, $chain) { -// list($library, $asset) = explode('/', $params['request']->url, 2) + array("", ""); +// $url = ltrim($params['request']->url, '/'); +// list($library, $asset) = explode('/', $url, 2) + array("", ""); // // if ($asset && ($path = Media::webroot($library)) && file_exists($file = "{$path}/{$asset}")) { // return function() use ($file) {
Trim leading slash of request url before parsing library and asset
UnionOfRAD_framework
train
php
8f2044c6992534fb59505ad5fe59876bf926f1b9
diff --git a/example/example/settings.py b/example/example/settings.py index <HASH>..<HASH> 100644 --- a/example/example/settings.py +++ b/example/example/settings.py @@ -8,6 +8,8 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ +import django + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) @@ -28,7 +30,8 @@ ALLOWED_HOSTS = [] # Application definition -TEST_RUNNER = 'discover_runner.DiscoverRunner' +if django.get_version() < '1.6': + TEST_RUNNER = 'discover_runner.DiscoverRunner' TRACK_PAGEVIEWS = True GEOIP_PATH = os.path.join(BASE_DIR, 'geoip')
Non-sucky testrunner for pre-django<I>
bruth_django-tracking2
train
py
a3fd2d691fd62fc1b9be3d7e6652f9740bee8a31
diff --git a/lib/travis/model/build.rb b/lib/travis/model/build.rb index <HASH>..<HASH> 100644 --- a/lib/travis/model/build.rb +++ b/lib/travis/model/build.rb @@ -66,7 +66,6 @@ class Build < ActiveRecord::Base end def next_number - env = defined?(Rails) ? Rails.env : ENV['ENV'] || ENV['RAILS_ENV'] || 'test' maximum(floor('number')).to_i + 1 end
env isn't used anywhere, so i am pretty sure it can be removed
travis-ci_travis-core
train
rb
0044ef9fc46e54c851bbdcefda5c42465770827a
diff --git a/ipyrad/assemble/refmap.py b/ipyrad/assemble/refmap.py index <HASH>..<HASH> 100644 --- a/ipyrad/assemble/refmap.py +++ b/ipyrad/assemble/refmap.py @@ -81,10 +81,11 @@ def index_reference_sequence(data, force=False): ## error handling if proc1.returncode: raise IPyradWarningExit(error1) - if "please use bgzip" in error2: - raise IPyradWarningExit(NO_ZIP_BINS.format(refseq_file)) - else: - raise IPyradWarningExit(error2) + if error2: + if "please use bgzip" in error2: + raise IPyradWarningExit(NO_ZIP_BINS.format(refseq_file)) + else: + raise IPyradWarningExit(error2) ## print finished message if data._headers:
Adjusted fix to bgzip test.
dereneaton_ipyrad
train
py
31adecbf829cd708990d411c81d8a9edcb2f4c31
diff --git a/active_event/lib/active_event/domain.rb b/active_event/lib/active_event/domain.rb index <HASH>..<HASH> 100644 --- a/active_event/lib/active_event/domain.rb +++ b/active_event/lib/active_event/domain.rb @@ -34,7 +34,7 @@ module ActiveEvent base.server_uri = 'druby://127.0.0.1:8787' end - def set_config(protocol: 'druby', host: 'localhost', port: 8787) + def set_config(protocol = 'druby', host = 'localhost', port = 8787) self.server_uri = "#{protocol}://#{host}:#{port}" end end diff --git a/active_event/lib/active_event/support/attr_setter.rb b/active_event/lib/active_event/support/attr_setter.rb index <HASH>..<HASH> 100644 --- a/active_event/lib/active_event/support/attr_setter.rb +++ b/active_event/lib/active_event/support/attr_setter.rb @@ -21,7 +21,7 @@ module ActiveEvent::Support def attributes(*args) super args.each do |attr| - define_method "#{attr}=", -> (value) { attributes[attr] = value } + define_method "#{attr}=", lambda { |value| attributes[attr] = value } end end end
* different syntax for lambda and default args to ensure rubinius support
hicknhack-software_rails-disco
train
rb,rb
b327981534da9cfc311d702c55806747ec87cab2
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index <HASH>..<HASH> 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -2661,11 +2661,12 @@ class _FlowSpecOperatorBase(_FlowSpecComponentBase): return cls(operator, value), rest def serialize_body(self): - length = (self.value.bit_length() + 7) // 8 or 1 - self.operator |= int(math.log(length, 2)) << 4 + byte_length = (self.value.bit_length() + 7) // 8 or 1 + length = int(math.ceil(math.log(byte_length, 2))) + self.operator |= length << 4 buf = struct.pack(self._OPE_PACK_STR, self.operator) - value_type = type_desc.IntDescr(length) - buf += struct.pack(self._VAL_PACK_STR % length, + value_type = type_desc.IntDescr(1 << length) + buf += struct.pack(self._VAL_PACK_STR % (1 << length), value_type.from_user(self.value)) return buf
packet/bgp: Properly calculate length for FlowSpec RFC <I> says the 'len' field in numeric or bitmask operators represents that the length of the value field is [1 << 'len']. But, in serializing FlowSpec messages, the packet library uses the `len` field as the length of the value field itself. This patch fixes it to serialize FlowSpec messages properly.
osrg_ryu
train
py
3d823fe35c8bca18082dbb2b0cadec844aeb4fa0
diff --git a/src/Codeception/Lib/Connector/ZF2.php b/src/Codeception/Lib/Connector/ZF2.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Lib/Connector/ZF2.php +++ b/src/Codeception/Lib/Connector/ZF2.php @@ -40,6 +40,8 @@ class ZF2 extends Client $zendRequest = $this->application->getRequest(); $zendResponse = $this->application->getResponse(); + $zendResponse->setStatusCode(200); + $uri = new HttpUri($request->getUri()); $queryString = $uri->getQuery(); $method = strtoupper($request->getMethod());
Reset status code in ZF2 connector
Codeception_base
train
php
1e810c57f99ba08e6cb97ec1ba10a1c0b95147f7
diff --git a/lxd/device/device.go b/lxd/device/device.go index <HASH>..<HASH> 100644 --- a/lxd/device/device.go +++ b/lxd/device/device.go @@ -115,6 +115,9 @@ func (d *deviceCommon) Remove() error { } // New instantiates a new device struct, validates the supplied config and sets it into the device. +// If the device type is valid, but the other config validation fails then an instantiated device +// is still returned with the validation error. If an unknown device is requested or the device is +// not compatible with the instance type then an ErrUnsupportedDevType error is returned. func New(instance InstanceIdentifier, state *state.State, name string, conf config.Device, volatileGet VolatileGetter, volatileSet VolatileSetter) (Device, error) { devFunc := devTypes[conf["type"]] @@ -132,9 +135,9 @@ func New(instance InstanceIdentifier, state *state.State, name string, conf conf // Init the device and run validation of supplied config. dev.init(instance, state, name, conf, volatileGet, volatileSet) err := dev.validateConfig() - if err != nil { - return nil, err - } - return dev, nil + // We still return the instantiated device here, as in some scenarios the caller + // may still want to use the device (such as when stopping or removing) even if + // the config validation has failed. + return dev, err }
device: Modifies New function to return device even if validation fails This is so the caller can decide whether to use the device or not based on the scenario. In cases where a new version of LXD restricts device validation such that a previously valid config is now invalid, it is useful for LXD to still be able to cleanly stop and remove the device even if validation of the old config fails.
lxc_lxd
train
go
3146ce934e337aede2e5f0af19150108812a4046
diff --git a/lib/fine_print/controller_additions.rb b/lib/fine_print/controller_additions.rb index <HASH>..<HASH> 100644 --- a/lib/fine_print/controller_additions.rb +++ b/lib/fine_print/controller_additions.rb @@ -30,14 +30,17 @@ module FinePrint class_eval do before_filter(filter_options) do |controller| + # If the user isn't signed in, they can't sign a contract. Since there + # may be some pages that logged in and non-logged in users can visit, + # just return quietly instead of raising an exception. + user = FinePrint.current_user_proc.call(self) + return true unless FinePrint.is_signed_in?(user) + contract_names = names - fine_print_skipped_contract_names # Bail if nothing to do return true if contract_names.blank? - user = FinePrint.current_user_proc.call(self) - FinePrint.raise_unless_signed_in(user) - unsigned_contract_names = FinePrint.get_unsigned_contract_names(user, contract_names)
quietly return if user not logged in
lml_fine_print
train
rb
0547177f321335668f20abb2558e9351fa8e32dc
diff --git a/GPy/core/model.py b/GPy/core/model.py index <HASH>..<HASH> 100644 --- a/GPy/core/model.py +++ b/GPy/core/model.py @@ -76,7 +76,7 @@ class Model(Parameterized): jobs = [] pool = mp.Pool(processes=num_processes) for i in range(num_restarts): - self.randomize() + if i>0: self.randomize() job = pool.apply_async(opt_wrapper, args=(self,), kwds=kwargs) jobs.append(job) @@ -90,7 +90,7 @@ class Model(Parameterized): for i in range(num_restarts): try: if not parallel: - self.randomize() + if i>0: self.randomize() self.optimize(**kwargs) else: self.optimization_runs.append(jobs[i].get())
change the behavior the optimize_restarts to keep the original model parameters for the firt run
SheffieldML_GPy
train
py
61a7ac85c748414c73a7109cbfee192a34e38016
diff --git a/master/buildbot/process/buildstep.py b/master/buildbot/process/buildstep.py index <HASH>..<HASH> 100644 --- a/master/buildbot/process/buildstep.py +++ b/master/buildbot/process/buildstep.py @@ -129,6 +129,8 @@ class SyncLogFileWrapper(logobserver.LogObserver): self.finished = False self.finishDeferreds = [] + self.step._sync_addlog_deferreds.append(addLogDeferred) + @addLogDeferred.addCallback def gotAsync(log): self.asyncLogfile = log @@ -537,6 +539,7 @@ class BuildStep(results.ResultComputingConfigMixin, def run(self): self._start_deferred = defer.Deferred() unhandled = self._start_unhandled_deferreds = [] + self._sync_addlog_deferreds = [] try: # here's where we set things up for backward compatibility for # old-style steps, using monkey patches so that new-style steps @@ -571,6 +574,9 @@ class BuildStep(results.ResultComputingConfigMixin, self._start_deferred.callback(results) results = yield self._start_deferred finally: + # wait all the sync logs have been actually created before finishing + yield defer.DeferredList(self._sync_addlog_deferreds, + consumeErrors=True) self._start_deferred = None unhandled = self._start_unhandled_deferreds self._start_unhandled_deferreds = None
wait for the logs are created before finishing the step There is a race condition between addLogs calls, and the end of the step. for oldStyleSteps, this matters, because the subsequent addStderr, are only called at the end of the step, so we must wait for log are created before continuing
buildbot_buildbot
train
py
e27135cb1ee68f632e0bc1909114486d1d70bffc
diff --git a/lib/couchrest/validation/validators/required_field_validator.rb b/lib/couchrest/validation/validators/required_field_validator.rb index <HASH>..<HASH> 100644 --- a/lib/couchrest/validation/validators/required_field_validator.rb +++ b/lib/couchrest/validation/validators/required_field_validator.rb @@ -37,7 +37,7 @@ module CouchRest def call(target) value = target.validation_property_value(field_name) - property = target.validation_property(field_name) + property = target.validation_property(field_name.to_s) return true if present?(value, property) error_message = @options[:message] || default_error(property) @@ -66,7 +66,7 @@ module CouchRest # Returns false for other property types. # Returns false for non-properties. def boolean_type?(property) - property ? property.type == TrueClass : false + property ? property.type == 'Boolean' : false end end # class RequiredFieldValidator
Fixed required_field_validator to behave correctly with boolean fields
couchrest_couchrest_model
train
rb
ebd8bdf874a479695ce2bec1e0e24cbcb2257a80
diff --git a/db/ActiveSearchTrait.php b/db/ActiveSearchTrait.php index <HASH>..<HASH> 100644 --- a/db/ActiveSearchTrait.php +++ b/db/ActiveSearchTrait.php @@ -183,7 +183,9 @@ trait ActiveSearchTrait $subquery = (new Query) ->select(array_keys($relation->link)) ->from(['t' => $relationClass::tableName()]) - ->where(['IN', $relationClass::primaryKey(), $value]); + ->where(['IN', array_map(function ($key) { + return 't.' . $key; + }, $relationClass::primaryKey()), $value]); $linkKeys = array_values($relation->link); } return ['IN', $linkKeys, $subquery];
fix relation search by adding prefix to pk
netis-pl_yii2-crud
train
php
9d9703928fecbbe7afd313e2696f9b9aac87dbfe
diff --git a/pysc2/lib/sc_process.py b/pysc2/lib/sc_process.py index <HASH>..<HASH> 100644 --- a/pysc2/lib/sc_process.py +++ b/pysc2/lib/sc_process.py @@ -61,10 +61,10 @@ class StarcraftProcess(object): host="127.0.0.1", connect=True, timeout_seconds=None, **kwargs): self._proc = None self._controller = None + self._check_exists(exec_path) self._tmp_dir = tempfile.mkdtemp(prefix="sc-", dir=run_config.tmp_dir) self._host = host self._port = portpicker.pick_unused_port() - self._check_exists(exec_path) args = [ exec_path, @@ -102,7 +102,7 @@ class StarcraftProcess(object): if hasattr(self, "_port") and self._port: portpicker.return_port(self._port) self._port = None - if os.path.exists(self._tmp_dir): + if hasattr(self, "_tmp_dir") and os.path.exists(self._tmp_dir): shutil.rmtree(self._tmp_dir) @property
Fail early if the binary doesn't exist. PiperOrigin-RevId: <I>
deepmind_pysc2
train
py
7451a0df190ae73e2fb7c6ec429d28ea0116d537
diff --git a/spec/controllers/api/systems_packages_controller_spec.rb b/spec/controllers/api/systems_packages_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/api/systems_packages_controller_spec.rb +++ b/spec/controllers/api/systems_packages_controller_spec.rb @@ -41,7 +41,7 @@ describe Api::SystemPackagesController do @organization = Organization.create!(:name => 'test_org', :cp_key => 'test_org') @environment_1 = KTEnvironment.create!(:name => 'test_1', :prior => @organization.locker.id, :organization => @organization) - @system = System.create!(:environment => @environment_1, :uuid => "1234", :name => "system.example.com", :cp_type => 'system', :facts => {}) + @system = System.create!(:environment => @environment_1, :uuid => "1234", :name => "system.example.com", :cp_type => 'system', :facts => {:foo => :bar}) System.stub(:first => @system) end
Temporary fix for jenkins errors
Katello_katello
train
rb
9a3415f4472ca96459f2bdf0dd1acd74096f6187
diff --git a/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js b/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js index <HASH>..<HASH> 100644 --- a/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js +++ b/ui/app/products/components/pnc-products-data-table/pncProductsDataTable.js @@ -50,6 +50,12 @@ title: 'Name', placeholder: 'Filter by Name', filterType: 'text' + }, + { + id: 'abbreviation', + title: 'Abbreviation', + placeholder: 'Filter by abbreviation', + filterType: 'text' } ];
[NCL-<I>] Add abbreviation filter option to product list page
project-ncl_pnc
train
js
f158061ab92f8ae7d5cbae19e717ecb390bc69b8
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,7 +55,7 @@ repo_name = u"dtoolcore" # built documents. # # The short X.Y version. -version = u"2.7.0" +version = u"2.8.0" # The full version, including alpha/beta/rc tags. release = version diff --git a/dtoolcore/__init__.py b/dtoolcore/__init__.py index <HASH>..<HASH> 100644 --- a/dtoolcore/__init__.py +++ b/dtoolcore/__init__.py @@ -16,7 +16,7 @@ except ImportError: import dtoolcore.utils -__version__ = "2.7.0" +__version__ = "2.8.0" def _generate_storage_broker_lookup(): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup -version = "2.7.0" +version = "2.8.0" url = "https://github.com/jic-dtool/dtoolcore" readme = open('README.rst').read()
Update version number to <I>
jic-dtool_dtoolcore
train
py,py,py
13c7b7bc97aab4d70e178fdb25af1b2c3b85ac5b
diff --git a/lib/plugins/package/lib/zipService.js b/lib/plugins/package/lib/zipService.js index <HASH>..<HASH> 100644 --- a/lib/plugins/package/lib/zipService.js +++ b/lib/plugins/package/lib/zipService.js @@ -1,5 +1,6 @@ 'use strict'; +const { ServerlessError } = require('../../../classes/Error'); const BbPromise = require('bluebird'); const archiver = require('archiver'); const os = require('os'); @@ -120,11 +121,16 @@ module.exports = { // Get file contents and stat in parallel this.getFileContent(fullPath), fs.statAsync(fullPath), - ]).then(result => ({ - data: result[0], - stat: result[1], - filePath, - })); + ]).then( + result => ({ + data: result[0], + stat: result[1], + filePath, + }), + error => { + throw new ServerlessError(`Cannot read file ${filePath} due to: ${error.message}`); + } + ); }, // Useful point of entry for e.g. transpilation plugins
fix(Packaging): Expose meaningfully file access errors (#<I>)
serverless_serverless
train
js
4d59864dc14c77105aaabaaab7cdcaa9651609cf
diff --git a/lib/shared/adapters/test_unit_adapter.rb b/lib/shared/adapters/test_unit_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/shared/adapters/test_unit_adapter.rb +++ b/lib/shared/adapters/test_unit_adapter.rb @@ -4,7 +4,7 @@ class TestUnitAdapter def self.command(project_path, ruby_interpreter, files) ruby_command = RubyEnv.ruby_command(project_path, :ruby_interpreter => ruby_interpreter) - "#{ruby_command} -Itest -e '%w(#{files}).each { |file| require(file) }'" + %{#{ruby_command} -Itest -e '%w(#{files}).each { |file| require("#{Dir.pwd}/#{file}") }'} end def self.test_files(dir)
Use full path with test unit files to support ruby <I>.
joakimk_testbot
train
rb
709d2297b0718ed91c50af577cbf69fcd605ac6c
diff --git a/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java b/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java +++ b/presto-main/src/main/java/com/facebook/presto/server/ThreadResource.java @@ -43,6 +43,9 @@ public class ThreadResource ImmutableList.Builder<Info> builder = ImmutableList.builder(); for (ThreadInfo info : mbean.getThreadInfo(mbean.getAllThreadIds(), Integer.MAX_VALUE)) { + if (info == null) { + continue; + } builder.add(new Info( info.getThreadId(), info.getThreadName(),
fix for thread listing under heavy workloads
prestodb_presto
train
java
88737038b25ac40ad2ae1ce1a60b9578fa492b54
diff --git a/upload/admin/controller/marketplace/cron.php b/upload/admin/controller/marketplace/cron.php index <HASH>..<HASH> 100644 --- a/upload/admin/controller/marketplace/cron.php +++ b/upload/admin/controller/marketplace/cron.php @@ -61,7 +61,7 @@ class Cron extends \Opencart\System\Engine\Controller { } if (isset($this->request->get['page'])) { - $page = $this->request->get['page']; + $page = (int)$this->request->get['page']; } else { $page = 1; } @@ -279,4 +279,4 @@ class Cron extends \Opencart\System\Engine\Controller { $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } -} \ No newline at end of file +}
Added integer on $page get request.
opencart_opencart
train
php
57095bafe72ffd80d22469215db026be3c5d4242
diff --git a/script/check-MakeGitError-thread-lock.go b/script/check-MakeGitError-thread-lock.go index <HASH>..<HASH> 100644 --- a/script/check-MakeGitError-thread-lock.go +++ b/script/check-MakeGitError-thread-lock.go @@ -9,6 +9,8 @@ import ( "go/printer" "go/token" "log" + "os" + "path/filepath" "strings" ) @@ -24,7 +26,7 @@ func main() { log.Fatal(err) } - pkgs, err := parser.ParseDir(fset, bpkg.Dir, nil, 0) + pkgs, err := parser.ParseDir(fset, bpkg.Dir, func(fi os.FileInfo) bool { return filepath.Ext(fi.Name()) == ".go" }, 0) if err != nil { log.Fatal(err) }
only check Go source files for non-thread-locked MakeGitError calls
libgit2_git2go
train
go
500a2ec4f1cebaf74ab9001be8a925478a8e2de8
diff --git a/src/playbacks/html5_video/html5_video.js b/src/playbacks/html5_video/html5_video.js index <HASH>..<HASH> 100644 --- a/src/playbacks/html5_video/html5_video.js +++ b/src/playbacks/html5_video/html5_video.js @@ -169,7 +169,7 @@ class HTML5Video extends Playback { this.$el.html(this.template({ src: this.src, type: this.typeFor(this.src) })) this.$el.append(style) this.trigger('playback:ready', this.name) - this.options.autoPlay && this.play() + process.nextTick(() => this.options.autoPlay && this.play()) return this } }
html5 video: fix autoplay not working correctly on safari (closes #<I>)
clappr_clappr
train
js
d3fde219fcff4d062b90fb63f1afe03b3349eb0d
diff --git a/test/utils/TestDateTime.java b/test/utils/TestDateTime.java index <HASH>..<HASH> 100644 --- a/test/utils/TestDateTime.java +++ b/test/utils/TestDateTime.java @@ -71,6 +71,12 @@ public final class TestDateTime { } @Test + public void parseDateTimeStringNow() { + long t = DateTime.parseDateTimeString("now", null); + assertEquals(t, 1357300800000L); + } + + @Test public void parseDateTimeStringRelativeS() { long t = DateTime.parseDateTimeString("60s-ago", null); assertEquals(60000, (System.currentTimeMillis() - t));
Added test for Now timestamp Fixes #<I>
OpenTSDB_opentsdb
train
java
8ae19d27686bbbcaa470df307ed1a6b02de1ea96
diff --git a/satpy/readers/abi_l1b.py b/satpy/readers/abi_l1b.py index <HASH>..<HASH> 100644 --- a/satpy/readers/abi_l1b.py +++ b/satpy/readers/abi_l1b.py @@ -96,10 +96,11 @@ class NC_ABI_L1B(BaseFileHandler): lon_0 = projection.attrs['longitude_of_projection_origin'][...] sweep_axis = projection.attrs['sweep_angle_axis'][0] - scale_x = self.nc['x'].attrs["scale_factor"][0] - scale_y = self.nc['y'].attrs["scale_factor"][0] - offset_x = self.nc['x'].attrs["add_offset"][0] - offset_y = self.nc['y'].attrs["add_offset"][0] + # need 64-bit floats otherwise small shift + scale_x = np.float64(self.nc['x'].attrs["scale_factor"][0]) + scale_y = np.float64(self.nc['y'].attrs["scale_factor"][0]) + offset_x = np.float64(self.nc['x'].attrs["add_offset"][0]) + offset_y = np.float64(self.nc['y'].attrs["add_offset"][0]) # x and y extents in m h = float(h)
Update ABI scale factors to be <I>-bit floats to improve X/Y calculations In other applications I have noticed that the in-file <I>-bit factor and offset produce a noticeable drift in the per-pixel X/Y values. When converted to <I>-bit to force <I>-bit arithmetic the results are closer to the advertised pixel resolution of the instrument.
pytroll_satpy
train
py
237c1652a459fb0cc2fcd3a68fdf789669a11185
diff --git a/spyderlib/widgets/explorer.py b/spyderlib/widgets/explorer.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/explorer.py +++ b/spyderlib/widgets/explorer.py @@ -395,8 +395,11 @@ class ExplorerTreeWidget(DirView): path, valid = QInputDialog.getText(self, translate('Explorer', 'Rename'), translate('Explorer', 'New name:'), - QLineEdit.Normal, fname) - if valid and path != fname: + QLineEdit.Normal, osp.basename(fname)) + if valid: + path = osp.join(osp.dirname(fname), unicode(path)) + if path == fname: + return try: os.rename(fname, path) self.parent_widget.emit(SIGNAL("renamed(QString,QString)"), @@ -409,9 +412,7 @@ class ExplorerTreeWidget(DirView): "<br><br>Error message:<br>%1") \ .arg(str(error))) finally: - selected_row = self.currentRow() - self.refresh() - self.setCurrentRow(selected_row) + self.refresh_folder(osp.dirname(fname)) def new_folder(self): """Create a new folder"""
File explorer widget: fixed "Rename" feature
spyder-ide_spyder
train
py
4fee02d7b114e17e3e9025d7547bca45b2a274fe
diff --git a/lib/mauth/client.rb b/lib/mauth/client.rb index <HASH>..<HASH> 100644 --- a/lib/mauth/client.rb +++ b/lib/mauth/client.rb @@ -7,6 +7,23 @@ require 'mauth/core_ext' require 'mauth/autoload' module MAuth + class Client + class << self + # the root of the MAuth-Client library + def root + File.expand_path('../..', File.dirname(__FILE__)) + end + + # the MAuth::Client library's current version + def version + version_file = File.join(root, 'VERSION') + File.exists?(version_file) ? File.read(version_file).chomp : "?" + end + end + end +end + +module MAuth # mAuth client was unable to verify the authenticity of a signed object (this does NOT mean the # object is inauthentic). typically due to a failure communicating with the mAuth service, in # which case the error may include the attribute mauth_service_response - a response from
add MAuth::Client.version and, assisting that, MAuth::Client.root
mdsol_mauth-client-ruby
train
rb
da278774bad10dec783fca1f37d83fc8096d7b66
diff --git a/src/tools/Fsck.java b/src/tools/Fsck.java index <HASH>..<HASH> 100644 --- a/src/tools/Fsck.java +++ b/src/tools/Fsck.java @@ -144,6 +144,8 @@ final class Fsck { final StringBuilder buf = new StringBuilder(); for (final Query query : queries) { final long start_time = System.nanoTime(); + long ping_start_time = start_time; + LOG.info("Starting to fsck data covered by " + query); long kvcount = 0; long rowcount = 0; final Bytes.ByteMap<Seen> seen = new Bytes.ByteMap<Seen>(); @@ -166,6 +168,13 @@ final class Fsck { } for (final KeyValue kv : row) { kvcount++; + if (kvcount % 100000 == 0) { + final long now = System.nanoTime(); + ping_start_time = (now - ping_start_time) / 1000000; + LOG.info("... " + kvcount + " KV analyzed in " + ping_start_time + + "ms (" + (100000 * 1000 / ping_start_time) + " KVs/s)"); + ping_start_time = now; + } if (kv.qualifier().length != 2) { LOG.warn("Ignoring unsupported KV with a qualifier of " + kv.qualifier().length + " bytes:" + kv);
fsck: Provide more feedback on how much progress is made. Change-Id: Ib<I>dce<I>e3cadf5f<I>b<I>bab5e4c<I>a0
OpenTSDB_opentsdb
train
java
171a25bad2ec2376b862b1ddd02380f77e4d2a83
diff --git a/treeCl/distance_matrix.py b/treeCl/distance_matrix.py index <HASH>..<HASH> 100644 --- a/treeCl/distance_matrix.py +++ b/treeCl/distance_matrix.py @@ -78,7 +78,7 @@ class DistanceMatrix(np.ndarray): add_noise=False, normalise=False, distribute_tasks=False, - **kwargs, # i.e. batch_size + **kwargs ): if distribute_tasks: diff --git a/treeCl/parameters.py b/treeCl/parameters.py index <HASH>..<HASH> 100644 --- a/treeCl/parameters.py +++ b/treeCl/parameters.py @@ -11,6 +11,14 @@ class BaseParameters(object): def dict(self): return dict((item.lstrip('_'), getattr(self, item)) for item in self.__slots__) + def read(self, fileobj): + return json.load(fileobj) + + def construct_from_dict(self, dict): + for k, v in dict.items(): + if '_{}'.format(k) in self.__slots__: + setattr(self, k, v) + def write(self, fileobj=sys.stdout, indent=None): json.dump(self.dict, fileobj, indent=indent)
Batch simulation (async and seqntl)
kgori_treeCl
train
py,py
5368f7aebd21d99105e8690ea88e7780169f9c1d
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -70,7 +70,7 @@ gulp.task('docList', ['gitBranch'], (done) => { /** * Generate API documentation for all js files, place markup in the correct folder for readthedocs.org */ -gulp.task('docs', ['gitBranch', 'lintExterns', 'docList'], function (done) { +gulp.task('docs', ['gitBranch', 'lintExterns', 'docList'], (done) => { // Abort(successfully) early if running in CI and not job #1 if (!runDocs) { return done();
More lambda I really am just fiddling now
SockDrawer_SockBot
train
js
503a037ad10eb3cdf7e676ab8c2bf4f8b6a6d22c
diff --git a/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php b/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php +++ b/eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php @@ -9,6 +9,7 @@ namespace eZ\Publish\Core\MVC\Symfony\Controller\Content; +use eZ\Publish\API\Repository\Values\Content\Location; use eZ\Publish\Core\MVC\Symfony\Controller\Controller; use eZ\Publish\Core\MVC\Symfony\View\Manager as ViewManager; use eZ\Publish\Core\MVC\Symfony\MVCEvents; @@ -96,10 +97,19 @@ class ViewController extends Controller try { + if ( isset( $params['location'] ) && $params['location'] instanceof Location ) + { + $location = $params['location']; + } + else + { + $location = $this->getRepository()->getLocationService()->loadLocation( $locationId ); + } + $response->headers->set( 'X-Location-Id', $locationId ); $response->setContent( $this->renderLocation( - $this->getRepository()->getLocationService()->loadLocation( $locationId ), + $location, $viewType, $layout, $params
EZP-<I>: Made it possible to pass a Location object in $params in ViewController
ezsystems_ezpublish-kernel
train
php
5174b2d463d58cb62d920e6a219d0aa7c108e2f9
diff --git a/js/ascendex.js b/js/ascendex.js index <HASH>..<HASH> 100644 --- a/js/ascendex.js +++ b/js/ascendex.js @@ -1831,8 +1831,21 @@ module.exports = class ascendex extends Exchange { } safeNetwork (networkId) { - // TODO: parse network - return networkId; + const networksById = { + 'TRC20': 'TRC20', + 'ERC20': 'ERC20', + 'GO20': 'GO20', + 'BEP2': 'BEP2', + 'BEP20 (BSC)': 'BEP20', + 'Bitcoin': 'BTC', + 'Bitcoin ABC': 'BCH', + 'Litecoin': 'LTC', + 'Matic Network': 'MATIC', + 'Solana': 'SOL', + 'xDai': 'STAKE', + 'Akash': 'AKT', + }; + return this.safeString (networksById, networkId, networkId); } async fetchDepositAddress (code, params = {}) {
Completed Ascendex SafeNetwork TODO
ccxt_ccxt
train
js
d8958eaad9df5d1acd5a6fc1c236770e9499319b
diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index <HASH>..<HASH> 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -213,13 +213,13 @@ class AlarmDecoder(object): """ if self._device: - self._device.write(data) + self._device.write(str.encode(data)) def get_config(self): """ Retrieves the configuration from the device. Called automatically by :py:meth:`_on_open`. """ - self.send(b"C\r") + self.send("C\r") def save_config(self): """
Fixed string encoding used with send.
nutechsoftware_alarmdecoder
train
py
ec13fbbfe310d9b173f57e0065b0941fd1a4a4fb
diff --git a/acceptancetests/assess_upgrade_series.py b/acceptancetests/assess_upgrade_series.py index <HASH>..<HASH> 100755 --- a/acceptancetests/assess_upgrade_series.py +++ b/acceptancetests/assess_upgrade_series.py @@ -39,7 +39,6 @@ def assess_juju_upgrade_series(client, args): reboot_machine(client, target_machine) upgrade_series_complete(client, target_machine) assert_correct_series(client, target_machine, args.to_series) - set_application_series(client, "dummy-subordinate", args.to_series) def upgrade_series_prepare(client, machine, series, **flags): @@ -72,10 +71,6 @@ def reboot_machine(client, machine): log.info("wait_for_started()") client.wait_for_started() -def set_application_series(client, application, series): - args = (application, series) - client.juju('set-series', args) - def assert_correct_series(client, machine, expected): """Verify that juju knows the correct series for the machine"""
Removes set_application_series command from assess_upgrade_series test.
juju_juju
train
py
e6a678dc2499d5993cf8f96e1465528962916f1a
diff --git a/src/Towel/Model/BaseModel.php b/src/Towel/Model/BaseModel.php index <HASH>..<HASH> 100755 --- a/src/Towel/Model/BaseModel.php +++ b/src/Towel/Model/BaseModel.php @@ -320,21 +320,15 @@ class BaseModel extends \Towel\BaseApp * Finds a Record by Id. Returns the record array and sets the internal * record if you want to use the record object. * - * @param String $id + * @param String $id * - * @return The current instance with the record setted internally. + * @return The current instance with the record setted internally or false is nothing have been found. */ public function findById($id) { - $result = $this->fetchOne("SELECT * from {$this->table} WHERE {$this->id_name} = ?", + return $this->fetchOne("SELECT * from {$this->table} WHERE {$this->id_name} = ?", array($id) ); - - if ($result) { - return $result; - } - - return false; } /** @@ -454,7 +448,7 @@ class BaseModel extends \Towel\BaseApp $id = $this->getField($field); } - $result = $relatedModel->findByID($id); + $result = $relatedModel->findById($id); return $result; }
Improvements in FindById
42mate_towel
train
php
607767eb1f0c945756cf5a19414e250e62d0b7ba
diff --git a/packages/blueprint-gatekeeper/lib/index.js b/packages/blueprint-gatekeeper/lib/index.js index <HASH>..<HASH> 100644 --- a/packages/blueprint-gatekeeper/lib/index.js +++ b/packages/blueprint-gatekeeper/lib/index.js @@ -1,9 +1,11 @@ var blueprint = require ('blueprint') + , path = require ('path') ; // Export the application as a module. This allows other applications to integrate // our application logic into their application logic. -module.exports = exports = new blueprint.ApplicationModule ('../app'); +var appPath = path.resolve (__dirname, '../app'); +module.exports = exports = new blueprint.ApplicationModule (appPath); // Export the authentication package. exports.auth = require ('./authentication'); \ No newline at end of file
Specified the app path incorrectly
onehilltech_blueprint
train
js
091a0cf173e2c8952011be4ade06b946d3c90bae
diff --git a/lib/puppet/functions.rb b/lib/puppet/functions.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/functions.rb +++ b/lib/puppet/functions.rb @@ -537,7 +537,7 @@ module Puppet::Functions required_count = from # array has just one element, but there may be multiple names that needs to be subtracted from the count # to make it correct for the last named element - adjust = param_names.size() -1 + adjust = max(0, param_names.size() -1) last_range = [max(0, (from - adjust)), (to - adjust)] [ args_type.element_type ] end
(PUP-<I>) Fix argument count adjustment for Ruby <I> There was a problem with PArrayType based signature string when there are no parameter names - the adjustment resulted in off by one error in the displayed string.
puppetlabs_puppet
train
rb
a153372052b06ac3a46b3bb3bd96e56001f676e9
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java @@ -471,6 +471,8 @@ public class OSQLEngine { pos = OStringSerializerHelper.getLowerIndexOf(candidate, pos + 1, " ", "\n", "\r", "\t", "(", "["); if (pos > -1) { commandName = candidate.substring(0, pos); + //remove double spaces + commandName = commandName.replaceAll(" ", " "); found = names.contains(commandName); } else { break;
Fix parsing problem for two spaces at the beginning of SQL statements (old parser) Resolves: #<I>
orientechnologies_orientdb
train
java
fca76687ca02341454be0d9290096c8a01ee48de
diff --git a/lib/bullet.rb b/lib/bullet.rb index <HASH>..<HASH> 100644 --- a/lib/bullet.rb +++ b/lib/bullet.rb @@ -177,14 +177,17 @@ module Bullet end def profile - Bullet.start_request if Bullet.enable? + if Bullet.enable? + begin + Bullet.start_request - yield + yield - if Bullet.enable? && Bullet.notification? - Bullet.perform_out_of_channel_notifications + Bullet.perform_out_of_channel_notifications if Bullet.notification? + ensure + Bullet.end_request + end end - Bullet.end_request if Bullet.enable? end private
ensure calling end_request in profile method
flyerhzm_bullet
train
rb
a74b0447193188077f5a1cb6e9f4aa20e00ef734
diff --git a/hacking/core.py b/hacking/core.py index <HASH>..<HASH> 100644 --- a/hacking/core.py +++ b/hacking/core.py @@ -74,6 +74,10 @@ IMPORT_EXCEPTIONS += DEFAULT_IMPORT_EXCEPTIONS def is_import_exception(mod): + """Check module name to see if import has been whitelisted. + + Import based rules should not run on any whitelisted module + """ return (mod in IMPORT_EXCEPTIONS or any(mod.startswith(m + '.') for m in IMPORT_EXCEPTIONS))
Add docstring to is_import_exception Clarify what is_import_exception does. Leave the name as is_import_exception and no is_import_whitelisted because import-exceptions is part of the API for hacking (used in the hacking section of tox.ini). Change-Id: Ib<I>d<I>ecfcdbcb<I>b<I>ab<I>e<I>a<I>
openstack_hacking
train
py
87efb8b467105ef35c87b12761af18e8da193a4a
diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java b/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java index <HASH>..<HASH> 100644 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java +++ b/byte-buddy-dep/src/test/java/net/bytebuddy/test/utility/JavaVersionRule.java @@ -27,7 +27,7 @@ public class JavaVersionRule implements MethodRule { public Statement apply(Statement base, FrameworkMethod method, Object target) { Enforce enforce = method.getAnnotation(Enforce.class); if (enforce != null) { - if (ClassFileVersion.ofJavaVersion(enforce.value()).compareTo(currentVersion) <= 0) { + if (ClassFileVersion.ofJavaVersion(enforce.value()).compareTo(currentVersion) > 0) { return new NoOpStatement(enforce.value()); } else if (!hotSpot) { for (int javaVersion : enforce.hotSpot()) {
Turned arround version comparison for preventing test of a certain level being executed.
raphw_byte-buddy
train
java
eb1dbfa3055bd71480eb34a282e974658de86b61
diff --git a/scs_osio/client_auth.py b/scs_osio/client_auth.py index <HASH>..<HASH> 100755 --- a/scs_osio/client_auth.py +++ b/scs_osio/client_auth.py @@ -22,8 +22,6 @@ from scs_host.sys.host import Host from scs_osio.cmd.cmd_client_auth import CmdClientAuth -# TODO: check whether the USER_ID exists on OSIO? - # -------------------------------------------------------------------------------------------------------------------- if __name__ == '__main__':
Added user check to host_device.
south-coast-science_scs_osio
train
py
497822017bcb0f5f49bfc83f04c50e67a4070fcb
diff --git a/views/search.py b/views/search.py index <HASH>..<HASH> 100644 --- a/views/search.py +++ b/views/search.py @@ -533,11 +533,20 @@ def results(qid, p, of, so, rm): recids = faceted_results_filter(recIDsHitSet, filter_data, facets) + jrec = request.values.get('jrec', 1, type=int) + rg = request.values.get('rg', 10, type=int) recids = sort_and_rank_records(recids, so=so, rm=rm, p=p) + records = len(recids) + + if records > 0 and records < jrec: + args = request.values.to_dict() + args["jrec"] = 1 + return redirect(url_for(request.endpoint, qid=qid, **args)) return response_formated_records( - recids, collection, of, - create_nearest_terms_box=_create_neareset_term_box, qid=qid) + recids[jrec-1:jrec-1+rg], collection, of, + create_nearest_terms_box=_create_neareset_term_box, qid=qid, + records=records) return make_results()
search: quickfix pagination troubles with facets * Fixes problem with ignoring pagination options while using facets. (closes #<I>) (PR #<I>)
inveniosoftware_invenio-search
train
py
f6d8f0e3bbba1e4bd96a42190f8e75577797f9b5
diff --git a/vint/ast/parsing.py b/vint/ast/parsing.py index <HASH>..<HASH> 100644 --- a/vint/ast/parsing.py +++ b/vint/ast/parsing.py @@ -3,7 +3,6 @@ from vint._bundles import vimlparser from vint.ast.traversing import traverse from vint.encodings.decoder import Decoder from vint.encodings.decoding_strategy import default_decoding_strategy -from pprint import pprint class Parser(object): @@ -38,11 +37,7 @@ class Parser(object): decoded = decoder.read(file_path) decoded_and_lf_normalized = decoded.replace('\r\n', '\n') - try: - return self.parse(decoded_and_lf_normalized) - except vimlparser.VimLParserException: - pprint(decoder.debug_hint) - raise + return self.parse(decoded_and_lf_normalized) def parse_redir(self, redir_cmd):
Remove debugging code (#<I>)
Kuniwak_vint
train
py
237234fc27fdd6488994d9895f1474a2770c87e1
diff --git a/commands/command_filter_process.go b/commands/command_filter_process.go index <HASH>..<HASH> 100644 --- a/commands/command_filter_process.go +++ b/commands/command_filter_process.go @@ -139,7 +139,7 @@ func filterCommand(cmd *cobra.Command, args []string) { // until a read from that channel becomes blocking (in // other words, we read until there are no more items // immediately ready to be sent back to Git). - paths := pathnames(readAvailable(available)) + paths := pathnames(readAvailable(available, 100)) if len(paths) == 0 { // If `len(paths) == 0`, `tq.Watch()` has // closed, indicating that all items have been @@ -302,8 +302,8 @@ func incomingOrCached(r io.Reader, ptr *lfs.Pointer) (io.Reader, error) { // 1. Reading from the channel of available items blocks, or ... // 2. There is one item available, or ... // 3. The 'tq.TransferQueue' is completed. -func readAvailable(ch <-chan *tq.Transfer) []*tq.Transfer { - ts := make([]*tq.Transfer, 0, 100) +func readAvailable(ch <-chan *tq.Transfer, cap int) []*tq.Transfer { + ts := make([]*tq.Transfer, 0, cap) for { select {
commands: make 'readAvailable' take an initial capacity
git-lfs_git-lfs
train
go
666b9642bac80b14608a5b920e976f21855db17c
diff --git a/src/Auth/ResetPassword/ResetPasswordRepository.php b/src/Auth/ResetPassword/ResetPasswordRepository.php index <HASH>..<HASH> 100644 --- a/src/Auth/ResetPassword/ResetPasswordRepository.php +++ b/src/Auth/ResetPassword/ResetPasswordRepository.php @@ -4,7 +4,6 @@ namespace Nodes\Api\Auth\ResetPassword; use Carbon\Carbon; use Illuminate\Database\Eloquent\Model as IlluminateModel; use Illuminate\Support\Facades\Mail; -use Illuminate\Support\Facades\Hash; use Nodes\Api\Auth\Exceptions\ResetPasswordNoUserException; use Nodes\Database\Eloquent\Repository as NodesRepository; use Nodes\Api\Auth\Exceptions\MissingUserModelException; @@ -181,7 +180,7 @@ class ResetPasswordRepository extends NodesRepository // Update user with new password return (bool) $user->update([ - 'password' => Hash::make($password) + 'password' => $password ]); } }
Don't hash in ResetPasswordRepository. This should be done in the user model with setPasswordAttribute()
nodes-php_api
train
php
8a51d4312142a9416eb593d2f0102d0674dd6544
diff --git a/git/git.go b/git/git.go index <HASH>..<HASH> 100644 --- a/git/git.go +++ b/git/git.go @@ -17,6 +17,7 @@ import ( "regexp" "strconv" "strings" + "syscall" "time" lfserrors "github.com/git-lfs/git-lfs/errors" @@ -685,9 +686,13 @@ func GitAndRootDirs() (string, string, error) { // If we got a fatal error, it's possible we're on a newer // (2.24+) Git and we're not in a worktree, so fall back to just // looking up the repo directory. - if e, ok := err.(*exec.ExitError); ok && e.ProcessState.ExitCode() == 128 { - absGitDir, err := GitDir() - return absGitDir, "", err + if e, ok := err.(*exec.ExitError); ok { + var ws syscall.WaitStatus + ws, ok = e.ProcessState.Sys().(syscall.WaitStatus) + if ok && ws.ExitStatus() == 128 { + absGitDir, err := GitDir() + return absGitDir, "", err + } } return "", "", fmt.Errorf("failed to call git rev-parse --git-dir --show-toplevel: %q", buf.String()) }
git/git.go: use Go <I> compatible ExitStatus We can retain support for Go <I> by replacing ProcessState.ExitCode() with ProcessState.Sys(), which we then try to convert to syscall.WaitStatus before using WaitStatus.ExitStatus().
git-lfs_git-lfs
train
go
df3a6e27a7d7dbf888d7afb610d5f0819084eb31
diff --git a/src/FieldHandlers/ListFieldHandler.php b/src/FieldHandlers/ListFieldHandler.php index <HASH>..<HASH> 100644 --- a/src/FieldHandlers/ListFieldHandler.php +++ b/src/FieldHandlers/ListFieldHandler.php @@ -73,9 +73,16 @@ class ListFieldHandler extends BaseFieldHandler $result = $data; $listName = $this->_getListName($options['fieldDefinitions']['type']); $fieldOptions = $this->_getListFieldOptions($listName); + $fieldOptions = $this->_filterOptions($fieldOptions); + + /* + nested list options + */ + $collection = new Collection($fieldOptions); + $fieldOptions = $collection->listNested()->printer('name', 'id', null)->toArray(); - if (!empty($fieldOptions[$data]['label'])) { - $result = h($fieldOptions[$data]['label']); + if (isset($fieldOptions[$data])) { + $result = h($fieldOptions[$data]); } return $result;
modify List Handler input value logic to support new nested functionality (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
cf5908bb1abf18355e9b4961c0829e798be4915c
diff --git a/src/Parser/Comment.php b/src/Parser/Comment.php index <HASH>..<HASH> 100644 --- a/src/Parser/Comment.php +++ b/src/Parser/Comment.php @@ -59,7 +59,8 @@ class Comment extends PartParser if($this->openedParenthesis >= 1) { return new InvalidEmail(new UnclosedComment(), $this->lexer->token['value']); - } else if ($this->openedParenthesis < 0) { + } + if ($this->openedParenthesis < 0) { return new InvalidEmail(new UnOpenedComment(), $this->lexer->token['value']); }
No superfluous elseif (#<I>) Replaces superfluous elseif with if.
egulias_EmailValidator
train
php
40b08bc7d0e63af431826338503a86165c7224be
diff --git a/lib/flag_shih_tzu.rb b/lib/flag_shih_tzu.rb index <HASH>..<HASH> 100644 --- a/lib/flag_shih_tzu.rb +++ b/lib/flag_shih_tzu.rb @@ -100,6 +100,22 @@ module FlagShihTzu def self.unset_#{flag_name}_sql sql_set_for_flag(:#{flag_name}, '#{colmn}', false) end + + def self.#{colmn.singularize}_values_for(*flag_names) + values = [] + flag_names.each do |flag_name| + if respond_to?(flag_name) + values_for_flag = send(:sql_in_for_flag, flag_name, '#{colmn}') + values = if values.present? + values & values_for_flag + else + values_for_flag + end + end + end + + values.sort + end EVAL if colmn != DEFAULT_COLUMN_NAME
Add dynamic ".*_values_for" helpers
pboling_flag_shih_tzu
train
rb
fe69f762da499f8a5771e1ad8504bf59a55ff97c
diff --git a/test_settings.py b/test_settings.py index <HASH>..<HASH> 100644 --- a/test_settings.py +++ b/test_settings.py @@ -17,3 +17,27 @@ except ImportError: pass SITE_ID = 1 + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': True, + 'formatters': { + 'simple': { + 'format': '- %(levelname)s %(message)s' + }, + }, + 'handlers': { + 'console':{ + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'simple' + }, + }, + 'loggers': { + '': { + 'handlers': ['console'], + 'propagate': True, + 'level': 'INFO', + }, + } +}
Infrastructure for convenient logging during tests.
dokterbob_django-multilingual-model
train
py
9ca76795a043b6811515f3476cc825405a50605a
diff --git a/src/components/source.js b/src/components/source.js index <HASH>..<HASH> 100644 --- a/src/components/source.js +++ b/src/components/source.js @@ -59,7 +59,7 @@ module.exports = class ComponentSource extends Source { const content = yield variant.getContent(true); const rendered = yield engine.render(variant.viewPath, content, context); if (layout && variant.preview) { - let layout = source.find(variant.preview); + let layout = source.find(`@${variant.preview.replace('@','')}`); if (!layout) { logger.error(`Preview layout ${variant.preview} for component ${variant._parent.handle} not found.`); return rendered;
fix(components): make preview find call @-prefix agnostic
frctl_fractal
train
js
eef3583dc7224367266058f550f6e944f9718c19
diff --git a/ezp/Persistence/Content/CreateStruct.php b/ezp/Persistence/Content/CreateStruct.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Content/CreateStruct.php +++ b/ezp/Persistence/Content/CreateStruct.php @@ -16,8 +16,7 @@ use ezp\Persistence\ValueObject; class CreateStruct extends ValueObject { /** - * @todo Language? - * @var string + * @var string[] Eg. array( 'eng-GB' => "New Article" ) */ public $name; diff --git a/ezp/Persistence/Content/UpdateStruct.php b/ezp/Persistence/Content/UpdateStruct.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Content/UpdateStruct.php +++ b/ezp/Persistence/Content/UpdateStruct.php @@ -26,7 +26,13 @@ class UpdateStruct extends ValueObject public $versionNo; /** - * @var int + * @var string[] Eg. array( 'eng-GB' => "New Article" ) + */ + public $name; + + /** + * @var int Creator of the version + * @todo Rename to creatorId to be consistent */ public $userId;
Add: $name on Content\UpdateStruct and document it as string[] to support languages
ezsystems_ezpublish-kernel
train
php,php
536b54c460b409ba203efccf66ae093513b83b2f
diff --git a/lib/easy_captcha/routes.rb b/lib/easy_captcha/routes.rb index <HASH>..<HASH> 100644 --- a/lib/easy_captcha/routes.rb +++ b/lib/easy_captcha/routes.rb @@ -3,7 +3,7 @@ module ActionDispatch #:nodoc: class Mapper #:nodoc: # call to add default captcha root def captcha_route - match "captcha" => EasyCaptcha::Controller, :via => :get + match 'captcha' => EasyCaptcha::Controller, :action => :captcha, :via => :get end end end
fixes controller namespacing in routes; closes #3
phatworx_easy_captcha
train
rb
2a99f3589e7d0882db7e159ea697611e15e43844
diff --git a/toml.py b/toml.py index <HASH>..<HASH> 100644 --- a/toml.py +++ b/toml.py @@ -58,6 +58,10 @@ def parse_value(v): elif v == 'false': return False elif v[0] == '"': + escapes = ['0', 'n', 'r', 't', '"', '\\'] + escapedchars = ['\0', '\n', '\r', '\t', '\"', '\\'] + for i in xrange(len(escapes)): + v = v.replace("\\"+escapes[i], escapedchars[i]) return v[1:-1] elif v[0] == '[': return parse_array(v) @@ -67,7 +71,11 @@ def parse_value(v): else: raise Exception("Wait, what?") else: - return int(v) + try: + int(v) + return int(v) + except ValueError: + return float(v) def parse_array(a):
Fix issue with escaped characters and floats I think I discovered a bug in PyYAML
uiri_toml
train
py
2d08ade8e28670b49b1f8abfe6121affb4905092
diff --git a/spaceship/lib/spaceship/test_flight/client.rb b/spaceship/lib/spaceship/test_flight/client.rb index <HASH>..<HASH> 100644 --- a/spaceship/lib/spaceship/test_flight/client.rb +++ b/spaceship/lib/spaceship/test_flight/client.rb @@ -112,6 +112,10 @@ module Spaceship req.body = body.to_json req.headers['Content-Type'] = 'application/json' end + + # This is invalid now. + @cached_groups.delete(app_id) if @cached_groups + handle_response(response) end
Invalidate group list when a group is created (#<I>) * Invalidate group list when a group is created * Fixing tests
fastlane_fastlane
train
rb
132a43c7d3f805b6de85d220ae572cad2a58a081
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,22 +1,12 @@ <?php -$files = array( - __DIR__.'/../vendor/autoload.php', //submodule autoloading - __DIR__.'/../../../autoload.php' //composer autoloading -); - -foreach ($files as $file){ - if (file_exists($file)) { - require_once $file; - $autoloaded = true; - break; - } -} - -if(!$autoloaded){ +$file = __DIR__.'/../vendor/autoload.php'; +if (!file_exists($file)) { throw new RuntimeException('Install dependencies to run test suite.'); } +require_once $file; + use Doctrine\Common\ClassLoader; use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
Remembered to put tests/bootstrap.php back
doctrine_mongodb-odm
train
php
d892b1376809c454980ce7083e6cee67d47e6b26
diff --git a/src/Readability.php b/src/Readability.php index <HASH>..<HASH> 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -1564,7 +1564,7 @@ class Readability */ public function getContent() { - return $this->content->C14N(); + return (null !== $this->content) ? $this->content->C14N() : null; } /**
Fix error C<I>N I have the error: "Call to a member function C<I>N() on null" You could reproduce like this: - try to parse a url like <URL> with the same object readability Previously, getContent would return "null" but now it call ->C<I>N() on a NULL object.
andreskrey_readability.php
train
php
491939a67c1eb095060a064c175ca0d61fc3b68e
diff --git a/client/wordpress-com.js b/client/wordpress-com.js index <HASH>..<HASH> 100644 --- a/client/wordpress-com.js +++ b/client/wordpress-com.js @@ -348,7 +348,8 @@ if ( config.isEnabled( 'manage/custom-post-types' ) ) { name: 'posts-custom', paths: [ '/types' ], module: 'my-sites/types', - secondary: true + secondary: true, + group: 'sites' } ); }
CPT: Set types group to sites So “My Sites” master bar link appears as active
Automattic_wp-calypso
train
js
bea6744945198857042a56c7ee67cb243bc647d1
diff --git a/config/webpack.test.js b/config/webpack.test.js index <HASH>..<HASH> 100644 --- a/config/webpack.test.js +++ b/config/webpack.test.js @@ -55,7 +55,10 @@ module.exports = function(env) { exclude: [ /\.(e2e|spec)\.ts$/, /node_modules/ - ] + ], + query: { + esModules: true + } } ] },
bug(tests): fix build?
swimlane_ngx-datatable
train
js
5acb4b5b17738566d5abcc9f4f5ac6231bb047a2
diff --git a/src/Query/LaravelQuery.php b/src/Query/LaravelQuery.php index <HASH>..<HASH> 100644 --- a/src/Query/LaravelQuery.php +++ b/src/Query/LaravelQuery.php @@ -200,6 +200,7 @@ class LaravelQuery extends LaravelBaseQuery implements IQueryProvider $skip = null, $skipToken = null ) { + /** @var Model $source */ $source = $this->unpackSourceEntity($sourceEntityInstance); return $this->getReader()->getRelatedResourceSet( $queryType, @@ -235,6 +236,7 @@ class LaravelQuery extends LaravelBaseQuery implements IQueryProvider ResourceProperty $targetProperty, KeyDescriptor $keyDescriptor ) { + /** @var Model $source */ $source = $this->unpackSourceEntity($sourceEntityInstance); return $this->getReader()->getResourceFromRelatedResourceSet( $sourceResourceSet, @@ -264,6 +266,7 @@ class LaravelQuery extends LaravelBaseQuery implements IQueryProvider ResourceSet $targetResourceSet, ResourceProperty $targetProperty ) { + /** @var Model $source */ $source = $this->unpackSourceEntity($sourceEntityInstance); $result = $this->getReader()->getRelatedResourceReference(
Annotate source unpacks in LaravelQuery
Algo-Web_POData-Laravel
train
php
93f03cc436f89c8f17fc11958670a254f1d10a81
diff --git a/login/signup.php b/login/signup.php index <HASH>..<HASH> 100644 --- a/login/signup.php +++ b/login/signup.php @@ -34,11 +34,9 @@ } } - if ($err) { - foreach ((array)$err as $key => $value) { - $focus = "form.$key"; - } - } + if ($err) { + $focus = 'form.' . array_shift(array_flip(get_object_vars($err))); + } if (!$user->country and $CFG->country) { $user->country = $CFG->country;
Much cooler way to set the form focus after an error. Sent in by Greg Barnett.
moodle_moodle
train
php
8cf0b9aea6e0d38b0ff03625062c269391eb9d1a
diff --git a/src/util-events.js b/src/util-events.js index <HASH>..<HASH> 100644 --- a/src/util-events.js +++ b/src/util-events.js @@ -41,7 +41,7 @@ seajs.off = function(name, callback) { // Emit event, firing all bound callbacks. Callbacks receive the same // arguments as `emit` does, apart from the event name var emit = seajs.emit = function(name, data) { - var list = events[name], fn + var list = events[name] if (list) { // Copy callback lists to prevent modification @@ -55,4 +55,3 @@ var emit = seajs.emit = function(name, data) { return seajs } -
Delete unused var .
seajs_seajs
train
js
e5d9a39051498a7f9320f640589302a6f0cdba16
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -8,7 +8,6 @@ use Tuum\Web\ServiceInterface\RendererInterface; use Tuum\Web\Stack\Stackable; use Tuum\Web\Stack\StackableInterface; use Tuum\Web\Stack\StackHandleInterface; -use Tuum\Locator\Container; class App implements ContainerInterface { @@ -21,7 +20,7 @@ class App implements ContainerInterface const RENDER_ENGINE = 'view.engine'; /** - * @var Container + * @var ContainerInterface */ public $container; @@ -31,7 +30,7 @@ class App implements ContainerInterface public $stack; /** - * @param Container $container + * @param ContainerInterface $container */ public function __construct($container) { @@ -39,7 +38,7 @@ class App implements ContainerInterface } /** - * @param Container $container + * @param ContainerInterface $container * @return static */ public static function forge($container)
use ContainerInterface as $container.
TuumPHP_Web
train
php
bff621cb8de6ddeb5fcd6d56ac499fccea188c22
diff --git a/core/codegen/platform/src/main/java/org/overture/codegen/trans/patterns/PatternTrans.java b/core/codegen/platform/src/main/java/org/overture/codegen/trans/patterns/PatternTrans.java index <HASH>..<HASH> 100644 --- a/core/codegen/platform/src/main/java/org/overture/codegen/trans/patterns/PatternTrans.java +++ b/core/codegen/platform/src/main/java/org/overture/codegen/trans/patterns/PatternTrans.java @@ -119,6 +119,14 @@ public class PatternTrans extends DepthFirstAnalysisAdaptor { return; } + + if (pattern instanceof AIgnorePatternCG) + { + AIdentifierPatternCG idPattern = getIdPattern(config.getIgnorePatternPrefix()); + transAssistant.replaceNodeWith(node.getTarget(), idPattern); + transAssistant.replaceNodeWith(pattern, idPattern.clone()); + return; + } DeclarationTag tag = fetchTag(node);
Fix: missing handling of the ignore pattern for local pattern assignments
overturetool_overture
train
java
e42aa326236b162be6f05bbed1ffee86c43c81f7
diff --git a/treeherder/webapp/graphql/schema.py b/treeherder/webapp/graphql/schema.py index <HASH>..<HASH> 100644 --- a/treeherder/webapp/graphql/schema.py +++ b/treeherder/webapp/graphql/schema.py @@ -64,6 +64,11 @@ class FailureLineGraph(DjangoObjectType): model = FailureLine +class GroupGraph(DjangoObjectType): + class Meta: + model = Group + + class ProductGraph(DjangoObjectType): class Meta: model = Product
Bug <I> - Add support for getting the FailureLine Group via GraphQL
mozilla_treeherder
train
py
c8fee52f3fcd42bf0e8d191fecb10e1efcafca90
diff --git a/src/app/actions/headers/peptable.py b/src/app/actions/headers/peptable.py index <HASH>..<HASH> 100644 --- a/src/app/actions/headers/peptable.py +++ b/src/app/actions/headers/peptable.py @@ -39,7 +39,10 @@ def get_psm2pep_header(oldheader, isobq_pattern=False, precurqfield=False): def get_linear_model_header(oldheader): header = oldheader[:] - ix = header.index(peptabledata.HEADER_PEP) + 1 + try: + ix = header.index(peptabledata.HEADER_PEP) + 1 + except ValueError: + ix = header.index(peptabledata.HEADER_QVAL) + 1 return header[:ix] + [peptabledata.HEADER_QVAL_MODELED] + header[ix:]
When inserting field in header, if PEP does not exist, use q-value
glormph_msstitch
train
py
800c31b9ccc4ac2d3bb8509c255b67b78a7d5e87
diff --git a/salt/modules/cron.py b/salt/modules/cron.py index <HASH>..<HASH> 100644 --- a/salt/modules/cron.py +++ b/salt/modules/cron.py @@ -604,10 +604,10 @@ def rm_job(user, if rm_ is not None: lst['crons'].pop(rm_) ret = 'removed' - comdat = _write_cron_lines(user, _render_tab(lst)) - if comdat['retcode']: - # Failed to commit, return the error - return comdat['stderr'] + comdat = _write_cron_lines(user, _render_tab(lst)) + if comdat['retcode']: + # Failed to commit, return the error + return comdat['stderr'] return ret rm = salt.utils.alias_function(rm_job, 'rm')
Don't create cron for cron.rm_job if no cron present for user
saltstack_salt
train
py
009ae5e3769fb31029adafbc6288943b0ae28551
diff --git a/jira/client.py b/jira/client.py index <HASH>..<HASH> 100644 --- a/jira/client.py +++ b/jira/client.py @@ -1755,9 +1755,15 @@ class JIRA: try: user_obj: User if self._is_cloud: - user_obj = self.search_users(query=user, maxResults=1)[0] + users = self.search_users(query=user, maxResults=20) else: - user_obj = self.search_users(user=user, maxResults=1)[0] + users = self.search_users(user=user, maxResults=20) + + matches = [] + if len(users) > 1: + matches = [u for u in users if self._get_user_identifier(u) == user] + user_obj = matches[0] if matches else users[0] + except Exception as e: raise JIRAError(str(e)) return self._get_user_identifier(user_obj)
Locate the exact user by identifier if multiple users returned from query (#<I>)
pycontribs_jira
train
py
ad2549170fb54ec1573fd724005c295ae6c891ea
diff --git a/tests/test_rpool.py b/tests/test_rpool.py index <HASH>..<HASH> 100644 --- a/tests/test_rpool.py +++ b/tests/test_rpool.py @@ -108,9 +108,20 @@ def return_instance(cls): def start_job(func, args): pool = get_reusable_pool(processes=2) - pool.apply(func, args) - pool.terminate() - pool.join() + try: + pool.apply(func, args) + except Exception as e: + # One should never call join before terminate: if the pool is broken, + # (AbortedWorkerError was raised) the cleanup mechanism should be + # triggered by the _worker_handler thread. Else we should call + # terminate explicitly + if not isinstance(e, AbortedWorkerError): + pool.terminate() + raise e + finally: + # _worker_handler thread is triggered every .1s + sleep(.2) + pool.join() class SayWhenError(ValueError):
TST ensure that callback pool end cleanly
tomMoral_loky
train
py
945011661f5b09e42a8e417b128189a5612a9aca
diff --git a/lib/fog/aws/models/ec2/snapshot.rb b/lib/fog/aws/models/ec2/snapshot.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/models/ec2/snapshot.rb +++ b/lib/fog/aws/models/ec2/snapshot.rb @@ -10,10 +10,13 @@ module Fog identity :id, 'snapshotId' + attribute :description attribute :progress attribute :created_at, 'startTime' + attribute :owner_id, 'ownerId' attribute :state, 'status' attribute :volume_id, 'volumeId' + attribute :volume_size, 'volumeSize' def destroy requires :id
[ec2] update snapshot models to accept new attributes
fog_fog
train
rb
1e1fa3a6f912e0deda68fe2b272293a33424f1f8
diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js index <HASH>..<HASH> 100644 --- a/lib/determine-basal/determine-basal.js +++ b/lib/determine-basal/determine-basal.js @@ -374,10 +374,20 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ } } } + + var minutes_running; + if (typeof currenttemp.duration == 'undefined' || currenttemp.duration == 0) { + minutes_running = 30; + } else if (typeof currenttemp.minutesrunning !== 'undefined'){ + // If the time the current temp is running is not defined, use default request duration of 30 minutes. + minutes_running = currenttemp.minutesrunning; + } else { + minutes_running = 30 - currenttemp.duration; + } // if there is a low-temp running, and eventualBG would be below min_bg without it, let it run if (round_basal(currenttemp.rate, profile) < round_basal(basal, profile) ) { - var lowtempimpact = (currenttemp.rate - basal) * (currenttemp.duration/60) * sens; + var lowtempimpact = (currenttemp.rate - basal) * ((30-minutes_running)/60) * sens; var adjEventualBG = eventualBG + lowtempimpact; if ( adjEventualBG < min_bg ) { rT.reason += "letting low temp of " + currenttemp.rate + " run.";
lowtempimpact based on <I> minutes (#<I>) * lowtempimpact based on <I> minutes @Scott * <I> as default for minutes_running
openaps_oref0
train
js
3cd6d5a67603dc580cf90886d63ad0ef3f0c497b
diff --git a/spec/javascripts/unit/transports/flash_transport_spec.js b/spec/javascripts/unit/transports/flash_transport_spec.js index <HASH>..<HASH> 100644 --- a/spec/javascripts/unit/transports/flash_transport_spec.js +++ b/spec/javascripts/unit/transports/flash_transport_spec.js @@ -31,6 +31,10 @@ describe("FlashTransport", function() { expect(this.transport.name).toEqual("flash"); }); + it("should not support ping", function() { + expect(this.transport.supportsPing()).toBe(false); + }); + it("should be supported only if Flash is present", function() { var _mimeTypes = navigator.mimeTypes;
Test FlashTransport for ping support
pusher_pusher-js
train
js
8427e136462c9b3ca53f843905eee4fcb60c0378
diff --git a/packages/vaex-jupyter/vaex/jupyter/bqplot.py b/packages/vaex-jupyter/vaex/jupyter/bqplot.py index <HASH>..<HASH> 100644 --- a/packages/vaex-jupyter/vaex/jupyter/bqplot.py +++ b/packages/vaex-jupyter/vaex/jupyter/bqplot.py @@ -51,6 +51,7 @@ class BqplotBackend(BackendBase): margin = {'bottom': 30, 'left': 60, 'right': 0, 'top': 0} self.figure = plt.figure(self.figure_key, fig=self.figure, scales=self.scales, fig_margin=margin) + self.figure.layout.min_width = '900px' plt.figure(fig=self.figure) self.figure.padding_y = 0 x = np.arange(0, 10)
vaex-jupyter: have a min with for bqplot
vaexio_vaex
train
py
c0ee8b77813470a55e9f4c89dfaa92010e0b35ff
diff --git a/api.go b/api.go index <HASH>..<HASH> 100644 --- a/api.go +++ b/api.go @@ -1,4 +1,4 @@ -package main +package giota import ( "bytes" diff --git a/api_mock.go b/api_mock.go index <HASH>..<HASH> 100644 --- a/api_mock.go +++ b/api_mock.go @@ -1,4 +1,4 @@ -package main +package giota // XXX: add a mock for IRI so that running test doesn't // require a running IRI instance, at least for simple diff --git a/api_test.go b/api_test.go index <HASH>..<HASH> 100644 --- a/api_test.go +++ b/api_test.go @@ -1,4 +1,4 @@ -package main +package giota import ( "testing"
changes the package from main to giota
iotaledger_iota.go
train
go,go,go
3ebe0af49112107fcf31217c3f414cc90fd769f2
diff --git a/js/bitfinex.js b/js/bitfinex.js index <HASH>..<HASH> 100644 --- a/js/bitfinex.js +++ b/js/bitfinex.js @@ -578,8 +578,9 @@ module.exports = class bitfinex extends Exchange { } handleErrors (code, reason, url, method, headers, body) { - if (this.verbose) + if (this.verbose) { console.log (this.id, method, url, code, reason, body ? ("\nResponse:\n" + body) : ''); + } if (code == 400) { if (body[0] == "{") { let response = JSON.parse (body);
one more transpiler fix... maybe
ccxt_ccxt
train
js
3501bc61f41175e143f6e04cef22e67176221afb
diff --git a/core-bundle/src/DependencyInjection/ContaoCoreExtension.php b/core-bundle/src/DependencyInjection/ContaoCoreExtension.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/DependencyInjection/ContaoCoreExtension.php +++ b/core-bundle/src/DependencyInjection/ContaoCoreExtension.php @@ -66,7 +66,6 @@ class ContaoCoreExtension extends ConfigurableExtension foreach ($this->files as $file) { $loader->load($file); - $container->addResource(new FileResource(__DIR__ . '/../Resources/config/' . $file)); } $container->setParameter('contao.prepend_locale', $mergedConfig['prepend_locale']);
[Core] No need to add YAML to container resources, the loader does it already
contao_contao
train
php
a9f34b0500ba6adfd89c490515560e0e8abac85f
diff --git a/src/consumer/subscriptionState.js b/src/consumer/subscriptionState.js index <HASH>..<HASH> 100644 --- a/src/consumer/subscriptionState.js +++ b/src/consumer/subscriptionState.js @@ -74,22 +74,24 @@ module.exports = class SubscriptionState { } /** - * @returns {Array<TopicPartitions>} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }] + * @returns {Array<TopicPartitions>} topicPartitions + * Example: [{ topic: 'topic-name', partitions: [1, 2] }] */ assigned() { return Object.values(this.assignedPartitionsByTopic).map(({ topic, partitions }) => ({ topic, - partitions, + partitions: partitions.sort(), })) } /** - * @returns {Array<TopicPartitions>} topicPartitions Example: [{ topic: 'topic-name', partitions: [1, 2] }] + * @returns {Array<TopicPartitions>} topicPartitions + * Example: [{ topic: 'topic-name', partitions: [1, 2] }] */ active() { return Object.values(this.assignedPartitionsByTopic).map(({ topic, partitions }) => ({ topic, - partitions: partitions.filter(partition => !this.isPaused(topic, partition)), + partitions: partitions.filter(partition => !this.isPaused(topic, partition)).sort(), })) }
Always return the list of partitions with stable order
tulios_kafkajs
train
js
bb20bad365119cb29f3d76b2f2efc65d4cd3841b
diff --git a/chef/lib/chef/provider/package/pkg.rb b/chef/lib/chef/provider/package/pkg.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/package/pkg.rb +++ b/chef/lib/chef/provider/package/pkg.rb @@ -37,11 +37,10 @@ class Chef when /^#{@new_resource.package_name}-(.+)/ @current_resource.version($1) Chef::Log.debug("Current version is #{@current_resource.version}") - else - @current_resource.version(nil) end end end + @current_resource.version(nil) unless @current_resource.version unless status.exitstatus == 0 || status.exitstatus == 1 raise Chef::Exception::Package, "pkg_info -E #{@new_resource.package_name} failed - #{status.inspect}!" @@ -59,13 +58,9 @@ class Chef case line when /^PORTVERSION=\s+(\S+)/ @candidate_version = $1 + Chef::Log.debug("Candidate version is #{@candidate_version}") end end - - @current_resource.version($1) - Chef::Log.debug("Current version is #{@current_resource.version}") - else - @current_resource.version(nil) end end end
clean up some unneeded code paths in Chef::Package::Pkg
chef_chef
train
rb
18275ae265e41c34e6731893eacc626833752e44
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -130,11 +130,12 @@ setup( 'scripts/mm_project'], include_dirs = [numpy.get_include()], ext_modules = [cocovar_module], - data_files = [('emma2', ['emma2.cfg'])], + data_files = [('emma2', ['emma2.cfg']), + # TODO: make this somehow choose the latest version available. + ('lib', + ['lib/stallone/stallone-1.0-SNAPSHOT-jar-with-dependencies.jar'])], # runtime dependencies install_requires = ['numpy >=1.8.0', 'scipy >=0.11', - 'JCC >=2.17'], - # build time dependencies - requires = ['JCC (>=2.17)'], + 'JPype1 >= 0.5.4.5'], )
[setup] install stallone lib to lib dir in emma2 egg. Removed jcc dependencies
markovmodel_PyEMMA
train
py
5c360a8b0c2b60f0818d355f4f094f7156c86e9d
diff --git a/fluid-ws-java-client/src/main/java/com/fluid/ws/client/v1/ABaseClientWS.java b/fluid-ws-java-client/src/main/java/com/fluid/ws/client/v1/ABaseClientWS.java index <HASH>..<HASH> 100644 --- a/fluid-ws-java-client/src/main/java/com/fluid/ws/client/v1/ABaseClientWS.java +++ b/fluid-ws-java-client/src/main/java/com/fluid/ws/client/v1/ABaseClientWS.java @@ -7,6 +7,7 @@ import java.net.URLEncoder; import java.net.UnknownHostException; import java.util.List; +import com.fluid.GitDescribe; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; @@ -781,4 +782,13 @@ public class ABaseClientWS { protected final boolean isEmpty(String textParam) { return (textParam == null) ? true : textParam.trim().isEmpty(); } + + /** + * + * @return + */ + public String getFluidAPIVersion() + { + return GitDescribe.GIT_DESCRIBE; + } }
Added a version fetcher for API.
Koekiebox-PTY-LTD_Fluid
train
java
0f135f0bf06b23c197109723016f1a6019356813
diff --git a/core/src/main/java/com/digitalpebble/storm/crawler/util/MetadataTransfer.java b/core/src/main/java/com/digitalpebble/storm/crawler/util/MetadataTransfer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/digitalpebble/storm/crawler/util/MetadataTransfer.java +++ b/core/src/main/java/com/digitalpebble/storm/crawler/util/MetadataTransfer.java @@ -25,7 +25,6 @@ import org.apache.commons.lang.StringUtils; import clojure.lang.PersistentVector; import com.digitalpebble.storm.crawler.Metadata; -import com.digitalpebble.storm.crawler.filtering.URLFilter; /** * Implements the logic of how the metadata should be passed to the outlinks, @@ -103,7 +102,7 @@ public class MetadataTransfer { return transferInstance; } - void configure(Map<String, Object> conf) { + protected void configure(Map<String, Object> conf) { trackPath = ConfUtils.getBoolean(conf, trackPathParamName, true);
MetadataTransfer : bugfix - configure method should be protected
DigitalPebble_storm-crawler
train
java
e29fa0c8e27bc7b7bd6e397b1897a8d56c70e94f
diff --git a/lib/defaults.php b/lib/defaults.php index <HASH>..<HASH> 100644 --- a/lib/defaults.php +++ b/lib/defaults.php @@ -23,6 +23,7 @@ "maxeditingtime" => 1800, "changepassword" => true, "country" => "", + "prefix" => "", "guestloginbutton" => 1, "debug" => 7 );
Add default prefix (for tables) of "" for upgraders
moodle_moodle
train
php
505602a4277503ccf52a901d6d6c01353aca02e0
diff --git a/src/Gerrie/Gerrie.php b/src/Gerrie/Gerrie.php index <HASH>..<HASH> 100644 --- a/src/Gerrie/Gerrie.php +++ b/src/Gerrie/Gerrie.php @@ -431,7 +431,7 @@ class Gerrie { } // Clear the temp tables. The data is not needed anymore - //$this->cleanupTempTables(); + $this->cleanupTempTables(); $this->setTime('end'); $this->outputEndStatistics();
Activated cleanup of temp tables again
andygrunwald_Gerrie
train
php
5e291c6c2bd3c4dde2613164f14632e3639c6c57
diff --git a/packages/cucumber-browserstack-example/nightwatch.conf.js b/packages/cucumber-browserstack-example/nightwatch.conf.js index <HASH>..<HASH> 100644 --- a/packages/cucumber-browserstack-example/nightwatch.conf.js +++ b/packages/cucumber-browserstack-example/nightwatch.conf.js @@ -13,6 +13,8 @@ module.exports = { desiredCapabilities: { 'browserstack.user': process.env.BROWSERSTACK_USERNAME, 'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY, + os: 'Windows', + os_version: '10', browserName: 'chrome', javascriptEnabled: true, acceptSslCerts: true,
set windows <I> as platform for browserstack tests
mucsi96_nightwatch-api
train
js
bcc23b7a1c9643047717c8879373afbaefe02006
diff --git a/python_modules/dagster/dagster/scheduler/sensor.py b/python_modules/dagster/dagster/scheduler/sensor.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster/dagster/scheduler/sensor.py +++ b/python_modules/dagster/dagster/scheduler/sensor.py @@ -144,7 +144,7 @@ def execute_sensor_iteration_loop( not handle_manager or (start_time - manager_loaded_time) > RELOAD_LOCATION_MANAGER_INTERVAL ): - stack.pop_all() # remove the previous context + stack.close() # remove the previous context handle_manager = stack.enter_context( RepositoryLocationHandleManager(grpc_server_registry) )
Fix sensor loop handle cleanup Summary: TIL that pop_stack doesn't actually close the contextmanagers in the stack! <URL>. Resolves <URL>, CTRL-C the daemon, daemon no longer hangs. Reviewers: prha, johann, alangenfeld Reviewed By: johann Differential Revision: <URL>
dagster-io_dagster
train
py
d08628d8951e35d015a66acee5e8dfb1fe453e06
diff --git a/src/bundle/Controller/LanguageController.php b/src/bundle/Controller/LanguageController.php index <HASH>..<HASH> 100644 --- a/src/bundle/Controller/LanguageController.php +++ b/src/bundle/Controller/LanguageController.php @@ -186,8 +186,7 @@ class LanguageController extends Controller public function editAction(Request $request, Language $language): Response { $form = $this->formFactory->updateLanguage( - new LanguageUpdateData($language), - 'ezplatform.language.view' + new LanguageUpdateData($language) ); $form->handleRequest($request);
EZP-<I>: Can't edit language because of Internal Server Error
ezsystems_ezplatform-admin-ui
train
php
a1c0e3374f874ee0a9aaa9818dcc867388967c17
diff --git a/green/cmdline.py b/green/cmdline.py index <HASH>..<HASH> 100644 --- a/green/cmdline.py +++ b/green/cmdline.py @@ -167,7 +167,6 @@ def main(testing=False, coverage_testing=False): cov.stop() cov.save() cov.combine() - cov.save() cov.report(file=stream, omit=omit) return(int(not result.wasSuccessful()))
Removed a redundant coverage call.
CleanCut_green
train
py
948cc0bb19762f1cb78b89b5048dee8a477cdfb1
diff --git a/wp-cxense.php b/wp-cxense.php index <HASH>..<HASH> 100644 --- a/wp-cxense.php +++ b/wp-cxense.php @@ -1,7 +1,7 @@ <?php /** * Plugin Name: WP cXense - * Version: 1.1.16 + * Version: 1.1.17 * Plugin URI: https://github.com/BenjaminMedia/wp-cxense * Description: This plugin integrates your site with cXense by adding meta tags and calling the cXense api * Author: Bonnier - Alf Henderson
Bumped plugin version to <I>
BenjaminMedia_wp-cxense
train
php
9597196df97e33028675c784f7219be1f856f0b0
diff --git a/juju/utils.py b/juju/utils.py index <HASH>..<HASH> 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -115,6 +115,8 @@ class IdQueue: async def block_until(*conditions, timeout=None, wait_period=0.5): """Return only after all conditions are true. + If a timeout occurs, it cancels the task and raises + asyncio.TimeoutError. """ async def _block(): @@ -125,7 +127,8 @@ async def block_until(*conditions, timeout=None, wait_period=0.5): async def block_until_with_coroutine(condition_coroutine, timeout=None, wait_period=0.5): """Return only after the given coroutine returns True. - + If a timeout occurs, it cancels the task and raises + asyncio.TimeoutError. """ async def _block(): while not await condition_coroutine():
Minor comments on docs for block_until related functions.
juju_python-libjuju
train
py
e4edbd8b60a608adbaf44242977f585093a43462
diff --git a/core/base/Boot.php b/core/base/Boot.php index <HASH>..<HASH> 100644 --- a/core/base/Boot.php +++ b/core/base/Boot.php @@ -213,7 +213,7 @@ abstract class Boot $require = require_once(dirname($this->_baseYiiFile) . DIRECTORY_SEPARATOR . 'BaseYii.php'); - include($this->getCoreBasePath() . '/Yii.php'); + require_once($this->getCoreBasePath() . '/Yii.php'); Yii::setAlias('@luya', $this->getCoreBasePath()); return $require;
use require once in order to fix multi loading.
luyadev_luya
train
php