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
7b0a0e8e0820be36747b4f89c69c32281aac5452
diff --git a/lib/easemob/token.rb b/lib/easemob/token.rb index <HASH>..<HASH> 100644 --- a/lib/easemob/token.rb +++ b/lib/easemob/token.rb @@ -1,7 +1,9 @@ module Easemob module Token def self.refresh - res = Easemob.do_post('token', grant_type: 'client_credentials', client_id: Easemob.client_id, client_secret: Easemob.client_secret) + res = Easemob.httprbs.with do |http| + http.post "#{Easemob.head_url}/token", json: { grant_type: 'client_credentials', client_id: Easemob.client_id, client_secret: Easemob.client_secret } + end raise "Failed to refresh easemob token: #{res}" unless res.code == 200 write_to_store(JSON.parse(res.to_s)) read_from_store
do_post will be used as other RESTful calling methods.
bayetech_easemob
train
rb
81202eeab132425b2b4b711d5c3dc3feac6066c5
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,16 @@ from astropy.sphinx.conf import * # 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('..')) +# sys.path.insert(0, os.path.abspath('..')) +# IMPORTANT: the above commented section was generated by sphinx-quickstart, but +# is *NOT* appropriate for astropy or Astropy affiliated packages. It is left +# commented oout with this explanation to make it clear why this should not be +# done. If the sys.path entry above is added, when the astropy.sphinx.conf +# import occurs, it will import the *source* version of astropy instead of the +# version installed (if invoked as "make html" or directly with sphinx), or the +# version in the build directory (if " pythonsetup.py build_sphinx" is used). +# Thus, any C-extensions that are needed to build the documentation will *not* +# be accessible, and the documentation will not build correctly. # -- General configuration -----------------------------------------------------
fixed conf.py to not insert source dir into sys.path
zblz_naima
train
py
f8fee421819e3c272e1c20890da7c90b4da971ad
diff --git a/lxc_template.go b/lxc_template.go index <HASH>..<HASH> 100755 --- a/lxc_template.go +++ b/lxc_template.go @@ -88,8 +88,8 @@ lxc.cap.drop = audit_control audit_write mac_admin mac_override mknod net_raw se {{if .Config.Memory}} lxc.cgroup.memory.limit_in_bytes = {{.Config.Memory}} lxc.cgroup.memory.soft_limit_in_bytes = {{.Config.Memory}} -{{with $ramSwap := getMemorySwap .Config}} -lxc.cgroup.memory.memsw.limit_in_bytes = {{$ramSwap}} +{{with $memSwap := getMemorySwap .Config}} +lxc.cgroup.memory.memsw.limit_in_bytes = {{$memSwap}} {{end}} {{end}} `
Missed a rename
moby_moby
train
go
f6eb2fa26935b3cfe7857e519c81c077806413a6
diff --git a/lambdaJSON.py b/lambdaJSON.py index <HASH>..<HASH> 100644 --- a/lambdaJSON.py +++ b/lambdaJSON.py @@ -2,6 +2,10 @@ try: import ujson as json except: import json from ast import literal_eval as eval +ntypes = ( (hasattr(__builtins__, 'long') + and (bool, int, float, complex, long)) + or (bool, int, float, complex)) + flatten = lambda obj: (isinstance(obj, bytes) and (b'bytes://'+obj).decode('utf8') or isinstance(obj, tuple) @@ -11,9 +15,7 @@ flatten = lambda obj: (isinstance(obj, bytes) or isinstance(obj, list) and [flatten(i) for i in obj] or isinstance(obj, dict) - and {(lambda x: isinstance(x, (hasattr(__builtins__, 'long') - and (bool, int, float, complex, long)) - or (bool, int, float, complex)) + and {(lambda x: isinstance(x, ntypes) and str(type(x))[8:-2]+'://'+str(x) or flatten(x))(i):flatten(obj[i]) for i in obj} or obj)
Moved 'long' type existence determination outside of function to increase speed.
pouya-eghbali_lambdaJSON
train
py
6fdd4ab02f90d72f61f65d15547369a7e894315f
diff --git a/lib/utils/OnepayRequestBuilder.php b/lib/utils/OnepayRequestBuilder.php index <HASH>..<HASH> 100644 --- a/lib/utils/OnepayRequestBuilder.php +++ b/lib/utils/OnepayRequestBuilder.php @@ -42,7 +42,7 @@ namespace Transbank\Onepay; $shoppingCart->getItems(), OnepayBase::getCallBackUrl(), $channel, - OnepayBase::getAppScheme()); # Channel, can be 'web' or 'mobile' for now + OnepayBase::getAppScheme()); # Channel, can be 'WEB', 'MOBILE' or 'APP' self::setKeys($request, $options); return OnepaySignUtil::getInstance()->sign($request, $options->getSharedSecret());
Add APP as posible value of channel code comment about this
TransbankDevelopers_transbank-sdk-php
train
php
6a0fb75d5a65c347359fec01084239e27c0a9b4d
diff --git a/Kwf/Media/Image.php b/Kwf/Media/Image.php index <HASH>..<HASH> 100644 --- a/Kwf/Media/Image.php +++ b/Kwf/Media/Image.php @@ -474,7 +474,7 @@ class Kwf_Media_Image $im = self::_processCommonImagickSettings($im); } if (isset($size['rotate']) && $size['rotate']) { - $im->rotateImage('#FFF', $size['rotate']); + $im->rotateImage(new ImagickPixel('#FFF'), $size['rotate']); } $factor = pow(2, $preScale['factor']); //1 if factor==0
Fix rotateImage with oloder imagick versions where background was required a ImagickPixel
koala-framework_koala-framework
train
php
34a1d7eeea7e8c07d759843ad03b4ad59acd2e4a
diff --git a/src/Bluz/Mailer/Mailer.php b/src/Bluz/Mailer/Mailer.php index <HASH>..<HASH> 100644 --- a/src/Bluz/Mailer/Mailer.php +++ b/src/Bluz/Mailer/Mailer.php @@ -69,6 +69,7 @@ class Mailer public function create() { $mail = new \PHPMailer(); + $mail->WordWrap = 920; // RFC 2822 Compliant for Max 998 characters per line $fromEmail = $this->options['from']['email']; $fromName = isset($this->options['from']['name']) ? $this->options['from']['name'] : '';
Fixed Mailer for RFC <I> Compliant for Max <I> characters per line
bluzphp_framework
train
php
a0442ab0536feda4e9645119c6e2c13c269dd530
diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/CommentEntityManager.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/CommentEntityManager.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/CommentEntityManager.java +++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/CommentEntityManager.java @@ -31,7 +31,7 @@ public class CommentEntityManager extends AbstractEntityManager<CommentEntity> { public void delete(CommentEntity commentEntity) { checkHistoryEnabled(); - super.delete(commentEntity); + super.delete(commentEntity, false); Comment comment = (Comment) commentEntity; if (getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { @@ -52,7 +52,7 @@ public class CommentEntityManager extends AbstractEntityManager<CommentEntity> { public void insert(CommentEntity commentEntity) { checkHistoryEnabled(); - super.insert(commentEntity); + super.insert(commentEntity, false); Comment comment = (Comment) commentEntity; if (getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Fixing CommentEventsTest
Activiti_Activiti
train
java
3bd03bb1a297afd546fc1e49d74b1ec11159c357
diff --git a/.eslintrules/valid-jsdoc.js b/.eslintrules/valid-jsdoc.js index <HASH>..<HASH> 100644 --- a/.eslintrules/valid-jsdoc.js +++ b/.eslintrules/valid-jsdoc.js @@ -228,7 +228,7 @@ module.exports = { functionData = fns.pop(), params = Object.create(null); let hasReturns = false, - hasChainable = false, + hasGpfChainable = false, hasConstructor = false, isInterface = false, isOverride = false, @@ -320,8 +320,8 @@ module.exports = { isInterface = true; break; - case "chainable": - hasChainable = true; + case "gpf": + hasGpfChainable = tag.description === ":chainable"; break; // no default @@ -339,7 +339,7 @@ module.exports = { }); // check for functions missing @returns - if (!isOverride && !hasReturns && !hasChainable && !hasConstructor && !isInterface && + if (!isOverride && !hasReturns && !hasGpfChainable && !hasConstructor && !isInterface && node.parent.kind !== "get" && node.parent.kind !== "constructor" && node.parent.kind !== "set" && !isTypeClass(node)) { if (requireReturn || functionData.returnPresent) {
Prefix jsdoc extensions with gpf
ArnaudBuchholz_gpf-js
train
js
49ed2493651431bef9473b83216dcef02466ddaa
diff --git a/src/CliConfig.php b/src/CliConfig.php index <HASH>..<HASH> 100644 --- a/src/CliConfig.php +++ b/src/CliConfig.php @@ -9,7 +9,7 @@ declare(strict_types=1); namespace SimpleComplex\Config; -use SimpleComplex\Utils\CliCommandInterface; +use SimpleComplex\Utils\Interfaces\CliCommandInterface; use SimpleComplex\Utils\CliEnvironment; use SimpleComplex\Utils\CliCommand; use SimpleComplex\Utils\Dependency;
Utils interfaces moved to sub namespace.
simplecomplex_php-config
train
php
9324d5c1a14193aef9cd46cd81574ba9e9d4a979
diff --git a/query/stdlib/testing/end_to_end_test.go b/query/stdlib/testing/end_to_end_test.go index <HASH>..<HASH> 100644 --- a/query/stdlib/testing/end_to_end_test.go +++ b/query/stdlib/testing/end_to_end_test.go @@ -134,6 +134,8 @@ var skipTests = map[string]string{ "drop_referenced": "need to support known errors in new test framework (https://github.com/influxdata/flux/issues/536)", "yield": "yield requires special test case (https://github.com/influxdata/flux/issues/535)", "rowfn_with_import": "imported libraries are not visible in user-defined functions (https://github.com/influxdata/flux/issues/1000)", + + "window_group_mean_ungroup": "window trigger optimization modifies sort order of its output tables (https://github.com/influxdata/flux/issues/1067)", } func TestFluxEndToEnd(t *testing.T) {
test(stdlib): skip failing window test due to new trigger optimization (#<I>)
influxdata_influxdb
train
go
4d8323a9add05199c6025533b4a7f5225c2f4f5a
diff --git a/Event/SendMessageEvent.php b/Event/SendMessageEvent.php index <HASH>..<HASH> 100644 --- a/Event/SendMessageEvent.php +++ b/Event/SendMessageEvent.php @@ -21,18 +21,21 @@ class SendMessageEvent extends Event private $object; private $receiver; private $sender; + private $users; public function __construct( - AbstractRoleSubject $receiver, User $sender, $content, - $object + $object, + AbstractRoleSubject $receiver = null, + array $users = array() ) { - $this->receiver = $receiver; $this->sender = $sender; $this->content = $content; $this->object = $object; + $this->receiver = $receiver; + $this->users = $users; } public function getContent() @@ -74,4 +77,14 @@ class SendMessageEvent extends Event { $this->sender = $sender; } + + public function getUsers() + { + return $this->users; + } + + public function setUsers(array $users) + { + $this->users = $users; + } } diff --git a/Manager/RoleManager.php b/Manager/RoleManager.php index <HASH>..<HASH> 100644 --- a/Manager/RoleManager.php +++ b/Manager/RoleManager.php @@ -715,7 +715,7 @@ class RoleManager $this->dispatcher->dispatch( 'claroline_message_sending', 'SendMessage', - array($ars, $sender, $content, $object) + array($sender, $content, $object, $ars) ); }
[CoreBundle] Message sending event can receive an array of users
claroline_Distribution
train
php,php
a423a15f7225d8ae8a8e2eb4e20db50b861c6c61
diff --git a/src/Resource.js b/src/Resource.js index <HASH>..<HASH> 100644 --- a/src/Resource.js +++ b/src/Resource.js @@ -477,7 +477,8 @@ Resource.prototype._xhrOnLoad = function () { var xhr = this.xhr, status = xhr.status !== undefined ? xhr.status : 200; //XDR has no `.status`, assume 200. - if (status === 200 || status === 204) { + // status can be 0 when using the file:// protocol, also check if a response was found + if (status === 200 || status === 204 || (status === 0 && xhr.responseText.length > 0)) { // if text, just return it if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) { this.data = xhr.responseText;
Fix when using Cordova, which uses file:// to load resources Because the status of an xhr request can be 0 when loading local files, I’ve updated the logic. Also the length of the response is checked, to make sure a valid response was found.
englercj_resource-loader
train
js
a0458abe949946c592401d1dc5b5bcc3a9bcd6d7
diff --git a/src/Mollie/API/Object/Method.php b/src/Mollie/API/Object/Method.php index <HASH>..<HASH> 100644 --- a/src/Mollie/API/Object/Method.php +++ b/src/Mollie/API/Object/Method.php @@ -31,11 +31,12 @@ */ class Mollie_API_Object_Method { - const IDEAL = "ideal"; - const PAYSAFECARD = "paysafecard"; - const CREDITCARD = "creditcard"; - const MISTERCASH = "mistercash"; - const PAYPAL = "paypal"; + const IDEAL = "ideal"; + const PAYSAFECARD = "paysafecard"; + const CREDITCARD = "creditcard"; + const MISTERCASH = "mistercash"; + const BANKTRANSFER = "banktransfer"; + const PAYPAL = "paypal"; /** * Id of the payment method.
Added BANKTRANSFER method constant.
mollie_mollie-api-php
train
php
3144fcda21946f96cb88453fa128cc1236553ee2
diff --git a/multilingual/translation.py b/multilingual/translation.py index <HASH>..<HASH> 100644 --- a/multilingual/translation.py +++ b/multilingual/translation.py @@ -118,7 +118,7 @@ def getter_generator(field_name, short_description): try: return getattr(self.get_translation(language_id_or_code), field_name) except TranslationDoesNotExist: - return "-translation-not-available-" + return None get_translation_field.short_description = short_description return get_translation_field diff --git a/testproject/articles/models.py b/testproject/articles/models.py index <HASH>..<HASH> 100644 --- a/testproject/articles/models.py +++ b/testproject/articles/models.py @@ -195,7 +195,7 @@ Test models for the multilingual library. >>> set_default_language(2) >>> c_n3 = Category.objects.create(name='nowa kategoria 2') >>> (c_n3.name, c_n3.name_en, c_n3.name_pl) -('nowa kategoria 2', '-translation-not-available-', 'nowa kategoria 2') +('nowa kategoria 2', None, 'nowa kategoria 2') """
Removed the "translation-not-available" placeholder. From now on you will simply get None when asking for nonexistant translations. git-svn-id: <URL>
ojii_django-multilingual-ng
train
py,py
2d427ed89e4a561b443dcf18b356ac3e3b5137f1
diff --git a/lib/webrat/selenium/selenium_session.rb b/lib/webrat/selenium/selenium_session.rb index <HASH>..<HASH> 100644 --- a/lib/webrat/selenium/selenium_session.rb +++ b/lib/webrat/selenium/selenium_session.rb @@ -21,6 +21,13 @@ module Webrat def initialize(*args) # :nodoc: end + def simulate + end + + def automate + yield + end + def visit(url) selenium.open(url) end
simualte and automate need to be there in SeleniumSession too
brynary_webrat
train
rb
f1ec4cbc404abef88496587e98324ab134a5419f
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java index <HASH>..<HASH> 100644 --- a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java +++ b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java @@ -232,7 +232,7 @@ import java.util.Set; } @Override public void setColorFilter(@Nullable ColorFilter colorFilter) { - throw new UnsupportedOperationException("Use addColorFilter instead."); + Log.w(L.TAG, "Use addColorFilter instead."); } /**
Warn instead of crash if setColorFilter is used. This causes reusing LottieAnimationView with non-Lottie drawables to crash pre-Lollipop Fixes #<I>
airbnb_lottie-android
train
java
54d45f5d6e99acb98dfd436a597f94f62cbfa41c
diff --git a/src/FactoryAwareTrait.php b/src/FactoryAwareTrait.php index <HASH>..<HASH> 100644 --- a/src/FactoryAwareTrait.php +++ b/src/FactoryAwareTrait.php @@ -18,7 +18,7 @@ trait FactoryAwareTrait * * @since [*next-version*] * - * @var FactoryInterface + * @var FactoryInterface|null */ protected $factory; @@ -27,7 +27,7 @@ trait FactoryAwareTrait * * @since [*next-version*] * - * @return FactoryInterface The factory instance, if any. + * @return FactoryInterface|null The factory instance, if any. */ protected function _getFactory() {
Added missing `null` type possibility in docs
Dhii_factory-base
train
php
eb9b087403cef87a8c36a9019a44e8a9704dbfe1
diff --git a/tq/verify.go b/tq/verify.go index <HASH>..<HASH> 100644 --- a/tq/verify.go +++ b/tq/verify.go @@ -47,8 +47,13 @@ func verifyUpload(c *lfsapi.Client, remote string, t *Transfer) error { tracerx.Printf("tq: verify %s attempt #%d (max: %d)", t.Oid[:7], i, mv) var res *http.Response + if t.Authenticated { + res, err = c.Do(req) + } else { + res, err = c.DoWithAuth(remote, req) + } - if res, err = c.Do(req); err != nil { + if err != nil { tracerx.Printf("tq: verify err: %+v", err.Error()) } else { err = res.Body.Close()
tq/verify: make verify request with authorization if required
git-lfs_git-lfs
train
go
f00e231c7b0290f6f64ee543b8df2ee389a0f34c
diff --git a/frontend/app/controllers/comable/orders_controller.rb b/frontend/app/controllers/comable/orders_controller.rb index <HASH>..<HASH> 100644 --- a/frontend/app/controllers/comable/orders_controller.rb +++ b/frontend/app/controllers/comable/orders_controller.rb @@ -89,19 +89,22 @@ module Comable def order_params_for_delivery params.require(:order).permit( - ship_address_attributes: [ - # TODO: Standardize - :family_name, - :first_name, - :zip_code, - :state_name, - :city, - :detail, - :phone_number - ] + ship_address_attributes: address_attributes ) end + def address_attributes + [ + :family_name, + :first_name, + :zip_code, + :state_name, + :city, + :detail, + :phone_number + ] + end + def order_invalid flash[:alert] = I18n.t('comable.orders.failure') redirect_to comable.cart_path
rubocop: Refactor the methods
appirits_comable
train
rb
a309c3ff81df521c2d2de86cbb29cdd8380d1d4d
diff --git a/src/ClientEngine.js b/src/ClientEngine.js index <HASH>..<HASH> 100644 --- a/src/ClientEngine.js +++ b/src/ClientEngine.js @@ -102,8 +102,8 @@ class ClientEngine { // start game, game loop, render loop this.gameEngine.start(); - gameLoop(); - renderLoop(); + window.requestAnimationFrame(gameLoop); + window.requestAnimationFrame(renderLoop); } step() {
start loops after bringup iteration
lance-gg_lance
train
js
14bb09fd9b39c31cae5418328ff14d6f8915f913
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java index <HASH>..<HASH> 100644 --- a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java +++ b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java @@ -313,10 +313,11 @@ public class LottieDrawable extends Drawable implements Drawable.Callback { reverseAnimationWhenCompositionAdded = false; return; } + long playTime = setStartTime ? (long) (progress * animator.getDuration()) : 0; + animator.start(); if (setStartTime) { - animator.setCurrentPlayTime((long) (progress * animator.getDuration())); + animator.setCurrentPlayTime(playTime); } - animator.start(); } @SuppressWarnings({"unused", "WeakerAccess"}) public void resumeReverseAnimation() {
Set play time after calling start() rather than before Fixes #<I>
airbnb_lottie-android
train
java
b2e84639d7fc144142e6f32f5a6200a25757dbe8
diff --git a/src/UserConfig.js b/src/UserConfig.js index <HASH>..<HASH> 100644 --- a/src/UserConfig.js +++ b/src/UserConfig.js @@ -608,11 +608,16 @@ class UserConfig { } addExtension(fileExtension, options = {}) { + if (!process.env.ELEVENTY_EXPERIMENTAL) { + return; + } + console.log( chalk.yellow( "Warning: Configuration API `addExtension` is an experimental Eleventy feature with an unstable API. Be careful!" ) ); + this.extensionMap.add( Object.assign( {
Experimental features require ELEVENTY_EXPERIMENTAL environment variable to opt-in
11ty_eleventy
train
js
b08d86b8cbb258c185e998f6b700a7730c603d2e
diff --git a/lib/atom/configuration.rb b/lib/atom/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/atom/configuration.rb +++ b/lib/atom/configuration.rb @@ -13,7 +13,7 @@ module Atom gem 'auth-hmac' require 'auth-hmac' @auth_hmac_enabled = true - rescue + rescue Exception @auth_hmac_enabled = false end else
Better handling of auth-hmac detection
seangeo_ratom
train
rb
d5ab61123c7adbfaf4e1790fd43ecf19f4da1e4e
diff --git a/lib/constraints.js b/lib/constraints.js index <HASH>..<HASH> 100644 --- a/lib/constraints.js +++ b/lib/constraints.js @@ -20,9 +20,19 @@ exports.uniqueness.create = function(label, keys, callback) { }; exports.uniqueness.list = function(label, key, callback) { + if (typeof key == 'function') { + callback = key; + key = null; + } + label = encodeURIComponent(label); - key = encodeURIComponent(key); - var endpoint = util.format('schema/constraint/%s/uniqueness/%s', label, key); + var endpoint = util.format('schema/constraint/%s/uniqueness', label); + + if (key) { + key = encodeURIComponent(key); + endpoint += '/' + key; + } + var op = this.operation(endpoint, 'GET'); this.call(op, function(err, constraints) { if (err) callback(err);
constraints: implement list all functionality for uniqueness constraints
brikteknologier_seraph
train
js
2919c20bb31f63a5707575869a19cfe14a5e451a
diff --git a/alerta/webhooks/cloudwatch.py b/alerta/webhooks/cloudwatch.py index <HASH>..<HASH> 100644 --- a/alerta/webhooks/cloudwatch.py +++ b/alerta/webhooks/cloudwatch.py @@ -76,7 +76,7 @@ def parse_notification(notification): def cloudwatch(): try: - incomingAlert = parse_notification(request.json) + incomingAlert = parse_notification(request.get_json(force=True)) except ValueError as e: raise ApiError(str(e), 400)
Fix cloudwatch webhook json parse (#<I>)
alerta_alerta
train
py
b487f452d6015c55fe30eb6421f4fae4347a0870
diff --git a/h5p.classes.php b/h5p.classes.php index <HASH>..<HASH> 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1230,7 +1230,7 @@ class H5PContentValidator { } // Check if string is according to optional regexp in semantics if (isset($semantics->regexp)) { - $pattern = $semantics->regexp->pattern; + $pattern = '|' . $semantics->regexp->pattern . '|'; $pattern .= isset($semantics->regexp->modifiers) ? $semantics->regexp->modifiers : ''; if (preg_match($pattern, $text) === 0) { // Note: explicitly ignore return value FALSE, to avoid removing text
BUGFIX: Regexp from semantics does not contain delimiters. Add in PHP
h5p_h5p-php-library
train
php
1bc7ee671762430b69f1d02fcf1ef138d3ddd6d3
diff --git a/spec/templates/helpers/data.rb b/spec/templates/helpers/data.rb index <HASH>..<HASH> 100644 --- a/spec/templates/helpers/data.rb +++ b/spec/templates/helpers/data.rb @@ -5,5 +5,5 @@ module Helpers TEMPLATE_DIR = File.expand_path(File.join(File.dirname(__FILE__),'data')) - register_data_dir TEMPLATE_DIR + register_data_path TEMPLATE_DIR end
Use the new register_data_path from data_paths <I>.
ronin-ruby_ronin-support
train
rb
8d71d820e0faa89a33659a454d5f2ede8b48ad89
diff --git a/grappa/reporters/code.py b/grappa/reporters/code.py index <HASH>..<HASH> 100644 --- a/grappa/reporters/code.py +++ b/grappa/reporters/code.py @@ -87,11 +87,11 @@ class CodeReporter(BaseReporter): if line == trace.lineno: if config.use_colors: - head += Fore.RED + '>' + Style.RESET_ALL + head += Fore.RED + '> ' + Style.RESET_ALL else: - head += '>' + head += '> ' else: - head += ' ' + head += ' ' buf.append(indent + head + code) return buf
refactor(reporter): add additional separator space in code reporter
grappa-py_grappa
train
py
d80bd1864ddeb841a35b34f98a9d3e6b48fae66d
diff --git a/robotframework-faker/FakerLibrary/keywords.py b/robotframework-faker/FakerLibrary/keywords.py index <HASH>..<HASH> 100644 --- a/robotframework-faker/FakerLibrary/keywords.py +++ b/robotframework-faker/FakerLibrary/keywords.py @@ -33,9 +33,9 @@ class FakerKeywords(object): hasattr(function, '__call__')]) def __getattr__(self, name): - if name in _fake.__dict__: + if name in _fake.__dict__.keys(): return _autocast(_fake.__dict__[name]) - elif name in faker.generator.Generator.__dict__: + elif name in faker.generator.Generator.__dict__.keys(): return _autocast(faker.generator.Generator.__dict__[name]) raise AttributeError('Non-existing keyword "{}"'.format(name))
Iterate over keys instead of over dictproxy object
guykisel_robotframework-faker
train
py
b7aed99581df715dbdcbedeef94de2851c7cf607
diff --git a/lib/chef/resource/windows_uac.rb b/lib/chef/resource/windows_uac.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/windows_uac.rb +++ b/lib/chef/resource/windows_uac.rb @@ -104,7 +104,9 @@ class Chef # # @return [Integer] def consent_behavior_users_symbol_to_reg(sym) - %i{auto_deny secure_prompt_for_creds prompt_for_creds}.index(sym) + # Since 2 isn't a valid value for ConsentPromptBehaviorUser, assign the value at index as nil. + # https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/user-account-control-group-policy-and-registry-key-settings#registry-key-settings + [:auto_deny, :secure_prompt_for_creds, nil, :prompt_for_creds].index(sym) end end end
fix(resource/windows_uac): fix registry settings for consent_behavior_users
chef_chef
train
rb
0e15d964c61c5151f91e2ebdce85742d2fe5ff71
diff --git a/artifactory.py b/artifactory.py index <HASH>..<HASH> 100755 --- a/artifactory.py +++ b/artifactory.py @@ -901,7 +901,8 @@ class ArtifactoryPath(pathlib.Path, PureArtifactoryPath): obj.session = kwargs.get('session', None) if obj.auth is None and cfg_entry: - obj.auth = (cfg_entry['username'], cfg_entry['password']) + obj.auth = requests.auth.HTTPDigestAuth(cfg_entry['username'], + cfg_entry['password']) if obj.cert is None and cfg_entry: obj.cert = cfg_entry['cert']
Use requests.auth.HTTPDigestAuth as default authentication The server respondes <I> Unauthorized, and provide a authentication realm and a nonce, so HTTPDigestAuth can present properly the password and re-send the same request. For more information, see <URL>
devopshq_artifactory
train
py
75f7f7207ee9f13d43c41fc1ef03eb0180268f59
diff --git a/ngProgress.js b/ngProgress.js index <HASH>..<HASH> 100644 --- a/ngProgress.js +++ b/ngProgress.js @@ -64,13 +64,9 @@ module.provider('progressbar', function () { progressbar.css('width', count + '%'); progressbar.css('opacity', '1'); $window.interval = setInterval(function () { - if (count + 1 >= 95) { - clearInterval($window.interval); - } else { - var random = Math.floor(Math.random() * 5); - count = count + random; - progressbar.css('width', count + '%'); - } + var remaining = 100 - count; + count = count + (0.15 * Math.pow(1-Math.sqrt(remaining), 2)); + progressbar.css('width', count + '%'); }, 400); }, // Sets the height of the progressbar. Use any valid CSS value
adjusting progressbar fill, eliminates the <I>% hard stop in favor of a tapered approach
victorb_ngProgress
train
js
3e977c7a170d230bd698d634c35caff1378b070f
diff --git a/lib/image_processing/mini_magick.rb b/lib/image_processing/mini_magick.rb index <HASH>..<HASH> 100644 --- a/lib/image_processing/mini_magick.rb +++ b/lib/image_processing/mini_magick.rb @@ -3,6 +3,8 @@ require "image_processing" module ImageProcessing module MiniMagick + extend Chainable + def self.valid_image?(file) ::MiniMagick::Tool::Convert.new do |convert| convert << file.path @@ -125,7 +127,5 @@ module ImageProcessing end end end - - extend Chainable end end diff --git a/lib/image_processing/vips.rb b/lib/image_processing/vips.rb index <HASH>..<HASH> 100644 --- a/lib/image_processing/vips.rb +++ b/lib/image_processing/vips.rb @@ -5,6 +5,8 @@ fail "image_processing/vips requires libvips 8.6+" unless Vips.at_least_libvips? module ImageProcessing module Vips + extend Chainable + def self.valid_image?(file) ::Vips::Image.new_from_file(file.path, access: :sequential).avg true @@ -116,7 +118,5 @@ module ImageProcessing options.select { |name, value| operation_options.include?(name) } end end - - extend Chainable end end
Move "extend Chainable" statements to the top By convention module inclusion/extension should be listed at the top of the class/module.
janko_image_processing
train
rb,rb
5499e01fb39a4bee1450a4ebb524e73f8f4b4d9a
diff --git a/endesive/pdf/cms.py b/endesive/pdf/cms.py index <HASH>..<HASH> 100644 --- a/endesive/pdf/cms.py +++ b/endesive/pdf/cms.py @@ -391,13 +391,24 @@ class SignedData(pdf.PdfFileWriter): } ) break + + old_flags = int(form.get("/SigFlags", 0)) + new_flags = int(form.get("/SigFlags", 0)) | udct.get("sigflags", 3) if new_13: fields.append(obj13ref) form.update( { po.NameObject("/Fields"): fields, po.NameObject("/SigFlags"): po.NumberObject( - udct.get("sigflags", 3) + new_flags + ), + } + ) + elif new_flags > old_flags: + form.update( + { + po.NameObject("/SigFlags"): po.NumberObject( + new_flags ), } )
Bitwise OR sigflags with any existing /SigFlags value in AcroForm. The values for that field should not be decreased when signing.
m32_endesive
train
py
ea8afd886d0ace6acc7debc3b782314cbf0f9ef1
diff --git a/lib/oxidized/model/asa.rb b/lib/oxidized/model/asa.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/model/asa.rb +++ b/lib/oxidized/model/asa.rb @@ -23,16 +23,16 @@ class ASA < Oxidized::Model comment cfg end + cmd 'show inventory' do |cfg| + comment cfg + end + cmd 'more system:running-config' do |cfg| cfg = cfg.each_line.to_a[3..-1].join cfg.gsub! /^: [^\n]*\n/, '' cfg end - cmd 'show inventory' do |cfg| - comment cfg - end - cfg :ssh do if vars :enable post_login do
move "show inventory" up to stop "show run" from being sandwiched in between comments
ytti_oxidized
train
rb
babd97f5ff7c5cec8750d3bdb37283bd10e0f515
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( author='MAAS Developers', author_email='maas-devel@lists.launchpad.net', url='https://github.com/maas/python-libmaas', - version="0.6.7", + version="0.6.8", classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers',
Release <I> (#<I>)
maas_python-libmaas
train
py
b84b99f090a4812c1ce78aca7f6ce4df2e9a48f5
diff --git a/perf/perf.go b/perf/perf.go index <HASH>..<HASH> 100644 --- a/perf/perf.go +++ b/perf/perf.go @@ -4,6 +4,7 @@ import ( "bytes" "expvar" "fmt" + "strconv" "sync" "time" @@ -61,7 +62,8 @@ func (me *buckets) String() string { } else { fmt.Fprintf(&b, ", ") } - fmt.Fprintf(&b, "%d: %d", i-9, count) + key := strconv.Itoa(i-9) + fmt.Fprintf(&b, "%q: %d", key, count) } me.mu.Unlock() fmt.Fprintf(&b, "}")
fix json format "peersFoundByPEX": 0, "peersFoundByTracker": 2, "perfBuckets": { "write chunk": {-3: 1}}, "pieceHashedCorrect": 1,
anacrolix_missinggo
train
go
f880b0c3c955d4f0f6ea0b149861a3003438f8e5
diff --git a/XBRL.php b/XBRL.php index <HASH>..<HASH> 100644 --- a/XBRL.php +++ b/XBRL.php @@ -15631,9 +15631,10 @@ class XBRL { { $this->log()->dimension_validation( "2.4.3", "The dimension cannot be located in the dimensions collection of the target role", array( - 'target role' => "'{$targetRole['roleUri']}'", + 'target role' => "'{$parent['targetRole']}'", 'dimension' => "'$dimensionId'", - 'error' => 'xbrldte:TargetRoleNotResolvedError', + 'location' => 'resolvePrimaryItemHypercubeDRS', + 'error' => 'xbrldte:TargetRoleNotResolvedError' ) ); continue; @@ -16168,8 +16169,10 @@ class XBRL { { $this->log()->dimension_validation( "2.4.3", "The dimension cannot be located in the dimensions collection of the target role", array( - 'target role' => "'{$targetRole['roleUri']}'", + 'target role' => "'{$parent['targetRole']}'", 'dimension' => "'$dimensionId'", + 'location' => 'mergeExtendedRoles', + 'error' => 'xbrldte:TargetRoleNotResolvedError', ) ); continue;
Two validation messages included the wrong role information
bseddon_XBRL
train
php
86b658376339652cdba4f8a714d632bf5303386b
diff --git a/DependencyInjection/Neo4jExtension.php b/DependencyInjection/Neo4jExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Neo4jExtension.php +++ b/DependencyInjection/Neo4jExtension.php @@ -39,7 +39,7 @@ class Neo4jExtension extends Extension if ($this->validateEntityManagers($config)) { $loader->load('entity_manager.xml'); - $this->handleEntityMangers($config, $container, $clientServiceIds); + $this->handleEntityManagers($config, $container, $clientServiceIds); $container->setAlias('neo4j.entity_manager', 'neo4j.entity_manager.default'); } @@ -119,7 +119,7 @@ class Neo4jExtension extends Extension * * @return array */ - private function handleEntityMangers(array &$config, ContainerBuilder $container, array $clientServiceIds): array + private function handleEntityManagers(array &$config, ContainerBuilder $container, array $clientServiceIds): array { $serviceIds = []; foreach ($config['entity_managers'] as $name => $data) {
Corrected typo in Neo4jExtension (#<I>)
neo4j-contrib_neo4j-symfony
train
php
ce5e85e88f04fe215914ac4dc5e22c5e66332984
diff --git a/taxid.go b/taxid.go index <HASH>..<HASH> 100644 --- a/taxid.go +++ b/taxid.go @@ -11,6 +11,7 @@ const ( TaxIDTypeCHVAT TaxIDType = "eu_vat" TaxIDTypeEUVAT TaxIDType = "eu_vat" TaxIDTypeINGST TaxIDType = "in_gst" + TaxIDTypeMXRFC TaxIDType = "mx_rfc" TaxIDTypeNOVAT TaxIDType = "no_vat" TaxIDTypeNZGST TaxIDType = "nz_gst" TaxIDTypeZAVAT TaxIDType = "za_vat"
Add `TaxIDTypeMXRFC` constant to `TaxIDType`
stripe_stripe-go
train
go
d9e3b4b625ae3975c0bad96a0e0055a932f44639
diff --git a/werkzeug/contrib/atom.py b/werkzeug/contrib/atom.py index <HASH>..<HASH> 100644 --- a/werkzeug/contrib/atom.py +++ b/werkzeug/contrib/atom.py @@ -22,10 +22,10 @@ :license: BSD, see LICENSE for more details. """ from datetime import datetime -from six import string_types + from werkzeug.utils import escape from werkzeug.wrappers import BaseResponse -from werkzeug._compat import implements_to_string +from werkzeug._compat import implements_to_string, string_types XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'
Remove six reference Apparently this module is untested.
pallets_werkzeug
train
py
2586aa58394f605677eb898a10cbfd2bf19217a8
diff --git a/core/src/main/java/cucumber/runtime/formatter/JUnitFormatter.java b/core/src/main/java/cucumber/runtime/formatter/JUnitFormatter.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/cucumber/runtime/formatter/JUnitFormatter.java +++ b/core/src/main/java/cucumber/runtime/formatter/JUnitFormatter.java @@ -97,7 +97,7 @@ class JUnitFormatter implements Formatter, Reporter { DOMSource source = new DOMSource(doc); trans.transform(source, result); } catch (TransformerException e) { - new CucumberException("Error while transforming.", e); + throw new CucumberException("Error while transforming.", e); } }
JUnitFormatter does not throw exception in done() method.
cucumber_cucumber-jvm
train
java
6e9df821bbcef7a80ccf20856f26474cddf3feca
diff --git a/src/Http/Controllers/Controller.php b/src/Http/Controllers/Controller.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/Controller.php +++ b/src/Http/Controllers/Controller.php @@ -48,10 +48,6 @@ abstract class Controller extends BaseController foreach ($rows as $row) { $options = json_decode($row->details); - if ($row->type == 'relationship' && $options->type != 'belongsToMany') { - $row->field = @$options->column; - } - // if the field for this row is absent from the request, continue // checkboxes will be absent when unchecked, thus they are the exception if (!$request->hasFile($row->field) && !$request->has($row->field) && $row->type !== 'checkbox') { @@ -60,6 +56,10 @@ abstract class Controller extends BaseController $content = $this->getContentBasedOnType($request, $slug, $row); + if ($row->type == 'relationship' && $options->type != 'belongsToMany') { + $row->field = @$options->column; + } + /* * merge ex_images and upload images */
fix relationship bug (#<I>) * fix relationship bug the relationship row field should be changed after the content is delivered * fix style error * fix style again
the-control-group_voyager
train
php
777433116eccdb0330415184a45455250f544e41
diff --git a/apiserver/facades/client/charms/client.go b/apiserver/facades/client/charms/client.go index <HASH>..<HASH> 100644 --- a/apiserver/facades/client/charms/client.go +++ b/apiserver/facades/client/charms/client.go @@ -822,8 +822,7 @@ func (a *API) listOneCharmResources(arg params.CharmURLAndOrigin) ([]params.Char if err != nil { return nil, apiservererrors.ServerError(err) } - - repo, err := a.getCharmRepository(corecharm.Source(curl.Schema)) + repo, err := a.getCharmRepository(corecharm.CharmHub) if err != nil { return nil, apiservererrors.ServerError(err) }
"ch" != "charm-hub". Use a Source not a url schema to request a charm repository. Unfortunately they are conceptually the same, but not match easy other directly.
juju_juju
train
go
a041b353b86d82e62e52e6d14bfa74ec1a01b6fd
diff --git a/server.py b/server.py index <HASH>..<HASH> 100755 --- a/server.py +++ b/server.py @@ -7,11 +7,26 @@ import daemon import os import json from web import app +import argparse + + +def parseArgs(): + + parser = argparse.ArgumentParser(description='Note Web App') + parser.add_argument('-F', action='store_true', help="Run WebApp in foreground (don't daemonize)", default=False) + parser.add_argument('-f', type=str, help="Set config file", default=os.path.expanduser('~/.note.conf')) + + args = parser.parse_args() + return args def main(): - with open(os.path.expanduser("~/.note.conf")) as fd: + args = parseArgs() + foreground = args.F + configFile = args.f + + with open(configFile) as fd: config = json.loads(fd.read()) try: @@ -35,11 +50,17 @@ def main(): except: listenIP = "127.0.0.1" - with daemon.DaemonContext(): + def startServer(): http_server = HTTPServer(WSGIContainer(app), ssl_options=serverSSLOptions) http_server.listen(port, address=listenIP) IOLoop.instance().start() + if foreground: + startServer() + else: + with daemon.DaemonContext(): + startServer() + if __name__ == '__main__': main()
added command line args for server.py
dwwkelly_note
train
py
f91a5fce2c27c58ecd6955221bf04239d71c4e11
diff --git a/src/TemplateMap.js b/src/TemplateMap.js index <HASH>..<HASH> 100644 --- a/src/TemplateMap.js +++ b/src/TemplateMap.js @@ -627,7 +627,7 @@ class TemplateMap { let warnings = {}; for (let entry of this.map) { for (let page of entry._pages) { - if (page.url === false) { + if (page.outputPath === false || page.url === false) { // do nothing (also serverless) } else if (!permalinks[page.url]) { permalinks[page.url] = [entry.inputPath];
Issue with duplicate permalinks when `build` missing from permalink object.
11ty_eleventy
train
js
6dbb4c7fd46fd2716c3494da3dde88d12dbe70e9
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,6 @@ require 'rubygems' require "flexmock" -require 'minitest/autorun' +require 'minitest/spec' # Configure Rails Environment environment = ENV["RAILS_ENV"] = 'test' @@ -24,4 +24,6 @@ class Seedbank::Spec < MiniTest::Spec end + + MiniTest::Spec.register_spec_type(/^Seedbank::/, Seedbank::Spec)
Fixed undefined method current for MiniTest::Spec.
james2m_seedbank
train
rb
96eac81ef926ae90335cff08f7615e65da7b93ad
diff --git a/src/MenuBuilder/MenuFactory.php b/src/MenuBuilder/MenuFactory.php index <HASH>..<HASH> 100644 --- a/src/MenuBuilder/MenuFactory.php +++ b/src/MenuBuilder/MenuFactory.php @@ -151,8 +151,10 @@ class MenuFactory } /** - * @param $name Menu's name - * @param null $context The object that generates the menu to be used as the event subject + * Returns a menu instance based on the provided name + * + * @param string $name Menu's name + * @param null|mixed $context The object that generates the menu to be used as the event subject * @return Menu */ protected function getMenuByName($name, $context = null) @@ -177,6 +179,8 @@ class MenuFactory if ($menuEntity->default) { $menuInstance = $this->_sortItems($menuInstance); } + + $menuInstance = self::createMenu($menuInstance); } return $menuInstance;
Fix PHPCS Improve backwards compatibility (task #<I>)
QoboLtd_cakephp-menu
train
php
f394f85aa6c87f7b189dd9aa20384d025a83c404
diff --git a/lib/ronin/path.rb b/lib/ronin/path.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/path.rb +++ b/lib/ronin/path.rb @@ -87,7 +87,7 @@ module Ronin dirs = (['..'] * (n-1)) - Path.new(path.join(*dirs)) + path.join(*dirs) when Enumerable n.map { |i| up(i) } else @@ -112,23 +112,20 @@ module Ronin # @api public # def join(*names) - names.map! { |name| name.to_s } + joined_path = if root? then '' + else self.to_s + end - # filter out errant directory separators - names.reject! { |dir| dir == @separator } + names.each do |name| + name = name.to_s - # join the path - sub_path = names.join(@separator) + # filter out errant directory separators + next if name == @separator - path = if root? - # prefix the root dir - self.to_s + sub_path - else - # join the path with the sub-path - [self.to_s, sub_path].join(@separator) - end + joined_path << @separator << name + end - return self.class.new(path) + return self.class.new(joined_path) end alias / join
Refactored Path#join.
ronin-ruby_ronin-support
train
rb
4def0b27db5b98ce1a490379131541124b7a90a1
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -5541,8 +5541,12 @@ function widgetHeight(widget) { if (widget.height != null) return widget.height; - if (!contains(document.body, widget.node)) - removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, "position: relative")); + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + parentStyle += "margin-left: -" + widget.cm.getGutterElement().offsetWidth + "px;"; + removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } return widget.height = widget.node.offsetHeight; }
Set parent width for coverGutter widgets in measure div When using the measure div to measure a LineWidget with coverGutter: true, set the parent's width to include the gutter. Otherwise, the widget will be measured as if it were not meant to cover the gutter (it will be measured at a narrower width). Fixes #<I>
codemirror_CodeMirror
train
js
885a725386a0c50de2704b328a5c6b223be909d4
diff --git a/src/Encore/Console/ServiceProvider.php b/src/Encore/Console/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Encore/Console/ServiceProvider.php +++ b/src/Encore/Console/ServiceProvider.php @@ -8,10 +8,8 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider { public function register() { - $app = $this->app; - - $this->app->singleton('console', function() use ($app) { - return new Console('EncorePHP', $app::VERSION); + $this->app->singleton('console', function() { + return new Console('EncorePHP', $this->app::VERSION); }); } } \ No newline at end of file diff --git a/src/Encore/View/ServiceProvider.php b/src/Encore/View/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Encore/View/ServiceProvider.php +++ b/src/Encore/View/ServiceProvider.php @@ -8,10 +8,8 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider { public function register() { - $app = $this->app; - - $this->app->instance('view', function() use ($app) { - $finder = new FileFinder(new Filesystem, $app['config']['view.paths']); + $this->app->instance('view', function() { + $finder = new FileFinder(new Filesystem, $this->app['config']['view.paths']); return new Manager($finder); });
We can use $this in closures now
encorephp_kernel
train
php,php
25969c01e974fce643be91db69c2b3f878349840
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ 'use strict'; var fs = require('fs'); -var yaml = require('js-yaml'); +var yaml = require('js-yaml-lite'); var moment = require('moment'); var columnify = require('columnify'); var merge = require('mixin-deep');
use js-yaml-lite
jonschlinkert_stringify-changelog
train
js
bbfb944cc185f99daa39247ae98dcb64743bf881
diff --git a/intranet/settings/__init__.py b/intranet/settings/__init__.py index <HASH>..<HASH> 100644 --- a/intranet/settings/__init__.py +++ b/intranet/settings/__init__.py @@ -786,6 +786,4 @@ if PRODUCTION: sentry_logging = LoggingIntegration( level=logging.INFO, event_level=logging.ERROR # Capture info and above as breadcrumbs # Send errors as events ) - sentry_sdk.init( - SENTRY_PUBLIC_DSN, integrations=[DjangoIntegration(), sentry_logging, CeleryIntegration()], send_default_pii=True - ) + sentry_sdk.init(SENTRY_PUBLIC_DSN, integrations=[DjangoIntegration(), sentry_logging, CeleryIntegration()], send_default_pii=True)
style: re-blackify settings
tjcsl_ion
train
py
bfd26e60beaceff15adc619baa119f70d5e7f6d7
diff --git a/tests/log_parser/test_utils.py b/tests/log_parser/test_utils.py index <HASH>..<HASH> 100644 --- a/tests/log_parser/test_utils.py +++ b/tests/log_parser/test_utils.py @@ -108,3 +108,20 @@ def test_get_crash_signature(line, exp_search_term): """tests the search term extracted from an error line is correct""" actual_search_term = get_crash_signature(line) assert actual_search_term == exp_search_term + +BLACKLIST_TEST_CASES = ( + ( + 'TEST-UNEXPECTED-FAIL | remoteautomation.py | application timed out after 330 seconds with no output', + 'TEST-UNEXPECTED-FAIL | remoteautomation.py | application timed out after 330 seconds with no output' + ), + ( + 'Return code: 1', + None + ), +) + +@pytest.mark.parametrize(("line", "exp_search_term"), BLACKLIST_TEST_CASES) +def test_get_blacklisted_search_term(line, exp_search_term): + """Test search term extraction for lines that contain a blacklisted term""" + actual_search_term = get_error_search_term(line) + assert actual_search_term == exp_search_term
Bug <I> - Add tests for the search term blacklist
mozilla_treeherder
train
py
945dc63a569d17f47b07473ac85a76076b213483
diff --git a/lib/assert/view.rb b/lib/assert/view.rb index <HASH>..<HASH> 100644 --- a/lib/assert/view.rb +++ b/lib/assert/view.rb @@ -7,7 +7,9 @@ module Assert::View # or passing the name of a view installed in ~/.assert/views def self.require_user_view(view_name) - views_file = File.expand_path(File.join('~/.assert/views', view_name, 'lib', view_name)) + views_file = File.expand_path( + File.join("#{ENV['HOME']}/.assert/views", view_name, 'lib', view_name) + ) if File.exists?(view_name) || File.exists?(view_name + '.rb') require view_name
use `ENV['HOME']` as the root for looking up custom views Instead of `~`. `ENV['HOME']` is more proper/robust.
redding_assert
train
rb
ac3b5078d6faa422c45eee8df9edea4372480904
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='pyevmasm', - version='0.1.0', + version='0.1.1', description='Ethereum Virtual Machine (EVM) assembler and disassembler', author='Trail of Bits', author_email='evmasm@trailofbits.com',
Update setup.py version for <I> release
crytic_pyevmasm
train
py
ebe4925dc104802bc19cfc8d0d42f5650213a9b9
diff --git a/pysat/_instrument.py b/pysat/_instrument.py index <HASH>..<HASH> 100644 --- a/pysat/_instrument.py +++ b/pysat/_instrument.py @@ -363,7 +363,7 @@ class Instrument(object): def __setattr__(self, name, value): """Moves instrument attributes onto meta attributes - + If the attribute is not in _base_attrs, add to meta attributes. For all other cases, store as an instrument attribute. """ @@ -747,16 +747,6 @@ class Instrument(object): def concat_data(self, data, *args, **kwargs): """Concats data1 and data2 for xarray or pandas as needed - Note - ---- - For pandas, sort=False is passed along to the underlying - pandas.concat method. If sort is supplied as a keyword, the - user provided value is used instead. - - For xarray, dim='time' is passed along to xarray.concat - except if the user includes a value for dim as a - keyword argument. - Parameters ---------- data : pandas or xarray @@ -767,6 +757,16 @@ class Instrument(object): void Instrument.data modified in place. + Notes + ----- + For pandas, sort=False is passed along to the underlying + pandas.concat method. If sort is supplied as a keyword, the + user provided value is used instead. + + For xarray, dim='time' is passed along to xarray.concat + except if the user includes a value for dim as a + keyword argument. + """ if self.pandas_format:
STY: Updated docstring
rstoneback_pysat
train
py
fc36a8d1b23c590e87ddcb4146596fd94edaa2d5
diff --git a/lib/command/run-multiple/chunk.js b/lib/command/run-multiple/chunk.js index <HASH>..<HASH> 100644 --- a/lib/command/run-multiple/chunk.js +++ b/lib/command/run-multiple/chunk.js @@ -62,7 +62,7 @@ const createChunks = (config, pattern) => { let chunks = []; if (typeof config.chunks === 'function') { chunks = config.chunks.call(this, files); - } else if (typeof config.chunks === 'number') { + } else if (typeof config.chunks === 'number' || typeof config.chunks === 'string') { chunks = splitFiles(files, Math.ceil(files.length / config.chunks)); } else { throw new Error('chunks is neither a finite number or a valid function');
fix multiple.parallel.chunks (#<I>) * fix multiple.parallel.chunks if multiple.parallel.chunks param in config set as environment variable, than codeceptjs throw "chunks is neither a finite number or a valid function". * Update chunk.js
Codeception_CodeceptJS
train
js
563b3530cd8ed0331171a117b6d8d207d7209102
diff --git a/tests/test.py b/tests/test.py index <HASH>..<HASH> 100644 --- a/tests/test.py +++ b/tests/test.py @@ -37,7 +37,7 @@ class KeepFDsTest(unittest.TestCase): self.pidfile = mkstemp()[1] self.logfile = mkstemp()[1] os.system("python tests/daemon_keep_fds.py %s %s" % (self.pidfile, self.logfile)) - sleep(.1) + sleep(1) def tearDown(self): os.system("kill `cat %s`" % self.pidfile)
Maybe travis ci is not enough fast
thesharp_daemonize
train
py
6ce0ca0f41a9a6446cf0b51111ed9fec33d4798e
diff --git a/disposable_email_checker/validators.py b/disposable_email_checker/validators.py index <HASH>..<HASH> 100644 --- a/disposable_email_checker/validators.py +++ b/disposable_email_checker/validators.py @@ -34,7 +34,7 @@ class DisposableEmailChecker(): if domain_part not in self.whitelist: for email_group in self.chunk(self.emails, 20): - regex = "(.*" + ")|(.*".join(email_group) + ")" + regex = "(.*" + "$)|(.*".join(email_group) + "$)" if re.match(regex, value): raise ValidationError(self.message, code=self.code)
Include @lfrodrigues regex fix (Issue #8)
aaronbassett_DisposableEmailChecker
train
py
48b830875dad65bc652401ccd4634e1014cec7bd
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -61,8 +61,8 @@ module Puppet # their name, and these resources are said to be non-isomorphic. # # @note The Type class deals with multiple concerns; some methods provide an internal DSL for convenient definition -# of types, other methods deal with various aspects while running; wiring up a resource (expressed in Puppet DSL -# or Ruby DSL) with its _resource type_ (i.e. an instance of Type) to enable validation, transformation of values +# of types, other methods deal with various aspects while running; wiring up a resource (expressed in Puppet DSL) +# with its _resource type_ (i.e. an instance of Type) to enable validation, transformation of values # (munge/unmunge), etc. Lastly, Type is also responsible for dealing with Providers; the concrete implementations # of the behavior that constitutes how a particular Type behaves on a particular type of system (e.g. how # commands are executed on a flavor of Linux, on Windows, etc.). This means that as you are reading through the
(PUP-<I>) Remove mention of Ruby DSL from documentation comment
puppetlabs_puppet
train
rb
5215612fce3ffda5bd04ef3fe59bde3d2d277bd6
diff --git a/python_modules/dagster/dagster/core/definitions/events.py b/python_modules/dagster/dagster/core/definitions/events.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster/dagster/core/definitions/events.py +++ b/python_modules/dagster/dagster/core/definitions/events.py @@ -92,7 +92,7 @@ class EventMetadataEntry(namedtuple('_EventMetadataEntry', 'label description en :py:class:`JsonMetadataEntryData`. Args: - data (str): The JSON data contained by this metadata entry. + data (Dict[str, Any]): The JSON data contained by this metadata entry. label (str): Short display label for this metadata entry. description (Optional[str]): A human-readable description of this metadata entry. ''' @@ -160,7 +160,7 @@ class JsonMetadataEntryData(namedtuple('_JsonMetadataEntryData', 'data')): '''Container class for JSON metadata entry data. Args: - data (str): The JSON data. + data (Dict[str, Any]): The JSON data. ''' def __new__(cls, data):
Fix docstring Summary: Correct type signature Test Plan: Unit Reviewers: alangenfeld, prha, nate, yuhan, schrockn Reviewed By: prha Differential Revision: <URL>
dagster-io_dagster
train
py
b9727e75ed06f830260d2fe014f4357ad7d48ccf
diff --git a/lib/reda/utils/__init__.py b/lib/reda/utils/__init__.py index <HASH>..<HASH> 100644 --- a/lib/reda/utils/__init__.py +++ b/lib/reda/utils/__init__.py @@ -2,4 +2,4 @@ reda.utils - utility functions that work on imported data, e.g., computation of geometric factors using inversion algorithms. """ -from .helper_functions import opt_import +from .helper_functions import opt_import, which
Make which importable from reda.utils.
geophysics-ubonn_reda
train
py
e6dedd0ca881197eab55f8ec8e0581395b8b2765
diff --git a/plenum/common/test_network_setup.py b/plenum/common/test_network_setup.py index <HASH>..<HASH> 100644 --- a/plenum/common/test_network_setup.py +++ b/plenum/common/test_network_setup.py @@ -69,7 +69,7 @@ class TestNetworkSetup: domainLedger = cls.init_domain_ledger(appendToLedgers, baseDir, config, envName, domainTxnFieldOrder) - trustee_txn = Member.nym_txn(trustee_def.nym, trustee_def.name, TRUSTEE) + trustee_txn = Member.nym_txn(trustee_def.nym, trustee_def.name, role=TRUSTEE) domainLedger.add(trustee_txn) for sd in steward_defs:
fix generation of trustee txns (#<I>)
hyperledger_indy-plenum
train
py
7923956d82b61168a217f63e82682c0ef27d5031
diff --git a/src/Aura/Marshal/Record/Builder.php b/src/Aura/Marshal/Record/Builder.php index <HASH>..<HASH> 100644 --- a/src/Aura/Marshal/Record/Builder.php +++ b/src/Aura/Marshal/Record/Builder.php @@ -34,6 +34,10 @@ class Builder implements BuilderInterface */ public function newInstance(GenericType $type, $data) { - return new GenericRecord((array) $data, $type); + $record = new GenericRecord([], $type); + foreach ((array) $data as $field => $value) { + $record->$field = $value; + } + return $record; } }
in RecordBuilder, set field values by property, not by constructor
auraphp_Aura.Marshal
train
php
f69486a6e20d8202c57ab1c9ca3cde46b309e463
diff --git a/go/unifiedapiclient/client_test.go b/go/unifiedapiclient/client_test.go index <HASH>..<HASH> 100644 --- a/go/unifiedapiclient/client_test.go +++ b/go/unifiedapiclient/client_test.go @@ -56,7 +56,7 @@ func TestClientRequest(t *testing.T) { flag.Parse() if *shouldTestApi { c := NewFromConfig(testCtx) - err := c.Call(testCtx, "POST", "/api/v1/ipset/unmark_mac/00:11:22:33:44:55/1", &DummyReply{}) + err := c.Call(testCtx, "POST", "/api/v1/ipset/unmark_mac/00:11:22:33:44:55?local=1", &DummyReply{}) if err != nil { t.Error("Error while contacting Unified API", err)
Update pfipset route in client test
inverse-inc_packetfence
train
go
23e2c342088a67ea03a5fd2ca960c82d4c79ba10
diff --git a/lib/zfs.js b/lib/zfs.js index <HASH>..<HASH> 100644 --- a/lib/zfs.js +++ b/lib/zfs.js @@ -28,7 +28,7 @@ var zfsBin = findCmd('zfs'); function zfs(args, callback) { "use strict"; - cp.execFile(zfsBin, args, {}, function (err, stdout, stderr) { + cp.execFile(zfsBin, args, {maxBuffer: 8000000}, function (err, stdout, stderr) { if (callback && typeof callback === 'function') { if (err) { err.message = _.compact(err.message.split('\n')).join('; ').trim();
Allow larger execFile buffer
calmh_node-zfs
train
js
ee6ab8215b2ffb38898a4f00b532681e18082b2d
diff --git a/lib/channel.js b/lib/channel.js index <HASH>..<HASH> 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -85,6 +85,11 @@ }); } + if (!!data.switch_to_channel && data.switch_to_channel.toString().match(/^\d+$/)) { + process.env.PIPEDRIVE_CHANNEL_HOST = 'channel' + data.switch_to_channel.toString() + '.pipedrive.com'; + self.restartClient(); + } + if (data.rabbitStateChange === 'open') { if (handlers.connect) { _.each(handlers.connect, function(handler) { @@ -97,7 +102,7 @@ client.onclose = function (e) { if (!clientClosed) { // not closed by user - we have some connection error. - self.restartClient(); + self.startClient(); return; } @@ -112,13 +117,10 @@ this.restartClient = function() { client.onopen = null; - client.onclose = null; client.onmessage = null; - client = null; - clientStarted = false; - - setTimeout(self.startClient, (1+Math.random()*4)*1000); + clientClosed = false; + client.close(); }; this.on = function(method, handler) {
add multi-channel support for the <I> branch
pipedrive_client-nodejs
train
js
d56db2ca034894cdd1fab72c60b19d0fb471e8ca
diff --git a/src/Pazuzu156/Gravatar/Laravel/GravatarServiceProvider.php b/src/Pazuzu156/Gravatar/Laravel/GravatarServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Pazuzu156/Gravatar/Laravel/GravatarServiceProvider.php +++ b/src/Pazuzu156/Gravatar/Laravel/GravatarServiceProvider.php @@ -25,14 +25,12 @@ class GravatarServiceProvider extends ServiceProvider */ public function register() { - $this->app['gravatar'] = $this->app->share( - function ($app) { - return new Gravatar( - config('gravatar.defaults.size'), - config('gravatar.secure') - ); - } - ); + $this->app->singleton('gravatar', function($app) { + return new Gravatar( + config('gravatar.defaults.size'), + config('gravatar.secure') + ); + }); } /**
Updated to support Laravel <I>
pazuzu156_Gravatar
train
php
ec3ed7ff65d876e77d8e4cb2b87d594caff3a2ca
diff --git a/languagetool-core/src/main/java/org/languagetool/Language.java b/languagetool-core/src/main/java/org/languagetool/Language.java index <HASH>..<HASH> 100644 --- a/languagetool-core/src/main/java/org/languagetool/Language.java +++ b/languagetool-core/src/main/java/org/languagetool/Language.java @@ -123,7 +123,7 @@ public abstract class Language { private static Language[] getRealLanguages() { List<Language> result = new ArrayList<>(); for (Language lang : LANGUAGES) { - if (!lang.getShortName().equals("xx")) { // skip demo language + if (!"xx".equals(lang.getShortName())) { // skip demo language result.add(lang); } }
flip equals in case a language has null as a name
languagetool-org_languagetool
train
java
c68cca2084ae5363df9fdb90258e40f210ec0610
diff --git a/lib/identity_cache/mem_cache_store_cas.rb b/lib/identity_cache/mem_cache_store_cas.rb index <HASH>..<HASH> 100644 --- a/lib/identity_cache/mem_cache_store_cas.rb +++ b/lib/identity_cache/mem_cache_store_cas.rb @@ -29,7 +29,7 @@ module IdentityCache keys = keys_to_names.keys rescue_error_with(false) do instrument(:cas_multi, keys, options) do - raw_values = @data.get_multi_cas(keys) + raw_values = @data.with { |c| c.get_multi_cas(keys) } values = {} raw_values.each do |key, raw_value| @@ -44,7 +44,7 @@ module IdentityCache cas_id = raw_values[key].last entry = ActiveSupport::Cache::Entry.new(value, **options) payload = options[:raw] ? entry.value.to_s : entry - @data.replace_cas(key, payload, cas_id, options[:expires_in].to_i, options) + @data.with { |c| c.replace_cas(key, payload, cas_id, options[:expires_in].to_i, options) } end end end
Fix mem_cache_store adapter with connection_pool (#<I>)
Shopify_identity_cache
train
rb
87d5b51de5c7cc89c147ce87462e2ebb1d72acf4
diff --git a/platform.js b/platform.js index <HASH>..<HASH> 100644 --- a/platform.js +++ b/platform.js @@ -657,7 +657,7 @@ if (isModuleScope && isHostType(context, 'system') && (data = [context.system])[0]) { os || (os = data[0].os || null); try { - data[1] = (data[1] = context.require) && data[1]('ringo/engine').version; + data[1] = context.require('ringo/engine').version; version = data[1].join('.'); name = 'RingoJS'; } catch(e) {
Simplify requiring of `ringo/engine`
bestiejs_platform.js
train
js
12fdff0dba650659826699f78e409eb1db660913
diff --git a/csrbuilder/__init__.py b/csrbuilder/__init__.py index <HASH>..<HASH> 100644 --- a/csrbuilder/__init__.py +++ b/csrbuilder/__init__.py @@ -206,6 +206,10 @@ class CSRBuilder(object): @ca.setter def ca(self, value): + if value is None: + self._basic_constraints = None + return + self._basic_constraints = x509.BasicConstraints({'ca': bool(value)}) if value:
Fix ability to set .ca attribute to None
wbond_csrbuilder
train
py
dadca8624ae26b26550113fe873728cd6ef60da0
diff --git a/tests/cases/models/js_file.test.php b/tests/cases/models/js_file.test.php index <HASH>..<HASH> 100644 --- a/tests/cases/models/js_file.test.php +++ b/tests/cases/models/js_file.test.php @@ -234,8 +234,20 @@ TEXT; /* asset_compress $time */ some javascript TEXT; - $contents = file_get_contents(TMP . 'tests/test_js_asset.' . $time . '.js'); - $this->assertEqual($contents, $expected); + $result = file_get_contents(TMP . 'tests/test_js_asset.' . $time . '.js'); + $this->assertEqual($result, $expected); + unlink(TMP . 'tests/test_js_asset.' . $time . '.js'); + + $time = time(); + $result = $this->JsFile->cache('test_js_asset.' . $time . '.js', $contents); + $this->assertTrue($result); + + $expected = <<<TEXT +/* asset_compress $time */ +some javascript +TEXT; + $result = file_get_contents(TMP . 'tests/test_js_asset.' . $time . '.js'); + $this->assertEqual($result, $expected); unlink(TMP . 'tests/test_js_asset.' . $time . '.js'); }
Adding tests for double timestamping.
markstory_asset_compress
train
php
48502a448e1fbb5e4083b7ac35a9d975f0ba83fb
diff --git a/rdopkg/actions.py b/rdopkg/actions.py index <HASH>..<HASH> 100644 --- a/rdopkg/actions.py +++ b/rdopkg/actions.py @@ -577,8 +577,8 @@ def update_spec(branch=None, changes=None, spec.save() -def get_source(bump_only=False): - if bump_only: +def get_source(no_new_sources=False): + if no_new_sources: return source_urls = specfile.Spec().get_source_urls() # So far, only Source0 is a tarball to download @@ -595,11 +595,8 @@ def get_source(bump_only=False): ".spec file.", rerun=True) -def new_sources(branch=None, fedpkg=FEDPKG, no_new_sources=False, - bump_only=False): +def new_sources(branch=None, fedpkg=FEDPKG, no_new_sources=False): _ensure_branch(branch) - if bump_only: - return if no_new_sources: log.info("skipping `%s new-sources` as requested." % fedpkg[0]) return
new-version: improve -b/-n behavior
softwarefactory-project_rdopkg
train
py
f31c7dd71f7cd0fd2f672ebe5362b3062fd43ffd
diff --git a/ansi2html/converter.py b/ansi2html/converter.py index <HASH>..<HASH> 100755 --- a/ansi2html/converter.py +++ b/ansi2html/converter.py @@ -293,14 +293,14 @@ def main(): # Produce only the headers and quit if opts.headers: - print(conv.produce_headers()) + _print(conv.produce_headers()) return # Process input line-by-line. Produce no headers. if opts.partial or opts.inline: line = sys.stdin.readline() while line: - print(conv.convert(ansi=line, full=False)[:-1], end='\n') + _print(conv.convert(ansi=line, full=False)[:-1]) line = sys.stdin.readline() return
Use correct output encoding for --partial. The problem was introduced in <I>ade7a9cebfa<I>b2ca<I>c<I>e5e
ralphbean_ansi2html
train
py
5f5d3d5ef057a786990c58865fe5c28f7118478f
diff --git a/lib/vagrant/machine_index.rb b/lib/vagrant/machine_index.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/machine_index.rb +++ b/lib/vagrant/machine_index.rb @@ -108,6 +108,9 @@ module Vagrant @lock.synchronize do with_index_lock do + # Reload the data + unlocked_reload + data = find_by_prefix(uuid) return nil if !data uuid = data["id"] @@ -134,7 +137,12 @@ module Vagrant # @param [String] uuid # @return [Boolean] def include?(uuid) - !!find_by_prefix(uuid) + @lock.synchronize do + with_index_lock do + unlocked_reload + return !!find_by_prefix(uuid) + end + end end # Releases an entry, unlocking it.
core: MachineIndex more aggressively reloads data
hashicorp_vagrant
train
rb
9166779003783f04a1238fe8487f211de87902ee
diff --git a/cytomine/tests/conftest.py b/cytomine/tests/conftest.py index <HASH>..<HASH> 100644 --- a/cytomine/tests/conftest.py +++ b/cytomine/tests/conftest.py @@ -71,7 +71,7 @@ def dataset(request): data["software_parameter"] = SoftwareParameter(random_string(), "Number", data["software"].id, 0, False, 1).save() data["abstract_image"] = AbstractImage(random_string(), "image/tiff").save() - data["abstract_image2"] = AbstractImage(random_string(), "image/tiff").save() + data["abstract_image2"] = AbstractImage(random_string(), "image/tiff", width=50, height=50).save() data["project"] = Project(random_string(), data["ontology"].id).save() data["image_instance"] = ImageInstance(data["abstract_image2"].id, data["project"].id).save()
Specify height and width of abstract image so that the annotations created in test_annotations are within image
cytomine_Cytomine-python-client
train
py
74a0b307b7c940fe45c51825d90e0d5c2fef6329
diff --git a/grammars/c/grammar_test.go b/grammars/c/grammar_test.go index <HASH>..<HASH> 100644 --- a/grammars/c/grammar_test.go +++ b/grammars/c/grammar_test.go @@ -86,5 +86,7 @@ func TestCParsing_Empty(t *testing.T) { } func TestCParsing_EmptyStruct(t *testing.T) { parseC_4t(t, `struct empty{};`) + parseC_4t(t, `struct {} empty;`) + parseC_4t(t, `struct empty {} empty;`) }
Expanded empty struct test.
pointlander_peg
train
go
ee63deb1be75151a6673575b1ff9f468dc611038
diff --git a/src/Cmsable/Cms/Action/Group.php b/src/Cmsable/Cms/Action/Group.php index <HASH>..<HASH> 100644 --- a/src/Cmsable/Cms/Action/Group.php +++ b/src/Cmsable/Cms/Action/Group.php @@ -232,5 +232,8 @@ class Group implements Countable, IteratorAggregate, ArrayAccess{ } - + public function newAction() + { + return new Action(); + } } \ No newline at end of file
Added newAction method to reduce boilerplate
mtils_cmsable
train
php
1ae4de58d1ecd7cb0eaf98a1db96cb7d151b81d7
diff --git a/cmd/bbs/main.go b/cmd/bbs/main.go index <HASH>..<HASH> 100644 --- a/cmd/bbs/main.go +++ b/cmd/bbs/main.go @@ -260,7 +260,7 @@ func main() { if err != nil { logger.Fatal("failed-to-connect-to-locket", err) } - locketClient := locketmodels.NewLocketClient(conn) + locketClient = locketmodels.NewLocketClient(conn) guid, err := uuid.NewV4() if err != nil {
actually assign locket client for fetching cells [#<I>]
cloudfoundry_bbs
train
go
50430dd72e5200d0b540d618f926480091f0dc54
diff --git a/src/components/wasd-controls.js b/src/components/wasd-controls.js index <HASH>..<HASH> 100644 --- a/src/components/wasd-controls.js +++ b/src/components/wasd-controls.js @@ -142,7 +142,7 @@ module.exports.Component = registerComponent('wasd-controls', { // Absolute. if (!rotation) { return directionVector; } - xRotation = this.data.fly ? 0 : rotation.x; + xRotation = this.data.fly ? rotation.x : 0; // Transform direction relative to heading. rotationEuler.set(THREE.Math.degToRad(xRotation), THREE.Math.degToRad(rotation.y), 0);
fix data.fly being applied in wasd-controls
aframevr_aframe
train
js
08b94afd516b8f75ca5c4cad50f84a4d40939776
diff --git a/src/Webiny/Component/Entity/EntityAbstract.php b/src/Webiny/Component/Entity/EntityAbstract.php index <HASH>..<HASH> 100755 --- a/src/Webiny/Component/Entity/EntityAbstract.php +++ b/src/Webiny/Component/Entity/EntityAbstract.php @@ -484,11 +484,11 @@ abstract class EntityAbstract implements \ArrayAccess try { // If simple ID or null - set and forget if (is_string($dataValue) || is_null($dataValue)) { - $entityAttribute->setValue($dataValue); + $entityAttribute->setValue($dataValue, $fromDb); continue; } - $entityAttribute->setValue($dataValue); + $entityAttribute->setValue($dataValue, $fromDb); } catch (ValidationException $e) { $validation[$attributeName] = $e; continue;
Pass $fromDb to Many2One attribute on populate from database
Webiny_Framework
train
php
d7598ee9d23d47540946795f204cb91e973528c5
diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/converters/markdown/redcarpet_parser.rb +++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb @@ -5,6 +5,7 @@ module Jekyll module CommonMethods def add_code_tags(code, lang) + code = code.to_s code = code.sub(/<pre>/, "<pre><code class=\"#{lang} language-#{lang}\" data-lang=\"#{lang}\">") code = code.sub(/<\/pre>/,"</code></pre>") end
Ensure inputted code is a string.
jekyll_jekyll
train
rb
d82511bfd8643a3fb6b0f01fdc492ecd2f40f5cc
diff --git a/example/002_HelloWorld/src/org/minimalj/example/helloworld2/UserNameEditor.java b/example/002_HelloWorld/src/org/minimalj/example/helloworld2/UserNameEditor.java index <HASH>..<HASH> 100644 --- a/example/002_HelloWorld/src/org/minimalj/example/helloworld2/UserNameEditor.java +++ b/example/002_HelloWorld/src/org/minimalj/example/helloworld2/UserNameEditor.java @@ -1,17 +1,16 @@ package org.minimalj.example.helloworld2; import org.minimalj.frontend.Frontend; -import org.minimalj.frontend.editor.Editor.NewObjectEditor; +import org.minimalj.frontend.editor.Editor.SimpleEditor; import org.minimalj.frontend.form.Form; -public class UserNameEditor extends NewObjectEditor<User> { +public class UserNameEditor extends SimpleEditor<User> { public UserNameEditor() { super("Greet"); } @Override - // this method could left out protected User createObject() { return new User(); }
UserNameEditor: don't use NewObjectEditor
BrunoEberhard_minimal-j
train
java
bcbe810317951e2d022287447a6ab206eff0954e
diff --git a/lib/runtime/context-n.js b/lib/runtime/context-n.js index <HASH>..<HASH> 100644 --- a/lib/runtime/context-n.js +++ b/lib/runtime/context-n.js @@ -4,8 +4,6 @@ var utils = require('compileit/lib/utils'); var Context = Generator.generate(function Context(data, props, context, cleanVars) { var _ = this; - utils.assertTypeError(data, 'object'); - _.data = data; _.props = props; _.context = context;
Update context-n.js Allow for looping of simple objects.
Mike96Angelo_Bars
train
js
5c84bb2a49220a6447e2e8a582e196f9934f92c9
diff --git a/src/Blueprint/View/View.php b/src/Blueprint/View/View.php index <HASH>..<HASH> 100644 --- a/src/Blueprint/View/View.php +++ b/src/Blueprint/View/View.php @@ -24,9 +24,9 @@ interface View public function __isset(string $var): bool; /** - * @return string + * @return string|false */ - public function render(): string; + public function render(); /** * @return array diff --git a/src/View/View.php b/src/View/View.php index <HASH>..<HASH> 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -121,10 +121,10 @@ class View implements \Peak\Blueprint\View\View } /** - * @return string + * @return string|false * @throws FileNotFoundException */ - public function render(): string + public function render() { $this->obN++; ob_start();
removed render return type, since the method could return a string or false
peakphp_framework
train
php,php
a06b5db5942770e790f47f56a38c34cd78ae51c2
diff --git a/cli/command/container/create.go b/cli/command/container/create.go index <HASH>..<HASH> 100644 --- a/cli/command/container/create.go +++ b/cli/command/container/create.go @@ -25,7 +25,7 @@ import ( // Pull constants const ( PullImageAlways = "always" - PullImageMissing = "missing" // Default (matches previous bahevior) + PullImageMissing = "missing" // Default (matches previous behavior) PullImageNever = "never" )
Update cli/command/container/create.go
docker_cli
train
go
b9a4aa227056ffd859af6f8f19fa16a877892fee
diff --git a/src/functions.php b/src/functions.php index <HASH>..<HASH> 100644 --- a/src/functions.php +++ b/src/functions.php @@ -31,7 +31,7 @@ use Symfony\Component\Console\Output\OutputInterface; * @param int $port * @return Builder */ -function server($name, $domain, $port = 22) +function server($name, $domain = null, $port = 22) { $deployer = Deployer::get();
Set domain to null since it is optional when using the fluent api
deployphp_deployer
train
php
b72faef15cc55f9e61dfbf7cea0988b05f4b9bed
diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index <HASH>..<HASH> 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -832,7 +832,7 @@ class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel): log.trace('Sending filtered data over publisher %s', pub_uri) # zmq filters are substring match, hash the topic # to avoid collisions - htopic = hashlib.sha1(topic).hexdigest() + htopic = salt.utils.stringutils.to_bytes(hashlib.sha1(topic).hexdigest()) pub_sock.send(htopic, flags=zmq.SNDMORE) pub_sock.send(payload) log.trace('Filtered data has been sent') @@ -840,7 +840,7 @@ class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel): else: # TODO: constants file for "broadcast" log.trace('Sending broadcasted data over publisher %s', pub_uri) - pub_sock.send('broadcast', flags=zmq.SNDMORE) + pub_sock.send(b'broadcast', flags=zmq.SNDMORE) pub_sock.send(payload) log.trace('Broadcasted data has been sent') else:
Ensure topic as bytes when zmq_filtering enabled when send multipart in zeromq, the first data should be bytes
saltstack_salt
train
py
0984c14ec8ba529039f6891f17d777a8273721d2
diff --git a/apps/full-site-editing/full-site-editing-plugin/global-styles/src/dom-updater.js b/apps/full-site-editing/full-site-editing-plugin/global-styles/src/dom-updater.js index <HASH>..<HASH> 100644 --- a/apps/full-site-editing/full-site-editing-plugin/global-styles/src/dom-updater.js +++ b/apps/full-site-editing/full-site-editing-plugin/global-styles/src/dom-updater.js @@ -58,7 +58,7 @@ export default ( options, getOptionValue ) => { Object.keys( currentOptions ).forEach( ( key ) => { declarationList += `${ cssVariables[ key ] }:${ currentOptions[ key ] };`; } ); - styleElement.textContent = `.editor-styles-wrapper{${ declarationList }}`; + styleElement.textContent = `.edit-post-visual-editor.editor-styles-wrapper{${ declarationList }}`; } ); } ); };
updated class name to set new styles under (#<I>)
Automattic_wp-calypso
train
js
576a1d3e78f0725d454e10c3d184117e5abef4db
diff --git a/indra/pipeline/pipeline.py b/indra/pipeline/pipeline.py index <HASH>..<HASH> 100644 --- a/indra/pipeline/pipeline.py +++ b/indra/pipeline/pipeline.py @@ -15,6 +15,14 @@ class AssemblyPipeline(): Ways to initialize and run the pipeline (examples assume you have a list of INDRA Statements stored in `stmts` variable.) + >>> from indra.statements import * + >>> map2k1 = Agent('MAP2K1', db_refs={'HGNC': '6840'}) + >>> mapk1 = Agent('MAPK1', db_refs={'HGNC': '6871'}) + >>> braf = Agent('BRAF') + >>> map2k1 = Agent('MAP2K1') + >>> stmts = [Phosphorylation(map2k1, mapk1, 'T', '185'), + ... Phosphorylation(braf, map2k1)] + 1) Provide a JSON file containing the steps and use a classmethod `from_json_file` and run it with `run` method on a list of statements. This option allows to store pipeline versions and reproduce the same
Provide stmts for examples
sorgerlab_indra
train
py
d2e1d559b7eeea6709209eea124e8ce08561259d
diff --git a/server/container_create.go b/server/container_create.go index <HASH>..<HASH> 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -588,11 +588,16 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string, } // TODO: volume handling in CRI-O - // right now, we do just mount tmpfs in order to have images like - // gcr.io/k8s-testimages/redis:e2e to work with CRI-O + // right now, we do just an mkdir in the container rootfs because we + // know kube manages volumes its own way and we don't need to behave + // like docker. + // For instance gcr.io/k8s-testimages/redis:e2e now work with CRI-O for dest := range containerImageConfig.Config.Volumes { - destOptions := []string{"mode=1777", "size=" + strconv.Itoa(64*1024*1024)} - specgen.AddTmpfsMount(dest, destOptions) + fp, err := symlink.FollowSymlinkInScope(filepath.Join(mountPoint, dest), mountPoint) + if err != nil { + return nil, err + } + os.MkdirAll(fp, 0644) } processArgs, err := buildOCIProcessArgs(containerConfig, containerImageConfig)
container_create: just mkdir on image's volumes tmpfs'es can override whatever there's on the container rootfs. We just mkdir the volume as we're confident kube manages volumes in container. We don't need any tmpfs nor any complex volume handling for now.
cri-o_cri-o
train
go
12168dec9e7b0ddab45d7f0b8da8be75c0c3c12f
diff --git a/src/collectors/PowerDNSCollector/PowerDNSCollector.py b/src/collectors/PowerDNSCollector/PowerDNSCollector.py index <HASH>..<HASH> 100644 --- a/src/collectors/PowerDNSCollector/PowerDNSCollector.py +++ b/src/collectors/PowerDNSCollector/PowerDNSCollector.py @@ -1,5 +1,6 @@ import diamond.collector import subprocess +import os class PowerDNSCollector(diamond.collector.Collector): """ @@ -24,6 +25,10 @@ class PowerDNSCollector(diamond.collector.Collector): } def collect(self): + if not os.access(self.config['pdns_control'], os.X_OK): + self.log.error(self.config['pdns_control']+" is not executable") + return False + sp = subprocess.Popen([self.config['pdns_control'], "list"], stdout=subprocess.PIPE) data = sp.communicate()[0] for metric in data.split(','):
Fixes #<I>, this verifies the binary is valid before attempting to run it
python-diamond_Diamond
train
py
92d4f32cfaf653e37faae567afeb458e58ef874c
diff --git a/src/string/title.js b/src/string/title.js index <HASH>..<HASH> 100644 --- a/src/string/title.js +++ b/src/string/title.js @@ -19,7 +19,7 @@ d3plus.string.title = function( text , key , vars ) { } if ( text.charAt(text.length-1) === "." ) { - return text.charAt(1).toUpperCase() + text.substr(1) + return text.charAt(0).toUpperCase() + text.substr(1) } var smalls = locale.lowercase,
fixed another "stupid" string.title bug
alexandersimoes_d3plus
train
js
663be2b1f77a47dbd129b114433d5782a068ba36
diff --git a/Kwc/Menu/EditableItems/Model.php b/Kwc/Menu/EditableItems/Model.php index <HASH>..<HASH> 100644 --- a/Kwc/Menu/EditableItems/Model.php +++ b/Kwc/Menu/EditableItems/Model.php @@ -30,6 +30,7 @@ class Kwc_Menu_EditableItems_Model extends Kwf_Model_Abstract } $childPagesComponentSelect = array(); + $childPagesComponentSelect['showInMenu'] = true; if ($whereId || (isset($whereEquals['ignore_visible']) && $whereEquals['ignore_visible'])
only load pages that are shown in menu
koala-framework_koala-framework
train
php
03b89cc7e4e2614bcd48bb0463798b3131557fd2
diff --git a/lib/veewee/provider/virtualbox/box/export_vagrant.rb b/lib/veewee/provider/virtualbox/box/export_vagrant.rb index <HASH>..<HASH> 100644 --- a/lib/veewee/provider/virtualbox/box/export_vagrant.rb +++ b/lib/veewee/provider/virtualbox/box/export_vagrant.rb @@ -119,7 +119,7 @@ module Veewee command_box_path = box_path is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) if is_windows - command_box_path = command_box_path.gsub(/^([A-Z])\:\/(.*)$/, '/\1/\2') + command_box_path = command_box_path.gsub(/^([A-Z])\:\/(.*)$/i, '/\1/\2') end command = "tar -cvf '#{command_box_path}' ." env.logger.debug(command)
Fix #<I>: make command_box_path.gsub pattern case-insensitive.
jedi4ever_veewee
train
rb
e3c162ebeda93cb77672a44b578719b82323eab4
diff --git a/Controller/Tool/WorkspaceParametersController.php b/Controller/Tool/WorkspaceParametersController.php index <HASH>..<HASH> 100644 --- a/Controller/Tool/WorkspaceParametersController.php +++ b/Controller/Tool/WorkspaceParametersController.php @@ -212,7 +212,6 @@ class WorkspaceParametersController extends Controller ); } else { $workspace->setName($wsRegisteredName); - $this->workspaceManager->replaceCode($workspace, $wsRegisteredCode); } $user = $this->security->getToken()->getUser(); diff --git a/Validator/Constraints/FileSizeValidator.php b/Validator/Constraints/FileSizeValidator.php index <HASH>..<HASH> 100644 --- a/Validator/Constraints/FileSizeValidator.php +++ b/Validator/Constraints/FileSizeValidator.php @@ -22,7 +22,7 @@ class FileSizeValidator extends ConstraintValidator { public function validate($value, Constraint $constraint) { - $validUnits = array('KB', 'MB', 'GB', 'TB'); + $validUnits = array('B', 'KB', 'MB', 'GB', 'TB'); $value = str_replace(' ', '', $value); $replacements = array('');
Minor bugfixes (workspace code renaming + workspace storage size constraints)
claroline_CoreBundle
train
php,php
dd56cf5f4731420c850dedeeb9bb812e7fb95083
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -655,8 +655,10 @@ Connection.prototype._apiAuthRequest = function(opts, callback) { return callback(errors.invalidJson()); } } else { - //console.log(body); - //return callback(errors.nonJsonResponse()); + // removing this for now since calling the _apiAuthRequest when + // revoking an oauth token doesn't return a JSON response, just + // a 200 response with an empty body. + // return callback(errors.nonJsonResponse()); } if(res.statusCode === 200) {
adding comments about removing the nonJsonResponse handling
kevinohara80_nforce
train
js