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
09e86ddfa2cf2ab8d200b7318b1904c1dbaeb8df
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java @@ -415,7 +415,7 @@ public class SingularityDeployChecker { sendCancelToLoadBalancer(pendingDeploy); } - return getDeployResultWithFailures(request, deploy, pendingDeploy, DeployState.FAILED, String.format("Task(s) %s for this deploy failed", inactiveDeployMatchingTasks), inactiveDeployMatchingTasks); + return getDeployResultWithFailures(request, deploy, pendingDeploy, DeployState.FAILED, String.format("%s task(s) for this deploy failed", inactiveDeployMatchingTasks.size()), inactiveDeployMatchingTasks); } return checkDeployProgress(request, cancelRequest, pendingDeploy, updatePendingDeployRequest, deploy, deployActiveTasks, otherActiveTasks);
shorter high level message, detail will be in individual failures
HubSpot_Singularity
train
java
d5b8c68603c835f4ea5f7251db1d5bcd0a318dc1
diff --git a/src/components/messages/Messages.js b/src/components/messages/Messages.js index <HASH>..<HASH> 100644 --- a/src/components/messages/Messages.js +++ b/src/components/messages/Messages.js @@ -4,7 +4,7 @@ import classNames from 'classnames'; export class Messages extends Component { static defaultProps = { - closable: false, + closable: true, className: null, style: null, onClear: null
Closable default value changed from false to true
primefaces_primereact
train
js
fce9f541a10776d5903ed540bf412087952f1f62
diff --git a/lib/ruboto/version.rb b/lib/ruboto/version.rb index <HASH>..<HASH> 100644 --- a/lib/ruboto/version.rb +++ b/lib/ruboto/version.rb @@ -1,3 +1,3 @@ module Ruboto - VERSION = '0.6.0.rc.0' + VERSION = '0.6.0.rc.1' end \ No newline at end of file
* Bumped versiopn to <I>.rc<I>
ruboto_ruboto
train
rb
82eca716d8c1fad36636f594d0974ad99acb0410
diff --git a/src/Slide.js b/src/Slide.js index <HASH>..<HASH> 100644 --- a/src/Slide.js +++ b/src/Slide.js @@ -1,3 +1,5 @@ +import { Shape } from './Shape'; + export class Slide { /** * Creates new Slide instance @@ -13,6 +15,8 @@ export class Slide { * @returns {Slide} */ addShape(shape) { + if (!(shape instanceof Shape)) throw new Error('You must provide Shape instance'); + this._shapes.push(shape); return this; }
feat(shape): Adds checking for Shape instance when you add it to Slide
ghaiklor_kittik
train
js
506e25828c904a204d5f6efd102d96053856886a
diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php index <HASH>..<HASH> 100644 --- a/classes/PodsAPI.php +++ b/classes/PodsAPI.php @@ -5396,7 +5396,8 @@ class PodsAPI { $bypass_cache = false; // Get current language data - $lang_data = pods_i18n()->get_current_language_data(); + + $lang_data = PodsInit::$i18n->get_current_language_data(); if ( $lang_data ) { if ( ! empty( $lang_data['language'] ) ) { @@ -5699,7 +5700,7 @@ class PodsAPI { $current_language = false; // Get current language data - $lang_data = pods_i18n()->get_current_language_data(); + $lang_data = PodsInit::$i18n->get_current_language_data(); if ( $lang_data ) { if ( ! empty( $lang_data['language'] ) ) {
I think the standard has been to access the singletons via `PodsInit`
pods-framework_pods
train
php
241bacd3ec4d1ac720e0c45c5e562a0c08f3afa4
diff --git a/droneapi/module/api.py b/droneapi/module/api.py index <HASH>..<HASH> 100644 --- a/droneapi/module/api.py +++ b/droneapi/module/api.py @@ -24,11 +24,24 @@ class MPParameters(Parameters): self.__module = module def __getitem__(self, name): + self.wait_valid() return self.__module.mav_param[name] def __setitem__(self, name, value): + self.wait_valid() self.__module.mpstate.functions.param_set(name, value) + def wait_valid(self): + '''Block the calling thread until parameters have been downloaded''' + # FIXME this is a super crufty spin-wait, also we should give the user the option of specifying a timeout + pstate = self.__param.pstate + while (pstate.mav_param_count == 0 or len(pstate.mav_param_set) != pstate.mav_param_count) and not self.__module.api.exit: + time.sleep(0.200) + + @property + def __param(self): + return self.__module.module('param') + class MPCommandSequence(CommandSequence): """ See CommandSequence baseclass for documentation.
Wait on reading params until after they have been fetched from vehicle. Fixes a bug reported by D Hugues.
dronekit_dronekit-python
train
py
093d4f2cd1ae973f2da2f2403da0db002a0e6a2e
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Export.php b/lib/Alchemy/Phrasea/Controller/Prod/Export.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Export.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Export.php @@ -297,7 +297,7 @@ class Export implements ControllerProviderInterface $mail->setButtonUrl($url); $mail->setExpiration($endDateObject); - $app['notification.deliverer']->deliver($mail); + $app['notification.deliverer']->deliver($mail, !!$request->request->get('reading_confirm', false)); unset($remaingEmails[$key]); }
Fix PHRAS-<I> acknowledgment of receipt is not setted
alchemy-fr_Phraseanet
train
php
63937d92084d39c8d00e11cccba135e96d226fc5
diff --git a/config/build.config.js b/config/build.config.js index <HASH>..<HASH> 100644 --- a/config/build.config.js +++ b/config/build.config.js @@ -33,8 +33,6 @@ module.exports = { docsAssets: { js: [ 'bower_components/angularytics/dist/angularytics.js', - 'config/lib/angular-animate-sequence/angular-animate-sequence.js', - 'config/lib/angular-animate-sequence/angular-animate-stylers.js', 'dist/angular-material.js', 'dist/docs/js/**/*.js' ], @@ -63,6 +61,7 @@ module.exports = { js: [ //Angular Animate Sequence 'config/lib/angular-animate-sequence/angular-animate-sequence.js', + 'config/lib/angular-animate-sequence/angular-animate-stylers.js', //Utilities 'src/base/utils.js',
chore(build) - added animate-stylers to ngMaterial.
angular_material
train
js
51b164953ca207124a327c69f3e3e59277277476
diff --git a/lib/plugins/load-plugin.js b/lib/plugins/load-plugin.js index <HASH>..<HASH> 100644 --- a/lib/plugins/load-plugin.js +++ b/lib/plugins/load-plugin.js @@ -54,8 +54,7 @@ module.exports = function(options, callback) { } }); } - - var execPlugin = require(options.value); + var port, uiPort, rulesPort, resRulesPort, statusPort, tunnelRulesPort, tunnelPort; var count = 0; var callbackHandler = function() { @@ -71,7 +70,13 @@ module.exports = function(options, callback) { }); } }; - + + try { + require.resolve(options.value); + } catch(e) { + return callbackHandler(); + } + var execPlugin = require(options.value); var startServer = execPlugin.pluginServer || execPlugin.server || execPlugin; if (typeof startServer == 'function') { ++count;
chore: Prevents modules from causing errors due to main methods
avwo_whistle
train
js
0709f5874f0e6b2206096904d1787cf7f69a2dbb
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -46,6 +46,7 @@ module.exports = { ], }, resolve: { + root: path.resolve(__dirname, 'src'), extensions: ['', '.js'], }, output: {
webpack: change resolve root path configuration
clappr_clappr
train
js
523b154a94d88a23219c5d3eeac57241f0372f0c
diff --git a/lxd/storage/drivers/driver_types.go b/lxd/storage/drivers/driver_types.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/driver_types.go +++ b/lxd/storage/drivers/driver_types.go @@ -8,6 +8,7 @@ type Info struct { Remote bool // Whether the driver uses a remote backing store. OptimizedImages bool // Whether driver stores images as separate volume. OptimizedBackups bool // Whether driver supports optimized volume backups. + OptimizedBackupHeader bool // Whether driver generates an optimised backup header file in backup. PreservesInodes bool // Whether driver preserves inodes when volumes are moved hosts. BlockBacking bool // Whether driver uses block devices as backing store. RunningQuotaResize bool // Whether quota resize is supported whilst instance running.
lxd/storage/drivers/driver/types: Adds OptimizedBackupHeader field to Info Used to indicate if driver will generate a backup header file when generating an optimized backup file.
lxc_lxd
train
go
7273d1888058e8b49206ce03204943f2ee0c8c47
diff --git a/lib/commands/fastboot.js b/lib/commands/fastboot.js index <HASH>..<HASH> 100644 --- a/lib/commands/fastboot.js +++ b/lib/commands/fastboot.js @@ -25,6 +25,7 @@ module.exports = { }); var app = express(); + app.get('/', server.middleware()); app.use(express.static('dist')); app.get('/*', server.middleware());
need to serve the index from the middleware stack, so index.html doesn't override it. (cherry picked from commit <I>f9d1a2a2a1c5a0ddc<I>f1eb<I>db0e<I>)
ember-fastboot_ember-cli-fastboot
train
js
34424132ea053292552cf54ced9c8b139e4797ee
diff --git a/examples/nsapplescript.js b/examples/nsapplescript.js index <HASH>..<HASH> 100644 --- a/examples/nsapplescript.js +++ b/examples/nsapplescript.js @@ -1,12 +1,21 @@ var $ = require('../') + +// import the "Foundation" framework and its dependencies $.import('Foundation') +// create the mandatory NSAutoreleasePool instance var pool = $.NSAutoreleasePool('alloc')('init') +// create an NSString of the applescript command that will be run var command = $('tell (system info) to return system version') + +// create an NSAppleScript instance with the `command` NSString var appleScript = $.NSAppleScript('alloc')('initWithSource', command) +// finally execute the NSAppleScript instance synchronously var resultObj = appleScript('executeAndReturnError', null) + +// resultObj may be null` or an NSAppleEventDescriptor instance , so check first if (resultObj) { console.dir(resultObj('stringValue').toString()) }
add some comments to the NSAppleScript example
TooTallNate_NodObjC
train
js
82bcadf7f829183fbf6feca81dcc6c69f08c358c
diff --git a/caravel/views.py b/caravel/views.py index <HASH>..<HASH> 100755 --- a/caravel/views.py +++ b/caravel/views.py @@ -686,8 +686,6 @@ appbuilder.add_view( category_label=__("Security"), icon='fa-table',) -appbuilder.add_separator("Sources") - class DruidClusterModelView(CaravelModelView, DeleteMixin): # noqa datamodel = SQLAInterface(models.DruidCluster) @@ -2218,8 +2216,8 @@ appbuilder.add_view( "CSS Templates", label=__("CSS Templates"), icon="fa-css3", - category="Sources", - category_label=__("Sources"), + category="Manage", + category_label=__("Manage"), category_icon='') appbuilder.add_link(
Moving 'CSS TEmplates' to the Manage menu category (#<I>)
apache_incubator-superset
train
py
7efc2360f1503e0cbc0788dd40c245c411086300
diff --git a/ELiDE/ELiDE/board/pawnspot.py b/ELiDE/ELiDE/board/pawnspot.py index <HASH>..<HASH> 100644 --- a/ELiDE/ELiDE/board/pawnspot.py +++ b/ELiDE/ELiDE/board/pawnspot.py @@ -40,7 +40,6 @@ class PawnSpot(ImageStack, Layout): use_boardspace = True positions = DictProperty() _childs = DictProperty() - _no_use_canvas = True def __init__(self, **kwargs): if 'proxy' in kwargs: @@ -276,7 +275,6 @@ class PawnSpot(ImageStack, Layout): self.positions = positions def _position(self, *args): - Logger.debug("PawnSpot: {} repositioning children".format(self.name)) x, y = self.pos for member_id, (offx, offy) in self.positions.items(): self._childs[member_id].pos = x + offx, y + offy
Decruft the old unused _no_use_canvas property It had meaning when I was doing tricky things with the pawn's canvas
LogicalDash_LiSE
train
py
aadad486de18ec36e8d5e47e32e4fe8106c4bd40
diff --git a/lib/ethon/curls/classes.rb b/lib/ethon/curls/classes.rb index <HASH>..<HASH> 100644 --- a/lib/ethon/curls/classes.rb +++ b/lib/ethon/curls/classes.rb @@ -17,15 +17,13 @@ module Ethon # :nodoc: class FDSet < ::FFI::Struct - # XXX how does this work on non-windows? how can curl know the new size... - FD_SETSIZE = ::Ethon::Libc.getdtablesize - if Curl.windows? layout :fd_count, :u_int, :fd_array, [:u_int, 64] # 2048 FDs def clear; self[:fd_count] = 0; end else + FD_SETSIZE = ::Ethon::Libc.getdtablesize layout :fds_bits, [:long, FD_SETSIZE / ::FFI::Type::LONG.size] # :nodoc:
Do not ask for getdtablesize on windows.
typhoeus_ethon
train
rb
ebbf22bea0e03a1126dcbf54e258c26c161d8f26
diff --git a/structr-ui/src/main/resources/structr/js/schema.js b/structr-ui/src/main/resources/structr/js/schema.js index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/resources/structr/js/schema.js +++ b/structr-ui/src/main/resources/structr/js/schema.js @@ -778,9 +778,23 @@ var _Schema = { var stillUsed = false; var normalizedKey = normalizeAttr(key); Object.keys(entity).forEach(function(k) { - if (entity[k] && (typeof entity[k] === 'string') && entity[k].contains(normalizedKey)) { - stillUsed = true; - return; + if (entity[k] && (typeof entity[k] === 'string')) { + + // check views for usage of this property + if (k.startsWith('__')) { + var viewVars = entity[k].split(','); + + viewVars.forEach(function(viewVar){ + + if (normalizeAttr(viewVar.trim()) === normalizedKey) { + stillUsed = true; + }; + }); + + if (stillUsed) { + return; + } + } } });
small fix for the schema editor so that property deletion is a little bit more robust before you could add properties with certain names and not be able to remove them at all
structr_structr
train
js
50a66de9aa288f41b2c40fbefb428a6ef4683600
diff --git a/resources/lang/it-IT/dashboard.php b/resources/lang/it-IT/dashboard.php index <HASH>..<HASH> 100644 --- a/resources/lang/it-IT/dashboard.php +++ b/resources/lang/it-IT/dashboard.php @@ -35,6 +35,7 @@ return [ 'failure' => 'Something went wrong updating the incident update', ], ], + 'reported_by' => 'Reported by :user', 'add' => [ 'title' => 'Riporta un problema', 'success' => 'Segnalazione aggiunta.',
New translations dashboard.php (Italian)
CachetHQ_Cachet
train
php
ded52580346a59e788d7c53e09d9df8ae549f60c
diff --git a/gitlab/objects.py b/gitlab/objects.py index <HASH>..<HASH> 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1290,10 +1290,6 @@ class ProjectTagRelease(GitlabObject): shortPrintAttr = 'description' -class ProjectTagReleaseManager(BaseManager): - obj_cls = ProjectTagRelease - - class ProjectTag(GitlabObject): _url = '/projects/%(project_id)s/repository/tags' _constructorTypes = {'release': 'ProjectTagRelease',
Remove unused ProjectTagReleaseManager class
python-gitlab_python-gitlab
train
py
a1629015283a12f7c27359ee3c7ad4677fd2c543
diff --git a/pkg/identity/cache.go b/pkg/identity/cache.go index <HASH>..<HASH> 100644 --- a/pkg/identity/cache.go +++ b/pkg/identity/cache.go @@ -120,9 +120,15 @@ func LookupReservedIdentity(lbls labels.Labels) *Identity { return nil } +var unknownIdentity = NewIdentity(IdentityUnknown, labels.Labels{labels.IDNameUnknown: labels.NewLabel(labels.IDNameUnknown, "", labels.LabelSourceReserved)}) + // LookupIdentityByID returns the identity by ID. This function will first // search through the local cache and fall back to querying the kvstore. func LookupIdentityByID(id NumericIdentity) *Identity { + if id == IdentityUnknown { + return unknownIdentity + } + if identity, ok := reservedIdentityCache[id]; ok { return identity } diff --git a/pkg/labels/labels.go b/pkg/labels/labels.go index <HASH>..<HASH> 100644 --- a/pkg/labels/labels.go +++ b/pkg/labels/labels.go @@ -47,6 +47,10 @@ const ( // IDNameInit is the label used to identify any endpoint that has not // received any labels yet. IDNameInit = "init" + + // IDNameUnknown is the label used to to idenfity an endpoint with an + // unknown identity. + IDNameUnknown = "unknown" ) // OpLabels represents the the possible types.
identity: Resolve unknown identity to label reserved:unknown ``` $ cilium identity get 0 ID LABELS 0 reserved:unknown ``` Fixes: #<I>
cilium_cilium
train
go,go
98871eb26d2c4c5946d918a2ebac9a1e6c35177b
diff --git a/spec/graphql/schema/field_spec.rb b/spec/graphql/schema/field_spec.rb index <HASH>..<HASH> 100644 --- a/spec/graphql/schema/field_spec.rb +++ b/spec/graphql/schema/field_spec.rb @@ -174,7 +174,6 @@ describe GraphQL::Schema::Field do use(GraphQL::Analysis::AST) end - focus it "provides metadata about arguments" do res = ArgumentDetailsSchema.execute("{ argumentDetails }") expected_strs = [
Remove focus, ya dummy
rmosolgo_graphql-ruby
train
rb
becfd1939f1af6f87d884b2ab73e4a2dba3f796a
diff --git a/packages/react/src/components/TileGroup/TileGroup.js b/packages/react/src/components/TileGroup/TileGroup.js index <HASH>..<HASH> 100644 --- a/packages/react/src/components/TileGroup/TileGroup.js +++ b/packages/react/src/components/TileGroup/TileGroup.js @@ -127,7 +127,9 @@ export default class TileGroup extends React.Component { return ( <fieldset className={className} disabled={disabled}> {this.renderLegend(legend)} - {this.getRadioTiles()} + <div> + {this.getRadioTiles()} + </div> </fieldset> ); }
fix(TileGroup): Wrap RadioTiles inside TileGroup (#<I>) * Wrap RadioTiles inside TileGroup This adds a wrapper div element around the RadioTiles inside the TileGroup component so that a flex layout can be applied to the tiles to make them render horizontally. * Remove the className on the wrapper div
carbon-design-system_carbon-components
train
js
c525520f04e865e5fe28007cc7735dcb74c23961
diff --git a/components/datepicker/index.js b/components/datepicker/index.js index <HASH>..<HASH> 100644 --- a/components/datepicker/index.js +++ b/components/datepicker/index.js @@ -269,7 +269,9 @@ export default class Datepicker extends Intact { const input = this.refs.input; input.focus(); setTimeout(() => { - input.blur(); + if (!this.destroyed) { + input.blur(); + } }); } }
fix(Datepicker): does not focus when destroyed
ksc-fe_kpc
train
js
587cdd4c5af0018740b54741766200139c51731b
diff --git a/Model/Behavior/UploadBehavior.php b/Model/Behavior/UploadBehavior.php index <HASH>..<HASH> 100644 --- a/Model/Behavior/UploadBehavior.php +++ b/Model/Behavior/UploadBehavior.php @@ -1902,7 +1902,7 @@ class UploadBehavior extends ModelBehavior { return $this->__filesToRemove; } - $DS = empty($dir) ? '' : DIRECTORY_SEPARATOR; + $DIRECTORY_SEPARATOR = empty($dir) ? '' : DIRECTORY_SEPARATOR; $mimeType = $this->_getMimeType($filePath); $isMedia = $this->_isMedia($model, $mimeType); $isImagickResize = $options['thumbnailMethod'] == 'imagick'; @@ -1950,7 +1950,7 @@ class UploadBehavior extends ModelBehavior { 'geometry', 'size', 'thumbnailPath' )); - $thumbnailFilePath = "{$thumbnailPath}{$dir}{$DS}{$fileName}.{$thumbnailType}"; + $thumbnailFilePath = "{$thumbnailPath}{$dir}{$DIRECTORY_SEPARATOR}{$fileName}.{$thumbnailType}"; $this->__filesToRemove[$model->alias][] = $thumbnailFilePath; } return $this->__filesToRemove;
rename variable to conform with variable naming
FriendsOfCake_cakephp-upload
train
php
3585344099fa0cdbf4c85767d9763b22f0847378
diff --git a/src/models/Link.php b/src/models/Link.php index <HASH>..<HASH> 100644 --- a/src/models/Link.php +++ b/src/models/Link.php @@ -16,12 +16,7 @@ class Link extends \hipanel\base\Model { use \hipanel\base\ModelTrait; - public static function index() - { - return 'ips'; - } - - public static function type() + public static function from() { return 'ip'; }
changed index/type -> `from` in ActiveRecord
hiqdev_hipanel-module-hosting
train
php
d6698f102a134bb91fb0e6f7ba4b2f725a5d5c6f
diff --git a/src/Fracture/Routing/Route.php b/src/Fracture/Routing/Route.php index <HASH>..<HASH> 100644 --- a/src/Fracture/Routing/Route.php +++ b/src/Fracture/Routing/Route.php @@ -20,6 +20,14 @@ class Route implements Matchable } + /** + * Method attempts to apply the generated regexp to the URI + * and, if successful, returns a list of parsed parameters. + * + * @param string $uri + * + * @return array|false + */ public function getMatch($uri) { $expression = $this->pattern->getExpression();
minor: adding some doc-block comments
fracture_routing
train
php
2608793b786c4b264e9c79c27783973f13689b83
diff --git a/addon/tern/tern.js b/addon/tern/tern.js index <HASH>..<HASH> 100644 --- a/addon/tern/tern.js +++ b/addon/tern/tern.js @@ -124,6 +124,8 @@ var self = this; var doc = findDoc(this, cm.getDoc()); var request = buildRequest(this, doc, query, pos); + var extraOptions = request.query && this.options.queryOptions && this.options.queryOptions[request.query.type] + if (extraOptions) for (var prop in extraOptions) request.query[prop] = extraOptions[prop]; this.server.request(request, function (error, data) { if (!error && self.options.responseFilter)
[tern addon] Support a queryOptions option that allows configuring queries Issue #<I>
codemirror_CodeMirror
train
js
55c4b6fa04f18635af054e5005bff1bd946aa928
diff --git a/test/src/error.js b/test/src/error.js index <HASH>..<HASH> 100644 --- a/test/src/error.js +++ b/test/src/error.js @@ -34,6 +34,7 @@ const macro = (t, SpecificError) => { }, {instanceOf: SpecificError}, ); + t.is(SpecificError.captureStackTrace, Error.captureStackTrace); }; macro.title = (title, SpecificError) => title || new SpecificError().name;
:test_tube: test: Test that captureStackTrace is present on extended errors.
aureooms_js-error
train
js
61ddd482552458aad284ce11e28b79c680a4b09f
diff --git a/brontide/noise.go b/brontide/noise.go index <HASH>..<HASH> 100644 --- a/brontide/noise.go +++ b/brontide/noise.go @@ -338,7 +338,7 @@ type BrontideMachine struct { func NewBrontideMachine(initiator bool, localPub *btcec.PrivateKey, remotePub *btcec.PublicKey) *BrontideMachine { - handshake := newHandshakeState(initiator, []byte("bitcoin"), localPub, + handshake := newHandshakeState(initiator, []byte("lightning"), localPub, remotePub) return &BrontideMachine{handshakeState: handshake}
brontide: set the prologue value as specified within BOLT<I>
lightningnetwork_lnd
train
go
44adc738495585b32d84518f64d318ea1ae8185e
diff --git a/invenio_previewer/webpack.py b/invenio_previewer/webpack.py index <HASH>..<HASH> 100644 --- a/invenio_previewer/webpack.py +++ b/invenio_previewer/webpack.py @@ -46,7 +46,7 @@ previewer = WebpackThemeBundle( './scss/invenio_previewer/simple_image.scss', }, dependencies={ - 'bootstrap-sass': '~3.4.0', + 'bootstrap-sass': '~3.3.5', 'd3': '^3.5.17', 'flightjs': '~1.5.1', 'font-awesome': '~4.5.0',
webpack: align version with Invenio-theme
inveniosoftware_invenio-previewer
train
py
57ce3cbb0e8b9a5ac6b2ce0a7d33bf5e47301a51
diff --git a/lib/Psc/Code/Test/Base.php b/lib/Psc/Code/Test/Base.php index <HASH>..<HASH> 100644 --- a/lib/Psc/Code/Test/Base.php +++ b/lib/Psc/Code/Test/Base.php @@ -8,6 +8,7 @@ use Webforge\Common\System\File; use Closure; use Psc\PHPUnit\InvokedAtMethodIndexMatcher; use Psc\PHPUnit\InvokedAtMethodGroupIndexMatcher; +use Psc\System\Console\Process; /** * Der Base-TestCase @@ -246,5 +247,26 @@ class Base extends AssertionsBase { { return new InvokedAtMethodGroupIndexMatcher($groupIndex, $method, $methodGroup); } + + /** + * @return Psc\System\Console\Process + */ + public function runPHPFile(File $phpFile) { + $phpBin = SystemUtil::findPHPBinary(); + + $process = Process::build($phpBin, array(), array('f'=>$phpFile))->end(); + $process->run(); + + $this->assertTrue($process->isSuccessful(), + sprintf("process for phpfile '%s' did not return 0.\ncmd:\n%s\nerr:\n%s\nout:\n%s\n", + $phpFile, + $process->getCommandLine(), + $process->getErrorOutput(), + $process->getOutput() + ) + ); + + return $process; + } } ?> \ No newline at end of file
add runPHpFile to base
webforge-labs_psc-cms
train
php
86c0acca8fe5552203175d91797d89e13e7d9c5b
diff --git a/litho-glide/src/main/java/com/github/pavlospt/litho/glide/GlideImageSpec.java b/litho-glide/src/main/java/com/github/pavlospt/litho/glide/GlideImageSpec.java index <HASH>..<HASH> 100644 --- a/litho-glide/src/main/java/com/github/pavlospt/litho/glide/GlideImageSpec.java +++ b/litho-glide/src/main/java/com/github/pavlospt/litho/glide/GlideImageSpec.java @@ -1,5 +1,6 @@ package com.github.pavlospt.litho.glide; +import android.content.Context; import android.graphics.drawable.Drawable; import android.net.Uri; import android.widget.ImageView; @@ -24,7 +25,6 @@ import com.facebook.litho.utils.MeasureUtils; import java.io.File; import static com.facebook.litho.annotations.ResType.DRAWABLE; -import static com.facebook.litho.annotations.ResType.INT; @MountSpec public class GlideImageSpec { @@ -45,8 +45,8 @@ public class GlideImageSpec { } @OnCreateMountContent - static ImageView onCreateMountContent(ComponentContext c) { - return new ImageView(c.getBaseContext()); + static ImageView onCreateMountContent(Context c) { + return new ImageView(c); } @OnMount
Fix API change after Litho version bump
pavlospt_litho-glide
train
java
8e84d5cf4d19a1f827b970c16b0e6bf878722551
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,12 @@ from setuptools import setup setup( name='pyconfluence', packages=['pyconfluence'], - version='1.1.2', + version='1.1.3', description='An API wrapper for Atlassian Confluence', author='Caleb Hawkins', author_email='hawkins.caleb93@gmail.com', url='https://github.com/FulcrumIT/pyconfluence', - download_url='https://github.com/FulcrumIT/pyconfluence/tarball/1.1.2', + download_url='https://github.com/FulcrumIT/pyconfluence/tarball/1.1.3', keywords=['confluence'], classifiers=[], )
Prepping for release <I>
FulcrumTechnologies_pyconfluence
train
py
7d57314cf2eb5f0864ee2e68783c2751eba1174d
diff --git a/src/di/parser.js b/src/di/parser.js index <HASH>..<HASH> 100644 --- a/src/di/parser.js +++ b/src/di/parser.js @@ -3,7 +3,7 @@ var args = require('./args'); var isArray = Array.isArray; -var tokens = function (fn, deps) { +var validTokens = function (fn, deps) { if (typeof fn !== 'function') { throw 'invalid injectable function'; } @@ -18,19 +18,19 @@ var tokens = function (fn, deps) { var inlineArrayParser = function (injectable) { var fn = injectable.pop(); var deps = injectable; - return tokens(fn, deps); + return validTokens(fn, deps); }; var $injectParser = function (injectable) { var fn = injectable; var deps = fn.$inject; - return tokens(fn, deps); + return validTokens(fn, deps); }; var fnParamParser = function (injectable) { var fn = injectable; var deps = args(fn); - return tokens(fn, deps); + return validTokens(fn, deps); }; var parser = function (injectable) {
[min] renamed internal function
pfraces-graveyard_ng-mock
train
js
ab7d90d1f8ac62e4e8db48ca9e85b97aa56bc0e8
diff --git a/packages/webpack/mixins/render/mixin.core.js b/packages/webpack/mixins/render/mixin.core.js index <HASH>..<HASH> 100644 --- a/packages/webpack/mixins/render/mixin.core.js +++ b/packages/webpack/mixins/render/mixin.core.js @@ -57,7 +57,7 @@ class WebpackRenderMixin extends Mixin { describe: 'Statically build locations', type: 'boolean', }; - if (command === 'start') { + if (command === 'start' && process.env.NODE_ENV !== 'production') { builder.static.implies = ['static', 'production']; builder.static.describe += ' (requires --production, -p)'; }
fix(webpack): allow "start -s" when NODE_ENV=production
untool_untool
train
js
49cfa550d267e1744cbf0a363f07cbf742d618e0
diff --git a/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ElementRefPropertyInfo.js b/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ElementRefPropertyInfo.js index <HASH>..<HASH> 100644 --- a/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ElementRefPropertyInfo.js +++ b/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ElementRefPropertyInfo.js @@ -28,9 +28,6 @@ Jsonix.Model.ElementRefPropertyInfo = Jsonix getPropertyElementTypeInfo : function(elementName) { Jsonix.Util.Ensure.ensureObject(elementName); var name = Jsonix.XML.QName.fromObject(elementName); - logger.info('>1>' + name.key); - logger.info('>2>' + this.elementName.key); - logger.info('>3>' + this.wrapperElementName); if (name.key === this.elementName.key) { return this;
Removed the debug log statements.
highsource_jsonix
train
js
9787bad993509aa23e7b6dca047c8c5015953c6d
diff --git a/src/Api/Providers/Provider.php b/src/Api/Providers/Provider.php index <HASH>..<HASH> 100644 --- a/src/Api/Providers/Provider.php +++ b/src/Api/Providers/Provider.php @@ -57,8 +57,7 @@ abstract class Provider */ public function execPostRequest($requestOptions, $resourceUrl, $returnData = false) { - $data = ['options' => $requestOptions]; - $postString = Request::createQuery($data); + $postString = Request::createQuery(['options' => $requestOptions]); $response = $this->request->exec($resourceUrl, $postString); if ($returnData) { @@ -70,11 +69,9 @@ abstract class Provider public function execGetRequest($requestOptions, $resourceUrl, $needsPagination = false, $bookmarks = []) { - $query = Request::createQuery( - ['options' => $requestOptions], '', $bookmarks - ); - + $query = Request::createQuery(['options' => $requestOptions], '', $bookmarks); $response = $this->request->exec($resourceUrl . "?{$query}"); + if ($needsPagination) { return $this->response->getPaginationData($response); }
upd: Provider requests refactoring
seregazhuk_php-pinterest-bot
train
php
b42be357d999f0c0f3586e2aecc617ce8daeab97
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -275,7 +275,7 @@ lunr.Index.prototype.query = function (fn) { * for the term we are working with. In that case we just add the scores * together. */ - queryVectors[field].upsert(termIndex, 1 * clause.boost, function (a, b) { return a + b }) + queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b }) /** * If we've already seen this term, field combo then we've already collected
Remove redundant multiplication clause.boost will always be a number and has a sensible default of 1. Multiplying the boost by 1 is redundant. Removing this redundant multiplication had a small, but measurable, positive impact on benchmark results.
olivernn_lunr.js
train
js
9d5259987e5c11a930420affba7ef309eff9b69f
diff --git a/pyrsistent/_immutable.py b/pyrsistent/_immutable.py index <HASH>..<HASH> 100644 --- a/pyrsistent/_immutable.py +++ b/pyrsistent/_immutable.py @@ -98,6 +98,6 @@ class {class_name}(namedtuple('ImmutableBase', [{quoted_members}]{verbose_string try: exec(template, namespace) except SyntaxError as e: - raise SyntaxError(e.message + ':\n' + template) from e + raise SyntaxError(str(e) + ':\n' + template) from e return namespace[name]
Stop using exception.message <URL>. As of Python <I>, exception.message was dropped, and attempting to access it causes an error.
tobgu_pyrsistent
train
py
2fecd945690a939931329c1aab29e12c3e773c67
diff --git a/internal/pipe/snapcraft/snapcraft.go b/internal/pipe/snapcraft/snapcraft.go index <HASH>..<HASH> 100644 --- a/internal/pipe/snapcraft/snapcraft.go +++ b/internal/pipe/snapcraft/snapcraft.go @@ -201,14 +201,12 @@ func (Pipe) Publish(ctx *context.Context) error { return pipe.ErrSkipPublishEnabled } snaps := ctx.Artifacts.Filter(artifact.ByType(artifact.PublishableSnapcraft)).List() - g := semerrgroup.New(ctx.Parallelism) for _, snap := range snaps { - snap := snap - g.Go(func() error { - return push(ctx, snap) - }) + if err := push(ctx, snap); err != nil { + return err + } } - return g.Wait() + return nil } func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries []*artifact.Artifact) error {
fix: do not push snaps concurrently (#<I>) It seems that the error I get sometimes (#<I>) is related to snap push not being able to work concurrently. I'm not a <I>% sure though, so I'll try this and see how it goes. If the error still happens, we can ignore the error or retry. closes #<I>
goreleaser_goreleaser
train
go
f89f18fbf77412fa355e1372b12d04e0a92292c2
diff --git a/lib/services/role.go b/lib/services/role.go index <HASH>..<HASH> 100644 --- a/lib/services/role.go +++ b/lib/services/role.go @@ -117,8 +117,6 @@ func NewImplicitRole() Role { }, Allow: RoleConditions{ Namespaces: []string{defaults.Namespace}, - Logins: []string{teleport.TraitInternalRoleVariable}, - NodeLabels: map[string]string{Wildcard: Wildcard}, Rules: CopyRulesSlice(DefaultImplicitRules), }, },
Remove allowed logins and labels from implicit role.
gravitational_teleport
train
go
a260e02fd3e967d2d6b602aa3bd15f952d4e45cc
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -211,7 +211,7 @@ module ActiveRecord # calling +checkout+ on this pool. def checkin(conn) @connection_mutex.synchronize do - conn._run_checkin_callbacks do + conn.send(:_run_checkin_callbacks) do @checked_out.delete conn @queue.signal end
Whoops. _run_*_callbacks is private
rails_rails
train
rb
33675df1ca049e5e9f4d99078ba7478175c92349
diff --git a/trakt/client.py b/trakt/client.py index <HASH>..<HASH> 100644 --- a/trakt/client.py +++ b/trakt/client.py @@ -6,7 +6,7 @@ from trakt.interfaces.base import InterfaceProxy import logging -__version__ = '2.2.0' +__version__ = '2.3.0' log = logging.getLogger(__name__)
Bumped version to <I>
fuzeman_trakt.py
train
py
2b6d418299a1848b871049f13d176d1872ef1fa0
diff --git a/typescript-generator-maven-plugin/src/main/java/cz/habarta/typescript/generator/maven/GenerateMojo.java b/typescript-generator-maven-plugin/src/main/java/cz/habarta/typescript/generator/maven/GenerateMojo.java index <HASH>..<HASH> 100644 --- a/typescript-generator-maven-plugin/src/main/java/cz/habarta/typescript/generator/maven/GenerateMojo.java +++ b/typescript-generator-maven-plugin/src/main/java/cz/habarta/typescript/generator/maven/GenerateMojo.java @@ -14,7 +14,7 @@ import org.apache.maven.project.MavenProject; * Generates TypeScript declaration file from specified java classes. * For more information see README and Wiki on GitHub. */ -@Mojo(name = "generate", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution = ResolutionScope.COMPILE) +@Mojo(name = "generate", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true) public class GenerateMojo extends AbstractMojo { /**
Mark Maven plugin as `threadSafe`
vojtechhabarta_typescript-generator
train
java
0d8203c303ba337c85dfeb936f291ab1ac3d7cd6
diff --git a/lib/knapsack_pro/runners/base_runner.rb b/lib/knapsack_pro/runners/base_runner.rb index <HASH>..<HASH> 100644 --- a/lib/knapsack_pro/runners/base_runner.rb +++ b/lib/knapsack_pro/runners/base_runner.rb @@ -11,7 +11,7 @@ module KnapsackPro end def test_file_paths - allocator.test_file_paths + @test_file_paths ||= allocator.test_file_paths end def stringify_test_file_paths
Cache API response test file paths to fix problem with double request to get test suite distribution for the node
KnapsackPro_knapsack_pro-ruby
train
rb
ac928cd073c5af084456a5c97b4b57866cd1f73c
diff --git a/test/test_tools.py b/test/test_tools.py index <HASH>..<HASH> 100644 --- a/test/test_tools.py +++ b/test/test_tools.py @@ -86,7 +86,7 @@ def test_recordplay(): record = Process(target=jps.tools.record, args=(file_path, ['/test_rec2'])) record.start() - time.sleep(0.1) + time.sleep(0.5) p1 = jps.Publisher('/test_rec1') p2 = jps.Publisher('/test_rec2') @@ -104,7 +104,7 @@ def test_recordplay(): assert os.path.exists(file_path) def print_file_and_check_json(path): - with open(file_path_all) as f: + with open(path) as f: data = f.read() print(data) json.loads(data)
Update tests to remove flacky test
OTL_jps
train
py
1e54117580c380fe749578d2e5254804ad0a4fc2
diff --git a/raft/raft_test.go b/raft/raft_test.go index <HASH>..<HASH> 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -476,17 +476,23 @@ func TestDuelingCandidates(t *testing.T) { nt.send(pb.Message{From: 1, To: 1, Type: pb.MsgHup}) nt.send(pb.Message{From: 3, To: 3, Type: pb.MsgHup}) + // 1 becomes leader since it receives votes from 1 and 2 sm := nt.peers[1].(*raft) if sm.state != StateLeader { t.Errorf("state = %s, want %s", sm.state, StateLeader) } + // 3 stays as candidate since it receives a vote from 3 and a rejection from 2 sm = nt.peers[3].(*raft) if sm.state != StateCandidate { t.Errorf("state = %s, want %s", sm.state, StateCandidate) } nt.recover() + + // candidate 3 now increases its term and tries to vote again + // we expect it to disrupt the leader 1 since it has a higher term + // 3 will be follower again since both 1 and 2 rejects its vote request since 3 does not have a long enough log nt.send(pb.Message{From: 3, To: 3, Type: pb.MsgHup}) wlog := &raftLog{
raft: add more comments for dueling candidates test case
etcd-io_etcd
train
go
c43d64f6106cd381670e90cb5dc2c663d2789598
diff --git a/src/Kunstmaan/AdminListBundle/Exception/ExportException.php b/src/Kunstmaan/AdminListBundle/Exception/ExportException.php index <HASH>..<HASH> 100644 --- a/src/Kunstmaan/AdminListBundle/Exception/ExportException.php +++ b/src/Kunstmaan/AdminListBundle/Exception/ExportException.php @@ -4,7 +4,7 @@ namespace Kunstmaan\AdminListBundle\EventSubscriber; /** * class ExportException */ -class ExportException extends \RuntimeException implements ExceptionInterface +class ExportException extends \RuntimeException { /** @var mixed */ protected $data;
[AdminListBundle] Removed undefined implemented class [SensiolabsInsight] Removed undefined implemented class
Kunstmaan_KunstmaanBundlesCMS
train
php
837e4c26affa6a5492a58d0e50d658672df8f2d0
diff --git a/chartpress.py b/chartpress.py index <HASH>..<HASH> 100755 --- a/chartpress.py +++ b/chartpress.py @@ -266,7 +266,7 @@ def main(): help='Use this tag for images & charts') argparser.add_argument('--extra-message', default='', help='extra message to add to the commit message when publishing charts') - argparser.add_argument('--set-prefix', default='', + argparser.add_argument('--set-prefix', default=None, help='override image prefix with this value') args = argparser.parse_args() @@ -276,7 +276,7 @@ def main(): for chart in config['charts']: if 'images' in chart: - image_prefix = args.set_prefix if args.set_prefix != '' else chart['imagePrefix'] + image_prefix = args.set_prefix if args.set_prefix is not None else chart['imagePrefix'] value_mods = build_images( prefix=image_prefix, images=chart['images'],
Use None as default for --set-prefix
jupyterhub_chartpress
train
py
b575ea3b68cdc8022e4490217a5321f6da75bb1f
diff --git a/src/common.py b/src/common.py index <HASH>..<HASH> 100644 --- a/src/common.py +++ b/src/common.py @@ -32,7 +32,7 @@ def gridEngineIsInstalled(): """Returns True if grid-engine is installed, else False. """ try: - return system("qstat -version") == 0 + return system("qstat -help") == 0 except RuntimeError: return False
Fix to function to check if grid engine is present
DataBiosphere_toil
train
py
f567a51f26bdf6b88555e9417ca3aeedd20f1ce4
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -23,6 +23,7 @@ module.exports = function (Model, defaultInput) { signals[arguments[0]] = signalFactory.apply(null, arguments); }; + controller.defaultInput = defaultInput; controller.signals = signals; controller.store = signalStore; controller.recorder = recorder;
Exposing defaultInput due to Angular view package
cerebral_cerebral
train
js
8bbc231cad3c808205670666683b59d74109969d
diff --git a/src/Cache/Pool.php b/src/Cache/Pool.php index <HASH>..<HASH> 100644 --- a/src/Cache/Pool.php +++ b/src/Cache/Pool.php @@ -50,6 +50,7 @@ class Pool implements CacheItemPoolInterface public static function persist() { file_put_contents(self::$path, serialize(self::$cache)); + chmod(self::$path, 0666); } public function __wakeup() @@ -57,8 +58,7 @@ class Pool implements CacheItemPoolInterface if (file_exists(self::$path)) { self::$cache = unserialize(file_get_contents(self::$path)); } else { - file_put_contents(self::$path, serialize(self::$cache)); - chmod(self::$path, 0666); + self::persist(); } } @@ -123,8 +123,7 @@ class Pool implements CacheItemPoolInterface public function save(CacheItemInterface $item) { self::$cache[$item->getKey()] = $item; - file_put_contents(self::$path, serialize(self::$cache)); - chmod(self::$path, 0666); + self::persist(); return true; }
we actually had a generic method for that
gentry-php_gentry
train
php
0735a6b924fc383aab25a48db045e028001e6958
diff --git a/Generator/FormattingTrait/AnnotationTrait.php b/Generator/FormattingTrait/AnnotationTrait.php index <HASH>..<HASH> 100644 --- a/Generator/FormattingTrait/AnnotationTrait.php +++ b/Generator/FormattingTrait/AnnotationTrait.php @@ -51,7 +51,7 @@ trait AnnotationTrait { $docblock_lines[] = str_repeat(' ', $indent) . $key . ' = ' - . "@{$value['#class']}(\"" . $value['#data'] . '")'; + . "@{$value['#class']}(\"" . $value['#data'] . '"),'; } } else {
Fixed missing comma in annotation lines that have a class.
drupal-code-builder_drupal-code-builder
train
php
b24ffc80a7524483531b336f7915e1feeb850056
diff --git a/RAPIDpy/gis/taudem.py b/RAPIDpy/gis/taudem.py index <HASH>..<HASH> 100644 --- a/RAPIDpy/gis/taudem.py +++ b/RAPIDpy/gis/taudem.py @@ -32,7 +32,8 @@ class TauDEM(object): def __init__(self, taudem_exe_path="", num_processors=1, - use_all_processors=False): + use_all_processors=False, + mpiexec_path="mpiexec"): """ Initializer """ @@ -41,6 +42,7 @@ class TauDEM(object): self.taudem_exe_path = taudem_exe_path self.num_processors = num_processors + self.mpiexec_path = mpiexec_path def _run_mpi_cmd(self, cmd): """ @@ -53,7 +55,7 @@ class TauDEM(object): time_start = datetime.utcnow() # Construct the taudem command line. - cmd = ['mpiexec', '-n', str(self.num_processors)] + cmd + cmd = [self.mpiexec_path, '-n', str(self.num_processors)] + cmd print("Command Line: {0}".format(" ".join(cmd))) process = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False) out, err = process.communicate()
allow for different mpiexec
erdc_RAPIDpy
train
py
baea5c7fd184177276eb9773fcdd013e8685be7e
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindSelfComparison2.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindSelfComparison2.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindSelfComparison2.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindSelfComparison2.java @@ -162,7 +162,7 @@ public class FindSelfComparison2 implements Detector { annotation = FindNullDeref.findLocalAnnotationFromValueNumber(methodGen.getMethod(), location, v0, frame); prefix = "SA_LOCAL_SELF_" ; } - + if (annotation == null) return; BugInstance bug = new BugInstance(this, prefix + op, priority).addClassAndMethod(methodGen, sourceFile) .add(annotation).addSourceLine(classContext, methodGen, sourceFile, location.getHandle()); bugReporter.reportBug(bug);
don't report self operation if we can't name the thing being compared git-svn-id: <URL>
spotbugs_spotbugs
train
java
844eacba26f392b5fbc2e491c256634e5ce25faa
diff --git a/framework/console/controllers/BaseMigrateController.php b/framework/console/controllers/BaseMigrateController.php index <HASH>..<HASH> 100644 --- a/framework/console/controllers/BaseMigrateController.php +++ b/framework/console/controllers/BaseMigrateController.php @@ -52,7 +52,7 @@ abstract class BaseMigrateController extends Controller * * @see $migrationNamespaces */ - public $migrationPath = '@app/migrations'; + public $migrationPath = ['@app/migrations']; /** * @var array list of namespaces containing the migration classes. *
Update BaseMigrateController.php make sure console arguments are recognized as array.
yiisoft_yii2
train
php
4223aad66832b217a6be4ecca31b31bab804720a
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@ -2066,7 +2066,7 @@ public class NodeTool StringBuffer errors = new StringBuffer(); - Map<InetAddress, Float> ownerships; + Map<InetAddress, Float> ownerships = null; try { ownerships = probe.effectiveOwnership(keyspace); @@ -2079,7 +2079,7 @@ public class NodeTool catch (IllegalArgumentException ex) { System.out.printf("%nError: " + ex.getMessage() + "%n"); - return; + System.exit(1); } Map<String, SetHostStat> dcs = getOwnershipByDc(probe, resolveIp, tokensToEndpoints, ownerships);
Fix exit code in nodetool when keyspace does not exist. Patch by Sachin Janani, reviewed by brandonwilliams for CASSANDRA-<I>
Stratio_stratio-cassandra
train
java
01dbe29b8d4c33e0cce64d6112446a25af0085a1
diff --git a/src/EmojiDictionary.php b/src/EmojiDictionary.php index <HASH>..<HASH> 100644 --- a/src/EmojiDictionary.php +++ b/src/EmojiDictionary.php @@ -1831,6 +1831,9 @@ class EmojiDictionary */ public static function get($symbol) { + + $symbol = strtolower($symbol); + if (isset(static::$dictionary[$symbol])) return static::$dictionary[$symbol]; else
Symbol reference is always converted to lower case
juanparati_Emoji
train
php
b1ae7c17cedb5399c4ef31dbc5d4ff65f0848eb8
diff --git a/bzr_exporter.py b/bzr_exporter.py index <HASH>..<HASH> 100755 --- a/bzr_exporter.py +++ b/bzr_exporter.py @@ -130,10 +130,12 @@ class BzrFastExporter(object): # Get the primary parent if nparents == 0: - # This is a parentless commit. We need to create a new branch - # otherwise git-fast-import will assume the previous commit - # was this one's parent - git_branch = self.next_available_branch_name() + if ncommits: + # This is a parentless commit but it's not the first one + # output. We need to create a new temporary branch for it + # otherwise git-fast-import will assume the previous commit + # was this one's parent + git_branch = self._next_tmp_branch_name() parent = bzrlib.revision.NULL_REVISION else: parent = revobj.parent_ids[0] @@ -257,7 +259,7 @@ class BzrFastExporter(object): git_ref = 'refs/tags/%s' % tag self.print_cmd(commands.ResetCommand(git_ref, ":" + mark)) - def next_available_branch_name(self): + def _next_tmp_branch_name(self): """Return a unique branch name. The name will start with "tmp".""" prefix = 'tmp' if prefix not in self.branch_names:
fix branch of first commit to not be refs/heads/tmp
jelmer_python-fastimport
train
py
766036620488b23615253ece44dd22f96b01f404
diff --git a/jaulp.wicket.components/src/main/java/de/alpharogroup/wicket/components/listview/ListViewPanel.java b/jaulp.wicket.components/src/main/java/de/alpharogroup/wicket/components/listview/ListViewPanel.java index <HASH>..<HASH> 100644 --- a/jaulp.wicket.components/src/main/java/de/alpharogroup/wicket/components/listview/ListViewPanel.java +++ b/jaulp.wicket.components/src/main/java/de/alpharogroup/wicket/components/listview/ListViewPanel.java @@ -110,6 +110,7 @@ public abstract class ListViewPanel<T> extends GenericPanel<List<T>> item.add(newListComponent("item", item)); } }; + listView.setReuseItems(true); return listView; }
set flag 'reuseItems' to true to all ListView's.
astrapi69_jaulp-wicket
train
java
9c9da0bfe7dbf4a0366c41cff186ce8fc2abe750
diff --git a/lib/ronin/platform/overlay_cache.rb b/lib/ronin/platform/overlay_cache.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/platform/overlay_cache.rb +++ b/lib/ronin/platform/overlay_cache.rb @@ -53,7 +53,13 @@ module Ronin if descriptions.kind_of?(Array) descriptions.each do |overlay| if overlay.kind_of?(Hash) - add(Overlay.new(overlay[:path],overlay[:media],overlay[:uri])) + overlay = Overlay.new( + overlay[:path], + overlay[:media], + overlay[:uri] + ) + + self[overlay.name] = overlay end end end
Don't use OverlayCache#add to populate the cache.
ronin-ruby_ronin
train
rb
a683da3ca1d077542aaf8b5d438361d44ee59855
diff --git a/lib/navigationlib.php b/lib/navigationlib.php index <HASH>..<HASH> 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -808,7 +808,7 @@ class global_navigation extends navigation_node { * @return bool */ public function initialise() { - global $SITE, $USER; + global $CFG, $SITE, $USER; // Check if it has alread been initialised if ($this->initialised || during_initial_install()) { return true; @@ -912,6 +912,18 @@ class global_navigation extends navigation_node { } } + // Give the local plugins a chance to include some navigation if they want. + foreach (get_list_of_plugins('local') as $plugin) { + if (!file_exists($CFG->dirroot.'/local/'.$plugin.'/lib.php')) { + continue; + } + require_once($CFG->dirroot.'/local/'.$plugin.'/lib.php'); + $function = $plugin.'_extends_navigation'; + if (function_exists($function)) { + $function($this); + } + } + // Remove any empty root nodes foreach ($this->rootnodes as $node) { if (!$node->has_children()) {
navigation MDL-<I> Added a callback for local plugins to allow them to add to the navigation.
moodle_moodle
train
php
1dfb0569aa6ea908bde1d3d5e352d5388207fa56
diff --git a/lib/request_log_analyzer/file_format/apache.rb b/lib/request_log_analyzer/file_format/apache.rb index <HASH>..<HASH> 100644 --- a/lib/request_log_analyzer/file_format/apache.rb +++ b/lib/request_log_analyzer/file_format/apache.rb @@ -55,7 +55,7 @@ module RequestLogAnalyzer::FileFormat # Creates the access log line definition based on the Apache log format string def self.access_line_definition(format_string) - format_string ||= :combined + format_string ||= :common format_string = LOG_FORMAT_DEFAULTS[format_string.to_sym] || format_string line_regexp = ''
Use Apache common access log format by default as it will work in more cases
wvanbergen_request-log-analyzer
train
rb
71d1fde2da9029a85dbfc6a1f16496ac97429fdb
diff --git a/statsd/event.go b/statsd/event.go index <HASH>..<HASH> 100644 --- a/statsd/event.go +++ b/statsd/event.go @@ -37,7 +37,7 @@ const ( type Event struct { // Title of the event. Required. Title string - // Text is the description of the event. Required. + // Text is the description of the event. Text string // Timestamp is a timestamp for the event. If not provided, the dogstatsd // server will set this to the current time.
update event doc comment (#<I>)
DataDog_datadog-go
train
go
5ca451faa168fe9138aa62b342c1a66e4e6459c5
diff --git a/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java b/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java index <HASH>..<HASH> 100644 --- a/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java +++ b/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java @@ -1421,7 +1421,7 @@ public class HeidelTime extends JCasAnnotator_ImplBase { valueNew = valueNew.replace(checkUndef, lmYearOnly-1+"-Q4"); } else { int newQuarter = lmQuarterOnly-1; - valueNew = valueNew.replace(checkUndef, dctYear+"-Q"+newQuarter); + valueNew = valueNew.replace(checkUndef, lmYearOnly+"-Q"+newQuarter); } } }
minor bugfix for quarter disambiguation
HeidelTime_heideltime
train
java
051b8d097467b20519975d6f233720cb99e501be
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ # Always prefer setuptools over distutils -from setuptools import setup +from setuptools import setup, find_packages # To use a consistent encoding from codecs import open as opn from os import path @@ -26,7 +26,8 @@ setup(name='lebot-cerebro', author='LeBot', author_email='sanket.upadhyay@infoud.co.in', license='MIT', - packages=['cerebro'], + packages=['cerebro']+find_packages(), + package_data={'': ['*.csv'], 'cerebro.data': ['datasets/*.csv']}, install_requires=[ 'scikit-learn', 'scipy',
Setup.py updated to include all the subpackages and data sets
Le-Bot_cerebro
train
py
07ccc23932073c0d13809cc0f2d5cfca5bb20ec3
diff --git a/lib/Thelia/Model/Customer.php b/lib/Thelia/Model/Customer.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Model/Customer.php +++ b/lib/Thelia/Model/Customer.php @@ -263,6 +263,13 @@ class Customer extends BaseCustomer implements UserInterface return $this; } + public function erasePassword() + { + parent::setPassword(null); + + return $this; + } + /* public function setRef($ref) {
Add a function to erase a customer password (#<I>) * Add a function to erase a customer password * Fix cs
thelia_core
train
php
7537b362e9c1447d4572d19bd895f4fcc7522a87
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb index <HASH>..<HASH> 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb @@ -52,7 +52,6 @@ users_manage "sysadmin" do end ssh_known_hosts_entry "github.com" -ssh_known_hosts_entry "localhost" sudo "sysadmins" do group ["sysadmin", "%superadmin"]
this just isn't working at all on fedora
chef_chef
train
rb
8ca5bdda15355c0ea7d8620cce679ae529477594
diff --git a/samtranslator/parser/parser.py b/samtranslator/parser/parser.py index <HASH>..<HASH> 100644 --- a/samtranslator/parser/parser.py +++ b/samtranslator/parser/parser.py @@ -63,7 +63,7 @@ class Parser: validation_errors = validator.validate(sam_template) if validation_errors: - LOG.warn("Template schema validation reported the following errors: " + ", ".join(validation_errors)) + LOG.warning("Template schema validation reported the following errors: %s", validation_errors) except Exception as e: # Catching any exception and not re-raising to make sure any validation process won't break transform LOG.exception("Exception from SamTemplateValidator: %s", e)
fix: fix validation errors log message that calls join on a string (#<I>)
awslabs_serverless-application-model
train
py
11d850d1de4cc28f38c73b6f1212042560a19c27
diff --git a/admin/resource.go b/admin/resource.go index <HASH>..<HASH> 100644 --- a/admin/resource.go +++ b/admin/resource.go @@ -57,6 +57,7 @@ func (res *Resource) setBaseResource(base *Resource) { findManyHandle := res.FindManyHandler res.FindManyHandler = func(value interface{}, context *qor.Context) error { + base.FindOneHandler(value, nil, context.Clone()) return findManyHandle(value, context) } diff --git a/context.go b/context.go index <HASH>..<HASH> 100644 --- a/context.go +++ b/context.go @@ -21,6 +21,11 @@ type Context struct { Errors } +func (context *Context) Clone() *Context { + var clone = *context + return &clone +} + func (context *Context) GetDB() *gorm.DB { if context.DB != nil { return context.DB
Add method to clone qor context
qor_qor
train
go,go
770cb34874f390734dbcd3b03de063dc5ac481ce
diff --git a/keyboard/__init__.py b/keyboard/__init__.py index <HASH>..<HASH> 100644 --- a/keyboard/__init__.py +++ b/keyboard/__init__.py @@ -136,7 +136,7 @@ def matches(event, name): or 'right ' + normalized == event.name ) - return matched_name or _os_keyboard.map_char(name)[0] == event.scan_code + return matched_name or _os_keyboard.map_char(normalized)[0] == event.scan_code def is_pressed(key): """
Slight change to event matching rule to avoid errors
boppreh_keyboard
train
py
050d9389888e596cb3e421713b93edfd250d8fde
diff --git a/Geometry/rectangle.py b/Geometry/rectangle.py index <HASH>..<HASH> 100644 --- a/Geometry/rectangle.py +++ b/Geometry/rectangle.py @@ -8,10 +8,11 @@ Provides an implementation of a rectangle designed to be easy to use: import random import math -from .point import Point +from .point2 import Point from .exceptions import * + class Rectangle(object): ''' Implements a Rectangle object in the XY plane defined by @@ -21,11 +22,6 @@ class Rectangle(object): Note: Origin may have a non-zero z coordinate. ''' - vertexNames = 'ABCD' - vertexNameA = vertexNames[0] - vertexNameB = vertexNames[1] - vertexNameC = vertexNames[2] - vertexNameD = vertexNames[3] @classmethod def randomSizeAndLocation(cls, radius, widthLimits, @@ -71,7 +67,7 @@ class Rectangle(object): height, Point.randomLocation(radius, origin)) - def __init__(self, origin=None, width=1, height=1): + def __init__(self, origin=None, width=1, height=1, theta=0): ''' :param: width - float X distance from origin.x :param: height - float Y distance from origin.y
added support for new Point, beginning of rotations
JnyJny_Geometry
train
py
b193892479a47106a3004aaf79cbb72f29b6627f
diff --git a/lib/travis/services/find_repo_settings.rb b/lib/travis/services/find_repo_settings.rb index <HASH>..<HASH> 100644 --- a/lib/travis/services/find_repo_settings.rb +++ b/lib/travis/services/find_repo_settings.rb @@ -4,7 +4,7 @@ module Travis register :find_repo_settings def run(options = {}) - result if authorized? + result if repo && authorized? end def updated_at diff --git a/spec/travis/services/find_repo_settings_spec.rb b/spec/travis/services/find_repo_settings_spec.rb index <HASH>..<HASH> 100644 --- a/spec/travis/services/find_repo_settings_spec.rb +++ b/spec/travis/services/find_repo_settings_spec.rb @@ -22,6 +22,11 @@ describe Travis::Services::FindRepoSettings do end describe 'run' do + it 'should return nil without a repo' do + repo.destroy + service.run.should be_nil + end + it 'should return repo settings' do user.permissions.create(repository_id: repo.id, push: true) service.run.to_hash.should == Repository::Settings.defaults.deep_merge({ 'foo' => 'bar' })
Return nil from find_repo_settings service if repo can't be find
travis-ci_travis-core
train
rb,rb
5630a767668aafb755052b4183184ea289620031
diff --git a/integration/cluster.go b/integration/cluster.go index <HASH>..<HASH> 100644 --- a/integration/cluster.go +++ b/integration/cluster.go @@ -837,6 +837,7 @@ func NewClusterV3(t *testing.T, cfg *ClusterConfig) *ClusterV3 { clus := &ClusterV3{ cluster: NewClusterByConfig(t, cfg), } + clus.Launch(t) for _, m := range clus.Members { client, err := NewClientV3(m) if err != nil { @@ -844,7 +845,6 @@ func NewClusterV3(t *testing.T, cfg *ClusterConfig) *ClusterV3 { } clus.clients = append(clus.clients, client) } - clus.Launch(t) return clus }
integration: NewClusterV3 should launch cluster before creating clients
etcd-io_etcd
train
go
beaca7622744405f8514da1424424966d0dfa54f
diff --git a/src/components/TableBody.js b/src/components/TableBody.js index <HASH>..<HASH> 100644 --- a/src/components/TableBody.js +++ b/src/components/TableBody.js @@ -55,13 +55,7 @@ class TableBody extends React.Component { const toIndex = Math.min(count, (page + 1) * rowsPerPage); if (page > totalPages && totalPages !== 0) { - throw new Error( - 'Provided options.page of `' + - page + - '` is greater than the total available page length of `' + - totalPages + - '`', - ); + console.warn('Current page is out of range.'); } for (let rowIndex = fromIndex; rowIndex < count && rowIndex < toIndex; rowIndex++) {
Issue warning insteaf of throwing an error (#<I>) We have a means to clean up the page out of bounds issue elsewhere, so this error is no longer needed and was causing breakage in certain circumstances.
gregnb_mui-datatables
train
js
33255a8b01779944906b876e9d6522d49c2900b4
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -2199,7 +2199,7 @@ def replace(name, not_found_content=None, backup='.bak', show_changes=True): - ''' + r''' Maintain an edit in a file .. versionadded:: 0.17.0 @@ -2207,6 +2207,17 @@ def replace(name, Params are identical to the remote execution function :mod:`file.replace <salt.modules.file.replace>`. + For complex regex patterns it can be useful to avoid the need for complex + quoting and escape sequences by making use of YAML's multiline string + syntax. + + .. code-block:: yaml + + complex_search_and_replace: + file.replace: + # <...snip...> + - pattern: | + CentOS \(2.6.32[^\n]+\n\s+root[^\n]+\n\)+ ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
Added note to file.replace about avoiding quoting and escaping in YAML
saltstack_salt
train
py
b45d4b3be23a70ae478b23fe6f3b16b5a3d5be13
diff --git a/tests/test_integrated_channels/test_canvas/test_client.py b/tests/test_integrated_channels/test_canvas/test_client.py index <HASH>..<HASH> 100644 --- a/tests/test_integrated_channels/test_canvas/test_client.py +++ b/tests/test_integrated_channels/test_canvas/test_client.py @@ -19,7 +19,7 @@ NOW = datetime.datetime(2017, 1, 2, 3, 4, 5, tzinfo=timezone.utc) NOW_TIMESTAMP_FORMATTED = NOW.strftime('%F') -@freeze_time(NOW) +@freeze_time(NOW)z @pytest.mark.django_db @pytest.mark.skip('Can only run once key field is removed from db, since it was marked Not Null') class TestCanvasApiClient(unittest.TestCase):
add canvas to installed_apps for test env
edx_edx-enterprise
train
py
9e19259bbf431b5819faa4db385fd3a666fe6df7
diff --git a/build/deps.js b/build/deps.js index <HASH>..<HASH> 100644 --- a/build/deps.js +++ b/build/deps.js @@ -34,6 +34,7 @@ var deps = { Extensions: { src: [ 'ext/LatLngUtil.js', + 'ext/PolygonUtil.js', 'ext/LineUtil.Intersect.js', 'ext/Polyline.Intersect.js', 'ext/Polygon.Intersect.js'
Including the PolygonUtil file in the dependencies config so it is included in the build.
Leaflet_Leaflet.draw
train
js
f1b84510b3162c76f21ce92cd74c5d8f70e746c8
diff --git a/spec/xpath_spec.rb b/spec/xpath_spec.rb index <HASH>..<HASH> 100644 --- a/spec/xpath_spec.rb +++ b/spec/xpath_spec.rb @@ -155,6 +155,19 @@ describe Capybara::XPath do @driver.find(@query).first.value.should == 'seeekrit' end end + + describe '#button' do + it "should find a button by id or content" do + @query = @xpath.button('awe123').to_s + @driver.find(@query).first.value.should == 'awesome' + @query = @xpath.button('okay556').to_s + @driver.find(@query).first.value.should == 'okay' + @query = @xpath.button('click_me_123').to_s + @driver.find(@query).first.value.should == 'click_me' + @query = @xpath.button('Click me!').to_s + @driver.find(@query).first.value.should == 'click_me' + end + end describe '#radio_button' do it "should find a radio button by id or label" do
Spec example for XPath.button was added
teamcapybara_capybara
train
rb
af34a7aa2b0cdd655a7d2a7298a7472de518c616
diff --git a/httpretty/core.py b/httpretty/core.py index <HASH>..<HASH> 100644 --- a/httpretty/core.py +++ b/httpretty/core.py @@ -482,7 +482,8 @@ class fakesock(object): self.truesock = self.create_socket() elif not self.truesock: raise UnmockedError() - with restored_libs(): + undo_patch_socket() + try: hostname = self._address[0] port = 80 if len(self._address) == 2: @@ -495,6 +496,9 @@ class fakesock(object): sock.connect(self._address) self.__truesock_is_connected__ = True self.truesock = sock + finally: + apply_patch_socket() + return self.truesock def real_socket_is_connected(self):
prevent exception from re-applying monkey patches. closes #<I>
gabrielfalcao_HTTPretty
train
py
80ff0df1b0e61aff8527d37652d3d51c8cab72d1
diff --git a/src/Command/ModuleDownloadCommand.php b/src/Command/ModuleDownloadCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/ModuleDownloadCommand.php +++ b/src/Command/ModuleDownloadCommand.php @@ -16,7 +16,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Buzz\Browser; use Alchemy\Zippy\Zippy; - class ModuleDownloadCommand extends Command { protected function configure() @@ -135,7 +134,7 @@ class ModuleDownloadCommand extends Command // Determine destination folder for contrib modules $drupal = $this->getDrupalHelper(); $drupalRoot = $drupal->getRoot(); - if($drupalRoot) { + if ($drupalRoot) { $module_contrib_path = $drupalRoot . '/modules/contrib'; } else { $output->writeln( @@ -152,7 +151,7 @@ class ModuleDownloadCommand extends Command // Create directory if does not exist if (!file_exists(dirname($module_contrib_path))) { - if(!mkdir($module_contrib_path, 0777, true)) { + if (!mkdir($module_contrib_path, 0777, true)) { $output->writeln( ' <error>'. $this->trans('commands.module.download.messages.error-creating-folter') . ': ' . $module_contrib_path .'</error>' );
Applied PHPQA to be PSR-2 complaint
hechoendrupal_drupal-console
train
php
62f47385277362b8992295c17379d6eb49734e9e
diff --git a/dpark/tracker.py b/dpark/tracker.py index <HASH>..<HASH> 100644 --- a/dpark/tracker.py +++ b/dpark/tracker.py @@ -127,13 +127,15 @@ class TrackerClient(object): if self.ctx is None: self.ctx = zmq.Context() + sock = None try: sock = self.ctx.socket(zmq.REQ) sock.connect(self.addr) sock.send_pyobj(msg) return sock.recv_pyobj() finally: - sock.close() + if sock: + sock.close() def stop(self): if self.ctx is not None:
Bugfix: variable maybe not defined in finnal block.
douban_dpark
train
py
abff7fb82ffa3ed995b96c2a6f41586f24cf16da
diff --git a/tohu/v6/tohu_namespace.py b/tohu/v6/tohu_namespace.py index <HASH>..<HASH> 100644 --- a/tohu/v6/tohu_namespace.py +++ b/tohu/v6/tohu_namespace.py @@ -17,8 +17,7 @@ def get_anonymous_name_for(g): if g.tohu_name is not None: return f"ANONYMOUS_ANONYMOUS_ANONYMOUS_{g.tohu_name}" else: - return f"ANONYMOUS_ANONYMOUS_ANONYMOUS_{g.tohu_id}" - + return f"ANONYMOUS_ANONYMOUS_ANONYMOUS_{g.__class__.__name__}_{g.tohu_id}" class TohuNamespace:
Display generator type in anonymous names (for easier debugging)
maxalbert_tohu
train
py
6c7e1fdf742552bb66ce40874fd7d216d319dedf
diff --git a/javamelody-core/src/main/java/net/bull/javamelody/CounterError.java b/javamelody-core/src/main/java/net/bull/javamelody/CounterError.java index <HASH>..<HASH> 100644 --- a/javamelody-core/src/main/java/net/bull/javamelody/CounterError.java +++ b/javamelody-core/src/main/java/net/bull/javamelody/CounterError.java @@ -37,7 +37,7 @@ class CounterError implements Serializable { * Default max size of error message. */ public static final int DEFAULT_MESSAGE_MAX_SIZE = 1000; - public static final int DEFAULT_STACKTRACE_MAX_SIZE = 10000; + public static final int DEFAULT_STACKTRACE_MAX_SIZE = 50000; private final long time; private final String remoteUser;
increase the default max size of stacktrace to <I> characters
javamelody_javamelody
train
java
fe47bd2e6e83dc534f5a1750f89ff08facbd5e56
diff --git a/datajoint/blob.py b/datajoint/blob.py index <HASH>..<HASH> 100644 --- a/datajoint/blob.py +++ b/datajoint/blob.py @@ -11,8 +11,15 @@ from decimal import Decimal import datetime import uuid import numpy as np +import sys from .errors import DataJointError +if sys.version_info[1] < 6: + from collections import OrderedDict +else: + # use dict in Python 3.6+ -- They are already ordered and look nicer + OrderedDict = dict + mxClassID = OrderedDict(( # see http://www.mathworks.com/help/techdoc/apiref/mxclassid.html @@ -301,7 +308,7 @@ class Blob: len_u64(it) + it for it in (self.pack_blob(i) for i in t)) def read_dict(self): - return dict((self.read_blob(self.read_value()), self.read_blob(self.read_value())) + return OrderedDict((self.read_blob(self.read_value()), self.read_blob(self.read_value())) for _ in range(self.read_value())) def pack_dict(self, d):
Update read_dict to return an OrderedDict.
datajoint_datajoint-python
train
py
77602073fd362633dc4ea84fe2c673f23c9fa452
diff --git a/action/Adapter.php b/action/Adapter.php index <HASH>..<HASH> 100644 --- a/action/Adapter.php +++ b/action/Adapter.php @@ -39,8 +39,10 @@ abstract class Adapter extends Component } if ($view = $this->getView()) { - foreach ($response->content as $key => $value) { - $view->$key = $value; + if (is_array($response->content)) { + foreach ($response->content as $key => $value) { + $view->$key = $value; + } } $response->content = $view->run();
fixed bug with related adapter without vars
execut_yii2-actions
train
php
931c2431b37370a805b73a56b4b791f6b496617a
diff --git a/test/test_all_basic.rb b/test/test_all_basic.rb index <HASH>..<HASH> 100755 --- a/test/test_all_basic.rb +++ b/test/test_all_basic.rb @@ -7,12 +7,12 @@ FILES = Dir[IMAGES_DIR + '/Button_*.gif'].sort FLOWER_HAT = IMAGES_DIR + '/Flower_Hat.jpg' IMAGE_WITH_PROFILE = IMAGES_DIR + '/image_with_profile.jpg' +require 'simplecov' require 'test/unit' if RUBY_VERSION < '1.9' require 'test/unit/ui/console/testrunner' $LOAD_PATH.push(root_dir) else - require 'simplecov' $LOAD_PATH.unshift(File.join(root_dir, 'lib')) $LOAD_PATH.unshift(File.join(root_dir, 'test')) end
Require 'simplecov' before 'test/unit' to retrives valid result (#<I>) Seems simplecov generate wrong report if it was required after 'test/unit’. * Before simplecov reports <I>% covered in rmagick_internal.rb * After simplecov reports <I>% covered in rmagick_internal.rb
rmagick_rmagick
train
rb
16f185e5447bc58ed78e924f283bc9ea2d6af131
diff --git a/src/components/zoom/zoom.js b/src/components/zoom/zoom.js index <HASH>..<HASH> 100644 --- a/src/components/zoom/zoom.js +++ b/src/components/zoom/zoom.js @@ -646,7 +646,12 @@ export default { swiper.zoom.onTouchEnd(e); }, doubleTap(swiper, e) { - if (swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) { + if ( + !swiper.animating && + swiper.params.zoom.enabled && + swiper.zoom.enabled && + swiper.params.zoom.toggle + ) { swiper.zoom.toggle(e); } },
fix(core): don't toggle zoom during transition Fixes #<I>
nolimits4web_swiper
train
js
404720aa004cd3fb1fda38c1ae6a41a00846d8c8
diff --git a/resource/meta.go b/resource/meta.go index <HASH>..<HASH> 100644 --- a/resource/meta.go +++ b/resource/meta.go @@ -157,6 +157,9 @@ func (meta *Meta) UpdateMeta() { qor.ExitWithMsg("%v meta type %v needs Collection", meta.Name, meta.Type) } + scopeField, _ := scope.FieldByName(meta.Alias) + relationship := scopeField.Relationship + if meta.Setter == nil { meta.Setter = func(resource interface{}, metaValues *MetaValues, context *qor.Context) { metaValue := metaValues.Get(meta.Name) @@ -166,11 +169,9 @@ func (meta *Meta) UpdateMeta() { value := metaValue.Value scope := &gorm.Scope{Value: resource} - scopeField, _ := scope.FieldByName(meta.Alias) field := reflect.Indirect(reflect.ValueOf(resource)).FieldByName(meta.Alias) if field.IsValid() && field.CanAddr() { - relationship := scopeField.Relationship if relationship != nil && relationship.Kind == "many_to_many" { context.DB().Where(ToArray(value)).Find(field.Addr().Interface()) if !scope.PrimaryKeyZero() {
Move get scope field outside of Setter
qor_qor
train
go
3aa929e8d0969e22c6c07541939986c845f61fcf
diff --git a/spec/cycle_spec.rb b/spec/cycle_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cycle_spec.rb +++ b/spec/cycle_spec.rb @@ -58,7 +58,7 @@ def create_chickens!(options = {}) options[:random].to_i.times do attributes = {} data.each do |type, values| - attributes["#{type}_col"] = values.rand if rand > 0.5 + attributes["#{type}_col"] = values[rand(values.length)] if rand > 0.5 end Chicken.create!(attributes) end
there is no Array::rand
toy_dump
train
rb
e9e2ec7b02e5edf09197514ceabc9aae9a8893cf
diff --git a/pydas/core.py b/pydas/core.py index <HASH>..<HASH> 100644 --- a/pydas/core.py +++ b/pydas/core.py @@ -78,18 +78,12 @@ class Communicator(object): return self._url @url.setter - def url_set(self, value): + def url(self, value): """Setter for the url. """ for driver in self.drivers: driver.url = value - @url.deleter - def url_del(self): - """Delete the url. - """ - del self._url - @property def debug(self): """Return the debug state of all drivers by logically anding them. diff --git a/pydas/drivers.py b/pydas/drivers.py index <HASH>..<HASH> 100644 --- a/pydas/drivers.py +++ b/pydas/drivers.py @@ -59,7 +59,7 @@ class BaseDriver(object): return self._url @url.setter - def url_set(self, value): + def url(self, value): """Set the url """ self._url = value @@ -118,7 +118,7 @@ class BaseDriver(object): "%d" % code) try: response = json.loads(request.content) - except json.JSONDecodeError: + except ValueError: raise PydasException("Request failed with HTTP error code " "%d and request.content %s" % (code, request.content))
BUG: Fixing url setter property errors. Thanks go to David Thompson for finding this.
midasplatform_pydas
train
py,py
630f111929339c51d49230b4fc01e05dc54030aa
diff --git a/linguist/models/base.py b/linguist/models/base.py index <HASH>..<HASH> 100644 --- a/linguist/models/base.py +++ b/linguist/models/base.py @@ -57,7 +57,7 @@ class Translation(models.Model): language = models.CharField( max_length=10, - verbose_name=_('locale'), + verbose_name=_('language'), choices=settings.SUPPORTED_LANGUAGES, default=settings.DEFAULT_LANGUAGE, help_text=_('The language for this translation'))
Fix language field verbose name.
ulule_django-linguist
train
py
54903259afe2fe8828946ac5a6495b26e951de55
diff --git a/app/controllers/no_cms/admin/pages/pages_controller.rb b/app/controllers/no_cms/admin/pages/pages_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/no_cms/admin/pages/pages_controller.rb +++ b/app/controllers/no_cms/admin/pages/pages_controller.rb @@ -72,7 +72,7 @@ module NoCms::Admin::Pages end def page_params - page_params = params.require(:page).permit(:title, :body, :parent_id, :draft) + page_params = params.require(:page).permit(:title, :template, :slug, :body, :parent_id, :draft) page_params.merge!(blocks_attributes: params[:page][:blocks_attributes]) unless params[:page][:blocks_attributes].blank? page_params end
Added some params to the allowed ones
simplelogica_nocms-admin-pages
train
rb
d74a58d4a44f9988e597b70b449cfa2bb9aa7f63
diff --git a/shared/actions/chat2/index.js b/shared/actions/chat2/index.js index <HASH>..<HASH> 100644 --- a/shared/actions/chat2/index.js +++ b/shared/actions/chat2/index.js @@ -814,15 +814,19 @@ const clearInboxFilter = (action: Chat2Gen.SelectConversationPayload) => // Show a desktop notification const desktopNotify = (action: Chat2Gen.DesktopNotificationPayload, state: TypedState) => { const {conversationIDKey, author, body} = action.payload - const metaMap = state.chat2.metaMap + const meta = Constants.getMeta(state, conversationIDKey) if ( !Constants.isUserActivelyLookingAtThisThread(state, conversationIDKey) && - !metaMap.getIn([conversationIDKey, 'isMuted']) // ignore muted convos + !meta.isMuted // ignore muted convos ) { logger.info('Sending Chat notification') return Saga.put((dispatch: Dispatch) => { - NotifyPopup(author, {body}, -1, author, () => { + let title = ['small', 'big'].includes(meta.teamType) ? meta.teamname : author + if (meta.teamType === 'big') { + title += `#${meta.channelname}` + } + NotifyPopup(title, {body}, -1, author, () => { dispatch( Chat2Gen.createSelectConversation({ conversationIDKey,
Show teamname as the title for big team chat notifications (#<I>) * replace notification title with teamname for team chat notifications * include channelname for big teams
keybase_client
train
js
5b49aae75f79c08be057ac0d961cfe00da660219
diff --git a/backbone.js b/backbone.js index <HASH>..<HASH> 100644 --- a/backbone.js +++ b/backbone.js @@ -1292,7 +1292,7 @@ return optional ? match : '([^/?]+)'; }) .replace(splatParam, '([^?]*?)'); - return new RegExp('^' + route + '(?:\\?(.*))?$'); + return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); }, // Given a route, and a URL fragment that it matches, return the array of diff --git a/test/router.js b/test/router.js index <HASH>..<HASH> 100644 --- a/test/router.js +++ b/test/router.js @@ -788,7 +788,22 @@ } } }); - var router = new Router; + new Router; + Backbone.history.start({pushState: true}); + }); + + test('newline in route', 1, function() { + location.replace('http://example.com/stuff%0Anonsense?param=foo%0Abar'); + Backbone.history.stop(); + Backbone.history = _.extend(new Backbone.History, {location: location}); + var Router = Backbone.Router.extend({ + routes: { + 'stuff\nnonsense': function() { + ok(true); + } + } + }); + new Router; Backbone.history.start({pushState: true}); });
Handle newlines in route params.
jashkenas_backbone
train
js,js
55cba67c998230e365d67bd3eee5f15dfbd6d7ad
diff --git a/package/src/testHelpers/factories.js b/package/src/testHelpers/factories.js index <HASH>..<HASH> 100644 --- a/package/src/testHelpers/factories.js +++ b/package/src/testHelpers/factories.js @@ -124,6 +124,23 @@ export const factories = { return this; }, + withAudioFileType: function(options) { + fileTypes.register('audio_files', _.extend({ + model: VideoFile, + matchUpload: /^audio/, + topLevelType: true + }, options)); + + fileTypesSetupArray.push({ + collectionName: 'audio_files', + typeName: 'Pageflow::AudioFile', + i18nKey: 'pageflow/audio_files', + nestedFileTypes: [{collectionName: 'text_track_files'}] + }); + + return this; + }, + withTextTrackFileType: function(options) { fileTypes.register('text_track_files', _.extend({ model: TextTrackFile,
Add factory builder method to define audio file type
codevise_pageflow
train
js
3a6529c65b70c7b98503389d8a8fce3c8f1a8840
diff --git a/scdl/scdl.py b/scdl/scdl.py index <HASH>..<HASH> 100755 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -395,7 +395,7 @@ def download_playlist(client: SoundCloud, playlist: BasicAlbumPlaylist, **kwargs try: if kwargs.get("n"): # Order by creation date and get the n lasts tracks playlist.tracks.sort( - key=lambda track: track.created_at, reverse=True + key=lambda track: track.id, reverse=True ) playlist.tracks = playlist.tracks[: int(kwargs.get("n"))] else:
Fix issue for limitting number of playlist entry downloads created_at doesn't seem to be present in the MiniTrack class, but id will always be present and works equally well.
flyingrub_scdl
train
py
4e7b9a24f0ff67be6dac4158bbb0854c698c8bfe
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup.py -- setup script for use of packages. """ from setuptools import setup, find_packages -__version__ = '1.3.6' +__version__ = '1.3.7' # create entry points # see http://astropy.readthedocs.org/en/latest/development/scripts.html
Bump to <I>. This includes mainly removal of large filterbank files to an outside source, and JOSS paper initial submission (not last version). Former-commit-id: a<I>dce<I>c7f<I>dfd2d<I>c7dd<I>c4db0c<I>
UCBerkeleySETI_blimpy
train
py
42b6cf32d3f5000f7f873a41a23f826257e056fa
diff --git a/src/com/opera/core/systems/preferences/FilePreference.java b/src/com/opera/core/systems/preferences/FilePreference.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/preferences/FilePreference.java +++ b/src/com/opera/core/systems/preferences/FilePreference.java @@ -28,7 +28,7 @@ public class FilePreference extends AbstractPreference { public FilePreference(OperaFilePreferences parent, String section, String key, Object value) { super(section, key, value); this.parent = parent; - super.setValue(value); + parent.write(); } /**
The constructor in super is already setting the value, instead we want to write it to disk
operasoftware_operaprestodriver
train
java
e1a41cde55da6b718bc44cd0ea22575b87b52ed7
diff --git a/lib/opentsdb/version.rb b/lib/opentsdb/version.rb index <HASH>..<HASH> 100644 --- a/lib/opentsdb/version.rb +++ b/lib/opentsdb/version.rb @@ -1,3 +1,3 @@ module OpenTSDB - VERSION = "0.2.0" + VERSION = '1.0.0' end
Bumps the version to MAJOR.
johnewart_ruby-opentsdb
train
rb