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
3c31b70724780d188c3a3e82c54668ad3044c266
diff --git a/parsecsv.lib.php b/parsecsv.lib.php index <HASH>..<HASH> 100644 --- a/parsecsv.lib.php +++ b/parsecsv.lib.php @@ -825,7 +825,7 @@ class parseCSV { $this->file = $file; } - if (preg_match('/\.php$/', $file) && preg_match('/<\?.*?\?>(.*)/ms', $data, $strip)) { + if (preg_match('/\.php$/i', $file) && preg_match('/<\?.*?\?>(.*)/ms', $data, $strip)) { $data = ltrim($strip[1]); }
Added accidentally removed regex modifier i
parsecsv_parsecsv-for-php
train
php
e9cf609db27997a65c8044c710324f38b3a52ab8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup requirements = [ 'numpy', 'scipy', - 'matplotlib==1.4.3', + 'matplotlib', 'pyyaml' ]
Remove version requirement for matplotlib
BerkeleyAutomation_autolab_core
train
py
fcaab2c9f16ff1a5c78446e413c61424a9941273
diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js index <HASH>..<HASH> 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js @@ -88,7 +88,7 @@ class LifeCycleHooksTest extends RenderingTestCase { }; let removeComponent = instance => { - let index = this.componentRegistry.indexOf(instance); + let index = this.componentRegistry.indexOf(getViewId(instance)); this.componentRegistry.splice(index, 1); delete this.components[name];
integration/components/life-cycle: fix removeComponent
emberjs_ember.js
train
js
8f7c91f34994dc64fc74637012acc1a9f3e30f67
diff --git a/examples/embed/spectrogram/spectrogram.py b/examples/embed/spectrogram/spectrogram.py index <HASH>..<HASH> 100644 --- a/examples/embed/spectrogram/spectrogram.py +++ b/examples/embed/spectrogram/spectrogram.py @@ -135,7 +135,7 @@ def make_spectrogram(): cols=TILE_WIDTH, rows=SPECTROGRAM_LENGTH, title=None, source=spec_source, plot_width=800, plot_height=300, x_range=[0, NGRAMS], y_range=[0, MAX_FREQ], - name="spectrogram", **plot_kw) + dilate=True, name="spectrogram", **plot_kw) spectrum_source = ColumnDataSource(data=dict(x=[], y=[])) spectrum = line(
fix stitching problem with image dilate option
bokeh_bokeh
train
py
0dfba3306d58ba3f4ddd44e10393a6c20b535e70
diff --git a/test/extended/apiserver/api_requests.go b/test/extended/apiserver/api_requests.go index <HASH>..<HASH> 100644 --- a/test/extended/apiserver/api_requests.go +++ b/test/extended/apiserver/api_requests.go @@ -262,7 +262,7 @@ var _ = g.Describe("[sig-arch][Late]", func() { "cluster-autoscaler-operator": 53.0, "cluster-baremetal-operator": 42.0, "cluster-image-registry-operator": 112, - "cluster-monitoring-operator": 41, + "cluster-monitoring-operator": 48, "cluster-node-tuning-operator": 44.0, "cluster-samples-operator": 26.0, "cluster-storage-operator": 189,
operators should not create watch channels very often: bump OpenStack monitoring operator
openshift_origin
train
go
57cf5a907fb2a4f731cf86d37424abae01cbeef8
diff --git a/lib/rom/relation/class_interface.rb b/lib/rom/relation/class_interface.rb index <HASH>..<HASH> 100644 --- a/lib/rom/relation/class_interface.rb +++ b/lib/rom/relation/class_interface.rb @@ -147,7 +147,7 @@ module ROM # @api private def default_name return unless name - Inflector.underscore(name).gsub('/', '_').to_sym + Inflector.underscore(name).tr('/', '_').to_sym end # Build relation registry of specified descendant classes
Use tr instead of gsub According to this benchmark [1] tr is way faster compared to gsub especially when just replacing a single character. [1]: <URL>
rom-rb_rom
train
rb
ceec5a982678846cdf48d88d9a14b975ade6ac09
diff --git a/cmd/juju/storage/poollistformatters.go b/cmd/juju/storage/poollistformatters.go index <HASH>..<HASH> 100644 --- a/cmd/juju/storage/poollistformatters.go +++ b/cmd/juju/storage/poollistformatters.go @@ -33,9 +33,7 @@ func formatPoolsTabular(pools map[string]PoolInfo) ([]byte, error) { ) tw := tabwriter.NewWriter(&out, minwidth, tabwidth, padding, padchar, flags) print := func(values ...string) { - fmt.Fprintf(tw, strings.Join(values, "\t")) - // Output newline after each pool - fmt.Fprintln(tw) + fmt.Fprintln(tw, strings.Join(values, "\t")) } print("NAME", "PROVIDER", "ATTRS")
CHanged to use println
juju_juju
train
go
aa60b42105ed88d2a1e562c727c50a6b4fe2cbf0
diff --git a/ignite-base/App/Sagas/OpenScreenSagas.js b/ignite-base/App/Sagas/OpenScreenSagas.js index <HASH>..<HASH> 100644 --- a/ignite-base/App/Sagas/OpenScreenSagas.js +++ b/ignite-base/App/Sagas/OpenScreenSagas.js @@ -1,12 +1,11 @@ import { call } from 'redux-saga/effects' import { Actions as NavigationActions, ActionConst } from 'react-native-router-flux' -import { merge } from 'ramda' // Process OPEN_SCREEN actions export function * openScreen (action) { - const {screen, options} = action + const {screen, options = {}} = action // Always reset the nav stack when opening a screen by default // You can override the RESET type in the options passed to the OPEN_SCREEN dispatch - const mergedOptions = merge({type: ActionConst.RESET}, options) + const mergedOptions = {type: ActionConst.RESET, ...options} yield call(NavigationActions[screen], mergedOptions) }
Replace ramda merge with es6 & add safety check
infinitered_ignite
train
js
eba55483fbab1608f2b364513e60ebcd622b294a
diff --git a/src/Proxy/Response.php b/src/Proxy/Response.php index <HASH>..<HASH> 100644 --- a/src/Proxy/Response.php +++ b/src/Proxy/Response.php @@ -125,7 +125,7 @@ final class Response * @return void * @throws RedirectException */ - public static function redirectTo($module = 'index', $controller = 'index', array $params = []): void + public static function redirectTo($module, $controller = 'index', array $params = []): void { $url = Router::getFullUrl($module, $controller, $params); self::redirect($url); diff --git a/tests/modules/test/controllers/throw-redirect.php b/tests/modules/test/controllers/throw-redirect.php index <HASH>..<HASH> 100644 --- a/tests/modules/test/controllers/throw-redirect.php +++ b/tests/modules/test/controllers/throw-redirect.php @@ -16,5 +16,5 @@ use Bluz\Proxy\Response; * @return void */ return function () { - Response::redirectTo('index', 'index'); + Response::redirectTo('index'); };
Changed signature of `Response::redirectTo()` method: - `module` is required
bluzphp_framework
train
php,php
9c78e13b29238d35aff12d8ae1788599d2c48115
diff --git a/build/lib/watch/index.js b/build/lib/watch/index.js index <HASH>..<HASH> 100644 --- a/build/lib/watch/index.js +++ b/build/lib/watch/index.js @@ -19,14 +19,15 @@ function handleDeletions() { let watch = void 0; -if (!process.env['VSCODE_USE_LEGACY_WATCH']) { - try { - watch = require('./watch-nsfw'); - } catch (err) { - console.warn('Could not load our cross platform file watcher: ' + err.toString()); - console.warn('Falling back to our platform specific watcher...'); - } -} +// Disabled due to https://github.com/Microsoft/vscode/issues/36214 +// if (!process.env['VSCODE_USE_LEGACY_WATCH']) { +// try { +// watch = require('./watch-nsfw'); +// } catch (err) { +// console.warn('Could not load our cross platform file watcher: ' + err.toString()); +// console.warn('Falling back to our platform specific watcher...'); +// } +// } if (!watch) { watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
Gulp watch fails to trigger recompilation while TypeScript compiles (fixes #<I>)
Microsoft_vscode
train
js
cfad61a2d562324e0260968925550ba1b5839224
diff --git a/modelx/core/space.py b/modelx/core/space.py index <HASH>..<HASH> 100644 --- a/modelx/core/space.py +++ b/modelx/core/space.py @@ -933,14 +933,19 @@ class BaseSpaceImpl(Derivable, BaseSpaceContainerImpl, Impl): # Dynamic Space Operation def set_formula(self, formula): - if self.formula is None: - if isinstance(formula, ParamFunc): - self.formula = formula - else: - self.formula = ParamFunc(formula, name="_formula") - self.altfunc = BoundFunction(self) + + if formula is None: + if self.formula is not None: + self.altfunc = self.formula = None else: - raise ValueError("formula already assigned.") + if self.formula is None: + if isinstance(formula, ParamFunc): + self.formula = formula + else: + self.formula = ParamFunc(formula, name="_formula") + self.altfunc = BoundFunction(self) + else: + raise ValueError("formula already assigned.") def eval_formula(self, node): return self.altfunc.get_updated().altfunc(*node[KEY])
ENH: Space.set_formula to accept None
fumitoh_modelx
train
py
92f9ebc29a0c8ebbde718ae62f806a2f66be3786
diff --git a/mqtt/client/pubsubs.py b/mqtt/client/pubsubs.py index <HASH>..<HASH> 100644 --- a/mqtt/client/pubsubs.py +++ b/mqtt/client/pubsubs.py @@ -161,9 +161,9 @@ class MQTTProtocol(MQTTBaseProtocol): def setBandwith(self, bandwith, factor=2): if bandwith <= 0: - raise VauleError("Bandwith should be a positive number") + raise ValueError("Bandwith should be a positive number") if factor <= 0: - raise VauleError("Bandwith should be a positive number") + raise ValueError("Bandwith should be a positive number") self._bandwith = bandwith self._factor = factor @@ -592,7 +592,7 @@ class MQTTProtocol(MQTTBaseProtocol): ''' Handle the absence of PUBCOMP ''' - log.error("{packet:7} (id={request.msgId:04x} qos={request.qos}) {timeout}, _retryPublish", packet="PUBCOMP", request=request, timeout="timeout") + log.error("{packet:7} (id={request.msgId:04x}) {timeout}, _retryPublish", packet="PUBCOMP", timeout="timeout") self._retryRelease(reply, dup=True) # --------------------------------------------------------------------------
Fixed exception name (ValueError instead of VauleError). Removed reference to missing argument in _pubrelError
astrorafael_twisted-mqtt
train
py
4378963480f8c1322a64a203f3f982c33e365ca3
diff --git a/test/specs/wrapper.spec.js b/test/specs/wrapper.spec.js index <HASH>..<HASH> 100644 --- a/test/specs/wrapper.spec.js +++ b/test/specs/wrapper.spec.js @@ -1,5 +1,5 @@ import { describeWithShallowAndMount } from '~resources/utils' -import { enableAutoDestroy, resetAutoDestroyState } from '~vue/test-utils' +import { enableAutoDestroy, resetAutoDestroyState } from '@vue/test-utils' describeWithShallowAndMount('Wrapper', mountingMethod => { ;['vnode', 'element', 'vm', 'options'].forEach(property => {
test: fix bad reference to vtu package
vuejs_vue-test-utils
train
js
af8b675cc3f9f0e053c27f655fa88a9e4aaee1dd
diff --git a/salt/modules/debian_ip.py b/salt/modules/debian_ip.py index <HASH>..<HASH> 100644 --- a/salt/modules/debian_ip.py +++ b/salt/modules/debian_ip.py @@ -1134,7 +1134,7 @@ def _parse_bridge_opts(opts, iface): if 'ports' in opts: if isinstance(opts['ports'], list): - opts['ports'] = ','.join(opts['ports']) + opts['ports'] = ' '.join(opts['ports']) config.update({'ports': opts['ports']}) for opt in ['ageing', 'fd', 'gcint', 'hello', 'maxage']:
Update the 'ports' option in bridge settings. It seems space is right delimiter. On trusty I got the following error trying to bringing up the bridge: $ ifup br0 interface em1,em2 does not exist!
saltstack_salt
train
py
d3fb6ec7b0e78918e9ecd647951f963bcd55a6fb
diff --git a/_html.php b/_html.php index <HASH>..<HASH> 100644 --- a/_html.php +++ b/_html.php @@ -48,6 +48,7 @@ $GLOBALS['Xiphe\THEMASTER\Settings'][] = array( ) ); +define('XIPHE_HTML_TEXTID', basename(dirname(__FILE__)).'/'.basename(__FILE__)); require_once 'bootstrap.php'; /* diff --git a/bootstrap.php b/bootstrap.php index <HASH>..<HASH> 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -15,7 +15,6 @@ define('XIPHE_HTML_ROOT_FOLDER', __DIR__.DIRECTORY_SEPARATOR); define('XIPHE_HTML_BASE_FOLDER', XIPHE_HTML_ROOT_FOLDER.'src'. DIRECTORY_SEPARATOR.'Xiphe'.DIRECTORY_SEPARATOR.'HTML'.DIRECTORY_SEPARATOR); -define('XIPHE_HTML_TEXTID', basename(__DIR__).'/'.basename(__FILE__)); /* * Include functions in the core namespace. @@ -29,4 +28,4 @@ include_once XIPHE_HTML_ROOT_FOLDER.'vendor/autoload.php'; if (!defined('XIPHE_HTML_AVAILABLE')) { $GLOBALS['HTML'] = new Xiphe\HTML(); define('XIPHE_HTML_AVAILABLE', true); -} +} \ No newline at end of file
textdomain definition moved to wp plugin file
Xiphe_HTML
train
php,php
b4989a370f0823036cbc26b86b325746b0a862ba
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -162,6 +162,7 @@ func (me *client) AddTorrent(metaInfo *metainfo.MetaInfo) error { if err != nil { return err } + torrent.MetaInfo = metaInfo me.addTorrent <- torrent return nil }
Fix crash due to torrent.MetaInfo being unset
anacrolix_torrent
train
go
a51cd361d1eef057f4fdce7d0bdca79809c47863
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -33,7 +33,6 @@ function getPropTypes(type, options) { Object.keys(props).forEach(function (k) { var propType = props[k]; - var propTypeName = t.getTypeName(propType); var checkPropType; if (process.env.NODE_ENV !== 'production') { @@ -48,7 +47,7 @@ function getPropTypes(type, options) { if (!validationResult.isValid()) { var message = [ - 'Invalid prop ' + t.stringify(prop) + ' supplied to ' + displayName + ', should be a ' + propTypeName + '.\n', + 'Invalid prop ' + t.stringify(prop) + ' supplied to ' + displayName + ', should be a ' + t.getTypeName(propType) + '.\n', 'Detected errors (' + validationResult.errors.length + '):\n' ].concat(validationResult.errors.map(function (e, i) { return ' ' + (i + 1) + '. ' + e.message;
optimisation: get the name only if is necessary
gcanti_tcomb-react
train
js
b0ffdcbceb26e977551d92e5ad603d877b937058
diff --git a/src/http_crawler/__init__.py b/src/http_crawler/__init__.py index <HASH>..<HASH> 100644 --- a/src/http_crawler/__init__.py +++ b/src/http_crawler/__init__.py @@ -6,7 +6,7 @@ import requests import tinycss -__version__ = '0.0.1' +__version__ = '0.1.0' def crawl(base_url):
Bump to version <I>
inglesp_http-crawler
train
py
c723a3468fb7c7c6b8a4193fba976d0ccfc06c7c
diff --git a/test/shim.test.js b/test/shim.test.js index <HASH>..<HASH> 100644 --- a/test/shim.test.js +++ b/test/shim.test.js @@ -270,7 +270,7 @@ describe("window.Rollbar.loadFull()", function() { // Wait for the Rollbar.loadFull() to complete and call // the callback function test() { - if (window.Rollbar && window.Rollbar.constructor.name === 'Notifier') { + if (errArgs) { expect(errArgs).to.not.be.equal(undefined); expect(errArgs).to.have.length(1);
wait until errArgs is defined. The test will timeout if it takes too long @brianr
rollbar_rollbar.js
train
js
34a190a6dabc7b66ea638e9975851b3cc48d9b9b
diff --git a/src/wormhole/_dilation/connector.py b/src/wormhole/_dilation/connector.py index <HASH>..<HASH> 100644 --- a/src/wormhole/_dilation/connector.py +++ b/src/wormhole/_dilation/connector.py @@ -6,10 +6,11 @@ from attr.validators import instance_of, provides, optional from automat import MethodicalMachine from zope.interface import implementer from twisted.internet.task import deferLater -from twisted.internet.defer import DeferredList +from twisted.internet.defer import DeferredList, CancelledError from twisted.internet.endpoints import serverFromString from twisted.internet.protocol import ClientFactory, ServerFactory from twisted.internet.address import HostnameAddress, IPv4Address, IPv6Address +from twisted.internet.error import ConnectingCancelledError from twisted.python import log from .. import ipaddrs # TODO: move into _dilation/ from .._interfaces import IDilationConnector, IDilationManager @@ -308,6 +309,8 @@ class Connector(object): desc = describe_hint_obj(h, is_relay, self._tor) d = deferLater(self._reactor, delay, self._connect, ep, desc, is_relay) + d.addErrback(lambda f: f.trap(ConnectingCancelledError, + CancelledError)) d.addErrback(log.err) self._pending_connectors.add(d)
dilate/connector: trap the right errors If we had multiple potential connections, the act of cancelling the losing ones was putting an error into log.err(), which flunked the tests. This happened to appear on windows because the appveyor environment has different interfaces than travis hosts.
warner_magic-wormhole
train
py
797c204ce92db4f9cc3d4374658ecddcbdbed85d
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -260,10 +260,11 @@ Client.prototype.connect = function(cfg) { self.emit('error', err); }); - if (typeof cfg.hostVerifier === 'function' - && ~crypto.getHashes().indexOf(cfg.hostHash)) { - var hashCb = cfg.hostVerifier, - hasher = crypto.createHash(cfg.hostHash); + if (typeof cfg.hostVerifier === 'function') { + if (HASHES.indexOf(cfg.hostHash) === -1) + throw new Error('Invalid host hash algorithm: ' + cfg.hostHash); + var hashCb = cfg.hostVerifier; + var hasher = crypto.createHash(cfg.hostHash); stream.once('fingerprint', function(key, verify) { hasher.update(key, 'binary'); verify(hashCb(hasher.digest('hex')));
Client: use cached crypto hashes list
mscdex_ssh2
train
js
0167fe7c854da62ed634373d9624be9f23493410
diff --git a/src/Form.php b/src/Form.php index <HASH>..<HASH> 100644 --- a/src/Form.php +++ b/src/Form.php @@ -571,6 +571,18 @@ class Form extends Base } /** + * @param array $attributes + * + * @return static + */ + public function setAttributes(array $attributes) + { + $this->getTag()->setAttributes($attributes); + + return $this; + } + + /** * Renders the opening tag. * * @return string
Add Form::setAttributes() to set several attributes in a single call
brick_form
train
php
aea7d4ffcf038c85976f7b26043f6247203abe4d
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -219,6 +219,24 @@ function runTests (options) { }); }); }); + it('should watch non-existent file and detect add', function(done) { + var spy = sinon.spy(); + var testPath = getFixturePath('add.txt'); + // need to be persistent or watcher will exit + options.persistent = true; + var watcher = chokidar.watch(testPath, options).on('add', spy); + // polling takes a bit longer here + setTimeout(function() { + fs.writeFileSync(testPath, 'a'); + delay(function() { + fs.unlinkSync(testPath); + spy.should.have.been.calledWith(testPath); + watcher.close(); + delete options.persistent; + done(); + }); + }, 500); + }); }); describe('watch options', function() { function clean (done) {
Add test for watching non-existent file gh-<I>
paulmillr_chokidar
train
js
eeaa69f1c31f2c8a6a70a9ab8a25ccdeceda598d
diff --git a/nailgun/entities.py b/nailgun/entities.py index <HASH>..<HASH> 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -2193,7 +2193,6 @@ class ContentViewVersion(Entity, EntityDeleteMixin, EntityReadMixin, EntitySearc 'minor': entity_fields.IntegerField(), 'module_stream_count': entity_fields.IntegerField(), 'package_count': entity_fields.IntegerField(), - 'puppet_module': entity_fields.OneToManyField(PuppetModule), 'repository': entity_fields.OneToManyField(Repository), 'version': entity_fields.StringField(), } @@ -2510,7 +2509,6 @@ class ContentView( Organization, required=True, ), - 'puppet_module': entity_fields.OneToManyField(PuppetModule), 'repository': entity_fields.OneToManyField(Repository), 'solve_dependencies': entity_fields.BooleanField(), 'version': entity_fields.OneToManyField(ContentViewVersion),
Remove puppet module field from CV (#<I>)
SatelliteQE_nailgun
train
py
e66f2c98374e0ad53a38395091d72fb0e745f752
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java index <HASH>..<HASH> 100644 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java @@ -120,8 +120,12 @@ final class ConnectionPool { if (connections.isEmpty()) { logger.debug("Tried to borrow connection but the pool was empty for {} - scheduling pool creation and waiting for connection", host); for (int i = 0; i < minPoolSize; i++) { - scheduledForCreation.incrementAndGet(); - newConnection(); + // If many connections are borrowed at the same time there needs to be a check to make sure no + // additional ones get scheduled for creation + if (scheduledForCreation.get() < minPoolSize) { + scheduledForCreation.incrementAndGet(); + newConnection(); + } } return waitForConnection(timeout, unit);
Prevents connections from exceeding max size in the driver. A fix for TINKERPOP-<I> - see that issue for more details.
apache_tinkerpop
train
java
cb25bb367b0a2f26549c213bb6941bf04c7af3bd
diff --git a/src/Uri.php b/src/Uri.php index <HASH>..<HASH> 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -591,36 +591,6 @@ class Uri implements UriTargetInterface */ private static function createUriString($scheme, $authority, $path, $query, $fragment) { - if ($scheme === 'file') { - return self::createFileUriString($path); - } - - return self::createWebUriString($scheme, $authority, $path, $query, $fragment); - } - - /** - * Return a URI for a file - * - * @param string $path - * @return string - */ - private static function createFileUriString($path) - { - return sprintf('file://%s', self::normalizePath($path)); - } - - /** - * Return a URI for a web address - * - * @param string $scheme - * @param string $authority - * @param string $path - * @param string $query - * @param string $fragment - * @return string - */ - private static function createWebUriString($scheme, $authority, $path, $query, $fragment) - { $uri = ''; if (!empty($scheme)) {
Simplify URI string creation Since this is no longer supporting non-web URIs: - removed createFileUriString(). - combined createUriString() and createWebUriString() into the former.
phly_http
train
php
64bd12a9e7d0fafe371a1f15416c1c1685a755bf
diff --git a/library/Garp/Model/Db/User.php b/library/Garp/Model/Db/User.php index <HASH>..<HASH> 100755 --- a/library/Garp/Model/Db/User.php +++ b/library/Garp/Model/Db/User.php @@ -275,6 +275,10 @@ class Garp_Model_Db_User extends Model_Base_User { $validationToken = uniqid(); $validationCode = $this->generateEmailValidationCode($user, $validationToken); + if (!$user->isConnected()) { + $user->setTable($this); + } + // Store the token in the user record $user->{$validationTokenColumn} = $validationToken; // Invalidate the user's email
fixed unserialized user for saving email validation
grrr-amsterdam_garp3
train
php
4cd65c78dd2f00b07a3763e18ea707ab6d23bc9d
diff --git a/src/AbstractArrayBackedDaftObject.php b/src/AbstractArrayBackedDaftObject.php index <HASH>..<HASH> 100644 --- a/src/AbstractArrayBackedDaftObject.php +++ b/src/AbstractArrayBackedDaftObject.php @@ -116,7 +116,7 @@ abstract class AbstractArrayBackedDaftObject extends AbstractDaftObject implemen /** * @param array<int|string, scalar|(scalar|array|object|null)[]|object|null> $array */ - final public static function DaftObjectFromJsonArray( + public static function DaftObjectFromJsonArray( array $array, bool $writeAll = self::BOOL_DEFAULT_WRITEALL ) : DaftJson {
allowing method to be overridden by downstream implementations
SignpostMarv_daft-object
train
php
b0b87072c2c6b7b5a0bd3316f01f1f7de460d280
diff --git a/src/components/VSelect/VSelect.js b/src/components/VSelect/VSelect.js index <HASH>..<HASH> 100644 --- a/src/components/VSelect/VSelect.js +++ b/src/components/VSelect/VSelect.js @@ -655,7 +655,6 @@ export default { // and click doesn't target the input setTimeout(() => { if (this.menuIsActive) return - console.log('here') this.focus() this.menuIsActive = true
fix(v-select): removed dev code
vuetifyjs_vuetify
train
js
ecba2bf079a5753126cec07ba1d4b07de9fe6d99
diff --git a/rbac/AuthorizerQueryBehavior.php b/rbac/AuthorizerQueryBehavior.php index <HASH>..<HASH> 100644 --- a/rbac/AuthorizerQueryBehavior.php +++ b/rbac/AuthorizerQueryBehavior.php @@ -72,7 +72,10 @@ class AuthorizerQueryBehavior extends Behavior } $query = new Query; - $tableSchema = $model->getTableSchema(); + + if ($user === null) { + return $query->andWhere('1=0'); + } if ($primaryKey === null) { $pkExpression = $this->quoteColumn('t', $model::primaryKey(), $model->getDb()->getSchema());
add a false condition to authorized() query when current user is not logged in
netis-pl_yii2-crud
train
php
477a6d426cd798f036df85b15d73935060503a48
diff --git a/core/chain_manager.go b/core/chain_manager.go index <HASH>..<HASH> 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -16,6 +16,10 @@ import ( var chainlogger = logger.NewLogger("CHAIN") +type StateQuery interface { + GetAccount(addr []byte) *state.StateObject +} + /* func AddTestNetFunds(block *types.Block) { for _, addr := range []string{ @@ -376,3 +380,8 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { return nil } + +// Satisfy state query interface +func (self *ChainManager) GetAccount(addr []byte) *state.StateObject { + return self.State().GetAccount(addr) +}
Added a query interface for world state
ethereum_go-ethereum
train
go
8622a109376cf7fbd0529999dc3eb5fd6c49ddb8
diff --git a/alerta/common/alert.py b/alerta/common/alert.py index <HASH>..<HASH> 100644 --- a/alerta/common/alert.py +++ b/alerta/common/alert.py @@ -106,7 +106,8 @@ class Alert(object): self.receive_time = datetime.datetime.utcnow() def __repr__(self): - return 'Alert(header=%r, alert=%r)' % (self.get_header(), self.get_body()) + return 'Alert(id=%r, environment=%r, resource=%r, event=%r, severity=%r, status=%r)' % ( + self.id, self.environment, self.resource, self.event, self.severity, self.status) def __str__(self): return json.dumps(self.get_body(), cls=DateEncoder, indent=4) @@ -355,7 +356,8 @@ class AlertDocument(object): } def __repr__(self): - return 'AlertDocument(header=%r, alert=%r)' % (self.get_header(), self.get_body()) + return 'Alert(id=%r, environment=%r, resource=%r, event=%r, severity=%r, status=%r)' % ( + self.id, self.environment, self.resource, self.event, self.severity, self.status) def __str__(self): return json.dumps(self.get_body(), cls=DateEncoder, indent=4)
fix Alert and AlertDocument repr methods
alerta_alerta
train
py
f46d4e65fda943cb9d05eac70df04635db3160ce
diff --git a/src/BooBoo.php b/src/BooBoo.php index <HASH>..<HASH> 100644 --- a/src/BooBoo.php +++ b/src/BooBoo.php @@ -130,7 +130,7 @@ class BooBoo { http_response_code(500); - $this->runHandlers($e); + $e = $this->runHandlers($e); if (!$this->silenceErrors) { $formattedResponse = $this->runFormatters($e); @@ -286,7 +286,10 @@ class BooBoo { /** @var \League\BooBoo\Handler\HandlerInterface $handler */ foreach (array_reverse($this->handlerStack) as $handler) { - $handler->handle($e); + $handledException = $handler->handle($e); + if ($handledException instanceof \Exception) { + $e = $handledException; + } } return $e;
Added some middleware "like" properties to the way exception handlers are run
thephpleague_booboo
train
php
225160d7bd2c2cf4d934780f2a202425d8861132
diff --git a/tests/device_tests/test_op_return.py b/tests/device_tests/test_op_return.py index <HASH>..<HASH> 100644 --- a/tests/device_tests/test_op_return.py +++ b/tests/device_tests/test_op_return.py @@ -65,6 +65,7 @@ class TestOpReturn(common.TrezorTest): proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)), proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=1)), + proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput), proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx), proto.TxRequest(request_type=proto_types.TXINPUT, details=proto_types.TxRequestDetailsType(request_index=0)), proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)),
device_tests: op_return now requires confirmation by user
trezor_python-trezor
train
py
d0e138fc3820d936fb8bc7f5a067d3a06ef24f22
diff --git a/packages/sproutcore-metal/lib/platform.js b/packages/sproutcore-metal/lib/platform.js index <HASH>..<HASH> 100644 --- a/packages/sproutcore-metal/lib/platform.js +++ b/packages/sproutcore-metal/lib/platform.js @@ -54,6 +54,33 @@ if (!SC.platform.create) { */ SC.platform.defineProperty = Object.defineProperty; +// Detects a bug in Android <3.2 where you cannot redefine a property using +// Object.defineProperty once accessors have already been set. +var canRedefineProperties = (function() { + var obj = {}, defineProperty = Object.defineProperty; + + defineProperty(obj, 'a', { + configurable: true, + enumerable: true, + get: function() { }, + set: function() { } + }); + + defineProperty(obj, 'a', { + configurable: true, + enumerable: true, + writable: true, + value: true + }); + + return obj.a === true; +})(); + +// Disable using defineProperty if it exhibits the bug above. +if (!canRedefineProperties) { + SC.platform.defineProperty = null; +} + // This is for Safari 5.0, which supports Object.defineProperty, but not // on DOM nodes.
Scumbag Android doesn't allow you to change an accessor descriptor to a data descriptor.
emberjs_ember.js
train
js
c37a7b67739669b6273f5eebb45d441f7fe5b093
diff --git a/src/models/axis.js b/src/models/axis.js index <HASH>..<HASH> 100644 --- a/src/models/axis.js +++ b/src/models/axis.js @@ -71,7 +71,9 @@ if(this.min<=0 && this.scaleType=="log") this.min = 0.01; if(this.max<=0 && this.scaleType=="log") this.max = 10; - if(this.min>=this.max) this.min = this.max/2; + + // Max may be less than min + // if(this.min>=this.max) this.min = this.max/2; if(this.min!=this.scale.domain()[0] || this.max!=this.scale.domain()[1]) this.scale.domain([this.min, this.max]);
Allow min to be less than max. Fixes #<I>
vizabi_vizabi
train
js
cc9ec17f74a145074eae87e977e5d0fabc887fd8
diff --git a/lib/coveralls.rb b/lib/coveralls.rb index <HASH>..<HASH> 100644 --- a/lib/coveralls.rb +++ b/lib/coveralls.rb @@ -63,13 +63,13 @@ module Coveralls if simplecov_setting puts "[Coveralls] Using SimpleCov's '#{simplecov_setting}' settings.".green if block_given? - ::SimpleCov.start(simplecov_setting) { instance_eval &block } + ::SimpleCov.start(simplecov_setting) { instance_eval(&block)} else ::SimpleCov.start(simplecov_setting) end elsif block_given? puts "[Coveralls] Using SimpleCov settings defined in block.".green - ::SimpleCov.start { instance_eval &block } + ::SimpleCov.start { instance_eval(&block) } else puts "[Coveralls] Using SimpleCov's default settings.".green ::SimpleCov.start
remove & interpreted as argument prefix. By adding the ()s, we make this unambiguous.
lemurheavy_coveralls-ruby
train
rb
bbb80cbb5b72e6ded91325079944e44ef08c31c8
diff --git a/support/test-runner/app.js b/support/test-runner/app.js index <HASH>..<HASH> 100644 --- a/support/test-runner/app.js +++ b/support/test-runner/app.js @@ -242,4 +242,10 @@ suite('socket.test.js', function () { }); }); + server('test sending query strings to the server', function (io) { + io.sockets.on('connection', function (socket) { + socket.json.send(socket.handshake); + }) + }); + }); diff --git a/test/socket.test.js b/test/socket.test.js index <HASH>..<HASH> 100644 --- a/test/socket.test.js +++ b/test/socket.test.js @@ -275,6 +275,21 @@ socket.disconnect(); next(); }); + }, + + 'test sending query strings to the server': function (next) { + var socket = create('?foo=bar'); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('message', function (data) { + data.query.foo.should().eql('bar'); + + socket.disconnect(); + next(); + }); } };
Added testcase for query string sending / getting
tsjing_socket.io-client
train
js,js
3ef01179a24d1df22ceb37b85e509aad88db9cf9
diff --git a/test/unified_format.py b/test/unified_format.py index <HASH>..<HASH> 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -604,6 +604,8 @@ class MatchEvaluatorUtil(object): def coerce_result(opname, result): """Convert a pymongo result into the spec's result format.""" + if hasattr(result, 'acknowledged') and not result.acknowledged: + return {'acknowledged': False} if opname == 'bulkWrite': return parse_bulk_write_result(result) if opname == 'insertOne':
PYTHON-<I> Fix unified test coerce_result on unack writes (#<I>)
mongodb_mongo-python-driver
train
py
40675f51f9eac0dd2dde15aedea3e03ade200a03
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -63,7 +63,7 @@ exports.filter = function filter(options, done) { let q = query.q; //check if is search query - const filters = _.omitBy(_.merge({}, filter, { q }), val => !val); + const filters = _.omitBy(_.merge({}, filter, { q }), val => val === undefined); //TODO ignore ['$jsonSchema', '$where'] @@ -666,4 +666,4 @@ exports.parse = function parse(string, done) { done(error); } -}; \ No newline at end of file +};
Fix elimination of false fields from filter.
lykmapipo_express-mquery
train
js
d10b48dd0aa00504212cb6f8598e5c1b7d0d968e
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index <HASH>..<HASH> 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -363,7 +363,7 @@ module ApplicationTests end RUBY - run_test_command('test/models/account_test.rb:4:9 test/models/post_test:4:9').tap do |output| + run_test_command('test/models/account_test.rb:4:9 test/models/post_test.rb:4:9').tap do |output| assert_match 'AccountTest:FirstFilter', output assert_match 'AccountTest:SecondFilter', output assert_match 'PostTest:FirstFilter', output
Fix model test path typo uncovered in previous commit. Because of the expanding whitelist for test filters, this test ended up running the tests on lines 4 and 9 in the post test even though the path wasn't right. Happened incidentally because the same line numbers were used in both account and post test. Add the .rb line so the file is required correctly and the filters are applied.
rails_rails
train
rb
90ff69586b0579e6d059d789da9a9ad37031c372
diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index <HASH>..<HASH> 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -15,7 +15,6 @@ import logging import logging.handlers from operator import itemgetter from socket import error as socket_error -import cgi from ldapcherry.exceptions import * from ldapcherry.lclogging import * @@ -35,8 +34,10 @@ from mako import exceptions if sys.version < '3': from sets import Set as set from urllib import quote_plus + from cgi import escape as html_escape else: from urllib.parse import quote_plus + from html import escape as html_escape SESSION_KEY = '_cp_username' @@ -64,7 +65,7 @@ class LdapCherry(object): def _escape_list(self, data): ret = [] for i in data: - ret.append(cgi.escape(i, True)) + ret.append(html_escape(i, True)) return ret def _escape_dict(self, data): @@ -76,7 +77,7 @@ class LdapCherry(object): elif isinstance(data[d], set): data[d] = set(self._escape_list(data[d])) else: - data[d] = cgi.escape(data[d], True) + data[d] = html_escape(data[d], True) return data def _escape(self, data, dtype):
remove deprecation warning for html escape in python 2, (html) escape is part of the cgi module in python 3, it's part of the html module we now do a conditional import depending on the version, and name the function html_escape.
kakwa_ldapcherry
train
py
1226328f39be12dd6a3fcfddfe10aa5f65872de7
diff --git a/src/Link.php b/src/Link.php index <HASH>..<HASH> 100644 --- a/src/Link.php +++ b/src/Link.php @@ -49,8 +49,11 @@ class Link { foreach ( $routes as $routePath => $routeDesc ){ $routePath = preg_replace( $regex, $replacements, $routePath ); if( preg_match( '#^/?' . $routePath . '/?$#', $path, $matches ) ){ - if( is_array( $routeDesc ) ) + if( is_array( $routeDesc ) ) { $handler = $routeDesc[0]; + if( isset( $routeDesc[2] )) + $middleware = $routeDesc[2]; + } else $handler = $routeDesc; $matched = $matches;
Adds middleware's basic code - Now array's value 2 would be used as middleware
apsdehal_Link
train
php
b06b7be406dd50868fb77613ca13bf3b18b1442e
diff --git a/scrubadub/detectors/base.py b/scrubadub/detectors/base.py index <HASH>..<HASH> 100644 --- a/scrubadub/detectors/base.py +++ b/scrubadub/detectors/base.py @@ -19,6 +19,6 @@ class RegexDetector(Detector): 'RegexFilth required for RegexDetector' ) if self.filth_cls.regex is None: - raise StopIteration + return for match in self.filth_cls.regex.finditer(text): yield self.filth_cls(match) diff --git a/scrubadub/scrubbers.py b/scrubadub/scrubbers.py index <HASH>..<HASH> 100644 --- a/scrubadub/scrubbers.py +++ b/scrubadub/scrubbers.py @@ -85,7 +85,7 @@ class Scrubber(object): # this is where the Scrubber does its hard work and merges any # overlapping filths. if not all_filths: - raise StopIteration + return filth = all_filths[0] for next_filth in all_filths[1:]: if filth.end < next_filth.beg:
Replace StopIteration with return (PEP <I>)
datascopeanalytics_scrubadub
train
py,py
13dd292c854fd0c48009f212b8c11ec01310de35
diff --git a/pygccxml/parser/patcher.py b/pygccxml/parser/patcher.py index <HASH>..<HASH> 100644 --- a/pygccxml/parser/patcher.py +++ b/pygccxml/parser/patcher.py @@ -60,14 +60,16 @@ class default_argument_patcher_t(object): try: int(arg.default_value) return False - except: + except ValueError: + # The arg.default_value string could not be converted to int return True def __fix_invalid_integral(self, func, arg): try: int(arg.default_value) return arg.default_value - except: + except ValueError: + # The arg.default_value string could not be converted to int pass try: @@ -83,7 +85,8 @@ class default_argument_patcher_t(object): if found_hex and not default_value.startswith('0x'): int('0x' + default_value, 16) return '0x' + default_value - except: + except ValueError: + # The arg.default_value string could not be converted to int pass # may be we deal with enum
Avoid empty exception handlers in patcher.py
gccxml_pygccxml
train
py
0e7f6a40c0a2d8c00fc49f1f95529c00d05dab8e
diff --git a/spec/Crummy/Phlack/Bridge/Guzzle/PhlackClientSpec.php b/spec/Crummy/Phlack/Bridge/Guzzle/PhlackClientSpec.php index <HASH>..<HASH> 100644 --- a/spec/Crummy/Phlack/Bridge/Guzzle/PhlackClientSpec.php +++ b/spec/Crummy/Phlack/Bridge/Guzzle/PhlackClientSpec.php @@ -17,4 +17,19 @@ class PhlackClientSpec extends ObjectBehavior { $this->shouldHaveType('\Guzzle\Service\Client'); } + + function its_factory_which_requires_a_config() + { + $this::factory([ 'username' => 'foo', 'token' => 'bar' ])->shouldReturnAnInstanceOf($this); + } + + function its_factory_requires_a_username() + { + $this->shouldThrow()->during('factory', array('foo' => 'user', 'token' => 'abc123')); + } + + function its_factory_requires_a_token() + { + $this->shouldThrow()->during('factory', array('username' => 'bar')); + } }
Adding factory config tests to PhlackClientSpec
mcrumm_phlack
train
php
fc374e807167f99e57bae4dd85e444f7be19deaf
diff --git a/core/play/src/main/java/play/mvc/BodyParser.java b/core/play/src/main/java/play/mvc/BodyParser.java index <HASH>..<HASH> 100644 --- a/core/play/src/main/java/play/mvc/BodyParser.java +++ b/core/play/src/main/java/play/mvc/BodyParser.java @@ -444,6 +444,7 @@ public interface BodyParser<A> { this.materializer = materializer; } + @Inject public TemporaryFile( HttpConfiguration httpConfiguration, play.libs.Files.TemporaryFileCreator temporaryFileCreator,
Add @Inject to TemporaryFile body parser constructor
playframework_playframework
train
java
181f7bd2040e03a8720de62913db8eb8010a93f2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -75,7 +75,6 @@ function complete(n) { for (j = i + 1; j < n; ++j) { if (i !== j) { g.addLink(i, j); - g.addLink(j, i); } } } diff --git a/test/create.js b/test/create.js index <HASH>..<HASH> 100644 --- a/test/create.js +++ b/test/create.js @@ -27,7 +27,7 @@ test('Create complete', function(t) { var graph = generators.complete(size); // Complete graph has all nodes connected with each other. t.equal(graph.getNodesCount(), size, "Unexpected number of nodes for complete graph"); - t.equal(graph.getLinksCount(), (size * (size - 1)), "Unexpected number of links for complete graph"); + t.equal(graph.getLinksCount(), (size * (size - 1)/2), "Unexpected number of links for complete graph"); t.end(); });
Removed extra link creation for complete graphs
anvaka_ngraph.generators
train
js,js
5f3b43390ccfc4224c682ba7559a6a7a129e2ed5
diff --git a/lib/Grid/Advanced.php b/lib/Grid/Advanced.php index <HASH>..<HASH> 100644 --- a/lib/Grid/Advanced.php +++ b/lib/Grid/Advanced.php @@ -572,6 +572,20 @@ class Grid_Advanced extends Grid_Basic } /** + * Additional formatting of checkbox fields column for totals row + * + * Basically we remove everything from such field + * + * @param string $field field name + * @param array $column column configuration + * + * @return void + */ + function format_totals_checkbox($field, $column) { + @$this->current_row_html[$field] = ''; + } + + /** * Additional formatting of delete button fields for totals row * * Basically we remove everything from such field
don't show selectable checkbox in totals row (for <I> branch)
atk4_atk4
train
php
749ccb4a60a2ad54759e1bcea9a47dc69646183e
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -41,7 +41,7 @@ module ActiveSupport end # +InheritableOptions+ provides a constructor to build an +OrderedOptions+ - # hash inherited from the another hash. + # hash inherited from another hash. # # Use this if you already have some hash and you want to create a new one based on it. #
Fixed grammar error in ordered_options documention.
rails_rails
train
rb
4666179cd71c8bec4d00331b1a1a9d2351ddfe5d
diff --git a/pytplot/__init__.py b/pytplot/__init__.py index <HASH>..<HASH> 100644 --- a/pytplot/__init__.py +++ b/pytplot/__init__.py @@ -5,8 +5,16 @@ from _collections import OrderedDict from . import HTMLPlotter +import os import sys +# runs without Qt +if not 'PYTPLOT_NO_GRAPHICS' in os.environ: + using_graphics = True +else: + using_graphics = False + + # This variable will be constantly changed depending on what x value the user is hovering over class HoverTime(object): hover_time = 0 @@ -26,8 +34,6 @@ class HoverTime(object): return -using_graphics = True - try: import pyqtgraph as pg from pyqtgraph.Qt import QtWidgets @@ -133,8 +139,9 @@ from pytplot.tplot_math import * # If we are in an ipython environment, set the gui to be qt5 # This allows the user to interact with the window in real time try: - magic = get_ipython().magic - magic(u'%gui qt5') + if using_graphics: + magic = get_ipython().magic + magic(u'%gui qt5') except: pass
Allow users to import pytplot without graphics Users can now import without Qt By setting PYTPLOT_NO_GRAPHICS environment variable before importing pytplot.
MAVENSDC_PyTplot
train
py
9ddacca15fad0d583e81d2ff4f821f2c3c92e567
diff --git a/indra/tests/test_cwms.py b/indra/tests/test_cwms.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_cwms.py +++ b/indra/tests/test_cwms.py @@ -1,6 +1,7 @@ from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str +import unittest from os.path import join, dirname, abspath from nose.plugins.attrib import attr @@ -52,6 +53,7 @@ def test_cwmsreader_cause(): @attr('slow', 'webservice') +@unittest.skip('Interpretation currently failing') def test_cwmsreader_inhibit(): # Test extraction of inhibition relations from the cwms reader service text = 'Persistent insecurity and armed conflict have disrupted ' + \
Skip test where CWMS interpretation is failing
sorgerlab_indra
train
py
74b8d8885c8ad90f5649a8eb8228c62a840c5f3a
diff --git a/par2ools/par2.py b/par2ools/par2.py index <HASH>..<HASH> 100644 --- a/par2ools/par2.py +++ b/par2ools/par2.py @@ -75,7 +75,7 @@ class Par2File(object): else: self.contents = obj_or_path.read() if getattr(obj_or_path, 'name', None): - self.path = f.name + self.path = obj_or_path.name self.packets = self.read_packets() def read_packets(self):
Fix opening by file object Fix error `UnboundLocalError: local variable 'f' referenced before assignment`
jmoiron_par2ools
train
py
8d4b934f5e2207b8b5cf4178f3862baa336576cd
diff --git a/src/Illuminate/Foundation/Console/AppNameCommand.php b/src/Illuminate/Foundation/Console/AppNameCommand.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Console/AppNameCommand.php +++ b/src/Illuminate/Foundation/Console/AppNameCommand.php @@ -134,6 +134,10 @@ class AppNameCommand extends Command { $this->replaceIn( $this->getBootstrapPath(), $this->currentRoot.'\\Console', $this->argument('name').'\\Console' ); + + $this->replaceIn( + $this->getBootstrapPath(), $this->currentRoot.'\\Exceptions', $this->argument('name').'\\Exceptions' + ); } /**
Update app:name command Allow php artisan app:name to set the correct namespace for the application exception handler
laravel_framework
train
php
8dfadedb8cec8661123f33345893f586d5cc16d4
diff --git a/kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/stdlib/PatternNameMatcher.java b/kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/stdlib/PatternNameMatcher.java index <HASH>..<HASH> 100644 --- a/kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/stdlib/PatternNameMatcher.java +++ b/kite-morphlines/kite-morphlines-core/src/main/java/org/kitesdk/morphline/stdlib/PatternNameMatcher.java @@ -168,7 +168,7 @@ final class PatternNameMatcher { if (cacheCapacity < 0) { throw new IllegalArgumentException("Cache capacity must not be negative"); } - this.cache = cacheCapacity > 0 ? new BoundedLRUHashMap<String, Boolean>(10000) : null; + this.cache = cacheCapacity > 0 ? new BoundedLRUHashMap<String, Boolean>(cacheCapacity) : null; } @Override
yet more optimization of performance of removeFields and removeValues morphline commands
kite-sdk_kite
train
java
ea40aa268d5044acab40d15789f0c97772cbad2c
diff --git a/lib/airbrake-ruby.rb b/lib/airbrake-ruby.rb index <HASH>..<HASH> 100644 --- a/lib/airbrake-ruby.rb +++ b/lib/airbrake-ruby.rb @@ -1,7 +1,6 @@ require 'net/https' require 'logger' require 'json' -require 'thread' require 'set' require 'socket' require 'time'
airbrake-ruby: fix the Lint/RedundantRequireStatement cop offence
airbrake_airbrake-ruby
train
rb
5d17b59d23b499c9c256f1b7fb02654026a98ddf
diff --git a/src/Logging/Drivers/Daily.php b/src/Logging/Drivers/Daily.php index <HASH>..<HASH> 100755 --- a/src/Logging/Drivers/Daily.php +++ b/src/Logging/Drivers/Daily.php @@ -8,6 +8,16 @@ use Modulus\Hibernate\Logging\Driver; class Daily extends Driver { /** + * Create log file if it doesn't already exists + * + * @return void + */ + public function __construct() + { + if (!file_exists($this->getLogFile())) touch($this->getLogFile()); + } + + /** * Get log file * * @return string
feat: Create log file if it doesn't already exists
modulusphp_hibernate
train
php
54007cbb024d1d056ed9148361f2e84acfc35506
diff --git a/src/Themosis/View/Compilers/ScoutCompiler.php b/src/Themosis/View/Compilers/ScoutCompiler.php index <HASH>..<HASH> 100644 --- a/src/Themosis/View/Compilers/ScoutCompiler.php +++ b/src/Themosis/View/Compilers/ScoutCompiler.php @@ -231,7 +231,7 @@ class ScoutCompiler extends Compiler implements ICompiler { */ protected function compileEchoDefaults($content) { - return preg_replace('/^(?=\$)(.+?)(?:\s+or\s+)(.+?)$/s', 'isset($1) ? $1 : $2', $content); + return preg_replace('/^.*?([\'"])(?:(?!\1).)*or(?:(?!\1).)*\1.*?$(*SKIP)(*F)|^(\S+) or (.*)$/', 'isset($2) ? $2 : $3', $content); } /**
Update scout compiler echo statement. Fix from Blade compiler.
themosis_framework
train
php
8cbda9694e8139ef84a526607399fc4058d79b1f
diff --git a/cluster/shard_writer.go b/cluster/shard_writer.go index <HASH>..<HASH> 100644 --- a/cluster/shard_writer.go +++ b/cluster/shard_writer.go @@ -43,7 +43,9 @@ func (w *ShardWriter) WriteShard(shardID, ownerID uint64, points []tsdb.Point) e if !ok { panic("wrong connection type") } - defer conn.Close() // return to pool + defer func(conn net.Conn) { + conn.Close() // return to pool + }(conn) // Build write request. var request WriteShardRequest
Ensure unusable connections get closed Fixes a bug where a connection that was marked as unusable didn't prevent it from getting checked backed into the pool.
influxdata_influxdb
train
go
b9bfefca65bca95873213f9b9c95a5c12d341f26
diff --git a/src/components/SimpleSelect.js b/src/components/SimpleSelect.js index <HASH>..<HASH> 100644 --- a/src/components/SimpleSelect.js +++ b/src/components/SimpleSelect.js @@ -57,7 +57,9 @@ const SimpleSelect = React.createClass({ return ( <div style={styles.component}> <div style={styles.menu}> - {this.props.items.map((item, i) => { + {this.props.children ? + this.props.children : + (this.props.items.map((item, i) => { return ( <div key={i} @@ -70,7 +72,8 @@ const SimpleSelect = React.createClass({ <div style={styles.text}>{item.text}</div> </div> ); - })} + }) + )} </div> <div onClick={this.props.onScrimClick} style={styles.scrim} /> </div>
SimpleSelect supports children over the items prop.
mxenabled_mx-react-components
train
js
0b405c211c9bf78466443d7ead5d03baf8e38db5
diff --git a/h2o-core/src/main/java/water/init/NetworkInit.java b/h2o-core/src/main/java/water/init/NetworkInit.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/init/NetworkInit.java +++ b/h2o-core/src/main/java/water/init/NetworkInit.java @@ -518,8 +518,8 @@ public class NetworkInit { bb.mark(); for( H2ONode h2o : nodes ) { try { + bb.reset(); if(H2O.ARGS.useUDP) { - bb.reset(); CLOUD_DGRAM.send(bb, h2o._key); } else { h2o.sendMessage(bb,priority);
[PUBDEV-<I>] Flatfile mode fix After discussion with Tomas we fixed flatfile mode which was failing in Sparkling Water.
h2oai_h2o-3
train
java
83f3487ac093015234c2f15292670792bfe00770
diff --git a/src/utils/formatSelector.js b/src/utils/formatSelector.js index <HASH>..<HASH> 100644 --- a/src/utils/formatSelector.js +++ b/src/utils/formatSelector.js @@ -182,10 +182,8 @@ export const FormatSelector = ( keysFromRaw: (rawKeys: any = {}) => { const keyRings = {} - const branchesNames: Array<string> = [ - 'master', - ...(Object.values(branches): any) - ] + const branchesNames: Array<string> = ['master'] + for (const n in branches) branchesNames.push(branches[n]) for (const branchName of branchesNames) { const { xpub, xpriv } = rawKeys[branchName] || {} keyRings[branchName] = {
Stop using unsupported `Object.values` method `Object.values` only exists in newer browsers, and crashes the plugin on the Android WebView.
EdgeApp_edge-currency-bitcoin
train
js
f32f8d9cf60b9e86f2b50081fc016d9f5f23af8d
diff --git a/lib/page-object/accessors.rb b/lib/page-object/accessors.rb index <HASH>..<HASH> 100644 --- a/lib/page-object/accessors.rb +++ b/lib/page-object/accessors.rb @@ -127,7 +127,7 @@ module PageObject # def expected_element_visible(element_name, timeout=::PageObject.default_element_wait, check_visible=false) define_method("has_expected_element_visible?") do - has_exected_element? + self.respond_to? "#{element_name}_element" and self.send("#{element_name}_element").when_present timeout self.respond_to? "#{element_name}_element" and self.send("#{element_name}_element").when_visible timeout end end
fix - expected_element_visible doesn't rely on expected_element anymore
cheezy_page-object
train
rb
ea4b9400ca5993d133c18a249c4654e5489640f2
diff --git a/sample/src/about/about.js b/sample/src/about/about.js index <HASH>..<HASH> 100644 --- a/sample/src/about/about.js +++ b/sample/src/about/about.js @@ -21,7 +21,7 @@ export class About { attached() { // let bridge = System.get(System.normalizeSync('aurelia-materialize-bridge')); // this.version = bridge.version; - this.version = '0.23.0'; + this.version = '0.24.0'; } onSelectionChanged(e) {
chore(sample): increase version
aurelia-ui-toolkits_aurelia-materialize-bridge
train
js
a285a5f2404fb2d3fc0fc84dd951bed9289d7ef7
diff --git a/graylog2-server/src/main/java/org/graylog2/shared/ServerVersion.java b/graylog2-server/src/main/java/org/graylog2/shared/ServerVersion.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/shared/ServerVersion.java +++ b/graylog2-server/src/main/java/org/graylog2/shared/ServerVersion.java @@ -20,5 +20,5 @@ import org.graylog2.plugin.Version; public class ServerVersion { public static final Version VERSION = Version.CURRENT_CLASSPATH; - public static final String CODENAME = "Space Moose"; + public static final String CODENAME = "Quantum Dog"; }
Update code name for <I> (#<I>) Welcome Quantum Dog!
Graylog2_graylog2-server
train
java
8c329354a8a1a169deb968e2f7c425bea73c6b98
diff --git a/vm/lib.luajs.js b/vm/lib.luajs.js index <HASH>..<HASH> 100644 --- a/vm/lib.luajs.js +++ b/vm/lib.luajs.js @@ -159,11 +159,11 @@ luajs.lib = { item = arguments[i]; if (item instanceof luajs.Table) { - output.push ('[Lua table]'); + output.push ('table: 0x' + item.__luajs.index.toString (16)); } else if (item instanceof Function) { - output.push ('[JavaScript function]'); - + output.push ('JavaScript function: ' + item.toString ()); + } else if (item === undefined) { output.push ('nil');
print() output made more consistent with Lua.
gamesys_moonshine
train
js
3b6c663483e8c53e66229fbad8a009d55a04dad6
diff --git a/tests/SxBootstrapTest/View/Helper/Bootstrap/NavigationMenuTest.php b/tests/SxBootstrapTest/View/Helper/Bootstrap/NavigationMenuTest.php index <HASH>..<HASH> 100644 --- a/tests/SxBootstrapTest/View/Helper/Bootstrap/NavigationMenuTest.php +++ b/tests/SxBootstrapTest/View/Helper/Bootstrap/NavigationMenuTest.php @@ -23,26 +23,6 @@ class NavigationMenuTest extends TestCase protected $helper; /** - * @var Navigation - */ - protected $nav; - - /** - * @var \SpiffyNavigation\Container - */ - protected $container1; - - /** - * @var \SpiffyNavigation\Container - */ - protected $container2; - - /** - * @var \SpiffyNavigation\Container - */ - protected $container3; - - /** * @var ServiceManager */ protected $serviceManager;
Add test and closes #<I>
SpoonX_SxBootstrap
train
php
87b4109418830ab81d931ae2c27dd0049eeb0e7b
diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java +++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java @@ -7794,7 +7794,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { List<T> answer = new ArrayList<>(indices.size()); for (Object value : indices) { if (value instanceof Collection) { - answer.addAll((List<T>)InvokerHelper.invokeMethod(self, "getAt", value)); + answer.addAll(getAt(self, (Collection) value)); } else { int idx = DefaultTypeTransformation.intUnbox(value); answer.add(getAt(self, idx));
minor refactor - no need to funnel through InvokerHelper here
apache_groovy
train
java
1a3f96b58fdcb21d40ec4239070337164fbc1195
diff --git a/middleman-core/lib/middleman-core/core_extensions/file_watcher.rb b/middleman-core/lib/middleman-core/core_extensions/file_watcher.rb index <HASH>..<HASH> 100644 --- a/middleman-core/lib/middleman-core/core_extensions/file_watcher.rb +++ b/middleman-core/lib/middleman-core/core_extensions/file_watcher.rb @@ -30,7 +30,7 @@ module Middleman # Setup source collection. @sources = ::Middleman::Sources.new(app, disable_watcher: app.config[:watcher_disable], - force_polling: app.config[:force_polling], + force_polling: app.config[:watcher_force_polling], latency: app.config[:watcher_latency]) # Add default ignores.
Fix misnamed config value which was causing --force-polling flag to be ignored by file_watcher extension
middleman_middleman
train
rb
033411444e9ae87bd286e358a0d356eadde2a91a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages setup( name='placebo', - version='0.3.0', + version='0.4.0', description='Make boto3 calls that look real but have no effect', author='Mitch Garnaat', author_email='mitch@garnaat.com', @@ -20,10 +20,10 @@ setup( 'Natural Language :: English', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4' + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5' ), )
Bumping version and fixing supported python versions.
garnaat_placebo
train
py
2762947a70ce1ec45c840ed585feba75c0432250
diff --git a/lib/fog/slicehost.rb b/lib/fog/slicehost.rb index <HASH>..<HASH> 100644 --- a/lib/fog/slicehost.rb +++ b/lib/fog/slicehost.rb @@ -44,8 +44,8 @@ module Fog end def initialize(options={}) - unless @password = options[:slicehost_password] - raise ArgumentError.new('password is required to access slicehost') + unless @slicehost_password = options[:slicehost_password] + raise ArgumentError.new('slicehost_password is required to access slicehost') end @host = options[:host] || "api.slicehost.com" @port = options[:port] || 443 @@ -55,7 +55,7 @@ module Fog def request(params) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") headers = { - 'Authorization' => "Basic #{Base64.encode64(@password).gsub("\n",'')}" + 'Authorization' => "Basic #{Base64.encode64(@slicehost_password).chomp!}" } case params[:method] when 'DELETE', 'GET', 'HEAD'
fix naming for slicehost password stuff
fog_fog
train
rb
4d77d2f7bcdc6323fb02258ffcb0cc1e7dc9ecb0
diff --git a/core/client/tagui.js b/core/client/tagui.js index <HASH>..<HASH> 100644 --- a/core/client/tagui.js +++ b/core/client/tagui.js @@ -163,7 +163,7 @@ } function handleClickOff(e) { - if (window.matchMedia('max-width: 650px')) { + if (window.matchMedia('(max-width: 650px)').matches) { e.preventDefault(); $('body').toggleClass('off-canvas'); }
Fixed 'G' button not working Fixes #<I>.
TryGhost_Ghost
train
js
002375a1dd6e915b7ae0acef7c2272d19a0dbf23
diff --git a/jwt.go b/jwt.go index <HASH>..<HASH> 100644 --- a/jwt.go +++ b/jwt.go @@ -59,11 +59,6 @@ type JWTConfig struct { cache Cache } -// Options returns JWT options. -func (c *JWTConfig) Options() *JWTOptions { - return c.opts -} - // NewTransport creates a transport that is authorize with the // parent JWT configuration. func (c *JWTConfig) NewTransport() Transport { diff --git a/oauth2.go b/oauth2.go index <HASH>..<HASH> 100644 --- a/oauth2.go +++ b/oauth2.go @@ -134,11 +134,6 @@ type Config struct { cache Cache } -// Options returns options. -func (c *Config) Options() *Options { - return c.opts -} - // AuthCodeURL returns a URL to OAuth 2.0 provider's consent page // that asks for permissions for the required scopes explicitly. func (c *Config) AuthCodeURL(state string) (authURL string, err error) {
Removing unnecessary option getters.
golang_oauth2
train
go,go
a25394d7a3634dc27f3974c3213d4ede9988887c
diff --git a/salt/pillar/cobbler.py b/salt/pillar/cobbler.py index <HASH>..<HASH> 100644 --- a/salt/pillar/cobbler.py +++ b/salt/pillar/cobbler.py @@ -52,7 +52,7 @@ def ext_pillar(minion_id, pillar, key=None, only=()): try: server = xmlrpclib.Server(url, allow_none=True) if user: - server = xmlrpclib.Server(server, server.login(user, password)) + server.login(user, password) result = server.get_blended_data(None, minion_id) except Exception: log.exception(
correct invalid xmlrpclib auth Same as #<I>, but for pillar this time.
saltstack_salt
train
py
d3d576c296dbafec0279d89172f299771c30f639
diff --git a/dev/js/build.js b/dev/js/build.js index <HASH>..<HASH> 100755 --- a/dev/js/build.js +++ b/dev/js/build.js @@ -94,10 +94,11 @@ var Builder = function(options) { return extractHeader(content); }; - var applyTemplateToFile = function(templatePath, contentFileName, outFileName, opt_extra) { + var applyTemplateToFile = function(defaultTemplatePath, contentFileName, outFileName, opt_extra) { console.log("processing: ", contentFileName); - var template = readFile(templatePath); var data = loadMD(contentFileName); + var templatePath = data.headers.template || defaultTemplatePath; + var template = readFile(templatePath); // Call prep's Content which parses the HTML. This helps us find missing tags // should probably call something else. //Convert(md_content)
make it possible to set template for docs
greggman_HappyFunTimes
train
js
43aefc49e28d5d6d0cd4aeff525746307810b6db
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,7 @@ def pytest_addoption(parser): group = parser.getgroup("psyplot", "psyplot specific options") - group.addoption('--no-removal', help='Do not remove created test files', + group.addoption('--no-remove', help='Do not remove created test files', action='store_true') group.addoption( '--ref', help='Create reference figures instead of running the tests', @@ -9,7 +9,7 @@ def pytest_addoption(parser): def pytest_configure(config): - if config.getoption('no_removal'): + if config.getoption('no_remove'): import _base_testing _base_testing.remove_temp_files = False if config.getoption('ref'):
Renamed no-removal to no-remove
Chilipp_psy-simple
train
py
6a62486f62371a05ded08d1bbc947ffaed104e13
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup(name='ledger-autosync', ], author='Erik Hetzner', author_email='egh@e6h.org', - url='https://bitbucket.org/egh/ledger-autosync', + url='https://gitlab.com/egh/ledger-autosync', packages=find_packages(exclude=[ 'tests']), entry_points={
Update url in setup.py
egh_ledger-autosync
train
py
526456ab1cfdb828ffc0072197646fc7e3ef4758
diff --git a/packages/docs/themes/cerebral-website/page/__head/page__head.bemhtml.js b/packages/docs/themes/cerebral-website/page/__head/page__head.bemhtml.js index <HASH>..<HASH> 100644 --- a/packages/docs/themes/cerebral-website/page/__head/page__head.bemhtml.js +++ b/packages/docs/themes/cerebral-website/page/__head/page__head.bemhtml.js @@ -17,3 +17,13 @@ block('page').elem('head')( ] }) ) + +block('page').elem('head').match(function (){ + return this._meta && this._meta.redirect +})( + content()(function () { + return applyNext().concat([ + { elem: 'meta', attrs: { 'http-equiv': 'refresh', content: '0; url="' + this._meta.redirect + '.html"' } } + ]) + }) +)
feat(page): support redirect tag in meta
cerebral_cerebral
train
js
30199b9cccdbc6b7bb47d90db04bc10de1248ec2
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -68,7 +68,7 @@ class TwitterLogin extends Component { const oauthVerifier = query.get('oauth_verifier'); closeDialog(); - return this.getOathToken(oauthVerifier, oauthToken); + return this.getOuathToken(oauthVerifier, oauthToken); } else { closeDialog(); return this.props.onFailure(new Error( @@ -87,7 +87,7 @@ class TwitterLogin extends Component { }, 500); } - getOathToken(oAuthVerifier, oauthToken) { + getOauthToken(oAuthVerifier, oauthToken) { return window.fetch(`${this.props.loginUrl}?oauth_verifier=${oAuthVerifier}&oauth_token=${oauthToken}`, { method: 'POST', credentials: this.props.credentials,
Update index.js I think this is a just a typo
GenFirst_react-twitter-auth
train
js
a0564c69b6596bd5214a38f86e32b0dfb4845a79
diff --git a/lib/jar_dependencies.rb b/lib/jar_dependencies.rb index <HASH>..<HASH> 100644 --- a/lib/jar_dependencies.rb +++ b/lib/jar_dependencies.rb @@ -353,7 +353,7 @@ module Jars end def to_jar( group_id, artifact_id, version, classifier = nil ) - file = "#{group_id.gsub( '.', '/' )}/#{artifact_id}/#{version}/#{artifact_id}-#{version}" + file = String.new("#{group_id.gsub( '.', '/' )}/#{artifact_id}/#{version}/#{artifact_id}-#{version}") file << "-#{classifier}" if classifier file << '.jar' file
do not use string literals which needs mutation fixes #<I>
mkristian_jar-dependencies
train
rb
9483ec05c6eea507496212013438802214182992
diff --git a/zenpy/__init__.py b/zenpy/__init__.py index <HASH>..<HASH> 100644 --- a/zenpy/__init__.py +++ b/zenpy/__init__.py @@ -25,7 +25,9 @@ class Zenpy(object): """ Provides Zenpy's default HTTPAdapter args for those users providing their own adapter. """ + return dict( + # http://docs.python-requests.org/en/latest/api/?highlight=max_retries#requests.adapters.HTTPAdapter max_retries=3 ) @@ -218,6 +220,7 @@ class Zenpy(object): def _init_session(self, email, token, oath_token, password, session): if not session: session = requests.Session() + # Workaround for possible race condition - https://github.com/kennethreitz/requests/issues/3661 session.mount('https://', HTTPAdapter(**self.http_adapter_kwargs())) if not hasattr(session, 'authorized') or not session.authorized:
Add comments explaining why we remount the HTTPAdapter. Raised in #<I>
facetoe_zenpy
train
py
9b1ff4f38e2cb6f3de2365f6742558f94b099517
diff --git a/src/Spryker/Zed/CompanyRoleDataImport/CompanyRoleDataImportConfig.php b/src/Spryker/Zed/CompanyRoleDataImport/CompanyRoleDataImportConfig.php index <HASH>..<HASH> 100644 --- a/src/Spryker/Zed/CompanyRoleDataImport/CompanyRoleDataImportConfig.php +++ b/src/Spryker/Zed/CompanyRoleDataImport/CompanyRoleDataImportConfig.php @@ -17,6 +17,8 @@ class CompanyRoleDataImportConfig extends DataImportConfig public const IMPORT_TYPE_COMPANY_USER_ROLE = 'company-user-role'; /** + * @api + * * @return \Generated\Shared\Transfer\DataImporterConfigurationTransfer */ public function getCompanyRoleDataImporterConfiguration(): DataImporterConfigurationTransfer @@ -28,6 +30,8 @@ class CompanyRoleDataImportConfig extends DataImportConfig } /** + * @api + * * @return \Generated\Shared\Transfer\DataImporterConfigurationTransfer */ public function getCompanyRolePermissionDataImporterConfiguration(): DataImporterConfigurationTransfer @@ -39,6 +43,8 @@ class CompanyRoleDataImportConfig extends DataImportConfig } /** + * @api + * * @return \Generated\Shared\Transfer\DataImporterConfigurationTransfer */ public function getCompanyUserRoleDataImporterConfiguration(): DataImporterConfigurationTransfer
Fix api docblocks.
spryker_company-role-data-import
train
php
cce4ace86de1784f1434f1ab0727775db6af6cd6
diff --git a/lib/api-client/resources/group.js b/lib/api-client/resources/group.js index <HASH>..<HASH> 100644 --- a/lib/api-client/resources/group.js +++ b/lib/api-client/resources/group.js @@ -130,6 +130,14 @@ Group.get = function (options, done) { * @param {Function} done */ Group.list = function (options, done) { + if (arguments.length === 1) { + done = options; + options = {}; + } + else { + options = options || {}; + } + return this.http.get(this.path, { data: options, done: done || noop
feat(group): allow list to be called w/o options Related to #CAM-<I>
camunda_camunda-bpm-sdk-js
train
js
ab126525df707b4b3584001330462baadfa8ffc6
diff --git a/worker.js b/worker.js index <HASH>..<HASH> 100644 --- a/worker.js +++ b/worker.js @@ -116,7 +116,14 @@ function test(ctx, cb) { var jsh = ctx.shellWrap("exec java -Xmx64m -jar " + jarPath + " " + username + " " + apiKey) ctx.striderMessage("Starting Sauce Connector") - connectorProc = ctx.forkProc(ctx.workingDir, jsh.cmd, jsh.args, exitCb) + var opts = { + cwd: ctx.workingDir, + cmd: jsh.cmd, + args: jsh.args, + screencmd: true, + env: {} + } + connectorProc = ctx.forkProc(opts, exitCb) // Wait until connector outputs "You may start your tests" // before executing Sauce tests connectorProc.stdout.on('data', function(data) {
use screencmd on sauce connector exec
Strider-CD_strider-sauce
train
js
d574309b173ad0bf380a2b5ef9572c8be16caf43
diff --git a/src/EasyAdminBundle.php b/src/EasyAdminBundle.php index <HASH>..<HASH> 100644 --- a/src/EasyAdminBundle.php +++ b/src/EasyAdminBundle.php @@ -14,7 +14,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; */ class EasyAdminBundle extends Bundle { - public const VERSION = '2.2.2-DEV'; + public const VERSION = '2.2.2'; public function build(ContainerBuilder $container) {
Prepared the <I> release
EasyCorp_EasyAdminBundle
train
php
903390e86ba97ce63a4133defba1258417e8506c
diff --git a/lib/expressView.js b/lib/expressView.js index <HASH>..<HASH> 100644 --- a/lib/expressView.js +++ b/lib/expressView.js @@ -32,7 +32,7 @@ function ReactEngineView(name, options) { this.useRouter = (name[0] === '/'); if (this.useRouter) { - name = url.parse(name).pathname; + name = url.parse(name).path; } View.call(this, name, options);
Use path instead of pathname to ensure querystring is not stripped
paypal_react-engine
train
js
abf69b39eee85f67eae35cd2ac3b954aa04e9557
diff --git a/openid/tools/oiddiag.py b/openid/tools/oiddiag.py index <HASH>..<HASH> 100644 --- a/openid/tools/oiddiag.py +++ b/openid/tools/oiddiag.py @@ -201,6 +201,7 @@ class Diagnostician(ApacheView): if openid_url is None: self.openingPage() else: + self.record(Event("Working on openid_url %s" % (openid_url,))) self.otherStuff(openid_url) def openingPage(self):
[project @ oiddiag: add event for openid_url input]
openid_python-openid
train
py
8e99f226cc0def48efa21b3d0ebad38b62829d23
diff --git a/zuul-core/src/test/java/com/netflix/zuul/netty/server/ServerTest.java b/zuul-core/src/test/java/com/netflix/zuul/netty/server/ServerTest.java index <HASH>..<HASH> 100644 --- a/zuul-core/src/test/java/com/netflix/zuul/netty/server/ServerTest.java +++ b/zuul-core/src/test/java/com/netflix/zuul/netty/server/ServerTest.java @@ -54,9 +54,8 @@ public class ServerTest { protected void initChannel(Channel ch) {} }; initializers.put(new NamedSocketAddress("test", new InetSocketAddress(0)), init); - // Pick an InetAddress likely different than the above. The port to channel map has a unique Key; this - // prevents the key being a duplicate. - initializers.put(new NamedSocketAddress("test2", new InetSocketAddress(InetAddress.getLocalHost(), 0)), init); + // The port to channel map keys on the port, post bind. This should be unique even if InetAddress is same + initializers.put(new NamedSocketAddress("test2", new InetSocketAddress( 0)), init); ClientConnectionsShutdown ccs = new ClientConnectionsShutdown( new DefaultChannelGroup(GlobalEventExecutor.INSTANCE),
Defer to localAddress since bind doesn't rely on it
Netflix_zuul
train
java
107ab3c295ea810f17228bb4d29f8b975d6b7115
diff --git a/spyder/widgets/variableexplorer/utils.py b/spyder/widgets/variableexplorer/utils.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/variableexplorer/utils.py +++ b/spyder/widgets/variableexplorer/utils.py @@ -282,7 +282,7 @@ def value_to_display(value, minmax=False): display = repr(value) else: display = repr(value) - elif isinstance(value, (list, tuple, dict, set)): + elif any([type(value) == t for t in [list, tuple, dict, set]]): display = CollectionsRepr.repr(value) elif isinstance(value, Image): display = '%s Mode: %s' % (address(value), value.mode)
Variable Explorer: Apply value_to_display only to collection types - This prevents applying it to instances of them (e.g. collections.defaultdict)
spyder-ide_spyder-kernels
train
py
c6f6ef51dafbc1f2f975deb6897ce28e7f995356
diff --git a/keyring_test.go b/keyring_test.go index <HASH>..<HASH> 100644 --- a/keyring_test.go +++ b/keyring_test.go @@ -38,6 +38,24 @@ like osx` } } +// TestGetMultiline tests getting a multi-line password from the keyring +func TestGetUmlaut(t *testing.T) { + umlautPassword := "at least on OSX üöäÜÖÄß will be encoded" + err := Set(service, user, umlautPassword) + if err != nil { + t.Errorf("Should not fail, got: %s", err) + } + + pw, err := Get(service, user) + if err != nil { + t.Errorf("Should not fail, got: %s", err) + } + + if umlautPassword != pw { + t.Errorf("Expected password %s, got %s", umlautPassword, pw) + } +} + // TestGetSingleLineHex tests getting a single line hex string password from the keyring. func TestGetSingleLineHex(t *testing.T) { hexPassword := "abcdef123abcdef123"
Test umlaut passwords OS X does return an hex encoded password at least on Big Sur currently the test will fail, since no fix is implemented yet
zalando_go-keyring
train
go
23a90f4efbd1977f067ee2c84bc222369c80843e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from distutils.core import setup setup( name='clif', - version='0.0.1', + version='0.1.0', author='François Ménabé', author_email='francois.menabe@gmail.com', license='MIT License',
Set version to <I>.
fmenabe_python-clif
train
py
d39d0a5c90540615ee957b427b7640fccd037575
diff --git a/tsdb/engine/tsm1/tsm1.go b/tsdb/engine/tsm1/tsm1.go index <HASH>..<HASH> 100644 --- a/tsdb/engine/tsm1/tsm1.go +++ b/tsdb/engine/tsm1/tsm1.go @@ -14,7 +14,6 @@ import ( "sort" "strings" "sync" - "syscall" "time" "github.com/golang/snappy" @@ -1971,7 +1970,8 @@ func NewDataFile(f *os.File) (*dataFile, error) { if err != nil { return nil, err } - mmap, err := syscall.Mmap(int(f.Fd()), 0, int(fInfo.Size()), syscall.PROT_READ, syscall.MAP_SHARED|MAP_POPULATE) + //mmap, err := syscall.Mmap(int(f.Fd()), 0, int(fInfo.Size()), syscall.PROT_READ, syscall.MAP_SHARED|MAP_POPULATE) + mmap, err := mmap(f, 0, int(fInfo.Size())) if err != nil { return nil, err } @@ -2030,7 +2030,7 @@ func (d *dataFile) close() error { if d.mmap == nil { return nil } - err := syscall.Munmap(d.mmap) + err := munmap(d.mmap) if err != nil { return err }
Removed Syscall.Mmap to use platform specific mmap Updates lines <I> and <I> to use mmamp in windows or unix versions instead of Syscall.Mmap
influxdata_influxdb
train
go
f95e4ae05002ea3de3211efa014064a4e56a2e83
diff --git a/lib/roger_sneakpeek/finalizer.rb b/lib/roger_sneakpeek/finalizer.rb index <HASH>..<HASH> 100644 --- a/lib/roger_sneakpeek/finalizer.rb +++ b/lib/roger_sneakpeek/finalizer.rb @@ -1,5 +1,6 @@ require "shellwords" require "roger/test" +require "roger/release" require "tempfile" require "faraday" require "uri"
Require roger/release so we can use Roger::Release
DigitPaint_roger_sneakpeek
train
rb
b282c596a74583411673a03604a79170a750d4aa
diff --git a/spec/lyber_core/robots/robot_spec.rb b/spec/lyber_core/robots/robot_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lyber_core/robots/robot_spec.rb +++ b/spec/lyber_core/robots/robot_spec.rb @@ -359,7 +359,7 @@ describe LyberCore::Robots::Robot do robot.start_slave(mock_stomp) elapsed_time = Time.now - start_time elapsed_time.should be >= MSG_BROKER_TIMEOUT - elapsed_time.should be <= MSG_BROKER_TIMEOUT+1.5 +# elapsed_time.should be <= MSG_BROKER_TIMEOUT+1.5 end end
Remove max timeout constraint from robot spec
sul-dlss_lyber-core
train
rb
598b1b1acedea7bf1d23cc4f633d969b9709ee6b
diff --git a/salt/modules/win_dacl.py b/salt/modules/win_dacl.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_dacl.py +++ b/salt/modules/win_dacl.py @@ -23,7 +23,7 @@ from salt.ext.six.moves import range # pylint: disable=redefined-builtin # Import third party libs try: - import salt.ext.six.moves.winreg # pylint: disable=import-error + import salt.ext.six.moves.winreg # pylint: disable=redefined-builtin import win32security import ntsecuritycon HAS_WINDOWS_MODULES = True
More pylint fixing
saltstack_salt
train
py
cc13eee64d35ceb2c6369ae9154e6cf3374b3e60
diff --git a/src/Responder/FormattedResponder.php b/src/Responder/FormattedResponder.php index <HASH>..<HASH> 100644 --- a/src/Responder/FormattedResponder.php +++ b/src/Responder/FormattedResponder.php @@ -107,7 +107,7 @@ class FormattedResponder implements ResponderInterface */ protected function formatter(ServerRequestInterface $request) { - $accept = current($request->getHeader('Accept')); + $accept = $request->getHeaderLine('Accept'); $priorities = $this->priorities(); $preferred = $this->negotiator->getBest($accept, array_keys($priorities));
Simplify Accept header access Calling `current($request->getHeader(...))` is the same as calling `$request->getHeaderLine` in this scenario.
equip_framework
train
php
16b080427b2cdb15da1d79a95ebfd072aa37cc55
diff --git a/bin/build-acorn.js b/bin/build-acorn.js index <HASH>..<HASH> 100644 --- a/bin/build-acorn.js +++ b/bin/build-acorn.js @@ -2,7 +2,7 @@ var fs = require("fs"), path = require("path") var stream = require("stream") var browserify = require("browserify") -var babelify = require("babelify") +var babelify = require("babelify").configure({loose: "all"}) process.chdir(path.resolve(__dirname, ".."))
Enable loose mode in Babel Saves a few lines of code, and some cycles when running the code. (Not a terribly significant difference, though.)
acornjs_acorn
train
js
b1b21cd17b2ce7fafa1c2896036bab0b37fc292f
diff --git a/js/cbrowser.js b/js/cbrowser.js index <HASH>..<HASH> 100644 --- a/js/cbrowser.js +++ b/js/cbrowser.js @@ -2065,15 +2065,9 @@ Browser.prototype.positionRuler = function() { //this.ruler2.style.display = this.rulerLocation == 'center' ? 'none' : 'block'; // Position accompanying single base location - //this.locSingleBase.style.left = '' + ((this.featurePanelWidth/2)|0 - (this.locSingleBase.offsetWidth/2)|0) + 'px'; - this.locSingleBase.style.left = '' + ((this.featurePanelWidth/2)|0) + 'px'; - - console.log(this.featurePanelWidth/2); - console.log(this.locSingleBase.offsetWidth/2); - var centreOffset = this.featurePanelWidth/2 - this.locSingleBase.offsetWidth/3; - console.log(centreOffset); - + var centreOffset = this.featurePanelWidth/2 - this.locSingleBase.offsetWidth/2 + this.ruler2.offsetWidth/2; this.locSingleBase.style.left = '' + (centreOffset|0) + 'px'; + for (var ti = 0; ti < this.tiers.length; ++ti) { var tier = this.tiers[ti]; var q = tier.quantOverlay;
Offset for locSingleBase now accomodates for the ruler2 width.
dasmoth_dalliance
train
js
2ab252feaf79b880dea8be811b15f5fa0595246c
diff --git a/opbeat_python/contrib/django/models.py b/opbeat_python/contrib/django/models.py index <HASH>..<HASH> 100644 --- a/opbeat_python/contrib/django/models.py +++ b/opbeat_python/contrib/django/models.py @@ -113,7 +113,7 @@ def get_client(client=None): if _client[0] != client: module, class_name = client.rsplit('.', 1) instance = getattr(__import__(module, {}, {}, class_name), class_name)( - # servers=getattr(django_settings, 'SENTRY_SERVERS', None), + servers=getattr(django_settings, 'OPBEAT_SERVERS', None), include_paths=set(getattr(django_settings, 'OPBEAT_INCLUDE_PATHS', [])) | get_installed_apps(), exclude_paths=getattr(django_settings, 'OPBEAT_EXCLUDE_PATHS', None), timeout=getattr(django_settings, 'OPBEAT_TIMEOUT', None),
Make it possible to externally define Opbeat servers
elastic_apm-agent-python
train
py
81a395ee2082838c53d06da06f40e48d6cbc578c
diff --git a/src/engine/Resolutor.js b/src/engine/Resolutor.js index <HASH>..<HASH> 100644 --- a/src/engine/Resolutor.js +++ b/src/engine/Resolutor.js @@ -96,9 +96,6 @@ function Resolutor(factsArg) { return true; }; - - - this.resolve = function resolve(program) { let _programWithoutClause = []; for (let i = 0; i < program.length; i += 1) { @@ -124,7 +121,11 @@ Resolutor.compactTheta = function compactTheta(theta1, theta2) { let theta = {}; Object.keys(theta1).forEach((key) => { let substitution = theta1[key]; - while (substitution instanceof Variable && theta2[substitution.evaluate()]) { + while (substitution instanceof Variable && theta2[substitution.evaluate()] !== undefined) { + if (theta2[substitution.evaluate()] instanceof Variable + && substitution.evaluate() === theta2[substitution.evaluate()].evaluate()) { + break; + } substitution = theta2[substitution.evaluate()]; } theta[key] = substitution;
prevent infinite looping for self references in theta
lps-js_lps.js
train
js