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
d10d7cafc0628b26e783c1533bf23ce2aed634ea
diff --git a/src/spec/gocli/integration/cli_vms_spec.rb b/src/spec/gocli/integration/cli_vms_spec.rb index <HASH>..<HASH> 100644 --- a/src/spec/gocli/integration/cli_vms_spec.rb +++ b/src/spec/gocli/integration/cli_vms_spec.rb @@ -87,7 +87,7 @@ describe 'cli: vms', type: :integration do expect(first_row).to include('ips') expect(first_row).to include('vm_cid') expect(first_row).to include('vm_type') - expect(first_row).to include('created_at') + expect(first_row).to include('vm_created_at') expect(first_row).to include('uptime') expect(first_row).to include('load_1m_5m_15m') expect(first_row).to include('cpu_total')
Rename cli created at column to vm created at [#<I>](<URL>)
cloudfoundry_bosh
train
rb
dc11387b69103a8a00dec2ad97937f95db8010f2
diff --git a/lib/ditty.rb b/lib/ditty.rb index <HASH>..<HASH> 100644 --- a/lib/ditty.rb +++ b/lib/ditty.rb @@ -40,10 +40,6 @@ module Ditty @mutex.synchronize { @hash.inject(memo, &block) } end - def each(&block) - @mutex.synchronize { @hash.each(&block) } - end - def each_with_object(memo, &block) @mutex.synchronize { @hash.each_with_object(memo, &block) } end diff --git a/lib/ditty/components/ditty.rb b/lib/ditty/components/ditty.rb index <HASH>..<HASH> 100644 --- a/lib/ditty/components/ditty.rb +++ b/lib/ditty/components/ditty.rb @@ -7,7 +7,7 @@ module Ditty class Ditty def self.load controllers = File.expand_path('../controllers', __dir__) - Dir.glob("#{controllers}/*.rb").each { |f| require f } + Dir.glob("#{controllers}/*.rb").sort.each { |f| require f } require 'ditty/models/user' require 'ditty/models/role'
fix: Issues reported by rubocop
EagerELK_ditty
train
rb,rb
2fac0aae5dc58b3e9858a63645c30ca178904447
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ import pkg_resources VERSION = "0.46.0" NAME = "websocket_client" -install_requires = ["six"] +install_requires = ["six", "rel"] tests_require = [] if sys.version_info[0] == 2 and sys.version_info[1] < 7:
added rel to install_requires[]
websocket-client_websocket-client
train
py
64d89b37489c6d3b08412accad055c9c69175c4b
diff --git a/src/client/ClientDataResolver.js b/src/client/ClientDataResolver.js index <HASH>..<HASH> 100644 --- a/src/client/ClientDataResolver.js +++ b/src/client/ClientDataResolver.js @@ -196,8 +196,7 @@ class ClientDataResolver { const file = path.resolve(resource); const stat = fs.statSync(file); if (!stat.isFile()) { - reject(new Error(`The file could not be found: ${file}`)); - return; + throw new Error(`The file could not be found: ${file}`); } fs.readFile(file, (err, data) => { diff --git a/src/client/voice/ClientVoiceManager.js b/src/client/voice/ClientVoiceManager.js index <HASH>..<HASH> 100644 --- a/src/client/voice/ClientVoiceManager.js +++ b/src/client/voice/ClientVoiceManager.js @@ -104,8 +104,7 @@ class ClientVoiceManager { joinChannel(channel) { return new Promise((resolve, reject) => { if (this.pending.get(channel.guild.id)) { - reject(new Error('already connecting to a channel in this guild')); - return; + throw new Error('already connecting to a channel in this guild'); } const existingConn = this.connections.get(channel.guild.id); if (existingConn) {
Replace a few rejections with throw (#<I>)
discordjs_discord.js
train
js,js
2b13810b56a47709e91251f0ee41e201868a731c
diff --git a/libraries/lithium/data/source/database/adapter/Sqlite3.php b/libraries/lithium/data/source/database/adapter/Sqlite3.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/data/source/database/adapter/Sqlite3.php +++ b/libraries/lithium/data/source/database/adapter/Sqlite3.php @@ -42,11 +42,11 @@ class Sqlite3 extends \lithium\data\source\Database { * @param array $config Configuration options for this class. For additional configuration, * see `lithium\data\source\Database` and `lithium\data\Source`. Available options * defined by this class: - * - 'database' _string_: database name. Defaults to none - * - 'flags' _integer_: Optional flags used to determine how to open the SQLite database. - * By default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE. - * - 'key' _string_: An optional encryption key used when encrypting and - * decrypting an SQLite database. + * - `'database'` _string_: database name. Defaults to none + * - `'flags'` _integer_: Optional flags used to determine how to open the SQLite + * database. By default, open uses SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE. + * - `'key'` _string_: An optional encryption key used when encrypting and decrypting + * an SQLite database. * * Typically, these parameters are set in `Connections::add()`, when adding the adapter to the * list of active connections.
Adding @params to doc blocks for __construct() method.
UnionOfRAD_framework
train
php
fac211d47deeeeeb44b167c3e7db16231701da28
diff --git a/core/components/handler/handler.go b/core/components/handler/handler.go index <HASH>..<HASH> 100644 --- a/core/components/handler/handler.go +++ b/core/components/handler/handler.go @@ -51,6 +51,7 @@ type component struct { RXDelay uint8 PowerRX1 uint32 PowerRX2 uint32 + RFChain uint32 InvPolarity bool JoinDelay uint8 } @@ -108,6 +109,7 @@ func New(c Components, o Options) Interface { h.Configuration.JoinDelay = 5 h.Configuration.PowerRX1 = 14 h.Configuration.PowerRX2 = 27 + h.Configuration.RFChain = 0 h.Configuration.InvPolarity = true set := make(chan bundle) @@ -763,7 +765,7 @@ func (h component) buildMetadata(metadata core.Metadata, size uint32, baseDelay CodingRate: metadata.CodingRate, DataRate: metadata.DataRate, Modulation: metadata.Modulation, - RFChain: metadata.RFChain, + RFChain: h.Configuration.RFChain, InvPolarity: h.Configuration.InvPolarity, Power: h.Configuration.PowerRX1, PayloadSize: size,
[hotfix] Response RFChain should always be 0
TheThingsNetwork_ttn
train
go
678b9fb603e2ce1bc12a34e14a715dcce5fc4a9c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -192,7 +192,7 @@ setup( author='James R. Barlow', author_email='[email protected]', license='MIT', - packages=find_packages(exclude=["tests", "tests.*"]), + packages=find_packages(exclude=["tests", "tests.*", "ocrmypdf.lib"]), keywords=['PDF', 'OCR', 'optical character recognition', 'PDF/A', 'scanning'], classifiers=[ "Programming Language :: Python :: 3",
Do we need to exclude ocrmypdf.lib?
jbarlow83_OCRmyPDF
train
py
5848c94bfce7896219dd20660392b35f90f3e4fc
diff --git a/lib/specjour/cucumber/preloader.rb b/lib/specjour/cucumber/preloader.rb index <HASH>..<HASH> 100644 --- a/lib/specjour/cucumber/preloader.rb +++ b/lib/specjour/cucumber/preloader.rb @@ -3,6 +3,9 @@ module Specjour module Preloader def self.load(paths, output) Specjour.benchmark("Loading Cucumber Environment") do + if defined?(::Rails) && !ENV['RAILS_ROOT'] + ENV['RAILS_ROOT'] = Rails.root.to_s # Load the current rails environment if it exists + end require 'cucumber' unless defined?(::Cucumber::Cli) args = paths.unshift '--format', 'Specjour::Cucumber::DistributedFormatter' cli = ::Cucumber::Cli::Main.new(args, output) diff --git a/lib/specjour/manager.rb b/lib/specjour/manager.rb index <HASH>..<HASH> 100644 --- a/lib/specjour/manager.rb +++ b/lib/specjour/manager.rb @@ -95,7 +95,7 @@ module Specjour end def project_path - File.expand_path(project_name, File.realpath('/tmp')) + File.expand_path(project_name, '/tmp') end def start
Fix Rails already initialized error (again) The initial fix expanded the test paths, which would break when distributing from Mac to Linux (/private/tmp instead of /tmp). Now, we utilize the fact that Cucumber checks for RAILS_ROOT to ensure the environment isn't loaded twice (by non-unique paths).
sandro_specjour
train
rb,rb
e3de60f49ad7d2d5437a971fbb2a740fd97b00fa
diff --git a/server/server_test.go b/server/server_test.go index <HASH>..<HASH> 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -2911,7 +2911,7 @@ func TestSubscribeShrink(t *testing.T) { } func TestGetSubStoreRace(t *testing.T) { - numChans := 100 + numChans := 10000 opts := GetDefaultOptions() opts.MaxChannels = numChans + 1
Update test to increase chance of concurrent calls to CreateChannel
nats-io_nats-streaming-server
train
go
8c253db50c2c5a6b09096b52d02d010f7d735f2f
diff --git a/polyaxon/sso/providers/oauth2/views.py b/polyaxon/sso/providers/oauth2/views.py index <HASH>..<HASH> 100644 --- a/polyaxon/sso/providers/oauth2/views.py +++ b/polyaxon/sso/providers/oauth2/views.py @@ -14,9 +14,8 @@ class OAuth2LoginView(View): client_id = None scope = '' - # pylint:disable=keyword-arg-before-vararg - def __init__(self, authorize_url=None, client_id=None, scope=None, resource=None, *args, **kwargs): - super().__init__(*args, **kwargs) + def __init__(self, authorize_url=None, client_id=None, scope=None, resource=None, **kwargs): + super().__init__(**kwargs) if authorize_url is not None: self.authorize_url = authorize_url if client_id is not None:
Fix issue with kwargs before args
polyaxon_polyaxon
train
py
ef5a87a045b9ef38980ac43d5c3ab489cd96139b
diff --git a/Adapter/Common.php b/Adapter/Common.php index <HASH>..<HASH> 100644 --- a/Adapter/Common.php +++ b/Adapter/Common.php @@ -297,4 +297,11 @@ abstract class Common extends Adapter * Gets the color of the $x, $y pixel */ abstract protected function getColor($x, $y); + + /** + * enable progressive image loading + */ + public function enableProgressive(){ + throw new \Exception('The Adapter '.$this->getName().' does not support Progressive Image loading'); + } } diff --git a/Adapter/GD.php b/Adapter/GD.php index <HASH>..<HASH> 100644 --- a/Adapter/GD.php +++ b/Adapter/GD.php @@ -460,4 +460,11 @@ class GD extends Common { return imagecolorat($this->resource, $x, $y); } + + /** + * enable progressive image loading + */ + public function enableProgressive(){ + imageinterlace($this->resource, 1); + } }
Progressive PNG / JPEG -> add the call to the image adapter
Gregwar_Image
train
php,php
83ffb82fb9f53e1c90d3b598067494a12258b605
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -15,7 +15,7 @@ module ActiveRecord table = Arel::Table.new(table_name, :engine => engine) end - attribute = table[column.to_sym] || Arel::Attribute.new(table, column) + attribute = table[column.to_sym] case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation
Arel::Table#[] always returns an attribute, so no need for ||
rails_rails
train
rb
270b4f7aff9626e415746aa6ba9b8e050d91277c
diff --git a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java index <HASH>..<HASH> 100644 --- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java +++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java @@ -2127,7 +2127,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { * * def animals = ['CAT', 'DOG', 'ELEPHANT'] as Set * def smallAnimals = animals.collectMany{ it.size() > 3 ? [] : [it.toLowerCase()] } - * assert smallAnimals == ['cat', 'dog'] as Set + * assert smallAnimals == ['cat', 'dog'] * * def orig = nums as Set * def origPlusIncrements = orig.collectMany{ [it, it+1] }
GROOVY-<I>: collectMany should not use createSimilarCollection and instead behave like collect
apache_groovy
train
java
e6e1ba8c083330e88c5d11fbc091f86a66cbfd65
diff --git a/lib/keen/client.rb b/lib/keen/client.rb index <HASH>..<HASH> 100644 --- a/lib/keen/client.rb +++ b/lib/keen/client.rb @@ -91,7 +91,7 @@ module Keen end def api_event_collection_resource_path(event_collection) - "/#{api_version}/projects/#{project_id}/events/#{CGI.escape(event_collection.to_s)}" + "/#{api_version}/projects/#{project_id}/events/#{URI::escape(event_collection.to_s)}" end def preprocess_params(params)
Fixed encoding method for event collections in URLs
keenlabs_keen-gem
train
rb
cbf65340ec77951e0bc73fb5063f67a895a5e21a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -39,11 +39,6 @@ export const VIEW_PRODUCTS_PERMISSION = { resource: 'products', }; -export const MANAGE_CUSTOMERS_PERMISSION = { - mode: 'manage', - resource: 'customers', -}; - export const MANAGE_OAUTH_CLIENTS = { mode: 'manage', resource: 'oauth_clients',
refactor(customers): to use permission constants over custom constant
commercetools_merchant-center-application-kit
train
js
9f617bb4094b44c1b6491868e5cf361ca8c927dd
diff --git a/nodemcu_uploader/uploader.py b/nodemcu_uploader/uploader.py index <HASH>..<HASH> 100644 --- a/nodemcu_uploader/uploader.py +++ b/nodemcu_uploader/uploader.py @@ -10,6 +10,7 @@ import time import logging import hashlib import os +import errno import serial @@ -246,6 +247,15 @@ class Uploader(object): destination = filename log.info('Transferring %s to %s', filename, destination) data = self.download_file(filename) + + # Just in case, the filename may contain folder, so create it if needed. + log.info(destination) + if not os.path.exists(os.path.dirname(destination)): + try: + os.makedirs(os.path.dirname(destination)) + except OSError as e: # Guard against race condition + if e.errno != errno.EEXIST: + raise with open(destination, 'w') as fil: fil.write(data)
Try to handle folder name in path by creating the folder if needed.
kmpm_nodemcu-uploader
train
py
43fcf2e8ae4f870f8e14170e963996a868a93971
diff --git a/lib/jets/cfn/template_builders/interface.rb b/lib/jets/cfn/template_builders/interface.rb index <HASH>..<HASH> 100644 --- a/lib/jets/cfn/template_builders/interface.rb +++ b/lib/jets/cfn/template_builders/interface.rb @@ -5,6 +5,9 @@ class Jets::Cfn::TemplateBuilders module Interface def build + return if @app_class.tasks.empty? # do not bother building or writing + # the template unless there are functions defined + compose # must be implemented by subclass write end
fix edge case when no public methods are defined for a job or controller
tongueroo_jets
train
rb
e3cb310be79eae1baa586ac249d76f34fac6e9bb
diff --git a/src/Illuminate/Support/Arr.php b/src/Illuminate/Support/Arr.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Support/Arr.php +++ b/src/Illuminate/Support/Arr.php @@ -55,10 +55,12 @@ class Arr continue; } - $results[] = $values; + foreach ($values as $item) { + array_push($results, $item); + } } - return array_merge(...$results); + return $results; } /**
Arr::collapse better performance
laravel_framework
train
php
1e98feda7c57e03232082c1049e93aaf2e0b4a91
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -30,8 +30,6 @@ import sys from setuptools import find_packages, setup from setuptools.command.test import test as TestCommand -PY3 = sys.version_info[0] == 3 - readme = open('README.rst').read() history = open('CHANGES.rst').read() @@ -50,6 +48,7 @@ tests_require = [ ] extras_require = { + ':python_version=="2.7"': ['ipaddr>=2.1.11'], 'celery': [ 'celery>=3.1.0', ], @@ -60,7 +59,9 @@ extras_require = { } extras_require['all'] = [] -for reqs in extras_require.values(): +for name, reqs in extras_require.items(): + if name[0] == ':': + continue extras_require['all'].extend(reqs) setup_requires = [ @@ -77,14 +78,10 @@ install_requires = [ 'SQLAlchemy-Utils[ipaddress]>=0.31.0', ] -if not PY3: - install_requires.append('ipaddr>=2.1.11') - packages = find_packages() class PyTest(TestCommand): - """PyTest Test.""" user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
installation: fix for ipaddr in wheel on PY3 * Makes a wheel generated on Python <I> universal for Python <I>+. (closes #<I>)
inveniosoftware_invenio-accounts
train
py
d603ddae03ddf6cdc3e064b05f643a4303f1df51
diff --git a/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java +++ b/liquibase-core/src/main/java/liquibase/database/core/OracleDatabase.java @@ -83,7 +83,7 @@ public class OracleDatabase extends AbstractJdbcDatabase { @Override public String getJdbcSchemaName(CatalogAndSchema schema) { - return schema.getCatalogName(); + return schema.getCatalogName() == null ? schema.getSchemaName() : schema.getCatalogName(); } @Override
CORE-<I> Oracle database dbDoc generation performance issues
liquibase_liquibase
train
java
b277a18190ae82b9a0d7b2f7c4741f0b4e941f13
diff --git a/src/js/cropper.js b/src/js/cropper.js index <HASH>..<HASH> 100644 --- a/src/js/cropper.js +++ b/src/js/cropper.js @@ -106,7 +106,12 @@ class Cropper { const { element, options } = this; - if (!options.checkOrientation || !window.ArrayBuffer) { + if ( + !options.rotatable + || !options.scalable + || !options.checkOrientation + || !window.ArrayBuffer + ) { this.clone(); return; }
fix: check orientation only when it is rotatable and scalable
fengyuanchen_cropperjs
train
js
0e506dfbaf33b77ee48f701cda904f213fc763fe
diff --git a/eZ/Publish/API/Repository/Tests/LocationServiceTest.php b/eZ/Publish/API/Repository/Tests/LocationServiceTest.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Tests/LocationServiceTest.php +++ b/eZ/Publish/API/Repository/Tests/LocationServiceTest.php @@ -1315,7 +1315,7 @@ class LocationServiceTest extends BaseTest { try { - $locationService->loadLocation( $childLocationId ); + $locationService->loadLocation( $this->generateId( 'location', $childLocationId ) ); $this->fail( "Location $childLocationId not deleted." ); } catch ( Exceptions\NotFoundException $e ) {} @@ -1328,7 +1328,7 @@ class LocationServiceTest extends BaseTest { try { - $contentService->loadContentInfo( $childContentId ); + $contentService->loadContentInfo( $this->generateId( 'object', $childContentId ) ); $this->fail( "Content $childContentId not deleted." ); } catch ( Exceptions\NotFoundException $e ) {}
Add ID generator to LocationServiceTest::testDeleteLocation
ezsystems_ezpublish-kernel
train
php
8d454e241724ea192de4a44b85aab2673efa418d
diff --git a/Slim/Router.php b/Slim/Router.php index <HASH>..<HASH> 100644 --- a/Slim/Router.php +++ b/Slim/Router.php @@ -190,7 +190,10 @@ class Router implements RouterInterface // According to RFC methods are defined in uppercase (See RFC 7231) $methods = array_map("strtoupper", $methods); - /** @var callable $routeHandler */ + /** + * This variable reassignment is to avoid PHPStan warning + * @var callable $routeHandler + */ $routeHandler = $handler; /** @var Route $route */
add comment for variable reassignment in Router to avoid PHPStan warning
slimphp_Slim
train
php
6a7e79a443cb1f1adde675ee5321302b0c5cff1b
diff --git a/lib/NormalModule.js b/lib/NormalModule.js index <HASH>..<HASH> 100644 --- a/lib/NormalModule.js +++ b/lib/NormalModule.js @@ -296,6 +296,9 @@ class NormalModule extends Module { } if (err) { + if (!(err instanceof Error)) { + err = new NonErrorEmittedError(err); + } const currentLoader = this.getCurrentLoader(loaderContext); const error = new ModuleBuildError(this, err, { from:
Convert non-Error errors into Errors
webpack_webpack
train
js
3a45e00201c7d2874b30cb9b3f2b68b3d85705e7
diff --git a/abilian/application.py b/abilian/application.py index <HASH>..<HASH> 100644 --- a/abilian/application.py +++ b/abilian/application.py @@ -123,6 +123,8 @@ class Application(Flask, ServiceManager, PluginManager): logging_file = self.config.get('LOGGING_CONFIG_FILE') if logging_file: + logging_file = os.path.abspath(os.path.join(self.instance_path, + logging_file)) if logging_file.endswith('.conf'): # old standard 'ini' file config logging.config.fileConfig(logging_file, disable_existing_loggers=False)
load logging file from instance_path
abilian_abilian-core
train
py
b6b1f9b3d7b8887a538b4f1bf40ceb862c190eec
diff --git a/lib/assemble.js b/lib/assemble.js index <HASH>..<HASH> 100644 --- a/lib/assemble.js +++ b/lib/assemble.js @@ -550,9 +550,8 @@ defineGetter('layouts', function () { patterns.push(glob); } - var layouts = this.get('layouts'); - layouts.cache(patterns, this.options); - return layouts.get(); + this.layoutsCache.add(patterns, this.options); + return this.layoutsCache.get(); });
updating to use this.layoutsCache
assemble_assemble
train
js
303e5e8a5f4e73cb78631a1875b4f33b7e5e1cfe
diff --git a/packages/ember-metal/lib/computed.js b/packages/ember-metal/lib/computed.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/computed.js +++ b/packages/ember-metal/lib/computed.js @@ -526,7 +526,7 @@ ComputedPropertyPrototype.teardown = function(obj, keyName) { The alternative syntax, with prototype extensions, might look like: ```js - fullName() { + fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') ```
[DOC release] Fix computed property syntax with prototype extensions. The previous code was a syntax error since you can't use a shorthand object method as part of a member expression.
emberjs_ember.js
train
js
4c30d2c1119576773e8864d5cb9bd4a2c23a267a
diff --git a/src/Illuminate/Foundation/Console/ModelMakeCommand.php b/src/Illuminate/Foundation/Console/ModelMakeCommand.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Console/ModelMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ModelMakeCommand.php @@ -42,6 +42,7 @@ class ModelMakeCommand extends GeneratorCommand if ($this->option('all')) { $this->input->setOption('factory', true); + $this->input->setOption('seed', true); $this->input->setOption('migration', true); $this->input->setOption('controller', true); $this->input->setOption('resource', true);
Enable seed to all option (#<I>)
laravel_framework
train
php
44bb0fe22a4072a5fa79e807a5721a76e4d15a04
diff --git a/src/lib/sendRequest.js b/src/lib/sendRequest.js index <HASH>..<HASH> 100644 --- a/src/lib/sendRequest.js +++ b/src/lib/sendRequest.js @@ -15,6 +15,7 @@ const createResponseHandler = ({ options, dispatch, reject, resolve }) => { meta: options, payload: err }) + if (options.onGlobalError) options.onGlobalError(err, res) if (options.onError) options.onError(err, res) return reject(err) }
Add option for a root global error to be set with redux-sutro
shastajs_tahoe
train
js
16208fb629e2ab15245ef67771fff4c1a2011298
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index <HASH>..<HASH> 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -247,9 +247,10 @@ var broadcast = { * * @param {string} str url with parameters to be updated * @param {boolean} [showAjaxLoading] whether to show the ajax loading gif or not. + * @param {string} strHash additional parameters that should be updated on the hash * @return {void} */ - propagateNewPage: function (str, showAjaxLoading) { + propagateNewPage: function (str, showAjaxLoading, strHash) { // abort all existing ajax requests globalAjaxQueue.abort(); @@ -273,6 +274,13 @@ var broadcast = { } } + if (strHash && currentHashStr.length != 0) { + var params_hash_vals = strHash.split("&"); + for (var i = 0; i < params_hash_vals.length; i++) { + currentHashStr = broadcast.updateParamValue(params_hash_vals[i], currentHashStr); + } + } + // Now load the new page. var newUrl = currentSearchStr + currentHashStr;
add possibility to update search and hash separately
matomo-org_matomo
train
js
6a830d1d3a1f7e6bb225affb6d739d41bcf6db93
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,9 +32,7 @@ MOCK_MODULES = [ 'choice', 'queueing_tool.queues.choice', 'matplotlib', - 'networkx', 'numpy', - 'numpy.random', 'priority_queue', 'queueing_tool.network.priority_queue', 'pygraphviz'
Changed mocked modules in conf.py for docs
djordon_queueing-tool
train
py
ebc738d43131e910ffa07d6e80e8e80e0c471883
diff --git a/lib/qx/tool/cli/commands/contrib/Install.js b/lib/qx/tool/cli/commands/contrib/Install.js index <HASH>..<HASH> 100644 --- a/lib/qx/tool/cli/commands/contrib/Install.js +++ b/lib/qx/tool/cli/commands/contrib/Install.js @@ -190,7 +190,7 @@ qx.Class.define("qx.tool.cli.commands.contrib.Install", { this.__data.libraries.push(library_elem); } if (writeToManifest && !this.__manifest.requires[current_uri]) { - this.__manifest.requires[current_uri] = info.version; + this.__manifest.requires[current_uri] = "^" + info.version; } await this.installApplication(current_download_path); await this.installDependencies(current_download_path);
install contribs with leading ^ in manifest.json
qooxdoo_qooxdoo-compiler
train
js
9716a5bbece1083f344317f8e863c86241523fc7
diff --git a/src/notebook/agendas/index.js b/src/notebook/agendas/index.js index <HASH>..<HASH> 100644 --- a/src/notebook/agendas/index.js +++ b/src/notebook/agendas/index.js @@ -74,6 +74,22 @@ export function executeCell(channels, id, source) { if (output.output_type === 'clear_output') { return new Immutable.List(); } + + // Naive implementation of stream buffering + // This should be broken out into a nice testable function + // Additionally, stdout and stderr should be in order as stdout followed + // by stderr, as implemented in the Jupyter notebook + if (output.output_type === 'stream') { + const last = outputs.last(); + if (last && last.get('name') === output.name) { + return outputs.updateIn([outputs.size - 1, 'text'], text => text + output.text); + } + const nextToLast = outputs.butLast().last(); + if (nextToLast && nextToLast.get('name') === output.name) { + return outputs.updateIn([outputs.size - 2, 'text'], text => text + output.text); + } + } + return outputs.push(Immutable.fromJS(output)); }, new Immutable.List()) // Update the outputs with each change
Initial implementation of stream accumulation Fixes #<I>
nteract_nteract
train
js
0056f27ba2cbb984b829c8db3a1f3c7ef15d29ba
diff --git a/libkbfs/folder_branch_ops.go b/libkbfs/folder_branch_ops.go index <HASH>..<HASH> 100644 --- a/libkbfs/folder_branch_ops.go +++ b/libkbfs/folder_branch_ops.go @@ -1053,6 +1053,11 @@ func (fbo *folderBranchOps) getMDForWriteOrRekeyLocked( headStatus := headTrusted if mdType == mdRekey { headStatus = headUntrusted + // If we already have a head (that has been filled after the initial + // check, but before we acquired the lock. Then use that. + if fbo.head != (ImmutableRootMetadata{}) { + return fbo.head, nil + } } err = fbo.setHeadLocked(ctx, lState, md, headStatus) if err != nil {
libkbfs: Avoid race in getMDForWriteOrRekeyLocked
keybase_client
train
go
2c30c4322b55497b047b4b7cb88f40a959331aa8
diff --git a/languagetool-dev/src/main/java/org/languagetool/dev/httpchecker/CheckCallable.java b/languagetool-dev/src/main/java/org/languagetool/dev/httpchecker/CheckCallable.java index <HASH>..<HASH> 100644 --- a/languagetool-dev/src/main/java/org/languagetool/dev/httpchecker/CheckCallable.java +++ b/languagetool-dev/src/main/java/org/languagetool/dev/httpchecker/CheckCallable.java @@ -162,6 +162,8 @@ class CheckCallable implements Callable<File> { try { System.setProperty("http.keepAlive", "false"); // without this, there's an overhead of about 1 second - not sure why URLConnection conn = url.openConnection(); + conn.setConnectTimeout(20*1000); + conn.setReadTimeout(60*1000); conn.setDoOutput(true); if (user != null && password != null) { String authString = user + ":" + password;
set timeouts so process cannot get stuck forever
languagetool-org_languagetool
train
java
92bd3cbfa3c7f0a1608da974cefb571da5b9b18b
diff --git a/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php b/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php index <HASH>..<HASH> 100644 --- a/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php +++ b/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php @@ -46,6 +46,7 @@ use ProxyManagerTestAsset\EmptyClass; use ProxyManagerTestAsset\HydratedObject; use ProxyManagerTestAsset\ReturnTypeHintedClass; use ProxyManagerTestAsset\ScalarTypeHintedClass; +use ProxyManagerTestAsset\VoidMethodTypeHintedClass; /** * Verifies that proxy factories don't conflict with each other when generating proxies @@ -131,6 +132,7 @@ class MultipleProxyGenerationTest extends PHPUnit_Framework_TestCase [ClassWithMethodWithByRefVariadicFunction::class], [ScalarTypeHintedClass::class], [ReturnTypeHintedClass::class], + [VoidMethodTypeHintedClass::class], ]; } }
Testing proxy generation against all generators, using `void` and verifying no return values are present
Ocramius_ProxyManager
train
php
fc917876cb763ca371aaf86a428f9761af49862f
diff --git a/ricecooker/__init__.py b/ricecooker/__init__.py index <HASH>..<HASH> 100644 --- a/ricecooker/__init__.py +++ b/ricecooker/__init__.py @@ -2,7 +2,7 @@ __author__ = 'Learning Equality' __email__ = '[email protected]' -__version__ = '0.6.30' +__version__ = '0.6.31' import sys
bump verison number to <I> in prep for release
learningequality_ricecooker
train
py
315e4e83f934091bdcd5f49b830afe1a736a29e8
diff --git a/blocks/blog_tags/block_blog_tags.php b/blocks/blog_tags/block_blog_tags.php index <HASH>..<HASH> 100644 --- a/blocks/blog_tags/block_blog_tags.php +++ b/blocks/blog_tags/block_blog_tags.php @@ -115,7 +115,7 @@ class block_blog_tags extends block_base { /// Finally we create the output foreach ($etags as $tag) { $link = $CFG->wwwroot.'/blog/index.php?courseid='. - $this->instance->pageid.'&filtertype=site&tagid='.$tag->id; + $this->instance->pageid.'&amp;filtertype=site&amp;tagid='.$tag->id; $this->content->text .= '<a href="'.$link.'" '. 'class="'.$tag->class.'" '. 'title="'.get_string('numberofentries','blog',$tag->ct).'">'.
Fixed XHTML notices with &amp;
moodle_moodle
train
php
85a78052ead106fde4cd6e577f77ec042ad1ccb7
diff --git a/lib/classes/binaryAdapter/image/resize/gd.class.php b/lib/classes/binaryAdapter/image/resize/gd.class.php index <HASH>..<HASH> 100644 --- a/lib/classes/binaryAdapter/image/resize/gd.class.php +++ b/lib/classes/binaryAdapter/image/resize/gd.class.php @@ -98,8 +98,23 @@ class binaryAdapter_image_resize_gd extends binaryAdapter_processorAbstract { $size = max($tech_datas[system_file::TC_DATAS_WIDTH], $tech_datas[system_file::TC_DATAS_HEIGHT]); } - - $imag_original = imagecreatefromjpeg($origine->getPathname()); + + switch($origine->get_mime()) + { + case "image/jpeg" : + $imag_original = imagecreatefromjpeg($origine->getPathname()); + break; + case "image/gif" : + $imag_original = imagecreatefromgif($origine->getPathname()); + break; + case "image/png" : + $imag_original = imagecreatefrompng($origine->getPathname()); + break; + default: + return $this; + break; + } + if ($imag_original) {
fix error with gd resizer processor
alchemy-fr_Phraseanet
train
php
9edda2d3893a8229c1de3555418080fab6dc0936
diff --git a/Container/Model/Struct.php b/Container/Model/Struct.php index <HASH>..<HASH> 100755 --- a/Container/Model/Struct.php +++ b/Container/Model/Struct.php @@ -46,8 +46,8 @@ class Struct extends AbstractModel if ($this->get($structName) === null) { $this->add(new Model($structName)); } - if (!empty($attributeName) && !empty($attributeType) && $this->getStructByName($structName) !== null) { - $this->get($structName)->addAttribute($attributeName, $attributeType); + if (($struct = $this->getStructByName($structName)) instanceof Model) { + $struct->addAttribute($attributeName, $attributeType); } } /**
issue #2 - simplify sanity check as addAttribute now does the job
WsdlToPhp_PackageGenerator
train
php
9d80aeb4953bb0427638348e945e040037e12fc8
diff --git a/src/main/java/com/coveros/selenified/services/HTTP.java b/src/main/java/com/coveros/selenified/services/HTTP.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/coveros/selenified/services/HTTP.java +++ b/src/main/java/com/coveros/selenified/services/HTTP.java @@ -373,7 +373,7 @@ public class HTTP { methodsField.set(null/*static field*/, newMethods); } catch (NoSuchFieldException | IllegalAccessException e) { - throw new IllegalStateException(e); + log.info("Your version of Java doesn't support the PATCH method, be warned! " + e); } } @@ -519,4 +519,4 @@ public class HTTP { } return new Response(reporter, headers, status, object, array, data); } -} \ No newline at end of file +}
Feature/reflection issues (#<I>) * Reducing selenium logging * Adding in warning about patch method * Update HTTP.java Downgrading log
Coveros_selenified
train
java
948973292bfad13cdb2f487372e189731a7e4b61
diff --git a/cmd/influx_inspect/tsm.go b/cmd/influx_inspect/tsm.go index <HASH>..<HASH> 100644 --- a/cmd/influx_inspect/tsm.go +++ b/cmd/influx_inspect/tsm.go @@ -558,9 +558,9 @@ func cmdDumpTsm1dev(opts *tsdmDumpOpts) { blockSize += int64(len(buf)) + 4 startTime := time.Unix(0, int64(btou64(buf[:8]))) - blockType := buf[8] + blockType := buf[0] - encoded := buf[9:] + encoded := buf[1:] var v []tsm1.Value v, err := tsm1.DecodeBlock(buf, v)
Update influx_inspect to handle min time removed from blocks
influxdata_influxdb
train
go
1c0616a61740f1407f684a1dbe816fa547873b13
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index <HASH>..<HASH> 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -250,7 +250,10 @@ class PyscriptBridge(object): self.cmd_echo = False def __getattr__(self, item: str): - """If attribute is a command, return a callable. Otherwise return the attribute.""" + """ + Provide a way to call application commands via the PyscriptBridge + ex: app.help() + """ func = self._cmd2_app.cmd_func(item) if func: @@ -264,7 +267,8 @@ class PyscriptBridge(object): return wrap_func else: - return getattr(self._cmd2_app, item) + # item does not refer to a command + raise AttributeError("'{}' object has no attribute '{}'".format(self._cmd2_app.pyscript_name, item)) def __dir__(self): """Return a custom set of attribute names to match the available commands"""
Changed PyscriptBridge.__getattr__ to raise Attribute error for non-commands
python-cmd2_cmd2
train
py
38e22d5e163fd598effd502397558ec64a7f5494
diff --git a/lib/veewee/provider/core/helper/ssh.rb b/lib/veewee/provider/core/helper/ssh.rb index <HASH>..<HASH> 100644 --- a/lib/veewee/provider/core/helper/ssh.rb +++ b/lib/veewee/provider/core/helper/ssh.rb @@ -110,7 +110,7 @@ module Veewee ch.on_data do |c, data| stdout+=data - ui.info data unless options[:mute] + ui.info(data, :new_line => false) unless options[:mute] end @@ -119,7 +119,7 @@ module Veewee ch.on_extended_data do |c, type, data| stderr+=data - ui.info data unless options[:mute] + ui.info(data, :new_line => false) unless options[:mute] end
Avoid writing new lines on ssh output... this breaks output that rewrites the line, such as download progress, and in many cases produces excess line breaks.
jedi4ever_veewee
train
rb
f911d9fc401bdcb088b4d20d8c05d96f013c449a
diff --git a/ng-swagger-gen.js b/ng-swagger-gen.js index <HASH>..<HASH> 100644 --- a/ng-swagger-gen.js +++ b/ng-swagger-gen.js @@ -104,7 +104,7 @@ function doGenerate(swagger, options) { model, modelsOutput + '/' + model.modelFile + '.ts' ); - if (options.generateExamples) { + if (options.generateExamples && model.modelExample) { generate( templates.example, {example: JSON.stringify(model.modelExample, null, 4)},
if there's no example in the model, we don't generate the example file
cyclosproject_ng-swagger-gen
train
js
0b9a6d297c08b6c3148109cf7e49efb8de0a9a2a
diff --git a/src/Models/Comment.php b/src/Models/Comment.php index <HASH>..<HASH> 100755 --- a/src/Models/Comment.php +++ b/src/Models/Comment.php @@ -60,7 +60,7 @@ class Comment extends Model public function createComment(Model $commentable, $data, Model $creator): self { return $commentable->comments()->create(array_merge($data, [ - 'creator_id' => $creator->id, + 'creator_id' => $creator->getAuthIdentifier(), 'creator_type' => get_class($creator), ])); }
Improve support for custom user providers Custom user providers might implement databases which do not use id as a default identifier. The getAuthIdentifier() allows the user provider to specify which key is the actual auth identifier.
faustbrian_Laravel-Commentable
train
php
ea8f48ffe8cb0d6e723c2a13c1f59c2d4d84a8bf
diff --git a/src/Sample.js b/src/Sample.js index <HASH>..<HASH> 100644 --- a/src/Sample.js +++ b/src/Sample.js @@ -42,7 +42,7 @@ prototype.transform = function(_, pulse) { if (res.length < num) { res.push(t); } else { - idx = ~~(cnt * Math.random()); + idx = ~~((cnt + 1) * Math.random()); if (idx < res.length && idx >= cap) { p = res[idx]; if (map[tupleid(p)]) out.rem.push(p); // eviction
Fix off-by-one error in Sample transform.
vega_vega-transforms
train
js
548319feb8916793a90fd56cb8d0c0b794c48006
diff --git a/wtf-trace-shim.js b/wtf-trace-shim.js index <HASH>..<HASH> 100644 --- a/wtf-trace-shim.js +++ b/wtf-trace-shim.js @@ -1,8 +1,9 @@ /** + * @license + * https://github.com/google/tracing-framework * Copyright 2012 Google, Inc. All Rights Reserved. - * * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. + * found at https://github.com/google/tracing-framework/blob/master/LICENSE. */ /**
Adding @license to the API shim.
google_tracing-framework
train
js
1439a1f4d27aaa96a812ae0fc6865c8d8986aa13
diff --git a/src/core/fontwatchrunner.js b/src/core/fontwatchrunner.js index <HASH>..<HASH> 100644 --- a/src/core/fontwatchrunner.js +++ b/src/core/fontwatchrunner.js @@ -126,8 +126,8 @@ webfont.FontWatchRunner.prototype.createHiddenElementWithFont_ = function( defaultFonts, opt_withoutFontFamily) { var variationCss = this.fvd_.expand(this.fontDescription_); var styleString = "position:absolute;top:-999px;font-size:300px;" + - "width:auto;height:auto;line-height:normal;margin:0;padding:0;" + - "font-family:" + (opt_withoutFontFamily ? "" : + "width:auto;height:auto;line-height:normal;margin:0;padding:0;" + + "font-variant:normal;font-family:" + (opt_withoutFontFamily ? "" : this.nameHelper_.quote(this.fontFamily_) + ",") + defaultFonts + ";" + variationCss; var span = this.domHelper_.createElement('span', { 'style': styleString },
Added font-variant normal to the style of the span.
typekit_webfontloader
train
js
e47265fa8c6d6cb832a95015562024000618c83a
diff --git a/Makefile.js b/Makefile.js index <HASH>..<HASH> 100644 --- a/Makefile.js +++ b/Makefile.js @@ -182,6 +182,9 @@ function getReleaseType(version) { function release(type) { var newVersion;/* , changes;*/ + exec("git checkout master && git fetch origin && git reset --hard origin/master"); + exec("npm install && npm prune"); + target.test(); echo("Generating new version"); newVersion = execSilent("npm version " + type).trim();
Build: Add branch update during release process (fixes #<I>)
eslint_eslint
train
js
5edffe6cdd58807c3f58102210a85f0d0e8203c7
diff --git a/core/FrontController.php b/core/FrontController.php index <HASH>..<HASH> 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -208,7 +208,8 @@ class Piwik_FrontController $exceptionToThrow = $e; } - if(Zend_Registry::get('config')->General->maintenance_mode == 1) + if(Zend_Registry::get('config')->General->maintenance_mode == 1 + && !Piwik_Common::isPhpCliMode()) { throw new Exception("Piwik is in scheduled maintenance. Please come back later."); }
Maintenance mode should only affect the Browser Piwik, in shell mode, it should still allow to run the upgrade while in maintenance mode git-svn-id: <URL>
matomo-org_matomo
train
php
28d66968d6c9bd997cbc45e27ddb8717979392d6
diff --git a/src/webvr-polyfill.js b/src/webvr-polyfill.js index <HASH>..<HASH> 100644 --- a/src/webvr-polyfill.js +++ b/src/webvr-polyfill.js @@ -96,7 +96,7 @@ WebVRPolyfill.prototype.enablePolyfill = function() { // Provide the VRDisplay object. window.VRDisplay = VRDisplay; - // Provide vrEnabled. + // Provide navigator.vrEnabled. var that = this; Object.defineProperty(navigator, 'vrEnabled', { get: function () {
More descriptive comment for vrEnabled #<I>
immersive-web_webvr-polyfill
train
js
d3932d0de33ffb3c8411f22384682bfa44d8c470
diff --git a/py/nupic/frameworks/opf/exp_generator/ExpGenerator.py b/py/nupic/frameworks/opf/exp_generator/ExpGenerator.py index <HASH>..<HASH> 100755 --- a/py/nupic/frameworks/opf/exp_generator/ExpGenerator.py +++ b/py/nupic/frameworks/opf/exp_generator/ExpGenerator.py @@ -925,7 +925,7 @@ def _generateEncoderStringsV2(includedFields, options): encoderDictsList.remove(encoderDict) #Remove any encoders not in fiexedFields - if 'fixedFields' in options: + if options.get('fixedFields') is not None: tempList=[] for encoderDict in encoderDictsList: if encoderDict['name'] in options['fixedFields']:
didn't realize an option could be None as opposed to just missing
numenta_nupic
train
py
2c2a0c3e7fb29fc8bebff2a1753c6c4961f65d0e
diff --git a/absl/tests/app_test.py b/absl/tests/app_test.py index <HASH>..<HASH> 100644 --- a/absl/tests/app_test.py +++ b/absl/tests/app_test.py @@ -20,6 +20,7 @@ from __future__ import print_function import codecs import contextlib +import copy import os import re import subprocess @@ -313,6 +314,14 @@ class FunctionalTests(absltest.TestCase): self.assertIn('during real_main', stdout) +class FlagDeepCopyTest(absltest.TestCase): + """Make sure absl flags are copy.deepcopy() compatible.""" + + def test_deepcopyable(self): + copy.deepcopy(FLAGS) + # Nothing to assert + + class FlagValuesExternalizationTest(absltest.TestCase): """Test to make sure FLAGS can be serialized out and parsed back in."""
Add a test to check that FLAGS is deepcopy-able. There are some unit tests for deepcopy support, but none that ensure the flags defined by absl behave correctly. PiperOrigin-RevId: <I> Change-Id: Ib<I>aac<I>a<I>a<I>e<I>ef
abseil_abseil-py
train
py
a68b978c5bcb2f1c04f2d92ec97c2e7ade857bbc
diff --git a/luciexe/build/main.go b/luciexe/build/main.go index <HASH>..<HASH> 100644 --- a/luciexe/build/main.go +++ b/luciexe/build/main.go @@ -16,6 +16,7 @@ package build import ( "bytes" + "compress/zlib" "context" "flag" "io" @@ -24,7 +25,6 @@ import ( "runtime/debug" "time" - "github.com/klauspost/compress/zlib" "golang.org/x/time/rate" "google.golang.org/protobuf/proto"
[luciexe] switch to standard compress/zlib. There is nothing wrong with klauspost version (AFAIK), but because we didn't allowlist it, the roll to infra is blocked. R=iannucci, yiwzhang Bug: <I> Change-Id: Ibc<I>ec<I>bb<I>a7ae8cf<I>fa<I>bd<I>d Reviewed-on: <URL>
luci_luci-go
train
go
e68d152cedb00efbe2e73536d746a099432f311d
diff --git a/src/server/pps/server/api_server.go b/src/server/pps/server/api_server.go index <HASH>..<HASH> 100644 --- a/src/server/pps/server/api_server.go +++ b/src/server/pps/server/api_server.go @@ -821,7 +821,7 @@ func (a *apiServer) FinishJob(ctx context.Context, request *ppsserver.FinishJobR // parent might have been cancelled, which would automatically result // in this commit being cancelled as well. commitInfo, err := pfsAPIClient.InspectCommit(ctx, &pfsclient.InspectCommitRequest{ - Commit: jobInfo.OutputCommit, + Commit: outputCommits.Commit[0], }) if err != nil { return nil, err
Use the merge commit as the output commit in FinishJob
pachyderm_pachyderm
train
go
ce88b6ad414ae13cc221cecb1e52f7b3b626b83b
diff --git a/salt/cloud/clouds/softlayer.py b/salt/cloud/clouds/softlayer.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/softlayer.py +++ b/salt/cloud/clouds/softlayer.py @@ -571,6 +571,8 @@ def list_nodes(call=None): ret[node]['public_ips'] = nodes[node]['primaryIpAddress'] if 'primaryBackendIpAddress' in nodes[node]: ret[node]['private_ips'] = nodes[node]['primaryBackendIpAddress'] + if 'status' in nodes[node]: + ret[node]['state'] = str(nodes[node]['status']['name']) return ret
Allow map file to work with softlayer Refs #<I>
saltstack_salt
train
py
88b3bd7d27559424b85d23d71daabb232482ab0e
diff --git a/main/core/Resources/modules/resource/explorer/store/actions.js b/main/core/Resources/modules/resource/explorer/store/actions.js index <HASH>..<HASH> 100644 --- a/main/core/Resources/modules/resource/explorer/store/actions.js +++ b/main/core/Resources/modules/resource/explorer/store/actions.js @@ -53,7 +53,9 @@ actions.fetchDirectories = (explorerName, parent = null) => ({ filters: { resourceType: 'directory' }, - sortBy: '-name' + sortBy: '-name', + //todo: lazy load instead + limit: 20 }), success: (response, dispatch) => dispatch(actions.loadDirectories(explorerName, parent, response.data || [])) }
[CoreBundle] Resource explorer directory list limit (#<I>)
claroline_Distribution
train
js
91386c7cf791481f0fab02707848a577e9eb4c24
diff --git a/code/UserDefinedForm.php b/code/UserDefinedForm.php index <HASH>..<HASH> 100755 --- a/code/UserDefinedForm.php +++ b/code/UserDefinedForm.php @@ -579,7 +579,7 @@ class UserDefinedForm_EmailRecipient extends DataObject { 'EmailAddress' => 'Varchar(200)', 'EmailSubject' => 'Varchar(200)', 'EmailFrom' => 'Varchar(200)', - 'EmailBody' => 'Text' + 'EmailBody' => 'HTMLText' ); static $has_one = array(
MINOR: changed html body to html to allow html tags
silverstripe_silverstripe-userforms
train
php
6009edcda2a5cf022417b4213ae02b6151b2604c
diff --git a/salt/renderers/pydsl.py b/salt/renderers/pydsl.py index <HASH>..<HASH> 100644 --- a/salt/renderers/pydsl.py +++ b/salt/renderers/pydsl.py @@ -338,7 +338,7 @@ For example: from __future__ import absolute_import import imp -import salt._compat +from six import exec_ from salt.utils import pydsl from salt.utils.pydsl import PyDslError from salt.exceptions import SaltRenderError @@ -373,7 +373,7 @@ def render(template, saltenv='base', sls='', tmplpath=None, rendered_sls=None, * **kws) dsl_sls.get_render_stack().append(dsl_sls) - salt._compat.exec_(template.read(), mod.__dict__) + exec_(template.read(), mod.__dict__) highstate = dsl_sls.to_highstate(mod) dsl_sls.get_render_stack().pop() return highstate
salt/renderers/pydsl.py: salt._compat => six
saltstack_salt
train
py
79630c6eb2418354152df9014f2ab50dc0c14bc5
diff --git a/src/filesystem/LocalFileSystem.php b/src/filesystem/LocalFileSystem.php index <HASH>..<HASH> 100644 --- a/src/filesystem/LocalFileSystem.php +++ b/src/filesystem/LocalFileSystem.php @@ -137,7 +137,7 @@ class LocalFileSystem extends BaseFileSystemStorage */ public function fileSystemContent($fileName) { - return file_get_contents($this->fileServerPath($fileName)); + return FileHelper::getFileContent($this->fileServerPath($fileName)); } /** diff --git a/src/storage/BaseFileSystemStorage.php b/src/storage/BaseFileSystemStorage.php index <HASH>..<HASH> 100644 --- a/src/storage/BaseFileSystemStorage.php +++ b/src/storage/BaseFileSystemStorage.php @@ -674,7 +674,13 @@ abstract class BaseFileSystemStorage extends Component $fromTempFile = tempnam(sys_get_temp_dir(), 'fromFile'); $fromTempFile.= $fileName; - $writeFile = FileHelper::writeFile($fromTempFile, $file->getContent()); + $content = $file->getContent(); + + if (empty($content)) { + return false; + } + + $writeFile = FileHelper::writeFile($fromTempFile, $content); // unable to write the temp file if (!$writeFile) {
do not throw exception when image is not found
luyadev_luya-module-admin
train
php,php
c2a5958c1d61853863f4b8ba8a5b4d692f3dab6f
diff --git a/support/test-runner/app.js b/support/test-runner/app.js index <HASH>..<HASH> 100644 --- a/support/test-runner/app.js +++ b/support/test-runner/app.js @@ -125,9 +125,8 @@ suite('socket.test.js', function () { }); server('test receiving messages', function (io) { - var messages = 0; - io.sockets.on('connection', function (socket) { + var messages = 0; var interval = setInterval(function () { socket.send(++messages);
Fixed tests race condition when re-running a same instance.
tsjing_socket.io-client
train
js
2c241ca6ae9c29af275c9f22a866213dd367de58
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -161,11 +161,11 @@ html_theme_options = { # The name for this set of Sphinx documents. # "<project> v<release> documentation" by default. # -html_title = 'Prince v' + release +html_title = 'Prince' # A shorter title for the navigation bar. Default is the same as html_title. # -html_short_title = 'Prince documentation' +#html_short_title = '' # The name of an image file (relative to this directory) to place at the top # of the sidebar.
Don't use release indicator for Sphinx
MaxHalford_prince
train
py
5ba3cb72ccbc5e90cc2ac332e27d8ff6bff95242
diff --git a/acos_client/v30/axapi_http.py b/acos_client/v30/axapi_http.py index <HASH>..<HASH> 100644 --- a/acos_client/v30/axapi_http.py +++ b/acos_client/v30/axapi_http.py @@ -116,7 +116,7 @@ class HttpClient(object): last_e = None - for i in xrange(0, 600): + for i in xrange(0, 1500): try: last_e = None if file_name is not None: @@ -136,7 +136,10 @@ class HttpClient(object): continue raise e + LOG.debug("acos_client retried %s %s times", self.url_base + api_url, i) + if last_e is not None: + LOG.error("acos_client failing with error %s after %s retries ignoring %s", last_e, i, self.retry_err_strings) raise e if z.status_code == 204:
Larger timeout for v3 retry loop. Observed a timeout of <I> seconds on connecting to a newly launched instance, the new timeout is about twice that. Better logging of number of retries used.
a10networks_acos-client
train
py
a71a009c5ee02fda21af420cb1bec3e55711c80a
diff --git a/source/jsx_block.js b/source/jsx_block.js index <HASH>..<HASH> 100644 --- a/source/jsx_block.js +++ b/source/jsx_block.js @@ -149,9 +149,14 @@ export default function jsx_block(state, startLine, endLine, silent) { token = state.push('jsx', '', 1); token.content = 'wrapper({}' + const oldLineMax = state.lineMax + state.blkIndent = blkIndent + state.lineMax = contentEnd state.md.block.tokenize(state, contentStart, contentEnd); + state.lineMax = oldLineMax + token = state.push('jsx', '', -1); token.content = ')' }
fix bug with parsing nested markdown blocks
frontarm_mdx-util
train
js
449eab87b3753c5ec1c16dbaab44484366da76e6
diff --git a/src/display/update_lines.js b/src/display/update_lines.js index <HASH>..<HASH> 100644 --- a/src/display/update_lines.js +++ b/src/display/update_lines.js @@ -21,7 +21,7 @@ export function updateHeightsInViewport(cm) { } let diff = cur.line.height - height if (height < 2) height = textHeight(display) - if (diff > .001 || diff < -.001) { + if (diff > .005 || diff < -.005) { updateLineHeight(cur.line, height) updateWidgetHeight(cur.line) if (cur.rest) for (let j = 0; j < cur.rest.length; j++)
Make line height calculations more tolerant of browser rounding errors
codemirror_CodeMirror
train
js
6f25caa082ec2265256374b303243ac2592cc524
diff --git a/utils/queue.go b/utils/queue.go index <HASH>..<HASH> 100644 --- a/utils/queue.go +++ b/utils/queue.go @@ -1,6 +1,7 @@ package utils import ( + "fmt" "encoding/json" "github.com/m4rw3r/uuid" "github.com/streadway/amqp" @@ -57,6 +58,7 @@ func (rmq *RMQ) Publish(event CKPTEvent) error { ContentEncoding: "utf-8", Body: msg, }); err != nil { + fmt.Printf("Could not publish msg:\n%s\nError was:\n%v\n", msg, err) return err } return nil
Try to log when we cant publish to message queue.
ckpt_backend-services
train
go
daa87e92c27021a2b6dd7de9a4ec4326c50ff41a
diff --git a/core/server/api.js b/core/server/api.js index <HASH>..<HASH> 100644 --- a/core/server/api.js +++ b/core/server/api.js @@ -114,7 +114,11 @@ users = { args = {id: this.user}; } - return dataProvider.User.read(args); + var filteredAttributes = ['password', 'created_by', 'updated_by']; + + return dataProvider.User.read(args).then(function omitAttrs(result) { + return _.omit(result, filteredAttributes); + }); }, // #### Edit
Merge pull request #<I> from jenius/master Remove unneeded info from /user api response
TryGhost_Ghost
train
js
12ffd9108e2284b8d4e9cdaf44c22e409cd436ac
diff --git a/lib/Thulium/Utilities/Clock.php b/lib/Thulium/Utilities/Clock.php index <HASH>..<HASH> 100644 --- a/lib/Thulium/Utilities/Clock.php +++ b/lib/Thulium/Utilities/Clock.php @@ -16,11 +16,15 @@ class Clock public static function nowAsString() { - return self::$freeze ? self::$freezeDate->format('Y-m-d H:i:s') : date('Y-m-d H:i:s'); + return self::now()->format('Y-m-d H:i:s'); } public static function now() { - return self::$freeze ? self::$freezeDate : new DateTime(); + $date = new DateTime(); + if (self::$freeze) { + $date->setTimestamp(self::$freezeDate->getTimestamp()); + } + return $date; } } \ No newline at end of file
Fixed clock to properly handle now() when invoked several times.
letsdrink_ouzo
train
php
1d4d274b0777793a8d39f76ded6a6b292f97abb0
diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index <HASH>..<HASH> 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -111,7 +111,12 @@ module ActionCable # Return a basic hash of statistics for the connection keyed with `identifier`, `started_at`, and `subscriptions`. # This can be returned by a health check against the connection. def statistics - { identifier: connection_identifier, started_at: @started_at, subscriptions: subscriptions.identifiers } + { + identifier: connection_identifier, + started_at: @started_at, + subscriptions: subscriptions.identifiers, + request_id: @env['action_dispatch.request_id'] + } end def beat
Include request id in statistics to make it to search the logs
rails_rails
train
rb
853753a3fcca85b0c70ff1aab217729d08100791
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -72,16 +72,16 @@ $ restore-trash /home/andrea/foo Empty the trashcan: $ empty-trash""", - 'packages' : ['libtrash'], - 'scripts' : ['src/trash', - 'src/list-trash', - 'src/restore-trash', - 'src/empty-trash'], - 'package_dir' : {'':'src'}, - 'data_files': [('man/man1', ['man/man1/empty-trash.1', - 'man/man1/list-trash.1', - 'man/man1/restore-trash.1', - 'man/man1/trash.1'])] + 'packages' : ['libtrash'], + 'scripts' : ['src/trash-file', + 'src/trash-list', + 'src/trash-restore', + 'src/trash-empty'], + 'package_dir' : {'':'src'}, + 'data_files': [('man/man1', ['man/man1/trash-empty.1', + 'man/man1/trash-list.1', + 'man/man1/trash-restore.1', + 'man/man1/trash-file.1'])] }
Updated setup.py with new commands names
andreafrancia_trash-cli
train
py
6c47f85028bd549c4dc391845cc7fd91a6c8b378
diff --git a/lxc/list.go b/lxc/list.go index <HASH>..<HASH> 100644 --- a/lxc/list.go +++ b/lxc/list.go @@ -59,9 +59,9 @@ A key/value pair referring to a configuration item. For those, the namespace can - "u.blah=abc" will do the same - - "security.privileged=1" will list all privileged containers + - "security.privileged=true" will list all privileged containers - - "s.privileged=1" will do the same + - "s.privileged=true" will do the same A regular expression matching a configuration item or its value. (e.g. volatile.eth0.hwaddr=00:16:3e:.*).
Fix help to provide sample that actually works Using 1 doesn't display privileged containers but if we use true it does.
lxc_lxd
train
go
8d9351226fe954644d707d7b146960cae5dc15e3
diff --git a/demos/collection/crud.php b/demos/collection/crud.php index <HASH>..<HASH> 100644 --- a/demos/collection/crud.php +++ b/demos/collection/crud.php @@ -79,7 +79,7 @@ $myExecutorClass = get_class(new class() extends \Atk4\Ui\UserAction\ModalExecut $result = parent::addFormTo($left); - if ($this->action->getModel()->get(File::hinting()->fieldName()->is_folder)) { + if ($this->action->getEntity()->get(File::hinting()->fieldName()->is_folder)) { \Atk4\Ui\Grid::addTo($right, ['menu' => false, 'ipp' => 5]) ->setModel(File::assertInstanceOf($this->action->getModel())->SubFolder); } else {
Fix demo (#<I>)
atk4_ui
train
php
dc518c5340fe537641b0cd2af6aa41ecccf59262
diff --git a/tests/unit/modules/blockdev_test.py b/tests/unit/modules/blockdev_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/blockdev_test.py +++ b/tests/unit/modules/blockdev_test.py @@ -86,6 +86,7 @@ class TestBlockdevModule(TestCase): with patch.dict(blockdev.__salt__, {'cmd.run': mock}): self.assertEqual(blockdev.fstype(device), fs_type) + @skipIf(not salt.utils.which('resize2fs'), 'resize2fs not found') def test_resize2fs(self): ''' unit tests for blockdev.resize2fs
Skip test_resize2fs if resize2fs does not exists (#<I>)
saltstack_salt
train
py
b32fc3865779b2ae4c889e228498031cead1591e
diff --git a/datadog_checks_base/datadog_checks/base/log.py b/datadog_checks_base/datadog_checks/base/log.py index <HASH>..<HASH> 100644 --- a/datadog_checks_base/datadog_checks/base/log.py +++ b/datadog_checks_base/datadog_checks/base/log.py @@ -43,6 +43,9 @@ class CheckLoggingAdapter(logging.LoggerAdapter): # Default to `unknown` for checks that log during # `__init__` and therefore have no `check_id` yet self.extra['_check_id'] = self.check_id or 'unknown' + if self.check_id: + # Break the reference cycle, once we resolved check_id we don't need the check anymore + self.check = None kwargs.setdefault('extra', self.extra) return msg, kwargs
Break reference cycle with log formatter (#<I>) Once check_id is set, we don't need to keep the reference to check. It could help garbage collect check instances.
DataDog_integrations-core
train
py
beb27c968d42722a896cc04bd3146cf636aa20ea
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -168,7 +168,7 @@ module.exports = function(grunt) { //jquery used only for testing and preview page { cwd: 'lib/jquery/dist/', - src: ['jquery.min.js'], + src: ['jquery.min.js', 'jquery.min.map'], dest: 'preview/preview_pages/assets/', expand: true },
Fix jQuery missing map on preview pages Before an error was being printed every time
vizabi_vizabi
train
js
3e4f5e6591cba6a7cda2b82efb19904407cd0421
diff --git a/comment/comment.js b/comment/comment.js index <HASH>..<HASH> 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -65,6 +65,12 @@ M.core_comment = { var scope = this; var value = ta.get('value'); if (value && value != M.util.get_string('addcomment', 'moodle')) { + ta.set('disabled', true); + ta.setStyles({ + 'backgroundImage': 'url(' + M.util.image_url('i/loading_small', 'core') + ')', + 'backgroundRepeat': 'no-repeat', + 'backgroundPosition': 'center center' + }); var params = {'content': value}; this.request({ action: 'add', @@ -75,6 +81,8 @@ M.core_comment = { var cid = scope.client_id; var ta = Y.one('#dlg-content-'+cid); ta.set('value', ''); + ta.set('disabled', false); + ta.setStyle('backgroundImage', 'none'); scope.toggle_textarea(false); var container = Y.one('#comment-list-'+cid); var result = scope.render([obj], true);
MDL-<I> comment: Indicate comment being saved via AJAX This should be considered as quick & dirty usability fix as the whole JS should ideally be rewritten and this behaviour should use CSS classes.
moodle_moodle
train
js
ab00e8588fd0ae0dee6d968db5d12552c87e9c3a
diff --git a/protocols.py b/protocols.py index <HASH>..<HASH> 100644 --- a/protocols.py +++ b/protocols.py @@ -1,5 +1,6 @@ from scapy.all import Packet, Ether, TCP, StrField, ShortField, XByteField, IntEnumField + class MeshIP(Packet): name = 'MeshIP' fields_desc = [ @@ -7,6 +8,7 @@ class MeshIP(Packet): ShortField('target', None), ] + class MeshARP(Packet): name = 'MeshARP' fields_desc = [ @@ -16,11 +18,22 @@ class MeshARP(Packet): ShortField('target', 5), ] -class HumanIRC(): + +class HumanARP(Packet): + name = 'HumanARP' + fields_desc = [ + IntEnumField('mode', 1, + {1: 'QUERY', 2: 'ANNOUNCE'} + ), + ShortField('target', 5), + ] + +class HumanIRC(Packet): name = 'HumanIRC' + fields_desc = [ + StrField('action', ''), + ] - def parse(self, message): - return message.split(' ', 1) if __name__ == '__main__': test_packet = (Ether() /
added human-readable protocol parsers for IRC
pirate_mesh-networking
train
py
ca646ce83bc5cf6ada3c813823a5c351a62b96ae
diff --git a/service/docs.js b/service/docs.js index <HASH>..<HASH> 100644 --- a/service/docs.js +++ b/service/docs.js @@ -170,7 +170,7 @@ function getCompat() { var fdata = { feature: feat, size: Object.keys(polyfill.variants).reduce(function(size, variantName) { - return Math.max(size, polyfill.variants[variantName].minGatedSource.length); + return Math.max(size, polyfill.variants[variantName].minSource.length); }, 0), isDefault: (polyfill.aliases && polyfill.aliases.indexOf('default') !== -1), hasTests: polyfill.hasTests
Gated source is no longer precompiled
Financial-Times_polyfill-service
train
js
f5ec015197e0132fdbbe785fa1a75f8f3e22b122
diff --git a/templates/requirements.html.php b/templates/requirements.html.php index <HASH>..<HASH> 100644 --- a/templates/requirements.html.php +++ b/templates/requirements.html.php @@ -51,7 +51,7 @@ <a href="<?php echo $path('/') ?>" class="btn btn-default"> <?php echo $trans('previous_step') ?> </a> - <?php if ($var('has_failed_requirement')): ?> + <?php if ($var('has_failed_requirement') || $var('has_failed_recommendation')): ?> <a href="" class="btn btn-warning"> <?php echo $trans('test_again') ?> </a>
[WebInstaller] Added retry button for failed recommendation
claroline_Distribution
train
php
1c6979131ae4ee50ab863cde43f961daccba908c
diff --git a/lib/translate_columns.rb b/lib/translate_columns.rb index <HASH>..<HASH> 100644 --- a/lib/translate_columns.rb +++ b/lib/translate_columns.rb @@ -185,10 +185,11 @@ module TranslateColumns # be used. # def save_with_translation(*args) + perform_validation = args.is_a?(Hash) ? args[:validate] : args if perform_validation && valid? || !perform_validation - translation.save(false) if (translation) + translation.save(*args) if (translation) disable_translation - save_without_translation(false) + save_without_translation(*args) enable_translation true else
Corrections for saving and new validation setup
samlown_translate_columns
train
rb
105c4a4ec6e1c4a722829a570ce6ca010caddc07
diff --git a/pypet/tests/link_test.py b/pypet/tests/link_test.py index <HASH>..<HASH> 100644 --- a/pypet/tests/link_test.py +++ b/pypet/tests/link_test.py @@ -283,4 +283,7 @@ class LinkMergeTest(TrajectoryComparator): if idx < old_length: self.assertTrue(param == 111) else: - self.assertTrue(param == 53) \ No newline at end of file + self.assertTrue(param == 53) + + self.env1.f_disable_logging() + self.env2.f_disable_logging() \ No newline at end of file
added logging disabling to test
SmokinCaterpillar_pypet
train
py
986f25f6b51e3672865439e9a6581aab121b45ee
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSource.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSource.java index <HASH>..<HASH> 100644 --- a/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSource.java +++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/DataSource.java @@ -19,6 +19,7 @@ package org.apache.flink.api.java.operators; import org.apache.flink.api.common.io.InputFormat; +import org.apache.flink.api.common.io.NonParallelInput; import org.apache.flink.api.common.operators.GenericDataSourceBase; import org.apache.flink.api.common.operators.OperatorInformation; import org.apache.flink.api.common.typeinfo.TypeInformation; @@ -52,6 +53,10 @@ public class DataSource<OUT> extends Operator<OUT, DataSource<OUT>> { } this.inputFormat = inputFormat; + + if (inputFormat instanceof NonParallelInput) { + this.dop = 1; + } } /**
[FLINK-<I>] DataSource sets DOP to 1 for NonParallelInputs.
apache_flink
train
java
be7ba0e98f5ea5debcd34288224f57c360c63dd0
diff --git a/commands/server.go b/commands/server.go index <HASH>..<HASH> 100644 --- a/commands/server.go +++ b/commands/server.go @@ -40,7 +40,8 @@ Serve them up.`, func server(cmd *cobra.Command, args []string) { InitializeConfig() - if Config.BaseUrl == "" { + // Unless command line overrides, we use localhost for the server + if BaseUrl == "" { Config.BaseUrl = "http://localhost:" + strconv.Itoa(serverPort) }
server defaults to localhost unless overridden by command line flags
gohugoio_hugo
train
go
5af891514e4ca3145ad07b5e20d64008d7db8f31
diff --git a/pmxbotweb/viewer.py b/pmxbotweb/viewer.py index <HASH>..<HASH> 100644 --- a/pmxbotweb/viewer.py +++ b/pmxbotweb/viewer.py @@ -15,7 +15,7 @@ from jinja2 import Environment, FileSystemLoader from cgi import escape -from pmxbot.botbase import get_logger_db +from pmxbot.logging import init_logger BASE = os.path.abspath(os.path.dirname(__file__)) jenv = Environment(loader=FileSystemLoader(os.path.join(BASE, 'templates'), encoding='utf-8')) @@ -72,7 +72,7 @@ class ChannelPage(object): def default(self, channel): page = jenv.get_template('channel.html') - db = get_logger_db(cherrypy.request.app.config['db'] + db = init_logger(cherrypy.request.app.config['db']) context = get_context() contents = db.get_channel_days(channel) months = {} @@ -116,7 +116,7 @@ def karma_comma(karma_results): result with the keys joined by commas. """ return [ - ', '.join(keys), value + (', '.join(keys), value) for keys, value in karma_results ]
Fixed two syntax errors in pmxbotweb.viewer Updated pmxbotweb.viewer to use pmxbot.logging
yougov_pmxbot
train
py
f8fb67a9580f378338020d4f40d60280b9001f1d
diff --git a/src/Plugin.php b/src/Plugin.php index <HASH>..<HASH> 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -4,6 +4,8 @@ namespace craft\awss3; use Craft; use craft\events\RegisterComponentTypesEvent; +use craft\services\Volumes; +use yii\base\Event; /** @@ -24,7 +26,7 @@ class Plugin extends \craft\base\Plugin { parent::init(); - Craft::$app->getVolumes()->on('registerVolumeTypes', function(RegisterComponentTypesEvent $event) { + Event::on(Volumes::class, Volumes::EVENT_REGISTER_VOLUME_TYPES, function(RegisterComponentTypesEvent $event) { $event->types[] = Volume::class; }); }
Use a class-level event to register the volume type
craftcms_aws-s3
train
php
60a0f4e1fd3f8026438f541c5a8a54905ad33b3e
diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/git.py b/datadog_checks_dev/datadog_checks/dev/tooling/git.py index <HASH>..<HASH> 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/git.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/git.py @@ -86,7 +86,7 @@ def get_commits_since(check_name, target_tag=None, exclude_branch=None): command = f"git log --pretty=%s {'' if target_tag is None else f'{target_tag}... '}{target_path}" with chdir(root): - return run_command(command, capture=True).stdout.splitlines() + return run_command(command, capture=True, check=True).stdout.splitlines() def git_show_file(path, ref):
Fail releases for missing tags (#<I>)
DataDog_integrations-core
train
py
a5bab9bd4134caff3b97e334b35d1f4341338ae5
diff --git a/lib/flor/unit/scheduler.rb b/lib/flor/unit/scheduler.rb index <HASH>..<HASH> 100644 --- a/lib/flor/unit/scheduler.rb +++ b/lib/flor/unit/scheduler.rb @@ -411,14 +411,17 @@ module Flor m end - def should_wake_up? + def reload_after + + @idle_count < 7 ? 1 : @reload_after + end - return true if Time.now - @reloaded_at >= @reload_after + def should_wake_up? return true if @wake_up + return true if Time.now - @reloaded_at >= reload_after - @next_time && - @next_time <= Flor.tstamp.split('.').first + @next_time && @next_time <= Flor.tstamp.split('.').first end def unreserve_messages
While @idle_count < 7 reload after 1 second
floraison_flor
train
rb
b0e8ee71f45d2ea0d0085a5f25e3b7dfbed03fe2
diff --git a/src/main/java/zmq/Clock.java b/src/main/java/zmq/Clock.java index <HASH>..<HASH> 100644 --- a/src/main/java/zmq/Clock.java +++ b/src/main/java/zmq/Clock.java @@ -30,7 +30,6 @@ public class Clock { private Clock() { } - // High precision timestamp. public static final long now_us() { return System.nanoTime() / 1000L; @@ -39,7 +38,7 @@ public class Clock { // Low precision timestamp. In tight loops generating it can be // 10 to 100 times faster than the high precision timestamp. public static final long now_ms() { - return now_us() / 1000L; + return System.currentTimeMillis(); } // CPU's timestamp counter. Returns 0 if it's not available.
Revert back to use currentTimeMillis because it's less expensive than nanoTime
zeromq_jeromq
train
java
b4f03921d89422fdb59a69d20b12d42d4bbedacb
diff --git a/src/define/class/class.js b/src/define/class/class.js index <HASH>..<HASH> 100644 --- a/src/define/class/class.js +++ b/src/define/class/class.js @@ -26,7 +26,7 @@ function _GpfClassDefinition (definition) { _GpfClassDefinition.prototype = Object.create(_GpfEntityDefinition.prototype); -Object.assign(_GpfClassDefinition.prototype, /** @lends _GpfClassDefinition.prototype */ { +Object.assign(_GpfClassDefinition.prototype, { constructor: _GpfClassDefinition,
Removes @lends that is automated (#<I>)
ArnaudBuchholz_gpf-js
train
js
e63783d4d38f4879040669bb1e9438b702ec5f8c
diff --git a/gems/rake-support/lib/torquebox/server.rb b/gems/rake-support/lib/torquebox/server.rb index <HASH>..<HASH> 100644 --- a/gems/rake-support/lib/torquebox/server.rb +++ b/gems/rake-support/lib/torquebox/server.rb @@ -23,7 +23,6 @@ module TorqueBox def self.torquebox_home if ((gem_version <=> Gem::Version.new('1.8.9')) < 0) - puts "[WARNING] Found rubygems version #{Gem::VERSION}. This probably means you are on JRuby 1.6.4. While JRuby 1.6.4 should work, TorqueBox is tested on and ships with JRuby 1.6.5." home = Gem.searcher.find( 'torquebox-server' ) else home = Gem::Specification.find_by_name( 'torquebox-server' )
Don't scare users of earlier JRuby versions
torquebox_torquebox
train
rb
46a8feacde5fb35535e7e6b95fdcee05058893b8
diff --git a/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java b/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java index <HASH>..<HASH> 100644 --- a/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java +++ b/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java @@ -210,7 +210,7 @@ public class QueryServiceImpl implements QueryService @QueryParam("corpora") String rawCorpusNames, @DefaultValue("0") @QueryParam("offset") String offsetRaw, @DefaultValue("-1") @QueryParam("limit") String limitRaw, - @DefaultValue("normal") @QueryParam("order") String orderRaw) throws IOException + @DefaultValue("ascending") @QueryParam("order") String orderRaw) throws IOException { requiredParameter(query, "q", "AnnisQL query"); requiredParameter(rawCorpusNames, "corpora", @@ -237,7 +237,7 @@ public class QueryServiceImpl implements QueryService Response.status(Response.Status.BAD_REQUEST).type( MediaType.TEXT_PLAIN).entity( "parameter 'order' has the invalid value '" + orderRaw + "'. It should be one of" - + " 'normal', 'random' or 'inverted"). + + " 'ascending', 'random' or 'descending"). build()); }
the default value for "find" was wrong (fixes #<I>)
korpling_ANNIS
train
java
3f71c049c4e6bd470322d2337782680066075321
diff --git a/src/LarametricsRouteServiceProvider.php b/src/LarametricsRouteServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/LarametricsRouteServiceProvider.php +++ b/src/LarametricsRouteServiceProvider.php @@ -61,7 +61,7 @@ class LarametricsRouteServiceProvider extends ServiceProvider { $larametricsRequest = LarametricsRequest::create([ 'method' => $routeMatched->request->getMethod(), 'uri' => $routeMatched->request->getRequestUri(), - 'ip' => $_SERVER['REMOTE_ADDR'], + 'ip' => $routeMatched->request->ip(), 'headers' => json_encode($routeMatched->request->header()), 'start_time' => LARAVEL_START, 'end_time' => microtime(true)
REMOTE_ADDR is not defined on phpunit Please replace it with ip method of Illuminate\Http\Request. This resolved phpunit error REMOTE_ADDR is not defined
aschmelyun_larametrics
train
php
0152d6d8d542bc390b7bfdfe3a8074ba88a37d35
diff --git a/generator/types.go b/generator/types.go index <HASH>..<HASH> 100644 --- a/generator/types.go +++ b/generator/types.go @@ -70,7 +70,7 @@ func simpleResolvedType(tn, fmt string, items *spec.Items) (result resolvedType) if tn == file { // special case of swagger type "file", rendered as io.ReadCloser interface result.IsPrimitive = true - result.GoType = typeMapping[binary] + result.GoType = formatMapping[str][binary] result.IsStream = true return }
Fixed simpleResolvedType to consider "binary" format with "string" type in the special case of "file"
go-swagger_go-swagger
train
go
0ae3d7595ac38bdef1b3edeca01f53ece6382490
diff --git a/java/src/playn/java/JavaTextLayout.java b/java/src/playn/java/JavaTextLayout.java index <HASH>..<HASH> 100644 --- a/java/src/playn/java/JavaTextLayout.java +++ b/java/src/playn/java/JavaTextLayout.java @@ -94,7 +94,7 @@ class JavaTextLayout extends AbstractTextLayout { float lineWidth = getWidth(bounds); float x = (float)-bounds.getX() + format.align.getX(lineWidth, width); float y = line == 0 ? 0 : line * (ascent() + descent() + leading()); - return new Rectangle(x, y, lineWidth, (float)bounds.getHeight()); + return new Rectangle(x, y, lineWidth, ascent() + descent()); } @Override
Use ascent and descent instead of relying on getBounds()
threerings_playn
train
java
92e6c138c5250e2980f77bcc0eaa44bc8df2f6f2
diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -698,7 +698,7 @@ class Debugger { * @deprecated Use Debugger::outputAs() and Debugger::addFormat(). Will be removed * in 3.0 */ - public function output($format = null, $strings = array()) { + public static function output($format = null, $strings = array()) { $self = Debugger::getInstance(); $data = null;
Add missing static on Debugger::output() This method should have been static the whole time, and the lack of static was causing tests to fail on PHP <I>
cakephp_cakephp
train
php
cbf327aaeeae35596fd9d6bf6a92209e6d946fc6
diff --git a/router/client/client.go b/router/client/client.go index <HASH>..<HASH> 100644 --- a/router/client/client.go +++ b/router/client/client.go @@ -23,10 +23,25 @@ type client struct { // New uses the default discoverd client and returns a client. func New() (Client, error) { + return newWithDiscoverdConnect() +} + +func newWithDiscoverdConnect() (*client, error) { if err := discoverd.Connect(""); err != nil { return nil, err } - return NewWithDiscoverd("", discoverd.DefaultClient), nil + return newWithDiscoverd("", discoverd.DefaultClient), nil +} + +// NewWithHTTP does the same thing as New but uses the given *http.Client +func NewWithHTTP(http *http.Client) (Client, error) { + c, err := newWithDiscoverdConnect() + if err != nil { + return nil, err + } + http.Transport = c.HTTP.Transport + c.HTTP = http + return c, nil } func newRouterClient() *client { @@ -47,6 +62,10 @@ func NewWithAddr(addr string) Client { // NewWithDiscoverd uses the provided discoverd client and returns a client. func NewWithDiscoverd(name string, dc dialer.DiscoverdClient) Client { + return newWithDiscoverd(name, dc) +} + +func newWithDiscoverd(name string, dc dialer.DiscoverdClient) *client { if name == "" { name = "router" }
router/client: Add NewWithHTTP method
flynn_flynn
train
go
a8aae649693e6c1a076bdc1959bf0a08552fe135
diff --git a/bool.go b/bool.go index <HASH>..<HASH> 100644 --- a/bool.go +++ b/bool.go @@ -51,7 +51,11 @@ func (ab *AtomicBool) SetTo(yes bool) { // Flip toggles the Boolean (replaces with its opposite value). func (ab *AtomicBool) Flip() { - atomic.StoreInt32((*int32)(ab), atomic.LoadInt32((*int32)(ab))^1) + var o, n int32 + o, n = 0, 1 + if !atomic.CompareAndSwapInt32((*int32)(ab), o, n) { + atomic.CompareAndSwapInt32((*int32)(ab), n, o) + } } // SetToIf sets the Boolean to new only if the Boolean matches the old
Refine flip method, may be not atomic yet
tevino_abool
train
go
586fcc585e382267eb973802e3b3e5bfe02fcb2b
diff --git a/examples/PHP/class.php b/examples/PHP/class.php index <HASH>..<HASH> 100644 --- a/examples/PHP/class.php +++ b/examples/PHP/class.php @@ -46,12 +46,17 @@ class Example { // no leading hyphen for protected method names - // calling a method with too many arguments for one line + // calling a method with too many arguments for an 80 character line $this->methodWithManyArguments( new Foo(), 'bar', 'baz', - 'bat' + 'bat', + 'bak', + 'bas', + 'bab', + 'bap', + 'bad' ); }
Clarifying how to call a method with too many arguments. Fixes #2
graze_standards
train
php
1ffdb769e03ba8a9ff9bc045aa5ca62425e9fb4b
diff --git a/pythonforandroid/__init__.py b/pythonforandroid/__init__.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/__init__.py +++ b/pythonforandroid/__init__.py @@ -1 +1 @@ -__version__ = '2020.03.30' +__version__ = '2020.04.29'
Updates version number to <I>
kivy_python-for-android
train
py