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
c35cd6ac44f317e401ec4a9e489408ddbaa7ef2a
diff --git a/natsort/compat/fastnumbers.py b/natsort/compat/fastnumbers.py index <HASH>..<HASH> 100644 --- a/natsort/compat/fastnumbers.py +++ b/natsort/compat/fastnumbers.py @@ -6,6 +6,8 @@ from __future__ import ( absolute_import ) +from distutils.version import StrictVersion + # If the user has fastnumbers installed, they will get great speed # benefits. If not, we use the simulated functions that come with natsort. try: @@ -15,8 +17,7 @@ try: ) import fastnumbers # Require >= version 0.7.1. - v = list(map(int, fastnumbers.__version__.split('.'))) - if not (v[0] >= 0 and v[1] >= 7 and v[2] >= 1): + if StrictVersion(fastnumbers.__version__) < StrictVersion('0.7.1'): raise ImportError # pragma: no cover except ImportError: from natsort.compat.fake_fastnumbers import (
fix "fastnumbers" version check (issue #<I>)
SethMMorton_natsort
train
py
cf87b9f4723ca22b5b95ead602e31b20d6ff5ec1
diff --git a/src/migrations/2014_03_12_195134_create_users_table.php b/src/migrations/2014_03_12_195134_create_users_table.php index <HASH>..<HASH> 100644 --- a/src/migrations/2014_03_12_195134_create_users_table.php +++ b/src/migrations/2014_03_12_195134_create_users_table.php @@ -21,9 +21,9 @@ class CreateUsersTable extends Migration { $table->string('last_name'); $table->string('password'); - $table->string('remember_token'); + $table->string('remember_token')->nullable(); - $table->dateTime('last_login'); + $table->dateTime('last_login')->nullable(); $table->timestamps(); });
Avoid error: <I> Avoid error <I> twice at the installation.
CoandaCMS_coanda-core
train
php
765fa36d22319401ee1972ef77b69c497a8af578
diff --git a/upup/pkg/fi/cloudup/gce/gce_cloud.go b/upup/pkg/fi/cloudup/gce/gce_cloud.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/cloudup/gce/gce_cloud.go +++ b/upup/pkg/fi/cloudup/gce/gce_cloud.go @@ -144,7 +144,7 @@ func NewGCECloud(region string, project string, labels map[string]string) (GCECl } c.iam = iamService - dnsService, err := dns.New(client) + dnsService, err := dns.NewService(ctx) if err != nil { return nil, fmt.Errorf("error building DNS API client: %v", err) }
Use dns.NewService instead of dns.New Fixes build problems caused by concurrent changes
kubernetes_kops
train
go
b052dc0786f540ecdacb18f5b21fcff7bf7148a7
diff --git a/loguru/_logger.py b/loguru/_logger.py index <HASH>..<HASH> 100644 --- a/loguru/_logger.py +++ b/loguru/_logger.py @@ -656,7 +656,8 @@ class Logger: The default levels' attributes can also be modified by setting the ``LOGURU_[LEVEL]_[ATTR]`` environment variable. For example, on Windows: ``setx LOGURU_DEBUG_COLOR "<blue>"`` - or ``setx LOGURU_TRACE_ICON "🚀"``. + or ``setx LOGURU_TRACE_ICON "🚀"``. If you use the ``set`` command, do not include quotes + but escape special symbol as needed, e.g. ``set LOGURU_DEBUG_COLOR=^<blue^>``. If you want to disable the pre-configured sink, you can set the ``LOGURU_AUTOINIT`` variable to ``False``. @@ -673,7 +674,7 @@ class Logger: >>> def debug_only(record): ... return record["level"].name == "DEBUG" ... - >>> logger.add("debug.log", filter=debug_only) # Other levels are filterd out + >>> logger.add("debug.log", filter=debug_only) # Other levels are filtered out >>> def my_sink(message): ... record = message.record
Document usage of "set" for Windows env variables (#<I>)
Delgan_loguru
train
py
fa7f3675ec1362e4d3a62233dc23cfd471b3308d
diff --git a/web/github-webhook.php b/web/github-webhook.php index <HASH>..<HASH> 100644 --- a/web/github-webhook.php +++ b/web/github-webhook.php @@ -85,7 +85,7 @@ function setStatus(\NamelessCoder\Gizzle\Payload $payload, \Milo\Github\Api $api $url = sprintf( '/repos/%s/%s/statuses/%s', $payload->getRepository()->getOwner()->getUsername(), - $payload->getRepository()->getFullName(), + $payload->getRepository()->getName(), $payload->getHead()->getSha1() ); switch ($state) {
[TASK] Use short name of repository when setting status
NamelessCoder_gizzle
train
php
a1cc15b7fd00f804351b7432634f91dcfa63607d
diff --git a/aiohttp/web.py b/aiohttp/web.py index <HASH>..<HASH> 100644 --- a/aiohttp/web.py +++ b/aiohttp/web.py @@ -308,7 +308,7 @@ def run_app(app, *, host='0.0.0.0', port=None, try: loop.run_forever() - except KeyboardInterrupt: # pragma: no branch + except KeyboardInterrupt: # pragma: no cover pass finally: srv.close()
Use proper pragma for coverage warning suppressing
aio-libs_aiohttp
train
py
614ed54f482f4324ac79d97d5133cf28a3ec626c
diff --git a/troposphere/cloudwatch.py b/troposphere/cloudwatch.py index <HASH>..<HASH> 100644 --- a/troposphere/cloudwatch.py +++ b/troposphere/cloudwatch.py @@ -69,6 +69,7 @@ class Alarm(AWSObject): 'AlarmDescription': (basestring, False), 'AlarmName': (basestring, False), 'ComparisonOperator': (basestring, True), + 'DatapointsToAlarm': (positive_integer, False), 'Dimensions': ([MetricDimension], False), 'EvaluateLowSampleCountPercentile': (basestring, False), 'EvaluationPeriods': (positive_integer, True), @@ -83,7 +84,6 @@ class Alarm(AWSObject): 'Threshold': (double, True), 'TreatMissingData': (basestring, False), 'Unit': (basestring, False), - 'DatapointsToAlarm': (positive_integer, False), } def validate(self):
Alphabetize DatapointsToAlarm in CloudWatch
cloudtools_troposphere
train
py
eb6f759c94e88bcf510dbcbcca1ae25cd799639d
diff --git a/detox/src/devices/AndroidDriver.js b/detox/src/devices/AndroidDriver.js index <HASH>..<HASH> 100644 --- a/detox/src/devices/AndroidDriver.js +++ b/detox/src/devices/AndroidDriver.js @@ -85,6 +85,7 @@ class AndroidDriver extends DeviceDriverBase { this.instrumentationProcess.on('close', (code, signal) => { log.verbose(`instrumentationProcess terminated due to receipt of signal ${signal}`); + this.terminateInstrumentation(); }); return this.instrumentationProcess.pid;
Kill Android instrumentation and nullify the object when it crashes (#<I>)
wix_Detox
train
js
2968b0ea672ce52cc1ee351b3e8d9cee24329b88
diff --git a/lib/commands/app-management.js b/lib/commands/app-management.js index <HASH>..<HASH> 100644 --- a/lib/commands/app-management.js +++ b/lib/commands/app-management.js @@ -83,8 +83,11 @@ commands.mobileQueryAppState = async function mobileQueryAppState (opts = {}) { return await this.proxyCommand('/wda/apps/state', 'POST', requireOptions(opts, ['bundleId'])); }; -commands.installApp = async function installApp (appPath) { - await this.mobileInstallApp({app: appPath}); +commands.installApp = async function installApp (appPath, opts = {}) { + await this.mobileInstallApp({ + ...(_.isPlainObject(opts) ? opts : {}), + app: appPath, + }); }; commands.activateApp = async function activateApp (bundleId, opts = {}) {
fix: Pass options to installApp call (#<I>)
appium_appium-xcuitest-driver
train
js
0bd97193c38ed5661d98a3ca58c37e3c8a3a745f
diff --git a/lib/instance/login_manager.rb b/lib/instance/login_manager.rb index <HASH>..<HASH> 100644 --- a/lib/instance/login_manager.rb +++ b/lib/instance/login_manager.rb @@ -84,7 +84,7 @@ module RightScale # All users are added to RightScale account's authorized keys. new_users = new_policy.users.select { |u| (u.expires_at == nil || u.expires_at > Time.now) } update_users(new_users, agent_identity, new_policy) do |audit_content| - yield audit_content + yield audit_content if block_given? end true
Only yield from SSH policy update if a block is given
rightscale_right_link
train
rb
c629dac485f7b8d083ba5393cf8dba8a72f1dc8d
diff --git a/lib/dependencies/CommonJsRequireDependencyParserPlugin.js b/lib/dependencies/CommonJsRequireDependencyParserPlugin.js index <HASH>..<HASH> 100644 --- a/lib/dependencies/CommonJsRequireDependencyParserPlugin.js +++ b/lib/dependencies/CommonJsRequireDependencyParserPlugin.js @@ -129,7 +129,7 @@ class CommonJsRequireDependencyParserPlugin { .for("require") .tap( "CommonJsRequireDependencyParserPlugin", - createHandler({ callNew: false }) + createHandler({ callNew: true }) ); } }
damnit, pushed failing test tests
webpack_webpack
train
js
49bdbbc60ff482dcf27007d471b5950ef0c82c5a
diff --git a/lib/action_kit_api.rb b/lib/action_kit_api.rb index <HASH>..<HASH> 100644 --- a/lib/action_kit_api.rb +++ b/lib/action_kit_api.rb @@ -38,7 +38,11 @@ module ActionKitApi "akid" => user.akid, }) - response = @@connection.call('act', act_attrs) + self.raw_act(act_attrs) + end + + def raw_act(*args) + response = @@connection.call('act', args) ActionKitApi::Action.new(response) end
Pulled actual api call out into a raw method for actions
Democracy-for-America_ActionKitApi
train
rb
3d56c756170590c25cbfb35c2bc759f06f3de3d0
diff --git a/MAVProxy/modules/mavproxy_misc.py b/MAVProxy/modules/mavproxy_misc.py index <HASH>..<HASH> 100644 --- a/MAVProxy/modules/mavproxy_misc.py +++ b/MAVProxy/modules/mavproxy_misc.py @@ -464,9 +464,9 @@ class MiscModule(mp_module.MPModule): print("Setting origin to: ", lat, lon, alt) self.master.mav.set_gps_global_origin_send( self.settings.target_system, - lat*10000000, # lat - lon*10000000, # lon - alt*1000) # param7 + int(lat*10000000), # lat + int(lon*10000000), # lon + int(alt*1000)) # param7 def cmd_magset_field(self, args): '''set compass offsets by field'''
mavproxy_misc: cast fields to int in set_gps_global_origin_send
ArduPilot_MAVProxy
train
py
2310f326b98270a3294f5c2c8256e2cbded5f915
diff --git a/Embed/FastImage.php b/Embed/FastImage.php index <HASH>..<HASH> 100644 --- a/Embed/FastImage.php +++ b/Embed/FastImage.php @@ -317,22 +317,22 @@ class FastImage $Image = new static($image); if ($Image->getType() === 'ico') { - $imagesSizes[] = [ + $imagesSizes[] = array( 'src' => $image, 'width' => 0, 'height' => 0 - ]; + ); continue; } list($width, $height) = $Image->getSize(); - $imagesSizes[] = [ + $imagesSizes[] = array( 'src' => $image, 'width' => $width, 'height' => $height - ]; + ); } catch (\Exception $Exception) { continue; }
fixed php <I> support
oscarotero_Embed
train
php
456fbacea12b697b0d68475ad43e63dea8d96e25
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name = 'fandjango', version = __version__, description = "Fandjango makes it stupidly easy to create Facebook applications with Django.", - long_description = open('README.rst').read() + '\n\n' + open('CHANGELOG').read(), + long_description = open('README.rst').read(), author = "Johannes Gorset", author_email = "[email protected]", url = "http://github.com/jgorset/fandjango",
Don't include the changelog in the long description
jgorset_fandjango
train
py
89440b10718584835397595c693d2201ad35b4e8
diff --git a/spec/analyser/statement_spec.rb b/spec/analyser/statement_spec.rb index <HASH>..<HASH> 100644 --- a/spec/analyser/statement_spec.rb +++ b/spec/analyser/statement_spec.rb @@ -10,7 +10,7 @@ module DeepCover let(:by_execution) do results .sort_by{|range, _runs| range.begin_pos } - .group_by{|_range, runs| runs != 0 } + .group_by{|_range, runs| runs && runs != 0 } .transform_values{|ranges_run_pairs| ranges_run_pairs.map(&:first)} end let(:lines_by_execution) { by_execution.transform_values{|ranges| ranges.map(&:line)} }
Differentiate nil runs from > 0
deep-cover_deep-cover
train
rb
c7f8b767aef6f3ca332bf4916ddf6498acbe4e44
diff --git a/tests/utils.py b/tests/utils.py index <HASH>..<HASH> 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -99,7 +99,9 @@ def reinit_hive_container(client: TheHiveApi) -> None: alerts = client.alert.find() cases = client.case.find() + observables = client.case.find() with ThreadPoolExecutor() as executor: executor.map(client.alert.delete, [alert["_id"] for alert in alerts]) executor.map(client.case.delete, [case["_id"] for case in cases]) + executor.map(client.observable.delete, [ob["_id"] for ob in observables])
Delete observables during container reinit
TheHive-Project_TheHive4py
train
py
3ef90dac66ca93566ad162765fe24a122cb639cf
diff --git a/mocha_test/asyncify.js b/mocha_test/asyncify.js index <HASH>..<HASH> 100644 --- a/mocha_test/asyncify.js +++ b/mocha_test/asyncify.js @@ -74,6 +74,13 @@ describe('asyncify', function(){ 'rsvp' ]; + // Both Bluebird and native promises emit these events. We handle it because Bluebird + // will report these rejections to stderr if we don't, which is a great feature for + // normal cases, but not here, since we expect unhandled rejections: + process.on('unhandledRejection', function () { + // Ignore. + }); + names.forEach(function(name) { describe(name, function() { @@ -111,6 +118,25 @@ describe('asyncify', function(){ done(); }); }); + + it('callback error', function(done) { + var promisified = function(argument) { + return new Promise(function (resolve) { + resolve(argument + " resolved"); + }); + }; + var call_count = 0; + async.asyncify(promisified)("argument", function () { + call_count++; + if (call_count === 1) { + throw new Error("error in callback"); + } + }); + setTimeout(function () { + expect(call_count).to.equal(1); + done(); + }, 15); + }); }); }); });
Added test case to make sure that callback isn't called multiple times in asyncify
caolan_async
train
js
47b9a9409ece8f64c56ca7391fd1d10f2f96f2f4
diff --git a/src/utility.js b/src/utility.js index <HASH>..<HASH> 100644 --- a/src/utility.js +++ b/src/utility.js @@ -56,6 +56,10 @@ function initTracking() { } } +/** + * Updates the viewport dimensions cache. + * @private + */ function getViewportDimensions() { session.scrollLeft = $window.scrollLeft(); session.scrollTop = $window.scrollTop();
Added doc comment for getViewportDimensions(). Related to issue #<I>.
stevenbenner_jquery-powertip
train
js
2ca77c26fafffdaf4d920fcb3817a2043f7e3591
diff --git a/tests/system/Database/Live/GroupTest.php b/tests/system/Database/Live/GroupTest.php index <HASH>..<HASH> 100644 --- a/tests/system/Database/Live/GroupTest.php +++ b/tests/system/Database/Live/GroupTest.php @@ -131,6 +131,6 @@ class GroupTest extends CIDatabaseTestCase ->get() ->getResult(); - $this->assertEquals(3, $result->count); + $this->assertEquals(3, $result[0]->count); } }
Fix logic error I suck at tests.
codeigniter4_CodeIgniter4
train
php
1d691ee4ac14eed8f6df0aac05b820bafcc4844a
diff --git a/socket.js b/socket.js index <HASH>..<HASH> 100644 --- a/socket.js +++ b/socket.js @@ -36,7 +36,7 @@ angular.module('btford.socket-io', []). emit: function (eventName, data, callback) { if (callback) { - socket.emit(eventName, data, asyncAngularify); + socket.emit(eventName, data, asyncAngularify(callback)); } else { socket.emit(eventName, data); }
Fixed async callback with params
bendrucker_angular-sockjs
train
js
9cf0f38ac57baa9c29744ba24e08238cae296918
diff --git a/lib/daru/view/adapters/googlecharts.rb b/lib/daru/view/adapters/googlecharts.rb index <HASH>..<HASH> 100644 --- a/lib/daru/view/adapters/googlecharts.rb +++ b/lib/daru/view/adapters/googlecharts.rb @@ -201,6 +201,7 @@ module Daru def export(plot, export_type='png', file_name='chart') raise NotImplementedError, 'Not yet implemented!' unless export_type == 'png' + plot.export_iruby(export_type, file_name) if defined? IRuby rescue NameError plot.export(export_type, file_name) @@ -268,11 +269,13 @@ module Daru case when data_set.is_a?(Daru::DataFrame) return ArgumentError unless data_set.index.is_a?(Daru::Index) + rows = add_dataframe_data(data_set) when data_set.is_a?(Daru::Vector) rows = add_vector_data(data_set) when data_set.is_a?(Array) return GoogleVisualr::DataTable.new if data_set.empty? + rows = add_array_data(data_set) when data_set.is_a?(Hash) @table = GoogleVisualr::DataTable.new(data_set) @@ -329,6 +332,7 @@ module Daru def return_js_type(data) return if data.nil? + data = data.is_a?(Hash) ? data[:v] : data extract_js_type(data) end
empty line after gaurd clause in googlecharts.rb in all places
SciRuby_daru-view
train
rb
c8bb407f57848ffb3a5e0ad85c11b79f7b0935cb
diff --git a/client/request.go b/client/request.go index <HASH>..<HASH> 100644 --- a/client/request.go +++ b/client/request.go @@ -40,7 +40,7 @@ type StatusMessage struct { ID *uint `json:"id"` Message *string `json:"message"` Slug *string `json:"slug"` - Version *string `json:"version"` + Version *int `json:"version"` Status *string `json:"resp"` }
Fix type of version field as returned by Grafana.
grafana-tools_sdk
train
go
dbedcc7aa6a6a1df1b6ea3775c1a7bac5f8fbdc8
diff --git a/tests/shells/test_bash.py b/tests/shells/test_bash.py index <HASH>..<HASH> 100644 --- a/tests/shells/test_bash.py +++ b/tests/shells/test_bash.py @@ -61,3 +61,8 @@ class TestBash(object): command = 'git log $(git ls-files thefuck | grep python_command) -p' command_parts = ['git', 'log', '$(git ls-files thefuck | grep python_command)', '-p'] assert shell.split_command(command) == command_parts + + # bashlex doesn't support parsing arithmetic expressions, so make sure + # shlex is used a fallback + # See https://github.com/idank/bashlex#limitations + assert shell.split_command('$((1 + 2))') == ['$((1', '+', '2))']
Test parsing bash arithmetic expressions
nvbn_thefuck
train
py
b3acec2f58a12f6e9c5cc4392cc47d24d10a699f
diff --git a/pytablewriter/_table_writer.py b/pytablewriter/_table_writer.py index <HASH>..<HASH> 100644 --- a/pytablewriter/_table_writer.py +++ b/pytablewriter/_table_writer.py @@ -12,6 +12,7 @@ from dataproperty import Typecode from ._error import EmptyHeaderError from ._error import EmptyValueError +from ._error import EmptyTableError from ._interface import TableWriterInterface @@ -207,6 +208,13 @@ class TableWriter(TableWriterInterface): self._verify_table_name() self._verify_stream() self._verify_header() + + if all([ + dataproperty.is_empty_sequence(self.header_list), + dataproperty.is_empty_sequence(self.value_matrix), + ]): + raise EmptyTableError() + try: self._verify_value_matrix() except EmptyValueError:
Add error handling for the case that table data is empty
thombashi_pytablewriter
train
py
50c12e55b6f8462f6904ae061e661d1d10c7590a
diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/provider/mount.rb +++ b/lib/puppet/provider/mount.rb @@ -44,7 +44,7 @@ module Puppet::Provider::Mount when "Solaris", "HP-UX" line =~ /^#{name} on / when "AIX" - line =~ /^[^\s]*\s+[^\s]+\s+#{name}\s/ + line.split(/\s+/)[1] == name else line =~ / on #{name} / end
bug #<I> -- code fix to handle AIX mount output Making a simplified fix to find mount name in AIX mount command output.
puppetlabs_puppet
train
rb
3d145f520d0c0a3f689d89f961db5c01cf8dc47a
diff --git a/caas/kubernetes/tunnel.go b/caas/kubernetes/tunnel.go index <HASH>..<HASH> 100644 --- a/caas/kubernetes/tunnel.go +++ b/caas/kubernetes/tunnel.go @@ -29,6 +29,11 @@ import ( "github.com/juju/juju/caas/kubernetes/pod" ) +const ( + // ForwardPortTimeout is the duration for waiting for a pod to be ready. + ForwardPortTimeout time.Duration = time.Minute * 10 +) + // Tunnel represents an ssh like tunnel to a Kubernetes Pod or Service type Tunnel struct { client rest.Interface @@ -92,10 +97,10 @@ func (t *Tunnel) findSuitablePodForService() (*corev1.Pod, error) { func (t *Tunnel) ForwardPort() error { if !t.IsValidTunnelKind() { - return fmt.Errorf("invalid tunel kind %s", t.Kind) + return fmt.Errorf("invalid tunnel kind %s", t.Kind) } - ctx, cancelFunc := context.WithTimeout(context.Background(), time.Minute) + ctx, cancelFunc := context.WithTimeout(context.Background(), ForwardPortTimeout) defer cancelFunc() podName := t.Target
Kubernetes: Wait for pod ready timeout The following moves the timeout deadline from 1 minute to <I> minutes. If a pod hasn't become ready in that time, I think it's safe to say it won't ever! The change is simple, just add a longer duration.
juju_juju
train
go
f9c5c1b0eebf8d8bb57050273521d554d64e3dcf
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -294,11 +294,10 @@ export default class VueI18n { ...values: any ): any { if (!key) { return '' } - if (choice !== undefined) { - return fetchChoice(this._t(key, _locale, messages, host, ...values), choice) - } else { - return fetchChoice(this._t(key, _locale, messages, host, ...values), 1) + if (choice === undefined) { + choice = 1 } + return fetchChoice(this._t(key, _locale, messages, host, ...values), choice) } tc (key: Path, choice?: number, ...values: any): TranslateResult {
:shirt: refactor(tc): tweak logic
kazupon_vue-i18n
train
js
c18ce9ae624e3446a3134586e3562e1fa43741fa
diff --git a/Model/CatalogIngestion/Request/Product/DataProcessor.php b/Model/CatalogIngestion/Request/Product/DataProcessor.php index <HASH>..<HASH> 100644 --- a/Model/CatalogIngestion/Request/Product/DataProcessor.php +++ b/Model/CatalogIngestion/Request/Product/DataProcessor.php @@ -53,6 +53,8 @@ class DataProcessor private const PRODUCT_VISIBILITY_NOT_VISIBLE = 'not_visible'; + private const PRODUCT_IMAGE_SIZENAME = 'standard'; + /** * @var ObjectManager */ @@ -414,7 +416,7 @@ class DataProcessor 'MediaFile' => $mediaImage->getPath(), 'MediaType' => $this->mime->getMimeType($mediaImage->getPath()), 'URL' => $mediaImage->getUrl(), - 'SizeName' => implode(',', $this->getMediaImageEntry($product, $imageId)->getTypes()), + 'SizeName' => self::PRODUCT_IMAGE_SIZENAME, 'Width' => $imageSize[0], 'Height' => $imageSize[1], 'Length' => null,
use a const for sizename (#<I>)
BoltApp_bolt-magento2
train
php
4b9a5b6a5c7450e05010a932f6d24697a9730e29
diff --git a/pyfilemail/__main__.py b/pyfilemail/__main__.py index <HASH>..<HASH> 100755 --- a/pyfilemail/__main__.py +++ b/pyfilemail/__main__.py @@ -193,4 +193,9 @@ def main(): logger.info(msg) if __name__ == '__main__': - main() \ No newline at end of file + try: + main() + + except KeyboardInterrupt: + msg = 'Aborted by user!' + logger.warning(msg) \ No newline at end of file
added catch for keyboard interrupt in __main__
apetrynet_pyfilemail
train
py
a2847a3b83bec021e97d274a32303f537e95b064
diff --git a/lib/hyperclient/collection.rb b/lib/hyperclient/collection.rb index <HASH>..<HASH> 100644 --- a/lib/hyperclient/collection.rb +++ b/lib/hyperclient/collection.rb @@ -37,9 +37,10 @@ module Hyperclient # Public: Returns the wrapped collection as a hash. # # Returns a Hash. - def to_hash + def to_h @collection.to_hash end + alias_method :to_hash, :to_h def to_s to_hash
Define to_h and alias as to_hash
codegram_hyperclient
train
rb
31bca3f04424e135ab21132542f95eef6d2c69c2
diff --git a/lib/hook_runner.js b/lib/hook_runner.js index <HASH>..<HASH> 100644 --- a/lib/hook_runner.js +++ b/lib/hook_runner.js @@ -54,12 +54,9 @@ HookRunner.prototype = { .good(function(){ callback(null) }) - .bad(function(data){ + .bad(function(err){ proc.kill() - callback({ - name: hook + ' hook: "' + command + '"', - message: data - }) + callback(err) }) .complete(function(err, stdout, stderr){ err = err ? {
Fix for process errors not gracefully handled in ci mode (#<I>).
testem_testem
train
js
cfbad1023cff18a48b817ed96c4eb173616d079e
diff --git a/aetros/JobModel.py b/aetros/JobModel.py index <HASH>..<HASH> 100644 --- a/aetros/JobModel.py +++ b/aetros/JobModel.py @@ -68,7 +68,11 @@ class JobModel: else: shape = (size[0] * size[1],) - trainer.input_shape[node['varName']] = shape + if 'varName' in node: + trainer.input_shape[node['varName']] = shape + else: + # older models + trainer.input_shape = shape def get_built_model(self, trainer): diff --git a/aetros/const.py b/aetros/const.py index <HASH>..<HASH> 100644 --- a/aetros/const.py +++ b/aetros/const.py @@ -1,4 +1,4 @@ -__version__ = '0.3.0' +__version__ = '0.3.1' __prog__ = "API_KEY='key' aetros" class bcolors:
Fixed BC with already generate code for older models (trainer.input_shape)
aetros_aetros-cli
train
py,py
852f3842aa8a86bf8660cbb3de6180bc33599082
diff --git a/lib/userlist/push/operations/create.rb b/lib/userlist/push/operations/create.rb index <HASH>..<HASH> 100644 --- a/lib/userlist/push/operations/create.rb +++ b/lib/userlist/push/operations/create.rb @@ -7,6 +7,8 @@ module Userlist resource = from_payload(payload) strategy.call(:post, endpoint, resource.attributes) end + + alias push create end def included(base) diff --git a/spec/userlist/push/operations/create_spec.rb b/spec/userlist/push/operations/create_spec.rb index <HASH>..<HASH> 100644 --- a/spec/userlist/push/operations/create_spec.rb +++ b/spec/userlist/push/operations/create_spec.rb @@ -31,5 +31,9 @@ RSpec.describe Userlist::Push::Operations::Create do expect(resource_type).to receive(:new).with(payload).and_return(resource) relation.create(payload) end + + it 'should be aliased as #push' do + expect(relation.method(:push)).to eq(relation.method(:create)) + end end end
Adds an alias for the create method
userlistio_userlist-ruby
train
rb,rb
d3910d0027034eddf1873a5780b9e5edf8bfee05
diff --git a/lib/ohai/mixin/command.rb b/lib/ohai/mixin/command.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/mixin/command.rb +++ b/lib/ohai/mixin/command.rb @@ -99,7 +99,7 @@ module Ohai return status, stdout_string, stderr_string end - def run_comand_windows(command, timeout) + def run_command_windows(command, timeout) if timeout begin systemu(command)
[OHAI-<I>] fix typo for run_command_windows
chef_ohai
train
rb
04edd3591fb5d24a5fa14052ed86b5275f0e85e7
diff --git a/src/oidcmsg/oidc/__init__.py b/src/oidcmsg/oidc/__init__.py index <HASH>..<HASH> 100755 --- a/src/oidcmsg/oidc/__init__.py +++ b/src/oidcmsg/oidc/__init__.py @@ -633,7 +633,7 @@ class RegistrationRequest(Message): # "client_id": SINGLE_OPTIONAL_STRING, # "client_secret": SINGLE_OPTIONAL_STRING, # "access_token": SINGLE_OPTIONAL_STRING, - "post_logout_redirect_uri": SINGLE_OPTIONAL_STRING, + "post_logout_redirect_uris": OPTIONAL_LIST_OF_STRINGS, "frontchannel_logout_uri": SINGLE_OPTIONAL_STRING, "frontchannel_logout_session_required": SINGLE_OPTIONAL_BOOLEAN, "backchannel_logout_uri": SINGLE_OPTIONAL_STRING,
post_logout_redirect_uris is a list. Fixed dump conversion.
openid_JWTConnect-Python-OidcMsg
train
py
0298725f0269cf2fffb723200d21f21ed3a7de64
diff --git a/app/models/action_mailbox/inbound_email/message_id.rb b/app/models/action_mailbox/inbound_email/message_id.rb index <HASH>..<HASH> 100644 --- a/app/models/action_mailbox/inbound_email/message_id.rb +++ b/app/models/action_mailbox/inbound_email/message_id.rb @@ -25,14 +25,14 @@ module ActionMailbox::InboundEmail::MessageId private def extract_message_id(source) - Mail.from_source(source).message_id - rescue => e - # FIXME: Add logging with "Couldn't extract Message ID, so will generating a new random ID instead" + Mail.from_source(source).message_id rescue nil end end private def generate_missing_message_id - self.message_id ||= Mail::MessageIdField.new.message_id + self.message_id ||= Mail::MessageIdField.new.message_id.tap do |message_id| + logger.warn "Message-ID couldn't be parsed or is missing. Generated a new Message-ID: #{message_id}" + end end end
Added logging when Message ID wasn't extracted
rails_rails
train
rb
b81dff92148fdbb7bedb90b81ac2f5ccd520626b
diff --git a/spring-cli/src/test/java/org/springframework/cli/SampleIntegrationTests.java b/spring-cli/src/test/java/org/springframework/cli/SampleIntegrationTests.java index <HASH>..<HASH> 100644 --- a/spring-cli/src/test/java/org/springframework/cli/SampleIntegrationTests.java +++ b/spring-cli/src/test/java/org/springframework/cli/SampleIntegrationTests.java @@ -73,7 +73,7 @@ public class SampleIntegrationTests { return command; } }); - this.command = future.get(30, TimeUnit.SECONDS); + this.command = future.get(4, TimeUnit.MINUTES); } @After
Increase integration test timeout Increase time for CLI integration tests to account for @Grab downloads.
spring-projects_spring-boot
train
java
5ade7c60dc1871d537241678b1a4d1a079eae393
diff --git a/lib/psych.rb b/lib/psych.rb index <HASH>..<HASH> 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -217,7 +217,7 @@ require 'psych/class_loader' module Psych # The version is Psych you're using - VERSION = '2.0.7' + VERSION = '2.0.8' # The version of libyaml Psych is using LIBYAML_VERSION = Psych.libyaml_version.join '.'
bumping version to <I>
ruby_psych
train
rb
9fb4803016fbc2108b9446b441dc40d8189c9cfb
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -70,8 +70,7 @@ module ActionController # Also, sets the +permitted+ attribute to the default value of # <tt>ActionController::Parameters.permit_all_parameters</tt>. # - # class Person - # include ActiveRecord::Base + # class Person < ActiveRecord::Base # end # # params = ActionController::Parameters.new(name: 'Francesco')
Fix Strong Parameters docs. It's only possible to inherit from ActiveRecord::Base and not include it.
rails_rails
train
rb
76be26c3853a6794f163ca47cbe8d1f63312c81d
diff --git a/lib/promise.js b/lib/promise.js index <HASH>..<HASH> 100644 --- a/lib/promise.js +++ b/lib/promise.js @@ -20,7 +20,7 @@ class Promise { if (executor === INTERNAL) { return; } - executor(value => this._resolve(value), reason => this._reject(reason)); + execute(this, executor); } toString() { @@ -158,6 +158,23 @@ Promise.reject = reject; Promise.all = require('./all')(PromiseArray); Promise.promisify = require('./promisify')(Promise, INTERNAL); +function execute(promise, executor) { + try { + executor(resolve, reject); + } catch(e) { + reject(e); + } + + function resolve(value) { + promise._resolve(value); + } + + function reject(reason) { + promise._reject(reason); + } +} + + function resolve(value) { const promise = new Promise(INTERNAL); promise._resolve(value);
feat(promise): add try-catch for executor
suguru03_aigle
train
js
17b827248ed5796443f690d6d6e8a6ade2c9f2c8
diff --git a/ObjectManager/BasicContent.php b/ObjectManager/BasicContent.php index <HASH>..<HASH> 100644 --- a/ObjectManager/BasicContent.php +++ b/ObjectManager/BasicContent.php @@ -76,6 +76,7 @@ class BasicContent extends Base } } $location = $this->createContent( $contentType, $name, $location ); + $this->mapContentPath( $path ); return $location; }
fixed bug in storing path of content
ezsystems_BehatBundle
train
php
e6a7b8a6e7445a8e8dc9957a989c7467a39197fb
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -252,8 +252,6 @@ describe('dvb.find', function () { assert(stop.city); assert(Array.isArray(stop.coords)); assert.strictEqual(2, stop.coords.length); - assert.strictEqual(51, Math.floor(stop.coords[0])); - assert.strictEqual(13, Math.floor(stop.coords[1])); } it('should return an array', function (done) {
remove assertion of coordinates these values aren't true for all results. Only their existence should matter.
kiliankoe_dvbjs
train
js
8b205df5df2b6c34c6e8ff496a838bd613b827f1
diff --git a/src/test/java/io/github/astrapi69/swing/check/model/CheckListPanelAssertjSwingTest.java b/src/test/java/io/github/astrapi69/swing/check/model/CheckListPanelAssertjSwingTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/github/astrapi69/swing/check/model/CheckListPanelAssertjSwingTest.java +++ b/src/test/java/io/github/astrapi69/swing/check/model/CheckListPanelAssertjSwingTest.java @@ -47,7 +47,6 @@ import io.github.astrapi69.window.adapter.CloseWindow; /** * GUI unit test with assertj-swing module */ -@ExtendWith(IgnoreHeadlessExceptionEachMethodsThrowableHandler.class) public class CheckListPanelAssertjSwingTest {
removed beforeEach method because on github-actions the FrameFixture runs into a NPE
lightblueseas_swing-components
train
java
35208036ce16b38bf8b57ac408c0c7d2aad5eee3
diff --git a/src/metapensiero/signal/atom.py b/src/metapensiero/signal/atom.py index <HASH>..<HASH> 100644 --- a/src/metapensiero/signal/atom.py +++ b/src/metapensiero/signal/atom.py @@ -9,6 +9,7 @@ import asyncio import contextlib from functools import partial import logging +import inspect import weakref from metapensiero.asyncio import transaction @@ -200,7 +201,17 @@ class Signal(object): results = [] for method in subscribers: try: - res = method(*args, **kwargs) + signature = inspect.signature(method, follow_wrapped=False) + has_varkw = any(p.kind == inspect.Parameter.VAR_KEYWORD + for n, p in signature.parameters.items()) + if has_varkw: + bind = signature.bind_partial(*args, **kwargs) + else: + bind = signature.bind_partial(*args, + **{k:v for k, v in kwargs.items() if k in + signature.parameters}) + bind.apply_defaults() + res = method(*bind.args, **bind.kwargs) if isawaitable(res): coros.append(res) else:
Bind keyword parameters only when they are present in the signature
metapensiero_metapensiero.signal
train
py
f1c9df3efa9f7199ca4f36a31b896d83f3b14510
diff --git a/src/diamond/handler/rabbitmq_pubsub.py b/src/diamond/handler/rabbitmq_pubsub.py index <HASH>..<HASH> 100644 --- a/src/diamond/handler/rabbitmq_pubsub.py +++ b/src/diamond/handler/rabbitmq_pubsub.py @@ -156,7 +156,7 @@ class rmqHandler (Handler): durable=self.rmq_durable) # Reset reconnect_interval after a successful connection self.reconnect_interval = 1 - except Exception as exception: + except Exception, exception: self.log.debug("Caught exception in _bind: %s", exception) if rmq_server in self.connections.keys(): self._unbind(rmq_server) @@ -199,7 +199,7 @@ class rmqHandler (Handler): channel = self.channels[rmq_server] channel.basic_publish(exchange=self.rmq_exchange, routing_key='', body="%s" % metric) - except Exception as exception: + except Exception, exception: self.log.error( "Failed publishing to %s, attempting reconnect", rmq_server)
Fixes #<I>, this solves the build issues on centos5
python-diamond_Diamond
train
py
803bff764aa88f4c3e5f06dc78f0493dd57bc7cc
diff --git a/pyte/screens.py b/pyte/screens.py index <HASH>..<HASH> 100644 --- a/pyte/screens.py +++ b/pyte/screens.py @@ -125,8 +125,10 @@ class Screen(list): -- move cursor to position (9, 9) in the display matrix. .. versionchanged:: 0.4.7 + .. warning:: - :data:`~pyte.modes.LNM` is reset by default. + :data:`~pyte.modes.LNM` is reset by default, to match VT220 + specification. .. seealso::
Fixed a typo in `Screen` docstring
selectel_pyte
train
py
6a9ea335b3e395c9c367a48dadca7e52eae24c40
diff --git a/src/record/Record.php b/src/record/Record.php index <HASH>..<HASH> 100644 --- a/src/record/Record.php +++ b/src/record/Record.php @@ -239,6 +239,11 @@ class Record implements Arrayable, ArrayAccess return $this->isValid(...$args); } + /** Shorter state checkers. */ + public final function saved(): bool { return !empty($this->saved); } + public final function finded(): bool { return !empty($this->finded); } + public final function removed(): bool { return !empty($this->removed); } + /** * @alias of isFinded() */
record.Record: add shorter state checkers.
froq_froq-database
train
php
600a7e14ba6c18b046aefabb18d62631acf4726d
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -379,13 +379,16 @@ module.exports = function(options) { change: function(file, compiled) { + // Monitor metadata only for HTML-files // We choose not to store and diff metadata as the add/remove process is // extremely fast (circa 1ms). - var file = Utils.parse(file, options.path), - route = Utils.makeRoute(options.url, file, { type: type }); + if ("html" === options.type) { + var file = Utils.parse(file, options.path), + route = Utils.makeRoute(options.url, file, { type: type }); - removeFile(router, file, { type: type, url: options.url }); - addFile(router, file, { type: type, url: options.url }); + removeFile(router, file, { type: type, url: options.url }); + addFile(router, file, { type: type, url: options.url }); + } global.shipp.emit("route:refresh", { route: route });
Restricts re-routing to non-HTML files
shippjs_shipp-server
train
js
27cbffff1bda2c41e20cee90591118dc9abb6592
diff --git a/spacy/training/converters/conllu_to_docs.py b/spacy/training/converters/conllu_to_docs.py index <HASH>..<HASH> 100644 --- a/spacy/training/converters/conllu_to_docs.py +++ b/spacy/training/converters/conllu_to_docs.py @@ -207,6 +207,7 @@ def conllu_sentence_to_doc( pos=poses, deps=deps, lemmas=lemmas, + morphs=morphs, heads=heads, ) for i in range(len(doc)):
Minor edit to CoNLL-U converter (#<I>) This doesn't make a difference given how the `merged_morph` values override the `morph` values for all the final docs, but could have led to unexpected bugs in the future if the converter is modified.
explosion_spaCy
train
py
b4d9ae605214569fe535979f5b2e98d377ac71c8
diff --git a/docs/endpoint_v1.go b/docs/endpoint_v1.go index <HASH>..<HASH> 100644 --- a/docs/endpoint_v1.go +++ b/docs/endpoint_v1.go @@ -21,8 +21,7 @@ type V1Endpoint struct { IsSecure bool } -// NewV1Endpoint parses the given address to return a registry endpoint. v can be used to -// specify a specific endpoint version +// NewV1Endpoint parses the given address to return a registry endpoint. func NewV1Endpoint(index *registrytypes.IndexInfo, userAgent string, metaHeaders http.Header) (*V1Endpoint, error) { tlsConfig, err := newTLSConfig(index.Name, index.Secure) if err != nil {
registry: endpoint_v1: fix outdated comment
docker_distribution
train
go
02384fa0232a63e4d347ff2dd587c0a8c9a2a103
diff --git a/controllers/media.go b/controllers/media.go index <HASH>..<HASH> 100644 --- a/controllers/media.go +++ b/controllers/media.go @@ -37,7 +37,7 @@ type MediaCommand struct { } type LoadMediaCommand struct { - MediaCommand + net.PayloadHeaders Media MediaItem `json:"media"` CurrentTime int `json:"currentTime"` Autoplay bool `json:"autoplay"` @@ -172,14 +172,11 @@ func (c *MediaController) Stop(ctx context.Context) (*api.CastMessage, error) { func (c *MediaController) LoadMedia(ctx context.Context, media MediaItem, currentTime int, autoplay bool, customData interface{}) (*api.CastMessage, error) { message, err := c.channel.Request(ctx, &LoadMediaCommand{ - MediaCommand: MediaCommand{ - PayloadHeaders: commandMediaLoad, - MediaSessionID: c.MediaSessionID, - }, - Media: media, - CurrentTime: currentTime, - Autoplay: autoplay, - CustomData: customData, + PayloadHeaders: commandMediaLoad, + Media: media, + CurrentTime: currentTime, + Autoplay: autoplay, + CustomData: customData, }) if err != nil { return nil, fmt.Errorf("Failed to send load command: %s", err)
Don't send mediaSessionId with LOAD requests.
barnybug_go-cast
train
go
0cdda3ea52b27689b4e0db31739896a44b1b3677
diff --git a/lib/api.js b/lib/api.js index <HASH>..<HASH> 100644 --- a/lib/api.js +++ b/lib/api.js @@ -49,17 +49,18 @@ module.exports = { else return value; }); - if(parsed.length == 6){ + if(parsed.length == 7){ var machine = [null, null]; if(!_.isNull(parsed[5])) machine = parsed[5].split("/"); var unit = { unit: parsed[0], - load: parsed[1], - active: parsed[2], - sub: parsed[3], - desc: parsed[4], + state: parsed[1], + load: parsed[2], + active: parsed[3], + sub: parsed[4], + desc: parsed[5], machine: machine[0], ip: machine[1] }
Update for fleet <I> list-units state field
normanjoyner_node-fleetctl
train
js
6079d9d6a3b63fa8d9aa7a3981c6c37cc435bccb
diff --git a/contrib/apparmor/template.go b/contrib/apparmor/template.go index <HASH>..<HASH> 100644 --- a/contrib/apparmor/template.go +++ b/contrib/apparmor/template.go @@ -33,14 +33,19 @@ profile /usr/bin/docker (attach_disconnected, complain) { @{DOCKER_GRAPH_PATH}/linkgraph.db k, @{DOCKER_GRAPH_PATH}/network/files/boltdb.db k, @{DOCKER_GRAPH_PATH}/network/files/local-kv.db k, + @{DOCKER_GRAPH_PATH}/[0-9]*.[0-9]*/linkgraph.db k, # For non-root client use: /dev/urandom r, + /dev/null rw, + /dev/pts/[0-9]* rw, /run/docker.sock rw, /proc/** r, + /proc/[0-9]*/attr/exec w, /sys/kernel/mm/hugepages/ r, /etc/localtime r, /etc/ld.so.cache r, + /etc/passwd r, {{if ge .MajorVersion 2}}{{if ge .MinorVersion 9}} ptrace peer=@{profile_name},
Policy extensions for user namespaces and docker exec A few additions to the policy when running with user namespaces enabled and when running 'docker exec'.
moby_moby
train
go
29a8a8d9ccdafebaa1d56bb31ee857f85d7aba15
diff --git a/libs/Console/Application.php b/libs/Console/Application.php index <HASH>..<HASH> 100644 --- a/libs/Console/Application.php +++ b/libs/Console/Application.php @@ -10,6 +10,26 @@ class Application extends SymfonyApplication $this->add(new Generate()); $this->add(new Serve()); + + $app_name = "daux/daux.io"; + + $up = '..' . DIRECTORY_SEPARATOR; + $composer = __DIR__ . DIRECTORY_SEPARATOR . $up . $up . $up . $up . $up . 'composer.lock'; + $version = "unknown"; + + if (file_exists($composer)) { + $app = json_decode(file_get_contents($composer)); + $packages = $app->packages; + + foreach ($packages as $package) { + if ($package->name == $app_name) { + $version = $package->version; + } + } + } + + $this->setVersion($version); + $this->setName($app_name); $this->setDefaultCommand('generate'); } }
Allow to get version with -V / --version #<I>
dauxio_daux.io
train
php
c740a6e01649dec83b74a3de4d5f6a0b71ebcff5
diff --git a/lib/metaforce/rake.rb b/lib/metaforce/rake.rb index <HASH>..<HASH> 100644 --- a/lib/metaforce/rake.rb +++ b/lib/metaforce/rake.rb @@ -34,6 +34,7 @@ module Metaforce print "username: "; @username = STDIN.gets.chomp print "password: "; @password = STDIN.gets.chomp print "security token: "; @security_token = STDIN.gets.chomp + Metaforce.log = true end end
Turn on logging when credentials are given in the command line.
ejholmes_metaforce
train
rb
8cdc7cfe62a2a5e0601cc208340f73f4b0fd80f6
diff --git a/pathspec/pathspec.py b/pathspec/pathspec.py index <HASH>..<HASH> 100644 --- a/pathspec/pathspec.py +++ b/pathspec/pathspec.py @@ -5,6 +5,7 @@ of files. """ import collections +from itertools import izip_longest from . import util from .compat import string_types, viewkeys @@ -36,7 +37,7 @@ class PathSpec(object): Tests equality of this ``PathSpec`` with ``other`` based on the regexs contained in their ``patterns``. """ - paired_patterns = zip(self.patterns, other.patterns) + paired_patterns = izip_longest(self.patterns, other.patterns) return all(a.regex == b.regex for a, b in paired_patterns) def __len__(self):
Use izip_longest to avoid false positive This catches the case where one PathSpac's patterns are a subset of another which would cause a false positive when comparing them.
cpburnz_python-path-specification
train
py
a0722fa9344a376d5cdb4658bc5e6bd514509922
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1999,7 +1999,7 @@ class Minion(MinionBase): salt.utils.minion.cache_jobs(self.opts, load['jid'], ret) load = {'cmd': ret_cmd, - 'load': jids.values()} + 'load': list(six.itervalues(jids))} def timeout_handler(*_): log.warning( @@ -3171,7 +3171,7 @@ class SyndicManager(MinionBase): if res: self.delayed = [] for master in list(six.iterkeys(self.job_rets)): - values = self.job_rets[master].values() + values = list(six.itervalues(self.job_rets[master])) res = self._return_pub_syndic(values, master_id=master) if res: del self.job_rets[master]
PY3 compatibility: ensure we are passing a list instead of dict_values Fixes #<I>.
saltstack_salt
train
py
4d236061ddf2fedd8ab0fbe4cfd7a8973e235391
diff --git a/src/Mutation/AbstractMutationResolver.php b/src/Mutation/AbstractMutationResolver.php index <HASH>..<HASH> 100644 --- a/src/Mutation/AbstractMutationResolver.php +++ b/src/Mutation/AbstractMutationResolver.php @@ -59,7 +59,7 @@ abstract class AbstractMutationResolver extends AbstractResolver implements Even $extensionExecutor = function ($method) { return function (FormEvent $event) use ($method) { foreach ($this->extensions as $extension) { - return call_user_func_array([$extension, $method], [$event]); + call_user_func_array([$extension, $method], [$event]); } }; };
fix issue executing extensions for some mutations
ynloultratech_graphql-bundle
train
php
df9a85e920b0336296491dac10e3a1595c796c06
diff --git a/lib/scenes/ThreeJSScene.js b/lib/scenes/ThreeJSScene.js index <HASH>..<HASH> 100644 --- a/lib/scenes/ThreeJSScene.js +++ b/lib/scenes/ThreeJSScene.js @@ -86,13 +86,13 @@ ThreeJSScene.prototype.init = function($container, options) { camera.aspect = width / height; camera.updateProjectionMatrix(); renderer.setSize(width, height); - render(); + redraw = true; } this.add = function(view) { this.views.push(view); scene.add(view.sceneObject); - render(); + redraw = true; }; this.remove = function(view) {
Fix bug with scene object add/remove
bjnortier_triptych
train
js
ba27d07bc1b2a8cf7a83b528a006f924be3222f1
diff --git a/sinatra-contrib/spec/respond_with_spec.rb b/sinatra-contrib/spec/respond_with_spec.rb index <HASH>..<HASH> 100644 --- a/sinatra-contrib/spec/respond_with_spec.rb +++ b/sinatra-contrib/spec/respond_with_spec.rb @@ -4,17 +4,11 @@ require 'spec_helper' require 'okjson' describe Sinatra::RespondWith do - def provides(*args) - @provides = args - end - def respond_app(&block) - types = @provides mock_app do set :app_file, __FILE__ set :views, root + '/respond_with' register Sinatra::RespondWith - respond_to(*types) if types class_eval(&block) end end
Spec: Drop unused local assistance method - the "provides" method was never called, and its instance variable never set - this change removes warnings output from the test run
sinatra_sinatra
train
rb
41e8f5ebb981ab81dbd20f62c285011b224c4668
diff --git a/agent/api/container/registryauth.go b/agent/api/container/registryauth.go index <HASH>..<HASH> 100644 --- a/agent/api/container/registryauth.go +++ b/agent/api/container/registryauth.go @@ -36,6 +36,7 @@ type ECRAuthData struct { RegistryID string `json:"registryId"` UseExecutionRole bool `json:"useExecutionRole"` pullCredentials credentials.IAMRoleCredentials + dockerAuthConfig types.AuthConfig lock sync.RWMutex } @@ -70,6 +71,23 @@ func (auth *ECRAuthData) SetPullCredentials(creds credentials.IAMRoleCredentials } // GetDockerAuthConfig returns the pull credentials in the auth +func (auth *ECRAuthData) GetDockerAuthConfig() types.AuthConfig { + auth.lock.RLock() + defer auth.lock.RUnlock() + + return auth.dockerAuthConfig +} + +// SetDockerAuthConfig sets the credentials to pull from ECR in the +// ecr auth data +func (auth *ECRAuthData) SetDockerAuthConfig(dac types.AuthConfig) { + auth.lock.Lock() + defer auth.lock.Unlock() + + auth.dockerAuthConfig = dac +} + +// GetDockerAuthConfig returns the pull credentials in the auth func (auth *ASMAuthData) GetDockerAuthConfig() types.AuthConfig { auth.lock.RLock() defer auth.lock.RUnlock()
ecrauth: unify the interface for the pull credentials
aws_amazon-ecs-agent
train
go
4ce6de19d04c5b5fa1a708cfb6c0deefea58c31f
diff --git a/app/controllers/effective/datatables_controller.rb b/app/controllers/effective/datatables_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/effective/datatables_controller.rb +++ b/app/controllers/effective/datatables_controller.rb @@ -40,6 +40,8 @@ module Effective :data => [], :recordsTotal => 0, :recordsFiltered => 0, + :aggregates => [], + :charts => {} }.to_json end
Include empty aggregates and charts in error json
code-and-effect_effective_datatables
train
rb
dbb40cef25942bae95bf83c17d6136784cc40ccb
diff --git a/src/Datasource/EntityTrait.php b/src/Datasource/EntityTrait.php index <HASH>..<HASH> 100644 --- a/src/Datasource/EntityTrait.php +++ b/src/Datasource/EntityTrait.php @@ -1458,6 +1458,7 @@ trait EntityTrait '[dirty]' => $this->_dirty, '[original]' => $this->_original, '[virtual]' => $this->_virtual, + '[hasErrors]' => $this->hasErrors(), '[errors]' => $this->_errors, '[invalid]' => $this->_invalid, '[repository]' => $this->_registryAlias
When debugging the Entity we also want to know if it (or one of the nested entities) has errors.
cakephp_cakephp
train
php
1751f7f497a92ede61d65f0063ccfbdb92c11820
diff --git a/refract/contrib/apielements.py b/refract/contrib/apielements.py index <HASH>..<HASH> 100644 --- a/refract/contrib/apielements.py +++ b/refract/contrib/apielements.py @@ -1,4 +1,4 @@ -from typing import List +from typing import List, Iterator from refract.elements import Array, String, Number from refract.registry import Registry @@ -183,7 +183,7 @@ class Category(Array): Returns the resource group categories found within the category. """ - categories = filter(is_element(Category), self.children) + categories: Iterator[Category] = filter(is_element(Category), self.children) resourceGroups = filter(has_class('resourceGroup'), categories) return list(resourceGroups) @@ -238,6 +238,6 @@ class ParseResult(Array): Returns an API category found within the parse result. """ - categories = filter(is_element(Category), self.children) + categories: Iterator[Category] = filter(is_element(Category), self.children) apis = filter(has_class('api'), categories) return next(apis)
refactor: resolve mypy complaints
kylef_refract.py
train
py
78a49491a842542b201605dda0994ba5deb873fb
diff --git a/analyzer.go b/analyzer.go index <HASH>..<HASH> 100644 --- a/analyzer.go +++ b/analyzer.go @@ -334,4 +334,5 @@ func (gosec *Analyzer) Reset() { gosec.context = &Context{} gosec.issues = make([]*Issue, 0, 16) gosec.stats = &Metrics{} + gosec.ruleset = NewRuleSet() } diff --git a/rules/rules_test.go b/rules/rules_test.go index <HASH>..<HASH> 100644 --- a/rules/rules_test.go +++ b/rules/rules_test.go @@ -28,10 +28,10 @@ var _ = Describe("gosec rules", func() { config = gosec.NewConfig() analyzer = gosec.NewAnalyzer(config, tests, logger) runner = func(rule string, samples []testutils.CodeSample) { - analyzer.LoadRules(rules.Generate(rules.NewRuleFilter(false, rule)).Builders()) for n, sample := range samples { analyzer.Reset() analyzer.SetConfig(sample.Config) + analyzer.LoadRules(rules.Generate(rules.NewRuleFilter(false, rule)).Builders()) pkg := testutils.NewTestPackage() defer pkg.Close() for i, code := range sample.Code {
Load rules on each code sample in order to reconfigure them
securego_gosec
train
go,go
01262ea75ab8d4dc151aeb0aff0e443f2c3bf82f
diff --git a/projects/ninux/ninux/wsgi.py b/projects/ninux/ninux/wsgi.py index <HASH>..<HASH> 100755 --- a/projects/ninux/ninux/wsgi.py +++ b/projects/ninux/ninux/wsgi.py @@ -28,7 +28,7 @@ application = get_wsgi_application() # Apply WSGI middleware here. # from helloworld.wsgi import HelloWorldApplication # application = HelloWorldApplication(application) -#from ninux.settings import DEBUG -#if DEBUG: -# from ninux import monitor -# monitor.start(interval=1.0) +from ninux.settings import DEBUG +if DEBUG: + from ninux import monitor + monitor.start(interval=1.0)
Enabled code change monitor for development environment (DEBUG = True)
ninuxorg_nodeshot
train
py
60e0106f6fee03a93efbbbb46c01b401e38c7694
diff --git a/app/Schema/Migration44.php b/app/Schema/Migration44.php index <HASH>..<HASH> 100644 --- a/app/Schema/Migration44.php +++ b/app/Schema/Migration44.php @@ -110,6 +110,7 @@ class Migration44 implements MigrationInterface $select1 = DB::table('placelocation') ->leftJoin('place_location', 'id', '=', 'pl_id') ->whereNull('id') + ->orderBy('pl_level') ->orderBy('pl_id') ->select([ 'pl_id', @@ -123,6 +124,7 @@ class Migration44 implements MigrationInterface $select2 = DB::table('placelocation') ->leftJoin('place_location', 'id', '=', 'pl_id') ->whereNull('id') + ->orderBy('pl_level') ->orderBy('pl_id') ->select([ 'pl_id',
Fix: wt_placelocation data created out-of-sequence causes migration error
fisharebest_webtrees
train
php
e4839186300be19fff7203b1f4d23d5231183f1e
diff --git a/src/xo.js b/src/xo.js index <HASH>..<HASH> 100644 --- a/src/xo.js +++ b/src/xo.js @@ -9,7 +9,7 @@ * @namespace xo * @version 0.3.2 */ - xo.VERSION = '0.4.0'; + xo.VERSION = '2.0.0'; function identity(x) { return x; diff --git a/test/xo.spec.js b/test/xo.spec.js index <HASH>..<HASH> 100644 --- a/test/xo.spec.js +++ b/test/xo.spec.js @@ -6,7 +6,7 @@ if(typeof xo === 'undefined') { describe('xo.VERSION', function() { it('returns correct version number', function() { - expect(xo.VERSION).toBe('0.4.0'); + expect(xo.VERSION).toBe('2.0.0'); }); });
correct source and tests version to <I>
bjdixon_xo
train
js,js
8df0e392fec50d222132c831b4f2ae3b3f0858a1
diff --git a/scripts/build-examples.js b/scripts/build-examples.js index <HASH>..<HASH> 100644 --- a/scripts/build-examples.js +++ b/scripts/build-examples.js @@ -10,9 +10,24 @@ glob.sync(`${examplesDir}/*/webpack.config.js`, { absolute: true }).forEach((p) => { const config = require(p); - webpack(config, (err) => { + webpack(config, (err, stats) => { if (err) { throw err; } + + const msgs = []; + const { errors, warnings } = stats.compilation; + + if (warnings.length > 0) { + msgs.push(`BUILD EXAMPLES WARNINGS\n${warnings.map(w => w.message).join('\n\n')}`); + } + + if (errors.length > 0) { + msgs.push(`BUILD EXAMPLES ERRORS\n${errors.map(e => e.message).join('\n\n')}`); + } + + if (msgs.length > 0) { + throw new Error(msgs.join('\n')); + } }); });
chore(scripts): fail when errors or warnings in examples build occurs
kisenka_svg-sprite-loader
train
js
3ad343b274f4502faa7b997ccaedfb2c65925c8f
diff --git a/application/Espo/Services/Settings.php b/application/Espo/Services/Settings.php index <HASH>..<HASH> 100644 --- a/application/Espo/Services/Settings.php +++ b/application/Espo/Services/Settings.php @@ -30,7 +30,7 @@ namespace Espo\Services; use Espo\Core\Exceptions\Forbidden; -use Espo\Core\Exceptions\NotFound; +use Espo\Core\Exceptions\Error; use Espo\Core\Exceptions\BadRequest; use Espo\ORM\Entity;
add missing `use` in settings.php service (#<I>)
espocrm_espocrm
train
php
9f95e0a49cf47989daa93ce60cd12b1b9138764c
diff --git a/test/test_cheddargetter_client_ruby.rb b/test/test_cheddargetter_client_ruby.rb index <HASH>..<HASH> 100644 --- a/test/test_cheddargetter_client_ruby.rb +++ b/test/test_cheddargetter_client_ruby.rb @@ -131,14 +131,14 @@ class TestCheddargetterClientRuby < Test::Unit::TestCase assert_raises(CheddarGetter::ResponseException){ result.customer } assert_equal true, result.valid? - result = CG.get_plan(:id => "fe96b9e6-53a2-102e-b098-40402145ee8b") + result = CG.get_plan(:id => "a6a816c8-6d14-11e0-bcd4-40406799fa1e") assert_equal 1, result.plans.size assert_equal "Free Plan Test", result.plan("FREE_PLAN_TEST")[:name] assert_equal true, result.valid? result = CG.get_plan(:code => "NOT_A_PLAN") assert_equal false, result.valid? - assert_equal ["Plan not found for code=NOT_A_PLAN within productCode=GEM_TEST"], result.error_messages + assert_equal ["Plan not found for code=NOT_A_PLAN within productCode=RUBYGEM"], result.error_messages end should "create a single free customer at cheddar getter" do
Fixing the plan data to work with testing account.
expectedbehavior_cheddargetter_client_ruby
train
rb
54fc2329fa597739ed7d4e2efb859718f25b255d
diff --git a/pysat/_constellation.py b/pysat/_constellation.py index <HASH>..<HASH> 100644 --- a/pysat/_constellation.py +++ b/pysat/_constellation.py @@ -6,12 +6,13 @@ class Constellation(object): """ def __init__(self, instruments=None, name=None): if instruments and name: - raise ValueError('When creating a constellation, please specify a ' - 'list of instruments or a name, not both.') + raise ValueError('When creating a constellation, please specify ' + 'a list of instruments or a name, not both.') elif instruments and not hasattr(instruments, '__getitem__'): raise ValueError('Constellation: Instruments must be list-like.') elif not (name or instruments): - raise ValueError('Constellation: Cannot create empty constellation.') + raise ValueError('Constellation: Cannot create empty ' + 'constellation.') if instruments: self.instruments = instruments
Change line wrap to appease pycodestyle.
rstoneback_pysat
train
py
fc8afec69c46b8acc1a9cbe4e2b72bc50a73ac3a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ install_requires = [ 'invenio-access>=1.1.0', 'invenio-accounts>=1.1.0', 'invenio-assets>=1.0.0', - 'invenio-files-rest>=1.0.0b1', + 'invenio-files-rest>=1.0.0a23', 'invenio-indexer>=1.0.2', 'invenio-pidstore>=1.0.0', 'invenio-records>=1.2.0',
installation: relax invenio-files-rest min version
inveniosoftware_invenio-communities
train
py
3cb6e901371486d9f2a5d7a00c53f4fb2247ea2d
diff --git a/src/Commands/ModelFromTableCommand.php b/src/Commands/ModelFromTableCommand.php index <HASH>..<HASH> 100644 --- a/src/Commands/ModelFromTableCommand.php +++ b/src/Commands/ModelFromTableCommand.php @@ -104,7 +104,7 @@ class ModelFromTableCommand extends Command $filename = Str::studly($table); if ($this->options['singular']){ - $filename = str_singular($filename); + $filename = Str::singular($filename); } $fullPath = "$path/$filename.php"; @@ -184,7 +184,7 @@ class ModelFromTableCommand extends Command */ public function replaceClassName($stub, $tableName) { - return str_replace('{{class}}', $this->options['singular'] ? str_singular(Str::studly($tableName)): Str::studly($tableName), $stub); + return str_replace('{{class}}', $this->options['singular'] ? Str::singular(Str::studly($tableName)): Str::studly($tableName), $stub); } /**
Updated str_singular to use the new Str class (Laravel 6)
laracademy_generators
train
php
5af7fa6c05da1e1bc9f91231b44f86b3de8accf7
diff --git a/lib/core/manager.rb b/lib/core/manager.rb index <HASH>..<HASH> 100644 --- a/lib/core/manager.rb +++ b/lib/core/manager.rb @@ -124,10 +124,9 @@ class Manager #--- def reload(core = false) - logger.info("Loading Nucleon plugins at #{current_time}") + logger.info("Loading Nucleon plugins at #{Time.now}") - if core - current_time = Time.now + if core Celluloid.logger = logger define_namespace :nucleon
Fixing issue with out of scope time variable in the reload method of the plugin manager.
coralnexus_nucleon
train
rb
957299ec5cf7ea3057bdd3592c77da6acdf5e376
diff --git a/source/Spiral/Core/Controller.php b/source/Spiral/Core/Controller.php index <HASH>..<HASH> 100644 --- a/source/Spiral/Core/Controller.php +++ b/source/Spiral/Core/Controller.php @@ -81,6 +81,9 @@ abstract class Controller extends Service implements ControllerInterface ); } + //Needed to be called via reflection + $reflection->setAccessible(true); + //Executing our action return $this->executeAction($reflection, $arguments, $parameters); }
HttpController refactored.
spiral_security
train
php
cbdd63a38ba45c6b64de5c8f11306a2e677ed519
diff --git a/src/ol/format/GeoJSON.js b/src/ol/format/GeoJSON.js index <HASH>..<HASH> 100644 --- a/src/ol/format/GeoJSON.js +++ b/src/ol/format/GeoJSON.js @@ -163,7 +163,7 @@ class GeoJSON extends JSONFeature { if (crs['type'] == 'name') { projection = getProjection(crs['properties']['name']); } else if (crs['type'] === 'EPSG') { - projection = getProjection("EPSG:" + crs['properties']['code']); + projection = getProjection('EPSG:' + crs['properties']['code']); } else { assert(false, 36); // Unknown SRS type }
Strings must have singlequotes Strings must have singlequotes
openlayers_openlayers
train
js
4cf8db44259b373d5614f1012e541db741920719
diff --git a/src/Models/MetadataKeyMethodNamesTrait.php b/src/Models/MetadataKeyMethodNamesTrait.php index <HASH>..<HASH> 100644 --- a/src/Models/MetadataKeyMethodNamesTrait.php +++ b/src/Models/MetadataKeyMethodNamesTrait.php @@ -25,7 +25,7 @@ trait MetadataKeyMethodNamesTrait * @return array|null * @throws InvalidOperationException */ - protected function getRelationsHasManyKeyNames($foo) + protected function getRelationsHasManyKeyNames(Relation $foo) { $thruName = null; if ($foo instanceof HasManyThrough) { @@ -48,7 +48,7 @@ trait MetadataKeyMethodNamesTrait * @return array * @throws InvalidOperationException */ - protected function polyglotKeyMethodNames($foo, $condition = false) + protected function polyglotKeyMethodNames(Relation $foo, $condition = false) { // if $condition is falsy, return quickly - don't muck around if (!$condition) { @@ -93,7 +93,7 @@ trait MetadataKeyMethodNamesTrait * @return array * @throws InvalidOperationException */ - protected function polyglotKeyMethodBackupNames($foo, $condition = false) + protected function polyglotKeyMethodBackupNames(Relation $foo, $condition = false) { // if $condition is falsy, return quickly - don't muck around if (!$condition) {
Add more type hints to key-method names trait
Algo-Web_POData-Laravel
train
php
4d697d5600d81c69d517d66773f0f451ac927ca2
diff --git a/src/main/java/htmlflow/HtmlView.java b/src/main/java/htmlflow/HtmlView.java index <HASH>..<HASH> 100644 --- a/src/main/java/htmlflow/HtmlView.java +++ b/src/main/java/htmlflow/HtmlView.java @@ -50,13 +50,13 @@ import static java.util.stream.Collectors.joining; * created on 29-03-2012 */ public abstract class HtmlView<T> implements HtmlWriter<T>, Element<HtmlView, Element> { - final static String WRONG_USE_OF_PRINTSTREAM_ON_THREADSAFE_VIEWS = + static final String WRONG_USE_OF_PRINTSTREAM_ON_THREADSAFE_VIEWS = "Cannot use PrintStream output for thread-safe views!"; - final static String WRONG_USE_OF_THREADSAFE_ON_VIEWS_WITH_PRINTSTREAM = + static final String WRONG_USE_OF_THREADSAFE_ON_VIEWS_WITH_PRINTSTREAM = "Cannot set thread-safety for views with PrintStream output!"; - final static String WRONG_USE_OF_RENDER_WITH_PRINTSTREAM = + static final String WRONG_USE_OF_RENDER_WITH_PRINTSTREAM = "Wrong use of render(). " + "Use write() rather than render() to output to PrintStream. " + "To get a String from render() you must use view() without a PrintStream ";
Minor fix reorder qualifiers.
xmlet_HtmlFlow
train
java
2a5547981dad7e59be2c26aeb52f5d49d2195b9c
diff --git a/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java b/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java +++ b/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java @@ -177,6 +177,14 @@ public class CustomTHsHaServer extends TNonblockingServer { select(); } + try + { + selector.close(); // CASSANDRA-3867 + } + catch (IOException e) + { + // ignore this exception. + } } catch (Throwable t) {
CASSANDRA-<I> patch by Vijay; reviewed by Brandon Williams for CASSANDRA-<I>
Stratio_stratio-cassandra
train
java
6fd3e33c62774eaf7a972df50f282affc832fb30
diff --git a/lib/browser/url.js b/lib/browser/url.js index <HASH>..<HASH> 100644 --- a/lib/browser/url.js +++ b/lib/browser/url.js @@ -1,9 +1,23 @@ module.exports = function() { - window.PeerConnection = window.webkitRTCPeerConnection || window.mozRTCPeerConnection || window.RTCPeerConnection; - window.masquaradedPeerConnection = window.PeerConnection; - window.PeerConnection = function(config) { - var pc = new window.masquaradedPeerConnection(config); + var origFunction; + + /** + * method to masquerade RTCPeerConnection + */ + var masqueradeFunction = function(param1, param2, param3) { + var pc = new origFunction(param1, param2, param3); window.webdriverRTCPeerConnectionBucket = pc; return pc; }; + + if(window.webkitRTCPeerConnection) { + origFunction = window.webkitRTCPeerConnection; + window.webkitRTCPeerConnection = masqueradeFunction; + } else if(window.mozRTCPeerConnection) { + origFunction = window.mozRTCPeerConnection; + window.mozRTCPeerConnection = masqueradeFunction; + } else if(window.RTCPeerConnection) { + origFunction = window.RTCPeerConnection; + window.RTCPeerConnection = masqueradeFunction; + } }
different approach of masquerading RTCPeerConnection
webdriverio_webdriverrtc
train
js
efc6bf4eb8f9b4619e334c2e896242dc1a08c80b
diff --git a/caravel/__init__.py b/caravel/__init__.py index <HASH>..<HASH> 100644 --- a/caravel/__init__.py +++ b/caravel/__init__.py @@ -26,6 +26,11 @@ logging.getLogger().setLevel(logging.DEBUG) app = Flask(__name__) app.config.from_object(CONFIG_MODULE) +if not app.debug: + # In production mode, add log handler to sys.stderr. + app.logger.addHandler(logging.StreamHandler()) + app.logger.setLevel(logging.INFO) + db = SQLA(app) cache = Cache(app, config=app.config.get('CACHE_CONFIG'))
Redirect application log to stderr, which is picked up by gunicorn. (#<I>)
apache_incubator-superset
train
py
22f6737c809986949a1f1ec491b85074dccd5b96
diff --git a/classes/Flatfile/Core.php b/classes/Flatfile/Core.php index <HASH>..<HASH> 100644 --- a/classes/Flatfile/Core.php +++ b/classes/Flatfile/Core.php @@ -325,19 +325,20 @@ class Flatfile_Core { // Match on property, terms and other stuffs // TODO + // Natural sort ordering + natsort($this->_files); + + // Ordering files + if ($this->_order === 'desc') + { + $this->_files = array_reverse($this->_files, TRUE); + } + // if ($multiple === TRUE) if ($multiple === TRUE OR $this->_query) { // Loading multiple Flatfile $result = array(); - // Natural sort ordering - natsort($this->_files); - - // Ordering files - if ($this->_order === 'desc') - { - $this->_files = array_reverse($this->_files, TRUE); - } // Each md file is load in array and returned foreach ($this->_files as $slug => $file)
Ebable sorting for a sinlge entry also
ziopod_Flatfile
train
php
fe750f1bb663ad221e62a4be9dbc97548b55f534
diff --git a/drools-compiler/src/main/java/org/drools/compiler/osgi/Activator.java b/drools-compiler/src/main/java/org/drools/compiler/osgi/Activator.java index <HASH>..<HASH> 100644 --- a/drools-compiler/src/main/java/org/drools/compiler/osgi/Activator.java +++ b/drools-compiler/src/main/java/org/drools/compiler/osgi/Activator.java @@ -27,7 +27,7 @@ import org.drools.core.runtime.process.ProcessRuntimeFactoryService; import org.kie.api.Service; import org.kie.internal.builder.KnowledgeBuilderFactoryService; import org.kie.internal.utils.ServiceRegistryImpl; -import org.kie.osgi.api.Activator.BundleContextInstantiator; +import org.kie.api.osgi.api.Activator.BundleContextInstantiator; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants;
Resolve split-packages: move everything from kie-api under org.kie.api: move classes directly under org.kie.osgi
kiegroup_drools
train
java
9a3390d5c8991b5560f3414013167623a24437ab
diff --git a/transaction.go b/transaction.go index <HASH>..<HASH> 100644 --- a/transaction.go +++ b/transaction.go @@ -375,7 +375,9 @@ func (txn *Txn) Commit(callback func(error)) error { } // CommitAt commits the transaction, following the same logic as Commit(), but at the given -// commit timestamp. This API is only useful for databases built on top of Badger (like Dgraph), and +// commit timestamp. It returns an error if ManagedTxns option is not set. +// +// This API is only useful for databases built on top of Badger (like Dgraph), and // can be ignored by most users. func (txn *Txn) CommitAt(commitTs uint64, callback func(error)) error { if !txn.db.opt.ManagedTxns {
Added an additional comment to CommitAt
dgraph-io_badger
train
go
be4044c6e67361f4a7e9e6d020ceeaece1a23e25
diff --git a/src/reanimated2/core.js b/src/reanimated2/core.js index <HASH>..<HASH> 100644 --- a/src/reanimated2/core.js +++ b/src/reanimated2/core.js @@ -8,6 +8,18 @@ global.__reanimatedWorkletInit = function(worklet) { worklet.__worklet = true; }; +// check if a worklet can be created successfully(in order to detect a lack of babel plugin) +if ( + !(() => { + 'worklet'; + }).__workletHash && + !process.env.JEST_WORKER_ID +) { + throw new Error( + "Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?" + ); +} + function _toArrayReanimated(object) { 'worklet'; if (Array.isArray(object)) {
Handle lack of babel plugin (#<I>) ## Description Handle a situation when someone forgets to add a babel plugin by throwing a corresponding error.
kmagiera_react-native-reanimated
train
js
2f805c0500d22a8e0e2ef52122c7a02b4cfbd93f
diff --git a/src/main/java/com/sksamuel/jqm4gwt/JQMActivityManager.java b/src/main/java/com/sksamuel/jqm4gwt/JQMActivityManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/sksamuel/jqm4gwt/JQMActivityManager.java +++ b/src/main/java/com/sksamuel/jqm4gwt/JQMActivityManager.java @@ -8,6 +8,15 @@ import com.google.gwt.user.client.ui.IsWidget; /** * @author Stephen K Samuel [email protected] 6 Sep 2012 01:25:22 + * + * When using the {@link JQMActivityManager} you must disable jQuery Mobile hash listening, + * otherwise jQuery Mobile will intercept hash changes, and so they will not propgate to the GWT activity manager. + * + * Add this override to your HTML page. + * + * $(document).bind("mobileinit", function(){ + * $.mobile.hashListeningEnabled = false; + * }); * */ public class JQMActivityManager extends ActivityManager { @@ -21,9 +30,13 @@ public class JQMActivityManager extends ActivityManager { } } + private static native void disableHashListening() /*-{ + $wnd.$.mobile.hashListeningEnabled = false; + }-*/; + public JQMActivityManager(ActivityMapper mapper, EventBus eventBus) { super(mapper, eventBus); setDisplay(new JQMAwareDisplay()); + disableHashListening(); } - }
Added disablign of hash events when using JQMActivityManager
jqm4gwt_jqm4gwt
train
java
6075c8b57de8d7e4a389f7c1f49bb60d735d3a8d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup(name='pysmap', packages=['pysmap', 'pysmap.twitterutil', 'pysmap.viz'], - version='0.0.32', + version='0.0.33', description='pysmap is a set of tools for working with twitter data', author='yvan', author_email='[email protected]',
added vbump and matplotlib rewrite over bokeh
SMAPPNYU_pysmap
train
py
7a3dc5547ca6d372c16ae092f34f68f12d01868d
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -51,7 +51,7 @@ copyright = u'2012, Andrew P. Davison' # The short X.Y version. version = '0.2' # The full version, including alpha/beta/rc tags. -release = '0.2.0' +release = '0.2.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/lazyarray.py b/lazyarray.py index <HASH>..<HASH> 100644 --- a/lazyarray.py +++ b/lazyarray.py @@ -12,7 +12,7 @@ import collections from functools import wraps import logging -__version__ = "0.2.1dev" +__version__ = "0.2.1" # stuff for Python 3 compatibility try: @@ -24,6 +24,12 @@ try: reduce except NameError: from functools import reduce + +try: + basestring +except NameError: + basestring = str + logger = logging.getLogger("lazyarray") diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from distutils.core import setup setup( name='lazyarray', - version='0.2.1dev', + version='0.2.1', py_modules=['lazyarray'], license='Modified BSD', author="Andrew P. Davison",
Previous release didn't work with Python 3
NeuralEnsemble_lazyarray
train
py,py,py
c20d7ad69f2dda9dd61c936c81e2d416487e32b4
diff --git a/client/lib/wpcom-undocumented/lib/undocumented.js b/client/lib/wpcom-undocumented/lib/undocumented.js index <HASH>..<HASH> 100644 --- a/client/lib/wpcom-undocumented/lib/undocumented.js +++ b/client/lib/wpcom-undocumented/lib/undocumented.js @@ -1952,12 +1952,16 @@ Undocumented.prototype.getSiteConnectInfo = function( targetUrl, filters ) { }; const parsedUrl = url.parse( targetUrl ); const endpointUrl = `/connect/site-info/${ parsedUrl.protocol.slice( 0, -1 ) }/${ parsedUrl.host }`; - - this.wpcom.req.get( `${ endpointUrl }`, { + let params = { filters: filters, - path: parsedUrl.path, apiVersion: '1.1', - }, resolver ); + }; + + if ( parsedUrl.path && parsedUrl.path !== '/' ) { + params.path = parsedUrl.path; + } + + this.wpcom.req.get( `${ endpointUrl }`, params, resolver ); } ); }
Jetpack-connect: Don't send / as default if there is no path in the entered url
Automattic_wp-calypso
train
js
6b95171698792b76ddccc11acab28588c7b899f8
diff --git a/openid/association.py b/openid/association.py index <HASH>..<HASH> 100644 --- a/openid/association.py +++ b/openid/association.py @@ -123,7 +123,7 @@ class Association(object): self.lifetime = lifetime self.assoc_type = assoc_type - def getExpiresIn(self): + def getExpiresIn(self, now=None): """ This returns the number of seconds this association is still valid for, or C{0} if the association is no longer valid. @@ -134,7 +134,10 @@ class Association(object): @rtype: C{int} """ - return max(0, self.issued + self.lifetime - int(time.time())) + if now is None: + now = int(time.time()) + + return max(0, self.issued + self.lifetime - now) expiresIn = property(getExpiresIn)
[project @ Allow passing a timestamp to getExpiresIn]
openid_python-openid
train
py
8988c388729ca7f1135a0577f2355009cc7e6725
diff --git a/demos/paymentDirect/non_js.php b/demos/paymentDirect/non_js.php index <HASH>..<HASH> 100644 --- a/demos/paymentDirect/non_js.php +++ b/demos/paymentDirect/non_js.php @@ -19,7 +19,6 @@ $user = new MangoPay\UserNatural(); $user->FirstName = 'John'; $user->LastName = 'Smith'; $user->Email = '[email protected]'; -$user->Address = "Some Address"; $user->Birthday = time(); $user->Nationality = 'FR'; $user->CountryOfResidence = 'FR'; @@ -74,4 +73,4 @@ $returnUrl .= 'payment.php'; <div class="clear"></div> <input type="submit" value="Pay" /> -</form> \ No newline at end of file +</form>
Remove address to ensure code runs with <I> of the API
Mangopay_mangopay2-php-sdk
train
php
986f49f4074a68626870c90ea5a17cb50ad4e3dc
diff --git a/libraries/lithium/tests/cases/util/InflectorTest.php b/libraries/lithium/tests/cases/util/InflectorTest.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/tests/cases/util/InflectorTest.php +++ b/libraries/lithium/tests/cases/util/InflectorTest.php @@ -6,7 +6,7 @@ * @license http://opensource.org/licenses/bsd-license.php The BSD License */ -namespace lithium\tests\cases\Util; +namespace lithium\tests\cases\util; use \lithium\util\Inflector;
Updated InflectorTest namespace to have proper casing.
UnionOfRAD_framework
train
php
429dae4f5c7d5570cde1745f8b30aab86fb56228
diff --git a/src/Show/Fields/SharpShowEntityListField.php b/src/Show/Fields/SharpShowEntityListField.php index <HASH>..<HASH> 100644 --- a/src/Show/Fields/SharpShowEntityListField.php +++ b/src/Show/Fields/SharpShowEntityListField.php @@ -90,11 +90,11 @@ class SharpShowEntityListField extends SharpShowField return $this; } - + public function showCount(bool $showCount = true): self { $this->showCount = $showCount; - + return $this; }
Apply fixes from StyleCI (#<I>)
code16_sharp
train
php
63d992a85f441f6bb75519d21384bd48c7d405f6
diff --git a/lib/cinch/helpers.rb b/lib/cinch/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/cinch/helpers.rb +++ b/lib/cinch/helpers.rb @@ -185,6 +185,11 @@ module Cinch end alias_method :Color, :Format + # (see .sanitize) + def Sanitize(string) + Cinch::Helpers.sanitize(string) + end + # Deletes all characters in the ranges 0–8, 10–31 as well as the # character 127, that is all non-printable characters and # newlines. @@ -206,7 +211,7 @@ module Cinch # @param [String] string The string to filter # @return [String] The filtered string # @since 2.2.0 - def Sanitize(string) + def self.sanitize(string) string.gsub(/[\x00-\x08\x10-\x1f\x7f]/, '') end diff --git a/lib/cinch/target.rb b/lib/cinch/target.rb index <HASH>..<HASH> 100644 --- a/lib/cinch/target.rb +++ b/lib/cinch/target.rb @@ -74,7 +74,7 @@ module Cinch # @param (see #msg) # @see #msg def safe_msg(text, notice = false) - msg(Cinch::Helpers.Sanitize(text), notice) + msg(Cinch::Helpers.sanitize(text), notice) end alias_method :safe_privmsg, :safe_msg alias_method :safe_send, :safe_msg
add Helpers.sanitize Allow usage of sanitize without having to include Helpers
cinchrb_cinch
train
rb,rb
ac9a2e52520ee6a8510be569c39f195a93576594
diff --git a/insteonplm/plm.py b/insteonplm/plm.py index <HASH>..<HASH> 100644 --- a/insteonplm/plm.py +++ b/insteonplm/plm.py @@ -88,7 +88,7 @@ class PLM(asyncio.Protocol): None, self._handle_get_next_all_link_record_nak, MESSAGE_NAK) self._message_callbacks.add_message_callback(MESSAGE_STANDARD_MESSAGE_RECEIVED_0X50, - COMMAND_ID_REQUEST_RESPONSE_0X10_0X10, _handle_id_request_response) + COMMAND_ID_REQUEST_RESPONSE_0X10_0X10, self._handle_id_request_response) def connection_made(self, transport): """Called when asyncio.Protocol establishes the network connection."""
fixed reference to _handle_id_request_response
nugget_python-insteonplm
train
py
770f54e84e8ba735bca52842bc8df9d27421f531
diff --git a/lib/evalhook/tree_processor.rb b/lib/evalhook/tree_processor.rb index <HASH>..<HASH> 100644 --- a/lib/evalhook/tree_processor.rb +++ b/lib/evalhook/tree_processor.rb @@ -72,7 +72,7 @@ module EvalHook end firstcall = nil - if tree[3] == s(:arglist) or tree[3] == nil + if tree[1] == nil and (tree[3] == s(:arglist) or tree[3] == nil) firstcall = s(:call, hook_handler_reference, :hooked_variable_method,
<I> test pass: fixed issue #9 (Methods shadowed by block variables)
tario_evalhook
train
rb
909caa03bdd8b40d890f06d5b3e54d982a199be1
diff --git a/gridsome/lib/build.js b/gridsome/lib/build.js index <HASH>..<HASH> 100644 --- a/gridsome/lib/build.js +++ b/gridsome/lib/build.js @@ -44,6 +44,7 @@ module.exports = async (context, args) => { // 5. clean up await plugins.callHook('afterBuild', { context, config, queue }) + await fs.remove(path.resolve(config.cacheDir, 'data')) await fs.remove(config.manifestsDir) console.log()
fix(build): clear cached data files
gridsome_gridsome
train
js
538d0307232f9c26e9cfd8e2f62a59dce7077a96
diff --git a/src/svg/path/path.py b/src/svg/path/path.py index <HASH>..<HASH> 100644 --- a/src/svg/path/path.py +++ b/src/svg/path/path.py @@ -293,12 +293,15 @@ class Path(MutableSequence): def __setitem__(self, index, value): self._segments[index] = value + self._lengths = None def __delitem__(self, index): del self._segments[index] + self._lengths = None def insert(self, index, value): self._segments.insert(index, value) + self._lengths = None def reverse(self): # Reversing the order of a path would require reversing each element
The ._length attribute needs to be cleared when the path is modified.
regebro_svg.path
train
py