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
d2ffe122fff415689a3056480a6955034fd76632
diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -0,0 +1,31 @@ +<?php + +namespace Ageras\LaravelOneSky; + +use Illuminate\Support\ServiceProvider as IlluminateServiceProvider; + +class ServiceProvider extends IlluminateServiceProvider +{ + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->registerCommands(); + } + + public function registerCommands() + { + $this->app->bindIf('command.onesky', function () { + return new Commands\OneSky(); + }); + $this->app->bindIf('command.onesky.pull', function () { + return new Commands\Pull(); + }); + $this->app->bindIf('command.onesky.push', function () { + return new Commands\Push(); + }); + } +}
Registering the artisan commands in the service provider
ageras-com_laravel-onesky
train
php
20934d5d932ec8faff48ab262d8897385872f6d8
diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java index <HASH>..<HASH> 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java @@ -46,10 +46,10 @@ public class TargetTableLayout extends AbstractTableLayout { final TagManagement tagManagement) { this.eventBus = eventBus; this.targetDetails = new TargetDetails(i18n, eventbus, permissionChecker, managementUIState, uinotification, - tagManagement, targetManagement, entityFactory); + tagManagement, targetManagement, entityFactory, targetTable); this.targetTableHeader = new TargetTableHeader(i18n, permissionChecker, eventBus, notification, managementUIState, managementViewAcceptCriteria, targetManagement, deploymentManagement, uiproperties, - eventbus, entityFactory, uinotification, tagManagement); + eventbus, entityFactory, uinotification, tagManagement, targetTable); super.init(targetTableHeader, targetTable, targetDetails); }
Removed usage of spring context helper
eclipse_hawkbit
train
java
1d98d441b803bd279b1f1842a667850f91fdaa56
diff --git a/modules/saml2debug/www/debug.php b/modules/saml2debug/www/debug.php index <HASH>..<HASH> 100644 --- a/modules/saml2debug/www/debug.php +++ b/modules/saml2debug/www/debug.php @@ -20,7 +20,7 @@ function getValue($raw) { if (array_key_exists('LogoutRequest', $arr)) return $arr['LogoutRequest']; if (array_key_exists('LogoutResponse', $arr)) return $arr['LogoutResponse']; - return urldecode(stripslashes($val)); + return rawurldecode(stripslashes($val)); } function decode($raw) { @@ -41,7 +41,7 @@ function encode($message) { if ($_REQUEST['binding'] === 'redirect') { return urlencode(base64_encode(gzdeflate(stripslashes($message)))); } else { - return urlencode(base64_encode(stripslashes($message))); + return base64_encode(stripslashes($message)); } }
saml2debug: Don't treat '+' as urlencoded space. A '+' in the SAMLRequest/Response is more likely to belong to the base<I>-encoding than to represent a space.
simplesamlphp_saml2
train
php
645971db1d8ec1015ff170635023c7b677a598c6
diff --git a/client/state/index.js b/client/state/index.js index <HASH>..<HASH> 100644 --- a/client/state/index.js +++ b/client/state/index.js @@ -30,9 +30,6 @@ import support from './support/reducer'; import themes from './themes/reducer'; import ui from './ui/reducer'; import users from './users/reducer'; -import comments from './comments/reducer'; -import googleAppsUsers from './google-apps-users/reducer'; -import reader from './reader/reducer'; import componentsUsageStats from './components-usage-stats/reducer'; /** @@ -62,9 +59,6 @@ export const reducer = combineReducers( { themes, ui, users, - comments, - googleAppsUsers, - reader, componentsUsageStats } );
Remove duplicate imports in client/state/index.js after bad merge
Automattic_wp-calypso
train
js
67873552b0687d90884d278c8b1663a465c04d4b
diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index <HASH>..<HASH> 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -35,11 +35,12 @@ def get_random_string(length=50): The default length of 12 with the a-z, A-Z, 0-9 character set returns a 71-bit value. log_2((26+26+10)^12) =~ 71 bits """ + punctuation = string.punctuation.replace('"', '').replace("'", '') if using_sysrandom: return ''.join(random.choice( - string.digits + string.ascii_letters + string.punctuation + string.digits + string.ascii_letters + punctuation ) for i in range(length)) - + print( "Cookiecutter Django couldn't find a secure pseudo-random number generator on your system." " Please change change your SECRET_KEY variables in conf/settings/local.py and env.example"
Removed single and double quotes from punctuation used in random key
pydanny_cookiecutter-django
train
py
f26e2b93a1ee67f7cfbcaf8ae90496c83e3e746e
diff --git a/src/actions/hits.js b/src/actions/hits.js index <HASH>..<HASH> 100644 --- a/src/actions/hits.js +++ b/src/actions/hits.js @@ -1,5 +1,6 @@ import { UPDATE_HITS, UPDATE_AGGS, UPDATE_COMPOSITE_AGGS } from '../constants'; import { SET_QUERY_TO_HITS } from '../../lib/constants'; +import { setError } from './misc'; export function updateAggs(component, aggregations, append = false) { return { @@ -42,6 +43,9 @@ export function saveQueryToHits(component, query) { export function mockDataForTesting(component, data) { return (dispatch) => { + if (data.error) { + dispatch(setError(component, data.error)); + } if (data.hasOwnProperty('aggregations')) { // set aggs dispatch(updateAggs(component, data.aggregations));
feat: add support for errors in mocking
appbaseio_reactivecore
train
js
e82d819f034616c856d41daba0e395934b34337c
diff --git a/salt/states/smartos.py b/salt/states/smartos.py index <HASH>..<HASH> 100644 --- a/salt/states/smartos.py +++ b/salt/states/smartos.py @@ -319,7 +319,7 @@ def image_absent(name): ret['result'] = True else: __salt__['imgadm.delete'](name) - ret['result'] = (name not in __salt__['imgadm.list']()) + ret['result'] = name not in __salt__['imgadm.list']() ret['comment'] = 'image {0} deleted'.format(name) ret['changes'][name] = None
drop outer parens, not needed
saltstack_salt
train
py
6b9efc6670c40cf6560a119bdb012d044982366c
diff --git a/bids/utils.py b/bids/utils.py index <HASH>..<HASH> 100644 --- a/bids/utils.py +++ b/bids/utils.py @@ -10,4 +10,12 @@ def matches_entities(obj, entities, strict=False): return False comm_ents = list(set(obj.entities.keys()) & set(entities.keys())) - return all([obj.entities[k] == entities[k] for k in comm_ents]) + for k in comm_ents: + current = obj.entities[k] + target = entities[k] + if isinstance(target, (list, tuple)): + if current not in target: + return False + elif current != target: + return False + return True
match_entities takes lists nwo
bids-standard_pybids
train
py
f60dc56d9120fee041daf553a628bd278bacb03c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -32,5 +32,9 @@ module.exports = function (opts) { }); yield *next; + + if (this.status == 302 && this.session && !(this.session[key])) { + this.session[key] = data; + } }; };
Enables flash messages to propagate across redirects
rickharrison_koa-flash
train
js
fb67beb97bd6b65ab0a7ad15758d03b786deea38
diff --git a/Kwf/Controller/Action/Maintenance/SetupController.php b/Kwf/Controller/Action/Maintenance/SetupController.php index <HASH>..<HASH> 100644 --- a/Kwf/Controller/Action/Maintenance/SetupController.php +++ b/Kwf/Controller/Action/Maintenance/SetupController.php @@ -47,7 +47,6 @@ class Kwf_Controller_Action_Maintenance_SetupController extends Kwf_Controller_A public function jsonCheckRequirementsAction() { - //TODO add progress bar //TODO add "warning" response (+plus additional info output) //TODO check for config.local.ini being writeable and does not yet exist (or is empty) //TODO check for web running in root of domain diff --git a/Kwf_js/Maintenance/SetupRequirements.js b/Kwf_js/Maintenance/SetupRequirements.js index <HASH>..<HASH> 100644 --- a/Kwf_js/Maintenance/SetupRequirements.js +++ b/Kwf_js/Maintenance/SetupRequirements.js @@ -33,7 +33,7 @@ Kwf.Maintenance.SetupRequirements = Ext.extend(Ext.Panel, { refresh: function() { Ext.Ajax.request({ url: '/kwf/maintenance/setup/json-check-requirements', - progress: true, + mask: this.body, success: function(response, options, result) { this.resultTemplate.overwrite(this.body, result); },
don't use progress dialog, that's fast enough
koala-framework_koala-framework
train
php,js
54461e35828c4eb0957ac4675e35345fd3f5c885
diff --git a/lib/components/base.js b/lib/components/base.js index <HASH>..<HASH> 100644 --- a/lib/components/base.js +++ b/lib/components/base.js @@ -106,17 +106,24 @@ export class BaseComponent { var self = this; function merge(into, schemas) { if (into.required || into.properties) { - console.warn('WARN: properties or required field set on the same level as allOf'); + let errMessage = `Can\'t merge allOf: properties or required fields are specified on the same level as allOf + ${into}`; + throw new Error(errMessage); } into.required = []; into.properties = {}; for (let subSchema of schemas) { + + // TODO: add support for merge array schemas if (typeof subSchema !== 'object' || subSchema.type !== 'object') { - console.warn('WARN: incorrect allOf element skipped\nObject: ', subSchema); + let errMessage = `Can\'t merge allOf: only subschemas with type: object can be merged + ${subSchema}`; + throw new Error(errMessage); } self.joinAllOf(subSchema); + // TODO: add check if can be merged correctly (no different properties with the same name) if (subSchema.properties) { Object.assign(into.properties, subSchema.properties); }
Throw errors for incorrect or not-supported allOfs
Rebilly_ReDoc
train
js
872d9364aba016f713174d95c279abefb236b7a6
diff --git a/lib/blockchain.js b/lib/blockchain.js index <HASH>..<HASH> 100644 --- a/lib/blockchain.js +++ b/lib/blockchain.js @@ -24,6 +24,7 @@ startChain = function(env) { } cmd += "--mine "; + cmd += "--maxpeers 0 "; if (config.account.password !== void 0) { cmd += "--password " + config.account.password + " ";
No reason for peers with test This made mine start to mine. (Would not start without it.)
embark-framework_embark
train
js
cc59c20a84a00fb8d5547d0e221bfb6eb6695e46
diff --git a/tests/functional/CreateCept.php b/tests/functional/CreateCept.php index <HASH>..<HASH> 100644 --- a/tests/functional/CreateCept.php +++ b/tests/functional/CreateCept.php @@ -21,6 +21,4 @@ $I->see('Password cannot be blank.'); $page->create('toster', '[email protected]', 'toster'); $I->see('User has been created'); $I->see('toster'); -$I->see('[email protected]'); - -Yii::$app->getUser()->logout(); \ No newline at end of file +$I->see('[email protected]'); \ No newline at end of file diff --git a/tests/functional/UpdateCept.php b/tests/functional/UpdateCept.php index <HASH>..<HASH> 100644 --- a/tests/functional/UpdateCept.php +++ b/tests/functional/UpdateCept.php @@ -14,6 +14,4 @@ $page = UpdatePage::openBy($I, ['id' => 2]); $page->update('new_toster', '[email protected]'); $I->see('User has been updated'); $I->see('new_toster'); -$I->see('[email protected]'); - -Yii::$app->getUser()->logout(); \ No newline at end of file +$I->see('[email protected]'); \ No newline at end of file
little refactoring in create and update cepts
dektrium_yii2-user
train
php,php
0d673763d1954fa24c8ed73d7d942b7e33ef1b12
diff --git a/walk.go b/walk.go index <HASH>..<HASH> 100644 --- a/walk.go +++ b/walk.go @@ -24,7 +24,7 @@ func (c *Client) walk(path string, walkFn filepath.WalkFunc) error { err = walkFn(path, info, err) if err != nil { - if info.IsDir() && err == filepath.SkipDir { + if info != nil && info.IsDir() && err == filepath.SkipDir { return nil }
info may be nil info may be nil caused by network error or other errors
colinmarc_hdfs
train
go
cbecf658230fedd8bb8135e24d3b9c522cbee341
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -245,8 +245,8 @@ on_saltstack = 'SALT_ON_SALTSTACK' in os.environ project = 'Salt' version = salt.version.__version__ -latest_release = '2017.7.0' # latest release -previous_release = '2016.11.6' # latest release from previous branch +latest_release = '2017.7.1' # latest release +previous_release = '2016.11.7' # latest release from previous branch previous_release_dir = '2016.11' # path on web server for previous branch next_release = '' # next release next_release_dir = '' # path on web server for next release branch
[<I>] Bump latest and previous versions
saltstack_salt
train
py
1753900f701888def49e74f646cd74ce753850fa
diff --git a/js/exx.js b/js/exx.js index <HASH>..<HASH> 100644 --- a/js/exx.js +++ b/js/exx.js @@ -407,15 +407,13 @@ module.exports = class exx extends Exchange { // const code = this.safeString (response, 'code'); const message = this.safeString (response, 'message'); - const feedback = this.id + ' ' + this.json (response); + const feedback = this.id + ' ' + body; if (code === '100') { return; } if (code !== undefined) { - const exceptions = this.exceptions; - if (code in exceptions) { - throw new exceptions[code] (feedback); - } else if (code === '308') { + this.throwExactlyMatchedException (this.exceptions, code, feedback); + if (code === '308') { // this is returned by the exchange when there are no open orders // {"code":308,"message":"Not Found Transaction Record"} return;
exx throwExactlyMatchedException
ccxt_ccxt
train
js
641520a68bb926594b7870e9310731907c087432
diff --git a/master/buildbot/schedulers/timed.py b/master/buildbot/schedulers/timed.py index <HASH>..<HASH> 100644 --- a/master/buildbot/schedulers/timed.py +++ b/master/buildbot/schedulers/timed.py @@ -73,10 +73,6 @@ class Timed(base.BaseScheduler): self.reason = util.ascii2unicode(reason % {'name': name}) - if createAbsoluteSourceStamps and not onlyIfChanged: - config.error( - "createAbsoluteSourceStamps can only be used with onlyIfChanged") - self.createAbsoluteSourceStamps = createAbsoluteSourceStamps self.onlyIfChanged = onlyIfChanged
Allow createAbsoluteSourceStamps without onlyIfChanged
buildbot_buildbot
train
py
8ac10c1fc80c9241086e4b4854886d771a71e8a1
diff --git a/salmon/apps/monitor/utils.py b/salmon/apps/monitor/utils.py index <HASH>..<HASH> 100644 --- a/salmon/apps/monitor/utils.py +++ b/salmon/apps/monitor/utils.py @@ -10,7 +10,7 @@ def build_command(target, function, output='json'): def check_failed(value, opts): if isinstance(value, basestring): - value = TypeTranslate(opts['type']).cast(value_as_str) + value = TypeTranslate(opts['type']).cast(value) success = eval(opts['assert'].format(value=value)) assert isinstance(success, bool) # this is check_failed, not check_success
Oops Guess it's time to start adding tests
lincolnloop_salmon
train
py
ae4ec97bc01db011b93ae57c1e978f0aad5bee2f
diff --git a/helios-system-tests/src/main/java/com/spotify/helios/system/RamdiskTest.java b/helios-system-tests/src/main/java/com/spotify/helios/system/RamdiskTest.java index <HASH>..<HASH> 100644 --- a/helios-system-tests/src/main/java/com/spotify/helios/system/RamdiskTest.java +++ b/helios-system-tests/src/main/java/com/spotify/helios/system/RamdiskTest.java @@ -100,9 +100,9 @@ public class RamdiskTest extends SystemTestBase { assert dfPort != null; - // Read "foo" from /volume/bar - final String foo = recvUtf8(dfPort, 5); - assertEquals("tmpfs", foo); + // If "/much-volatile" mount is present a line starting with tmpfs should be returned + final String dfOutput = recvUtf8(dfPort, 5); + assertEquals("tmpfs", dfOutput); } private String recvUtf8(final int port, final int numBytes) throws Exception {
Fix copy-pasta'd comment in test
spotify_helios
train
java
8b5a05b921414164b09e2e6341d0983a48c06c88
diff --git a/chartpress.py b/chartpress.py index <HASH>..<HASH> 100755 --- a/chartpress.py +++ b/chartpress.py @@ -265,11 +265,11 @@ def _get_identifier(tag, n_commits, commit, long): if "-" in tag: # append a pre-release tag, with a . separator # 0.1.2-alpha.1 -> 0.1.2-alpha.1.n.h - return f"{tag}.{n_commits:03d}.{commit}" + return f"{tag}.n{n_commits:03d}.h{commit}" else: # append a release tag, with a - separator # 0.1.2 -> 0.1.2-n.h - return f"{tag}-{n_commits:03d}.{commit}" + return f"{tag}-n{n_commits:03d}.h{commit}" else: return f"{tag}" @@ -291,7 +291,7 @@ def _strip_identifiers_build_suffix(identifier): # split away our custom build specification: something ending in either # . or - followed by three or more digits, a dot, an commit sha of four # or more alphanumeric characters. - return re.sub(r'[-\.]\d{3,}\.\w{4,}\Z', "", identifier) + return re.sub(r'[-\.]n\d{3,}\.h\w{4,}\Z', "", identifier) def build_images(prefix, images, tag=None, push=False, force_push=False, chart_version=None, force_build=False, skip_build=False, long=False):
Add n and sha prefix to build info
jupyterhub_chartpress
train
py
1e820485177e2490a0620c4227345df1b1cff1a4
diff --git a/lib/travis/model/ssl_key.rb b/lib/travis/model/ssl_key.rb index <HASH>..<HASH> 100644 --- a/lib/travis/model/ssl_key.rb +++ b/lib/travis/model/ssl_key.rb @@ -35,7 +35,7 @@ class SslKey < Travis::Model def generate_keys unless public_key && private_key - keys = OpenSSL::PKey::RSA.generate(2048) + keys = OpenSSL::PKey::RSA.generate(4096) self.public_key = keys.public_key.to_s self.private_key = keys.to_pem end
go all the way to <I>
travis-ci_travis-core
train
rb
ce1923167f14fc9fc0142c669444f0c1a11636fc
diff --git a/dom/events/events.js b/dom/events/events.js index <HASH>..<HASH> 100644 --- a/dom/events/events.js +++ b/dom/events/events.js @@ -30,10 +30,10 @@ module.exports = { return (this.nodeName && (this.nodeType === 1 || this.nodeType === 9)) || this === window; }, dispatch: function(event, args, bubbles){ - var doc = _document(); var ret; var dispatchingOnDisabled = fixSyntheticEventsOnDisabled && isDispatchingOnDisabled(this, event); + var doc = this.ownerDocument || _document(); var ev = doc.createEvent('HTMLEvents'); var isString = typeof event === "string";
Prefer making events with ownerDocument (#<I>)
canjs_can-util
train
js
74205e663f52e3cfc68ab41283633bc99bac9755
diff --git a/tests/commands/thread_test.py b/tests/commands/thread_test.py index <HASH>..<HASH> 100644 --- a/tests/commands/thread_test.py +++ b/tests/commands/thread_test.py @@ -13,10 +13,10 @@ from alot.commands import thread class Test_ensure_unique_address(unittest.TestCase): - foo = '"foo" <[email protected]>' - foo2 = '"foo the fanzy" <[email protected]>' - bar = '"bar" <[email protected]>' - baz = '"baz" <[email protected]>' + foo = 'foo <[email protected]>' + foo2 = 'foo the fanzy <[email protected]>' + bar = 'bar <[email protected]>' + baz = 'baz <[email protected]>' def test_unique_lists_are_unchanged(self): expected = sorted([self.foo, self.bar])
Fix test for ensure_unique_address with new quoting
pazz_alot
train
py
99d968801aee8bf95b8b335dd379ae3431eada78
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -362,13 +362,12 @@ async.parallel(loadFixtures(csvFixtures), function (err) { }); }); - test('should add a \\ to escape \\" when doubleQuotes is set to \\"', function(t){ + test('should escape " when preceeded by \\', function(t){ json2csv({ - data: [{field: '\\"'}], - doubleQuotes:'\\"' + data: [{field: '\\"'}] }, function(error, csv){ t.error(error); - t.equal(csv, '"field"\n"\\\\"'); + t.equal(csv, '"field"\n"\\"""'); t.end(); }); });
made test more generic based on more testing
zemirco_json2csv
train
js
89b8b78980429b5f0eff62ee97637bf56a2dedfb
diff --git a/requesting.go b/requesting.go index <HASH>..<HASH> 100644 --- a/requesting.go +++ b/requesting.go @@ -227,7 +227,7 @@ func (p *Peer) applyRequestState(next desiredRequestState) bool { requestHeap := &next.Requests t := p.t heap.Init(requestHeap) - for requestHeap.Len() != 0 && maxRequests(current.Requests.GetCardinality()) < p.nominalMaxRequests() { + for requestHeap.Len() != 0 && maxRequests(current.Requests.GetCardinality()+current.Cancelled.GetCardinality()) < p.nominalMaxRequests() { req := heap.Pop(requestHeap).(RequestIndex) existing := t.requestingPeer(req) if existing != nil && existing != p {
Include requests pending cancel in current request count This fix a situation where peers might be dropping our requests, and since we depend on all requests being satisfied before re-requesting, we get stuck waiting for the request to be filled.
anacrolix_torrent
train
go
79b2d816f541e69d5fb7f36a3c39fa0d432157a6
diff --git a/wright/stage/c.py b/wright/stage/c.py index <HASH>..<HASH> 100644 --- a/wright/stage/c.py +++ b/wright/stage/c.py @@ -62,7 +62,7 @@ int main() { def __call__(self, name, headers=()): source = self.source % (name,) for header in headers: - source = '#include <{}>\n'.format(header) + source = '#include <{}>\n'.format(header) + source with TempFile('define', '.c', content=source) as temp: return super(CheckDefine, self).__call__(temp.filename, run=True)
c: pass headers in CheckDefine
tehmaze-labs_wright
train
py
fb66ad1d07095751ecc17b7af458a6adc7549e72
diff --git a/trie/ctrie/ctrie.go b/trie/ctrie/ctrie.go index <HASH>..<HASH> 100644 --- a/trie/ctrie/ctrie.go +++ b/trie/ctrie/ctrie.go @@ -63,8 +63,10 @@ type Ctrie struct { } // generation demarcates Ctrie snapshots. We use a heap-allocated reference -// instead of an integer to avoid integer overflows. -type generation struct{} +// instead of an integer to avoid integer overflows. Struct must have a field +// on it since two distinct zero-size variables may have the same address in +// memory. +type generation struct{ _ int } // iNode is an indirection node. I-nodes remain present in the Ctrie even as // nodes above and below change. Thread-safety is achieved in part by
Add field to generation In Go, two zero-sized structs can be placed in the same memory address.
Workiva_go-datastructures
train
go
2065abaf09f316a812e836ebb2b8b919fb864dfa
diff --git a/test/modules/misc.js b/test/modules/misc.js index <HASH>..<HASH> 100644 --- a/test/modules/misc.js +++ b/test/modules/misc.js @@ -1556,6 +1556,20 @@ define([ 'ractive' ], function ( Ractive ) { t.equal( ractive.find( 'svg' ).getAttribute( 'viewBox' ), '0 0 100 100' ); }); + test( 'Nested conditional computations should survive unrendering and rerendering (#1364)', ( t ) => { + var ractive = new Ractive({ + el: fixture, + template: '{{#cond}}{{# i === 1 }}1{{/}}{{# i === 2 }}2{{/}}{{/}}', + data: { i: 1, cond: true } + }); + + t.equal( fixture.innerHTML, '1' ); + ractive.set( 'cond', false ); + ractive.set( 'cond', true ); + ractive.set( 'i', 2 ); + t.equal( fixture.innerHTML, '2' ); + }); + // Is there a way to artificially create a FileList? Leaving this commented // out until someone smarter than me figures out how // test( '{{#each}} iterates over a FileList (#1220)', t => {
add test case for conditional and computation behavior from #<I>
ractivejs_ractive
train
js
72414940cc99185305e048dfcdbcddc0b758fa38
diff --git a/go/test/endtoend/vtgate/lookup_test.go b/go/test/endtoend/vtgate/lookup_test.go index <HASH>..<HASH> 100644 --- a/go/test/endtoend/vtgate/lookup_test.go +++ b/go/test/endtoend/vtgate/lookup_test.go @@ -161,7 +161,7 @@ func TestConsistentLookup(t *testing.T) { if got, want := fmt.Sprintf("%v", qr.Rows), "[[INT64(5) VARBINARY(\"\\x16k@\\xb4J\\xbaK\\xd6\")]]"; got != want { t.Errorf("select:\n%v want\n%v", got, want) } - exec(t, conn, "delete from t1 where id1=1") + exec(t, conn, "delete from t1 where id2=5") } func TestDMLScatter(t *testing.T) {
use lookup vindex to delete the record
vitessio_vitess
train
go
43e218c9690dd32268f6266ba0fe6705380b3605
diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -33,13 +33,6 @@ OpenLayers.Popup.Anchored.prototype = }, /** - */ - destroy: function() { - OpenLayers.Popup.prototype.destroy.apply(this, arguments); - }, - - - /** * @param {OpenLayers.Pixel} px * * @returns Reference to a div that contains the drawn popup
no reason to override Popup's destroy() if nothing new is being destroyed git-svn-id: <URL>
openlayers_openlayers
train
js
6309ffd1b7c678568705f1cf0fb5e44ea0fb3c22
diff --git a/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php b/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php +++ b/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php @@ -62,17 +62,14 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase public function testUnsilencing() { ob_start(); - $bak = array( - ini_set('log_errors', 0), - ini_set('display_errors', 1), - ); + + $this->iniSet('log_errors', 0); + $this->iniSet('display_errors', 1); // See below: this will fail with parse error // but this should not be @-silenced. @class_exists(__NAMESPACE__.'\TestingUnsilencing', true); - ini_set('log_errors', $bak[0]); - ini_set('display_errors', $bak[1]); $output = ob_get_clean(); $this->assertStringMatchesFormat('%aParse error%a', $output);
Use $this->iniSet() in tests
symfony_symfony
train
php
2f4866b7047a72a435f18274b692902ced85e3b9
diff --git a/angr/simos/javavm.py b/angr/simos/javavm.py index <HASH>..<HASH> 100644 --- a/angr/simos/javavm.py +++ b/angr/simos/javavm.py @@ -16,6 +16,9 @@ class SimJavaVM(SimOS): kwargs['arch'] = self.arch if kwargs.get('os_name', None) is None: kwargs['os_name'] = self.name + if kwargs.get('project', None) is None: + kwargs['project'] = self.project + state = SimState(**kwargs)
SimJavaVM: pass project object to SimState constructor
angr_angr
train
py
285ef0529961156f383a9099d8730b821b393429
diff --git a/lib/stsci/tools/eparoption.py b/lib/stsci/tools/eparoption.py index <HASH>..<HASH> 100644 --- a/lib/stsci/tools/eparoption.py +++ b/lib/stsci/tools/eparoption.py @@ -113,8 +113,10 @@ class EparOption(object): self.inputLabel.pack(side = LEFT, fill = X, expand = TRUE) # Get the prompt string and determine if special handling is needed - self.prompt = self.paramInfo.get(field = "p_prompt", native = 0, - prompt = 0) + # Use the prompt/description from the default version, in case they + # have edited theirs - this is not editable - see ticket #803 + self.prompt = self.defaultParamInfo.get(field="p_prompt", native=0, + prompt=0) # Check the prompt to determine how many lines of valid text exist lines = self.prompt.split("\n") @@ -136,7 +138,8 @@ class EparOption(object): promptLines = promptLines[:-len(DSCRPTN_FLAG)] self._flaggedDescription = True fgColor = "black" - if self._flaggedDescription: fgColor = "red" + # turn off this red coloring for the DSCRPTN_FLAG - see #803 +# if self._flaggedDescription: fgColor = "red" # Generate the prompt label self.promptLabel = Label(self.master_frame, anchor=W, fg=fgColor,
for a small part of #<I>; disable use of user-edited prompt/description fields, and thus will not color them red to signify that git-svn-id: <URL>
spacetelescope_stsci.tools
train
py
c9a4098d66cf8646c3b4f06b241d0018b329eec9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,9 +25,10 @@ long_description = 'FIXME stub: refer to https://github.com/netheosgithub/pcs_ap setup( - name='pcs_api', + name='pcs-api', version=metadata['version'], url='https://github.com/netheosgithub/pcs_api', + download_url='https://github.com/netheosgithub/pcs_api/releases', license='Apache Software License V2.0', author='Netheos', tests_require=['pytest>=2.5.2'],
setup.py: renamed (underscore not allowed in a pypi distribution)
netheosgithub_pcs_api
train
py
838fe38f48d7da28f6c1fa7c9c55018e52eb8e46
diff --git a/lib/core/polling/tests/polling-spec.js b/lib/core/polling/tests/polling-spec.js index <HASH>..<HASH> 100644 --- a/lib/core/polling/tests/polling-spec.js +++ b/lib/core/polling/tests/polling-spec.js @@ -1,4 +1,4 @@ -/*global inject, beforeEach, expect, module, angular, spyOn*/ +/*global inject, describe, it, availity, beforeEach, expect, module, angular, spyOn*/ describe('avPollingService', function() { 'use strict';
linter fixes for polling spec
Availity_availity-angular
train
js
06651fd28b57a603fa9a0bfaa7687ef5e29b9ceb
diff --git a/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java b/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java +++ b/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java @@ -1508,6 +1508,15 @@ public class ContentSpec extends Node { } /** + * Gets the list of additional files needed by the book. + * + * @return The list of additional Files. + */ + public FileList getFileList() { + return files; + } + + /** * Sets the list of additional files needed by the book. * * @param files The list of additional Files.
Added a way to get the FileList object.
pressgang-ccms_PressGangCCMSContentSpec
train
java
6b8c6b3fe9eb1cb80e9ef6d414e6fe5d44314857
diff --git a/commands.go b/commands.go index <HASH>..<HASH> 100644 --- a/commands.go +++ b/commands.go @@ -273,6 +273,13 @@ func (c *cmdable) Ping() *StatusCmd { return cmd } +func (c *cmdable) Wait(numSlaves int, timeout time.Duration) *IntCmd { + + cmd := NewIntCmd("wait", numSlaves, int(timeout/time.Second)) + c.process(cmd) + return cmd +} + func (c *cmdable) Quit() *StatusCmd { panic("not implemented") } diff --git a/commands_test.go b/commands_test.go index <HASH>..<HASH> 100644 --- a/commands_test.go +++ b/commands_test.go @@ -50,6 +50,13 @@ var _ = Describe("Commands", func() { Expect(ping.Val()).To(Equal("PONG")) }) + It("should Wait", func() { + // assume testing on single redis instance + wait := client.Wait(0, time.Minute) + Expect(wait.Err()).NotTo(HaveOccurred()) + Expect(wait.Val()).To(Equal(int64(0))) + }) + It("should Select", func() { pipe := client.Pipeline() sel := pipe.Select(1)
Added implementation for WAIT command Reference: <URL>
go-redis_redis
train
go,go
40df4aad14cca76d0572b22b8c9d564a2bc5f695
diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index <HASH>..<HASH> 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -385,9 +385,8 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error { // Inherit fsnFlags from parent directory w.fsnmut.Lock() - dirFsnFlags, dirFsnFound := w.fsnFlags[dirPath] - if dirFsnFound { - w.fsnFlags[filePath] = dirFsnFlags + if flags, found := w.fsnFlags[dirPath]; found { + w.fsnFlags[filePath] = flags } else { w.fsnFlags[filePath] = FSN_ALL } @@ -444,9 +443,8 @@ func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { if !doesExist { // Inherit fsnFlags from parent directory w.fsnmut.Lock() - dirFsnFlags, dirFsnFound := w.fsnFlags[dirPath] - if dirFsnFound { - w.fsnFlags[filePath] = dirFsnFlags + if flags, found := w.fsnFlags[dirPath]; found { + w.fsnFlags[filePath] = flags } else { w.fsnFlags[filePath] = FSN_ALL }
If statements on map results more idiomatic.
fsnotify_fsnotify
train
go
990af5ee793a6383a49055794e855ed61997e91f
diff --git a/pywb/rewrite/test/test_rewrite_live.py b/pywb/rewrite/test/test_rewrite_live.py index <HASH>..<HASH> 100644 --- a/pywb/rewrite/test/test_rewrite_live.py +++ b/pywb/rewrite/test/test_rewrite_live.py @@ -174,6 +174,19 @@ def test_local_2_no_rewrite(): # still link rewrite in HTML assert '"/pywb/20131226101010/http://example.com/some/path/another.html"' in buff +def test_local_unclosed_script(): + status_headers, buff = get_rewritten(get_test_dir() + 'text_content/sample_unclosed_script.html', + urlrewriter, + head_insert_func, + 'com,example,test)/') + + # wombat insert added + assert '<head><script src="/static/__pywb/wombat.js"> </script>' in buff, buff + + # JS location and JS link rewritten + assert 'window.WB_wombat_location = "/pywb/20131226101010/http:\/\/example.com/dynamic_page.html";\n}\n</script>' in buff, buff + + def test_example_1(): status_headers, buff = get_rewritten('http://example.com/', urlrewriter, req_headers={'Connection': 'close'})
rewrite: add extra test for rewriting html with <script> tag that's never closed
webrecorder_pywb
train
py
658f76ec5ccf3eec29ecfbc9fa1680356fd7b55c
diff --git a/lib/classes/task/period/writemeta.php b/lib/classes/task/period/writemeta.php index <HASH>..<HASH> 100644 --- a/lib/classes/task/period/writemeta.php +++ b/lib/classes/task/period/writemeta.php @@ -134,7 +134,7 @@ class task_period_writemeta extends task_databoxAbstract { period.value = xml.find("period").text(); cleardoc.checked = Number(xml.find("cleardoc").text()) > 0; - cleardoc.mwg = Number(xml.find("mwg").text()) > 0; + mwg.checked = Number(xml.find("mwg").text()) > 0; maxrecs.value = xml.find("maxrecs").text(); maxmegs.value = xml.find("maxmegs").text(); }
#PHRAS-<I> #time <I>m fix: task writemeta, mwg checkbox is saved
alchemy-fr_Phraseanet
train
php
8191921c6f9b705984ad7dba375dbe798a9d73be
diff --git a/app/views/dashboard/incidents/add.blade.php b/app/views/dashboard/incidents/add.blade.php index <HASH>..<HASH> 100644 --- a/app/views/dashboard/incidents/add.blade.php +++ b/app/views/dashboard/incidents/add.blade.php @@ -54,6 +54,7 @@ {{ trans('cachet.incidents.status')[4] }} </label> </div> + @if($components->count() > 0) <div class="form-group"> <label>{{ trans('forms.incidents.component') }}</label> <select name='incident[component_id]' class='form-control'> @@ -64,6 +65,7 @@ </select> <span class='help-block'>{{ trans('forms.optional') }}</span> </div> + @endif <div class="form-group hidden" id='component-status'> <div class="well"> <div class="radio-items">
Only show component picker if there are components to pick
CachetHQ_Cachet
train
php
5b78601b4ab9edd3ceeb9328be320d22289a1c19
diff --git a/core/src/main/java/com/google/bitcoin/core/Wallet.java b/core/src/main/java/com/google/bitcoin/core/Wallet.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -115,7 +115,7 @@ public class Wallet implements Serializable, BlockChainListener { private final NetworkParameters params; private Sha256Hash lastBlockSeenHash; - private int lastBlockSeenHeight = -1; + private int lastBlockSeenHeight; private transient CopyOnWriteArrayList<ListenerRegistration<WalletEventListener>> eventListeners; @@ -2571,7 +2571,10 @@ public class Wallet implements Serializable, BlockChainListener { } } - /** Returns the height of the last seen best-chain block. Can be -1 if a wallet is old and doesn't have that data. */ + /** + * Returns the height of the last seen best-chain block. Can be 0 if a wallet is brand new or -1 if the wallet + * is old and doesn't have that data. + */ public int getLastBlockSeenHeight() { lock.lock(); try {
Wallet: make last seen block height default to zero not -1
bitcoinj_bitcoinj
train
java
8365d48c863cf06ccf1465cc0a161cefae29d69d
diff --git a/templates/trust.tpl.php b/templates/trust.tpl.php index <HASH>..<HASH> 100644 --- a/templates/trust.tpl.php +++ b/templates/trust.tpl.php @@ -10,7 +10,7 @@ $params = array( echo('<p>' . $this->t('{openidProvider:openidProvider:confirm_question}', $params) . '</p>'); ?> <form method="post" action="?"> -<input type="hidden" name="StateID" value="<?php echo $this->data['StateID']; ?>" /> +<input type="hidden" name="StateID" value="<?php echo htmlspecialchars($this->data['StateID']); ?>" /> <input type="checkbox" name="TrustRemember" value="on" id="remember" /> <label for="TrustRemember"><?php echo($this->t('{openidProvider:openidProvider:remember}')); ?></label>
openidProvider: Fix cross-site scripting. If someone is able to perform a session fixation attack on the openidProvider host, he can then make users execute scripts in that domain. git-svn-id: <URL>
simplesamlphp_simplesamlphp-module-openidprovider
train
php
886ed1ccf38715dbae587ce6d6e736809bf73d4f
diff --git a/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java b/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java index <HASH>..<HASH> 100644 --- a/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java +++ b/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java @@ -1309,8 +1309,10 @@ public class SuggestedFixes { boolean warningInSameCompilationUnit = false; for (Diagnostic<? extends JavaFileObject> diagnostic : diagnosticListener.getDiagnostics()) { warningIsError |= diagnostic.getCode().equals("compiler.err.warnings.and.werror"); + JavaFileObject diagnosticSource = diagnostic.getSource(); + // If the source's origin is unknown, assume that new diagnostics are due to a modification. boolean diagnosticInSameCompilationUnit = - diagnostic.getSource().toUri().equals(modifiedFileUri); + diagnosticSource == null || diagnosticSource.toUri().equals(modifiedFileUri); switch (diagnostic.getKind()) { case ERROR: ++countErrors;
Handle diagnostics without source In some cases, compiler diagnostics may not have an associated source, and for testing whether suggested fixes compile these should be treated as originating from the same compilation unit of the suggested fix. Fixes #<I> Fixes #<I> COPYBARA_INTEGRATE_REVIEW=<URL>
google_error-prone
train
java
c039ee0752db5ccf091358cd797bf521d677dded
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + from setuptools import setup from codecs import open from os import path
declare encoding in setup.py
regardscitoyens_anpy
train
py
2847b2f0a649089478be8133a1cf7c8fdb590f53
diff --git a/simulator/src/test/java/com/hazelcast/simulator/worker/tasks/AbstractAsyncWorkerTest.java b/simulator/src/test/java/com/hazelcast/simulator/worker/tasks/AbstractAsyncWorkerTest.java index <HASH>..<HASH> 100644 --- a/simulator/src/test/java/com/hazelcast/simulator/worker/tasks/AbstractAsyncWorkerTest.java +++ b/simulator/src/test/java/com/hazelcast/simulator/worker/tasks/AbstractAsyncWorkerTest.java @@ -132,7 +132,7 @@ public class AbstractAsyncWorkerTest { @RunWithWorker public Worker createWorker() { - return new Worker(++workerCreated); + return new Worker(workerCreated++); } private class Worker extends AbstractAsyncWorker<Operation, String> {
Fixed workerId in AbstractAsyncWorkerTest.
hazelcast_hazelcast-simulator
train
java
b44cedd1a0913ca7b1785dfb47b809ad6e5af9ef
diff --git a/alerta/views/alerts.py b/alerta/views/alerts.py index <HASH>..<HASH> 100644 --- a/alerta/views/alerts.py +++ b/alerta/views/alerts.py @@ -82,7 +82,7 @@ def set_status(alert_id): timeout = request.json.get('timeout', None) if not status: - raise ApiError("must supply 'status' as json data") + raise ApiError("must supply 'status' as json data", 400) customers = g.get('customers', None) alert = Alert.find_by_id(alert_id, customers) @@ -115,7 +115,7 @@ def action_alert(alert_id): timeout = request.json.get('timeout', None) if not action: - raise ApiError("must supply 'action' as json data") + raise ApiError("must supply 'action' as json data", 400) customers = g.get('customers', None) alert = Alert.find_by_id(alert_id, customers)
Missing JSON data is <I>, not <I> error (#<I>)
alerta_alerta
train
py
3c0669c1dc80d9c028a0cd5986b209231e93861e
diff --git a/nodeconductor/monitoring/zabbix/db_client.py b/nodeconductor/monitoring/zabbix/db_client.py index <HASH>..<HASH> 100644 --- a/nodeconductor/monitoring/zabbix/db_client.py +++ b/nodeconductor/monitoring/zabbix/db_client.py @@ -108,6 +108,12 @@ class ZabbixDBClient(object): ORDER BY hi.clock - (hi.clock %% 60) ASC """ + # This is a work-around for MySQL-python<1.2.5 + # that was unable to serialize lists with a single value properly. + # MySQL-python==1.2.3 is default in Centos 7 as of 2015-03-03. + if len(host_ids) == 1: + host_ids.append(host_ids[0]) + parameters = (host_ids, start_timestamp, end_timestamp) with connections['zabbix'].cursor() as cursor: diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ install_requires = [ setup( name='nodeconductor', - version='0.40.1', + version='0.40.2', author='OpenNode Team', author_email='[email protected]', url='https://github.com/opennode/nodeconductor',
Work-around buggy MySQL-python for resource usage
opennode_waldur-core
train
py,py
4dd35cdaf12b2207820496e9eb96c33635553d5e
diff --git a/package/rules/sass.js b/package/rules/sass.js index <HASH>..<HASH> 100644 --- a/package/rules/sass.js +++ b/package/rules/sass.js @@ -1,8 +1,9 @@ const getStyleRule = require('../utils/get_style_rule') +const { resolved_paths: includePaths } = require('../config') module.exports = getStyleRule(/\.(scss|sass)(\.erb)?$/i, false, [ { loader: 'sass-loader', - options: { sourceMap: true } + options: { sourceMap: true, includePaths } } ])
Pass resolved_paths as includePaths to sass-loader (#<I>)
rails_webpacker
train
js
e30171bfbc43acbc8a98757de9c9acf7ffe49a44
diff --git a/lib/scoped_search/definition.rb b/lib/scoped_search/definition.rb index <HASH>..<HASH> 100644 --- a/lib/scoped_search/definition.rb +++ b/lib/scoped_search/definition.rb @@ -168,7 +168,7 @@ module ScopedSearch column_types += [:integer, :double, :float, :decimal] if value =~ NUMERICAL_REGXP column_types += [:datetime, :date, :timestamp] if (parse_temporal(value)) - default_fields.select { |field| column_types.include?(field.type) } + default_fields.select { |field| column_types.include?(field.type) && !field.set? } end # Try to parse a string as a datetime.
removed set fields from numerical value free text search
wvanbergen_scoped_search
train
rb
d1952e45dabdef7b6e1f77acf707a947db654c4c
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/IncludeTag.java @@ -74,17 +74,7 @@ public class IncludeTag implements Tag { interpreter.getContext().addDependency("coded_files", templateFile); - JinjavaInterpreter child = new JinjavaInterpreter(interpreter); - JinjavaInterpreter.pushCurrent(child); - - try { - String result = child.render(node); - interpreter.addAllErrors(child.getErrorsCopy()); - return result; - } finally { - JinjavaInterpreter.popCurrent(); - } - + return interpreter.render(node); } catch (IOException e) { throw new InterpretException(e.getMessage(), e, tagNode.getLineNumber(), tagNode.getStartPosition()); } finally {
Render node in tag in the same scope.
HubSpot_jinjava
train
java
bf023693b600cfa252589a13553980b8c9b1813a
diff --git a/lib/ui/validation/field.js b/lib/ui/validation/field.js index <HASH>..<HASH> 100644 --- a/lib/ui/validation/field.js +++ b/lib/ui/validation/field.js @@ -121,7 +121,7 @@ var avValField = controllers[2]; if(!ngModel && !rule) { - $log.info('avValField requires ngModel and a validation rule to run.'); + $log.error('avValField requires ngModel and a validation rule to run.'); return; } @@ -149,12 +149,12 @@ ngModel.$formatters.unshift(avValField.validate); scope.$on(AV_VAL.EVENTS.REVALIDATE, function() { - avValField.validate(ngModel.$modelValue); + avValField.validate(ngModel.$viewValue); }); scope.$on(AV_VAL.EVENTS.SUBMITTED, function() { ngModel.$dirty = true; - avValField.validate(ngModel.$modelValue); + avValField.validate(ngModel.$viewValue); }); scope.$on('$destroy', function () {
validation fixes * submitted/revalidate events should trigger a validation with data from $viewValue * use $log.error for invalid av-val-field state
Availity_availity-angular
train
js
831157dede672227ba5b9d820f47453bc4c65d8e
diff --git a/src/Nayjest/Grids/Components/CsvExport.php b/src/Nayjest/Grids/Components/CsvExport.php index <HASH>..<HASH> 100644 --- a/src/Nayjest/Grids/Components/CsvExport.php +++ b/src/Nayjest/Grids/Components/CsvExport.php @@ -95,9 +95,7 @@ class CsvExport extends RenderableComponent header("Pragma: no-cache"); set_time_limit(0); - // force to prepare columns hider component - $this->grid->getConfig()->getComponentByNameRecursive('columns_hider')->prepare(); - + $this->grid->prepare(); $this->grid->getConfig()->initialize($this->grid); /** * @var $provider \Nayjest\Grids\EloquentDataProvider diff --git a/src/Nayjest/Grids/Grid.php b/src/Nayjest/Grids/Grid.php index <HASH>..<HASH> 100644 --- a/src/Nayjest/Grids/Grid.php +++ b/src/Nayjest/Grids/Grid.php @@ -50,7 +50,7 @@ class Grid } - protected function prepare() + public function prepare() { if ($this->prepared === true) { return;
added prepearing for grid before csv export
Nayjest_Grids
train
php,php
b5018f206f2e577b25ad1c20904df2513399bd70
diff --git a/src/Exception/StateMachineException.php b/src/Exception/StateMachineException.php index <HASH>..<HASH> 100755 --- a/src/Exception/StateMachineException.php +++ b/src/Exception/StateMachineException.php @@ -7,8 +7,6 @@ */ namespace Mothership\StateMachine\Exception; -use Mothership\Exception\ExceptionAbstract; - /** * Class StateMachineException. * @@ -18,6 +16,6 @@ use Mothership\Exception\ExceptionAbstract; * * @link http://www.mothership.de/ */ -class StateMachineException extends ExceptionAbstract +class StateMachineException extends \Exception { }
Update StateMachineException.php
mothership-gmbh_state_machine
train
php
6ce58a789df2f4565250cc4e9f607f5863654109
diff --git a/src/reducers/__tests__/collections.spec.js b/src/reducers/__tests__/collections.spec.js index <HASH>..<HASH> 100644 --- a/src/reducers/__tests__/collections.spec.js +++ b/src/reducers/__tests__/collections.spec.js @@ -1,4 +1,3 @@ -import expect from 'expect'; import { OrderedMap, fromJS } from 'immutable'; import { configLoaded } from '../../actions/config'; import collections from '../collections'; @@ -15,11 +14,11 @@ describe('collections', () => { it('should load the collections from the config', () => { expect( collections(undefined, configLoaded({ collections: [ - { name: 'posts', folder: '_posts', fields: [{ name: 'title', widget: 'string' }] } + { name: 'posts', folder: '_posts', fields: [{ name: 'title', widget: 'string' }] }, ] })) ).toEqual( OrderedMap({ - posts: fromJS({ name: 'posts', folder: '_posts', fields: [{ name: 'title', widget: 'string' }] }) + posts: fromJS({ name: 'posts', folder: '_posts', fields: [{ name: 'title', widget: 'string' }] }), }) ); });
Do not use expect to get better diffs out of Jest
netlify_netlify-cms
train
js
c4d336c07b97fb8a43848a5624a1ea6ac78a4d32
diff --git a/examples/__init__.py b/examples/__init__.py index <HASH>..<HASH> 100755 --- a/examples/__init__.py +++ b/examples/__init__.py @@ -78,8 +78,8 @@ result = zendesk.ticket_create(data=new_ticket) #ticket_id = get_id_from_url(ticket_url) # Need ticket ID? -from zendesk import get_id_from_url -ticket_id = get_id_from_url(ticket_url) +from zdesk import get_id_from_url +ticket_id = get_id_from_url(result) # Show zendesk.ticket_show(id=ticket_id) @@ -126,7 +126,7 @@ new_user = { 'roles': 4, } } -result = zendesk.user_create(data=new_user, complete_response=True) +result = zendesk.user_create(data=new_user) user_id = get_id_from_url(result) # Show
fix example file so it will execute completely
fprimex_zdesk
train
py
01ba20ca0486fbbd50ae5f0b4926b6959d4fca5d
diff --git a/unitypack/__init__.py b/unitypack/__init__.py index <HASH>..<HASH> 100644 --- a/unitypack/__init__.py +++ b/unitypack/__init__.py @@ -10,3 +10,10 @@ def load(file, env=None): if env is None: env = UnityEnvironment() return env.load(file) + +def load_from_file(file, env=None): + from .environment import UnityEnvironment + + if env is None: + env = UnityEnvironment() + return env.get_asset_by_filename(file)
Expose get_asset_by_filename as load_from_file
HearthSim_UnityPack
train
py
0638da7c4909feb5ae36bfee54e4e30e512aa0c3
diff --git a/exampleConfig.js b/exampleConfig.js index <HASH>..<HASH> 100644 --- a/exampleConfig.js +++ b/exampleConfig.js @@ -42,7 +42,7 @@ Optional Variables: log: log settings [object, default: undefined] backend: where to log: stdout or syslog [string, default: stdout] application: name of the application for syslog [string, default: statsd] - level: log level for syslog [string, default: LOG_INFO] + level: log level for [node-]syslog [string, default: LOG_INFO] */ { diff --git a/lib/logger.js b/lib/logger.js index <HASH>..<HASH> 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -24,10 +24,13 @@ Logger.prototype = { } else { if (!type) { type = this.level + if (!this.util[type]) { + throw "Undefined log level: " + type; + } } else if (type == 'debug') { type = "LOG_DEBUG"; } - this.util.log(eval("this.util." + this.level), msg); + this.util.log(this.util[type], msg); } } }
Test if the supplied log level is defined in node-syslog. Remove eval()! :)
statsd_statsd
train
js,js
427642aaba0d93b9b104ec1f7111540c8c758f74
diff --git a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php +++ b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php @@ -111,10 +111,11 @@ class DefaultQueryCache implements QueryCache $region = $persister->getCacheRegion(); $regionName = $region->getName(); + $cm = $this->em->getClassMetadata($entityName); // @TODO - move to cache hydration component foreach ($entry->result as $index => $entry) { - if (($entityEntry = $region->get($entityKey = new EntityCacheKey($entityName, $entry['identifier']))) === null) { + if (($entityEntry = $region->get($entityKey = new EntityCacheKey($cm->rootEntityName, $entry['identifier']))) === null) { if ($this->cacheLogger !== null) { $this->cacheLogger->entityCacheMiss($regionName, $entityKey);
Entity cache key is built differently on read than on write
doctrine_orm
train
php
e9a0ad94de20c75bd59c2fc89ca298b5a027a1d8
diff --git a/etc/eslint/rules/stdlib.js b/etc/eslint/rules/stdlib.js index <HASH>..<HASH> 100644 --- a/etc/eslint/rules/stdlib.js +++ b/etc/eslint/rules/stdlib.js @@ -2629,6 +2629,24 @@ rules[ 'stdlib/no-require-absolute-path' ] = 'error'; rules[ 'stdlib/no-require-index' ] = 'error'; /** +* Never allow packages to require themselves. +* +* @name no-self-require +* @memberof rules +* @type {string} +* @default 'error' +* +* @example +* // Bad... +* var self = require( __filename ); +* +* @example +* // Good... +* var other = require( './other.js' ); +*/ +rules[ 'stdlib/no-self-require' ] = 'error'; + +/** * Never allow unassigned `require()` calls. * * @name no-unassigned-require
Enable rule to prevent a package from requiring itself
stdlib-js_stdlib
train
js
20fb91a810d8044db1d0591efe7149fcbe9facd5
diff --git a/adafruit_seesaw/seesaw.py b/adafruit_seesaw/seesaw.py index <HASH>..<HASH> 100644 --- a/adafruit_seesaw/seesaw.py +++ b/adafruit_seesaw/seesaw.py @@ -277,6 +277,7 @@ class Seesaw: self.write(_GPIO_BASE, _GPIO_DIRSET_BULK, cmd) elif mode == self.INPUT: self.write(_GPIO_BASE, _GPIO_DIRCLR_BULK, cmd) + self.write(_GPIO_BASE, _GPIO_PULLENCLR, cmd) elif mode == self.INPUT_PULLUP: self.write(_GPIO_BASE, _GPIO_DIRCLR_BULK, cmd)
seesaw: Clear pull-ups when setting mode to INPUT .. pull-ups are enabled with INPUT_PULLUP, INPUT_PULLDOWN and would otherwise never be disabled
adafruit_Adafruit_CircuitPython_seesaw
train
py
c8546d01e1434f15615a8cdffa1c3b1b66cecc75
diff --git a/AppiumLibrary/keywords/keywordgroup.py b/AppiumLibrary/keywords/keywordgroup.py index <HASH>..<HASH> 100644 --- a/AppiumLibrary/keywords/keywordgroup.py +++ b/AppiumLibrary/keywords/keywordgroup.py @@ -2,7 +2,7 @@ import sys import inspect -from future.utils import with_metaclass +from six import with_metaclass try: from decorator import decorator except SyntaxError: # decorator module requires Python/Jython 2.4+
Changing future.utils to six
serhatbolsu_robotframework-appiumlibrary
train
py
a23f3a6e6e276a642ac0b397997f08f82ef9bd10
diff --git a/packages/tiptap/src/Editor.js b/packages/tiptap/src/Editor.js index <HASH>..<HASH> 100644 --- a/packages/tiptap/src/Editor.js +++ b/packages/tiptap/src/Editor.js @@ -274,7 +274,7 @@ export default class Editor extends Emitter { if (typeof content === 'string') { const htmlString = `<div>${content}</div>` const parser = new window.DOMParser() - const element = parser.parseFromString(htmlString, 'text/html').body + const element = parser.parseFromString(htmlString, 'text/html').body.firstElementChild return DOMParser.fromSchema(this.schema).parse(element, parseOptions) }
Fix an issue with with parsing custom extensions see details in #<I>
scrumpy_tiptap
train
js
b4a70cd92c56ba3bac5841cb85c7ecfdc618af42
diff --git a/ipyrad/__main__.py b/ipyrad/__main__.py index <HASH>..<HASH> 100644 --- a/ipyrad/__main__.py +++ b/ipyrad/__main__.py @@ -10,6 +10,7 @@ import ipyrad as ip import argparse import logging import atexit +import time import sys import os @@ -487,6 +488,13 @@ def main(): "\n Interactive assembly and analysis of RAD-seq data"+\ "\n -------------------------------------------------------------" + ## Log the current version. End run around the LOGGER + ## so it'll always print regardless of log level. + with open(ip.__debugfile__, 'w') as logfile: + logfile.write(header) + logfile.write("\n Begin run: {}".format(time.strftime("%Y-%m-%d %H:%M"))) + logfile.write("\n Using args {}".format(vars(args))) + ## if merging just do the merge and exit if args.merge: print(header)
Write the version and the args used to the log file for each run. This might be annoying, but it could be useful.
dereneaton_ipyrad
train
py
de86f6019c0f6c517e5346a7bf9d8db6d6ffdf27
diff --git a/lib/by_star/by_year.rb b/lib/by_star/by_year.rb index <HASH>..<HASH> 100644 --- a/lib/by_star/by_year.rb +++ b/lib/by_star/by_year.rb @@ -14,7 +14,7 @@ module ByStar end def by_year_String_or_Fixnum(year, options={}) - time = "#{year.to_s}-01-01 00:00:00".to_time + time = "#{year.to_s}-01-01".to_time by_year_Time(time, options) end alias_method :by_year_String, :by_year_String_or_Fixnum
Remove The H:M:S from by_year_String_or_Fixnum This is because to_time has these defaulting to 0
radar_by_star
train
rb
fe469911641169be81fc5c80d0932a256257a733
diff --git a/tests/unit/io/test_eventletreactor.py b/tests/unit/io/test_eventletreactor.py index <HASH>..<HASH> 100644 --- a/tests/unit/io/test_eventletreactor.py +++ b/tests/unit/io/test_eventletreactor.py @@ -39,6 +39,10 @@ class EventletTimerTest(unittest.TestCase, TimerConnectionTests): # to make sure no monkey patching is happening if not MONKEY_PATCH_LOOP: return + + # This is being added temporarily due to a bug in eventlet: + # https://github.com/eventlet/eventlet/issues/401 + import eventlet; eventlet.sleep() monkey_patch() cls.connection_class = EventletConnection EventletConnection.initialize_reactor()
Added fix to temporal bug in eventlet
datastax_python-driver
train
py
9bd1c951c9fd2156415e7e88019b3a87dcf50008
diff --git a/wix-restaurants-api/src/main/java/com/wix/restaurants/Errors.java b/wix-restaurants-api/src/main/java/com/wix/restaurants/Errors.java index <HASH>..<HASH> 100644 --- a/wix-restaurants-api/src/main/java/com/wix/restaurants/Errors.java +++ b/wix-restaurants-api/src/main/java/com/wix/restaurants/Errors.java @@ -6,6 +6,7 @@ public class Errors { // Client public static final String InvalidData = "https://www.wixrestaurants.com/errors/invalid_data"; public static final String PaymentRejected = "https://www.wixrestaurants.com/errors/cc_rejected"; + public static final String PaymentExceedsLimit = "https://www.wixrestaurants.com/errors/payment_exceeds_limit"; public static final String Forbidden = "https://www.wixrestaurants.com/errors/no_permission"; public static final String Conflict = "https://www.wixrestaurants.com/errors/conflict"; public static final String Authentication = "https://www.wixrestaurants.com/errors/authentication";
Added Errors.PaymentExceedsLimit
wix_wix-restaurants-java-sdk
train
java
49e313c4698360c2e7434828d88df2fdb83234b1
diff --git a/src/sos/executor_utils.py b/src/sos/executor_utils.py index <HASH>..<HASH> 100644 --- a/src/sos/executor_utils.py +++ b/src/sos/executor_utils.py @@ -147,7 +147,7 @@ CONFIG = {} del sos_handle_parameter_ ''' + global_def, None) except Exception as e: - env.logger.trace( + env.logger.warning( f'Failed to execute global definition {short_repr(global_def)}: {e}') def statementMD5(stmts):
Boost trace on the execution of global_def in host as warning #<I>
vatlab_SoS
train
py
bd23c8ef2566ae31b4d4862e3cc5af4b73b8f8dd
diff --git a/examples/list/src/com/webimageloader/example/list/MainActivity.java b/examples/list/src/com/webimageloader/example/list/MainActivity.java index <HASH>..<HASH> 100644 --- a/examples/list/src/com/webimageloader/example/list/MainActivity.java +++ b/examples/list/src/com/webimageloader/example/list/MainActivity.java @@ -95,7 +95,9 @@ public class MainActivity extends ListActivity { public void setMemoryCache(MemoryCache memoryCache) { this.memoryCache = memoryCache; - scheduleUpdates(); + if (memoryCache != null) { + scheduleUpdates(); + } } private void scheduleUpdates() {
Check if we have a memory cache
lexs_webimageloader
train
java
eb36c85f3d5703ad20dc6f4dc523aa324842d416
diff --git a/src/client/utils/ipcAdapter.js b/src/client/utils/ipcAdapter.js index <HASH>..<HASH> 100644 --- a/src/client/utils/ipcAdapter.js +++ b/src/client/utils/ipcAdapter.js @@ -22,7 +22,7 @@ class ClientIPCAdapter extends IPCAdapter { const currentActivityId = results[1].activityId return activities.map((activity) => { - if (activity.id === currentActivityId) { + if (activity.id !== '-1' && activity.id === currentActivityId) { activity.activityStatus = ACTIVITIY_STATUS.STARTED } else { activity.activityStatus = ACTIVITIY_STATUS.OFF
fix(ipc): Set default activity state better when load activities
swissmanu_orchestra
train
js
bf9907fd933367e6ac7d627700f460e258f83b70
diff --git a/metamorphosis-client/src/main/java/com/taobao/metamorphosis/client/extension/spring/AbstractMetaqMessageSessionFactory.java b/metamorphosis-client/src/main/java/com/taobao/metamorphosis/client/extension/spring/AbstractMetaqMessageSessionFactory.java index <HASH>..<HASH> 100644 --- a/metamorphosis-client/src/main/java/com/taobao/metamorphosis/client/extension/spring/AbstractMetaqMessageSessionFactory.java +++ b/metamorphosis-client/src/main/java/com/taobao/metamorphosis/client/extension/spring/AbstractMetaqMessageSessionFactory.java @@ -17,7 +17,7 @@ import com.taobao.metamorphosis.utils.ZkUtils.ZKConfig; * @since 1.4.5 * @param <T> */ -public abstract class AbstractMetaqMessageSessionFactory<T extends MessageSessionFactory> implements FactoryBean<T>, +public abstract class AbstractMetaqMessageSessionFactory<T extends MessageSessionFactory> implements FactoryBean, DisposableBean { protected MetaClientConfig metaClientConfig = new MetaClientConfig();
Make client to be compitable with spring 2.x
killme2008_Metamorphosis
train
java
68455f1f8f6898eeff41c09a48b9d714f0b2717e
diff --git a/app/models/renalware/hd/dry_weight.rb b/app/models/renalware/hd/dry_weight.rb index <HASH>..<HASH> 100644 --- a/app/models/renalware/hd/dry_weight.rb +++ b/app/models/renalware/hd/dry_weight.rb @@ -12,7 +12,7 @@ module Renalware has_paper_trail class_name: "Renalware::HD::Version" - scope :ordered, -> { order(assessed_on: :desc) } + scope :ordered, -> { order(assessed_on: :desc, created_at: :desc) } validates :patient, presence: true validates :assessor, presence: true diff --git a/app/presenters/renalware/hd/dashboard_presenter.rb b/app/presenters/renalware/hd/dashboard_presenter.rb index <HASH>..<HASH> 100644 --- a/app/presenters/renalware/hd/dashboard_presenter.rb +++ b/app/presenters/renalware/hd/dashboard_presenter.rb @@ -36,7 +36,7 @@ module Renalware def dry_weights @dry_weights ||= begin - weights = DryWeight.for_patient(patient).limit(10).includes(:assessor).ordered + weights = DryWeight.for_patient(patient).limit(4).includes(:assessor).ordered CollectionPresenter.new(weights, DryWeightPresenter) end end
Only display last 4 dry weights in HD Summary
airslie_renalware-core
train
rb,rb
f1d117131c7717f9fb91061cfa31e1aa3664c2a5
diff --git a/lib/wbench/version.rb b/lib/wbench/version.rb index <HASH>..<HASH> 100644 --- a/lib/wbench/version.rb +++ b/lib/wbench/version.rb @@ -1,3 +1,3 @@ module WBench - VERSION = '1.1.0' + VERSION = '1.1.1' end
Bump to version <I>
desktoppr_wbench
train
rb
70ca666cd2e6c9e3ea6c9bdbb70c082d442785f4
diff --git a/neomodel/properties.py b/neomodel/properties.py index <HASH>..<HASH> 100644 --- a/neomodel/properties.py +++ b/neomodel/properties.py @@ -12,12 +12,12 @@ if sys.version_info >= (3, 0): def validator(fn): fn_name = fn.func_name if hasattr(fn, 'func_name') else fn.__name__ - if fn_name is 'inflate': + if fn_name == 'inflate': exc_class = InflateError elif fn_name == 'deflate': exc_class = DeflateError else: - raise Exception("Unknown Property method " + fn.func_name) + raise Exception("Unknown Property method " + fn_name) @functools.wraps(fn) def validator(self, value, node_id=None):
Fixed a couple of errors in the validator decorator
neo4j-contrib_neomodel
train
py
b9e632f4e1b8cec9720ed0bb80caf2bab74209d6
diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/feature/rails.rb +++ b/lib/puppet/feature/rails.rb @@ -9,7 +9,7 @@ Puppet.features.add(:rails) do begin require 'active_record' rescue LoadError => detail - if Facter["operatingsystem"].value == "Debian" and FileTest.exists?("/usr/share/rails") + if FileTest.exists?("/usr/share/rails") count = 0 Dir.entries("/usr/share/rails").each do |dir| libdir = File.join("/usr/share/rails", dir, "lib")
Fixed #<I> - Rails feature update fixed for Debian and Ubuntu
puppetlabs_puppet
train
rb
1940d7f002c98047f4ff5037a32a66eefd15bb17
diff --git a/tests/test_slack.py b/tests/test_slack.py index <HASH>..<HASH> 100644 --- a/tests/test_slack.py +++ b/tests/test_slack.py @@ -437,7 +437,8 @@ class TestSlackBackendArchive(TestCaseBackendArchive): def setUp(self): super().setUp() - self.backend = Slack('C011DUKE8', 'aaaa', max_items=5, archive=self.archive) + self.backend_write_archive = Slack('C011DUKE8', 'aaaa', max_items=5, archive=self.archive) + self.backend_read_archive = Slack('C011DUKE8', 'aaaa', max_items=5, archive=self.archive) @httpretty.activate @unittest.mock.patch('perceval.backends.core.slack.datetime_utcnow')
[tests] Modify slack tests when fetching from archive This patch adds two different backend objects (one fetches data from remote a data source and the other one from an archive) in order to ensure that backend and method params are initialized in the same way independently from which method is called (fetch or fetch_from_archive)
chaoss_grimoirelab-perceval
train
py
08cb7a66ef64250370e327f87840f3bd3fb29201
diff --git a/php-typography/lang_unformatted/convert_pattern.php b/php-typography/lang_unformatted/convert_pattern.php index <HASH>..<HASH> 100644 --- a/php-typography/lang_unformatted/convert_pattern.php +++ b/php-typography/lang_unformatted/convert_pattern.php @@ -124,7 +124,7 @@ class Pattern_Converter { File modified to place pattern and exceptions in arrays that can be understood in php files. This file is released under the same copyright as the below referenced original file - Original unmodified file is available at: <?= dirname( $this->url ) . "\n" ?> + Original unmodified file is available at: <?= dirname( $this->url ) . "/\n" ?> Original file name: <?= basename( $this->url ) . "\n" ?> //============================================================================================================
Don't strip trailing slash from URL
mundschenk-at_php-typography
train
php
5554fb79c27c387993a2aeef997b2c29b399c09a
diff --git a/acos_client/client.py b/acos_client/client.py index <HASH>..<HASH> 100644 --- a/acos_client/client.py +++ b/acos_client/client.py @@ -47,7 +47,7 @@ from acos_client.v30.sflow import SFlow as v30_SFlow from acos_client.v30.slb import SLB as v30_SLB from acos_client.v30.system import System as v30_System from acos_client.v30.vrrpa.vrid import VRID as v30_VRRPA - +from acos_client.v30.vlan import Vlan as v30_Vlan VERSION_IMPORTS = { '21': { @@ -62,6 +62,7 @@ VERSION_IMPORTS = { 'SFlow': v21_SFlow, 'SLB': v21_SLB, 'System': v21_System, + 'Vlan': None, }, '30': { 'DNS': v30_DNS, @@ -78,6 +79,7 @@ VERSION_IMPORTS = { 'System': v30_System, 'File': v30_File, 'VRRPA': v30_VRRPA + 'Vlan': v30_Vlan }, }
Added vlan property to client
a10networks_acos-client
train
py
4dae327a99f3c11fe141c7249e60f1ab8bda9a9e
diff --git a/lib/Utils.php b/lib/Utils.php index <HASH>..<HASH> 100644 --- a/lib/Utils.php +++ b/lib/Utils.php @@ -22,7 +22,7 @@ class Utils { passthru($cmd, $return_var); - if($return_content) $output = ob_get_contents(); + if($return_content) $output = trim(ob_get_contents()); if($return_content) ob_end_clean(); // if command exits with a code other than 0 throw exception diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index <HASH>..<HASH> 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -19,7 +19,7 @@ class UtilsTest extends PHPUnit_Framework_TestCase { */ function testExecReturn() { $output = Utils::exec('echo hello!', true); - $this->assertEquals("hello!\n", $output); + $this->assertEquals("hello!", $output); } /**
Trim exec output and modified tests to match
FusePump_cli.php
train
php,php
ee064df28c554370b2aed82224c5f714eabd8435
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/OrderingFrom.java b/core/src/main/java/com/google/errorprone/bugpatterns/OrderingFrom.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/OrderingFrom.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/OrderingFrom.java @@ -68,9 +68,9 @@ import java.util.ArrayList; summary = "Ordering.from(new Comparator<T>() { }) can be refactored to cleaner form", explanation = "Calls of the form\n" + - "{{{Ordering.from(new Comparator<T>() { ... })}}}\n" + + "`Ordering.from(new Comparator<T>() { ... })`\n" + "can be unwrapped to a new anonymous subclass of Ordering\n" + - "{{{new Ordering<T>() { ... }}}}\n" + + "`new Ordering<T>() { ... }`\n" + "which is shorter and cleaner (and potentially more efficient).", category = GUAVA, severity = WARNING, maturity = EXPERIMENTAL) public class OrderingFrom extends BugChecker implements MethodInvocationTreeMatcher {
Remove triple curly braces. These are valid syntax for code.google but Github interprets them as fluid markup. Switch to backticks.
google_error-prone
train
java
f36aeb761e30c830f2b70ff0f0e712ed963495c0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,13 @@ setup( version='1.0.5', packages=[ 'ntlm_auth' ], install_requires=[ - "six", - "ordereddict ; python_version<'2.7'" + 'six' ], + extras_require={ + ':python_version<"2.7"': [ + 'ordereddict' + ] + }, author='Jordan Borean', author_email='[email protected]', url='https://github.com/jborean93/ntlm-auth',
Fix environment markers being stripped when building python wheels (#<I>)
jborean93_ntlm-auth
train
py
a79e9fc26e6a90a31ee141d105c2ac0d637df7f6
diff --git a/src/http-auth-interceptor.js b/src/http-auth-interceptor.js index <HASH>..<HASH> 100644 --- a/src/http-auth-interceptor.js +++ b/src/http-auth-interceptor.js @@ -123,9 +123,8 @@ retryAll: function(updater) { for (var i = 0; i < buffer.length; ++i) { var _cfg = updater(buffer[i].config); - if (_cfg === false) - continue; - retryHttpRequest(_cfg, buffer[i].deferred); + if (_cfg !== false) + retryHttpRequest(_cfg, buffer[i].deferred); } buffer = []; }
inverted "if" statement to remove "continue"
witoldsz_angular-http-auth
train
js
18be0aaea210dc595d82c32e0a0d3062a27bde49
diff --git a/spec/aptly/repo_spec.rb b/spec/aptly/repo_spec.rb index <HASH>..<HASH> 100644 --- a/spec/aptly/repo_spec.rb +++ b/spec/aptly/repo_spec.rb @@ -45,4 +45,16 @@ module Aptly repo.list_packages.should eq([]) end end + + describe "Adding Packages" do + it "should successfully add a single file" do + repo = Aptly::Repo.new 'repo2' + repo.add 'spec/pkgs/pkg1_1.0.1-1_amd64.deb' + end + + it "should reflect the new package in the repo content" do + repo = Aptly::Repo.new 'repo2' + repo.list_packages.should eq(['pkg1_1.0.1-1_amd64']) + end + end end
Added test for adding packages to a repo
ryanuber_ruby-aptly
train
rb
e68acb9a3268fb438bd47119f0fa0abd8e67055a
diff --git a/tests/Desarrolla2/Cache/Adapter/Test/FileTest.php b/tests/Desarrolla2/Cache/Adapter/Test/FileTest.php index <HASH>..<HASH> 100644 --- a/tests/Desarrolla2/Cache/Adapter/Test/FileTest.php +++ b/tests/Desarrolla2/Cache/Adapter/Test/FileTest.php @@ -47,7 +47,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ public function hasTest() { - $value = mktime(); + $value = time(); $this->cache->set('key', $value); $this->assertTrue($this->cache->has('key', $value)); } @@ -58,7 +58,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ public function getTest() { - $value = mktime(); + $value = time(); $this->cache->set('key', $value); $this->assertEquals($this->cache->get('key'), $value); } @@ -78,7 +78,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ public function deleteTest() { - $value = mktime(); + $value = time(); $this->cache->set('key2', $value); $this->cache->delete('key2'); }
removed apc from travis
desarrolla2_Cache
train
php
c518f6f97ca8686e1796824c993e5134d45c5c53
diff --git a/src/Schema.php b/src/Schema.php index <HASH>..<HASH> 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -580,17 +580,9 @@ class Schema implements \JsonSerializable { * @return bool|null Returns the cleaned value or **null** if validation fails. */ private function validateBoolean($value, ValidationField $field) { - if (!is_bool($value)) { - $bools = [ - '0' => false, 'false' => false, 'no' => false, 'off' => false, '' => false, - '1' => true, 'true' => true, 'yes' => true, 'on' => true - ]; - if ((is_string($value) || is_numeric($value)) && isset($bools[$value])) { - $value = $bools[$value]; - } else { - $field->addTypeError('boolean'); - $value = null; - } + $value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + if ($value === null) { + $field->addTypeError('boolean'); } return $value; }
Simplify boolean validation.
vanilla_garden-schema
train
php
25da34054315c95a80ac2369409fd3bb90eaf1d1
diff --git a/builtin/providers/azurerm/resource_arm_network_security_group.go b/builtin/providers/azurerm/resource_arm_network_security_group.go index <HASH>..<HASH> 100644 --- a/builtin/providers/azurerm/resource_arm_network_security_group.go +++ b/builtin/providers/azurerm/resource_arm_network_security_group.go @@ -66,6 +66,7 @@ func resourceArmNetworkSecurityGroup() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validateNetworkSecurityRuleProtocol, + StateFunc: ignoreCaseStateFunc, }, "source_port_range": { diff --git a/builtin/providers/azurerm/resource_arm_network_security_group_test.go b/builtin/providers/azurerm/resource_arm_network_security_group_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/azurerm/resource_arm_network_security_group_test.go +++ b/builtin/providers/azurerm/resource_arm_network_security_group_test.go @@ -204,7 +204,7 @@ resource "azurerm_network_security_group" "test" { priority = 100 direction = "Inbound" access = "Allow" - protocol = "Tcp" + protocol = "TCP" source_port_range = "*" destination_port_range = "*" source_address_prefix = "*"
Ignoring the case for NSG Protocol's in the state (#<I>)
hashicorp_terraform
train
go,go
0edfdb210986ee2b8fcf7dddc4d71c78f83bd427
diff --git a/lib/sfn/version.rb b/lib/sfn/version.rb index <HASH>..<HASH> 100644 --- a/lib/sfn/version.rb +++ b/lib/sfn/version.rb @@ -1,4 +1,4 @@ module Sfn # Current library version - VERSION = Gem::Version.new('3.0.30') + VERSION = Gem::Version.new('3.0.31') end
Update version for development <I>
sparkleformation_sfn
train
rb
24ba87430279b7ad1a04cd180713757d29806736
diff --git a/tile_generator/package_flags.py b/tile_generator/package_flags.py index <HASH>..<HASH> 100644 --- a/tile_generator/package_flags.py +++ b/tile_generator/package_flags.py @@ -125,14 +125,15 @@ class DockerBosh(FlagBase): job_name = 'docker-bosh-' + package['name'] release['requires_docker_bosh'] = True - release['packages'] += [{ - 'name': 'common', - 'files': [{ - 'name': 'utils.sh', - 'path': template.path('src/common/utils.sh') - }], - 'dir': 'src' - }] + if not 'common' in [p['name'] for p in release['packages']]: + release['packages'] += [{ + 'name': 'common', + 'files': [{ + 'name': 'utils.sh', + 'path': template.path('src/common/utils.sh') + }], + 'dir': 'src' + }] release['jobs'] += [{ 'name': job_name,
Add common package only once for package docker bosh
cf-platform-eng_tile-generator
train
py
232b9044188e3dd304343aa129301c6ad8ba5f63
diff --git a/src/Domain/StreamName.php b/src/Domain/StreamName.php index <HASH>..<HASH> 100644 --- a/src/Domain/StreamName.php +++ b/src/Domain/StreamName.php @@ -2,8 +2,6 @@ namespace HelloFresh\Engine\Domain; -use Assert\Assertion; - /** * Class StreamName * @@ -22,9 +20,13 @@ class StreamName */ public function __construct($name) { - Assertion::string($name, 'StreamName must be a string'); - Assertion::notEmpty($name, 'StreamName must not be empty'); - Assertion::maxLength($name, 200, 'StreamName should not be longer than 200 chars'); + if (!\is_string($name)) { + throw new \InvalidArgumentException('StreamName must be a string!'); + } + $len = \strlen($name); + if ($len === 0 || $len > 200) { + throw new \InvalidArgumentException('StreamName must not be empty and not longer than 200 chars!'); + } $this->name = $name; }
Remove usage of Assertion in StreamName
hellofresh_engine
train
php
26ed6b5c0ab7c1b2490fd002f117f7215a9be18b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ tests_require = [ 'hypothesis-pytest==0.19.0', 'py==1.4.31', 'pydocstyle==1.0.0', - 'pytest==3.0.1', + 'pytest==3.0.2', 'pytest-benchmark==3.0.0', 'pytest-cov==2.2.1', 'Sphinx==1.4.4',
upgrade to latest pytest (<I>)
jab_bidict
train
py
2cec82c6694425460c24b8373f114b3749257890
diff --git a/tensorflow_probability/python/distributions/mvn_full_covariance.py b/tensorflow_probability/python/distributions/mvn_full_covariance.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/distributions/mvn_full_covariance.py +++ b/tensorflow_probability/python/distributions/mvn_full_covariance.py @@ -186,3 +186,6 @@ class MultivariateNormalFullCovariance(mvn_tril.MultivariateNormalTriL): allow_nan_stats=allow_nan_stats, name=name) self._parameters = parameters + + def _params_event_ndims(self): + return dict(loc=1, covariance_matrix=2)
Hypothesis testing revealed that MVNFullCov supports slicing via subclassing of MVNTriL, but does not properly specify _params_event_ndims. PiperOrigin-RevId: <I>
tensorflow_probability
train
py
871fcf94afa0fcbfe2ca1ff2696a20da874b7094
diff --git a/src/components/checkbox/index.js b/src/components/checkbox/index.js index <HASH>..<HASH> 100644 --- a/src/components/checkbox/index.js +++ b/src/components/checkbox/index.js @@ -57,10 +57,11 @@ class Checkbox extends BaseComponent { }; render() { - const {value, selectedIcon, style} = this.getThemeProps(); + const {value, selectedIcon, style, ...others} = this.getThemeProps(); return ( <TouchableOpacity activeOpacity={1} + {...others} style={[this.styles.container, value && this.styles.containerSelected, style]} onPress={this.onPress} >
pass other props to Checkbox container
wix_react-native-ui-lib
train
js
3aa310613b75072d53511a3e3d24d630e7ddbb78
diff --git a/src/ChildProcess/Adapter.php b/src/ChildProcess/Adapter.php index <HASH>..<HASH> 100644 --- a/src/ChildProcess/Adapter.php +++ b/src/ChildProcess/Adapter.php @@ -212,9 +212,7 @@ class Adapter implements AdapterInterface 'type' => $entry['type'], ]; $promises[] = \React\Filesystem\detectType($this->typeDetectors, $node)->then(function (NodeInterface $node) use ($stream) { - $stream->emit('data', [ - $node, - ]); + $stream->write($node); return new FulfilledPromise(); });
Write to the stream instead of emitting it
reactphp_filesystem
train
php
28b3b3b8c82985a83ef8938d5bff374a76038578
diff --git a/src/Factory.php b/src/Factory.php index <HASH>..<HASH> 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -28,10 +28,10 @@ final class Factory ) { return new Promise\Promise(function ($resolve, $reject) use ($process, $loop, $options) { $server = new Server('127.0.0.1:0', $loop); - $argvString = \escapeshellarg(ArgvEncoder::encode([ - 'address' => $server->getAddress(), - ])); + $options['random'] = \bin2hex(\random_bytes(32)); + $options['address'] = $server->getAddress(); + $argvString = \escapeshellarg(ArgvEncoder::encode($options)); $process = new Process($process->getCommand() . ' ' . $argvString); self::startParent($process, $server, $loop, $options)->done($resolve, $reject);
Support for advanced own child from examples Fix when `address` and `random` options was not filled.
WyriHaximus_reactphp-child-process-messenger
train
php
e24ac009bdc1f94e32a35b7b3bbee821877a5f8d
diff --git a/api/protocol/lorawan/validation.go b/api/protocol/lorawan/validation.go index <HASH>..<HASH> 100644 --- a/api/protocol/lorawan/validation.go +++ b/api/protocol/lorawan/validation.go @@ -74,10 +74,10 @@ func (m *ActivationMetadata) Validate() bool { if m.DevEui == nil || m.DevEui.IsEmpty() { return false } - if m.DevAddr == nil || m.DevAddr.IsEmpty() { + if m.DevAddr != nil && m.DevAddr.IsEmpty() { return false } - if m.NwkSKey == nil || m.NwkSKey.IsEmpty() { + if m.NwkSKey != nil && m.NwkSKey.IsEmpty() { return false } return true
Fix ActivationMetadata validation Uplink ActivationMetadata does not have DevAddr and NwkSKey
TheThingsNetwork_ttn
train
go
701a3d14899ca03fff9d7a5a0f2a2f2b3948dee2
diff --git a/spec/gem_spec.rb b/spec/gem_spec.rb index <HASH>..<HASH> 100644 --- a/spec/gem_spec.rb +++ b/spec/gem_spec.rb @@ -3,11 +3,9 @@ require 'schema_dev/gem' describe SchemaDev::Gem do around(:each) do |example| - silence_stream(STDOUT) do - silence_stream(STDERR) do - in_tmpdir do - example.run - end + in_tmpdir do + suppress_stdout_stderr do + example.run end end end 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 @@ -15,6 +15,22 @@ def in_tmpdir end end +def suppress_stdout_stderr + save_stdout = STDOUT.dup + save_stderr = STDERR.dup + begin + Tempfile.open do |f| + STDOUT.reopen f + STDERR.reopen f + yield + end + ensure + STDERR.reopen save_stderr + STDOUT.reopen save_stdout + end +end + + def get_config(data) SchemaDev::Config._reset in_tmpdir do
replace deprecated silence_stream (activesupport) with local helper
SchemaPlus_schema_dev
train
rb,rb
b5062d0bd1a38215c97f00833a518445562b34a5
diff --git a/resources/lang/sv-SE/forms.php b/resources/lang/sv-SE/forms.php index <HASH>..<HASH> 100644 --- a/resources/lang/sv-SE/forms.php +++ b/resources/lang/sv-SE/forms.php @@ -155,7 +155,7 @@ return [ 'days-of-incidents' => 'Hur många dagar av händelser ska visas?', 'time_before_refresh' => 'Status page refresh rate (in seconds).', 'banner' => 'Bannerbild', - 'banner-help' => 'Vi rekommenderar att du inte laddar upp bilder som är bredare än 930 px.', + 'banner-help' => "Vi rekommenderar att du inte laddar upp bilder som är bredare än 930 px.", 'subscribers' => 'Tillåt att registrera sig för notifikationer via e-post?', 'suppress_notifications_in_maintenance' => 'Suppress notifications when incident occurs during maintenance period?', 'skip_subscriber_verification' => 'Skip verifying of users? (Be warned, you could be spammed)',
New translations forms.php (Swedish)
CachetHQ_Cachet
train
php
981d3e1cb1c0fa333fdd3a8cd4a28fd4219ed7f6
diff --git a/pyads/ads.py b/pyads/ads.py index <HASH>..<HASH> 100644 --- a/pyads/ads.py +++ b/pyads/ads.py @@ -5,6 +5,7 @@ :created on: 2018-06-11 18:15:53 """ +from __future__ import annotations import struct import itertools from collections import OrderedDict
Add __future__.annotations To prevent Sphinx from expanding custom types.
stlehmann_pyads
train
py
2ac4e2d6b5737ccfa00306432d9f41e294ed7e6a
diff --git a/chef/lib/chef/provider/file.rb b/chef/lib/chef/provider/file.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/file.rb +++ b/chef/lib/chef/provider/file.rb @@ -132,7 +132,9 @@ class Chef @current_resource.path(@new_resource.path) if !::File.directory?(@new_resource.path) if ::File.exist?(@new_resource.path) - @current_resource.checksum(checksum(@new_resource.path)) + if @action != :create_if_missing + @current_resource.checksum(checksum(@new_resource.path)) + end end end load_current_resource_attrs
Don't get checksum for create_if_missing We don't need the checksum in create for create_if_missing because we're going to create because we already know the file doesn't exist.
chef_chef
train
rb
9e971369bb6f30f4999be6cf2f8fc617f87f95c6
diff --git a/app/helpers/alchemy/pages_helper.rb b/app/helpers/alchemy/pages_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/alchemy/pages_helper.rb +++ b/app/helpers/alchemy/pages_helper.rb @@ -10,9 +10,7 @@ module Alchemy end def picture_essence_caption(content) - return "" if content.nil? - return "" if content.essence.nil? - content.essence.caption + content.try(:essence).try(:caption) end # Renders links to language root pages of all published languages. diff --git a/spec/helpers/pages_helper_spec.rb b/spec/helpers/pages_helper_spec.rb index <HASH>..<HASH> 100644 --- a/spec/helpers/pages_helper_spec.rb +++ b/spec/helpers/pages_helper_spec.rb @@ -388,5 +388,14 @@ module Alchemy end + describe "#picture_essence_caption" do + let(:essence) { mock_model('EssencePicture', caption: 'my caption') } + let(:content) { mock_model('Content', essence: essence) } + + it "should return the caption of the contents essence" do + expect(helper.picture_essence_caption(content)).to eq "my caption" + end + end + end end
Adds spec for PagesHelper#picture_essence_caption and refactors it.
AlchemyCMS_alchemy_cms
train
rb,rb