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
226f79e03aabbc4fdd2c6675586b5aea0e99b154
diff --git a/mod/forum/lib.php b/mod/forum/lib.php index <HASH>..<HASH> 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3317,7 +3317,8 @@ function forum_tp_count_forum_unread_posts($userid, $forumid, $groupid=false) { } $sql = 'SELECT COUNT(p.id) '. - 'FROM '.$CFG->prefix.'forum_posts p JOIN '.$CFG->prefix.'forum_discussions d ON p.discussion = d.id '. + 'FROM '.$CFG->prefix.'forum_posts p '. + 'LEFT JOIN '.$CFG->prefix.'forum_discussions d ON p.discussion = d.id '. 'LEFT JOIN '.$CFG->prefix.'forum_read r ON r.postid = p.id AND r.userid = '.$userid.' '. 'WHERE d.forum = '.$forumid.$groupsel. ' AND p.modified >= '.$cutoffdate.' AND r.id is NULL';
Corrected a typo that was throwing errors.
moodle_moodle
train
php
dcdbbe54229ad741ca1dcd546b50f7069d23fff0
diff --git a/src/client.js b/src/client.js index <HASH>..<HASH> 100644 --- a/src/client.js +++ b/src/client.js @@ -245,7 +245,9 @@ function makeUnaryRequestFunction(method, serialize, deserialize) { return; } if (response.status.code !== grpc.status.OK) { - callback(response.status); + var error = new Error(response.status.details); + error.code = response.status.code; + callback(error); return; } emitter.emit('status', response.status); @@ -314,7 +316,9 @@ function makeClientStreamRequestFunction(method, serialize, deserialize) { return; } if (response.status.code !== grpc.status.OK) { - callback(response.status); + var error = new Error(response.status.details); + error.code = response.status.code; + callback(error); return; } stream.emit('status', response.status);
Return error status as actual errors to client callbacks
grpc_grpc-node
train
js
73845a0c60dfecde45c2cdca39626530f9070333
diff --git a/dynamic_scraper/utils/processors.py b/dynamic_scraper/utils/processors.py index <HASH>..<HASH> 100644 --- a/dynamic_scraper/utils/processors.py +++ b/dynamic_scraper/utils/processors.py @@ -1,7 +1,7 @@ #Stage 2 Update (Python 3) from __future__ import unicode_literals from builtins import str -import datetime +import datetime, re from scrapy import log @@ -10,7 +10,14 @@ def string_strip(text, loader_context): text = str(text) chars = loader_context.get('string_strip', ' \n\t\r') return text.strip(chars) + + +def remove_chars(text, loader_context): + pattern = loader_context.get('remove_chars', '') + result_str = re.sub(pattern, '', str(text)) + return result_str + def pre_string(text, loader_context): pre_str = loader_context.get('pre_string', '')
New processor remove_chars for removing characters or character pattern from a scraped string
holgerd77_django-dynamic-scraper
train
py
88e17fb28f98145aaa581b95ff89b8307a60f16e
diff --git a/source/php/Module/Posts/TemplateController/ExpandableListTemplate.php b/source/php/Module/Posts/TemplateController/ExpandableListTemplate.php index <HASH>..<HASH> 100644 --- a/source/php/Module/Posts/TemplateController/ExpandableListTemplate.php +++ b/source/php/Module/Posts/TemplateController/ExpandableListTemplate.php @@ -101,6 +101,9 @@ class ExpandableListTemplate } else { $accordion[$index]['heading'] = apply_filters('the_title', $post->post_title); } + + } else { + $accordion[$index]['heading'] = apply_filters('the_title', $post->post_title); } $accordion[$index]['content'] = apply_filters('the_content', $post->post_content);
Fixes missing titles in accordion view
helsingborg-stad_Modularity
train
php
e93c5aced976e55d351f57699f1a083f006a26ac
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -88,7 +88,7 @@ kill.hooks = []; // // Start-up a small static file server so we can download files and fixtures - // inside our tests. + // inside our PhantomJS test. // require('./static'),
Remove unnecessary change in test/index.js
unshiftio_requests
train
js
e9c5083d1fcaf79ee239a7818bd13da3a909f1be
diff --git a/src/mui/list/FilterButton.js b/src/mui/list/FilterButton.js index <HASH>..<HASH> 100644 --- a/src/mui/list/FilterButton.js +++ b/src/mui/list/FilterButton.js @@ -52,7 +52,7 @@ export class FilterButton extends Component { render() { const hiddenFilters = this.getHiddenFilters(); - return (hiddenFilters.length > 0 && <span> + return (hiddenFilters.length > 0 && <div style={{ display: 'inline-block' }}> <FlatButton primary label="Add Filter" icon={<ContentFilter />} onTouchTap={this.handleTouchTap} /> <Popover open={this.state.open} @@ -67,7 +67,7 @@ export class FilterButton extends Component { )} </Menu> </Popover> - </span>); + </div>); } }
Fix regression in material ui Popover component
marmelab_react-admin
train
js
52b3e66e0ee610d59fc1a85e3afd4757d0002cd1
diff --git a/MQ2/plugins/csv_plugin.py b/MQ2/plugins/csv_plugin.py index <HASH>..<HASH> 100644 --- a/MQ2/plugins/csv_plugin.py +++ b/MQ2/plugins/csv_plugin.py @@ -67,12 +67,13 @@ def get_qtls_from_rqtl_data(matrix, lod_threshold): # row 0: markers # row 1: chr # row 2: pos - for row in t_matrix[4:]: + for row in t_matrix[3:]: lgroup = None max_lod = None peak = None cnt = 1 while cnt < len(row): + print row[0] if lgroup is None: lgroup = t_matrix[1][cnt] diff --git a/MQ2/plugins/xls_plugin.py b/MQ2/plugins/xls_plugin.py index <HASH>..<HASH> 100644 --- a/MQ2/plugins/xls_plugin.py +++ b/MQ2/plugins/xls_plugin.py @@ -102,7 +102,7 @@ def get_qtls_from_rqtl_data(matrix, lod_threshold): # row 0: markers # row 1: chr # row 2: pos - for row in t_matrix[4:]: + for row in t_matrix[3:]: lgroup = None max_lod = None peak = None
The trait information starts on the fourth column of the file, not the fifth...
PBR_MQ2
train
py,py
79088520af04de8a9aa7f923bc7b6e836ac79285
diff --git a/test/CrateTest/PDO/PDOTest.php b/test/CrateTest/PDO/PDOTest.php index <HASH>..<HASH> 100644 --- a/test/CrateTest/PDO/PDOTest.php +++ b/test/CrateTest/PDO/PDOTest.php @@ -143,6 +143,17 @@ class PDOTest extends TestCase /** * @covers ::getAttribute + * @covers ::setAttribute + */ + public function testGetAndSetStatementClass() + { + $this->assertEquals(PDOStatement::class, $this->pdo->getAttribute(PDO::ATTR_STATEMENT_CLASS)); + $this->pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, 'Doctrine\DBAL\Driver\PDO\Statement'); + $this->assertEquals('Doctrine\DBAL\Driver\PDO\Statement', $this->pdo->getAttribute(PDO::ATTR_STATEMENT_CLASS)); + } + + /** + * @covers ::getAttribute */ public function testGetVersion() {
Add test case for ATTR_STATEMENT_CLASS
crate_crate-pdo
train
php
f17ec928dfcba7db6b69a66baae84e354b2a61ba
diff --git a/src/python/grpcio/grpc/experimental/aio/_interceptor.py b/src/python/grpcio/grpc/experimental/aio/_interceptor.py index <HASH>..<HASH> 100644 --- a/src/python/grpcio/grpc/experimental/aio/_interceptor.py +++ b/src/python/grpcio/grpc/experimental/aio/_interceptor.py @@ -53,6 +53,7 @@ class UnaryUnaryClientInterceptor(metaclass=ABCMeta): client_call_details: ClientCallDetails, request: RequestType) -> Union[UnaryUnaryCall, ResponseType]: """Intercepts a unary-unary invocation asynchronously. + Args: continuation: A coroutine that proceeds with the invocation by executing the next interceptor in chain or invoking the @@ -65,8 +66,10 @@ class UnaryUnaryClientInterceptor(metaclass=ABCMeta): client_call_details: A ClientCallDetails object describing the outgoing RPC. request: The request value for the RPC. + Returns: - An object with the RPC response. + An object with the RPC response. + Raises: AioRpcError: Indicating that the RPC terminated with non-OK status. asyncio.CancelledError: Indicating that the RPC was canceled.
Fix lack of empty line in the docstring
grpc_grpc
train
py
c0a8411cc8eb9e62ac8db2358c0ef168b0a31461
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 @@ -309,7 +309,7 @@ class StreamIO extends AbstractIO $buffer = fwrite($this->sock, mb_substr($data, $written, 8192, 'ASCII'), 8192); $this->cleanup_error_handler(); } catch (\ErrorException $e) { - throw new AMQPRuntimeException($e->getMessage(). $e->getCode(), $e); + throw new AMQPRuntimeException($e->getMessage(), $e->getCode(), $e); } if ($buffer === false) {
Fixed typo that may cause fatal error in runtime due to incorrect arguments being passed. Fixes #<I>
php-amqplib_php-amqplib
train
php
d3f86182468169727fe487e220c8ba2614d1ded0
diff --git a/tasks/iisexpress.js b/tasks/iisexpress.js index <HASH>..<HASH> 100644 --- a/tasks/iisexpress.js +++ b/tasks/iisexpress.js @@ -23,7 +23,9 @@ module.exports = function(grunt) { cmd: options.cmd, args: args, opts: spawnOptions - }, function() {}); + }, function(error, result, code) { + grunt.event.emit('iisexpress.done', error, result, code); + }); spawn.stdout.on('data', function (data) { grunt.log.write('IIS Express: ' + data); @@ -45,4 +47,4 @@ module.exports = function(grunt) { }); } }); -}; \ No newline at end of file +};
Emit event when child process exits.
rpeterclark_grunt-iisexpress
train
js
c873f5a7fea91613c2218427fa6408da2bb8ae85
diff --git a/pkg/archive/changes.go b/pkg/archive/changes.go index <HASH>..<HASH> 100644 --- a/pkg/archive/changes.go +++ b/pkg/archive/changes.go @@ -187,10 +187,15 @@ func changes(layers []string, rw string, dc deleteChange, sc skipChange) ([]Chan } if change.Kind == ChangeAdd || change.Kind == ChangeDelete { parent := filepath.Dir(path) - if _, ok := changedDirs[parent]; !ok && parent != "/" { - changes = append(changes, Change{Path: parent, Kind: ChangeModify}) - changedDirs[parent] = struct{}{} + tail := []Change{} + for parent != "/" { + if _, ok := changedDirs[parent]; !ok && parent != "/" { + tail = append([]Change{{Path: parent, Kind: ChangeModify}}, tail...) + changedDirs[parent] = struct{}{} + } + parent = filepath.Dir(parent) } + changes = append(changes, tail...) } // Record change
Extend the fix for #<I> to cover the whole path Extend the fix for #<I> to cover every component of an added or removed file's pathname.
containers_storage
train
go
96acb5fa09f91d0124e7eb0ffbc19810e0521236
diff --git a/lib/gds_api/test_helpers/publishing_api_v2.rb b/lib/gds_api/test_helpers/publishing_api_v2.rb index <HASH>..<HASH> 100644 --- a/lib/gds_api/test_helpers/publishing_api_v2.rb +++ b/lib/gds_api/test_helpers/publishing_api_v2.rb @@ -154,6 +154,12 @@ module GdsApi stub_request(:get, url).to_return(status: 200, body: item.to_json, headers: {}) end + def publishing_api_has_links(links) + links = links.with_indifferent_access + url = PUBLISHING_API_V2_ENDPOINT + "/links/" + links[:content_id] + stub_request(:get, url).to_return(status: 200, body: links.to_json, headers: {}) + end + private def stub_publishing_api_put(content_id, body, resource_path, override_response_hash = {}) response_hash = {status: 200, body: '{}', headers: {"Content-Type" => "application/json; charset=utf-8"}}
Add a publishing_api_has_links helper This is to stub that the Publishing API V2 contains a links payload.
alphagov_gds-api-adapters
train
rb
32ace82879553fb8b0800a1e79951522530d9573
diff --git a/kdtree/kdtree.py b/kdtree/kdtree.py index <HASH>..<HASH> 100644 --- a/kdtree/kdtree.py +++ b/kdtree/kdtree.py @@ -404,7 +404,7 @@ class KDNode(Node): return best @require_axis - def search_nn_dist(self, point, distance, best=[]): + def search_nn_dist(self, point, distance, best=None): """ Search the n nearest nodes of the given point which are within given distance @@ -413,6 +413,9 @@ class KDNode(Node): nodes to the point within the distance will be returned. """ + if best is None: + best = [] + # consider the current node if self.dist(point) < distance: best.append(self) @@ -471,7 +474,7 @@ class KDNode(Node): -def create(point_list=[], dimensions=None, axis=0, sel_axis=None): +def create(point_list=None, dimensions=None, axis=0, sel_axis=None): """ Creates a kd-tree from a list of points All points in the list must be of the same dimensionality.
Fixing default argument issue in search_nn_dist. This was causing nodes to be duplicated in the array returned by the method.
stefankoegl_kdtree
train
py
dda3b01d01c48cd3e3df143fc2c8ecb681ade7ab
diff --git a/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go b/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go index <HASH>..<HASH> 100644 --- a/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go +++ b/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go @@ -238,7 +238,7 @@ func GetEquivalencePod(pod *v1.Pod) interface{} { // to be equivalent if len(pod.OwnerReferences) != 0 { for _, ref := range pod.OwnerReferences { - if *ref.Controller && isValidControllerKind(ref.Kind) { + if *ref.Controller { equivalencePod.ControllerRef = ref // a pod can only belongs to one controller break @@ -248,17 +248,6 @@ func GetEquivalencePod(pod *v1.Pod) interface{} { return &equivalencePod } -// isValidControllerKind checks if a given controller's kind can be applied to equivalence pod algorithm. -func isValidControllerKind(kind string) bool { - switch kind { - // list of kinds that we cannot handle - case StatefulSetKind: - return false - default: - return true - } -} - // EquivalencePod is a group of pod attributes which can be reused as equivalence to schedule other pods. type EquivalencePod struct { ControllerRef metav1.OwnerReference
Remove special case for StatefulSets in scheduler
kubernetes_kubernetes
train
go
15c2d20f266e9d5f05ec63b75ef8fc4b3fd22a56
diff --git a/timer.js b/timer.js index <HASH>..<HASH> 100644 --- a/timer.js +++ b/timer.js @@ -111,14 +111,10 @@ var hours = document.createElement('div'); hours.className = 'hours'; - var days = document.createElement('div'); - days.className = 'days'; - var clearDiv = document.createElement('div'); clearDiv.className = 'clearDiv'; return timerBoxElement. - append(days). append(hours). append(minutes). append(seconds). @@ -135,6 +131,10 @@ that.onComplete(); }); + that.on('complete', function(){ + that.addClass('timeout'); + }); + }; })(jQuery);
Add timeout class on complete event. Remove days element.
caike_jQuery-Simple-Timer
train
js
ce6f557f6b67eea29a9dc81a780685813d682877
diff --git a/closure/goog/editor/plugins/linkdialogplugin.js b/closure/goog/editor/plugins/linkdialogplugin.js index <HASH>..<HASH> 100644 --- a/closure/goog/editor/plugins/linkdialogplugin.js +++ b/closure/goog/editor/plugins/linkdialogplugin.js @@ -332,15 +332,14 @@ goog.editor.plugins.LinkDialogPlugin.prototype.handleOk = function(e) { this.touchUpAnchorOnOk_(extraAnchors[i], e); } - // Place cursor to the right of the modified link, and immediately dispatch a - // selectionChange event. + // Place cursor to the right of the modified link. this.currentLink_.placeCursorRightOf(); - this.getFieldObject().dispatchSelectionChangeEvent(); - - this.getFieldObject().dispatchChange(); this.getFieldObject().focus(); + this.getFieldObject().dispatchSelectionChangeEvent(); + this.getFieldObject().dispatchChange(); + this.eventHandler_.removeAll(); };
Automated g4 rollback *** Reason for rollback *** Didn't help fix *** Original change description *** Have LinkDialogPlugin fire selectionChange event immediately after moving cursor by moving the focus call to after the dispatch call (as well as after the change event dispatch call) *** ------------- Created by MOE: <URL>
google_closure-library
train
js
92fa14a54458723d6e6e0dcc915c99f000e2501d
diff --git a/ansuz.js b/ansuz.js index <HASH>..<HASH> 100644 --- a/ansuz.js +++ b/ansuz.js @@ -136,7 +136,10 @@ var exists=ansuz.exists=function (A,e){ if the provided argument is an object, instead test if one of the keys corresponds to such a value */ - if(isArray(A)) return (A.indexOf(e)!==-1)?true:false; + if(typeof e === 'undefined'){ + return A; + } + if(isArray(A)) return (A.indexOf(e)!==-1); if(typeof A==='object'){ for(a in A){ if(A[a] == e){ @@ -186,7 +189,7 @@ var log=ansuz.log=function(a,b){ }; var is=ansuz.is=function (a,b){ -/* alias for equality, for when you want to curry */ + /* alias for equality, for when you want to curry */ return a === b; };
ansuz.js : checks for truthiness if only one argument is passed
ansuz_ansuzjs
train
js
fa8ce00953b8d0586231cb9a1c89d9c04a8eeed1
diff --git a/src/scs_core/aws/client/mqtt_client.py b/src/scs_core/aws/client/mqtt_client.py index <HASH>..<HASH> 100644 --- a/src/scs_core/aws/client/mqtt_client.py +++ b/src/scs_core/aws/client/mqtt_client.py @@ -31,9 +31,9 @@ class MQTTClient(object): __QUEUE_DROP_BEHAVIOUR = MQTTLib.DROP_OLDEST # not required for infinite queue __QUEUE_DRAINING_FREQUENCY = 2 # recommended: 2 (Hz) - __RECONN_BASE = 2 # recommended: 1 (sec) - __RECONN_MAX = 64 # recommended: 32 (sec) - __RECONN_STABLE = 40 # recommended: 20 (sec) + __RECONN_BASE = 1 # recommended: 1 (sec) + __RECONN_MAX = 32 # recommended: 32 (sec) + __RECONN_STABLE = 20 # recommended: 20 (sec) __DISCONNECT_TIMEOUT = 20 # recommended: 10 (sec) __OPERATION_TIMEOUT = 10 # recommended: 5 (sec)
Changed connect times in MQTTClient.
south-coast-science_scs_core
train
py
c9a395f8b3bed97269fa9a0d0583dfc3df1029d8
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py index <HASH>..<HASH> 100644 --- a/OpenSSL/crypto.py +++ b/OpenSSL/crypto.py @@ -1192,11 +1192,11 @@ def dump_certificate_request(type, req): if type == FILETYPE_PEM: result_code = _api.PEM_write_bio_X509_REQ(bio, req._req) elif type == FILETYPE_ASN1: - pass + result_code = _api.i2d_X509_REQ_bio(bio, req._req) elif type == FILETYPE_TEXT: - pass + result_code = _api.X509_REQ_print_ex(bio, req._req, 0, 0) else: - 1/0 + raise ValueError("type argument must be FILETYPE_PEM, FILETYPE_ASN1, or FILETYPE_TEXT") if result_code == 0: 1/0 @@ -1220,7 +1220,7 @@ def load_certificate_request(type, buffer): if type == FILETYPE_PEM: req = _api.PEM_read_bio_X509_REQ(bio, _api.NULL, _api.NULL, _api.NULL) elif type == FILETYPE_ASN1: - pass + req = _api.d2i_X509_REQ_bio(bio, _api.NULL) else: 1/0
Make another FunctionTests case pass by implementing some more proper error handling
pyca_pyopenssl
train
py
81583a5b4fb16bbc1b466155e15f3d658b2a2701
diff --git a/source/clique/collection.py b/source/clique/collection.py index <HASH>..<HASH> 100644 --- a/source/clique/collection.py +++ b/source/clique/collection.py @@ -251,15 +251,25 @@ class Collection(object): else: data['padding'] = '%d' - if self.indexes: + if '{holes}' in pattern: data['holes'] = self.holes().format('{ranges}') + if '{range}' in pattern or '{ranges}' in pattern: indexes = list(self.indexes) - if len(indexes) == 1: + indexes_count = len(indexes) + + if indexes_count == 0: + data['range'] = '' + + elif indexes_count == 1: data['range'] = '{0}'.format(indexes[0]) + else: - data['range'] = '{0}-{1}'.format(indexes[0], indexes[-1]) + data['range'] = '{0}-{1}'.format( + indexes[0], indexes[-1] + ) + if '{ranges}' in pattern: separated = self.separate() if len(separated) > 1: ranges = [collection.format('{range}') @@ -270,11 +280,6 @@ class Collection(object): data['ranges'] = ', '.join(ranges) - else: - data['holes'] = '' - data['range'] = '' - data['ranges'] = '' - return pattern.format(**data) def is_contiguous(self):
[#<I>] Avoid redundant and potentially infinitely recursive computation in Collection.format.
4degrees_clique
train
py
4f9235752cea29c5a31721440578b430823a1e69
diff --git a/html5lib/_trie/_base.py b/html5lib/_trie/_base.py index <HASH>..<HASH> 100644 --- a/html5lib/_trie/_base.py +++ b/html5lib/_trie/_base.py @@ -1,6 +1,9 @@ from __future__ import absolute_import, division, unicode_literals -from collections import Mapping +try: + from collections.abc import Mapping +except ImportError: # Python 2.7 + from collections import Mapping class Trie(Mapping): diff --git a/html5lib/treebuilders/dom.py b/html5lib/treebuilders/dom.py index <HASH>..<HASH> 100644 --- a/html5lib/treebuilders/dom.py +++ b/html5lib/treebuilders/dom.py @@ -1,7 +1,10 @@ from __future__ import absolute_import, division, unicode_literals -from collections import MutableMapping +try: + from collections.abc import MutableMapping +except ImportError: # Python 2.7 + from collections import MutableMapping from xml.dom import minidom, Node import weakref
Try to import MutableMapping from collections.abc (#<I>) Note that collections.abc has been added in Python <I>. Fixes #<I>
html5lib_html5lib-python
train
py,py
6883e93cd4260b83be9451e9efd019f965b6f14a
diff --git a/lib/virtualmonkey/deployment_runner.rb b/lib/virtualmonkey/deployment_runner.rb index <HASH>..<HASH> 100644 --- a/lib/virtualmonkey/deployment_runner.rb +++ b/lib/virtualmonkey/deployment_runner.rb @@ -261,13 +261,12 @@ module VirtualMonkey end raise "Fatal: Failed to verify that monitoring is operational" unless response #TODO: pass in some list of plugin info to check multiple values. For now just -# hardcoding the df check +# hardcoding the cpu check sleep 60 # This is to allow monitoring data to accumulate - monitor=server.get_sketchy_data({'start'=>-60,'end'=>-20,'plugin_name'=>"df",'plugin_type'=>"df-mnt"}) - data=monitor['data'] - free=data['free'] - raise "No df free data" unless free.length > 0 - raise "DF not free" unless free[0] > 0 + monitor=server.get_sketchy_data({'start'=>-60,'end'=>-20,'plugin_name'=>"cpu-0",'plugin_type'=>"cpu-idle"}) + idle_values = monitor['data']['value'] + raise "No cpu idle data" unless idle_values.length > 0 + raise "No idle time" unless idle_values[0] > 0 puts "Monitoring is OK for #{server.nickname}" end end
Jon's monitoring check changes (compat w/ Win & Linux)
jeremyd_virtualmonkey
train
rb
936c24e0c2fe9180245e8d6022a6a966860bccb6
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -191,10 +191,20 @@ exports.argmentApp = function (app, opts) { app.engine('html', exports.engine); app.locals.appRoot = opts.appRoot; app.locals.assetsDirName = opts.assetsDirName; - var _render = app.response.render; - app.response.render = function () { - this.locals.partials = this.locals.partials || getPartials(opts.appRoot); - _render.apply(this, arguments); - }; + app.use(function (req, res, next) { + var _render = res.render; + res.render = function (view, options, fn) { + if ('function' === typeof options) { + fn = options; + options = {}; + } + this.locals.partials = this.locals.partials || getPartials(opts + .appRoot); + options = assign({}, app.locals, this.locals, options); + this.locals = {}; + _render.call(this, view, options, fn); + }; + next(); + }); app.use(exports.middleware(opts)); -}; +}; \ No newline at end of file
fix render monkey patch for express-promise
dysonshell_ds-render
train
js
fe1021cc9f3c56a0419661056efdbb7c29df2c4a
diff --git a/src/main/resources/META-INF/resources/primefaces/datepicker/0-datepicker.js b/src/main/resources/META-INF/resources/primefaces/datepicker/0-datepicker.js index <HASH>..<HASH> 100644 --- a/src/main/resources/META-INF/resources/primefaces/datepicker/0-datepicker.js +++ b/src/main/resources/META-INF/resources/primefaces/datepicker/0-datepicker.js @@ -1802,7 +1802,9 @@ : ((((this.isMultipleSelection() || this.isRangeSelection()) && this.value instanceof Array) ? this.value[0] : this.value) || this.parseValue(new Date())); - this.updateViewDate(null, viewDate); + if(viewDate instanceof Date) { + this.updateViewDate(null, viewDate); + } } },
Fix primefaces#<I>: Only update viewDate if it is really a date (#<I>)
primefaces_primefaces
train
js
ad4bc5701e2d9380ea04181f67401404f5f2200c
diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index <HASH>..<HASH> 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -500,12 +500,10 @@ func main() { case <-term: level.Warn(logger).Log("msg", "Received SIGTERM, exiting gracefully...") reloadReady.Close() - case <-webHandler.Quit(): level.Warn(logger).Log("msg", "Received termination request via web service, exiting gracefully...") case <-cancel: reloadReady.Close() - break } return nil },
remove unwanted break (#<I>)
prometheus_prometheus
train
go
b752066dd144d3b16ebd4acff5682b52c7131ba0
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -697,7 +697,11 @@ class AESFuncs(object): self.serial.dump( clear_load, open( os.path.join( - salt.utils.jid_dir(jid), + salt.utils.jid_dir( + jid, + self.opts['cachedir'], + self.opts['hash_type'] + ), '.load.p' ), 'w+')
Ensure the correct args are passed to jid_dir
saltstack_salt
train
py
6cc023ebf0f6f113759d38944f6b64c2423a2b56
diff --git a/Validator/UniqueValidator.php b/Validator/UniqueValidator.php index <HASH>..<HASH> 100644 --- a/Validator/UniqueValidator.php +++ b/Validator/UniqueValidator.php @@ -60,6 +60,7 @@ class UniqueValidator extends ConstraintValidator if ( $id !== null && count($entities) === 1 + && $accessor->getValue($object, $id) !== null && $entityManager->getReference($class, $accessor->getValue($object, $id)) === current($entities) ) { return;
Ignore ID attribute when it is null in Unique validator. (#<I>) Ignore ID attribute when it is null in Unique validator
vaniocz_vanio-domain-bundle
train
php
609409e57e4e8c8f549dbe08a0463c56de2091f9
diff --git a/furious/context.py b/furious/context.py index <HASH>..<HASH> 100644 --- a/furious/context.py +++ b/furious/context.py @@ -57,6 +57,18 @@ def new(): return new_context +def init_context_with_async(async): + """Instantiate a new JobContext and store a reference to it in the global + async context to make later retrieval easier.""" + if not _local_context._executing_async_context: + raise ContextExistsError + + _init() + job_context = JobContext(async) + _local_context._executing_async_context = job_context + return job_context + + def get_current_async(): """Return a reference to the currently executing Async job object or None if not in an Async job. @@ -178,7 +190,14 @@ def _init(): if hasattr(_local_context, '_initialized'): return + # Used to track the context object stack. _local_context.registry = [] + + # Used to provide easy access to the currently running Async job. + _local_context._executing_async_context = None + _local_context._executing_async = None + + # So that we do not inadvertently reinitialize the local context. _local_context._initialized = True return _local_context
Add setup and helper to initialize the eniviron with a job context.
Workiva_furious
train
py
42511c2deb7ef511f55eda114866e082989b6118
diff --git a/src/PhpFlo/Port.php b/src/PhpFlo/Port.php index <HASH>..<HASH> 100644 --- a/src/PhpFlo/Port.php +++ b/src/PhpFlo/Port.php @@ -134,12 +134,6 @@ final class Port extends AbstractPort throw new PortException("This port is not connected"); } - if (false == $this->hasType($data, 'send')) { - throw new InvalidTypeException( - 'Port tries to send invalid data type "' . gettype($data) . '"!' - ); - } - if ($this->isConnected()) { return $this->socket->send($data); }
Fix regression in port type check on initialization
phpflo_phpflo
train
php
72f924a386b0b3172bece4eab6574eb973eb6c88
diff --git a/salt/cloud/clouds/msazure.py b/salt/cloud/clouds/msazure.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/msazure.py +++ b/salt/cloud/clouds/msazure.py @@ -63,7 +63,7 @@ try: import salt.utils.msazure from salt.utils.msazure import object_to_dict HAS_LIBS = True -except ImportError, e: +except ImportError: pass __virtualname__ = 'azure' @@ -674,9 +674,9 @@ def create(vm_): ret['Attached Volumes'] = created data = show_instance(vm_['name'], call='action') - log.info('Created Cloud VM {0[name]!r}'.format(vm_)) + log.info('Created Cloud VM \'{0[name]}\''.format(vm_)) log.debug( - '{0[name]!r} VM creation details:\n{1}'.format( + '\'{0[name]}\' VM creation details:\n{1}'.format( vm_, pprint.pformat(data) ) )
Correcting lint error, reverting !r
saltstack_salt
train
py
d46cf1d9d864846f803bd6e4167319dd536db99e
diff --git a/tests/test_reading.py b/tests/test_reading.py index <HASH>..<HASH> 100755 --- a/tests/test_reading.py +++ b/tests/test_reading.py @@ -12,10 +12,10 @@ def test_from_local_file(): def test_from_analysis_id(): - mwtabfile_generator = mwtab.read_files("5") + mwtabfile_generator = mwtab.read_files("2") mwtabfile = next(mwtabfile_generator) - assert mwtabfile.study_id == "ST000004" - assert mwtabfile.analysis_id == "AN000005" + assert mwtabfile.study_id == "ST000002" + assert mwtabfile.analysis_id == "AN000002" @pytest.mark.parametrize("files_source", [
Fixes `test_reading.py` module, which tests the mwtab packages ability to read on generate `~mwtab.MWTabFile` objects.
MoseleyBioinformaticsLab_mwtab
train
py
dc22ec0aad17f976a86474fa1094c55db4e6968b
diff --git a/spacy/about.py b/spacy/about.py index <HASH>..<HASH> 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -1,6 +1,6 @@ # fmt: off __title__ = "spacy" -__version__ = "2.2.0.dev16" +__version__ = "2.2.0.dev17" __release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
Set version to <I>.de<I>
explosion_spaCy
train
py
22af4b8b5bb84d3d21966a10e7401e95bcbd38b7
diff --git a/Source/classes/HUD.js b/Source/classes/HUD.js index <HASH>..<HASH> 100644 --- a/Source/classes/HUD.js +++ b/Source/classes/HUD.js @@ -11,10 +11,10 @@ Garnish.HUD = Garnish.Base.extend({ this.$trigger = $(trigger); this.setSettings(settings, Garnish.HUD.defaults); - if (typeof Garnish.HUD.activeHUDs == "undefined") - { - Garnish.HUD.activeHUDs = {}; - } + if (typeof Garnish.HUD.activeHUDs == "undefined") + { + Garnish.HUD.activeHUDs = {}; + } this.showing = false; @@ -42,11 +42,11 @@ Garnish.HUD = Garnish.Base.extend({ return; } - if (Garnish.HUD.activeHUDs.length && !this.settings.closeOtherHUDs) + if (this.settings.closeOtherHUDs) { for (var hudID in Garnish.HUD.activeHUDs) { - Garnish.HUD.activeHUDs[hudID].hide(); - } + Garnish.HUD.activeHUDs[hudID].hide(); + } } this.$hud.show(); @@ -256,6 +256,6 @@ Garnish.HUD = Garnish.Base.extend({ onShow: $.noop, onHide: $.noop, closeBtn: null, - closeOtherHUDs: false + closeOtherHUDs: true } });
Fix some broken-logic naming for HUD.
pixelandtonic_garnishjs
train
js
7101a3097f95ddb8d1d23c09585a7610fece1277
diff --git a/lib/Resque/Worker.php b/lib/Resque/Worker.php index <HASH>..<HASH> 100644 --- a/lib/Resque/Worker.php +++ b/lib/Resque/Worker.php @@ -69,13 +69,8 @@ class Resque_Worker } $this->queues = $queues; - if(function_exists('gethostname')) { - $hostname = gethostname(); - } - else { - $hostname = php_uname('n'); - } - $this->hostname = $hostname; + $this->hostname = php_uname('n'); + $this->id = $this->hostname . ':'.getmypid() . ':' . implode(',', $this->queues); }
gethostname() doesn't work on Amazon's EC2
chrisboulton_php-resque
train
php
f9a1cd6f50e1b2b294607f901c2bc8c9b3c2681b
diff --git a/condoor/version.py b/condoor/version.py index <HASH>..<HASH> 100644 --- a/condoor/version.py +++ b/condoor/version.py @@ -1,3 +1,3 @@ """Version information.""" -__version__ = '1.0.5.dev2' +__version__ = '1.0.6'
Bumping version number to <I>
kstaniek_condoor
train
py
7b282b427c7570fe3943f7234ef27d8d61cee48b
diff --git a/app/controllers/renalware/events_controller.rb b/app/controllers/renalware/events_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/renalware/events_controller.rb +++ b/app/controllers/renalware/events_controller.rb @@ -5,14 +5,11 @@ module Renalware def new @event = Event.new - authorize @event @event_type = EventType.new end def create @event = @patient.events.new(event_params) - authorize @event - if @event.save redirect_to patient_events_path(@patient), :notice => "You have successfully added an encounter/event." else @@ -22,7 +19,6 @@ module Renalware def index @events = @patient.events - authorize @events end private
Removed pundit 'authorize' from events_controller's patient actions.
airslie_renalware-core
train
rb
73870910837d5591db76c6bf033f3cb78e94669a
diff --git a/pysc2/env/sc2_env.py b/pysc2/env/sc2_env.py index <HASH>..<HASH> 100644 --- a/pysc2/env/sc2_env.py +++ b/pysc2/env/sc2_env.py @@ -511,7 +511,8 @@ class SC2Env(environment.Base): wait_time = next_step_time - time.time() if wait_time > 0.0: - time.sleep(wait_time) + with sw("wait_on_step_mul"): + time.sleep(wait_time) # Note that we use the targeted next_step_time here, not the actual # time. This is so that we advance our view of the SC2 game clock in @@ -557,7 +558,8 @@ class SC2Env(environment.Base): self._target_step, game_loop) - time.sleep(REALTIME_GAME_LOOP_SECONDS) + with sw("wait_on_game_loop"): + time.sleep(REALTIME_GAME_LOOP_SECONDS) else: # We're beyond our target now. if needed_to_wait:
Wrap realtime waits with stopwatch. PiperOrigin-RevId: <I>
deepmind_pysc2
train
py
87838127b03973bbe5646d872545fa9606b20c74
diff --git a/src/ocrmypdf/pdfinfo/info.py b/src/ocrmypdf/pdfinfo/info.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/pdfinfo/info.py +++ b/src/ocrmypdf/pdfinfo/info.py @@ -409,15 +409,10 @@ class ImageInfo: return _get_dpi(self._shorthand, (self._width, self._height)) def __repr__(self): - class_locals = { - attr: getattr(self, attr, None) - for attr in dir(self) - if not attr.startswith('_') - } return ( - "<ImageInfo '{name}' {type_} {width}x{height} {color} " - "{comp} {bpc} {enc} {dpi}>" - ).format(**class_locals) + f"<ImageInfo '{self.name}' {self.type_} {self.width}x{self.height} " + f"{self.color} {self.comp} {self.bpc} {self.enc} {self.dpi}>" + ) def _find_inline_images(contentsinfo: ContentsInfo) -> Iterator[ImageInfo]:
info: replace introspection with explicit f-string
jbarlow83_OCRmyPDF
train
py
17350b04dcc1f1e2433365c33b067883196e1de5
diff --git a/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/Utils.java b/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/Utils.java index <HASH>..<HASH> 100644 --- a/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/Utils.java +++ b/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/Utils.java @@ -102,6 +102,10 @@ public class Utils return Double.toString(n.doubleValue()); } } + else if(obj instanceof Character) + { + return "'" + obj + "'"; + } else if(obj instanceof String) { return "\"" + obj.toString() + "\"";
Small fix to the 'toString(..)' method in the codegen runtime Utils class
overturetool_overture
train
java
acfa2315128bd89398ed18de8760b9d7c3efd4e7
diff --git a/learning.py b/learning.py index <HASH>..<HASH> 100644 --- a/learning.py +++ b/learning.py @@ -159,8 +159,8 @@ class NaiveBayesLearner(Learner): def train(self, dataset): """Just count the target/attr/val occurrences. Count how many times each value of each attribute occurs. - Store count in N[targetvalue][attr][val]. Let N[attr][None] be the - sum over all vals.""" + Store count in N[targetvalue][attr][val]. Let + N[targetvalue][attr][None] be the sum over all vals.""" self.dataset = dataset N = {} ## Initialize to 0 @@ -168,6 +168,7 @@ class NaiveBayesLearner(Learner): N[gv] = {} for attr in self.dataset.attrs: N[gv][attr] = {} + assert None not in self.dataset.values[attr] for val in self.dataset.values[attr]: N[gv][attr][val] = 0 N[gv][attr][None] = 0
NaiveBayesLearner: Fixed doc comment and added an assertion.
hobson_aima
train
py
2c816958f1c9330a87a0938be380cab84bbbf5e5
diff --git a/provision/docker/provisioner.go b/provision/docker/provisioner.go index <HASH>..<HASH> 100644 --- a/provision/docker/provisioner.go +++ b/provision/docker/provisioner.go @@ -42,7 +42,11 @@ func getRouterForApp(app provision.App) (router.Router, error) { type dockerProvisioner struct{} func (p *dockerProvisioner) Initialize() error { - return initDockerCluster() + err := initDockerCluster() + if err != nil { + return err + } + return migrateImages() } // Provision creates a route for the container
provision/docker: call migrateImages on Initialize Related to #<I> (only missing some tests, before I close it).
tsuru_tsuru
train
go
a319b6cf589b2defca28aac408e1f94b68d40110
diff --git a/lhc/binf/genomic_feature.py b/lhc/binf/genomic_feature.py index <HASH>..<HASH> 100644 --- a/lhc/binf/genomic_feature.py +++ b/lhc/binf/genomic_feature.py @@ -5,6 +5,8 @@ from lhc.collections.sorted_list import SortedList class GenomicFeature(Interval): + __slots__ = ('_chr', 'children', 'name', 'type') + def __init__(self, name, type=None, interval=None, data=None): self._chr = None self.children = SortedList() @@ -94,3 +96,9 @@ class GenomicFeature(Interval): if depth == 0: return res if self.strand == '+' else revcmp(res) return res + + def __getstate__(self): + return self._chr, self.children, self.name, self.type, self.start, self.stop, self.data, self.strand, self.type + + def __setstate__(self, state): + self._chr, self.children, self.name, self.type, self.start, self.stop, self.data, self.strand, self.type = state
added get and set state to genomic feature
childsish_lhc-python
train
py
feb76858777a49e9ad3df8f025c458f6623f952f
diff --git a/app/scripts/HorizontalGeneAnnotationsTrack.js b/app/scripts/HorizontalGeneAnnotationsTrack.js index <HASH>..<HASH> 100644 --- a/app/scripts/HorizontalGeneAnnotationsTrack.js +++ b/app/scripts/HorizontalGeneAnnotationsTrack.js @@ -674,6 +674,7 @@ class HorizontalGeneAnnotationsTrack extends HorizontalTiled1DPixiTrack { } else { r.setAttribute('fill', this.options.minusStrandColor); } + r.setAttribute('opacity', '0.3'); gTile.appendChild(r); });
<I>% opacity on SVG export gene annotations
higlass_higlass
train
js
30c736247a74d9f338461fe22a03110649e01dcd
diff --git a/src/Medoo.php b/src/Medoo.php index <HASH>..<HASH> 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -530,7 +530,7 @@ class Medoo if ($single_condition != []) { - $condition = $this->data_implode($single_condition, ''); + $condition = $this->data_implode($single_condition, ' AND'); if ($condition != '') {
[feature] Connect conditions with AND keyword by default
catfan_Medoo
train
php
bfec90f1e8d6fc6029cca32be5a2d4dd8717000b
diff --git a/interact.js b/interact.js index <HASH>..<HASH> 100644 --- a/interact.js +++ b/interact.js @@ -98,7 +98,6 @@ maxPerElement: 1, snap: { - actions : ['drag'], enabled : false, mode : 'grid', endOnly : false, @@ -121,7 +120,6 @@ }, inertia: { - actions : ['drag'], enabled : false, resistance : 10, // the lambda in exponential decay minSpeed : 100, // target speed must be above this for inertia to start @@ -1961,7 +1959,6 @@ // check if inertia should be started inertiaPossible = (options[this.action].inertia.enabled && this.action !== 'gesture' - && contains(inertiaOptions.actions, this.action) && event !== inertiaStatus.startEvent); inertia = (inertiaPossible @@ -5189,7 +5186,6 @@ resistance: inertia.resistance, minSpeed: inertia.minSpeed, endSpeed: inertia.endSpeed, - actions: inertia.actions, allowResume: inertia.allowResume, zeroResumeDelta: inertia.zeroResumeDelta };
Remove actions:[] from snap and inertia options
taye_interact.js
train
js
2c4ba607a9ace26c58d434c4d65db862ba40163a
diff --git a/example/main.go b/example/main.go index <HASH>..<HASH> 100644 --- a/example/main.go +++ b/example/main.go @@ -33,6 +33,29 @@ func main() { } func publish(written, read *disruptor.Cursor) { + + // sequence := disruptor.InitialSequenceValue + // writer := &disruptor.Writer2{} + + // // writer := disruptor.NewWriter(written, read, BufferSize) + // for sequence < Iterations { + // sequence = writer.Reserve() + // } + + // sequence := disruptor.InitialSequenceValue + // writer := disruptor.NewWriter(written, read, BufferSize) + + // for sequence <= Iterations { + // sequence = writer.Reserve() + // ringBuffer[sequence&BufferMask] = sequence + // written.Sequence = sequence + // // writer.Commit(sequence) + // } + + // fmt.Println(writer.Gating()) + + gating := 0 + previous := disruptor.InitialSequenceValue gate := disruptor.InitialSequenceValue @@ -42,12 +65,15 @@ func publish(written, read *disruptor.Cursor) { for wrap > gate { gate = read.Sequence + gating++ } ringBuffer[next&BufferMask] = next written.Sequence = next previous = next } + + fmt.Println("Gating", gating) } type SampleConsumer struct{}
Experimenting with different writing techniques.
smartystreets_go-disruptor
train
go
46129d51f5d1022637ed1d835cc7449a42cfcf3f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,10 @@ module.exports = function download (opts, cb) { var symbols = opts.symbols || false if (!version) return cb(new Error('must specify version')) var filename = 'electron-v' + version + '-' + platform + '-' + arch + (symbols ? '-symbols' : '') + '.zip' - var url = process.env.ELECTRON_MIRROR || opts.mirror || 'https://github.com/atom/electron/releases/download/v' + var url = process.env.NPM_CONFIG_ELECTRON_MIRROR || + process.env.ELECTRON_MIRROR || + opts.mirror || + 'https://github.com/atom/electron/releases/download/v' url += version + '/electron-v' + version + '-' + platform + '-' + arch + (symbols ? '-symbols' : '') + '.zip' var homeDir = homePath() var cache = opts.cache || path.join(homeDir, './.electron')
Added npm config support Added support for electron mirror in npm config
parro-it_libui-download
train
js
306f03c6cf11d706e0c86849c5f8412fa989032a
diff --git a/src/Model/Table/ImportsTable.php b/src/Model/Table/ImportsTable.php index <HASH>..<HASH> 100644 --- a/src/Model/Table/ImportsTable.php +++ b/src/Model/Table/ImportsTable.php @@ -65,10 +65,26 @@ class ImportsTable extends Table ->notEmpty('filename'); $validator + ->requirePresence('status', 'create') + ->notEmpty('status'); + + $validator + ->requirePresence('model_name', 'create') + ->notEmpty('model_name'); + + $validator + ->requirePresence('attempts', 'create') + ->notEmpty('attempts'); + + $validator ->requirePresence('options', 'update') ->notEmpty('options', 'update'); $validator + ->requirePresence('attempted_date', 'update') + ->notEmpty('attempted_date', 'update'); + + $validator ->dateTime('trashed') ->allowEmpty('trashed');
Added validation rules for new fields (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
6308495c6fbc9035718215fda63b1221180a410f
diff --git a/ignite/contrib/handlers/neptune_logger.py b/ignite/contrib/handlers/neptune_logger.py index <HASH>..<HASH> 100644 --- a/ignite/contrib/handlers/neptune_logger.py +++ b/ignite/contrib/handlers/neptune_logger.py @@ -7,7 +7,6 @@ import torch import torch.nn as nn from torch.optim import Optimizer -import ignite import ignite.distributed as idist from ignite.contrib.handlers.base_logger import ( BaseLogger,
remove unused imports in contrib/handlers (#<I>)
pytorch_ignite
train
py
cd635e32286b67c574d6241a8e960ef37af9dcf3
diff --git a/currencies/__init__.py b/currencies/__init__.py index <HASH>..<HASH> 100644 --- a/currencies/__init__.py +++ b/currencies/__init__.py @@ -1 +1 @@ -__version__ = '0.3.0' +__version__ = '0.3.2'
pushed to version <I>.
bashu_django-simple-currencies
train
py
2ea15ac4781d8942b6232e954574342dcf88704a
diff --git a/demo_timeout.py b/demo_timeout.py index <HASH>..<HASH> 100644 --- a/demo_timeout.py +++ b/demo_timeout.py @@ -7,7 +7,7 @@ my_agent = 'mwapi demo script <ahalfaker@wikimedia.org>' session = mwapi.Session('https://10.11.12.13', user_agent=my_agent, timeout=0.5) -print("Making a request that should hang for 2 seconds and then timeout.") +print("Making a request that should hang for 0.5 seconds and then timeout.") try: session.get(action="fake") except mwapi.errors.TimeoutError as e:
Fixes print statement for demo_timeout. Timeout is <I> seconds.
mediawiki-utilities_python-mwapi
train
py
63c683fdf9f8d629116a28b9e8439b7e2269c265
diff --git a/lib/active_annotations/rdf_annotation.rb b/lib/active_annotations/rdf_annotation.rb index <HASH>..<HASH> 100644 --- a/lib/active_annotations/rdf_annotation.rb +++ b/lib/active_annotations/rdf_annotation.rb @@ -142,7 +142,9 @@ module ActiveAnnotations def start_time value = fragment_value.nil? ? nil : fragment_value.object.value.scan(/^t=(.*)$/).flatten.first.split(/,/)[0] - value.nil? ? nil : value.to_f + Float(value) + rescue + value end def start_time=(value) @@ -151,7 +153,9 @@ module ActiveAnnotations def end_time value = fragment_value.nil? ? nil : fragment_value.object.value.scan(/^t=(.*)$/).flatten.first.split(/,/)[1] - value.nil? ? nil : value.to_f + Float(value) + rescue + value end def end_time=(value)
Try casting start and end time into Floats but fall back to actual value
avalonmediasystem_active_annotations
train
rb
4c1bc7e1776f65b8023dead49a18bb4bbe949c5c
diff --git a/src/connection.js b/src/connection.js index <HASH>..<HASH> 100644 --- a/src/connection.js +++ b/src/connection.js @@ -27,11 +27,8 @@ class Connection { */ async setClient (skipListeners) { let sioConfig = this.auth.access_token ? { - query: 'bearer=' + this.auth.access_token, - reconnection: false - } : { - reconnection: false - } + query: 'bearer=' + this.auth.access_token + } : {} // Connect to parent namespace this.client = io.connect(this.options.api_url + this.options.namespace, sioConfig)
fix: Keep original reconnect behaviour alive, so long-term disconnects won't cause issues.
cubic-js_cubic
train
js
0b13c15d929db3ac3ae012c135824f2e80973df5
diff --git a/src/main/java/org/aludratest/impl/log4testing/data/TestObject.java b/src/main/java/org/aludratest/impl/log4testing/data/TestObject.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/aludratest/impl/log4testing/data/TestObject.java +++ b/src/main/java/org/aludratest/impl/log4testing/data/TestObject.java @@ -133,9 +133,4 @@ public abstract class TestObject { return comment; } - @Override - public int hashCode() { - return id == null ? 0 : id.hashCode(); - } - }
Remove useless hashCode() method Method would only be meaningful if equals() could also be implemented. As hashCode() falls back to an object-unique ID, it is no better than Object#hashCode().
AludraTest_aludratest
train
java
81dbbb871e5b60151cba123525a16af7a61bac92
diff --git a/eZ/Publish/Core/REST/Client/Input/Parser/FieldDefinition.php b/eZ/Publish/Core/REST/Client/Input/Parser/FieldDefinition.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/REST/Client/Input/Parser/FieldDefinition.php +++ b/eZ/Publish/Core/REST/Client/Input/Parser/FieldDefinition.php @@ -68,11 +68,18 @@ class FieldDefinition extends Parser 'names' => $this->parserTools->parseTranslatableList( $data['names'] ), 'descriptions' => $this->parserTools->parseTranslatableList( $data['descriptions'] ), - // TODO: Call fromHash() here 'defaultValue' => $this->fieldTypeParser->parseValue( $data['fieldType'], $data['defaultValue'] ), + 'fieldSettings' => $this->fieldTypeParser->parseFieldSettings( + $data['fieldType'], + $data['fieldSettings'] + ), + 'validators' => $this->fieldTypeParser->parseFieldSettings( + $data['fieldType'], + $data['validatorConfiguration'] + ), ) ); } }
Implemented: Parsing of fieldSettings and validatorConfiguration.
ezsystems_ezpublish-kernel
train
php
7dd8a31eb10a114de14bdb9c0084c796f34de85c
diff --git a/lib/player.js b/lib/player.js index <HASH>..<HASH> 100644 --- a/lib/player.js +++ b/lib/player.js @@ -2856,7 +2856,8 @@ function grooveFileToDbFile(file, filenameHintWithoutPath, object) { object.albumArtistName = (file.getMetadata("album_artist") || "").trim(); object.albumName = (file.getMetadata("album") || "").trim(); object.compilation = !!(parseInt(file.getMetadata("TCP"), 10) || - parseInt(file.getMetadata("TCMP"), 10)); + parseInt(file.getMetadata("TCMP"), 10) || + parseInt(file.getMetadata("TPOS"))); object.track = parsedTrack.value; object.trackCount = parsedTrack.total; object.disc = parsedDisc.value;
TPOS tag indicates song is part of compilation
andrewrk_groovebasin
train
js
bf027629070e0beaed767799ff77fd5a9ef83238
diff --git a/fabfile.py b/fabfile.py index <HASH>..<HASH> 100644 --- a/fabfile.py +++ b/fabfile.py @@ -5,7 +5,7 @@ import errno import os -from fabric.api import * +from fabric.api import (env, local, task) env.projname = local("python setup.py --name", capture=True) env.version = local("python setup.py --version", capture=True)
fabfile: Import only the needed symbols to please pyflakes.
coursera-dl_coursera-dl
train
py
d61155144d893a0976471da9ee197cc21f11c57b
diff --git a/example/extract-rest-api-id.js b/example/extract-rest-api-id.js index <HASH>..<HASH> 100644 --- a/example/extract-rest-api-id.js +++ b/example/extract-rest-api-id.js @@ -22,7 +22,7 @@ stdin.on('data', function (chunk) { }) stdin.on('end', function () { - let inputJSON = inputChunks.join() + let inputJSON = inputChunks.join('') let parsedData = JSON.parse(inputJSON) parsedData.items.forEach(function (curr) { if (curr.name === targetRestApiName) {
Update extract-rest-api-id.js (#<I>) Added double quotes on chunks join to avoid default ',' (comma) character used by JS.
deliveryhero_serverless-aws-documentation
train
js
653da1a8082c4e69144edc53ec61e3cda1afe68a
diff --git a/java/client/test/org/openqa/selenium/ExecutingAsyncJavascriptTest.java b/java/client/test/org/openqa/selenium/ExecutingAsyncJavascriptTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/ExecutingAsyncJavascriptTest.java +++ b/java/client/test/org/openqa/selenium/ExecutingAsyncJavascriptTest.java @@ -49,7 +49,7 @@ public class ExecutingAsyncJavascriptTest extends JUnit4TestBase { public void setUp() { assumeTrue(driver instanceof JavascriptExecutor); executor = (JavascriptExecutor) driver; - driver.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS); + driver.manage().timeouts().setScriptTimeout(5000, TimeUnit.MILLISECONDS); } @Test @@ -202,7 +202,6 @@ public class ExecutingAsyncJavascriptTest extends JUnit4TestBase { @Test public void shouldNotTimeoutWithMultipleCallsTheFirstOneBeingSynchronous() { driver.get(pages.ajaxyPage); - driver.manage().timeouts().setScriptTimeout(10, TimeUnit.MILLISECONDS); assertThat((Boolean) executor.executeAsyncScript("arguments[arguments.length - 1](true);")) .isTrue(); assertThat((Boolean) executor.executeAsyncScript(
[java] Setting script timeout to zero is nonsense, but default (<I> seconds) is too long for tests
SeleniumHQ_selenium
train
java
e5072d4406a22507938f01f39cc74a1b0b6e1d8e
diff --git a/client/objectstore.go b/client/objectstore.go index <HASH>..<HASH> 100644 --- a/client/objectstore.go +++ b/client/objectstore.go @@ -27,7 +27,7 @@ var ( backupListCmd = cli.Command{ Name: "list", - Usage: "list volume in objectstore: list <dest>", + Usage: "list backups in objectstore: list <dest>", Flags: []cli.Flag{ cli.StringFlag{ Name: "volume-uuid", diff --git a/client/volume.go b/client/volume.go index <HASH>..<HASH> 100644 --- a/client/volume.go +++ b/client/volume.go @@ -54,7 +54,7 @@ var ( volumeMountCmd = cli.Command{ Name: "mount", - Usage: "mount a volume to an specific path: mount <volume> [options]", + Usage: "mount a volume: mount <volume> [options]", Flags: []cli.Flag{ cli.StringFlag{ Name: "mountpoint",
cli: correct "mount" and "backup list" help text
rancher_convoy
train
go,go
076c3269228f0db1281b433a96c784a0e9c51e25
diff --git a/umap/parametric_umap.py b/umap/parametric_umap.py index <HASH>..<HASH> 100644 --- a/umap/parametric_umap.py +++ b/umap/parametric_umap.py @@ -510,15 +510,15 @@ class ParametricUMAP(UMAP): print("Keras full model saved to {}".format(parametric_model_output)) # # save model.pkl (ignoring unpickleable warnings) - # with catch_warnings(): - # filterwarnings("ignore") + with catch_warnings(): + filterwarnings("ignore") # work around optimizers not pickling anymore (since tf 2.4) - self._optimizer_dict = self.optimizer.get_config() - model_output = os.path.join(save_location, "model.pkl") - with open(model_output, "wb") as output: - pickle.dump(self, output, pickle.HIGHEST_PROTOCOL) - if verbose: - print("Pickle of ParametricUMAP model saved to {}".format(model_output)) + self._optimizer_dict = self.optimizer.get_config() + model_output = os.path.join(save_location, "model.pkl") + with open(model_output, "wb") as output: + pickle.dump(self, output, pickle.HIGHEST_PROTOCOL) + if verbose: + print("Pickle of ParametricUMAP model saved to {}".format(model_output)) def get_graph_elements(graph_, n_epochs):
Finally fixed; extended test to check model loads correctly.
lmcinnes_umap
train
py
6e95ff495d4bff92a4e803ba44418343b862d68d
diff --git a/lib/godot/producer/producer.js b/lib/godot/producer/producer.js index <HASH>..<HASH> 100644 --- a/lib/godot/producer/producer.js +++ b/lib/godot/producer/producer.js @@ -8,10 +8,11 @@ var stream = require('stream'), ip = require('ip'), utile = require('utile'), - uuid = require('node-uuid'); + uuid = require('node-uuid'), + tick = typeof setImmediate == 'undefined' + ? process.nextTick + : setImmediate; -// -// ### function Producer (options) // #### @options {Object} Options for this producer. // Constructor function for the Producer object responsible // for creating events to process. @@ -107,7 +108,7 @@ Object.keys(Producer.prototype.types).forEach(function (key) { // if (value === 0) { return (function tickProduce() { - process.nextTick(function () { + tick(function () { self.produce(); tickProduce(); });
[fix] use setImmediate and do some fancy things to ensure we have backward compat
nodejitsu_godot
train
js
9f3d462d5347fc176a91e5323e2d489715d293a7
diff --git a/test/integration/projects.js b/test/integration/projects.js index <HASH>..<HASH> 100644 --- a/test/integration/projects.js +++ b/test/integration/projects.js @@ -72,10 +72,11 @@ module.exports = [ 'aio/content/examples/router/src/app/app-routing.module.9.ts' ] }, - { - repository: 'https://github.com/microsoft/typescript', - extraArguments: typescriptArguments - }, + // TODO: enable this when ``@typescript-eslint/parser` support typescript 4.0 + // { + // repository: 'https://github.com/microsoft/typescript', + // extraArguments: typescriptArguments + // }, { repository: 'https://github.com/microsoft/vscode', extraArguments: typescriptArguments
Temporary disable integration tests for the TypeScript project (#<I>)
sindresorhus_eslint-plugin-unicorn
train
js
4db788c287a12dfe790404a4b62b65f623d9c2ba
diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index <HASH>..<HASH> 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -46,6 +46,8 @@ export class Aggregations extends Component { {label: _('Max'), value: 'max'}, {label: _('First'), value: 'first'}, {label: _('Last'), value: 'last'}, + {label: _('Change'), value: 'change'}, + {label: _('Range'), value: 'range'}, ]} clearable={false} />
New aggregate functions (#<I>)
plotly_react-chart-editor
train
js
6b7680ed78e45dbe808b0b9b8ef5523ab096d05b
diff --git a/product/selectors/product.js b/product/selectors/product.js index <HASH>..<HASH> 100644 --- a/product/selectors/product.js +++ b/product/selectors/product.js @@ -157,12 +157,9 @@ export const getPopulatedProductsResult = (state, hash, result) => { let products = []; let totalProductCount = !hash ? 0 : null; - if (result) { + if (result && result.products) { totalProductCount = result.totalResultCount; - - if (result.products) { - products = result.products.map(id => getProductById(state, id).productData); - } + products = result.products.map(id => getProductById(state, id).productData); } return {
CON-<I>: Bugfix for the product selectors
shopgate_pwa
train
js
4b325f1ee10b731aa24ec58afd58ed9db39cd9c2
diff --git a/client/state/home/reducer.js b/client/state/home/reducer.js index <HASH>..<HASH> 100644 --- a/client/state/home/reducer.js +++ b/client/state/home/reducer.js @@ -24,7 +24,7 @@ const schema = { export const quickLinksToggleStatus = withSchemaValidation( schema, - ( state = 'collapsed', action ) => { + ( state = 'expanded', action ) => { switch ( action.type ) { case HOME_QUICK_LINKS_EXPAND: return 'expanded'; diff --git a/client/state/selectors/is-home-quick-links-expanded.js b/client/state/selectors/is-home-quick-links-expanded.js index <HASH>..<HASH> 100644 --- a/client/state/selectors/is-home-quick-links-expanded.js +++ b/client/state/selectors/is-home-quick-links-expanded.js @@ -4,4 +4,4 @@ * @param {object} state Global state tree * @returns {object} Whether Quick Links are expanded */ -export default ( state ) => state.home?.quickLinksToggleStatus === 'expanded'; +export default ( state ) => state.home?.quickLinksToggleStatus !== 'collapsed';
My Home: Quick links expanded by default (#<I>)
Automattic_wp-calypso
train
js,js
f1ac714d53d1f537f3a244c4ca0a8140c58e9d81
diff --git a/Classes/Page/Part/MetatagPart.php b/Classes/Page/Part/MetatagPart.php index <HASH>..<HASH> 100644 --- a/Classes/Page/Part/MetatagPart.php +++ b/Classes/Page/Part/MetatagPart.php @@ -378,7 +378,7 @@ class MetatagPart extends AbstractPart * * @param array $tsConfig TypoScript config setup * - * @return string Page Id or url + * @return null|array of (linkParam, linkConf, linkMpMode) */ protected function detectCanonicalPage(array $tsConfig = array()) { @@ -1296,7 +1296,7 @@ class MetatagPart extends AbstractPart */ protected function generateCanonicalUrl() { - //User has specified a canonical URL in the backend + //User has specified a canonical URL in the page properties if (!empty($this->pageRecord['tx_metaseo_canonicalurl'])) { return $this->pageRecord['tx_metaseo_canonicalurl']; }
[TASK] fix doc: return data type Issue #<I>
webdevops_TYPO3-metaseo
train
php
4394b09517efd6c73f5590ad88a27d7cd4b8e802
diff --git a/test/host/loader.js b/test/host/loader.js index <HASH>..<HASH> 100644 --- a/test/host/loader.js +++ b/test/host/loader.js @@ -6,7 +6,7 @@ /*global run, exit:true*/ // From bdd.js /*global __coverage__*/ // Coverage data - var Func = Function, + var safeFunc = Function, sources, context = (function () { /*global global*/ // NodeJS global @@ -17,7 +17,7 @@ if ("undefined" !== typeof window) { return window; } - return this; //eslint-disable-line no-invalid-this + return safeFunc("return this;")(); }()), _resolvePath = function (configuration, relativePath) { @@ -94,7 +94,7 @@ } // Load the list of modules var sourcesJson = configuration.read("src/sources.json"); - sources = new Func("return " + sourcesJson + ";")(); + sources = safeFunc("return " + sourcesJson + ";")(); }, _loadBDD = function (configuration, verbose) {
Support Nashorn: access to global (#<I>)
ArnaudBuchholz_gpf-js
train
js
ef8ebf407f4abc45d6181022d7d84ab64586fca9
diff --git a/tests/test_error.py b/tests/test_error.py index <HASH>..<HASH> 100644 --- a/tests/test_error.py +++ b/tests/test_error.py @@ -13,15 +13,21 @@ class StripeErrorTests(StripeTestCase): self.assertEqual(u'öre', six.text_type(err)) if six.PY2: self.assertEqual('\xc3\xb6re', str(err)) + else: + self.assertEqual(u'öre', str(err)) def test_formatting_with_request_id(self): err = StripeError(u'öre', headers={'request-id': '123'}) self.assertEqual(u'Request 123: öre', six.text_type(err)) if six.PY2: self.assertEqual('Request 123: \xc3\xb6re', str(err)) + else: + self.assertEqual(u'Request 123: öre', str(err)) def test_formatting_with_none(self): err = StripeError(None, headers={'request-id': '123'}) self.assertEqual(u'Request 123: <empty message>', six.text_type(err)) if six.PY2: self.assertEqual('Request 123: <empty message>', str(err)) + else: + self.assertEqual('Request 123: <empty message>', str(err))
Adds a couple more error assertions for Python 3 This is basically a no-op, but just adds a few more test case branches for Python 3 to demonstrate what `str(...)` on an error should be expected to return in that version (instead of just on Python 2).
stripe_stripe-python
train
py
dbe6c7aa7b948e806bf0073fe5351e76ceb1cfc3
diff --git a/stanza/utils/training/run_pos.py b/stanza/utils/training/run_pos.py index <HASH>..<HASH> 100644 --- a/stanza/utils/training/run_pos.py +++ b/stanza/utils/training/run_pos.py @@ -1,6 +1,7 @@ import logging +import os from stanza.models import tagger @@ -24,6 +25,10 @@ def run_treebank(mode, paths, treebank, short_name, test_pred_file = temp_output_file if temp_output_file else f"{pos_dir}/{short_name}.test.pred.conllu" if mode == Mode.TRAIN: + if not os.path.exists(train_file): + logger.error("TRAIN FILE NOT FOUND: %s ... skipping" % train_file) + return + # some languages need reduced batch size if short_name == 'de_hdt': # 'UD_German-HDT'
Warn rather than crash if a training file is missing
stanfordnlp_stanza
train
py
ffe6837cbac98ebafaf925acc2dfa18f2618f5d6
diff --git a/api/auth_test.go b/api/auth_test.go index <HASH>..<HASH> 100644 --- a/api/auth_test.go +++ b/api/auth_test.go @@ -1540,7 +1540,7 @@ func (s *AuthSuite) TestRemoveUserWithTheUserBeingLastMemberOfATeam(c *gocheck.C c.Assert(e.Code, gocheck.Equals, http.StatusForbidden) expected := `This user is the last member of the team "painofsalvation", so it cannot be removed. -Please remove the team, them remove the user.` +Please remove the team, then remove the user.` c.Assert(e.Message, gocheck.Equals, expected) }
api/auth: fixed tests.
tsuru_tsuru
train
go
11301c1356f6e76b07e895c0b41a326a0fabc080
diff --git a/aws/resource_aws_codepipeline_test.go b/aws/resource_aws_codepipeline_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_codepipeline_test.go +++ b/aws/resource_aws_codepipeline_test.go @@ -685,7 +685,7 @@ resource "aws_iam_role_policy" "codepipeline_policy" { "Action": [ "sts:AssumeRole" ], - "Resource": aws_iam_role.codepipeline_action_role.arn + "Resource": "${aws_iam_role.codepipeline_action_role.arn}" } ] }
tests/resource/aws_codepipeline: Fix TestAccAWSCodePipeline_deployWithServiceRole (#<I>)
terraform-providers_terraform-provider-aws
train
go
032b2c8aa42ffc011a9719a012632c031faa4f82
diff --git a/mollie/api/objects/payment.py b/mollie/api/objects/payment.py index <HASH>..<HASH> 100644 --- a/mollie/api/objects/payment.py +++ b/mollie/api/objects/payment.py @@ -152,15 +152,15 @@ class Payment(Base): @property def get_amount_refunded(self): try: - return self._get_property('amountRefunded') - except TypeError: + return self['amountRefunded'] + except KeyError: return '0.0' @property def get_amount_remaining(self): try: - return self._get_property('amountRemaining') - except TypeError: + return self['amountRemaining'] + except KeyError: return '0.0' @property diff --git a/tests/test_payments.py b/tests/test_payments.py index <HASH>..<HASH> 100644 --- a/tests/test_payments.py +++ b/tests/test_payments.py @@ -73,8 +73,8 @@ def test_get_single_payment(client, response): assert payment.id == PAYMENT_ID assert payment.mode == 'test' assert payment.status == 'open' - assert payment.get_amount_refunded == 0.0 - assert payment.get_amount_remaining == 0.0 + assert payment.get_amount_refunded == '0.0' + assert payment.get_amount_remaining == '0.0' assert payment.is_open() is True assert payment.is_pending() is False assert payment.is_canceled() is False
make get_amount_remaining and refunded return string instead of float
mollie_mollie-api-python
train
py,py
df8457b9df803583df810aaa8707f9c46f9a3a18
diff --git a/test/python_client_test.py b/test/python_client_test.py index <HASH>..<HASH> 100755 --- a/test/python_client_test.py +++ b/test/python_client_test.py @@ -29,6 +29,8 @@ def setUpModule(): global vtgateclienttest_port global vtgateclienttest_grpc_port + environment.topo_server().setup() + vtgateclienttest_port = environment.reserve_ports(1) args = environment.binary_args('vtgateclienttest') + [ '-log_dir', environment.vtlogroot, @@ -49,6 +51,8 @@ def tearDownModule(): utils.kill_sub_process(vtgateclienttest_process, soft=True) vtgateclienttest_process.wait() + environment.topo_server().teardown() + class TestPythonClient(unittest.TestCase): CONNECT_TIMEOUT = 10.0
test: Re-adding topo server setup. I accidentally removed it here: <URL>
vitessio_vitess
train
py
fb7b6f9d42ecce6a009e7244aa297aa57d71b15c
diff --git a/tests/test_schedule.py b/tests/test_schedule.py index <HASH>..<HASH> 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -45,7 +45,7 @@ class ScheduleTests(PyResTests): key2 = int(time.mktime(d2.timetuple())) self.resq.enqueue_at(d, Basic,"test1") self.resq.enqueue_at(d2, Basic,"test1") - item = self.resq.next_delayed_timestamp() + int(item) = self.resq.next_delayed_timestamp() assert item == key2 def test_next_item_for_timestamp(self):
change the result to cast to int The newer version of redis-py no longer tries to extrapolate the type of a return value.
binarydud_pyres
train
py
87e0cc68c991088c0dc379efc2be94a979083b89
diff --git a/lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb b/lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb index <HASH>..<HASH> 100644 --- a/lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb +++ b/lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb @@ -16,6 +16,9 @@ module Danger # via the return value for the danger command. If you have linters with errors for this call # you can use `messaging.fail` instead. # + # You can optionally add `file` and `line` to provide inline feedback on a PR in GitHub, note that + # only feedback inside the PR's diff will show up inline. Others will appear inside the main comment. + # # It is possible to have Danger ignore specific warnings or errors by writing `Danger: Ignore "[warning/error text]"`. # # Sidenote: Messaging is the only plugin which adds functions to the root of the Dangerfile.
Add a note about file:line:
danger_danger
train
rb
ac6e1df0934d9b90cfe92269cf57168558970a58
diff --git a/cmd/cayley/command/database.go b/cmd/cayley/command/database.go index <HASH>..<HASH> 100644 --- a/cmd/cayley/command/database.go +++ b/cmd/cayley/command/database.go @@ -91,8 +91,11 @@ func NewLoadDatabaseCmd() *cobra.Command { p := mustSetupProfile(cmd) defer mustFinishProfile(p) load, _ := cmd.Flags().GetString(flagLoad) + if load == "" && len(args) == 1 { + load = args[0] + } if load == "" { - return errors.New("quads file must be specified") + return errors.New("one quads file must be specified") } if init, err := cmd.Flags().GetBool("init"); err != nil { return err @@ -135,8 +138,11 @@ func NewDumpDatabaseCmd() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { printBackendInfo() dump, _ := cmd.Flags().GetString(flagDump) + if dump == "" && len(args) == 1 { + dump = args[0] + } if dump == "" { - return errors.New("quads file must be specified") + return errors.New("one quads file must be specified") } h, err := openDatabase() if err != nil {
cli: allow to pass file name as argument for load and dump
cayleygraph_cayley
train
go
76f875bfea94aec46148a6100622c2cc45df68f4
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,7 @@ export {OrmMetadata} from './orm-metadata'; export {EntityManager} from './entity-manager'; export {association} from './decorator/association'; export {resource} from './decorator/resource'; +export {name} from './decorator/name'; export {repository} from './decorator/repository'; export {validation} from './decorator/validation'; export {validatedResource} from './decorator/validated-resource';
chore(project): Expose @name decorator
SpoonX_aurelia-orm
train
js
98e49ecb6458efeaf64a639db3eedd69ec6b4085
diff --git a/src/embed/world-renderer.js b/src/embed/world-renderer.js index <HASH>..<HASH> 100644 --- a/src/embed/world-renderer.js +++ b/src/embed/world-renderer.js @@ -235,7 +235,13 @@ WorldRenderer.prototype.didLoadFail_ = function(message) { WorldRenderer.prototype.setDefaultYaw_ = function(angleRad) { // Rotate the camera parent to take into account the scene's rotation. // By default, it should be at the center of the image. - this.camera.parent.rotation.y = (Math.PI / 2.0) + angleRad; + var display = this.controls.getVRDisplay(); + var theta = display.theta_ || 0; + + if ( display.poseSensor_ ) { + display.poseSensor_.resetPose(); + } + this.camera.parent.rotation.y = (Math.PI / 2.0) + angleRad - theta; }; /**
reset pose and account for camera rotation when loading scene
googlearchive_vrview
train
js
fedb08de6b3b7973b18c0d4c5a6972bc44fde074
diff --git a/src/test/java/com/helger/css/reader/AbstractFuncTestCSSReader.java b/src/test/java/com/helger/css/reader/AbstractFuncTestCSSReader.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/helger/css/reader/AbstractFuncTestCSSReader.java +++ b/src/test/java/com/helger/css/reader/AbstractFuncTestCSSReader.java @@ -139,6 +139,9 @@ public abstract class AbstractFuncTestCSSReader // Handle each error as a fatal error! final CascadingStyleSheet aCSS = CSSReader.readFromFile (aFile, m_aReaderSettings); assertNull (sKey, aCSS); + + // For Travis :( + System.gc (); } } @@ -173,6 +176,9 @@ public abstract class AbstractFuncTestCSSReader final CascadingStyleSheet aCSSReRead = CSSReader.readFromStringReader (sCSS, m_aReaderSettings); assertNotNull ("Failed to parse:\n" + sCSS, aCSSReRead); assertEquals (sKey, aCSS, aCSSReRead); + + // For Travis :( + System.gc (); } }
More .gc for Travis :(
phax_ph-css
train
java
2ebc4a2b88fffebbfff3ab8a73b36976c5bcc32e
diff --git a/src/router-directive.es5.js b/src/router-directive.es5.js index <HASH>..<HASH> 100644 --- a/src/router-directive.es5.js +++ b/src/router-directive.es5.js @@ -1,9 +1,6 @@ 'use strict'; -/** - * @name ngFuturisticRouter - * - * @description +/* * A module for adding new a routing system Angular 1. */ angular.module('ngFuturisticRouter', ['ngFuturisticRouter.generated']).
docs(router): remove jsdoc for module For now, the docs will explain the module at the root level
angular_router
train
js
6eb0a556ff46213aa46962acff51066e77500935
diff --git a/SoftLayer/CLI/modules/cci.py b/SoftLayer/CLI/modules/cci.py index <HASH>..<HASH> 100755 --- a/SoftLayer/CLI/modules/cci.py +++ b/SoftLayer/CLI/modules/cci.py @@ -838,8 +838,8 @@ usage: sl cci dns sync <identifier> [options] DNS related actions for a CCI Options: - -a Sync only the A record - --ptr Sync only the PTR record + -a Sync the A record for the host + --ptr Sync the PTR record for the host """ action = 'dns' options = ['confirm']
Updating dns sync docs
softlayer_softlayer-python
train
py
67aae29071436394fdbf8065beedbd3b0d0c25ef
diff --git a/lib/linkedin/client.rb b/lib/linkedin/client.rb index <HASH>..<HASH> 100644 --- a/lib/linkedin/client.rb +++ b/lib/linkedin/client.rb @@ -13,7 +13,7 @@ module LinkedIn def initialize(options={}, &block) configure options, &block - self.access_token ||= self.config[:access_token].to_s + self.access_token ||= self.config.access_token.to_s end def connection @@ -87,7 +87,7 @@ module LinkedIn def url_for(option_key) host = config.auth_host - path = config["#{option_key}_path".to_sym] + path = config.send("#{option_key}_path") "#{host}#{path}" end end diff --git a/lib/linkedin/configuration.rb b/lib/linkedin/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/linkedin/configuration.rb +++ b/lib/linkedin/configuration.rb @@ -22,7 +22,7 @@ module LinkedIn module BaseConfiguration def configure(config={}, &block) - self.config.marshal_load self.config.to_h.merge(config) + self.config.marshal_load self.config.marshal_dump.merge(config) yield self.config if block_given? @@ -35,7 +35,7 @@ module LinkedIn end def defaults(*keys) - config.to_h.slice *keys + config.marshal_dump.slice *keys end end
Pre-<I> openstruct support
bobbrez_linkedin2
train
rb,rb
f83469646a3dc1df6396ed44480c0be3435949f3
diff --git a/IPython/html/static/widgets/js/widget_int.js b/IPython/html/static/widgets/js/widget_int.js index <HASH>..<HASH> 100644 --- a/IPython/html/static/widgets/js/widget_int.js +++ b/IPython/html/static/widgets/js/widget_int.js @@ -290,7 +290,7 @@ define([ * Called when view is rendered. */ this.$el - .addClass('widget-hbox widget-text'); + .addClass('widget-hbox widget-numeric-text'); this.$label = $('<div />') .appendTo(this.$el) .addClass('widget-label')
wrong css class for widget-int
jupyter-widgets_ipywidgets
train
js
f039c865f7ff4575d057309797bdc2f48185150f
diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index <HASH>..<HASH> 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -736,7 +736,8 @@ class behat_navigation extends behat_base { * Recognised page names are: * | Page type | Identifier meaning | description | * | Category | category idnumber | List of courses in that category. | - * | Course | course shortname | Main course home page | + * | Course | course shortname | Main course home pag | + * | Course editing | course shortname | Edit settings page for the course | * | Activity | activity idnumber | Start page for that activity | * | Activity editing | activity idnumber | Edit settings page for that activity | * | [modname] Activity | activity name or idnumber | Start page for that activity | @@ -778,7 +779,7 @@ class behat_navigation extends behat_base { $courseid = $this->get_course_id($identifier); if (!$courseid) { throw new Exception('The specified course with shortname, fullname, or idnumber "' . - $identifier . '" does not exist'); + $identifier . '" does not exist'); } return new moodle_url('/course/edit.php', ['id' => $courseid]);
MDL-<I> behat: Option to jump to course edit page
moodle_moodle
train
php
2dcbe25e3e32ab3fc096508d82288eed19f69bb3
diff --git a/lib/ansible_tower_client/collection.rb b/lib/ansible_tower_client/collection.rb index <HASH>..<HASH> 100644 --- a/lib/ansible_tower_client/collection.rb +++ b/lib/ansible_tower_client/collection.rb @@ -30,6 +30,14 @@ module AnsibleTowerClient build_object(parse_response(api.get("#{klass.endpoint}/#{id}/"))) end + def create!(*args) + klass.create!(api, *args) + end + + def create(*args) + klass.create(api, *args) + end + private def class_from_type(type)
Add creation methods to AnsibleTowerClient::Collection i.e. Ability to do api.job_templates.create(:key => "value")
ansible_ansible_tower_client_ruby
train
rb
a5352e41c195ea34b3b5856403ef68370db58438
diff --git a/website/src/components/charts/sankey/Sankey.js b/website/src/components/charts/sankey/Sankey.js index <HASH>..<HASH> 100644 --- a/website/src/components/charts/sankey/Sankey.js +++ b/website/src/components/charts/sankey/Sankey.js @@ -28,7 +28,7 @@ const initialSettings = { left: 50, }, - layout: 'vertical', + layout: 'horizontal', align: 'justify', sort: 'auto', colors: 'category10',
feat(website): change sankey default layout
plouc_nivo
train
js
4b9d888687fb4ba88b75268daef04ebaa0f13639
diff --git a/worker/uniter/filter.go b/worker/uniter/filter.go index <HASH>..<HASH> 100644 --- a/worker/uniter/filter.go +++ b/worker/uniter/filter.go @@ -167,8 +167,8 @@ func (f *filter) loop(unitName string) (err error) { configw := f.service.WatchConfig() defer watcher.Stop(configw, &f.tomb) - // Config events cannot be meaningfully reset until one is available; - // once we receive the initial change, we unblock reset requests by + // Config events cannot be meaningfully discarded until one is available; + // once we receive the initial change, we unblock discard requests by // setting this channel to its namesake on f. var discardConfig chan struct{} for { @@ -228,7 +228,7 @@ func (f *filter) loop(unitName string) (err error) { f.outResolved = f.outResolvedOn } case <-discardConfig: - log.Debugf("filter: reset config event") + log.Debugf("filter: discarded config event") f.outConfig = nil } }
excise remaining resets in favour of discards
juju_juju
train
go
5f88db93ffcaba40fd2630050f89a2d7f249510e
diff --git a/gns3server/web/route.py b/gns3server/web/route.py index <HASH>..<HASH> 100644 --- a/gns3server/web/route.py +++ b/gns3server/web/route.py @@ -180,7 +180,7 @@ class Route(object): except aiohttp.web.HTTPBadRequest as e: response = Response(request=request, route=route) response.set_status(e.status) - response.json({"message": e.text, "status": e.status, "path": route, "request": request.json}) + response.json({"message": e.text, "status": e.status, "path": route, "request": request.json, "method": request.method}) except aiohttp.web.HTTPException as e: response = Response(request=request, route=route) response.set_status(e.status)
Add the method in the bad request answer
GNS3_gns3-server
train
py
4989d6869edb3f140d0d3f631b4cb6705290324d
diff --git a/Eloquent/Model.php b/Eloquent/Model.php index <HASH>..<HASH> 100755 --- a/Eloquent/Model.php +++ b/Eloquent/Model.php @@ -2123,6 +2123,19 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab } /** + * Make the given, typically hidden, attributes visible. + * + * @param array|string $attributes + * @return $this + */ + public function withHidden($attributes) + { + $this->hidden = array_diff($this->hidden, (array) $attributes); + + return $this; + } + + /** * Get the visible attributes for the model. * * @return array
added withHidden method to fluently remove some hidden columns.
illuminate_database
train
php
bb1fb26c74bc160c570472720ac3415ee4ef0ead
diff --git a/Classes/Util.php b/Classes/Util.php index <HASH>..<HASH> 100644 --- a/Classes/Util.php +++ b/Classes/Util.php @@ -32,6 +32,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\TimeTracker\NullTimeTracker; use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use TYPO3\CMS\Frontend\Page\PageRepository; @@ -580,7 +581,7 @@ class Util { $isWorkspaceRecord = false; - if (BackendUtility::isTableWorkspaceEnabled($table)) { + if ((ExtensionManagementUtility::isLoaded('workspaces')) && (BackendUtility::isTableWorkspaceEnabled($table))) { $record = BackendUtility::getRecord($table, $uid); if ($record['pid'] == '-1' || $record['t3ver_state'] > 0) {
[BUG] Optimize call in isDraftRecord with respect to workspaces
TYPO3-Solr_ext-solr
train
php
eedf1eb76a9632ff3ee8460269102d1de69cad27
diff --git a/main/java/uk/co/real_logic/sbe/generation/cpp98/Cpp98Generator.java b/main/java/uk/co/real_logic/sbe/generation/cpp98/Cpp98Generator.java index <HASH>..<HASH> 100644 --- a/main/java/uk/co/real_logic/sbe/generation/cpp98/Cpp98Generator.java +++ b/main/java/uk/co/real_logic/sbe/generation/cpp98/Cpp98Generator.java @@ -749,7 +749,7 @@ public class Cpp98Generator implements CodeGenerator "# define SBE_FLOAT_NAN NAN\n" + "# define SBE_DOUBLE_NAN NAN\n" + "#endif\n\n" + - "#include \"sbe/sbe.hpp\"\n\n", + "#include <sbe/sbe.hpp>\n\n", className.toUpperCase() )); @@ -758,7 +758,7 @@ public class Cpp98Generator implements CodeGenerator for (final String incName : typesToInclude) { sb.append(String.format( - "#include \"%1$s/%2$s.hpp\"\n", + "#include <%1$s/%2$s.hpp>\n", namespaceName, toUpperFirstChar(incName) ));
[cpp] Changed #include statements to use '<file.h>' instead of '"file.h"'. This allows cpp projects to more easily share the generated files by setting include paths.
real-logic_simple-binary-encoding
train
java
1439695b91bb4324b90d0416f15b9345efd8988c
diff --git a/lib/assets/javascripts/jasmine-runner.js b/lib/assets/javascripts/jasmine-runner.js index <HASH>..<HASH> 100644 --- a/lib/assets/javascripts/jasmine-runner.js +++ b/lib/assets/javascripts/jasmine-runner.js @@ -90,6 +90,10 @@ var address = args[1]; console.log('Running: ' + address); + if(phantom.version.major===2){ + // PhantomJS 2 workaround + address+='\n'; + } page.open(address, function(status) { if (status === "success") { // PhantomJS 2 has a memory consumption problem. This works around it.
phantom2 needs newline after address
searls_jasmine-rails
train
js
76269ebff530a4dae7f0037047db013ca252c7a1
diff --git a/src/org/openscience/cdk/tools/SaturationChecker.java b/src/org/openscience/cdk/tools/SaturationChecker.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/tools/SaturationChecker.java +++ b/src/org/openscience/cdk/tools/SaturationChecker.java @@ -370,7 +370,16 @@ public class SaturationChecker int missingHydrogen = (int) (defaultAtom.getMaxBondOrderSum() - container.getBondOrderSum(atom) + atom.getFormalCharge()); - if (atom.getFlag(CDKConstants.ISAROMATIC)) missingHydrogen--; + if (atom.getFlag(CDKConstants.ISAROMATIC)){ + Bond[] connectedBonds=container.getConnectedBonds(atom); + boolean subtractOne=true; + for(int i=0;i<connectedBonds.length;i++){ + if(connectedBonds[i].getOrder()==2 || connectedBonds[i].getOrder()==CDKConstants.BONDORDER_AROMATIC) + subtractOne=false; + } + if(subtractOne) + missingHydrogen--; + } logger.debug("Atom: " + atom.getSymbol()); logger.debug(" max bond order: " + defaultAtom.getMaxBondOrderSum()); logger.debug(" bond order sum: " + container.getBondOrderSum(atom));
Corrected problems with handling aromatic atoms which have got the correct number of bonds git-svn-id: <URL>
cdk_cdk
train
java
6ba9b7fc22d59ca023cc3a91fafdd2461c3b7dc9
diff --git a/tests/contrib/django/conftest.py b/tests/contrib/django/conftest.py index <HASH>..<HASH> 100644 --- a/tests/contrib/django/conftest.py +++ b/tests/contrib/django/conftest.py @@ -91,6 +91,9 @@ def pytest_configure(config): ELASTIC_APM={ "METRICS_INTERVAL": "0ms", "TRANSPORT_CLASS": "tests.fixtures.DummyTransport", + "SERVICE_NAME": "testapp", + "CENTRAL_CONFIG": False, + "CLOUD_PROVIDER": False, }, # avoid autostarting the metrics collector thread ) settings_dict.update(
disable config updater thread and cloud metadata checker in tests (#<I>)
elastic_apm-agent-python
train
py
d5505b10f42c0415864ecbfc92c46ecd5acafcf5
diff --git a/src/Wsdl2PhpGenerator/ComplexType.php b/src/Wsdl2PhpGenerator/ComplexType.php index <HASH>..<HASH> 100644 --- a/src/Wsdl2PhpGenerator/ComplexType.php +++ b/src/Wsdl2PhpGenerator/ComplexType.php @@ -98,8 +98,13 @@ class ComplexType extends Type $comment = new PhpDocComment(); $comment->setVar(PhpDocElementFactory::getVar($type, $name, '')); - $comment->setAccess(PhpDocElementFactory::getPublicAccess()); - $var = new PhpVariable('public', $name, 'null', $comment); + if ($this->config->getCreateAccessors()) { + $comment->setAccess(PhpDocElementFactory::getProtectedAccess()); + $var = new PhpVariable('protected', $name, 'null', $comment); + } else { + $comment->setAccess(PhpDocElementFactory::getPublicAccess()); + $var = new PhpVariable('public', $name, 'null', $comment); + } $class->addVariable($var); if (!$member->getNillable()) {
Members are protected if accessor methods are being used
wsdl2phpgenerator_wsdl2phpgenerator
train
php
5156cbd479bd462f57df2c1989b1741d66644569
diff --git a/js/h5p.js b/js/h5p.js index <HASH>..<HASH> 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -190,6 +190,16 @@ H5P.cloneObject = function (object, recursive, array) { return clone; }; +/** + * Remove all empty spaces before and after the value. + * + * @param {String} value + * @returns {@exp;value@call;replace} + */ +H5P.trim = function (value) { + return value.replace(/^\s+|\s+$/g, ''); +}; + // We have several situations where we want to shuffle an array, extend array // to do so. Array.prototype.shuffle = function() {
Fine tuning on the editor and the boardgame.
h5p_h5p-php-library
train
js
10b6323146b5b5fd2d3e2ca66a0459215801be8d
diff --git a/shared/search/index.native.js b/shared/search/index.native.js index <HASH>..<HASH> 100644 --- a/shared/search/index.native.js +++ b/shared/search/index.native.js @@ -6,6 +6,7 @@ import UserGroup from './user-search/user-group' import UserSearch from './user-search/render' import {globalStyles} from '../styles' import {compose, withProps} from 'recompose' +import {Keyboard} from 'react-native' import type {Props} from '.' import type {Props as UserSearchProps} from './user-search/render' @@ -34,7 +35,10 @@ export default compose( headerStyle: { borderBottomWidth: 0, }, - onCancel: ownProps.onReset, + onCancel: () => { + ownProps.onReset() + Keyboard.dismiss() + }, })), HeaderHoc, )(SearchRender)
dismiss keyboard on search cancel (#<I>)
keybase_client
train
js
fc947555b6ff4215ada66835e9f6dad6070eaffc
diff --git a/openquake/calculators/ucerf_base.py b/openquake/calculators/ucerf_base.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/ucerf_base.py +++ b/openquake/calculators/ucerf_base.py @@ -311,7 +311,7 @@ class UCERFSource(BaseSeismicSource): mag, self.rake[ridx], self.tectonic_region_type, surface_set[len(surface_set) // 2].get_middle_point(), MultiSurface(surface_set), self.rate[ridx], self.tom) - + rupture.rup_id = self.start + ridx return rupture def iter_ruptures(self, **kwargs):
Added rup_id
gem_oq-engine
train
py