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
c6fe110a987c62f38a878e2600c0be232e2001f4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -168,12 +168,8 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: ISC License (ISCL)', 'Natural Language :: English', - "Programming Language :: Python :: 2", - 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', ], test_suite='tests', tests_require=test_requirements,
Update classifiers to show that we only support python <I> right now
sqreen_PyMiniRacer
train
py
4c14b92e820045187d1b2e7de6fc7a10e73e9a00
diff --git a/spec/adhearsion/call_controller/dial_spec.rb b/spec/adhearsion/call_controller/dial_spec.rb index <HASH>..<HASH> 100644 --- a/spec/adhearsion/call_controller/dial_spec.rb +++ b/spec/adhearsion/call_controller/dial_spec.rb @@ -9,11 +9,11 @@ module Adhearsion let(:to) { 'sip:foo@bar.com' } let(:other_call_id) { new_uuid } - let(:other_mock_call) { flexmock OutboundCall.new, :id => other_call_id } + let(:other_mock_call) { flexmock OutboundCall.new, :id => other_call_id, :write_command => true } let(:second_to) { 'sip:baz@bar.com' } let(:second_other_call_id) { new_uuid } - let(:second_other_mock_call) { flexmock OutboundCall.new, :id => second_other_call_id } + let(:second_other_mock_call) { flexmock OutboundCall.new, :id => second_other_call_id, :write_command => true } let(:mock_answered) { Punchblock::Event::Answered.new }
[BUGFIX] Ensure calls never actually execute a command in dial specs
adhearsion_adhearsion
train
rb
526c2cc4447475e676be3ace418943e0dc953f97
diff --git a/app/SymfonyRequirements.php b/app/SymfonyRequirements.php index <HASH>..<HASH> 100644 --- a/app/SymfonyRequirements.php +++ b/app/SymfonyRequirements.php @@ -413,7 +413,7 @@ class SymfonyRequirements extends RequirementCollection if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { $this->addRequirement( - (in_array(date_default_timezone_get(), \DateTimeZone::listIdentifiers())), + (in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())), sprintf('Default timezone is deprecated (%s)', date_default_timezone_get()), 'Fix your <strong>php.ini</strong> file (list of deprecated timezones http://us.php.net/manual/en/timezones.others.php).' );
removed a backslash to avoid problem with PHP <I>
symfony_symfony-standard
train
php
d8b0ff586cf01fb17da84286eb6bf0e71a92224f
diff --git a/indra/sources/tas/processor.py b/indra/sources/tas/processor.py index <HASH>..<HASH> 100644 --- a/indra/sources/tas/processor.py +++ b/indra/sources/tas/processor.py @@ -40,6 +40,7 @@ class TasProcessor(object): return Agent(name, db_refs=refs) def _extract_protein(self, name, gene_id): + refs = {'EGID': gene_id} hgnc_id = hgnc_client.get_hgnc_from_entrez(gene_id) if hgnc_id is not None: refs['HGNC'] = hgnc_id
Fix constructing protein refs in TAS
sorgerlab_indra
train
py
3ed62e5bd403f1d9710b1182278a9942fd59df34
diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index <HASH>..<HASH> 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -888,6 +888,12 @@ class XCCClient(IMMClient): yield self.get_disk_firmware(diskent) elif mode==1: yield self.get_disk_hardware(diskent) + if mode == 1: + bdata = {'Description': 'Unmanaged Disk'} + if adp.get('m2Type', -1) == 2: + yield ('M.2 Disk', bdata) + for umd in adp.get('unmanagedDisks', []): + yield ('Disk {0}'.format(umd['slotNo']), bdata) def get_disk_hardware(self, diskent, prefix=''): bdata = {}
Add detected, but unknown disks SATA attached disks can show presence, provide recognition of detected, but unmanaged disks. Change-Id: I<I>ed2fe9dc9cc0d<I>bfd4e<I>bc<I>b1f5fa
openstack_pyghmi
train
py
2577f0c433b542bf619828da615c44ef4280c1ae
diff --git a/aws/resource_aws_elasticache_cluster_test.go b/aws/resource_aws_elasticache_cluster_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_elasticache_cluster_test.go +++ b/aws/resource_aws_elasticache_cluster_test.go @@ -36,7 +36,10 @@ func testSweepElasticacheClusters(region string) error { } conn := client.(*AWSClient).elasticacheconn - err = conn.DescribeCacheClustersPages(&elasticache.DescribeCacheClustersInput{}, func(page *elasticache.DescribeCacheClustersOutput, isLast bool) bool { + input := &elasticache.DescribeCacheClustersInput{ + ShowCacheClustersNotInReplicationGroups: aws.Bool(true), + } + err = conn.DescribeCacheClustersPages(input, func(page *elasticache.DescribeCacheClustersOutput, isLast bool) bool { if len(page.CacheClusters) == 0 { log.Print("[DEBUG] No ElastiCache Replicaton Groups to sweep") return false
Excludes Clusters in Replication Groups from sweeper
terraform-providers_terraform-provider-aws
train
go
8bc0853b21ed4b9797ac8dc4fef3956d7b00f36f
diff --git a/dipper/sources/EOM.py b/dipper/sources/EOM.py index <HASH>..<HASH> 100644 --- a/dipper/sources/EOM.py +++ b/dipper/sources/EOM.py @@ -45,7 +45,7 @@ class EOM(PostgreSQLSource): files = { 'map': { 'file': 'hp-to-eom-mapping.tsv', - 'url': 'https://phenotype-ontologies.googlecode.com/svn/trunk/src/ontology/hp/mappings/hp-to-eom-mapping.tsv' + 'url': 'https://raw.githubusercontent.com/obophenotype/human-phenotype-ontology/master/src/mappings/hp-to-eom-mapping.tsv' } } @@ -162,7 +162,7 @@ class EOM(PostgreSQLSource): subcategory, objective_definition, subjective_definition, comments, synonyms, replaces, small_figure_url, large_figure_url, e_uid, v_uid, v_uuid, - v_last_modified) = line + v_last_modified,v_status, v_lastmodified_epoch) = line # note: # e_uid v_uuid v_last_modified terminology_category_url
change url for mapping file from google code to github, add in two addtional columns in ingest file
monarch-initiative_dipper
train
py
74797a2ac80ca0375a02c4a8b38a972bfa19c9f2
diff --git a/util/kube/kube.go b/util/kube/kube.go index <HASH>..<HASH> 100644 --- a/util/kube/kube.go +++ b/util/kube/kube.go @@ -109,7 +109,10 @@ func DeleteResourceWithLabel(config *rest.Config, namespace string, labelSelecto if err != nil { return err } - err = dclient.Resource(&apiResource, namespace).DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: labelSelector}) + propagationPolicy := metav1.DeletePropagationForeground + err = dclient.Resource(&apiResource, namespace).DeleteCollection(&metav1.DeleteOptions{ + PropagationPolicy: &propagationPolicy, + }, metav1.ListOptions{LabelSelector: labelSelector}) if err != nil && !apierr.IsNotFound(err) { return err }
Delete child dependents while deleting app resources (#<I>)
argoproj_argo-cd
train
go
c28e9722d4bbfa82fde79ea2fc81965bd4bcf12e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ license: GNU-GPL2 from setuptools import setup setup(name='arguments', - version='23', + version='24', description='Argument parser based on docopt', url='https://github.com/erikdejonge/arguments', author='Erik de Jonge',
pip Monday <I> March <I> (week:<I> day:<I>), <I>:<I>:<I>
erikdejonge_arguments
train
py
2e7861ea287d5f597158e82748c5557bc2c7a10e
diff --git a/lib/gopher2000/rendering/base.rb b/lib/gopher2000/rendering/base.rb index <HASH>..<HASH> 100644 --- a/lib/gopher2000/rendering/base.rb +++ b/lib/gopher2000/rendering/base.rb @@ -119,6 +119,12 @@ module Gopher underline(@width, under) end + def small_header(str, under = '=') + str = " " + str + " " + text(str) + underline(str.length, under) + end + # # output a centered string in a box # @param [String] str the string to output
add #small_header -- an underlined chunk of text
muffinista_gopher2000
train
rb
9bb1617e8324bcf68243d05aae44e435e5a75028
diff --git a/Entity/Post.php b/Entity/Post.php index <HASH>..<HASH> 100644 --- a/Entity/Post.php +++ b/Entity/Post.php @@ -94,7 +94,7 @@ class Post extends Statusable /** * @var Tag[]|ArrayCollection * - * @ORM\ManyToMany(targetEntity="Icap\BlogBundle\Entity\Tag", inversedBy="posts", cascade={"all"}) + * @ORM\ManyToMany(targetEntity="Icap\BlogBundle\Entity\Tag", inversedBy="posts", cascade={"persist"}) * @ORM\JoinTable(name="icap__blog_post_tag") */ protected $tags; diff --git a/Entity/Tag.php b/Entity/Tag.php index <HASH>..<HASH> 100644 --- a/Entity/Tag.php +++ b/Entity/Tag.php @@ -29,7 +29,7 @@ class Tag protected $name; /** - * @ORM\ManyToMany(targetEntity="Post", mappedBy="tags", cascade={"all"}) + * @ORM\ManyToMany(targetEntity="Post", mappedBy="tags") */ private $posts;
[BlogBundle] Correct cascade for avoiding cascade removing
claroline_Distribution
train
php,php
baa58c4069faf9504dc82b3ff4f0db7a6a3ac31e
diff --git a/trump/orm.py b/trump/orm.py index <HASH>..<HASH> 100644 --- a/trump/orm.py +++ b/trump/orm.py @@ -1472,6 +1472,13 @@ class Feed(Base, ReprMixin): if hdlrp: reporter.add_handlepoint(hdlrp) return reporter + def _note_session(self): + self.ses = object_session(self) + +@event.listens_for(Feed, 'load') +def __receive_load(target, context): + """ saves the session upon being queried """ + target._note_session() class FeedTag(Base, ReprMixin): __tablename__ = '_feed_tags'
Give the Feed a session on load
Equitable_trump
train
py
a8e65a54cb339b1a2bb443d3459ae9513d841c6c
diff --git a/src/view/component.js b/src/view/component.js index <HASH>..<HASH> 100644 --- a/src/view/component.js +++ b/src/view/component.js @@ -291,8 +291,6 @@ function Component(options) { // eslint-disable-line // #[begin] reverse var reverseWalker = options.reverseWalker; if (this.el || reverseWalker) { - this._toPhase('beforeCreate'); - var RootComponentType = this.components[ this.aNode.directives.is ? evalExpr(this.aNode.directives.is.value, this.data) : this.aNode.tagName ]; @@ -324,7 +322,6 @@ function Component(options) { // eslint-disable-line this._toPhase('created'); - this._toPhase('beforeAttach'); this._attached(); this._toPhase('attached'); }
Add component lifecycle in dev for devtools.
baidu_san
train
js
b32df632da4268eb3e06e3baf8dba870227a9604
diff --git a/syntax/printer_test.go b/syntax/printer_test.go index <HASH>..<HASH> 100644 --- a/syntax/printer_test.go +++ b/syntax/printer_test.go @@ -70,7 +70,10 @@ var printTests = []printCase{ {"foo\n\n", "foo"}, {"\n\nfoo", "foo"}, {"# foo \n # bar\t", "# foo\n# bar"}, - {"#", "#"}, + samePrint("#"), + samePrint("#c1\\\n#c2"), + samePrint("#\\\n#"), + samePrint("foo\\\\\nbar"), samePrint("a=b # inline\nbar"), samePrint("a=$(b) # inline"), samePrint("foo # inline\n# after"),
syntax: add regression tests involving backslashes See the previous commit for context.
mvdan_sh
train
go
0769e770c3094c105013554b8b76c06a0025d78f
diff --git a/lib/collection.js b/lib/collection.js index <HASH>..<HASH> 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -38,6 +38,7 @@ function Collection(options) { }; +Collection.prototype.forEach = forEach; Collection.prototype.find = find; Collection.prototype.findAll = findAll; Collection.prototype.remove = remove; @@ -369,3 +370,20 @@ function removeAll(filter) { return count; } + + +/** +Same as collection.items.forEach but using a yieldable action +*/ +function * forEach(action) { + var i; + var ilen; + + if (!(action instanceof Function)) { + throw CollectionException('Action must be a function'); + } + + for (i = 0, ilen = this.items.length; i < ilen; ++i) { + yield action(this.items[i], i); + } +} diff --git a/lib/model.js b/lib/model.js index <HASH>..<HASH> 100644 --- a/lib/model.js +++ b/lib/model.js @@ -355,6 +355,7 @@ function Model(data, exists) { } } + this._isDirty = false; // overwrite... } util.inherits(Model, EventEmitter);
Model isDirty set to false on instanciate. Added async collection foreach
beyo_model
train
js,js
1788cc6b6dbdd1f0ad05c385498e2e40f09cfe9c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: setup( name='ibmiotf', - version="0.1.3", + version="0.1.5", author='David Parker', author_email='parkerda@uk.ibm.com', package_dir={'': 'src'}, diff --git a/src/ibmiotf/__init__.py b/src/ibmiotf/__init__.py index <HASH>..<HASH> 100644 --- a/src/ibmiotf/__init__.py +++ b/src/ibmiotf/__init__.py @@ -26,7 +26,7 @@ from datetime import datetime from pkg_resources import get_distribution from encodings.base64_codec import base64_encode -__version__ = "0.1.3" +__version__ = "0.1.5" class Message: def __init__(self, data, timestamp=None):
Set version to <I> in master
ibm-watson-iot_iot-python
train
py,py
7b2d7d41f0c973473209b4c6e7255dc36e106325
diff --git a/i3ipc.py b/i3ipc.py index <HASH>..<HASH> 100644 --- a/i3ipc.py +++ b/i3ipc.py @@ -526,6 +526,10 @@ class Con(object): return [c for c in self.descendents() if c.mark and re.search(pattern, c.mark)] + def find_fullscreen(self): + return [c for c in self.descendents() + if c.type == 'con' and c.fullscreen_mode] + def workspace(self): ret = self.parent
Add find_fullscreen() to Con find_fullscreen() finds any descendent containers that are in fullscreen mode. It skips workspaces and outputs.
acrisci_i3ipc-python
train
py
1b8579936a854dfb84aca998ce17862b1a3135b0
diff --git a/grimoire_elk/enriched/stackexchange.py b/grimoire_elk/enriched/stackexchange.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/enriched/stackexchange.py +++ b/grimoire_elk/enriched/stackexchange.py @@ -86,19 +86,17 @@ class StackExchangeEnrich(Enrich): def get_identities(self, item): """ Return the identities from an item """ - identities = [] item = item['data'] for identity in ['owner']: if identity in item and item[identity]: user = self.get_sh_identity(item[identity]) - identities.append(user) + yield user if 'answers' in item: for answer in item['answers']: user = self.get_sh_identity(answer[identity]) - identities.append(user) - return identities + yield user @metadata def get_rich_item(self, item, kind='question', question_tags=None):
[enrich-stackexchange] Replace list with yield This code replaces the list used in the method get_identities with a yield, thus reducing the memory footprint.
chaoss_grimoirelab-elk
train
py
f5cc77b11b736cad1d3e024676b9577a33c9c874
diff --git a/metric_tank/dataprocessor.go b/metric_tank/dataprocessor.go index <HASH>..<HASH> 100644 --- a/metric_tank/dataprocessor.go +++ b/metric_tank/dataprocessor.go @@ -6,7 +6,9 @@ import ( "github.com/grafana/grafana/pkg/log" "github.com/raintank/raintank-metric/metric_tank/consolidation" "math" + "math/rand" "runtime" + "time" ) // doRecover is the handler that turns panics into returns from the top level of getTarget. @@ -254,6 +256,9 @@ func getSeries(store Store, key string, consolidator consolidation.Consolidator, } } if oldest > fromUnix { + if rand.Uint32()%50 == 0 { + log.Info("cassandra needed for %s %d - %d span=%ds now=%d oldest=%d", key, fromUnix, toUnix, toUnix-fromUnix-1, time.Now().Unix(), oldest) + } reqSpanBoth.Value(int64(toUnix - fromUnix)) if consolidator != consolidation.None { key = aggMetricKey(key, consolidator.Archive(), aggSpan)
sampled justifications why cassandra is needed
grafana_metrictank
train
go
16f929b8b65ff38f53183847c8e5a10441928b3b
diff --git a/telethon/utils.py b/telethon/utils.py index <HASH>..<HASH> 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -321,7 +321,11 @@ def get_peer_id(peer, add_mark=False): i = peer.channel_id # IDs will be strictly positive -> log works return -(i + pow(10, math.floor(math.log10(i) + 3))) - _raise_cast_fail(peer, 'int') + # Maybe a full entity was given and we just need its ID + try: + return get_peer_id(get_input_peer(peer), add_mark=add_mark) + except ValueError: + _raise_cast_fail(peer, 'int') def resolve_id(marked_id):
Fix .get_peer_id not working with full entities
LonamiWebs_Telethon
train
py
848d9b86837755e9810ab803a08c6e5c4f868ac0
diff --git a/lib/aclosure.js b/lib/aclosure.js index <HASH>..<HASH> 100644 --- a/lib/aclosure.js +++ b/lib/aclosure.js @@ -38,8 +38,7 @@ function aclosure (src, dest, options = {}) { ) let compiled = yield new Promise((resolve, reject) => { compiler.run((exitCode, stdOut, stdErr) => { - console.error(stdErr) - exitCode === 0 ? resolve(stdOut) : reject(stdErr) + exitCode === 0 ? resolve(stdOut) : reject(new Error(stdErr)) }) }) let result = yield writeout(dest, compiled.toString(), { diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,7 @@ /** * Closure compiler wrapper * @module aclosure - * @version 2.0.2 + * @version 2.0.3 */ 'use strict' diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aclosure", - "version": "2.0.3", + "version": "2.0.4", "description": "Closure compiler wrapper", "main": "lib", "browser": false,
Version incremented to <I>
a-labo_aclosure
train
js,js,json
6fc4ba62d2decca99eda6334ce995dd33d4d72af
diff --git a/lib/zold/node/front.rb b/lib/zold/node/front.rb index <HASH>..<HASH> 100755 --- a/lib/zold/node/front.rb +++ b/lib/zold/node/front.rb @@ -183,7 +183,7 @@ while #{settings.address} is in '#{settings.network}'" platform: RUBY_PLATFORM, load: Usagewatch.uw_load.to_f, threads: "#{Thread.list.select { |t| t.status == 'run' }.count}/#{Thread.list.count}", - wallets: Cachy.cache(:a_key, expires_in: 5 * 60) { settings.wallets.all.count }, + wallets: Cachy.cache(:a_wallets, expires_in: 5 * 60) { settings.wallets.all.count }, remotes: settings.remotes.all.count, nscore: settings.remotes.all.map { |r| r[:score] }.inject(&:+) || 0, farm: settings.farm.to_json, @@ -425,7 +425,7 @@ while #{settings.address} is in '#{settings.network}'" end def score - best = settings.farm.best + best = Cachy.cache(:a_score, expires_in: 60) { settings.farm.best } raise 'Score is empty, there is something wrong with the Farm!' if best.empty? best[0] end
#<I> cache score in front
zold-io_zold
train
rb
09b649872b360de524ecfeb291b08924fd9cede3
diff --git a/tonnikala/languages/python/generator.py b/tonnikala/languages/python/generator.py index <HASH>..<HASH> 100644 --- a/tonnikala/languages/python/generator.py +++ b/tonnikala/languages/python/generator.py @@ -435,6 +435,9 @@ class PyComplexExprNode(PyComplexNode): class PyBlockNode(PyComplexNode): def __init__(self, name): super(PyBlockNode, self).__init__() + if not isinstance(name, str): + name = name.encode('UTF-8') # python 2 + self.name = name
fixed the name: needs to be utf8 for python 2
tetframework_Tonnikala
train
py
ba44cce8fc2208d7df5f29fdd6b71d3b96bb0144
diff --git a/jsonschema/validators.py b/jsonschema/validators.py index <HASH>..<HASH> 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -149,8 +149,11 @@ def create(meta_schema, validators=(), version=None, default_types=None): raise UnknownType(type, instance, self.schema) pytypes = self._types[type] + # FIXME: draft < 6 + if isinstance(instance, float) and type == "integer": + return instance.is_integer() # bool inherits from int, so ensure bools aren't reported as ints - if isinstance(instance, bool): + elif isinstance(instance, bool): pytypes = _utils.flatten(pytypes) is_number = any( issubclass(pytype, numbers.Number) for pytype in pytypes
zeroTerminatedFloats. That's a really annoying change...
Julian_jsonschema
train
py
1ba1e89445e400c9e9e3f3dd173060e60f91ab6b
diff --git a/lib/spatial_features/models/feature.rb b/lib/spatial_features/models/feature.rb index <HASH>..<HASH> 100644 --- a/lib/spatial_features/models/feature.rb +++ b/lib/spatial_features/models/feature.rb @@ -45,7 +45,7 @@ class Feature < ActiveRecord::Base end def self.cache_derivatives(options = {}) - options.reverse_merge! :lowres_simplification => 0.0001, :lowres_precision => 5 + options.reverse_merge! :lowres_simplification => 0.00001, :lowres_precision => 5 update_all("area = ST_Area(geog), geom = ST_Transform(geog::geometry, 26910), diff --git a/lib/spatial_features/version.rb b/lib/spatial_features/version.rb index <HASH>..<HASH> 100644 --- a/lib/spatial_features/version.rb +++ b/lib/spatial_features/version.rb @@ -1,3 +1,3 @@ module SpatialFeatures - VERSION = "1.4.5" + VERSION = "1.4.6" end
Decrease default simplification tolerance. It was oversimplifying some shapes that it shouldn't have.
culturecode_spatial_features
train
rb,rb
faedd191ccb8ad00399144d62f4c25d03c09dbdb
diff --git a/src/helpers.js b/src/helpers.js index <HASH>..<HASH> 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -259,17 +259,19 @@ function formatValue(pre, value, options, axis) { } } - if (precision !== undefined) { - value = value.toPrecision(precision); - value = parseFloat(value).toString(); // no insignificant zeros - } + if (!axis) { + if (precision !== undefined) { + value = value.toPrecision(precision); + value = parseFloat(value).toString(); // no insignificant zeros + } - if (options.round !== undefined) { - if (options.round < 0) { - let num = Math.pow(10, -1 * options.round); - value = parseInt((1.0 * value / num).toFixed(0)) * num; - } else { - value = parseFloat(value.toFixed(options.round)); + if (options.round !== undefined) { + if (options.round < 0) { + let num = Math.pow(10, -1 * options.round); + value = parseInt((1.0 * value / num).toFixed(0)) * num; + } else { + value = parseFloat(value.toFixed(options.round)); + } } }
No need to apply precision or rounding to axis
ankane_chartkick.js
train
js
164012f7c975e4fb9c7fb1f7d4e581e2b2a4b16c
diff --git a/lib/input-plugins.js b/lib/input-plugins.js index <HASH>..<HASH> 100644 --- a/lib/input-plugins.js +++ b/lib/input-plugins.js @@ -9,6 +9,14 @@ const nunjucks = require('nunjucks'); */ nunjucks.configure({ autoescape: true }); +/* + * Common tests for input plugins + * + * @param {object} test ava test runner + * @param {object} plugin input plugin + * + * @returns {object} plugin input plugin + */ module.exports = function pluginTests(test, plugin) { let validation = []; let inputs = [];
:unamused: add jsdoc to trigger semantic release
punchcard-cms_shared-tests
train
js
0bea428228bc97c145d06afaea26a7344711790f
diff --git a/tests/test_sqlalchemy_athena.py b/tests/test_sqlalchemy_athena.py index <HASH>..<HASH> 100644 --- a/tests/test_sqlalchemy_athena.py +++ b/tests/test_sqlalchemy_athena.py @@ -272,6 +272,12 @@ class TestSQLAlchemyAthena(unittest.TestCase): self.assertIsInstance(one_row_complex.c.col_decimal.type, DECIMAL) @with_engine() + def test_select_offset_limit(self, engine, conn): + many_rows = Table("many_rows", MetaData(), autoload_with=conn) + rows = conn.execute(many_rows.select().offset(10).limit(5)).fetchall() + self.assertEqual(rows, [(i,) for i in range(10, 15)]) + + @with_engine() def test_reserved_words(self, engine, conn): """Presto uses double quotes, not backticks""" fake_table = Table(
Add test cases for offset and limit clauses
laughingman7743_PyAthena
train
py
e93fd650587bfbf9495c489e77f59b97a7a526e9
diff --git a/yModel/mongo.py b/yModel/mongo.py index <HASH>..<HASH> 100644 --- a/yModel/mongo.py +++ b/yModel/mongo.py @@ -175,7 +175,7 @@ class MongoTree(MongoSchema, Tree): else: ValidationError("Unexpected child model: {} vs {}".format(child.__name__, self.children_models[as_])) - async def children(self, member, models, sort = None, exclude = None): + async def children(self, member, models, sort = None): if not self.table: raise InvalidOperation("No table") @@ -197,10 +197,11 @@ class MongoTree(MongoSchema, Tree): aggregation = [{"$match": {"path": self.get_url(), "type": type_}}] if sort: aggregation.append(sort) + docs = await self.table.aggregate(aggregation).to_list(None) model_class = getattr(models, type_) - children = model_class(self.table, many = True, exclude = exclude or ()) + children = model_class(self.table, many = True) children.load(docs, many = True) return children
exclude fields has moved to the rendering of the information of the model
Garito_yModel
train
py
5b5a31e49e0826856beac570b1b0a7d8469eddd9
diff --git a/client/lib/post-normalizer/rule-content-make-images-safe.js b/client/lib/post-normalizer/rule-content-make-images-safe.js index <HASH>..<HASH> 100644 --- a/client/lib/post-normalizer/rule-content-make-images-safe.js +++ b/client/lib/post-normalizer/rule-content-make-images-safe.js @@ -60,7 +60,7 @@ function isCandidateForContentImage( imageUrl ) { } ); } -export default function( maxWidth ) { +export default function( maxWidth = false ) { return function makeImagesSafe( post, dom ) { let content_images = [], images; diff --git a/client/state/reader/posts/normalization-rules.js b/client/state/reader/posts/normalization-rules.js index <HASH>..<HASH> 100644 --- a/client/state/reader/posts/normalization-rules.js +++ b/client/state/reader/posts/normalization-rules.js @@ -156,7 +156,7 @@ const fastPostNormalizationRules = flow( [ withContentDom( [ removeStyles, removeElementsBySelector, - makeImagesSafe( READER_CONTENT_WIDTH ), + makeImagesSafe(), discoverFullBleedImages, makeEmbedsSafe, disableAutoPlayOnEmbeds,
Reader: Stop resizing images in content (#<I>) This was a misguided attempt to get bigger images for features, from a long time ago. Sadly, it breaks things that use photon or the wp image api to make images a specific size. We'll revisit this later if necessary.
Automattic_wp-calypso
train
js,js
d1cf28c02fc654c614d2dcafe4c05f3bb7947e7d
diff --git a/lib/jenkins_api_client/job.rb b/lib/jenkins_api_client/job.rb index <HASH>..<HASH> 100644 --- a/lib/jenkins_api_client/job.rb +++ b/lib/jenkins_api_client/job.rb @@ -285,7 +285,7 @@ module JenkinsApi is_building = @client.api_get_request( "/job/#{job_name}/#{build_number}" )["building"] - if is_building == "true" + if is_building @client.api_post_request("/job/#{job_name}/#{build_number}/stop") end end
Issue #<I> - [Job] - reverting previous changes as the API does return as true/false
arangamani_jenkins_api_client
train
rb
e37a615a94e7dcb50643f2d0adc25aa843ed4c84
diff --git a/modules/cms/menu/Item.php b/modules/cms/menu/Item.php index <HASH>..<HASH> 100644 --- a/modules/cms/menu/Item.php +++ b/modules/cms/menu/Item.php @@ -247,6 +247,17 @@ class Item extends \yii\base\Object } /** + * Get all sibilings for the current item + * + * @return array An array with all item-object siblings + * @since 1.0.0-beta3 + */ + public function getSiblings() + { + return (new Query())->where(['parent_nav_id' => $this->getParentNavId()])->with($this->_with)->all(); + } + + /** * Return all parent elemtns **with** the current item. * * @return array An array with Item-Objects.
Added ability to get cms menu item siblings. closes #<I>
luyadev_luya
train
php
cb450b673d994081b7d95e3b07c978537032c781
diff --git a/libsubmit/providers/cobalt/cobalt.py b/libsubmit/providers/cobalt/cobalt.py index <HASH>..<HASH> 100644 --- a/libsubmit/providers/cobalt/cobalt.py +++ b/libsubmit/providers/cobalt/cobalt.py @@ -182,8 +182,7 @@ class Cobalt(ExecutionProvider): raise(ep_error.ScriptPathError(script_filename, e )) try: - submit_script = Template(template_string).substitute(**configs, - jobname=job_name) + submit_script = Template(template_string).substitute(**configs) with open(script_filename, 'w') as f: f.write(submit_script)
Fixing issue with multiple attributes to site template generator
Parsl_libsubmit
train
py
4d70d7ea281c3a9b1be631cfb1fb2fd1c1733e4d
diff --git a/requests.go b/requests.go index <HASH>..<HASH> 100644 --- a/requests.go +++ b/requests.go @@ -91,7 +91,7 @@ func (c *Client) propfind(path string, self bool, body string, resp interface{}, } else { rq.Header.Add("Depth", "1") } - rq.Header.Add("Content-Type", "text/xml;charset=UTF-8") + rq.Header.Add("Content-Type", "application/xml;charset=UTF-8") rq.Header.Add("Accept", "application/xml,text/xml") rq.Header.Add("Accept-Charset", "utf-8") // TODO add support for 'gzip,deflate;q=0.8,q=0.7'
use 'application/xml' instead of 'text/xml'. related with (1) in #<I>
studio-b12_gowebdav
train
go
01af31d2dd28ca959866933ae2927b6feaac66e6
diff --git a/livereload/watcher.py b/livereload/watcher.py index <HASH>..<HASH> 100644 --- a/livereload/watcher.py +++ b/livereload/watcher.py @@ -138,9 +138,17 @@ class Watcher(object): return False def is_glob_changed(self, path, ignore=None): - for f in glob.glob(path): - if self.is_file_changed(f, ignore): - return True + try: + for f in glob.glob(path): + if self.is_file_changed(f, ignore): + return True + except TypeError: + """ + Problem: on every ~10 times for some reason the glob returns Path instead of a string + TODO: Rewrite this block to use the python Path alongside string + aka pathlib introduced in Python 3.4 + """ + return False
Patch for python <I> on GNU/Linux environment aka PosixPath
tjwalch_django-livereload-server
train
py
2275c83358986c9f612ebb1915c5d3392319f1f8
diff --git a/runtime.go b/runtime.go index <HASH>..<HASH> 100644 --- a/runtime.go +++ b/runtime.go @@ -363,7 +363,7 @@ func (runtime *Runtime) Create(config *runconfig.Config, name string) (*Containe warnings := []string{} if checkDeprecatedExpose(img.Config) || checkDeprecatedExpose(config) { - warnings = append(warnings, "The mapping to public ports on your host has been deprecated. Use -p to publish the ports.") + warnings = append(warnings, "The mapping to public ports on your host via Dockerfile EXPOSE (host:port:port) has been deprecated. Use -p to publish the ports.") } if img.Config != nil {
make the port mapping deprecation error message more obvious see <I> Docker-DCO-<I>-
moby_moby
train
go
7ad0006263dc4a0811f1ef50a5b09b78b1064027
diff --git a/app/models/alchemy/picture_variant.rb b/app/models/alchemy/picture_variant.rb index <HASH>..<HASH> 100644 --- a/app/models/alchemy/picture_variant.rb +++ b/app/models/alchemy/picture_variant.rb @@ -93,7 +93,7 @@ module Alchemy convert_format = render_format.sub("jpeg", "jpg") != picture.image_file_format.sub("jpeg", "jpg") - if render_format =~ /jpe?g/ && convert_format + if render_format =~ /jpe?g/ && (convert_format || options[:quality]) quality = options[:quality] || Config.get(:output_image_jpg_quality) encoding_options << "-quality #{quality}" end
Fix jpeg quality option for jpeg files The quality option was previously ignored if the image was a JPEG. Now the quality configuration will be added if the file isn't a JPEG or the quality option was set.
AlchemyCMS_alchemy_cms
train
rb
a28753d7532a5177b85ee0838de2f78bb128d6d0
diff --git a/troposphere/rds.py b/troposphere/rds.py index <HASH>..<HASH> 100644 --- a/troposphere/rds.py +++ b/troposphere/rds.py @@ -172,6 +172,7 @@ class DBInstance(AWSObject): 'AutoMinorVersionUpgrade': (boolean, False), 'AvailabilityZone': (basestring, False), 'BackupRetentionPeriod': (validate_backup_retention_period, False), + 'CACertificateIdentifier': (basestring, False), 'CharacterSetName': (basestring, False), 'CopyTagsToSnapshot': (boolean, False), 'DBClusterIdentifier': (basestring, False),
Add CACertificateIdentifier to DBInstance (#<I>)
cloudtools_troposphere
train
py
fcf715441261b0813192a98e454ffccfc22b19f4
diff --git a/src/Model/Behavior/Version/VersionTrait.php b/src/Model/Behavior/Version/VersionTrait.php index <HASH>..<HASH> 100644 --- a/src/Model/Behavior/Version/VersionTrait.php +++ b/src/Model/Behavior/Version/VersionTrait.php @@ -37,11 +37,16 @@ trait VersionTrait } $table = TableRegistry::get($this->source()); - $primaryKey = $table->primaryKey(); - - $conditions = [$primaryKey => $this->id]; - $entities = $table->find('versions', ['conditions' => $conditions]) - ->all(); + $primaryKey = (array)$table->primaryKey(); + + $query = $table->find('versions'); + $pkValue = $this->extract($primaryKey); + $conditions = []; + foreach ($pkValue as $key => $value) { + $field = current($query->aliasField($key)); + $conditions[$field] = $value; + } + $entities = $query->where($conditions)->all(); if (empty($entities)) { return [];
Fixed bug in VersionTrait where primary key was hardcoded to $entity->id.
josegonzalez_cakephp-version
train
php
778bb2351a80be6f42996bafaa830072e580c8e9
diff --git a/lib/drafter/creation.rb b/lib/drafter/creation.rb index <HASH>..<HASH> 100644 --- a/lib/drafter/creation.rb +++ b/lib/drafter/creation.rb @@ -16,6 +16,7 @@ module Drafter attrs = self.attributes serialize_attributes_to_draft unfuck_sti + self.draft.save! build_draft_uploads self.draft end @@ -26,7 +27,6 @@ module Drafter # https://github.com/rails/rails/issues/617 def unfuck_sti draft.draftable_type = self.class.to_s - self.draft.save! end # Set up the draft object, setting its :data attribute to the serialized
Saving is actually not part of the STI hack.
futurechimp_drafter
train
rb
ce13eaad2506bb913b7318b7d56477c04ac3b571
diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index <HASH>..<HASH> 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -42,6 +42,7 @@ class SupportStrTest extends PHPUnit_Framework_TestCase { public function testStartsWith() { $this->assertTrue(Str::startsWith('jason', 'jas')); + $this->assertTrue(Str::startsWith('jason', 'jason')); $this->assertTrue(Str::startsWith('jason', array('jas'))); $this->assertFalse(Str::startsWith('jason', 'day')); $this->assertFalse(Str::startsWith('jason', array('day'))); @@ -52,6 +53,7 @@ class SupportStrTest extends PHPUnit_Framework_TestCase { public function testEndsWith() { $this->assertTrue(Str::endsWith('jason', 'on')); + $this->assertTrue(Str::endsWith('jason', 'jason')); $this->assertTrue(Str::endsWith('jason', array('on'))); $this->assertFalse(Str::endsWith('jason', 'no')); $this->assertFalse(Str::endsWith('jason', array('no')));
Adding another test to string tests.
laravel_framework
train
php
a4c202ebf666f8aacb7f03950bf2e5f3ddc90667
diff --git a/Security/FacebookAuthenticator.php b/Security/FacebookAuthenticator.php index <HASH>..<HASH> 100755 --- a/Security/FacebookAuthenticator.php +++ b/Security/FacebookAuthenticator.php @@ -27,7 +27,7 @@ use Symfony\Component\Security\Guard\AbstractGuardAuthenticator; use WellCommerce\Bundle\ClientBundle\Entity\ClientInterface; use WellCommerce\Bundle\CoreBundle\Helper\Helper; use WellCommerce\Bundle\CoreBundle\Helper\Router\RouterHelperInterface; -use WellCommerce\Bundle\CoreBundle\Manager\ManagerInterface; +use WellCommerce\Bundle\DoctrineBundle\Manager\ManagerInterface; class FacebookAuthenticator extends AbstractGuardAuthenticator {
New managers, datasets, removed query builders
WellCommerce_WishlistBundle
train
php
91de1ff78cc31b2d58cf037e0460e91ea10026a1
diff --git a/src/skyTracker.js b/src/skyTracker.js index <HASH>..<HASH> 100644 --- a/src/skyTracker.js +++ b/src/skyTracker.js @@ -25,7 +25,14 @@ sky.getInfo = function (id, callback) { return callback(utils.getError('DOWN')) } - const json = JSON.parse(body) + let json = null + try { + json = JSON.parse(body) + } catch (e) { + console.log(id, error) + return callback(utils.getError('PARSER')) + } + // Not found if (json.message.indexOf('No result found for your query.') != -1) {
:art: Added a catch to sky provider json parser
hdnpt_geartrack
train
js
d4c817e67d829f002451467ecdd22a4e19f8e86e
diff --git a/openfisca_country_template/variables/taxes.py b/openfisca_country_template/variables/taxes.py index <HASH>..<HASH> 100644 --- a/openfisca_country_template/variables/taxes.py +++ b/openfisca_country_template/variables/taxes.py @@ -9,8 +9,6 @@ from openfisca_core.model_api import * # Import the entities specifically defined for this tax and benefit system from openfisca_country_template.entities import * -from housing import HousingOccupancyStatus - class income_tax(Variable): value_type = float @@ -54,9 +52,10 @@ class housing_tax(Variable): january = period.first_month accommodation_size = household('accomodation_size', january) - # `housing_occupancy_status` is an Enum. To access an enum element, we use the . notation. - # Note than HousingOccupancyStatus has been imported on the beginning of this file. + # `housing_occupancy_status` is an Enum variable occupancy_status = household('housing_occupancy_status', january) + HousingOccupancyStatus = occupancy_status.possible_values # Get the enum associated with the variable + # To access an enum element, we use the . notation. tenant = (occupancy_status == HousingOccupancyStatus.tenant) owner = (occupancy_status == HousingOccupancyStatus.owner)
Avoid cross-variables files importation
openfisca_country-template
train
py
4ad05afbc650e117059bf042d5c0fb3ec1f5d5b7
diff --git a/lib/cleaver.js b/lib/cleaver.js index <HASH>..<HASH> 100644 --- a/lib/cleaver.js +++ b/lib/cleaver.js @@ -48,7 +48,9 @@ Cleaver.prototype._parseDocument = function () { self.slides.push(md(slices[i])); } - self.slides.push(self._renderAuthorSlide(self.metadata.author)); + if (self.metadata.author) { + self.slides.push(self._renderAuthorSlide(self.metadata.author)); + } // maybe load an external stylesheet if (self.metadata.style) {
only insert author slide if we have the info available
jdan_cleaver
train
js
b57b4c41b905d056ca6f36bee9330b52af477a1a
diff --git a/api/http_test.go b/api/http_test.go index <HASH>..<HASH> 100644 --- a/api/http_test.go +++ b/api/http_test.go @@ -22,6 +22,16 @@ type httpSuite struct { var _ = gc.Suite(&httpSuite{}) +func (s *httpSuite) SetUpSuite(c *gc.C) { + s.HTTPSuite.SetUpSuite(c) + s.JujuConnSuite.SetUpSuite(c) +} + +func (s *httpSuite) TearDownSuite(c *gc.C) { + s.HTTPSuite.TearDownSuite(c) + s.JujuConnSuite.TearDownSuite(c) +} + func (s *httpSuite) SetUpTest(c *gc.C) { s.HTTPSuite.SetUpTest(c) s.JujuConnSuite.SetUpTest(c) @@ -34,6 +44,11 @@ func (s *httpSuite) SetUpTest(c *gc.C) { ) } +func (s *httpSuite) TearDownTest(c *gc.C) { + s.HTTPSuite.TearDownTest(c) + s.JujuConnSuite.TearDownTest(c) +} + func (s *httpSuite) TestNewHTTPRequestSuccess(c *gc.C) { req, err := s.APIState.NewHTTPRequest("GET", "somefacade") c.Assert(err, jc.ErrorIsNil)
Add missing methods to a test suite.
juju_juju
train
go
3ec5f76b104b8cf14bf1f4d8104595d7d618e485
diff --git a/pyrogram/client/methods/messages/send_sticker.py b/pyrogram/client/methods/messages/send_sticker.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/methods/messages/send_sticker.py +++ b/pyrogram/client/methods/messages/send_sticker.py @@ -134,7 +134,7 @@ class SendSticker(BaseClient): elif hasattr(sticker, "read"): file = self.save_file(sticker, progress=progress, progress_args=progress_args) media = types.InputMediaUploadedDocument( - mime_type=self.guess_mime_type(sticker) or "image/webp", + mime_type=self.guess_mime_type(sticker.name) or "image/webp", file=file, attributes=[ types.DocumentAttributeFilename(file_name=sticker.name)
Fix TypeError in send_sticker
pyrogram_pyrogram
train
py
121e40c0a88ffcde4150fed8656eef915c5c0cd7
diff --git a/Tests/ArrayHelperTest.php b/Tests/ArrayHelperTest.php index <HASH>..<HASH> 100644 --- a/Tests/ArrayHelperTest.php +++ b/Tests/ArrayHelperTest.php @@ -2518,7 +2518,7 @@ class ArrayHelperTest extends TestCase // Search case sensitive. $this->assertEquals('name', ArrayHelper::arraySearch('Foo', $array)); - // Search case insenitive. + // Search case insensitive. $this->assertEquals('email', ArrayHelper::arraySearch('FOOBAR', $array, false)); // Search non existent value.
s/insenitive/insensitive
joomla-framework_utilities
train
php
10b7610fc7a0452de4c4685562f0ac4f963c2ed1
diff --git a/tests/test_api.py b/tests/test_api.py index <HASH>..<HASH> 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -169,7 +169,7 @@ class TestDeployGit(unittest.TestCase): with settings( branch="develop", repro_url="git@github.com:Frojd/Frojd-Django-Boilerplate1.git", - source_path="django_boilerplate", + source_path="src", warn_only=True): setup() @@ -183,7 +183,7 @@ class TestDeployGit(unittest.TestCase): with settings( branch="develop", repro_url="git@github.com:Frojd/Frojd-Django-Boilerplate.git", - source_path="django_boilerplate", + source_path="src", warn_only=True): setup()
Updated folder strucutre to sync with latest boilerplate repro
Frojd_Fabrik
train
py
0a084d774de18c06a3b3dee2314a1f5fc0d6d032
diff --git a/symphony/content/content.publish.php b/symphony/content/content.publish.php index <HASH>..<HASH> 100644 --- a/symphony/content/content.publish.php +++ b/symphony/content/content.publish.php @@ -494,13 +494,13 @@ class contentPublish extends AdministrationPage } // Flag filtering + $filter_stats = null; if (isset($_REQUEST['filter'])) { $filter_stats = new XMLElement('p', '<span>– ' . __('%d of %d entries (filtered)', array($entries['total-entries'], EntryManager::fetchCount($section_id))) . '</span>', array('class' => 'inactive')); - $this->Breadcrumbs->appendChild($filter_stats); } else { $filter_stats = new XMLElement('p', '<span>– ' . __('%d entries', array($entries['total-entries'])) . '</span>', array('class' => 'inactive')); - $this->Breadcrumbs->appendChild($filter_stats); } + $this->Breadcrumbs->appendChild($filter_stats); // Build table $visible_columns = $section->fetchVisibleColumns();
Simplify entry count (filter stats).
symphonycms_symphony-2
train
php
04971acb85809d219be8413fcbb71efd2751b94d
diff --git a/pydle/features/rfc1459/client.py b/pydle/features/rfc1459/client.py index <HASH>..<HASH> 100644 --- a/pydle/features/rfc1459/client.py +++ b/pydle/features/rfc1459/client.py @@ -688,7 +688,7 @@ class RFC1459Support(BasicClient): def on_raw_318(self, message): """ End of /WHOIS list. """ - target, nickname = message.params[0] + target, nickname = message.params[:2] # Mark future as done. if nickname in self._requests['whois']:
Parse end of WHOIS list properly.
Shizmob_pydle
train
py
d74544e0ce845fa9ae07431793564e80f034335e
diff --git a/packages/vaex-core/vaex/dataframe.py b/packages/vaex-core/vaex/dataframe.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/dataframe.py +++ b/packages/vaex-core/vaex/dataframe.py @@ -3348,10 +3348,10 @@ class DataFrame(object): parts += ["<td>%s</td>" % name] virtual = name not in self.column_names if name in self.column_names: - type = self.dtype(name) + dtype = str(self.dtype(name)) if self.dtype(name) != str else 'str' else: - type = "</i>virtual column</i>" - parts += ["<td>%s</td>" % type] + dtype = "</i>virtual column</i>" + parts += ["<td>%s</td>" % dtype] units = self.unit(name) units = units.to_string("latex_inline") if units else "" parts += ["<td>%s</td>" % units]
Fixes the info panel where the string types were not being displayed (#<I>)
vaexio_vaex
train
py
462fcdc64da3009b363c92f67fd79921d0a16f09
diff --git a/test/minitest_helper.rb b/test/minitest_helper.rb index <HASH>..<HASH> 100644 --- a/test/minitest_helper.rb +++ b/test/minitest_helper.rb @@ -194,3 +194,10 @@ class CustomMiniTestRunner end MiniTest::Unit.runner = CustomMiniTestRunner::Unit.new + +begin # load reporters for RubyMine if available + require 'minitest/reporters' + MiniTest::Reporters.use! +rescue LoadError + # ignored +end if ENV['RUBYMINE']
support for running mini tests in RubyMine add `gem 'minitest-reporters', require: false` to your `bundle.d/local.rb` and set ENV['RUBYMINE'] in Run/Debug configuration defaults
Katello_katello
train
rb
426a462972fb86658f44f433b15ba6988a64d1e8
diff --git a/aesh/src/main/java/org/aesh/command/container/DefaultCommandContainer.java b/aesh/src/main/java/org/aesh/command/container/DefaultCommandContainer.java index <HASH>..<HASH> 100644 --- a/aesh/src/main/java/org/aesh/command/container/DefaultCommandContainer.java +++ b/aesh/src/main/java/org/aesh/command/container/DefaultCommandContainer.java @@ -71,6 +71,10 @@ public abstract class DefaultCommandContainer<CI extends CommandInvocation> impl if (getParser().getProcessedCommand().parserExceptions().size() > 0) { throw getParser().getProcessedCommand().parserExceptions().get(0); } + + if (getParser().parsedCommand() == null) { + throw new CommandLineParserException("Command and/or sub-command is not valid!"); + } getParser().parsedCommand().getCommandPopulator().populateObject(getParser().parsedCommand().getProcessedCommand(), invocationProviders, aeshContext, CommandLineParser.Mode.VALIDATE); return getParser().parsedCommand().getProcessedCommand();
Warn user of wrong command In case the user is invoking a wrong command and/or sub-command, a NPE is thrown. This PR attempts to throw a more meaningful exception (CommandLineparserException) and the reason for the stacktrace.
aeshell_aesh
train
java
7a8fde6b83fe6c90a0a41593ea257e4c3ab9a401
diff --git a/visidata/vdtui.py b/visidata/vdtui.py index <HASH>..<HASH> 100755 --- a/visidata/vdtui.py +++ b/visidata/vdtui.py @@ -2154,7 +2154,7 @@ class Column: try: return self.setValue(row, value) except Exception as e: - pass # exceptionCaught(e) + exceptionCaught(e) def setValues(self, rows, *values): 'Set our column value for given list of rows to `value`.'
[setValueSafe] show exceptions during setter
saulpw_visidata
train
py
b9d4f9591eb2a9ea62c3b409298cfbebf2350d3c
diff --git a/ui/admin/src/main/java/org/openengsb/ui/admin/testClient/TestClient.java b/ui/admin/src/main/java/org/openengsb/ui/admin/testClient/TestClient.java index <HASH>..<HASH> 100644 --- a/ui/admin/src/main/java/org/openengsb/ui/admin/testClient/TestClient.java +++ b/ui/admin/src/main/java/org/openengsb/ui/admin/testClient/TestClient.java @@ -74,11 +74,8 @@ import org.openengsb.ui.admin.model.Argument; import org.openengsb.ui.admin.model.MethodCall; import org.openengsb.ui.admin.model.MethodId; import org.openengsb.ui.admin.model.ServiceId; -<<<<<<< HEAD import org.openengsb.ui.admin.organizeGlobalsPage.OrganizeGlobalsPage; -======= import org.openengsb.ui.admin.organizeImportsPage.OrganizeImportsPage; ->>>>>>> 70181519016c268a4bbe96e831f5062120b3ff7e import org.openengsb.ui.common.model.LocalizableStringModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
[OPENENGSB-<I>] Corrected merge problem
openengsb_openengsb
train
java
dd9a2dcc75bb94bcee53892a703f5cbe5c123ae2
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3432,7 +3432,7 @@ function build_navigation($extranavlinks, $cm = null) { debugging('The field $cm->name should be set if you call build_navigation with '. 'a $cm parameter. If you get $cm using get_coursemodule_from_instance or ', 'get_coursemodule_from_id, this will be done automatically.', DEBUG_DEVELOPER); - if (!$cm->modname = get_field($cm->modname, 'name', 'id', $cm->instance)) { + if (!$cm->name = get_field($cm->modname, 'name', 'id', $cm->instance)) { error('Cannot get the module name in build navigation.'); } }
MDL-<I> - Addendum - fix typo in fixup code. Sorry.
moodle_moodle
train
php
3e9b66a91a171bbbeeaa582ca6a3b28e5a8cb944
diff --git a/core/analyzer.go b/core/analyzer.go index <HASH>..<HASH> 100644 --- a/core/analyzer.go +++ b/core/analyzer.go @@ -16,7 +16,6 @@ package core import ( - "fmt" "go/ast" "go/importer" "go/parser" @@ -126,7 +125,10 @@ func (gas *Analyzer) process(filename string, source interface{}) error { conf := types.Config{Importer: importer.Default()} gas.context.Pkg, err = conf.Check("pkg", gas.context.FileSet, []*ast.File{root}, gas.context.Info) if err != nil { - return fmt.Errorf(`Error during type checking: "%s"`, err) + // TODO(gm) Type checker not currently considering all files within a package + // see: issue #113 + gas.logger.Printf(`Error during type checking: "%s"`, err) + err = nil } gas.context.Imports = NewImportInfo()
Temporarily disable typechecker fatal error It seems that the typechecker isn't considering the entire package fileset in the current way that gas is processing projects. This leads to cases where types that are defined in one file aren't known about when gas is processing other files within that module. A redesign is needed, this is a temporary fix to return to old behaviour. Related to #<I>
securego_gosec
train
go
092f9a74e58c0cc3e9b324593e67db302a5919ee
diff --git a/stdeb/util.py b/stdeb/util.py index <HASH>..<HASH> 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -209,11 +209,7 @@ def get_deb_depends_from_setuptools_requires(requirements): if not gooddebs: log.warn("I found no Debian package which provides the required " "Python package \"%s\" with version requirements " - "\"%s\". Guessing blindly that the name \"python-%s\" " - "will be it, and that the Python package version number " - "requirements will apply to the Debian package." - % (req.project_name, req.specs, reqname)) - gooddebs.add("python-" + reqname) + "\"%s\"."% (req.project_name, req.specs)) elif len(gooddebs) == 1: log.info("I found a Debian package which provides the require " "Python package. Python package: \"%s\", " @@ -242,7 +238,8 @@ def get_deb_depends_from_setuptools_requires(requirements): # good package. alts.append("%s"%deb) - depends.append(' | '.join(alts)) + if len(alts): + depends.append(' | '.join(alts)) return depends
don't include packages in Depends: that aren't known to be Debian packages
astraw_stdeb
train
py
b3fef350b42d03b59eb5691b31352679cf0ebfbf
diff --git a/public/js/content.js b/public/js/content.js index <HASH>..<HASH> 100644 --- a/public/js/content.js +++ b/public/js/content.js @@ -567,7 +567,7 @@ apos.modal = function(sel, options) { // If we don't have a select element first - focus the first input. // We also have to check for a select element within an array as the first field. if ($el.find("form:not(.apos-filter) .apos-fieldset:first.apos-fieldset-selectize, form:not(.apos-filter) .apos-fieldset:first.apos-fieldset-array .apos-fieldset:first.apos-fieldset-selectize").length === 0 ) { - $el.find("form:not(.apos-filter) :input:visible:enabled:first").focus(); + $el.find("form:not(.apos-filter) .apos-fieldset:not([data-extra-fields-link]):first :input:visible:enabled:first").focus(); } }); });
fixed #<I> 'First select field in SlideshowEditor opens with focus when limit:1 is set'
apostrophecms_apostrophe
train
js
2255dc8469862255926d214971e5e5a97caeff69
diff --git a/service/service.go b/service/service.go index <HASH>..<HASH> 100644 --- a/service/service.go +++ b/service/service.go @@ -161,6 +161,9 @@ func ListServices(initDir string) ([]string, error) { } var linuxExecutables = map[string]string{ + // Note that some systems link /sbin/init to whatever init system + // is supported, so in the future we may need some other way to + // identify upstart uniquely. "/sbin/init": InitSystemUpstart, "/sbin/upstart": InitSystemUpstart, "/sbin/systemd": InitSystemSystemd,
Add a note about the use of /sbin/init.
juju_juju
train
go
07486519138bd3f11a9aeedd63be1d10f68dec3c
diff --git a/gandi/cli/commands/ip.py b/gandi/cli/commands/ip.py index <HASH>..<HASH> 100644 --- a/gandi/cli/commands/ip.py +++ b/gandi/cli/commands/ip.py @@ -3,7 +3,7 @@ import click from gandi.cli.core.cli import cli -from gandi.cli.core.utils import output_ip, output_generic +from gandi.cli.core.utils import output_ip from gandi.cli.core.params import (option, pass_gandi, DATACENTER, IP_TYPE, option, IntChoice)
ip: remove unused import output_generic `output_generic` was never used in this file
Gandi_gandi.cli
train
py
5c3967600837cc9e84dbed6a23772a3c21b67c81
diff --git a/packages/create/src/generators/wc-lit-element/templates/_MyEl.js b/packages/create/src/generators/wc-lit-element/templates/_MyEl.js index <HASH>..<HASH> 100644 --- a/packages/create/src/generators/wc-lit-element/templates/_MyEl.js +++ b/packages/create/src/generators/wc-lit-element/templates/_MyEl.js @@ -4,11 +4,9 @@ export class <%= className %> extends LitElement { static get styles() { return css` :host { - --<%= tagName %>-text-color: #000; - display: block; padding: 25px; - color: var(--<%= tagName %>-text-color); + color: var(--<%= tagName %>-text-color, #000); } `; }
fix(create): set default value for variable Previous code set a specific variable value on `:host`, which does not make sense for variables since we probably want to allow overrides from ancestors.
open-wc_open-wc
train
js
be8672fc2a25ab90033e500b373a8c8492c23827
diff --git a/src/constants.js b/src/constants.js index <HASH>..<HASH> 100644 --- a/src/constants.js +++ b/src/constants.js @@ -2,5 +2,8 @@ export const socketOptions = { protocol: 'http', hostname: 'remotedev.io', port: 80, - autoReconnect: true + autoReconnect: true, + autoReconnectOptions: { + randomness: 60000 + } };
Add randomness to the reconnect delay not to flood the server after a worker crash
zalmoxisus_remote-redux-devtools
train
js
8468dd97ab5b2116f05e4fe3854b9e9a5cab4335
diff --git a/lib/opal/sprockets/source_map_header_patch.rb b/lib/opal/sprockets/source_map_header_patch.rb index <HASH>..<HASH> 100644 --- a/lib/opal/sprockets/source_map_header_patch.rb +++ b/lib/opal/sprockets/source_map_header_patch.rb @@ -22,7 +22,9 @@ module Opal def self.inject!(prefix) self.prefix = prefix - ::Sprockets::Server.send :include, self + unless ::Sprockets::Server.ancestors.include?(self) + ::Sprockets::Server.send :include, self + end end def self.prefix
Guard against multiple calls to the .included hook
opal_opal
train
rb
74e4d295b3c71f01ea50064cd35f4e9dd533e881
diff --git a/lib/Cake/Database/Connection.php b/lib/Cake/Database/Connection.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Database/Connection.php +++ b/lib/Cake/Database/Connection.php @@ -140,8 +140,8 @@ class Connection { * * @param string|Driver $driver * @param array|null $config Either config for a new driver or null. - * @throws Cake\Database\MissingDriverException When a driver class is missing. - * @throws Cake\Database\MissingExtensionException When a driver's PHP extension is missing. + * @throws Cake\Database\Exception\MissingDriverException When a driver class is missing. + * @throws Cake\Database\Exception\MissingExtensionException When a driver's PHP extension is missing. * @return Driver */ public function driver($driver = null, $config = null) { diff --git a/lib/Cake/Test/TestCase/Database/QueryTest.php b/lib/Cake/Test/TestCase/Database/QueryTest.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Test/TestCase/Database/QueryTest.php +++ b/lib/Cake/Test/TestCase/Database/QueryTest.php @@ -17,8 +17,8 @@ namespace Cake\Test\TestCase\Database; use Cake\Core\Configure; -use Cake\Database\Query; use Cake\Database\ConnectionManager; +use Cake\Database\Query; use Cake\TestSuite\TestCase; /**
Resolving a couple coding standard errors
cakephp_cakephp
train
php,php
69bb9825a7fd8fd29dffd5262659b720c54bb346
diff --git a/lib/trello/basic_data.rb b/lib/trello/basic_data.rb index <HASH>..<HASH> 100644 --- a/lib/trello/basic_data.rb +++ b/lib/trello/basic_data.rb @@ -55,7 +55,7 @@ module Trello resource = options.delete(:in) || self.class.to_s.split("::").last.downcase.pluralize klass = options.delete(:via) || Trello.const_get(name.to_s.singularize.camelize) params = options.merge(args[0] || {}) - resources = Client.get("/#{resource}/#{id}/#{name}", options).json_into(klass) + resources = Client.get("/#{resource}/#{id}/#{name}", params).json_into(klass) MultiAssociation.new(self, resources).proxy end end
Update lib/trello/basic_data.rb Use the processed options as a parameter so that filtering of trello objects works
jeremytregunna_ruby-trello
train
rb
2feff1ea168b481189cdc91a6a63ab9196416c8e
diff --git a/c_level_db.go b/c_level_db.go index <HASH>..<HASH> 100644 --- a/c_level_db.go +++ b/c_level_db.go @@ -107,6 +107,7 @@ func (db *CLevelDB) Print() { } func (db *CLevelDB) Stats() map[string]string { + // TODO: Find the available properties for the C LevelDB implementation keys := []string{} stats := make(map[string]string) diff --git a/mem_db.go b/mem_db.go index <HASH>..<HASH> 100644 --- a/mem_db.go +++ b/mem_db.go @@ -94,10 +94,7 @@ func (it *memDBIterator) Key() []byte { } func (it *memDBIterator) Value() []byte { - it.db.mtx.Lock() - defer it.db.mtx.Unlock() - - return it.db.db[it.keys[it.last]] + return it.db.Get(it.Key()) } func (db *MemDB) Iterator() Iterator {
Commented the empty table in c_level_db, and cleaned up the mem_db Value call.
tendermint_tendermint
train
go,go
b1d44e14b7430fb3ad2db93d0b9df24fbc656a4e
diff --git a/modules/tags/editsynonym.php b/modules/tags/editsynonym.php index <HASH>..<HASH> 100644 --- a/modules/tags/editsynonym.php +++ b/modules/tags/editsynonym.php @@ -41,7 +41,7 @@ if ( $locale === false ) return $Module->handleError( eZError::KERNEL_NOT_FOUND, 'kernel' ); if ( count( $languages ) == 1 ) - return $Module->redirectToView( 'editsynonym', array( $tag->attribute( 'id' ), $languages[0]->attribute( 'locale' ) ) ); + return $Module->redirectToView( 'editsynonym', array( $tag->attribute( 'id' ), current( $languages )->attribute( 'locale' ) ) ); $tpl = eZTemplate::factory();
also applied the language fix to editsynonym.php
ezsystems_eztags
train
php
3420269a9d88a99953baa44b3e26f83bc1f71189
diff --git a/tasks/ssh_deploy.js b/tasks/ssh_deploy.js index <HASH>..<HASH> 100644 --- a/tasks/ssh_deploy.js +++ b/tasks/ssh_deploy.js @@ -11,7 +11,7 @@ module.exports = function(grunt) { grunt.registerTask('ssh_deploy', 'Begin Deployment', function() { - this.async(); + var done = this.async(); var Connection = require('ssh2'); var client = require('scp2'); var moment = require('moment'); @@ -174,7 +174,9 @@ module.exports = function(grunt) { updateSymlink, onAfterDeploy, closeConnection - ]); + ], function () { + done(); + }); }; }); }; \ No newline at end of file
Fixed ssh-deploy task hangs on finish #3
dasuchin_grunt-ssh-deploy
train
js
c679239ab5d679dd994f7160ab1af87754618af4
diff --git a/server_metrics/postgresql.py b/server_metrics/postgresql.py index <HASH>..<HASH> 100644 --- a/server_metrics/postgresql.py +++ b/server_metrics/postgresql.py @@ -14,3 +14,4 @@ def get_database_size(db_user, db_name): db_user, db_name) total = commands.getoutput(cmd).split()[2] total = int(total) + return total
Bugfix: get_postgresql_size did not return anything
bitlabstudio_python-server-metrics
train
py
2a58023125edcdd2323e3a11f995c411242f3ee0
diff --git a/fitsio/fitslib.py b/fitsio/fitslib.py index <HASH>..<HASH> 100644 --- a/fitsio/fitslib.py +++ b/fitsio/fitslib.py @@ -4491,7 +4491,7 @@ _hdu_type_map = {IMAGE_HDU:'IMAGE_HDU', 'BINARY_TBL':BINARY_TBL} # no support yet for complex -_table_fits2npy = {1: 'b1', +_table_fits2npy = {#1: 'b1', 11: 'u1', 12: 'i1', 14: 'b1', # logical. Note pyfits uses this for i1, cfitsio casts to char*
temporarily comment out support for binary table type 1, X
esheldon_fitsio
train
py
3fae19dd9840b9a399f63baab9ae46483133fd80
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -567,7 +567,7 @@ function get_record_sql($sql, $expectmultiple=false, $nolimit=false) { $limit = ''; } else if ($expectmultiple) { $limit = ' LIMIT 1'; - } else if (isset($CFG->debug) && $CFG->debug) { + } else if (isset($CFG->debug) && $CFG->debug > 7) { // Debugging mode - don't use a limit of 1, but do change the SQL, because sometimes that // causes errors, and in non-debug mode you don't see the error message and it is // impossible to know what's wrong.
Bug #<I> missing ' > 7' in debug test. Merged from MOODLE_<I>_STABLE.
moodle_moodle
train
php
8e62504fef5e68bc4877fee1c05f9f347c3e9867
diff --git a/lib/state_machine.rb b/lib/state_machine.rb index <HASH>..<HASH> 100644 --- a/lib/state_machine.rb +++ b/lib/state_machine.rb @@ -24,8 +24,8 @@ module StateMachine # Default is nil. # * <tt>:integration</tt> - The name of the integration to use for adding # library-specific behavior to the machine. Built-in integrations - # include :data_mapper, :active_record, and :sequel. By default, this - # is determined automatically. + # include :active_model, :active_record, :data_mapper, :mongo_mapper, and + # :sequel. By default, this is determined automatically. # # Configuration options relevant to ORM integrations: # * <tt>:plural</tt> - The pluralized name of the attribute. By default,
Update StateMachine::MacroMethods docs to reflect new integrations
pluginaweek_state_machine
train
rb
91b870e47bd96a9d4ea177fa891e88f0dc87b3eb
diff --git a/HISTORY.rst b/HISTORY.rst index <HASH>..<HASH> 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,10 @@ History ------- +0.4.25 (2020-03-12) +___________________ +* Bug Fixes + 0.4.24 (2020-02-25) ___________________ * Added some extra fields(ms_server) for Fixed Address diff --git a/infoblox_client/__init__.py b/infoblox_client/__init__.py index <HASH>..<HASH> 100644 --- a/infoblox_client/__init__.py +++ b/infoblox_client/__init__.py @@ -1,3 +1,3 @@ __author__ = 'John Belamaric' __email__ = 'jbelamaric@infoblox.com' -__version__ = '0.4.24' +__version__ = '0.4.25' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ with open('testing_requirements.txt') as requirements_file: setup( name='infoblox-client', - version='0.4.24', + version='0.4.25', description="Client for interacting with Infoblox NIOS over WAPI", long_description=readme + '\n\n' + history, long_description_content_type='text/markdown',
Bump up version to <I> (#<I>)
infobloxopen_infoblox-client
train
rst,py,py
398a11b57dc0e1189dc2a3fea822b1d6fb82f5b8
diff --git a/test/test_db.py b/test/test_db.py index <HASH>..<HASH> 100644 --- a/test/test_db.py +++ b/test/test_db.py @@ -1,5 +1,3 @@ -from eventlet.greenpool import GreenPile -from mock import Mock from sqlalchemy import Column, Integer from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.session import Session @@ -29,31 +27,6 @@ config = { } -def test_concurrency(): - - container = Mock() - container.config = config - container.service_name = "fooservice" - - entrypoint = DummyProvider() - service_instance = Mock() - - def inject(worker_ctx): - orm_session = OrmSession(DeclBase).bind(container, "session") - orm_session.setup() - return orm_session.acquire_injection(worker_ctx) - - # get injections concurrently - pile = GreenPile() - for _ in xrange(CONCURRENT_REQUESTS): - worker_ctx = WorkerContext(container, service_instance, entrypoint) - pile.spawn(inject, worker_ctx) - results = set(pile) - - # injections should all be unique - assert len(results) == CONCURRENT_REQUESTS - - def test_db(container_factory): container = container_factory(FooService, config)
Don't need to test sqlalchemy session thread-safety; trust the docs
nameko_nameko
train
py
63bb7616a06e1232e8e867919450649e91a4515c
diff --git a/pact-jvm-provider-junit/src/main/java/au/com/dius/pact/provider/junit/loader/PactBrokerLoader.java b/pact-jvm-provider-junit/src/main/java/au/com/dius/pact/provider/junit/loader/PactBrokerLoader.java index <HASH>..<HASH> 100644 --- a/pact-jvm-provider-junit/src/main/java/au/com/dius/pact/provider/junit/loader/PactBrokerLoader.java +++ b/pact-jvm-provider-junit/src/main/java/au/com/dius/pact/provider/junit/loader/PactBrokerLoader.java @@ -58,7 +58,7 @@ public class PactBrokerLoader implements PactLoader { this.pactBrokerTags = tags.stream().flatMap(tag -> parseListExpression(tag).stream()).collect(toList()); this.pactBrokerConsumers = consumers.stream().flatMap(consumer -> parseListExpression(consumer).stream()).collect(toList()); this.failIfNoPactsFound = true; - this.pactSource = new PactBrokerSource(this.pactBrokerHost, this.pactBrokerPort); + this.pactSource = new PactBrokerSource(this.pactBrokerHost, this.pactBrokerPort, this.pactBrokerProtocol); } public PactBrokerLoader(final PactBroker pactBroker) {
Put back oddly removed param for pactSource initialization
DiUS_pact-jvm
train
java
05747d6c75a0caeee3ffd08a180dc257c6f658e6
diff --git a/slither/core/declarations/function.py b/slither/core/declarations/function.py index <HASH>..<HASH> 100644 --- a/slither/core/declarations/function.py +++ b/slither/core/declarations/function.py @@ -305,6 +305,7 @@ class Function(metaclass=ABCMeta): # pylint: disable=too-many-public-methods from slither.slithir.operations import Call if self._can_send_eth is None: + self._can_send_eth = False for ir in self.all_slithir_operations(): if isinstance(ir, Call) and ir.can_send_eth(): self._can_send_eth = True
fix that Function.can_send_eth() sometimes returns None when it's supposed to return bool
crytic_slither
train
py
fb526c0a3418dba4e18bc8cbc0f63c2d763100bf
diff --git a/asammdf/typing.py b/asammdf/typing.py index <HASH>..<HASH> 100644 --- a/asammdf/typing.py +++ b/asammdf/typing.py @@ -12,7 +12,7 @@ from typing_extensions import Literal from .blocks import v2_v3_blocks, v4_blocks from .blocks.source_utils import Source -StrOrBytesPath = Union[str, bytes, PathLike[str], PathLike[bytes]] +StrOrBytesPath = Union[str, bytes, "PathLike[str]", "PathLike[bytes]"] # asammdf specific types
fix(typing): does not work with Python <I>
danielhrisca_asammdf
train
py
5e8f059a5d1f298324e847822b997778a3472128
diff --git a/Facades/Http.php b/Facades/Http.php index <HASH>..<HASH> 100644 --- a/Facades/Http.php +++ b/Facades/Http.php @@ -20,7 +20,7 @@ use Illuminate\Http\Client\Factory; * @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType) * @method static \Illuminate\Http\Client\PendingRequest dd() * @method static \Illuminate\Http\Client\PendingRequest dump() - * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0) + * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null) * @method static \Illuminate\Http\Client\PendingRequest sink(string|resource $to) * @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback) * @method static \Illuminate\Http\Client\PendingRequest timeout(int $seconds)
[8.x] Allow passing when callback to Http client retry method (#<I>) * Allow passing when callback to http client retry method * linting * add callable type * update phpdoc on factory and facade * Update PendingRequest.php
illuminate_support
train
php
97723949ab4a2a57f85b22cd05efc4097a669835
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -692,7 +692,7 @@ func (c *Client) DisableTraceAll() *Client { return c } -// EnableTraceAll enable trace for all requests. +// EnableTraceAll enable trace for all requests (http3 currently does not support trace). func (c *Client) EnableTraceAll() *Client { c.trace = true return c diff --git a/request.go b/request.go index <HASH>..<HASH> 100644 --- a/request.go +++ b/request.go @@ -686,7 +686,7 @@ func (r *Request) DisableTrace() *Request { return r } -// EnableTrace enables trace. +// EnableTrace enables trace (http3 currently does not support trace). func (r *Request) EnableTrace() *Request { if r.trace == nil { r.trace = &clientTrace{}
declare in the comment that h3 does not support trace yet
imroc_req
train
go,go
be05ad6dc70906029987ba92a2fc47946c81be97
diff --git a/ghost/admin/config/targets.js b/ghost/admin/config/targets.js index <HASH>..<HASH> 100644 --- a/ghost/admin/config/targets.js +++ b/ghost/admin/config/targets.js @@ -1,11 +1,19 @@ /* eslint-env node */ +const browsers = [ + 'last 2 Chrome versions', + 'last 2 Firefox versions', + 'last 2 Safari versions', + 'last 2 Edge versions' +]; + +const isCI = !!process.env.CI; +const isProduction = process.env.EMBER_ENV === 'production'; + +if (isCI || isProduction) { + browsers.push('ie 11'); +} + module.exports = { - browsers: [ - 'ie 11', - 'last 2 Chrome versions', - 'last 2 Firefox versions', - 'last 2 Safari versions', - 'last 2 Edge versions' - ] + browsers };
Only transpile for IE<I> target in CI & production builds no issue - makes debugging during development easier because there's a lot less indirection added to work around missing ES6 support in IE<I>
TryGhost_Ghost
train
js
7793377fd9ca393ed28f32e1e165cd230343c14a
diff --git a/asammdf/gui/widgets/mdi_area.py b/asammdf/gui/widgets/mdi_area.py index <HASH>..<HASH> 100644 --- a/asammdf/gui/widgets/mdi_area.py +++ b/asammdf/gui/widgets/mdi_area.py @@ -1827,8 +1827,6 @@ class WithMDIArea: ) numeric.add_new_channels(signals) - numeric.format = fmt - numeric._update_values() menu = w.systemMenu()
fix loading numeric window from display file
danielhrisca_asammdf
train
py
ab45ae28e7e00bf422f3f2279d7ae11ef54c44da
diff --git a/ci/bootstrap.py b/ci/bootstrap.py index <HASH>..<HASH> 100755 --- a/ci/bootstrap.py +++ b/ci/bootstrap.py @@ -1,7 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import absolute_import, print_function, unicode_literals - import os import sys from os.path import exists diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals - import os diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- -from __future__ import absolute_import -from __future__ import print_function import io import re
chg: dev: Remove __future__ imports; I'm not supporting Python 2.
RescueTime_cwmon
train
py,py,py
58fb4904515c06cd415990b9ca5c6f07c6efde3a
diff --git a/src/Router/DefaultRouter.php b/src/Router/DefaultRouter.php index <HASH>..<HASH> 100644 --- a/src/Router/DefaultRouter.php +++ b/src/Router/DefaultRouter.php @@ -85,7 +85,7 @@ class DefaultRouter extends AbstractRouter $params = $this->makeKeyValuePairs($params); $params = $params + $routeData->getParams(); unset($params['params']); - $routeData->setParams($params); + $routeData = new RouteData($routeData->getRouteName(), $params); } return $routeData; @@ -118,9 +118,7 @@ class DefaultRouter extends AbstractRouter $params['params'][] = $value; } - $routeData->setParams($params); - - return $router->makeUrl($routeData, $language, $absolute); + return $router->makeUrl(new RouteData($routeData->getRouteName(), $params), $language, $absolute); } private function makeKeyValuePairs(array $array)
Fix DefaultRouter: RouteData is immutable
gobline_application
train
php
3d92f987dc63cd8850ca4af81c3b304562b4249a
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -99,8 +99,7 @@ EOT { /** @var KernelInterface $kernel */ $kernel = $this->getApplication()->getKernel(); - $targetArg = rtrim($input->getArgument('target'), '/'); - + $targetArg = rtrim($input->getArgument('target') ?? '', '/'); if (!$targetArg) { $targetArg = $this->getPublicDirectory($kernel->getContainer()); }
[FrameworkBundle] Avoid calling rtrim(null, '/') in AssetsInstallCommand
symfony_symfony
train
php
ba8fb2ada08f878e0a695dc1721139fa6c1b203a
diff --git a/tests/ApiEvidenceTest.php b/tests/ApiEvidenceTest.php index <HASH>..<HASH> 100644 --- a/tests/ApiEvidenceTest.php +++ b/tests/ApiEvidenceTest.php @@ -79,7 +79,7 @@ class ApiTestEvidence extends TestCase { $this->assertEquals("some description", $evidence_item1->evidence_item->description); //Check we can't make an invalid grade item - $this->expectException(\Exception::class); + $this->expectException("\Exception"); $evidence_item2 = $this->api->create_evidence_item_grade("B", "some description", $this->credential->credential->id); } @@ -89,7 +89,7 @@ class ApiTestEvidence extends TestCase { $this->assertEquals("Completed in 9 days", $evidence_item1->evidence_item->description); //Check we can't make an invalid duration item - $this->expectException(\Exception::class); + $this->expectException("\Exception"); $evidence_item2 = $this->api->create_evidence_item_duration(date("Y-m-d", strtotime("2017-10-01")), date("Y-m-d", strtotime("2017-10-01")), $this->credential->credential->id); }
Remove class resolution to ensure compatibility with php <I>
accredible_acms-php-api
train
php
1e72beb96ab4ee43d90b1514ff5b91421438f096
diff --git a/test/integration/helper.js b/test/integration/helper.js index <HASH>..<HASH> 100644 --- a/test/integration/helper.js +++ b/test/integration/helper.js @@ -101,11 +101,13 @@ exports.setLib = function(context) { // Mutate the bindings arrays to not check dates. if (item === 'bindings') { parseBindingDates(newData, localData); - } if (item === 'result') { + } + + if (item === 'result') { parseResultDates(newData, localData); } - expect(localData).to.eql(newData); + expect(newData).to.eql(localData); });
Reverse expect for console output to be correct
tgriesser_knex
train
js
41efaa62556ace80f2beb8a1a5220c24d93d2d49
diff --git a/lib/jsonapi/request.rb b/lib/jsonapi/request.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/request.rb +++ b/lib/jsonapi/request.rb @@ -185,7 +185,11 @@ module JSONAPI checked_has_one_associations[param] = @resource_klass.resource_for(association.type).verify_key(value, context) elsif association.is_a?(JSONAPI::Association::HasMany) keys = [] - value.each do |value| + if value.is_a?(Array) + value.each do |val| + keys.push(@resource_klass.resource_for(association.type).verify_key(val, context)) + end + else keys.push(@resource_klass.resource_for(association.type).verify_key(value, context)) end checked_has_many_associations[param] = keys diff --git a/test/controllers/controller_test.rb b/test/controllers/controller_test.rb index <HASH>..<HASH> 100644 --- a/test/controllers/controller_test.rb +++ b/test/controllers/controller_test.rb @@ -526,7 +526,7 @@ class PostsControllerTest < ActionController::TestCase post_object = Post.find(3) assert_equal 1, post_object.tags.length - put :update_association, {post_id: 3, association: 'tags', tags: [5]} + put :update_association, {post_id: 3, association: 'tags', tags: 5} assert_response :no_content post_object = Post.find(3)
Fix issue if value was not an array for parse_params for a HasMany association
cerebris_jsonapi-resources
train
rb,rb
7085f36764c390f1b3495de131c63d2f6f5029fc
diff --git a/tests/integration/states/test_pkg.py b/tests/integration/states/test_pkg.py index <HASH>..<HASH> 100644 --- a/tests/integration/states/test_pkg.py +++ b/tests/integration/states/test_pkg.py @@ -490,7 +490,7 @@ class PkgTest(ModuleCase, SaltReturnAssertsMixin): self.skipTest('Package manager is not available') test_name = 'bash-completion' - if (grains.get('os') == 'Amazon' and grains.get('osmajorrelease') != 2): + if grains.get('os') == 'Amazon' and grains.get('osmajorrelease') != 2: test_name = 'bash-doc' ret = self.run_state('pkg.installed', @@ -513,7 +513,7 @@ class PkgTest(ModuleCase, SaltReturnAssertsMixin): self.skipTest('Package manager is not available') package = 'bash-completion' - if (grains.get('os') == 'Amazon' and grains.get('osmajorrelease') != 2): + if grains.get('os') == 'Amazon' and grains.get('osmajorrelease') != 2: package = 'bash-doc' pkgquery = 'version'
Fixed pylint issue on PR not showing when run pylint locally
saltstack_salt
train
py
0ccad2793d1053a809051a172070c69e45d20346
diff --git a/test/unique-css.js b/test/unique-css.js index <HASH>..<HASH> 100644 --- a/test/unique-css.js +++ b/test/unique-css.js @@ -149,3 +149,10 @@ test( '.one.two {} .one.two.three {}', '.one.two {} .one.two.three {}' ); + +test( + 'keyframe selectors', + css, + '@keyframes a {0% {} 100% {}} @keyframes b {0% {} 100% {}}', + '@keyframes a {0% {} 100% {}} @keyframes b {0% {} 100% {}}' +);
Issue #<I>: Add test for expected keyframe behavior
ChristianMurphy_postcss-combine-duplicated-selectors
train
js
2fc589d1772ca547969f0f4c089050d542012679
diff --git a/ddmrp/tests/test_ddmrp.py b/ddmrp/tests/test_ddmrp.py index <HASH>..<HASH> 100644 --- a/ddmrp/tests/test_ddmrp.py +++ b/ddmrp/tests/test_ddmrp.py @@ -51,7 +51,7 @@ class TestDdmrp(common.SavepointCase): cls.customer_location = cls.env.ref('stock.stock_location_customers') cls.uom_unit = cls.env.ref('product.product_uom_unit') cls.buffer_profile_pur = cls.env.ref( - 'ddmrp.stock_buffer_profile_replenish_purchased_short_low') + 'ddmrp.stock_buffer_profile_replenish_purchased_medium_low') cls.group_stock_manager = cls.env.ref('stock.group_stock_manager') cls.group_mrp_user = cls.env.ref('mrp.group_mrp_user') cls.group_change_procure_qty = cls.env.ref(
Use the buffer profile which match with the test data
OCA_ddmrp
train
py
9a6eee795cfe3aca690ce3ab9a1066731d525c96
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -13,21 +13,21 @@ setup( long_description_content_type='text/markdown', include_package_data=True, install_requires=[ - 'directory_client_core>=6.0.0,<7.0.0', + 'directory_client_core>=6.1.0,<7.0.0', ], extras_require={ 'test': [ - 'pytest==5.1.0', - 'pytest-cov==2.7.1', - 'pytest-sugar>=0.9.1,<1.0.0', - 'flake8==3.7.8', - 'requests_mock==1.6.0', - 'freezegun==0.3.12', 'codecov==2.0.15', - 'twine>=1.11.0,<2.0.0', - 'wheel>=0.31.0,<1.0.0', - 'pytest-django>=3.2.1,<4.0.0', - 'setuptools>=38.6.0,<42.0.0', + 'flake8==3.7.9', + 'freezegun==0.3.15', + 'pytest-cov==2.8.1', + 'pytest-django>=3.8.0,<4.0.0', + 'pytest-sugar>=0.9.2,<1.0.0', + 'pytest==5.3.5', + 'requests_mock==1.7.0', + 'setuptools>=45.2.0,<50.0.0', + 'twine>=3.1.1,<4.0.0', + 'wheel>=0.34.2,<1.0.0', ] }, classifiers=[
update all requirements to the latest available version
uktrade_directory-cms-client
train
py
da1bf0833041b4aa1d5f3c6bfba2f2353d20b30f
diff --git a/beetle/base.py b/beetle/base.py index <HASH>..<HASH> 100644 --- a/beetle/base.py +++ b/beetle/base.py @@ -34,6 +34,10 @@ def default_copy(path, output): class Includer(object): specific = {} + def add(self, extensions, function): + for extension in extensions: + self.specific[extension] = function + def __init__(self, folders, output): self.folders = folders self.output = output
Enabled extending the includer.
cknv_beetle
train
py
8d59e85a40671fdc3aa0bcf4766bdb3c4b3b47b8
diff --git a/includes/Controls.php b/includes/Controls.php index <HASH>..<HASH> 100644 --- a/includes/Controls.php +++ b/includes/Controls.php @@ -50,21 +50,4 @@ class Controls { return $this->controls; } - /** - * Hook into WP - */ - private function register_hooks() { - add_action( 'customize_register', array( $this, 'include_files' ), 99 ); - } - - /** - * Include the custom control files. Because they depend on the WP_Cs - */ - public function include_files() { - $path = KIRKI_PATH . '/includes/Controls'; - foreach ( self::$CONTROL_TYPES as $typeId => $className ) { - include_once( $path . '/' . $className . '.php' ); - } - } - }
No need for that since we now use an autoloader
aristath_kirki
train
php
389401414c1b9dc79a105e44cb00f9c67e13486c
diff --git a/lib/switch_user/provider.rb b/lib/switch_user/provider.rb index <HASH>..<HASH> 100644 --- a/lib/switch_user/provider.rb +++ b/lib/switch_user/provider.rb @@ -10,11 +10,11 @@ module SwitchUser autoload :Session, 'switch_user/provider/session' def self.init(controller) - if SwitchUser.provider.is_a?(Hash) - klass_part = SwitchUser.provider[:name] + klass_part = if SwitchUser.provider.is_a?(Hash) + SwitchUser.provider[:name] else - klass_part = SwitchUser.provider - end + SwitchUser.provider + end klass_part = klass_part.to_s.classify diff --git a/lib/switch_user/provider/dummy.rb b/lib/switch_user/provider/dummy.rb index <HASH>..<HASH> 100644 --- a/lib/switch_user/provider/dummy.rb +++ b/lib/switch_user/provider/dummy.rb @@ -20,11 +20,11 @@ module SwitchUser attr_reader :original_user def remember_current_user(remember) - if remember - @original_user = current_user + @original_user = if remember + current_user else - @original_user = nil - end + nil + end end end end
Auto corrected by following Style/ConditionalAssignment
flyerhzm_switch_user
train
rb,rb
2ebe2b93abbb4f6a5cdc900e1f392152f2832a53
diff --git a/js/test/test.js b/js/test/test.js index <HASH>..<HASH> 100644 --- a/js/test/test.js +++ b/js/test/test.js @@ -155,7 +155,7 @@ let testTrades = async (exchange, symbol) => { let trades = await exchange.fetchTrades (symbol) log (symbol.green, 'fetched', Object.values (trades).length.toString ().green, 'trades') - log (asTable (trades)) + // log (asTable (trades)) } else {
removed excessive logging from test.js
ccxt_ccxt
train
js
03baa7b55dbcff7399c8d6a30bee1f084fc75b56
diff --git a/ddsc/localstore.py b/ddsc/localstore.py index <HASH>..<HASH> 100644 --- a/ddsc/localstore.py +++ b/ddsc/localstore.py @@ -1,4 +1,5 @@ import os +import math import datetime import hashlib import mimetypes @@ -248,7 +249,7 @@ class LocalFile(object): processor(chunk, chunk_hash_alg, chunk_hash_value) def count_chunks(self, bytes_per_chunk): - return int(float(self.size) / float(bytes_per_chunk)) + return math.ceil(float(self.size) / float(bytes_per_chunk)) @staticmethod def read_in_chunks(infile, blocksize):
Fix off by one bug in chunk count for progress bar
Duke-GCB_DukeDSClient
train
py
b60f61f79d4315ca09b5c3332f7a7c8998e7ebef
diff --git a/lib/fetch/index.js b/lib/fetch/index.js index <HASH>..<HASH> 100644 --- a/lib/fetch/index.js +++ b/lib/fetch/index.js @@ -1676,24 +1676,16 @@ function httpNetworkFetch ( } } - let iterator - if (decoders.length > 1) { - this.decoder = decoders[0] - iterator = pipeline(...decoders, () => {})[ - Symbol.asyncIterator - ]() - } else if (decoders.length === 1) { - this.decoder = decoders[0] - iterator = this.decoder[Symbol.asyncIterator]() - } else { - this.decoder = new PassThrough() - iterator = this.decoder[Symbol.asyncIterator]() + pipeline(...decoders, () => {}) + } else if (decoders.length === 0) { + // TODO (perf): Avoid intermediate. + decoders.push(new PassThrough()) } - if (this.decoder) { - this.decoder.on('drain', resume) - } + this.decoder = decoders[0].on('drain', resume) + + const iterator = decoders[decoders.length - 1][Symbol.asyncIterator]() pullAlgorithm = async (controller) => { // 4. Set bytes to the result of handling content codings given
refactor: simplify decoders
mcollina_undici
train
js
3ae05317df7d927ef58b95aca837af17012b3704
diff --git a/commons/queue/queue_test.go b/commons/queue/queue_test.go index <HASH>..<HASH> 100644 --- a/commons/queue/queue_test.go +++ b/commons/queue/queue_test.go @@ -86,7 +86,7 @@ func (s *MySuite) TestOffer(c *C) { } func (s *MySuite) TestConcurrent(c *C) { - cap := math.MaxInt16 + cap := 32 q, _ := NewChannelQueue(cap) if q == nil { c.Fail()
reduce number of threads in test, -race flag during tests makes it very slow
control-center_serviced
train
go