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
a82adaa4741de35a7c17cbe99340cf63c2efab2f
diff --git a/phy/plot/features.py b/phy/plot/features.py index <HASH>..<HASH> 100644 --- a/phy/plot/features.py +++ b/phy/plot/features.py @@ -241,8 +241,9 @@ class FeatureView(BaseSpikeCanvas): def on_key_press(self, event): coeff = .25 - if event.key == '+': - self.marker_size += coeff - if event.key == '-': - self.marker_size -= coeff - self.update() + if 'Control' in event.modifiers: + if event.key == '+': + self.marker_size += coeff + if event.key == '-': + self.marker_size -= coeff + self.update()
Fixed marker scale shortcut in feature view.
kwikteam_phy
train
py
bcdbe612af7f110a2015b750c1791d253b3687bb
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -155,7 +155,11 @@ export default class Masonry extends React.PureComponent { render() { return ( - <View style={{flex: 1}} + <View style={ + !this.props.containerWidth + ? {flex: 1} + : {flex: 1, width: this.props.containerWidth} + } onLayout={(event) => { if (!this.props.containerWidth) { this._setParentDimensions(event, this.props.columns, this.props.spacing);
Fixed fail safe dimensions for containerWidth prop.
Luehang_react-native-masonry-list
train
js
6c24d2ff6580d2dbc78dcbee3e26d7301b61d7d5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,13 @@ from distutils.core import setup setup(name='django-categories', - version='0.1', + version='0.2', description='A way to handle one or more hierarchical category trees in django.', long_description='This app attempts to provide a generic category system that multiple apps could use. It uses MPTT for the tree storage and provides a custom admin for better visualization (copied and modified from feinCMS).', author='Corey Oordt', author_email='[email protected]', url='http://opensource.washingtontimes.com/projects/django-categories/', - packages=['categories'], + packages=['categories', 'editor'], classifiers=['Development Status :: 4 - Beta', 'Framework :: Django', 'License :: OSI Approved :: Apache License',
upped the version and separated the editor
callowayproject_django-categories
train
py
c0ec78bf15192affc7d9616690174420a2e63333
diff --git a/touchables/GenericTouchable.js b/touchables/GenericTouchable.js index <HASH>..<HASH> 100644 --- a/touchables/GenericTouchable.js +++ b/touchables/GenericTouchable.js @@ -39,6 +39,8 @@ const PublicPropTypes = { delayPressIn: PropTypes.number, delayPressOut: PropTypes.number, delayLongPress: PropTypes.number, + shouldActivateOnStart: PropTypes.bool, + disallowInterruption: PropTypes.bool, }; const InternalPropTypes = { @@ -262,6 +264,8 @@ export default class GenericTouchable extends Component { } onGestureEvent={this.onGestureEvent} hitSlop={this.props.hitSlop} + shouldActivateOnStart={this.props.shouldActivateOnStart} + disallowInterruption={this.props.disallowInterruption} {...this.props.extraButtonProps}> <Animated.View {...coreProps} style={this.props.style}> {this.props.children}
make it possible to use shouldActivateOnStart and disallowInterruption in touchables (#<I>)
kmagiera_react-native-gesture-handler
train
js
2a48a36862b1bd7b0738abf0fd49920a09e13323
diff --git a/src/js/tests/unit/select2-loader.js b/src/js/tests/unit/select2-loader.js index <HASH>..<HASH> 100644 --- a/src/js/tests/unit/select2-loader.js +++ b/src/js/tests/unit/select2-loader.js @@ -36,9 +36,9 @@ $(function () { ); QUnit.test( - 'should call the ckeditor() method on the textarea on page load with no attribute', + 'should call the select2 method on the select element on page load with no attribute', function () { - var $select = $('<select data-onload-select2="">Some text</select>'); + var $select = $('<select data-onload-select2>Some text</select>'); $('#qunit-fixture').append($select); sinon.spy(jQuery.fn, 'select2');
Improve select2-loader test to test if attribute has no value
visionappscz_bootstrap-ui
train
js
7255e3a913aa3e088b220cbedc7befbdeb0bac6e
diff --git a/includes/object-cache.php b/includes/object-cache.php index <HASH>..<HASH> 100644 --- a/includes/object-cache.php +++ b/includes/object-cache.php @@ -380,7 +380,7 @@ class WP_Object_Cache { /** * Track how long request took. * - * @var int + * @var float */ public $cache_time = 0;
Fix cache time's type in WP_Object_Cache A `float` is put in it everywhere.
tillkruss_redis-cache
train
php
b66c34eac375ae080412e29f0d9651ba77d8d36e
diff --git a/packages/create-next-app/templates/default/components/nav.js b/packages/create-next-app/templates/default/components/nav.js index <HASH>..<HASH> 100644 --- a/packages/create-next-app/templates/default/components/nav.js +++ b/packages/create-next-app/templates/default/components/nav.js @@ -4,10 +4,10 @@ import Link from 'next/link' const links = [ { href: 'https://zeit.co/now', label: 'ZEIT' }, { href: 'https://github.com/zeit/next.js', label: 'GitHub' }, -].map(link => { - link.key = `nav-link-${link.href}-${link.label}` - return link -}) +].map(link => ({ + ...link, + key: `nav-link-${link.href}-${link.label}`, +})) const Nav = () => ( <nav>
Fix js template to be TS compatible (#<I>)
zeit_next.js
train
js
15e7f6e8728d72786f8720ef4f7635c5791dcdb4
diff --git a/master/buildbot/test/integration/test_upgrade.py b/master/buildbot/test/integration/test_upgrade.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/integration/test_upgrade.py +++ b/master/buildbot/test/integration/test_upgrade.py @@ -143,7 +143,7 @@ class UpgradeTestMixin(db.RealDatabaseMixin): implied = [idx for (tname, idx) in self.db.model.implied_indexes if tname == tbl.name] - exp = sorted(exp + implied) + exp = sorted(exp + implied, key=lambda k: k["name"]) got = sorted(insp.get_indexes(tbl.name), key=lambda x: x['name'])
Use a key when comparing dictionaries This fixes tests on Python 3.
buildbot_buildbot
train
py
529a57ebcbcf51a7f510591bcc1c465822ecb6b6
diff --git a/tests/unit/modules/win_useradd_test.py b/tests/unit/modules/win_useradd_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/win_useradd_test.py +++ b/tests/unit/modules/win_useradd_test.py @@ -157,9 +157,7 @@ class com_error(Exception): """ Mock of com_error """ - def __init__(self, message): - self.msg = message - + pass class pywintypes(object): '''
removed pylint error
saltstack_salt
train
py
1443b1c8965716e02ddca590ef742e7cc3ab9932
diff --git a/fritzhome/actor.py b/fritzhome/actor.py index <HASH>..<HASH> 100644 --- a/fritzhome/actor.py +++ b/fritzhome/actor.py @@ -81,9 +81,12 @@ class Actor(object): Returns the current environment temperature. Attention: Returns None if the value can't be queried or is unknown. """ - raise NotImplementedError("This should work according to the AVM docs, but don't...") + #raise NotImplementedError("This should work according to the AVM docs, but don't...") value = self.box.homeautoswitch("gettemperature", self.actor_id) - return int(value) if value.isdigit() else None + if value.isdigit(): + return float(value)/10 + else: + return None def get_consumption(self, timerange="10"): """
Temperature as float temperature need to be returned as float (xx.x°). Also delete raise.
DerMitch_fritzbox-smarthome
train
py
860cec4593e5e8e03ed02bf9a9b97501872d4503
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.0.2', + version='0.0.3', py_modules=['bbc_tracklist', 'cmdline'], description='Download BBC radio show tracklistings', #long_description=long_description,
Update setup.py for <I> release Python <I> is out, but not <I>% sure that mediafile supports it, so have left the versions intact here.
StevenMaude_bbc-radio-tracklisting-downloader
train
py
c3a9521bba4709d580285481be55df6322308cd9
diff --git a/core/app/helpers/refinery/image_helper.rb b/core/app/helpers/refinery/image_helper.rb index <HASH>..<HASH> 100644 --- a/core/app/helpers/refinery/image_helper.rb +++ b/core/app/helpers/refinery/image_helper.rb @@ -21,14 +21,15 @@ module Refinery # and we wanted to display a thumbnail cropped to 200x200 then we can use image_fu like this: # <%= image_fu @model.image, '200x200' %> or with no thumbnail: <%= image_fu @model.image %> def image_fu(image, geometry = nil, options = {}) - if image.present? - dimensions = (image.thumbnail_dimensions(geometry) rescue {}) + return nil if image.blank? - image_tag(image.thumbnail(:geometry => geometry, - :strip => options[:strip]).url, { - :alt => image.respond_to?(:title) ? image.title : image.image_name, - }.merge(dimensions).merge(options)) - end + thumbnail_args = options.slice(:strip) + thumbnail_args[:geometry] = geometry if geometry + + image_tag_args = (image.thumbnail_dimensions(geometry) rescue {}) + image_tag_args[:alt] = image.respond_to?(:title) ? image.title : image.image_name + + image_tag(image.thumbnail(thumbnail_args).url, image_tag_args.merge(options)) end end end
Refactored image_fu helper to only use geometry when not nil.
refinery_refinerycms
train
rb
ed548e70eb7973684db9208ba3895c87a4d5f28e
diff --git a/views/cypress/tests/manage-schema.spec.js b/views/cypress/tests/manage-schema.spec.js index <HASH>..<HASH> 100644 --- a/views/cypress/tests/manage-schema.spec.js +++ b/views/cypress/tests/manage-schema.spec.js @@ -126,4 +126,4 @@ cy.removePropertyFromClass(className, newPropertyName, selectors.itemClassForm, selectors.editClass, selectors.classOptions, selectors.editClassUrl); }); }); -}); \ No newline at end of file +});
chore: add new line at eof
oat-sa_extension-tao-item
train
js
e3e6a1fa2adaf4780368f939d583688b4fc2be74
diff --git a/test/HelmetTest.js b/test/HelmetTest.js index <HASH>..<HASH> 100644 --- a/test/HelmetTest.js +++ b/test/HelmetTest.js @@ -62,7 +62,9 @@ describe("Helmet", () => { ReactDOM.render( <div> <Helmet title={"Main Title"} /> - <Helmet title={"Nested Title"} /> + <div> + <Helmet title={"Nested Title"} /> + </div> </div>, container );
Fixed Nested Title Test (#<I>)
nfl_react-helmet
train
js
3fbbd3b1e2647f185ed9e1190b7ec17fd76cc3a9
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -7,8 +7,8 @@ import ( "io/ioutil" "net/http" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" + "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/openstack" ) type Config struct { @@ -45,7 +45,6 @@ func (c *Config) loadAndValidate() error { UserID: c.UserID, Password: c.Password, TokenID: c.Token, - APIKey: c.APIKey, IdentityEndpoint: c.IdentityEndpoint, TenantID: c.TenantID, TenantName: c.TenantName,
provider/openstack: gophercloud migration: Removing APIKey Attribute gophercloud/gophercloud no longer supports the APIKey authentication attribute. Removal of this attribute may impact users who were using the Terraform OpenStack provider in with vendor-modified clouds.
terraform-providers_terraform-provider-openstack
train
go
2e983b803fc3fe71cbabce448319c9a5df819c98
diff --git a/kbfsblock/context.go b/kbfsblock/context.go index <HASH>..<HASH> 100644 --- a/kbfsblock/context.go +++ b/kbfsblock/context.go @@ -50,7 +50,7 @@ type Context struct { Creator keybase1.UserOrTeamID `codec:"c"` // Writer is the UID that should be charged for this reference to // the block. If empty, it defaults to Creator. - Writer keybase1.UserOrTeamID `codec:"w,omitempty"` + Writer keybase1.UserOrTeamID `codec:"w,omitempty" json:",omitempty"` // When RefNonce is all 0s, this is the initial reference to a // particular block. Using a constant refnonce for the initial // reference allows the server to identify and optimize for the
kbfsblock: allow writer to be empty in json Now protocol unmarshal enforces it.
keybase_client
train
go
9382b47750f9fb31cf795d5db79078e411e603fa
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,6 @@ export default { * true value */ const chainCans = (metas, to, from) => { - // store most recent fail let fail = null const chain = metas.reduce((chain, meta) => { return chain @@ -94,23 +93,15 @@ export default { ? meta.can(to, from, canNavigate) : Promise.resovle(canNavigate(...metaToStatementPair(meta))) - if (nextPromise instanceof Promise) { - return nextPromise; - } - - if (options.strict) { + if (options.strict && !(nextPromise instanceof Promise)) { throw new Error('$route.meta.can must return a promise in strict mode') } - return Boolean(nextPromise) + + return nextPromise }) .catch(error => false) // convert errors to false }, Promise.resolve(true)) - - /* getter to access fail route later */ - chain.getFail = () => { - return fail - } - + chain.getFail = () => fail return chain }
refactor: shorten and simplify chain impl.
mblarsen_vue-browser-acl
train
js
6d684ea7fd7076814a045a362faf2632a5056f3f
diff --git a/parsimonious/expressions.py b/parsimonious/expressions.py index <HASH>..<HASH> 100644 --- a/parsimonious/expressions.py +++ b/parsimonious/expressions.py @@ -344,7 +344,6 @@ class Sequence(Compound): """ def _uncached_match(self, text, pos, cache, error): new_pos = pos - length_of_sequence = 0 children = [] for m in self.members: node = m.match_core(text, new_pos, cache, error) @@ -353,9 +352,8 @@ class Sequence(Compound): children.append(node) length = node.end - node.start new_pos += length - length_of_sequence += length # Hooray! We got through all the members! - return Node(self, text, pos, pos + length_of_sequence, children) + return Node(self, text, pos, new_pos, children) def _as_rhs(self): return u'({0})'.format(u' '.join(self._unicode_members()))
remove some redundant code in Sequence expression (#<I>)
erikrose_parsimonious
train
py
bf39ec6b17e6ae83ff22bb2c2fd091bd8b59a06a
diff --git a/pycbc/types/timeseries.py b/pycbc/types/timeseries.py index <HASH>..<HASH> 100644 --- a/pycbc/types/timeseries.py +++ b/pycbc/types/timeseries.py @@ -840,7 +840,7 @@ class TimeSeries(Array): def add_into(self, other): """Return the sum of the two time series accounting for the time stamp. - The other vector will be resized and time shifted wiht sub-sample + The other vector will be resized and time shifted with sub-sample precision before adding. This assumes that one can assume zeros outside of the original vector range. """
Fix typo (#<I>)
gwastro_pycbc
train
py
ad68854f9866d4bfa8c8667f42ebaf165e4fb28d
diff --git a/Demo/src/androidTest/java/com/braintreepayments/demo/test/utilities/TestHelper.java b/Demo/src/androidTest/java/com/braintreepayments/demo/test/utilities/TestHelper.java index <HASH>..<HASH> 100644 --- a/Demo/src/androidTest/java/com/braintreepayments/demo/test/utilities/TestHelper.java +++ b/Demo/src/androidTest/java/com/braintreepayments/demo/test/utilities/TestHelper.java @@ -24,6 +24,7 @@ public class TestHelper { PreferenceManager.getDefaultSharedPreferences(getTargetContext()) .edit() .clear() + .putBoolean("paypal_use_hardcoded_configuration", true) .commit(); onDevice().onHomeScreen().launchApp("com.braintreepayments.demo");
Use PayPal hardcoded config in demo app tests
braintree_braintree_android
train
java
c29df127675f92dc14baaa190ee3bc3ab14c34d8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -133,7 +133,11 @@ def create_mo_files(): lang, extension = path.splitext(po_file) mo_dir = path.join(localedir, lang, 'LC_MESSAGES') mo_file = domain + '.mo' - msgfmt_cmd = 'msgfmt {} -o {}'.format(path.join(localedir, po_file), path.join(mo_dir, mo_file)) + try: + os.makedirs(mo_dir) + except os.error: # already exists + pass + msgfmt_cmd = 'msgfmt -o {} {}'.format(path.join(mo_dir, mo_file), path.join(localedir, po_file)) subprocess.call(msgfmt_cmd, shell=True) data_files.append(get_data_files_tuple(mo_dir))
fix(setup.py): Create mo directory before compilation
DLR-RM_RAFCON
train
py
c98ca9a7225a70d8287f7be76f502912bd978ec9
diff --git a/clamdispatcher.py b/clamdispatcher.py index <HASH>..<HASH> 100755 --- a/clamdispatcher.py +++ b/clamdispatcher.py @@ -35,6 +35,10 @@ def mem(pid, size="rss"): if len(sys.argv) < 4: print >>sys.stderr,"[CLAM Dispatcher] ERROR: Invalid syntax, use clamdispatcher.py [pythonpath] settingsmodule projectdir cmd arg1 arg2 ..." + f = open(projectdir + '.done','w') + f.write(str(1)) + f.close() + os.unlink(projectdir + '.pid') sys.exit(1) offset = 0 @@ -54,9 +58,17 @@ print >>sys.stderr, "[CLAM Dispatcher] Started (" + datetime.datetime.now().strf if not cmd: print >>sys.stderr, "[CLAM Dispatcher] FATAL ERROR: No command specified!" + f = open(projectdir + '.done','w') + f.write(str(1)) + f.close() + os.unlink(projectdir + '.pid') sys.exit(1) elif not os.path.isdir(projectdir): print >>sys.stderr, "[CLAM Dispatcher] FATAL ERROR: Project directory "+ projectdir + " does not exist" + f = open(projectdir + '.done','w') + f.write(str(1)) + f.close() + os.unlink(projectdir + '.pid') sys.exit(1) exec "import " + settingsmodule + " as settings"
dispatcher errors should clean up dotfiles
proycon_clam
train
py
f3e03bf421d9292c3c56f410413b593169fdd124
diff --git a/src/styles/style_parser.js b/src/styles/style_parser.js index <HASH>..<HASH> 100644 --- a/src/styles/style_parser.js +++ b/src/styles/style_parser.js @@ -1,5 +1,6 @@ import Utils from '../utils/utils'; import Geo from '../geo'; +import log from '../utils/log'; import parseCSSColor from 'csscolorparser'; @@ -525,7 +526,11 @@ StyleParser.calculateOrder = function(order, context) { // Evaluate a function-based property, or pass-through static value StyleParser.evalProperty = function(prop, context) { if (typeof prop === 'function') { - return prop(context); + try { + return prop(context); + } catch(e) { + log('warn', e); + } } return prop; };
try/catch on evalProperty
tangrams_tangram
train
js
0baaed5cc3a6e25bf376998edd8b1a1870069e58
diff --git a/usage/usage_test.go b/usage/usage_test.go index <HASH>..<HASH> 100644 --- a/usage/usage_test.go +++ b/usage/usage_test.go @@ -146,6 +146,9 @@ func TestUsageMinusOne(t *testing.T) { mock.Add(29 * time.Second) assertLen(59, aggmetrics, 0, t) mock.Add(time.Second) + // not very pretty.. but an easy way to assure that the Usage Reporter + // goroutine has some time to push the results into our fake aggmetrics + time.Sleep(20 * time.Millisecond) assertLen(60, aggmetrics, 6, t) assert(60, aggmetrics, 1, "metrictank.usage-minus1.numSeries", 60, 1, t) assert(60, aggmetrics, 1, "metrictank.usage-minus1.numPoints", 60, 1, t)
this should fix #<I> there still might be the 3rd race, on usage.Clock but 1e9e5dc<I>f7c<I>b1f<I>b<I>cacbd<I>b should have adressed that and it hasn't showed in a while
grafana_metrictank
train
go
24dde403c9a0978e60ebf56e8fe199dc0442357f
diff --git a/app/packages/gamejs/lib/gamejs.js b/app/packages/gamejs/lib/gamejs.js index <HASH>..<HASH> 100644 --- a/app/packages/gamejs/lib/gamejs.js +++ b/app/packages/gamejs/lib/gamejs.js @@ -262,6 +262,10 @@ Rect.prototype.toString = function() { return ["[", this.left, ",", this.top, "]"," [",this.width, ",", this.height, "]"].join(""); } +Rect.prototype.clone = function() { + return new Rect(this); +}; + /** * A Surface represents a bitmap image with a fixed width and height. The * most important feature of a Surface is that they can be `blitted` @@ -335,7 +339,7 @@ Surface.prototype.blit = function(src, dest, area, special_flags) { // dest, we only care about x, y if (dest instanceof Rect) { - rDest = dest; // new gamejs.Rect([dest.left, dest.top], src.getSize()); + rDest = dest.clone(); // new gamejs.Rect([dest.left, dest.top], src.getSize()); var srcSize = src.getSize(); if (!rDest.width) rDest.width = srcSize[0]; if (!rDest.height) rDest.height = srcSize[1];
fix blit modifying passed in rect reference; new: Rect.clone()
GameJs_gamejs
train
js
8500f251a3c20b95561057aa7245a03451e74f69
diff --git a/django_jenkins/tasks/run_pyflakes.py b/django_jenkins/tasks/run_pyflakes.py index <HASH>..<HASH> 100644 --- a/django_jenkins/tasks/run_pyflakes.py +++ b/django_jenkins/tasks/run_pyflakes.py @@ -2,6 +2,7 @@ import os import re import sys +from optparse import make_option from pyflakes.scripts import pyflakes try: @@ -11,6 +12,14 @@ except ImportError: class Reporter(object): + option_list = ( + make_option("--pyflakes-exclude-dir", + action="append", + default=['south_migrations'], + dest="pyflakes_exclude_dirs", + help="Path name to exclude"), + ) + def run(self, apps_locations, **options): output = open(os.path.join(options['output_dir'], 'pyflakes.report'), 'w') @@ -21,7 +30,8 @@ class Reporter(object): for location in apps_locations: if os.path.isdir(location): for dirpath, dirnames, filenames in os.walk(os.path.relpath(location)): - if dirpath.endswith(os.sep + 'south_migrations'): + if dirpath.endswith(tuple( + ''.join([os.sep, exclude_dir]) for exclude_dir in options['pyflakes_exclude_dirs'])): continue for filename in filenames:
Added support for excluding paths in the pyflakes runner
kmmbvnr_django-jenkins
train
py
5272cec6c8c3a24a79ced409a625d998ea7e289a
diff --git a/src/client/ClientDataResolver.js b/src/client/ClientDataResolver.js index <HASH>..<HASH> 100644 --- a/src/client/ClientDataResolver.js +++ b/src/client/ClientDataResolver.js @@ -307,6 +307,7 @@ class ClientDataResolver { * ``` * [ * 'DEFAULT', + * 'WHITE', * 'AQUA', * 'GREEN', * 'BLUE', diff --git a/src/util/Constants.js b/src/util/Constants.js index <HASH>..<HASH> 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -705,6 +705,7 @@ exports.UserChannelOverrideMap = { exports.Colors = { DEFAULT: 0x000000, + WHITE: 0xFFFFFF, AQUA: 0x1ABC9C, GREEN: 0x2ECC71, BLUE: 0x3498DB, diff --git a/typings/index.d.ts b/typings/index.d.ts index <HASH>..<HASH> 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1667,6 +1667,7 @@ declare module 'discord.js' { type CollectorOptions = { time?: number }; type ColorResolvable = ('DEFAULT' + | 'WHITE' | 'AQUA' | 'GREEN' | 'BLUE'
feat(Util): add WHITE as color resolvable (#<I>)
discordjs_discord.js
train
js,js,ts
2127d6a1a1014d7e9c9643c641fd080454b53d30
diff --git a/custom_services/CustomYandexOAuthService.php b/custom_services/CustomYandexOAuthService.php index <HASH>..<HASH> 100644 --- a/custom_services/CustomYandexOAuthService.php +++ b/custom_services/CustomYandexOAuthService.php @@ -53,7 +53,7 @@ class CustomYandexOAuthService extends YandexOAuthService { return $this->getIsAuthenticated(); } - protected function getCodeUrl($redirect_uri, $state) { + protected function getCodeUrl($redirect_uri, $state = '') { return $this->providerOptions['authorize'] . '?client_id=' . $this->client_id . '&redirect_uri=' . urlencode($redirect_uri) . '&scope=' . $this->scope . '&response_type=code&state=' . urlencode($state); }
Fix interface incompatibility in custom Yandex OAuth service.
Nodge_yii-eauth
train
php
a2faaa131711e5028ded2487a6d63c23bb54dfe6
diff --git a/libcontainer/cgroups/utils.go b/libcontainer/cgroups/utils.go index <HASH>..<HASH> 100644 --- a/libcontainer/cgroups/utils.go +++ b/libcontainer/cgroups/utils.go @@ -155,14 +155,16 @@ func getCgroupMountsHelper(ss map[string]bool, mi io.Reader, all bool) ([]Mount, if !known || (!all && seen) { continue } + ss[opt] = true if strings.HasPrefix(opt, cgroupNamePrefix) { opt = opt[len(cgroupNamePrefix):] } m.Subsystems = append(m.Subsystems, opt) - ss[opt] = true numFound++ } - res = append(res, m) + if len(m.Subsystems) > 0 || all { + res = append(res, m) + } } if err := scanner.Err(); err != nil { return nil, err
Fix duplicate entries and missing entries in getCgroupMountsHelper
opencontainers_runc
train
go
c86c7a123a5b2436cf87fc133a448426e160695e
diff --git a/Kwc/Abstract/Image/ImageUploadField.php b/Kwc/Abstract/Image/ImageUploadField.php index <HASH>..<HASH> 100644 --- a/Kwc/Abstract/Image/ImageUploadField.php +++ b/Kwc/Abstract/Image/ImageUploadField.php @@ -18,14 +18,12 @@ class Kwc_Abstract_Image_ImageUploadField extends Kwf_Form_Container_Abstract $this->fields->add($this->_image); $this->_dimensions = $dimensions; - if (count($dimensions) > 1) { - $this->fields->add(new Kwc_Abstract_Image_DimensionField('dimension', trlKwf('Dimension'))) - ->setAllowBlank(false) - ->setTriggerClass('cropTrigger') - ->setLabelStyle('display:none') - ->setCtCls('dimensionContainer') - ->setDimensions($dimensions); - } + $this->fields->add(new Kwc_Abstract_Image_DimensionField('dimension', trlKwf('Dimension'))) + ->setAllowBlank(false) + ->setTriggerClass('cropTrigger') + ->setLabelStyle('display:none') + ->setCtCls('dimensionContainer') + ->setDimensions($dimensions); } public function setShowHelptext($showHelptext)
Enable dimension-field also if only one dimension is defined
koala-framework_koala-framework
train
php
cd24eced2107e518a753256bfc51ccdacf227d47
diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py index <HASH>..<HASH> 100644 --- a/src/saml2/client_base.py +++ b/src/saml2/client_base.py @@ -301,6 +301,9 @@ class Base(Entity): except KeyError: pass + if sign is None: + sign = self.authn_requests_signed + if (sign and self.sec.cert_handler.generate_cert()) or \ client_crt is not None: with self.lock:
Whatever is defined in the configuration is the default.
IdentityPython_pysaml2
train
py
4a686e11ba87ebf2100eb57dbb6bb9b09050dfc1
diff --git a/discord/guild.py b/discord/guild.py index <HASH>..<HASH> 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -905,6 +905,15 @@ class Guild(Hashable): The channel's preferred audio bitrate in bits per second. user_limit: :class:`int` The channel's limit for number of members that can be in a voice channel. + + Raises + ------ + Forbidden + You do not have the proper permissions to create this channel. + HTTPException + Creating the channel failed. + InvalidArgument + The permission overwrite information is not in proper form. Returns ------- @@ -927,6 +936,15 @@ class Guild(Hashable): The ``category`` parameter is not supported in this function since categories cannot have categories. + + Raises + ------ + Forbidden + You do not have the proper permissions to create this channel. + HTTPException + Creating the channel failed. + InvalidArgument + The permission overwrite information is not in proper form. Returns -------
Added exception documentation for Guild.create_voice_channel
Rapptz_discord.py
train
py
c7fa4a9f53bd0e9070db0807072f2bcb0f041f2c
diff --git a/src/main/java/net/sourceforge/tess4j/util/PdfUtilities.java b/src/main/java/net/sourceforge/tess4j/util/PdfUtilities.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/sourceforge/tess4j/util/PdfUtilities.java +++ b/src/main/java/net/sourceforge/tess4j/util/PdfUtilities.java @@ -212,6 +212,27 @@ public class PdfUtilities { return pageCount; } +// /** +// * Gets PDF Page Count using Ghost4J's new high-level API available in Ghost4J 0.4.0. +// * (Taken out due to many required additional libraries.) +// * +// * @param inputPdfFile +// * @return number of pages +// */ +// public static int getPdfPageCount1(String inputPdfFile) { +// int pageCount = 0; +// +// try { +// // load PDF document +// PDFDocument document = new PDFDocument(); +// document.load(new File(inputPdfFile)); +// pageCount = document.getPageCount(); +// } catch (Exception e) { +// logger.log(Level.SEVERE, e.getMessage(), e); +// } +// return pageCount; +// } + /** * Merge PDF files. *
Possible alternative to getPdfPageCount
nguyenq_tess4j
train
java
d18fd8037d2aa020104ba6b5bd345ebfed72d44b
diff --git a/wisdom-api/src/main/java/org/wisdom/api/model/Repository.java b/wisdom-api/src/main/java/org/wisdom/api/model/Repository.java index <HASH>..<HASH> 100644 --- a/wisdom-api/src/main/java/org/wisdom/api/model/Repository.java +++ b/wisdom-api/src/main/java/org/wisdom/api/model/Repository.java @@ -10,9 +10,8 @@ import java.util.Collection; * Providers must register the 'repository.name' and 'repository.type' properties with their service registration. * * @param <T> the type of repository - * @param <I> type of key used by the repository */ -public interface Repository<T, I extends Serializable> { +public interface Repository<T> { /** * The service property that <strong>must</strong> be published to indicate the repository name. @@ -29,7 +28,7 @@ public interface Repository<T, I extends Serializable> { * by the current repository. * @return the set of Curd service, empty if none. */ - Collection<Crud<?, I>> getCrudServices(); + Collection<Crud<?, ?>> getCrudServices(); /** * The name of the repository.
Repository should not define the type of key
wisdom-framework_wisdom
train
java
9a76512bcc79a289b0f514a10f22a09c6d6d9c31
diff --git a/lib/sbsm/lookandfeel.rb b/lib/sbsm/lookandfeel.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/lookandfeel.rb +++ b/lib/sbsm/lookandfeel.rb @@ -50,7 +50,7 @@ module SBSM set_dictionary(@language) end def attributes(key) - self::class::HTML_ATTRIBUTES.fetch(key, {}).dup + self::class::HTML_ATTRIBUTES.fetch(key.to_sym, {}).dup end def base_url [@session.http_protocol + ':/', @session.server_name, @language, @flavor].compact.join("/") diff --git a/lib/sbsm/lookandfeelwrapper.rb b/lib/sbsm/lookandfeelwrapper.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/lookandfeelwrapper.rb +++ b/lib/sbsm/lookandfeelwrapper.rb @@ -34,7 +34,7 @@ module SBSM @component.send(symbol, *args, &block) end def attributes(key) - self::class::HTML_ATTRIBUTES.fetch(key) { + self::class::HTML_ATTRIBUTES.fetch(key.to_sym) { @component.attributes(key) } end
find all Html-Attributes via their Symbol
zdavatz_sbsm
train
rb,rb
ea76f5686d45211003315f2db21fdc83284667d5
diff --git a/master/buildbot/steps/python_twisted.py b/master/buildbot/steps/python_twisted.py index <HASH>..<HASH> 100644 --- a/master/buildbot/steps/python_twisted.py +++ b/master/buildbot/steps/python_twisted.py @@ -535,7 +535,7 @@ class Trial(ShellCommand): if warnings: lines = sorted(warnings.keys()) - self.addCompleteLog("warnings", "\n".join(lines)) + self.addCompleteLog("warnings", "".join(lines)) def evaluateCommand(self, cmd): return self.results
That was one \n too much
buildbot_buildbot
train
py
8a1c5cf24c539dd71493267438b2b3bd555fb7c3
diff --git a/extensions/flags/src/Listener/AddPostFlagsRelationship.php b/extensions/flags/src/Listener/AddPostFlagsRelationship.php index <HASH>..<HASH> 100755 --- a/extensions/flags/src/Listener/AddPostFlagsRelationship.php +++ b/extensions/flags/src/Listener/AddPostFlagsRelationship.php @@ -119,10 +119,12 @@ class AddPostFlagsRelationship $postsWithPermission = []; foreach ($posts as $post) { - $post->setRelation('flags', null); + if (is_object($post)) { + $post->setRelation('flags', null); - if ($actor->can('viewFlags', $post->discussion)) { - $postsWithPermission[] = $post; + if ($actor->can('viewFlags', $post->discussion)) { + $postsWithPermission[] = $post; + } } }
Don't set flags relationship on non-hydrated posts
flarum_core
train
php
cea7842eea1526550beaf6a32716ed6357560871
diff --git a/claripy/frontend.py b/claripy/frontend.py index <HASH>..<HASH> 100644 --- a/claripy/frontend.py +++ b/claripy/frontend.py @@ -399,8 +399,9 @@ class Frontend(ana.Storable): if self._concrete_type_check(e) and self._concrete_type_check(v): return e == v - if self._eager_resolution('solution', False, e, v): - return True + eager_solution = self._eager_resolution('solution', None, e, v) + if eager_solution is not None: + return eager_solution b = self._solution(e, v, extra_constraints=extra_constraints, exact=exact, cache=cache) if b is False and len(extra_constraints) == 0 and e.symbolic:
properly use the eager backends to resolve a solution check
angr_claripy
train
py
588745019d7423596effef690b06f02df03e89ed
diff --git a/src/Controllers/Async.php b/src/Controllers/Async.php index <HASH>..<HASH> 100644 --- a/src/Controllers/Async.php +++ b/src/Controllers/Async.php @@ -703,13 +703,6 @@ class Async implements ControllerProviderInterface // Start the 'stopwatch' for the profiler. $app['stopwatch']->start('bolt.async.before'); - // Only set which endpoint it is, if it's not already set. Which it is, in cases like - // when it's embedded on a page using {{ render() }} - // @todo Is this still needed? - if (empty($app['end'])) { - $app['end'] = "asynchronous"; - } - // If there's no active session, don't do anything.. if (!$app['users']->isValidSession()) { $app->abort(404, "You must be logged in to use this.");
Remove a @todo and related crap that was wrong in the first place
bolt_bolt
train
php
72b001aaadbf6ddd9cde58398aca71042de62d42
diff --git a/src/common/system.js b/src/common/system.js index <HASH>..<HASH> 100644 --- a/src/common/system.js +++ b/src/common/system.js @@ -251,7 +251,13 @@ sre.System.prototype.toEnriched = function(expr) { var root = sre.WalkerUtil.getSemanticRoot(enr); switch (sre.Engine.getInstance().speech) { case sre.Engine.Speech.SHALLOW: - (new sre.AdhocSpeechGenerator()).getSpeech(root, enr); + var speech = sre.System.getInstance().toSpeech(expr); + root.setAttribute(sre.EnrichMathml.Attribute.SPEECH, speech); + // The following is how it should be done. But there are still some + // problems with tables and embellished elements that make rebuilt + // difficult. + // + // (new sre.AdhocSpeechGenerator()).getSpeech(root, enr); break; case sre.Engine.Speech.DEEP: (new sre.TreeSpeechGenerator()).getSpeech(root, enr);
Work around for enrichment with shallow speech computation.
zorkow_speech-rule-engine
train
js
a8f6747726952c757a420a742383b63d40e9d04b
diff --git a/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java b/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java +++ b/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java @@ -825,8 +825,9 @@ public class ClusterTest final TestNode oldFollower2 = cluster.startStaticNode(followers.get(1).index(), true); cluster.awaitLeader(); - awaitElectionClosed(oldFollower1); - awaitElectionClosed(oldFollower2); + + cluster.awaitServiceMessageCount(oldFollower1, messageCount); + cluster.awaitServiceMessageCount(oldFollower2, messageCount); assertEquals(0L, oldLeader.errors()); assertEquals(0L, oldFollower1.errors());
[Java] Await service message count before confirming there are no errors after catchup.
real-logic_aeron
train
java
029c693f19ee088af329620fb729dd9005080755
diff --git a/lib/action_mailroom/mailbox.rb b/lib/action_mailroom/mailbox.rb index <HASH>..<HASH> 100644 --- a/lib/action_mailroom/mailbox.rb +++ b/lib/action_mailroom/mailbox.rb @@ -31,6 +31,8 @@ class ActionMailroom::Mailbox inbound_email.delivered! rescue => exception inbound_email.failed! + + # TODO: Include a reference to the inbound_email in the exception raised so error handling becomes easier rescue_with_handler(exception) || raise end
Make a note for tying inbound email to exception Then InboundEmail doesn't need to serialize or track the exception that went with it. The arrow will point the other way.
rails_rails
train
rb
ebf874ea0d0c55d2c30ec7526d8df787014c7f70
diff --git a/plugins/API/API.php b/plugins/API/API.php index <HASH>..<HASH> 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -925,6 +925,7 @@ class Piwik_API_API if(is_null($order)) { $order = array( + Piwik_Translate('General_MultiSitesSummary'), Piwik_Translate('VisitsSummary_VisitsSummary'), Piwik_Translate('Goals_Ecommerce'), Piwik_Translate('Actions_Actions'),
I actually don't understand why the build is failing: ApiGetReportMetadata_year.test.php fails on Jenkins but not on my box... and the failure appears to be that the metadata reports list appears in random order somehow! git-svn-id: <URL>
matomo-org_matomo
train
php
268fad0d89a7bdb5071c6ce4b65b1f1303feed89
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -34,14 +34,13 @@ setup(name=name.replace('_', '-'), "Topic :: Text Processing :: Filters", "Topic :: Text Processing :: Markup :: HTML", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - ], + ], author='Gandi', author_email='[email protected]', - url='', + url='https://github.com/Gandi/pyramid_htmlmin', keywords='web pyramid pylons', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=requires, ) -
Add missing url field in setup.py
Gandi_pyramid_htmlmin
train
py
a271472be797917c794e9e8b60e9f1279f976685
diff --git a/TYPO3.Neos/Classes/Controller/Backend/SetupController.php b/TYPO3.Neos/Classes/Controller/Backend/SetupController.php index <HASH>..<HASH> 100644 --- a/TYPO3.Neos/Classes/Controller/Backend/SetupController.php +++ b/TYPO3.Neos/Classes/Controller/Backend/SetupController.php @@ -75,7 +75,7 @@ class SetupController extends \F3\FLOW3\MVC\Controller\ActionController { public function noSiteAction() { $titles = array('Velkommen til TYPO3!', 'Willkommen zu TYPO3!', 'Welcome to TYPO3!', '¡Bienvenido a TYPO3!', '¡Benvingut a TYPO3!', 'Laipni lūdzam TYPO3!', 'Bienvenue sur TYPO3!', - 'Welkom op TYPO3!', 'Добро пожаловать в TYPO3!'); + 'Welkom op TYPO3!', 'Добро пожаловать в TYPO3!', 'ようこそTYPO3へ'); $this->view->assign('title', $titles[rand(0, count($titles) - 1)]); }
[+BUGFIX] TYPO3 (Demo): Added japanese to the list of greeting messages. Original-Commit-Hash: ff9db<I>a2ab<I>f<I>b<I>b6d<I>db4c<I>d7d1d3
neos_neos-development-collection
train
php
6f470a2d02f6e5ddc7e688cb7c0e56943f03fa57
diff --git a/torrent.go b/torrent.go index <HASH>..<HASH> 100644 --- a/torrent.go +++ b/torrent.go @@ -9,6 +9,7 @@ import ( "math" "math/rand" "net" + "os" "sort" "sync" "time" @@ -626,7 +627,7 @@ func (t *Torrent) hashPiece(piece int) (ret metainfo.Hash) { missinggo.CopyExact(&ret, hash.Sum(nil)) return } - if err != io.ErrUnexpectedEOF { + if err != io.ErrUnexpectedEOF && !os.IsNotExist(err) { log.Printf("unexpected error hashing piece with %T: %s", t.storage, err) } return
Don't log missing files during hashing
anacrolix_torrent
train
go
e3e12d2f7d158dca9339aead146555527493db5c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,7 @@ let electron, ipc = null; var threads = null; var isElectron = false; var ipcSenders = {}; +var osNumberOfCPUs = 1; function Log(level) { var args = CopyArguments(arguments); @@ -69,9 +70,12 @@ try { if (!isElectron || electron.ipcMain) { let child_process = require('child_process'); + let os = require('os'); fork = child_process.fork; path = require('path'); threads = []; + + osNumberOfCPUs = os.cpus().length; } /** @@ -515,7 +519,7 @@ var Config = new (function() { * The number of threads maximum * Default: 4 */ - this.maxThreads = 4; + this.maxThreads = Math.max(osNumberOfCPUs-1, 1); /** * Log level information (from 0 to no information, to 3 to thread information) * Default: 0 @@ -528,7 +532,6 @@ var Config = new (function() { */ this.killThreadsWhenInactive = true; // To avoid memory leaks. Set on true if memory is controlled on each thread to have better performance })(); - Function.prototype.Threadify = Threadify; exports.Threadify = function(o, options) {
Auto-detect the number of CPUs and set threads to CPUs -1
Stitchuuuu_thread-promisify
train
js
a36e170f7c06fcd32d1392d8c34db4694ce76788
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2522,6 +2522,7 @@ function update_capabilities($component = 'moodle') { } } // Add new capabilities to the stored definition. + $existingcaps = $DB->get_records_menu('capabilities', array(), 'id', 'id, name'); foreach ($newcaps as $capname => $capdef) { $capability = new stdClass(); $capability->name = $capname; @@ -2532,7 +2533,7 @@ function update_capabilities($component = 'moodle') { $DB->insert_record('capabilities', $capability, false); - if (isset($capdef['clonepermissionsfrom']) && in_array($capdef['clonepermissionsfrom'], $storedcaps)){ + if (isset($capdef['clonepermissionsfrom']) && in_array($capdef['clonepermissionsfrom'], $existingcaps)){ if ($rolecapabilities = $DB->get_records('role_capabilities', array('capability'=>$capdef['clonepermissionsfrom']))){ foreach ($rolecapabilities as $rolecapability){ //assign_capability will update rather than insert if capability exists
MDL-<I> allow cloning of plugin permissions from core Please note it is discouraged to clone from different plugin type because the upgrade order is not guaranteed.
moodle_moodle
train
php
c8352039b730d088d5c8840a04db3638e90d6842
diff --git a/src/support.js b/src/support.js index <HASH>..<HASH> 100644 --- a/src/support.js +++ b/src/support.js @@ -25,8 +25,8 @@ export const matrix = { 11: 0b1000000000000000111000001100000 }, edge: { - 12: 0b1011110110111100011010001011101, - 13: 0b1011111110111100011111001011111 + 12: 0b1011110100111100011010001011101, + 13: 0b1011111100111100011111001011111 }, node: { '0.10': 0b1000000000101000000000001000000,
Edge <I> and <I> don't support destructuring according to MDN. Here's the MDN page: <URL>
bublejs_buble
train
js
67ed8178f1362a0b4a0825d2d4f25f6a94597b7a
diff --git a/spyderlib/widgets/externalshell/sitecustomize.py b/spyderlib/widgets/externalshell/sitecustomize.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/externalshell/sitecustomize.py +++ b/spyderlib/widgets/externalshell/sitecustomize.py @@ -21,8 +21,6 @@ import shlex PY2 = sys.version[0] == '2' -from spyderlib.utils import programs - #============================================================================== # sys.argv can be missing when Python is embedded, taking care of it. @@ -843,8 +841,8 @@ def evalsc(command): """Evaluate special commands (analog to IPython's magic commands but far less powerful/complete)""" assert command.startswith('%') - - from subprocess import Popen, PIPE + from spyderlib.utils import programs + namespace = _get_globals() command = command[1:].strip() # Remove leading %
Sitecustomize: Move import statement to the right place
spyder-ide_spyder
train
py
688228b2a6f24b0688110b532b64fd05eeb0a247
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -110,7 +110,7 @@ Series.prototype.execute = function(request,reply) { cb(); }; - func.call({},request,reply,reply.data); + func.call({},request,reply); } }),function(err,results) {
Updates on series execute - Do not pass third argument as data
Pranay92_hapi-next
train
js
32e8750deded4e4d6bd0127aabf7c71f26af3af1
diff --git a/plugins/plugin.go b/plugins/plugin.go index <HASH>..<HASH> 100644 --- a/plugins/plugin.go +++ b/plugins/plugin.go @@ -235,7 +235,7 @@ func (p *Plugin) setEndpoints() error { for _, c := range containers { e := "/system/v1/metrics/v0/containers/" + c p.Log.Infof("Discovered new container endpoint %s", e) - p.Endpoints = append(p.Endpoints, e) + p.Endpoints = append(p.Endpoints, e, e+"/app") } return nil @@ -263,6 +263,12 @@ func makeMetricsRequest(client *http.Client, request *http.Request) (producers.M return mm, err } + // 204 No Content is not an error code; we handle it explicitly + if resp.StatusCode == http.StatusNoContent { + l.Warnf("Empty response received from endpoint: %+v", request.URL) + return mm, nil + } + err = json.Unmarshal(body, &mm) if err != nil { l.Errorf("Encountered error parsing JSON, %s. JSON Content was: %s", err.Error(), body)
Scrape app metrics in plugins (#<I>) * Scrape /app endpoint in plugins * Avoid erroring on <I> No Content
dcos_dcos-metrics
train
go
183229f81ebfb8bd4ea7b1974c10764a71622787
diff --git a/js/rainbow.js b/js/rainbow.js index <HASH>..<HASH> 100644 --- a/js/rainbow.js +++ b/js/rainbow.js @@ -606,11 +606,11 @@ window['Rainbow'] = (function() { /** * adds event listener to start highlighting */ -(function (w) { - if (w.addEventListener) { - return w.addEventListener('load', Rainbow.init, false); +(function () { + if (window.addEventListener) { + return window.addEventListener('load', Rainbow.init, false); } - w.attachEvent('onload', Rainbow.init); -}) (window); + window.attachEvent('onload', Rainbow.init); +}) (); Rainbow["onHighlight"] = Rainbow.onHighlight;
Believe it or not this shaves some space
ccampbell_rainbow
train
js
d382c56b259897cde9ab17414f2b126a562638dc
diff --git a/helpers/translation/class.RDFUtils.php b/helpers/translation/class.RDFUtils.php index <HASH>..<HASH> 100644 --- a/helpers/translation/class.RDFUtils.php +++ b/helpers/translation/class.RDFUtils.php @@ -19,8 +19,6 @@ * */ -error_reporting(E_ALL); - /** * Aims at providing utility methods for RDF Translation models. * @@ -164,11 +162,13 @@ class tao_helpers_translation_RDFUtils $dataUsageNode->setAttributeNs($rdfNs, 'rdf:resource', INSTANCE_LANGUAGE_USAGE_DATA); $descriptionNode->appendChild($dataUsageNode); + $dataUsageNode = $doc->createElementNS($base, 'tao:LanguageOrientation'); + $dataUsageNode->setAttributeNs($rdfNs, 'rdf:resource', INSTANCE_ORIENTATION_LTR); + $descriptionNode->appendChild($dataUsageNode); + $returnValue = $doc; return $returnValue; } -} - -?> \ No newline at end of file +} \ No newline at end of file
added orientation left to right by default to newly created languages git-svn-id: <URL>
oat-sa_tao-core
train
php
d1cb4b2990d5b06531be57c7c697a1d58e9d05b0
diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/util/ArrayListSpanAccumulator.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/util/ArrayListSpanAccumulator.java index <HASH>..<HASH> 100644 --- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/util/ArrayListSpanAccumulator.java +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/util/ArrayListSpanAccumulator.java @@ -34,7 +34,7 @@ public class ArrayListSpanAccumulator implements SpanReporter { public List<Span> getSpans() { synchronized (this.spans) { - return this.spans; + return new ArrayList<>(this.spans); } }
Returning a copy of spans from ArrayListSpanAccumulator
spring-cloud_spring-cloud-sleuth
train
java
92849df7324b9aaa1e8f1660101939438420c829
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -254,7 +254,7 @@ module ActionDispatch @key_strategy.call model.model_name end - named_route = prefix + "#{name}_#{suffix}" + named_route = "#{prefix}#{name}_#{suffix}" [named_route, args] end
drop allocations when handling model url generation
rails_rails
train
rb
187bca72775409d08712301d9ccfc8b92d772c85
diff --git a/src/renderer/CanvasRenderer.js b/src/renderer/CanvasRenderer.js index <HASH>..<HASH> 100644 --- a/src/renderer/CanvasRenderer.js +++ b/src/renderer/CanvasRenderer.js @@ -48,8 +48,6 @@ meta.class("meta.CanvasRenderer", "meta.Renderer", } this.ctx.lineWidth = 2; - this.ctx.strokeStyle = "red"; - this.ctx.fillStyle = "red"; var entity; var entityFlag = this.holder.Flag; @@ -58,7 +56,17 @@ meta.class("meta.CanvasRenderer", "meta.Renderer", entity = this.entities[n]; if(entity.flags & entityFlag.INSTANCE_HIDDEN) { continue; } - if(entity.flags & entityFlag.DEBUG || this.meta.cache.debug) { + if(entity.flags & entityFlag.DEBUG || this.meta.cache.debug) + { + if(entity.flags & entityFlag.PICKING) { + this.ctx.strokeStyle = "green"; + this.ctx.fillStyle = "green"; + } + else { + this.ctx.strokeStyle = "red"; + this.ctx.fillStyle = "red"; + } + this.drawVolume(entity); } }
Debugger now shows pickable entities in different color.
tenjou_meta2d
train
js
ccea40e9821c8e4f209befb0104d45464e809ca4
diff --git a/lib/ssm.js b/lib/ssm.js index <HASH>..<HASH> 100644 --- a/lib/ssm.js +++ b/lib/ssm.js @@ -11,9 +11,9 @@ function getParametersByPath( ssm, params, parameters ) { if( data.NextToken ) { - params.NextToken = data.NextToken; + let nextPageParams = Object.assign( {}, params, { NextToken: data.NextToken } ); - return getParametersByPath( ssm, params, parameters ); + return getParametersByPath( ssm, nextPageParams, parameters ); } return parameters;
fixed issue with pagination that modifies the incoming params object
vandium-io_aws-param-store
train
js
45e4097b2397b55101d829c0e8a6a1f346696423
diff --git a/spec/host_spec.rb b/spec/host_spec.rb index <HASH>..<HASH> 100644 --- a/spec/host_spec.rb +++ b/spec/host_spec.rb @@ -139,5 +139,7 @@ describe Host do end end - include_examples "#scripts" + pending "scan.xml does not currently include any hostscripts" do + include_examples "#scripts" + end end
Make Host#scripts pending until we can generate hostscripts.
sophsec_ruby-nmap
train
rb
4b999fc92d1b17bee66f1fe738c6da3834495f73
diff --git a/src/util/can-patch-native-accessors.js b/src/util/can-patch-native-accessors.js index <HASH>..<HASH> 100644 --- a/src/util/can-patch-native-accessors.js +++ b/src/util/can-patch-native-accessors.js @@ -3,6 +3,6 @@ import getPropertyDescriptor from './get-property-descriptor'; -const nativeParentNode = getPropertyDescriptor(Node.prototype, 'parentNode'); +const nativeParentNode = getPropertyDescriptor(Element.prototype, 'innerHTML'); export default !!nativeParentNode;
Opera doesn't have parentNode on Node.prototype but all browsers seem to have innerHTML on Element.prototype.
skatejs_named-slots
train
js
df50358fc954f49c6780eb69e1a3704f3fb1b91c
diff --git a/src/Session/CSession.php b/src/Session/CSession.php index <HASH>..<HASH> 100644 --- a/src/Session/CSession.php +++ b/src/Session/CSession.php @@ -65,7 +65,7 @@ class CSession { return isset($_SESSION) && isset($_SESSION[$key]) ? $_SESSION[$key] - : null; + : $default; }
session get did not return the default value
mosbth_Anax-MVC
train
php
4c7e6e0f5985b676d6fd3c02d89d8a00bcd4df39
diff --git a/src/Youch/index.js b/src/Youch/index.js index <HASH>..<HASH> 100644 --- a/src/Youch/index.js +++ b/src/Youch/index.js @@ -129,7 +129,7 @@ class Youch { message: this.error.message, name: this.error.name, status: this.error.status, - frames: stack.frames.map(callback) + frames: stack.frames instanceof Array === true ? stack.frames.map(callback) : [] } }
refactor(youch): add conditional before looping over frames frames can be undefined at times, so it is required to make sure frames is a valid array before mapping over them
poppinss_youch
train
js
9c5b7d263e895c3c0c88424396a45b6b4789b346
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/XMPPError.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/XMPPError.java index <HASH>..<HASH> 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/XMPPError.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/XMPPError.java @@ -199,7 +199,14 @@ public class XMPPError extends AbstractError { xml.halfOpenElement(condition.toString()); xml.xmlnsAttribute(NAMESPACE); - xml.closeEmptyElement(); + if (conditionText != null) { + xml.rightAngleBracket(); + xml.escape(conditionText); + xml.closeElement(condition.toString()); + } + else { + xml.closeEmptyElement(); + } addDescriptiveTextsAndExtensions(xml);
Include conditionText in XMPPError.toXML()
igniterealtime_Smack
train
java
1260a46f56dc08c2dc4f25569a1838ddb6ad270e
diff --git a/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java b/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java index <HASH>..<HASH> 100644 --- a/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java +++ b/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java @@ -76,7 +76,7 @@ public abstract class AmazonWebServiceClient { boolean success = com.amazonaws.log.InternalLogFactory.configureFactory( new CommonsLogFactory()); if (log.isDebugEnabled()) - log.debug("Internal logging succesfully configured to commons logger: " + log.debug("Internal logging successfully configured to commons logger: " + success); }
Fixed typo in debug log message Fixed "succesfully"
aws_aws-sdk-java
train
java
506181599c218d3d8e43ee970cb12eb6742f68eb
diff --git a/lib/db/leveldb_dbinstance.go b/lib/db/leveldb_dbinstance.go index <HASH>..<HASH> 100644 --- a/lib/db/leveldb_dbinstance.go +++ b/lib/db/leveldb_dbinstance.go @@ -539,6 +539,14 @@ func (db *Instance) dropFolder(folder []byte) { } dbi.Release() + // Remove all sequences related to the folder + sequenceKey := db.sequenceKey([]byte(folder), 0) + dbi = t.NewIterator(util.BytesPrefix(sequenceKey[:4]), nil) + for dbi.Next() { + db.Delete(dbi.Key(), nil) + } + dbi.Release() + // Remove all items related to the given folder from the global bucket dbi = t.NewIterator(util.BytesPrefix([]byte{KeyTypeGlobal}), nil) for dbi.Next() {
lib/db: Remove all sequences related to the folder (fixes #<I>) (#<I>)
syncthing_syncthing
train
go
345c65142c551232166e0a797b67d8412377d8d9
diff --git a/src/main/java/com/jayway/maven/plugins/android/common/DependencyResolver.java b/src/main/java/com/jayway/maven/plugins/android/common/DependencyResolver.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/jayway/maven/plugins/android/common/DependencyResolver.java +++ b/src/main/java/com/jayway/maven/plugins/android/common/DependencyResolver.java @@ -84,6 +84,7 @@ public final class DependencyResolver && found.getArtifactId().equals( artifact.getArtifactId() ) && found.getVersion().equals( artifact.getVersion() ) && found.getType().equals( artifact.getType() ) + && found.getClassifier().equals( artifact.getClassifier() ) ; } };
Adding classifier to dep resolution.
simpligility_android-maven-plugin
train
java
3d15cb9c57f1ac53fc6c4b71b4bb03adb9fee761
diff --git a/hrapplications/views.py b/hrapplications/views.py index <HASH>..<HASH> 100755 --- a/hrapplications/views.py +++ b/hrapplications/views.py @@ -138,6 +138,7 @@ def hr_application_view(request, app_id): comment.text = form.cleaned_data['comment'] comment.save() logger.info("Saved comment by user %s to %s" % (request.user, app)) + return redirect(hr_application_view, app_id) else: logger.warn("User %s does not have permission to add ApplicationComments" % request.user) else:
Prevent refresh from resubmitting comments (#<I>) Closes #<I>
allianceauth_allianceauth
train
py
a847aed9b81111e1a7ace4e1930213bcc31e775b
diff --git a/lib/opal/parser.rb b/lib/opal/parser.rb index <HASH>..<HASH> 100644 --- a/lib/opal/parser.rb +++ b/lib/opal/parser.rb @@ -848,7 +848,7 @@ module Opal @method_calls[meth.to_sym] = true # we are trying to access a lvar in irb mode - if @irb_vars and @scope.top? and arglist == s(:arglist) and recv == nil + if @irb_vars and @scope.top? and arglist == s(:arglist) and recv == nil and iter == nil return with_temp { |t| lvar = meth.intern lvar = "#{lvar}$" if RESERVED.include? lvar
Fix bug in generating methods in irb mode
opal_opal
train
rb
008ead54ea12d8af10a58a57e65cbedb262364ac
diff --git a/hal/maths/probability/utils.py b/hal/maths/probability/utils.py index <HASH>..<HASH> 100644 --- a/hal/maths/probability/utils.py +++ b/hal/maths/probability/utils.py @@ -14,5 +14,4 @@ def do_trials(experiment, trials): def get_stats(experiment, trials): results = do_trials(experiment, trials) mean, var = np.mean(results), np.std(results) - std = np.power(var, 2) # sigma squared - return mean, std + return mean, var
Auto-generated push for backup reasons. See previous commits for meaningful message.
sirfoga_pyhal
train
py
401145e38dbef849e6a90dccbf56a28854b7b237
diff --git a/src/Bedrock/View/Cache.php b/src/Bedrock/View/Cache.php index <HASH>..<HASH> 100644 --- a/src/Bedrock/View/Cache.php +++ b/src/Bedrock/View/Cache.php @@ -13,6 +13,11 @@ use \Exception; */ class Cache { + /** + * Activate/Deactivate cache + * @var bool + */ + protected $use_cache = false; /** * Cache expiration time in sec
fixed missing $use_cache property
peakphp_framework
train
php
33cc7db454226f9ea38c728fe5f227565b3d1cd2
diff --git a/ai/models.py b/ai/models.py index <HASH>..<HASH> 100644 --- a/ai/models.py +++ b/ai/models.py @@ -61,3 +61,6 @@ class SearchNode(object): node = node.parent return list(reversed(path)) + + def __hash__(self): + return hash(self.state)
The hash of a node is the hash of it's state
simpleai-team_simpleai
train
py
aabea412ade3c044e0f9fcf48b24136061f5b706
diff --git a/txzmq/connection.py b/txzmq/connection.py index <HASH>..<HASH> 100644 --- a/txzmq/connection.py +++ b/txzmq/connection.py @@ -9,7 +9,6 @@ from zmq.core.socket import Socket from zope.interface import implements from twisted.internet.interfaces import IFileDescriptor, IReadDescriptor -from twisted.internet import reactor from twisted.python import log diff --git a/txzmq/test/test_pubsub.py b/txzmq/test/test_pubsub.py index <HASH>..<HASH> 100644 --- a/txzmq/test/test_pubsub.py +++ b/txzmq/test/test_pubsub.py @@ -1,8 +1,6 @@ """ Tests for L{txzmq.pubsub}. """ -import zmq - from twisted.trial import unittest from txzmq.connection import ZmqEndpoint, ZmqEndpointType
Fix pyflakes warnings.
smira_txZMQ
train
py,py
1e4b2e9cba6d5d42d35c3fc2bb6ba8acde512a70
diff --git a/src/java/jdbc_adapter/RubyJdbcConnection.java b/src/java/jdbc_adapter/RubyJdbcConnection.java index <HASH>..<HASH> 100644 --- a/src/java/jdbc_adapter/RubyJdbcConnection.java +++ b/src/java/jdbc_adapter/RubyJdbcConnection.java @@ -652,7 +652,8 @@ public class RubyJdbcConnection extends RubyObject { IRubyObject connection_factory = getInstanceVariable("@connection_factory"); JdbcConnectionFactory factory = null; try { - factory = (JdbcConnectionFactory) ((JavaObject) rubyApi.getInstanceVariable(connection_factory, "@java_object")).getValue(); + factory = (JdbcConnectionFactory) JavaEmbedUtils.rubyToJava( + connection_factory.getRuntime(), connection_factory, JdbcConnectionFactory.class); } catch (Exception e) { factory = null; }
Fix for jruby trunk compatibility -- @java_object going away
jruby_activerecord-jdbc-adapter
train
java
861c414c3bb83c32dd9f3a1b5c8f300ee9343cb1
diff --git a/perfdash/perfdash.go b/perfdash/perfdash.go index <HASH>..<HASH> 100644 --- a/perfdash/perfdash.go +++ b/perfdash/perfdash.go @@ -29,7 +29,7 @@ import ( "time" // TODO: move this somewhere central - "k8s.io/contrib/mungegithub/pulls/jenkins" + "k8s.io/contrib/mungegithub/mungers/jenkins" "k8s.io/kubernetes/pkg/util/sets" )
Fix perfdash after great munger move
kubernetes-retired_contrib
train
go
7cfa929a39bbf50c2ed3157f6b6fac8055afc0ae
diff --git a/api/src/opentrons/system/nmcli.py b/api/src/opentrons/system/nmcli.py index <HASH>..<HASH> 100644 --- a/api/src/opentrons/system/nmcli.py +++ b/api/src/opentrons/system/nmcli.py @@ -412,7 +412,8 @@ def _build_con_add_cmd(ssid: str, security_type: SECURITY_TYPES, 'ifname', 'wlan0', 'type', 'wifi', 'con-name', ssid, - 'wifi.ssid', ssid] + 'wifi.ssid', ssid, + '802-11-wireless.cloned-mac-address', 'permanent'] if hidden: configure_cmd += ['wifi.hidden', 'true'] if security_type == SECURITY_TYPES.WPA_PSK:
fix(api): Force the permanent mac address for wifi connections (#<I>) This should prevent the macs from changing when the robot restarts, which plays havoc with people using mac whitelisting in their wireless networks.
Opentrons_opentrons
train
py
698f38216870715b7638873947d3c0aaf123d7fa
diff --git a/app/models/landable/author.rb b/app/models/landable/author.rb index <HASH>..<HASH> 100644 --- a/app/models/landable/author.rb +++ b/app/models/landable/author.rb @@ -10,15 +10,18 @@ module Landable end def can_read - access_tokens.fresh.last.can_read? + token = access_tokens.fresh.last + token.present? && token.can_read? end def can_edit - access_tokens.fresh.last.can_edit? + token = access_tokens.fresh.last + token.present? && token.can_edit? end def can_publish - access_tokens.fresh.last.can_publish? + token = access_tokens.fresh.last + token.present? && token.can_publish? end end end
not all authors have access_tokens!
enova_landable
train
rb
41b6c3c2bfc431f289cbc695ebe45eb0f2ab44fe
diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py index <HASH>..<HASH> 100644 --- a/salt/modules/lxc.py +++ b/salt/modules/lxc.py @@ -2907,7 +2907,7 @@ def running_systemd(name, cache=True): '''\ #!/usr/bin/env bash set -x - if ! which systemctl 1>/dev/nulll 2>/dev/null;then exit 2;fi + if ! which systemctl 1>/dev/null 2>/dev/null;then exit 2;fi for i in \\ /run/systemd/journal/dev-log\\ /run/systemd/journal/flushed\\
Fix typo in redirecting shell output to /dev/null
saltstack_salt
train
py
9eb928c94cf5cb0e15ac631bbc9cd27f07fedb87
diff --git a/PPI/App.php b/PPI/App.php index <HASH>..<HASH> 100644 --- a/PPI/App.php +++ b/PPI/App.php @@ -24,6 +24,7 @@ class App { 'cacheConfig' => false, // Config object caching 'errorLevel' => E_ALL, // The error level to throw via error_reporting() 'showErrors' => 'On', // Whether to display errors or not. This gets fired into ini_set('display_errors') + 'exceptionHandler' => array('\PPI\Core\ExceptionHandler', 'handle'), // This must be a callback accepted by set_exception_handler() 'router' => null, 'session' => null, 'config' => null, @@ -149,7 +150,7 @@ class App { error_reporting($this->_envOptions['errorLevel']); ini_set('display_errors', $this->getEnv('showErrors', 'On')); - set_exception_handler(array('\PPI\Core\ExceptionHandler', 'handle')); + set_exception_handler($this->_envOptions['exceptionHandler']); // Fire up the default config handler if($this->_envOptions['config'] === null) {
Modified to support user-defined Exception handler
ppi_framework
train
php
68a01355ea07b54392dc7947ac1883b1b5d14e79
diff --git a/tests/db/models_test.py b/tests/db/models_test.py index <HASH>..<HASH> 100644 --- a/tests/db/models_test.py +++ b/tests/db/models_test.py @@ -173,7 +173,7 @@ class Inputs4JobTestCase(unittest.TestCase): inp1.save() models.Input2job(oq_job=self.job, input=inp1).save() inp2 = models.Input(owner=self.job.owner, path=self.paths.next(), - input_type="rupture", size=self.sizes.next()) + input_type="rupture_model", size=self.sizes.next()) inp2.save() models.Input2job(oq_job=self.job, input=inp2).save() inp3 = models.Input(owner=self.job.owner, path=self.paths.next(), @@ -200,7 +200,7 @@ class Inputs4JobTestCase(unittest.TestCase): models.Input2job(oq_job=self.job, input=inp1).save() path = self.paths.next() inp2 = models.Input(owner=self.job.owner, path=path, - input_type="rupture", size=self.sizes.next()) + input_type="rupture_model", size=self.sizes.next()) inp2.save() models.Input2job(oq_job=self.job, input=inp2).save() self.assertEqual([inp2], models.inputs4job(self.job.id, path=path))
Fixing failing test in models_test.py
gem_oq-engine
train
py
2ff798820470a6a84d18e2d82d217b6cfa7b5e69
diff --git a/gromacs/tools.py b/gromacs/tools.py index <HASH>..<HASH> 100644 --- a/gromacs/tools.py +++ b/gromacs/tools.py @@ -162,7 +162,8 @@ def tool_factory(clsname, name, driver, base=GromacsCommand): """ Factory for GromacsCommand derived types. """ clsdict = { 'command_name': name, - 'driver': driver + 'driver': driver, + '__doc__': property(base._get_gmx_docs) } return type(clsname, (base,), clsdict)
Merged develop into automatic-tool-loading
Becksteinlab_GromacsWrapper
train
py
64f8998019e00741302776e6b17d5958ae6353c5
diff --git a/js/bam/alignmentContainer.js b/js/bam/alignmentContainer.js index <HASH>..<HASH> 100644 --- a/js/bam/alignmentContainer.js +++ b/js/bam/alignmentContainer.js @@ -305,7 +305,7 @@ var igv = (function (igv) { this.total = 0; } - const threshold = 0.2; + const t = 0.2; const qualityWeight = true; @@ -313,7 +313,7 @@ var igv = (function (igv) { var myself = this, mismatchQualitySum, - threshold = threshold * ((qualityWeight && this.qual) ? this.qual : this.total); + threshold = t * ((qualityWeight && this.qual) ? this.qual : this.total); mismatchQualitySum = 0; ["A", "T", "C", "G"].forEach(function (base) {
bug fix: coverage track mismatches not shown
igvteam_igv.js
train
js
4fdc99b8dda4bba102e3bf946fdf16fb7261bd18
diff --git a/session/bootstrap.go b/session/bootstrap.go index <HASH>..<HASH> 100644 --- a/session/bootstrap.go +++ b/session/bootstrap.go @@ -444,6 +444,9 @@ const ( version57 = 57 // version58 add `Repl_client_priv` and `Repl_slave_priv` to `mysql.user` version58 = 58 + + // please make sure this is the largest version + currentBootstrapVersion = version58 ) var ( diff --git a/session/session.go b/session/session.go index <HASH>..<HASH> 100644 --- a/session/session.go +++ b/session/session.go @@ -2133,8 +2133,7 @@ func CreateSessionWithDomain(store kv.Storage, dom *domain.Domain) (*session, er } const ( - notBootstrapped = 0 - currentBootstrapVersion = version57 + notBootstrapped = 0 ) func getStoreBootstrapVersion(store kv.Storage) int64 {
session: fix didn't change current version in #<I> (#<I>)
pingcap_tidb
train
go,go
26dd6b3ff98a20555689239229f66041c9c63a37
diff --git a/lib/riot/context.rb b/lib/riot/context.rb index <HASH>..<HASH> 100644 --- a/lib/riot/context.rb +++ b/lib/riot/context.rb @@ -20,7 +20,7 @@ module Riot def asserts_topic; asserts("topic") { topic }; end def context(description, &definition) - @contexts << Context.new("#{@description} #{description}", self, &definition) + @contexts << self.class.new("#{@description} #{description}", self, &definition) end def run(reporter)
lets us subclass context and create new ones that use the subclass
thumblemonks_riot
train
rb
caaf6c350fe00ef551f4344b91d4f5808c7bdddf
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -51,12 +51,9 @@ describe UsersController do response.should_not be_success end - it "should error if no environment" do + it "should pass if no environment" do post 'create', {:user => {:username=>"bar-user", :password=>"password1234"}} - response.should_not be_success - - post 'create', {:user => { :password=>"password1234"}} - response.should_not be_success + response.should be_success end end
corrected test for creating user w/o env
Katello_katello
train
rb
70030e769da10ecad5e6663fe02df7396e802c1d
diff --git a/lib/coral_core/codes.rb b/lib/coral_core/codes.rb index <HASH>..<HASH> 100644 --- a/lib/coral_core/codes.rb +++ b/lib/coral_core/codes.rb @@ -34,12 +34,14 @@ class Codes #--- def self.render_index(status_code = nil) - output = "Status index mappings: (actual result in [])\n" + output = "Status index:\n" @@status_index.each do |code, name| + name = name.gsub(/_/, ' ').capitalize + if ! status_code.nil? && status_code == code - output << sprintf(" [ %3i ] - %s\n", code, name) + output << sprintf(" [ %3i ] - %s\n", code, name) else - output << sprintf(" %3i - %s\n", code, name) + output << sprintf(" %3i - %s\n", code, name) end end output << "\n" @@ -99,8 +101,7 @@ class Codes code(:action_unprocessed) code(:batch_error) - code(:access_denied) - code(:validation_failed) + code(:access_denied) end end \ No newline at end of file
Changing rendering and code ordering in the core codes class.
coralnexus_corl
train
rb
8e8857385ee30b94bb51a39be7025dc04ccc7fe6
diff --git a/src/main/java/com/graphhopper/util/Helper.java b/src/main/java/com/graphhopper/util/Helper.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/graphhopper/util/Helper.java +++ b/src/main/java/com/graphhopper/util/Helper.java @@ -366,15 +366,9 @@ public class Helper { System.err.println("GraphHopper Initialization WARNING: cannot get version!?"); } else { // throw away the "-SNAPSHOT" - int major = -1, minor = -1; - try { - major = Integer.parseInt(version.substring(0, indexP)); - minor = Integer.parseInt(version.substring(indexP + 1, indexM)); - } catch (Exception ex) { - System.err.println("GraphHopper Initialization WARNING: cannot parse version!? " + ex.getMessage()); - } + String tmp = version.substring(0, indexM); SNAPSHOT = version.toLowerCase().contains("-snapshot"); - VERSION = major + "." + minor; + VERSION = tmp; } }
minor fix for versions having subsub versions
graphhopper_graphhopper
train
java
eb7964865a5083615503896f7793051491eae23d
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -363,7 +363,12 @@ module ActionController #:nodoc: # Name can take one of three forms: # * String: This would normally take the form of a path like "pages/45/notes" # * Hash: Is treated as an implicit call to url_for, like { :controller => "pages", :action => "notes", :id => 45 } - # * Regexp: Will destroy all the matched fragments, example: %r{pages/\d*/notes} Ensure you do not specify start and finish in the regex (^$) because the actual filename matched looks like ./cache/filename/path.cache + # * Regexp: Will destroy all the matched fragments, example: + # %r{pages/\d*/notes} + # Ensure you do not specify start and finish in the regex (^$) because + # the actual filename matched looks like ./cache/filename/path.cache + # Regexp expiration is not supported on caches which can't iterate over + # all keys, such as memcached. def expire_fragment(name, options = nil) return unless perform_caching
Document that expire_fragment with regexp arg fails on memcached and other caches which don't support iteration over all keys. Closes #<I>. git-svn-id: <URL>
rails_rails
train
rb
22d8075c536bdfc1790b23381e0017720cc921a5
diff --git a/superset/assets/javascripts/SqlLab/actions.js b/superset/assets/javascripts/SqlLab/actions.js index <HASH>..<HASH> 100644 --- a/superset/assets/javascripts/SqlLab/actions.js +++ b/superset/assets/javascripts/SqlLab/actions.js @@ -164,15 +164,17 @@ export function postStopQuery(query) { return function (dispatch) { const stopQueryUrl = '/superset/stop_query/'; const stopQueryRequestData = { client_id: query.id }; + dispatch(stopQuery(query)); $.ajax({ type: 'POST', dataType: 'json', url: stopQueryUrl, data: stopQueryRequestData, success() { - if (!query.runAsync) { - dispatch(stopQuery(query)); - } + notify.success('Query was stopped.'); + }, + error() { + notify.error('Failed at stopping query.'); }, }); };
Making the stop button instantaneous (#<I>)
apache_incubator-superset
train
js
27ef944dedd4506e6d07a31cb85cd6cccbebc9d1
diff --git a/tmhUtilities.php b/tmhUtilities.php index <HASH>..<HASH> 100644 --- a/tmhUtilities.php +++ b/tmhUtilities.php @@ -86,8 +86,15 @@ class tmhUtilities { * @return string the current URL */ function php_self($dropqs=true) { + $protocol = 'http'; + if (strtolower($_SERVER['HTTPS']) == 'on') { + $protocol = 'https'; + } elseif (isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] == '443')) { + $protocol = 'https'; + } + $url = sprintf('%s://%s%s', - empty($_SERVER['HTTPS']) ? (@$_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http') : 'http', + $protocol, $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI'] );
protocol was not inferred correctly for https when ['HTTPS'] == 'on'. Props: ospector
themattharris_tmhOAuth
train
php
846fb3e46b9e8e0dc6b7951235ddaee24a9323fa
diff --git a/hrp/internal/boomer/runner.go b/hrp/internal/boomer/runner.go index <HASH>..<HASH> 100644 --- a/hrp/internal/boomer/runner.go +++ b/hrp/internal/boomer/runner.go @@ -830,10 +830,8 @@ func (r *workerRunner) run() { log.Warn().Msg("Timeout waiting for sending quit message to master, boomer will quit any way.") } - if atomic.LoadInt32(&r.client.failCount) < 2 { - if err = r.client.signOut(r.client.config.ctx); err != nil { - log.Error().Err(err).Msg("failed to sign out") - } + if err = r.client.signOut(r.client.config.ctx); err != nil { + log.Info().Err(err).Msg("failed to sign out") } r.client.close()
fix: mask error logging that worker fails to sign out
HttpRunner_HttpRunner
train
go
c25e77fc8ededd692306415be837df971a7d72c2
diff --git a/lib/merb-core/controller/mixins/render.rb b/lib/merb-core/controller/mixins/render.rb index <HASH>..<HASH> 100644 --- a/lib/merb-core/controller/mixins/render.rb +++ b/lib/merb-core/controller/mixins/render.rb @@ -284,15 +284,15 @@ module Merb::RenderMixin end # Called in templates to get at content thrown in another template. The - # results of rendering a template are automatically thrown into :layout, so - # catch_content or catch_content(:layout) can be used inside layouts to get - # the content rendered by the action template. + # results of rendering a template are automatically thrown into :for_layout, + # so catch_content or catch_content(:for_layout) can be used inside layouts + # to get the content rendered by the action template. # # ==== Parameters - # obj<Object>:: The key in the thrown_content hash. Defaults to :layout. + # obj<Object>:: The key in the thrown_content hash. Defaults to :for_layout. #--- # @public - def catch_content(obj = :layout) + def catch_content(obj = :for_layout) @_caught_content[obj] end @@ -321,4 +321,4 @@ module Merb::RenderMixin @_caught_content[obj] = string.to_s << (block_given? ? capture(&block) : "") end -end \ No newline at end of file +end
catch_content should default to :for_layout render throws the rendered content as :for_layout now, so catch_content should catch that by default
wycats_merb
train
rb
8bb553bfa6cd3e18e5959e08a6d8b853820dc48b
diff --git a/src/Driver/RabbitMqDriver.php b/src/Driver/RabbitMqDriver.php index <HASH>..<HASH> 100644 --- a/src/Driver/RabbitMqDriver.php +++ b/src/Driver/RabbitMqDriver.php @@ -55,10 +55,18 @@ class RabbitMqDriver implements DriverInterface */ public function wait(Closure $callback) { - $this->channel->basic_consume($this->queue, '', false, true, false, false, function ($rabbitMessage) use ($callback) { - $message = $this->serializer->unserialize($rabbitMessage->body); - $callback($message); - }); + $this->channel->basic_consume( + $this->queue, + '', + false, + true, + false, + false, + function ($rabbitMessage) use ($callback) { + $message = $this->serializer->unserialize($rabbitMessage->body); + $callback($message); + } + ); while (count($this->channel->callbacks)) { $this->channel->wait();
Changed <I> character limit in one line
tomaj_hermes
train
php
07dde22848725aea67d58c6b7439b92ce90556e1
diff --git a/src/Discord/Parts/Channel/Channel.php b/src/Discord/Parts/Channel/Channel.php index <HASH>..<HASH> 100644 --- a/src/Discord/Parts/Channel/Channel.php +++ b/src/Discord/Parts/Channel/Channel.php @@ -685,7 +685,7 @@ class Channel extends Part } } - return $this->http->post(Endpoint::bind(Endpoint::CHANNEL_MESSAGES), $content)->then(function ($response) { + return $this->http->post(Endpoint::bind(Endpoint::CHANNEL_MESSAGES, $this->id), $content)->then(function ($response) { return $this->factory->create(Message::class, $response, true); }); }
Fixed issue with sending messages - no channel ID passed
teamreflex_DiscordPHP
train
php
e72ff180bdd827b97ab0ff58df5f6821bef87597
diff --git a/pymc3/variational/test_functions.py b/pymc3/variational/test_functions.py index <HASH>..<HASH> 100644 --- a/pymc3/variational/test_functions.py +++ b/pymc3/variational/test_functions.py @@ -1,4 +1,4 @@ -from theano import tensor as tt +from theano import tensor as tt, theano from .opvi import TestFunction from pymc3.theanof import floatX
add temperature (cherry picked from commit ab<I>bf)
pymc-devs_pymc
train
py
eab1e48d2060a48e3a1b3301389206981e3f5914
diff --git a/web/concrete/elements/collection_metadata.php b/web/concrete/elements/collection_metadata.php index <HASH>..<HASH> 100644 --- a/web/concrete/elements/collection_metadata.php +++ b/web/concrete/elements/collection_metadata.php @@ -127,7 +127,7 @@ if ($_REQUEST['approveImmediately'] == 1) { <? if ($asl->allowEditPaths()) { ?> <div id="ccm-page-paths-tab" style="display: none"> - + <?php if ($c->getCollectionID() != 1) { ?> <div class="clearfix"> <label for="cHandle"><?= t('Canonical URL')?></label> <div class="input"> @@ -141,6 +141,7 @@ if ($_REQUEST['approveImmediately'] == 1) { <span class="help-block"><?=t('This page must always be available from at least one URL. That URL is listed above.')?></span> </div> </div> + <?php } ?> <?php if (!$c->isGeneratedCollection()) { ?> <div class="clearfix" id="ccm-more-page-paths">
Hide canonical url for root page The canonical url field in page properties should not be visible for the home page: users shouldn't be able to edit it since it should always be "/" Former-commit-id: <I>e<I>f<I>c<I>ac<I>afda6c<I>e<I>bf<I>e
concrete5_concrete5
train
php
3b018105995a8e9bad502a4d5a34ab3281a027cc
diff --git a/andes/models/line.py b/andes/models/line.py index <HASH>..<HASH> 100644 --- a/andes/models/line.py +++ b/andes/models/line.py @@ -350,10 +350,8 @@ class Line(ModelBase): # V1 = polar(Vm[self.a1], Va[self.a1]) # V2 = polar(Vm[self.a2], Va[self.a2]) - I1 = mul(self.v1, div(self.y12 + self.y1, self.m2)) - \ - mul(self.v2, div(self.y12, self.mconj)) - I2 = mul(self.v2, self.y12 + self.y2) - \ - mul(self.v2, div(self.y12, self.m)) + I1 = mul(self.v1, div(self.y12 + self.y1, self.m2)) - mul(self.v2, div(self.y12, self.mconj)) + I2 = mul(self.v2, self.y12 + self.y2) - mul(self.v1, div(self.y12, self.m)) self.I1_real = I1.real() self.I1_imag = I1.imag()
Fixed a typo in line.seriesflow calculating the current on the receiving end
cuihantao_andes
train
py
c73fc53ded563ef463e7937877a4f8dd3a41d5a9
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -67,10 +67,9 @@ module.exports = function(config) { // Enable / disable watching file and executing tests whenever any file changes autoWatch: false, - // If browser does not capture in given timeout [ms], kill it - captureTimeout: 60000, - - // Additional no activity timeout to work with external browsers + // Broser connection tolerances + browserDisconnectTolerance: 2, + browserDisconnectTimeout: 10000, browserNoActivityTimeout: 60000, // Continuous Integration mode by default @@ -79,7 +78,7 @@ module.exports = function(config) { // Sauce config, requires username and accessKey to be loaded in ENV sauceLabs: { testName: 'Restmod Unit Tests', - startConnect: true + startConnect: false }, // Custom sauce launchers
fix(tests): disables sauce config startConnect
platanus_angular-restmod
train
js
c01ea09e9fabd4b0d3cae80727be6cef149ed820
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -481,13 +481,10 @@ class MWorker(multiprocessing.Process): if exc.errno == errno.EINTR: continue raise exc + # Changes here create a zeromq condition, check with thatch45 before + # making and zeromq changes except KeyboardInterrupt: - if socket.closed is False: - socket.setsockopt(zmq.LINGER, 2500) - socket.close() - finally: - if context.closed is False: - context.term() + socket.close() def _handle_payload(self, payload): '''
Remove a clause that was leaving worker connections in a bad state
saltstack_salt
train
py
a0ed99b19200e16aa58592dfc4a10a14c2d2a367
diff --git a/Tests/MessagePartTest.php b/Tests/MessagePartTest.php index <HASH>..<HASH> 100644 --- a/Tests/MessagePartTest.php +++ b/Tests/MessagePartTest.php @@ -50,7 +50,16 @@ EOF; $part->loadSource($message); - $this->assertContains('this is *some bold text*', $part->getPart('text/plain'), 'Can we extract the plain text section?'); + $this->assertContains( + 'this is *some bold text*', + $part->getPart('text/plain')->getContent(), + 'Can we extract the plain text section?' + ); + $this->assertContains( + 'this is <b>some bold text</b>', + $part->getPart('text/html')->getContent(), + 'Can we get the html content?' + ); } }
Fixes #2 Passing test to get plain and html parts of a multipart message with attachment
alexandresalome_mailcatcher
train
php
de56f98cb535d0809d3683eae8610fc2eac28034
diff --git a/pysat/instruments/omni_hro.py b/pysat/instruments/omni_hro.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/omni_hro.py +++ b/pysat/instruments/omni_hro.py @@ -52,6 +52,7 @@ import functools import numpy as np import pandas as pds import scipy.stats as stats +import warnings import pysat from .methods import nasa_cdaweb as cdw @@ -200,8 +201,6 @@ def calculate_imf_steadiness(inst, steady_window=15, min_window_frac=0.75, Y-Z plane (default=0.5) """ - import warnings - # We are not going to interpolate through missing values sample_rate = int(inst.tag[0]) max_wnum = np.floor(steady_window / sample_rate)
STY: all imports at the top
rstoneback_pysat
train
py