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
6336767b85cbac11c8e7cdb387697ab47eacbafd
diff --git a/tests/test_django.py b/tests/test_django.py index <HASH>..<HASH> 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -114,16 +114,14 @@ class WithFileFactory(factory.django.DjangoModelFactory): class Meta: model = models.WithFile - if django is not None: - afile = factory.django.FileField() + afile = factory.django.FileField() class WithImageFactory(factory.django.DjangoModelFactory): class Meta: model = models.WithImage - if django is not None: - animage = factory.django.ImageField() + animage = factory.django.ImageField() class WithSignalsFactory(factory.django.DjangoModelFactory):
Don't test Django's presence in tests Django is a test requirement, there are import at the top of the test_django.py file, there's not need to test if django is defined in the factories.
FactoryBoy_factory_boy
train
py
d2fa78061e0fe6a4c5be92c9edc73dc081fbf3e3
diff --git a/pex/resolver.py b/pex/resolver.py index <HASH>..<HASH> 100644 --- a/pex/resolver.py +++ b/pex/resolver.py @@ -167,7 +167,8 @@ class Resolver(object): if dist is None: raise Untranslateable('Package %s is not translateable by %s' % (package, translator)) if not distribution_compatible(dist, self._interpreter, self._platform): - raise Untranslateable('Could not get distribution for %s on appropriate platform.' % package) + raise Untranslateable( + 'Could not get distribution for %s on platform %s.' % (package, self._platform)) return dist def resolve(self, resolvables, resolvable_set=None):
Improve error messaging for platform constrained Untranslateable errors.
pantsbuild_pex
train
py
0a6a8dc58e2615bcdcc7114fc6e06308b65ba772
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -614,6 +614,8 @@ Server.prototype._run = function _run(req, res, route, chain, callback) { }); d = domain.create(); + d.add(req); + d.add(res); d.on('error', function onError(err) { log.trace({err: err}, 'uncaughtException'); self.emit('uncaughtException', req, res, route, err);
add req/res to route domain
restify_plugins
train
js
8fddbf66c038f35efe4777abe4ed904123725116
diff --git a/src/internalHelpers/_endsWith.js b/src/internalHelpers/_endsWith.js index <HASH>..<HASH> 100644 --- a/src/internalHelpers/_endsWith.js +++ b/src/internalHelpers/_endsWith.js @@ -1,3 +1,5 @@ +// @flow + /** * Check if a string ends with something */
chore(internal): add @flow to endsWith
styled-components_polished
train
js
d1b0888b425755e9cfce491025cdb3d02ff46c66
diff --git a/src/Controller/Base.php b/src/Controller/Base.php index <HASH>..<HASH> 100644 --- a/src/Controller/Base.php +++ b/src/Controller/Base.php @@ -20,18 +20,19 @@ use ReflectionException; /** * Allow the app to add functionality, if needed + * Negative conditional helps with static analysis */ -if (class_exists('\App\Cron\Controller\Base')) { - abstract class BaseMiddle extends \App\Cron\Controller\Base - { - } -} else { +if (!class_exists('\App\Cron\Controller\Base')) { abstract class BaseMiddle { public function __construct() { } } +} else { + abstract class BaseMiddle extends \App\Cron\Controller\Base + { + } } // --------------------------------------------------------------------------
chore: Swap middle class to help static analysis
nails_module-cron
train
php
d83b17461fde59f399fa45d820caa2890019cd21
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/api/SingularityRunNowRequest.java b/SingularityBase/src/main/java/com/hubspot/singularity/api/SingularityRunNowRequest.java index <HASH>..<HASH> 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/api/SingularityRunNowRequest.java +++ b/SingularityBase/src/main/java/com/hubspot/singularity/api/SingularityRunNowRequest.java @@ -17,6 +17,16 @@ public class SingularityRunNowRequest { private final Optional<Resources> resources; private final Optional<Long> runAt; + public SingularityRunNowRequest( + Optional<String> message, + Optional<Boolean> skipHealthchecks, + Optional<String> runId, + Optional<List<String>> commandLineArgs, + Optional<Resources> resources + ) { + this(message, skipHealthchecks, runId, commandLineArgs, resources, Optional.<Long>absent()); + } + @JsonCreator public SingularityRunNowRequest(@JsonProperty("message") Optional<String> message, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks,
Keep original constructor for backwards compatibility.
HubSpot_Singularity
train
java
8bdf75239da90f04500b77c05fd4d07f0f90b87b
diff --git a/pyvodb/load.py b/pyvodb/load.py index <HASH>..<HASH> 100644 --- a/pyvodb/load.py +++ b/pyvodb/load.py @@ -128,7 +128,7 @@ def load_from_dict(db, data, metadata): 'address': venue.get('address'), 'latitude': venue['location']['latitude'], 'longitude': venue['location']['longitude'], - 'note': venue.get('note'), + 'notes': venue.get('notes'), }) diff --git a/pyvodb/tables.py b/pyvodb/tables.py index <HASH>..<HASH> 100644 --- a/pyvodb/tables.py +++ b/pyvodb/tables.py @@ -280,9 +280,9 @@ class Venue(TableBase): slug = Column( Unicode(), nullable=False, doc=u"Identifier for use in URLs") - note = Column( + notes = Column( Unicode(), nullable=True, - doc=u"Note about the venue, e.g. directions to get there") + doc=u"Notes about the venue, e.g. directions to get there") city = relationship('City', backref=backref('venues'))
Rename venue 'note' back to 'notes'
pyvec_pyvodb
train
py,py
aec4872d6b48380fdd3ea67ac5bf93373f2cea4c
diff --git a/lib/discordrb/webhooks/embeds.rb b/lib/discordrb/webhooks/embeds.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/webhooks/embeds.rb +++ b/lib/discordrb/webhooks/embeds.rb @@ -144,6 +144,13 @@ module Discordrb::Webhooks def initialize(url: nil) @url = url end + + # @return A hash representation of this embed thumbnail, to be converted to JSON. + def to_hash + { + url: @url + } + end end # An embed's author will be shown at the top to indicate who "authored" the particular event the webhook was sent for.
:anchor: Add a method EmbedThumbnail#to_hash
meew0_discordrb
train
rb
964a74baad2a4b258afe45613a8a34b41348f90c
diff --git a/lib/UA.js b/lib/UA.js index <HASH>..<HASH> 100644 --- a/lib/UA.js +++ b/lib/UA.js @@ -81,6 +81,14 @@ var aliases = { } }; +// Chrome on iOS uses a UIWebView of the underlying platform to render +// content, by stripping the CriOS string the useragent parser will alias the +// user agent to ios_saf for the UIWebView, which is closer to the actual +// renderer +function stripCriOS(uaString) { + return uaString.replace(/(CriOS\/(\d+)\.(\d+)\.(\d+)\.(\d+))/, ''); +} + var UA = function(uaString) { var semver, a; @@ -89,7 +97,7 @@ var UA = function(uaString) { if (normalized) { this.ua = new useragent.Agent(normalized[1], normalized[2], (normalized[3] || 0), (normalized[4] || 0)); } else { - this.ua = useragent.lookup(uaString); + this.ua = useragent.lookup(stripCriOS(uaString)); } // For improved cache performance, remove the patch version. There are few cases in which a patch release drops the requirement for a polyfill, but if so, the polyfill can simply be served unnecessarily to the patch versions that contain the fix, and we can stop targeting at the next minor release.
Strip any mention of the CriOS version from the user agent string, the UA string is then parsed as the corresponding ios_saf version. (See <URL>)
Financial-Times_polyfill-service
train
js
57fd0486944b2bc3520b3aacbd018fc3a67e28c9
diff --git a/docs/reference/themes/mongodb/static/js/scripts.js b/docs/reference/themes/mongodb/static/js/scripts.js index <HASH>..<HASH> 100644 --- a/docs/reference/themes/mongodb/static/js/scripts.js +++ b/docs/reference/themes/mongodb/static/js/scripts.js @@ -45,7 +45,7 @@ jQuery(document).ready(function() { }); jQuery('.body table').addClass('table').addClass('table-striped'); var siteInput = $('#search input[name="site"]'); - if (siteInput.val().substring(0, 4) != "http") { + if (siteInput.val().indexOf(window.location.hostname) < 0) { siteInput.attr("value", window.location.hostname + siteInput.val()); } jQuery("#search form").submit(function() {
Docs: JS fix for search form (#<I>) As the protocol is not part of the window.location.hostname ensure if the browser caches the form field that the hostname isn't duplicated on refresh. JAVA-<I>
mongodb_mongo-java-driver
train
js
f89168821985b8386c8eda4ea47b4d789d2de9eb
diff --git a/glue/ligolw/ilwd.py b/glue/ligolw/ilwd.py index <HASH>..<HASH> 100644 --- a/glue/ligolw/ilwd.py +++ b/glue/ligolw/ilwd.py @@ -101,7 +101,7 @@ class ILWD(object): subclassed in order to provide specific values of the class variables "table_name", "column_name", and "index_offset". """ - __slots__ = ("table_name", "column_name", "n", "index_offset") + __slots__ = ("n",) table_name = None column_name = None index_offset = None
Experimentation reveals that the __slots__ attribute should not list symbol names that are defined at the class level, only those that are defined at the instance level.
gwastro_pycbc-glue
train
py
c6d430e74d7aeec42732eecba160d49ed0b6b662
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,7 @@ setup( packages=[ 'luigi', 'luigi.contrib', + 'luigi.tools' ], package_data={ 'luigi': luigi_package_data
Add 'tools' package so the package works when installed
spotify_luigi
train
py
9fba1514d2bcb9a191ebb49fcee334d32296d5de
diff --git a/libnetwork/drivers/macvlan/macvlan.go b/libnetwork/drivers/macvlan/macvlan.go index <HASH>..<HASH> 100644 --- a/libnetwork/drivers/macvlan/macvlan.go +++ b/libnetwork/drivers/macvlan/macvlan.go @@ -17,17 +17,15 @@ const ( vethLen = 7 containerVethPrefix = "eth" vethPrefix = "veth" - macvlanType = "macvlan" // driver type name - modePrivate = "private" // macvlan mode private - modeVepa = "vepa" // macvlan mode vepa - modeBridge = "bridge" // macvlan mode bridge - modePassthru = "passthru" // macvlan mode passthrough - parentOpt = "parent" // parent interface -o parent - modeOpt = "_mode" // macvlan mode ux opt suffix + macvlanType = "macvlan" // driver type name + modePrivate = "private" // macvlan mode private + modeVepa = "vepa" // macvlan mode vepa + modeBridge = "bridge" // macvlan mode bridge + modePassthru = "passthru" // macvlan mode passthrough + parentOpt = "parent" // parent interface -o parent + driverModeOpt = "macvlan_mode" // macvlan mode ux opt suffix ) -var driverModeOpt = macvlanType + modeOpt // mode --option macvlan_mode - type endpointTable map[string]*endpoint type networkTable map[string]*network
libnetwork: macvlan: clean up some consts
moby_moby
train
go
c2f31dd53f2eb6759e58ce21f1c54587f03d8d6f
diff --git a/spec/unit_tests/job_spec.rb b/spec/unit_tests/job_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit_tests/job_spec.rb +++ b/spec/unit_tests/job_spec.rb @@ -251,6 +251,11 @@ describe JenkinsApi::Client::Job do "/job/test_job/build").and_return(302) @job.build("test_job").should == 302 end + it "accepts the job name with params and builds the job" do + @client.should_receive(:api_post_request).with( + "/job/test_job/buildWithParameters",{:branch => 'feature/new-stuff'}).and_return(302) + @job.build("test_job",{:branch => 'feature/new-stuff'}).should == 302 + end end describe "#get_config" do
added spec for buildWithParameters
arangamani_jenkins_api_client
train
rb
09bce624ff9bd336ac368db5960dcf4066939c00
diff --git a/resources/views/admin/formElements/defaultForm.blade.php b/resources/views/admin/formElements/defaultForm.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/admin/formElements/defaultForm.blade.php +++ b/resources/views/admin/formElements/defaultForm.blade.php @@ -38,7 +38,7 @@ }); $(".datetimepicker input").datetimepicker({ - format: 'YYYY-MM-DD HH:mm' + format: 'YYYY-MM-DD HH:mm:ss' }); tinymce.init({
Fix default format for datepicker to include seconds.
despark_ignicms
train
php
4829a401d8c5d469dab7d73f2dc7d1312cfa9d80
diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index <HASH>..<HASH> 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -397,9 +397,8 @@ PROXY; return <<<PROXY #!/usr/bin/env sh -self=\$(realpath \$0 >/dev/null 2>&1) -if [ -z "\$self" ] -then +self=\$(realpath \$0 2> /dev/null) +if [ -z "\$self" ]; then self="\$0" fi
Fix symlink resolution in shell proxy (#<I>)
composer_composer
train
php
0b7f27559789dba52d6551868ca8353a13582b76
diff --git a/lockfile.js b/lockfile.js index <HASH>..<HASH> 100644 --- a/lockfile.js +++ b/lockfile.js @@ -141,10 +141,12 @@ exports.lock = function (path, opts, cb) { if (typeof opts.retries === 'number' && opts.retries > 0) { debug('has retries', opts.retries) + var retries = opts.retries + opts.retries = 0 cb = (function (orig) { return function cb (er, fd) { debug('retry-mutated callback') - opts.retries -= 1 - if (!er || opts.retries < 0) return orig(er, fd) + retries -= 1 + if (!er || retries < 0) return orig(er, fd) debug('lock retry', path, opts)
manage 'retries' so it does not clash with 'wait' polling This fixes #5 by avoiding the confusion situation where every poll can be retried, instead of every retry doing a polling phase.
npm_lockfile
train
js
f3597cc2e68cf7413516d21501b3380b73c05c83
diff --git a/src/googleclouddebugger/capture_collector.py b/src/googleclouddebugger/capture_collector.py index <HASH>..<HASH> 100644 --- a/src/googleclouddebugger/capture_collector.py +++ b/src/googleclouddebugger/capture_collector.py @@ -354,7 +354,10 @@ class CaptureCollector(object): """ try: if not hasattr(name, '__dict__'): - name = str(name) + if isinstance(name, unicode): + name = name.encode('unicode_escape') + else: + name = str(name) else: # TODO(vlif): call str(name) with immutability verifier here. name = str(id(name)) self._total_size += len(name)
Allow unicode values for keys in dictionaries in the python agent ------------- Created by MOE: <URL>
GoogleCloudPlatform_cloud-debug-python
train
py
1ff3c79ff6ab20c8ef0facd945972845712ab039
diff --git a/src/ol/projection.js b/src/ol/projection.js index <HASH>..<HASH> 100644 --- a/src/ol/projection.js +++ b/src/ol/projection.js @@ -39,7 +39,7 @@ ol.ProjectionUnits = { ol.METERS_PER_UNIT = {}; ol.METERS_PER_UNIT[ol.ProjectionUnits.DEGREES] = 2 * Math.PI * ol.sphere.NORMAL.radius / 360; -ol.METERS_PER_UNIT[ol.ProjectionUnits.FEET] = 0.02540005080010160020; +ol.METERS_PER_UNIT[ol.ProjectionUnits.FEET] = 0.3048; ol.METERS_PER_UNIT[ol.ProjectionUnits.METERS] = 1;
Use correct value to convert from foot to meters (was using value for converting to inches). Thanks @twpayne
openlayers_openlayers
train
js
c6f6746bfa583fcce338581ea3ea3895463c59a0
diff --git a/krakenapi.go b/krakenapi.go index <HASH>..<HASH> 100644 --- a/krakenapi.go +++ b/krakenapi.go @@ -6,6 +6,7 @@ import ( "crypto/sha512" "encoding/base64" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -13,7 +14,6 @@ import ( "strconv" "strings" "time" - "errors" ) const ( @@ -52,6 +52,13 @@ var privateMethods = []string{ "TradeVolume", "AddOrder", "CancelOrder", + "DepositMethods", + "DepositAddresses", + "DepositStatus", + "WithdrawInfo", + "Withdraw", + "WithdrawStatus", + "WithdrawCancel", } // KrakenApi represents a Kraken API Client connection @@ -229,15 +236,15 @@ func (api *KrakenApi) Depth(pair string, count int) (*OrderBook, error) { _, err := api.queryPublic("Depth", url.Values{ "pair": {pair}, "count": {strconv.Itoa(count)}, }, &dr) - + if err != nil { return nil, err } - + if book, found := dr[pair]; found { return &book, nil } - + return nil, errors.New("invalid response") }
feat(API): Added missing private "User funding" methods. (#<I>)
beldur_kraken-go-api-client
train
go
00165ef7c923e04d813a698ef52e44d6a49a0cef
diff --git a/src/formatter-jsonapi/lib/link.js b/src/formatter-jsonapi/lib/link.js index <HASH>..<HASH> 100644 --- a/src/formatter-jsonapi/lib/link.js +++ b/src/formatter-jsonapi/lib/link.js @@ -81,7 +81,7 @@ export default function (model, opts={}) { id: String(related.id) }; } else { - link.linkage = 'null'; + link.linkage = null; } if (exporter) { exporter(related);
return non-string null as linkage
endpoints_endpoints
train
js
4adab134ecf4741a9c7f81d811ecb0127170e2d4
diff --git a/js/coinbasepro.js b/js/coinbasepro.js index <HASH>..<HASH> 100644 --- a/js/coinbasepro.js +++ b/js/coinbasepro.js @@ -16,7 +16,7 @@ module.exports = class coinbasepro extends gdax { 'logo': 'https://user-images.githubusercontent.com/1294454/41764625-63b7ffde-760a-11e8-996d-a6328fa9347a.jpg', 'api': 'https://api.pro.coinbase.com', 'www': 'https://pro.coinbase.com/', - 'doc': 'https://docs.pro.coinbase.com/' + 'doc': 'https://docs.pro.coinbase.com/', 'fees': [ 'https://www.gdax.com/fees', 'https://support.gdax.com/customer/en/portal/topics/939402-depositing-and-withdrawing-funds/articles',
Ooops... forgot a comma!
ccxt_ccxt
train
js
28ce5e646992a3e0a6afe58f8e579656e92853c0
diff --git a/lib/common.js b/lib/common.js index <HASH>..<HASH> 100644 --- a/lib/common.js +++ b/lib/common.js @@ -485,7 +485,7 @@ function getSampleInner(orig,options,samplerOptions,api){ } function getSample(orig,options,samplerOptions,api){ - if (orig && orig.example) return orig.example; + if (orig && orig.example) return clean(orig.example); let result = getSampleInner(orig,options,samplerOptions,api); result = clean(result); result = strim(result,options.maxDepth);
fix: remove x-widdershins-oldref from examples
Mermade_widdershins
train
js
9a42c5e6baffc1c4c32b42af71459ff12250ac56
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ setup( packages=[ 'edx_lint', + 'edx_lint.cmd', 'edx_lint.pylint', ],
Forgot to install the cmd package
edx_edx-lint
train
py
802824639d1f89ba9a0922dc6ffb71e523c6e8c8
diff --git a/eZ/Publish/Core/MVC/Legacy/Templating/LegacyEngine.php b/eZ/Publish/Core/MVC/Legacy/Templating/LegacyEngine.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/MVC/Legacy/Templating/LegacyEngine.php +++ b/eZ/Publish/Core/MVC/Legacy/Templating/LegacyEngine.php @@ -68,6 +68,8 @@ class LegacyEngine implements EngineInterface $tpl = eZTemplate::factory(); foreach ( $parameters as $varName => $param ) { + // If $param is an array, we recursively convert all objects contained in it (if any). + // Scalar parameters are passed as is if ( is_array( $param ) ) { array_walk_recursive(
Added comments in Templating\LegacyEngine
ezsystems_ezpublish-kernel
train
php
e0e45cf86ddd23be76d2cadb6769027cfdc82485
diff --git a/src/ossos/core/ossos/gui/controllers.py b/src/ossos/core/ossos/gui/controllers.py index <HASH>..<HASH> 100644 --- a/src/ossos/core/ossos/gui/controllers.py +++ b/src/ossos/core/ossos/gui/controllers.py @@ -288,12 +288,12 @@ class ProcessRealsController(AbstractController): if key != 'h': source_cutout.update_pixel_location((cen_x, cen_y), hdulist_index) except Exception as er: - print "DAOPhot failure: {}".format(er) + print("DAOPhot failure: {}".format(er)) logger.critical("PHOT ERROR: {}".format(er)) phot_failure = sky_failure = cen_failure = True obs_mag = None obs_mag_err = None - band = None + band = '' default_comment = str(er) obs_mag = phot_failure and None or obs_mag @@ -352,7 +352,7 @@ class ProcessRealsController(AbstractController): previous_observations.append(this_observation) print Orbfit(previous_observations).summarize() except Exception as ex: - logger.error(type(ex), str(ex)) + logger.error(str(type(ex))+" "+str(ex)) print "Failed to compute preliminary orbit." if obs_mag < 24 and auto is not False:
Sent band to blank if no magnitude measured
OSSOS_MOP
train
py
7d5f39d14751842ae174c668304598ca098c4331
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: setup( name='django-localized-fields', - version='1.6', + version='1.7', packages=find_packages(), include_package_data=True, license='MIT License',
Bumped version to <I>
SectorLabs_django-localized-fields
train
py
bc80337f60e423ce2e540fbb32efd377d94ed631
diff --git a/draco/spec.py b/draco/spec.py index <HASH>..<HASH> 100644 --- a/draco/spec.py +++ b/draco/spec.py @@ -6,6 +6,7 @@ import json import os from collections import defaultdict from typing import Any, Dict, Iterable, List, Optional, Tuple, Union +from copy import deepcopy import agate import numpy as np @@ -481,6 +482,8 @@ class Query(): @staticmethod def from_vegalite(full_spec: Dict) -> 'Query': ''' Parse from Vega-Lite spec that uses map for encoding. ''' + full_spec = deepcopy(full_spec) + encodings: List[Encoding] = [] for channel, enc in full_spec.get('encoding', {}).items():
deepcopy spec in `from_vegalite` to avoid modifying input spec
uwdata_draco
train
py
63fffaac3f203361e20edad4bda8a9beaf30e430
diff --git a/lib/rim/command/status.rb b/lib/rim/command/status.rb index <HASH>..<HASH> 100644 --- a/lib/rim/command/status.rb +++ b/lib/rim/command/status.rb @@ -73,6 +73,7 @@ class Status < Command out = gs.execute "git rev-list --format=oneline -n 1 #{stat.git_rev}" if out =~ /^(\w+) (.*)/ sha1, comment = $1, $2 + comment = comment[0..76]+"..." if comment.size > 80 headline += "#{stat_info} #{sha1[0..6]} #{comment}" end else
cut comments in rim status output when too long
esrlabs_esr-rim
train
rb
bf84c5bb7b8c3170bf220d0c48518525fc84fb32
diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index <HASH>..<HASH> 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -212,14 +212,12 @@ func (w *Watcher) readEvents() { if errno != nil && errno != syscall.EINTR { w.Error <- os.NewSyscallError("kevent", errno) continue - } else { - events = eventbuf[0:n] } - } - // Timeout, no big deal - if n == 0 { - continue + // Received some events + if n > 0 { + events = eventbuf[0:n] + } } // Flush the events we recieved to the events channel
BSD - fix for rob (EINTR)
fsnotify_fsnotify
train
go
972877ba30b99ea6d1b9e5c94a821d48559d5be5
diff --git a/src/directives/dxTree.js b/src/directives/dxTree.js index <HASH>..<HASH> 100644 --- a/src/directives/dxTree.js +++ b/src/directives/dxTree.js @@ -25,7 +25,7 @@ post: function (scope, elm, attr, ctrl) { scope.$dxLevel = isRoot ? 0 : scope.$dxLevel + 1; scope.$dxIsRoot = isRoot; - scope.$dxParent = isRoot + scope.$dxPrior = scope.$dxParent = isRoot ? parse(attr.dxTree || attr.root)(scope) : parse(attr.dxNode || attr.node)(scope); @@ -54,4 +54,7 @@ comp.directive('dxTree', $NodeDirective(true)); comp.directive('dxNode', $NodeDirective(false)); + + comp.directive('dxStartWith', $NodeDirective(true)); + comp.directive('dxConnect', $NodeDirective(false)); }()); \ No newline at end of file
added Start With - Connect syntax.
dotJEM_angular-tree
train
js
7aec84f3d03bc5083ffbf4e14e4c9e4e8788b734
diff --git a/src/location.js b/src/location.js index <HASH>..<HASH> 100644 --- a/src/location.js +++ b/src/location.js @@ -64,7 +64,7 @@ if (global.history && global.location) { _.filter(handler, _.locationFilter); }; _.locationFilter = function(event, handler) { - var matches = (event.uri || current).match(handler.uriRE); + var matches = (event.location || current).match(handler.uriRE); if (matches) { this.args.splice.apply(this.args, [1,0].concat(matches)); if (handler.keys) {
.uri was replaced with .location
esha_Eventi
train
js
7564afed3e912fbca698e428b7b1ae0bc3e3523b
diff --git a/lib/TaskRouterClient.js b/lib/TaskRouterClient.js index <HASH>..<HASH> 100644 --- a/lib/TaskRouterClient.js +++ b/lib/TaskRouterClient.js @@ -40,6 +40,7 @@ function TaskRouterClient(sid, tkn, workspaceSid, options) { //REST Resource - shorthand for just "workspace" and "workspaces" to match the REST API var workspaceResource = require('./resources/task_router/Workspaces')(this); this.workspaces = workspaceResource; + this.workspace = new workspaceResource(workspaceSid); //mix the account object in with the client object - assume master account for resources _.extend(this, workspaceResource);
exposed workspace attribute for TaskRouterClient
twilio_twilio-node
train
js
a86c873a73a6ae1c7dcc4cf2f69e3f4c0d09edd1
diff --git a/clientconn.go b/clientconn.go index <HASH>..<HASH> 100644 --- a/clientconn.go +++ b/clientconn.go @@ -1304,7 +1304,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne // // LB channel health checking is enabled when all requirements below are met: // 1. it is not disabled by the user with the WithDisableHealthCheck DialOption -// 2. internal.HealthCheckFunc is set by importing the grpc/healthcheck package +// 2. internal.HealthCheckFunc is set by importing the grpc/health package // 3. a service config with non-empty healthCheckConfig field is provided // 4. the load balancer requests it //
cleanup: fix mention of healthcheck to health (#<I>)
grpc_grpc-go
train
go
c8b94f826e748e6f2cdf1dda04745c0627e8a815
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -91,7 +91,11 @@ class OrganizationsController < ApplicationController end def destroy - if Organization.count > 1 + if current_organization == @organization + errors [_("Could not delete organization '#{params[:id]}'."), _("The current organization cannot be deleted. Please switch to a different organization before deleting.")] + + render :text => "The current organization cannot be deleted. Please switch to a different organization before deleting.", :status=>:bad_request and return + elsif Organization.count > 1 @id = @organization.id begin @organization.destroy
<I> - Enforced the cant delete current org restriction on the controller side
Katello_katello
train
rb
87a7f22a5db8b920ff023c2a0bc709cde1aaa6e4
diff --git a/structr-ui/src/main/java/org/structr/web/resource/LoginResource.java b/structr-ui/src/main/java/org/structr/web/resource/LoginResource.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/web/resource/LoginResource.java +++ b/structr-ui/src/main/java/org/structr/web/resource/LoginResource.java @@ -158,7 +158,7 @@ public class LoginResource extends FilterableResource { if (returnedMethodResult == null) { // should not happen - returnedMethodResult = new RestMethodResult(401); + throw new AuthenticationException(AuthHelper.STANDARD_ERROR_MSG); } return returnedMethodResult;
Minor: Do not return empty result for login action with empty username and password
structr_structr
train
java
a7816d5e8dbc6f97257b8de957727eb59fee235e
diff --git a/ipuz/direction.py b/ipuz/direction.py index <HASH>..<HASH> 100644 --- a/ipuz/direction.py +++ b/ipuz/direction.py @@ -3,7 +3,9 @@ def validate_direction(direction): splitted = direction.split(':') direction_name = direction - if len(splitted) > 1: + if len(splitted) > 2: + return False + if len(splitted) <= 2: direction_name = splitted[0] return direction_name in ( "Across", diff --git a/tests/test_ipuz.py b/tests/test_ipuz.py index <HASH>..<HASH> 100644 --- a/tests/test_ipuz.py +++ b/tests/test_ipuz.py @@ -510,6 +510,13 @@ class IPUZCrosswordValueTestCase(IPUZBaseTestCase): "Invalid CrosswordValue in saved element found" ) + def test_validate_crosswordvalue_with_invalid_direction(self): + self.puzzle["saved"] = [[{"Across:Horizontal:and_something": "A"}]] + self.validate_puzzle( + self.puzzle, + "Invalid CrosswordValue in saved element found" + ) + class IPUZWriteTestCase(IPUZBaseTestCase):
Fixed issue with Direction validation with multiple colons
svisser_ipuz
train
py,py
63e317598c511892bc59f86dc1384932765d94eb
diff --git a/pkg/client/unversioned/fake/fake.go b/pkg/client/unversioned/fake/fake.go index <HASH>..<HASH> 100644 --- a/pkg/client/unversioned/fake/fake.go +++ b/pkg/client/unversioned/fake/fake.go @@ -47,6 +47,7 @@ func (f roundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error) { type RESTClient struct { Client *http.Client NegotiatedSerializer runtime.NegotiatedSerializer + GroupName string Req *http.Request Resp *http.Response @@ -94,8 +95,14 @@ func (c *RESTClient) request(verb string) *restclient.Request { ns := c.NegotiatedSerializer serializer, _ := ns.SerializerForMediaType(runtime.ContentTypeJSON, nil) streamingSerializer, _ := ns.StreamingSerializerForMediaType(runtime.ContentTypeJSON, nil) + + groupName := api.GroupName + if c.GroupName != "" { + groupName = c.GroupName + } + internalVersion := unversioned.GroupVersion{ - Group: registered.GroupOrDie(api.GroupName).GroupVersion.Group, + Group: registered.GroupOrDie(groupName).GroupVersion.Group, Version: runtime.APIVersionInternal, } internalVersion.Version = runtime.APIVersionInternal
Make the fake RESTClient usable by all the API groups, not just core.
kubernetes_kubernetes
train
go
c2d1a50d8fbc6e76ad2ace4b2e73cb2e9a16d555
diff --git a/test/TextFilter/TextFilterTest.php b/test/TextFilter/TextFilterTest.php index <HASH>..<HASH> 100644 --- a/test/TextFilter/TextFilterTest.php +++ b/test/TextFilter/TextFilterTest.php @@ -2,11 +2,13 @@ namespace Anax\TextFilter; +use \PHPUnit\Framework\TestCase; + /** * A testclass * */ -class TextFilterTest extends \PHPUnit_Framework_TestCase +class TextFilterTest extends TestCase { /** * Supported filters. diff --git a/test/TextFilter/TextFilterUtilitiesTest.php b/test/TextFilter/TextFilterUtilitiesTest.php index <HASH>..<HASH> 100644 --- a/test/TextFilter/TextFilterUtilitiesTest.php +++ b/test/TextFilter/TextFilterUtilitiesTest.php @@ -2,11 +2,13 @@ namespace Anax\TextFilter; +use \PHPUnit\Framework\TestCase; + /** * A testclass * */ -class TextFilterUtilitiesTest extends \PHPUnit_Framework_TestCase +class TextFilterUtilitiesTest extends TestCase { /** * Provider for TextWithLinks
Upgrade phpunit testclass to support newer version of phpunit.
canax_textfilter
train
php,php
d5b20b9886f2261334451f4bf7039dbe42072f39
diff --git a/src/js/pannellum.js b/src/js/pannellum.js index <HASH>..<HASH> 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1452,11 +1452,15 @@ function loadScene(sceneId, targetPitch, targetYaw) { // Set new pointing if (targetPitch === 'same') { workingPitch = config.pitch; + } else { + workingPitch = targetPitch; } if (targetYaw === 'same') { workingYaw = config.yaw; } else if (targetYaw === 'sameAzimuth') { workingYaw = config.yaw + config.northOffset - tourConfig.scenes[sceneId].northOffset; + } else { + workingYaw = targetYaw; } // Destroy hot spots from previous scene
Fix target yaw (fixes #<I>, thanks trumpton).
mpetroff_pannellum
train
js
f9d9d1e7571840246a27d41b4c5f92496591099e
diff --git a/bpm/src/main/java/org/jboss/pnc/bpm/BpmManager.java b/bpm/src/main/java/org/jboss/pnc/bpm/BpmManager.java index <HASH>..<HASH> 100644 --- a/bpm/src/main/java/org/jboss/pnc/bpm/BpmManager.java +++ b/bpm/src/main/java/org/jboss/pnc/bpm/BpmManager.java @@ -162,7 +162,7 @@ public class BpmManager { public void cleanup() { log.debug("Bpm manager tasks cleanup started"); Map<Integer, BpmTask> clonnedTasks = null; - synchronized(this.tasks) { + synchronized(this) { clonnedTasks = new HashMap<>(this.tasks); }
Fix synchronization in BpmManager not to allow concurency issues on tasks field
project-ncl_pnc
train
java
43305407c494a1e03f501b321ee1e3ea490e52f9
diff --git a/imhotep/tools.py b/imhotep/tools.py index <HASH>..<HASH> 100644 --- a/imhotep/tools.py +++ b/imhotep/tools.py @@ -94,4 +94,3 @@ class Tool(object): run on over stdin. """ raise NotImplementedError() -
W<I> blank line at end of file
justinabrahms_imhotep
train
py
cf62256a079b6114bcfc419bb268834e9062dd6a
diff --git a/api/src/opentrons/hardware_control/api.py b/api/src/opentrons/hardware_control/api.py index <HASH>..<HASH> 100644 --- a/api/src/opentrons/hardware_control/api.py +++ b/api/src/opentrons/hardware_control/api.py @@ -551,9 +551,16 @@ class API(HardwareAPILike): """ Resume motion after a call to :py:meth:`pause`. """ + # Resume must be called immediately to awaken thread running hardware + # methods (ThreadManager) self._backend.resume() - asyncio.run_coroutine_threadsafe(self._execution_manager.resume(), - self._loop) + + async def _chained_calls(): + # mirror what happens API.pause. + await self._execution_manager.resume() + self._backend.resume() + + asyncio.run_coroutine_threadsafe(_chained_calls(), self._loop) def halt(self): """ Immediately stop motion.
fix(api): fix race condition causing pause/running state mismatch. (#<I>) closes #<I>
Opentrons_opentrons
train
py
b571a2be75dcf2be611ebfcb739f32d54182201a
diff --git a/src/cf/commands/logout_test.go b/src/cf/commands/logout_test.go index <HASH>..<HASH> 100644 --- a/src/cf/commands/logout_test.go +++ b/src/cf/commands/logout_test.go @@ -13,7 +13,7 @@ func TestLogoutClearsAccessTokenOrgAndSpace(t *testing.T) { config, _ := configRepo.Get() config.AccessToken = "MyAccessToken" config.Organization = cf.Organization{Name: "MyOrg"} - config.Space = cf.Space{Name: "MyOrg"} + config.Space = cf.Space{Name: "MySpace"} ui := new(testhelpers.FakeUI)
Gave the space a better name
cloudfoundry_cli
train
go
b16c772a6aa0cc272afc8415b239ac26fb12739e
diff --git a/molo/core/migrations/0033_bannerindexpage_footerindexpage_sectionindexpage.py b/molo/core/migrations/0033_bannerindexpage_footerindexpage_sectionindexpage.py index <HASH>..<HASH> 100644 --- a/molo/core/migrations/0033_bannerindexpage_footerindexpage_sectionindexpage.py +++ b/molo/core/migrations/0033_bannerindexpage_footerindexpage_sectionindexpage.py @@ -9,7 +9,6 @@ class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0028_merge'), - ('wagtailcore', '0040_page_draft_title'), ('core', '0032_sitesettings_ga_tag_manager'), ]
Remove dependency on wagtailcore migration
praekeltfoundation_molo
train
py
50e361d61f31f8a7cb3b9a949cd297cfbec50b26
diff --git a/parsl/tests/test_threads/test_error_code_bash.py b/parsl/tests/test_threads/test_error_code_bash.py index <HASH>..<HASH> 100644 --- a/parsl/tests/test_threads/test_error_code_bash.py +++ b/parsl/tests/test_threads/test_error_code_bash.py @@ -45,7 +45,7 @@ def test_div_0(test_fn=div_0): assert f.result() == err_code, "{0} expected err_code:{1} but got {2}".format(test_fn.__name__, err_code, f.result()) - os.listdir('.') + print(os.listdir('.')) os.remove('std.err') os.remove('std.out') return True
Minor change. Will be rolled back later.
Parsl_parsl
train
py
79364ee78acd2b020cde6f11fc5815f47eb6c1bb
diff --git a/tests/RouteTest.php b/tests/RouteTest.php index <HASH>..<HASH> 100644 --- a/tests/RouteTest.php +++ b/tests/RouteTest.php @@ -258,6 +258,7 @@ class RouteTest extends PHPUnit_Framework_TestCase */ public function testInvokeWhenDisablingOutputBuffer() { + ob_start(); $callable = function ($req, $res, $args) { echo 'foo'; return $res->write('bar'); @@ -277,5 +278,8 @@ class RouteTest extends PHPUnit_Framework_TestCase $response = $route->__invoke($request, $response); $this->assertEquals('bar', (string)$response->getBody()); + + $output = ob_get_clean(); + $this->assertEquals('foo', $output); } }
Ensure that echo doesn't leak to phpunit
slimphp_Slim
train
php
93e5b706265faf7873b0939b14448ec17bcaa287
diff --git a/src/Dudulina/Scheduling/ScheduledCommandsDispatcher.php b/src/Dudulina/Scheduling/ScheduledCommandsDispatcher.php index <HASH>..<HASH> 100644 --- a/src/Dudulina/Scheduling/ScheduledCommandsDispatcher.php +++ b/src/Dudulina/Scheduling/ScheduledCommandsDispatcher.php @@ -56,11 +56,12 @@ class ScheduledCommandsDispatcher $this->logger->error( 'Scheduled command exception', [ - 'exceptionClass' => \get_class($exception), - 'trace' => $exception->getTrace(), - 'dueDate' => $scheduledCommand->getFireDate()->format('c'), - 'commandClass' => \get_class($scheduledCommand), - 'commandDump' => print_r($scheduledCommand, true), + 'exceptionClass' => \get_class($exception), + 'exceptionMessage' => $exception->getMessage(), + 'trace' => $exception->getTraceAsString(), + 'dueDate' => $scheduledCommand->getFireDate()->format('c'), + 'commandClass' => \get_class($scheduledCommand), + 'commandDump' => print_r($scheduledCommand, true), ] ); }
restructured exception handling in ScheduledCommandDispatcher
xprt64_dudulina
train
php
bd59f842f0d91ea07638cae417b9e9462038b89a
diff --git a/model/DataList.php b/model/DataList.php index <HASH>..<HASH> 100644 --- a/model/DataList.php +++ b/model/DataList.php @@ -978,9 +978,8 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab */ public function remove($item) { // By default, we remove an item from a DataList by deleting it. - if($item instanceof $this->dataClass) $item->delete(); - - } + $this->removeByID($item->ID); + } /** * Remove an item from this DataList by ID
FIX Make sure you can only remove items from a DataList that are actually in it
silverstripe_silverstripe-framework
train
php
41353c98242c1fe049f5251fdefed886455a6490
diff --git a/Resources/public/js/typeaheadbundle.js b/Resources/public/js/typeaheadbundle.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/typeaheadbundle.js +++ b/Resources/public/js/typeaheadbundle.js @@ -260,7 +260,7 @@ li = $( this.$id.data('prototype') ); li.data('value', data.id) .find('input:hidden').val(data.id).attr('id', _id + '_' + data.id).attr('name', name).end() - .find('a').text(text).end() + .find('.lifo-typeahead-item').text(text).end() .appendTo(list) ; }
use selector '.lifo-typeahead-item' instead of 'a' to add text to list items to allow for more flexible customizations.
lifo101_typeahead-bundle
train
js
3bc2239a3b554539a5a531964770e033c788ac98
diff --git a/internal/pixels/pixels.go b/internal/pixels/pixels.go index <HASH>..<HASH> 100644 --- a/internal/pixels/pixels.go +++ b/internal/pixels/pixels.go @@ -177,6 +177,7 @@ func (p *Pixels) CreateImage(context *opengl.Context, width, height int, filter return nil, err } } + p.image = gimg p.basePixels, err = gimg.Pixels(context) if err != nil { return nil, err
pixels: Bug fix: Update image member when creating a new image
hajimehoshi_ebiten
train
go
905cb8fa8c124f19b28a9700b0bae7c1819e58d8
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -903,13 +903,13 @@ class AESFuncs(object): return {} if 'mine_get' in self.opts: # If master side acl defined. - if not isinstance(self.opts['mine_get'],dict): + if not isinstance(self.opts['mine_get'], dict): return {} perms = set() for match in self.opts['mine_get']: if re.match(match, load['id']): if isinstance(self.opts['mine_get'][match], list): - perms.update(self.opts['mine_get'][match]) + perms.update(self.opts['mine_get'][match]) good = False for perm in perms: if re.match(perm, load['fun']):
Fix pylint issues in master.py
saltstack_salt
train
py
927160687c3b4b7fa1c436fbda92be6fab1c47e9
diff --git a/src/main/java/com/google/cloud/tools/managedcloudsdk/components/SdkComponent.java b/src/main/java/com/google/cloud/tools/managedcloudsdk/components/SdkComponent.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/google/cloud/tools/managedcloudsdk/components/SdkComponent.java +++ b/src/main/java/com/google/cloud/tools/managedcloudsdk/components/SdkComponent.java @@ -36,7 +36,9 @@ public enum SdkComponent { GCD_EMULATOR("gcd-emulator"), GSUTIL("gsutil"), KUBECTL("kubectl"), - PUBSUB_EMULATOR("pubsub-emulator"); + PUBSUB_EMULATOR("pubsub-emulator"), + MINIKUBE("minikube"), + SKAFFOLD("skaffold"); private final String value;
Add minikube and skaffold to list of gcloud components (#<I>)
GoogleCloudPlatform_appengine-plugins-core
train
java
e6093b852c4979cacdbcfdb37cb7084dff80bf31
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -54,22 +54,20 @@ export function createContext (history, location, state) { * given context object. * * @param {Function[]} middleware - * @return {Function} + * @param {Object} context */ -export function runMiddleware (middleware) { - return function (ctx) { - var mw = middleware.slice(0); - const callNext = function () { - var next = mw.shift(); - if (!next) return; - try { - return Promise.resolve(next(context, callNext)); - } catch (err) { - return Promise.reject(err); - } +export function runMiddleware (middleware, context) { + var mw = middleware.slice(0); + const callNext = function () { + var next = mw.shift(); + if (!next) return; + try { + return Promise.resolve(next(context, callNext)); + } catch (err) { + return Promise.reject(err); } - callNext(); } + callNext(); } /**
runMiddleware() method is no longer a higher order function
HelpfulHuman_Router-Kit
train
js
de9b1ba21cbe47a09731dd509c147bcc243d0deb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ history = open('HISTORY.rst').read().replace('.. :changelog:', '') setup( name='clarify_python', - version='1.0.1', + version='1.0.0', description='The Clarify Python 3 Helper Library wraps the entire Clarify API in Python 3.x function calls.', long_description=readme + '\n\n' + history, author='Paul Murphy',
Changed version number to <I>
Clarify_clarify_python
train
py
660fddb2b31b202c51743f83d48facbde012c962
diff --git a/src/search/FindReplace.js b/src/search/FindReplace.js index <HASH>..<HASH> 100644 --- a/src/search/FindReplace.js +++ b/src/search/FindReplace.js @@ -720,11 +720,13 @@ define(function (require, exports, module) { this._panel.$panel .off(".replaceAll") .on("click.replaceAll", ".replace-checked", function (e) { - self.matches.reverse().forEach(function (match) { - if (match.isChecked) { - var rw = typeof self.replaceWhat === "string" ? self.replaceWith : FindUtils.parseDollars(self.replaceWith, match.result); - self.editor.document.replaceRange(rw, match.start, match.end, "+replaceAll"); - } + self.editor.document.batchOperation(function () { + self.matches.reverse().forEach(function (match) { + if (match.isChecked) { + var rw = typeof self.replaceWhat === "string" ? self.replaceWith : FindUtils.parseDollars(self.replaceWith, match.result); + self.editor.document.replaceRange(rw, match.start, match.end); + } + }); }); self.hideResults(); });
Use batchOperation() instead of edit op merging for replace all Logically, this is a single operation, not a set of merged adjacent operations, and we wouldn't want a second replaceAll done immediately afterward to merge with it (though it would be difficult to get into that case).
adobe_brackets
train
js
704b7f216a9c18d858c28ff8e0780fef7f49d792
diff --git a/src/readers/csv/csv.js b/src/readers/csv/csv.js index <HASH>..<HASH> 100644 --- a/src/readers/csv/csv.js +++ b/src/readers/csv/csv.js @@ -72,7 +72,7 @@ const CSVReader = Reader.extend({ try { const { delimiter = this._guessDelimiter(text) } = this; const parser = d3.dsvFormat(delimiter); - const data = parser.parse(text); + const data = parser.parse(text, row => Object.keys(row).every(key => !row[key]) ? null : row); const result = { columns: data.columns, data }; cached[path] = result;
Skip empty rows in csv (#<I>)
vizabi_vizabi
train
js
25d7eff071e7e72fbee3fc5bc2dd2e55757efb1a
diff --git a/sprd/model/Currency.js b/sprd/model/Currency.js index <HASH>..<HASH> 100644 --- a/sprd/model/Currency.js +++ b/sprd/model/Currency.js @@ -1,6 +1,6 @@ define(["sprd/data/SprdModel", "underscore"], function (Model, _) { - var dotCurrencyCodes = ['USD', 'GBP']; + var dotCurrencyCodes = ['USD', 'GBP', 'AUD']; return Model.inherit('sprd.model.Currency', {
DEV-<I> - Tablomat uses wrong pricing format in Australia (comma instead of period)
spreadshirt_rAppid.js-sprd
train
js
98ce76f04118c572072fc11ff0802ccdb4aa7979
diff --git a/src/ServiceFactory.php b/src/ServiceFactory.php index <HASH>..<HASH> 100644 --- a/src/ServiceFactory.php +++ b/src/ServiceFactory.php @@ -57,11 +57,6 @@ abstract /* static final (fuck fuck fuuuck!!) */ class ServiceFactory $serviceMethodArguments = null; $serviceAliases = $app->configValue('app.service.aliases', []); - // redirect main method - if ($requestUri->segment(1) == Service::METHOD_MAIN) { - return $response->redirect('/'. $serviceName)->end(); - } - // main if (empty($serviceName)) { $serviceName = Service::SERVICE_MAIN;
Move "main" method check to Service.
froq_froq-service
train
php
447fa861340497a1b1d21c30387a9bedcd8abb42
diff --git a/internal/services/recoveryservices/recovery_services_vault_resource_test.go b/internal/services/recoveryservices/recovery_services_vault_resource_test.go index <HASH>..<HASH> 100644 --- a/internal/services/recoveryservices/recovery_services_vault_resource_test.go +++ b/internal/services/recoveryservices/recovery_services_vault_resource_test.go @@ -286,6 +286,9 @@ resource "azurerm_recovery_services_vault" "test" { soft_delete_enabled = false storage_mode_type = "LocallyRedundant" + tags = { + ENV = "test" + } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) }
add tet for azurerm_recovery_services_vault
terraform-providers_terraform-provider-azurerm
train
go
7bf007a8b35558d536dd340caa42617cc0cfbeb0
diff --git a/pkg/envoy/xds/cache.go b/pkg/envoy/xds/cache.go index <HASH>..<HASH> 100644 --- a/pkg/envoy/xds/cache.go +++ b/pkg/envoy/xds/cache.go @@ -109,9 +109,7 @@ func (c *Cache) tx(typeURL string, upsertedResources map[string]proto.Message, d // If the value is unchanged, don't update the entry, to preserve its // lastModifiedVersion. This allows minimizing the frequency of // responses in GetResources. - // Calling proto.Message.String is not very cheap, but we assume that - // the reduced churn between the clients and the server is worth it. - if !found || oldV.resource.String() != value.String() { + if !found || !proto.Equal(oldV.resource, value) { if found { cacheLog.WithField(logfields.XDSResourceName, name).Debug("updating resource in cache")
pkg/envoy: use proto.Equal instead comparing strings On medium-large clusters with lots of endpoints, the conversion to Strings in order to perform a comparison can be expensive. Instead, we should make use of the protobuf equal function that should have the same result.
cilium_cilium
train
go
6af69da3fced4e8ac389c492338c6da8ad9968f2
diff --git a/__mocks__/react-easy-state.js b/__mocks__/react-easy-state.js index <HASH>..<HASH> 100644 --- a/__mocks__/react-easy-state.js +++ b/__mocks__/react-easy-state.js @@ -2,7 +2,7 @@ export * from '../src' // use this to test the es6 modules build -// export * from '../dist/es6' +// export * from '../dist/easyState.module' // use to test the commonJS build -// export * from '../dist/es5' +// export * from '../dist/easyState.commonJS'
fix (test): fix mocks for modules and commonJS build test
solkimicreb_react-easy-state
train
js
9b4b900fabc65e59f5ab158a00c47c401de2ae8f
diff --git a/lib/resque/worker.rb b/lib/resque/worker.rb index <HASH>..<HASH> 100644 --- a/lib/resque/worker.rb +++ b/lib/resque/worker.rb @@ -476,7 +476,7 @@ module Resque # Returns an array of string pids of all the other workers on this # machine. Useful when pruning dead workers on startup. def worker_pids - `ps -A -o pid,command | grep [r]esque | grep -v "resque-web"`.split("\n").map do |line| + `ps -A -o pid,command | grep resque | grep -v "resque-web"`.split("\n").map do |line| line.split(' ')[0] end end diff --git a/test/worker_test.rb b/test/worker_test.rb index <HASH>..<HASH> 100644 --- a/test/worker_test.rb +++ b/test/worker_test.rb @@ -267,6 +267,11 @@ context "Resque::Worker" do end end + test "worker_pids returns pids" do + known_workers = @worker.worker_pids + assert !known_workers.empty? + end + test "Processed jobs count" do @worker.work(0) assert_equal 1, Resque.info[:processed]
Fix issue with finding worker pids on jruby - Old pattern returned empty array of worker pids on jruby
resque_resque
train
rb,rb
23a0bf812292c71cf5159523d8ceb21a43eb0323
diff --git a/internetarchive/config.py b/internetarchive/config.py index <HASH>..<HASH> 100644 --- a/internetarchive/config.py +++ b/internetarchive/config.py @@ -26,6 +26,7 @@ internetarchive.config """ from __future__ import absolute_import +import errno import os from collections import defaultdict from six.moves import configparser @@ -97,8 +98,15 @@ def write_config_file(auth_config, config_file=None): # The XDG Base Dir spec requires that the XDG_CONFIG_HOME directory be created with mode 700. # is_xdg will be True iff config_file is ${XDG_CONFIG_HOME}/internetarchive/ia.ini. # So create grandparent first if necessary then parent to ensure both have the right mode. - os.makedirs(os.path.dirname(config_directory), mode=0o700, exist_ok=True) - os.mkdir(config_directory, mode=0o700) + try: + os.makedirs(os.path.dirname(config_directory), mode=0o700, exist_ok=True) + except TypeError: # Python 2 doesn't have exist_ok + try: + os.makedirs(os.path.dirname(config_directory), mode=0o700) + except OSError as e: + if e.errno != errno.EEXIST or not os.path.isdir(os.path.dirname(config_directory)): + raise + os.mkdir(config_directory, 0o700) # Write config file. with open(config_file, 'w') as fh:
Fix write_config_file directory creation under Python 2 due to missing os.makedirs exist_ok kwarg
jjjake_internetarchive
train
py
a7c4e407f08f7b60c6df3a1bb39f1be049b82971
diff --git a/tests/Unit/DirectoryTests/ProductTest.php b/tests/Unit/DirectoryTests/ProductTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/DirectoryTests/ProductTest.php +++ b/tests/Unit/DirectoryTests/ProductTest.php @@ -108,4 +108,18 @@ class ProductTest extends \Test\TestCase $items = $product->getAllItems(); $this->assertCount(0, $items); } + + public function testEmptyAgreements() + { + $product = new \Connect\Product(); + $agreements = $product->getAllAgreements(); + $this->assertCount(0, $agreements); + } + + public function testEmptyActions() + { + $product = new \Connect\Product(); + $actions = $product->getAllActions(); + $this->assertCount(0, $actions); + } }
Added test to ensure <I>% coverage on Products
ingrammicro_connect-php-sdk
train
php
b289be540a441e3ea392c1011e668373b0c3e166
diff --git a/lib/neovim/ruby_provider.rb b/lib/neovim/ruby_provider.rb index <HASH>..<HASH> 100644 --- a/lib/neovim/ruby_provider.rb +++ b/lib/neovim/ruby_provider.rb @@ -28,7 +28,7 @@ module Neovim def self.__define_setup(plug) plug.__send__(:setup) do |client| $stdout.define_singleton_method(:write) do |string| - client.out_write(string) + client.out_write(string + "\n") end $stderr.define_singleton_method(:write) do |string|
Add newline to stdout writes
neovim_neovim-ruby
train
rb
72f01d167fff16036dba2af3161bd59f71ee9291
diff --git a/neo4j/meta.py b/neo4j/meta.py index <HASH>..<HASH> 100644 --- a/neo4j/meta.py +++ b/neo4j/meta.py @@ -19,4 +19,4 @@ # limitations under the License. -version = "1.5.0" +version = "1.6.0"
Updated version to <I>
neo4j_neo4j-python-driver
train
py
6e2a4f00fbe7be60029c3f7303d124cbaca85a1d
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -1023,7 +1023,13 @@ class Collection extends Object } else { $inValues = $values[$column]; } - $result[$column][$operator] = array_values($inValues); + + $inValues = array_values($inValues); + if (count($inValues) == 1) { + $result[$column] = $inValues[0]; + } else { + $result[$column][$operator] = $inValues; + } } return $result;
update buildInCondition for array of one element
yiisoft_yii2-mongodb
train
php
f7508cf2ce8fced2165cce9456044c2c14cba34b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ long_description = "" with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as readme: long_description = readme.read() -tests_require = ["pytest", "pytest-cov", "codecov", "flake8", "black", "psutil"] +tests_require = ["pytest>=5,<6", "pytest-cov>=2,<3", "codecov>=2,<3", "flake8>=3,<4", "black", "psutil"] class BaseCommand(Command):
Set a specific range of test dependency versions to make builds more stable
slackapi_python-slackclient
train
py
ee7d1a2de91828b4e02531fd87a37738432def68
diff --git a/ui/src/plugins/Loading.js b/ui/src/plugins/Loading.js index <HASH>..<HASH> 100644 --- a/ui/src/plugins/Loading.js +++ b/ui/src/plugins/Loading.js @@ -5,6 +5,7 @@ import { isSSR } from './Platform.js' import uid from '../utils/uid.js' let + hiding = false, vm = null, timeout, props = {}, @@ -32,6 +33,11 @@ export default { props.customClass += ` text-${props.backgroundColor}` + // Force hide(don't wait for transition to finish) to show the next loading + if (hiding && vm !== null) { + vm.$emit('destroy') + } + if (this.isActive) { if (vm) { if (!vm.isActive) { @@ -101,7 +107,7 @@ export default { }, hide () { - if (!this.isActive) { + if (!this.isActive || hiding) { return } @@ -111,12 +117,14 @@ export default { this.isActive = false } else { + hiding = true vm.isActive = false vm.$on('destroy', () => { if (vm !== null) { vm.$destroy() } this.isActive = false + hiding = false }) } },
Fixed some of sequential Loading's were not showing When hide is called plugin will enter the hiding state. Hiding state disappears when the leave transition is finished just as before. If `show()` is called when the loading is hiding, the loading will be force hidden, then the new loading will be shown.
quasarframework_quasar
train
js
ddf82c333702e22d3cd7e5c693ad0603089a57a4
diff --git a/ethereum.go b/ethereum.go index <HASH>..<HASH> 100644 --- a/ethereum.go +++ b/ethereum.go @@ -65,7 +65,8 @@ func main() { go func() { for { res := dagger.Search(ethutil.Big("01001"), ethutil.BigPow(2, 36)) - server.Broadcast("blockmine", ethutil.Encode(res.String())) + log.Println("Res dagger", res) + //server.Broadcast("blockmine", ethutil.Encode(res.String())) } }() } diff --git a/testing.go b/testing.go index <HASH>..<HASH> 100644 --- a/testing.go +++ b/testing.go @@ -16,11 +16,11 @@ func Testing() { bm := NewBlockManager() tx := NewTransaction("\x00", 20, []string{"PUSH"}) - txData := tx.MarshalRlp() + txData := tx.RlpEncode() //fmt.Printf("%q\n", txData) copyTx := &Transaction{} - copyTx.UnmarshalRlp(txData) + copyTx.RlpDecode(txData) //fmt.Println(tx) //fmt.Println(copyTx)
Removed dagger broadcasting to the net
ethereum_go-ethereum
train
go,go
cc036b4f2bae0ae98fd6b0573ce4ede39740418d
diff --git a/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php b/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php @@ -85,8 +85,6 @@ class BasicAuthenticationListener implements ListenerInterface return; } - $event->stopPropagation(); - $event->setResponse($this->authenticationEntryPoint->start($request, $failed)); } }
[Security] Removed useless method call
symfony_symfony
train
php
76792903df70c0b4b3a9f28d29ed7f55033bca4a
diff --git a/openhtf/util/measurements.py b/openhtf/util/measurements.py index <HASH>..<HASH> 100644 --- a/openhtf/util/measurements.py +++ b/openhtf/util/measurements.py @@ -63,7 +63,6 @@ Examples: import collections -import itertools import logging from enum import Enum @@ -350,10 +349,8 @@ class Collection(mutablerecords.Record('Collection', ['_measurements'], raise NotAMeasurementError('Not a measurement', name, self._measurements) def __iter__(self): # pylint: disable=invalid-name - def _GetMeasurementValue(item): # pylint: disable=invalid-name - """Extract a single MeasurementValue's value.""" - return item[0], item[1].value - return itertools.imap(_GetMeasurementValue, self._values.iteritems()) + """Extract each MeasurementValue's value.""" + return ((key, val.value) for key, val in self._values.iteritems()) def __setattr__(self, name, value): # pylint: disable=invalid-name self[name] = value
Cleanup measurements.Collection.__iter__ Replaced a function and itertools.imap() call with a simpler generator expression
google_openhtf
train
py
914074598c35f018514aa181b01c4d4d9cdd9eed
diff --git a/src/main/java/com/cloudbees/jenkins/support/impl/NetworkInterfaces.java b/src/main/java/com/cloudbees/jenkins/support/impl/NetworkInterfaces.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/cloudbees/jenkins/support/impl/NetworkInterfaces.java +++ b/src/main/java/com/cloudbees/jenkins/support/impl/NetworkInterfaces.java @@ -122,8 +122,8 @@ public class NetworkInterfaces extends Component { bos.append(" ** Index - ").append(ni.getIndex()).append("\n"); Enumeration<InetAddress> inetAddresses = ni.getInetAddresses(); while (inetAddresses.hasMoreElements()) { - NetworkInterface networkInterface = networkInterfaces.nextElement(); - bos.append(" ** InetAddress - ").append(networkInterface).append("\n"); + InetAddress inetAddress = inetAddresses.nextElement(); + bos.append(" ** InetAddress - ").append(inetAddress).append("\n"); } bos.append(" ** MTU - ").append(ni.getMTU()).append("\n"); bos.append(" ** Is Up - ").append(ni.isUp()).append("\n");
Refer to inetAddress in loop.
jenkinsci_support-core-plugin
train
java
3b82416ad34ab83283be99e7434277c84ab3d228
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -86,8 +86,13 @@ setup( 'pyyaml', 'webencodings', 'gevent==1.1.2', - 'webassets', - ], + 'webassets==0.12.0', + 'pyamf' + ], + dependency_links=[ + 'git+https://github.com/ikreymer/webassets.git@pyinstaller#egg=webassets-0.12.0', + 'git+https://github.com/t0m/pyamf.git@python3#egg=pyamf-0.8.0' + ], tests_require=[ 'pytest', 'WebTest',
setup: add specific dependencies for webassets, pyamf
webrecorder_pywb
train
py
da7908239c0666fd12d10a43a00a1e8657619da9
diff --git a/lib/Api/Campaigns.php b/lib/Api/Campaigns.php index <HASH>..<HASH> 100644 --- a/lib/Api/Campaigns.php +++ b/lib/Api/Campaigns.php @@ -131,7 +131,7 @@ class Campaigns extends Api return $this->makeRequest($this->endpoint.'/'.$id.'/contacts', $parameters); } - /** + /** * Clone an Existing campaign * * @param int $id Campaign ID
one more space so it looks perty
mautic_api-library
train
php
8df95bc674561e2039e4b9d7694706db13546796
diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index <HASH>..<HASH> 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -179,8 +179,20 @@ ol.interaction.Select.prototype.handleMapBrowserEvent = * @inheritDoc */ ol.interaction.Select.prototype.setMap = function(map) { + var currentMap = this.getMap(); + var selectedFeatures = this.featureOverlay_.getFeatures(); + if (!goog.isNull(currentMap)) { + selectedFeatures.forEach(function(feature) { + currentMap.getSkippedFeatures().remove(feature); + }); + } goog.base(this, 'setMap', map); this.featureOverlay_.setMap(map); + if (!goog.isNull(map)) { + selectedFeatures.forEach(function(feature) { + map.getSkippedFeatures().push(feature); + }); + } };
Handle skipped features when setting the map When a Select interaction is removed from the map, it should remove its selected features from the map's skippedFeatures collection. When it is added to a map, it should add them.
openlayers_openlayers
train
js
9823516670ae09a0c2cf7207030ed3993a044803
diff --git a/lib/tools/adb-commands.js b/lib/tools/adb-commands.js index <HASH>..<HASH> 100644 --- a/lib/tools/adb-commands.js +++ b/lib/tools/adb-commands.js @@ -9,6 +9,8 @@ import Logcat from '../logcat'; import { sleep, waitForCondition } from 'asyncbox'; import { SubProcess } from 'teen_process'; import B from 'bluebird'; +import { quote } from 'shell-quote'; + const SETTINGS_HELPER_ID = 'io.appium.settings'; const WIFI_CONNECTION_SETTING_RECEIVER = `${SETTINGS_HELPER_ID}/.receivers.WiFiConnectionSettingReceiver`; @@ -1541,12 +1543,14 @@ methods.screenrecord = function (destination, options = {}) { cmd.push('--bugreport'); } cmd.push(destination); - log.debug(`Building screenrecord process with the command line: adb shell ${cmd.join(' ')}`); - return new SubProcess(this.executable.path, [ + + const fullCmd = [ ...this.executable.defaultArgs, 'shell', ...cmd - ]); + ]; + log.debug(`Building screenrecord process with the command line: adb ${quote(fullCmd)}`); + return new SubProcess(this.executable.path, fullCmd); }; export default methods;
Improve logging for the screenrecord command (#<I>) * Improve logging for the screenrecord command * Use shell-quote call
appium_appium-adb
train
js
020fa51c5437fef8a44b3437cbd229b28510e147
diff --git a/src/Symfony/Component/HttpFoundation/RedirectResponse.php b/src/Symfony/Component/HttpFoundation/RedirectResponse.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/RedirectResponse.php +++ b/src/Symfony/Component/HttpFoundation/RedirectResponse.php @@ -37,10 +37,13 @@ class RedirectResponse extends Response } parent::__construct( - sprintf('<html> + sprintf('<!DOCTYPE html> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="refresh" content="1;url=%1$s" /> + + <title>Redirecting to %1$s</title> </head> <body> Redirecting to <a href="%1$s">%1$s</a>.
[RedirectResponse] Added missing `doctype` and `title` tag
symfony_symfony
train
php
df5b5086176d46fa1dd33a4f0733c68be65ce7e7
diff --git a/pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebFilterAnnotationScanner.java b/pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebFilterAnnotationScanner.java index <HASH>..<HASH> 100644 --- a/pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebFilterAnnotationScanner.java +++ b/pax-web-extender-war/src/main/java/org/ops4j/pax/web/extender/war/internal/parser/WebFilterAnnotationScanner.java @@ -96,6 +96,7 @@ public class WebFilterAnnotationScanner extends } WebAppFilterMapping mapping = new WebAppFilterMapping(); mapping.setDispatcherTypes(dispatcherSet); + mapping.setFilterName(name); webApp.addFilterMapping(mapping); } else { WebAppInitParam[] initParams = filter.getInitParams(); @@ -153,6 +154,7 @@ public class WebFilterAnnotationScanner extends } WebAppFilterMapping mapping = new WebAppFilterMapping(); mapping.setDispatcherTypes(dispatcherSet); + mapping.setFilterName(name); webApp.addFilterMapping(mapping); } }
[PAXWEB-<I>] - Annotated Filters miss to set the FilterName: "Filter name is null."
ops4j_org.ops4j.pax.web
train
java
58a00ac0ad1696fee5935601a64177ee94b9970b
diff --git a/spyderlib/utils/introspection/jedi_plugin.py b/spyderlib/utils/introspection/jedi_plugin.py index <HASH>..<HASH> 100644 --- a/spyderlib/utils/introspection/jedi_plugin.py +++ b/spyderlib/utils/introspection/jedi_plugin.py @@ -172,7 +172,12 @@ class JediPlugin(IntrospectionPlugin): def parse_call_def(self, call_def): """Get a formatted calltip and docstring from Jedi""" - call_def = call_def[0] + for cd in call_def: + if cd.doc: + call_def = cd + break + else: + call_def = call_def[0] name = call_def.name if name is None: return
Fix handling of multiple call defs.
spyder-ide_spyder
train
py
480e966ad1e6dee3bbfba009016a0d8615ccf65f
diff --git a/aetros/logger.py b/aetros/logger.py index <HASH>..<HASH> 100755 --- a/aetros/logger.py +++ b/aetros/logger.py @@ -99,22 +99,25 @@ class GeneralLogger(object): self.write(buf) + flush_chars = [b'\n', b'\r'] + while True: try: # needs to be 1 so we fetch data in near real-time chunk = buffer.read(1) if chunk == b'': + if current_line: + handle_line(current_line) return current_line += chunk - while b'\n' in current_line: - current_line = current_line.replace(b'\r', b'') - pos = current_line.find(b'\n') - line = current_line[:pos+1] - current_line = current_line[pos+1:] - - handle_line(line) + for char in flush_chars: + while char in current_line: + pos = current_line.find(char) + line = current_line[:pos+1] + current_line = current_line[pos+1:] + handle_line(line) except (KeyboardInterrupt, SystemExit): raise
Use \r as flush character as well
aetros_aetros-cli
train
py
6c98b4608f8cf18502dfa1d2f2adf992b5e9189c
diff --git a/cmd/runtimetest/main.go b/cmd/runtimetest/main.go index <HASH>..<HASH> 100644 --- a/cmd/runtimetest/main.go +++ b/cmd/runtimetest/main.go @@ -68,7 +68,7 @@ func loadSpecConfig(path string) (spec *rspec.Spec, err error) { cf, err := os.Open(configPath) if err != nil { if os.IsNotExist(err) { - return nil, fmt.Errorf("%s not found", specConfig) + return nil, specerror.NewError(specerror.ConfigInRootBundleDir, err, rspec.Version) } return nil, err
runtimetest: Raise ConfigInRootBundleDir for missing config.json This is a bit tricky, because before we load the config, we don't know the target spec version. If a future spec version relaxes the current requirement, we'll have difficulty reporting an "I couldn't find the config" error as a spec violation. If/when that happens, I'm fine dropping this block altogether, and having this error fall through as a non-spec "you called us wrong" error.
opencontainers_runtime-tools
train
go
1aea2b1fa96500e0972b0141485782582511f069
diff --git a/pyes/query.py b/pyes/query.py index <HASH>..<HASH> 100644 --- a/pyes/query.py +++ b/pyes/query.py @@ -1775,7 +1775,7 @@ class FunctionScoreQuery(Query): class RandomFunction(FunctionScoreFunction): """Is a random boost based on a seed value""" - _internal_name = 'random_Score' + _internal_name = 'random_score' def __init__(self, seed, filter=None): self.seed = seed
fixed typo which broke random_score function
aparo_pyes
train
py
5a804abd331e1c266dd81124a2bfc66bf55a52f3
diff --git a/lib/thrift_client.rb b/lib/thrift_client.rb index <HASH>..<HASH> 100644 --- a/lib/thrift_client.rb +++ b/lib/thrift_client.rb @@ -210,14 +210,16 @@ module TimingOutThriftClient end def has_timeouts! - if @options[:timeout_overrides].any? - if (@options[:transport_wrapper] || @options[:transport]).method_defined?(:timeout=) - return true - else - warn "ThriftClient: Timeout overrides have no effect with with transport type #{(@options[:transport_wrapper] || @options[:transport])}" - end + transport_can_timeout? if @options[:timeout_overrides].any? + end + + def transport_can_timeout? + if (@options[:transport_wrapper] || @options[:transport]).method_defined?(:timeout=) + true + else + warn "ThriftClient: Timeout overrides have no effect with with transport type #{(@options[:transport_wrapper] || @options[:transport])}" + false end - false end end
breaking out the timeout override and transport checks
twitter_thrift_client
train
rb
9e62f7e52392408715d8b953713c0ef2726b5ebe
diff --git a/src/CliRenderer.php b/src/CliRenderer.php index <HASH>..<HASH> 100644 --- a/src/CliRenderer.php +++ b/src/CliRenderer.php @@ -130,7 +130,7 @@ class CliRenderer /** * @param string $inlineBlockClass * - * @return null|CliBlockRendererInterface + * @return null|CliInlineRendererInterface */ private function getInlineRendererForClass($inlineBlockClass) {
Correct typehint - makes the IDE happier.
AydinHassan_cli-md-renderer
train
php
d4d206e614faddd321b250668e9fb8a50fbdf96b
diff --git a/config/module.config.php b/config/module.config.php index <HASH>..<HASH> 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -72,8 +72,7 @@ return array( ), ), )), - - // Navigation-Konfig für die main_navigation + 'navigation' => array( 'default' => array( 'settings' => array( diff --git a/src/Settings/Listener/InjectSubNavigationListener.php b/src/Settings/Listener/InjectSubNavigationListener.php index <HASH>..<HASH> 100644 --- a/src/Settings/Listener/InjectSubNavigationListener.php +++ b/src/Settings/Listener/InjectSubNavigationListener.php @@ -26,7 +26,7 @@ class InjectSubNavigationListener } $services = $event->getApplication()->getServiceManager(); - $navigation = $services->get('main_navigation'); + $navigation = $services->get('Core/Navigation'); $settingsMenu = $navigation->findOneBy('route', 'lang/settings'); if ($settingsMenu->hasChildren()) {
[Core] renamed the "main_navigation" into Core/Navigation to fit the naming conventions.
yawik_settings
train
php,php
0ac09d0003ea8c2dc2d433ed1d23b19f7ce4de71
diff --git a/javascript/node/selenium-webdriver/lib/until.js b/javascript/node/selenium-webdriver/lib/until.js index <HASH>..<HASH> 100644 --- a/javascript/node/selenium-webdriver/lib/until.js +++ b/javascript/node/selenium-webdriver/lib/until.js @@ -205,7 +205,7 @@ exports.urlContains = function urlContains(substrUrl) { 'for URL to contain ' + JSON.stringify(substrUrl), function(driver) { return driver.getCurrentUrl().then(function(url) { - return url.indexOf(substrUrl) !== -1; + return url && url.indexOf(substrUrl) !== -1; }); }); };
fix: add until.urlContains null value check (#<I>) `driver.getCurrentUrl()` can return `null` in some cases, which causes a `TypeError` instead of continuing to retry for the expected time.
SeleniumHQ_selenium
train
js
60958fdbd3c5ad8f2fb9678553564aa3ae9d15ac
diff --git a/.size-limit.js b/.size-limit.js index <HASH>..<HASH> 100755 --- a/.size-limit.js +++ b/.size-limit.js @@ -1,6 +1,6 @@ const shared = { webpack: false, running: false } module.exports = [ - { path: "dist/vue-treeselect.umd.min.js", limit: "16 KB", ...shared }, + { path: "dist/vue-treeselect.umd.min.js", limit: "16.5 KB", ...shared }, { path: "dist/vue-treeselect.min.css", limit: "5 KB", ...shared }, ]
increase the upper limit for the size of minified js file
riophae_vue-treeselect
train
js
dabda45248f6bbee9989ec1b06108973d09f2285
diff --git a/tests/ATest.php b/tests/ATest.php index <HASH>..<HASH> 100644 --- a/tests/ATest.php +++ b/tests/ATest.php @@ -222,4 +222,13 @@ class ATest extends PHPUnit_Framework_TestCase $this->assertEquals(array(0, 2, 4, 6, 8, 10), $a->filter($even)->array); $this->assertEquals(array(1, 3, 5, 7, 9), $a->filter($odd)->array); } + + + public function testMappingValuesShouldSuccess() + { + $cube = function($n){return $n * $n * $n;}; + + $a = new A(range(1, 5)); + $this->assertEquals(array(1, 8, 27, 64, 125), $a->map($cube)->array); + } }
Unit testing for map feature of A class
malenkiki_bah
train
php
180cc3bd4c75372022d857f689ce51dbe54de097
diff --git a/src/Domains/Resource/ResourceBlueprint.php b/src/Domains/Resource/ResourceBlueprint.php index <HASH>..<HASH> 100644 --- a/src/Domains/Resource/ResourceBlueprint.php +++ b/src/Domains/Resource/ResourceBlueprint.php @@ -10,7 +10,6 @@ use Illuminate\Support\Fluent; * @method ResourceBlueprint model($model) * @method ResourceBlueprint nav($nav) * @method ResourceBlueprint resourceKey($key) - * @method ResourceBlueprint label($label) * @method ResourceBlueprint entryLabel($entryLabel) */ class ResourceBlueprint extends Fluent @@ -22,6 +21,14 @@ class ResourceBlueprint extends Fluent return $this->resourceKey ?? str_singular($this->table); } + public function label($label) + { + $this->offsetSet('label', $label); + if (! $this->resourceKey) { + $this->resourceKey(str_slug(str_singular($label), '_')); + } + } + public function fill(array $attributes = []) { foreach ($attributes as $key => $value) {
Set resource key from label, if not set before
superv_platform
train
php
efd4bc2ce90d2e401f627c216b8ba237c63ad6f9
diff --git a/Eloquent/Concerns/HasAttributes.php b/Eloquent/Concerns/HasAttributes.php index <HASH>..<HASH> 100644 --- a/Eloquent/Concerns/HasAttributes.php +++ b/Eloquent/Concerns/HasAttributes.php @@ -1178,6 +1178,8 @@ trait HasAttributes } elseif ($this->hasCast($key, ['object', 'collection'])) { return $this->castAttribute($key, $current) == $this->castAttribute($key, $original); + } elseif ($this->hasCast($key, ['real', 'float', 'double'])) { + return abs($this->castAttribute($key, $current) - $this->castAttribute($key, $original)) < PHP_FLOAT_EPSILON * 4; } elseif ($this->hasCast($key)) { return $this->castAttribute($key, $current) === $this->castAttribute($key, $original);
Correct implementation of float casting comparison (#<I>)
illuminate_database
train
php
ee0a807f4539e800cd443a43eb0fd68895cca965
diff --git a/lib/chef/resource/rhsm_register.rb b/lib/chef/resource/rhsm_register.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/rhsm_register.rb +++ b/lib/chef/resource/rhsm_register.rb @@ -64,7 +64,7 @@ class Chef property :auto_attach, [TrueClass, FalseClass], description: "If true, RHSM will attempt to automatically attach the host to applicable subscriptions. It is generally better to use an activation key with the subscriptions pre-defined.", - introduced: "16.5" + default: false property :install_katello_agent, [TrueClass, FalseClass], description: "If true, the 'katello-agent' RPM will be installed.",
fixes typo made in auto_attach edit
chef_chef
train
rb
0a87fa39494184f51e42d69b80e70d9202f3acde
diff --git a/src/passes/bloom.js b/src/passes/bloom.js index <HASH>..<HASH> 100644 --- a/src/passes/bloom.js +++ b/src/passes/bloom.js @@ -43,12 +43,11 @@ export class BloomPass extends Pass { this.renderTargetX = new THREE.WebGLRenderTarget(1, 1, { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, + generateMipmaps: false, stencilBuffer: false, depthBuffer: false }); - this.renderTargetX.texture.generateMipmaps = false; - /** * A second render target. * @@ -67,6 +66,7 @@ export class BloomPass extends Pass { * * @property resolutionScale * @type Number + * @default 0.5 */ this.resolutionScale = (options.resolutionScale === undefined) ? 0.5 : options.resolutionScale; @@ -185,7 +185,7 @@ export class BloomPass extends Pass { this.convolutionMaterial.uniforms.tDiffuse.value = this.renderTargetX; renderer.render(this.scene, this.camera, this.renderTargetY); - // Render original scene with superimposed blur. + // Render the original scene with superimposed blur. if(this.renderToScreen) { this.quad.material = this.combineMaterial;
Code cleanup. Made it more compact.
vanruesc_postprocessing
train
js
0c7c95b58868f20037024e60692e4e47ac30eab3
diff --git a/lib/gemspec.rb b/lib/gemspec.rb index <HASH>..<HASH> 100644 --- a/lib/gemspec.rb +++ b/lib/gemspec.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby require File.expand_path('../../vendor/refinerycms/refinery.rb', __FILE__) -files = %w( .gitignore .yardopts Gemfile ).map { |file| Dir[file] }.flatten +files = %w( .gitignore .yardopts Gemfile readme.md license.md changelog.md todo.md ).map { |file| Dir[file] }.flatten %w(app bin config db features lib public script test themes vendor).sort.each do |dir| files += Dir.glob("#{dir}/**/*") end
Add all documentation to the gem. license.md is particularly important because if you don't distribute software with a license, then it isn't licensed.
refinery_refinerycms
train
rb
3c17a401bd2f73e4636ad31e8e988237664f18e0
diff --git a/Tests/Formatter/AtomFormatterTest.php b/Tests/Formatter/AtomFormatterTest.php index <HASH>..<HASH> 100644 --- a/Tests/Formatter/AtomFormatterTest.php +++ b/Tests/Formatter/AtomFormatterTest.php @@ -141,7 +141,7 @@ class AtomFormatterTest extends \PHPUnit_Framework_TestCase $output = $feed->render('atom'); $this->assertContains('<title><![CDATA[Fake title]]></title>', $output); - $this->assertContains('<summary><![CDATA[Fake description or content]]></summary>', $output); + $this->assertContains('<summary type="html"><![CDATA[Fake description or content]]></summary>', $output); $this->assertContains('<link href="http://github.com/eko/FeedBundle/article/fake/url"/>', $output); }
Update AtomFormatter test with html type on summary element.
eko_FeedBundle
train
php
72b7c33ed5176a9d42a91b479397334f52140a07
diff --git a/src/IterableCodeExtractor.php b/src/IterableCodeExtractor.php index <HASH>..<HASH> 100644 --- a/src/IterableCodeExtractor.php +++ b/src/IterableCodeExtractor.php @@ -196,7 +196,7 @@ trait IterableCodeExtractor { $files = new RecursiveIteratorIterator( new RecursiveCallbackFilterIterator( - new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ), + new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::UNIX_PATHS ), function ( $file, $key, $iterator ) use ( $include, $exclude, $extensions ) { /** @var RecursiveCallbackFilterIterator $iterator */ /** @var SplFileInfo $file */
Pass UNIX_PATHS flag to RecursiveDirectoryIterator constructor This is needed so that the files in the RecursiveCallbackFilterIterator callback have Unix-style paths for matching against $include and $exclude.
wp-cli_i18n-command
train
php
07eca8a9e4f2455639ebccb5a5abeba997647de5
diff --git a/BAC0/infos.py b/BAC0/infos.py index <HASH>..<HASH> 100644 --- a/BAC0/infos.py +++ b/BAC0/infos.py @@ -10,6 +10,7 @@ Informations MetaData __author__ = 'Christian Tremblay, P.Eng.' __email__ = 'christian.tremblay@servisys.com' -__url__ = 'http://www.servisys.com' -__version__ = '0.98' +__url__ = 'https://github.com/ChristianTremblay/BAC0' +__download_url__ = 'https://github.com/ChristianTremblay/BAC0/archive/master.zip' +__version__ = '0.98.1' __license__ = 'LGPLv3' \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,10 +6,12 @@ from BAC0 import infos as infos setup(name='BAC0', version=infos.__version__, - description='BACnet Scripting Library', + description='BACnet Scripting Framework for testing DDC Controls', author=infos.__author__, author_email=infos.__email__, url=infos.__url__, + download_url = infos.__download_url__, + keywords = ['bacnet', 'building', 'automation', 'test'], packages=[ 'BAC0', 'BAC0.core',
Little tweaks to setup.py while configuring PyPI sync
ChristianTremblay_BAC0
train
py,py
5101c6f96ff1ec34ccbf8006f6e192fd45005602
diff --git a/test/tc_package.rb b/test/tc_package.rb index <HASH>..<HASH> 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -78,7 +78,7 @@ class TestPackage < Test::Unit::TestCase def test_validation assert_equal(@package.validate.size, 0, @package.validate) Axlsx::Workbook.send(:class_variable_set, :@@date1904, 9900) - assert_equal(@package.validate.size, 2, @package.validate) + assert(@package.validate.size > 0) end def test_parts
patch spec for xerces/libxml parser differences
randym_axlsx
train
rb
5903aa53c02bdd999bf0f29b0977bb7fc3dab6ce
diff --git a/src/view/items/Yielder.js b/src/view/items/Yielder.js index <HASH>..<HASH> 100644 --- a/src/view/items/Yielder.js +++ b/src/view/items/Yielder.js @@ -1,7 +1,6 @@ import Item from './shared/Item'; import Fragment from '../Fragment'; import parse from '../../parse/_parse'; -import runloop from '../../global/runloop'; import { warnIfDebug } from '../../utils/log'; import { removeFromArray } from '../../utils/array'; @@ -45,7 +44,6 @@ export default class Yielder extends Item { bubble () { if ( !this.dirty ) { - runloop.addFragment( this.fragment ); this.containerFragment.bubble(); this.dirty = true; }
no need to register the yielder fragment when bubbling via the container fragment
ractivejs_ractive
train
js