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
e11d8a2a2e89bb92c903fb2ab863abe68b331aa4
diff --git a/lib/AbstractView.php b/lib/AbstractView.php index <HASH>..<HASH> 100644 --- a/lib/AbstractView.php +++ b/lib/AbstractView.php @@ -551,11 +551,17 @@ abstract class AbstractView extends AbstractObject } $on_chain=$this->js(true); + $fired=false; - $this->api->addHook('pre-js-collection', function($api) - use($event,$selector,$ret_js,$on_chain){ - $on_chain->on($event,$selector,$ret_js->_enclose(null,true)); - }); + $this->api->jui->addHook( + 'pre-getJS', + function($api) use($event,$selector,$ret_js,$on_chain,&$fired) { + if($fired)return; + $fired=true; + + $on_chain->on($event,$selector,$ret_js->_enclose(null,true)); + } + ); return $ret_js; diff --git a/lib/jQuery.php b/lib/jQuery.php index <HASH>..<HASH> 100644 --- a/lib/jQuery.php +++ b/lib/jQuery.php @@ -101,6 +101,7 @@ class jQuery extends AbstractController { } /* [private] Collect JavaScript chains from specified object and add them into onReady section */ function getJS($obj){ + $this->hook('pre-getJS'); $r=''; foreach($obj->js as $key=>$chains){
improve how on() works on relodable objects (paginators)
atk4_atk4
train
php,php
a72437377c48d8cf3a8537a0e2d47a72fc034f60
diff --git a/gitmediaclient/client.go b/gitmediaclient/client.go index <HASH>..<HASH> 100644 --- a/gitmediaclient/client.go +++ b/gitmediaclient/client.go @@ -151,7 +151,10 @@ func doRequest(req *http.Request, creds Creds) (*http.Response, error) { if err == nil { if res.StatusCode > 299 { - execCreds(creds, "reject") + // An auth error should be 403. Could be 404 also. + if res.StatusCode < 405 { + execCreds(creds, "reject") + } apierr := &Error{} dec := json.NewDecoder(res.Body)
don't reject auth for upstream service issues
git-lfs_git-lfs
train
go
3a19de3cdaccce820bb123ecbd572ef7fd9cda5b
diff --git a/stacker/blueprints/base.py b/stacker/blueprints/base.py index <HASH>..<HASH> 100644 --- a/stacker/blueprints/base.py +++ b/stacker/blueprints/base.py @@ -413,6 +413,10 @@ class Blueprint(object): required when creating EC2 userdata files. Automatically, encodes the data file to base64 after it is processed. + Args: + raw_userdata (str of userdata): + str of the given userdata to be parsed + """ pattern = re.compile(r'{{([::|\w]+)}}') userdata = ""
Updated comments in parse_user_data
cloudtools_stacker
train
py
fb11b9105112d3512e9a50761ed581f87683c5b9
diff --git a/acceptancetests/assess_log_rotation.py b/acceptancetests/assess_log_rotation.py index <HASH>..<HASH> 100755 --- a/acceptancetests/assess_log_rotation.py +++ b/acceptancetests/assess_log_rotation.py @@ -233,7 +233,7 @@ def main(): client = make_client_from_args(args) with boot_context(args.temp_env_name, client, bootstrap_host=args.bootstrap_host, - machines=args.machine, series=args.series, + machines=args.machine, series=args.series, arch=args.arch, agent_url=args.agent_url, agent_stream=args.agent_stream, log_dir=args.logs, keep_env=args.keep_env, upload_tools=args.upload_tools, diff --git a/acceptancetests/assess_multimodel.py b/acceptancetests/assess_multimodel.py index <HASH>..<HASH> 100755 --- a/acceptancetests/assess_multimodel.py +++ b/acceptancetests/assess_multimodel.py @@ -73,6 +73,7 @@ def multimodel_setup(args): args.bootstrap_host, args.machine, args.series, + args.arch, args.agent_url, args.agent_stream, args.logs, args.keep_env,
Ensure we pass arch to boot_context The boot context takes a arch argument. The arch argument was added to allow deploying via the deploy_stack function to work. Unfortunately it's virtually impossible to get all the acceptance tests to run in one click, so we have to rely on jenkins to tell us when they're failing.
juju_juju
train
py,py
3702ba1bee3bab5ea09b720ff7afaaf70d530a76
diff --git a/test/helper.js b/test/helper.js index <HASH>..<HASH> 100644 --- a/test/helper.js +++ b/test/helper.js @@ -58,7 +58,6 @@ ex('sl-build --install --commit'); assert(!test('-e', 'node_modules/debug'), 'dev dep not installed'); assert(test('-e', 'node_modules/node-syslog'), 'prod dep installed'); assert(!test('-e', 'node_modules/node-syslog/build'), 'addons not built'); -assert(which('sl-pm'), 'sl-pm not in path'); assert(which('sl-build'), 'sl-build not in path'); console.log('test/app built succesfully');
test: Don't require sl-pm in path Remove assertion that strong-pm has been installed or linked globally.
strongloop_strong-pm
train
js
c197a152564f5288473389517fae3c902243da0a
diff --git a/lib/searchkick/model.rb b/lib/searchkick/model.rb index <HASH>..<HASH> 100644 --- a/lib/searchkick/model.rb +++ b/lib/searchkick/model.rb @@ -72,8 +72,12 @@ module Searchkick alias_method :search_index, :searchkick_index unless method_defined?(:search_index) def searchkick_reindex(method_name = nil, **options) - relation = Searchkick.relation?(self) - searchkick_index.reindex(searchkick_klass, method_name, scoped: relation, **options) + scoped = Searchkick.relation?(self) + relation = scoped ? all : searchkick_klass + # prevent scope from affecting search_data + unscoped do + searchkick_index.reindex(relation, method_name, scoped: scoped, **options) + end end alias_method :reindex, :searchkick_reindex unless method_defined?(:reindex)
Prevented scope from affecting search_data [skip ci]
ankane_searchkick
train
rb
df9e2cf081ccc3e6761475dbf2bd1fccc1725e4b
diff --git a/src/sos/sos_task.py b/src/sos/sos_task.py index <HASH>..<HASH> 100644 --- a/src/sos/sos_task.py +++ b/src/sos/sos_task.py @@ -167,7 +167,12 @@ def loadTask(filename): return pickle.load(task) elif header.startswith('SOSTASK1.2'): task.readline() - return pickle.loads(lzma.decompress(task.read())) + try: + return pickle.loads(lzma.decompress(task.read())) + except: + # at some point, the task files were compressed with zlib + import zlib + return pickle.loads(zlib.decompress(task.read())) else: raise ValueError('Try old format') except:
Be compatible with task files written with zlib compression
vatlab_SoS
train
py
e64594c5eede8e380c494a99c276a2ce9f2cdb1d
diff --git a/ddsc/core/filedownloader.py b/ddsc/core/filedownloader.py index <HASH>..<HASH> 100644 --- a/ddsc/core/filedownloader.py +++ b/ddsc/core/filedownloader.py @@ -1,13 +1,14 @@ """ Downloads a file based on ranges. """ +import os import math import tempfile import requests from multiprocessing import Process, Queue -DOWNLOAD_FILE_CHUNK_SIZE = 1024 -MIN_DOWNLOAD_CHUNK_SIZE = 10 * 1024 * 1024 +DOWNLOAD_FILE_CHUNK_SIZE = 20 * 1024 * 1024 +MIN_DOWNLOAD_CHUNK_SIZE = 20 * 1024 * 1024 class FileDownloader(object): @@ -103,6 +104,8 @@ class FileDownloader(object): for temp_path in self.file_parts: with open(temp_path, "rb") as infile: outfile.write(infile.read()) + for temp_path in self.file_parts: + os.remove(temp_path) def download_async(url, headers, path, progress_queue):
tweak download block size and remove parts after merging them
Duke-GCB_DukeDSClient
train
py
2597d13fc871b80e665c905e37dd50e846590ae2
diff --git a/salt/client/ssh/shell.py b/salt/client/ssh/shell.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/shell.py +++ b/salt/client/ssh/shell.py @@ -292,7 +292,7 @@ class Shell(object): logmsg = 'Executing command: {0}'.format(cmd) if self.passwd: logmsg = logmsg.replace(self.passwd, ('*' * 6)) - if 'decode("base64")' in logmsg: + if 'decode("base64")' in logmsg or 'base64.b64decode(' in logmsg: log.debug('Executed SHIM command. Command logged to TRACE') log.trace(logmsg) else: diff --git a/salt/utils/vt.py b/salt/utils/vt.py index <HASH>..<HASH> 100644 --- a/salt/utils/vt.py +++ b/salt/utils/vt.py @@ -219,7 +219,7 @@ class Terminal(object): '{2}'.format(self.pid, self.child_fd, self.child_fde) ) terminal_command = ' '.join(self.args) - if 'decode("base64")' in terminal_command: + if 'decode("base64")' in terminal_command or 'base64.b64decode(' in terminal_command: log.debug('VT: Salt-SSH SHIM Terminal Command executed. Logged to TRACE') log.trace('Terminal Command: {0}'.format(terminal_command)) else:
update code that changes log level of salt-ssh shim command str.`decode("base<I>")` has been changed to `base<I>.b<I>decode`, but the code that checks for `decode("base<I>")` has not been changed
saltstack_salt
train
py,py
b28c41fd523b6cd338e7bb5d3f2c1980c1c48e56
diff --git a/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/InterrogativeVerbFilter.java b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/InterrogativeVerbFilter.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/InterrogativeVerbFilter.java +++ b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/InterrogativeVerbFilter.java @@ -52,15 +52,10 @@ public class InterrogativeVerbFilter extends RuleFilter { private MorfologikFrenchSpellerRule morfologikRule; - public InterrogativeVerbFilter() { + public InterrogativeVerbFilter() throws IOException { ResourceBundle messages = JLanguageTool.getDataBroker().getResourceBundle(JLanguageTool.MESSAGE_BUNDLE, new Locale("fr")); - try { - morfologikRule = new MorfologikFrenchSpellerRule(messages, new French(), null, Collections.emptyList()); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + morfologikRule = new MorfologikFrenchSpellerRule(messages, new French(), null, Collections.emptyList()); } @Override
[fr] throws IOException
languagetool-org_languagetool
train
java
336a100c7cf0e00102d3d38636faf14c37e49cd2
diff --git a/mailutils.py b/mailutils.py index <HASH>..<HASH> 100644 --- a/mailutils.py +++ b/mailutils.py @@ -125,7 +125,7 @@ def send_email(fromaddr, server.quit() sent = True except (smtplib.SMTPException, socket.error): - register_exception(alert_admin=True) + register_exception() if (debug_level > 1): log('ERR_MISCUTIL_CONNECTION_SMTP', attempt_sleeptime, sys.exc_info()[0], fromaddr, toaddr, body) sleep(attempt_sleeptime)
mailutils: fixed recursive exception bomb When it's impossible to send an email, do not alert admin when calling register_exception(), since the email sending facility might be totally compromized, thus causing a recursive exception bomb.
inveniosoftware-attic_invenio-utils
train
py
3446daa3daa9ea4e93db824bb9b5fe5d911be0fe
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5467,6 +5467,14 @@ function redirect($url, $message='', $delay=-1) { $message = "<strong>Error output, so disabling automatic redirect.</strong></p><p>" . $message; } + $performanceinfo = ''; + if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) { + if (defined('MDL_PERFTOLOG')) { + $perf = get_performance_info(); + error_log("PERF: " . $perf['txt']); + } + } + /// when no message and header printed yet, try to redirect if (empty($message) and !defined('HEADER_PRINTED')) {
redirect() - log performance profiling info Many heavy pages end in a redirect. Log their profiling data! Thanks to Matt Clarkson for spotting the problem.
moodle_moodle
train
php
e014ba9cc54f43b7018b4798bc141641d48186b7
diff --git a/js2py/translators/pyjsparser.py b/js2py/translators/pyjsparser.py index <HASH>..<HASH> 100644 --- a/js2py/translators/pyjsparser.py +++ b/js2py/translators/pyjsparser.py @@ -22,7 +22,7 @@ from .pyjsparserdata import * from .std_nodes import * from pprint import pprint -REGEXP_SPECIAL_SINGLE = {'\\', '^', '$', '*', '+', '?', '.', '[', ']', '(', ')', '{', '{', '|'} +REGEXP_SPECIAL_SINGLE = {'\\', '^', '$', '*', '+', '?', '.', '[', ']', '(', ')', '{', '{', '|', '-'} import six
include hyphen in regexp special single chars I ran into troubles using a JavaScript regexp like /[a\-z]/ where the "-" is meant to be literal. Adding "-" to the REGEXP_SPECIAL_SINGLE set fixes this (for me).
PiotrDabkowski_Js2Py
train
py
b7e65d8c0a75b24fb6e385888cd42ee511c8314d
diff --git a/gossip/gossip/gossip_impl.go b/gossip/gossip/gossip_impl.go index <HASH>..<HASH> 100644 --- a/gossip/gossip/gossip_impl.go +++ b/gossip/gossip/gossip_impl.go @@ -382,14 +382,20 @@ func (g *gossipServiceImpl) Stop() { } atomic.StoreInt32((&g.stopFlag), int32(1)) g.logger.Info("Stopping gossip") - go g.comm.Stop() + comWG := sync.WaitGroup{} + comWG.Add(1) + go func() { + defer comWG.Done() + g.comm.Stop() + }() g.discAdapter.close() - go g.disc.Stop() - go g.pushPull.Stop() + g.disc.Stop() + g.pushPull.Stop() g.toDieChan <- struct{}{} g.emitter.Stop() g.ChannelDeMultiplexer.Close() g.stopSignal.Wait() + comWG.Wait() } func (g *gossipServiceImpl) UpdateMetadata(md []byte) {
Wait for comm layer to stop when gossip stops Gossip's Stop() method stops underlying comm layer asynchronously but doesn't wait for it to stop. I simply changed it so that it now waits for it to stop until the Stop() method exits. Change-Id: I<I>a3d<I>e<I>c2b1fe<I>c3aea1e<I>
hyperledger_fabric
train
go
ce608bbc48d53e9eb073a1429a5c5e9e3c0344f9
diff --git a/lib/marty/monkey.rb b/lib/marty/monkey.rb index <HASH>..<HASH> 100644 --- a/lib/marty/monkey.rb +++ b/lib/marty/monkey.rb @@ -124,3 +124,16 @@ class String self == 'infinity' ? self : old_in_time_zone(zone) end end + +###################################################################### + +# Axlsx::sanitize modifies strings in worksheet definition -- this +# doesn't work with Delorean's frozen strings. +require 'axlsx' +module Axlsx + def self.sanitize(str) + str.delete(CONTROL_CHARS) + end +end + +######################################################################
Added monkey patch to fix issues with Axlsx and frozen strings.
arman000_marty
train
rb
f4b985b83694e23c97a622d01ca1ab26fca5a29c
diff --git a/src/DruidFamiliar/TransformingTimeBoundaryDruidQuery.php b/src/DruidFamiliar/TransformingTimeBoundaryDruidQuery.php index <HASH>..<HASH> 100644 --- a/src/DruidFamiliar/TransformingTimeBoundaryDruidQuery.php +++ b/src/DruidFamiliar/TransformingTimeBoundaryDruidQuery.php @@ -54,9 +54,11 @@ class TransformingTimeBoundaryDruidQuery implements IDruidQuery public function handleResponse($response = Array()) { if ( isset ( $response[0]['result'] ) ) { - return $response[0]['result']; + } + if ( empty( $response ) ) { + throw new \Exception('Unknown data source'); } throw new \Exception('Unexpected response format');
Enhancing TransformingTimeBoundaryDruidQuery to handle an empty data source in a more friendly manner
r4j4h_php-druid-query
train
php
6290b373a001f464df788a56c80169b3abb7b5a4
diff --git a/lib/mqtt/client.rb b/lib/mqtt/client.rb index <HASH>..<HASH> 100644 --- a/lib/mqtt/client.rb +++ b/lib/mqtt/client.rb @@ -81,12 +81,19 @@ class MQTT::Client end # Create a new MQTT Client instance + # + # Accepts one of the following: + # - a URI that uses the MQTT scheme + # - a hostname and port + # - a Hash containing attributes to be set on the new instance # # If no arguments are given then the method will look for a URI # in the MQTT_BROKER environment variable. # # Examples: # client = MQTT::Client.new + # client = MQTT::Client.new('mqtt://myserver.example.com') + # client = MQTT::Client.new('mqtt://user:[email protected]') # client = MQTT::Client.new('myserver.example.com') # client = MQTT::Client.new('myserver.example.com', 18830) # client = MQTT::Client.new(:remote_host => 'myserver.example.com')
Improved documentation on the Client initialize method
njh_ruby-mqtt
train
rb
dd551acf9181b8d4a58fce5b68fe1c4080b95d24
diff --git a/ghost/admin/app/components/editor-labs/publish-options/publish-at.js b/ghost/admin/app/components/editor-labs/publish-options/publish-at.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/components/editor-labs/publish-options/publish-at.js +++ b/ghost/admin/app/components/editor-labs/publish-options/publish-at.js @@ -1,8 +1,11 @@ import Component from '@glimmer/component'; import moment from 'moment'; import {action} from '@ember/object'; +import {inject as service} from '@ember/service'; export default class PublishAtOption extends Component { + @service settings; + @action setDate(selectedDate) { const newDate = moment(this.args.publishOptions.scheduledAtUTC); @@ -35,7 +38,7 @@ export default class PublishAtOption extends Component { // hour/minute will be the site timezone equivalent but we need the hour/minute // as it would be in UTC - const conversionDate = moment(); + const conversionDate = moment().tz(this.settings.get('timezone')); conversionDate.set({hour, minute}); const utcDate = moment.utc(conversionDate);
Fixed schedule time changing after setting if local and site tz don't match closes <URL>
TryGhost_Ghost
train
js
cc79af58194ff7846ba9edc02481cb31826e7f2a
diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/CompoundInfinitivRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/CompoundInfinitivRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/CompoundInfinitivRule.java +++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/CompoundInfinitivRule.java @@ -27,6 +27,7 @@ import org.languagetool.rules.*; import org.languagetool.rules.patterns.PatternToken; import org.languagetool.rules.patterns.PatternTokenBuilder; import org.languagetool.tagging.disambiguation.rules.DisambiguationPatternRule; +import org.languagetool.tools.StringTools; import org.languagetool.tools.Tools; import java.io.IOException; @@ -134,7 +135,7 @@ public class CompoundInfinitivRule extends Rule { } private boolean isMisspelled(String word) { - word = word.substring(0, 1).toLowerCase() + word.substring(1); + word = StringTools.lowercaseFirstChar(word); if (linguServices == null && speller != null) { return speller.isMisspelled(word); } else if (linguServices != null) {
[DE] StringTools.lowercaseFirstChar replaced in CompoundInfinitivRule
languagetool-org_languagetool
train
java
14ef74d0901f227f0ef23cdd6f21d93244000500
diff --git a/datajoint/blob.py b/datajoint/blob.py index <HASH>..<HASH> 100644 --- a/datajoint/blob.py +++ b/datajoint/blob.py @@ -234,6 +234,8 @@ def pack_obj(obj): blob += pack_array(np.array(obj, dtype=np.dtype('c'))) elif isinstance(obj, Iterable): blob += pack_array(np.array(obj)) + elif isinstance(obj, int) or isinstance(obj, float): + blob += pack_array(np.array(obj)) else: raise DataJointError("Packing object of type %s currently not supported!" % type(obj))
Support packing int and float into blob
datajoint_datajoint-python
train
py
ee3f48d01abb518315f3a4dea415c20d623d1fb6
diff --git a/test/test-quoting.js b/test/test-quoting.js index <HASH>..<HASH> 100644 --- a/test/test-quoting.js +++ b/test/test-quoting.js @@ -2,7 +2,7 @@ const test = require('ava'); const bashParser = require('../src'); -test('quotes within double quotes', t => { +test.only('quotes within double quotes', t => { const result = bashParser('echo "TEST1 \'TEST2"'); // console.log(inspect(result, {depth:null})) t.deepEqual(result, {
Add test for line numbers in syntax errors
vorpaljs_bash-parser
train
js
ba1ff8f04049c95adfe56472a855aa21bb631b13
diff --git a/pyvirtualdisplay/smartdisplay.py b/pyvirtualdisplay/smartdisplay.py index <HASH>..<HASH> 100644 --- a/pyvirtualdisplay/smartdisplay.py +++ b/pyvirtualdisplay/smartdisplay.py @@ -60,7 +60,7 @@ class SmartDisplay(Display): """ t = 0 sleep_time = 0.3 # for fast windows - repeat_time = 1 + repeat_time = 0.5 while 1: log.debug("sleeping %s secs" % str(sleep_time)) time.sleep(sleep_time) @@ -72,7 +72,7 @@ class SmartDisplay(Display): if cb_imgcheck(img): break sleep_time = repeat_time - repeat_time += 1 # progressive + repeat_time += 0.5 # progressive if t > timeout: msg = "Timeout! elapsed time:%s timeout:%s " % (t, timeout) raise DisplayTimeoutError(msg)
waitgrab: smaller polling times
ponty_PyVirtualDisplay
train
py
d967567b4e2b2f15783fa04ca8715fab5e003baf
diff --git a/core/src/main/java/com/graphhopper/routing/AlternativeRouteCH.java b/core/src/main/java/com/graphhopper/routing/AlternativeRouteCH.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/graphhopper/routing/AlternativeRouteCH.java +++ b/core/src/main/java/com/graphhopper/routing/AlternativeRouteCH.java @@ -183,8 +183,7 @@ public class AlternativeRouteCH extends DijkstraBidirectionCHNoSOD { for (EdgeIteratorState edge : vtPath.calcEdges()) { path.addEdge(edge.getEdge()); } - final IntIndexedContainer vtNodes = vtPath.calcNodes(); - path.setEndNode(vtNodes.get(vtNodes.size() - 1)); + path.setEndNode(vtPath.getEndNode()); path.setWeight(svPath.getWeight() + vtPath.getWeight()); path.setDistance(svPath.getDistance() + vtPath.getDistance()); path.addTime(svPath.time + vtPath.time);
Factor out concat for Paths
graphhopper_graphhopper
train
java
8b23eaf13394fbda4475c4a7207a3d3831ad10f6
diff --git a/LiSE/LiSE/handle.py b/LiSE/LiSE/handle.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/handle.py +++ b/LiSE/LiSE/handle.py @@ -566,7 +566,7 @@ class EngineHandle(object): k, v = kv return pack(k), pack(v) old = cache.get(char, {}) - new = dict(self.threadpool.map(pack_pair, copier(char, *args).items())) + new = dict(map(pack_pair, copier(char, *args).items())) if store: cache[char] = new return self._packed_dict_delta(old, new)
Avoid a weird inconsistent error in _character_something_delta
LogicalDash_LiSE
train
py
9bdeedcf4eff3bc40406966d0efd5d8cf7206b35
diff --git a/eppy/geometry/pyNumeric.py b/eppy/geometry/pyNumeric.py index <HASH>..<HASH> 100644 --- a/eppy/geometry/pyNumeric.py +++ b/eppy/geometry/pyNumeric.py @@ -17,8 +17,6 @@ """This module is used to implement native Python functions to replace those called from numpy, when using eppy with Rhino""" -# Wrote by Tuan Tran [email protected] / [email protected] -# School of Architecture, University of Hawaii at Manoa +# Written by Eric Youngson [email protected] / [email protected] +# Succession Ecological Services: Portland, Oregon -####### The following code within the block credited by ActiveState Code Recipes code.activestate.com -## {{{ http://code.activestate.com/recipes/578276/ (r1) \ No newline at end of file
Branch: i<I>_pythongeometry | Intent: Create module of native Python functions to replace numpy functions used in eppy geometry modules Commit Intent: Revise file header for new author & organization --------------------------------------------------------------------------------------- */eppy/geometry/pyNumeric.py -Revised laste section of header by replacing Tuan's name and org with my own... -
santoshphilip_eppy
train
py
88c977c061a67a5bbe4f6e304ad30838639dd30a
diff --git a/core/src/main/java/org/eobjects/analyzer/util/SourceColumnFinder.java b/core/src/main/java/org/eobjects/analyzer/util/SourceColumnFinder.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/eobjects/analyzer/util/SourceColumnFinder.java +++ b/core/src/main/java/org/eobjects/analyzer/util/SourceColumnFinder.java @@ -140,8 +140,10 @@ public class SourceColumnFinder { for (final InputColumn<?> inputColumn : inputColumns) { final InputColumnSourceJob source = findInputColumnSource(inputColumn); if (source != null) { - result.add(source); - findAllSourceJobs(source, result); + final boolean added = result.add(source); + if (added) { + findAllSourceJobs(source, result); + } } } } @@ -157,8 +159,10 @@ public class SourceColumnFinder { for (final FilterOutcome outcome : requirements) { HasFilterOutcomes source = findOutcomeSource(outcome); if (source != null) { - result.add(source); - findAllSourceJobs(source, result); + final boolean added = result.add(source); + if (added) { + findAllSourceJobs(source, result); + } } } }
Further prevented stack overflow situations in SourceColumnFinder
datacleaner_AnalyzerBeans
train
java
36fe23312e9209d856a7f61acf43a82769e44b99
diff --git a/flowcraft/generator/engine.py b/flowcraft/generator/engine.py index <HASH>..<HASH> 100644 --- a/flowcraft/generator/engine.py +++ b/flowcraft/generator/engine.py @@ -55,6 +55,7 @@ except ImportError: process_map = { + "abyss": assembly.Abyss, "abricate": annotation.Abricate, "assembly_mapping": ap.AssemblyMapping, "bowtie": mapping.Bowtie, @@ -101,8 +102,7 @@ process_map = { "split_assembly": meta.SplitAssembly, "trimmomatic": readsqc.Trimmomatic, "true_coverage": readsqc.TrueCoverage, - "viral_assembly": assembly.ViralAssembly, - "abyss": assembly.Abyss + "viral_assembly": assembly.ViralAssembly } """
Change order of abyss class in components dictionary to maintain alphabetical order
assemblerflow_flowcraft
train
py
62357c0a9148dbb94e997abedf76a510f781c436
diff --git a/dipper/sources/Source.py b/dipper/sources/Source.py index <HASH>..<HASH> 100644 --- a/dipper/sources/Source.py +++ b/dipper/sources/Source.py @@ -380,12 +380,14 @@ class Source: if cache_response: LOG.info( "Found File '%s/%s' in DipperCache", self.name, filesource['file']) - self.dataset.set_ingest_source(remote_file) + self.dataset.set_ingest_source(filesource['url']) if remote_file in self.remote_file_timestamps: - timestamp = Literal( - self.remote_file_timestamps[remote_file], datatype=XSD.dateTime) + # Here we assume that the timestamp of the cached file on + # DipperCache is the date it was retrieved from the upstream source + timestamp = Literal(self.remote_file_timestamps[remote_file], + datatype=XSD.dateTime) self.dataset.graph.addTriple( - remote_file, self.globaltt['retrieved_on'], timestamp) + filesource['url'], self.globaltt['retrieved_on'], timestamp) else: LOG.warning( "File %s/%s absent from DipperCache", self.name, filesource['file'])
Set URL to that of the upstream source, and assume timestamp on DipperCache is the when it was retreived
monarch-initiative_dipper
train
py
16faf064de412418d172ccc40729a8c5ad7a63ec
diff --git a/src/ol/renderer/canvas/Map.js b/src/ol/renderer/canvas/Map.js index <HASH>..<HASH> 100644 --- a/src/ol/renderer/canvas/Map.js +++ b/src/ol/renderer/canvas/Map.js @@ -145,11 +145,11 @@ class CanvasMapRenderer extends MapRenderer { } const viewResolution = frameState.viewState.resolution; - let i, ii, layer, layerRenderer, layerState; + let i, ii; for (i = 0, ii = layerStatesArray.length; i < ii; ++i) { - layerState = layerStatesArray[i]; - layer = layerState.layer; - layerRenderer = /** @type {import("./Layer.js").default} */ (this.getLayerRenderer(layer)); + const layerState = layerStatesArray[i]; + const layer = layerState.layer; + const layerRenderer = /** @type {import("./Layer.js").default} */ (this.getLayerRenderer(layer)); if (!visibleAtResolution(layerState, viewResolution) || layerState.sourceState != SourceState.READY) { continue;
Fix type check errors in ol/renderer/canvas/Map
openlayers_openlayers
train
js
868625d8c3ce214de956c5a3665390ea87624d88
diff --git a/chain/chain.go b/chain/chain.go index <HASH>..<HASH> 100644 --- a/chain/chain.go +++ b/chain/chain.go @@ -60,7 +60,6 @@ func NewClient(net *btcnet.Params, connect, user, pass string, certs []byte) (*C notificationLock: new(sync.Mutex), quit: make(chan struct{}), } - initializedClient := make(chan struct{}) ntfnCallbacks := btcrpcclient.NotificationHandlers{ OnClientConnected: client.onClientConnect, OnBlockConnected: client.onBlockConnected, @@ -83,7 +82,6 @@ func NewClient(net *btcnet.Params, connect, user, pass string, certs []byte) (*C return nil, err } client.Client = c - close(initializedClient) return &client, nil }
Remove a unused channel from chain.NewClient
btcsuite_btcwallet
train
go
743631346a9cf85ad96bdfb8af603d572f7a0b44
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,8 +10,8 @@ source_suffix = ".rst" master_doc = "index" project = "pwned-passwords-django" copyright = "2018-2020, James Bennett" -version = "1.4a" -release = "1.4a" +version = "1.4" +release = "1.4" exclude_trees = ["_build"] pygments_style = "sphinx" html_static_path = ["_static"]
Fix version number in docs.
ubernostrum_pwned-passwords-django
train
py
bacdc3504baf6eeff802aab2ee57e5588830882a
diff --git a/array-keys.js b/array-keys.js index <HASH>..<HASH> 100644 --- a/array-keys.js +++ b/array-keys.js @@ -41,7 +41,7 @@ ArrayKeys.prototype.getRecord = function (id) { }; ArrayKeys.prototype.exists = function (id) { - if (this.idx.getIndex(id) >= 0) { + if (this.getIndex(id) >= 0) { return true; } else { return false; diff --git a/test/basics-suite.js b/test/basics-suite.js index <HASH>..<HASH> 100644 --- a/test/basics-suite.js +++ b/test/basics-suite.js @@ -56,6 +56,13 @@ function getTests() { }, { + desc: '# exists 2', + run: function (env, test) { + test.assert(env.mod.exists('thingy2'), true); + } + }, + + { desc: '# getCount (3)', run: function (env, test) { test.assert(env.mod.getCount(), 3);
bugfix, erroneously referenced method. with test
silverbucket_array-keys
train
js,js
093db3ddfa75a096911886734067f26309c59738
diff --git a/terraform/cloudtesting/end_to_end_test.go b/terraform/cloudtesting/end_to_end_test.go index <HASH>..<HASH> 100644 --- a/terraform/cloudtesting/end_to_end_test.go +++ b/terraform/cloudtesting/end_to_end_test.go @@ -14,13 +14,24 @@ import ( ) var ( - numClients = flag.Int("num_clients", 1, "Number of clients") + numClients = flag.Int("num_clients", 0, "Number of clients") masterServerAddress = flag.String("ms_address", "", "Address of master server") serversFile = flag.String("servers_file", "", "File with server hosts") ) func TestCloudEndToEnd(t *testing.T) { flag.Parse() + + if *numClients == 0 { + t.Skip("num_clients flag is required to run this test.") + } + if *masterServerAddress == "" { + t.Skip("ms_address flag is required to run this test.") + } + if *serversFile == "" { + t.Skip("servers_file flag is required to run this test.") + } + wd, err := os.Getwd() if err != nil { t.Fatalf("Failed to get working directory: %v", err)
Skip test if flags are note set. (#<I>)
google_fleetspeak
train
go
f5d0e3d7605cc05b0fd549d2b89c9d1db48ce093
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -1,7 +1,7 @@ require 'active_support/core_ext/hash/keys' module ActiveSupport - # Implements a hash where keys +:foo+ and +"foo"+ are considered to be the same. + # Implements a hash where keys <tt>:foo</tt> and <tt>"foo"</tt> are considered to be the same. # # rgb = ActiveSupport::HashWithIndifferentAccess.new #
+"foo"+ doesn't generate code tag [ci skip]
rails_rails
train
rb
fcc5b4814b65c291d5d2d3bd7d97af9c81e65d62
diff --git a/src/Notifications/Notifications/BackupHasFailed.php b/src/Notifications/Notifications/BackupHasFailed.php index <HASH>..<HASH> 100644 --- a/src/Notifications/Notifications/BackupHasFailed.php +++ b/src/Notifications/Notifications/BackupHasFailed.php @@ -25,8 +25,8 @@ class BackupHasFailed extends BaseNotification $mailMessage = (new MailMessage) ->error() - ->subject("Could not back up `{$this->getApplicationName()}`") - ->line("An error occurred while backing up `{$this->getApplicationName()}`") + ->subject("Failed back up of `{$this->getApplicationName()}`") + ->line("Important: An error occurred while backing up `{$this->getApplicationName()}`") ->line("Exception message: `{$this->event->exception->getMessage()}`") ->line("Exception trace: `" . $this->event->exception->getTraceAsString() . "`"); @@ -42,7 +42,7 @@ class BackupHasFailed extends BaseNotification { return (new SlackMessage) ->error() - ->content("An error occurred while backing up `{$this->getApplicationName()}`") + ->content("Failed back up of `{$this->getApplicationName()}`") ->attachment(function (SlackAttachment $attachment) { $attachment ->title('Exception message')
Bring the Fail to the front of the notification (#<I>)
spatie_laravel-backup
train
php
f10c1094454c789c798d0a6b84ef92a218811ee1
diff --git a/Command/PopulateCommand.php b/Command/PopulateCommand.php index <HASH>..<HASH> 100644 --- a/Command/PopulateCommand.php +++ b/Command/PopulateCommand.php @@ -103,7 +103,7 @@ class PopulateCommand extends ContainerAwareCommand if ($input->isInteractive() && $reset && $input->getOption('offset')) { /** @var QuestionHelper $dialog */ $dialog = $this->getHelperSet()->get('question'); - if (!$dialog->askConfirmation($input, $output, new Question('<question>You chose to reset the index and start indexing with an offset. Do you really want to do that?</question>'))) { + if (!$dialog->ask($input, $output, new Question('<question>You chose to reset the index and start indexing with an offset. Do you really want to do that?</question>'))) { return; } }
Fix call of unknown method QuestionHelper::askConfirmation() QuestionHelper has no method askConfirmation(), use ask() Problem is caused by migration from DialogHelper to QuestionHelper in this commit: <URL>
FriendsOfSymfony_FOSElasticaBundle
train
php
632cb5d833d1cd37cdb14b427f6caa89f48b8208
diff --git a/gnupg/_parsers.py b/gnupg/_parsers.py index <HASH>..<HASH> 100644 --- a/gnupg/_parsers.py +++ b/gnupg/_parsers.py @@ -1348,5 +1348,8 @@ class ListPackets(object): self.need_passphrase_sym = True elif key == 'USERID_HINT': self.userid_hint = value.strip().split() + elif key in ('NO_SECKEY', 'BEGIN_DECRYPTION', 'DECRYPTION_FAILED', + 'END_DECRYPTION'): + pass else: raise ValueError("Unknown status message: %r" % key)
Add more recognized keys to ListPackets status handling method.
isislovecruft_python-gnupg
train
py
8cb07eb379d7efee8336258a9009c349dd705f66
diff --git a/pysnmp/entity/config.py b/pysnmp/entity/config.py index <HASH>..<HASH> 100644 --- a/pysnmp/entity/config.py +++ b/pysnmp/entity/config.py @@ -238,7 +238,8 @@ def addTargetAddr( def addSocketTransport(snmpEngine, transportDomain, transport): """Add transport object to socket dispatcher of snmpEngine""" - snmpEngine.registerTransportDispatcher(dispatch.AsynsockDispatcher()) + if not snmpEngine.transportDispatcher: + snmpEngine.registerTransportDispatcher(dispatch.AsynsockDispatcher()) snmpEngine.transportDispatcher.registerTransport( transportDomain, transport )
at addSocketTransport(), create transport dispatcher if does not exist. better make sure that existing one is of Socket type.
etingof_pysnmp
train
py
54bb622da787eaa33a9d59bd13ee819981ca844f
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,7 +35,7 @@ end require 'rubygems' # If spork is available in the Gemfile it'll be used but we don't force it. -unless RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)! or (begin; require 'spork'; rescue LoadError; nil end).nil? +unless (begin; require 'spork'; rescue LoadError; nil end).nil? require 'spork' Spork.prefork do
Spork is working on Windows now
refinery_refinerycms
train
rb
ad6d075ad6757e9bfb2bfd6e6416c7ea6ef7f53b
diff --git a/jams/tests/eval_test.py b/jams/tests/eval_test.py index <HASH>..<HASH> 100644 --- a/jams/tests/eval_test.py +++ b/jams/tests/eval_test.py @@ -89,7 +89,7 @@ def test_onset_invalid(): def test_chord_valid(): ref_ann = create_annotation(values=['C', 'E', 'G:min7'], - namespace='chord_harte') + namespace='chord') est_ann = create_annotation(values=['D', 'E', 'G:maj'], namespace='chord_harte') @@ -99,7 +99,7 @@ def test_chord_valid(): def test_chord_invalid(): ref_ann = create_annotation(values=['C', 'E', 'G:min7'], - namespace='chord_harte') + namespace='chord') est_ann = create_annotation(values=[{'tonic': 'C', 'chord': 'I'}], namespace='chord_roman')
updated eval tests to cover both chord namespaces
marl_jams
train
py
4128ffcbb86017ac99e3d04f2d0e7dc5602366ff
diff --git a/src/NodeChanger/ExpressionAdder.php b/src/NodeChanger/ExpressionAdder.php index <HASH>..<HASH> 100644 --- a/src/NodeChanger/ExpressionAdder.php +++ b/src/NodeChanger/ExpressionAdder.php @@ -80,6 +80,10 @@ final class ExpressionAdder */ public function addExpressionsToNodes(array $nodes): array { + if (! count($this->expressionsToAdd)) { + return $nodes; + } + $this->expressionAddingNodeVisitor->setExpressionsToAdd($this->expressionsToAdd); return $this->nodeTraverser->traverse($nodes);
ExpressionAdder: run only if these are nodes to be added
rectorphp_rector
train
php
b3cf42b6d1d23ae1e436b34cba0696c9a8712c12
diff --git a/src/main/java/act/handler/builtin/controller/impl/ReflectedHandlerInvoker.java b/src/main/java/act/handler/builtin/controller/impl/ReflectedHandlerInvoker.java index <HASH>..<HASH> 100644 --- a/src/main/java/act/handler/builtin/controller/impl/ReflectedHandlerInvoker.java +++ b/src/main/java/act/handler/builtin/controller/impl/ReflectedHandlerInvoker.java @@ -275,6 +275,13 @@ public class ReflectedHandlerInvoker<M extends HandlerMethodMetaInfo> extends De } else if (paramType.isAssignableFrom(o.getClass())) { oa[i] = o; } else { + // try primitive wrapper juggling + if (paramType.isPrimitive()) { + if ($.wrapperClassOf(paramType).isAssignableFrom(o.getClass())) { + oa[i] = o; + continue; + } + } throw new BindException("Cannot resolve parameter[%s] from %s", bindName, o); } continue;
fix bind issue when action handler needs primitive type
actframework_actframework
train
java
f5a8fb88935f9c317b29b56d36873160673d2bdb
diff --git a/src/discoursegraphs/readwrite/rst/rs3.py b/src/discoursegraphs/readwrite/rst/rs3.py index <HASH>..<HASH> 100644 --- a/src/discoursegraphs/readwrite/rst/rs3.py +++ b/src/discoursegraphs/readwrite/rst/rs3.py @@ -81,7 +81,7 @@ class RSTGraph(DiscourseDocumentGraph): (root precedes token1, which precedes token2 etc.) """ # super calls __init__() of base class DiscourseDocumentGraph - super(RSTGraph, self).__init__() + super(RSTGraph, self).__init__(namespace=namespace) self.ns = namespace if not rs3_filepath:
rs3: the default root node is now the rst:root_node, cf. #<I>
arne-cl_discoursegraphs
train
py
67f0458a6dafb6a817cce0d9497fe901b267e5ba
diff --git a/tests/test_megaplan.py b/tests/test_megaplan.py index <HASH>..<HASH> 100644 --- a/tests/test_megaplan.py +++ b/tests/test_megaplan.py @@ -1,8 +1,13 @@ from builtins import next from builtins import object import mock +import unittest -from bugwarrior.services.mplan import MegaplanService +try: + from bugwarrior.services.mplan import MegaplanService +except SyntaxError: + raise unittest.SkipTest( + 'Upstream python-megaplan does not support python3 yet.') from .base import ServiceTest, AbstractServiceTest
Skip megaplan tests in python3.
ralphbean_bugwarrior
train
py
e631cf50ce196e730a14a7c642039947c079c553
diff --git a/bqplot/pyplot/pyplot.py b/bqplot/pyplot/pyplot.py index <HASH>..<HASH> 100644 --- a/bqplot/pyplot/pyplot.py +++ b/bqplot/pyplot/pyplot.py @@ -321,15 +321,19 @@ def axes(mark=None, options={}, **kwargs): fig_axes = [axis for axis in fig.axes] for name in scales: if name not in mark.class_trait_names(scaled=True): - # Pass if the scale is not needed. + # The scale is not needed. continue + axis_args = dict(mark.scales_metadata.get(name, {}), + **(options.get(name, {}))) if name in axes: - # Pass if there is already an axis for this scaled attribute. + # There is already an axis for this scaled attribute. + for arg in axis_args: + setattr(axes[name], arg, axis_args[arg]) continue + # An axis must be created. We fetch the type from the registry + # the key being provided in the scaled attribute decoration key = mark.class_traits()[name].get_metadata('atype', 'bqplot.Axis') axis_type = Axis.axis_types[key] - axis_args = dict(mark.scales_metadata.get(name, {}), - **(options.get(name, {}))) axis = axis_type(scale=scales[name], **axis_args) fig_axes.append(axis) axes[name] = axis
make axes changes dynamic in pyplot
bloomberg_bqplot
train
py
002f47a0fbf16eb52b465527833055d5f81f8692
diff --git a/src/main/java/io/github/bonigarcia/handler/DockerDriverHandler.java b/src/main/java/io/github/bonigarcia/handler/DockerDriverHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/handler/DockerDriverHandler.java +++ b/src/main/java/io/github/bonigarcia/handler/DockerDriverHandler.java @@ -351,7 +351,7 @@ public class DockerDriverHandler { } private String getDockerPath(File file) { - String fileString = file.getAbsolutePath().toString(); + String fileString = file.getAbsolutePath(); if (fileString.contains(":")) { // Windows fileString = toLowerCase(fileString.charAt(0)) + fileString.substring(1);
Minor smell-fix according to sonarcloud report
bonigarcia_selenium-jupiter
train
java
1e3c28167ffb300ffb0246787ac7893801d887c8
diff --git a/src/dependencies.js b/src/dependencies.js index <HASH>..<HASH> 100644 --- a/src/dependencies.js +++ b/src/dependencies.js @@ -6,11 +6,6 @@ suffix: Pusher.dependency_suffix }); - // Support Firefox versions which prefix WebSocket - if (!window.WebSocket && window.MozWebSocket) { - window.WebSocket = window.MozWebSocket; - } - function initialize() { Pusher.ready(); }
Don't bind MozWebSocket to WebSocket anymore
pusher_pusher-js
train
js
c1f20c981f21c86dcfc3f12c818db1b6e8d08a56
diff --git a/src/db.js b/src/db.js index <HASH>..<HASH> 100644 --- a/src/db.js +++ b/src/db.js @@ -188,11 +188,11 @@ var transaction = db.transaction( table ), store = transaction.objectStore( table ), index = indexName ? store.index( indexName ) : store, - keyRange = type ? IDBKeyRange[ type ].apply( null, args ) : undefined, + keyRange = type ? IDBKeyRange[ type ].apply( null, args ) : null, results = [], promise = new Promise(); - ( keyRange ? index[cursorType]( keyRange ) : index[cursorType]( ) ).onsuccess = function ( e ) { + index[cursorType]( keyRange ).onsuccess = function ( e ) { var cursor = e.target.result; if ( typeof cursor === typeof 0 ) {
Reading the spec clarifies how to handle no range, use null!
aaronpowell_db.js
train
js
8521fc2c15583cae8876ac36ff2b79b045b6a1f1
diff --git a/dmenu/dmenu.py b/dmenu/dmenu.py index <HASH>..<HASH> 100644 --- a/dmenu/dmenu.py +++ b/dmenu/dmenu.py @@ -2,18 +2,18 @@ import re from subprocess import PIPE, Popen from sys import version_info - +# determine the string type for this version of python if version_info[0] == 3: _string_types = str, else: _string_types = basestring, - # used to match the usage error message _usage = re.compile('usage:', re.I) class DmenuError(Exception): + '''The base class for dmenu errors.''' pass
Add a clarifying comment about string_types and DmenuError.
allonhadaya_dmenu-python
train
py
f042d742b9511e51a869f82b27dd32ca5b966427
diff --git a/app/models/version.rb b/app/models/version.rb index <HASH>..<HASH> 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -141,11 +141,13 @@ class Version < ApplicationRecord subquery = <<-SQL versions.rubygem_id IN (SELECT versions.rubygem_id FROM versions + WHERE versions.indexed = 'true' GROUP BY versions.rubygem_id - HAVING COUNT(versions.id) > 1) + HAVING COUNT(versions.id) > 1 + ORDER BY MAX(created_at) DESC LIMIT :limit) SQL - where(subquery) + where(subquery, limit: limit) .joins(:rubygem) .indexed .by_created_at
Limit select of distinct rubygems in just_updated Previously, this was scanning the complete versions table which was unnecessary when we only wanted to show <I> versions order by created_at. Adding limit and order by with agg on created_at in subquery would ensure we selecting over relevant rows only. query plan: <URL>
rubygems_rubygems.org
train
rb
ef3cd76e3dc4583b06f5f2b8e896643c44280c51
diff --git a/structs.go b/structs.go index <HASH>..<HASH> 100644 --- a/structs.go +++ b/structs.go @@ -232,6 +232,7 @@ type Role struct { ID string `json:"id"` Name string `json:"name"` Managed bool `json:"managed"` + Mentionable bool `json:"mentionable"` Hoist bool `json:"hoist"` Color int `json:"color"` Position int `json:"position"`
Add mentionable to Role struct
bwmarrin_discordgo
train
go
6090d8fd424b51cee7a660cb425ee3c8bfd3333d
diff --git a/src/javascript/xhr/XMLHttpRequest.js b/src/javascript/xhr/XMLHttpRequest.js index <HASH>..<HASH> 100644 --- a/src/javascript/xhr/XMLHttpRequest.js +++ b/src/javascript/xhr/XMLHttpRequest.js @@ -958,14 +958,14 @@ define("moxie/xhr/XMLHttpRequest", [ headers: _headers, mimeType: _mimeType, encoding: _encoding, - responseType: props.responseType, + responseType: self.responseType, options: _options }, data); } // clarify our requirements _options.required_caps = Basic.extend({}, _options.required_caps, { - receive_response_type: props.responseType + receive_response_type: self.responseType }); if (_options.ruid) { // we do not need to wait if we can connect directly
XHR, HTML5: Reference responseType directly rather than through props object, which is not functional currently.
moxiecode_moxie
train
js
cdfa6720bd3a9594ad8b6a310e4e934e65651eed
diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php @@ -122,7 +122,8 @@ class OrderRepository extends CartRepository implements OrderRepositoryInterface $queryBuilder = parent::getCollectionQueryBuilder(); $queryBuilder ->andWhere($queryBuilder->expr()->isNotNull('o.completedAt')) - ->innerJoin('o.user', 'user') + ->leftJoin('o.user', 'user') + ->addSelect('user') ; if ($deleted) {
Leftjoin because order.user can be null And select the user to avoid more queries
Sylius_Sylius
train
php
4d38b1674bb23385c8ab866af98a2a31e7ab098e
diff --git a/guava/src/com/google/common/cache/CacheBuilder.java b/guava/src/com/google/common/cache/CacheBuilder.java index <HASH>..<HASH> 100644 --- a/guava/src/com/google/common/cache/CacheBuilder.java +++ b/guava/src/com/google/common/cache/CacheBuilder.java @@ -650,8 +650,9 @@ public final class CacheBuilder<K, V> { * {@link CacheLoader#reload}. * * <p>As the default implementation of {@link CacheLoader#reload} is synchronous, it is - * recommended that users of this method override {@link CacheLoader#reload} with an asynchrnous - * implementation; otherwise refreshes will block other cache operations. + * recommended that users of this method override {@link CacheLoader#reload} with an asynchronous + * implementation; otherwise refreshes will be performed during unrelated cache read and write + * operations. * * <p>Currently automatic refreshes are performed when the first stale request for an entry * occurs. The request triggering refresh will make a blocking call to {@link CacheLoader#reload}
Clarify the impact of having a synchronous refresh implementation. ------------- Created by MOE: <URL>
google_guava
train
java
7af61de35760bb1cbd956bebbe9d130ab0427013
diff --git a/pyfolio/tears.py b/pyfolio/tears.py index <HASH>..<HASH> 100644 --- a/pyfolio/tears.py +++ b/pyfolio/tears.py @@ -132,10 +132,9 @@ def create_full_tear_sheet(returns, positions=None, transactions=None, set_context=set_context) if bayesian and live_start_date is not None: - create_bayesian_tear_sheet(returns, - live_start_date=live_start_date, - benchmark_rets=benchmark_rets, - set_context=set_context) + create_bayesian_tear_sheet_oos(returns, live_start_date, + benchmark_rets=benchmark_rets, + set_context=set_context) @plotting_context @@ -455,7 +454,7 @@ def create_interesting_times_tear_sheet( @plotting_context -def create_bayesian_tear_sheet_oos(returns, live_start_date=None, +def create_bayesian_tear_sheet_oos(returns, live_start_date, benchmark_rets=None, return_fig=False): """ Generate a number of Bayesian distributions and a Bayesian
BUG Call the new Bayesian tear sheet from full tear sheet.
quantopian_pyfolio
train
py
5593c8c186f1046edf95272e8ac4ce3394908c25
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1054,7 +1054,7 @@ var QUERIES = [ { regexp: /^(firefox|ff|fx)\s+esr$/i, select: function () { - return ['firefox 78', 'firefox 91'] + return ['firefox 91'] } }, {
Update Firefox ESR versions (#<I>) Firefox <I> is not an ESR anymore since November <I>.
browserslist_browserslist
train
js
20e26c3df81279c8482d96b77083fa0ea1eb3477
diff --git a/notifiers/balloon.js b/notifiers/balloon.js index <HASH>..<HASH> 100644 --- a/notifiers/balloon.js +++ b/notifiers/balloon.js @@ -123,14 +123,16 @@ function doNotification (options, notifierOptions, callback) { } function fromErrorCodeToAction (errorCode) { - if (errorCode === 2) { - return 'timeout'; - } - if (errorCode === 3 || errorCode === 6 || errorCode === 7) { - return 'activate'; - } - if (errorCode === 4) { - return 'close'; + switch (errorCode) { + case 2: + return 'timeout'; + case 3: + case 6: + case 7: + return 'activate'; + case 4: + return 'close'; + default: + return 'error'; } - return 'error'; }
Changed ifs to switch.
mikaelbr_node-notifier
train
js
daa732d9c06db7b21795eb62406c83dec69437c3
diff --git a/examples/server/server.js b/examples/server/server.js index <HASH>..<HASH> 100644 --- a/examples/server/server.js +++ b/examples/server/server.js @@ -36,7 +36,7 @@ const HTML = ({ content, store }) => ( ) app.use(function (req, res) { - const memoryHistory = createMemoryHistory(req.path) + const memoryHistory = createMemoryHistory(req.url) const store = configureStore(memoryHistory) const history = syncHistoryWithStore(memoryHistory, store)
Use url for history. Closes #<I>
reactjs_react-router-redux
train
js
1a916d7098f615feaea6206f1795bab87a118330
diff --git a/autoslug/tests.py b/autoslug/tests.py index <HASH>..<HASH> 100644 --- a/autoslug/tests.py +++ b/autoslug/tests.py @@ -65,6 +65,13 @@ class ModelWithUniqueSlugFK(Model): >>> d = ModelWithUniqueSlugFK.objects.create(name=greeting, simple_model=sm1) >>> d.slug 'hello-world-3' + >>> sm3.name = 'test' + >>> sm3.save() + >>> c.slug + 'hello-world' + >>> c.save() + >>> c.slug + 'hello-world-4' """ name = CharField(max_length=200) simple_model = ForeignKey(SimpleModel)
Tests for recently introduced bug in unique slug generation. See #6.
justinmayer_django-autoslug
train
py
b5e0887e3740eb166ed1f5c59d7f216873c53688
diff --git a/api/runner/logger.go b/api/runner/logger.go index <HASH>..<HASH> 100644 --- a/api/runner/logger.go +++ b/api/runner/logger.go @@ -19,7 +19,7 @@ func NewFuncLogger(appName, path, function, requestID string) io.Writer { r: r, w: w, } - log := logrus.WithFields(logrus.Fields{"app_name": appName, "path": path, "function": function, "request_id": requestID}) + log := logrus.WithFields(logrus.Fields{"user_log": true, "app_name": appName, "path": path, "function": function, "request_id": requestID}) go func(reader io.Reader) { scanner := bufio.NewScanner(reader) for scanner.Scan() {
Added user_log=true to user log lines.
iron-io_functions
train
go
06bfb017f818fa71482861140f7774f3bc118780
diff --git a/lib/tvdb_party/httparty_icebox.rb b/lib/tvdb_party/httparty_icebox.rb index <HASH>..<HASH> 100644 --- a/lib/tvdb_party/httparty_icebox.rb +++ b/lib/tvdb_party/httparty_icebox.rb @@ -168,7 +168,7 @@ module HTTParty #:nodoc: # ===== Store objects in memory # - Struct.new("Response", :code, :body, :headers) { def to_s; self.body; end } + Struct.new("IceboxResponse", :code, :body, :headers) { def to_s; self.body; end } class MemoryStore < AbstractStore def initialize(options={}) super; @store = {}; self
change struct name to not clash with Rails
maddox_tvdb_party
train
rb
b3ab51f96eac212f3c62980f12d370c9d03eba27
diff --git a/bcbio/distributed/ipythontasks.py b/bcbio/distributed/ipythontasks.py index <HASH>..<HASH> 100644 --- a/bcbio/distributed/ipythontasks.py +++ b/bcbio/distributed/ipythontasks.py @@ -56,7 +56,7 @@ def process_alignment(*args): process_alignment.metadata = {"resources": ["star", "novoalign", "bwa", "bowtie2", "tophat2"], "ensure": {"tophat2": tophat.job_requirements, - "star": star.job.requirements}} + "star": star.job_requirements}} @require(alignprep) def prep_align_inputs(*args):
Typo in job requirements for ipython parallel star alignment
bcbio_bcbio-nextgen
train
py
76e621fcbfddb9d428f947985c6e235dcb328885
diff --git a/lib/monetize.rb b/lib/monetize.rb index <HASH>..<HASH> 100644 --- a/lib/monetize.rb +++ b/lib/monetize.rb @@ -66,6 +66,8 @@ module Monetize end def extract_cents(input, currency = Money.default_currency) + warn '[DEPRECATION] Monetize.extract_cents is deprecated. Use Monetize.parse().cents' + Monetize::Parser.new(input).parse_cents(currency) end end diff --git a/spec/monetize_spec.rb b/spec/monetize_spec.rb index <HASH>..<HASH> 100644 --- a/spec/monetize_spec.rb +++ b/spec/monetize_spec.rb @@ -520,6 +520,20 @@ describe Monetize do end describe '.extract_cents' do + it 'is deprecated' do + allow(Monetize).to receive(:warn) + + Monetize.extract_cents('100') + + expect(Monetize) + .to have_received(:warn) + .with('[DEPRECATION] Monetize.extract_cents is deprecated. Use Monetize.parse().cents') + end + + it 'extracts cents from a given string' do + expect(Monetize.extract_cents('10.99')).to eq(1099) + end + it "correctly treats pipe marks '|' in input (regression test)" do expect(Monetize.extract_cents('100|0')).to eq Monetize.extract_cents('100!0') end
Deprecate Monetize.extract_cents This method is not documented and untested. The same effect can be achieved by calling .cents on the result of Monetize.parse.
RubyMoney_monetize
train
rb,rb
8560d6453357e7048834b3fec931dd5ac5f6d9b0
diff --git a/install/scripts/portableSharedLibraries/OAT/mediaPlayer.js b/install/scripts/portableSharedLibraries/OAT/mediaPlayer.js index <HASH>..<HASH> 100644 --- a/install/scripts/portableSharedLibraries/OAT/mediaPlayer.js +++ b/install/scripts/portableSharedLibraries/OAT/mediaPlayer.js @@ -94,7 +94,13 @@ define([ * xxxx xxxx xxxx */ return { + getMediaElement: function getMediaElement() { + return mediaElement; + }, + render: function render() { + var self = this; + return new Promise(function(resolve) { //intialize the player if not yet done @@ -111,7 +117,7 @@ define([ autoStart: autostart && canBePlayed(timesPlayed, maxPlays), loop: loop, renderTo: $container, - _debugMode: true + _debugMode: false }) .on('render', function() { resize(mediaElement, $container, width); @@ -130,17 +136,16 @@ define([ $container.trigger('playerready'); }) .on('ended', function() { - timesPlayed++; + timesPlayed++; // todo: use mediaElement getTimesPlayed? if (!canBePlayed(timesPlayed, maxPlays) ) { this.disable(); } }); + self.element = mediaElement; } }; - - // todo: find what to do with this /** if(_.size(media.attributes) === 0){
expose the mediaElement object in the mediaplayer shared library
oat-sa_extension-tao-itemqti
train
js
952e1d4d5ba61b2537bfa3859964cceafa90ee73
diff --git a/autorelease/release_notes.py b/autorelease/release_notes.py index <HASH>..<HASH> 100644 --- a/autorelease/release_notes.py +++ b/autorelease/release_notes.py @@ -117,10 +117,12 @@ class ReleaseNoteWriter(GitHubRepoBase): title = pull['title'] number = str(pull['number']) author = pull['user']['login'] - out_str = "* " + title + " (#" + number + ")" + out_str = "* " + title + " (#" + number if author not in self.config['standard_contributors']: out_str += " @" + author + out_str += ")" for label in extra_labels: + label = label.replace(' ', '_') out_str += " #" + label out_str += "\n" return out_str
Minor improvements to release notes formatting * External contributor name now inside parens: (#XXX) @~~~~~ ==> (#XXX @~~~~~) * Multiword hashtags now underscore-separateed: #my tag name ==> #my_tag_name
dwhswenson_autorelease
train
py
4c593d8b78c86d7dfdcd7040faccde584668c746
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -367,7 +367,7 @@ define(function(require, exports, module) { "('", node.value.partial.trim(), "', { render: function(_data) {", "data = _data || data;", "return ", this.process(node.nodes), ";", - "}, data: data}),", + "}, data: data, _filters: {}, _partials: {} }),", // Invoke the parent template with the passed data. "partials['", node.value.template.trim(), "'].render(data)", ")"
Fixes bug with registerPartial inside of extend Before, compiling extend partials would not pass a valid Combyne object, they were missing `_filters` and `_partials`.
tbranyen_combyne
train
js
bc630428f4d326264fbed2f3f8111cd273ab6251
diff --git a/salt/modules/mdadm.py b/salt/modules/mdadm.py index <HASH>..<HASH> 100644 --- a/salt/modules/mdadm.py +++ b/salt/modules/mdadm.py @@ -2,8 +2,11 @@ Salt module to manage RAID arrays with mdadm ''' +import os import logging +import salt.utils + # Set up logger log = logging.getLogger(__name__) @@ -13,7 +16,11 @@ def __virtual__(): ''' mdadm provides raid functions for Linux ''' - return 'raid' if __grains__['kernel'] == 'Linux' else False + if __grains__['kernel'] == 'Linux': + return False + if not salt.utils.which('mdadm'): + return False + return 'raid' def list(): @@ -49,6 +56,11 @@ def detail(device='/dev/md0'): ''' ret = {} ret['members'] = {} + + # Lets make sure the device exists before running mdadm + if not os.path.exists(device): + raise CommandExecutionError("Device {0} doesn't exist!") + cmd = 'mdadm --detail {0}'.format(device) for line in __salt__['cmd.run_stdout'](cmd).splitlines(): if line.startswith(device):
salt.module.mdadm: a few sanity checks - Test for mdadm in __virtual__() - Make sure the device ie: /dev/md0 exists before running mdadm on it. It is easier to blow up before executing a command
saltstack_salt
train
py
a51cc04ca6fca6102954e61c25c9582b807e6d8b
diff --git a/Query/Processors/PostgresProcessor.php b/Query/Processors/PostgresProcessor.php index <HASH>..<HASH> 100755 --- a/Query/Processors/PostgresProcessor.php +++ b/Query/Processors/PostgresProcessor.php @@ -17,14 +17,12 @@ class PostgresProcessor extends Processor */ public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) { - $results = $query->getConnection()->selectFromWriteConnection($sql, $values); + $result = $query->getConnection()->selectFromWriteConnection($sql, $values)[0]; $sequence = $sequence ?: 'id'; - $result = (array) $results[0]; - - $id = $result[$sequence]; - + $id = is_object($result) ? $result->$sequence : $result[$sequence]; + return is_numeric($id) ? (int) $id : $id; }
Database\PostgresProcessor::processInserGettId | array cast fails to get "sequence" from entity when fetch mode is set to PDO::FETCH_CLASS (#<I>)
illuminate_database
train
php
87ae15bd2fed97ec74b494c512e0b6b9d4996171
diff --git a/ox_modules/module-mob/commands/execute.js b/ox_modules/module-mob/commands/execute.js index <HASH>..<HASH> 100644 --- a/ox_modules/module-mob/commands/execute.js +++ b/ox_modules/module-mob/commands/execute.js @@ -9,10 +9,12 @@ /** * @function execute - * @summary Executes a JavaScript code inside the HTML page. + * @summary Executes JavaScript code inside HTML page. * @param {String} js - Script to execute. - * @for android, ios. web/hybrid + * @param {...Object} arg - Optional script arguments. + * @for hybrid, web */ -module.exports = function(js, elm) { - return _this._driver.execute(js, elm); +module.exports = function(js) { + var args = Array.prototype.splice.call(arguments, 0); + return _this._driver.execute.apply(null, args); };
Fix mob.execute to accept variable number of arguments
oxygenhq_oxygen
train
js
4cb5f889bf3e8c496e7975798d636a510e5738d6
diff --git a/test_dj_database_url.py b/test_dj_database_url.py index <HASH>..<HASH> 100644 --- a/test_dj_database_url.py +++ b/test_dj_database_url.py @@ -65,14 +65,14 @@ class DatabaseTestSuite(unittest.TestCase): def test_empty_sqlite_url(self): url = 'sqlite://' - dj_database_url.parse(url) + url = dj_database_url.parse(url) assert url['ENGINE'] == 'django.db.backends.sqlite3' assert url['NAME'] == ':memory:' def test_memory_sqlite_url(self): url = 'sqlite://:memory:' - dj_database_url.parse(url) + url = dj_database_url.parse(url) assert url['ENGINE'] == 'django.db.backends.sqlite3' assert url['NAME'] == ':memory:'
Fixing test to actually use the result of the parse
kennethreitz_dj-database-url
train
py
6ca07507757e9d35b719625c977e866da694032b
diff --git a/chef/lib/windows/pipe_server.rb b/chef/lib/windows/pipe_server.rb index <HASH>..<HASH> 100644 --- a/chef/lib/windows/pipe_server.rb +++ b/chef/lib/windows/pipe_server.rb @@ -90,9 +90,10 @@ module RightScale # Forces detachment of the handler on EM's next tick. def force_detach - # Use next tick to prevent issue in EM where descriptors list - # gets out-of-sync when calling detach in an unbind callback - EM.next_tick { detach unless @unbound } + # No need to use next tick to prevent issue in EM where + # descriptors list gets out-of-sync when calling detach + # in an unbind callback + detach unless @unbound end protected
Refs #<I> - No need to use next tick when detaching
rightscale_right_link
train
rb
8c6cc9e51b58ca8e8cc32d3d3f49177a9fb20af6
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -17527,13 +17527,14 @@ ); if ( ! $this->is_api_result_object( $result, 'installs' ) ) { - if ( ! is_object( $bundle_license ) ) { + if ( is_object( $bundle_license ) ) { /** * When a license object is provided, it's an attempt by the SDK to activate a bundle license and not a user-initiated action, therefore, do not show any admin notice to avoid confusion (e.g.: the notice will show up just above the opt-in link). If the license activation fails, the admin will see an opt-in link instead. * * @author Leo Fajardo (@leorw) - * @since 2.4.0 + * @since 2.4.0 */ + } else { $error_message = FS_Api::is_api_error_object( $result ) ? $result->error->message : $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' );
[bundle-license-activation] The documentation was misleading since it was explaining the opposite case. Therefore, created an empty opposite `if` statement and positioned the comment in it.
Freemius_wordpress-sdk
train
php
5f91f8829dffd9c433dfbfc8a360f2d0ebe17e79
diff --git a/src/org/jgroups/blocks/cs/NioConnection.java b/src/org/jgroups/blocks/cs/NioConnection.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/blocks/cs/NioConnection.java +++ b/src/org/jgroups/blocks/cs/NioConnection.java @@ -395,7 +395,11 @@ public class NioConnection extends Connection { protected static ByteBuffer makeLengthBuffer(ByteBuffer buf) { - return (ByteBuffer)ByteBuffer.allocate(Global.INT_SIZE).putInt(buf.remaining()).clear(); + ByteBuffer buffer = ByteBuffer.allocate(Global.INT_SIZE).putInt(buf.remaining()); + // Workaround for JDK8 compatibility + // clear() returns java.nio.Buffer in JDK8, but java.nio.ByteBuffer since JDK9. + ((java.nio.Buffer) buffer).clear(); + return buffer; } protected enum State {reading, waiting_to_terminate, done}
JGRP-<I> Fix JDK8 compability with uses of ByteBuffer.clear().
belaban_JGroups
train
java
63e6bf1874cdc2f072d900e17ced01a543199c3f
diff --git a/lib/remocon/command/pull_command.rb b/lib/remocon/command/pull_command.rb index <HASH>..<HASH> 100644 --- a/lib/remocon/command/pull_command.rb +++ b/lib/remocon/command/pull_command.rb @@ -123,10 +123,8 @@ module Remocon end end - removed = {} - - removed_keys.each do |k| - removed[k] = Remocon::ParameterFileDumper.new({ k => left[k] }).dump + removed = removed_keys.each_with_object({}) do |k, acc| + acc.merge!(Remocon::ParameterFileDumper.new({ k => left[k] }).dump) end [unchanged, added, changed, removed]
Fixed a spec of removed params
jmatsu_remocon
train
rb
870accc0fd53b758ee9de6a13b3dd589481a9729
diff --git a/loggredile/loggredile.go b/loggredile/loggredile.go index <HASH>..<HASH> 100644 --- a/loggredile/loggredile.go +++ b/loggredile/loggredile.go @@ -83,7 +83,6 @@ func streamMessages(addr string, path string, outMessages, errMessages chan<- *l go func() { for { _, data, err := ws.ReadMessage() - if err != nil { close(outMessages) close(errMessages) @@ -102,23 +101,5 @@ func streamMessages(addr string, path string, outMessages, errMessages chan<- *l } }() - go func() { - for { - err := ws.WriteMessage(websocket.BinaryMessage, []byte{42}) - if err != nil { - break - } - - select { - case <-stop: - ws.Close() - return - - case <-time.After(1 * time.Second): - // keep-alive - } - } - }() - return stop }
stop sending keepalives to loggregator this appears to be done via websocket ping/pongs instead, which gorilla/websocket automatically does for us
cloudfoundry_inigo
train
go
21296a797c53ce8a855978d4cbdacf6950623a0a
diff --git a/buildbot/status/web/build.py b/buildbot/status/web/build.py index <HASH>..<HASH> 100644 --- a/buildbot/status/web/build.py +++ b/buildbot/status/web/build.py @@ -170,7 +170,7 @@ class StatusResourceBuild(HtmlResource): name = req.args.get("username", ["<unknown>"])[0] comments = req.args.get("comments", ["<no reason specified>"])[0] reason = ("The web-page 'rebuild' button was pressed by " - "'%s': %s\n" % (html.escape(name), html.escape(comments))) + "'%s': %s\n" % (name, comments)) extraProperties = getAndCheckProperties(req) if not bc or not b.isFinished() or extraProperties is None: log.msg("could not rebuild: bc=%s, isFinished=%s"
remove overzealous escaping of reason in rebuild() I'd like a second look at this, since these escapes were added while resolving the XSS vulnerabilities back in <I>.*. I think they are unnecessary, particularly with the use of Jinja. I suspect they were added out of an abundance of caution, lest the reason later be used unescaped in a status display.
buildbot_buildbot
train
py
700d8d3aa8ab1b921db6e0c83d5d2da945d03c26
diff --git a/daemon_config_linux_test.go b/daemon_config_linux_test.go index <HASH>..<HASH> 100644 --- a/daemon_config_linux_test.go +++ b/daemon_config_linux_test.go @@ -159,10 +159,6 @@ func TestDaemonRuntimeRoot(t *testing.T) { t.Fatal(err) } - if err = task.Start(ctx); err != nil { - t.Fatal(err) - } - stateJSONPath := filepath.Join(runtimeRoot, testNamespace, id, "state.json") if _, err = os.Stat(stateJSONPath); err != nil { t.Errorf("error while getting stat for %s: %v", stateJSONPath, err)
Don't start top container in test
containerd_containerd
train
go
e38cd1be718a207125e8116667d3e2675258d2b9
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java index <HASH>..<HASH> 100755 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherTest.java @@ -99,6 +99,7 @@ import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -441,8 +442,8 @@ public class DispatcherTest extends AbstractDispatcherTest { assertThat( cancelFuture, - FlinkMatchers.futureFailedWith( - FlinkJobTerminatedWithoutCancellationException.class)); + FlinkMatchers.futureWillCompleteExceptionally( + FlinkJobTerminatedWithoutCancellationException.class, Duration.ofHours(8))); } @Test
[FLINK-<I>][tests] Wait for cancellation future to complete
apache_flink
train
java
bfda593c9cea57dfde3ce2855d9d7e9923d94e0e
diff --git a/Tests/Package/Repositories/StatusesTest.php b/Tests/Package/Repositories/StatusesTest.php index <HASH>..<HASH> 100755 --- a/Tests/Package/Repositories/StatusesTest.php +++ b/Tests/Package/Repositories/StatusesTest.php @@ -86,7 +86,8 @@ class StatusesTest extends \PHPUnit_Framework_TestCase array( 'state' => 'success', 'target_url' => 'http://example.com/my_url', - 'description' => 'Success is the only option - failure is not.' + 'description' => 'Success is the only option - failure is not.', + 'context' => 'Joomla/Test' ) ); @@ -102,7 +103,8 @@ class StatusesTest extends \PHPUnit_Framework_TestCase '6dcb09b5b57875f334f61aebed695e2e4193db5e', 'success', 'http://example.com/my_url', - 'Success is the only option - failure is not.' + 'Success is the only option - failure is not.', + 'Joomla/Test' ), $this->equalTo(json_decode($this->sampleString)) );
Add unit tests Repositories/Statuses::create()
joomla-framework_github-api
train
php
7bad2c4c2c80764fe30ccdc73a0eb9f1adcb8ba9
diff --git a/salt/cloud/clouds/gce.py b/salt/cloud/clouds/gce.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/gce.py +++ b/salt/cloud/clouds/gce.py @@ -2256,8 +2256,8 @@ def request_instance(vm_): 'ex_service_accounts', vm_, __opts__, default=None), 'ex_can_ip_forward': config.get_cloud_config_value( 'ip_forwarding', vm_, __opts__, default=False), - 'ex_preemptible': config.get_cloud_config_value( - 'preemptible', vm_, __opts__, default=False + 'ex_preemptible': config.get_cloud_config_value( + 'preemptible', vm_, __opts__, default=False ) }) if kwargs.get('ex_disk_type') not in ('pd-standard', 'pd-ssd'):
[develop] Lint fix for gce.py (#<I>)
saltstack_salt
train
py
b6e0fa8bd271925baa94266a391385ca7d30a31e
diff --git a/lib/templates.js b/lib/templates.js index <HASH>..<HASH> 100644 --- a/lib/templates.js +++ b/lib/templates.js @@ -62,7 +62,7 @@ if (!templates.cache[tpl]) { fs.readFile(filename, function(err, html) { - templates.cache[tpl] = html.toString(); + templates.cache[tpl] = (html || '').toString(); return fn(err, templates.parse(templates.cache[tpl], options)); }); } else {
don't crash express if template doesn't exist
benchpressjs_benchpressjs
train
js
5a520ddedb2a257b839c66c383afd12a3b62d16b
diff --git a/benchexec/tools/aprove.py b/benchexec/tools/aprove.py index <HASH>..<HASH> 100644 --- a/benchexec/tools/aprove.py +++ b/benchexec/tools/aprove.py @@ -60,7 +60,8 @@ class Tool(benchexec.tools.template.BaseTool): logging.warning('Unable to determine AProVE version: {0}'.format(e.strerror)) return '' - version_aprove_match = re.compile(r'^# AProVE Commit ID: (.*)', re.MULTILINE).search(util.decode_to_string(stdout)) + version_aprove_match = re.search( + r'^# AProVE Commit ID: (.*)', util.decode_to_string(stdout), re.MULTILINE) if not version_aprove_match: logging.warning('Unable to determine AProVE version: {0}'.format(util.decode_to_string(stdout))) return ''
Simplify regexp handling Compilation for immediate usage is useless.
sosy-lab_benchexec
train
py
1c4ce2f4d7e8a8fb93a2599206ba8f5b778d6638
diff --git a/presto-main/src/main/java/com/facebook/presto/server/PluginManager.java b/presto-main/src/main/java/com/facebook/presto/server/PluginManager.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/server/PluginManager.java +++ b/presto-main/src/main/java/com/facebook/presto/server/PluginManager.java @@ -226,7 +226,6 @@ public class PluginManager log.debug("Classpath for %s:", pomFile); List<URL> urls = new ArrayList<>(); - urls.add(new File(pomFile.getParentFile(), "target/classes/").toURI().toURL()); for (Artifact artifact : sortedArtifacts(artifacts)) { if (artifact.getFile() != null) { log.debug(" %s", artifact.getFile());
Remove redundant classes directory for plugins The target/classes directory is already included in the resolved classpath returned by the artifact resolver.
prestodb_presto
train
java
0ae859ea2237729166c56daa8a1d91fee2ba70cf
diff --git a/src/MercadoPago/Entities/Flavor1/Preapproval.php b/src/MercadoPago/Entities/Flavor1/Preapproval.php index <HASH>..<HASH> 100644 --- a/src/MercadoPago/Entities/Flavor1/Preapproval.php +++ b/src/MercadoPago/Entities/Flavor1/Preapproval.php @@ -10,6 +10,7 @@ use MercadoPago\Annotation\Attribute; * @RestMethod(resource="/v1/preapproval/search", method="search") * @RestMethod(resource="/v1/customers/", method="create") * @RestMethod(resource="/v1/preapproval/:id", method="update") + * @RequestParam(param="access_token") */ class Preapproval extends Entity
Access token auth for preapproval
mercadopago_sdk-php
train
php
5c3cb1a2ca3fa26d62c7efc5cbb454ec38fe102b
diff --git a/odl/discr/discretization.py b/odl/discr/discretization.py index <HASH>..<HASH> 100644 --- a/odl/discr/discretization.py +++ b/odl/discr/discretization.py @@ -234,7 +234,8 @@ class RawDiscretizationVector(NtuplesBaseVector): def __init__(self, space, ntuple): """Initialize a new instance.""" assert isinstance(space, RawDiscretization) - assert isinstance(ntuple, space.dspace.element_type) + assert ntuple in space.dspace + super().__init__(space) self._ntuple = ntuple
ENH: improve assert in RawDiscretizationVector
odlgroup_odl
train
py
dc7a719b676602d1921d99756139916fe9caea7f
diff --git a/Globals.php b/Globals.php index <HASH>..<HASH> 100644 --- a/Globals.php +++ b/Globals.php @@ -1,6 +1,8 @@ <?php namespace Coercive\Utility\Globals; +use Exception; + /** * Globals * PHP Version 7 @@ -77,7 +79,17 @@ class Globals { if(is_null($mItem)) { return null; } # WHAT ELSE - if(is_object($mItem) || is_resource($mItem) || is_callable($mItem)) { + if(is_object($mItem) || is_resource($mItem)) { + return $mItem; + } + + # If a class already called : crash + try { + if(@is_callable($mItem)) { + return $mItem; + } + } + catch(Exception $oException) { return $mItem; }
is_callable can crash if a class already called
Coercive_Globals
train
php
9ecab059dd4c5b9f0492984a39eed6c94bd33606
diff --git a/lib/cucumber_analytics/version.rb b/lib/cucumber_analytics/version.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber_analytics/version.rb +++ b/lib/cucumber_analytics/version.rb @@ -1,3 +1,3 @@ module CucumberAnalytics - VERSION = '1.2.0' + VERSION = '1.3.0' end
Version bump Gem version bumped for <I> release.
enkessler_cucumber_analytics
train
rb
4e4f15b98f80da060a28d4fce8557228de09c30c
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -209,20 +209,10 @@ class Updater extends \common_ext_ExtensionUpdater $serviceManager = $this->getServiceManager(); $fsService = $serviceManager->get(FileSystemService::SERVICE_ID); - if ($fsService instanceof FileSystemService) { - $adapters = $fsService->getOption('adapters'); - $adapterUri = 'http://tao.local/mytao.rdf#i145813022277374'; - if (in_array($adapterUri, array_keys($adapters))) { - if (isset($adapters[$adapterUri]['options']) && isset($adapters[$adapterUri]['options']['root'])) { - $rootPath = $adapters[$adapterUri]['options']['root']; - $itemUpdater = new ItemUpdateInlineFeedback($rootPath); - $itemUpdater->update(true); - } - } - } - - - + $fs = \taoItems_models_classes_ItemsService::singleton()->getDefaultFileSource(); + $itemUpdater = new ItemUpdateInlineFeedback($fs->getPath()); + $itemUpdater->update(true); + $this->setVersion('2.14.0'); }
fix updater by adding file source path
oat-sa_extension-tao-itemqti
train
php
0dc533058cdf56d418c96a0a0f9817e5ac678a81
diff --git a/src/main/java/com/offbytwo/jenkins/JenkinsServer.java b/src/main/java/com/offbytwo/jenkins/JenkinsServer.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/offbytwo/jenkins/JenkinsServer.java +++ b/src/main/java/com/offbytwo/jenkins/JenkinsServer.java @@ -288,6 +288,12 @@ public class JenkinsServer { client.post("/job/" + encode(jobName) + "/doDelete"); } + /** + * Delete a job from Jenkins. + * @param jobName The name of the job to be deleted. + * @param crumbFlag The crumFlag. + * @throws IOException In case of an failure. + */ public void deleteJob(String jobName, boolean crumbFlag) throws IOException { client.post("/job/" + encode(jobName) + "/doDelete", crumbFlag); }
Added JavaDoc for deleteJob method.
jenkinsci_java-client-api
train
java
77c35e7bdeb3e6900460f943cb4cb8f7c1558ee0
diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index <HASH>..<HASH> 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -928,6 +928,8 @@ class LeftAndMain extends Controller implements PermissionProvider { $data = array(); $ids = explode(',', $request->getVar('ids')); foreach($ids as $id) { + if($id === "") continue; // $id may be a blank string, which is invalid and should be skipped over + $record = $this->getRecord($id); $recordController = ($this->stat('tree_class') == 'SiteTree') ? singleton('CMSPageEditController')
BUGFIX: Remove possibility of E_NOTICE in updatetreenodes().
silverstripe_silverstripe-framework
train
php
d72adfa5dec8f9263083a149bfd7ffbce614fa19
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( long_description=long_description, packages=find_packages('.'), install_requires = [ - 'prompt_toolkit==0.50', + 'prompt_toolkit==0.51', 'jedi>=0.9.0', 'docopt', ],
Upgrade to prompt_toolkit <I>.
prompt-toolkit_ptpython
train
py
8c0d7fe440a9afb75f1553f8963e2e481efd83b4
diff --git a/skew/backends/redis_backend.py b/skew/backends/redis_backend.py index <HASH>..<HASH> 100644 --- a/skew/backends/redis_backend.py +++ b/skew/backends/redis_backend.py @@ -54,7 +54,7 @@ class RedisBlockingQueue(RedisQueue): return None -class RedisDataStore(BaseResultStore): +class RedisDataStore(BaseDataStore): def __init__(self, name, **connection): """ RESULT_STORE_CONNECTION = {
Fixing a bad line in the redis backend
coleifer_huey
train
py
39d2e094d61ce848670850ab477acc601c37f067
diff --git a/platform/android/library/src/in/uncod/android/bypass/Bypass.java b/platform/android/library/src/in/uncod/android/bypass/Bypass.java index <HASH>..<HASH> 100644 --- a/platform/android/library/src/in/uncod/android/bypass/Bypass.java +++ b/platform/android/library/src/in/uncod/android/bypass/Bypass.java @@ -47,7 +47,8 @@ public class Bypass { SpannableStringBuilder builder = new SpannableStringBuilder(); String text = element.getText(); if (element.size() == 0 - && element.getParent().getType() != Type.BLOCK_CODE) { + && element.getParent() != null + && element.getParent().getType() != Type.BLOCK_CODE) { text = text.replace('\n', ' '); } if (element.getParent() != null
Check for null parent in recureElement The check is done elsewhere in this method, it should be done here as well
Uncodin_bypass
train
java
a7e83ec8d6a09e1c560b3375ca672c73f6c7a01e
diff --git a/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java b/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java +++ b/core/src/main/java/hudson/node_monitors/ResponseTimeMonitor.java @@ -113,7 +113,7 @@ public class ResponseTimeMonitor extends NodeMonitor { private static final class Step2 implements Callable<Step3,IOException> { private final Data cur; - private final long start = System.nanoTime(); + private final long start = System.currentTimeMillis(); public Step2(Data cur) { this.cur = cur; @@ -137,8 +137,8 @@ public class ResponseTimeMonitor extends NodeMonitor { } private Object readResolve() { - long end = System.nanoTime(); - return new Data(cur,TimeUnit2.NANOSECONDS.toMillis(end-start)); + long end = System.currentTimeMillis(); + return new Data(cur,(end-start)); } private static final long serialVersionUID = 1L;
Use System.currentTimeMillis() instead of System.nanoTime() to protect against incorrect values if times are ever compared between different JVM nodes
jenkinsci_jenkins
train
java
008c42263bd846e2fa401d784b7b3f43382b8829
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ requirements = ( setup( name='combine', - version='0.0.26', + version='0.0.27.dev0', description='A helpful, simple static site generator.', long_description=long_description, long_description_content_type='text/markdown',
Back to development: <I>
dropseed_combine
train
py
5bd4050a73cb36faf4fbcb79db86aaf3ae3f327a
diff --git a/cheroot/cli.py b/cheroot/cli.py index <HASH>..<HASH> 100644 --- a/cheroot/cli.py +++ b/cheroot/cli.py @@ -179,9 +179,8 @@ def main(): help='Timeout in seconds for putting requests into queue') raw_args = parser.parse_args() - # ensure current directory is at front of sys.path - if '' not in sys.path: - sys.path.insert(0, '') + # ensure cwd in sys.path + '' in sys.path or sys.path.insert(0, '') # validate arguments server_args = {}
One liner for ensuring cwd in sys.path
cherrypy_cheroot
train
py
b19d787f8fb14dc85edb7f70d5ebc5c18fec6a76
diff --git a/lib/setupHttpRoutes.js b/lib/setupHttpRoutes.js index <HASH>..<HASH> 100644 --- a/lib/setupHttpRoutes.js +++ b/lib/setupHttpRoutes.js @@ -52,7 +52,7 @@ function setupHttpRoutes(server, skynet){ // curl http://localhost:3000/status server.get('/status', function(req, res){ console.log('STATUS', req); - skynet.sendActivity(getActivity('',req)); + skynet.sendActivity(getActivity('status',req)); res.setHeader('Access-Control-Allow-Origin','*'); getSystemStatus(function(data){ console.log(data); @@ -471,7 +471,7 @@ function setupHttpRoutes(server, skynet){ }); server.get('/', function(req, res, next) { - skynet.sendActivity(getActivity('',req)); + skynet.sendActivity(getActivity('website',req)); file.serveFile('/index.html', 200, {}, req, res); });
add activity topics for more rest endpoints
octoblu_meshblu
train
js
f31c51f7eea2200d84f8d1ff4d93461406d9c4db
diff --git a/djstripe/__init__.py b/djstripe/__init__.py index <HASH>..<HASH> 100644 --- a/djstripe/__init__.py +++ b/djstripe/__init__.py @@ -7,7 +7,7 @@ __title__ = "dj-stripe" __summary__ = "Django + Stripe Made Easy" __uri__ = "https://github.com/pydanny/dj-stripe/" -__version__ = "0.7.0" +__version__ = "0.8.0" __author__ = "Daniel Greenfeld" __email__ = "[email protected]"
gearing up for <I>
dj-stripe_dj-stripe
train
py
09f10cbc018ec5e83f49303950f9e4270bc0c0de
diff --git a/core/src/main/java/lucee/commons/lang/ClassUtil.java b/core/src/main/java/lucee/commons/lang/ClassUtil.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/lucee/commons/lang/ClassUtil.java +++ b/core/src/main/java/lucee/commons/lang/ClassUtil.java @@ -69,7 +69,10 @@ public final class ClassUtil { lcClassName=lcClassName.substring(10); isRef=true; } - + + if(lcClassName.equals("void") || className.equals("[V")) { + return void.class; + } if(lcClassName.equals("boolean") || className.equals("[Z")) { if(isRef) return Boolean.class; return boolean.class;
add support for "void" as class definition
lucee_Lucee
train
java
503ec12dd8855265c3bca6eacedee65d54af3f50
diff --git a/code/Subsite.php b/code/Subsite.php index <HASH>..<HASH> 100644 --- a/code/Subsite.php +++ b/code/Subsite.php @@ -205,7 +205,7 @@ JS; * @param boolean $cache * @return int ID of the current subsite instance */ - static function currentSubsiteID($cache = true) { + static function currentSubsiteID() { if(isset($_REQUEST['SubsiteID'])) { $id = (int)$_REQUEST['SubsiteID']; } else { @@ -213,7 +213,7 @@ JS; } if(!isset($id) || $id === NULL) { - $id = self::getSubsiteIDForDomain($cache); + $id = self::getSubsiteIDForDomain(); Session::set('SubsiteID', $id); }
BUGFIX: Removed obsolete cache argument from currentSubsiteID() (from r<I>)
silverstripe_silverstripe-subsites
train
php