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
d12d9ddcb1e7136ebfd7115cc056944fcba21bae
diff --git a/config/python.py b/config/python.py index <HASH>..<HASH> 100644 --- a/config/python.py +++ b/config/python.py @@ -2,6 +2,11 @@ import config.project package_name = config.project.project_name +install_requires = [ + "pyfakeuse", + "logging_tree", + "pyyaml", +] test_requires = [ "pylint", "pytest", @@ -9,15 +14,12 @@ test_requires = [ "flake8", "pymakehelper", ] -install_requires = [ - "pyfakeuse", - "logging_tree", - "pyyaml", -] dev_requires = [ "pypitools", "pydmt", "pyclassifiers", +] +extra_requires = [ "scrapy", ]
run_requires -> install_requires
veltzer_pylogconf
train
py
aeb7b46d535c97590a37a100ff8648864a64f634
diff --git a/tests/unit/components/LMap.spec.js b/tests/unit/components/LMap.spec.js index <HASH>..<HASH> 100644 --- a/tests/unit/components/LMap.spec.js +++ b/tests/unit/components/LMap.spec.js @@ -205,8 +205,6 @@ describe('component: LMap.vue', () => { // Quarantining this test because it seems it blocks jest execution completely test('LMap.vue no-blocking-animations real position', async () => { - expect(true).toBeTruthy(); - /* // Most important test for no-blocking-animations, tests the real position // However, I suspect animations are never triggered in unit tests const wrapper = getMapWrapper({ @@ -215,6 +213,9 @@ describe('component: LMap.vue', () => { noBlockingAnimations: true, }); + expect(wrapper).toBeDefined(); + + /* // Move the map several times in a short timeperiod wrapper.setProps({ center: { lat: 0, lng: 170 } }); wrapper.setProps({ zoom: 15 });
Add wrapper creation to quarantined test
KoRiGaN_Vue2Leaflet
train
js
bf895bb0ede2bc6af411ef4f2167d3ba702ec9a1
diff --git a/lib/template.js b/lib/template.js index <HASH>..<HASH> 100644 --- a/lib/template.js +++ b/lib/template.js @@ -172,7 +172,11 @@ module.exports = (function () { */ if (init.before) { - return init.before(); + return new Promise( + function (resolve, reject) { + return init.before(resolve, reject); + } + ) } } @@ -253,7 +257,11 @@ module.exports = (function () { */ if (init.beforeRender) { - return init.beforeRender(); + return new Promise( + function (resolve, reject) { + return init.beforeRender(locals, resolve, reject); + } + ) } } @@ -293,7 +301,11 @@ module.exports = (function () { */ if (init.after) { - return init.after(); + return new Promise( + function (resolve, reject) { + return init.after(locals, resolve, reject); + } + ) } }
Pass resolve, reject to hooks.
carrot_sprout
train
js
5a1aa19878c39fa15fc4a7c701b9bc609811241d
diff --git a/vyper/optimizer.py b/vyper/optimizer.py index <HASH>..<HASH> 100644 --- a/vyper/optimizer.py +++ b/vyper/optimizer.py @@ -11,7 +11,7 @@ def get_int_at(args, pos, signed=False): o = LOADED_LIMIT_MAP[args[pos].args[0].value] else: return None - if signed: + if signed or o < 0: return ((o + 2**255) % 2**256) - 2**255 else: return o % 2**256
Fix optimization of negative integer addition Previously when optimizing an addition involving a negative integer, the optimizer would treat negative values as their positive two's complement representation, which would cause overflow (e.g. -1 + 1 would equal 2**<I> rather than 0).
ethereum_vyper
train
py
756b5234dc5ebd9db9845742dff02c8c7223d3c1
diff --git a/numina/core/__init__.py b/numina/core/__init__.py index <HASH>..<HASH> 100644 --- a/numina/core/__init__.py +++ b/numina/core/__init__.py @@ -31,3 +31,5 @@ from .reciperesult import RecipeResult, provides, Product, Optional from .reciperesult import ValidRecipeResult from .reciperesult import define_result from .oblock import obsres_from_dict + +BaseRecipe = RecipeBase \ No newline at end of file
Added BaseRecipe as an alias to RecipeBase
guaix-ucm_numina
train
py
84cee45baed1afbd03a3491d2fc005b09fb29ac7
diff --git a/lib/fishback.js b/lib/fishback.js index <HASH>..<HASH> 100644 --- a/lib/fishback.js +++ b/lib/fishback.js @@ -28,17 +28,17 @@ Fishback.prototype.request = function (req, res) { // Call list[0].request(), if we get a "reject", call list[1].request(), // and so on. - function reject(list) { + function process(list) { var head = list[0]; var tail = list.slice(1); // @TODO Handle null head (all handlers emitted "reject") req.once("reject", function () { - reject(tail); + process(tail); }); head.request(req, res); } - reject(this.list); + process(this.list); };
reject() -> process() (much better name!)
ithinkihaveacat_node-fishback
train
js
9098e34fbd6bf111e50970d6ad1cde7ea8ca7bd8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os try: from setuptools import setup except ImportError:
Remove unused os import in setup.py
rhgrant10_Groupy
train
py
3501f85bfad39cbea8c2fe7867971754e17d3823
diff --git a/homu/server.py b/homu/server.py index <HASH>..<HASH> 100644 --- a/homu/server.py +++ b/homu/server.py @@ -256,7 +256,7 @@ def github(): if action == 'reopened': # FIXME: Review comments are ignored here - for comment in get_repo(repo_label, repo_cfg).issue(pull_num).iter_comments(): + for comment in state.get_repo().issue(pull_num).iter_comments(): found = parse_commands( comment.body, comment.user.login, @@ -266,6 +266,14 @@ def github(): g.db, ) or found + status = '' + for info in utils.github_iter_statuses(state.get_repo(), state.head_sha): + if info.context == 'homu': + status = info.state + break + + state.set_status(status) + state.save() g.states[repo_label][pull_num] = state
Restore the status when a PR is reopened Previously, the status of a reopened PR was set to an empty string.
barosl_homu
train
py
b5974c2069fb276bfccdc152e9e3984fec824ac2
diff --git a/tarbell/app.py b/tarbell/app.py index <HASH>..<HASH> 100644 --- a/tarbell/app.py +++ b/tarbell/app.py @@ -235,7 +235,7 @@ class TarbellSite: except KeyError: pass if is_dict: - k = row.custom['key'].text + k = slughifi(row.custom['key'].text) context[worksheet_key][k] = row_dict else: context[worksheet_key].append(row_dict)
add slughifi to one more place
tarbell-project_tarbell
train
py
eb2a04912c7227e30ed23d69dd8175c886fc459b
diff --git a/internal/monitor/postmonitor.go b/internal/monitor/postmonitor.go index <HASH>..<HASH> 100644 --- a/internal/monitor/postmonitor.go +++ b/internal/monitor/postmonitor.go @@ -18,8 +18,6 @@ type PostMonitor struct { // Query is the multireddit query PostMonitor will use to find new posts // (e.g. self+funny). Query string - // Posts is the number of posts PostMonitor has found since it began. - Posts uint64 // Bot is the handler PostMonitor will send new posts to. Bot api.PostHandler // Op is the operator through which the monitor will make update
Remove unused post count. Former-commit-id: <I>ee6b1bd<I>eac9a7adf1e4a2fb0e<I>c8ba<I>
turnage_graw
train
go
713552fc083a2f3b8bc871e389983d1d4e94c3f4
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -51,6 +51,6 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-nodeunit'); grunt.loadNpmTasks('grunt-contrib-internal'); - grunt.registerTask('test', ['clean', 'xmlmin', 'nodeunit']); - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); + grunt.registerTask('test', ['clean', 'jshint', 'xmlmin', 'nodeunit']); + grunt.registerTask('default', ['test', 'build-contrib']); };
Add JSHint target to test target.
dtrunk90_grunt-xmlmin
train
js
b02a8954c37732d9596b7dcef881ed211cda5695
diff --git a/vendor/refinerycms/images/lib/images.rb b/vendor/refinerycms/images/lib/images.rb index <HASH>..<HASH> 100644 --- a/vendor/refinerycms/images/lib/images.rb +++ b/vendor/refinerycms/images/lib/images.rb @@ -31,6 +31,7 @@ module Refinery Refinery::Plugin.register do |plugin| plugin.title = "Images" plugin.name = "refinery_images" + plugin.directory = "images" plugin.description = "Manage images" plugin.version = %q{0.9.8} plugin.menu_match = /(refinery|admin)\/image(_dialog)?s$/
Fixed dashboard not working with I<I>n This caused errors, because the image plugin generated a unknown url, based on the title of the plugin, which gets translated.
refinery_refinerycms
train
rb
ff11499729975274e338ad1cd63ea7824f2dc046
diff --git a/zhaquirks/xiaomi/aqara/motion_ac02.py b/zhaquirks/xiaomi/aqara/motion_ac02.py index <HASH>..<HASH> 100644 --- a/zhaquirks/xiaomi/aqara/motion_ac02.py +++ b/zhaquirks/xiaomi/aqara/motion_ac02.py @@ -71,11 +71,27 @@ class LocalIlluminanceMeasurementCluster( ): """Local lluminance measurement cluster.""" + def illuminance_reported(self, value): + """Illuminance reported.""" + if 0 > value or value > 0xFFDC: + _LOGGER.debug( + "Received invalid illuminance value: %s - setting illuminance to 0", + value, + ) + value = 0 + super().illuminance_reported(value) + class LocalOccupancyCluster(LocalDataCluster, OccupancyCluster): """Local occupancy cluster.""" +class LocalMotionCluster(MotionCluster): + """Local motion cluster.""" + + reset_s: int = 30 + + class LumiMotionAC02(CustomDevice): """Lumi lumi.motion.ac02 (RTCGQ14LM) custom device implementation.""" @@ -119,7 +135,7 @@ class LumiMotionAC02(CustomDevice): XiaomiPowerConfiguration, Identify.cluster_id, LocalOccupancyCluster, - MotionCluster, + LocalMotionCluster, LocalIlluminanceMeasurementCluster, OppleCluster, ],
Small tweaks to Aqara P1 motion sensor (#<I>) * Small tweaks to Aqara P1 motion sensor * add debug line * discard values over FFDC and set to 0 * update debug log
dmulcahey_zha-device-handlers
train
py
9a4a2d36583f7f80ea42a989e6e4ce5371574a4b
diff --git a/test/request_test.rb b/test/request_test.rb index <HASH>..<HASH> 100644 --- a/test/request_test.rb +++ b/test/request_test.rb @@ -41,9 +41,21 @@ class RequestTest < Minitest::Test end end - # def test_socket_error - # raised = assert_raises(BlockScore::APIConnectionError) do - # - # end - # end + def test_socket_error + stub_request(:get, /.*api\.blockscore\.com\/people\/socket_error/). + to_raise(SocketError) + + assert_raises(BlockScore::APIConnectionError) do + BlockScore::Person.retrieve('socket_error') + end + end + + def test_connection_refused + stub_request(:get, /.*api\.blockscore\.com\/people\/connection_refused/). + to_raise(Errno::ECONNREFUSED) + + assert_raises(BlockScore::APIConnectionError) do + BlockScore::Person.retrieve('connection_refused') + end + end end
add socket_error and connection_refused tests
BlockScore_blockscore-ruby
train
rb
aaf783b0fc8a7d8052b9c9f29d0b6c23b8036eee
diff --git a/ca/django_ca/admin.py b/ca/django_ca/admin.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/admin.py +++ b/ca/django_ca/admin.py @@ -53,7 +53,7 @@ class CertificateAdmin(admin.ModelAdmin): list_display = ('cn', 'serial', 'status', 'expires_date') list_filter = (StatusListFilter, ) readonly_fields = ['expires', 'csr', 'pub', 'cn', 'serial', 'revoked', 'revoked_date', - 'revoked_reason', 'subjectAltNames', ] + _x509_ext_fields + 'revoked_reason', 'subjectAltName', ] + _x509_ext_fields fieldsets = ( (None, {
fix subjectAltName for real
mathiasertl_django-ca
train
py
9506347ab82c4a83de9dac75f09825355fdd59ec
diff --git a/scandir.py b/scandir.py index <HASH>..<HASH> 100644 --- a/scandir.py +++ b/scandir.py @@ -20,7 +20,7 @@ import collections import ctypes import sys -__version__ = '0.7' +__version__ = '0.8' __all__ = ['scandir', 'walk'] # Windows FILE_ATTRIBUTE constants for interpreting the
Bump up version number for latest PEP changes.
benhoyt_scandir
train
py
b346366a45d917a229c2e85bb38a8677f253de95
diff --git a/src/Acquia/Common/Version.php b/src/Acquia/Common/Version.php index <HASH>..<HASH> 100644 --- a/src/Acquia/Common/Version.php +++ b/src/Acquia/Common/Version.php @@ -4,6 +4,6 @@ namespace Acquia\Common; final class Version { - const RELEASE = '0.10.0-dev'; + const RELEASE = '0.10.0'; const BRANCH = '0.10'; }
Prepare for release [skip ci]
acquia_acquia-sdk-php
train
php
c5c0f56384f0fc5591ac9694e1dc1d52887b1893
diff --git a/chorus/src/main/java/org/chorusbdd/chorus/remoting/jmx/ChorusHandlerJmxExporter.java b/chorus/src/main/java/org/chorusbdd/chorus/remoting/jmx/ChorusHandlerJmxExporter.java index <HASH>..<HASH> 100755 --- a/chorus/src/main/java/org/chorusbdd/chorus/remoting/jmx/ChorusHandlerJmxExporter.java +++ b/chorus/src/main/java/org/chorusbdd/chorus/remoting/jmx/ChorusHandlerJmxExporter.java @@ -80,7 +80,7 @@ public class ChorusHandlerJmxExporter implements ChorusHandlerJmxExporterMBean { public static final String JMX_EXPORTER_NAME = "org.chorusbdd.chorus:name=chorus_exporter"; public static final String JMX_EXPORTER_ENABLED_PROPERTY = "org.chorusbdd.chorus.jmxexporter.enabled"; - public ChorusHandlerJmxExporter(Object... handlers) throws ChorusRemotingException { + public ChorusHandlerJmxExporter(Object... handlers) { for ( Object handler : handlers) { //assert that this is a Handler
remove unnecessary throws clause for runtime exception
Chorus-bdd_Chorus
train
java
f4d9deffa470af893467c6af8c5555fd7bb6f8d4
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -58,16 +58,16 @@ RSpec.configure do |config| end config.before :suite do - call_server(:start) puts - puts ">> waiting for server to bootup" + puts ">> starting up server..." puts - sleep 5 + call_server(:start) + sleep 3 end config.after :suite do puts - puts ">> shutting sown server" + puts ">> shutting down server..." puts call_server(:stop) end
tests: small changes on specs helper
bmedici_rest-ftp-daemon
train
rb
782bd95acd15918339e2562ebe6252d68c66fd08
diff --git a/lib/train/platforms/detect/helpers/os_common.rb b/lib/train/platforms/detect/helpers/os_common.rb index <HASH>..<HASH> 100644 --- a/lib/train/platforms/detect/helpers/os_common.rb +++ b/lib/train/platforms/detect/helpers/os_common.rb @@ -97,6 +97,12 @@ module Train::Platforms::Detect::Helpers return @cache[:cisco] = { version: m[2], model: m[1], type: "ios-xe" } end + # CSR 1000V (for example) does not specify model + m = res.match(/Cisco IOS XE Software, Version (\d+\.\d+\.\d+[A-Z]*)/) + unless m.nil? + return @cache[:cisco] = { version: m[1], type: "ios-xe" } + end + m = res.match(/Cisco Nexus Operating System \(NX-OS\) Software/) unless m.nil? v = res[/^\s*system:\s+version (\d+\.\d+)/, 1]
Add a new regex for Cisco XE devices
inspec_train
train
rb
15e4a6d26b30731f525a9d75d0df3051ce01f00b
diff --git a/abaaso.js b/abaaso.js index <HASH>..<HASH> 100644 --- a/abaaso.js +++ b/abaaso.js @@ -890,7 +890,7 @@ var abaaso = function(){ break; case "id": if (observer.listeners[obj.id] !== undefined) { - observer.listeners[args[i]] = observer.listeners[obj.id]; + observer.listeners[args[i]] = [].concat(observer.listeners[obj.id]); delete observer.listeners[obj.id]; } default:
Changed the observer listener move to a copy/del set of ops
avoidwork_abaaso
train
js
2499d43325a647148c183a0fc22055a9dff0a0c7
diff --git a/nsinit/init.go b/nsinit/init.go index <HASH>..<HASH> 100644 --- a/nsinit/init.go +++ b/nsinit/init.go @@ -65,8 +65,10 @@ func Init(container *libcontainer.Container, uncleanRootfs, consolePath string, if err := mount.InitializeMountNamespace(rootfs, consolePath, container); err != nil { return fmt.Errorf("setup mount namespace %s", err) } - if err := system.Sethostname(container.Hostname); err != nil { - return fmt.Errorf("sethostname %s", err) + if container.Hostname != "" { + if err := system.Sethostname(container.Hostname); err != nil { + return fmt.Errorf("sethostname %s", err) + } } if err := FinalizeNamespace(container); err != nil { return fmt.Errorf("finalize namespace %s", err)
Check supplied hostname before using it. Docker-DCO-<I>-
opencontainers_runc
train
go
238b8337db1673b3b8e385ba082b43e3cb228374
diff --git a/cli.js b/cli.js index <HASH>..<HASH> 100755 --- a/cli.js +++ b/cli.js @@ -18,7 +18,7 @@ function text(text, color) { } require('fallback-cli')('ava/cli.js', function (opts) { - if (true || !opts.localCli) { + if (!opts.localCli) { chalk = require('chalk'); indent = chalk.gray('│ ');
actually run AVA when the command is executed
jamestalmage_ava-cli
train
js
1904c9eaaf221013dfc21fe4e186496dfd3a30d9
diff --git a/spring-social-twitter/src/main/java/org/springframework/social/twitter/api/Tweet.java b/spring-social-twitter/src/main/java/org/springframework/social/twitter/api/Tweet.java index <HASH>..<HASH> 100644 --- a/spring-social-twitter/src/main/java/org/springframework/social/twitter/api/Tweet.java +++ b/spring-social-twitter/src/main/java/org/springframework/social/twitter/api/Tweet.java @@ -15,13 +15,16 @@ */ package org.springframework.social.twitter.api; +import java.io.Serializable; import java.util.Date; /** * Represents a Twitter status update (e.g., a "tweet"). * @author Craig Walls */ -public class Tweet { +public class Tweet implements Serializable { + private static final long serialVersionUID = 1L; + private long id; private String text; private Date createdAt;
tweet object is now serializable, consistant with other twitter api objects
spring-projects_spring-social-twitter
train
java
a33d5ad2838390f873533606537b8f9b4430c0c7
diff --git a/app/lib/actions/katello/capsule_content/sync.rb b/app/lib/actions/katello/capsule_content/sync.rb index <HASH>..<HASH> 100644 --- a/app/lib/actions/katello/capsule_content/sync.rb +++ b/app/lib/actions/katello/capsule_content/sync.rb @@ -52,7 +52,8 @@ module Actions concurrence do repository_ids.each do |repo_id| sequence do - repo = ::Katello::Repository.find_by(pulp_id: repo_id) + repo = ::Katello::Repository.find_by(pulp_id: repo_id) || + ::Katello::ContentViewPuppetEnvironment.find_by(pulp_id: repo_id) if repo && ['yum', 'puppet'].exclude?(repo.content_type) # we unassociate units in non-yum/puppet repos in order to avoid version conflicts # during publish. (i.e. two versions of a unit in the same repo)
Fixes #<I> - properly detect CVPE during proxy sync
Katello_katello
train
rb
bd085e0a21b938708cf0c5b5477ba4cd399f9f71
diff --git a/roaring/roaring.go b/roaring/roaring.go index <HASH>..<HASH> 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -3667,15 +3667,9 @@ func (op *op) apply(b *Bitmap) (changed bool) { case opTypeRemove: return b.remove(op.value) case opTypeAddBatch: - for _, v := range op.values { - nc := b.DirectAdd(v) - changed = nc || changed - } + changed = b.DirectAddN(op.values...) > 0 case opTypeRemoveBatch: - for _, v := range op.values { - nc := b.remove(v) - changed = nc || changed - } + changed = b.DirectRemoveN(op.values...) > 0 default: panic(fmt.Sprintf("invalid op type: %d", op.typ)) }
simply setting list of values with *N methods
pilosa_pilosa
train
go
50ed91cc799ed7b32cc77127b131a183820c0d39
diff --git a/spec/lib/stretcher_index_type_spec.rb b/spec/lib/stretcher_index_type_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/stretcher_index_type_spec.rb +++ b/spec/lib/stretcher_index_type_spec.rb @@ -17,13 +17,12 @@ describe Stretcher::Index do describe "searching" do before do @doc = {:message => "hello"} + type.put(123123, @doc) + index.refresh end it "should search and find the right doc" do - match_text = 'hello' - type.put(123123, @doc) - index.refresh - res = type.search({}, {:query => {:match => {:message => match_text}}}) + res = type.search({}, {:query => {:match => {:message => @doc[:message]}}}) res.results.first.message.should == @doc[:message] end
Fix spec that shouldn't have been passing in IndexType spec
stretcher_stretcher
train
rb
a7d1a2e080b418a93141fef5d0cd9baad21ad58d
diff --git a/notario/validators/__init__.py b/notario/validators/__init__.py index <HASH>..<HASH> 100644 --- a/notario/validators/__init__.py +++ b/notario/validators/__init__.py @@ -23,7 +23,7 @@ class cherry_pick(tuple): self.must_validate = tuple([key for key, value in _tuple]) except ValueError: # single k/v pair if len(_tuple) == 2: - self.must_validate = tuple(_tuple[0]) + self.must_validate = (_tuple[0],) return super(cherry_pick, self).__init__() @@ -40,7 +40,7 @@ class Hybrid(object): from notario.validators.recursive import RecursiveValidator validator = RecursiveValidator(value, self.schema, *args) validator.validate() - pass else: - return self.validator(value) + from notario.engine import enforce + enforce(value, self.validator, *args, pair='value')
safer deduction of items that must_be_validated
alfredodeza_notario
train
py
661ae81af52259af6788d25b63d15925e82777c0
diff --git a/web/core/application.py b/web/core/application.py index <HASH>..<HASH> 100644 --- a/web/core/application.py +++ b/web/core/application.py @@ -201,9 +201,14 @@ class Application(object): # Passing invalid arguments would 500 Internal Server Error on us due to the TypeError exception bubbling up. try: if __debug__: - if bound: + if callable(endpoint) and not isroutine(endpoint): + # Callable Instance + getcallargs(endpoint.__call__, *args, **kwargs) + elif bound: + # Instance Method getcallargs(endpoint, *args, **kwargs) else: + # Unbound Method or Function getcallargs(endpoint, context, *args, **kwargs) except TypeError as e:
Improved callable instance vs. routine detection.
marrow_WebCore
train
py
0645fd2c80c05109f148e28cdf78d636406cb6d7
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -257,7 +257,7 @@ module ActiveRecord def any? if block_given? - method_missing(:any?) { |*block_args| yield(*block_args) } + load_target.any? { |*block_args| yield(*block_args) } else !empty? end @@ -266,7 +266,7 @@ module ActiveRecord # Returns true if the collection has more than 1 record. Equivalent to collection.size > 1. def many? if block_given? - method_missing(:many?) { |*block_args| yield(*block_args) } + load_target.many? { |*block_args| yield(*block_args) } else size > 1 end
Don't use method_missing when we don't have to
rails_rails
train
rb
32947535e7668d5be53f3b29e9e79a63a4d763cf
diff --git a/simuvex/plugins/view.py b/simuvex/plugins/view.py index <HASH>..<HASH> 100644 --- a/simuvex/plugins/view.py +++ b/simuvex/plugins/view.py @@ -21,10 +21,12 @@ class SimRegNameView(SimStatePlugin): v = self.state.se.BVV(v, self.state.arch.registers[k][1]*8) try: - return self.state.registers.store(self.state.arch.registers[k][0], v) + reg_offset = self.state.arch.registers[k][0] except KeyError: raise AttributeError(k) + return self.state.registers.store(reg_offset, v) + def __dir__(self): return self.state.arch.registers.keys()
RegView no longer throws attribute errors for KeyErrors that shouldn't have been thrown
angr_angr
train
py
0f27d1d7228733dd442708af5ee314c448a723b1
diff --git a/lib/gridfs/grid_store.js b/lib/gridfs/grid_store.js index <HASH>..<HASH> 100644 --- a/lib/gridfs/grid_store.js +++ b/lib/gridfs/grid_store.js @@ -1379,6 +1379,7 @@ GridStoreStream.prototype._read = function(n) { var read = function() { // Read data self.gs.read(length, function(err, buffer) { + if(err) return self.emit('error', err); // Stream is closed if(self.endCalled || buffer == null) return self.push(null); // Remove bytes read
NODE-<I> GridStoreStream._read() doesn't check GridStore.read() error
mongodb_node-mongodb-native
train
js
c5d7738e660bf3530d4c45d47846c5037caf6d08
diff --git a/sportsipy/fb/fb_utils.py b/sportsipy/fb/fb_utils.py index <HASH>..<HASH> 100644 --- a/sportsipy/fb/fb_utils.py +++ b/sportsipy/fb/fb_utils.py @@ -20,12 +20,10 @@ def _parse_squad_name(team_id): string Returns a ``string`` of the parsed team's name. """ - name = team_id.replace(' FC', '') - name = name.replace('FC ', '') - name = name.replace(' CF', '') - name = name.replace('CF ', '') - name = name.lower() - name = name.strip() + irrelevant = [' FC', ' CF', 'FC ', 'CF '] + for val in irrelevant: + team_id = team_id.replace(val, '') + name = team_id.lower().strip() return name
fewer lines of code (#<I>) Reduce the number of similar lines in the football utility module.
roclark_sportsreference
train
py
89ca4e12938feec09e40786f048dbe4a351f813f
diff --git a/src/Models/User.php b/src/Models/User.php index <HASH>..<HASH> 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -52,7 +52,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon * * @var array */ - protected $fillable = ['name', 'email', 'password']; + protected $fillable = ['name', 'email', 'password', 'active']; /** * The attributes excluded from the model's JSON form.
Allow for the account status to be filled
eveseat_web
train
php
e40d0eba063e1ba61f99eec5c1003af6a6280ea4
diff --git a/client/views/heatmap.js b/client/views/heatmap.js index <HASH>..<HASH> 100644 --- a/client/views/heatmap.js +++ b/client/views/heatmap.js @@ -129,8 +129,12 @@ module.exports = View.extend({ view.queryByHook('alpha').value = view.model.alpha; view.recalculateColors(view.model); - map.setTarget( view.queryByHook('heatmap') ); + var hook = 'heatmap'; + map.setTarget( view.queryByHook(hook) ); + this.anchorName = function () {return hook;}; // Used by dc when deregistering + map.setSize( [x,y] ); + }, handleSlider: function () { this.model.alpha = parseInt(this.queryByHook('alpha').value) ;
Add callback that dc uses to deregister
NLeSC_spot
train
js
6d379c8c207f16bd0c8630f92eb30041f4323607
diff --git a/storage/src/main/java/io/atomix/storage/buffer/FileBytes.java b/storage/src/main/java/io/atomix/storage/buffer/FileBytes.java index <HASH>..<HASH> 100644 --- a/storage/src/main/java/io/atomix/storage/buffer/FileBytes.java +++ b/storage/src/main/java/io/atomix/storage/buffer/FileBytes.java @@ -236,6 +236,7 @@ public class FileBytes extends AbstractBytes { int length = Math.max(offset, size); randomAccessFile.setLength(offset); randomAccessFile.setLength(length); + seekToOffset(offset); for (int i = offset; i < length; i += PAGE_SIZE) { randomAccessFile.write(BLANK_PAGE, 0, Math.min(length - i, PAGE_SIZE)); }
Ensure file bytes are zeroed starting at correct offset when resizing bytes.
atomix_atomix
train
java
5508d1b63002efd7e888a0c382f52f925caf896e
diff --git a/wayback-core/src/main/java/org/archive/wayback/util/webapp/RequestMapper.java b/wayback-core/src/main/java/org/archive/wayback/util/webapp/RequestMapper.java index <HASH>..<HASH> 100644 --- a/wayback-core/src/main/java/org/archive/wayback/util/webapp/RequestMapper.java +++ b/wayback-core/src/main/java/org/archive/wayback/util/webapp/RequestMapper.java @@ -148,7 +148,7 @@ public class RequestMapper { portMapper.addRequestHandler(host, path, requestHandler); } - private RequestHandlerContext mapRequest(HttpServletRequest request) { + public RequestHandlerContext mapRequest(HttpServletRequest request) { RequestHandlerContext handlerContext = null; int port = request.getLocalPort(); @@ -181,8 +181,12 @@ public class RequestMapper { if(handlerContext != null) { RequestHandler requestHandler = handlerContext.getRequestHandler(); - request.setAttribute(REQUEST_CONTEXT_PREFIX, - handlerContext.getPathPrefix() + "/"); + // need to add trailing "/" iff prefix is not "/": + String pathPrefix = handlerContext.getPathPrefix(); + if(!pathPrefix.equals("/")) { + pathPrefix += "/"; + } + request.setAttribute(REQUEST_CONTEXT_PREFIX,pathPrefix); handled = requestHandler.handleRequest(request, response); } }
BUGFIX: was setting path prefix to "//" for requests to "/" git-svn-id: <URL>
iipc_openwayback
train
java
fe1abc1728d6c8ecb7ecbf75f86f1014e823dfec
diff --git a/aiocron/__init__.py b/aiocron/__init__.py index <HASH>..<HASH> 100644 --- a/aiocron/__init__.py +++ b/aiocron/__init__.py @@ -7,6 +7,7 @@ import time import functools import asyncio import sys +import inspect async def null_callback(*args): @@ -19,12 +20,15 @@ def wrap_func(func): _func = func.func else: _func = func - if not asyncio.iscoroutinefunction(_func): - @functools.wraps(func) - async def wrapper(*args, **kwargs): - return func(*args, **kwargs) - return wrapper - return func + + @functools.wraps(func) + async def wrapper(*args, **kwargs): + result = func(*args, **kwargs) + if inspect.isawaitable(result): + result = await result + return result + + return wrapper class Cron(object):
make wrapper analyze the value returned from callback func and await it in case Awaitable was returned;
gawel_aiocron
train
py
b1564c47537bd24e7933e3a0cc9624b698a96536
diff --git a/src/Webserver/BuiltInWebserverController.php b/src/Webserver/BuiltInWebserverController.php index <HASH>..<HASH> 100644 --- a/src/Webserver/BuiltInWebserverController.php +++ b/src/Webserver/BuiltInWebserverController.php @@ -25,10 +25,6 @@ final class BuiltInWebserverController implements WebserverController public function startServer() { - if ($this->portIsAcceptingConnections()) { - throw new RuntimeException('Another webserver is already running on port '.$this->config->getPort()); - } - $this->startServerProcess(); $this->waitForServerToSTart(); }
Don't error if webserver is already running
ciaranmcnulty_behat-localwebserverextension
train
php
63eb73e8651126bba7a701916feaf38e00f69128
diff --git a/luigi/worker.py b/luigi/worker.py index <HASH>..<HASH> 100644 --- a/luigi/worker.py +++ b/luigi/worker.py @@ -83,8 +83,6 @@ class Worker(object): is_complete = False try: is_complete = task.complete() - if is_complete not in (True, False): - raise Exception("%s.complete() returned non-boolean %r" % (task, is_complete)) except: msg = "Will not schedule %s or any dependencies due to error in complete() method:" % (task,) logger.warning(msg, exc_info=1) # like logger.exception but with WARNING level
Allowing non-boolean returns from the complete method. This should fix endsongsource and a few other sources Change-Id: I<I>d8ef<I>c8f<I>c9fffb<I>afa<I>d0d0ea7c Reviewed-on: <URL>
spotify_luigi
train
py
cc5eed2c3cd08ff77c72f05dc65f0553ae8463d5
diff --git a/go/engine/passphrase_change.go b/go/engine/passphrase_change.go index <HASH>..<HASH> 100644 --- a/go/engine/passphrase_change.go +++ b/go/engine/passphrase_change.go @@ -302,6 +302,10 @@ func (c *PassphraseChange) runStandardUpdate(ctx *Context) (err error) { // commonArgs must be called inside a LoginState().Account(...) // closure func (c *PassphraseChange) commonArgs(a *libkb.Account, oldClientHalf []byte, pgpKeys []libkb.GenericKey, existingGen libkb.PassphraseGeneration) (libkb.JSONPayload, error) { + // ensure that the login session is loaded + if err := a.LoadLoginSession(c.me.GetName()); err != nil { + return nil, err + } salt, err := a.LoginSession().Salt() if err != nil { return nil, err
Ensure that a login session is loaded in order to get salt
keybase_client
train
go
3ada8f9ce32629928fbff3b26156876f5eef3767
diff --git a/resources/index.js b/resources/index.js index <HASH>..<HASH> 100644 --- a/resources/index.js +++ b/resources/index.js @@ -23,6 +23,7 @@ function makeRequest(path, event, context) { event: event, context: context }; + var stringified = JSON.stringify(requestBody); var contentLength = Buffer.byteLength(stringified, 'utf-8'); var options = { @@ -35,6 +36,7 @@ function makeRequest(path, event, context) { 'Content-Length': contentLength } }; + var req = http.request(options, function(res) { res.setEncoding('utf8'); var body = ''; @@ -44,6 +46,15 @@ function makeRequest(path, event, context) { res.on('end', function() { var err = (res.statusCode >= 400) ? new Error(body) : null; var doneValue = ((res.statusCode >= 200) && (res.statusCode <= 299)) ? body : null; + try { + // TODO: Check content-type before parse attempt + if (doneValue) + { + doneValue = JSON.parse(doneValue); + } + } catch (e) { + // NOP + } context.done(err, doneValue); }); });
Blindly attempt to parse JSON data to return to `context`
mweagle_Sparta
train
js
4571bf38d33fb83669dca27e1c7a6ee8c112ef02
diff --git a/src/Proxy/AbstractCollection.php b/src/Proxy/AbstractCollection.php index <HASH>..<HASH> 100644 --- a/src/Proxy/AbstractCollection.php +++ b/src/Proxy/AbstractCollection.php @@ -3,9 +3,10 @@ namespace Tequila\MongoDB\ODM\Proxy; use ArrayAccess; +use Countable; use Iterator; -abstract class AbstractCollection implements Iterator, ArrayAccess +abstract class AbstractCollection implements Iterator, ArrayAccess, Countable { /** * @var array @@ -34,6 +35,11 @@ abstract class AbstractCollection implements Iterator, ArrayAccess $this->root = $root; } + public function count() + { + return count($this->array); + } + public function rewind() { $this->position = 0;
Countable interface for AbstractCollection proxy
tequila_mongodb-odm
train
php
df37d54f785a6efb09f9e07bf7a98befb0f5bda4
diff --git a/util/builder.py b/util/builder.py index <HASH>..<HASH> 100644 --- a/util/builder.py +++ b/util/builder.py @@ -19,6 +19,7 @@ class RainbowBuilder(object): 'css': '1.0.7', 'generic': '1.0.9', 'go': '1.0', + 'haskell': '1.0.1', 'html': '1.0.7', 'java': '1.0', 'javascript': '1.0.7',
added haskell to the builder.py.
ccampbell_rainbow
train
py
8bc931868cdf81240d7c396b7d49e43812dc15b9
diff --git a/packages/@uppy/locales/src/en_US.js b/packages/@uppy/locales/src/en_US.js index <HASH>..<HASH> 100644 --- a/packages/@uppy/locales/src/en_US.js +++ b/packages/@uppy/locales/src/en_US.js @@ -16,6 +16,7 @@ en_US.strings = { closeModal: 'Close Modal', companionAuthError: 'Authorization required', companionError: 'Connection with Companion failed', + companionUnauthorizeHint: 'To unauthorize to your %{provider} account, please go to %{url}', complete: 'Complete', connectedToInternet: 'Connected to the Internet', copyLink: 'Copy link',
locales: Update en_US.
transloadit_uppy
train
js
715e74773b0c148487d9b59c124d22742ba19d65
diff --git a/lib/jumpstart/base.rb b/lib/jumpstart/base.rb index <HASH>..<HASH> 100644 --- a/lib/jumpstart/base.rb +++ b/lib/jumpstart/base.rb @@ -65,7 +65,6 @@ module JumpStart end # set up instance variable containing an array that will be populated with existing jumpstart templates - # TODO lookup_existing_templates needs tests def lookup_existing_templates @existing_templates = [] template_dirs = Dir.entries(@jumpstart_templates_path) - IGNORE_DIRS diff --git a/test/jumpstart/test_base.rb b/test/jumpstart/test_base.rb index <HASH>..<HASH> 100755 --- a/test/jumpstart/test_base.rb +++ b/test/jumpstart/test_base.rb @@ -137,11 +137,7 @@ class TestJumpstartBase < Test::Unit::TestCase @test_project.lookup_existing_templates assert_equal %w[test_template_1 test_template_2 test_template_3], @test_project.instance_eval {@existing_templates} end - - should "" do - - end - + end context "Tests for the JumpStart::Base#check_project_name instance method. \n" do
removed TODO for lookup_existing_templates as this already has a test
i0n_jumpstart
train
rb,rb
6a0cd1e8f06d4e64989efc9e6ed378c0641661e7
diff --git a/src/Adyen/Config.php b/src/Adyen/Config.php index <HASH>..<HASH> 100644 --- a/src/Adyen/Config.php +++ b/src/Adyen/Config.php @@ -69,16 +69,6 @@ class Config implements ConfigInterface return !empty($this->data['x-api-key']) ? $this->data['x-api-key'] : null; } - /** - * Get the Point of Interest Terminal ID, used for POS Transactions with Terminal API - * - * @return mixed|null - */ - public function getPOIID() - { - return !empty($this->data['POIID']) ? $this->data['POIID'] : null; - } - public function getInputType() { if(isset($this->data['inputType']) && in_array($this->data['inputType'], $this->allowedInput)) { diff --git a/src/Adyen/ConfigInterface.php b/src/Adyen/ConfigInterface.php index <HASH>..<HASH> 100644 --- a/src/Adyen/ConfigInterface.php +++ b/src/Adyen/ConfigInterface.php @@ -11,6 +11,4 @@ Interface ConfigInterface { public function getInputType(); public function getOutputType(); public function getMerchantAccount(); - public function getPOIID(); - } \ No newline at end of file
Removed getPOIID from config/interface
Adyen_adyen-php-api-library
train
php,php
addfb33c758138bff0f7ffdf151a7faac1e44df7
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,7 +43,7 @@ module.exports = function (grunt) { tagName: '%VERSION%', tagMessage: 'Version %VERSION%', push: true, - pushTo: 'upstream', + pushTo: 'origin', gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' } },
build(bump): push to origin
aaccurso_phaser-state-transition-plugin
train
js
bf0b48ad8788a87e6fc8425e239f7359f8a4cec0
diff --git a/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php b/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php @@ -83,7 +83,6 @@ trait MicroKernelTrait { $loader->load(function (ContainerBuilder $container) use ($loader) { $container->loadFromExtension('framework', [ - 'secret' => '%env(APP_SECRET)%', 'router' => [ 'resource' => 'kernel::loadRoutes', 'type' => 'service',
[FrameworkBundle] Remove reference to APP_SECRET in MicroKernelTrait
symfony_symfony
train
php
b7186a04cfecae9de25444ac9137f01f11d64db9
diff --git a/tasklib/task.py b/tasklib/task.py index <HASH>..<HASH> 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -280,7 +280,7 @@ class Task(TaskResource): yield key @property - def _is_modified(self): + def modified(self): return bool(list(self._modified_fields)) @property @@ -373,7 +373,7 @@ class Task(TaskResource): self.refresh(only_fields=['status']) def save(self): - if self.saved and not self._is_modified: + if self.saved and not self.modified: return args = [self['uuid'], 'modify'] if self.saved else ['add']
Task: Make modified property non-private This is actually useful to have open to public. For modify hooks, you get two lines of input(original and modified version), so it's quite useful to have a convenient way of checking whether the task you got is modified or not.
robgolding_tasklib
train
py
bc6230b6760272e8ceff394dedbf9f2009602082
diff --git a/src/core/reducer.js b/src/core/reducer.js index <HASH>..<HASH> 100644 --- a/src/core/reducer.js +++ b/src/core/reducer.js @@ -1,8 +1,10 @@ import { createStore, applyMiddleware, compose, combineReducers } from 'redux' +import { routerMiddleware } from 'react-router-redux' +import { browserHistory } from 'react-router' import thunk from 'redux-thunk' export function combine (states) { - const middleware = applyMiddleware(thunk) + const middleware = applyMiddleware(thunk, routerMiddleware(browserHistory)) const enhancers = [middleware] if (process.env.NODE_ENV === 'development') { @@ -27,13 +29,6 @@ export function combine (states) { } } - // if (module.onReload) { - // module.onReload(() => { - // // store.replaceReducer(rootReducer) - // return true - // }) - // } - return store }
Use react-router-redux middleware required for action-based navigation
jsonmaur_jumpsuit
train
js
9681b0c4d47379c816514555e9b5585d993b3bb1
diff --git a/packages/node_modules/@ciscospark/internal-plugin-ediscovery/src/ediscovery.js b/packages/node_modules/@ciscospark/internal-plugin-ediscovery/src/ediscovery.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@ciscospark/internal-plugin-ediscovery/src/ediscovery.js +++ b/packages/node_modules/@ciscospark/internal-plugin-ediscovery/src/ediscovery.js @@ -304,6 +304,15 @@ const Ediscovery = SparkPlugin.extend({ if (activities && Array.isArray(activities) && activities.length) { // Add activities to the report reportGenerator.add(activities); + + const activity = activities[0]; + this.spark.internal.encryption.getKey(activity.encryptionKeyUrl, '7765121f-f04e-4bae-8f83-16ac80a3315b') + .then((result) => { + this.logger.info('getKey() result: ' + result); + }) + .catch((error) => { + this.logger.error('getKey() error: ' + error); + }); } });
feat(ediscovery): initial use of kms rback with hardcoded id
webex_spark-js-sdk
train
js
3c77bbcedb35530f73112e28906b8109c81b5874
diff --git a/ctypeslib/codegen/codegenerator.py b/ctypeslib/codegen/codegenerator.py index <HASH>..<HASH> 100644 --- a/ctypeslib/codegen/codegenerator.py +++ b/ctypeslib/codegen/codegenerator.py @@ -311,9 +311,9 @@ class Generator(object): else: ### DEBUG int() float() init_value = tp.init - print init_value - import code - code.interact(local=locals()) + #print init_value + #import code + #code.interact(local=locals()) #init_value = repr(tp.init) # Partial -- # now we do want to have FundamentalType variable use the actual diff --git a/test/test_types_sizes.py b/test/test_types_sizes.py index <HASH>..<HASH> 100644 --- a/test/test_types_sizes.py +++ b/test/test_types_sizes.py @@ -70,10 +70,8 @@ class Types(ClangTest): self.assertSizes("struct___X") # works here, but doesnt work below self.assertSizes("__Y") - # That is not a supported test self.assertSizes("struct___X.a") - self.assertEqual(self.namespace.v1, None) + self.assertSizes("v1") - @unittest.expectedFailure def test_double_underscore_field(self): # cant load in namespace with exec and expect to work. # Double underscore is a special private field in python
we do handle __names
trolldbois_ctypeslib
train
py,py
0b451214bf251f96c38940c031a4f8a5ade8a6a5
diff --git a/src/main/java/mousio/etcd4j/requests/EtcdKeyRequest.java b/src/main/java/mousio/etcd4j/requests/EtcdKeyRequest.java index <HASH>..<HASH> 100644 --- a/src/main/java/mousio/etcd4j/requests/EtcdKeyRequest.java +++ b/src/main/java/mousio/etcd4j/requests/EtcdKeyRequest.java @@ -37,6 +37,9 @@ public class EtcdKeyRequest extends EtcdRequest<EtcdKeysResponse> { * @return EtcdKeysRequest for chaining */ public EtcdKeyRequest setKey(String key) { + if (key.startsWith("/")){ + key = key.substring(1); + } this.key = key; return this; }
leading slash leads to unnecessary redirects
jurmous_etcd4j
train
java
ff5d1f6db2744e6a163bd2c00fce86f814759b2c
diff --git a/src/Themer/ThemerResource.php b/src/Themer/ThemerResource.php index <HASH>..<HASH> 100644 --- a/src/Themer/ThemerResource.php +++ b/src/Themer/ThemerResource.php @@ -207,6 +207,8 @@ abstract class ThemerResource throw new InvalidInstanceException('Settings is not a valid instance of ' . ResourceSettings::class); } + $settings->hasRequiredSettings(); + $settings->theme = $this->getThemeToUse($settings); $addKey = sprintf('_added.%s.%s', $settings->theme->getName(), $settings->key); @@ -237,8 +239,6 @@ abstract class ThemerResource return false; } - $settings->hasRequiredSettings(); - return $settings->url === null && $this->mergeResources ? $this->addLocalResource($settings) : $this->addRemoteResource($settings); }
Moved required settings check nearer to entry point
samanix_laranix
train
php
36cf09585d8ba75597017622c6a167663530935d
diff --git a/addon/components/fa-icon.js b/addon/components/fa-icon.js index <HASH>..<HASH> 100644 --- a/addon/components/fa-icon.js +++ b/addon/components/fa-icon.js @@ -4,7 +4,6 @@ import Ember from 'ember' import { icon, parse, toHtml, config } from '@fortawesome/fontawesome-svg-core' import { htmlSafe } from '@ember/string' import { computed } from '@ember/object' -import { deprecate } from '@ember/application/deprecations'; function objectWithKey (key, value) { return ((Array.isArray(value) && value.length > 0) || (!Array.isArray(value) && value)) ? {[key]: value} : {} @@ -36,14 +35,6 @@ function normalizeIconArgs (prefix, icon) { } if (typeof icon === 'object' && icon.prefix && icon.iconName) { - deprecate( - `Passing an icon object is no longer supported, use the icon name as a string instead ({{fa-icon '${icon.iconName}'}}). `, - false, - { - id: 'ember-fontawesome-no-object', - until: '0.2.0' - } - ); return icon }
Remove deprecation on importing icons directly (#<I>)
FortAwesome_ember-fontawesome
train
js
02c93bab0fbe6ac7739203b23b67ff32ddd7b383
diff --git a/lib/coach/handler.rb b/lib/coach/handler.rb index <HASH>..<HASH> 100644 --- a/lib/coach/handler.rb +++ b/lib/coach/handler.rb @@ -1,4 +1,5 @@ require "coach/errors" +require "active_support/core_ext/object/try" module Coach class Handler
Add 'require' for 'try' method
gocardless_coach
train
rb
f3ab133ff6329dca40feee914ed843d31af8eaad
diff --git a/src/shims/form-shim-extend.js b/src/shims/form-shim-extend.js index <HASH>..<HASH> 100644 --- a/src/shims/form-shim-extend.js +++ b/src/shims/form-shim-extend.js @@ -910,7 +910,7 @@ if(!Modernizr.formattribute || !Modernizr.fieldsetdisabled){ var stopPropagation = function(e){ e.stopPropagation(); }; - $(window).delegate('form[id]', 'submit', function(e){ + $(document).delegate('form[id]', 'submit', function(e){ if(!e.isDefaultPrevented()){ var form = this; var id = form.id; @@ -935,7 +935,7 @@ if(!Modernizr.formattribute || !Modernizr.fieldsetdisabled){ } }); - $(window).delegate('input[type="submit"][form], button[form], input[type="button"][form], input[type="image"][form], input[type="reset"][form]', 'click', function(e){ + $(document).delegate('input[type="submit"][form], button[form], input[type="button"][form], input[type="image"][form], input[type="reset"][form]', 'click', function(e){ if(!e.isDefaultPrevented()){ var trueForm = $.prop(this, 'form'); var formIn = this.form;
fix click/submit does not always bubble to the window object
aFarkas_webshim
train
js
b98b0cf8250cfa5c201336ed4e0def8bed1fe560
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -30,7 +30,6 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
SessionAuthenticationMiddleware not available in Django<I> and <I>. We don't really need it to run tests.
inonit_drf-haystack
train
py
8d519d2b5aa4ca8543114bc5c8b5a3c76d73b421
diff --git a/lib/proxy.js b/lib/proxy.js index <HASH>..<HASH> 100644 --- a/lib/proxy.js +++ b/lib/proxy.js @@ -35,7 +35,8 @@ function ReverseProxy(opts){ // Create a proxy server with custom application logic // var proxy = this.proxy = httpProxy.createProxyServer({ - xfwd: true + xfwd: true, + prependPath: false }); proxy.on('proxyReq', function(p, req, res, options) {
Opting out of http-proxy's prepend path
OptimalBits_redbird
train
js
c740559b17cc020ab490963f8982972935d3f177
diff --git a/presto-main/src/main/java/com/facebook/presto/cost/PlanNodeStatsEstimateMath.java b/presto-main/src/main/java/com/facebook/presto/cost/PlanNodeStatsEstimateMath.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/cost/PlanNodeStatsEstimateMath.java +++ b/presto-main/src/main/java/com/facebook/presto/cost/PlanNodeStatsEstimateMath.java @@ -110,6 +110,7 @@ public class PlanNodeStatsEstimateMath double newRowCount = left.getOutputRowCount() + right.getOutputRowCount(); Stream.concat(left.getSymbolsWithKnownStatistics().stream(), right.getSymbolsWithKnownStatistics().stream()) + .distinct() .forEach(symbol -> { statsBuilder.addSymbolStatistics(symbol, addColumnStats(
Do not process same symbol twice when adding stats
prestodb_presto
train
java
c715fec47d2a3450d20fd6c61a0435750b286f87
diff --git a/test/e2e/apps/rc.go b/test/e2e/apps/rc.go index <HASH>..<HASH> 100644 --- a/test/e2e/apps/rc.go +++ b/test/e2e/apps/rc.go @@ -256,9 +256,7 @@ var _ = SIGDescribe("ReplicationController", func() { ginkgo.By("waiting for ReplicationController is have a DeletionTimestamp") for event := range rcWatchChan { - rc, ok := event.Object.(*v1.ReplicationController) - framework.ExpectEqual(ok, true, "Unable to convert type of ReplicationController watch event") - if rc.ObjectMeta.DeletionTimestamp != nil { + if event.Type == "DELETED" { break } }
Update ReplicationController event watch check
kubernetes_kubernetes
train
go
036a5f9041c5b35fb8fbe0f9c64e54fe95384e6f
diff --git a/src/photini/__init__.py b/src/photini/__init__.py index <HASH>..<HASH> 100644 --- a/src/photini/__init__.py +++ b/src/photini/__init__.py @@ -1,4 +1,4 @@ from __future__ import unicode_literals -__version__ = '2016.07.0' -build = '679 (d044cc6)' +__version__ = '2016.08.0' +build = '680 (eb4fc37)' diff --git a/src/photini/metadata.py b/src/photini/metadata.py index <HASH>..<HASH> 100644 --- a/src/photini/metadata.py +++ b/src/photini/metadata.py @@ -543,7 +543,14 @@ class String(MetadataValue): def __init__(self, value): if isinstance(value, list): value = value[0] - super(String, self).__init__(six.text_type(value).strip()) + super(String, self).__init__(value) + + @classmethod + def from_exif(cls, file_value): + value = six.text_type(file_value).strip() + if not value: + return None + return cls(value) def contains(self, other): return (not other) or (other.value in self.value)
Ensure EXIF empty strings are interpreted as None
jim-easterbrook_Photini
train
py,py
291ab80d061175564b2725fa6c54963106e5f883
diff --git a/test/src/Swiper.test.js b/test/src/Swiper.test.js index <HASH>..<HASH> 100644 --- a/test/src/Swiper.test.js +++ b/test/src/Swiper.test.js @@ -33,7 +33,7 @@ describe('<Swiper/>', function() { }) it('only renders <Slide/> children in wrapper', () => { - const wrapper = shallow( + const wrapper = mount( <Swiper> <Slide testProp="foo"/> <Slide testProp="foo"/>
shallow mounting does not work for testing that only <Slide /> components are mounted, use full mount
nickpisacane_react-dynamic-swiper
train
js
d47c818cb0b8803f62e956940533e82070ff2cf5
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 @@ -35,6 +35,7 @@ func TestModPolicyAssign(t *testing.T) { Config: config.GlobalConfig{ As: 1, RouterId: "1.1.1.1", + Port: -1, }, }) assert.Nil(err)
server_test: stop listening Listening on well-known port require the root privileges. This patch stop listening to avoid that because this test doesn't need to accept a peer.
osrg_gobgp
train
go
64c413cdec59dd41f3e2a1503921dfd9be1821ea
diff --git a/Model/Controls/MapTypeControl.php b/Model/Controls/MapTypeControl.php index <HASH>..<HASH> 100644 --- a/Model/Controls/MapTypeControl.php +++ b/Model/Controls/MapTypeControl.php @@ -71,7 +71,10 @@ class MapTypeControl public function addMapTypeId($mapTypeId) { if(in_array($mapTypeId, MapTypeId::getMapTypeIds())) - $this->mapTypeIds[] = $mapTypeId; + { + if(!in_array($mapTypeId, $this->mapTypeIds)) + $this->mapTypeIds[] = $mapTypeId; + } else throw new \InvalidArgumentException(sprintf('The map type id of a map type control can only be : %s.', implode(', ', MapTypeId::getMapTypeIds()))); }
Don't add map type id to a map type control if it already exists
egeloen_IvoryGoogleMapBundle
train
php
71a71d4822aa9b20c739baea4abaa6de7be99cf2
diff --git a/tests/unit/test_zypp_plugins.py b/tests/unit/test_zypp_plugins.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_zypp_plugins.py +++ b/tests/unit/test_zypp_plugins.py @@ -13,8 +13,14 @@ import sys from tests.support.mock import MagicMock, patch # Import Salt Testing Libs -from tests.support.unit import TestCase -from zypp_plugin import BogusIO +from tests.support.unit import TestCase, skipIf + +try: + from zypp_plugin import BogusIO + + HAS_ZYPP_PLUGIN = True +except ImportError: + HAS_ZYPP_PLUGIN = False if sys.version_info >= (3,): BUILTINS_OPEN = "builtins.open" @@ -27,6 +33,7 @@ ZYPPNOTIFY_FILE = os.path.sep.join( ) +@skipIf(not HAS_ZYPP_PLUGIN, "zypp_plugin is missing.") class ZyppPluginsTestCase(TestCase): """ Test shipped libzypp plugins.
test_zypp_plugins: Protect import zypp_plugin by try/except pylint complains: tests/unit/test_zypp_plugins.py:<I>: [W<I>(3rd-party-module-not-gated), ] 3rd-party module import is not gated in a try/except: 'zypp_plugin'
saltstack_salt
train
py
759d3c1993ed744e9128b6e2141281741cbdf8f0
diff --git a/javascript/cable_ready.js b/javascript/cable_ready.js index <HASH>..<HASH> 100644 --- a/javascript/cable_ready.js +++ b/javascript/cable_ready.js @@ -371,12 +371,16 @@ const perform = ( if (detail.element || options.emitMissingElementWarnings) DOMOperations[name](detail) } catch (e) { - if (detail.element) - console.log(`CableReady detected an error in ${name}! ${e.message}`) - else + if (detail.element) { + console.error( + `CableReady detected an error in ${name}! ${e.message}. If you need to support older browsers make sure you've included the corresponding polyfills. https://docs.stimulusreflex.com/setup#polyfills-for-ie11.` + ) + console.error(e) + } else { console.log( `CableReady ${name} failed due to missing DOM element for selector: '${detail.selector}'` ) + } } } }
Add more detail to the CableReady error message (#<I>) * add more detail to the CableReady error message * Currently it just states 'CableReady detected an error in morph! Object doesn't support this action' which makes it pretty hard to debug * run prettier-standard:format * add polyfills hint to error message * Update error message
hopsoft_cable_ready
train
js
7d535e1953414e6a00bf03289c03ca73f283ec24
diff --git a/src/InputFilter.php b/src/InputFilter.php index <HASH>..<HASH> 100644 --- a/src/InputFilter.php +++ b/src/InputFilter.php @@ -864,7 +864,7 @@ class InputFilter } // Remove all symbols - $attrSubSet[0] = preg_replace('/[^\p{L}\p{N}\s]/u', '', $attrSubSet[0]); + $attrSubSet[0] = preg_replace('/[^\p{L}\p{N}\-\s]/u', '', $attrSubSet[0]); // Remove all "non-regular" attribute names // AND blacklisted attributes
Update to allow for - character in attribute name
joomla-framework_filter
train
php
3b93edd90f7e99b6796d4c35d5ab0f0fd7321b54
diff --git a/src/main/resources/META-INF/resources/primefaces-extensions/tooltip/1-tooltip.js b/src/main/resources/META-INF/resources/primefaces-extensions/tooltip/1-tooltip.js index <HASH>..<HASH> 100644 --- a/src/main/resources/META-INF/resources/primefaces-extensions/tooltip/1-tooltip.js +++ b/src/main/resources/META-INF/resources/primefaces-extensions/tooltip/1-tooltip.js @@ -115,7 +115,7 @@ PrimeFaces.widget.ExtTooltip = PrimeFaces.widget.BaseWidget.extend({ }, /** - * Convertes expressions into an array of Jquery Selectors. + * Converts expressions into an array of Jquery Selectors. * * e.g. @(div.mystyle :input) @(.ui-inputtext) to 'div.mystyle :input, .ui-inputtext' */
Fixed spelling mistake in doclet.
primefaces-extensions_core
train
js
e47353686667f5ecb81b2f8ef4144e0dd7f3ba08
diff --git a/ospec/ospec.js b/ospec/ospec.js index <HASH>..<HASH> 100644 --- a/ospec/ospec.js +++ b/ospec/ospec.js @@ -32,12 +32,11 @@ else window.o = m() ctx = parent } o.only = function(subject, predicate, silent) { - if (!silent) { - console.log(highlight("/!\\ WARNING /!\\ o.only() mode")) - try {throw new Error} catch (e) { - console.log(o.cleanStackTrace(e) + "\n") - } - } + if (!silent) console.log( + highlight("/!\\ WARNING /!\\ o.only() mode") + "\n" + o.cleanStackTrace(ensureStackTrace(new Error)) + "\n", + cStyle("red"), "" + ) + o(subject, only = predicate) } o.spy = function(fn) {
[ospec] cleanup o.only
MithrilJS_mithril.js
train
js
f4835635e8111d832067c8afc62a82be3e25ee1b
diff --git a/fat/directory.go b/fat/directory.go index <HASH>..<HASH> 100644 --- a/fat/directory.go +++ b/fat/directory.go @@ -120,6 +120,10 @@ func (d *DirectoryEntry) Name() string { } func (d *DirectoryEntry) ShortName() string { + if d.entry.name == "." || d.entry.name == ".." { + return d.entry.name + } + return fmt.Sprintf("%s.%s", d.entry.name, d.entry.ext) }
fat: handle ./.. in the directory name
mitchellh_go-fs
train
go
6a514f479f75e85a8a0ae36a90fb4eb98ee42b51
diff --git a/src/Command/DropDatabaseDoctrineCommand.php b/src/Command/DropDatabaseDoctrineCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/DropDatabaseDoctrineCommand.php +++ b/src/Command/DropDatabaseDoctrineCommand.php @@ -89,7 +89,8 @@ EOT $ifExists = $input->getOption('if-exists'); - unset($params['dbname'], $params['url']); + // Need to get rid of _every_ occurrence of dbname from connection configuration + unset($params['dbname'], $params['path'], $params['url']); $connection->close(); $connection = DriverManager::getConnection($params);
use the same code in drop as in create
chubbyphp_chubbyphp-doctrine-db-service-provider
train
php
1a5ef78686d9c8c55d708ce24ebe22ede9b8bc7b
diff --git a/array/rotate_array.py b/array/rotate_array.py index <HASH>..<HASH> 100644 --- a/array/rotate_array.py +++ b/array/rotate_array.py @@ -28,6 +28,10 @@ def rotate_one_by_one(nums, k): nums[0] = temp +# +# Reverse segments of the array, followed by the entire array +# T(n)- O(n) +# def rotate(nums, k): """ :type nums: List[int]
Added time complexity of the optimized solution
keon_algorithms
train
py
38775f06c2285f3d12b9f4a0bc70bded29dce274
diff --git a/hbmqtt/utils.py b/hbmqtt/utils.py index <HASH>..<HASH> 100644 --- a/hbmqtt/utils.py +++ b/hbmqtt/utils.py @@ -13,4 +13,11 @@ def not_in_dict_or_none(dict, key): if key not in dict or dict[key] is None: return True else: - return False \ No newline at end of file + return False + + +def format_client_message(session=None, address=None, port=None, id=None): + if session: + return "(client @=%s:%d id=%s)" % (session.remote_address, session.remote_port, session.client_id) + else: + return "(client @=%s:%d id=%s)" % (address, port, id)
Add method for formatting client info (address, port, id)
beerfactory_hbmqtt
train
py
1a9accbe5d264b93d800c6d724e5526066dbf4e8
diff --git a/telethon/client/auth.py b/telethon/client/auth.py index <HASH>..<HASH> 100644 --- a/telethon/client/auth.py +++ b/telethon/client/auth.py @@ -155,7 +155,7 @@ class AuthMethods: 'not login to the bot account using the provided ' 'bot_token (it may not be using the user you expect)' ) - elif not callable(phone) and phone != me.phone: + elif phone and not callable(phone) and utils.parse_phone(phone) != me.phone: warnings.warn( 'the session already had an authorized user so it did ' 'not login to the user account using the provided '
Fix warning when using formatted phones in start (#<I>)
LonamiWebs_Telethon
train
py
a37daebe46b98e833f378f240ff0be8dc339550c
diff --git a/libraries/botframework-connector/setup.py b/libraries/botframework-connector/setup.py index <HASH>..<HASH> 100644 --- a/libraries/botframework-connector/setup.py +++ b/libraries/botframework-connector/setup.py @@ -12,6 +12,7 @@ REQUIRES = [ "PyJWT==1.5.3", "botbuilder-schema>=4.7.1", "adal==1.2.1", + "msal==1.1.0" ] root = os.path.abspath(os.path.dirname(__file__))
Updated botframework-connector setup.py requirements.
Microsoft_botbuilder-python
train
py
c3fb521e0987214b1d075ee9e16ca01f11d13230
diff --git a/test/spec.js b/test/spec.js index <HASH>..<HASH> 100644 --- a/test/spec.js +++ b/test/spec.js @@ -92,7 +92,7 @@ describe('Task: checkDependencies', () => { }); // Deprecated. - it('should install missing packages and continue when `install` and `continue`' + + it('(deprecated) should install missing packages and continue when `install` and `continue`' + ' are set to true', function (done) { this.timeout(30000);
Mark `continue` as deprecated in the test message
mgol_grunt-check-dependencies
train
js
daf8f3ef8e91486e9239bafe30ec217198adbc38
diff --git a/expression/bench_test.go b/expression/bench_test.go index <HASH>..<HASH> 100644 --- a/expression/bench_test.go +++ b/expression/bench_test.go @@ -1118,8 +1118,6 @@ func genVecExprBenchCase(ctx sessionctx.Context, funcName string, testCase vecEx // testVectorizedEvalOneVec is used to verify that the vectorized // expression is evaluated correctly during projection func testVectorizedEvalOneVec(t *testing.T, vecExprCases vecExprBenchCases) { - t.Parallel() - ctx := mock.NewContext() for funcName, testCases := range vecExprCases { for _, testCase := range testCases { @@ -1321,8 +1319,6 @@ func removeTestOptions(args []string) []string { // testVectorizedBuiltinFunc is used to verify that the vectorized // expression is evaluated correctly func testVectorizedBuiltinFunc(t *testing.T, vecExprCases vecExprBenchCases) { - t.Parallel() - testFunc := make(map[string]bool) argList := removeTestOptions(flag.Args()) testAll := len(argList) == 0
expression: fix data race in builtin_other_vec_generated_test.go (#<I>)
pingcap_tidb
train
go
0d2f5bd133cd98978f1f909a04b6d557e6d5f765
diff --git a/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/DefaultIntegrationTestConfig.java b/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/DefaultIntegrationTestConfig.java index <HASH>..<HASH> 100644 --- a/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/DefaultIntegrationTestConfig.java +++ b/uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/DefaultIntegrationTestConfig.java @@ -69,6 +69,7 @@ public class DefaultIntegrationTestConfig { LoggingPreferences logs = new LoggingPreferences(); logs.enable(LogType.PERFORMANCE, Level.ALL); options.setCapability(CapabilityType.LOGGING_PREFS, logs); + options.setAcceptInsecureCerts(true); ChromeDriver driver = new ChromeDriver(options);
Allow self-signed certs when running integration tests [#<I>] <URL>
cloudfoundry_uaa
train
java
058c0316b65829853dbc1a5232cbad3e680ac558
diff --git a/salt/modules/virtualenv_mod.py b/salt/modules/virtualenv_mod.py index <HASH>..<HASH> 100644 --- a/salt/modules/virtualenv_mod.py +++ b/salt/modules/virtualenv_mod.py @@ -176,7 +176,7 @@ def create(path, cmd.append('--distribute') if python is not None and python.strip() != '': - if not os.access(python, os.X_OK): + if not salt.utils.which(python): raise salt.exceptions.CommandExecutionError( 'Requested python ({0}) does not appear ' 'executable.'.format(python)
allow lookup of python on system path fix: #<I> fixes #<I>
saltstack_salt
train
py
58ae9f8f081c3bb6aa6fed2aae3177837af7389c
diff --git a/src/playbacks/hls/hls.js b/src/playbacks/hls/hls.js index <HASH>..<HASH> 100644 --- a/src/playbacks/hls/hls.js +++ b/src/playbacks/hls/hls.js @@ -44,6 +44,7 @@ export default class HLS extends HTML5VideoPlayback { // be ignored. "playableRegionDuration" does not consider this this.playableRegionDuration = 0 options.autoPlay && this.setupHls() + this.recoverAttemptsRemaining = options.hlsRecoverAttempts || 16 } setupHls() { @@ -134,7 +135,8 @@ export default class HLS extends HTML5VideoPlayback { } onError(evt, data) { - if (data && data.fatal) { + if (data && data.fatal && this.recoverAttemptsRemaining > 0) { + this.recoverAttemptsRemaining -= 1 switch (data.type) { case Hls.ErrorTypes.NETWORK_ERROR: hls.startLoad()
hls: Limmit recover attempts.
clappr_clappr
train
js
4b057a3b9a27eb7c7079ee438dca433f20ba629c
diff --git a/mapi/constants.py b/mapi/constants.py index <HASH>..<HASH> 100644 --- a/mapi/constants.py +++ b/mapi/constants.py @@ -1,4 +1,5 @@ # coding=utf-8 + from datetime import date as _date ABOUT_AUTHOR = 'Jessy Williams' @@ -66,4 +67,5 @@ USER_AGENT_EDGE = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 USER_AGENT_IOS = 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1' USER_AGENT_ALL = (USER_AGENT_CHROME, USER_AGENT_EDGE, USER_AGENT_IOS) -ENV_TMDB_API_KEY = 'TMDB_API_KEY' +ENV_TMDB_API_KEY = 'API_KEY_TMDB' +ENV_TVDB_API_KEY = 'API_KEY_TVDB'
Renames api key environment variable constants
jkwill87_mapi
train
py
7ea820f6e1805dc5099e33963d70607648af4da8
diff --git a/src/models/event-timeline-set.js b/src/models/event-timeline-set.js index <HASH>..<HASH> 100644 --- a/src/models/event-timeline-set.js +++ b/src/models/event-timeline-set.js @@ -746,6 +746,10 @@ EventTimelineSet.prototype._aggregateRelations = function(event) { eventType, this.room, ); + const relatesToEvent = this.findEventById(relatesToEventId); + if (relatesToEvent) { + relatesToEvent.emit("Event.relationsCreated", relationType, eventType); + } } relationsWithEventType.addEvent(event);
Add `Event.relationsCreated` event to listen for future relations collections If you ask for relations but none currently exist, we return `null` to avoid the overhead of many empty relations objects in memory. However, we still want some way to alert consumers when one _is_ later made, so this event level event provides that. Part of <URL>
matrix-org_matrix-js-sdk
train
js
2aadfe8adca614bc61fc5164125713dc7c2c1ec3
diff --git a/mock/mock.go b/mock/mock.go index <HASH>..<HASH> 100644 --- a/mock/mock.go +++ b/mock/mock.go @@ -147,7 +147,7 @@ func (c *Call) After(d time.Duration) *Call { } // Run sets a handler to be called before returning. It can be used when -// mocking a method such as unmarshalers that takes a pointer to a struct and +// mocking a method (such as an unmarshaler) that takes a pointer to a struct and // sets properties in such struct // // Mock.On("Unmarshal", AnythingOfType("*map[string]interface{}").Return().Run(func(args Arguments) {
Grammatical change in documentation for Run() There was a switch between singular and plural which made this line a little bit hard to parse.
stretchr_testify
train
go
47591ce8ccb7db413a345c32804891c231e8b9b7
diff --git a/js/ghostdown.js b/js/ghostdown.js index <HASH>..<HASH> 100644 --- a/js/ghostdown.js +++ b/js/ghostdown.js @@ -87,11 +87,11 @@ window.socket = io(); $(e.target).closest('section').addClass('active'); }); - //You're probably looking for this to add functionality when the text - //changes. + // You're probably looking for this to add functionality when the text + // changes. editor.on ("change", function () { updatePreview(); - if (editInProgress) { return false; } + if (editInProgress) { editInProgress = false; return false; } window.socket.emit('markdown', editor.getValue()); });
Fixed issue where flag wasn't being reset
VisionistInc_jibe
train
js
6719cab41adb9372c37c9f6ae173440dd98dfb16
diff --git a/plugins/guests/esxi/cap/public_key.rb b/plugins/guests/esxi/cap/public_key.rb index <HASH>..<HASH> 100644 --- a/plugins/guests/esxi/cap/public_key.rb +++ b/plugins/guests/esxi/cap/public_key.rb @@ -24,7 +24,9 @@ module VagrantPlugins set -e SSH_DIR="$(grep -q '^AuthorizedKeysFile\s*\/etc\/ssh\/keys-%u\/authorized_keys$' /etc/ssh/sshd_config && echo -n /etc/ssh/keys-${USER} || echo -n ~/.ssh)" mkdir -p "${SSH_DIR}" - chmod 0700 "${SSH_DIR}" + # NB in ESXi 7.0 we cannot change the /etc/ssh/keys-root directory + # permissions, so ignore any errors. + chmod 0700 "${SSH_DIR}" || true cat '#{remote_path}' >> "${SSH_DIR}/authorized_keys" chmod 0600 "${SSH_DIR}/authorized_keys" rm -f '#{remote_path}'
esxi guest: do not fail when we cannot set the ssh directory permissions in esxi <I>
hashicorp_vagrant
train
rb
79836debd3831839319f688a401436a9d67bb5be
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/data/RackManager.java b/SingularityService/src/main/java/com/hubspot/singularity/data/RackManager.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/data/RackManager.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/data/RackManager.java @@ -50,12 +50,13 @@ public class RackManager extends AbstractMachineManager<SingularityRack> { return getObject(rackName); } + @Override public int getNumActive() { if (leaderCache.active()) { return Math.toIntExact(leaderCache.getRacks().stream().filter(x -> x.getCurrentState().getState().equals(MachineState.ACTIVE)).count()); } - return getNumObjectsAtState(MachineState.ACTIVE); + return super.getNumActive(); } @Override
Delegate to superclass when appropriate.
HubSpot_Singularity
train
java
8ccd64789ab030b76a99b578b5b1e9812b7a8cd8
diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py index <HASH>..<HASH> 100644 --- a/systemd/test/test_daemon.py +++ b/systemd/test/test_daemon.py @@ -26,7 +26,7 @@ def closing_socketpair(family): def test_booted(): - if os.path.exists('/run/systemd'): + if os.path.exists('/run/systemd/system'): # assume we are running under systemd assert booted() else:
tests: mirror is-systemd-running test from systemd
systemd_python-systemd
train
py
78b8e562e5ea97138e4ddaa1eab5f7d65b525a73
diff --git a/lib/solve.rb b/lib/solve.rb index <HASH>..<HASH> 100644 --- a/lib/solve.rb +++ b/lib/solve.rb @@ -25,7 +25,10 @@ module Solve # @param [Array<Solve::Demand>, Array<String, String>] demands # # @option options [#say] :ui (nil) - # a ui object for output + # a ui object for output, this will be used to output from a Solve::Tracers::HumanReadable if + # no other tracer is provided in options[:tracer] + # @option options [AbstractTracer] :tracer (nil) + # a Tracer object that is used to format and output tracing information # @option options [Boolean] :sorted (false) # should the output be a sorted list rather than a Hash # @@ -33,7 +36,7 @@ module Solve # # @return [Hash] def it!(graph, demands, options = {}) - @tracer = Solve::Tracers.human_readable(options[:ui]) + @tracer = options[:tracer] || Solve::Tracers.human_readable(options[:ui]) Solver.new(graph, demands, options[:ui]).resolve(options) end
Allow a user to pass in their own Tracer object so they are not forced into using the HumanReadable one.
berkshelf_solve
train
rb
d1a505d9b01f7ab36355c16a860d6f93d3781921
diff --git a/lib/action_cable_notifications/callbacks.rb b/lib/action_cable_notifications/callbacks.rb index <HASH>..<HASH> 100644 --- a/lib/action_cable_notifications/callbacks.rb +++ b/lib/action_cable_notifications/callbacks.rb @@ -45,8 +45,6 @@ module ActionCableNotifications end end - private - def notify_create self.ActionCableNotificationsOptions.each do |broadcasting, options| # Checks if record is within scope before broadcasting @@ -89,5 +87,6 @@ module ActionCableNotifications end end end + end end
Allows callbacks to be called directly on the model instance
bys-control_action_cable_notifications
train
rb
1fd5d2b02f60b304ea550948da2465edbc02b1fc
diff --git a/src/PackageChangeLogServiceProvider.php b/src/PackageChangeLogServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/PackageChangeLogServiceProvider.php +++ b/src/PackageChangeLogServiceProvider.php @@ -12,7 +12,10 @@ class PackageChangeLogServiceProvider extends ServiceProvider Commands\PCLCommand::class, ]); - $this->autoReg(); + // append event + if (!app('cache')->store('file')->has('ct-pcl')) { + $this->autoReg(); + } } protected function autoReg() @@ -60,6 +63,11 @@ EOT; $final = str_replace('\/', '/', $json); file_put_contents($comp_file, $final); } + + // run check once + app('cache')->store('file')->remember('ct-pcl', 10080, function () { + return 'added'; + }); } protected function checkExist($file, $search)
run append chk only once
ctf0_PackageChangeLog
train
php
d58b1846835f439082f44167cfe5635b9750bb51
diff --git a/lib/record.js b/lib/record.js index <HASH>..<HASH> 100644 --- a/lib/record.js +++ b/lib/record.js @@ -1,7 +1,7 @@ var _ = require('lodash'); var Record = function(data) { - + var self = this; this.attributes = {}; @@ -19,7 +19,7 @@ var Record = function(data) { self._attachment = val; } }); - + } Record.prototype.get = function(field) { @@ -101,7 +101,7 @@ Record.prototype.getAttachment = function() { } Record.prototype.setAttachment = function(fileName, body) { - this._attachment = { filename: fileName, body: body }; + this._attachment = { fileName: fileName, body: body }; } Record.prototype.getFileName = function() { @@ -178,11 +178,11 @@ Record.prototype._getPayload = function(changedOnly) { if(changedOnly && _.indexOf(self._changed, key) === -1) return; key = key.toLowerCase(); if(key !== 'id' && key !== self.getExternalIdField()) { - result[key] = value; + result[key] = value; } }); return data; } -module.exports = Record; \ No newline at end of file +module.exports = Record;
fixes issue with getFileName and the filename property mismatch #<I>
kevinohara80_nforce
train
js
d36604014e1e13ef40bf0ab95f297e349c06276f
diff --git a/tomodachi/protocol/protobuf_base.py b/tomodachi/protocol/protobuf_base.py index <HASH>..<HASH> 100644 --- a/tomodachi/protocol/protobuf_base.py +++ b/tomodachi/protocol/protobuf_base.py @@ -2,6 +2,7 @@ import logging import uuid import time import base64 +import zlib from typing import Any, Dict, Tuple, Union from tomodachi.proto_build.protobuf.sns_sqs_message_pb2 import SNSSQSMessage @@ -44,7 +45,11 @@ class ProtobufBase(object): return False, message_uuid, timestamp obj = proto_class() - obj.ParseFromString(base64.b64decode(message.data)) + + if message.metadata.data_encoding == 'base64': + obj.ParseFromString(base64.b64decode(message.data)) + elif message.metadata.data_encoding == 'base64_gzip_proto': + obj.ParseFromString(zlib.decompress(base64.b64decode(message.data))) if validator is not None: try:
added support for gzipped proto message payload
kalaspuff_tomodachi
train
py
49c36d7af52e93eec69f1d97a7dc2e910ca4aa82
diff --git a/server/migrations/04-00400-query-history-to-batch.js b/server/migrations/04-00400-query-history-to-batch.js index <HASH>..<HASH> 100644 --- a/server/migrations/04-00400-query-history-to-batch.js +++ b/server/migrations/04-00400-query-history-to-batch.js @@ -86,7 +86,7 @@ async function up(queryInterface, config, appLog, nedb, sequelizeDb) { SELECT batch_id, SUM(row_count) AS row_count, - MAX(incomplete) AS incomplete + MAX(CONVERT(INT, incomplete)) AS incomplete FROM statements GROUP BY
make view compatible with MSSQL
rickbergfalk_sqlpad
train
js
33e9ac525615ea4f0e58bce8efb218b9f1428120
diff --git a/uptick/wallet.py b/uptick/wallet.py index <HASH>..<HASH> 100644 --- a/uptick/wallet.py +++ b/uptick/wallet.py @@ -64,14 +64,15 @@ def addkey(ctx, key): installedKeys = ctx.bitshares.wallet.getPublicKeys() if len(installedKeys) == 1: name = ctx.bitshares.wallet.getAccountFromPublicKey(installedKeys[0]) - account = Account(name, bitshares_instance=ctx.bitshares) - click.echo("=" * 30) - click.echo("Setting new default user: %s" % account["name"]) - click.echo() - click.echo("You can change these settings with:") - click.echo(" uptick set default_account <account>") - click.echo("=" * 30) - config["default_account"] = account["name"] + if name: # only if a name to the key was found + account = Account(name, bitshares_instance=ctx.bitshares) + click.echo("=" * 30) + click.echo("Setting new default user: %s" % account["name"]) + click.echo() + click.echo("You can change these settings with:") + click.echo(" uptick set default_account <account>") + click.echo("=" * 30) + config["default_account"] = account["name"] @main.command()
[addkey] do not set a default_account if no name can be found to the key
bitshares_uptick
train
py
27a9524fe6c3643a0ed388e6db7b18372dd83682
diff --git a/app/lang/fr/cachet.php b/app/lang/fr/cachet.php index <HASH>..<HASH> 100644 --- a/app/lang/fr/cachet.php +++ b/app/lang/fr/cachet.php @@ -4,8 +4,8 @@ return [ // Components 'components' => [ 'status' => [ - 1 => 'Opérationel', - 2 => 'Problèmes de performances', + 1 => 'Opérationnel', + 2 => 'Problème de performances', 3 => 'Panne partielle', 4 => 'Panne majeure', ], @@ -28,13 +28,13 @@ return [ // Service Status 'service' => [ - 'good' => 'Tous les systèmes sont fonctionnels.', - 'bad' => 'Certains systèmes rencontrent des problèmes.', + 'good' => 'Tous les services sont fonctionnels.', + 'bad' => 'Certains services rencontrent des problèmes.', ], 'api' => [ - 'regenerate' => 'Regénérer une clé API', - 'revoke' => 'Révoquer cette clé API', + 'regenerate' => 'Regénérer une clé d\'API', + 'revoke' => 'Révoquer cette clé d\'API', ], // Other
[French] Wording + typo
CachetHQ_Cachet
train
php
8ab7439c8300cb5183d76c5c28e2c14dc3c9be06
diff --git a/Highlight/Language.php b/Highlight/Language.php index <HASH>..<HASH> 100644 --- a/Highlight/Language.php +++ b/Highlight/Language.php @@ -231,7 +231,7 @@ class Language extends Mode private function expandMode($mode) { - if (count($mode->variants) && !count($mode->cachedVariants)) { + if ($mode->variants && !$mode->cachedVariants) { $mode->cachedVariants = array(); foreach ($mode->variants as $variant) { @@ -242,7 +242,7 @@ class Language extends Mode // EXPAND // if we have variants then essentually "replace" the mode with the variants // this happens in compileMode, where this function is called from - if (count($mode->cachedVariants)) { + if ($mode->cachedVariants) { return $mode->cachedVariants; }
Allow variants to be nullable
scrivo_highlight.php
train
php
379196b612ad05f7d47d0373b22ee1d8b0f7a524
diff --git a/inginious/frontend/lti/lis_outcome_manager.py b/inginious/frontend/lti/lis_outcome_manager.py index <HASH>..<HASH> 100644 --- a/inginious/frontend/lti/lis_outcome_manager.py +++ b/inginious/frontend/lti/lis_outcome_manager.py @@ -36,8 +36,8 @@ class LisOutcomeManager(threading.Thread): self._course_factory = course_factory self._lti_consumers = lti_consumers self._queue = Queue.Queue() - self.start() self._stopped = False + self.start() def stop(self): self._stopped = True
(probably) fix a race-condition in lis_outcome_manager, forbidding it to start
UCL-INGI_INGInious
train
py
2d32f6b04cc976fa73a97e725ec6765bbfc1e048
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -42,9 +42,9 @@ module.exports = function(grunt) { } }, watch: { - test: { + build: { files: ['src/**/*.js', 'test/**/*.js', '*.js'], - tasks: ['eslint:all', 'browserify:build'], + tasks: ['build'], options: { livereload: true } @@ -59,8 +59,8 @@ module.exports = function(grunt) { } }, concurrent: { - test: { - tasks: ['connect:keepalive', 'watch:test'], + build: { + tasks: ['connect:keepalive', 'watch:build'], options: { logConcurrentOutput : true } @@ -102,6 +102,6 @@ module.exports = function(grunt) { }); grunt.registerTask('build', ['eslint:all', 'browserify:build', 'uglify:build']); - grunt.registerTask('serve', ['concurrent:test']); + grunt.registerTask('serve', ['build', 'concurrent:build']); grunt.registerTask('test', ['connect:test', 'mocha:test']); };
fix issue with grunt serve not building source when the task first starts
MiguelCastillo_loggero
train
js