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
02387a2f82d8651903b54e7942742dcdbfe0b647
diff --git a/www/tests/test_classes.py b/www/tests/test_classes.py index <HASH>..<HASH> 100644 --- a/www/tests/test_classes.py +++ b/www/tests/test_classes.py @@ -273,5 +273,54 @@ class EnumInt(int, metaclass=Enumeration): assert isinstance('foo', EnumInt) +# metaclass with multiple inheritance +class Meta(type): + pass + +class A(metaclass=Meta): + pass + +class B(str, A): + pass + +assert B.__class__ == Meta + +class C: + pass + +class D(A, C): + pass + +assert D.__class__ == Meta + +class Meta1(type): + pass +class Meta2(type): + pass + +class A1(metaclass=Meta1): + pass +class A2(metaclass=Meta2): + pass + +try: + class B(A1, A2): + pass + raise Exception("should have raised TypeError") +except TypeError: + pass + +class Meta3(Meta1): + pass + +class A3(metaclass=Meta3): + pass + +class C(A3, A1): + pass + +assert C.__class__ == Meta3 + + print('passed all tests..')
Add tests for classes that inherit several classes with different metaclasses
brython-dev_brython
train
py
b45730e1d9cf1f8a7d860db8fcdd52925f2e9665
diff --git a/bootstrap/start.php b/bootstrap/start.php index <HASH>..<HASH> 100644 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -74,6 +74,13 @@ if (!isset($unitTesting) || !$unitTesting) { /* |-------------------------------------------------------------------------- +| Fix for XDebug aborting threads > 100 nested +|-------------------------------------------------------------------------- +*/ +ini_set('xdebug.max_nesting_level', 300); + +/* +|-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
Fixes issue where XDebug aborts the thread for maximum function count.
octobercms_october
train
php
e041e13ac8ee034e2a6cd535a5b33a5495bdab59
diff --git a/Kwf_js/CallOnContentReady.js b/Kwf_js/CallOnContentReady.js index <HASH>..<HASH> 100644 --- a/Kwf_js/CallOnContentReady.js +++ b/Kwf_js/CallOnContentReady.js @@ -73,10 +73,12 @@ Kwf.onContentReady = function(fn, options) { var deferHandlerNum = null; Kwf._addReadyHandler = function(type, onAction, selector, fn, options) { + if (!options) options = {}; + if (typeof options.defer == 'undefined') options.defer = true; //default defer=true readyElHandlers.push({ selector: selector, fn: fn, - options: options || {}, + options: options, num: readyElHandlers.length, //unique number type: type, onAction: onAction diff --git a/Kwf_js/Utils/ResponsiveEl.js b/Kwf_js/Utils/ResponsiveEl.js index <HASH>..<HASH> 100644 --- a/Kwf_js/Utils/ResponsiveEl.js +++ b/Kwf_js/Utils/ResponsiveEl.js @@ -51,6 +51,7 @@ Kwf.Utils.ResponsiveEl = function(selector, widths, options) initEl = widths; } + if (typeof options.defer == 'undefined') options.defer = false; Kwf.onJElementWidthChange(selector, initEl, options); };
defer=true all onReady methods by default - incompatible change - better default behaviour as most can be deferred - and if dependency on other methods exist (eg. form) that are also deferred
koala-framework_koala-framework
train
js,js
9ebd847956cca339ebe156d1d14af45ce9b6bc84
diff --git a/blockscope.js b/blockscope.js index <HASH>..<HASH> 100644 --- a/blockscope.js +++ b/blockscope.js @@ -109,7 +109,7 @@ function createScopes(node) { // assert(node.type === "FunctionDeclaration"); // no support for named function expressions yet assert(node.id.type === "Identifier"); - addToScope(node.$parent.$scope, node.id.name, "fun", node.id, node.body.range[0]); + addToScope(node.$parent.$scope, node.id.name, "fun", node.id, null); //, node.body.range[0]); } node.$scope = new Scope({ diff --git a/scope.js b/scope.js index <HASH>..<HASH> 100644 --- a/scope.js +++ b/scope.js @@ -67,6 +67,11 @@ Scope.prototype.add = function(name, kind, node, referableFromPos) { if (scope.names.has(name) && (config.disallowDuplicated || isConstLet(scope.names.get(name)) || isConstLet(kind))) { return error(node.loc.start.line, "{0} is already declared", name); } + + if (kind === "fun" && referableFromPos === null) { + referableFromPos = scope.node.range[0]; + } + scope.names.set(name, kind); scope.poses.set(name, referableFromPos); };
function names should be referable from start of outer hoist scope
olov_defs
train
js,js
e576ad2970222feb57160f90314fb1d1b1bbbc71
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -70,6 +70,7 @@ exports.startServer = function(entryPoint) { var b = browserify({ entries: [entryPoint ? entryPoint : './app.jsx'], + extensions: [".jsx"], debug: true, plugin: [watchify], cache: {},
Add jsx as an extension for browserify
boundlessgeo_sdk-tools
train
js
34380efde450983bda8f794168d08e56285cf520
diff --git a/test/api/getting-started.js b/test/api/getting-started.js index <HASH>..<HASH> 100644 --- a/test/api/getting-started.js +++ b/test/api/getting-started.js @@ -11,6 +11,13 @@ describe('Getting Started - async', function() { let control = await vessel.control.get(); let orbitalReference = await vessel.orbitalReferenceFrame.get(); let flight = await vessel.flight(orbitalReference); + let throttle = await control.throttle.get(); + let heading = await flight.heading.get(); + console.log({ + throttle, + heading + }); + //Or send them in a batch (Method 1) let getThrottleCall = spaceCenter.controlGetThrottle(control.id); let getHeadingCall = spaceCenter.flightGetHeading(flight.id); let response = await client.send([getThrottleCall, getHeadingCall]);
Simplifying getting started's default example
eXigentCoder_krpc-node
train
js
907260395d1119dd9640f6d446ed099e5ac193f8
diff --git a/spead2/test/test_passthrough.py b/spead2/test/test_passthrough.py index <HASH>..<HASH> 100644 --- a/spead2/test/test_passthrough.py +++ b/spead2/test/test_passthrough.py @@ -360,6 +360,20 @@ class TestPassthroughTcp(BaseTestPassthrough): return spead2.send.TcpStream(thread_pool, "127.0.0.1", 8887) +class TestPassthroughTcpCustomSocket(BaseTestPassthrough): + def prepare_receiver(self, receiver): + sock = socket.socket() + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + sock.bind(("127.0.0.1", 8887)) + sock.listen(1) + receiver.add_tcp_reader(sock) + + def prepare_sender(self, thread_pool): + sock = socket.socket() + sock.connect(("127.0.0.1", 8887)) + return spead2.send.TcpStream(thread_pool, sock) + + class TestPassthroughTcp6(BaseTestPassthroughIPv6): def prepare_receiver(self, receiver): receiver.add_tcp_reader(8887, bind_hostname="::1")
Add test for synchronous TcpStream with custom socket
ska-sa_spead2
train
py
a7f4f2dc3f35aac50069f8684b581f38dd202fe7
diff --git a/sequel/where.js b/sequel/where.js index <HASH>..<HASH> 100644 --- a/sequel/where.js +++ b/sequel/where.js @@ -79,7 +79,10 @@ var WhereBuilder = module.exports = function WhereBuilder(schema, currentTable, WhereBuilder.prototype.single = function single(queryObject, options) { - if(!queryObject) return ''; + if(!queryObject) return { + query: '', + values: [] + }; var self = this; var queryString = '';
Fixed a case where WHERE clauses could return a string where an object is expected.
balderdashy_waterline-sequel
train
js
1f7fcef99484acd8dc93bebb0c857592d12e9328
diff --git a/eZ/Publish/Core/Persistence/InMemory/SearchHandler.php b/eZ/Publish/Core/Persistence/InMemory/SearchHandler.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/InMemory/SearchHandler.php +++ b/eZ/Publish/Core/Persistence/InMemory/SearchHandler.php @@ -143,6 +143,15 @@ class SearchHandler extends SearchHandlerInterface ) ); + $locations = $this->backend->find( + 'Content\\Location', + array( 'contentId' => $item->versionInfo->contentInfo->id ) + ); + if ( !empty( $locations ) ) + { + $item->versionInfo->contentInfo->mainLocationId = $locations[0]->mainLocationId; + } + $resultList[] = $item; } }
Fixed: set mainLocationId
ezsystems_ezpublish-kernel
train
php
47878003891ee7b9cd829f87edfb266262ebd00d
diff --git a/dist/jquery.floatThead.js b/dist/jquery.floatThead.js index <HASH>..<HASH> 100644 --- a/dist/jquery.floatThead.js +++ b/dist/jquery.floatThead.js @@ -296,9 +296,10 @@ function setFloatWidth(){ var tableWidth = $table.outerWidth(); var width = $scrollContainer.width() || tableWidth; - $floatContainer.width(width - scrollbarOffset.vertical); + var noOffsetWidth = ($scrollContainer.css("overflow-y") != 'hidden')?width - scrollbarOffset.vertical:width; + $floatContainer.width(noOffsetWidth); if(locked){ - var percent = 100 * tableWidth / (width - scrollbarOffset.vertical); + var percent = 100 * tableWidth / (noOffsetWidth); $floatTable.css('width', percent+'%'); } else { $floatTable.outerWidth(tableWidth);
correct floatThead-container width when scrollContainer overflow is hidden
mkoryak_floatThead
train
js
79e13451cbfa7b3e0041a92c62aafe1c1962f095
diff --git a/src/Relax.js b/src/Relax.js index <HASH>..<HASH> 100644 --- a/src/Relax.js +++ b/src/Relax.js @@ -14,11 +14,13 @@ var assign = require('object-assign'); var CHANGE_EVENT = 'relax:change'; var VIEW_ACTION = 'VIEW_ACTION'; var SERVER_ACTION = 'SERVER_ACTION'; +var PLATFORM_ACTION = 'PLATFORM_ACTION'; var Relax = { VIEW_ACTION: VIEW_ACTION, SERVER_ACTION: SERVER_ACTION, + PLATFORM_ACTION: PLATFORM_ACTION, /** * Creates new singleton store. @@ -96,6 +98,18 @@ var Relax = { }, /** + * Dispatches action as a platform action. + * + * @param {object} action + */ + handlePlatformAction: function (action) { + this.dispatch({ + source: PLATFORM_ACTION, + action: action + }); + }, + + /** * Registers a Store to be notified about all the actions. * * @param {object} Store
Added PLATFORM_ACTION source for nw.js compatibility
gyzerok_relax.js
train
js
399586b02177b170760317bac2b0a68a8bb5a783
diff --git a/test/watcher.js b/test/watcher.js index <HASH>..<HASH> 100644 --- a/test/watcher.js +++ b/test/watcher.js @@ -37,7 +37,8 @@ describe('watcher', function () { } await Promise.all([ - fs.remove(fixtureDir), + fs.remove(fixtureDir, {maxBusyTries: 1}) + .catch(err => console.warn('Unable to delete fixture directory', err)), ...subs.map(sub => sub.unwatch()) ]) })
Soft failure when Windows can't delete a fixture directory
atom_watcher
train
js
6d2ad5af083cc5936f1b89b71604fd53e4315a34
diff --git a/src/SpotifyWebAPI.php b/src/SpotifyWebAPI.php index <HASH>..<HASH> 100644 --- a/src/SpotifyWebAPI.php +++ b/src/SpotifyWebAPI.php @@ -382,7 +382,7 @@ class SpotifyWebAPI * https://developer.spotify.com/web-api/get-list-featured-playlists/ * * @param array|object $options Optional. Options for the playlists. - * - string locale Optional. An lowercase ISO 639 language code and an uppercase ISO 3166-1 alpha-2 country code. Show playlists in this language. + * - string locale Optional. An lowercase ISO 639 language code and an uppercase ISO 3166-1 alpha-2 country code. Separated by an underscore. Show playlists in this language. * - string country Optional. An ISO 3166-1 alpha-2 country code. Show playlists from this country. * - string timestamp Optional. A ISO 8601 timestamp. Show playlists relevant to this date and time. * - int limit Optional. Limit the number of playlists.
Clarify that SpotifyWebAPI::getFeaturedPlaylists() locale must be separated by an underscore
jwilsson_spotify-web-api-php
train
php
3dc97c0e0c6eb0ff792e6adb07ab1700cbf43fdb
diff --git a/goinsta.go b/goinsta.go index <HASH>..<HASH> 100644 --- a/goinsta.go +++ b/goinsta.go @@ -986,6 +986,7 @@ func getImageDimension(imagePath string) (int, int, error) { if err != nil { return 0, 0, err } + defer file.Close() image, _, err := image.DecodeConfig(file) if err != nil {
closes getImageDimension file descriptor fixing issue #<I> (#<I>)
ahmdrz_goinsta
train
go
f467f5f2da1ac55600aa89bbbb6efe9dfc13c169
diff --git a/lib/mongoat.js b/lib/mongoat.js index <HASH>..<HASH> 100644 --- a/lib/mongoat.js +++ b/lib/mongoat.js @@ -90,7 +90,7 @@ Mongoat.Collection.prototype.query = function(opName, query, sort, document, opt return _this[opName + 'Method'].apply(_this, params) .then(function (mongObject) { promises = []; - promises = utilsHelper.promisify(_this.hooks[colName].after[opName_X], docToProcess[0]); + promises = utilsHelper.promisify(_this.hooks[colName].after[opName_X], mongObject); Promise.all(promises); return mongObject; });
Send the mongOject to after hooks
dial-once_node-mongoat
train
js
da2847ce360bb5823eaf70cb9f0febb9368fc79f
diff --git a/contrail_api_cli/manager.py b/contrail_api_cli/manager.py index <HASH>..<HASH> 100644 --- a/contrail_api_cli/manager.py +++ b/contrail_api_cli/manager.py @@ -70,6 +70,10 @@ class CommandManager(object): :rtype: (name, Command) """ for ext in self.extensions: + # don't return ext that failed + # to load earlier + if ext.obj is None: + continue yield (ext.name, ext.obj) @classmethod
Don't register commands that failed to load
eonpatapon_contrail-api-cli
train
py
bcc0f5f85453ec7b52a333736be473deef175af8
diff --git a/implementations/micrometer-registry-elastic/src/main/java/io/micrometer/elastic/ElasticConfig.java b/implementations/micrometer-registry-elastic/src/main/java/io/micrometer/elastic/ElasticConfig.java index <HASH>..<HASH> 100644 --- a/implementations/micrometer-registry-elastic/src/main/java/io/micrometer/elastic/ElasticConfig.java +++ b/implementations/micrometer-registry-elastic/src/main/java/io/micrometer/elastic/ElasticConfig.java @@ -70,7 +70,7 @@ public interface ElasticConfig extends StepRegistryConfig { /** * The index date format used for rolling indices. - * This is appended to the index name, split by a '-'. + * This is appended to the index name, separated by the {@link #indexDateSeparator()}. * Default is: "yyyy-MM" * * @return date format for index
Reference `indexDateSeparator()` option in JavaDoc for `indexDateFormat()` Now that the `indexDateSeparator` is not hardcoded but configurable, it should be referenced where the hardcoded value was mentioned.
micrometer-metrics_micrometer
train
java
553bf7333c56168c4ebedd9cdef722dd92bddcf4
diff --git a/db/seeds/seeds.go b/db/seeds/seeds.go index <HASH>..<HASH> 100644 --- a/db/seeds/seeds.go +++ b/db/seeds/seeds.go @@ -8,6 +8,7 @@ import ( "github.com/jinzhu/configor" "github.com/manveru/faker" "github.com/qor/qor-example/db" + "github.com/qor/qor/publish" ) var Fake *faker.Faker @@ -108,6 +109,8 @@ func TruncateTables(tables ...interface{}) { panic(err) } db.DB.AutoMigrate(table) - db.Publish.AutoMigrate(table) + if publish.IsPublishableModel(table) { + db.Publish.AutoMigrate(table) + } } }
Only create draft table for those publishable models
qor_qor-example
train
go
0344650ade9e7d3ca71046608f5530eb67bebf97
diff --git a/grab/cli.py b/grab/cli.py index <HASH>..<HASH> 100644 --- a/grab/cli.py +++ b/grab/cli.py @@ -21,11 +21,13 @@ def activate_env(env_path): execfile(activate_script, dict(__file__=activate_script)) -def setup_logging(action, level): +def setup_logging(action, level, clear_handlers=False): root = logging.getLogger() root.setLevel(logging.DEBUG) - #for hdl in root.handlers: - # root.removeHandler(hdl) + + if clear_handlers: + for hdl in root.handlers: + root.removeHandler(hdl) hdl = logging.StreamHandler() hdl.setLevel(level) @@ -101,7 +103,7 @@ def process_command_line(): #else: #command_key = args.action # TODO: enable logs - setup_logging(args.action, logging_level) + setup_logging(args.action, logging_level, clear_handlers=True) # Setup action handler action_name = args.action @@ -143,7 +145,7 @@ def process_command_line(): #print 'Trying to lock file: %s' % lock_path #assert_lock(lock_path) - logger.debug('Execution %s action' % action_name) + logger.debug('Executing %s action' % action_name) try: action_mod.main(**vars(args)) except Exception as ex:
More correct logging initialization in `grab` utility
lorien_grab
train
py
27d49ba5e628a73fa303b8922f7dea5b9a2d0b67
diff --git a/lib/generators/draper/decorator/templates/decorator.rb b/lib/generators/draper/decorator/templates/decorator.rb index <HASH>..<HASH> 100644 --- a/lib/generators/draper/decorator/templates/decorator.rb +++ b/lib/generators/draper/decorator/templates/decorator.rb @@ -7,8 +7,8 @@ class <%= singular_name.camelize %>Decorator < ApplicationDecorator # Normal Usage: helpers.number_to_currency(2) # Abbreviated : h.number_to_currency(2) # - # Or, optionally enable "lazy helpers" by calling this method: - # lazy_helpers + # Or, optionally enable "lazy helpers" by include this module : + # include Draper::LazyHelpers # Then use the helpers with no proxy: # number_to_currency(2)
Change the usage of lazy_helper by include Draper::LazyHelpers in generator template
drapergem_draper
train
rb
1f39067a8e987c5f6c3cd0b423fdb936a1031c18
diff --git a/threadedcomments/models.py b/threadedcomments/models.py index <HASH>..<HASH> 100644 --- a/threadedcomments/models.py +++ b/threadedcomments/models.py @@ -10,7 +10,7 @@ class ThreadedComment(Comment): parent = models.ForeignKey('self', null=True, blank=True, default=None, related_name='children') last_child = models.ForeignKey('self', null=True, blank=True) - tree_path = models.TextField(null=True, blank=True, db_index=True) + tree_path = models.TextField(blank=True, db_index=True) def _get_depth(self): return len(self.tree_path.split(PATH_SEPARATOR))
Changed tree_path not to be nullable, as per convention
HonzaKral_django-threadedcomments
train
py
4f7f4db473100ae8739381a5e653a572cb1cb6ba
diff --git a/src/main/java/io/vlingo/wire/fdx/bidirectional/ClientRequestResponseChannel.java b/src/main/java/io/vlingo/wire/fdx/bidirectional/ClientRequestResponseChannel.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/vlingo/wire/fdx/bidirectional/ClientRequestResponseChannel.java +++ b/src/main/java/io/vlingo/wire/fdx/bidirectional/ClientRequestResponseChannel.java @@ -123,6 +123,7 @@ public class ClientRequestResponseChannel implements RequestSenderChannel, Respo } } catch (Exception e) { closeChannel(); + logger.log(getClass().getSimpleName() + ": Cannot prepare/open channel because: " + e.getMessage(), e); } return null; }
Added logging when managed channel will not open or otherwise fails preparing.
vlingo_vlingo-wire
train
java
c3470b5fe1271bdf85dd8628e47146d0dfd7f42b
diff --git a/src/main.js b/src/main.js index <HASH>..<HASH> 100644 --- a/src/main.js +++ b/src/main.js @@ -218,6 +218,12 @@ function configureCommandlineSwitchesSync(cliArgs) { } }); + /* Following features are disabled from the runtime. + * `CalculateNativeWinOcclusion` - Disable native window occlusion tracker, + * Refs https://groups.google.com/a/chromium.org/g/embedder-dev/c/ZF3uHHyWLKw/m/VDN2hDXMAAAJ + */ + app.commandLine.appendSwitch('disable-features', 'CalculateNativeWinOcclusion'); + // Support JS Flags const jsFlags = getJSFlags(cliArgs); if (jsFlags) {
fix: disable occlusion tracker on windows (#<I>)
Microsoft_vscode
train
js
8401fd0ea88981f450e3a49bd8390af5912a0e41
diff --git a/openquake/commonlib/calc.py b/openquake/commonlib/calc.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/calc.py +++ b/openquake/commonlib/calc.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with OpenQuake. If not, see <http://www.gnu.org/licenses/>. import warnings +import operator import numpy from openquake.baselib import hdf5, general @@ -190,11 +191,10 @@ def get_imts_periods(imtls): :param imtls: a set of intensity measure type strings :returns: a list of IMT strings and a list of periods """ - def getperiod(imt): - return imt[1] or 0 + period = operator.attrgetter('period') imts = sorted((from_string(imt) for imt in imtls - if imt.startswith('SA') or imt == 'PGA'), key=getperiod) - return [str(imt) for imt in imts], [imt[1] or 0.0 for imt in imts] + if imt.startswith('SA') or imt == 'PGA'), key=period) + return [str(imt) for imt in imts], [imt.period for imt in imts] def make_hmap(pmap, imtls, poes):
Fixed UHS export [demos]
gem_oq-engine
train
py
4c620fa30f60c47a2afa045c6f2a13718d613f8e
diff --git a/src/BryanCrowe/Growl.php b/src/BryanCrowe/Growl.php index <HASH>..<HASH> 100644 --- a/src/BryanCrowe/Growl.php +++ b/src/BryanCrowe/Growl.php @@ -1,6 +1,8 @@ <?php namespace BryanCrowe; +use RuntimeException; + class Growl { @@ -123,6 +125,8 @@ class Growl } break; } + + throw new RuntimeException('Could not find any notification packages.'); } /**
Throw a RuntimeException if no growl or notification packages are found
bcrowe_growl
train
php
13e6d536416717f999346caa96510183a5b82020
diff --git a/src/Session.php b/src/Session.php index <HASH>..<HASH> 100644 --- a/src/Session.php +++ b/src/Session.php @@ -3,13 +3,13 @@ namespace SpotifyWebAPI; class Session { - private $accessToken = ''; - private $clientId = ''; - private $clientSecret = ''; - private $expirationTime = 0; - private $redirectUri = ''; - private $refreshToken = ''; - private $request = null; + protected $accessToken = ''; + protected $clientId = ''; + protected $clientSecret = ''; + protected $expirationTime = 0; + protected $redirectUri = ''; + protected $refreshToken = ''; + protected $request = null; /** * Constructor
Mark Session properites as protected instead of private
jwilsson_spotify-web-api-php
train
php
afaa3ad1d081db95cc9db2436eb132803d7dfd25
diff --git a/client/signup/config/flows.js b/client/signup/config/flows.js index <HASH>..<HASH> 100644 --- a/client/signup/config/flows.js +++ b/client/signup/config/flows.js @@ -228,6 +228,9 @@ function removeUserStepFromFlow( flow ) { } function filterFlowName( flowName ) { + if ( 'headstart' === flowName && 'production' === config( 'env' ) ) { + return 'main'; + } return flowName; }
Signup: Headstart: Disable the Headstart flow temporarily while preparing for its launch.
Automattic_wp-calypso
train
js
94a25e7de57c4267aa973fec5716cb38dfab55a4
diff --git a/app/models/tolk/locale.rb b/app/models/tolk/locale.rb index <HASH>..<HASH> 100644 --- a/app/models/tolk/locale.rb +++ b/app/models/tolk/locale.rb @@ -55,7 +55,7 @@ module Tolk secondary_locales.each do |locale| File.open("#{to}/#{locale.name}.yml", "w+") do |file| data = locale.to_hash - data.respond_to?(:ya2yaml) ? file.write(data.ya2yaml(:syck_compatible => true)) : YAML.dump(locale.to_hash, file) + data.respond_to?(:ya2yaml) ? file.write(data.ya2yaml(:syck_compatible => true)) : file.write(YAML.dump(data).force_encoding file.external_encoding.name) end end end
fixes encoding exceptions for non-well encoded strings at dump
tolk_tolk
train
rb
7fa42267ab4236861a22334dc95f3c5d27d41d40
diff --git a/src/Console/Command/CheckCommand.php b/src/Console/Command/CheckCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/Command/CheckCommand.php +++ b/src/Console/Command/CheckCommand.php @@ -56,7 +56,7 @@ class CheckCommand extends Command { $lock = filter_var( $input->getArgument( 'lock' ), FILTER_SANITIZE_STRING ); if ( is_dir( $lock ) ) { - $lock = trailingslashit( $lock ) . 'composer.lock'; + $lock = rtrim( $lock, '/\\' ) . '/composer.lock'; } $lock = realpath( $lock );
Don't use trailingslashit() outside of WordPress.
ssnepenthe_soter
train
php
0138e665151d0df418dd85038efe59612428a388
diff --git a/fred/helpers/__init__.py b/fred/helpers/__init__.py index <HASH>..<HASH> 100644 --- a/fred/helpers/__init__.py +++ b/fred/helpers/__init__.py @@ -14,6 +14,7 @@ from pandas import DataFrame # consider putting this in ~/.fred or env var _USE_JOBLIB_CACHE = True +_THROTTLE_REQUESTS = True def _fetch(url, ssl_verify = True): """ @@ -131,8 +132,13 @@ def _get_request(url_root,api_key,path,response_type,params, ssl_verify): if _USE_JOBLIB_CACHE: import joblib - location = '/tmp/joblib_cache' one_gb = 1000000000 + location = '/tmp/joblib_cache' memory = joblib.Memory(location, verbose=1, bytes_limit=one_gb) - memory.cache - _get_request = memory.cache(_get_request) + if _THROTTLE_REQUESTS: + from ratelimit import limits, sleep_and_retry + period_seconds = 1 + calls_per_second = 20 + _get_request = memory.cache(sleep_and_retry(limits(calls=calls_per_second, period=period_seconds)(_get_request))) + else: + _get_request = memory.cache(_get_request)
Add throttling. On by default
avelkoski_FRB
train
py
8d5a907dc86b056fe5119f09c9fece99fb28166e
diff --git a/lib/liquid/standardfilters.rb b/lib/liquid/standardfilters.rb index <HASH>..<HASH> 100644 --- a/lib/liquid/standardfilters.rb +++ b/lib/liquid/standardfilters.rb @@ -33,7 +33,7 @@ module Liquid end def escape(input) - CGI.escapeHTML(input).untaint + CGI.escapeHTML(input).untaint unless input.nil? end alias_method :h, :escape diff --git a/test/integration/standard_filter_test.rb b/test/integration/standard_filter_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/standard_filter_test.rb +++ b/test/integration/standard_filter_test.rb @@ -118,6 +118,7 @@ class StandardFiltersTest < Minitest::Test def test_escape assert_equal '&lt;strong&gt;', @filters.escape('<strong>') + assert_equal nil, @filters.escape(nil) assert_equal '&lt;strong&gt;', @filters.h('<strong>') end
Fixed issue where "nil" value for "escape" filter breaks rendering Closes #<I>
Shopify_liquid
train
rb,rb
fe05ec9aee8037e5ddd091a8ae9f751aa20dec20
diff --git a/crypto/src/main/java/org/web3j/crypto/WalletUtils.java b/crypto/src/main/java/org/web3j/crypto/WalletUtils.java index <HASH>..<HASH> 100644 --- a/crypto/src/main/java/org/web3j/crypto/WalletUtils.java +++ b/crypto/src/main/java/org/web3j/crypto/WalletUtils.java @@ -157,7 +157,7 @@ public class WalletUtils { * Get keystore destination directory for a Rinkeby network * @return */ - private String getRinkebyKeyDirectory() { + public String getRinkebyKeyDirectory() { return String.format("%s%srinkeby%skeystore", WalletUtils.getDefaultKeyDirectory(), File.separator, File.separator); }
Update WalletUtils.java Added method to get Rinkeby keystore directory
web3j_web3j
train
java
c973359d3daf66fd0b4730cf0a7a0f983e15370b
diff --git a/error.go b/error.go index <HASH>..<HASH> 100644 --- a/error.go +++ b/error.go @@ -1,28 +1,16 @@ package cdp -import "fmt" - -type cdpError struct { - Domain string - Op string - Err error -} - -func (e cdpError) Error() string { - return fmt.Sprintf("cdp.%s: %s: %s", e.Domain, e.Op, e.Err.Error()) -} - -var ( - _ error = (*cdpError)(nil) +import ( + "github.com/mafredri/cdp/cdpdom" ) -// ErrorCauser returns the error that caused this -// error. Returns itself if it is not a cdpError. +// ErrorCauser returns the error that caused this error. +// Returns err if it is not a cdpdom OpError. func ErrorCauser(err error) error { if err == nil { return nil } - if err, ok := err.(*cdpError); ok { + if err, ok := err.(*cdpdom.OpError); ok { return err.Err } return err
Check for cdpdom OpError in ErrorCauser
mafredri_cdp
train
go
8e16eeb087a97a5e847ca712ad54707570365a94
diff --git a/src/base/Controller.php b/src/base/Controller.php index <HASH>..<HASH> 100644 --- a/src/base/Controller.php +++ b/src/base/Controller.php @@ -46,4 +46,19 @@ class Controller extends \yii\web\Controller // use client repository specific path return '@app/views/'.$this->module->id.'/'.$this->id; } + + /** + * if we are acting in the module context and the layout is empty we only should renderPartial the content + * + * @param unknown_type $view + * @param unknown_type $params + */ + public function render($view, $params = []) + { + if (!empty($this->module->getContext()) && empty($this->layout)) { + return $this->renderPartial($view, $params); + } + + return parent::render($view, $params); + } }
[+] added overwritten render method to avoid problems when using render inside cms context
luyadev_luya
train
php
7d845648e3e8eb73e4d9503552808775d3ca88fe
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index <HASH>..<HASH> 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -1614,7 +1614,7 @@ class MainWindow(QMainWindow): self.save_current_window_settings(prefix) if CONF.get('main', 'single_instance'): if os.name == 'nt': - self.open_files_server.shutdown(socket.SHUT_RDWR) + pass # All seems to indicate port is closed at this point self.open_files_server.close() for widget in self.widgetlist: if not widget.closing_plugin(cancelable):
Fix traceback while closing main window on Windows
spyder-ide_spyder
train
py
2be35b5c77588086ccf63d58b44f962572a0ae8f
diff --git a/buffalo/cmd/new.go b/buffalo/cmd/new.go index <HASH>..<HASH> 100644 --- a/buffalo/cmd/new.go +++ b/buffalo/cmd/new.go @@ -99,7 +99,7 @@ func installDeps(pwd string, rootPath string) error { cmds = append(cmds, glideGet("github.com/markbates/pop/..."), glideInstall("github.com/markbates/pop/soda"), - exec.Command("$GOPATH/bin/soda", "g", "config", "-t", dbType), + exec.Command("soda", "g", "config", "-t", dbType), ) }
why isn't go finding the bin in the $GOPATH??
gobuffalo_buffalo
train
go
b40d38befa41ff84128c65cb6f59e4d0fe3d4e90
diff --git a/websocket.go b/websocket.go index <HASH>..<HASH> 100644 --- a/websocket.go +++ b/websocket.go @@ -148,7 +148,7 @@ func handleEvent(ch chan SlackEvent, event json.RawMessage) { if ack.Ok { log.Printf("Received an ok for: %d", ack.ReplyTo) } else { - log.Println(event) + log.Println(string(event)) log.Println("XXX: ?") } case "hello":
Print unknown events in English not bytes
nlopes_slack
train
go
e69a013ac3b4e39de859f78bf15da841c1a8ad27
diff --git a/src/Table/TableCell.js b/src/Table/TableCell.js index <HASH>..<HASH> 100644 --- a/src/Table/TableCell.js +++ b/src/Table/TableCell.js @@ -57,7 +57,8 @@ export type Props = { export const styles = (theme: Object) => ({ root: { - borderBottom: `1px solid ${theme.palette.text.lightDivider}`, + // Same value as theme.palette.text.lightDivider without the transparency. + borderBottom: `1px solid ${theme.palette.type === 'light' ? '#ededed' : '#505050'}`, textAlign: 'left', }, numeric: {
[Table] Transparency less border color (#<I>)
mui-org_material-ui
train
js
b46d7fd5271a103a23c35a6988847b260d07329d
diff --git a/pkg/kube/wait.go b/pkg/kube/wait.go index <HASH>..<HASH> 100644 --- a/pkg/kube/wait.go +++ b/pkg/kube/wait.go @@ -267,7 +267,10 @@ func (w *waiter) statefulSetReady(sts *appsv1.StatefulSet) bool { var partition int // 1 is the default for replicas if not set var replicas = 1 - if sts.Spec.UpdateStrategy.RollingUpdate.Partition != nil { + // For some reason, even if the update strategy is a rolling update, the + // actual rollingUpdate field can be nil. If it is, we can safely assume + // there is no partition value + if sts.Spec.UpdateStrategy.RollingUpdate != nil && sts.Spec.UpdateStrategy.RollingUpdate.Partition != nil { partition = int(*sts.Spec.UpdateStrategy.RollingUpdate.Partition) } if sts.Spec.Replicas != nil {
fix(kube): Fixes nil panic with stateful set waiting Sometimes the stateful set `rollingUpdate` field can be nil even when the strategy is a rolling update Fixes #<I>
helm_helm
train
go
f9ce1483d3210a4af2f95a69122c4e3437e8a9d9
diff --git a/lib/engine_http.js b/lib/engine_http.js index <HASH>..<HASH> 100644 --- a/lib/engine_http.js +++ b/lib/engine_http.js @@ -99,13 +99,15 @@ HttpEngine.prototype.step = function step(requestSpec, ee) { } else { requestParams.agent = context._agent; } - - - let requestParamsString = JSON.stringify(requestParams, null, 2); request(requestParams, function requestCallback(err, res, body) { - debug('request: %s', requestParamsString) - + debug('request: %s', JSON.stringify({ + uri: requestParams.uri, + method: requestParams.method, + headers: requestParams.headers, + json: requestParams.json + }, null, 2)); + if (err) { let errCode = err.code || err.message; ee.emit('error', errCode);
No longer tries to stringify the entire request on debug
artilleryio_artillery
train
js
3382479b30b9d509826384e874550738d4406f2e
diff --git a/system/Database/Database.php b/system/Database/Database.php index <HASH>..<HASH> 100644 --- a/system/Database/Database.php +++ b/system/Database/Database.php @@ -99,7 +99,7 @@ class Database */ public function loadForge(ConnectionInterface $db) { - $className = strpos($db->DBDriver, '\\') === false ? '\CodeIgniter\Database\\' . $db->DBDriver . '\\Forge' : $db->DBDriver . '\\Connection'; + $className = strpos($db->DBDriver, '\\') === false ? '\CodeIgniter\Database\\' . $db->DBDriver . '\\Forge' : $db->DBDriver . '\\Forge'; // Make sure a connection exists if ( ! $db->connID)
Fix error where Forge class might not be returned. Fixes #<I>
codeigniter4_CodeIgniter4
train
php
41a6472a4ac5661fe2a4ef4f70e1511850276436
diff --git a/magma/courses.py b/magma/courses.py index <HASH>..<HASH> 100644 --- a/magma/courses.py +++ b/magma/courses.py @@ -52,7 +52,7 @@ class CoursesList(list): def filter(self, criteria): if isinstance(criteria, str): _criteria = criteria - criteria = lambda x: x[_criteria] + criteria = lambda x: x.get(_criteria) return CoursesList(filter(criteria, self))
CoursesList#filter fixed for nonexisting keys
bfontaine_p7magma
train
py
224f17323213b5d3a6eefe47a6802ca58e09fd35
diff --git a/test/leSpec.js b/test/leSpec.js index <HASH>..<HASH> 100644 --- a/test/leSpec.js +++ b/test/leSpec.js @@ -1,3 +1,4 @@ +/*globals LE, sinon, describe, it, expect, afterEach, beforeEach, jasmine*/ var GLOBAL = this; var TOKEN = 'test_token'; @@ -14,7 +15,7 @@ function mockXMLHttpRequests(){ this.xhr.onCreate = function(request){ requestList.push(request); - } + }; } function addGetJson(){ this.getXhrJson = function(xhrRequestId) { @@ -139,7 +140,7 @@ describe('sends log level', function(){ return function(){ LE[method]('test'); expect(this.getXhrJson(0).level).toBe(level); - } + }; }(method, level)); }
keeping jslint happy
rapid7_le_js
train
js
45c7521a73a8979aac2c113975a2a29f2abbdb1b
diff --git a/lib/loader.js b/lib/loader.js index <HASH>..<HASH> 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -132,7 +132,7 @@ function loadCommand(name) { try { module = require(path.resolve(this.root, String(name))); } catch (e) { - if (e) { + if (e && e.code !== 'MODULE_NOT_FOUND') { console.error('There was an error loading module "%s":\n', name, e); } return null;
Module not found is not an error for slc commands slc falls back to using npm or run, if it can't find a command. See SLN-<I>.
strongloop_strongloop
train
js
61c3e0827aedd1667a3f952843ee4a489971bb7c
diff --git a/client/state/test/index.js b/client/state/test/index.js index <HASH>..<HASH> 100644 --- a/client/state/test/index.js +++ b/client/state/test/index.js @@ -174,9 +174,9 @@ describe( 'state', () => { } ); describe( 'ui', () => { - require( '../users/test/actions' ); - require( '../users/test/reducer' ); - require( '../users/test/selectors' ); + require( '../ui/test/actions' ); + require( '../ui/test/reducer' ); + require( '../ui/test/selectors' ); describe( 'editor', () => { describe( 'contact-form', () => {
State: Properly include UI tests
Automattic_wp-calypso
train
js
dc80bf5f70b9cec4da89f58fd38bdd1c2abda569
diff --git a/pysc2/tests/multi_player_test.py b/pysc2/tests/multi_player_test.py index <HASH>..<HASH> 100644 --- a/pysc2/tests/multi_player_test.py +++ b/pysc2/tests/multi_player_test.py @@ -79,10 +79,9 @@ class TestMultiplayer(utils.TestCase): # Create the join request. join = sc_pb.RequestJoinGame(race=sc_common.Random, options=interface) join.shared_port = 0 # unused - join.server_ports.game_port = ports.pop(0) - join.server_ports.base_port = ports.pop(0) - for _ in range(players - 1): - join.client_ports.add(game_port=ports.pop(0), base_port=ports.pop(0)) + join.server_ports.game_port = ports[0] + join.server_ports.base_port = ports[1] + join.client_ports.add(game_port=ports[2], base_port=ports[3]) # Play a few short games. for _ in range(2): # 2 episodes
Return the ports properly. PiperOrigin-RevId: <I>
deepmind_pysc2
train
py
1457ff59ad3921eeb9b9d86d94a1ba6856f32d72
diff --git a/client/lib/post-normalizer/rule-pick-canonical-media.js b/client/lib/post-normalizer/rule-pick-canonical-media.js index <HASH>..<HASH> 100644 --- a/client/lib/post-normalizer/rule-pick-canonical-media.js +++ b/client/lib/post-normalizer/rule-pick-canonical-media.js @@ -16,8 +16,8 @@ function isImageLargeEnoughForFeature( image ) { if ( ! image ) { return false; } - const imageIsTallEnough = 350 <= image.width; - const imageIsWideEnough = 85 <= image.height; + const imageIsTallEnough = 100 <= image.width; + const imageIsWideEnough = 75 <= image.height; return imageIsTallEnough && imageIsWideEnough; }
Reader: Try <I>px x <I>px as min feature size - Part 2 (#<I>) * drops the featured image min size down to <I>px wide (and <I>px tall for features). * change min height to <I>px (from <I>px)
Automattic_wp-calypso
train
js
2dd427359d2d8f5dd5d2c33bbe64fb490e6006b2
diff --git a/ca/django_ca/tests/tests_admin.py b/ca/django_ca/tests/tests_admin.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/tests/tests_admin.py +++ b/ca/django_ca/tests/tests_admin.py @@ -168,7 +168,7 @@ class AddTestCase(AdminTestMixin, DjangoCAWithCSRTestCase): 'subject_5': cn, 'subjectAltName_1': True, 'algorithm': 'sha256', - 'expires': '2018-04-12', + 'expires': self.ca.expires.strftime('%Y-%m-%d'), 'keyUsage_0': ['digitalSignature', 'keyAgreement', ], 'keyUsage_1': True, 'extendedKeyUsage_0': ['clientAuth', 'serverAuth', ], @@ -200,7 +200,7 @@ class AddTestCase(AdminTestMixin, DjangoCAWithCSRTestCase): 'subjectAltName_0': san, 'subjectAltName_1': True, 'algorithm': 'sha256', - 'expires': '2018-04-12', + 'expires': self.ca.expires.strftime('%Y-%m-%d'), 'keyUsage_0': [], 'keyUsage_1': False, 'extendedKeyUsage_0': [],
pass expires date of CA instead of random date
mathiasertl_django-ca
train
py
14dcd8789c764743cfcb2e7a7b9b7d33b21a2779
diff --git a/fluent_blogs/models/managers.py b/fluent_blogs/models/managers.py index <HASH>..<HASH> 100644 --- a/fluent_blogs/models/managers.py +++ b/fluent_blogs/models/managers.py @@ -17,7 +17,7 @@ class EntryQuerySet(QuerySet): .filter(status=Entry.PUBLISHED) \ .filter( Q(publication_date__isnull=True) | - Q(publication_date__lt=datetime.now()) + Q(publication_date__lte=datetime.now()) ).filter( Q(publication_end_date__isnull=True) | Q(publication_end_date__gte=datetime.now())
Fix .published() to accept current date as well.
django-fluent_django-fluent-blogs
train
py
d1a0e832ebbacb61f4cdc4b3a39937cc98d9b325
diff --git a/src/main/java/com/axibase/tsd/driver/jdbc/strategies/RowIterator.java b/src/main/java/com/axibase/tsd/driver/jdbc/strategies/RowIterator.java index <HASH>..<HASH> 100755 --- a/src/main/java/com/axibase/tsd/driver/jdbc/strategies/RowIterator.java +++ b/src/main/java/com/axibase/tsd/driver/jdbc/strategies/RowIterator.java @@ -136,9 +136,10 @@ public class RowIterator implements Iterator<Object[]>, AutoCloseable { settings.setCommentCollectionEnabled(true); settings.setEmptyValue(""); settings.setNullValue(null); - settings.setNumberOfRowsToSkip(1); + settings.setNumberOfRowsToSkip(0); settings.setSkipEmptyLines(false); settings.setProcessor(rowProcessor); + settings.setHeaderExtractionEnabled(true); return settings; }
Fixed the way to skip header read by CsvReader (#<I>)
axibase_atsd-jdbc
train
java
132a45ec255e1866d0b315c918e119a73294eb2b
diff --git a/Lib/AssetScanner.php b/Lib/AssetScanner.php index <HASH>..<HASH> 100644 --- a/Lib/AssetScanner.php +++ b/Lib/AssetScanner.php @@ -116,18 +116,18 @@ class AssetScanner { foreach ($this->_paths as $path) { if ($ds = $this->isRemote($path)) { $file = $this->_normalizePath($file, $ds); - $full_path = $path . $file; + $fullPath = $path . $file; // Opens and closes the remote file, just to check for its existance. Its contents will be read elsewhere. - $handle = @fopen($full_path, 'rb'); + $handle = @fopen($fullPath, 'rb'); if ($handle) { fclose($handle); - return $full_path; + return $fullPath; } } else { $file = $this->_normalizePath($file, DS); - $full_path = $path . $file; - if (file_exists($full_path)) { - return $full_path; + $fullPath = $path . $file; + if (file_exists($fullPath)) { + return $fullPath; } } }
Changed format of variable $full_path to camelCase.
markstory_asset_compress
train
php
1ad91cda51a0c57240a872f8570449ea6bd8f439
diff --git a/spec/lib/validators/phony_validator_spec.rb b/spec/lib/validators/phony_validator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/validators/phony_validator_spec.rb +++ b/spec/lib/validators/phony_validator_spec.rb @@ -327,6 +327,14 @@ describe PhonyPlausibleValidator do expect(@home.errors.messages.to_hash).to include(phone_number: ['является недействительным номером']) end end + + it 'should translate the error message in Portuguese' do + I18n.with_locale(:pt) do + @home.phone_number = INVALID_NUMBER + @home.valid? + expect(@home.errors.messages.to_hash).to include(phone_number: ['é um número inválido']) + end + end end end
Add test for translated error message in Portuguese
joost_phony_rails
train
rb
cb36b8b88a66ba73a747fe6723c6cd022d46f5e4
diff --git a/sark/core.py b/sark/core.py index <HASH>..<HASH> 100644 --- a/sark/core.py +++ b/sark/core.py @@ -152,10 +152,10 @@ def get_name_or_address(ea): def get_native_size(): """Get the native word size in normal 8-bit bytes.""" info = idaapi.get_inf_structure() - if info.is_32bit(): - return 4 - elif info.is_64bit(): + if info.is_64bit(): return 8 + elif info.is_32bit(): + return 4 else: return 2
Fixed a bug in `get_native_size` where <I> bit would show as <I>. Seems like the `is_<I>bit` and `is_<I>bit` flags are not mutually exclusive.
tmr232_Sark
train
py
8a5c52a20457c4d35c63a0998a3b567317d88412
diff --git a/code/compat/pages/BlogHolder.php b/code/compat/pages/BlogHolder.php index <HASH>..<HASH> 100644 --- a/code/compat/pages/BlogHolder.php +++ b/code/compat/pages/BlogHolder.php @@ -50,6 +50,7 @@ class BlogHolder extends BlogTree implements MigratableObject { if($this->ClassName === 'BlogHolder') { $this->ClassName = 'Blog'; $this->RecordClassName = 'Blog'; + $this->PostsPerPage = 10; $this->write(); }
FIX Explicitly set the PostsPerPage during migration Tested against the silverstripe.org codebase, BlogHolder migration fails unless you set this.
silverstripe_silverstripe-blog
train
php
b6753a34ae4e6c43f6c5a51b573fa8e791ab4fd5
diff --git a/manticore/ethereum.py b/manticore/ethereum.py index <HASH>..<HASH> 100644 --- a/manticore/ethereum.py +++ b/manticore/ethereum.py @@ -361,7 +361,7 @@ class ABI(object): return simplify(value) if ty == u'uint256': return get_uint(256, offset), offset+32 - if ty == u'bool': + elif ty in (u'bool', u'uint8'): return get_uint(8, offset), offset+32 elif ty == u'address': return get_uint(160, offset), offset+32
Adds support for unmarshaling uint8 type (#<I>)
trailofbits_manticore
train
py
3258aa00930df278ef82f156fb7dfaf332067e97
diff --git a/alot/db/attachment.py b/alot/db/attachment.py index <HASH>..<HASH> 100644 --- a/alot/db/attachment.py +++ b/alot/db/attachment.py @@ -47,7 +47,8 @@ class Attachment(object): """mime type of the attachment part""" ctype = self.part.get_content_type() # replace underspecified mime description by a better guess - if ctype in ['octet/stream', 'application/octet-stream']: + if ctype in ['octet/stream', 'application/octet-stream', + 'application/octetstream']: ctype = helper.guess_mimetype(self.get_data()) return ctype
use magic on application/octetstream' attachments Some versions of AppleMail apparently send out attachements with incorrect mimetypes "application/octetstream" (instead of "application/octet-stream"). This patch makes alot use libmagic on the attachments content to determine the actual content type.
pazz_alot
train
py
c3841a8447f1ed3409bce646fa56b16179d66357
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setup( "Topic :: Software Development :: Libraries :: Python Modules", "Environment :: Web Environment", ], - keywords='redis, s3', + keywords='redis, s3, dynamodb', author='Brian Jinwright', author_email='opensource@ipoots.com', maintainer='Brian Jinwright',
added dynamodb to setup.py keywords
capless_kev
train
py
e3a76b8b6e831857fcebe7d3e868c00a9e6e4ea0
diff --git a/src/Access/DiscussionPolicy.php b/src/Access/DiscussionPolicy.php index <HASH>..<HASH> 100755 --- a/src/Access/DiscussionPolicy.php +++ b/src/Access/DiscussionPolicy.php @@ -62,10 +62,8 @@ class DiscussionPolicy extends AbstractPolicy { // Wrap all discussion permission checks with some logic pertaining to // the discussion's tags. If the discussion has a tag that has been - // restricted, and the user has this permission for that tag, then they - // are allowed. If the discussion only has tags that have been - // restricted, then the user *must* have permission for at least one of - // them. + // restricted, the user must have the permission for that tag. If all of + // the discussion's tags are restricted, then ignore global permissions. $tags = $discussion->tags; if (count($tags)) { @@ -73,8 +71,8 @@ class DiscussionPolicy extends AbstractPolicy foreach ($tags as $tag) { if ($tag->is_restricted) { - if ($actor->hasPermission('tag'.$tag->id.'.discussion.'.$ability)) { - return true; + if (! $actor->hasPermission('tag'.$tag->id.'.discussion.'.$ability)) { + return false; } } else { $restricted = false; @@ -82,7 +80,7 @@ class DiscussionPolicy extends AbstractPolicy } if ($restricted) { - return false; + return true; } } }
Change tag permission logic Require a user to have permission for *all* of the restricted tags a discussion has, rather than just one. See <URL>
flarum_tags
train
php
bb5cbbd60652df9e5a956819d609ea678487bd24
diff --git a/xapian_backend.py b/xapian_backend.py index <HASH>..<HASH> 100644 --- a/xapian_backend.py +++ b/xapian_backend.py @@ -271,9 +271,7 @@ class SearchBackend(BaseSearchBackend): warnings.warn("Highlight has not been implemented yet.", Warning, stacklevel=2) database = xapian.Database(self.path) - - if getattr(settings, 'HAYSTACK_INCLUDE_SPELLING', False) is True: - spelling_suggestion = '' + spelling_suggestion = None if query_string == '*': query = xapian.Query('') # Make '*' match everything @@ -301,7 +299,7 @@ class SearchBackend(BaseSearchBackend): matches = enquire.get_mset(start_offset, end_offset) results = self._process_results(matches, facets) - if getattr(settings, 'HAYSTACK_INCLUDE_SPELLING', False) is True: + if spelling_suggestion: results['spelling_suggestion'] = spelling_suggestion return results
Small refactor on spelling suggestions in SearchBackend.search method
notanumber_xapian-haystack
train
py
c71ab90f5f7f724f712012dd4405afda9818e0f0
diff --git a/nameko/nameko_doc/entities.py b/nameko/nameko_doc/entities.py index <HASH>..<HASH> 100644 --- a/nameko/nameko_doc/entities.py +++ b/nameko/nameko_doc/entities.py @@ -1,5 +1,5 @@ from collections import namedtuple -import rst_render as rst +from . import rst_render as rst TITLE_LEVEL_FOR_SUBSECTIONS = 2 diff --git a/nameko/nameko_doc/method_extractor.py b/nameko/nameko_doc/method_extractor.py index <HASH>..<HASH> 100644 --- a/nameko/nameko_doc/method_extractor.py +++ b/nameko/nameko_doc/method_extractor.py @@ -1,7 +1,7 @@ import inspect import logging -import entities +from . import entities from nameko.rpc import Rpc
make accidentally implicitly relative imports explicit
nameko_nameko
train
py,py
0b591b179d418c58230c5c654fa3d886ea57b0b3
diff --git a/imagemounter/volume.py b/imagemounter/volume.py index <HASH>..<HASH> 100644 --- a/imagemounter/volume.py +++ b/imagemounter/volume.py @@ -561,6 +561,8 @@ class Volume(object): self.fstype = 'jffs2' elif "minix filesystem" in fsdesc: self.fstype = 'minix' + elif 'vmfs_volume_member' in fsdesc: + self.fstype = 'vmfs' elif fsdesc == 'dos': self.fstype = 'volumesystem' self.volumes.vstype = 'dos'
Improve support for detecting vmfs
ralphje_imagemounter
train
py
bb611324a9597307df6c226673913820538de48e
diff --git a/lib/fog/rackspace/authentication.rb b/lib/fog/rackspace/authentication.rb index <HASH>..<HASH> 100644 --- a/lib/fog/rackspace/authentication.rb +++ b/lib/fog/rackspace/authentication.rb @@ -20,11 +20,11 @@ module Fog @identity_service != nil end - def authenticate_v2(options) + def authenticate_v2(identity_options) h = { - :rackspace_api_key => options[:rackspace_api_key], - :rackspace_username => options[:rackspace_username], - :rackspace_auth_url => options[:rackspace_auth_url] + :rackspace_api_key => identity_options[:rackspace_api_key], + :rackspace_username => identity_options[:rackspace_username], + :rackspace_auth_url => identity_options[:rackspace_auth_url] } @identity_service = Fog::Rackspace::Identity.new(h)
[rackspace] renaming variables in the interest of clarification
fog_fog
train
rb
c580677211c3a66ddae42844100ceceb8c216f4c
diff --git a/packages/react-server/core/ClientController.js b/packages/react-server/core/ClientController.js index <HASH>..<HASH> 100644 --- a/packages/react-server/core/ClientController.js +++ b/packages/react-server/core/ClientController.js @@ -271,7 +271,7 @@ class ClientController extends EventEmitter { currentBaseTag = document.createElement("base"); document.head.appendChild(currentBaseTag); } - currentBaseTag.href = base.href; + if (base.href) currentBaseTag.href = base.href; if (base.target) currentBaseTag.target = base.target; }
Only set href on base tag if it existed previously
redfin_react-server
train
js
899a400cab9ea3286c49f2f7dc7657377aef022d
diff --git a/generate/generate.go b/generate/generate.go index <HASH>..<HASH> 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -1207,7 +1207,7 @@ func (g *Generator) DropProcessCapabilityPermitted(c string) error { cp := strings.ToUpper(c) for i, cap := range g.spec.Process.Capabilities.Permitted { if strings.ToUpper(cap) == cp { - g.spec.Process.Capabilities.Ambient = removeFunc(g.spec.Process.Capabilities.Ambient, i) + g.spec.Process.Capabilities.Permitted = removeFunc(g.spec.Process.Capabilities.Permitted, i) } }
generate: fix handling of permitted caps drop
opencontainers_runtime-tools
train
go
9b4a41b55fef21567aac5248c445dda4265a6a10
diff --git a/src/projexui/widgets/xviewwidget/xviewwidget.py b/src/projexui/widgets/xviewwidget/xviewwidget.py index <HASH>..<HASH> 100644 --- a/src/projexui/widgets/xviewwidget/xviewwidget.py +++ b/src/projexui/widgets/xviewwidget/xviewwidget.py @@ -136,7 +136,15 @@ class XViewWidget(QtGui.QScrollArea): :return <XViewPanel> || None """ focus_widget = QtGui.QApplication.instance().focusWidget() - return projexui.ancestor(focus_widget, XViewPanel) + focus_panel = projexui.ancestor(focus_widget, XViewPanel) + + panels = self.panels() + if focus_panel in panels: + return focus_panel + try: + return panels[0] + except AttributeError: + return None def currentView(self): """
checking to make sure the focus panel is within the view widget
bitesofcode_projexui
train
py
99a1d5a8b53a90c11c02ee5600a2695e18186769
diff --git a/tests/integration/config.py b/tests/integration/config.py index <HASH>..<HASH> 100644 --- a/tests/integration/config.py +++ b/tests/integration/config.py @@ -8,6 +8,9 @@ class TestConfig(object): SQLALCHEMY_DATABASE_URI = "sqlite://" SQLALCHEMY_ECHO = False + CELERY_ALWAYS_EAGER = True # run tasks locally, no async + CELERY_EAGER_PROPAGATES_EXCEPTIONS = True + CSRF_ENABLED = False SECRET_KEY = "tototiti" SALT = "retwis"
celery config for tests: no async, propagate exceptions
abilian_abilian-core
train
py
3685a0ec7cb01048ae97d7050252ef39c720decb
diff --git a/packages/react-server-website/components/Header.js b/packages/react-server-website/components/Header.js index <HASH>..<HASH> 100644 --- a/packages/react-server-website/components/Header.js +++ b/packages/react-server-website/components/Header.js @@ -9,13 +9,13 @@ import './Header.less'; const links = [ { - label: "Source", - path: "/source", + label: "Docs", + path: "/docs", internal: true, }, { - label: "Docs", - path: "/docs", + label: "Source", + path: "/source", internal: true, }, {
Reorder header links (#<I>)
redfin_react-server
train
js
61274ae9940daedbb40345868257676d88de5795
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def find_package_data(package): setuptools.setup( name='brozzler', - version='1.5.dev320', + version='1.5.0', description='Distributed web crawling with browsers', url='https://github.com/internetarchive/brozzler', author='Noah Levitt', @@ -71,7 +71,7 @@ setuptools.setup( 'websocket-client>=0.39.0,<=0.48.0', 'pillow>=5.2.0', 'urlcanon>=0.1.dev23', - 'doublethink>=0.2.0.dev90', + 'doublethink>=0.2.0', 'rethinkdb>=2.3', 'cerberus>=1.0.1', 'jinja2>=2.10',
peg to working doublethink see: <URL>
internetarchive_brozzler
train
py
0d6081a764cb9efaacb83fe051e02ec6f4735375
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ def runSetup(): 'gcs_oauth2_boto_plugin==1.9', botoRequirement], 'cwl': [ - 'cwltool==1.0.20170810192106', + 'cwltool==1.0.20170815202200', 'schema-salad >= 2.6, < 3', 'cwltest>=1.0.20170214185319']}, package_dir={'': 'src'}, diff --git a/src/toil/cwl/cwltoil.py b/src/toil/cwl/cwltoil.py index <HASH>..<HASH> 100755 --- a/src/toil/cwl/cwltoil.py +++ b/src/toil/cwl/cwltoil.py @@ -743,7 +743,7 @@ def main(args=None, stdout=sys.stdout): if options.logLevel: cwllogger.setLevel(options.logLevel) - outdir = options.outdir + outdir = os.path.abspath(options.outdir) fileindex = {} existing = {}
Bump cwltool version for reverse mapping fix. Get abspath for output directory.
DataBiosphere_toil
train
py,py
22ec5b6fa944acf884f4aeaf41b2a33e2f8b896a
diff --git a/lib/natto/binding.rb b/lib/natto/binding.rb index <HASH>..<HASH> 100644 --- a/lib/natto/binding.rb +++ b/lib/natto/binding.rb @@ -68,8 +68,8 @@ module Natto cmd = 'mecab-config --libs' Open3.popen3(cmd) do |stdin,stdout,stderr| toks = stdout.read.split - base = toks.first[2..-1] - lib = toks.last[2..-1] + base = toks[0][2..-1] + lib = toks[1][2..-1] end File.realpath(File.join(base, "lib#{lib}.#{ext}")) rescue
Slight fix for mecab-config behavior on Mac OS. Issue <I>. user: buruzaemon branch 'default' changed lib/natto/binding.rb
buruzaemon_natto
train
rb
d01b09256f8fda4b222f3e26366817f4ac5b4c5a
diff --git a/zinnia/tests/test_admin_forms.py b/zinnia/tests/test_admin_forms.py index <HASH>..<HASH> 100644 --- a/zinnia/tests/test_admin_forms.py +++ b/zinnia/tests/test_admin_forms.py @@ -15,11 +15,6 @@ class EntryAdminFormTestCase(TestCase): isinstance(form.fields['categories'].widget, RelatedFieldWidgetWrapper)) - def test_initial_sites(self): - form = EntryAdminForm() - self.assertEqual( - len(form.fields['sites'].initial), 1) - class CategoryAdminFormTestCase(TestCase):
Remove now useless test for initial sites value in form
Fantomas42_django-blog-zinnia
train
py
a3f421f8325838f1e2d4d1f991b39887957c4233
diff --git a/src/deprecated/platformSpecificDeprecated.android.js b/src/deprecated/platformSpecificDeprecated.android.js index <HASH>..<HASH> 100644 --- a/src/deprecated/platformSpecificDeprecated.android.js +++ b/src/deprecated/platformSpecificDeprecated.android.js @@ -170,6 +170,7 @@ function addTabIcon(tab) { function navigatorSetButtons(navigator, navigatorEventID, params) { if (params.rightButtons) { params.rightButtons.forEach(function(button) { + button.enabled = !button.disabled; if (button.icon) { const icon = resolveAssetSource(button.icon); if (icon) {
Added the fix for old API setting disabled for buttons to navigatorSetButtons
wix_react-native-navigation
train
js
de640a09345610d1d07bf149f608bf016d69480f
diff --git a/PyTest/test_suite.py b/PyTest/test_suite.py index <HASH>..<HASH> 100644 --- a/PyTest/test_suite.py +++ b/PyTest/test_suite.py @@ -1,8 +1,9 @@ from unittest import TestCase -#from pydbc import connect import pyodbc as pydbc +#import pydbc dsn = "DSN=PostgreSQL R&D test database" +#dsn = "PostgreSQL R&D test database" class TestConnect(TestCase): @@ -48,6 +49,20 @@ class TestConnect(TestCase): with self.assertRaises(BaseException): connection.execute("Oh Boy!") +class TestResultSet(TestCase): + + def setUp(self): + self.connection = pydbc.connect(dsn) + self.cursor = self.connection.cursor() + + def tearDown(self): + self.cursor.close() + self.connection.close() + + def test_single_row_integer_result(self): + result = self.cursor.execute("select 42") + row = result.fetchone() + self.assertItemsEqual(row, [42]) if __name__ == '__main__': from unittest import main
added select <I> test case
blue-yonder_turbodbc
train
py
b424eb131e7c303df8bbf4c86e63f63157052d8b
diff --git a/Access/Gate.php b/Access/Gate.php index <HASH>..<HASH> 100644 --- a/Access/Gate.php +++ b/Access/Gate.php @@ -275,7 +275,7 @@ class Gate implements GateContract * @param \Illuminate\Contracts\Auth\Authenticatable $user * @param string $ability * @param array $arguments - * @return bool|void + * @return bool|null */ protected function callBeforeCallbacks($user, $ability, array $arguments) { diff --git a/Access/HandlesAuthorization.php b/Access/HandlesAuthorization.php index <HASH>..<HASH> 100644 --- a/Access/HandlesAuthorization.php +++ b/Access/HandlesAuthorization.php @@ -7,6 +7,7 @@ trait HandlesAuthorization /** * Create a new access response. * + * @param string|null $message * @return \Illuminate\Auth\Access\Response */ protected function allow($message = null) diff --git a/Guard.php b/Guard.php index <HASH>..<HASH> 100755 --- a/Guard.php +++ b/Guard.php @@ -221,7 +221,7 @@ class Guard implements GuardContract /** * Get the user ID from the recaller cookie. * - * @return string + * @return string|null */ protected function getRecallerId() {
Corrected PhpDoc blocks
illuminate_auth
train
php,php,php
4b06a32753fa94803e1134076fa299bcce69b299
diff --git a/lib/svtplay_dl/tests/utils.py b/lib/svtplay_dl/tests/utils.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/tests/utils.py +++ b/lib/svtplay_dl/tests/utils.py @@ -7,17 +7,17 @@ from __future__ import absolute_import import unittest -import svtplay_dl.utils +import svtplay_dl.subtitle class timestrTest(unittest.TestCase): def test_1(self): - self.assertEqual(svtplay_dl.utils.timestr(1), "00:00:00,00") + self.assertEqual(svtplay_dl.subtitle.timestr(1), "00:00:00,00") def test_100(self): - self.assertEqual(svtplay_dl.utils.timestr(100), "00:00:00,10") + self.assertEqual(svtplay_dl.subtitle.timestr(100), "00:00:00,10") def test_3600(self): - self.assertEqual(svtplay_dl.utils.timestr(3600), "00:00:03,60") + self.assertEqual(svtplay_dl.subtitle.timestr(3600), "00:00:03,60") def test_3600000(self): - self.assertEqual(svtplay_dl.utils.timestr(3600000), "01:00:00,00") + self.assertEqual(svtplay_dl.subtitle.timestr(3600000), "01:00:00,00")
tests: update the path to timestr
spaam_svtplay-dl
train
py
4e7e80a1233b549608036f9d06847d96577601d7
diff --git a/context/context_test.go b/context/context_test.go index <HASH>..<HASH> 100644 --- a/context/context_test.go +++ b/context/context_test.go @@ -153,7 +153,7 @@ func testDependsOn(t *testing.T, c *ctx) { func TestGoContext(t *testing.T) { goCtx := stdctx.Background() - xCtx := NewContext().(*ctx) + xCtx := NewContext() var ( exists bool diff --git a/context/types.go b/context/types.go index <HASH>..<HASH> 100644 --- a/context/types.go +++ b/context/types.go @@ -21,6 +21,8 @@ package context import ( + stdctx "context" + "github.com/m3db/m3x/pool" "github.com/m3db/m3x/resource" ) @@ -63,6 +65,12 @@ type Context interface { // Reset will reset the context for reuse. Reset() + + // GoContext returns the Go std context + GoContext() (stdctx.Context, bool) + + // SetGoContext sets the Go std context + SetGoContext(stdctx.Context) } // Pool provides a pool for contexts.
Add go std ctx functions to interface (#<I>)
m3db_m3x
train
go,go
162347dbed646e71eafa60d6ce577a0868e4f474
diff --git a/grimoire_elk/_version.py b/grimoire_elk/_version.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/_version.py +++ b/grimoire_elk/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.26.1" +__version__ = "0.26.2"
[grimoire_elk] Update version for pip packages to <I>
chaoss_grimoirelab-elk
train
py
0fa38eccc0e25deb782c7afd83b42dd9335dd6f7
diff --git a/tests/lax_control_flow_test.py b/tests/lax_control_flow_test.py index <HASH>..<HASH> 100644 --- a/tests/lax_control_flow_test.py +++ b/tests/lax_control_flow_test.py @@ -1368,7 +1368,7 @@ class LaxControlFlowTest(jtu.JaxTestCase): def testIssue810(self): def loss(A): def step(x, i): - return A @ x, None + return np.matmul(A, x), None init_x = np.zeros(A.shape[-1:]) last_x, _ = lax.scan(step, init_x, np.arange(10)) return np.sum(last_x)
use np.matmul and not `@` for py<I>
tensorflow_probability
train
py
68c7f47515c3ffcd9d5ee61cd5ac13c1be238a29
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityScheduler.java @@ -594,8 +594,12 @@ public class SingularityScheduler { private int getNumMissingInstances(List<SingularityTaskId> matchingTaskIds, SingularityRequest request, SingularityPendingRequest pendingRequest, Optional<SingularityPendingDeploy> maybePendingDeploy) { - if (request.isOneOff() && pendingRequest.getPendingType() == PendingType.ONEOFF) { - return 1; + if (request.isOneOff()) { + if (pendingRequest.getPendingType() == PendingType.ONEOFF) { + return 1; + } else { + return 0; + } } return numInstancesExpected(request, pendingRequest, maybePendingDeploy) - matchingTaskIds.size();
make sure to only schedule on demand on ONEOFF pending type
HubSpot_Singularity
train
java
02fe6a98557c20d47f7ac0bca7cdcc3f843baa12
diff --git a/pkg/oc/cli/rsh/rsh.go b/pkg/oc/cli/rsh/rsh.go index <HASH>..<HASH> 100644 --- a/pkg/oc/cli/rsh/rsh.go +++ b/pkg/oc/cli/rsh/rsh.go @@ -58,6 +58,10 @@ var ( # Open a shell session on the first container in pod 'foo' %[1]s foo + # Open a shell session on the first container in pod 'foo' and namespace 'bar' + # (Note that oc client specific arguments must come before the resource name and its arguments) + %[1]s -n bar foo + # Run the command 'cat /etc/resolv.conf' inside pod 'foo' %[1]s foo cat /etc/resolv.conf @@ -65,7 +69,7 @@ var ( %[1]s dc/docker-registry cat config.yml # Open a shell session on the container named 'index' inside a pod of your job - # %[1]s -c index job/sheduled`) + %[1]s -c index job/sheduled`) ) // RshOptions declare the arguments accepted by the Rsh command
Add example 'oc rsh' command to reduce further false issue reports like #<I> and #<I>
openshift_origin
train
go
d3d2da951e1c23db18293b7b9d42371234259927
diff --git a/engine/podgroup_ops.go b/engine/podgroup_ops.go index <HASH>..<HASH> 100644 --- a/engine/podgroup_ops.go +++ b/engine/podgroup_ops.go @@ -158,6 +158,10 @@ func (op pgOperRefreshInstance) Do(pgCtrl *podGroupController, c cluster.Cluster pgCtrl.RUnlock() }() + if(op.instanceNo > len(pgCtrl.podCtrls)){ + log.Warnf("Pod is not exists") + return false + } podCtrl := pgCtrl.podCtrls[op.instanceNo-1] podCtrl.Refresh(c)
Fixed bug for refresh when pod is shrinked
laincloud_deployd
train
go
ecab5f46adaec6c21da675ab74d5efa4a84adcab
diff --git a/Swat/SwatTreeNode.php b/Swat/SwatTreeNode.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTreeNode.php +++ b/Swat/SwatTreeNode.php @@ -1,4 +1,6 @@ <?php +require_once('Swat/SwatObject.php'); + /** * A simple class for building a tree structure *
Fixed require for SwatObject svn commit r<I>
silverorange_swat
train
php
8cae6df6961abd1cea10b640b45dc81d8eaecadb
diff --git a/cocaine/proxy/proxy.py b/cocaine/proxy/proxy.py index <HASH>..<HASH> 100644 --- a/cocaine/proxy/proxy.py +++ b/cocaine/proxy/proxy.py @@ -418,7 +418,7 @@ class CocaineProxy(object): channel = yield app.enqueue(event, trace=trace) request.logger.debug("%d: send event data (attempt %d)", id(app), attempts) yield channel.tx.write(msgpack.packb(data), trace=trace) - yield channel.tx.close() + yield channel.tx.close(trace=trace) request.logger.debug("%d: waiting for a code and headers (attempt %d)", id(app), attempts) code_and_headers = yield channel.rx.get(timeout=timeout) request.logger.debug("%d: code and headers have been received (attempt %d)", id(app), attempts)
Tracing: pass trace id on channel close event.
cocaine_cocaine-tools
train
py
28df34f9bae78b3499c466b65c31f7ab56a4e9ee
diff --git a/src/Core/Repository/RepositoryService.php b/src/Core/Repository/RepositoryService.php index <HASH>..<HASH> 100644 --- a/src/Core/Repository/RepositoryService.php +++ b/src/Core/Repository/RepositoryService.php @@ -31,7 +31,7 @@ class RepositoryService $entityName = $nameParts[1]; $entityClass = "\\$namespace\\Entity\\$entityName"; - $repository = $this->getRepository($entityClass); + $repository = $this->dm->getRepository($entityClass); $repository->setEntityPrototype(new $entityClass()); return $repository;
[Core] Fix: Typo in RepositoryService.
yawik_core
train
php
c304ee903f0b990fbc40ee91d7f943e15db937a6
diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index <HASH>..<HASH> 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -11,7 +11,7 @@ from .errors import (RPCError, UnauthorizedError, InvalidParameterError, ReadCancelledError, FileMigrateError, PhoneMigrateError, NetworkMigrateError, UserMigrateError, PhoneCodeEmptyError, PhoneCodeExpiredError, PhoneCodeHashEmptyError, - PhoneCodeInvalidError) + PhoneCodeInvalidError, InvalidChecksumError) # For sending and receiving requests from .tl import MTProtoRequest, Session, JsonSession @@ -817,6 +817,14 @@ class TelegramClient(TelegramBareClient): except ReadCancelledError: self._logger.info('Receiving updates cancelled') + except BrokenPipeError: + self._logger.info('Tcp session is broken. Reconnecting...') + self.reconnect() + + except InvalidChecksumError: + self._logger.info('MTProto session is broken. Reconnecting...') + self.reconnect() + except OSError: self._logger.warning('OSError on updates thread, %s logging out', 'was' if self.sender.logging_out else 'was not')
Trigger reconnection on BrokenPipeError and InvalidChecksumError
LonamiWebs_Telethon
train
py
830d499ce47e5a6bcd68badcf35934b7c71bc50f
diff --git a/openquake/calculators/hazard/general.py b/openquake/calculators/hazard/general.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/hazard/general.py +++ b/openquake/calculators/hazard/general.py @@ -152,7 +152,7 @@ def validate_site_model(sm_nodes, mesh): ) sm_ch = sm_mp.convex_hull - # Enlarging the area because the site model nodes + # Enlarging the area if the site model nodes # create a straight line with zero area. if sm_ch.area == 0: sm_ch = sm_ch.buffer(DILATION_ONE_METER)
replaced because with if :) Former-commit-id: f<I>ba<I>d<I>b0f<I>f6b<I>be4b5
gem_oq-engine
train
py
81ee4f9339b995d995ab58341be7ee870f6b2bc7
diff --git a/lib/record-stream.js b/lib/record-stream.js index <HASH>..<HASH> 100644 --- a/lib/record-stream.js +++ b/lib/record-stream.js @@ -118,7 +118,7 @@ Parsable.prototype.stream = function(type, options) { } if (!this._dataStream) { this._dataStream = new PassThrough(); - this._parserStream = converter.parse(options); + this._parserStream = converter.parse(options).on('error', (error) => this.emit('error', error)); this._parserStream.pipe(this).pipe(new PassThrough({ objectMode: true, highWaterMark: ( 500 * 1000 ) })); } return this._dataStream;
Catch csv parsing errors and emit
jsforce_jsforce
train
js
91dc1edd84bf0a4137dcc969256c717c61b2989c
diff --git a/src/AutosizeInput.js b/src/AutosizeInput.js index <HASH>..<HASH> 100644 --- a/src/AutosizeInput.js +++ b/src/AutosizeInput.js @@ -79,7 +79,7 @@ var AutosizeInput = React.createClass({ var escapedValue = (this.props.value || '').replace(/\&/g, '&amp;').replace(/ /g, '&nbsp;').replace(/\</g, '&lt;').replace(/\>/g, '&gt;'); var wrapperStyle = this.props.style || {}; wrapperStyle.display = 'inline-block'; - var inputStyle = this.props.inputStyle || {}; + var inputStyle = Object.assign({}, this.props.inputStyle); inputStyle.width = this.state.inputWidth; inputStyle.boxSizing = 'content-box'; var placeholder = this.props.placeholder ? <div ref="placeholderSizer" style={sizerStyle}>{this.props.placeholder}</div> : null;
Fixing an issue where props could be mutated
JedWatson_react-input-autosize
train
js
d13d5340b885acac1cd803221a65e6fb61502485
diff --git a/builder.go b/builder.go index <HASH>..<HASH> 100644 --- a/builder.go +++ b/builder.go @@ -212,6 +212,7 @@ func NewStages(node *parser.Node, b *Builder) (Stages, error) { Builder: &Builder{ Args: b.Args, AllowedArgs: b.AllowedArgs, + Env: b.Env, }, Node: root, }) @@ -436,7 +437,7 @@ func (b *Builder) FromImage(image *docker.Image, node *parser.Node) error { SplitChildren(node, command.From) b.RunConfig = *image.Config - b.Env = b.RunConfig.Env + b.Env = append(b.Env, b.RunConfig.Env...) b.RunConfig.Env = nil // Check to see if we have a default PATH, note that windows won't
Add env to stage Add env from containers.conf to stage so buildah bud can set default env for containers using containers.conf.
openshift_imagebuilder
train
go
48e8e180c2f77dea46ee45209f69a88ddddc7c4c
diff --git a/sentry/client/base.py b/sentry/client/base.py index <HASH>..<HASH> 100644 --- a/sentry/client/base.py +++ b/sentry/client/base.py @@ -52,10 +52,10 @@ class SentryClient(object): try: response = urllib2.urlopen(req, None, settings.REMOTE_TIMEOUT).read() except urllib2.URLError, e: - logger.error('Unable to reach Sentry log server: %s' % (e,), extra={'exc_info': sys.exc_info(), 'remote_url': url}) + logger.error('Unable to reach Sentry log server: %s' % (e,), exc_info=sys.exc_info(), extra={'remote_url': url}) logger.log(kwargs.pop('level', None) or logging.ERROR, kwargs.pop('message', None)) except urllib2.HTTPError, e: - logger.error('Unable to reach Sentry log server: %s' % (e,), extra={'exc_info': sys.exc_info(), 'body': e.read(), 'remote_url': url}) + logger.error('Unable to reach Sentry log server: %s' % (e,), exc_info=sys.exc_info(), extra={'body': e.read(), 'remote_url': url}) logger.log(kwargs.pop('level', None) or logging.ERROR, kwargs.pop('message', None)) else: from sentry.models import GroupedMessage
exc_info isnt part of extra, its on the base log method
elastic_apm-agent-python
train
py
51ef5628d07c3a39aff7219e598e67de6e8b2332
diff --git a/addon/models/session.js b/addon/models/session.js index <HASH>..<HASH> 100644 --- a/addon/models/session.js +++ b/addon/models/session.js @@ -8,17 +8,17 @@ export default Ember.Object.extend({ this.set('auth', OAuth2.create({providerId: this.get('providerId')})); } }, - - provider: function(providerId, auth) { - if (arguments.length === 1) { - this.set('providerId', providerId); - this.set('auth', OAuth2.create({providerId: providerId})); - } else if (arguments.length === 2) { - this.set('providerId', providerId); - this.set('auth', auth); + + provider: Ember.computed('auth', { + /*jshint unused: false*/ + get(key) { + return this.get('auth'); + }, + set(key, value) { + this.set('providerId', value); + this.set('auth', OAuth2.create({providerId: value})); } - return this.get('auth'); - }, + }), isExpired: function() { if (this.get('auth')) {
new ember api for getter setter on provider
amkirwan_ember-token-auth
train
js
43f3eb30f901e47419a2d3a65050e87cfdd0cd82
diff --git a/classes/lazy.php b/classes/lazy.php index <HASH>..<HASH> 100644 --- a/classes/lazy.php +++ b/classes/lazy.php @@ -67,7 +67,7 @@ class ezpRestPoConfig implements ezcBaseConfigurationInitializer { public static function configureObject( $instance ) { - return new ezcPersistentSession( ezcDbInstance::get(), new ezcPersistentCodeManager( 'rest/rest/classes/po_maps' ) ); + return new ezcPersistentSession( ezcDbInstance::get(), new ezcPersistentCodeManager( 'extension/rest/classes/po_maps' ) ); } } ezcBaseInit::setCallback( 'ezcInitPersistentSessionInstance', 'ezpRestPoConfig' );
Fixed path to persistent objects, and removed some debugging
ezsystems_ezpublish-legacy
train
php
05d5fbf09094501e8243b9beb80794f1b64713a4
diff --git a/packages/www/gulpfile.js b/packages/www/gulpfile.js index <HASH>..<HASH> 100644 --- a/packages/www/gulpfile.js +++ b/packages/www/gulpfile.js @@ -56,7 +56,7 @@ const buildViewForPageUrl = (basename, pageUrl = config.get("www.publishUrl")) = packageJson, pageUrl, injectedScript: [ - `<script type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="${config.get("crisp.app.id")}";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>` + `<script>window.$crisp=[];window.CRISP_WEBSITE_ID="${config.get("crisp.app.id")}";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>` ].join("") }) }))
chore: `<script type="application/javascript">` -> `<script>`.
randytarampi_me
train
js
3c6d38652b6801ab91562df6d8530113d6f20403
diff --git a/spec/pg_search_spec.rb b/spec/pg_search_spec.rb index <HASH>..<HASH> 100644 --- a/spec/pg_search_spec.rb +++ b/spec/pg_search_spec.rb @@ -272,9 +272,11 @@ describe "an ActiveRecord model which includes PgSearch" do end it "returns rows where at one column contains all of the terms in the query and another does not" do - included = model_with_pg_search.create!(:title => 'foo', :content => 'bar') + in_title = model_with_pg_search.create!(:title => 'foo', :content => 'bar') + in_content = model_with_pg_search.create!(:title => 'bar', :content => 'foo') + results = model_with_pg_search.search_title_and_content('foo') - results.should == [included] + results.should =~ [in_title, in_content] end # Searching with a NULL column will prevent any matches unless we coalesce it.
Test both columns in the multiple columns spec
Casecommons_pg_search
train
rb
6cae4ca14c18a34b15799cb77e042d26b91b2620
diff --git a/config/set/common/control-structures.php b/config/set/common/control-structures.php index <HASH>..<HASH> 100644 --- a/config/set/common/control-structures.php +++ b/config/set/common/control-structures.php @@ -3,7 +3,6 @@ declare(strict_types=1); use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff; -use PhpCsFixer\Fixer\Basic\Psr4Fixer; use PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer; use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer; use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer; @@ -45,8 +44,6 @@ return static function (ContainerConfigurator $containerConfigurator): void { $services->set(ExplicitIndirectVariableFixer::class); - $services->set(Psr4Fixer::class); - $services->set(SingleClassElementPerStatementFixer::class) ->call('configure', [[ 'elements' => ['const', 'property'],
[CI] split split and tagged split
Symplify_EasyCodingStandard
train
php
feffdd2cf832cad09f569ee232ea08fe8fd455ee
diff --git a/polyfills/Array.prototype.some/tests.js b/polyfills/Array.prototype.some/tests.js index <HASH>..<HASH> 100644 --- a/polyfills/Array.prototype.some/tests.js +++ b/polyfills/Array.prototype.some/tests.js @@ -1,3 +1,4 @@ +// See: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.some beforeEach(function() { this.array = [0, 2, 4, 6, 8, 10, 12, 14];
Added link to documentation in living draft
Financial-Times_polyfill-service
train
js
03807b4cd2b235b14dc3e5ce6f36d4839e76b0b2
diff --git a/features/support/cucumber_rails_helper.rb b/features/support/cucumber_rails_helper.rb index <HASH>..<HASH> 100644 --- a/features/support/cucumber_rails_helper.rb +++ b/features/support/cucumber_rails_helper.rb @@ -48,6 +48,7 @@ module CucumberRailsHelper def bundle_install run_command_and_stop 'bundle config set --local without "development"' + run_command_and_stop "bundle config set --local path '#{ENV['GITHUB_WORKSPACE']}/vendor/bundle'" if ENV.key?('GITHUB_WORKSPACE') run_command_and_stop 'bundle install' end
Use GitHub workspace gem cache when running tests in CI
cucumber_cucumber-rails
train
rb
391ba6f91aec79f00c770f8f8db2566197b49d21
diff --git a/test/test/util/test_scheme.js b/test/test/util/test_scheme.js index <HASH>..<HASH> 100644 --- a/test/test/util/test_scheme.js +++ b/test/test/util/test_scheme.js @@ -275,10 +275,17 @@ shaka.test.TestScheme.createManifests = function(shaka, suffix) { } } }); + + // This seems to be necessary. Otherwise, we end up with a URL like + // "http:/base/..." which then fails to load on Safari for some reason. + var locationUri = new goog.Uri(location.href); + var partialUri = new goog.Uri(data.text.uri); + var absoluteUri = locationUri.resolve(partialUri); + gen.addStreamSet('text') .addStream(2) .mime(data.text.mimeType, data.text.codec) - .textStream(data.text.uri); + .textStream(absoluteUri.toString()); MANIFESTS[name + suffix] = gen.build(); }
Fix failure to load test vtt stream on Safari Only seems to affect Safari, and only the tests in Player integration. Change-Id: I1befa<I>c3a<I>e<I>b9a0bf8c<I>bbfefd<I>c4cc<I>
google_shaka-player
train
js
1190765378a4268713f78dce5c7d6d5199ae89e4
diff --git a/Auth/OpenID/AX.php b/Auth/OpenID/AX.php index <HASH>..<HASH> 100644 --- a/Auth/OpenID/AX.php +++ b/Auth/OpenID/AX.php @@ -806,7 +806,7 @@ class Auth_OpenID_AX_FetchResponse extends Auth_OpenID_AX_KeyValueMessage { * arguments that represent this fetch_response, or * Auth_OpenID_AX_Error on error. */ - function getExtensionArgs(&$request) + function getExtensionArgs($request=null) { $aliases = new Auth_OpenID_NamespaceMap();
[project @ Auth_OpenID_AX_FetchResponse::getExtensionArgs takes request by value, defaults to null]
openid_php-openid
train
php
485f5400db2604918d7b76a50e95f2633cd13188
diff --git a/admin_interface/settings.py b/admin_interface/settings.py index <HASH>..<HASH> 100644 --- a/admin_interface/settings.py +++ b/admin_interface/settings.py @@ -23,6 +23,5 @@ def check_installed_app(app, app_dj_version_limit): def check_installed_apps(): - check_installed_app('colorfield', (4, 0)) check_installed_app('flat', (1, 9)) check_installed_app('flat_responsive', (2, 0))
Removed: Checking condition for colorfield package (#<I>)
fabiocaccamo_django-admin-interface
train
py