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
980c7dcabeef462d99a20b2b479689184dc17569
diff --git a/lang/en_utf8/form.php b/lang/en_utf8/form.php index <HASH>..<HASH> 100644 --- a/lang/en_utf8/form.php +++ b/lang/en_utf8/form.php @@ -15,7 +15,7 @@ $string['err_rangelength']='You must enter between {$a->format[0]} and {$a->form $string['err_required']='You must supply a value here.'; $string['nomethodforaddinghelpbutton'] = 'There is no method for adding a help button to form element $a->name (class $a->classname)'; $string['nonexistentformelements'] = 'Trying to add help buttons to nonexistent form elements : $a'; -$string['requiredelement'] = 'Required field.'; +$string['requiredelement'] = 'Required field'; $string['general'] = 'General Settings'; $string['modstandardels']='Common Module Settings'; $string['miscellaneoussettings']='Miscellaneous Settings';
MDL-<I> Remove dot from "Required field." string
moodle_moodle
train
php
461738994a7e3419950f42956c08ef32c313911d
diff --git a/pandas/core/frame.py b/pandas/core/frame.py index <HASH>..<HASH> 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8325,7 +8325,6 @@ Wild 185.0 result = result.iloc[0].rename(None) return result - data = self if numeric_only is None: data = self values = data.values
CLN: Remove unused assignment (#<I>)
pandas-dev_pandas
train
py
dd5503377718e510e9f036261dd9877958713181
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -78,7 +78,7 @@ module ActiveRecord each_current_configuration(environment) { |configuration| create configuration } - ActiveRecord::Base.establish_connection environment + ActiveRecord::Base.establish_connection(environment.to_sym) end def drop(*arguments)
Cast env to symbol, fixes deprecation warning Warning: DEPRECATION WARNING: Passing a string to ActiveRecord::Base.establish_connection for a configuration lookup is deprecated, please pass a symbol (:development) instead.
rails_rails
train
rb
58082cc9f5b83f1a479c4d402fc583c1ea557daa
diff --git a/src/utils/processing/get-convertible-texture-ids.js b/src/utils/processing/get-convertible-texture-ids.js index <HASH>..<HASH> 100644 --- a/src/utils/processing/get-convertible-texture-ids.js +++ b/src/utils/processing/get-convertible-texture-ids.js @@ -8,7 +8,16 @@ export default function getConvertibleTextureKeys(storageId) { var url = getUrlFromStorageId(storageId) return loadData3d(url) - .then(getTextureKeys) + .then(function(data3d) { + + return getTextureKeys(data3d, { + filter: function (storageId, type, format, material, data3d) { + // use source maps only + return format === 'source' ? storageId : false + } + }) + + }) .then(function(textures) { return textures.map(getStorageIdFromUrl) })
filter texture keys to include only source maps
archilogic-com_3dio-js
train
js
133ee319922d50441eae30092ad30f114ea5e65c
diff --git a/lib/omnibus/whitelist.rb b/lib/omnibus/whitelist.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/whitelist.rb +++ b/lib/omnibus/whitelist.rb @@ -152,6 +152,7 @@ MAC_WHITELIST_LIBS = [ /Foundation/, /IOKit$/, /Tk$/, + /libbrotlidec\.1\.dylib/, /libutil\.dylib/, /libffi\.dylib/, /libncurses\.5\.4\.dylib/,
Fix mac_x-<I> failure for chef-workstation
chef_omnibus
train
rb
f60374a7fadab1c791b78b9f51e8637350ce3eb3
diff --git a/tools/builder/rollup.js b/tools/builder/rollup.js index <HASH>..<HASH> 100644 --- a/tools/builder/rollup.js +++ b/tools/builder/rollup.js @@ -314,6 +314,7 @@ async function createCompat(name) { { loose: true, useBuiltIns: 'entry', + corejs: 3, modules: false, shippedProposals: true, targets: compatTarget,
mute babel warning during compat build
zerobias_effector
train
js
3d89264e734de9288f2a6f624f9bc990915e0cdf
diff --git a/components/place-under-ng/place-under-ng.js b/components/place-under-ng/place-under-ng.js index <HASH>..<HASH> 100644 --- a/components/place-under-ng/place-under-ng.js +++ b/components/place-under-ng/place-under-ng.js @@ -87,7 +87,7 @@ const module = angular.module('Ring.place-under', []); * rg-place-under=".some-selector" = selector to point target element * place-top-offset="1" = offset in pixels */ -module.directive('rgPlaceUnder', function ($timeout, getClosestElementWithCommonParent) { +module.directive('rgPlaceUnder', function ($window, getClosestElementWithCommonParent) { const DEBOUNCE_INTERVAL = 10; const HEIGHT_CHECK_INTERVAL = 50; @@ -110,7 +110,7 @@ module.directive('rgPlaceUnder', function ($timeout, getClosestElementWithCommon function waitForNonZeroHeight(element) { return new Promise(resolve => { function checkElementHeight() { - element.offsetHeight === 0 ? $timeout(checkElementHeight, HEIGHT_CHECK_INTERVAL) : resolve(); + element.offsetHeight === 0 ? $window.setTimeout(checkElementHeight, HEIGHT_CHECK_INTERVAL) : resolve(); } checkElementHeight();
JPS-<I> use native setTimeout because we don't want to trigger digest while just checking element height Former-commit-id: 9c1c<I>a<I>b<I>a<I>f<I>da0d<I>fe<I>e4
JetBrains_ring-ui
train
js
8545e0c5fb988abb251a90a3f5d141af2ac9a93a
diff --git a/lib/fastlane/runner.rb b/lib/fastlane/runner.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/runner.rb +++ b/lib/fastlane/runner.rb @@ -8,7 +8,8 @@ module Fastlane return_val = nil - Dir.chdir(Fastlane::FastlaneFolder.path || Dir.pwd) do # the file is located in the fastlane folder + path_to_use = Fastlane::FastlaneFolder.path || Dir.pwd + Dir.chdir(path_to_use) do # the file is located in the fastlane folder @before_all.call(key) if @before_all return_val = nil @@ -24,7 +25,9 @@ module Fastlane return return_val rescue => ex - @error.call(key, ex) if @error # notify the block + Dir.chdir(path_to_use) do + @error.call(key, ex) if @error # notify the block + end raise ex end
Fixed problem with error block running in the wrong folder context
fastlane_fastlane
train
rb
221401e249d092174a856b1284d870f489407fd2
diff --git a/src/VuFindCode/ISBN.php b/src/VuFindCode/ISBN.php index <HASH>..<HASH> 100644 --- a/src/VuFindCode/ISBN.php +++ b/src/VuFindCode/ISBN.php @@ -134,7 +134,16 @@ class ISBN */ public static function normalizeISBN($raw) { - return preg_replace('/[^0-9X]/', '', strtoupper($raw)); + // First strip out illegal characters: + $pass1 = preg_replace('/[^0-9X]/', '', strtoupper($raw)); + if (strlen($pass1) < 2) { + return $pass1; + } + + // Now make sure we only have an X at the end: + $check = substr($pass1, -1); + $isbn = substr($pass1, 0, strlen($pass1) - 1); + return preg_replace('/[^0-9]/', '', $isbn) . $check; } /**
Clean inappropriately-positioned X characters.
vufind-org_vufindcode
train
php
d14630f636f0829421c28dd51dabc9e8880c5df1
diff --git a/test_apps/test_app/test/ens_spec.js b/test_apps/test_app/test/ens_spec.js index <HASH>..<HASH> 100644 --- a/test_apps/test_app/test/ens_spec.js +++ b/test_apps/test_app/test/ens_spec.js @@ -17,22 +17,28 @@ config({ "args": ["$ENSRegistry", rootNode], "onDeploy": [ `ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => { - ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send(); - Resolver.methods.setAddr('${rootNode}', '${address}').send(); - })` + ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send(); + Resolver.methods.setAddr('${rootNode}', '${address}').send().then(() => { + global.ensTestReady = true; + }); + });` ] } } }); contract("ENS", function () { - this.timeout(0); + this.timeout(1000); before(function (done) { // Wait for onDeploy to finish - setTimeout(function () { + const wait = setInterval(() => { + if (!global.ensTestReady) { + return; + } + clearInterval(wait); done(); - }, 500); + }); }); it("should have registered embark.eth", async function () {
use setInterval to wait for deploy complete
embark-framework_embark
train
js
2fe38ec10b4743738b1e40806323df4958781cb8
diff --git a/lib/cache/get.js b/lib/cache/get.js index <HASH>..<HASH> 100644 --- a/lib/cache/get.js +++ b/lib/cache/get.js @@ -4,7 +4,7 @@ module.exports = function (cache, type, index) { var group = cache[type]; var cached = group.items[index]; if (cached && cached.time) { - if (group.permanent) { + if (!group.permanent) { var passed = Date.now() / 1000 - cached.time; if (passed > group.expire) { return false;
Fix Well... apparently the cache was never really enabled Oops
sentanos_roblox-js
train
js
77c5766f254e9acb68766e6fa1e2f68fb2b9be9c
diff --git a/src/UnderConstructionServiceProvider.php b/src/UnderConstructionServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/UnderConstructionServiceProvider.php +++ b/src/UnderConstructionServiceProvider.php @@ -26,7 +26,7 @@ class UnderConstructionServiceProvider extends ServiceProvider $this->commands('LarsJanssen\UnderConstruction\Commands\SetCodeCommand'); $this->mergeConfigFrom(__DIR__.'/../config/under-construction.php', 'under-construction'); - $this->app->bind('TransFormer', function ($app) { + $this->app->bind('TransFormer', function($app) { return new TransFormer(); }); @@ -38,7 +38,7 @@ class UnderConstructionServiceProvider extends ServiceProvider ], ]; - $this->getRouter()->group($routeConfig, function ($router) { + $this->getRouter()->group($routeConfig, function($router) { $router->post('check', [ 'uses' => 'CodeController@check', 'as' => 'underconstruction.check',
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
larsjanssen6_underconstruction
train
php
aa591da53a32e5dba14693c784122fef4e46bd2e
diff --git a/source/Application/Controller/Admin/SystemInfoController.php b/source/Application/Controller/Admin/SystemInfoController.php index <HASH>..<HASH> 100644 --- a/source/Application/Controller/Admin/SystemInfoController.php +++ b/source/Application/Controller/Admin/SystemInfoController.php @@ -61,8 +61,7 @@ class SystemInfoController extends \OxidEsales\Eshop\Application\Controller\Admi echo("<br><br>"); phpinfo(); - $sMessage = ob_get_contents(); - ob_end_clean(); + $sMessage = ob_get_clean(); \OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit($sMessage); } else {
OXDEV-<I> Output buffer usage improvement
OXID-eSales_oxideshop_ce
train
php
4d1389a2e7cd6e00d952a0cb45277d5f1e8c41ca
diff --git a/src/Metrics/Subscription.php b/src/Metrics/Subscription.php index <HASH>..<HASH> 100644 --- a/src/Metrics/Subscription.php +++ b/src/Metrics/Subscription.php @@ -23,6 +23,7 @@ class Subscription extends AbstractModel { protected $id; + protected $external_id; protected $plan; protected $quantity; protected $mrr;
Support external_id on Metrics Subscriptions
chartmogul_chartmogul-php
train
php
b57f2bd02205dcb9d2bd0b38eab80432a637d46f
diff --git a/javascript/UploadField.js b/javascript/UploadField.js index <HASH>..<HASH> 100644 --- a/javascript/UploadField.js +++ b/javascript/UploadField.js @@ -102,10 +102,13 @@ this.fileupload($.extend(true, { formData: function(form) { - + var idVal = $(form).find(':input[name=ID]').val(); + if(!idVal) { + idVal = 0; + } return [ {name: 'SecurityID', value: $(form).find(':input[name=SecurityID]').val()}, - {name: 'ID', value: $(form).find(':input[name=ID]').val()} + {name: 'ID', value: idVal} ]; }, errorMessages: {
BUGFIX: UploadField does not work on DataObjects
silverstripe_silverstripe-framework
train
js
efd2def64b956cada2fd6a5a10f6e584321b4dd2
diff --git a/Tone/component/Envelope.js b/Tone/component/Envelope.js index <HASH>..<HASH> 100644 --- a/Tone/component/Envelope.js +++ b/Tone/component/Envelope.js @@ -179,6 +179,18 @@ define(["Tone/core/Tone", "Tone/signal/Signal"], function(Tone){ }; /** + * trigger the attack and release after a sustain time + * @param {Tone.Time} duration the duration of the note + * @param {Tone.Time=} time the time of the attack + * @param {number=} velocity the velocity of the note + */ + Tone.Envelope.prototype.triggerAttackRelease = function(duration, time, velocity) { + time = this.toSeconds(time); + this.triggerAttack(time, velocity); + this.triggerRelease(time + this.toSeconds(duration)); + }; + + /** * borrows the connect method from {@link Tone.Signal} * * @function
triggerAttackRelease on Envelope
Tonejs_Tone.js
train
js
9609b91fcd87c03a506efb0098830df40b945289
diff --git a/lib/drizzlepac/adriz_versions.py b/lib/drizzlepac/adriz_versions.py index <HASH>..<HASH> 100644 --- a/lib/drizzlepac/adriz_versions.py +++ b/lib/drizzlepac/adriz_versions.py @@ -10,4 +10,4 @@ else: __version__ = '1.0.0' __full_version__ = __version__+sversion -__vdate__ = '25-May-2012' +__vdate__ = '30-May-2012'
Update version date for drizzlepac to reflect change made to support OPUS pipeline operations; specifically, static mask filenames now partially randomly generated. git-svn-id: <URL>
spacetelescope_drizzlepac
train
py
68b029061a826260116d78774ab3c2460dbe76b1
diff --git a/lib/arbetsformedlingen/api/results/ad_result.rb b/lib/arbetsformedlingen/api/results/ad_result.rb index <HASH>..<HASH> 100644 --- a/lib/arbetsformedlingen/api/results/ad_result.rb +++ b/lib/arbetsformedlingen/api/results/ad_result.rb @@ -7,6 +7,8 @@ module Arbetsformedlingen # @param [API::Response] response # @return [Values::Ad] def self.build(response) + return build_empty(response) unless response.success? + response_data = response.json data = response_data.fetch('platsannons') @@ -35,6 +37,10 @@ module Arbetsformedlingen # private + def self.build_empty(response) + Values::Ad.new(response: response) + end + def self.build_terms(data) Values::Terms.new( duration: data.fetch('varaktighet'),
Return empty Values::Ad object if response is not success
buren_arbetsformedlingen
train
rb
b5f22f016dd6bd8bf80c74105828bdc74728163f
diff --git a/Testing/Fakes/NotificationFake.php b/Testing/Fakes/NotificationFake.php index <HASH>..<HASH> 100644 --- a/Testing/Fakes/NotificationFake.php +++ b/Testing/Fakes/NotificationFake.php @@ -232,9 +232,24 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory $notification->id = Str::uuid()->toString(); } + $notifiableChannels = $channels ?: $notification->via($notifiable); + + if (method_exists($notification, 'shouldSend')) { + $notifiableChannels = array_filter( + $notifiableChannels, + function ($channel) use ($notification, $notifiable) { + return $notification->shouldSend($notifiable, $channel) !== false; + } + ); + + if (empty($notifiableChannels)) { + continue; + } + } + $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ 'notification' => $notification, - 'channels' => $channels ?: $notification->via($notifiable), + 'channels' => $notifiableChannels, 'notifiable' => $notifiable, 'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { if ($notifiable instanceof HasLocalePreference) {
[8.x] Notification assertions respect `shouldSend` method on notification (#<I>) * added `shouldSend` support to notification assertions * changed count to empty
illuminate_support
train
php
9bfd9bcbe28457c564e15e6154ead9ee8cf0c165
diff --git a/polyaxon_schemas/polyaxonfile/specification.py b/polyaxon_schemas/polyaxonfile/specification.py index <HASH>..<HASH> 100644 --- a/polyaxon_schemas/polyaxonfile/specification.py +++ b/polyaxon_schemas/polyaxonfile/specification.py @@ -389,8 +389,13 @@ class GroupSpecification(BaseSpecification): @cached_property def experiments_def(self): - concurrent_experiments = self.settings.concurrent_experiments if self.settings else 1 - return self.matrix_space, concurrent_experiments + if self.settings: + concurrent_experiments = self.settings.concurrent_experiments + search_method = self.settings.search_method + else: + concurrent_experiments = 1 + search_method = None + return self.matrix_space, concurrent_experiments, search_method @cached_property def matrix_declarations(self):
Add search method to experiment_def
polyaxon_polyaxon
train
py
8730e8523adb2f0480107f594ce08a24fef701d3
diff --git a/docker/examples/stats/stats.go b/docker/examples/stats/stats.go index <HASH>..<HASH> 100644 --- a/docker/examples/stats/stats.go +++ b/docker/examples/stats/stats.go @@ -11,7 +11,8 @@ import ( // Retrieve global email statistics // GET /stats -func Retrieveglobalemailstatistics() { +// RetrieveGlobalEmailStatistics demonstrates how to retrieve e-mail statistics. +func RetrieveGlobalEmailStatistics() { apiKey := os.Getenv("SENDGRID_API_KEY") host := "http://localhost:4010" request := sendgrid.GetRequest(apiKey, "/v3/stats", host)
convert to camelcase for readability and add godoc
sendgrid_sendgrid-go
train
go
b6838a3770d175d67e10b84474b47f2910c217f9
diff --git a/h2o-core/src/main/java/water/H2O.java b/h2o-core/src/main/java/water/H2O.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/H2O.java +++ b/h2o-core/src/main/java/water/H2O.java @@ -681,7 +681,10 @@ final public class H2O { StringBuilder ua = new StringBuilder(); if (source.contains("Safari")) { - ua.append("Safari"); + ua.append("safari"); + } + else if (source.contains("Python")) { + ua.append("python"); } else { for (int i = 0; i < source.length(); i++) {
Do a pretty parsing of python user agent for calc of model name.
h2oai_h2o-3
train
java
28c98cd314b87acffd85337aeedd242903b5fe60
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentInner.java index <HASH>..<HASH> 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentInner.java @@ -18,7 +18,7 @@ public class DeploymentInner { /** * The deployment properties. */ - @JsonProperty(value = "properties") + @JsonProperty(value = "properties", required = true) private DeploymentProperties properties; /**
Regenerated Resources (#<I>)
Azure_azure-sdk-for-java
train
java
1d2a00a8961897d220088f2382d7d56f57ffcc8e
diff --git a/lib/Github/Api/Organization/Members.php b/lib/Github/Api/Organization/Members.php index <HASH>..<HASH> 100644 --- a/lib/Github/Api/Organization/Members.php +++ b/lib/Github/Api/Organization/Members.php @@ -10,13 +10,20 @@ use Github\Api\AbstractApi; */ class Members extends AbstractApi { - public function all($organization, $type = null) + public function all($organization, $type = null, $filter = 'all') { + $parameters = array(); + $path = 'orgs/'.rawurlencode($organization).'/'; if (null === $type) { - return $this->get('orgs/'.rawurlencode($organization).'/members'); + $path .= 'members'; + if (null !== $filter) { + $parameters['filter'] = $filter; + } + } else { + $path .= 'public_members'; } - return $this->get('orgs/'.rawurlencode($organization).'/public_members'); + return $this->get($path, $parameters); } public function show($organization, $username)
Add support for filtering organisation members by 2FA status
KnpLabs_php-github-api
train
php
1c6796f63216ce1de00e2c779a9d5893c22bcc6a
diff --git a/javaobj.py b/javaobj.py index <HASH>..<HASH> 100644 --- a/javaobj.py +++ b/javaobj.py @@ -315,6 +315,9 @@ class JavaString(str): """ Represents a Java String """ + def __hash__(self): + return str.__hash__(self) + def __eq__(self, other): if not isinstance(other, str): return False @@ -1421,7 +1424,7 @@ class DefaultObjectTransformer(object): new_object = self.JavaMap() java_object.copy(new_object) - for i in range((len(java_object.annotations) - 1) / 2): + for i in range((len(java_object.annotations) - 1) // 2): new_object[java_object.annotations[i * 2 + 1]] = \ java_object.annotations[i * 2 + 2]
Small corrections due to tests - JavaString is now hashable - Use an integer-division reading annotations
tcalmant_python-javaobj
train
py
772c1f2b16df787bd4598b886a54978877d683a6
diff --git a/shaderdef/stage.py b/shaderdef/stage.py index <HASH>..<HASH> 100644 --- a/shaderdef/stage.py +++ b/shaderdef/stage.py @@ -43,7 +43,7 @@ class Stage(object): self._return_type = get_output_interface(func) def declare_inputs(self, lines): - for name, param_type in self._params.items(): + for name, param_type in sorted(self._params.items()): # TODO(nicholasbishop): dedup with return type origin = getattr(param_type, '__origin__', None) array = None
Add sorting to make output deterministic
nicholasbishop_shaderdef
train
py
a49b0fdb76e518122579dc4d6426ca8d34e4db63
diff --git a/mode/xml/xml.js b/mode/xml/xml.js index <HASH>..<HASH> 100644 --- a/mode/xml/xml.js +++ b/mode/xml/xml.js @@ -21,7 +21,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true}, + 'track': true, 'wbr': true, 'menuitem': true}, implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, 'th': true, 'tr': true},
[xml mode] Mark <menuitem> as self-closing tag Closes #<I>
codemirror_CodeMirror
train
js
2f287093bb58d26c6d3ecafdfe256b1314e8517e
diff --git a/src/Library/Usage.php b/src/Library/Usage.php index <HASH>..<HASH> 100644 --- a/src/Library/Usage.php +++ b/src/Library/Usage.php @@ -36,7 +36,7 @@ class Usage { * @access private * @var string */ - private $gaId = 'UA-1501988-42'; + private $gaId; /** * An array of page prefixes to load usage tracking on. @@ -60,6 +60,8 @@ class Usage { Filter::add( $this ); self::$filtersAdded = true; } + + $this->gaId = Configs::get( 'gaId' ); } /** diff --git a/src/library.global.php b/src/library.global.php index <HASH>..<HASH> 100644 --- a/src/library.global.php +++ b/src/library.global.php @@ -136,4 +136,8 @@ return array( 'priority' => 'core', ), ), + + + // Google Analytics ID, used by the Usage class. + 'gaId' => 'UA-1501988-42', );
Move ga id to config file
BoldGrid_library
train
php,php
2170b83724b5f2bb1f955ff2f699b161fe65cfa2
diff --git a/lib/sbsm/request.rb b/lib/sbsm/request.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/request.rb +++ b/lib/sbsm/request.rb @@ -80,6 +80,9 @@ module SBSM 'drbsession_uri' => @drb_uri, 'session_path' => '/', } + if unparsed_uri =~ /pointer/ + return + end if(is_crawler?) sleep 2.0 sid = [ENV['DEFAULT_FLAVOR'], @cgi.params['language'], @cgi.user_agent].join('-')
Drop any request containing pointer in it
zdavatz_sbsm
train
rb
49b1f683fb55908c83a211989710478b0c3c7d14
diff --git a/lib/environment.js b/lib/environment.js index <HASH>..<HASH> 100644 --- a/lib/environment.js +++ b/lib/environment.js @@ -13,6 +13,8 @@ module.exports = { string_decoder: {preferBuiltin: true, glob: true}, buffer: {expose: 'buffer', glob: true}, url: {preferBuiltin: true, glob: true}, + punycode: {preferBuiltin: true, glob: true}, + querystring: {preferBuiltin: true, glob: true}, 'liquid-json': {expose: 'json', glob: true}, 'crypto-js': {glob: true}, atob: {glob: true},
Added punycode and querystring to the sandbox
postmanlabs_postman-sandbox
train
js
51c7c06d952bfef7f35278cf4564d155cdfd797a
diff --git a/gnotty/server.py b/gnotty/server.py index <HASH>..<HASH> 100755 --- a/gnotty/server.py +++ b/gnotty/server.py @@ -159,7 +159,8 @@ def run(): print "Could not kill any daemons" return if settings.DAEMON: - kill(pid_file) + if kill(pid_file): + print "Running daemon killed" daemonize(pid_file) serve_forever()
Show a message when a current daemon is killed by starting a new one.
stephenmcd_gnotty
train
py
85ae51ee366790897eb233122726cfe540847bdc
diff --git a/spyder/plugins/projects/projecttypes/__init__.py b/spyder/plugins/projects/projecttypes/__init__.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/projects/projecttypes/__init__.py +++ b/spyder/plugins/projects/projecttypes/__init__.py @@ -61,12 +61,16 @@ class BaseProject(object): def set_recent_files(self, recent_files): """Set a list of files opened by the project.""" - for recent_file in recent_files[:]: - if not os.path.isfile(recent_file): - recent_files.remove(recent_file) - recent_files = [os.path.relpath(recent_file, self.root_path) - for recent_file in recent_files] - files = list(OrderedDict.fromkeys(recent_files)) + processed_recent_files = [] + for recent_file in recent_files: + if os.path.isfile(recent_file): + try: + relative_recent_file = os.path.relpath( + recent_file, self.root_path) + processed_recent_files.append(relative_recent_file) + except ValueError: + processed_recent_files.append(recent_file) + files = list(OrderedDict.fromkeys(processed_recent_files)) self.config.set('main', 'recent_files', files) def get_recent_files(self):
Projects: Handle relative paths for recent files on different mounts
spyder-ide_spyder
train
py
537360fbb57fe3be2efac313f2a67631bf096dee
diff --git a/test/integration/index.js b/test/integration/index.js index <HASH>..<HASH> 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -204,7 +204,7 @@ describe('Stream client', function () { }); it('add activity', function (done) { - var activity = {'actor': 1, 'verb': 'add', 'object': 1}; + var activity = {'actor': 'test-various:characters', 'verb': 'add', 'object': 1, 'tweet': 'hello world'}; function get(error, response, body) { var activityId = body['id']; user1.get({'limit': 1}, function(error, response, body) {
a bit more extensive testing on add activity
GetStream_stream-js
train
js
74f293e2fc85464845842c9bb57102157f8465c9
diff --git a/src/components/chips/Chips.js b/src/components/chips/Chips.js index <HASH>..<HASH> 100644 --- a/src/components/chips/Chips.js +++ b/src/components/chips/Chips.js @@ -118,18 +118,19 @@ export class Chips extends Component { onKeyDown(event) { const inputValue = event.target.value; + const values = this.props.value || []; switch(event.which) { //backspace case 8: - if (this.inputElement.value.length === 0 && this.props.value && this.props.value.length > 0) { - this.removeItem(event, this.props.value.length - 1); + if (this.inputElement.value.length === 0 && values.length > 0) { + this.removeItem(event, values.length - 1); } break; //enter case 13: - if (inputValue && inputValue.trim().length && (!this.props.max || this.props.max > this.props.value.length)) { + if (inputValue && inputValue.trim().length && (!this.props.max || this.props.max > values.length)) { this.addItem(event, inputValue, true); } break;
Fixed #<I> - Chips is not working when the initial value sets 'null'
primefaces_primereact
train
js
45631618eef068f43ddf7d1b6f5619a99b1ec564
diff --git a/jlib-core/src/main/java/org/jlib/core/collection/ContainsKeyCacheMap.java b/jlib-core/src/main/java/org/jlib/core/collection/ContainsKeyCacheMap.java index <HASH>..<HASH> 100644 --- a/jlib-core/src/main/java/org/jlib/core/collection/ContainsKeyCacheMap.java +++ b/jlib-core/src/main/java/org/jlib/core/collection/ContainsKeyCacheMap.java @@ -65,7 +65,6 @@ import com.google.common.collect.ForwardingMap; * // dicouraged by clean coders * value = map.get(key); * if (value != null) { - * value = map.get(key); * // commands with value * } * else {
using Guava ForwardingMap instead of DelegatingMap
jlib-framework_jlib-operator
train
java
5173ef43c84d0700f3cb98875b9999a2ca9b72c9
diff --git a/salt/fileclient.py b/salt/fileclient.py index <HASH>..<HASH> 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -228,6 +228,7 @@ class Client(object): # go through the list of all files finding ones that are in # the target directory and caching them for fn_ in self.file_list(saltenv): + fn_ = salt.utils.locales.sdecode(fn_) if fn_.strip() and fn_.startswith(path): if salt.utils.check_include_exclude( fn_, include_pat, exclude_pat): diff --git a/salt/fileserver/__init__.py b/salt/fileserver/__init__.py index <HASH>..<HASH> 100644 --- a/salt/fileserver/__init__.py +++ b/salt/fileserver/__init__.py @@ -551,7 +551,8 @@ class Fileserver(object): if 'path' not in load or 'saltenv' not in load: return '' - fnd = self.find_file(load['path'], load['saltenv']) + fnd = self.find_file(salt.utils.locales.sdecode(load['path']), + load['saltenv']) if not fnd.get('back'): return '' fstr = '{0}.file_hash'.format(fnd['back'])
Decode unicode names in fileclient/server Closes #<I>
saltstack_salt
train
py,py
98902046c772b7e1073bf82a29c53d59a83cc4d3
diff --git a/lib/nominatim/search.rb b/lib/nominatim/search.rb index <HASH>..<HASH> 100644 --- a/lib/nominatim/search.rb +++ b/lib/nominatim/search.rb @@ -149,5 +149,23 @@ module Nominatim self end + # Limit results to certain type, instead of trying to match + # all possible matches. + # + # Possible values: + # - settlement + # - country + # - city + # - state + # + # This feature is not in official Nominatim documentation. + # + # @param type Type to restrict to + # @return [Nominatim::Search] + def featuretype(type) + @criteria[:featuretype] = type + self + end + end end
Added undocumented criteria featuretype to Search. This allows restriction by certain area feature, like city, so results from another city specified in the query won’t be mixed to the result. For some reason this feature is not documented in public API doc of Nominatim.
Smarre_ruby-nominatim
train
rb
db9e4c410eea1d6dae665b7ff6d3a7a763d20107
diff --git a/udiskie/prompt.py b/udiskie/prompt.py index <HASH>..<HASH> 100644 --- a/udiskie/prompt.py +++ b/udiskie/prompt.py @@ -146,6 +146,7 @@ def get_password_gui(device): return None [email protected]_generator_function def get_password_tty(device): """Get the password to unlock a device from terminal.""" # TODO: make this a TRUE async
Fix bug with get_password_tty
coldfix_udiskie
train
py
5bfd001b55357106dba090c83a1c88912a004665
diff --git a/datasette/cli.py b/datasette/cli.py index <HASH>..<HASH> 100644 --- a/datasette/cli.py +++ b/datasette/cli.py @@ -550,7 +550,9 @@ def serve( ) # De-duplicate files so 'datasette db.db db.db' only attaches one /db - files = list(dict.fromkeys(files)) + files_seen = set() + deduped_files = [f for f in files if f not in files_seen and not files_seen.add(f)] + files = deduped_files try: ds = Datasette(files, **kwargs)
Use de-dupe idiom that works with Python <I>, refs #<I>
simonw_datasette
train
py
d76f99fb8f79aeb542b4adfd0c0168ae789a56f8
diff --git a/demo.py b/demo.py index <HASH>..<HASH> 100755 --- a/demo.py +++ b/demo.py @@ -2,6 +2,7 @@ import argparse import re +import logging from miflora.miflora_poller import MiFloraPoller, \ MI_CONDUCTIVITY, MI_MOISTURE, MI_LIGHT, MI_TEMPERATURE, MI_BATTERY @@ -18,6 +19,7 @@ def valid_miflora_mac(mac, pat=re.compile(r"C4:7C:8D:[0-9A-F]{2}:[0-9A-F]{2}:[0- parser = argparse.ArgumentParser() parser.add_argument('mac', type=valid_miflora_mac) parser.add_argument('--backend', choices=['gatttool', 'bluepy'], default='gatttool') +parser.add_argument('-v', '--verbose', action='store_const', const=True) args = parser.parse_args() backend = None @@ -28,6 +30,9 @@ elif args.backend == 'bluepy': else: raise Exception('unknown backend: {}'.format(args.backend)) +if args.verbose: + logging.basicConfig(level=logging.DEBUG) + poller = MiFloraPoller(args.mac, backend) print("Getting data from Mi Flora")
added "-v" flag to demo.py to print debug output to console. (#<I>)
open-homeautomation_miflora
train
py
93e1aae6380b2bc01778e0c37f9863ac5b2e9932
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -168,6 +168,7 @@ def _filter_requirements(lines_iter, filter_names=None, REQ_UPPER_BOUNDS = { 'bcolz': '<1', 'pandas': '<0.19', + 'networkx': '<2.0', }
MAINT: networkx 2 changes the behavior of out_degree
quantopian_zipline
train
py
2f7dce28078c8b65a928c9d757d48673ca5e3df4
diff --git a/kconfiglib.py b/kconfiglib.py index <HASH>..<HASH> 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1381,6 +1381,11 @@ class Config(object): def _eval_expr(self, expr): """Evaluates an expression and returns one of the tristate values "n", "m" or "y".""" + + # Handles e.g. an "x if y" condition where the "if y" part is missing. + if expr is None: + return "y" + res = self._eval_expr_2(expr) if res == "m": @@ -1395,9 +1400,6 @@ class Config(object): return res def _eval_expr_2(self, expr): - if expr is None: - return "y" - if isinstance(expr, Symbol): # Non-bool/tristate symbols are always "n" in a tristate sense, # regardless of their value
Move 'expr is None' check up to _eval_expr(). None should never appear as a subexpression.
ulfalizer_Kconfiglib
train
py
fd1ee42c4ed9ff1d1b0474a32a43e45a785a416c
diff --git a/niworkflows/reports/tests/test_core.py b/niworkflows/reports/tests/test_core.py index <HASH>..<HASH> 100644 --- a/niworkflows/reports/tests/test_core.py +++ b/niworkflows/reports/tests/test_core.py @@ -214,3 +214,30 @@ def test_generated_reportlets(bids_sessions, ordering): assert reportlets_num == expected_reportlets_num == out_figs else: assert reportlets_num < expected_reportlets_num == out_figs + + [email protected]( + "subject_id,out_html", [ + ('sub-01', 'sub-01.html'), + ('sub-sub1', 'sub-sub1.html'), + ('01', 'sub-01.html'), + ('sub1', 'sub-sub1.html'), + ] +) +def test_subject_id(tmp_path, subject_id, out_html): + reports = tmp_path / 'reports' + Path( + reports + / 'fmriprep' + / (subject_id if subject_id.startswith('sub-') else f'sub-{subject_id}') + ).mkdir(parents=True) + + report = Report( + str(tmp_path), + 'myuniqueid', + reportlets_dir=reports, + subject_id=subject_id, + packagename='fmriprep', + ) + assert report.subject_id[:4] != 'sub-' + assert report.out_filename == out_html
TST: add basic test to ensure subject ID is not stripped
poldracklab_niworkflows
train
py
45a3991fce5cf9987de8ef691aaaf28ea3473a85
diff --git a/google-cloud-debugger/test/google/cloud/debugger/backoff_test.rb b/google-cloud-debugger/test/google/cloud/debugger/backoff_test.rb index <HASH>..<HASH> 100644 --- a/google-cloud-debugger/test/google/cloud/debugger/backoff_test.rb +++ b/google-cloud-debugger/test/google/cloud/debugger/backoff_test.rb @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +require "helper" describe Google::Cloud::Debugger::Backoff do let(:backoff) { Google::Cloud::Debugger::Backoff.new }
Fix intermittent debugger backoff test failures (#<I>)
googleapis_google-cloud-ruby
train
rb
24deb8a51df999aeb6d2b3d6c05d1f3e231a6e66
diff --git a/telebot/handler_backends.py b/telebot/handler_backends.py index <HASH>..<HASH> 100644 --- a/telebot/handler_backends.py +++ b/telebot/handler_backends.py @@ -5,7 +5,7 @@ import threading from telebot import apihelper -class HandlerBackend: +class HandlerBackend(object): """ Class for saving (next step|reply) handlers """
Change class from new-style class to object class
eternnoir_pyTelegramBotAPI
train
py
c5f82073ef38c960226b151756dfd9fe5b787e3c
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor/widgets/codeeditor.py +++ b/spyder/plugins/editor/widgets/codeeditor.py @@ -1677,7 +1677,7 @@ class CodeEditor(TextEditBaseWidget): data = block.userData() if data and data.code_analysis: for warning in data.code_analysis: - warnings.append([warning[-1], block.blockNumber()]) + warnings.append([warning[-1], block.blockNumber() + 1]) block = block.next() return warnings
Editor: Fix line number of warning actions
spyder-ide_spyder
train
py
c46fdc6bf1327100567b91d5f4986aaa35950660
diff --git a/ryu/app/simple_switch.py b/ryu/app/simple_switch.py index <HASH>..<HASH> 100644 --- a/ryu/app/simple_switch.py +++ b/ryu/app/simple_switch.py @@ -84,7 +84,7 @@ class SimpleSwitch(app_manager.RyuApp): def _port_status_handler(self, ev): msg = ev.msg reason = msg.reason - port_no = msg.port_no + port_no = msg.desc.port_no ofproto = msg.datapath.ofproto if reason == ofproto.OFPPR_ADD:
simple_switch: fix port_status_handler port_no is not a member of msg, but a member of msg.desc.
osrg_ryu
train
py
eed02105b8d7249fac3bd180699ec52f34495b98
diff --git a/lib/nox-server.js b/lib/nox-server.js index <HASH>..<HASH> 100644 --- a/lib/nox-server.js +++ b/lib/nox-server.js @@ -211,8 +211,6 @@ exports.nox = function(requirefun, cookiename, logfun, uglify) { logfun('serving nox-client.js for ' + page.url + '\n'); - res.writeHead(200, { 'Content-Type': 'text/javascript', 'Cache-Control': 'no-cache' }); - var result = []; async.waterfall([ function(wfcb) { @@ -323,13 +321,18 @@ exports.nox = function(requirefun, cookiename, logfun, uglify) { wfcb(); }, function(wfcb) { + res.writeHead(200, { 'Content-Type': 'text/javascript', + 'Cache-Control': 'no-cache' }); res.end(result); wfcb(); } ], function(err) { - if( err ) + if( err ) { + res.writeHead(500); + res.end(); logfun('error creating ' + page.url + '/nox-client.js:' + err + '\n'); + } }); }
give <I> response in error cases
asaarinen_nox.js
train
js
13cb8d82441e452f5a3762dbc002dd7c1fa1e95c
diff --git a/pkg/kube/client.go b/pkg/kube/client.go index <HASH>..<HASH> 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -274,7 +274,8 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader originalInfo := original.Get(info) if originalInfo == nil { - return fmt.Errorf("no resource with the name %q found", info.Name) + kind := info.Mapping.GroupVersionKind.Kind + return fmt.Errorf("no %s with the name %q found", kind, info.Name) } if err := updateResource(c, info, originalInfo.Object, force, recreate); err != nil {
Show kind in resource-not-found-in-release error This error occures when resource is not found in helm release: `Error: UPGRADE FAILED: no resource with the name "redis-cluster-sentinel" found` Changed to: `Error: UPGRADE FAILED: no ConfigMap with the name "redis-cluster-sentinel" found` So now that resource can easily be found in cluster.
helm_helm
train
go
946dd7dfb18d801a24b15d2e012045384c98cdc4
diff --git a/Filter/AssetsUrl.php b/Filter/AssetsUrl.php index <HASH>..<HASH> 100644 --- a/Filter/AssetsUrl.php +++ b/Filter/AssetsUrl.php @@ -40,7 +40,7 @@ class AssetsUrl implements FilterInterface, HashableInterface $fs = new Filesystem(); $resource = $matches['resource']; - preg_match("/(\@{1,2})([A-Z][A-Za-z\_]*)/", $resource, $matches); + preg_match("/(\@{1,2})([A-Z][A-Za-z0-9\_\-]*)/", $resource, $matches); if ($resource{1} == "@") { $resource = substr($resource, 1); @@ -72,7 +72,7 @@ class AssetsUrl implements FilterInterface, HashableInterface return $resource; }; - $pattern = "/(?P<resource>\@{1,2}[A-Za-z\_]+Bundle[A-Za-z\_\.\/\-]*)/"; + $pattern = "/(?P<resource>\@{1,2}[A-Za-z\_]+Bundle[A-Za-z0-9\_\.\/\-]*)/"; $asset->setContent(preg_replace_callback($pattern, $callback, $content)); }
Fix in AssetsUrl - there was no support for numbers
Hexmedia_Administrator-Bundle
train
php
bd3b349d160f4ab5cbe4a41aa9d8200ce23aedb7
diff --git a/system/rake-support/share/rails-template.rb b/system/rake-support/share/rails-template.rb index <HASH>..<HASH> 100644 --- a/system/rake-support/share/rails-template.rb +++ b/system/rake-support/share/rails-template.rb @@ -27,7 +27,7 @@ else initializer("session_store.rb") do <<-INIT # Configure the TorqueBox Servlet-based session store. -# Provides for server-based, in-memory, cluster-compatible sessions. +# Provides for server-based, in-memory, cluster-compatible sessions #{app_const}.config.session_store TorqueBox::Session::ServletStore if defined?(TorqueBox::Session::ServletStore) INIT end @@ -41,7 +41,7 @@ initializer("active_record_handle_async.rb") do # end # # a_model_instance.background.another_method -if defined?(TorqueBox::Messaging) +if defined?(TorqueBox::Messaging) && defined?(ActiveRecord::Base) require 'torquebox/messaging/embedded_tasks' ActiveRecord::Base.send(:include, TorqueBox::Messaging::EmbeddedTasks ) end
Check for ActiveRecord::Base before trying to include EmbeddedTasks.
torquebox_torquebox
train
rb
48cbdab8232c0985e1ab008871cb9f2dc1d56585
diff --git a/pirc522/__init__.py b/pirc522/__init__.py index <HASH>..<HASH> 100644 --- a/pirc522/__init__.py +++ b/pirc522/__init__.py @@ -43,7 +43,7 @@ class RFID(object): irq = threading.Event() def __init__(self, bus=0, device=0, speed=1000000, pin_rst=22, - pin_ce=0, pin_irq=18): + pin_ce=0, pin_irq=18, pin_mode=GPIO.BOARD): self.pin_rst = pin_rst self.pin_ce = pin_ce self.pin_irq = pin_irq @@ -52,7 +52,7 @@ class RFID(object): self.spi.open(bus, device) self.spi.max_speed_hz = speed - GPIO.setmode(GPIO.BOARD) + GPIO.setmode(pin_mode) GPIO.setup(pin_rst, GPIO.OUT) GPIO.setup(pin_irq, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.add_event_detect(pin_irq, GPIO.FALLING,
Variable GPIO.setmode Let user decide which pinout should be used
ondryaso_pi-rc522
train
py
a7650cac822c96cd6bd6afad7095886c2bc84884
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name='pyshould', description='Should style asserts based on pyhamcrest', - version='0.4.0', + version='0.5.0', url='https://github.com/drslump/pyshould', author='Ivan -DrSlump- Montes', author_email='[email protected]',
Upped version to <I>
drslump_pyshould
train
py
1bf3e7e37ef098f9cb8bd123f15c7952bb509518
diff --git a/src/Ingruz/Rest/Controllers/RestDingoController.php b/src/Ingruz/Rest/Controllers/RestDingoController.php index <HASH>..<HASH> 100644 --- a/src/Ingruz/Rest/Controllers/RestDingoController.php +++ b/src/Ingruz/Rest/Controllers/RestDingoController.php @@ -134,7 +134,9 @@ class RestDingoController extends Controller implements RestControllerInterface return $this->respondNotProcessable('Unable to delete the selected '.ucfirst($this->baseClass)); } - return $this->baseClass.' deleted successfully'; + $message = $this->baseClass.' deleted successfully'; + + return compact('message'); } /**
Change response to DELETE requests in Dingo Controller
ingro_Rest
train
php
e71e76a0dbd71707a44be8da16d685e6765ffc41
diff --git a/lib/daemon/runner.js b/lib/daemon/runner.js index <HASH>..<HASH> 100644 --- a/lib/daemon/runner.js +++ b/lib/daemon/runner.js @@ -22,7 +22,7 @@ function Runner(conf) { this.db_poll_stop = this._dbconn.listenTask(function(err, task) { if (err) { logger.debug("Runner: Error polling database:", err) - this.stop(1); + that.stop(1); } // check default controller on a best effort basis
Fixed undefined this error in runner
meetings_gearsloth
train
js
f260493e73744dc96f021a38e80832b8a17e3b87
diff --git a/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb b/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb index <HASH>..<HASH> 100644 --- a/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb +++ b/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb @@ -6,7 +6,13 @@ class AddCommentCountToActivityObject < ActiveRecord::Migration ActivityObject.reset_column_information ActivityObject.all.each do |ao| - ao.comment_count = Activity.includes(:activity_objects).where('activity_objects.object_type' => "Comment").where(:ancestry => [ao.activities.first.id]).size + parent_activity = ao.activities.first + + # Actors have not parent activities + next if parent_activity.blank? + + ao.comment_count = Activity.includes(:activity_objects).where('activity_objects.object_type' => "Comment").where(:ancestry => [parent_activity.id]).size + ao.save! if ao.comment_count > 0 end
Fix add_comment_count migration Heads-up @rafaelgg
ging_social_stream
train
rb
61a9e28fb7c83e66e9226e6b6b8dcc48065de505
diff --git a/metadata.go b/metadata.go index <HASH>..<HASH> 100644 --- a/metadata.go +++ b/metadata.go @@ -1050,7 +1050,7 @@ func (fm *ForceMetadata) MakeZip(files ForceMetadataFiles) (zipdata []byte, err zipper := zip.NewWriter(zipfile) for name, data := range files { name = filepath.ToSlash(name) - wr, err := zipper.Create(fmt.Sprintf("unpackaged%s%s", string(os.PathSeparator), name)) + wr, err := zipper.Create(fmt.Sprintf("unpackaged/%s", name)) if err != nil { return nil, err }
Fix Zip File Creation on Windows Use forward slash for paths to files added to the zip file being deployed. Per the archive/zip documentation, Writer.Create only allows forward slashes. Fixes "No package.xml found" error when using `force push` on windows.
ForceCLI_force
train
go
bcbc6ac4a8b10559cb32b20a2a3a541cb0fe5f97
diff --git a/src/Traits/DateTimeTrait.php b/src/Traits/DateTimeTrait.php index <HASH>..<HASH> 100755 --- a/src/Traits/DateTimeTrait.php +++ b/src/Traits/DateTimeTrait.php @@ -32,7 +32,7 @@ trait DateTimeTrait * * @return string */ - public function createdAt($timeAgo = false, $format = 'l jS \\of F Y'): string + public function createdAt($timeAgo = false, $format = 'd.m.Y'): string { return $timeAgo ? $this->getTimeAgo($this->created_at) : $this->created_at->format($format); } @@ -43,7 +43,7 @@ trait DateTimeTrait * * @return string */ - public function updatedAt($timeAgo = false, $format = 'l jS \\of F Y'): string + public function updatedAt($timeAgo = false, $format = 'd.m.Y'): string { return $timeAgo ? $this->getTimeAgo($this->updated_at) : $this->updated_at->format($format); } @@ -54,7 +54,7 @@ trait DateTimeTrait * * @return string */ - public function deletedAt($timeAgo = false, $format = 'l jS \\of F Y'): string + public function deletedAt($timeAgo = false, $format = 'd.m.Y'): string { return $timeAgo ? $this->getTimeAgo($this->deleted_at) : $this->deleted_at->format($format); }
Use dmY as default date format
faustbrian_Laravel-Presenter
train
php
629ca8c79257f22907e7f3d22f6d76e3911dd5e5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ setup(name='b2handle', 'in the EUDAT project.'), long_description=long_description, classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7',
Change development status classifier from beta to prod/stable
EUDAT-B2SAFE_B2HANDLE
train
py
32e595e5e7244e8260b1d555adcfd0edc8ab07ae
diff --git a/km3pipe/db.py b/km3pipe/db.py index <HASH>..<HASH> 100644 --- a/km3pipe/db.py +++ b/km3pipe/db.py @@ -329,10 +329,7 @@ class DBManager(object): cookie_str = str(cookie, 'utf-8') # Python 3 except TypeError: cookie_str = str(cookie) # Python 2 - print("The following permanent session cookie has been stored in " - "~/.km3net and will be used from now on to authenticate with " - "the KM3NeT Oracle DB:\n\n" - " {0}\n\n".format(cookie_str)) + log.debug("Session cookie: {0}".format(cookie_str)) config.set('DB', 'session_cookie', cookie_str) self.restore_ression(cookie)
log.debug instead of print. we dont want to confuse the user
tamasgal_km3pipe
train
py
823dd303fc74c4673ad0fad9f2434ec15833de2b
diff --git a/lib/i18n/tasks/logging.rb b/lib/i18n/tasks/logging.rb index <HASH>..<HASH> 100644 --- a/lib/i18n/tasks/logging.rb +++ b/lib/i18n/tasks/logging.rb @@ -25,6 +25,9 @@ module I18n::Tasks::Logging def log_stderr(*args) MUTEX.synchronize do + # 1. We don't want output from different threads to get intermixed. + # 2. StringIO is currently not thread-safe (blows up) on JRuby: + # https://github.com/jruby/jruby/issues/4417 $stderr.puts(*args) end end
Explain on why the mutex is needed in logging.rb Reference <URL>
glebm_i18n-tasks
train
rb
62118deb5d941c8d8ebe131643768fbf01f975eb
diff --git a/src/styles/style_manager.js b/src/styles/style_manager.js index <HASH>..<HASH> 100755 --- a/src/styles/style_manager.js +++ b/src/styles/style_manager.js @@ -212,7 +212,7 @@ StyleManager.mix = function (style, styles) { // Track which styles were mixed into this one for (let s of sources) { - style.mixed[s] = true; + style.mixed[s.name] = true; } } sources.push(style);
fix population of style's set of `mixed` styles
tangrams_tangram
train
js
7e09a02d9fbef4302a9ba9056047c2feb06fd7d4
diff --git a/lib/barby/outputter/cairo_outputter.rb b/lib/barby/outputter/cairo_outputter.rb index <HASH>..<HASH> 100644 --- a/lib/barby/outputter/cairo_outputter.rb +++ b/lib/barby/outputter/cairo_outputter.rb @@ -1,3 +1,4 @@ +require 'barby/outputter' require 'cairo' require 'stringio' diff --git a/lib/barby/outputter/png_outputter.rb b/lib/barby/outputter/png_outputter.rb index <HASH>..<HASH> 100644 --- a/lib/barby/outputter/png_outputter.rb +++ b/lib/barby/outputter/png_outputter.rb @@ -1,3 +1,4 @@ +require 'barby/outputter' require 'png' module Barby
Require Outputter parent class for Png- and CairoOutputter
toretore_barby
train
rb,rb
a11e952f5e8556539433ac7f5cb0a1bb65271d93
diff --git a/config/environment.js b/config/environment.js index <HASH>..<HASH> 100644 --- a/config/environment.js +++ b/config/environment.js @@ -6,6 +6,9 @@ module.exports = function(environment /*, appConfig */) { 'Nunito:400,700', 'Nunito Sans:400,600,700' ], + moment: { + includeLocales: ['es', 'fr'], + }, EmberENV: { EXTEND_PROTOTYPES: { String: true, diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index <HASH>..<HASH> 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -52,10 +52,6 @@ module.exports = function(environment) { // ] } }, - moment: { - includeLocales: ['es', 'fr'], - includeTimezone: 'all', - }, EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build
Ship moment config to consuming app
ilios_common
train
js,js
d69d2e6a9194f5693a57db0250c8b88230f51c34
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # http://packaging.python.org/en/latest/tutorial.html#version - version='1.0.10', + version='1.0.11', url='https://github.com/mjirik/io3d', author='Miroslav Jirik', author_email='[email protected]',
version with fixed read of more then <I> files with no extension
mjirik_io3d
train
py
80b44deb1e0c9731a29dc5dab63464ea4f952f05
diff --git a/src/Koldy/Http/Mime.php b/src/Koldy/Http/Mime.php index <HASH>..<HASH> 100644 --- a/src/Koldy/Http/Mime.php +++ b/src/Koldy/Http/Mime.php @@ -932,6 +932,7 @@ class Mime 'wmx' => 'video/x-ms-wmx', 'wmz' => 'application/x-msmetafile', 'woff' => 'application/x-font-woff', + 'woff2' => 'application/font-woff2', 'wpd' => 'application/vnd.wordperfect', 'wpl' => 'application/vnd.ms-wpl', 'wps' => 'application/vnd.ms-works',
Added mime type for woff2 file type
koldy_framework
train
php
707253ef88924021526eafb48ae68184c48f11f0
diff --git a/main.js b/main.js index <HASH>..<HASH> 100644 --- a/main.js +++ b/main.js @@ -174,11 +174,9 @@ CrispCache.prototype.set = function (key, value, options, callback) { options = {}; } // Set default options - options = Object.assign({ - staleTtl: this._getDefaultStaleTtl(), - expiresTtl: this._getDefaultExpiresTtl(), - size: 1 - }, options); + 'staleTtl' in options || (options.staleTtl = this._getDefaultStaleTtl()); + 'expiresTtl' in options || (options.expiresTtl = this._getDefaultExpiresTtl()); + 'size' in options || (options.size = 1); if (options.expiresTtl > 0) { var cacheEntry = new CacheEntry({
Fix failing Node v0.x tests
four43_node-crisp-cache
train
js
6218d3b6ac9d2549354778e9fa5c68783d469b45
diff --git a/packages/api-generator/src/helpers/variables.js b/packages/api-generator/src/helpers/variables.js index <HASH>..<HASH> 100644 --- a/packages/api-generator/src/helpers/variables.js +++ b/packages/api-generator/src/helpers/variables.js @@ -192,8 +192,8 @@ const VSelect = { props: { parent: 'VueComponent', item: 'object', - on: 'object', - attrs: 'object', + on: 'object // Only needed when providing your own v-list-item', + attrs: 'object // Only needed when providing your own v-list-item', }, source: 'v-select', },
docs(VSelect): update information on the item slot on and attrs are only needed if the user has a root v-list-item in the item slot resolves #<I>
vuetifyjs_vuetify
train
js
0fc011d476d608a728d17299bd636fab8eb7aefa
diff --git a/src/foremast/awslambda/cloudwatch_log_event/cloudwatch_log_event.py b/src/foremast/awslambda/cloudwatch_log_event/cloudwatch_log_event.py index <HASH>..<HASH> 100644 --- a/src/foremast/awslambda/cloudwatch_log_event/cloudwatch_log_event.py +++ b/src/foremast/awslambda/cloudwatch_log_event/cloudwatch_log_event.py @@ -50,7 +50,7 @@ def create_cloudwatch_log_event(app_name, env, region, rules): LOG.critical('Filter name is required and no filter_name is defined!') raise InvalidEventConfiguration('Filter name is required and no filter_name is defined!') - if not filter_pattern: + if filter_pattern is None: LOG.critical('Filter pattern is required and no filter_pattern is defined!') raise InvalidEventConfiguration('Filter pattern is required and no filter_pattern is defined!')
fix: changed logic to accept blank filter pattern
foremast_foremast
train
py
c442cff7d51d8d2425ea5c44c9114ef91badcbaa
diff --git a/src/plugins/plugin.streaming.js b/src/plugins/plugin.streaming.js index <HASH>..<HASH> 100644 --- a/src/plugins/plugin.streaming.js +++ b/src/plugins/plugin.streaming.js @@ -12,8 +12,6 @@ export default function(Chart) { var realTimeScale = Chart.scaleService.getScaleConstructor('realtime'); - var refreshTimerID; - function removeOldData(scale, lower, data, datasetIndex) { var i, ilen; @@ -64,7 +62,7 @@ export default function(Chart) { id: 'streaming', afterInit: function(chart, options) { - refreshTimerID = setInterval(function() { + chart.refreshTimerID = setInterval(function() { onRefresh(chart); }, options.refresh); }, @@ -127,6 +125,8 @@ export default function(Chart) { }, destroy: function(chart) { + var refreshTimerID = chart.refreshTimerID; + if (refreshTimerID) { clearInterval(refreshTimerID); }
Make each chart keep its refresh timer ID
nagix_chartjs-plugin-streaming
train
js
0bf100459fdd8f4aac4b6aa76103c853a0f2a50d
diff --git a/test/fixtures/es6-export.js b/test/fixtures/es6-export.js index <HASH>..<HASH> 100644 --- a/test/fixtures/es6-export.js +++ b/test/fixtures/es6-export.js @@ -4,4 +4,4 @@ export function exportTest() { export default function exportTestDefault() { return gettext('Hi from an ES6 export default!'); -} \ No newline at end of file +} diff --git a/test/fixtures/es6-import.js b/test/fixtures/es6-import.js index <HASH>..<HASH> 100644 --- a/test/fixtures/es6-import.js +++ b/test/fixtures/es6-import.js @@ -2,4 +2,4 @@ import exportTestDefault, { exportTest } from './es6-export'; const fromDefaultExport = exportTestDefault(); // should be ignored const fromExport = exportTest(); // should be ignored -gettext('Hi from ES6 file with import!'); \ No newline at end of file +gettext('Hi from ES6 file with import!');
Add new lines at the end of fixture files
rubenv_angular-gettext-tools
train
js,js
6e35626ec520db28fa2a3b5acd65107881a33c1d
diff --git a/riak/client/__init__.py b/riak/client/__init__.py index <HASH>..<HASH> 100644 --- a/riak/client/__init__.py +++ b/riak/client/__init__.py @@ -296,11 +296,9 @@ class RiakClient(RiakMapReduceChain, RiakClientOperations): Iterate through all of the connections and close each one. """ if self._http_pool is not None: - for item in self._http_pool: - self._http_pool.delete_element(item) + self._http_pool.clear() if self._pb_pool is not None: - for item in self._pb_pool: - self._pb_pool.delete_element(item) + self._pb_pool.clear() def _create_node(self, n): if isinstance(n, RiakNode):
Use built-in pool clear() method instead of explicitly iterating on client close()
basho_riak-python-client
train
py
8a40d7e8cf9372953fec673ac8119b674d3e4c98
diff --git a/src/Admin/Appearance/Widgets.php b/src/Admin/Appearance/Widgets.php index <HASH>..<HASH> 100644 --- a/src/Admin/Appearance/Widgets.php +++ b/src/Admin/Appearance/Widgets.php @@ -165,9 +165,11 @@ class Widgets add_filter('use_widgets_block_editor', '__return_false'); } - if ($GLOBALS['pagenow'] === 'widgets.php') { - BlockEditor::set($this->editor); - } + add_action('admin_init', function (){ + if ($GLOBALS['pagenow'] === 'widgets.php') { + BlockEditor::set($this->editor); + } + }); } /**
Fix warning ErrorException (E_WARNING) Cannot modify header information - headers already sent by (output started at [...]web/app/mu-plugins/intervention/src/Admin/Appearance/Widgets.php:<I>)
soberwp_intervention
train
php
e105b26fa6a62d36f553ff9c02a41b4da2768e1c
diff --git a/pusher/notification_client.py b/pusher/notification_client.py index <HASH>..<HASH> 100644 --- a/pusher/notification_client.py +++ b/pusher/notification_client.py @@ -20,7 +20,7 @@ GCM_TTL = 241920 class NotificationClient(Client): def __init__( self, app_id, key, secret, ssl=True, host=None, port=None, - timeout=5, cluster=None, json_encoder=None, json_decoder=None, + timeout=30, cluster=None, json_encoder=None, json_decoder=None, backend=None, **backend_options): super(NotificationClient, self).__init__( app_id, key, secret, ssl, host, port, timeout, cluster,
bump notification_client timeout to <I>s
pusher_pusher-http-python
train
py
79d12f7679f651cf9135c1b89337d0ce0bea7f8b
diff --git a/src/FlexiPeeHP/FlexiBeeRO.php b/src/FlexiPeeHP/FlexiBeeRO.php index <HASH>..<HASH> 100644 --- a/src/FlexiPeeHP/FlexiBeeRO.php +++ b/src/FlexiPeeHP/FlexiBeeRO.php @@ -291,7 +291,8 @@ class FlexiBeeRO extends \Ease\Brick /** * SetUp Object to be ready for connect * - * @param array $options Object Options + * @param array $options Object Options (company,url,user,password,evidence, + * prefix,debug) */ public function setUp($options = []) { @@ -329,6 +330,9 @@ class FlexiBeeRO extends \Ease\Brick if (isset($options['prefix'])) { $this->setPrefix($options['prefix']); } + if (isset($options['debug'])) { + $this->debug = $options['debug']; + } } /**
Debug Added to FlexiBeeRO class accepted options
Spoje-NET_FlexiPeeHP
train
php
e769f33cd31eadf790aad0637aedb01092ff19b0
diff --git a/src/components/MultiSelect/FilterableMultiSelect.js b/src/components/MultiSelect/FilterableMultiSelect.js index <HASH>..<HASH> 100644 --- a/src/components/MultiSelect/FilterableMultiSelect.js +++ b/src/components/MultiSelect/FilterableMultiSelect.js @@ -86,6 +86,11 @@ export default class FilterableMultiSelect extends React.Component { * Initialize the component with an open(`true`)/closed(`false`) menu. */ open: PropTypes.bool, + + /** + * Callback function for translating ListBoxMenuIcon SVG title + */ + translateWithId: PropTypes.func, }; static getDerivedStateFromProps({ open }, state) { @@ -221,6 +226,7 @@ export default class FilterableMultiSelect extends React.Component { light, invalid, invalidText, + translateWithId, } = this.props; const className = cx( `${prefix}--multi-select`, @@ -281,7 +287,10 @@ export default class FilterableMultiSelect extends React.Component { {inputValue && isOpen && ( <ListBox.Selection clearSelection={this.clearInputValue} /> )} - <ListBox.MenuIcon isOpen={isOpen} /> + <ListBox.MenuIcon + isOpen={isOpen} + translateWithId={translateWithId} + /> </ListBox.Field> {isOpen && ( <ListBox.Menu>
fix(multi-select): introduce translateWithId (#<I>) Fixes #<I>.
carbon-design-system_carbon-components-react
train
js
3bec239f7c9c62924fd3b16df978a4c970ce43b3
diff --git a/src/parse.js b/src/parse.js index <HASH>..<HASH> 100644 --- a/src/parse.js +++ b/src/parse.js @@ -81,6 +81,7 @@ Parse.register('group', require('./transformers/group')); Parse.register('spec', require('./transformers/spec')); Parse.register('date', require('./transformers/date')); Parse.register('bool', require('./transformers/bool')); +Parse.register('number', require('./transformers/number')); Parse.register('base64', require('./transformers/base64')); Parse.register('multilingual', require('./transformers/multilingual')); Parse.register('stripPrefix', require('./transformers/stripPrefix'));
[number] Enable NumberTransformer
ambassify_parse-js
train
js
5d5aa9edf5f89b8d1523aeb10198323d521bd572
diff --git a/src/Taxonomy.php b/src/Taxonomy.php index <HASH>..<HASH> 100644 --- a/src/Taxonomy.php +++ b/src/Taxonomy.php @@ -76,12 +76,12 @@ class Taxonomy { /** * Create a new term in a specific vocabulary * - * @param string $name - * The name of the term - * * @param int $vid * The Vocabulary ID in which to add the term * + * @param string $name + * The name of the term + * * @param int $parent * The ID of the parent term if it is a child * @@ -93,8 +93,8 @@ class Taxonomy { * * @thrown Illuminate\Database\Eloquent\ModelNotFoundException */ - public function createTerm($name, $vid, $parent = 0, $weight = 0) { - if ($vocabulary = $this->vocabulary->findOrFail($id);) { + public function createTerm($vid, $name, $parent = 0, $weight = 0) { + if ($vocabulary = $this->vocabulary->findOrFail($id)) { $term = [ 'name' => $name, 'vocabulary_id' => $vid,
Removed trailing ; in if
DevFactoryCH_taxonomy
train
php
28cd22952632ba0e0bc4d37abfd68046348536bd
diff --git a/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java b/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java +++ b/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java @@ -148,7 +148,7 @@ public enum OGlobalConfiguration { // ENVIRONMENT "memory.directMemory.preallocate", "Preallocate amount of direct memory which is needed for the disk cache", Boolean.class, - true), + false), DIRECT_MEMORY_TRACK_MODE( "memory.directMemory.trackMode",
chore: disabled memory pre-allocation
orientechnologies_orientdb
train
java
207990035a9675a8f2fc34b61c88b86d1b566319
diff --git a/client/state/jetpack-connect/actions.js b/client/state/jetpack-connect/actions.js index <HASH>..<HASH> 100644 --- a/client/state/jetpack-connect/actions.js +++ b/client/state/jetpack-connect/actions.js @@ -378,6 +378,11 @@ export function isUserConnected( siteId, siteIsOnSitesList ) { } } ) .catch( error => { + dispatch( + recordTracksEvent( 'calypso_jpc_siterequest_failure', { + error: error, + } ) + ); dispatch( { type: SITE_REQUEST_FAILURE, siteId,
Jetpack Connect: Add tracks to site request failure (#<I>)
Automattic_wp-calypso
train
js
3a394b6ad2e53e2ab33ca21bdd45ba652f85fe95
diff --git a/packages/neos-ui/src/Containers/Modals/SelectNodeType/index.js b/packages/neos-ui/src/Containers/Modals/SelectNodeType/index.js index <HASH>..<HASH> 100644 --- a/packages/neos-ui/src/Containers/Modals/SelectNodeType/index.js +++ b/packages/neos-ui/src/Containers/Modals/SelectNodeType/index.js @@ -195,7 +195,7 @@ export default class SelectNodeType extends PureComponent { return ( <Dialog actions={[this.renderCancelAction()]} - title={[this.renderSelectNodeTypeDialogHeader()]} + title={this.renderSelectNodeTypeDialogHeader()} onRequestClose={this.handleCancel} isOpen style="wide"
Bugfix don't pass the create dialog title as array
neos_neos-ui
train
js
5fa63c50f07482b652931506082208b94092a6b0
diff --git a/haproxy_exporter.go b/haproxy_exporter.go index <HASH>..<HASH> 100644 --- a/haproxy_exporter.go +++ b/haproxy_exporter.go @@ -382,7 +382,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) (up float64) { info, err := e.parseInfo(infoReader) if err != nil { - level.Debug(e.logger).Log("msg", "Faild parsing show info", "err", err) + level.Debug(e.logger).Log("msg", "Failed parsing show info", "err", err) } else { ch <- prometheus.MustNewConstMetric(haproxyInfo, prometheus.GaugeValue, 1, info.ReleaseDate, info.Version) }
Correct a typo in haproxy_exporter.go (#<I>)
prometheus_haproxy_exporter
train
go
929614450ff8ec467d440a892bd30bf4e882af7c
diff --git a/tests/test_aggregator.py b/tests/test_aggregator.py index <HASH>..<HASH> 100644 --- a/tests/test_aggregator.py +++ b/tests/test_aggregator.py @@ -182,6 +182,6 @@ def test_issue_61(): latex = r'\frac{x + 4}{x + \frac{123 \left(\sqrt{x} + 5\right)}{x + 4} - 8}' expected = [r'\frac', ['x', '+', '4'], ['x', '+', - r'\frac', ['123', [r'\left', '(', [r'\sqrt', ['x'], '+', '5'], r'\right', ')']], ['x', '+', '4'] - , '-', '8']] + r'\frac', ['123', [r'\left', '(', [r'\sqrt', ['x'], '+', '5'], r'\right', ')']], ['x', '+', '4'], + '-', '8']] assert expected == list(aggregate(latex))
Make work for pycodestyle
roniemartinez_latex2mathml
train
py
a1bfde67510d2a8b114279cf93762685f9483e3f
diff --git a/modules/custom/d_geysir/src/Utility/ModalDetector.php b/modules/custom/d_geysir/src/Utility/ModalDetector.php index <HASH>..<HASH> 100644 --- a/modules/custom/d_geysir/src/Utility/ModalDetector.php +++ b/modules/custom/d_geysir/src/Utility/ModalDetector.php @@ -46,12 +46,21 @@ class ModalDetector implements ModalDetectorInterface { public function isGeysirModalRequest(): bool { try { $controller = $this->resolver->getController($this->request); + $is_modal = ( + // Modal window. + $this->request->query->get('_wrapper_format') === 'drupal_modal' || + ( + // Ajax inside modal window. + $this->request->query->get('_wrapper_format') === 'drupal_ajax' && + $this->request->request->get('_triggering_element_name') !== 'op' + ) + ); if (isset($controller[0])) { - return $controller[0] instanceof GeysirModalController; + return $controller[0] instanceof GeysirModalController && $is_modal; } - return $controller instanceof GeysirModalController; + return $controller instanceof GeysirModalController && $is_modal; } catch (\LogicException $exception) { return FALSE;
Issue #<I> by gpietrzak: (v <I>) Form buttons broken after paragraph save
droptica_droopler
train
php
66888ad0e11217443a868b2d77dfec696343828a
diff --git a/lib/cli/parse.js b/lib/cli/parse.js index <HASH>..<HASH> 100644 --- a/lib/cli/parse.js +++ b/lib/cli/parse.js @@ -153,13 +153,19 @@ module.exports = function parse(options, callback) { }; function firstErrorDescription(node) { + if (!node.hasError) return null; + if (node.type === 'ERROR') { return "ERROR " + pointString(node.startPosition) + " - " + pointString(node.endPosition); } - const {namedChildren} = node; - for (let i = 0, length = namedChildren.length; i < length; i++) { - const description = firstErrorDescription(namedChildren[i]); + if (node.isMissing()) { + return "MISSING " + node.type + " " + pointString(node.startPosition) + " - " + pointString(node.endPosition); + } + + const {children} = node; + for (let i = 0, length = children.length; i < length; i++) { + const description = firstErrorDescription(children[i]); if (description) return description; } }
Fix first error description when there are missing tokens
tree-sitter_tree-sitter-cli
train
js
b329881529e63fd28db0dede98b4f58361ea3d7f
diff --git a/library/CM/FormField/Textarea.js b/library/CM/FormField/Textarea.js index <HASH>..<HASH> 100644 --- a/library/CM/FormField/Textarea.js +++ b/library/CM/FormField/Textarea.js @@ -8,6 +8,7 @@ var CM_FormField_Textarea = CM_FormField_Text.extend({ events: { 'blur [contenteditable]': function() { this.trigger('blur'); + this.triggerChange(); }, 'focus [contenteditable]': function() { this.trigger('focus'); @@ -87,6 +88,12 @@ var CM_FormField_Textarea = CM_FormField_Text.extend({ this.setValue(''); }, + disableTriggerChangeOnInput: function() { + this.delegateEvents( + _(this.events).omit('input [contenteditable]') + ); + }, + /** * @param {String} text * @returns {string}
Introduce "disableTriggerChangeOnInput" for Textarea, trigger change on "blur" event
cargomedia_cm
train
js
538a80893e6e7494f57f324310aab2e24472d705
diff --git a/spec/helpers/fortitude_rails_helpers.rb b/spec/helpers/fortitude_rails_helpers.rb index <HASH>..<HASH> 100644 --- a/spec/helpers/fortitude_rails_helpers.rb +++ b/spec/helpers/fortitude_rails_helpers.rb @@ -9,7 +9,6 @@ module Spec out = [ "gem 'fortitude', :path => '#{rails_server_project_root}'" ] - out << "gem 'i18n', '< 0.7.0'" if RUBY_VERSION =~ /^1\.8\./ out end
Try not spec'ing any i<I>n gem version at all on the server itself.
ageweke_fortitude
train
rb
c5939e6fac666a464e8a9741321c7a9cf84bb663
diff --git a/mithril.js b/mithril.js index <HASH>..<HASH> 100644 --- a/mithril.js +++ b/mithril.js @@ -553,10 +553,11 @@ var m = (function app(window, undefined) { //routing var modes = {pathname: "", hash: "#", search: "?"}; - var redirect = function() {}, routeParams = {}, currentRoute; + var redirect = function() {}, routeParams, currentRoute; m.route = function() { //m.route() if (arguments.length === 0) return currentRoute; + //m.route(el, defaultRoute, routes) else if (arguments.length === 3 && type.call(arguments[1]) == STRING) { var root = arguments[0], defaultRoute = arguments[1], router = arguments[2]; redirect = function(source) { @@ -606,7 +607,10 @@ var m = (function app(window, undefined) { else $location[m.route.mode] = currentRoute } }; - m.route.param = function(key) {return routeParams[key]}; + m.route.param = function(key) { + if (!routeParams) throw new Error("You must call m.route(element, defaultRoute, routes) before calling m.route.param()") + return routeParams[key] + }; m.route.mode = "search"; function normalizeRoute(route) {return route.slice(modes[m.route.mode].length)} function routeByValue(root, router, path) {
show error message if m.route.param is called before m.route(el, defRoute, routes)
MithrilJS_mithril.js
train
js
778fd07ea84dbca5d886b84e30325a957ccbe5eb
diff --git a/src/Synapse/Mapper/AbstractMapper.php b/src/Synapse/Mapper/AbstractMapper.php index <HASH>..<HASH> 100644 --- a/src/Synapse/Mapper/AbstractMapper.php +++ b/src/Synapse/Mapper/AbstractMapper.php @@ -158,17 +158,20 @@ abstract class AbstractMapper implements LoggerAwareInterface return $this; } + /** + * Set up the hydrator and prototype of this mapper if not yet set + */ protected function initialize() { if ($this->initialized) { return; } - if (!is_object($this->prototype)) { + if (! is_object($this->prototype)) { $this->prototype = new ArrayObject; } - if (!$this->hydrator instanceof HydratorInterface) { + if (! $this->hydrator instanceof HydratorInterface) { $this->hydrator = new ArraySerializable; } @@ -221,6 +224,12 @@ abstract class AbstractMapper implements LoggerAwareInterface return new EntityIterator($entities); } + /** + * Execute the given query and return the result as an array of arrays + * + * @param PreparableSqlInterface $query Query to be executed + * @return array + */ protected function executeAndGetResultsAsArray(PreparableSqlInterface $query) { $statement = $this->getSqlObject()->prepareStatementForSqlObject($query);
Refs #<I> - Add missing DocBlocks and fix coding standards.
synapsestudios_synapse-base
train
php
30c18a34bf75413f02fee037d02acd845e423911
diff --git a/Command/DebugRouterCommand.php b/Command/DebugRouterCommand.php index <HASH>..<HASH> 100644 --- a/Command/DebugRouterCommand.php +++ b/Command/DebugRouterCommand.php @@ -8,6 +8,8 @@ use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\HttpKernel\Kernel; + class DebugRouterCommand extends Command { @@ -50,7 +52,14 @@ class DebugRouterCommand extends Command $router = $this->routers[$rname]; $collection = $router->getCollection(); - $table = new Table($output); + + $version = Kernel::VERSION_ID; + if ($version < 30000) { + $table = $this->getHelperSet()->get('table'); + } else { + $table = new Table($output); + } + $table->setHeaders(['Name', 'Pattern', 'Callback']); $rows = [];
Update DebugRouterCommand.php I get VERSION_ID from Kernel, hope this is a right way.
GeniusesOfSymfony_PubSubRouterBundle
train
php
ba914f01c2ca12e18a5fe69899c88f14f4b9b2ab
diff --git a/bin/fasta-subset.py b/bin/fasta-subset.py index <HASH>..<HASH> 100755 --- a/bin/fasta-subset.py +++ b/bin/fasta-subset.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -Given a set of FASTA sequence identifiers from sys.argv or in a file, read +Given a set of FASTA sequence identifiers from sys.argv and/or in a file, read FASTA from stdin, and print FASTA to stdout for the given sequence ids. """
Tiny change to docstring.
acorg_dark-matter
train
py
c359d3f95e903825f172aab81148bbf1ef29ef40
diff --git a/src/Component/Filter/StringFilter.php b/src/Component/Filter/StringFilter.php index <HASH>..<HASH> 100644 --- a/src/Component/Filter/StringFilter.php +++ b/src/Component/Filter/StringFilter.php @@ -53,18 +53,17 @@ class StringFilter implements FilterInterface } if (1 === count($fields)) { - $expression = $this->getExpression($expressionBuilder, $type, $fields[0], $value); - } else { - $expressions = []; + $dataSource->restrict($this->getExpression($expressionBuilder, $type, current($fields), $value)); - foreach ($fields as $field) { - $expressions[] = $this->getExpression($expressionBuilder, $type, $field, $value); - } + return; + } - $expression = $expressionBuilder->orX(...$expressions); + $expressions = []; + foreach ($fields as $field) { + $expressions[] = $this->getExpression($expressionBuilder, $type, $field, $value); } - $dataSource->restrict($expression); + $dataSource->restrict($expressionBuilder->orX(...$expressions)); } /**
[Grid] Decrease nesting level in StringFilter
Sylius_SyliusGridBundle
train
php
18e274369bcfd184fb1a1504e8ba427bdd48c82f
diff --git a/errors.go b/errors.go index <HASH>..<HASH> 100644 --- a/errors.go +++ b/errors.go @@ -14,6 +14,10 @@ type Error struct { } func (e Error) Error() string { + if e.Type == "genericError" { + return e.Message + } + return fmt.Sprintf("kite error %s - %s - %s", e.Type, e.Message, e.Code) }
kite/errors: return user errors as it is
koding_kite
train
go
b8b1d1c44c8d38110e7af5f43848e9da493eb3dc
diff --git a/restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/DialRecordingTest.java b/restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/DialRecordingTest.java index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/DialRecordingTest.java +++ b/restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/DialRecordingTest.java @@ -190,7 +190,7 @@ public class DialRecordingTest { } Thread.sleep(1000); wireMockRule.resetRequests(); - wireMockRule.resetMappings(); + //do not use this as it requires Java8 wireMockRule.resetMappings(); Thread.sleep(4000); }
removed resetMappings as it requires java8
RestComm_Restcomm-Connect
train
java
8fc23650046127fa96b9da805fd351dde7eb89b3
diff --git a/txkoji/task.py b/txkoji/task.py index <HASH>..<HASH> 100644 --- a/txkoji/task.py +++ b/txkoji/task.py @@ -163,7 +163,7 @@ class Task(Munch): return self.params[0] # params[0] is the source URL for these tasks: if self.method not in ('build', 'buildArch', 'buildContainer', - 'buildMaven', 'buildSRPMFromSCM'): + 'buildMaven', 'buildSRPMFromSCM', 'maven'): return None # (I wish there was a better way to do this.) source = self.params[0] @@ -225,7 +225,7 @@ class Task(Munch): @property def target(self): - if self.method in ('build', 'buildContainer'): + if self.method in ('build', 'buildContainer', 'maven'): return self.params[1] if self.method == 'buildNotification': if self.params[2]:
task: add .target and .package support for maven tasks Populate .target and .package for maven tasks
ktdreyer_txkoji
train
py
17c23f04bc5cd504619a414cffde2089d83d4d93
diff --git a/apiserver/facades/client/applicationoffers/state.go b/apiserver/facades/client/applicationoffers/state.go index <HASH>..<HASH> 100644 --- a/apiserver/facades/client/applicationoffers/state.go +++ b/apiserver/facades/client/applicationoffers/state.go @@ -62,7 +62,6 @@ type Backend interface { OfferConnections(string) ([]OfferConnection, error) SpaceByName(string) (Space, error) User(names.UserTag) (User, error) - UserPermission(subject names.UserTag, target names.Tag) (permission.Access, error) CreateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error UpdateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error
Remove the duplicated function The function UserPermission was duplicated in both commoncrossmodel.Backend and Backend, which emits a warning. Static analysis should have picked this up, but for some reason it hasn't. This fixes the issue, but we need to work out why it wasn't caught.
juju_juju
train
go
dfe7226bb4cc25a48972822c587f56ebf1fb1e46
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,9 +16,9 @@ import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath(os.path.join('..', '..'))) sys.path.insert(0, os.path.abspath('..')) +import pulsar # -- General configuration ----------------------------------------------------- @@ -50,9 +50,9 @@ copyright = u'2014, Galaxy Project' # built documents. # # The short X.Y version. -version = '0.2.0' +version = pulsar.__version__ # The full version, including alpha/beta/rc tags. -release = '0.2.0' +release = pulsar.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Dynamically set pulsar version from docs.
galaxyproject_pulsar
train
py
ee5d97578317a17f17345aae78f264909711bb58
diff --git a/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php b/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php index <HASH>..<HASH> 100644 --- a/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php +++ b/tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php @@ -409,20 +409,4 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest ' ); } - - public function testFileLabelAccessibility() - { - $form = $this->factory->createNamed('file', 'name'); - $html = $this->renderRow($form->createView()); - - $this->assertMatchesXpath($html, -'/div - [ - ./label[@for="name"] - /following-sibling::input[@id="name"][@type="file"] - ] -' - ); - } - }
[Form] Remove a test which is no more relevant (after recent FileType refactoring)
symfony_symfony
train
php
52d806041b7544a6e302427769b5b06a70bcd576
diff --git a/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/html5/stylesandsemantics/Summary.java b/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/html5/stylesandsemantics/Summary.java index <HASH>..<HASH> 100644 --- a/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/html5/stylesandsemantics/Summary.java +++ b/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/html5/stylesandsemantics/Summary.java @@ -75,6 +75,7 @@ public class Summary extends AbstractHtml { * @since 1.0.0 */ protected void init() { + // to override and use this method } }
Code formatting improvement Added needful comment in empty method body
webfirmframework_wff
train
java
05df82e96301a7628b5b58428c5f23795f2b81a0
diff --git a/otsrdflib/ots.py b/otsrdflib/ots.py index <HASH>..<HASH> 100644 --- a/otsrdflib/ots.py +++ b/otsrdflib/ots.py @@ -29,7 +29,7 @@ class OrderedTurtleSerializer(TurtleSerializer): # Instance order: self.sorters = [ - ('.*?([0-9]+)$', lambda x: int(x[0])) + ('.*?/[A-Za-z]+([0-9]+)$', lambda x: int(x[0])) ] # Order of instances:
Fix so default sorter doesn't match uuids
scriptotek_otsrdflib
train
py