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
cb024294b4f3f10b65dcdd54f0bd96dd3ec87316
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index <HASH>..<HASH> 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -5,7 +5,7 @@ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] + wrap_parameters :format => [:json] end # Disable root element in JSON by default.
did not work with ruby <I>
next-l_enju_leaf
train
rb
1296e3d1747ce847a029b4c2d5cc569ed4794655
diff --git a/lib/kete_trackable_items/extensions/helpers/application_helper.rb b/lib/kete_trackable_items/extensions/helpers/application_helper.rb index <HASH>..<HASH> 100644 --- a/lib/kete_trackable_items/extensions/helpers/application_helper.rb +++ b/lib/kete_trackable_items/extensions/helpers/application_helper.rb @@ -64,11 +64,14 @@ ApplicationHelper.module_eval do html = String.new phrase = order.blank? ? t('application_helper.tracking_list_create_html.location_tracking') : t('application_helper.tracking_list_create_html.tracking_list_from_order') + basket = order.blank? ? @current_basket : order.basket + repositories = basket.repositories.count == 0 && + basket != @site_basket ? @site_basket.repositories : basket.repositories - if @current_basket.repositories.count > 0 - if @current_basket.repositories.count == 1 + if repositories.count > 0 + if repositories.count == 1 - url_hash = { :repository_id => @current_basket.repositories.first, + url_hash = { :repository_id => repositories.first, :method => :post } if order
Making basket and repositories resolve properly for order and/or non-site baskets without a repository.
kete_kete_trackable_items
train
rb
2df8c275f35b5ced84ca4fa64f7ba85dc02ba811
diff --git a/tests/fixtures/TenantResolver.php b/tests/fixtures/TenantResolver.php index <HASH>..<HASH> 100644 --- a/tests/fixtures/TenantResolver.php +++ b/tests/fixtures/TenantResolver.php @@ -2,11 +2,13 @@ namespace OwenIt\Auditing\Tests\fixtures; +use OwenIt\Auditing\Contracts\Auditable; use OwenIt\Auditing\Contracts\Resolver; class TenantResolver implements Resolver { - public static function resolve() + + public static function resolve(Auditable $auditable) { return 1; }
Fix test-resolver missing argument
owen-it_laravel-auditing
train
php
5441ba75d542878d1a1393573306cbde111aabea
diff --git a/lib/fastlane/lane_manager.rb b/lib/fastlane/lane_manager.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/lane_manager.rb +++ b/lib/fastlane/lane_manager.rb @@ -7,7 +7,23 @@ module Fastlane ff = Fastlane::FastFile.new(File.join(Fastlane::FastlaneFolder.path, 'Fastfile')) if lanes.count == 0 - raise "Please pass the name of the lane you want to drive. Available lanes: #{ff.runner.available_lanes.join(', ')}".red + loop do + Helper.log.error "You must provide a lane to drive. Available lanes:" + available = ff.runner.available_lanes + + available.each_with_index do |lane, index| + puts "#{index + 1}) #{lane}" + end + + i = gets.strip.to_i - 1 + if i >= 0 and (available[i] rescue nil) + lanes = [available[i]] + Helper.log.info "Driving the lane #{lanes.first}. Next time launch fastlane using `fastlane #{lanes.first}`".green + break # yeah + end + + Helper.log.error "Invalid input. Please enter the number of the lane you want to use".red + end end # Making sure the default '.env' and '.env.default' get loaded
Added lane selection if you don't specify one
fastlane_fastlane
train
rb
e9393191b73fe949906cfcffc110f4b56799756f
diff --git a/core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java b/core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java +++ b/core/src/main/java/com/orientechnologies/orient/core/config/OStorageConfiguration.java @@ -478,10 +478,7 @@ public class OStorageConfiguration implements OSerializableStream { indexEngines.put(name.toLowerCase(getLocaleInstance()), indexEngineData); } } - - // SET FLAGS - strictSQL = "true".equalsIgnoreCase("strictSQL"); - txRequiredForSQLGraphOperations = "true".equalsIgnoreCase("txRequiredForSQLGraphOperations"); + } public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException {
Remove wrong fix on configuration read from stream
orientechnologies_orientdb
train
java
57ff65d4233ca4d754ae9d5b218d637dcd58f047
diff --git a/php/class-wp-cli.php b/php/class-wp-cli.php index <HASH>..<HASH> 100644 --- a/php/class-wp-cli.php +++ b/php/class-wp-cli.php @@ -661,7 +661,11 @@ class WP_CLI { * @param CompositeCommand $old_command Command that was already registered. * @param CompositeCommand $new_command New command that is being added. */ - private static function merge_sub_commands( $command_to_keep, $old_command, $new_command ) { + private static function merge_sub_commands( + CompositeCommand $command_to_keep, + CompositeCommand $old_command, + CompositeCommand $new_command + ) { foreach ( $old_command->get_subcommands() as $subname => $subcommand ) { $command_to_keep->add_subcommand( $subname, $subcommand, false ); }
Enforce types for merge_sub_commands()
wp-cli_wp-cli
train
php
26aa33d4f42e210792d4a264707e62ea34ae278e
diff --git a/lib/eye/patch/capistrano.rb b/lib/eye/patch/capistrano.rb index <HASH>..<HASH> 100644 --- a/lib/eye/patch/capistrano.rb +++ b/lib/eye/patch/capistrano.rb @@ -7,14 +7,14 @@ Capistrano::Configuration.instance.load do if fetch(:eye_default_hooks) after "deploy:stop", "eye:stop" - after "deploy:start", "eye:start" + after "deploy:start", "eye:load" before "deploy:restart", "eye:restart" end namespace :eye do desc "Start eye with the desired configuration file" - task :start, roles: -> { fetch(:eye_roles) } do + task :load, roles: -> { fetch(:eye_roles) } do run "cd #{current_path} && #{fetch(:eye_bin)} l #{fetch(:eye_config)}" end @@ -28,4 +28,6 @@ Capistrano::Configuration.instance.load do run "cd #{current_path} && #{fetch(:eye_bin)} r all" end end + + before "eye:restart", "eye:load" end
Reload eye configuration before restart on deploy
tablexi_eye-patch
train
rb
e330533db78099343c68d69da1421f59f5dcafc1
diff --git a/views/partials/sidebar-left.blade.php b/views/partials/sidebar-left.blade.php index <HASH>..<HASH> 100644 --- a/views/partials/sidebar-left.blade.php +++ b/views/partials/sidebar-left.blade.php @@ -1,4 +1,4 @@ -<div class="grid-md-4 grid-lg-3"> +<aside class="grid-md-4 grid-lg-3"> <?php global $post; $childOf = isset(array_reverse(get_post_ancestors($post))[1]) ? array_reverse(get_post_ancestors($post))[1] : get_option('page_on_front'); @@ -21,4 +21,4 @@ <?php endif; ?> <?php dynamic_sidebar('left-sidebar'); ?> -</div> +</aside>
Sidebar from div element to aside element
helsingborg-stad_Municipio
train
php
5d1d3c9ec95f8bf6c7d1a73befbd3e8b4458363d
diff --git a/tensorflow_datasets/image_classification/food101.py b/tensorflow_datasets/image_classification/food101.py index <HASH>..<HASH> 100644 --- a/tensorflow_datasets/image_classification/food101.py +++ b/tensorflow_datasets/image_classification/food101.py @@ -69,7 +69,7 @@ class Food101(tfds.core.GeneratorBasedBuilder): description=(_DESCRIPTION), features=tfds.features.FeaturesDict(features_dict), supervised_keys=("image", "label"), - homepage="https://www.vision.ee.ethz.ch/datasets_extra/food-101/", + homepage="https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/", citation=_CITATION) def _split_generators(self, dl_manager):
Updating faulty link in food<I>.py file The homepage link to the Food<I> paper given in the file was wrong leading to a <I> error Added the correct link to the Food<I> paper
tensorflow_datasets
train
py
d7b99236f2f5ea2b3594c70a2800662cab9043ae
diff --git a/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java b/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java index <HASH>..<HASH> 100644 --- a/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java +++ b/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java @@ -83,6 +83,8 @@ public class ConsequenceTypeMappings { termToAccession.put("CpG_island", 307); termToAccession.put("DNAseI_hypersensitive_site", 685); termToAccession.put("polypeptide_variation_site", 336); + termToAccession.put("protein_altering_variant", 1818); + termToAccession.put("start_lost", 2012); // Fill the accession to term map for(String key : termToAccession.keySet()) {
ConsequenceTypeMappings: added two new terms
opencb_biodata
train
java
b5e7a45b4106ea46de6d031a8592419e6f38a139
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -726,17 +726,19 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate } /** - * Partition the collection into two array using the given callback. + * Partition the collection into two arrays using the given callback or key. * - * @param callable $callback + * @param callable|string $callback * @return array */ - public function partition(callable $callback) + public function partition($callback) { $partitions = [new static(), new static()]; + $callback = $this->valueRetriever($callback); + foreach ($this->items as $item) { - $partitions[! (int) $callback($item)][] = $item; + $partitions[(int) ! $callback($item)][] = $item; } return $partitions;
Allow passing a key to the partition method in the collection class.
illuminate_support
train
php
8ff27c0c89e9377b848af7c291afd12d66f9a024
diff --git a/packages/node_modules/@webex/internal-plugin-devices/test/integration/spec/devices.js b/packages/node_modules/@webex/internal-plugin-devices/test/integration/spec/devices.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/internal-plugin-devices/test/integration/spec/devices.js +++ b/packages/node_modules/@webex/internal-plugin-devices/test/integration/spec/devices.js @@ -421,9 +421,9 @@ describe('plugin-devices', () => { }); describe('when the priority host cannot be mapped', () => { - beforeEach('remove postauth services', () => { - /* eslint-disable-next-line no-underscore-dangle */ - services._getCatalog().serviceGroups.postauth = []; + beforeEach('stub priority host url converting', () => { + services.convertUrlToPriorityHostUrl = sinon.stub(); + services.convertUrlToPriorityHostUrl.returns(undefined); }); it('should return a rejected promise',
test(internal-plugin-devices): improve websocket retrieval Update the test suite to validate that the web socket retrieval method updates work as expected.
webex_spark-js-sdk
train
js
cde364bf271e6aa22df8ce581dbde89675ce3207
diff --git a/core/server/services/bulk-email/index.js b/core/server/services/bulk-email/index.js index <HASH>..<HASH> 100644 --- a/core/server/services/bulk-email/index.js +++ b/core/server/services/bulk-email/index.js @@ -221,8 +221,8 @@ module.exports = { recipient.member_first_name = (recipient.member_name || '').split(' ')[0]; // dynamic data from replacements - replacements.forEach((id, recipientProp, fallback) => { - data[id] = recipient[recipientProp] || fallback || ''; + replacements.forEach(({id, recipientProperty, fallback}) => { + data[id] = recipient[recipientProperty] || fallback || ''; }); recipientData[recipient.member_email] = data;
🐛 Fixed email card replacements showing raw replacement text in emails closes <URL>
TryGhost_Ghost
train
js
c175e03663cd5b5aad058b04006bd466073069d5
diff --git a/lib/snowy_owl/version.rb b/lib/snowy_owl/version.rb index <HASH>..<HASH> 100644 --- a/lib/snowy_owl/version.rb +++ b/lib/snowy_owl/version.rb @@ -1,3 +1,3 @@ module SnowyOwl - VERSION = "0.1.1" + VERSION = "0.1.2" end
[hy] release <I>
hanystudy_snowy_owl
train
rb
af94f16e958b98711945a94a3c3ea24bd60b0179
diff --git a/spyder/preferences/configdialog.py b/spyder/preferences/configdialog.py index <HASH>..<HASH> 100644 --- a/spyder/preferences/configdialog.py +++ b/spyder/preferences/configdialog.py @@ -143,6 +143,7 @@ class ConfigDialog(QDialog): # Widgets self.pages_widget = QStackedWidget() + self.pages_widget.setMinimumWidth(600) self.contents_widget = QListWidget() self.button_reset = QPushButton(_('Reset to defaults')) @@ -162,6 +163,7 @@ class ConfigDialog(QDialog): self.contents_widget.setSpacing(1) self.contents_widget.setCurrentRow(0) self.contents_widget.setMinimumWidth(220) + self.contents_widget.setMinimumHeight(400) # Layout hsplitter = QSplitter()
Preferences: Add minimum width for its pages and height for its contents
spyder-ide_spyder
train
py
e341acf87bb88501173dd127a9cd85eb007c20c3
diff --git a/src/MadeYourDay/Contao/CustomElements.php b/src/MadeYourDay/Contao/CustomElements.php index <HASH>..<HASH> 100644 --- a/src/MadeYourDay/Contao/CustomElements.php +++ b/src/MadeYourDay/Contao/CustomElements.php @@ -976,8 +976,15 @@ class CustomElements public static function loadConfig($bypassCache = false) { // Don't load the config in the install tool - if (\Environment::get('script') === 'contao/install.php') { - return; + if (version_compare(VERSION, '4.0', '>=')) { + if (\System::getContainer()->get('request')->get('_route') === 'contao_backend_install') { + return; + } + } + else { + if (\Environment::get('script') === 'contao/install.php') { + return; + } } $filePaths = static::getCacheFilePaths();
Added compatibility for Contao 4
madeyourday_contao-rocksolid-custom-elements
train
php
3164c71aa621c92c83ccbe4db5688f59f418e157
diff --git a/languages/perl.php b/languages/perl.php index <HASH>..<HASH> 100644 --- a/languages/perl.php +++ b/languages/perl.php @@ -50,7 +50,7 @@ class LuminousPerlScanner extends LuminousSimpleScanner { $stack--; if (!$stack) $close_delimiter_match = $next[1][2]; - $finish = $next[0]; + $finish = $next[0] + strlen($next[1][1]); } else assert(0); $this->pos($next[0] + strlen($next[1][0]));
fix perl gobbling backslashes, sometimes
markwatkinson_luminous
train
php
9e9bd677f66285117be1f77ffe70877ab860ee0a
diff --git a/code/MSSQLDatabaseConfigurationHelper.php b/code/MSSQLDatabaseConfigurationHelper.php index <HASH>..<HASH> 100644 --- a/code/MSSQLDatabaseConfigurationHelper.php +++ b/code/MSSQLDatabaseConfigurationHelper.php @@ -53,10 +53,8 @@ class MSSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper { /** * Ensure a database connection is possible using credentials provided. - * The established connection resource is returned with the results as well. - * * @param array $databaseConfig Associative array of db configuration, e.g. "server", "username" etc - * @return array Result - e.g. array('success' => true, 'connection' => mssql link, 'error' => 'details of error') + * @return array Result - e.g. array('success' => true, 'error' => 'details of error') */ public function requireDatabaseConnection($databaseConfig) { $success = false; @@ -80,7 +78,6 @@ class MSSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper { return array( 'success' => $success, - 'connection' => $conn, 'error' => $error ); }
MINOR Removed return of connection which is not used any longer
silverstripe_silverstripe-mssql
train
php
a30aec99fd39978b0532ea6f3e1027f34675af34
diff --git a/cake/dispatcher.php b/cake/dispatcher.php index <HASH>..<HASH> 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -136,13 +136,13 @@ class Dispatcher extends Object { ))); } - $privateAction = (bool)(strpos($this->params['action'], '_', 0) === 0); + $privateAction = $this->params['action'][0] === '_'; $prefixes = Router::prefixes(); if (!empty($prefixes)) { if (isset($this->params['prefix'])) { $this->params['action'] = $this->params['prefix'] . '_' . $this->params['action']; - } elseif (strpos($this->params['action'], '_') !== false && !$privateAction) { + } elseif (strpos($this->params['action'], '_') > 0) { list($prefix, $action) = explode('_', $this->params['action']); $privateAction = in_array($prefix, $prefixes); }
Applying patch from 'robustsolution' for optimization in Dispatcher::dispatch. Fixes #<I>
cakephp_cakephp
train
php
cde1d706afb16ef3a48eeef414310da9ae75aa36
diff --git a/tests/test_fields/test_field_tracker.py b/tests/test_fields/test_field_tracker.py index <HASH>..<HASH> 100644 --- a/tests/test_fields/test_field_tracker.py +++ b/tests/test_fields/test_field_tracker.py @@ -189,6 +189,7 @@ class FieldTrackerTests(FieldTrackerTestCase, FieldTrackerCommonTests): # has_changed() returns False for deferred fields, without un-deferring them. # Use an if because ModelTracked doesn't support has_changed() in this case. if self.tracked_class == Tracked: + self.assertFalse(item.tracker.has_changed('number')) if django.VERSION >= (1, 10): self.assertTrue('number' in item.get_deferred_fields()) else:
Cover a branch in `has_changed`.
jazzband_django-model-utils
train
py
dcb24af95d38710ca0634c63dd017ac40ba139f0
diff --git a/gbdxtools/images/worldview.py b/gbdxtools/images/worldview.py index <HASH>..<HASH> 100644 --- a/gbdxtools/images/worldview.py +++ b/gbdxtools/images/worldview.py @@ -36,8 +36,7 @@ class WorldViewImage(RDABaseImage): @staticmethod def _find_parts(cat_id, band_type): - query = "item_type:IDAHOImage AND attributes.catalogID:{} " \ - "AND attributes.colorInterpretation:{}".format(cat_id, band_types[band_type]) + query = "item_type:IDAHOImage AND attributes.catalogID:{}".format(cat_id) _parts = vector_services_query(query) if not len(_parts): raise MissingIdahoImages('Unable to find IDAHO imagery in the catalog: {}'.format(query))
worldview parts method now returns all idaho image parts for an image
DigitalGlobe_gbdxtools
train
py
aac122ae011492e0e739be4514f30c63300001e8
diff --git a/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java b/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java index <HASH>..<HASH> 100644 --- a/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java +++ b/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java @@ -270,6 +270,11 @@ final class ConfigDelayedMerge extends AbstractConfigValue implements Unmergeabl render(stack, sb, indent, atRoot, atKey, options); } + @Override + protected void render(StringBuilder sb, int indent, boolean atRoot, ConfigRenderOptions options) { + render(sb, indent, atRoot, null, options); + } + // static method also used by ConfigDelayedMergeObject. static void render(List<AbstractConfigValue> stack, StringBuilder sb, int indent, boolean atRoot, String atKey, ConfigRenderOptions options) {
Fix toString of ConfigDelayedMerge, the default render() in superclass didn't work The superclass called unwrapped() to render, which isn't allowed here.
lightbend_config
train
java
64bb0719e99409f7038cea392706212f80ec59da
diff --git a/lib/fezzik.rb b/lib/fezzik.rb index <HASH>..<HASH> 100644 --- a/lib/fezzik.rb +++ b/lib/fezzik.rb @@ -3,8 +3,8 @@ require "thread" require "rake" require "rake/remote_task" require "colorize" -require "fezzik/base.rb" -require "fezzik/environment.rb" -require "fezzik/io.rb" -require "fezzik/util.rb" -require "fezzik/version.rb" +require "fezzik/base" +require "fezzik/environment" +require "fezzik/io" +require "fezzik/util" +require "fezzik/version"
Delete .rb from some requires
dmac_fezzik
train
rb
8e85a8bbead0b548b9bf56a908a1e607d63f9106
diff --git a/hug/test.py b/hug/test.py index <HASH>..<HASH> 100644 --- a/hug/test.py +++ b/hug/test.py @@ -76,10 +76,13 @@ for method in HTTP_METHODS: globals()[method.lower()] = tester -def cli(method, *args, **arguments): +def cli(method, *args, api=None, module=None, **arguments): """Simulates testing a hug cli method from the command line""" - collect_output = arguments.pop('collect_output', True) + if api and module: + raise ValueError("Please specify an API OR a Module that contains the API, not both") + elif api or module: + method = API(api or module).cli.commands[method].interface._function command_args = [method.__name__] + list(args) for name, values in arguments.items():
Add ability to test against API for CLI methods
hugapi_hug
train
py
790413cbb96dc3dea2f441fa90ad3359ceb33362
diff --git a/jsf/injection/src/main/java/org/jboss/as/jsf/injection/weld/WeldApplicationFactory.java b/jsf/injection/src/main/java/org/jboss/as/jsf/injection/weld/WeldApplicationFactory.java index <HASH>..<HASH> 100644 --- a/jsf/injection/src/main/java/org/jboss/as/jsf/injection/weld/WeldApplicationFactory.java +++ b/jsf/injection/src/main/java/org/jboss/as/jsf/injection/weld/WeldApplicationFactory.java @@ -28,6 +28,13 @@ public class WeldApplicationFactory extends ForwardingApplicationFactory { private volatile Application application; + // This private constructor must never be called, but it is here to suppress the WELD-001529 warning + // that an InjectionTarget is created for this class with no appropriate constructor. + private WeldApplicationFactory() { + super(); + applicationFactory = null; + } + public WeldApplicationFactory(ApplicationFactory applicationFactory) { this.applicationFactory = applicationFactory; }
WFLY-<I> CDI JSF apps get WELD-<I> warning
wildfly_wildfly
train
java
af1503bae6cd22db591ed7f20962c5e71e85e74b
diff --git a/vendor/Krystal/Validate/Pattern/PerPageCount.php b/vendor/Krystal/Validate/Pattern/PerPageCount.php index <HASH>..<HASH> 100644 --- a/vendor/Krystal/Validate/Pattern/PerPageCount.php +++ b/vendor/Krystal/Validate/Pattern/PerPageCount.php @@ -27,8 +27,10 @@ final class PerPageCount extends AbstractPattern 'Numeric' => array( 'message' => 'Per page count must be numeric', ), - - //@TODO Min 1 + 'GreaterThan' => array( + 'value' => 0, + 'message' => 'Per page count must be greater than 0' + ) ) )); }
Added greater than 0 restriction to per page pattern
krystal-framework_krystal.framework
train
php
cfec9e53005d7381318401b47e55bc4b3bde822d
diff --git a/tests/ExpressGatewayTest.php b/tests/ExpressGatewayTest.php index <HASH>..<HASH> 100644 --- a/tests/ExpressGatewayTest.php +++ b/tests/ExpressGatewayTest.php @@ -101,7 +101,8 @@ class ExpressGatewayTest extends GatewayTestCase 'currency' => 'BYR' ))->send(); - $httpRequest = $this->getMockedRequests()[0]; + $httpRequests = $this->getMockedRequests(); + $httpRequest = $httpRequests[0]; $queryArguments = $httpRequest->getQuery()->toArray(); $this->assertSame('GET_TOKEN', $queryArguments['TOKEN']); $this->assertSame('GET_PAYERID', $queryArguments['PAYERID']); @@ -126,7 +127,8 @@ class ExpressGatewayTest extends GatewayTestCase 'payerid' => 'CUSTOM_PAYERID' ))->send(); - $httpRequest = $this->getMockedRequests()[0]; + $httpRequests = $this->getMockedRequests(); + $httpRequest = $httpRequests[0]; $queryArguments = $httpRequest->getQuery()->toArray(); $this->assertSame('CUSTOM_TOKEN', $queryArguments['TOKEN']); $this->assertSame('CUSTOM_PAYERID', $queryArguments['PAYERID']);
Fixed PHP<I> distaste of index access after function call: ()[0]
thephpleague_omnipay-paypal
train
php
0390c3180d8c198779d98445237eaa035dddd51b
diff --git a/lib/sprockets/digest_utils.rb b/lib/sprockets/digest_utils.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets/digest_utils.rb +++ b/lib/sprockets/digest_utils.rb @@ -80,6 +80,9 @@ module Sprockets digest << val.to_s } end + + ADD_VALUE_TO_DIGEST.compare_by_identity.rehash + ADD_VALUE_TO_DIGEST.default_proc = ->(_, val) { raise TypeError, "couldn't digest #{ val }" }
Speed up Hash lookups with constants Since we are always looking up these hashes with an identical duplicate (not just the same value, the same object) we can take advantage of Hash.compare_by_identity. Suggested by @dgynn in <URL>
rails_sprockets
train
rb
88423c26a25c98039472442fe3e2d4a0de35f180
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -22,7 +22,7 @@ function Queue(options) { EventEmitter.call(this); options = options || {}; - this.concurrency = options.concurrency || 1; + this.concurrency = options.concurrency || Infinity; this.timeout = options.timeout || 0; this.pending = 0; this.session = 0;
change default concurrency to Infinity
jessetane_queue
train
js
33ffb17c9780db93e44bc9daaa284d4809940a95
diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js index <HASH>..<HASH> 100644 --- a/src/windows/CameraProxy.js +++ b/src/windows/CameraProxy.js @@ -176,7 +176,14 @@ function takePictureFromFileWP(successCallback, errorCallback, args) { else { var storageFolder = Windows.Storage.ApplicationData.current.localFolder; file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) { - successCallback(URL.createObjectURL(storageFile)); + if(destinationType == Camera.DestinationType.NATIVE_URI) { + successCallback("ms-appdata:///local/" + storageFile.name); + } + else { + successCallback(URL.createObjectURL(storageFile)); + } + + }, function () { errorCallback("Can't access localStorage folder."); });
Patch for CB-<I>, this closes #<I>
apache_cordova-plugin-camera
train
js
7c829f38844c395e585802953f92c273365fb10b
diff --git a/hazelcast/src/test/java/com/hazelcast/collection/SetTransactionTest.java b/hazelcast/src/test/java/com/hazelcast/collection/SetTransactionTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/collection/SetTransactionTest.java +++ b/hazelcast/src/test/java/com/hazelcast/collection/SetTransactionTest.java @@ -10,6 +10,7 @@ import com.hazelcast.test.annotation.QuickTest; import com.hazelcast.transaction.TransactionContext; import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -19,6 +20,7 @@ import static org.junit.Assert.*; @RunWith(HazelcastParallelClassRunner.class) @Category(ProblematicTest.class) +@Ignore public class SetTransactionTest { static HazelcastInstance instance1;
Explicitly ignored SetTransactionTest because of long running time
hazelcast_hazelcast
train
java
9ada4f548c0189bb702cc9f23ce5ab802e9ebaed
diff --git a/lib/to_lang/string_methods.rb b/lib/to_lang/string_methods.rb index <HASH>..<HASH> 100644 --- a/lib/to_lang/string_methods.rb +++ b/lib/to_lang/string_methods.rb @@ -28,25 +28,19 @@ module ToLang case method.to_s when /^to_(.*)_from_(.*)$/ if CODEMAP[$1] && CODEMAP[$2] - define_and_call_method(method) do - translate(CODEMAP[$1], :from => CODEMAP[$2]) - end + define_and_call_method(method) { translate(CODEMAP[$1], :from => CODEMAP[$2]) } else original_method_missing(method, *args, block) end when /^from_(.*)_to_(.*)$/ if CODEMAP[$1] && CODEMAP[$2] - define_and_call_method(method) do - translate(CODEMAP[$2], :from => CODEMAP[$1]) - end + define_and_call_method(method) { translate(CODEMAP[$2], :from => CODEMAP[$1]) } else original_method_missing(method, *args, block) end when /^to_(.*)$/ if CODEMAP[$1] - define_and_call_method(method) do - translate(CODEMAP[$1]) - end + define_and_call_method(method) { translate(CODEMAP[$1]) } else original_method_missing(method, *args, block) end
favor braces over do/end for further terseness
jimmycuadra_to_lang
train
rb
537091a5e986f4aee3ec7cb21a7086bbb06b9fa0
diff --git a/sublimedsl/keymap.py b/sublimedsl/keymap.py index <HASH>..<HASH> 100644 --- a/sublimedsl/keymap.py +++ b/sublimedsl/keymap.py @@ -260,11 +260,6 @@ class Context(): self.match_all = None self._parent = parent - for op in self._OPERATORS: - func = partial(self._operator, op) - func.__name__ = op - setattr(self.__class__, op, func) - def all(self): """ Require the test to succeed for all selections. @@ -306,6 +301,11 @@ class Context(): self.operand = operand return self._parent or self + def __getattr__(self, name): + if name in self._OPERATORS: + return partial(self._operator, name) + raise AttributeError + def __str__(self): return jsonify(self, indent=None)
Fix wrongly defined operator methods in Context This is equivalent to method_missing in Ruby. A better solution would be to correctly define the methods dynamically on the class, but that's unnecessarily complicated. Python <I> added handy function partialmethod that would be ideal for this case, but I should keep sublimedsl compatible at least with <I>.
jirutka_sublimedsl
train
py
3c6ed0af51c9967b3e8a2f845f588322181bc06d
diff --git a/lib/acmesmith/command.rb b/lib/acmesmith/command.rb index <HASH>..<HASH> 100644 --- a/lib/acmesmith/command.rb +++ b/lib/acmesmith/command.rb @@ -81,6 +81,7 @@ module Acmesmith acme.new_certificate(csr) rescue Acme::Client::Error::Unauthorized => e raise unless config.auto_authorize_on_request + raise if retried puts "=> Authorizing unauthorized domain names" # https://github.com/letsencrypt/boulder/blob/b9369a481415b3fe31e010b34e2ff570b89e42aa/ra/ra.go#L604 @@ -95,7 +96,7 @@ module Acmesmith puts " * #{domains.join(', ')}" authorize(*domains) retried = true - retry unless retried + retry end cert = Certificate.from_acme_client_certificate(acme_cert)
Oops, it didn't work...
sorah_acmesmith
train
rb
fbf905a674299c6b4f850b51d0637e1665f77d56
diff --git a/config/local.js b/config/local.js index <HASH>..<HASH> 100644 --- a/config/local.js +++ b/config/local.js @@ -3,7 +3,7 @@ module.exports = { /** * Core-Node config */ - endpointPath: __dirname + '/../endpoints/', + endpointPath: `${process.cwd()}/api`, endpointParent: __dirname + '/../lib/endpoint.js', /**
feat: enable 0 config setup - use /api in cwd as standard folder for endpoints
cubic-js_cubic
train
js
c5ee84819bfa075883cc9a739dcf30741af2667e
diff --git a/packages/components/bolt-link/src/link.js b/packages/components/bolt-link/src/link.js index <HASH>..<HASH> 100644 --- a/packages/components/bolt-link/src/link.js +++ b/packages/components/bolt-link/src/link.js @@ -153,21 +153,15 @@ class BoltLink extends withLitHtml() { switch (name) { case 'before': case 'after': - const iconClasses = cx('c-bolt-link__icon', { - 'is-empty': name in this.slots === false, - }); - - return html` - <span class="${iconClasses}" - >${ - name in this.slots - ? this.slot(name) - : html` - <slot name="${name}" /> - ` - }</span - > - `; + const iconClasses = cx('c-bolt-link__icon'); + + return name in this.slots + ? html` + <span class="${iconClasses}">${this.slot(name)}</span> + ` + : html` + <slot name="${name}" /> + `; default: const itemClasses = cx('c-bolt-link__text', { 'is-empty': name in this.slots === false,
feature: only output icon wrapper span when slot has content
bolt-design-system_bolt
train
js
2a3b37ea41a95352826ed9956561f916a049a2c1
diff --git a/src/Crypto.php b/src/Crypto.php index <HASH>..<HASH> 100644 --- a/src/Crypto.php +++ b/src/Crypto.php @@ -60,7 +60,7 @@ class Crypto // TODO: requester public key - if ($transaction->recipientId) { + if (isset($transaction->recipientId)) { $out .= \BitWasp\Bitcoin\Base58::decodeCheck($transaction->recipientId)->getBinary(); } else { $out .= pack('x21');
fix: check if recipient is set
ArkEcosystem_php-crypto
train
php
56bafbdb5dd727d8f9fe8922945baf55c5b38d14
diff --git a/envy.go b/envy.go index <HASH>..<HASH> 100644 --- a/envy.go +++ b/envy.go @@ -68,8 +68,16 @@ func loadEnv() { } } +// Mods returns true if module support is enabled, false otherwise +// See https://github.com/golang/go/wiki/Modules#how-to-install-and-activate-module-support for details func Mods() bool { - return Get(GO111MODULE, "off") == "on" + go111 := Get(GO111MODULE, "") + + if !InGoPath() { + return go111 != "off" + } + + return go111 == "on" } // Reload the ENV variables. Useful if diff --git a/envy_test.go b/envy_test.go index <HASH>..<HASH> 100644 --- a/envy_test.go +++ b/envy_test.go @@ -31,6 +31,10 @@ func Test_Mods(t *testing.T) { r.False(Mods()) Set(GO111MODULE, "on") r.True(Mods()) + Set(GO111MODULE, "auto") + r.Equal(!InGoPath(), Mods()) + Set(GO111MODULE, "") + r.Equal(!InGoPath(), Mods()) }) }
envy.Mods() - Modify behavior to better match the current module autodetection in place in go (#<I>) Add tests for GO<I>MODULE being set to auto or being left blank.
gobuffalo_envy
train
go,go
75acf1bc2c04e2ac5602aadd2709460a7fc1336c
diff --git a/teensy_minimal_rpc/proxy.py b/teensy_minimal_rpc/proxy.py index <HASH>..<HASH> 100644 --- a/teensy_minimal_rpc/proxy.py +++ b/teensy_minimal_rpc/proxy.py @@ -350,7 +350,8 @@ try: adc_sampler = AdcSampler(self, channels, sample_count) adc_sampler.reset() adc_sampler.start_read(sampling_rate_hz) - df_adc_results = adc_sampler.get_results().astype('int16') + dtype = 'int16' if differential else 'uint16' + df_adc_results = adc_sampler.get_results().astype(dtype) df_volts = reference_V * (df_adc_results / (1 << (resolution + adc_settings.gain_power)))
Return unsigned integers if not differential mode
wheeler-microfluidics_dropbot-dx
train
py
837279279f2c8391ab341e554f905395dce30339
diff --git a/tests/test_examples.py b/tests/test_examples.py index <HASH>..<HASH> 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -32,7 +32,7 @@ def compare_text(example_filename, output_text): saved_text = infile.read() assert output_text == saved_text -def similar_images(orig_image, new_image, tol=1.0e-1): +def similar_images(orig_image, new_image, tol=1.0e-6): """Compare two PIL image objects and return a boolean True/False of whether they are similar (True) or not (False). "tol" is a unitless float between 0-1 that does not depend on the size of the images."""
Fix mistaken threshold value in image comparison that crept in somewhere
joferkington_mplstereonet
train
py
3397a8a1cb93663079eb12a16b1f2af573614447
diff --git a/grimoire_elk/utils.py b/grimoire_elk/utils.py index <HASH>..<HASH> 100755 --- a/grimoire_elk/utils.py +++ b/grimoire_elk/utils.py @@ -225,8 +225,11 @@ def get_kibiter_version(url): The url must point to the Elasticsearch used by Kibiter """ - config_url = '/.kibana/config/_search' - url += "/" + config_url + config_url = '.kibana/config/_search' + # Avoid having // in the URL because ES will fail + if url[-1] != '/': + url += "/" + url += config_url r = requests.get(url) r.raise_for_status() version = r.json()['hits']['hits'][0]['_id']
Avoid adding '//' to URL to be used with Elasticsearch API REST because the API REST petition will fail if '//' are in the URL path.
chaoss_grimoirelab-elk
train
py
6e7a0ce1b29e1df965e4b1db08a5275b68334c17
diff --git a/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js b/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js +++ b/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js @@ -1762,8 +1762,8 @@ function loadAdminPage() { var newStreamProperties = $(".newStreamProperty"); for (var i = 0; i < newStreamProperties.length; i += 2) { newConfig["property"].push({ - "name": $(newStreamProperties[i]).val(), - "value": $(newStreamProperties[i + 1]).val(), + "name": encodeURIComponent($(newStreamProperties[i]).val()), + "value": encodeURIComponent($(newStreamProperties[i + 1]).val()), }); }
VMC-<I> : URLEncoded data to pass special characters.
VoltDB_voltdb
train
js
949e4d79d3ec8aa64d814d85d1db5376879b877a
diff --git a/aeron-client/src/main/java/io/aeron/Aeron.java b/aeron-client/src/main/java/io/aeron/Aeron.java index <HASH>..<HASH> 100644 --- a/aeron-client/src/main/java/io/aeron/Aeron.java +++ b/aeron-client/src/main/java/io/aeron/Aeron.java @@ -66,7 +66,7 @@ public final class Aeron implements AutoCloseable /** * Duration in nanoseconds for which the client conductor will sleep between duty cycles. */ - public static final long IDLE_SLEEP_NS = TimeUnit.MILLISECONDS.toNanos(10); + public static final long IDLE_SLEEP_NS = TimeUnit.MILLISECONDS.toNanos(16); /** * Default interval between sending keepalive control messages to the driver.
[Java] Increase idle sleep from <I> to <I>ms in client conductor duty cycle.
real-logic_aeron
train
java
b478dbea7b13cac3937975ca6b72c95f6672e3cd
diff --git a/malcolm/modules/stats/parts/statspart.py b/malcolm/modules/stats/parts/statspart.py index <HASH>..<HASH> 100644 --- a/malcolm/modules/stats/parts/statspart.py +++ b/malcolm/modules/stats/parts/statspart.py @@ -392,7 +392,10 @@ class StatsPart(parts.ChildPart): '/dls_sw/work', '/dls_sw/prod') - self.stats["pymalcolm_ver"] = version.__version__ + if self.stats["pymalcolm_path"].startswith('/dls_sw/prod'): + self.stats["pymalcolm_ver"] = version.__version__ + else: + self.stats["pymalcolm_ver"] = "Work" hostname = os.uname()[1] self.stats["kernel"] = "%s %s" % (os.uname()[0], os.uname()[2]) self.stats["hostname"] = hostname if len(hostname) < 39 else hostname[
check if pymalcolm is running from prod before setting version stat
dls-controls_pymalcolm
train
py
1e42fc6742e001fc47f199dc456099168e55123c
diff --git a/bika/lims/browser/worksheet.py b/bika/lims/browser/worksheet.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/worksheet.py +++ b/bika/lims/browser/worksheet.py @@ -1253,6 +1253,8 @@ class WorksheetServicesView(BikaListingView): self.show_select_column = True self.pagesize = 0 self.show_workflow_action_buttons = False + self.show_categories=context.bika_setup.getCategoriseAnalysisServices() + self.expand_all_categories=True self.columns = { 'Service': {'title': _('Service'), @@ -1276,7 +1278,8 @@ class WorksheetServicesView(BikaListingView): self.categories = [] catalog = getToolByName(self, self.catalog) services = catalog(portal_type = "AnalysisService", - inactive_state = "active") + inactive_state = "active", + sort_on = 'sortable_title') items = [] for service in services: # if the service has dependencies, it can't have reference analyses @@ -1311,7 +1314,6 @@ class WorksheetServicesView(BikaListingView): } items.append(item) - items = sorted(items, key = itemgetter('Service')) self.categories.sort(lambda x, y: cmp(x.lower(), y.lower())) return items
dbw#<I> add_reference: group and sort services list
senaite_senaite.core
train
py
d888fa4a39baf9caeb554019dc87fd27f6f0b1ef
diff --git a/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js b/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js +++ b/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js @@ -690,6 +690,7 @@ // Get next entry var sUrl = resolveURL(oXhr.url); + sUrl = new URI(sUrl).resource(); sUrl = _private.replaceEntriesUrlByRegex(sUrl); var sUrlGroup = oXhr.method + sUrl; @@ -851,4 +852,4 @@ } }; return RequestRecorder; -})); \ No newline at end of file +}));
[INTERNAL][FIX] RequestRecorder: Get correct URL part The RequestRecorder uses the URL resource part as part of the index for the its saved requests. The resource call got missing and the URLs could not be found because the index of the map differs with the check for the current request. Change-Id: I6f<I>c<I>c<I>bc8a<I>cff<I>c<I>
SAP_openui5
train
js
caa9ecd1ae225e05c4b0b12b1901e9e938c202c3
diff --git a/models/cad-status.js b/models/cad-status.js index <HASH>..<HASH> 100644 --- a/models/cad-status.js +++ b/models/cad-status.js @@ -21,6 +21,8 @@ var StatusOptionValue = new Schema({ type: String, default: "" } +}, { + _id: false }); var StatusOption = new Schema({ @@ -44,6 +46,8 @@ var StatusOption = new Schema({ type: [StatusOptionValue], default: [] } +}, { + _id: false }); var modelSchema = new Schema({ diff --git a/models/department.js b/models/department.js index <HASH>..<HASH> 100644 --- a/models/department.js +++ b/models/department.js @@ -14,6 +14,8 @@ var Agency = new Schema({ type: String, default: "" } +}, { + _id: false }); var EsriToken = new Schema({ diff --git a/models/user.js b/models/user.js index <HASH>..<HASH> 100644 --- a/models/user.js +++ b/models/user.js @@ -26,6 +26,8 @@ var Agency = new Schema({ type: String, default: "" } +}, { + _id: false }); var modelSchema = new Schema({
Added missing _id: false to child objects
TabletCommand_tabletcommand-backend-models
train
js,js,js
1ba4381920f580145730ca5e3f89ea988ffd15f6
diff --git a/wilson/util/wetutil.py b/wilson/util/wetutil.py index <HASH>..<HASH> 100644 --- a/wilson/util/wetutil.py +++ b/wilson/util/wetutil.py @@ -171,7 +171,7 @@ def rotate_down(C_in, p): UdL.conj(), UdL, C_in[k]) # type dL X dL X - for k in ['S1ddRR', ]: + for k in ['S1ddRR', 'S8ddRR']: C[k] = np.einsum('ia,kc,ijkl->ajcl', UdL.conj(), UdL.conj(), C_in[k])
[wetutil] Add missing operator to d_L rotation
wilson-eft_wilson
train
py
52bf1339460220b80d6afdd21eb710ef7d8eaf18
diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index <HASH>..<HASH> 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -662,6 +662,7 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) { nnode, err := root.GetDirectory().GetNode() if err != nil { webError(w, "WritableGateway: failed to finalize", err, http.StatusInternalServerError) + return } ncid := nnode.Cid()
fix(gw): missing return if dir fails to finalize (#<I>)
ipfs_go-ipfs
train
go
97e6374ba756bf6b8dbe2ba19e1f9c5ed4879573
diff --git a/src/Helpers/helpers.php b/src/Helpers/helpers.php index <HASH>..<HASH> 100644 --- a/src/Helpers/helpers.php +++ b/src/Helpers/helpers.php @@ -43,6 +43,14 @@ if (! function_exists('concatenate_with_separator')) { } if (! function_exists('getDbPropertyId')) { + /** + * Gets the ID from a table and column based on a term + * + * @param $term + * @param $table + * @param string $column + * @return null + */ function getDbPropertyId($term, $table, $column = 'name') { $result = \Illuminate\Support\Facades\DB::table($table) @@ -54,4 +62,18 @@ if (! function_exists('getDbPropertyId')) { } return null; } +} + +if (! function_exists('ddd')) { + /** + * Adds file and line to the traditional die and dump function + */ + function ddd() { + $from = debug_backtrace()[0]; + $args = func_get_args(); + array_push($args, $from['file']); + array_push($args, $from['line']); + + call_user_func_array('dd', $args); + } } \ No newline at end of file
Update the helpers to include ddd
midnite81_laravel-base
train
php
79fd5d84ca6897e97350d0f0c5e6ba4e78e40a7a
diff --git a/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb b/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb index <HASH>..<HASH> 100644 --- a/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb +++ b/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb @@ -1,3 +1,3 @@ module DresClient - VERSION = "0.5.0" + VERSION = "0.6.0" end diff --git a/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb b/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb index <HASH>..<HASH> 100644 --- a/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb +++ b/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb @@ -12,7 +12,7 @@ module DresRails end def self.version - "0.5.0" + "0.6.0" end def self.version_label
Increase VERSION to <I>
RailsEventStore_rails_event_store
train
rb,rb
f4b877581ecf5e486c84ac76d66dc88b3f6b0959
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -12,5 +12,6 @@ module.exports = { 'major_lake_changed': require('./comparators/major-lake-modified'), 'pokemon_footway': require('./comparators/pokemon-footway'), 'place_edited': require('./comparators/place-edited'), - 'major_name_modification': require('./comparators/major_name_modification') + 'major_name_modification': require('./comparators/major_name_modification'), + 'wikidata': require('./comparators/wikidata') };
Export comparator from index.js
mapbox_osm-compare
train
js
181c8ff75e41897d4a7370908b90a3542a88590d
diff --git a/lib/cinch/user.rb b/lib/cinch/user.rb index <HASH>..<HASH> 100644 --- a/lib/cinch/user.rb +++ b/lib/cinch/user.rb @@ -365,6 +365,10 @@ module Cinch # @return [void] def update_nick(new_nick) @last_nick, @name = @name, new_nick + # Unsync authname because some networks tie authentication to + # the nick, so the user might not be authenticated anymore after + # changing his nick + unsync(:authname) @bot.user_list.update_nick(self) end
unsync authname on nick change Some networks tie authentication to the nick, so the user might not be authenticated anymore after changing his nick
cinchrb_cinch
train
rb
845c1758a5632f254e6d52d69e424a728f473a6a
diff --git a/components/twofactor.js b/components/twofactor.js index <HASH>..<HASH> 100644 --- a/components/twofactor.js +++ b/components/twofactor.js @@ -1,7 +1,6 @@ const StdLib = require('@doctormckay/stdlib'); const SteamTotp = require('steam-totp'); -const Helpers = require('./helpers.js'); const SteamUser = require('../index.js'); /**
Remove don't use require In this file don't use Helpers
DoctorMcKay_node-steam-user
train
js
47bc138fc1d9ddafab8e4cf9cac8865f2092c003
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/caching/fragments.rb +++ b/actionpack/lib/action_controller/caching/fragments.rb @@ -41,7 +41,9 @@ module ActionController #:nodoc: else pos = buffer.length block.call - write_fragment(name, buffer[pos..-1], options) + content = buffer[pos..-1] + content = content.as_str if content.respond_to?(:as_str) + write_fragment(name, content, options) end else block.call diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -89,8 +89,12 @@ module ActiveSupport #:nodoc: self end + def as_str + ''.replace(self) + end + def to_yaml - "".replace(self).to_yaml + as_str.to_yaml end end end
Write strings to fragment cache, not outputbuffers
rails_rails
train
rb,rb
fddfba566072de02fffb93c52a64de5969c9787a
diff --git a/multiqc/modules/fastq_screen/fastq_screen.py b/multiqc/modules/fastq_screen/fastq_screen.py index <HASH>..<HASH> 100755 --- a/multiqc/modules/fastq_screen/fastq_screen.py +++ b/multiqc/modules/fastq_screen/fastq_screen.py @@ -139,7 +139,7 @@ class MultiqcModule(BaseMultiqcModule): thisdata = list() if len(categories) > 0: getCats = False - for org in self.fq_screen_data[s]: + for org in sorted(self.fq_screen_data[s]): if org == 'total_reads': continue try:
sort organisms in fastq_screen plot
ewels_MultiQC
train
py
3b98107a4133b89b5ee1b432dd6ab966240f4d7d
diff --git a/src/EasyDB.php b/src/EasyDB.php index <HASH>..<HASH> 100644 --- a/src/EasyDB.php +++ b/src/EasyDB.php @@ -34,7 +34,7 @@ class EasyDB */ public function __construct(\PDO $pdo, string $dbEngine = '') { - $this->pdo = clone $pdo; + $this->pdo = $pdo; $this->pdo->setAttribute( \PDO::ATTR_EMULATE_PREPARES, false @@ -369,7 +369,7 @@ class EasyDB */ public function getPdo(): \PDO { - return (clone $this->pdo); + return $this->pdo; } /**
Attempting to clone $this->pdo caused a segfault.
paragonie_easydb
train
php
771b1a46f7621d90e3dacfb21f60358ad855e50c
diff --git a/mod/quiz/index.php b/mod/quiz/index.php index <HASH>..<HASH> 100644 --- a/mod/quiz/index.php +++ b/mod/quiz/index.php @@ -120,6 +120,8 @@ $a->studentstring = $course->students; $data[] = "<a href=\"report.php?mode=overview&amp;q=$quiz->id\">" . get_string('numattempts', 'quiz', $a) . '</a>'; + } else { + $data[] = ''; } } else if ($showing = 'scores') {
MDL-<I> - Problem with the tables on the quiz index page. Merged from MOODLE_<I>_STABLE.
moodle_moodle
train
php
204bfc232712a5793b003f33132c20de08c66e9e
diff --git a/src/org/jgroups/protocols/pbcast/FLUSH.java b/src/org/jgroups/protocols/pbcast/FLUSH.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/protocols/pbcast/FLUSH.java +++ b/src/org/jgroups/protocols/pbcast/FLUSH.java @@ -355,6 +355,11 @@ public class FLUSH extends Protocol { // for processing of application messages after we join, // lets wait for STOP_FLUSH to complete // before we start allowing message up. + Address dest=msg.getDest(); + if(dest != null && !dest.isMulticastAddress()) { + return up_prot.up(evt); // allow unicasts to pass, virtual synchrony olny applies to multicasts + } + if(!allowMessagesToPassUp) return null; }
allow unicast messages to pass even when blocked
belaban_JGroups
train
java
888ca7f4a4d19a137df1fadd336bcd8ca25b90dc
diff --git a/src/main/org/codehaus/groovy/ant/VerifyClass.java b/src/main/org/codehaus/groovy/ant/VerifyClass.java index <HASH>..<HASH> 100644 --- a/src/main/org/codehaus/groovy/ant/VerifyClass.java +++ b/src/main/org/codehaus/groovy/ant/VerifyClass.java @@ -119,7 +119,9 @@ public class VerifyClass extends MatchingTask { log("verifying of class " + clazz + " failed"); } if (verbose) log(method.name + method.desc); - TraceMethodVisitor mv = new TraceMethodVisitor(null) { + + TraceMethodVisitor mv = new TraceMethodVisitor(null); + /*= new TraceMethodVisitor(null) { public void visitMaxs(int maxStack, int maxLocals) { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < text.size(); ++i) { @@ -135,7 +137,7 @@ public class VerifyClass extends MatchingTask { } if (verbose) log(buffer.toString()); } - }; + };*/ for (int j = 0; j < method.instructions.size(); ++j) { Object insn = method.instructions.get(j); if (insn instanceof AbstractInsnNode) {
comment out some of the logging to ensure the build even compiles
apache_groovy
train
java
e15cf6d10d448a15b0ec05e331c22c487cc10533
diff --git a/globus_cli/commands/logout.py b/globus_cli/commands/logout.py index <HASH>..<HASH> 100644 --- a/globus_cli/commands/logout.py +++ b/globus_cli/commands/logout.py @@ -54,7 +54,7 @@ def logout_command(yes): click.get_current_context().exit(1) # prompt - _confirm("Are you sure you'd like to logout?") + _confirm("Are you sure you want to logout?") # check for username -- if not set, probably not logged in username = lookup_option(WHOAMI_USERNAME_OPTNAME)
Make logout language stylistically consistent We don't got no contractions in this here formal english.
globus_globus-cli
train
py
47d16da2f2533f74aea576247380ba7bd566a0b5
diff --git a/lib/sinatra/param.rb b/lib/sinatra/param.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/param.rb +++ b/lib/sinatra/param.rb @@ -37,19 +37,13 @@ module Sinatra end def one_of(*names) - count = 0 - names.each do |name| - if params[name] and present?(params[name]) - count += 1 - next unless count > 1 - - error = "Parameters #{names.join(', ')} are mutually exclusive" - if content_type and content_type.match(mime_type(:json)) - error = {message: error}.to_json - end - - halt 400, error + if names.count{|name| params[name] and present?(params[name])} > 1 + error = "Parameters #{names.join(', ')} are mutually exclusive" + if content_type and content_type.match(mime_type(:json)) + error = {message: error}.to_json end + + halt 400, error end end
Refactoring implementation of one_of
mattt_sinatra-param
train
rb
98d3930ed8478c28373ea7e15c02c366012af337
diff --git a/tensorflow_datasets/text/multi_nli.py b/tensorflow_datasets/text/multi_nli.py index <HASH>..<HASH> 100644 --- a/tensorflow_datasets/text/multi_nli.py +++ b/tensorflow_datasets/text/multi_nli.py @@ -63,8 +63,9 @@ class MultiNLIConfig(tfds.core.BuilderConfig): **kwargs: keyword arguments forwarded to super. """ super(MultiNLIConfig, self).__init__( - version=tfds.core.Version( - "1.0.0", "New split API (https://tensorflow.org/datasets/splits)"), + version=tfds.core.Version("1.0.0"), + release_notes= + "New split API (https://tensorflow.org/datasets/splits)", **kwargs) self.text_encoder_config = ( text_encoder_config or tfds.deprecated.text.TextEncoderConfig())
Add release notes for multi_nli
tensorflow_datasets
train
py
0618d7129719285329bdb2e2bb8b67440523abb4
diff --git a/pyforms/gui/Controls/ControlDockWidget.py b/pyforms/gui/Controls/ControlDockWidget.py index <HASH>..<HASH> 100644 --- a/pyforms/gui/Controls/ControlDockWidget.py +++ b/pyforms/gui/Controls/ControlDockWidget.py @@ -36,10 +36,10 @@ class ControlDockWidget(ControlEmptyWidget): """ Show the control """ - self.show() + super(ControlDockWidget, self).show() def hide(self): """ Hide the control """ - self.hide() \ No newline at end of file + super(ControlDockWidget, self).hide() \ No newline at end of file
fixed bug when calling methods hide or show in the ControlDockWidget
UmSenhorQualquer_pyforms
train
py
ac6f395cc95aed50c464ef56e4accfbb4f4d19c7
diff --git a/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php b/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php index <HASH>..<HASH> 100644 --- a/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php +++ b/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/XmlVisitorTest.php @@ -305,7 +305,7 @@ class XmlVisitorTest extends AbstractVisitorTestCase $command = $this->getMockBuilder('Guzzle\Service\Command\OperationCommand') ->setConstructorArgs(array($input, $operation)) ->getMockForAbstractClass(); - $command->setClient(new Client()); + $command->setClient(new Client('http://www.test.com/some/path.php')); $request = $command->prepare(); if (!empty($input)) { $this->assertEquals('application/xml', (string) $request->getHeader('Content-Type'));
Changed test to show XMLVisitorTest::testSerializesXml fail
guzzle_guzzle3
train
php
324213a93145fa3a0bac9adf050042c6419d6b50
diff --git a/lib/chef/resource/windows_pagefile.rb b/lib/chef/resource/windows_pagefile.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/windows_pagefile.rb +++ b/lib/chef/resource/windows_pagefile.rb @@ -120,7 +120,10 @@ class Chef # raise an exception if the target drive location is invalid def pagefile_drive_exist?(pagefile) - ::Dir.exist?(pagefile[0] + ":\\") ? nil : (raise "You are trying to create a pagefile on a drive that does not exist!") + if (::Dir.exist?(pagefile[0] + ":\\") == false) + raise "You are trying to create a pagefile on a drive that does not exist!" + end + # ::Dir.exist?(pagefile[0] + ":\\") ? nil : (raise "You are trying to create a pagefile on a drive that does not exist!") end # See if the pagefile exists
Updated the Windows Pagefile resource to use PowerShell over WMI, added a corresponding test file
chef_chef
train
rb
0757aeaf803530e9c175daddceae0fa3c5733469
diff --git a/tilequeue/wof.py b/tilequeue/wof.py index <HASH>..<HASH> 100644 --- a/tilequeue/wof.py +++ b/tilequeue/wof.py @@ -868,7 +868,6 @@ class WofProcessor(object): # this means that we had a value for superseded_by in # the raw json, but not in the meta file # this should get treated as a removal - ids_to_remove.add(failure_wof_id) superseded_by_wof_ids.add(failure_wof_id) failed_wof_ids.add(failure_wof_id) @@ -896,6 +895,7 @@ class WofProcessor(object): if superseded_by_wof_ids: for n in prev_neighbourhoods: if n.wof_id in superseded_by_wof_ids: + ids_to_remove.add(n.wof_id) diffs.append((n, None)) # if the neighbourhood became funky and we had it in our
Move superseded removal for clarity
tilezen_tilequeue
train
py
1c39bf6186c39523c454d104bbd99abd3eb7237f
diff --git a/java/org.cohorte.herald.http/src/main/java/org/cohorte/herald/http/impl/HttpDirectory.java b/java/org.cohorte.herald.http/src/main/java/org/cohorte/herald/http/impl/HttpDirectory.java index <HASH>..<HASH> 100644 --- a/java/org.cohorte.herald.http/src/main/java/org/cohorte/herald/http/impl/HttpDirectory.java +++ b/java/org.cohorte.herald.http/src/main/java/org/cohorte/herald/http/impl/HttpDirectory.java @@ -41,7 +41,7 @@ import org.cohorte.herald.http.IHttpConstants; * @author Thomas Calmant */ @Component -@Provides(specifications = IHttpDirectory.class) +@Provides(specifications = { ITransportDirectory.class, IHttpDirectory.class }) @Instantiate(name = "herald-http-directory") public class HttpDirectory implements ITransportDirectory, IHttpDirectory {
Added ITransportDirectory to the service provided by HttpDirectory The HTTP Directory was never called by Herald Directory :/
cohorte_cohorte-herald
train
java
4f97f8560cde7d98d36695940542352b6ac651a4
diff --git a/core/router/downlink.go b/core/router/downlink.go index <HASH>..<HASH> 100644 --- a/core/router/downlink.go +++ b/core/router/downlink.go @@ -31,7 +31,9 @@ func (r *router) SubscribeDownlink(gatewayID string, subscriptionID string) (<-c gateway := r.getGateway(gatewayID) if fromSchedule := gateway.Schedule.Subscribe(subscriptionID); fromSchedule != nil { - r.Discovery.AddGatewayID(gatewayID, gateway.Token()) + if token := gateway.Token(); gatewayID != "" && token != "" { + r.Discovery.AddGatewayID(gatewayID, token) + } toGateway := make(chan *pb.DownlinkMessage) go func() { ctx.Debug("Activate downlink") @@ -54,7 +56,9 @@ func (r *router) SubscribeDownlink(gatewayID string, subscriptionID string) (<-c func (r *router) UnsubscribeDownlink(gatewayID string, subscriptionID string) error { gateway := r.getGateway(gatewayID) - r.Discovery.RemoveGatewayID(gatewayID, gateway.Token()) + if token := gateway.Token(); gatewayID != "" && token != "" { + r.Discovery.RemoveGatewayID(gatewayID, token) + } gateway.Schedule.Stop(subscriptionID) return nil }
Only announce downlink gateway if it has a token
TheThingsNetwork_ttn
train
go
031e1920c92e2f63b2f4455895735ca7867f558f
diff --git a/lib/Doctrine/MongoDB/Query/Query.php b/lib/Doctrine/MongoDB/Query/Query.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/MongoDB/Query/Query.php +++ b/lib/Doctrine/MongoDB/Query/Query.php @@ -144,9 +144,6 @@ class Query implements IteratorAggregate { switch ($this->query['type']) { case self::TYPE_FIND: - if (isset($this->query['mapReduce']['reduce'])) { - $this->query['query'][$this->cmd . 'where'] = $this->query['mapReduce']['reduce']; - } $cursor = $this->collection->find($this->query['query'], $this->query['select']); return $this->prepareCursor($cursor);
[Query] Do not populate $where criteria with reduce JavaScript
doctrine_mongodb
train
php
2d63d6a09abc5ccd8e29b4170b212abfa2a1edae
diff --git a/lib/command/init.js b/lib/command/init.js index <HASH>..<HASH> 100644 --- a/lib/command/init.js +++ b/lib/command/init.js @@ -90,16 +90,10 @@ module.exports = function (initPath) { { name: 'steps', type: 'confirm', - message: 'Would you like to extend I object with custom steps?', + message: 'Would you like to extend the "I" object with custom steps?', default: true, }, { - name: 'translation', - type: 'list', - message: 'Do you want to choose localization for tests?', - choices: translations, - }, - { name: 'steps_file', type: 'input', message: 'Where would you like to place custom steps?', @@ -108,6 +102,12 @@ module.exports = function (initPath) { return answers.steps; }, }, + { + name: 'translation', + type: 'list', + message: 'Do you want to choose localization for tests?', + choices: translations, + }, ]).then((result) => { const config = defaultConfig; config.name = testsPath.split(path.sep).pop();
Fix typo. Improve order of prompts. (#<I>)
Codeception_CodeceptJS
train
js
231178bff0236aa301e3e92bce1cd8f0efe84a60
diff --git a/Event/StrictDispatcher.php b/Event/StrictDispatcher.php index <HASH>..<HASH> 100644 --- a/Event/StrictDispatcher.php +++ b/Event/StrictDispatcher.php @@ -11,7 +11,7 @@ namespace Claroline\CoreBundle\Event; -use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; use JMS\DiExtraBundle\Annotation as DI; /** @@ -35,7 +35,7 @@ class StrictDispatcher * "ed" = @DI\Inject("event_dispatcher") * }) */ - public function __construct(EventDispatcher $ed) + public function __construct(EventDispatcherInterface $ed) { $this->eventDispatcher = $ed; }
[CoreBundle] Fixing StrictDispatcher.
claroline_Distribution
train
php
33acdbf3bf1518bba67fd1f7030d14726c4463bf
diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index <HASH>..<HASH> 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -477,13 +477,12 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist // try and convert the specified network to a device. device, err := netmap.NameIntoDevice(network) - // success. so we know that it's an actual network type inside netmap.conf if err == nil { + // success. so we know that it's an actual network type inside netmap.conf templateData.Network_Type = network templateData.Network_Device = device - - // otherwise, we were unable to find the type, so assume its a custom device. } else { + // otherwise, we were unable to find the type, so assume its a custom device. templateData.Network_Type = "custom" templateData.Network_Device = network }
move comments so indentation is more logical
hashicorp_packer
train
go
2902223579aa5c890d71016fdda84947536b7f23
diff --git a/udiskie/cli.py b/udiskie/cli.py index <HASH>..<HASH> 100644 --- a/udiskie/cli.py +++ b/udiskie/cli.py @@ -49,10 +49,9 @@ def get_backend(clsname, version=None): try: return udisks1() except DBusException: - msg = sys.exc_info()[1].get_dbus_message() log = logging.getLogger(__name__) - log.warning('Failed to connect UDisks1 dbus service: %s.\n' - 'Falling back to UDisks2 [experimental].' % (msg,)) + log.warning('Failed to connect UDisks1 dbus service.\n' + 'Falling back to UDisks2 [experimental].') return udisks2() elif version == 1: return udisks1()
Fix incorrect usage of GLib.GError GLib.GError has no method `.get_dbus_message()` like dbus.DBusException had. Instead, it has an attribute `.message`. But this is not very useful for the user anyway in the case, so we just leave it out.
coldfix_udiskie
train
py
c79a823964c80d29e3782358a82b94a9f0a8610a
diff --git a/salt/tops/varstack.py b/salt/tops/varstack.py index <HASH>..<HASH> 100644 --- a/salt/tops/varstack.py +++ b/salt/tops/varstack.py @@ -49,11 +49,9 @@ from __future__ import absolute_import import logging try: - HAS_VARSTACK = False import varstack - HAS_VARSTACK = True except ImportError: - pass + varstack = None # Set up logging log = logging.getLogger(__name__) @@ -63,10 +61,7 @@ __virtualname__ = 'varstack' def __virtual__(): - if not HAS_VARSTACK: - log.error("Can't find varstack master_top") - return False - return __virtualname__ + return (False, 'varstack not installed') if varstack is None else __virtualname__ def top(**kwargs):
Squelch error logging when varstack is not installed This gets rid of spurious errors when varstack isn't installed. Most people won't use this so these errors are not helpful.
saltstack_salt
train
py
0938f7e5fa9995a663a5396b1f291509e8de6d52
diff --git a/wps.php b/wps.php index <HASH>..<HASH> 100644 --- a/wps.php +++ b/wps.php @@ -54,6 +54,10 @@ $whoops_handler = new PrettyPageHandler; $whoops_handler->addDataTableCallback( 'WP', function () { global $wp; + if ( ! $wp instanceof \WP ) { + return array(); + } + $output = get_object_vars( $wp ); unset( $output['private_query_vars'] ); unset( $output['public_query_vars'] ); @@ -68,6 +72,10 @@ $whoops_handler->addDataTableCallback( 'backtrace', function () { $whoops_handler->addDataTableCallback( 'WP_Query', function () { global $wp_query; + if ( ! $wp_query instanceof \WP_Query ) { + return array(); + } + $output = get_object_vars( $wp_query ); $output['query_vars'] = array_filter( $output['query_vars'] ); unset( $output['posts'] );
Added checks on global objects to make sense. Fixes #1
Rarst_wps
train
php
1b5c562eca99eeb573c4316f2a22ac93cd7fe2f4
diff --git a/fritzconnection/core/processor.py b/fritzconnection/core/processor.py index <HASH>..<HASH> 100644 --- a/fritzconnection/core/processor.py +++ b/fritzconnection/core/processor.py @@ -326,7 +326,7 @@ class Service: values. Caches the dictionary once retrieved from _scpd. """ if self._state_variables is None: - self._state_variables = self._scpd.actions + self._state_variables = self._scpd.state_variables return self._state_variables def load_scpd(self, address, port):
Bugfix in service to return state_variables instead of actions.
kbr_fritzconnection
train
py
83e6e1060ef4104f22f6f3d84900d28224e39c50
diff --git a/cmd/xl-v1-multipart.go b/cmd/xl-v1-multipart.go index <HASH>..<HASH> 100644 --- a/cmd/xl-v1-multipart.go +++ b/cmd/xl-v1-multipart.go @@ -387,15 +387,16 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s // Initialize md5 writer. md5Writer := md5.New() + lreader := data // Limit the reader to its provided size > 0. if size > 0 { // This is done so that we can avoid erroneous clients sending // more data than the set content size. - data = io.LimitReader(data, size) + lreader = io.LimitReader(data, size) } // else we read till EOF. // Construct a tee reader for md5sum. - teeReader := io.TeeReader(data, md5Writer) + teeReader := io.TeeReader(lreader, md5Writer) // Erasure code data and write across all disks. sizeWritten, checkSums, err := erasureCreateFile(onlineDisks, minioMetaBucket, tmpPartPath, teeReader, xlMeta.Erasure.BlockSize, xl.dataBlocks, xl.parityBlocks, bitRotAlgo, xl.writeQuorum)
Layer LimitReader responsibly allowing sign verification to work (#<I>)
minio_minio
train
go
ac9a0e1e135c86e54d312f6e663822493e40db16
diff --git a/lib/rails3-jquery-autocomplete/simple_form_plugin.rb b/lib/rails3-jquery-autocomplete/simple_form_plugin.rb index <HASH>..<HASH> 100644 --- a/lib/rails3-jquery-autocomplete/simple_form_plugin.rb +++ b/lib/rails3-jquery-autocomplete/simple_form_plugin.rb @@ -49,27 +49,27 @@ module SimpleForm # label_method, value_method = detect_collection_methods association = object.send(reflection.name) - autocomplete_options[:value] = association.send(label_method) if association.respond_to? label_method - puts "label_method:#{label_method}" - puts "value: #{autocomplete_options[:value]}" - # + if association.respond_to? label_method + autocomplete_options[:value] = association.send(label_method) + end out = @builder.autocomplete_field( attribute_name, options[:url], autocomplete_options ) + hidden_options = if association.respond_to? value_method + new_options = {} + new_options[:value] = association.send(value_method) + input_html_options.merge new_options + else + input_html_options + end out << @builder.hidden_field( attribute_name, - rewrite_hidden_option(association.send(value_method)) if association.respond_to? value_method + hidden_options ) out.html_safe end - - def rewrite_hidden_option(value) - new_options = {} - new_options[:value] = value - input_html_options.merge new_options - end end end
before sending methods, check respond_to?
crowdint_rails3-jquery-autocomplete
train
rb
f7ef7eafc9753c160c1173512d9a1bd1cff06400
diff --git a/src/repl.js b/src/repl.js index <HASH>..<HASH> 100644 --- a/src/repl.js +++ b/src/repl.js @@ -139,11 +139,11 @@ function completer(text) { return [[], text]; } -var PROMPT_MULTI = chalk.bold("... "); -var PROMPT_SINGLE = chalk.bold("squiggle> "); - function prompt() { - return isMultiline ? PROMPT_MULTI : PROMPT_SINGLE; + var text = isMultiline ? + "......... " : + "squiggle> "; + return chalk.bold(text); } function interruptMessage() { @@ -162,6 +162,9 @@ function toggleMultilineMode(rl) { isMultiline = !isMultiline; rl.setPrompt(prompt()); rl.prompt(); + if (currentCode.length > 0 || rl.line.length > 0) { + rl.write("\n"); + } } function keybindHandler(rl, c, k) {
Tweaks the prompt a bit
squiggle-lang_squiggle-lang
train
js
4e1a39131a3197890bb4fda85d0236744276568f
diff --git a/drivers/k8055/driver-k8055.rb b/drivers/k8055/driver-k8055.rb index <HASH>..<HASH> 100644 --- a/drivers/k8055/driver-k8055.rb +++ b/drivers/k8055/driver-k8055.rb @@ -98,12 +98,14 @@ class K8055DigitalOutput < K8055Pin def write(value) begin @k8055.synchronize do - if value + if not value and not @state + # workaround to a libk8055 bug ? + elsif value @k8055.digital_on @index - else + elsif not value @k8055.digital_off @index end - @state = value + if value then @state = true else @state = false end end rescue puts "K8055 Error"
Workaround for a libk<I> bug in set_digital
openplacos_openplacos
train
rb
4dad42de1e9d2683fe800198ec6690bac14cb9f3
diff --git a/lib/arjdbc/db2/adapter.rb b/lib/arjdbc/db2/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/db2/adapter.rb +++ b/lib/arjdbc/db2/adapter.rb @@ -500,12 +500,13 @@ module ArJdbc change_column_null(table_name, column_name, options[:null]) end end - + # http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.dbobj.doc/doc/t0020132.html - def remove_column(table_name, column_name) #:nodoc: - sql = "ALTER TABLE #{table_name} DROP COLUMN #{column_name}" - - as400? ? execute_and_auto_confirm(sql) : execute(sql) + def remove_column(table_name, *column_names) #:nodoc: + for column_name in column_names.flatten + sql = "ALTER TABLE #{table_name} DROP COLUMN #{column_name}" + as400? ? execute_and_auto_confirm(sql) : execute(sql) + end reorg_table(table_name) end
fix DB2 remove_column not supporting multiple column_names (since <I>)
jruby_activerecord-jdbc-adapter
train
rb
07e141261ec3b3f96fe68518d59512dd85ffb22d
diff --git a/src/wyil/transforms/VerificationCheck.java b/src/wyil/transforms/VerificationCheck.java index <HASH>..<HASH> 100644 --- a/src/wyil/transforms/VerificationCheck.java +++ b/src/wyil/transforms/VerificationCheck.java @@ -101,7 +101,7 @@ public class VerificationCheck implements Transform { } public static int getLimit() { - return 100; + return 500; } public void setLimit(int limit) {
I may have to have a separate process, or something which I can genuinely control
Whiley_WhileyCompiler
train
java
a8f8fd57cf405d9a6ec7ac9fb94db01f7368466c
diff --git a/pkg/httputil/httputil.go b/pkg/httputil/httputil.go index <HASH>..<HASH> 100644 --- a/pkg/httputil/httputil.go +++ b/pkg/httputil/httputil.go @@ -27,6 +27,7 @@ import ( "net" "net/http" "net/url" + "os" "path" "strconv" "strings" @@ -63,7 +64,7 @@ func RequestEntityTooLargeError(conn http.ResponseWriter) { func ServeError(conn http.ResponseWriter, req *http.Request, err error) { conn.WriteHeader(http.StatusInternalServerError) - if IsLocalhost(req) { + if IsLocalhost(req) || os.Getenv("CAMLI_DEV_CAMLI_ROOT") != "" { fmt.Fprintf(conn, "Server error: %s\n", err) return }
httputil: allow full error serving when with devcam When hacking on e.g. importers, I sometimes want to use devcam with -hostname, to test with a non local context. In which case, when hitting an error httputil.ServeError would not print the full error, which makes it harder to debug. Change-Id: I2fb8c<I>d4f<I>fbf<I>addd6e7af<I>
perkeep_perkeep
train
go
72cfeebc298416b621b4a4814d92d0d00672ab3a
diff --git a/mrcrowbar/common.py b/mrcrowbar/common.py index <HASH>..<HASH> 100644 --- a/mrcrowbar/common.py +++ b/mrcrowbar/common.py @@ -46,6 +46,9 @@ def serialise( obj, fields ): def file_path_recurse( *root_list ): for root in root_list: + if os.path.isfile( root ): + yield root + continue for path, dirs, files in os.walk( root ): for item in files: file_path = os.path.join( path, item )
common.file_path_recurse: fix case where root is a file
moralrecordings_mrcrowbar
train
py
821f1fb4c3bd009d5c63922709382f403c732817
diff --git a/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java b/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java index <HASH>..<HASH> 100644 --- a/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java +++ b/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java @@ -233,7 +233,8 @@ public class WikipediaQuickCheck { final URL url = new URL(urlString); final String mediaWikiContent = check.getMediaWikiContent(url); final String plainText = check.getPlainText(mediaWikiContent); - final WikipediaQuickCheckResult checkResult = check.checkPage(plainText, new German()); + final Language lang = check.getLanguage(url); + final WikipediaQuickCheckResult checkResult = check.checkPage(plainText, lang); final ContextTools contextTools = new ContextTools(); contextTools.setContextSize(CONTEXT_SIZE); for (RuleMatch ruleMatch : checkResult.getRuleMatches()) {
main method: use the language from the URL, not German
languagetool-org_languagetool
train
java
039b440c638a1b8d2d595668a6fcf892c3cf79ed
diff --git a/lib/solargraph/pin/reference.rb b/lib/solargraph/pin/reference.rb index <HASH>..<HASH> 100644 --- a/lib/solargraph/pin/reference.rb +++ b/lib/solargraph/pin/reference.rb @@ -12,6 +12,7 @@ module Solargraph def resolve api_map unless @resolved + @resolved = true @name = api_map.find_fully_qualified_namespace(@name, pin.namespace) end end
Avoid infinite recursion when resolving reference pins.
castwide_solargraph
train
rb
7cba2c8c2abd13f450cd2e587178a413493ec312
diff --git a/jquery.csv.js b/jquery.csv.js index <HASH>..<HASH> 100755 --- a/jquery.csv.js +++ b/jquery.csv.js @@ -72,7 +72,7 @@ }; /** - * jQuery.CSV2Array(csvString) + * jQuery.CSVEntry2Array(csvString) * Converts a CSV string to a javascript array. * * @param {String} csv The string containing the raw CSV data. @@ -115,4 +115,5 @@ return a; }; -})( jQuery ); \ No newline at end of file +})( jQuery ); +
jquery.csv.js - added a quick documentation fix - added a newline at the end of the file
mageddo_javascript-csv
train
js
9a54328f3a7fb8c4662e17dadb0eba8858503686
diff --git a/src/ProfileConfig.php b/src/ProfileConfig.php index <HASH>..<HASH> 100644 --- a/src/ProfileConfig.php +++ b/src/ProfileConfig.php @@ -31,7 +31,7 @@ class ProfileConfig extends Config 'listen' => '::', 'enableLog' => false, 'enableAcl' => false, - 'aclGroupList' => [], + 'aclPermissionList' => [], 'managementIp' => '127.0.0.1', 'reject4' => false, 'reject6' => false,
rename aclGroupList to aclPermissionList
eduvpn_vpn-lib-common
train
php
b94948499028f0fa0ba0e243e42c489597aa0ff5
diff --git a/src/main/java/org/dynjs/runtime/builtins/types/array/IsArray.java b/src/main/java/org/dynjs/runtime/builtins/types/array/IsArray.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dynjs/runtime/builtins/types/array/IsArray.java +++ b/src/main/java/org/dynjs/runtime/builtins/types/array/IsArray.java @@ -15,9 +15,10 @@ public class IsArray extends AbstractNativeFunction { return true; } - if ( args[0] instanceof JSObject && ((JSObject)args[0]).hasExternalIndexedData() ) { - return true; - } + // TODO: Nodyn buffers should not be considered an array according to Array.isArray +// if ( args[0] instanceof JSObject && ((JSObject)args[0]).hasExternalIndexedData() ) { +// return true; +// } return false; }
Array.isArray should not return true for non-arrays. Removed the code that caused Array.isArray to return true for any JSObject that has externally indexed data. This feature was added for V8 parity, specifically when dealing with Node.js buffers, however Array.isArray(buffer) in node <I>.x returns false.
dynjs_dynjs
train
java
e3a0e83b6cd99723efa463eaa5723f6ced792b28
diff --git a/py/selenium/webdriver/common/desired_capabilities.py b/py/selenium/webdriver/common/desired_capabilities.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/common/desired_capabilities.py +++ b/py/selenium/webdriver/common/desired_capabilities.py @@ -27,22 +27,22 @@ class DesiredCapabilities(object): CHROME = {"browserName": "chrome", "version": "", - "platform": "any", + "platform": "ANY", "javascriptEnabled": True } HTMLUNIT = {"browserName": "htmlunit", "version": "", - "platform": "windows", + "platform": "ANY", "javascriptEnabled": True } IPHONE = {"browserName": "iphone", "version": "", - "platform": "windows", + "platform": "MAC", "javascriptEnabled": True } ANDROID = {"browserName": "android", "version": "", - "platform": "windows", + "platform": "LINUX", "javascriptEnabled": True }
DavidBurns corrected platforms for desired capabilities r<I>
SeleniumHQ_selenium
train
py
33da4458f4f9a6e3801ebfd722c61e8792ca8bc5
diff --git a/internal/service/appflow/flow.go b/internal/service/appflow/flow.go index <HASH>..<HASH> 100644 --- a/internal/service/appflow/flow.go +++ b/internal/service/appflow/flow.go @@ -1113,12 +1113,11 @@ func ResourceFlow() *schema.Resource { }, }, "task_properties": { - Type: schema.TypeMap, - Optional: true, - ValidateFunc: validation.StringInSlice(appflow.OperatorPropertiesKeys_Values(), false), + Type: schema.TypeMap, + Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.All(validation.StringMatch(regexp.MustCompile(`\S+`), "must not contain any whitespace characters"), validation.StringLenBetween(0, 2048)), + ValidateFunc: validation.StringLenBetween(0, 2048), }, }, "task_type": {
appflow: amend ValidateFunc for task_properties to avoid type conflict
terraform-providers_terraform-provider-aws
train
go
363a750af2e0e81ad39d2951a4aaca1231d7a358
diff --git a/lhc/file_format/vcf_/merger.py b/lhc/file_format/vcf_/merger.py index <HASH>..<HASH> 100644 --- a/lhc/file_format/vcf_/merger.py +++ b/lhc/file_format/vcf_/merger.py @@ -102,7 +102,7 @@ class VcfMerger(object): return sorted_tops def _updateSorting(self, sorted_tops, entry, idx): - key = (entry.chr, entry.pos) + key = (Chromosome.getIdentifier(entry.chr), entry.pos) sorted_tops.get(key, []).append(idx) def _mergeHeaders(self, hdrs):
fixed vcf merge chromosome out-of-order bug
childsish_sofia
train
py
8d27fea36a80d99944efe4f4b5c4e7d977a5163f
diff --git a/prometheus_flask_exporter/__init__.py b/prometheus_flask_exporter/__init__.py index <HASH>..<HASH> 100644 --- a/prometheus_flask_exporter/__init__.py +++ b/prometheus_flask_exporter/__init__.py @@ -11,7 +11,7 @@ from flask import Flask, Response from flask import request, make_response, current_app from flask.views import MethodViewType from prometheus_client import Counter, Histogram, Gauge, Summary -from prometheus_client.exposition import choose_encoder +from prometheus_client.exposition import choose_formatter from werkzeug.serving import is_running_from_reloader if sys.version_info[0:2] >= (3, 4): @@ -278,7 +278,7 @@ class PrometheusMetrics(object): if 'PROMETHEUS_MULTIPROC_DIR' in os.environ or 'prometheus_multiproc_dir' in os.environ: multiprocess.MultiProcessCollector(registry) - generate_latest, content_type = choose_encoder(request.headers.get("Accept")) + generate_latest, content_type = choose_formatter(request.headers.get("Accept")) headers = {'Content-Type': content_type} return generate_latest(registry), 200, headers
change choose_encoder to choose_formatter
rycus86_prometheus_flask_exporter
train
py
844c43b9cde02b84583f0e3641fc20e670a3b25f
diff --git a/benchmarks/src/test/java/zipkin2/server/ServerIntegratedBenchmark.java b/benchmarks/src/test/java/zipkin2/server/ServerIntegratedBenchmark.java index <HASH>..<HASH> 100644 --- a/benchmarks/src/test/java/zipkin2/server/ServerIntegratedBenchmark.java +++ b/benchmarks/src/test/java/zipkin2/server/ServerIntegratedBenchmark.java @@ -138,7 +138,7 @@ class ServerIntegratedBenchmark { .withNetworkAliases("backend") .withCommand("backend") .withExposedPorts(9000) - .waitingFor(Wait.forHttp("/health")); + .waitingFor(Wait.forHttp("/actuator/health")); closer.register(backend::stop); GenericContainer<?> frontend = new GenericContainer<>("openzipkin/example-sleuth-webmvc") @@ -146,7 +146,7 @@ class ServerIntegratedBenchmark { .withNetworkAliases("frontend") .withCommand("frontend") .withExposedPorts(8081) - .waitingFor(Wait.forHttp("/health")); + .waitingFor(Wait.forHttp("/actuator/health")); closer.register(frontend::stop); GenericContainer<?> prometheus = new GenericContainer<>("prom/prometheus")
Actually sleuth is using actuator health..
apache_incubator-zipkin
train
java
cb04402900583886160d3628530b8bcbc4fdd511
diff --git a/docs/src/pages/discover-more/languages/Languages.js b/docs/src/pages/discover-more/languages/Languages.js index <HASH>..<HASH> 100644 --- a/docs/src/pages/discover-more/languages/Languages.js +++ b/docs/src/pages/discover-more/languages/Languages.js @@ -32,7 +32,7 @@ function Languages() { variant="body2" color="secondary" data-no-link="true" - href={`/${language.code === 'en' ? '' : language.code}/`} + href={language.code === 'en' ? '/' : `/${language.code}/`} > Documentation </Link>
[docs] Fix english language link (#<I>)
mui-org_material-ui
train
js
8de89e2622b6a99c30e7f6ea9f35974dcf7559e3
diff --git a/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java b/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java +++ b/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.java @@ -1206,16 +1206,7 @@ public class ODatabaseDocumentTx extends OListenerManger<ODatabaseListener> impl private void clearOwner() { final Thread current = Thread.currentThread(); - final Thread o = owner.get(); - - if (o == null) { - throw new IllegalStateException("Database is going to be closed but was not opened"); - } - - if (o != current || !owner.compareAndSet(current, null)) { - throw new IllegalStateException("Database was opened in other thread `" + o.getName() + "' thread but closed in `" + - current.getName() + "' thread"); - } + owner.compareAndSet(current, null); } @Override
Issue #<I> was fixed.
orientechnologies_orientdb
train
java
105746e10e02c5916d9fe628e74f87b852683fa4
diff --git a/tensorforce/util/agent_util.py b/tensorforce/util/agent_util.py index <HASH>..<HASH> 100644 --- a/tensorforce/util/agent_util.py +++ b/tensorforce/util/agent_util.py @@ -25,7 +25,6 @@ from tensorforce.config import Config from tensorforce.exceptions.tensorforce_exceptions import TensorForceValueError from tensorforce.rl_agents.random_agent import RandomAgent from tensorforce.rl_agents.dqn_agent import DQNAgent -from tensorforce.rl_agents.double_dqn_agent import DoubleDQNAgent from tensorforce.rl_agents.naf_agent import NAFAgent @@ -63,6 +62,5 @@ def get_default_config(agent_type): agents = { 'RandomAgent': RandomAgent, 'DQNAgent': DQNAgent, - 'DoubleDQNAgent': DoubleDQNAgent, 'NAFAgent': NAFAgent }
removed ddqn agent from agent util
tensorforce_tensorforce
train
py
9f084d8485c53bcdebc2b80ec8ebb4c82b3fcb9e
diff --git a/wal_e/piper.py b/wal_e/piper.py index <HASH>..<HASH> 100644 --- a/wal_e/piper.py +++ b/wal_e/piper.py @@ -124,7 +124,10 @@ def popen_sp(*args, **kwargs): # to the gevent hub. for fp_symbol in ['stdin', 'stdout', 'stderr']: value = getattr(proc, fp_symbol) + if value is not None: + # this branch is only taken if a descriptor is sent in + # with 'PIPE' mode. setattr(proc, fp_symbol, NonBlockPipeFileWrap(value)) return proc
Explain why there is a None guard
wal-e_wal-e
train
py
462aff67fbc3488746a98b32fc5d377f41e80cb9
diff --git a/src/playbacks/hls/hls.js b/src/playbacks/hls/hls.js index <HASH>..<HASH> 100644 --- a/src/playbacks/hls/hls.js +++ b/src/playbacks/hls/hls.js @@ -153,7 +153,7 @@ export default class HLS extends HTML5VideoPlayback { fillLevels() { this._levels = this.hls.levels.map((level, index) => { - return {id: index , label: `${level.bitrate/1000}Kbps` + return {id: index, level: level, label: `${level.bitrate/1000}Kbps` }}) this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this._levels) }
send the entire level object (including height and bitrate) to the PLAYBACK_LEVELS_AVAILABLE event
clappr_clappr
train
js