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
87fa0351eba4d66965961aa27eb0268e80e526d2
diff --git a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php index <HASH>..<HASH> 100644 --- a/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php +++ b/src/Surfnet/StepupMiddlewareClient/Identity/Dto/RaListingSearchQuery.php @@ -57,19 +57,35 @@ final class RaListingSearchQuery implements HttpQuery $this->pageNumber = $pageNumber; } + /** + * @param string $institution + * @return RaListingSearchQuery + */ + public function setInstitution($institution) + { + $this->assertNonEmptyString($institution, 'institution'); + + $this->institution = $institution; + + return $this; + } /** * @param string $orderBy + * @return RaListingSearchQuery */ public function setOrderBy($orderBy) { $this->assertNonEmptyString($orderBy, 'orderBy'); $this->orderBy = $orderBy; + + return $this; } /** * @param string|null $orderDirection + * @return RaListingSearchQuery */ public function setOrderDirection($orderDirection) { @@ -79,6 +95,8 @@ final class RaListingSearchQuery implements HttpQuery ); $this->orderDirection = $orderDirection ?: null; + + return $this; } private function assertNonEmptyString($value, $parameterName)
Allow setting of Institution on RaSearchQuery
OpenConext_Stepup-Middleware-clientbundle
train
php
97e6a66b92fe79e6d14be5c9c85f50f673960027
diff --git a/src/Interfaces/WebAccess.php b/src/Interfaces/WebAccess.php index <HASH>..<HASH> 100644 --- a/src/Interfaces/WebAccess.php +++ b/src/Interfaces/WebAccess.php @@ -2,12 +2,13 @@ namespace BotMan\BotMan\Interfaces; -interface WebAccess { - /** - * Get the instance as a web accessible array. - * This will be used within the WebDriver. - * - * @return array - */ - public function toWebDriver(); -} \ No newline at end of file +interface WebAccess +{ + /** + * Get the instance as a web accessible array. + * This will be used within the WebDriver. + * + * @return array + */ + public function toWebDriver(); +}
Apply fixes from StyleCI (#<I>)
botman_botman
train
php
c947edfbe4aa5fcff480d454dd3fa600945d6948
diff --git a/pymc3/distributions/__init__.py b/pymc3/distributions/__init__.py index <HASH>..<HASH> 100644 --- a/pymc3/distributions/__init__.py +++ b/pymc3/distributions/__init__.py @@ -60,6 +60,8 @@ from .multivariate import LKJCorr from .timeseries import AR1 from .timeseries import GaussianRandomWalk from .timeseries import GARCH11 +from .timeseries import MvGaussianRandomWalk +from .timeseries import MvStudentTRandomWalk from .transforms import transform from .transforms import stick_breaking @@ -116,6 +118,8 @@ __all__ = ['Uniform', 'LKJCorr', 'AR1', 'GaussianRandomWalk', + 'MvGaussianRandomWalk', + 'MvStudentTRandomWalk', 'GARCH11', 'SkewNormal', 'Mixture',
MAINT Add multivariate random walks to imports.
pymc-devs_pymc
train
py
0368b552dd73de64135f773f0f36f3bbe9d89530
diff --git a/util.py b/util.py index <HASH>..<HASH> 100644 --- a/util.py +++ b/util.py @@ -37,5 +37,7 @@ def validate(**schema): typ = schema[name] validators[typ](value) return fn(*args) + validator.__name__ = fn.__name__ + validator.__doc__ = fn.__doc__ return validator return wrapper
copy name and docstring to decorator function
bivab_smbus-cffi
train
py
62de678b51bf8807fd6a66eb15c0704f16d24783
diff --git a/git/githistory/rewriter.go b/git/githistory/rewriter.go index <HASH>..<HASH> 100644 --- a/git/githistory/rewriter.go +++ b/git/githistory/rewriter.go @@ -162,6 +162,8 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) { return nil, err } + p := r.l.Percentage("migrate: Rewriting commits", uint64(len(commits))) + // Keep track of the last commit that we rewrote. Callers often want // this so that they can perform a git-update-ref(1). var tip []byte @@ -224,9 +226,15 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) { // commit. r.cacheCommit(oid, rewrittenCommit) + // Increment the percentage displayed in the terminal. + p.Count(1) + // Move the tip forward. tip = rewrittenCommit } + + r.l.Close() + return tip, err }
git/githistory: count percentage completion for rewriting commits
git-lfs_git-lfs
train
go
03fefd6f7a661dc985d1d89231087fdd328b16a6
diff --git a/host/calibrate_plsr_dac.py b/host/calibrate_plsr_dac.py index <HASH>..<HASH> 100644 --- a/host/calibrate_plsr_dac.py +++ b/host/calibrate_plsr_dac.py @@ -79,7 +79,7 @@ class PlsrDacScan(ScanBase): fit_plt, = plt.plot(x, fit_fn(x), '--k') plt.title('PlsrDAC calibration') plt.xlabel('PlsrDAC') - plt.ylabel('voltage [V]') + plt.ylabel('voltage [mV]') plt.grid(True) plt.legend([data_plt, fit_plt], ["data", str(fit_fn)], loc=0) if show:
ENH: unit in mV not V
SiLab-Bonn_pyBAR
train
py
98ff73453b597c474d4504ccda39baae51024f36
diff --git a/src/sdk/GameyeClient.php b/src/sdk/GameyeClient.php index <HASH>..<HASH> 100644 --- a/src/sdk/GameyeClient.php +++ b/src/sdk/GameyeClient.php @@ -160,7 +160,7 @@ class GameyeClient $query = "?" . $query; } - $url = sprintf('%s/fetch/%s%s', $this->config['ApiEndpoint'], $state, $query); + $url = sprintf('%s/query/%s%s', $this->config['ApiEndpoint'], $state, $query); return $url; } @@ -168,7 +168,7 @@ class GameyeClient private function makeCommandUrl( $action ) { - $url = sprintf('%s/action/%s', $this->config['ApiEndpoint'], $action); + $url = sprintf('%s/command/%s', $this->config['ApiEndpoint'], $action); return $url; }
using query / command (#<I>)
Gameye_gameye-sdk-php
train
php
9521d466a0a4b7c4c5906570bbbb835f91e1f13d
diff --git a/helpers/configs.rb b/helpers/configs.rb index <HASH>..<HASH> 100644 --- a/helpers/configs.rb +++ b/helpers/configs.rb @@ -9,6 +9,7 @@ end def set_log_file(config) unless config['log_file'].nil? + puts_info "Log file: #{config['log_file']}" log_path = config['log_file'] log = File.new log_path, 'a+' STDOUT.reopen log @@ -22,8 +23,11 @@ end def set_pid_file(config) pid_path = config['pid_file'] || '/var/run/mci.pid' + pid = Process.pid + puts_info "PID file: #{pid_path}" + puts_info "PID: #{pid}" File.open pid_path, 'w' do |file| - file.write Process.pid + file.write pid end end
A bit more output around configs
JScott_robot_sweatshop
train
rb
315ba325b97b57b43468d415a3f12c4074f06a3c
diff --git a/packages/react-ui-components/.storybook/webpack.config.js b/packages/react-ui-components/.storybook/webpack.config.js index <HASH>..<HASH> 100644 --- a/packages/react-ui-components/.storybook/webpack.config.js +++ b/packages/react-ui-components/.storybook/webpack.config.js @@ -5,14 +5,21 @@ const brandVars = brand.generateCssVarsObject(brand.config, 'brand'); module.exports = { module: { loaders: [ + // + // The CSS modules compliant loader. + // { test: /\.css$/, loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader', include: [ - path.resolve(__dirname, '../src/'), - path.resolve(__dirname, '../node_modules/font-awesome/') + path.resolve(__dirname, '../src/') ] }, + + // + // If you want to use the <Icon/> component, this loader is + // required since the FA source will be included. + // { test: /\.(woff|woff2)$/, loader: 'url?limit=100000' @@ -20,6 +27,9 @@ module.exports = { ] }, + // + // Note these plugins if you want to use webpack with to compile your application. + // postcss: [ require('autoprefixer')({ browsers: ['last 2 versions']
BUGFIX: Trigger a new release, add docs to the example webpack setup
neos_neos-ui
train
js
c0fca9227856c4ea49a994ba455a2dfb7c634bd4
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -64,6 +64,7 @@ FileCache.prototype.list = function list(){ }; FileCache.prototype.add = function add(urls){ + if(!urls) urls = []; if(typeof urls === 'string') urls = [urls]; var self = this; urls.forEach(function(url){ @@ -76,6 +77,7 @@ FileCache.prototype.add = function add(urls){ }; FileCache.prototype.remove = function remove(urls,returnPromises){ + if(!urls) urls = []; var promises = []; if(typeof urls === 'string') urls = [urls]; var self = this;
bugfix invalid urls when adding and removing
markmarijnissen_cordova-file-cache
train
js
609eb72d6e38c2cdf9980d1f6a3a0c08970e7adc
diff --git a/squad/api/rest.py b/squad/api/rest.py index <HASH>..<HASH> 100644 --- a/squad/api/rest.py +++ b/squad/api/rest.py @@ -1304,7 +1304,7 @@ class MetricSerializer(DynamicFieldsModelSerializer, serializers.HyperlinkedMode class MetricViewSet(NestedViewSetMixin, ModelViewSet): - queryset = Metric.objects.prefetch_related('suite').all() + queryset = Metric.objects.prefetch_related('suite', 'metadata').all() project_lookup_key = 'build__project__in' serializer_class = MetricSerializer filterset_class = MetricFilter
api: rest: prefetch metadata for metrics endpoint
Linaro_squad
train
py
dc23fc61a3b3c2fe745b6bc48d96bbc8e747d068
diff --git a/comments/app.js b/comments/app.js index <HASH>..<HASH> 100644 --- a/comments/app.js +++ b/comments/app.js @@ -59,11 +59,27 @@ app.configure(function() { // Authentication +// Old version for backwards compat. app.get('/auth/session', function(req, res) { new Request(req).getUser(function(user) { if (user) { res.json({ userName: user.username, + mod: user.moderator + }); + } + else { + res.json(false); + } + }); +}); + +// New version. +app.get('/auth/session_new', function(req, res) { + new Request(req).getUser(function(user) { + if (user) { + res.json({ + userName: user.username, mod: user.moderator, sessionID: req.sessionID }); diff --git a/template/app/controller/Auth.js b/template/app/controller/Auth.js index <HASH>..<HASH> 100644 --- a/template/app/controller/Auth.js +++ b/template/app/controller/Auth.js @@ -74,7 +74,7 @@ Ext.define('Docs.controller.Auth', { */ retrieveSession: function() { Ext.Ajax.request({ - url: Docs.baseUrl + '/session', + url: Docs.baseUrl + '/session_new', params: { sid: this.sid }, method: 'GET', cors: true,
Keep the old version of /session request still working. Add a new version with a different name alongside it. This way we can keep two versions of the API working at the same time, which is needed when first deploying the backend code and then waiting for the frontend code to get moved into live.
senchalabs_jsduck
train
js,js
733895177138b8674897deb6e806de468542b1ce
diff --git a/lib/dm-core/query.rb b/lib/dm-core/query.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/query.rb +++ b/lib/dm-core/query.rb @@ -1042,9 +1042,10 @@ module DataMapper # # @api private def normalize_options(options = OPTIONS) - (options & [ :order, :fields, :links, :unique ]).each do |option| - send("normalize_#{option}") - end + normalize_order if options.include? :order + normalize_fields if options.include? :fields + normalize_links if options.include? :links + normalize_unique if options.include? :unique end # Normalize order elements to Query::Direction instances
Speed up #normalize_options by ~2x [#<I>]
datamapper_dm-core
train
rb
d73430aab34a190b7a8663065f0e0a224ae848fd
diff --git a/resumable.js b/resumable.js index <HASH>..<HASH> 100644 --- a/resumable.js +++ b/resumable.js @@ -698,11 +698,11 @@ var Resumable = function(opts){ appendFilesFromFileList([file]); }; $.removeFile = function(file){ - var files = []; - $h.each($.files, function(f,i){ - if(f!==file) files.push(f); - }); - $.files = files; + for(var i = $.files.length - 1; i >= 0; i--) { + if($.files[i] === file) { + $.files.splice(i, 1); + } + } }; $.getFromUniqueIdentifier = function(uniqueIdentifier){ var ret = false;
Maintain single reference to $.files
23_resumable.js
train
js
edb8e934700235eafea44212f01ba4c216267fa1
diff --git a/lib/hurley/header.rb b/lib/hurley/header.rb index <HASH>..<HASH> 100644 --- a/lib/hurley/header.rb +++ b/lib/hurley/header.rb @@ -4,7 +4,7 @@ module Hurley class Header def initialize(initial = nil) @hash = {} - merge(initial) if initial + update(initial) if initial end extend Forwardable @@ -30,7 +30,7 @@ module Hurley @hash.delete(self.class.canonical(key)) end - def merge(hash) + def update(hash) hash.each do |key, value| self[key] = value end diff --git a/lib/hurley/query.rb b/lib/hurley/query.rb index <HASH>..<HASH> 100644 --- a/lib/hurley/query.rb +++ b/lib/hurley/query.rb @@ -27,8 +27,9 @@ module Hurley parser.call(raw_query) end - def initialize + def initialize(initial = nil) @hash = {} + update(initial) if initial end extend Forwardable @@ -48,7 +49,7 @@ module Hurley end end - def merge(absolute) + def update(absolute) absolute.each do |key, value| @hash[key] = value unless key?(key) end
use #update instead of #merge since it modifies self
lostisland_hurley
train
rb,rb
6ae6f5f9a099ee1d752f8c4987d8c54c6ab59225
diff --git a/sprd/view/PrintColorImage.js b/sprd/view/PrintColorImage.js index <HASH>..<HASH> 100644 --- a/sprd/view/PrintColorImage.js +++ b/sprd/view/PrintColorImage.js @@ -23,7 +23,6 @@ define(["xaml!sprd/view/Image", "sprd/data/ImageService", "sprd/model/PrintType" if (printColor) { if (!this._isImagePrintColor()) { backgroundColor = printColor.toHexString(); - this.set('loaded', true); } } else { this.set('loaded', true); @@ -69,6 +68,8 @@ define(["xaml!sprd/view/Image", "sprd/data/ImageService", "sprd/model/PrintType" width: this.$.width, height: this.$.height }); + } else { + return imageService.emptyImage(); } }
load empty image if print color can be styled without image request
spreadshirt_rAppid.js-sprd
train
js
0aaa75a1fd104defbccbd4b54a028db743f8286e
diff --git a/src/Query.php b/src/Query.php index <HASH>..<HASH> 100644 --- a/src/Query.php +++ b/src/Query.php @@ -1053,7 +1053,7 @@ final class Query return $this->add('order', join(', ', $fields) . $nulls); } - return $this->add('order', $this->prepareField($field) . $collate . $nulls); + return $this->add('order', $this->prepareFields($field) . $collate . $nulls); } /**
Query: fix orderBy() [multi-field issue].
froq_froq-database
train
php
30168c5947ceb03fe0f4fcbef0fedab6f92f52ec
diff --git a/src/scs_core/aqcsv/connector/mapping_task.py b/src/scs_core/aqcsv/connector/mapping_task.py index <HASH>..<HASH> 100644 --- a/src/scs_core/aqcsv/connector/mapping_task.py +++ b/src/scs_core/aqcsv/connector/mapping_task.py @@ -14,6 +14,8 @@ from ast import literal_eval from collections import OrderedDict +from scs_core.aqcsv.connector.datum_mapping import DatumMapping + from scs_core.data.json import JSONable, PersistentJSONable from scs_core.data.localized_datetime import LocalizedDatetime @@ -204,6 +206,12 @@ class MappingTask(JSONable): # ---------------------------------------------------------------------------------------------------------------- + def mappings(self): + return [DatumMapping(self.topic, species, self.site_code) for species in self.parameters] + + + # ---------------------------------------------------------------------------------------------------------------- + @property def pk(self): return self.org, self.group, self.loc, self.topic
Added mappings(..) method to MappingTask.
south-coast-science_scs_core
train
py
6c446205090966f6838cdd1576e677aadf64411f
diff --git a/packages/ember-views/lib/views/view.js b/packages/ember-views/lib/views/view.js index <HASH>..<HASH> 100644 --- a/packages/ember-views/lib/views/view.js +++ b/packages/ember-views/lib/views/view.js @@ -127,7 +127,7 @@ Ember.CoreView = Ember.Object.extend(Ember.Evented, { // insert a new buffer after the "parent buffer"). var tagName = this.tagName; - if (tagName === null || tagName === undefined) { + if (Ember.isNone(tagName)) { tagName = 'div'; }
Use isNone to check tag name
emberjs_ember.js
train
js
2c1ab9be3ca2a3196e7f6db3caa37efac0c59d0e
diff --git a/quart/flask_patch/_patch.py b/quart/flask_patch/_patch.py index <HASH>..<HASH> 100644 --- a/quart/flask_patch/_patch.py +++ b/quart/flask_patch/_patch.py @@ -17,6 +17,15 @@ def _patch_asyncio() -> None: asyncio.Task = asyncio.tasks._CTask = asyncio.tasks.Task = asyncio.tasks._PyTask # type: ignore asyncio.Future = asyncio.futures._CFuture = asyncio.futures.Future = asyncio.futures._PyFuture # type: ignore # noqa + current_policy = asyncio.get_event_loop_policy() + if hasattr(asyncio, 'unix_events'): + target_policy = asyncio.unix_events._UnixDefaultEventLoopPolicy # type: ignore + else: + target_policy = object() + + if not isinstance(current_policy, target_policy): + raise RuntimeError("Flask Patching only works with the default event loop policy") + def _sync_wait(self, future): # type: ignore preserved_ready = list(self._ready) self._ready.clear()
Raise an error if Flask Patching is used with an alternative event loop It only works with the default asyncio event loop policy, and hence not with uvloop or others. This now errors making it clearer to users.
pgjones_quart
train
py
d066f8b726221bcaec18a8847582b54749d0e48e
diff --git a/caravel/assets/javascripts/reduxUtils.js b/caravel/assets/javascripts/reduxUtils.js index <HASH>..<HASH> 100644 --- a/caravel/assets/javascripts/reduxUtils.js +++ b/caravel/assets/javascripts/reduxUtils.js @@ -67,9 +67,15 @@ export function addToArr(state, arrKey, obj) { export function enhancer() { let enhancerWithPersistState = compose(persistState()); if (process.env.NODE_ENV === 'dev') { - enhancerWithPersistState = compose( - persistState(), window.devToolsExtension && window.devToolsExtension() - ); + if (window.devToolsExtension) { + enhancerWithPersistState = compose( + persistState(), window.devToolsExtension && window.devToolsExtension() + ); + } else { + console.warn('You may encounter errors unless' + + 'you have Redux Devtool Extension installed: ' + + 'http://github.com/zalmoxisus/redux-devtools-extension'); + } } return enhancerWithPersistState; }
Added alert to install redux devtool (#<I>) * Added alert to install redux devtool * Change to warning
apache_incubator-superset
train
js
2efc9531debaddeec0fb7d605d627367102b5c68
diff --git a/src/Illuminate/Notifications/ChannelManager.php b/src/Illuminate/Notifications/ChannelManager.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Notifications/ChannelManager.php +++ b/src/Illuminate/Notifications/ChannelManager.php @@ -2,19 +2,14 @@ namespace Illuminate\Notifications; -use Ramsey\Uuid\Uuid; use Illuminate\Mail\Markdown; use InvalidArgumentException; use Illuminate\Support\Manager; use Nexmo\Client as NexmoClient; -use Illuminate\Support\Collection; use GuzzleHttp\Client as HttpClient; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Bus\Dispatcher as Bus; use Nexmo\Client\Credentials\Basic as NexmoCredentials; -use Illuminate\Database\Eloquent\Collection as ModelCollection; use Illuminate\Contracts\Notifications\Factory as FactoryContract; use Illuminate\Contracts\Notifications\Dispatcher as DispatcherContract;
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
fd651083f2521d0ba3af9dbf50862ed5a9f19f63
diff --git a/searx/webapp.py b/searx/webapp.py index <HASH>..<HASH> 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -17,6 +17,11 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >. (C) 2013- by Adam Tauber, <[email protected]> ''' +if __name__ == '__main__': + from sys import path + from os.path import realpath, dirname + path.append(realpath(dirname(realpath(__file__))+'/../')) + import json import cStringIO import os
[fix] PYTHONPATH settings
asciimoo_searx
train
py
60d981b14c002c79c99da4cecd9b515306062408
diff --git a/src/Plinth/Validation/Validator.php b/src/Plinth/Validation/Validator.php index <HASH>..<HASH> 100644 --- a/src/Plinth/Validation/Validator.php +++ b/src/Plinth/Validation/Validator.php @@ -428,7 +428,7 @@ class Validator extends Connector */ private function checkValue(&$value, ValidationProperty &$validationProperty) { - if ($this->isValueInvalid($value, $validationProperty)) return $value = false; //Variable is invalid + if ($this->isValueInvalid($value, $validationProperty)) return false; //Variable is invalid if ($validationProperty->isRequired()) { if ($value === NULL || $value === "") return $value = false; //Variable is required @@ -453,7 +453,7 @@ class Validator extends Connector $validmultiple = true; foreach ($array as $i => &$value) { - if ($this->isValueInvalid($value, $validationProperty)) return $value = false; //If a variable in the array is invalid always return fals + if ($this->isValueInvalid($value, $validationProperty)) return false; //If a variable in the array is invalid always return fals if ($value !== NULL && $value !== "") { if ($this->validateRules($value, $validationProperty)) $counter++; else $validmultiple = false;
No need to set the value to false as it's already false or null in case of an invalid boolean
Warsaalk_Plinth
train
php
f0a061342e603a7064e5035d7447fe7d996020ab
diff --git a/src/Service/SelfUpdater.php b/src/Service/SelfUpdater.php index <HASH>..<HASH> 100644 --- a/src/Service/SelfUpdater.php +++ b/src/Service/SelfUpdater.php @@ -100,6 +100,7 @@ class SelfUpdater $this->stdErr->writeln(" composer global remove " . $this->config->get('application.package_name')); $this->stdErr->writeln(" curl -sS " . $this->config->get('application.installer_url') . " | php\n"); } + return false; } @@ -109,7 +110,13 @@ class SelfUpdater $currentVersion )); - $updater = new Updater(null, false); + if (!is_writable($localPhar)) { + $this->stdErr->writeln('Cannot update as the Phar file is not writable: ' . $localPhar); + + return false; + } + + $updater = new Updater($localPhar, false); $strategy = new ManifestStrategy($currentVersion, $manifestUrl, $this->allowMajor, $this->allowUnstable); $strategy->setManifestTimeout($this->timeout); $updater->setStrategyObject($strategy);
Skip updates check if the Phar file is not writable
platformsh_platformsh-cli
train
php
590330d26221d83f4385dbac8d5428f77671ea8b
diff --git a/pyvista/examples/downloads.py b/pyvista/examples/downloads.py index <HASH>..<HASH> 100644 --- a/pyvista/examples/downloads.py +++ b/pyvista/examples/downloads.py @@ -259,7 +259,7 @@ def _retrieve_zip(retriever, filename): def _download_file(filename, progress_bar=False): - """Download a file from https://github.com/pyvista/vtk-data/master/Data. + """Download a file from https://github.com/pyvista/vtk-data/tree/master/Data. If ``pyvista.VTK_DATA_PATH`` is set, then the remote repository is expected to be a local git repository. @@ -267,7 +267,7 @@ def _download_file(filename, progress_bar=False): Parameters ---------- filename : str - Path within https://github.com/pyvista/vtk-data/master/Data to download + Path within https://github.com/pyvista/vtk-data/tree/master/Data to download the file from. progress_bar : bool, default: False
Correct vtk-data url in _download_file docstring (#<I>)
vtkiorg_vtki
train
py
97cf9b8366444b68409224c79bace322ec84f8b4
diff --git a/Form/Type/EasyAdminFormType.php b/Form/Type/EasyAdminFormType.php index <HASH>..<HASH> 100644 --- a/Form/Type/EasyAdminFormType.php +++ b/Form/Type/EasyAdminFormType.php @@ -162,7 +162,7 @@ class EasyAdminFormType extends AbstractType */ public function getName() { - return 'JavierEguiluz\Bundle\EasyAdminBundle\Form\Type\EasyAdminFormType'; + return $this->isLegacySymfonyForm() ? 'easyadmin' : 'JavierEguiluz\\Bundle\\EasyAdminBundle\\Form\\Type\\EasyAdminFormType'; } private function isLegacySymfonyForm()
Let's see if it works
EasyCorp_EasyAdminBundle
train
php
fba648450b8e31b94d4e9db029cef5d6de89c00f
diff --git a/dwave/cloud/exceptions.py b/dwave/cloud/exceptions.py index <HASH>..<HASH> 100644 --- a/dwave/cloud/exceptions.py +++ b/dwave/cloud/exceptions.py @@ -1,8 +1,12 @@ -class SolverFailureError(Exception): +class SolverError(Exception): + """Generic base class for all solver-related errors.""" + + +class SolverFailureError(SolverError): """An exception raised when there is a remote failure calling a solver.""" -class SolverAuthenticationError(Exception): +class SolverAuthenticationError(SolverError): """An exception raised when there is an authentication error.""" def __init__(self): @@ -20,5 +24,5 @@ class InvalidAPIResponseError(Exception): """Raised when an invalid/unexpected response from D-Wave Solver API is received.""" -class UnsupportedSolverError(Exception): +class UnsupportedSolverError(SolverError): """The solver we received from the API is not supported by the client."""
Make all solver-related errors inherit from same base
dwavesystems_dwave-cloud-client
train
py
a999c4b166923f7e315432b8bdbc573803bef924
diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js index <HASH>..<HASH> 100644 --- a/src/language/CSSUtils.js +++ b/src/language/CSSUtils.js @@ -1069,7 +1069,7 @@ define(function (require, exports, module) { } } else if (/@(charset|import|namespace|include|extend)/i.test(token) || - !/\{/.test(token)) { + !/\{/.test(stream.string)) { // This code handles @rules in this format: // @rule ... ;
Should check { on stream.string and not on token.
adobe_brackets
train
js
d625df32b1a7305f6f524965813f82318bc4260b
diff --git a/tests/test_collaboration.py b/tests/test_collaboration.py index <HASH>..<HASH> 100644 --- a/tests/test_collaboration.py +++ b/tests/test_collaboration.py @@ -45,6 +45,9 @@ class TestCollaboration(unittest.TestCase): collaborator_list = self.collaboration.get_collaborators() self.assertIsInstance(collaborator_list, PaginatedList) + self.assertIsInstance(collaborator_list[0], Collaborator) + self.assertEqual(collaborator_list[0].id, 12345) + self.assertEqual(collaborator_list[0].name, "Don Draper") @requests_mock.Mocker()
added more tests for get collaborators.
ucfopen_canvasapi
train
py
8f363c0e54661f5ea4fdd0dfca5e906b23db5667
diff --git a/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php b/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php +++ b/src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php @@ -5,8 +5,8 @@ namespace Illuminate\Database\Eloquent\Concerns; use Closure; use Illuminate\Support\Arr; use Illuminate\Support\Str; -use Illuminate\Database\Query\Expression; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Query\Expression; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder;
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
e977290c8dca1dba0b496136e4fa2a67258ddcda
diff --git a/docs/changelog.rst b/docs/changelog.rst index <HASH>..<HASH> 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,10 @@ Changelog ========= +Changes in v0.2.6 +================= +- Removed the ``HotQueue.__repr__`` method as it is no longer supported + Changes in v0.2.5 ================= - Fixed a bug in v0.2.4 that prevented install in some environments diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,9 +45,9 @@ copyright = u'2010, Richard Henry' # built documents. # # The short X.Y version. -version = '0.2.5' +version = '0.2.6' # The full version, including alpha/beta/rc tags. -release = '0.2.5' +release = '0.2.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/hotqueue.py b/hotqueue.py index <HASH>..<HASH> 100644 --- a/hotqueue.py +++ b/hotqueue.py @@ -15,7 +15,7 @@ from redis import Redis __all__ = ['HotQueue'] -__version__ = '0.2.5' +__version__ = '0.2.6' def key_for_name(name):
Bumping version to <I>
richardhenry_hotqueue
train
rst,py,py
f338f29781d216279d9816bc1974a6ecf8e8cf55
diff --git a/js-git.js b/js-git.js index <HASH>..<HASH> 100644 --- a/js-git.js +++ b/js-git.js @@ -308,7 +308,7 @@ function newRepo(db, workDir) { } function checkBranch(err, hash) { - if (err) return callback(err); + if (err && err.code !== "ENOENT") return callback(err); if (hash) { return resolveHashish(hash, callback); } @@ -316,7 +316,7 @@ function newRepo(db, workDir) { } function checkTag(err, hash) { - if (err) return callback(err); + if (err && err.code !== "ENOENT") return callback(err); if (hash) { return resolveHashish(hash, callback); }
Fix hashish resolving
creationix_js-git
train
js
77de171d46454364f1368ba50101d7fdfa1f0268
diff --git a/perfidix/src/test/java/org/perfidix/socketadapter/SocketViewStubTest.java b/perfidix/src/test/java/org/perfidix/socketadapter/SocketViewStubTest.java index <HASH>..<HASH> 100644 --- a/perfidix/src/test/java/org/perfidix/socketadapter/SocketViewStubTest.java +++ b/perfidix/src/test/java/org/perfidix/socketadapter/SocketViewStubTest.java @@ -239,6 +239,7 @@ public class SocketViewStubTest { * @see java.lang.Thread#run() */ @Override + @SuppressWarnings("unchecked") public void run() { try {
added @SuppressedWarningstag to SocketViewStubTest
sebastiangraf_perfidix
train
java
2dee4c4172e88abef552b4f36c969c834cf1b3c1
diff --git a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java index <HASH>..<HASH> 100644 --- a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java +++ b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java @@ -14,5 +14,6 @@ public interface ICameraObject extends ICamera { ISize setPreviewSize(int width, int height); void setDisplayOrientation(int rotate); void doTakePicture(Activity previewActivity, int rotation); + void setFocus(Activity mPreview); }
Camera fix EMBPD<I>,<I>,<I> Added logic to handle camera preview going black on rotation by setting focus in preview only and release Camera Object [mayank fkgm<I>] Added the logic to save the image with filename at the user provided folder
rhomobile_rhodes
train
java
41d4c5e0b684952d4ae1ac0a9ae4a470c485cf9e
diff --git a/src/main/java/com/aoindustries/encoding/Coercion.java b/src/main/java/com/aoindustries/encoding/Coercion.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/aoindustries/encoding/Coercion.java +++ b/src/main/java/com/aoindustries/encoding/Coercion.java @@ -327,7 +327,6 @@ public final class Coercion { value instanceof Writable && !((Writable)value).isFastToString() ) - // TODO: Short-cut other types? (CharSequence, Node, ...?) ) { if(encoderPrefixSuffix) encoder.writePrefixTo(out); write(value, encoder, out);
Will not short-cut other types.
aoindustries_ao-encoding
train
java
5ba0bbd042e33a437b87e5ca37b489a28f3ac023
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java index <HASH>..<HASH> 100644 --- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java +++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java @@ -3788,7 +3788,7 @@ public class Sql { public int[] withBatch(int batchSize, String sql, Closure closure) throws SQLException { Connection connection = createConnection(); List<Tuple> indexPropList = null; - SqlWithParams preCheck = preCheckForNamedParams(sql); + SqlWithParams preCheck = buildSqlWithIndexedProps(sql); boolean savedWithinBatch = withinBatch; BatchingPreparedStatementWrapper psWrapper = null; if (preCheck != null) { @@ -4361,7 +4361,7 @@ public class Sql { } public SqlWithParams checkForNamedParams(String sql, List<Object> params) { - SqlWithParams preCheck = preCheckForNamedParams(sql); + SqlWithParams preCheck = buildSqlWithIndexedProps(sql); if (preCheck == null) { return new SqlWithParams(sql, params); }
avoid use of deprecated code
apache_groovy
train
java
7352bfc39070882df7956d4a112058e29f3b5f4f
diff --git a/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScannerTransformer.java b/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScannerTransformer.java index <HASH>..<HASH> 100644 --- a/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScannerTransformer.java +++ b/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScannerTransformer.java @@ -16,6 +16,8 @@ package com.google.errorprone.scanner; +import static java.util.Objects.requireNonNull; + import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableClassToInstanceMap; import com.google.errorprone.CodeTransformer; @@ -48,7 +50,7 @@ public abstract class ErrorProneScannerTransformer implements CodeTransformer { /** Create a VisitorState object from a compilation unit. */ private VisitorState createVisitorState(Context context, DescriptionListener listener) { - return new VisitorState( - context, listener, scanner().severityMap(), context.get(ErrorProneOptions.class)); + ErrorProneOptions options = requireNonNull(context.get(ErrorProneOptions.class)); + return new VisitorState(context, listener, scanner().severityMap(), options); } }
Add a defensive null-check RELNOTES: N/A ------------- Created by MOE: <URL>
google_error-prone
train
java
6d7453a0d985eec35d733cc4d097d85ad1f734eb
diff --git a/lib/cisco_spark/model.rb b/lib/cisco_spark/model.rb index <HASH>..<HASH> 100644 --- a/lib/cisco_spark/model.rb +++ b/lib/cisco_spark/model.rb @@ -51,10 +51,13 @@ module CiscoSpark end def parse_collection(collection) + collection = JSON.parse(collection) if collection.is_a?(String) + collection = collection.fetch('items', []) if collection.is_a?(Hash) collection.map{ |hash| parse(hash) } end def parse(hash) + hash = JSON.parse(hash) if hash.is_a?(String) params = attributes.each_with_object({}) do |(attribute, caster), params| params[attribute] = caster.call(hash[Utils.camelize(attribute)]) end
Make parse and parse to collection to handle JSON strings
NGMarmaduke_cisco_spark-ruby
train
rb
ed7242f0dc06f3e462555f2cf95ee2d176d8c786
diff --git a/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java b/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java +++ b/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java @@ -661,6 +661,11 @@ public class StandardBullhornData implements BullhornData { * @return */ private <L extends ListWrapper<T>, T extends BullhornEntity> L handleGetMultipleEntities(Class<T> type, Set<Integer> idList, Set<String> fieldSet, EntityParams params) { + if (idList.size() == 1){ + List<T> list = new ArrayList<T>(); + list.add(this.handleGetEntity(type, idList.iterator().next(), fieldSet, ParamFactory.entityParams())); + return (L) new StandardListWrapper<T>(list); + } String ids = idList.stream().map(id -> String.valueOf(id)).collect(Collectors.joining(",")); Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForGetMultiple(BullhornEntityInfo.getTypesRestEntityName(type), ids, fieldSet, params); String url = restUrlFactory.assembleEntityUrl(params);
fix for findMultipleEntities call when one id is passed in
bullhorn_sdk-rest
train
java
4385822c6564de0dc4371faaaf9c99edb54db47c
diff --git a/cglib/src/main/java/net/sf/cglib/beans/BulkBeanEmitter.java b/cglib/src/main/java/net/sf/cglib/beans/BulkBeanEmitter.java index <HASH>..<HASH> 100644 --- a/cglib/src/main/java/net/sf/cglib/beans/BulkBeanEmitter.java +++ b/cglib/src/main/java/net/sf/cglib/beans/BulkBeanEmitter.java @@ -56,7 +56,7 @@ class BulkBeanEmitter extends ClassEmitter { private void generateGet(final Class target, final Method[] getters) { CodeEmitter e = begin_method(Constants.ACC_PUBLIC, GET_PROPERTY_VALUES, null); - if (getters.length >= 0) { + if (getters.length > 0) { e.load_arg(0); e.checkcast(Type.getType(target)); Local bean = e.make_local();
Fix a no-op comparison Array lengths are always >= 0, this code was trying to test if the array was non-empty. The mistake was detected by <URL>
cglib_cglib
train
java
42aa6615b23234a3b2b4716c827362b4f5057986
diff --git a/lib/capybara/spec/session/all_spec.rb b/lib/capybara/spec/session/all_spec.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/spec/session/all_spec.rb +++ b/lib/capybara/spec/session/all_spec.rb @@ -22,10 +22,14 @@ shared_examples_for "all" do end context "with css selectors" do - it "should find the first element using the given locator" do + it "should find all elements using the given selector" do @session.all(:css, 'h1').first.text.should == 'This is a test' @session.all(:css, "input[id='test_field']").first[:value].should == 'monkey' end + + it "should find all elements when given a list of selectors" do + @session.all(:css, 'h1, p').should have(4).elements + end end context "with xpath selectors" do diff --git a/lib/capybara/xpath.rb b/lib/capybara/xpath.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/xpath.rb +++ b/lib/capybara/xpath.rb @@ -56,7 +56,7 @@ module Capybara end def from_css(css) - append(Nokogiri::CSS.xpath_for(css).first) + XPath.new(*[@paths, Nokogiri::CSS.xpath_for(css)].flatten) end alias_method :for_css, :from_css
Allow comma separated CSS selectors in searches
teamcapybara_capybara
train
rb,rb
96e14610d3c862660628aa37aa0d8e1e829e5455
diff --git a/lib/easy_app_helper/core/places.rb b/lib/easy_app_helper/core/places.rb index <HASH>..<HASH> 100644 --- a/lib/easy_app_helper/core/places.rb +++ b/lib/easy_app_helper/core/places.rb @@ -40,8 +40,9 @@ class EasyAppHelper::Core::Config::Places } end - CONF ={ - mingw32: Windows + CONF = { + mingw32: Windows, + linux: Unix } DEFAULT = Unix
Added proper linux detection. Default remains Unix (should be ok for some other unices)
lbriais_easy_app_helper
train
rb
160af2ef0633c5ed6171dcb999f75c1c5e6af03c
diff --git a/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php b/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php index <HASH>..<HASH> 100644 --- a/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php +++ b/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php @@ -123,6 +123,8 @@ class SpeedTrapListener implements \PHPUnit_Framework_TestListener */ public function endTest(\PHPUnit_Framework_Test $test, $time) { + if (!$test instanceof \PHPUnit_Framework_TestCase) return; + $time = $this->toMilliseconds($time); $threshold = $this->getSlowThreshold($test);
Allow Exceptions thrown during setup/teardown to pass through Fixes #<I>
johnkary_phpunit-speedtrap
train
php
5eae41f85ddef994987bb0645f98f442afff7350
diff --git a/frasco/json_decoder.py b/frasco/json_decoder.py index <HASH>..<HASH> 100644 --- a/frasco/json_decoder.py +++ b/frasco/json_decoder.py @@ -1,5 +1,6 @@ from flask import json import speaklater +import datetime class JSONEncoder(json.JSONEncoder): @@ -14,4 +15,6 @@ class JSONEncoder(json.JSONEncoder): return o.value if isinstance(o, set): return list(o) + if isinstance(o, datetime.time): + return str(o) return json.JSONEncoder.default(self, o)
Added support for encoding datetime.time in JSONEncoder
frascoweb_frasco
train
py
85d6695609eb17a289b56ea4a40d28dd5ae70704
diff --git a/pdf.php b/pdf.php index <HASH>..<HASH> 100644 --- a/pdf.php +++ b/pdf.php @@ -83,6 +83,9 @@ define("IS_AJAX", true); exit; }*/ +$hr = new htmlResponse(true, true); +$hr->setCache(true); + $args = array(); for($i = 1; $i < count($items); $i++) $args[] = $items[$i]; @@ -131,8 +134,6 @@ if( $ret != null && $ret != false ) { $ret = $name; } -$hr = new htmlResponse(true, true); - if( $ret === null ) { $hr->set("<html><head><title>PDF Page</title></head><body><h1>PDF Not Found</h1><h2>Error Message:</h2><p>".$cls->getMessage()."</p></body></html>");
pdf.php: Enable caching to work around an issue in IE
SkUrRiEr_pdflib
train
php
df725cace6f8f23834faf49f658b83f71c80564f
diff --git a/extensions/tags/src/LoadForumTagsRelationship.php b/extensions/tags/src/LoadForumTagsRelationship.php index <HASH>..<HASH> 100755 --- a/extensions/tags/src/LoadForumTagsRelationship.php +++ b/extensions/tags/src/LoadForumTagsRelationship.php @@ -42,6 +42,7 @@ class LoadForumTagsRelationship ->limit(4) // We get one more than we need so the "more" link can be shown. ) ->whereVisibleTo($actor) + ->withStateFor($actor) ->get(); } } diff --git a/extensions/tags/src/Tag.php b/extensions/tags/src/Tag.php index <HASH>..<HASH> 100644 --- a/extensions/tags/src/Tag.php +++ b/extensions/tags/src/Tag.php @@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Builder; * @property int $last_posted_discussion_id * @property int $last_posted_user_id * @property string $icon + * @property TagState */ class Tag extends AbstractModel {
perf: Eager load actor tag states (#<I>)
flarum_core
train
php,php
f8be3f9e95e33664863636f1607ff5614a5877d5
diff --git a/src/python/pants/backend/jvm/ivy_utils.py b/src/python/pants/backend/jvm/ivy_utils.py index <HASH>..<HASH> 100644 --- a/src/python/pants/backend/jvm/ivy_utils.py +++ b/src/python/pants/backend/jvm/ivy_utils.py @@ -383,8 +383,11 @@ class IvyUtils(object): ivy_args.extend(self._args) def safe_link(src, dest): - if os.path.islink(dest): + try: os.unlink(dest) + except OSError as e: + if e.errno != errno.ENOENT: + raise os.symlink(src, dest) with IvyUtils.ivy_lock:
Better way to avoid unlinking a non-existent file. This solves a race condition too (although there is still another race), and is more consistent with similar patterns elsewhere in the file. Testing Done: Relevant integration tests pass (after cleaning, so this triggers both a failed unlink and a successful one). Manually tested the relevant code block. Reviewed at <URL>
pantsbuild_pants
train
py
55ac30235afa25fb0f19b3bde62b948a055eacfa
diff --git a/lib/testers/rule-tester.js b/lib/testers/rule-tester.js index <HASH>..<HASH> 100644 --- a/lib/testers/rule-tester.js +++ b/lib/testers/rule-tester.js @@ -147,6 +147,12 @@ function RuleTester(testerConfig) { lodash.cloneDeep(defaultConfig), testerConfig ); + + /** + * Rule definitions to define before tests. + * @type {Object} + */ + this.rules = {}; } /** @@ -239,7 +245,7 @@ RuleTester.prototype = { * @returns {void} */ defineRule(name, rule) { - eslint.defineRule(name, rule); + this.rules[name] = rule; }, /** @@ -508,6 +514,7 @@ RuleTester.prototype = { RuleTester.describe("valid", () => { test.valid.forEach(valid => { RuleTester.it(valid.code || valid, () => { + eslint.defineRules(this.rules); testValidTemplate(ruleName, valid); }); }); @@ -516,6 +523,7 @@ RuleTester.prototype = { RuleTester.describe("invalid", () => { test.invalid.forEach(invalid => { RuleTester.it(invalid.code, () => { + eslint.defineRules(this.rules); testInvalidTemplate(ruleName, invalid); }); });
Chore: fix the timing to define rules for tests (#<I>)
eslint_eslint
train
js
d491730e92319f1d7d9e4899a7b39e61ae1407b2
diff --git a/src/Bitpay/PrivateKey.php b/src/Bitpay/PrivateKey.php index <HASH>..<HASH> 100644 --- a/src/Bitpay/PrivateKey.php +++ b/src/Bitpay/PrivateKey.php @@ -436,7 +436,7 @@ class PrivateKey extends Key $byte = $byte.$digits[$rem]; } - $byte = $beg_ec_text . "\r\n" . chunk_splt(base64_encode(strrev($byte)), 64) . $end_ec_text; + $byte = $beg_ec_text . "\r\n" . chunk_split(base64_encode(strrev($byte)), 64) . $end_ec_text; $this->pemEncoded = $byte;
Fixed misspelled function name. If I could learn how to type that'd be great...
bitpay_php-bitpay-client
train
php
203312e8bb39ba15f97c92703a7a49b3991e070f
diff --git a/docker/internal/tarfile/src.go b/docker/internal/tarfile/src.go index <HASH>..<HASH> 100644 --- a/docker/internal/tarfile/src.go +++ b/docker/internal/tarfile/src.go @@ -107,9 +107,9 @@ func (s *Source) Close() error { return nil } -// LoadTarManifest loads and decodes the manifest.json -func (s *Source) LoadTarManifest() ([]ManifestItem, error) { - return s.archive.Manifest, nil +// TarManifest returns contents of manifest.json +func (s *Source) TarManifest() []ManifestItem { + return s.archive.Manifest } func (s *Source) prepareLayerData(tarManifest *ManifestItem, parsedConfig *manifest.Schema2Image) (map[digest.Digest]*layerInfo, error) { diff --git a/docker/tarfile/src.go b/docker/tarfile/src.go index <HASH>..<HASH> 100644 --- a/docker/tarfile/src.go +++ b/docker/tarfile/src.go @@ -60,7 +60,7 @@ func (s *Source) Close() error { // LoadTarManifest loads and decodes the manifest.json func (s *Source) LoadTarManifest() ([]ManifestItem, error) { - return s.internal.LoadTarManifest() + return s.internal.TarManifest(), nil } // GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available).
Turn tarfile.Source.LoadTarManifest into a TarManifest We can drop the unused error return value now.
containers_image
train
go,go
db45a210fd32673f11b82a67498c20e4b0ae0d75
diff --git a/lib/concerns/models/user.rb b/lib/concerns/models/user.rb index <HASH>..<HASH> 100644 --- a/lib/concerns/models/user.rb +++ b/lib/concerns/models/user.rb @@ -1,18 +1,20 @@ -module Wobauth::Concerns::Models::User - extend ActiveSupport::Concern +module Wobauth + module Concerns + module Models::User + extend ActiveSupport::Concern - included do - has_many :authorities, as: :authorizable, dependent: :destroy - has_many :roles, through: :authorities - has_many :memberships, dependent: :destroy - has_many :group_roles, through: :groups, source: :roles - has_many :groups, -> { uniq }, through: :memberships - end + included do + has_many :authorities, as: :authorizable, dependent: :destroy + has_many :roles, through: :authorities + has_many :memberships, dependent: :destroy + has_many :group_roles, through: :groups, source: :roles + has_many :groups, -> { uniq }, through: :memberships + end - def to_s - email - end + def to_s + email + end - module ClassMethods + end end end
rebuild namespace, don't work otherwise
swobspace_wobauth
train
rb
17ae1e068cdeafa7c0c3851ca6c6b07bd1e894a2
diff --git a/code/libraries/koowa/components/com_koowa/template/abstract.php b/code/libraries/koowa/components/com_koowa/template/abstract.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/components/com_koowa/template/abstract.php +++ b/code/libraries/koowa/components/com_koowa/template/abstract.php @@ -109,7 +109,7 @@ abstract class ComKoowaTemplateAbstract extends KTemplateAbstract { $result = parent::compile(); - if(isset($this->_cache)) + if(isset($this->_cache) && $this->getPath()) { $identifier = md5($this->getPath());
test #<I>: Make sure there is a path before running md5 on it to avoid cache identifier collisions
joomlatools_joomlatools-framework
train
php
232ca0275e9fb82fe7bb25b03fc2402e8c1ee815
diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index <HASH>..<HASH> 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -343,10 +343,6 @@ class NodeLanguage: # 'node_protobuf_async_streaming_ping_pong', rpc_type='STREAMING', # client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER') - - # 50 | 90 | 95 | 99 | 99.9 - # 323834.797877769 | 432510.52549709007 | 458703.85481928807 | 507691.6539182514 | 3826148.8700816636 - # 272716.21113941644 | 307298.29139655043 | 329730.74530904385 | 413965.4319992619 | 2518204.1519497186 yield _ping_pong_scenario( 'node_protobuf_unary_ping_pong', rpc_type='UNARY', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
Removed unnecessary notes from scenario_config.py
grpc_grpc
train
py
8148b632915592000e13a385298f2330e2cb2bf8
diff --git a/pkg/datapath/linux/node.go b/pkg/datapath/linux/node.go index <HASH>..<HASH> 100644 --- a/pkg/datapath/linux/node.go +++ b/pkg/datapath/linux/node.go @@ -1449,7 +1449,7 @@ func (n *linuxNodeHandler) NodeConfigurationChanged(newConfig datapath.LocalNode prevConfig := n.nodeConfig n.nodeConfig = newConfig - if n.nodeConfig.EnableIPv4 { + if n.nodeConfig.EnableIPv4 || n.nodeConfig.EnableIPv6 { ifaceName := "" switch { case !option.Config.EnableL2NeighDiscovery:
neigh: Enable neighbor discovery on NodeConfigurationChanged Expand to also support IPv6 as otherwise we won't perform L2 neighbor discovery on node updates.
cilium_cilium
train
go
39f99db17d3b5d0520bf84203d4bb0cc42f3a32a
diff --git a/vaex/test/dataset.py b/vaex/test/dataset.py index <HASH>..<HASH> 100644 --- a/vaex/test/dataset.py +++ b/vaex/test/dataset.py @@ -178,6 +178,17 @@ class TestDataset(unittest.TestCase): self.dataset.add_column("x", self.dataset.data.x) self.assertSequenceEqual(columns, self.dataset.get_column_names()) + def test_rename_column(self): + self.dataset.rename_column("x", "xx") + self.assertNotIn("x", self.dataset.columns) + self.assertNotIn("x", self.dataset.column_names) + self.assertNotIn("x", self.dataset.units) + self.assertNotIn("x", self.dataset.ucds) + self.assertIn("xx", self.dataset.columns) + self.assertIn("xx", self.dataset.column_names) + self.assertIn("xx", self.dataset.units) + self.assertIn("xx", self.dataset.ucds) + def test_csv(self): separator = "," fn = tempfile.mktemp(".csv")
test rename_column
vaexio_vaex
train
py
b2694ed1068270e78f37f3190dd952e685b2f149
diff --git a/dynect/records.go b/dynect/records.go index <HASH>..<HASH> 100644 --- a/dynect/records.go +++ b/dynect/records.go @@ -166,27 +166,3 @@ type DataBlock struct { // SRV Weight string `json:"weight,omitempty" bson:"weight,omitempty"` } - -/* -Represents an A record. -*/ -type ARecord struct { - BaseRecord - RData ARDataBlock `json:"rdata"` -} - -/* -Represents an AAAA record. - -It uses the ADataBlock struct for is nested record data, as there is zero -difference in the structure between an A record and an AAAA record; the -only difference is in the value of the data, itself. -*/ -type AAAARecord struct { - BaseRecord - RData ARDataBlock `json:"rdata"` -} - -type ARDataBlock struct { - Address string `json:"address"` -}
dynect: Removed useless structs.
nesv_go-dynect
train
go
5d8e7352f7f0a61d68e854601328faf08d7c18d0
diff --git a/socket.go b/socket.go index <HASH>..<HASH> 100644 --- a/socket.go +++ b/socket.go @@ -93,8 +93,9 @@ func (s *Socket) packetReader() { var b [0x1000]byte for { // In C, all the reads are processed and when it threatens to block, - // only then do we call utp_issue_deferred_acks. I don't know how we - // can do this in Go. + // we're supposed to call utp_issue_deferred_acks. I don't know how we + // can do this in Go. An mrecv or non-blocking form of ReadFrom is + // required. n, addr, err := s.pc.ReadFrom(b[:]) if err != nil { mu.Lock()
Improve comment about Go's ReadFrom and utp_issue_deferred_acks
anacrolix_go-libutp
train
go
f33215e0f765bcc20e8440e0a037ef63faac701c
diff --git a/asammdf/mdf_v4.py b/asammdf/mdf_v4.py index <HASH>..<HASH> 100644 --- a/asammdf/mdf_v4.py +++ b/asammdf/mdf_v4.py @@ -1782,14 +1782,14 @@ class MDF4(object): 'unit_addr': unit_addr, } ch = Channel(**kargs) - name = 't' + name = time_name if memory == 'minimum': address = tell() write(bytes(ch)) gp_channels.append(address) else: ch.name = name - ch.unit = 's' + ch.unit = time_unit gp_channels.append(ch) gp_sdata.append(None) @@ -4940,7 +4940,7 @@ class MDF4(object): t += offset metadata = [ 'Time', - v4c.SYNC_TYPE_INDEX, + v4c.SYNC_TYPE_TIME, ] else: time_conv = group['channel_conversions'][time_ch_nr] diff --git a/asammdf/version.py b/asammdf/version.py index <HASH>..<HASH> 100644 --- a/asammdf/version.py +++ b/asammdf/version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- """ asammdf version module """ -__version__ = '3.0.3' +__version__ = '3.0.4dev'
make sure to use master channel name and unit
danielhrisca_asammdf
train
py,py
c63e08b62dc7522682d3ff97c03d8afdd9d7b7b0
diff --git a/src/config/config.js b/src/config/config.js index <HASH>..<HASH> 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -29,7 +29,7 @@ export let config = { buttonSizes: ['tiny', 'small', 'medium'], throttles: { - v4_mobile_device: 100 + v4_mobile_device: 1000 }, customCountry: false,
Ramp v3 mobile to <I>%
paypal_paypal-checkout-components
train
js
b91d199a5866a3f9500a7260082be700eea2d95e
diff --git a/cassandra/cqlengine/query.py b/cassandra/cqlengine/query.py index <HASH>..<HASH> 100644 --- a/cassandra/cqlengine/query.py +++ b/cassandra/cqlengine/query.py @@ -1178,7 +1178,7 @@ class ModelQuerySet(AbstractQuerySet): self._execute(us) null_conditional = [condition for condition in self._conditional - if condition.field not in updated_columns] + if condition.field not in updated_columns] if self._conditional else None if nulled_columns: ds = DeleteStatement(self.column_family_name, fields=nulled_columns, @@ -1298,7 +1298,7 @@ class DMLQuery(object): # remove conditions on fields that have been updated self._conditional = [condition for condition in self._conditional - if condition.field not in updated_columns] + if condition.field not in updated_columns] if self._conditional else None if not null_clustering_key: self._delete_null_columns()
handle None conditional PYTHON-<I>
datastax_python-driver
train
py
467178abd7b279c3412a23af26dd238223c8848d
diff --git a/lib/pry-state/version.rb b/lib/pry-state/version.rb index <HASH>..<HASH> 100644 --- a/lib/pry-state/version.rb +++ b/lib/pry-state/version.rb @@ -1,3 +1,3 @@ module PryState - VERSION = '0.2.1' + VERSION = '0.1.9' end
Changed version to <I>
SudhagarS_pry-state
train
rb
ef8b2b54069b82adc21b3a9e4f0f7e4fa2bcff01
diff --git a/membership.go b/membership.go index <HASH>..<HASH> 100644 --- a/membership.go +++ b/membership.go @@ -411,7 +411,7 @@ func multicastAnnounce(addr string) error { logfTrace("Sent announcement multicast to %v\n", fullAddr) if GetMulticastAnnounceIntervalSeconds() > 0 { - time.Sleep(time.Second * 10) + time.Sleep(time.Second * time.Duration(GetMulticastAnnounceIntervalSeconds())) } else { return nil }
Fixes bug where sleeping period did not use the configured value
clockworksoul_smudge
train
go
8ee0a37503c2309e679b8876c569934c10463afd
diff --git a/src/rexsterclient.js b/src/rexsterclient.js index <HASH>..<HASH> 100644 --- a/src/rexsterclient.js +++ b/src/rexsterclient.js @@ -56,6 +56,7 @@ module.exports = (function(){ * * @return {Promise} */ + RexsterClient.prototype.execute = RexsterClient.prototype.exec = function(gremlin, callback) { if (gremlin instanceof ObjectWrapper) { var statement = gremlin; diff --git a/test/client.exec.js b/test/client.exec.js index <HASH>..<HASH> 100644 --- a/test/client.exec.js +++ b/test/client.exec.js @@ -6,6 +6,17 @@ var g = grex.g; describe('client', function() { + describe('.execute()', function() { + it('should execute a script', function() { + var client = grex.createClient(); + + client.execute(gremlin(g.v(1)), function(err, response) { + should.not.exist(err); + should.exist(response.results); + }); + }); + }); + describe('.exec()', function() { describe('when port is incorrect', function() { var client = grex.createClient(); @@ -102,6 +113,5 @@ describe('client', function() { }); }); }); - }); }); \ No newline at end of file
Add client.execute() as alias of client.exec()
jbmusso_grex
train
js,js
3e3b66e8c1125caa49a7e00d7596946f54471cba
diff --git a/osuapi/__init__.py b/osuapi/__init__.py index <HASH>..<HASH> 100644 --- a/osuapi/__init__.py +++ b/osuapi/__init__.py @@ -2,6 +2,6 @@ __title__ = "osssss" __author__ = "khazhyk" __license__ = "MIT" __copyright__ = "Copyright khazhyk" -__version__ = "0.0.2" +__version__ = "0.0.3" from osuapi.osu import OsuApi diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ setup( keywords="osu", packages=find_packages(), description="osu! api wrapper.", - long_description=read('README.md'), classifiers=[ "Development Status :: 1 - Planning", "Intended Audience :: Developers",
Remove long_description from setup.py
khazhyk_osuapi
train
py,py
2cc9b1c0693ecfd65e18bd98a51befac51287352
diff --git a/lib/active_zuora/generator.rb b/lib/active_zuora/generator.rb index <HASH>..<HASH> 100644 --- a/lib/active_zuora/generator.rb +++ b/lib/active_zuora/generator.rb @@ -174,7 +174,7 @@ module ActiveZuora end customize 'ProductRatePlanCharge' do - exclude_from_queries :product_rate_plan_charge_tier_data, :revenue_recognition_rule_name + exclude_from_queries :product_rate_plan_charge_tier_data, :revenue_recognition_rule_name, :deferred_revenue_account, :recognized_revenue_account end customize 'Usage' do
Add a few more fields from the Z-Finance package
sportngin_active_zuora
train
rb
6f0b70aa803acdac30775157874ea304c8db5477
diff --git a/setup/source/webpack.mix.js b/setup/source/webpack.mix.js index <HASH>..<HASH> 100644 --- a/setup/source/webpack.mix.js +++ b/setup/source/webpack.mix.js @@ -137,6 +137,8 @@ mix extractVueStyles: false, // Extract .vue component styling to file, rather than inline. + globalVueStyles: file, // Variables file to be imported in every component. + processCssUrls: true, // Process/optimize relative stylesheet url()'s. Set to false, if you don't want them touched. purifyCss: false, // Remove unused CSS selectors.
Modify comment in webpack.mix.js
haasz_laravel-mix-ext
train
js
f3b5232ab421740afe643fbe596514ed188306fc
diff --git a/tests/personifySpecs.js b/tests/personifySpecs.js index <HASH>..<HASH> 100644 --- a/tests/personifySpecs.js +++ b/tests/personifySpecs.js @@ -49,7 +49,7 @@ describe('All methods are working', function(){ xit('personify.homePersonify function should work', function(done){ var personify = new Personify(config); - personify.homePersonify('@test', function(data, err) { + personify.homePersonify({screen_name: '@test'}, function(data, err) { if(err) throw err; done(); }); @@ -98,4 +98,4 @@ describe('Personify methods functionality', function(){ done(); }); }); -}); \ No newline at end of file +});
fix spec for homePersonify
PersonifyJS_personify.js
train
js
12d1a561f0dbb010375fd6200691606276889380
diff --git a/lettuce/languages.py b/lettuce/languages.py index <HASH>..<HASH> 100644 --- a/lettuce/languages.py +++ b/lettuce/languages.py @@ -175,5 +175,15 @@ LANGUAGES = { 'scenario_outline': u'Situasjon Oversikt', 'scenario_separator': u'(Situasjon Oversikt|Situasjon)', 'background': u'(?:Background)', - } + }, + 'sv': { + 'examples': u'Exempel|Scenarion', + 'feature': u'Egenskaper', + 'name': u'Swedish', + 'native': u'Svenska', + 'scenario': u'Scenario', + 'scenario_outline': u'Scenarioöversikt', + 'scenario_separator': u'(Scenarioöversikt|Scenario)', + 'background': u'(?:Context)', + }, }
Swedish language strings They were partially based on the Norwegian translation. Norwegian (Bokmål) is very similar to Swedish.
aloetesting_aloe_django
train
py
82897595b113936b21edc971f22df5ba20d528c5
diff --git a/lib/allscripts_unity_client/json_client_driver.rb b/lib/allscripts_unity_client/json_client_driver.rb index <HASH>..<HASH> 100644 --- a/lib/allscripts_unity_client/json_client_driver.rb +++ b/lib/allscripts_unity_client/json_client_driver.rb @@ -100,7 +100,7 @@ module AllscriptsUnityClient def raise_if_response_error(response) if response.nil? raise APIError, "Response was empty" - elsif response.is_a?(Array) && !response[0]["Error"].nil? + elsif response.is_a?(Array) && !response[0].nil? && !response[0]["Error"].nil? raise APIError, response[0]["Error"] elsif response.is_a?(String) && response.include?("error:") raise APIError, response diff --git a/lib/allscripts_unity_client/version.rb b/lib/allscripts_unity_client/version.rb index <HASH>..<HASH> 100644 --- a/lib/allscripts_unity_client/version.rb +++ b/lib/allscripts_unity_client/version.rb @@ -1,3 +1,3 @@ module AllscriptsUnityClient - VERSION = "1.2.6" + VERSION = "1.2.7" end
Fixing bug with raise_if_response_error.
healthfinch_allscripts-unity-client
train
rb,rb
d93238b5ad51ceadb069ce50e485e2e6607cc78a
diff --git a/logdog/common/storage/bigtable/storage.go b/logdog/common/storage/bigtable/storage.go index <HASH>..<HASH> 100644 --- a/logdog/common/storage/bigtable/storage.go +++ b/logdog/common/storage/bigtable/storage.go @@ -185,13 +185,6 @@ func (s *Storage) Get(c context.Context, r storage.GetRequest, cb storage.GetCal } } - log.Fields{ - "rk": rk.encode(), - "rkIndex": rk.index, - "rkCount": rk.count, - "startIndex": startIndex, - }.Debugf(c, "Punting row key range [%d - %d]...", startIndex, rk.index) - for index := startIndex; index <= rk.index; index++ { // If we're not doing keys-only, consume the row. var row []byte
[logdog] Remove spammy debug log. We suspect that this log statement is slowing down archivist as it's QUITE spammy and provides very little value. R=ddoman Bug: <I> Change-Id: Ie<I>d1ee6d4e3a<I>bd<I>d<I>d<I>c3cc9f7 Reviewed-on: <URL>
luci_luci-go
train
go
03769cac08441b1d4968dfac6b06cffc1873d817
diff --git a/clients/java/src/test/java/com/thoughtworks/selenium/RealDealIntegrationTest.java b/clients/java/src/test/java/com/thoughtworks/selenium/RealDealIntegrationTest.java index <HASH>..<HASH> 100644 --- a/clients/java/src/test/java/com/thoughtworks/selenium/RealDealIntegrationTest.java +++ b/clients/java/src/test/java/com/thoughtworks/selenium/RealDealIntegrationTest.java @@ -50,10 +50,10 @@ public class RealDealIntegrationTest extends TestCase { assertEquals("linkToAnchorOnThisPage", links[3]); selenium.click("link"); selenium.waitForPageToLoad("5000"); - assertTrue(selenium.isLocation("/selenium-server/tests/html/test_click_page2.html")); + assertTrue(selenium.getLocation().endsWith("/selenium-server/tests/html/test_click_page2.html")); selenium.click("previousPage"); selenium.waitForPageToLoad("5000"); - assertTrue(selenium.isLocation("/selenium-server/tests/html/test_click_page1.html")); + assertTrue(selenium.getLocation().endsWith("/selenium-server/tests/html/test_click_page1.html")); } public void testAgain() {
isLocation is now getLocation r<I>
SeleniumHQ_selenium
train
java
74150d192429dd40dc1ba165bf96c0e994487997
diff --git a/deploy_stack.py b/deploy_stack.py index <HASH>..<HASH> 100755 --- a/deploy_stack.py +++ b/deploy_stack.py @@ -604,6 +604,7 @@ def run_deployer(): if host is None: raise Exception('Could not get machine 0 host') try: + client.wait_for_started() safe_print_status(client) client.deployer(args.bundle_path, args.bundle_name) except BaseException as e:
client.wait_for_started() before running deployer.
juju_juju
train
py
496c44809a81f415f18ca958cfbc7dc5089be286
diff --git a/src/Field_SQL_One.php b/src/Field_SQL_One.php index <HASH>..<HASH> 100644 --- a/src/Field_SQL_One.php +++ b/src/Field_SQL_One.php @@ -11,8 +11,11 @@ class Field_SQL_One extends Field_One * * Returns Expression in case you want to do something else with it. */ - public function addField($field, $their_field) + public function addField($field, $their_field = null) { + if($their_field === null) { + $their_field = $field; + } return $this->owner->addExpression($field, function ($m) use ($their_field) { return $m->refLink($this->link)->action('field', [$their_field]); });
allow hasOne()->addField('foo'); (instead of saying foo twice)
atk4_data
train
php
e6510de261f6e402340ca58dc6c91845657a39c6
diff --git a/src/Services/AbstractService.php b/src/Services/AbstractService.php index <HASH>..<HASH> 100644 --- a/src/Services/AbstractService.php +++ b/src/Services/AbstractService.php @@ -10,6 +10,7 @@ use Czim\Service\Contracts\ServiceResponseInterface; use Czim\Service\Exceptions\ServiceConfigurationException; use Czim\Service\Responses\ServiceResponse; use Czim\Service\Responses\ServiceResponseInformation; +use Illuminate\Support\Arr; use Validator; abstract class AbstractService implements ServiceInterface @@ -169,9 +170,9 @@ abstract class AbstractService implements ServiceInterface if (array_key_exists('credentials', $config)) { $this->defaults->setCredentials( - array_get($config['credentials'], 'name'), - array_get($config['credentials'], 'password'), - array_get($config['credentials'], 'domain') + Arr::get($config['credentials'], 'name'), + Arr::get($config['credentials'], 'password'), + Arr::get($config['credentials'], 'domain') ); }
Replaced old array_get() calls with Arr::get()
czim_laravel-service
train
php
2d49119fbe4da6048c8e5ff7e616f0e45ad55adc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ REQUIRES = [ 'django-registration-redux', 'djangorestframework<3.11', 'drf-extensions<0.5', - 'jsonfield', + 'jsonfield<3.0.0', 'pillow', 'diff-match-patch', 'pyLibravatar',
Pin jsonfield to before <I>, so wafer works with older Django versions
CTPUG_wafer
train
py
2d02dae70e3edef2d08c27642512da9254708c76
diff --git a/welly/well.py b/welly/well.py index <HASH>..<HASH> 100644 --- a/welly/well.py +++ b/welly/well.py @@ -220,7 +220,10 @@ class Well(object): figsize=(2*ntracks, 13), sharey=True) + kwargs = {} for i, track in enumerate(tracks): + if '.' in track: + track, kwargs['field'] = track.split('.') if ntracks == 1: axarr = [axarr] try: # ...treating as a plottable objectself. @@ -232,7 +235,7 @@ class Well(object): else: thisax = thisax.twiny() try: - self.data[u].plot(ax=thisax, legend=legend) + self.data[u].plot(ax=thisax, legend=legend, **kwargs) except KeyError: continue
pass kwargs to plot
agile-geoscience_welly
train
py
87af8266e12a9cab46bd41fffc00fb470d52a6e2
diff --git a/lib/alipay/wap/sign.rb b/lib/alipay/wap/sign.rb index <HASH>..<HASH> 100644 --- a/lib/alipay/wap/sign.rb +++ b/lib/alipay/wap/sign.rb @@ -12,12 +12,12 @@ Udmh5Ua2xg6IEfk493VQIDAQAB def self.verify?(params, options = {}) params = Utils.stringify_keys(params) - key = options[:pid] || Alipay.key sign = params.delete('sign') string = params_to_string(params) case params['sec_id'] when 'MD5' + key = options[:pid] || Alipay.key ::Alipay::Sign::MD5.verify?(key, string, sign) when '0001' # RSA ::Alipay::Sign::RSA.verify?(ALIPAY_RSA_PUBLIC_KEY, string, sign)
move key var to MD5 scope
chloerei_alipay
train
rb
4efdefaf5ab3b3495c3e4de33190cd801be8f1a2
diff --git a/gns3server/version.py b/gns3server/version.py index <HASH>..<HASH> 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -23,8 +23,8 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "2.1.10" -__version_info__ = (2, 1, 10, 0) +__version__ = "2.1.11dev1" +__version_info__ = (2, 1, 11, 99) # If it's a git checkout try to add the commit if "dev" in __version__:
Development on <I>dev1
GNS3_gns3-server
train
py
72e9212d8d637abaaba7cb1597dc0732254a698e
diff --git a/message_test.go b/message_test.go index <HASH>..<HASH> 100644 --- a/message_test.go +++ b/message_test.go @@ -9,15 +9,13 @@ import ( "testing" ) -type messageTest struct { +var messageTests = [...]*struct { parsed *Message rawMessage string rawPrefix string hostmask bool // Is it very clear that the prefix is a hostname? server bool // Is the prefix a servername? -} - -var messageTests = [...]*messageTest{ +}{ { parsed: &Message{ Prefix: &Prefix{
Use anonymous structs for Message tests.
sorcix_irc
train
go
098688aafebbf19ddada2a907940fa455d6d8e09
diff --git a/tests/flags.js b/tests/flags.js index <HASH>..<HASH> 100644 --- a/tests/flags.js +++ b/tests/flags.js @@ -1,3 +1,5 @@ +"use strict"; + const assert = require('assert'); const shell = require('shelljs'); const fs = require('fs-extra'); @@ -77,7 +79,7 @@ describe('flags', () => { }); assert.ok(linesReceived > 0); - }).timeout(10000); + }).timeout(60000); it('Should be able to report junit xml', (done) => { const runResult = shell.exec('elm-test --report=junit tests/OnePassing.elm', {silent: true});
allow let/const on node4
rtfeldman_node-test-runner
train
js
8ae294baaa332e71f5a0103c089c044597f82c10
diff --git a/src/com/jayantkrish/jklol/util/IoUtils.java b/src/com/jayantkrish/jklol/util/IoUtils.java index <HASH>..<HASH> 100644 --- a/src/com/jayantkrish/jklol/util/IoUtils.java +++ b/src/com/jayantkrish/jklol/util/IoUtils.java @@ -6,8 +6,10 @@ import java.io.FileReader; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.List; +import java.util.Set; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; public class IoUtils { @@ -89,6 +91,23 @@ public class IoUtils { } /** + * Returns a list of the unique values in {@code columnNumber} of + * {@code filename}. The columns of {@code filename} are delimited + * by {@code delimiter}. + * + * @param filename + * @param columnNumber + * @param delimiter + * @return + */ + public static List<String> readUniqueColumnValuesFromDelimitedFile(String filename, + int columnNumber, String delimiter) { + Set<String> values = Sets.newHashSet( + readColumnFromDelimitedFile(filename, columnNumber, delimiter)); + return Lists.newArrayList(values); + } + + /** * Serializes {@code object} into {@code filename}. * * @param filename
src/com/jayantkrish/jklol/util/IoUtils.java
jayantk_jklol
train
java
a60dd6cd29af2bdecdff90c73bc2aacaff882d6d
diff --git a/js/bittrex.js b/js/bittrex.js index <HASH>..<HASH> 100644 --- a/js/bittrex.js +++ b/js/bittrex.js @@ -485,9 +485,12 @@ module.exports = class bittrex extends Exchange { } let symbol = undefined; if (!market) { - if ('Exchange' in order) + if ('Exchange' in order) { if (order['Exchange'] in this.markets_by_id) market = this.markets_by_id[order['Exchange']]; + else + symbol = order['Exchange']; + } } if (market) symbol = market['symbol'];
fallback to bittrex symbol id for delisted markets #<I>
ccxt_ccxt
train
js
1c41a70537a9adb2ca5ec2b8d4d8c42f79525ffb
diff --git a/src/Macro.php b/src/Macro.php index <HASH>..<HASH> 100644 --- a/src/Macro.php +++ b/src/Macro.php @@ -58,7 +58,7 @@ class Macro implements Directive { $blueMacros = $this->getAllBlueMacrosFromCrossover($crossover->all(), $blueContext); if ($this->terminal && isset($blueMacros[$this->id])) { // already expanded - $ts->back($from); + $ts->jump($from); return; }
better fix for "macro pattern matched contiguously" bug
marcioAlmada_yay
train
php
3ebcb78a4ddff6324a0b38befe009925f6b1afac
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -55,7 +55,7 @@ author = u'Victor Stinner' # built documents. # # The short X.Y version. -version = release = '0.7.11' +version = release = '0.7.12' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/perf/__init__.py b/perf/__init__.py index <HASH>..<HASH> 100644 --- a/perf/__init__.py +++ b/perf/__init__.py @@ -1,6 +1,6 @@ from __future__ import division, print_function, absolute_import -__version__ = '0.7.11' +__version__ = '0.7.12' # Clocks try: diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # - git commit -a -m "post-release" # - git push -VERSION = '0.7.11' +VERSION = '0.7.12' DESCRIPTION = 'Python module to generate and modify perf' CLASSIFIERS = [
post release: set version to <I>
vstinner_perf
train
py,py,py
3900afdb3296b74c95348aab8a680443418b990c
diff --git a/split-file.js b/split-file.js index <HASH>..<HASH> 100644 --- a/split-file.js +++ b/split-file.js @@ -94,16 +94,13 @@ SplitFile.prototype.splitFileBySize = function(file, maxSize) { // Number of parts (exclusive last part!) var parts = Math.ceil(totalSize / maxSize); - var splitSize = maxSize; + var splitSize = Math.round(maxSize); // If size of the parts is 0 then you have more parts than bytes. if(splitSize < 1) { return Promise.reject(new Error("Too many parts, or file too small!")); } - // Get last split size, this is different from the others because it uses scrap value. - var lastSplitSize = totalSize - (splitSize * parts); - // Capture the partinfo in here: var partInfo = []; @@ -119,8 +116,9 @@ SplitFile.prototype.splitFileBySize = function(file, maxSize) { end: (i * splitSize) + splitSize }; } + // recalculate the size of the last chunk - partInfo[partInfo.length - 1].end = (i * splitSize) + lastSplitSize; + partInfo[partInfo.length - 1].end = totalSize; return self.__splitFile(file, partInfo); });
[BUGFIX] Fixing issues with decimal maxSize in the splitbysize method.
tomvlk_node-split-file
train
js
25264ea3c047f4857f5f28a3f76522a90680c5ae
diff --git a/lib/origen/revision_control/git.rb b/lib/origen/revision_control/git.rb index <HASH>..<HASH> 100755 --- a/lib/origen/revision_control/git.rb +++ b/lib/origen/revision_control/git.rb @@ -217,7 +217,14 @@ module Origen # Origen.app.rc.remote_branch?("feature/exists") # => true # Origen.app.rc.remote_branch?("feature/does_not_exist") # => false def remote_branch?(str) - !git("ls-remote --heads #{remote} #{str}", verbose: false).empty? + # Github doesn't like the ssh:// for this command, whereas Stash seems + # to require it. + if github? + rem = remote_without_protocol + else + rem = remote + end + !git("ls-remote --heads #{rem} #{str}", verbose: false).empty? end def initialized? @@ -257,6 +264,11 @@ module Origen self.class.user_email end + # Returns true if the remote points to a github url + def github? + !!(remote.to_s =~ /github.com/) + end + private def remote_without_protocol
Patch to remote_branch method for Github
Origen-SDK_origen
train
rb
c45f64cb8d62e2e7103fdf8345ab9d058e4f7a67
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -2369,6 +2369,8 @@ def line(name, content, match=None, mode=None, location=None, ''' Line-based editing of a file. + .. versionadded:: Beryllium + Params are identical to the remote execution function :mod:`file.line <salt.modules.file.line>`.
Add versionadded directive to file.line state
saltstack_salt
train
py
66e8c77aac09896bb13a5ab89d6109cdaaecacaa
diff --git a/scraper/php/ScrapeResult.class.php b/scraper/php/ScrapeResult.class.php index <HASH>..<HASH> 100644 --- a/scraper/php/ScrapeResult.class.php +++ b/scraper/php/ScrapeResult.class.php @@ -10,9 +10,13 @@ class ScrapeResult if ($path != null) { $this->data = file_get_contents($path); - $this->extension = pathinfo($path, PATHINFO_EXTENSION); + $this->extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); $this->filename = pathinfo($path, PATHINFO_BASENAME); } + else if ($_SERVER['HTTP_USER_AGENT'] != 'GrabzIt') + { + throw new Exception("A call originating from a non-GrabzIt server has been detected"); + } } public function __toString() @@ -60,18 +64,18 @@ class ScrapeResult { if ($this->extension == null && $_FILES['file']['name'] != null) { - $this->extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); + $this->extension = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION)); } return $this->extension; } public function save($path) { - $dat = $this->toString(); + $dat = $this->toString(); if ($dat != null) { return file_put_contents($path, $dat) !== false; - } + } return false; } }
Added security to ScrapeResult to ensure only calls from GrabzIt are accepted.
GrabzIt_grabzit
train
php
198e525d5925834e2949b3414b0b0cb61b8a86f4
diff --git a/ghost/members-ssr/index.js b/ghost/members-ssr/index.js index <HASH>..<HASH> 100644 --- a/ghost/members-ssr/index.js +++ b/ghost/members-ssr/index.js @@ -112,7 +112,7 @@ module.exports = function create(options = EMPTY) { message: `Cookie ${cookieName} not found` }); } - }); + }, cookieConfig); return { exchangeTokenForSession,
Fixed getMemberIdentiyTokenFromSession no-issue This did not have the cookieConfig passed, so could not correctly parse request
TryGhost_Ghost
train
js
3bdbbbec28a03c7d1e6b12adfb4bd77854702057
diff --git a/app/controllers/admin/feedback_controller.rb b/app/controllers/admin/feedback_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/admin/feedback_controller.rb +++ b/app/controllers/admin/feedback_controller.rb @@ -156,10 +156,10 @@ class Admin::FeedbackController < Admin::BaseController return end when 'Mark Checked Items as Ham' - update_feedback(items, :change_state!) + update_feedback(items, :mark_as_ham!) flash[:notice]= _("Marked %d item(s) as Ham",ids.size) when 'Mark Checked Items as Spam' - update_feedback(items, :change_state!) + update_feedback(items, :mark_as_spam!) flash[:notice]= _("Marked %d item(s) as Spam",ids.size) when 'Confirm Classification of Checked Items' update_feedback(items, :confirm_classification!) diff --git a/app/models/feedback.rb b/app/models/feedback.rb index <HASH>..<HASH> 100644 --- a/app/models/feedback.rb +++ b/app/models/feedback.rb @@ -133,6 +133,16 @@ class Feedback < ActiveRecord::Base result end + def mark_as_ham! + mark_as_ham + save! + end + + def mark_as_spam! + mark_as_ham + save! + end + def report_as_spam report_as('spam') end
admin/feedback: make sure that "Mark checked item as (Ham|Spam)" do what they say. The behaviour of these was to just toggle the state, now they are actually marking them as ham/spam so that they don't misbehave.
publify_publify
train
rb,rb
ffdeb4194b50ae318e2c64b27ee763f298ecfaa5
diff --git a/prune_geojson_file.py b/prune_geojson_file.py index <HASH>..<HASH> 100644 --- a/prune_geojson_file.py +++ b/prune_geojson_file.py @@ -135,7 +135,7 @@ class Pruning_geojson_file: new_item = self.get_single_pair_of_coords(u, v, temp, id_iterator, True) self.json_dict['features'].append(new_item) if 'oneway' in item['properties']: - if item['properties']['oneway'] == 'no': + if item['properties']['oneway'] != 'yes': id_iterator += 1 temp = copy.deepcopy(item) new_item = self.get_single_pair_of_coords(v, u, temp, id_iterator, False)
fix - inverted condition for oneway tag handling
aicenter_roadmap-processing
train
py
06aec1cf02be146c04cb56ec3883752e02899ab0
diff --git a/plugins/jobs/server/job_rest.py b/plugins/jobs/server/job_rest.py index <HASH>..<HASH> 100644 --- a/plugins/jobs/server/job_rest.py +++ b/plugins/jobs/server/job_rest.py @@ -127,6 +127,16 @@ class Job(Resource): .errorResponse('Read access was denied for the job.', 403) ) def getJob(self, job): + user = self.getCurrentUser() + + # If the job is not public check access + if not job.get('public', False): + if user: + self.model('job', 'jobs').requireAccess( + job, user, level=AccessType.READ) + else: + self.ensureTokenScopes('jobs.job_' + str(job['_id'])) + return job @access.token
Allow job token to look at itself!
girder_girder
train
py
63967f73d2feb1552661c205f61be68993fea9cf
diff --git a/tests/testapp/tests.py b/tests/testapp/tests.py index <HASH>..<HASH> 100644 --- a/tests/testapp/tests.py +++ b/tests/testapp/tests.py @@ -11,7 +11,7 @@ from testapp.models import TestModel, TypedTestModel class ModelFieldTestCase(TestCase): - def ModelFieldTestCase(self): + def test_to_python(self): field = models.SmallUUIDField() out = field.to_python('IBNApQOzTHGzdjkSt6t-Jg') self.assertIsInstance(out, SmallUUID)
Correcting erroneous test name
adamcharnock_django-smalluuid
train
py
057610cb286581786616dcb2b8dfe8a1ebdb609c
diff --git a/lib/restforce/concerns/streaming.rb b/lib/restforce/concerns/streaming.rb index <HASH>..<HASH> 100644 --- a/lib/restforce/concerns/streaming.rb +++ b/lib/restforce/concerns/streaming.rb @@ -46,16 +46,16 @@ module Restforce end def incoming(message, callback) - channel = message.fetch('channel').gsub('/topic/', '') - replay_id = message.fetch('data', {}).fetch('event', {})['replayId'] - - handler = @replay_handlers[channel] - if !replay_id.nil? && !handler.nil? && handler.respond_to?(:[]=) - # remember the last replay_id for this channel - handler[channel] = replay_id + callback.call(message).tap do + channel = message.fetch('channel').gsub('/topic/', '') + replay_id = message.fetch('data', {}).fetch('event', {})['replayId'] + + handler = @replay_handlers[channel] + if !replay_id.nil? && !handler.nil? && handler.respond_to?(:[]=) + # remember the last replay_id for this channel + handler[channel] = replay_id + end end - - callback.call(message) end def outgoing(message, callback)
Write latest replays after middleware callback
restforce_restforce
train
rb
0930d2f86db45f9921183119b468c648625e6014
diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index <HASH>..<HASH> 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -241,7 +241,7 @@ class BaseHtml $method = 'post'; } if ($request->enableCsrfValidation && !strcasecmp($method, 'post')) { - $hiddenInputs[] = static::hiddenInput($request->csrfVar, $request->getMaskedCsrfToken()); + $hiddenInputs[] = static::hiddenInput($request->csrfVar, $request->getCsrfToken()); } }
Renamed Request::maskedCsrfToken to csrfToken.
yiisoft_yii-core
train
php
a76e4fe60c4705018423e7dedbe71c2549c0c337
diff --git a/classes/phing/tasks/ext/coverage/CoverageReportTask.php b/classes/phing/tasks/ext/coverage/CoverageReportTask.php index <HASH>..<HASH> 100755 --- a/classes/phing/tasks/ext/coverage/CoverageReportTask.php +++ b/classes/phing/tasks/ext/coverage/CoverageReportTask.php @@ -205,6 +205,11 @@ class CoverageReportTask extends Task { $sourceElement = $this->doc->createElement('sourcefile'); $sourceElement->setAttribute('name', basename($filename)); + + /** + * Add original/full filename to document + */ + $sourceElement->setAttribute('sourcefile', $filename); $filelines = $this->highlightSourceFile($filename);
Add full filename to xml document (closes issue #<I>)
phingofficial_phing
train
php
bcb7b69b004f44da706cb953587297a9d4fb6357
diff --git a/lib/bullet/active_record5.rb b/lib/bullet/active_record5.rb index <HASH>..<HASH> 100644 --- a/lib/bullet/active_record5.rb +++ b/lib/bullet/active_record5.rb @@ -187,8 +187,8 @@ module Bullet ::ActiveRecord::Associations::SingularAssociation.prepend(Module.new { # call has_one and belongs_to associations - def reader(force_reload = false) - result = force_reload ? force_reload_reader : super() + def target + result = super() if Bullet.start? if owner.class.name !~ /^HABTM_/ && !@inversed Bullet::Detector::NPlusOneQuery.call_association(owner, reflection.name)
Hook into target instead of reader, so all access is tracked
flyerhzm_bullet
train
rb
93f975319667add70225be28e197f70a2f7441b3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -99,7 +99,7 @@ for (let name of supportedFunctions) { * The actual js-yaml schema, extending the DEFAULT_SAFE_SCHEMA. */ const schema = new jsYaml.Schema({ - include: [ jsYaml.DEFAULT_SAFE_SCHEMA ], + include: [ jsYaml.CORE_SCHEMA ], implicit: [], explicit: allTagTypes, }); diff --git a/test/test-main.js b/test/test-main.js index <HASH>..<HASH> 100644 --- a/test/test-main.js +++ b/test/test-main.js @@ -102,4 +102,22 @@ describe('yaml-schema', function() { assert.deepEqual(yamlParse(input), parsed); assert.deepEqual(yamlParse(yamlDump(parsed)), parsed); }); + + it("should parse date-like strings as strings", function() { + const input = ` + Key: + - 2001-11-01 + - '2001-11-02' + `; + + const parsed = { + "Key": [ + "2001-11-01", + "2001-11-02" + ] + }; + + assert.deepEqual(yamlParse(input), parsed); + assert.deepEqual(yamlParse(yamlDump(parsed)), parsed); + }); });
Restrict base YAML dialect to the core schema (#9) Fixes #8. This aligns with the CFN YAML support defined by: <URL>
gristlabs_yaml-cfn
train
js,js
b7a6ca0c897edc573f3aa806b1091086a0f57462
diff --git a/lektor_htmlmin.py b/lektor_htmlmin.py index <HASH>..<HASH> 100644 --- a/lektor_htmlmin.py +++ b/lektor_htmlmin.py @@ -2,6 +2,7 @@ import os import codecs import chardet +import sys import htmlmin @@ -42,7 +43,8 @@ class HTMLMinPlugin(Plugin): """ Minifies the target html file. """ - enc = chardet.detect(open(target).read())['encoding'] + html = open(target, 'rb').read() + enc = chardet.detect(html)['encoding'] with codecs.open(target, 'r+', enc) as f: result = htmlmin.minify(f.read(), **self.options) f.seek(0)
Improve compatibility between 2.x and 3.x
Vesuvium_lektor-htmlmin
train
py