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
3e244d7a7c3365d10a26c9cc8df4cdb2347dba4e
diff --git a/internal/uidriver/glfw/ui_unix.go b/internal/uidriver/glfw/ui_unix.go index <HASH>..<HASH> 100644 --- a/internal/uidriver/glfw/ui_unix.go +++ b/internal/uidriver/glfw/ui_unix.go @@ -34,7 +34,7 @@ func (u *UserInterface) adjustWindowPosition(x, y int) (int, int) { func (u *UserInterface) currentMonitorFromPosition() *glfw.Monitor { // TODO: Return more appropriate display. - if cm, ok := getCachedMonitor(u.window.GetPos()); ok { + if cm, ok := getCachedMonitor(u.window.GetMonitor()); ok { return cm.m } return glfw.GetPrimaryMonitor()
uidriver/glfw: Bug fix: compile error on Linux
hajimehoshi_ebiten
train
go
c3554e707d15fc987d1b009758589ed7c08b7009
diff --git a/mintapi/api.py b/mintapi/api.py index <HASH>..<HASH> 100644 --- a/mintapi/api.py +++ b/mintapi/api.py @@ -73,7 +73,11 @@ def get_accounts(email, password): if df in account: # Convert from javascript timestamp to unix timestamp # http://stackoverflow.com/a/9744811/5026 - ts = account[df] / 1e3 + try: + ts = account[df] / 1e3 + except TypeError: + # returned data is not a number, don't parse + continue account[df + 'InDate'] = datetime.fromtimestamp(ts) return accounts
Fix: Sometimes closeDate is None
mrooney_mintapi
train
py
db162f01674469db59e9f2ac36dd334a42abde79
diff --git a/lib/haml/template/plugin.rb b/lib/haml/template/plugin.rb index <HASH>..<HASH> 100644 --- a/lib/haml/template/plugin.rb +++ b/lib/haml/template/plugin.rb @@ -12,7 +12,8 @@ module Haml # template is a template object in Rails >=2.1.0, # a source string previously if template.respond_to? :source - options[:filename] = template.filename + # Template has a generic identifier in Rails >=3.0.0 + options[:filename] = template.respond_to?(:identifier) ? template.identifier : template.filename source = template.source else source = template
[Haml] Basic compatibility with edge rails. Closes gh-7
sass_ruby-sass
train
rb
34522c1cb67bbcd73030b9ac4a8783215cde2ffd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,9 @@ function Messenger (node, port, address) { this.address = address this.socket = dgram.createSocket("udp4") this.socket.bind(port, address) + this.close = function () { + this.socket.close() + } this.createMessage = function (obj) { return new Buffer(JSON.stringify(obj)) } @@ -170,6 +173,10 @@ function Node (id, address, port, generateProposalId, currentRound) { // :: Int } else { this.currentRound = 1 } + this.end = function () { + this.messenger.close() + // should probably persist stateLog here + } } function Cluster (nodes) { // :: [Node] -> Cluster
Close sockets. Don't know how I forgot this.
bigeasy_paxos
train
js
1f451c89602716bdbce3e050a10d7c02353209db
diff --git a/src/components/tabController/TabBar.js b/src/components/tabController/TabBar.js index <HASH>..<HASH> 100644 --- a/src/components/tabController/TabBar.js +++ b/src/components/tabController/TabBar.js @@ -241,7 +241,7 @@ class TabBar extends PureComponent { setItemsLayouts = () => { const {selectedIndex} = this.context; // It's important to calculate itemOffsets for RTL support - this._itemsOffsets = _.times(this._itemsWidths.length, (i) => _.chain(this._itemsWidths).take(i).sum().value()); + this._itemsOffsets = _.times(this._itemsWidths.length, (i) => _.chain(this._itemsWidths).take(i).sum().value() + this.centerOffset); const itemsOffsets = _.map(this._itemsOffsets, (offset) => offset + INDICATOR_INSET); const itemsWidths = _.map(this._itemsWidths, (width) => width - INDICATOR_INSET * 2); this.contentWidth = _.sum(this._itemsWidths);
Fixed issue with centered TabController's TabBar selected indicator not positioned correctly
wix_react-native-ui-lib
train
js
8cc4ab6c4bee3633522cf3b712bd400a872018b6
diff --git a/sprd/model/processor/BasketItemProcessor.js b/sprd/model/processor/BasketItemProcessor.js index <HASH>..<HASH> 100644 --- a/sprd/model/processor/BasketItemProcessor.js +++ b/sprd/model/processor/BasketItemProcessor.js @@ -46,6 +46,9 @@ define(['sprd/model/processor/DefaultProcessor', 'sprd/model/Shop', 'sprd/model/ link.href = decodeURI(link.href); link.href = link.href.replace("{BASKET_ID}", model.$context.$contextModel.$.id); link.href = link.href.replace("{BASKET_ITEM_ID}", payload.id); + elementPayload.editLink = link.href; + } else if (link.type == "continueShopping") { + elementPayload.continueShoppingLink = link.href; } }
DEV-<I> - fixed parsing of existing edit and continueShopping link
spreadshirt_rAppid.js-sprd
train
js
f2c44694e660f5b4d59ca86f75c81c0a2a67bc11
diff --git a/lib/class-wp-json-terms-controller.php b/lib/class-wp-json-terms-controller.php index <HASH>..<HASH> 100644 --- a/lib/class-wp-json-terms-controller.php +++ b/lib/class-wp-json-terms-controller.php @@ -176,7 +176,7 @@ class WP_JSON_Terms_Controller extends WP_JSON_Controller { } } - return array( + $data = array( 'id' => (int) $item->term_taxonomy_id, 'count' => (int) $item->count, 'description' => $item->description, @@ -184,6 +184,7 @@ class WP_JSON_Terms_Controller extends WP_JSON_Controller { 'slug' => $item->slug, 'parent_id' => (int) $parent_id, ); + return apply_filters( 'json_prepare_term', $data, $item, $request ); } /**
Pass prepared term through a filter This will make it easier for users to modify response values
WP-API_WP-API
train
php
6a5bc414566723ee7e8cfc26238d89beb6cd5b8a
diff --git a/games/facerank/server/game.room.js b/games/facerank/server/game.room.js index <HASH>..<HASH> 100644 --- a/games/facerank/server/game.room.js +++ b/games/facerank/server/game.room.js @@ -55,7 +55,7 @@ module.exports = function(node, channel) { room = channel.createGameRoom({ group: 'facerank', - playerList: tmpPlayerList, + clients: tmpPlayerList, channel: channel, logicPath: logicPath });
Updated 'playerList' to 'clients'
nodeGame_nodegame
train
js
df31a64d2ac992330a2b456e926fa1a06f3dd6e8
diff --git a/saspy/sasbase.py b/saspy/sasbase.py index <HASH>..<HASH> 100644 --- a/saspy/sasbase.py +++ b/saspy/sasbase.py @@ -1095,6 +1095,8 @@ class SASsession(): fmat += ';' else: raise TypeError("Bad key type. {} must be a str or dict type".format(key)) + else: + opts += key+'='+str(dsopts[key]) + ' ' if len(opts): opts = '(' + opts + ')'
add support to DSOPTS for any keyword=value
sassoftware_saspy
train
py
c2648135e3d666853ed2a6c2a7ab7daebb985d7e
diff --git a/libkbfs/block_retrieval_queue.go b/libkbfs/block_retrieval_queue.go index <HASH>..<HASH> 100644 --- a/libkbfs/block_retrieval_queue.go +++ b/libkbfs/block_retrieval_queue.go @@ -240,7 +240,9 @@ func (brq *blockRetrievalQueue) FinalizeRequest(retrieval *blockRetrieval, block // lock. retrieval.reqMtx.Lock() defer retrieval.reqMtx.Unlock() - brq.prefetcher.HandleBlock(block, retrieval.kmd, retrieval.priority) + if brq.prefetcher != nil { + brq.prefetcher.HandleBlock(block, retrieval.kmd, retrieval.priority) + } for _, r := range retrieval.requests { req := r if block != nil {
block_retrieval_queue: need nil check for prefetcher
keybase_client
train
go
3c0306822f2f671dd0c566db68be2ab6b209da7e
diff --git a/core/server/api/canary/members.js b/core/server/api/canary/members.js index <HASH>..<HASH> 100644 --- a/core/server/api/canary/members.js +++ b/core/server/api/canary/members.js @@ -54,7 +54,8 @@ module.exports = { 'order', 'debug', 'page', - 'search' + 'search', + 'include' ], permissions: true, validation: {},
Added `include` as a valid option for members browse api refs <URL>
TryGhost_Ghost
train
js
b6127de01ec7a6aee6ecc3ec451860263fdeeabb
diff --git a/clustered/client/src/main/java/org/ehcache/clustered/client/internal/service/DefaultClusteringService.java b/clustered/client/src/main/java/org/ehcache/clustered/client/internal/service/DefaultClusteringService.java index <HASH>..<HASH> 100644 --- a/clustered/client/src/main/java/org/ehcache/clustered/client/internal/service/DefaultClusteringService.java +++ b/clustered/client/src/main/java/org/ehcache/clustered/client/internal/service/DefaultClusteringService.java @@ -316,7 +316,7 @@ class DefaultClusteringService implements ClusteringService { this.entity.validateCache(cacheId, clientStoreConfiguration); } } catch (ClusteredStoreException e) { - throw new CachePersistenceException("Unable to create server store proxy for entity '" + entityIdentifier + "'", e); + throw new CachePersistenceException("Unable to create server store proxy '" + cacheIdentifier.getId() + "' for entity '" + entityIdentifier + "'", e); } ServerStoreMessageFactory messageFactory = new ServerStoreMessageFactory(cacheId);
#<I> add store name in reported exception
ehcache_ehcache3
train
java
8f845a356b5b348f17d2c44eaaa8d40b6c431e42
diff --git a/kernel/classes/packagecreators/ezextension/ezextensionpackagecreator.php b/kernel/classes/packagecreators/ezextension/ezextensionpackagecreator.php index <HASH>..<HASH> 100644 --- a/kernel/classes/packagecreators/ezextension/ezextensionpackagecreator.php +++ b/kernel/classes/packagecreators/ezextension/ezextensionpackagecreator.php @@ -148,6 +148,7 @@ class eZExtensionPackageCreator extends eZPackageCreationHandler if ( $extensionCount == 1 ) { + $extensionName = $extensionList[0]; $packageInformation['name'] = $extensionName; $packageInformation['summary'] = "$extensionName extension"; $packageInformation['description'] = "This package contains the $extensionName eZ Publish extension";
- Implemented enhancement #<I>: allow a package to contain more than one extension # fixed PHP notice introduced by previous commit for this enhancement git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
803759371ef2813db9001ecf6fcca49a410a3466
diff --git a/pyrabbit/api.py b/pyrabbit/api.py index <HASH>..<HASH> 100644 --- a/pyrabbit/api.py +++ b/pyrabbit/api.py @@ -441,8 +441,16 @@ class Client(object): """ vhost = '%2F' if vhost == '/' else vhost path = Client.urls['queues_by_name'] % (vhost, name) - queue = self.http.do_call(path, 'GET') - depth = queue['messages'] + queue = self.http.do_call(path,'GET') + depth = 0 + + if isinstance(queue, list): + for q in queue: + if q['name'] == name: + depth = q['messages'] + else: + depth = queue['messages'] + return depth def purge_queues(self, queues):
Support for virtual host with multiple queues
bkjones_pyrabbit
train
py
59330f69ee69fe988f3e15f92fdd8045c3abc651
diff --git a/Skinny.class.php b/Skinny.class.php index <HASH>..<HASH> 100644 --- a/Skinny.class.php +++ b/Skinny.class.php @@ -111,7 +111,7 @@ class Skinny{ if(empty($html)) return $html; - if( preg_match_all('~<ins data-type="movetoskin" data-name="([\w:]+)">([\S\s]*?)<\/ins>~m', $html, $matches, PREG_SET_ORDER) ){ + if( preg_match_all('~<ins data-type="movetoskin" data-name="([\w:-]+)">([\S\s]*?)<\/ins>~m', $html, $matches, PREG_SET_ORDER) ){ foreach($matches as $match){ if( !isset( self::$content[ $match[1] ] )){ self::$content[ $match[1] ] = array(); @@ -205,7 +205,7 @@ class Skinny{ $skinNames = \Skin::getSkinNames(); $skinName = $skinNames[$key]; - + $className = "\Skin{$skinName}"; if (class_exists($className)) { $skin = new $className();
fix: hyphens should be allowed in zone names
tinymighty_skinny
train
php
f2f2f7c1c171041c8123d8c7323ad24b9cd35a7a
diff --git a/dynamic_dynamodb/__init__.py b/dynamic_dynamodb/__init__.py index <HASH>..<HASH> 100644 --- a/dynamic_dynamodb/__init__.py +++ b/dynamic_dynamodb/__init__.py @@ -80,7 +80,7 @@ def main(): while True: table_names = set() configured_tables = config['tables'].keys() - not_used_tables = configured_tables + not_used_tables = set(configured_tables) # Add regexp table names for table_instance in dynamodb.list_tables(): @@ -93,7 +93,10 @@ def main(): table_instance.table_name, key_name )) - not_used_tables.remove(key_name) + not_used_tables.discard(key_name) + else: + logger.debug("Table {0} did not match with config key {1}".format( + table_instance.table_name, key_name)) if not_used_tables: logger.warning(
Update main() method to support matching multiple DynamoDB tables with a single table config
sebdah_dynamic-dynamodb
train
py
474c704924d1429bf623832d37ac5f7aa3155bcd
diff --git a/gkeepapi/node.py b/gkeepapi/node.py index <HASH>..<HASH> 100644 --- a/gkeepapi/node.py +++ b/gkeepapi/node.py @@ -1271,16 +1271,16 @@ class NodeDrawing(NodeBlob): class Blob(Node): """Represents a Google Keep blob.""" - def __init__(self, parent_id=None, **kwargs): - super(Blob, self).__init__(type_=NodeType.Blob, parent_id=parent_id, **kwargs) - self.blob = NodeBlob() - _blob_type_map = { BlobType.Audio: NodeAudio, BlobType.Image: NodeImage, BlobType.Drawing: NodeDrawing, } + def __init__(self, parent_id=None, **kwargs): + super(Blob, self).__init__(type_=NodeType.Blob, parent_id=parent_id, **kwargs) + self.blob = NodeBlob() + @classmethod def from_json(cls, raw): """Helper to construct a blob from a dict. @@ -1294,7 +1294,7 @@ class Blob(Node): cls = None _type = raw.get('type') try: - cls = BlobType(_type) + cls = self._blob_type_map[BlobType(_type)] except ValueError: logger.warning('Unknown blob type: %s', _type) return None
Issue #<I>: Fix BlobType callable error
kiwiz_gkeepapi
train
py
79851a4cb27fd5e8ffb98a0fa7ef0e917f543813
diff --git a/manticore/core/executor.py b/manticore/core/executor.py index <HASH>..<HASH> 100644 --- a/manticore/core/executor.py +++ b/manticore/core/executor.py @@ -148,14 +148,14 @@ class BranchLimited(Policy): with self.locked_context() as policy_ctx: visited = policy_ctx.get('visited', dict()) summaries = policy_ctx.get('summaries', dict()) - lst = [] - for id_, pc in summaries.items(): - cnt = visited.get(pc, 0) - if id_ not in state_ids: - continue - if cnt <= self._limit: - lst.append((id_, visited.get(pc, 0))) - lst = sorted(lst, key=lambda x: x[1]) + lst = [] + for id_, pc in summaries.items(): + cnt = visited.get(pc, 0) + if id_ not in state_ids: + continue + if cnt <= self._limit: + lst.append((id_, visited.get(pc, 0))) + lst = sorted(lst, key=lambda x: x[1]) if lst: return lst[0][0]
Issue <I> --> Global lock held for a bit long (#<I>) - Problem: * Global lock need to be held until the required variables are fetched * Lock should be released further while processing further - Fix: * Scope the lock loop until the variables are set - Uncertain: * A similar scenario in `choice` function, should it be fixed as well? * Do we have to explicitly unlock? * Should there be any error handle for failures in lock loop?
trailofbits_manticore
train
py
bf31d5d3181ec02218086f945ca245cc237d03e5
diff --git a/lib/Psc/CMS/Service/CMSService.php b/lib/Psc/CMS/Service/CMSService.php index <HASH>..<HASH> 100644 --- a/lib/Psc/CMS/Service/CMSService.php +++ b/lib/Psc/CMS/Service/CMSService.php @@ -29,7 +29,7 @@ class CMSService extends ControllerService { public function routeController(ServiceRequest $request) { $r = $this->initRequestMatcher($request); - $controller = $r->qmatchiRx('/^(tpl|excel|images|uploads)$/i'); + $controller = $r->qmatchiRx('/^(tpl|excel|images|uploads|persona)$/i'); if ($controller === 'tpl') { $x = 0; @@ -134,6 +134,10 @@ class CMSService extends ControllerService { return array($controller, $method, $params); } + } elseif ($controller === 'persona') { + $controller = new \Webforge\Persona\Controller(); + + return array($controller, 'verify', array($r->bvar('assertion'))); } throw HTTPException::NotFound('Die Resource für cms '.$request.' existiert nicht.');
add persona integration into cms service
webforge-labs_psc-cms
train
php
96edcd6a3b5a03b70f418bd83f22186046733dd1
diff --git a/pythonforandroid/recipes/libpq/__init__.py b/pythonforandroid/recipes/libpq/__init__.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/recipes/libpq/__init__.py +++ b/pythonforandroid/recipes/libpq/__init__.py @@ -4,10 +4,16 @@ import os.path class LibpqRecipe(Recipe): - version = '9.5.3' + version = '10.12' url = 'http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2' depends = [] + def get_recipe_env(self, arch): + env = super().get_recipe_env(arch) + env['USE_DEV_URANDOM'] = '1' + + return env + def should_build(self, arch): return not os.path.isfile('{}/libpq.a'.format(self.ctx.get_libs_dir(arch.arch)))
Bump libpq version (#<I>) * bump libpq version * Fix libpq env for cross compile
kivy_python-for-android
train
py
dc609b06fd35dcbfcf3108ff8ca48aa6be9f9034
diff --git a/cmd/influxd/run/command.go b/cmd/influxd/run/command.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/run/command.go +++ b/cmd/influxd/run/command.go @@ -67,14 +67,14 @@ func (cmd *Command) Run(args ...string) error { // Print sweet InfluxDB logo. fmt.Print(logo) + // Set parallelism. + runtime.GOMAXPROCS(runtime.NumCPU()) + // Mark start-up in log. log.Printf("InfluxDB starting, version %s, branch %s, commit %s, built %s", cmd.Version, cmd.Branch, cmd.Commit, cmd.BuildTime) log.Printf("Go version %s, GOMAXPROCS set to %d", runtime.Version(), runtime.GOMAXPROCS(0)) - // Set parallelism. - runtime.GOMAXPROCS(runtime.NumCPU()) - // Write the PID file. if err := cmd.writePIDFile(options.PIDFile); err != nil { return fmt.Errorf("write pid file: %s", err)
Set GOMAXPROCS before log message Previously the impression was being given that GOMAXPROCS was not being set correctly.
influxdata_influxdb
train
go
b27f73710d44a19cf55b2e5577a007f9a009e211
diff --git a/lib/Compilation.js b/lib/Compilation.js index <HASH>..<HASH> 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -1,7 +1,7 @@ /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ "use strict"; const async = require("async");
Revert indents to Compilation
webpack_webpack
train
js
1dddbdbdd6cb184767dcaa576a5ffa0fe81d65cb
diff --git a/lib/api-client/resources/filter.js b/lib/api-client/resources/filter.js index <HASH>..<HASH> 100644 --- a/lib/api-client/resources/filter.js +++ b/lib/api-client/resources/filter.js @@ -140,5 +140,24 @@ Filter.delete = function(id, done) { }; +/** + * Performs an authorizations lookup on the resource or entity + * + * @param {uuid} [id] of the filter to get authorizations for + * @param {Function} done + */ +Filter.authorizations = function(id, done) { + if (arguments.length === 1) { + return this.http.options(this.path, { + done: id + }); + } + + return this.http.options(this.path +'/'+ id, { + done: done + }); +}; + + module.exports = Filter;
feat(API services): add filter authorizations method
camunda_camunda-bpm-sdk-js
train
js
441bd09a6a771e5bc7ee78cdea4427344f47844f
diff --git a/raft.go b/raft.go index <HASH>..<HASH> 100644 --- a/raft.go +++ b/raft.go @@ -1468,7 +1468,7 @@ func (r *Raft) requestVote(rpc RPC, req *RequestVoteRequest) { return } - if lastIdx > req.LastLogIndex { + if lastTerm == req.LastLogTerm && lastIdx > req.LastLogIndex { r.logger.Printf("[WARN] raft: Rejecting vote request from %v since our last index is greater (%d, %d)", candidate, lastIdx, req.LastLogIndex) return
Compare logs correctly on a RequestVote Per issue #<I>: > The log comparison in the RequestVote request handler is incorrect. The current code, > rejects the request if the voter's last log term is greater than the candidate's OR > if the voter's last log index is greater than the candidate's. It should actually only compare the log index if the last terms are equal.
hashicorp_raft
train
go
010319d93e5349332d59a9fc5fb06db8c2381c85
diff --git a/salt/returners/librato_return.py b/salt/returners/librato_return.py index <HASH>..<HASH> 100644 --- a/salt/returners/librato_return.py +++ b/salt/returners/librato_return.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- ''' -Salt returner to return highstate stats to librato +Salt returner to return highstate stats to Librato -To enable this returner the minion will need the librato +To enable this returner the minion will need the Librato client importable on the python path and the following values configured in the minion or master config. @@ -14,7 +14,7 @@ https://github.com/librato/python-librato librato.email: example@librato.com librato.api_token: abc12345def -This return supports multi-dimension metrics for librato. To enable +This return supports multi-dimension metrics for Librato. To enable support for more metrics, the tags JSON object can be modified to include other tags.
fixing capitalization of librato
saltstack_salt
train
py
2a86cc3c470a1a74e7442e85a317cb9e582d2282
diff --git a/hpcbench/driver.py b/hpcbench/driver.py index <HASH>..<HASH> 100644 --- a/hpcbench/driver.py +++ b/hpcbench/driver.py @@ -180,6 +180,8 @@ class Network(object): return [] nodes = set() for definition in definitions: + if len(definition.items()) == 0: + continue mode, value = list(definition.items())[0] if mode == 'match': nodes = nodes.union(set([
in some cases empty nodelists come from the recursive tags this makes sure these items are ignored. Ultimately the tag/nodelist generation should be revisted
BlueBrain_hpcbench
train
py
f40b7a829fc47c432d43794f8a6eda35e0f0bb32
diff --git a/Swat/SwatActions.php b/Swat/SwatActions.php index <HASH>..<HASH> 100644 --- a/Swat/SwatActions.php +++ b/Swat/SwatActions.php @@ -67,9 +67,13 @@ class SwatActions extends SwatControl implements SwatUIParent { $this->selected = null; echo '<div class="swat-actions">'; - echo '<label for="'.$this->name.'_actionfly">'; + + $label = new SwatHtmlTag('label'); + $label->for = $this->name.'_actionfly'; + $label->open(); echo sprintf('%s: ', _S('Action')); - echo '</label>'; + $label->close(); + $this->actionfly->display(); echo ' '; $this->apply_button->display();
Use SwatHtmlTag for label instead of echoing html. svn commit r<I>
silverorange_swat
train
php
2b43736654e1f52487c9edfd794c39782e64d7e9
diff --git a/pylint/checkers/base_checker.py b/pylint/checkers/base_checker.py index <HASH>..<HASH> 100644 --- a/pylint/checkers/base_checker.py +++ b/pylint/checkers/base_checker.py @@ -43,6 +43,17 @@ class BaseChecker(OptionsProviderMixIn): OptionsProviderMixIn.__init__(self) self.linter = linter + def __gt__(self, other): + """Permit to sort a list of Checker by name.""" + return "{}{}".format(self.name, self.msgs).__gt__( + "{}{}".format(other.name, other.msgs) + ) + + def __repr__(self): + status = "Checker" if self.enabled else "Disabled checker" + msgids = [id for id in self.msgs] + return "{} '{}' responsible for {}".format(status, self.name, ", ".join(msgids)) + def add_message( self, msgid,
Feat - Add a __repr__ and __gt__ function for BaseCheckers Permit pylint's developper to see what is inside a sorted list of checkers.
PyCQA_pylint
train
py
6bf9b97d890a2925f237733015af1b41393c1f49
diff --git a/classes/ezjscpacker.php b/classes/ezjscpacker.php index <HASH>..<HASH> 100644 --- a/classes/ezjscpacker.php +++ b/classes/ezjscpacker.php @@ -385,12 +385,6 @@ class ezjscPacker eZDebug::writeWarning( "Could not find any files: " . var_export( $fileArray, true ), __METHOD__ ); return array(); } - else if ( !isset( $data['locale'][1] ) && $data['locale'][0] && !$data['locale'][0] instanceof ezjscServerRouter ) - { - self::$log[] = $data; - // return if there is only one file in array to save us from caching it - return array_merge( $data['http'], $data['www'] ); - } // See if cahe file exists and if it has expired (only if time is not part of name) if ( $ezjscINI->variable( 'Packer', 'AppendLastModifiedTime' ) === 'enabled' )
Fixed #<I>: Packer template operators do not execute optimizer when called with only one file
ezsystems_ezpublish-legacy
train
php
8d2a26369424c28963b3cf320b10e02979590cbb
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py index <HASH>..<HASH> 100644 --- a/ryu/controller/controller.py +++ b/ryu/controller/controller.py @@ -19,6 +19,7 @@ import logging import gevent import traceback import random +import greenlet from gevent.server import StreamServer from gevent.queue import Queue @@ -63,6 +64,8 @@ def _deactivate(method): def deactivate(self): try: method(self) + except greenlet.GreenletExit: + pass except: traceback.print_stack() raise
ignore GreenletExit exception We get a pretty anonying message every time a datapath has gone since we kill send_thr gleenlet in the normal termination. Let's ignore the exception. In the long term, we should improve error message delivering. Just printing an error is pretty useless.
osrg_ryu
train
py
c44a6a93003efabc1782d903b6ac7150b23cfb08
diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index <HASH>..<HASH> 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -38,6 +38,9 @@ Master config. - bucket3 - bucket4 + Note that bucket names must be all lowercase both in the AWS console + and in Salt, otherwise you may encounter "SignatureDoesNotMatch" errors. + A multiple environment bucket must adhere to the following root directory structure::
jcockhren encountered an issue this evening with regards to s3fs buckets, I have added a note that details the solution to hopefully avoid this in the future.
saltstack_salt
train
py
cbb1e43241d423c9b49951e4ba138940ca4d9f51
diff --git a/src/commands/main.js b/src/commands/main.js index <HASH>..<HASH> 100644 --- a/src/commands/main.js +++ b/src/commands/main.js @@ -143,7 +143,7 @@ const mainCommand = async function (options, command) { }, SUGGESTION_TIMEOUT) // eslint-disable-next-line promise/catch-or-return - prompt.then((value) => resolve(value)) + prompt.then((value) => resolve(value.suggestion)) }) // create new log line log()
fix: no option in Suggestion prompt (#<I>) (#<I>)
netlify_cli
train
js
007722d8189878cc5e4eeb06c433522265b42509
diff --git a/src/geometry/ext/Geometry.Animation.js b/src/geometry/ext/Geometry.Animation.js index <HASH>..<HASH> 100644 --- a/src/geometry/ext/Geometry.Animation.js +++ b/src/geometry/ext/Geometry.Animation.js @@ -42,7 +42,6 @@ Geometry.include(/** @lends Geometry.prototype */ { } const map = this.getMap(), projection = this._getProjection(), - symbol = this.getSymbol() || {}, stylesToAnimate = this._prepareAnimationStyles(styles); let preTranslate; @@ -84,6 +83,7 @@ Geometry.include(/** @lends Geometry.prototype */ { } const dSymbol = styles['symbol']; if (dSymbol) { + const symbol = this.getSymbol() || {}; this.setSymbol(extendSymbol(symbol, dSymbol)); } if (map && isFocusing) {
refresh symbol in every frame, fix #<I>
maptalks_maptalks.js
train
js
f633df6bb8e0e84699db2f47178f4b402ccc07a8
diff --git a/eventkit/utils/time.py b/eventkit/utils/time.py index <HASH>..<HASH> 100644 --- a/eventkit/utils/time.py +++ b/eventkit/utils/time.py @@ -1,4 +1,4 @@ -from datetime import timedelta +from datetime import datetime, timedelta from timezone import timezone @@ -50,8 +50,9 @@ def round_datetime(when=None, precision=60, rounding=ROUND_NEAREST): # If precision is a weekday, the beginning of time must be that same day. when_min = when.min + timedelta(days=weekday) if timezone.is_aware(when): - when_min = \ - timezone.datetime(tzinfo=when.tzinfo, *when_min.timetuple()[:3]) + # It doesn't seem to be possible to localise the `min` datetime without + # raising `OverflowError`, so create a timezone aware object manually. + when_min = datetime(tzinfo=when.tzinfo, *when_min.timetuple()[:3]) delta = when - when_min remainder = int(delta.total_seconds()) % precision # First round down and strip microseconds.
Fix `OverflowError`. It doesn't seem to be possible to localise `datetime.min` without raising `OverflowError`, so create a timezone aware object manually.
ic-labs_django-icekit
train
py
cdcd0f35f458dfb4ce7622258ebccb9dc5833067
diff --git a/angr/keyed_region.py b/angr/keyed_region.py index <HASH>..<HASH> 100644 --- a/angr/keyed_region.py +++ b/angr/keyed_region.py @@ -299,8 +299,8 @@ class KeyedRegion(object): # is there a region item that begins before the start and overlaps with this variable? floor_key, floor_item = self._get_container(start) if floor_item is not None and floor_key not in overlapping_items: - # insert it into the beginningq - overlapping_items.insert(0, (floor_key, self._storage[floor_key])) + # insert it into the beginning + overlapping_items.insert(0, floor_key) # scan through the entire list of region items, split existing regions and insert new regions as needed to_update = {start: RegionObject(start, object_size, {stored_object})}
Fix bug in keyed_region introduced in #<I>
angr_angr
train
py
fd6ca3752e2baa251b1a04bb95b6383eb26ef676
diff --git a/test/testFromStyleguidist.js b/test/testFromStyleguidist.js index <HASH>..<HASH> 100644 --- a/test/testFromStyleguidist.js +++ b/test/testFromStyleguidist.js @@ -68,8 +68,8 @@ const testFromStyleguidist = ( options ) await sleep(delay) // some components (like the ActionMenu) are flaky due to external libs - requestAnimationFrame(() => { - root.update() + requestAnimationFrame(async () => { + await root.update() rendered.push(pretty(removeTouchRipples(root.html()))) doneCounter++ if (doneCounter === codes.length) {
fix(test): Use async/await in testFromStyleguidist
cozy_cozy-ui
train
js
2dbebf2ebc09477070df33f1bb0492ab7f514ccb
diff --git a/examples/example.js b/examples/example.js index <HASH>..<HASH> 100644 --- a/examples/example.js +++ b/examples/example.js @@ -102,7 +102,7 @@ window.onload = function() { /* add an unknown node implicitly by adding an edge */ g.addEdge("strawberry", "apple"); - g.removeNode("1"); + //g.removeNode("1"); /* layout the graph using the Spring layout implementation */ var layouter = new Graph.Layout.Spring(g);
remove node removed from example until it works
strathausen_dracula
train
js
04a31fbf26266432e795a0911791149028d8818d
diff --git a/infra/azure/utils/helper.js b/infra/azure/utils/helper.js index <HASH>..<HASH> 100644 --- a/infra/azure/utils/helper.js +++ b/infra/azure/utils/helper.js @@ -72,7 +72,7 @@ const helper = { }); } - record.securityGroup = ''; + record.securityGroup = []; if(opts.networkInterface){ if(opts.networkInterface.ipConfigurations) { opts.networkInterface.ipConfigurations.forEach(function(oneIpConfig) { @@ -86,7 +86,7 @@ const helper = { }); } if(opts.networkInterface.networkSecurityGroup && opts.networkInterface.networkSecurityGroup.id) { - record.securityGroup = opts.networkInterface.networkSecurityGroup.id.split('/').pop(); + record.securityGroup.push(opts.networkInterface.networkSecurityGroup.id.split('/').pop()); } }
Updated azure vm list to include array of security groups
soajs_soajs.core.drivers
train
js
c267f2d996635c57acc68eceabe54e9ad242c558
diff --git a/src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java b/src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java index <HASH>..<HASH> 100644 --- a/src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java +++ b/src/main/java/su/litvak/chromecast/api/v2/ChromeCast.java @@ -106,6 +106,16 @@ public class ChromeCast { } /** + * @param appId application identifier + * @return true if application with specified identifier is running now + * @throws IOException + */ + public boolean isAppRunning(String appId) throws IOException { + Status status = getStatus(); + return status != null && status.getRunningApp() != null && appId.equals(status.getRunningApp().id); + } + + /** * @param appId application identifier * @return application descriptor if app successfully launched, null otherwise * @throws IOException
Added isAppRunning() method to CC API
vitalidze_chromecast-java-api-v2
train
java
170f43c3539e98110e2fba13642b38f3629690c5
diff --git a/lib/irt/utils.rb b/lib/irt/utils.rb index <HASH>..<HASH> 100644 --- a/lib/irt/utils.rb +++ b/lib/irt/utils.rb @@ -26,7 +26,8 @@ module IRT tmp_file = Tempfile.new(['', '.irt']) tmp_file << "\n" # one empty line makes irb of 1.9.2 happy tmp_file.flush - tmp_path = tmp_file.path + # ENV used because with IRT.cli? 2 different processes need to access the same path + ENV['IRT_TMP_PATH'] = tmp_path = tmp_file.path at_exit { check_save_tmp_file(tmp_file, &block) } tmp_path end @@ -40,6 +41,8 @@ module IRT FileUtils.mkdir_p(dirname) unless File.directory?(dirname) FileUtils.cp source_path, as_file if block && IRT::Prompter.yes?( %(Do you want to run the file "#{as_file_local}" now?) ) + # reset the tmpfile content so the at_exit proc will not be triggered + File.open(source_path, 'w'){|f| f.puts "\n"} if IRT.irt_file == Pathname.new(ENV['IRT_TMP_PATH']).realpath block.call as_file, source_path end end
skips asking for save the temp file if it has been saved as and rerun
ddnexus_irt
train
rb
d0d8b3dbd8dc91a0901acd876437b3f270048915
diff --git a/src/base.js b/src/base.js index <HASH>..<HASH> 100644 --- a/src/base.js +++ b/src/base.js @@ -352,8 +352,8 @@ var scaffoldChart = function(selection) { this.svg = d4.appendOnce(d3.select(selection), 'svg#chart.d4.chart') - .attr('width', this.width + this.margin.left + this.margin.right) - .attr('height', this.height + this.margin.top + this.margin.bottom); + .attr('width', Math.abs(this.width + this.margin.left + this.margin.right)) + .attr('height', Math.abs(this.height + this.margin.top + this.margin.bottom)); d4.appendOnce(this.svg, 'defs'); d4.appendOnce(this.svg, 'g.margins')
Prevent d4 from trying to create an SVG element with dimensions less than zero.
heavysixer_d4
train
js
6bfad8fce80fe9bf82c283dc2af4bb311dd94e1d
diff --git a/build.go b/build.go index <HASH>..<HASH> 100644 --- a/build.go +++ b/build.go @@ -217,7 +217,7 @@ var dependencyRepos = []dependencyRepo{ {path: "xdr", repo: "https://github.com/calmh/xdr.git", commit: "08e072f9cb16"}, } -func init() { +func initTargets() { all := targets["all"] pkgs, _ := filepath.Glob("cmd/*") for _, pkg := range pkgs { @@ -226,6 +226,9 @@ func init() { // ignore dotfiles continue } + if noupgrade && pkg == "stupgrades" { + continue + } all.buildPkgs = append(all.buildPkgs, fmt.Sprintf("github.com/syncthing/syncthing/cmd/%s", pkg)) } targets["all"] = all @@ -257,6 +260,8 @@ func main() { }() } + initTargets() + // Invoking build.go with no parameters at all builds everything (incrementally), // which is what you want for maximum error checking during development. if flag.NArg() == 0 {
build: Make stupgrades build target conditional (fixes #<I>) (#<I>)
syncthing_syncthing
train
go
056ebde82676cfb99f10d10597fb47a92602bb56
diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index <HASH>..<HASH> 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -188,6 +188,8 @@ begin # tests from chef-server as the user acls are not supported in chef-zero # at this time. "--skip-chef-zero-quirks", + + "--skip-status" ] # The knife tests are very slow and don't give us a lot of extra coverage,
skipping status in pedant test
chef_chef-zero
train
rb
a8479829b180c4da74027b220a629a794a894091
diff --git a/core/src/main/java/com/orientechnologies/orient/core/record/impl/OEdgeDelegate.java b/core/src/main/java/com/orientechnologies/orient/core/record/impl/OEdgeDelegate.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/record/impl/OEdgeDelegate.java +++ b/core/src/main/java/com/orientechnologies/orient/core/record/impl/OEdgeDelegate.java @@ -36,6 +36,7 @@ import com.orientechnologies.orient.core.serialization.OSerializableStream; import com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper; import com.orientechnologies.orient.core.storage.OStorage; +import java.util.Collections; import java.util.HashSet; import java.util.Optional; import java.util.Set; @@ -114,7 +115,7 @@ public class OEdgeDelegate implements OEdge { if (element != null) { return element.getPropertyNames(); } - return null; + return Collections.EMPTY_SET; } public OEdge delete() {
fix NPE on HTTP API with lightweight edges
orientechnologies_orientdb
train
java
b4374d33b0e5d62c3510f1f5ac4a48e7f48cb203
diff --git a/airflow/www/static/js/connection_form.js b/airflow/www/static/js/connection_form.js index <HASH>..<HASH> 100644 --- a/airflow/www/static/js/connection_form.js +++ b/airflow/www/static/js/connection_form.js @@ -60,6 +60,10 @@ $(document).ready(function () { const fieldBehavioursElem = document.getElementById('field_behaviours'); const config = JSON.parse(decode(fieldBehavioursElem.textContent)); + // Prevent login/password fields from triggering browser auth extensions + const form = document.getElementById('model_form'); + if (form) form.setAttribute('autocomplete', 'off'); + // Save all DOM elements into a map on load. const controlsContainer = getControlsContainer(); const connTypesToControlsMap = getConnTypesToControlsMap();
turn off autocomplete for connection forms (#<I>) * turn off autocomplete for connection forms * switch autocomplete to the whole form * add comment
apache_airflow
train
js
d108def7a4454d5addeb960d359fea111c349fdc
diff --git a/lib/grant.js b/lib/grant.js index <HASH>..<HASH> 100644 --- a/lib/grant.js +++ b/lib/grant.js @@ -263,6 +263,8 @@ function useRefreshTokenGrant (done) { 'No user/userId parameter returned from getRefreshToken')); } + self.user = refreshToken.user || { id: refreshToken.userId }; + if (self.model.revokeRefreshToken) { return self.model.revokeRefreshToken(token, function (err) { if (err) return done(error('server_error', false, err)); @@ -270,7 +272,6 @@ function useRefreshTokenGrant (done) { }); } - self.user = refreshToken.user || { id: refreshToken.userId }; done(); }); }
Fix user is undefined after revoking refresh token. Fixes #<I>
oauthjs_node-oauth2-server
train
js
e7ef9b58d81421e82d2fe27e5409557cf17b9b7b
diff --git a/src/main/java/org/eobjects/analyzer/util/CharIterator.java b/src/main/java/org/eobjects/analyzer/util/CharIterator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/eobjects/analyzer/util/CharIterator.java +++ b/src/main/java/org/eobjects/analyzer/util/CharIterator.java @@ -60,7 +60,7 @@ public class CharIterator implements ListIterator<Character> { if (c == null) { return false; } - return c == current(); + return c.charValue() == current(); } public boolean isLetter() { @@ -102,7 +102,7 @@ public class CharIterator implements ListIterator<Character> { return _index; } - public Character current() { + public char current() { return _chars[_index]; }
Minor bugfix in the CharIterator
datacleaner_AnalyzerBeans
train
java
e2846e43e0dc48fbb316ce1607e04e24e627b746
diff --git a/soco/events.py b/soco/events.py index <HASH>..<HASH> 100755 --- a/soco/events.py +++ b/soco/events.py @@ -29,11 +29,11 @@ log = logging.getLogger(__name__) # pylint: disable=C0103 def parse_event_xml(xml_event): - """ Parse a unicode xml_event and return a dict with keys representing the - event properties""" + """ Parse an xml_event passed as bytes and return a dict with keys + representing the event properties""" result = {} - tree = XML.fromstring(xml_event.encode('utf-8')) + tree = XML.fromstring(xml_event) properties = tree.iterfind( './/{urn:schemas-upnp-org:event-1-0}property') for prop in properties:
Fixes #<I>: incorrect encoding in events
amelchio_pysonos
train
py
e93776ac1bcacd2655222e99d4c4993a482d2984
diff --git a/app/models/catarse_pagarme/bank_account_concern.rb b/app/models/catarse_pagarme/bank_account_concern.rb index <HASH>..<HASH> 100644 --- a/app/models/catarse_pagarme/bank_account_concern.rb +++ b/app/models/catarse_pagarme/bank_account_concern.rb @@ -33,7 +33,7 @@ module CatarsePagarme::BankAccountConcern agencia: self.agency, conta: self.account, conta_dv: self.account_digit, - legal_name: self.user.name, + legal_name: self.user.name[0..29], document_number: self.user.cpf, type: self.account_type }
Should limit legal name when pushing to gateway
catarse_catarse_pagarme
train
rb
bca507aa59106929b0ce227e3061f72048025f10
diff --git a/tests/test_mysqlparse.py b/tests/test_mysqlparse.py index <HASH>..<HASH> 100644 --- a/tests/test_mysqlparse.py +++ b/tests/test_mysqlparse.py @@ -34,4 +34,4 @@ class ParseTest(unittest.TestCase): with self.assertRaises(TypeError) as ctx: mysqlparse.parse(None) - self.assertEqual(ctx.exception.message, "Expected file-like or string object, but got 'NoneType' instead.") + self.assertEqual(str(ctx.exception), "Expected file-like or string object, but got 'NoneType' instead.")
Learned the hard way that `BaseException.message` was deprecated in <I>.
seporaitis_mysqlparse
train
py
776d76991ad7ba920db0083ef74f5fe9af8b374b
diff --git a/lib/icomoon-phantomjs.js b/lib/icomoon-phantomjs.js index <HASH>..<HASH> 100644 --- a/lib/icomoon-phantomjs.js +++ b/lib/icomoon-phantomjs.js @@ -42,27 +42,37 @@ async.series([ // Continue cb(); }, - function exportFont (cb) { - // Export our font + function moveToDownloadScreen (cb) { + // Move to the downlod screen page.evaluate(function () { // Select our images $('#imported').find('.checkbox-icon').click(); // "Click" the 'Next' link window.location.hash = 'font'; - - // Click the download link - $('#saveFont').click(); }); - // Continue - setTimeout(cb, 1000); + // Wait for the next screen to load + waitFor(function () { + return page.evaluate(function () { + return $('#saveFont').length; + }); + }, cb); }, - function waitForRedirect (cb) { - // Wait for a redirect request + function exportFont (cb) { + // Save any zip redirect requests page.onNavigationRequested = function (url) { - downloadLink = url; + if (url.indexOf('.zip') > -1) { + downloadLink = url; + } }; + + // Click the download link + page.evaluate(function () { + $('#saveFont').click(); + }); + + // Wait for the redirect request to our zip waitFor(function () { return downloadLink; }, cb);
Fully migrated off of CasperJS =D
twolfson_icomoon-phantomjs
train
js
54744207a2ff4ff3562414cefd6254abf6c0d18d
diff --git a/lib/pundit/resource.rb b/lib/pundit/resource.rb index <HASH>..<HASH> 100644 --- a/lib/pundit/resource.rb +++ b/lib/pundit/resource.rb @@ -22,7 +22,7 @@ module Pundit def warn_if_show_defined policy_class = Pundit::PolicyFinder.new(_model_class.new).policy! - if policy_class.method_defined?(:show?) + if policy_class.instance_methods(false).include?(:show?) puts "WARN: pundit-resources does not use the show? action." puts " #{policy_class::Scope} will be used instead." end
warn only if policy subclass defines show? method
togglepro_pundit-resources
train
rb
c1ea85f439a247221b54cc6111acc86fd031c4c2
diff --git a/src/Factory/Controller/SessionToolbarControllerFactory.php b/src/Factory/Controller/SessionToolbarControllerFactory.php index <HASH>..<HASH> 100644 --- a/src/Factory/Controller/SessionToolbarControllerFactory.php +++ b/src/Factory/Controller/SessionToolbarControllerFactory.php @@ -20,22 +20,29 @@ namespace SanSessionToolbar\Factory\Controller; use SanSessionToolbar\Controller\SessionToolbarController; -use Zend\Mvc\Controller\ControllerManager; +use Zend\ServiceManager\FactoryInterface; +use Zend\ServiceManager\ServiceLocatorInterface; +use Zend\ServiceManager\ServiceLocatorAwareInterface; /** * Factory class for SessionToolbarController creation. * * @author Abdul Malik Ikhsan <samsonasik@gmail.com> */ -class SessionToolbarControllerFactory +class SessionToolbarControllerFactory implements FactoryInterface { - public function __invoke(ControllerManager $controllerManager) + public function createService(ServiceLocatorInterface $serviceLocator) { - $services = $controllerManager->getServiceLocator(); + $services = $this->getInnerServiceLocator($serviceLocator); return new SessionToolbarController( $services->get('ViewRenderer'), (object) $services->get('SanSessionManager') ); } + + protected function getInnerServiceLocator(ServiceLocatorAwareInterface $sla) + { + return $sla->getServiceLocator(); + } }
Refactoring factory to use FactoryInterface Using FactoryInterface while avoiding a type error to be thrown by scrutinizer.
samsonasik_SanSessionToolbar
train
php
3965157a53f2d281992213312f40475135f5c4d8
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -34,8 +34,8 @@ module.exports = function(grunt) { options: { }, files: [ - {src: ['test/fixtures/objects/hello_world.json', - 'test/fixtures/templates/hello_world.html.mustache'], + {data: 'test/fixtures/objects/hello_world.json', + template: 'test/fixtures/templates/hello_world.html.mustache', dest: 'tmp/hello_world.html'} ] },
Separate src files into data and template
5thWall_mustache-render
train
js
d427e5896a08013745ed07299254fe8b432dc87e
diff --git a/spec/fsr/listener/outbound.rb b/spec/fsr/listener/outbound.rb index <HASH>..<HASH> 100644 --- a/spec/fsr/listener/outbound.rb +++ b/spec/fsr/listener/outbound.rb @@ -109,6 +109,7 @@ EM.describe MyListener do should "be able to update an existing session" do @listener.receive_data("Content-Length: 0\nUnique-ID: abcd-1234-efgh-5678\n\n") @listener.session.headers[:unique_id].should.equal "abcd-1234-efgh-5678" + @listener.session.headers[:test_var].should.equal nil @listener.update_session @listener.receive_data("Content-Length: 74\n\nEvent-Name: CHANNEL_DATA\nUnique-ID: abcd-1234-efgh-5678\nTest-Var: foobar\n\n") @listener.session.headers[:test_var].should.equal "foobar"
In outbound listener spec, made sure to test variable is nil in update session test for a more complete test
vangberg_librevox
train
rb
9471cf9c8db6e2473f3b0dd25361eadcbc56859c
diff --git a/poetry/console/commands/init.py b/poetry/console/commands/init.py index <HASH>..<HASH> 100644 --- a/poetry/console/commands/init.py +++ b/poetry/console/commands/init.py @@ -48,7 +48,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in self.line( [ "", - "This command will guide you through creating your <info>poetry.toml</> config.", + "This command will guide you through creating your <info>pyproject.toml</> config.", "", ] )
Fix typo (#<I>)
sdispater_poetry
train
py
295ca0c49cc6742f8f7a184f5e7d3411c75683dd
diff --git a/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php b/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php index <HASH>..<HASH> 100644 --- a/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php +++ b/classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php @@ -163,13 +163,8 @@ class Gems_Tracker_Snippets_EditRoundSnippetAbstract extends Gems_Snippets_Model if (! $this->roundId) { $this->roundId = $this->request->getParam(Gems_Model::ROUND_ID); } - - if ($this->request->isPost()) { - // If post we keep the formvalues and do not overwrite with default data - $this->createData = false; - } else { - $this->createData = (! $this->roundId); - } + + $this->createData = (! $this->roundId); return parent::hasHtmlOutput(); } @@ -183,7 +178,7 @@ class Gems_Tracker_Snippets_EditRoundSnippetAbstract extends Gems_Snippets_Model { parent::loadFormData(); - if ($this->createData) { + if ($this->createData && !$this->request->isPost()) { $this->formData = $this->trackEngine->getRoundDefaults() + $this->formData; }
Better fix for onchange problem while adding rounds (thanks to Matijs)
GemsTracker_gemstracker-library
train
php
ac957bcf9fc1eccc72a5af9bf81b519db379cda1
diff --git a/packages/ember-routing/lib/system/route.js b/packages/ember-routing/lib/system/route.js index <HASH>..<HASH> 100644 --- a/packages/ember-routing/lib/system/route.js +++ b/packages/ember-routing/lib/system/route.js @@ -155,6 +155,16 @@ let Route = EmberObject.extend(ActionHandler, Evented, { }, /** + Populates the QP meta information in the BucketCache. + + @private + @method _populateQPMeta + */ + _populateQPMeta() { + this._bucketCache.stash('route-meta', this.fullRouteName, this.get('_qp')); + }, + + /** @private @property _qp diff --git a/packages/ember-routing/lib/system/router.js b/packages/ember-routing/lib/system/router.js index <HASH>..<HASH> 100644 --- a/packages/ember-routing/lib/system/router.js +++ b/packages/ember-routing/lib/system/router.js @@ -596,6 +596,7 @@ const EmberRouter = EmberObject.extend(Evented, { } handler._setRouteName(routeName); + handler._populateQPMeta(); if (engineInfo && !hasDefaultSerialize(handler)) { throw new Error('Defining a custom serialize method on an Engine route is not supported.');
Cache QP meta in BucketCache This will allow lazily loaded routes/engines to use the BucketCache as its source of truth for QP meta information instead of having to go directly to the Route instance.
emberjs_ember.js
train
js,js
b4272aa4a0be7c52d242b0af1b27274b72acffb5
diff --git a/src/landslide/parser.py b/src/landslide/parser.py index <HASH>..<HASH> 100644 --- a/src/landslide/parser.py +++ b/src/landslide/parser.py @@ -50,7 +50,6 @@ class Parser(object): raise RuntimeError(u"Looks like docutils are not installed") html = html_body(text, input_encoding=self.encoding) - html = re.sub(r'</div>\n', r'', html, re.DOTALL | re.UNICODE) html = re.sub(r'<p class="sys.+\n.+ion\.', r'', html, re.DOTALL | re.UNICODE) # Pretty hackish html = re.sub(r'<h1 class="title">', r'<h1>', html,
remove the closing div cleaning code (since the opening div cleaning code was removed)
adamzap_landslide
train
py
9ae2c8dc0f03038d4481287d7b258f28c4afb1c5
diff --git a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php @@ -88,8 +88,7 @@ class FileProfilerStorage implements ProfilerStorageInterface $iterator = new \RecursiveDirectoryIterator($this->folder, $flags); $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - foreach ($iterator as $file) - { + foreach ($iterator as $file) { if (is_file($file)) { unlink($file); }
[HttpKernel] CS in file storage
symfony_symfony
train
php
e93929fb07f45623a6f4841dac321c38dacc9a87
diff --git a/hgvs/parser.py b/hgvs/parser.py index <HASH>..<HASH> 100644 --- a/hgvs/parser.py +++ b/hgvs/parser.py @@ -121,7 +121,7 @@ class Parser(object): att_name = "parse_" + rule_name rule_fxn = make_parse_rule_function(rule_name) self.__setattr__(att_name, rule_fxn) - self._logger.info("Exposed {n} rules ({rules})".format(n=len(exposed_rules), rules=", ".join(exposed_rules))) + self._logger.debug("Exposed {n} rules ({rules})".format(n=len(exposed_rules), rules=", ".join(exposed_rules)))
drop log level for exposed parse rules/methods
biocommons_hgvs
train
py
60e451cc7a3b117fc83cde8bb3def3b33e9aeb6f
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -16,7 +16,7 @@ class Config const PROVIDERS = [ self::PROVIDER_GITHUB, - self::PROVIDER_GITLAB +// self::PROVIDER_GITLAB // Will be enabled after PR #24 is accepted ]; /** @var string */ diff --git a/src/ReleaseCommand.php b/src/ReleaseCommand.php index <HASH>..<HASH> 100644 --- a/src/ReleaseCommand.php +++ b/src/ReleaseCommand.php @@ -186,15 +186,14 @@ EOH; '<error>No token provided, and could not find it in the config file %s</error>', $configFile) ); - $output->writeln(sprintf( - 'Please provide the --token option, or create the file %s with your' - . ' GitHub personal access token as the sole contents', - $tokenFile - )); + $output->writeln( + 'Please provide the --token option, or create the config file' + . ' with the config command' + ); return null; } - return trim(file_get_contents($tokenFile)); + return trim($config->token()); } private function promptToSaveToken(string $token, InputInterface $input, OutputInterface $output) : void
Finishing release command and removing gitlab until PR #<I> is accepted
phly_keep-a-changelog
train
php,php
e83079d82d9852b778ec1b89eb880b93b8b22722
diff --git a/tests/lib/rules/self-closing-comp.js b/tests/lib/rules/self-closing-comp.js index <HASH>..<HASH> 100644 --- a/tests/lib/rules/self-closing-comp.js +++ b/tests/lib/rules/self-closing-comp.js @@ -45,6 +45,9 @@ ruleTester.run('self-closing-comp', rule, { code: 'var HelloJohn = <div>&nbsp;</div>;', parserOptions: parserOptions }, { + code: 'var HelloJohn = <div>{\' \'}</div>;', + parserOptions: parserOptions + }, { code: 'var HelloJohn = <Hello name="John">&nbsp;</Hello>;', parserOptions: parserOptions }
Add additional test for self-closing-comp
ytanruengsri_eslint-plugin-react-ssr
train
js
e00de50e2c8de2709407630e4aefe1d1e14944fe
diff --git a/spec/middleware_spec.rb b/spec/middleware_spec.rb index <HASH>..<HASH> 100644 --- a/spec/middleware_spec.rb +++ b/spec/middleware_spec.rb @@ -475,7 +475,7 @@ def set_escrow_env key, presenter, id, nonce ] end -def store_in_escrow store, id = 'id', nonce = 'nonce', response = [] +def store_in_escrow store, id = 'id', nonce = 'nonce', response = [ 200, {}, [ "" ] ] store.set( presenter.escrow_key(id), ActiveSupport::JSON.encode(
Spec helper method returns realistic Rack response
duncanbeevers_SecureEscrow
train
rb
721e37957cce075251fea6c7e330d01d412cd729
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index <HASH>..<HASH> 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -19,6 +19,7 @@ require 'pp' require 'socket' require 'chef/config' +require 'chef/config_fetcher' require 'chef/exceptions' require 'chef/log' require 'chef/platform'
added require for config_fetcher
chef_chef
train
rb
6d85c2cd155d4d5fb40c36bda9e01700c8000055
diff --git a/test_elasticsearch_dsl/test_document.py b/test_elasticsearch_dsl/test_document.py index <HASH>..<HASH> 100644 --- a/test_elasticsearch_dsl/test_document.py +++ b/test_elasticsearch_dsl/test_document.py @@ -65,7 +65,7 @@ def test_you_can_supply_own_mapping_instance(): class Meta: mapping = Mapping('my_d') - mapping = mapping.meta('_all', enabled=False) + mapping.meta('_all', enabled=False) assert { 'my_d': {
no need to save the result of .meta()
elastic_elasticsearch-dsl-py
train
py
469704c59daabf6210f423569fd1bf76a1dadf68
diff --git a/lib/task-data/tasks/install-esx.js b/lib/task-data/tasks/install-esx.js index <HASH>..<HASH> 100644 --- a/lib/task-data/tasks/install-esx.js +++ b/lib/task-data/tasks/install-esx.js @@ -17,6 +17,9 @@ module.exports = { esxBootConfigTemplateUri: '{{ api.templates }}/{{ options.esxBootConfigTemplate }}?nodeId={{ task.nodeId }}', //jshint ignore: line comport: 'com1', comportaddress: '0x3f8', //com1=0x3f8, com2=0x2f8, com3=0x3e8, com4=0x2e8 + gdbPort: 'default', + logPort: 'com1', + debugLogToSerial: '1', repo: '{{file.server}}/esxi/{{options.version}}', hostname: 'localhost', rootPassword: "RackHDRocks!",
Add option to allow console redirect in ESXi bootstrap
RackHD_on-tasks
train
js
605b9f9ed009f6d53ddf5dbd57b4e54b850a57b0
diff --git a/source/test/test_transition_creation.py b/source/test/test_transition_creation.py index <HASH>..<HASH> 100644 --- a/source/test/test_transition_creation.py +++ b/source/test/test_transition_creation.py @@ -51,6 +51,8 @@ def create_statemachine(): with raises(ValueError): state4.add_transition(None, None, state3.state_id, None) + state4.add_transition(state3.state_id, 4, state4.state_id, 5) + state4.start_state_id = None state4.add_transition(None, None, state1.state_id, None)
fix introduce random occuring bug in test_transition_creation because of missing transition
DLR-RM_RAFCON
train
py
eea935fe9079a0209eeef249b9cf05f511c5dfd7
diff --git a/src/com/aoindustries/lang/ProcessResult.java b/src/com/aoindustries/lang/ProcessResult.java index <HASH>..<HASH> 100644 --- a/src/com/aoindustries/lang/ProcessResult.java +++ b/src/com/aoindustries/lang/ProcessResult.java @@ -76,6 +76,7 @@ public class ProcessResult { } } ); + stdoutThread.start(); // Read stderr in background thread final StringBuilder stderr = new StringBuilder(); @@ -105,6 +106,8 @@ public class ProcessResult { } } ); + stderrThread.start(); + try { // Wait for process to exit int exitVal = process.waitFor();
Fixed bug where threads were not started.
aoindustries_aocode-public
train
java
e05922eb51fe300d65db77de4bb6df3456962787
diff --git a/src/Language/Polish/PolishTransformerFactory.php b/src/Language/Polish/PolishTransformerFactory.php index <HASH>..<HASH> 100644 --- a/src/Language/Polish/PolishTransformerFactory.php +++ b/src/Language/Polish/PolishTransformerFactory.php @@ -9,9 +9,22 @@ use Kwn\NumberToWords\Model\Currency; class PolishTransformerFactory extends AbstractTransformerFactory { + /** + * Language identifier (RFC 3066) + */ const LANGUAGE_IDENTIFIER = 'pl'; /** + * Language name + */ + const LANGUAGE_NAME = 'Polish'; + + /** + * Native language name + */ + const LANGUAGE_NATIVE_NAME = 'Polski'; + + /** * Return language identifier (RFC 3066) * * @return string
Polish factory constants udpated
kwn_number-to-words
train
php
f670001f81b857320c5f52553f40f6786707e826
diff --git a/src/OAuth2/Storage/Memory.php b/src/OAuth2/Storage/Memory.php index <HASH>..<HASH> 100644 --- a/src/OAuth2/Storage/Memory.php +++ b/src/OAuth2/Storage/Memory.php @@ -156,13 +156,13 @@ class Memory implements AuthorizationCodeInterface, public function setClientDetails($client_id, $client_secret = null, $redirect_uri = null, $grant_types = null, $user_id = null) { - $this->clientCredentials[$client_id] = [ + $this->clientCredentials[$client_id] = array( 'client_id' => $client_id, 'client_secret' => $client_secret, 'redirect_uri' => $redirect_uri, 'grant_types' => $grant_types, 'user_id' => $user_id, - ]; + ); return true; }
removes php <I>-specific code
bshaffer_oauth2-server-php
train
php
0c606b97133515c4ff7bd73e4a1db29e34907c08
diff --git a/src/sync.js b/src/sync.js index <HASH>..<HASH> 100644 --- a/src/sync.js +++ b/src/sync.js @@ -399,8 +399,13 @@ }, autoMergeDocument: function(node) { - if ((node.common.body === undefined && node.remote.body === false) - || (node.remote.body === node.common.body && node.remote.contentType === node.common.contentType)) { + hasNoRemoteChanges = function(node) { + return (node.common.body === undefined && node.remote.body === false) || + (node.remote.body === node.common.body && + node.remote.contentType === node.common.contentType); + }; + + if (hasNoRemoteChanges(node)) { delete node.remote; } else if (node.remote.body !== undefined) { // keep/revert:
Extract conditions into local function Using a function with a meaningful name makes the check more readable.
remotestorage_remotestorage.js
train
js
ed48813e4f9206c288bce12268a0082b95825449
diff --git a/PhpAmqpLib/Wire/IO/StreamIO.php b/PhpAmqpLib/Wire/IO/StreamIO.php index <HASH>..<HASH> 100644 --- a/PhpAmqpLib/Wire/IO/StreamIO.php +++ b/PhpAmqpLib/Wire/IO/StreamIO.php @@ -112,20 +112,14 @@ class StreamIO extends AbstractIO set_error_handler(array($this, 'error_handler')); - try { - $this->sock = stream_socket_client( - $remote, - $errno, - $errstr, - $this->connection_timeout, - STREAM_CLIENT_CONNECT, - $this->context - ); - } catch (\Exception $e) { - restore_error_handler(); - - throw $e; - } + $this->sock = stream_socket_client( + $remote, + $errno, + $errstr, + $this->connection_timeout, + STREAM_CLIENT_CONNECT, + $this->context + ); restore_error_handler(); @@ -303,6 +297,8 @@ class StreamIO extends AbstractIO return; } + restore_error_handler(); + // raise all other issues to exceptions throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); }
Remove try-catch Added the restoring of the error handler to the error handler itself, so the `try-catch` block is not necessary.
php-amqplib_php-amqplib
train
php
4b4515e8776d24b895e99d0c3ea03913808de9b2
diff --git a/lib/locomotive/steam/liquid/filters/translate.rb b/lib/locomotive/steam/liquid/filters/translate.rb index <HASH>..<HASH> 100644 --- a/lib/locomotive/steam/liquid/filters/translate.rb +++ b/lib/locomotive/steam/liquid/filters/translate.rb @@ -15,6 +15,8 @@ module Locomotive @context.registers[:services].translator.translate(input, options) || input end + alias t translate + end ::Liquid::Template.register_filter(Translate) diff --git a/spec/integration/liquid/filters/translate_spec.rb b/spec/integration/liquid/filters/translate_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/liquid/filters/translate_spec.rb +++ b/spec/integration/liquid/filters/translate_spec.rb @@ -48,6 +48,13 @@ describe Locomotive::Steam::Liquid::Filters::Translate do end + describe 'shortcut alias' do + + let(:source) { "{{ 'welcome_message' | t: 'fr', 'locomotive.default' }}" } + it { expect(translator).to receive(:translate).with('welcome_message', 'locale' => 'fr', 'scope' => 'locomotive.default'); subject } + + end + end describe 'pluralization' do
add an alias (shorter) for the translate liquid filter
locomotivecms_steam
train
rb,rb
60ad0f24569491ab44a26e929c6e6c7e26b62244
diff --git a/src/main/java/javax/time/zone/ZoneOffsetTransitionRule.java b/src/main/java/javax/time/zone/ZoneOffsetTransitionRule.java index <HASH>..<HASH> 100644 --- a/src/main/java/javax/time/zone/ZoneOffsetTransitionRule.java +++ b/src/main/java/javax/time/zone/ZoneOffsetTransitionRule.java @@ -96,7 +96,7 @@ public final class ZoneOffsetTransitionRule implements Serializable { /** * Whether the cutover time is midnight at the end of day. */ - private boolean timeEndOfDay; + private final boolean timeEndOfDay; /** * The definition of how the local time should be interpreted. */ diff --git a/src/main/java/javax/time/zone/ZoneRulesGroup.java b/src/main/java/javax/time/zone/ZoneRulesGroup.java index <HASH>..<HASH> 100644 --- a/src/main/java/javax/time/zone/ZoneRulesGroup.java +++ b/src/main/java/javax/time/zone/ZoneRulesGroup.java @@ -107,7 +107,7 @@ public final class ZoneRulesGroup { /** * The versions and rules. */ - private AtomicReference<TreeMap<String, ZoneRulesVersion>> versions = + private final AtomicReference<TreeMap<String, ZoneRulesVersion>> versions = new AtomicReference<TreeMap<String, ZoneRulesVersion>>( new TreeMap<String, ZoneRulesVersion>(Collections.reverseOrder()));
Make fields final Found by mutability detector
ThreeTen_threetenbp
train
java,java
20658ea7f4828c7bf8a0683081d1d1db498dc744
diff --git a/irc/strings.py b/irc/strings.py index <HASH>..<HASH> 100644 --- a/irc/strings.py +++ b/irc/strings.py @@ -14,6 +14,9 @@ class IRCFoldedCase(FoldedCase): >>> IRCFoldedCase('[this]') == IRCFoldedCase('{THIS}') True + + >>> IRCFoldedCase().lower() == '' + True """ translation = dict(zip( map(ord, string.ascii_uppercase + r"[]\^"),
Add test capturing infinite recursion when string is empty. Ref #<I>.
jaraco_irc
train
py
473ed40f6100842d987830810a22a77a15bc5e08
diff --git a/examples/timeseries/statevector.py b/examples/timeseries/statevector.py index <HASH>..<HASH> 100644 --- a/examples/timeseries/statevector.py +++ b/examples/timeseries/statevector.py @@ -44,6 +44,7 @@ bits = [ ] data = StateVector.fetch('L1:ISI-ETMX_ODC_CHANNEL_OUT_DQ', 'May 22 2014 14:00', 'May 22 2014 15:00', bits=bits) +data = data.astype('uint32') # hide # For this example, we wish to :meth:`~StateVector.resample` the data to a # much lower rate, to make visualising the state much easier:
examples: added hidden astype for StateVector - old ODCs were written as float instead of uint<I>
gwpy_gwpy
train
py
0b72f2632dd6c52367e55e9b8c137731d23ce313
diff --git a/app/models/api/requests/CreateUserRequest.java b/app/models/api/requests/CreateUserRequest.java index <HASH>..<HASH> 100644 --- a/app/models/api/requests/CreateUserRequest.java +++ b/app/models/api/requests/CreateUserRequest.java @@ -18,7 +18,6 @@ */ package models.api.requests; -import com.google.common.collect.Lists; import models.User; import org.joda.time.DateTimeZone; @@ -37,7 +36,7 @@ public class CreateUserRequest extends ChangeUserRequest { this.fullname = user.getFullName(); this.email = user.getEmail(); this.password = ""; - this.permissions = Lists.newArrayList("*"); // TODO PREVIEW user.getPermissions(); + this.permissions = user.getPermissions(); final DateTimeZone timeZone = user.getTimeZone(); if (timezone != null) { this.timezone = timeZone.getID();
why was this reverted again? rebase?! i remember pushing this on friday :(
Graylog2_graylog2-server
train
java
5dfdeebc3051c533d6d838ff9a236a3a6c303129
diff --git a/tests/commands/test_changelog_command.py b/tests/commands/test_changelog_command.py index <HASH>..<HASH> 100644 --- a/tests/commands/test_changelog_command.py +++ b/tests/commands/test_changelog_command.py @@ -313,3 +313,25 @@ def test_changelog_without_revision(mocker, tmp_commitizen_project): with pytest.raises(NoRevisionError): cli.main() + + +def test_changelog_with_different_tag_name_and_changelog_content( + mocker, tmp_commitizen_project +): + changelog_file = tmp_commitizen_project.join("CHANGELOG.md") + changelog_file.write( + """ + # Unreleased + + ## v1.0.0 + """ + ) + create_file_and_commit("feat: new file") + git.tag("2.0.0") + + # create_file_and_commit("feat: new file") + testargs = ["cz", "changelog", "--incremental"] + mocker.patch.object(sys, "argv", testargs) + + with pytest.raises(NoRevisionError): + cli.main()
test(commands/changelog): add test case when tag name and the latest tag in changelog are different
Woile_commitizen
train
py
a743058e82c32a587f0030be2f63e3d523b01dad
diff --git a/src/main/java/org/socketio/netty/SocketIOServer.java b/src/main/java/org/socketio/netty/SocketIOServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/socketio/netty/SocketIOServer.java +++ b/src/main/java/org/socketio/netty/SocketIOServer.java @@ -66,7 +66,7 @@ public class SocketIOServer { private int closeTimeout = 25; - private String transports = "websocket,xhr-polling"; + private String transports = "websocket,flashsocket,xhr-polling"; private SSLContext sslContext = null; diff --git a/src/main/java/org/socketio/netty/TransportType.java b/src/main/java/org/socketio/netty/TransportType.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/socketio/netty/TransportType.java +++ b/src/main/java/org/socketio/netty/TransportType.java @@ -17,5 +17,6 @@ package org.socketio.netty; public enum TransportType { XHR_POLLING, - WEBSOCKET + WEBSOCKET, + FLASHSOCKET }
Add Flash Socket transport type to enum
scalecube_socketio
train
java,java
215fed1051d1e5527c9b544cf175910a47e2cff0
diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index <HASH>..<HASH> 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -172,12 +172,11 @@ func Remove(repoPath string) error { func LockedByOtherProcess(repoPath string) bool { repoPath = path.Clean(repoPath) - // packageLock must be held to check the number of openers. - packageLock.Lock() - defer packageLock.Unlock() + // TODO replace this with the "api" file + // https://github.com/ipfs/specs/tree/master/repo/fs-repo // NB: the lock is only held when repos are Open - return lockfile.Locked(repoPath) && openersCounter.NumOpeners(repoPath) == 0 + return lockfile.Locked(repoPath) } // openConfig returns an error if the config file is not present.
fsrepo.LockedByOtherProcess no longer checks for local opens This is only called from `ipfs` command line tool well before it opens the repo. The behavior change here causes a false positive if the current process has already opened the repo. That's a bit late to ask this question, anyway, and is not expected to have ever triggered.
ipfs_go-ipfs
train
go
c02aec08f344cdf37fc847149a0c9f6b0d2ac7d1
diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index <HASH>..<HASH> 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -379,6 +379,7 @@ class SerializerExtension(Extension, object): parser.fail('Unknown format ' + parser.stream.current.value, parser.stream.current.lineno) + # pylint: disable=E1120,E1121 def parse_load(self, parser): filter_name = parser.stream.current.value lineno = next(parser.stream).lineno @@ -479,3 +480,4 @@ class SerializerExtension(Extension, object): .set_lineno(lineno) ).set_lineno(lineno) ] + # pylint: enable=E1120,E1121
Jinja2 meta-classes trigger issues with PyLint.
saltstack_salt
train
py
59690b955df431804e8cf9cfee7b8f06795a53b0
diff --git a/src/main/org/openscience/cdk/pharmacophore/PharmacophoreMatcher.java b/src/main/org/openscience/cdk/pharmacophore/PharmacophoreMatcher.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/pharmacophore/PharmacophoreMatcher.java +++ b/src/main/org/openscience/cdk/pharmacophore/PharmacophoreMatcher.java @@ -276,6 +276,7 @@ public class PharmacophoreMatcher { */ @TestMethod("testMatchedAtoms") public List<List<PharmacophoreAtom>> getUniqueMatchingPharmacophoreAtoms() { + getMatchingPharmacophoreAtoms(); List<List<PharmacophoreAtom>> ret = new ArrayList<List<PharmacophoreAtom>>(); List<String> tmp = new ArrayList<String>();
Updated code so that if the user gets the unique matches just after matching, the code will first get the full set of non-unique matches. Since we get the non USA matches lazily, the USA method was working with a NULL object rather than the expected matching pharmacophore atoms git-svn-id: <URL>
cdk_cdk
train
java
b17cb48dbe906b446843ca1f4055df48c45d33f7
diff --git a/src/core/Events.js b/src/core/Events.js index <HASH>..<HASH> 100644 --- a/src/core/Events.js +++ b/src/core/Events.js @@ -84,7 +84,8 @@ var Common = require('./Common'); callbacks, eventClone; - if (object.events) { + var events = object.events; + if (events && Object.keys(events).length > 0) { if (!event) event = {}; @@ -92,7 +93,7 @@ var Common = require('./Common'); for (var i = 0; i < names.length; i++) { name = names[i]; - callbacks = object.events[name]; + callbacks = events[name]; if (callbacks) { eventClone = Common.clone(event, false);
Optimized Events.trigger method when no event is emitted
liabru_matter-js
train
js
b100492e1ca84ee2c5670f67bf45997b209c49c2
diff --git a/runtime/lib/collection/PropelObjectCollection.php b/runtime/lib/collection/PropelObjectCollection.php index <HASH>..<HASH> 100644 --- a/runtime/lib/collection/PropelObjectCollection.php +++ b/runtime/lib/collection/PropelObjectCollection.php @@ -278,6 +278,7 @@ class PropelObjectCollection extends PropelCollection $mainObj = $object->$getMethod(); // instance pool is used here to avoid a query $mainObj->$addMethod($object); } + $relatedObjects->clearIterator(); } elseif ($relationMap->getType() == RelationMap::MANY_TO_ONE) { // nothing to do; the instance pool will catch all calls to getRelatedObject() // and return the object in memory
Fixed small memory leak. Closes #<I>
propelorm_Propel
train
php
7febb0622319efe9d53b209937df721076eeeae2
diff --git a/salt/states/mdadm.py b/salt/states/mdadm.py index <HASH>..<HASH> 100644 --- a/salt/states/mdadm.py +++ b/salt/states/mdadm.py @@ -63,7 +63,7 @@ def present(name, devices A list of devices used to build the array. - + kwargs Optional arguments to be passed to mdadm.
Sneaky white space Using the web based editor and some white space found its way in.
saltstack_salt
train
py
d9647cb30ea494763ac4452fce809a9849c58272
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,8 @@ METADATA = dict( 'Framework :: Django', ], packages=find_packages(), - package_data={'allauth': ['templates/allauth/*.html'], } + package_data={'allauth': ['templates/allauth/*.html', + 'facebook/templates/facebook/*.html' ], } ) if __name__ == '__main__':
Added missing .html file to package data
pennersr_django-allauth
train
py
4493b2b780e5e19331703454e1e4c8405977e5b5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,17 @@ # -*- coding: utf-8 -*- # from distutils.core import setup +import os +import codecs from matplotlib2tikz import __version__ def read(fname): - return codecs.open(os.path.join(os.path.dirname(__file__), fname), - encoding='utf-8').read() + return codecs.open( + os.path.join(os.path.dirname(__file__), fname), + encoding='utf-8' + ).read() setup( name='matplotlib2tikz',
add missing imports in setup.py
nschloe_matplotlib2tikz
train
py
77f3619bde16b18c08ba05054201d2821b688cad
diff --git a/lib/intesys_asset_manager/version.rb b/lib/intesys_asset_manager/version.rb index <HASH>..<HASH> 100644 --- a/lib/intesys_asset_manager/version.rb +++ b/lib/intesys_asset_manager/version.rb @@ -1,3 +1,3 @@ module AssetManager - VERSION = '1.2.3.3' + VERSION = '1.2.3' end
revert version <I>
intesys_asset_manager
train
rb
47835b0edbe6898a6c60f29c379264bff7e32b84
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -36,7 +36,8 @@ dependencies['testing'] = [ 'isort==4.2.5', ] + dependencies['html5lib'] + dependencies['lxml'] -long_description = io.open('README.md', encoding='utf-8').read() +with io.open('README.md', encoding='utf-8') as readme_file: + long_description = readme_file.read() setup( name='draftjs_exporter',
Close opened README.md file
springload_draftjs_exporter
train
py
08edad78ccbb14c34a1a8f88c04be9636485a4b7
diff --git a/backup/util/includes/restore_includes.php b/backup/util/includes/restore_includes.php index <HASH>..<HASH> 100644 --- a/backup/util/includes/restore_includes.php +++ b/backup/util/includes/restore_includes.php @@ -88,7 +88,8 @@ require_once($CFG->dirroot . '/backup/util/ui/restore_moodleform.class.php'); require_once($CFG->dirroot . '/backup/util/ui/restore_ui_components.php'); // And some moodle stuff too -require_once ($CFG->dirroot . '/tag/lib.php'); -require_once ($CFG->dirroot . '/lib/gradelib.php'); -require_once ($CFG->dirroot . '/course/lib.php'); +require_once($CFG->dirroot . '/tag/lib.php'); +require_once($CFG->dirroot . '/lib/gradelib.php'); +require_once($CFG->dirroot . '/lib//questionlib.php'); +require_once($CFG->dirroot . '/course/lib.php'); require_once ($CFG->dirroot . '/blocks/moodleblock.class.php');
MDL-<I> backup - added missing required lib
moodle_moodle
train
php
23213b972bca1264831793fd981a92fd78f1bd24
diff --git a/Kwf/Exception/Abstract.php b/Kwf/Exception/Abstract.php index <HASH>..<HASH> 100644 --- a/Kwf/Exception/Abstract.php +++ b/Kwf/Exception/Abstract.php @@ -86,11 +86,6 @@ abstract class Kwf_Exception_Abstract extends Exception header('Content-Type: text/html; charset=utf-8'); } - while (ob_get_level() > 0) { - ob_end_flush(); - } - - echo $view->render($template); } catch (Exception $e) { echo '<pre>';
removing flushing output buffer when rendering exception - this breaks unittests as phpunit also uses an buffer which we clear - this should not be neccessary as on exit all buffers are flushed anyway
koala-framework_koala-framework
train
php
231b8d9fc88bed9e1071d521c8df497562a4df03
diff --git a/src/Packer/PacketLength.php b/src/Packer/PacketLength.php index <HASH>..<HASH> 100644 --- a/src/Packer/PacketLength.php +++ b/src/Packer/PacketLength.php @@ -28,10 +28,13 @@ final class PacketLength public static function unpack(string $data) : int { - if (false === $data = @\unpack('C/N', $data)) { + if (!isset($data[4]) || "\xce" !== $data[0]) { throw new \RuntimeException('Unable to unpack packet length.'); } - return $data[1]; + return \ord($data[1]) << 24 + | \ord($data[2]) << 16 + | \ord($data[3]) << 8 + | \ord($data[4]); } }
Optimize unpacking the packet length
tarantool-php_client
train
php
b4084fc9c0c00c159245a6c18230ba6d60bab4af
diff --git a/src/library/scala/runtime/Equality.java b/src/library/scala/runtime/Equality.java index <HASH>..<HASH> 100644 --- a/src/library/scala/runtime/Equality.java +++ b/src/library/scala/runtime/Equality.java @@ -78,10 +78,12 @@ public class Equality } public static void log(String msg) { - if (logger != null) { - logger.warning(msg); - handler.flush(); + if (logEverything) { + if (logger != null) { + logger.warning(msg); + handler.flush(); + } + else System.out.println(msg); } - else System.out.println(msg); } }
Fix for some accidentally enabled logging.
scala_scala
train
java
68accb89549d6e8d989aed31eda5b1a63a1e21e8
diff --git a/lib/podio/areas/contact.rb b/lib/podio/areas/contact.rb index <HASH>..<HASH> 100644 --- a/lib/podio/areas/contact.rb +++ b/lib/podio/areas/contact.rb @@ -32,6 +32,10 @@ module Podio }.body end + def find_all_admins_for_org(org_id) + list Podio.connection.get("/org/#{org_id}/admin/").body + end + def find_all_for_space(space_id, options={}) options.assert_valid_keys(:key, :value, :limit, :offset, :type, :order, :name, :email, :required, :contact_type, :exclude_self) options[:type] ||= 'full'
Added find all admins for org method to Contact area
podio_podio-rb
train
rb
3c822367051a61f5d6d37e64597f1cbc92f91f69
diff --git a/memory-store/index.js b/memory-store/index.js index <HASH>..<HASH> 100644 --- a/memory-store/index.js +++ b/memory-store/index.js @@ -86,7 +86,7 @@ class MemoryStore { return entry } - async get (opts) { + async get (opts = {}) { let entries if (opts.order === 'created') { entries = this.entries
fix(memory-store): `get` should works without `opts` argument (#<I>)
logux_core
train
js
928dd33d1af743b747f69af35aeb09ba74db0b23
diff --git a/txtorcon/socks.py b/txtorcon/socks.py index <HASH>..<HASH> 100644 --- a/txtorcon/socks.py +++ b/txtorcon/socks.py @@ -691,6 +691,8 @@ class TorSocksEndpoint(object): self._proxy_ep = socks_endpoint # can be Deferred if six.PY2 and isinstance(host, str): host = unicode(host) # noqa + if six.PY3 and isinstance(host, bytes): + host = host.decode('ascii') self._host = host self._port = port self._tls = tls
generally workaround twisted's URL notions
meejah_txtorcon
train
py
a6591aae0d6e1493ac1e4dbffb75a32d92836d11
diff --git a/Piwik.php b/Piwik.php index <HASH>..<HASH> 100644 --- a/Piwik.php +++ b/Piwik.php @@ -278,7 +278,7 @@ class Piwik { */ private function _request($method, $params = array()) { $url = $this->_parseUrl($method, $params); - +var_dump($url); $handle = curl_init(); curl_setopt($handle, CURLOPT_URL, $url); curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5); @@ -2271,7 +2271,7 @@ class Piwik { * @param string $segment */ public function getRegion($segment = '') { - return $this->_request('UserCountry.getRegion ', array( + return $this->_request('UserCountry.getRegion', array( 'segment' => $segment, )); } @@ -2282,7 +2282,7 @@ class Piwik { * @param string $segment */ public function getCity($segment = '') { - return $this->_request('UserCountry.getCity ', array( + return $this->_request('UserCountry.getCity', array( 'segment' => $segment, )); }
In some of the methods there were spaces in the URL so methods were failing. All fixed!
VisualAppeal_Matomo-PHP-API
train
php
7468c2a96e953ca2f62f4c8942c279fe76f46034
diff --git a/components/ngDroplet.js b/components/ngDroplet.js index <HASH>..<HASH> 100644 --- a/components/ngDroplet.js +++ b/components/ngDroplet.js @@ -42,6 +42,11 @@ */ $scope.FILE_TYPES = { VALID: 1, INVALID: 2, DELETED: 4, UPLOADED: 8 }; + // Dynamically add the `ALL` property. + $scope.FILE_TYPES.ALL = Object.keys($scope.FILE_TYPES).reduce(function map(current, key) { + return (current |= $scope.FILE_TYPES[key]); + }, 0); + /** * @property files * @type {Array}
Added FILE_TYPES.ALL property
Wildhoney_ngDroplet
train
js
7f20c6b979c7ef7ae2e80635ba2713999aea1d53
diff --git a/test/lib/time-lord/period_test.rb b/test/lib/time-lord/period_test.rb index <HASH>..<HASH> 100644 --- a/test/lib/time-lord/period_test.rb +++ b/test/lib/time-lord/period_test.rb @@ -48,7 +48,7 @@ class TestTimeLordPeriod < MiniTest::Unit::TestCase def test_in_words_between_11_months_and_year expected = "11 months from now" Timecop.freeze(Time.local(2013, 1, 1)) - actual = Time.local(2013, 12, 1).ago.in_words + actual = Time.local(2013, 12, 3).ago.in_words assert_equal(expected, actual) end
Re-breaking tests, as this doesn't actually fix the problem
krainboltgreene_time-lord
train
rb