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
5be874db4198813d12ff9f6c89981fa20f985612
diff --git a/src/Matcher.php b/src/Matcher.php index <HASH>..<HASH> 100644 --- a/src/Matcher.php +++ b/src/Matcher.php @@ -141,7 +141,9 @@ class Matcher $match = self::parse($value, $pattern); if($match !== false) { - return call_user_func_array($callback, $match); + return is_callable($callback) ? + call_user_func_array($callback, $match) : + $callback; } }
allow returning a constant instead of a callback
functional-php_pattern-matching
train
php
ecadca124f38f56a58588cd69c9928a2c85e2c99
diff --git a/tacl/db_manager.py b/tacl/db_manager.py index <HASH>..<HASH> 100644 --- a/tacl/db_manager.py +++ b/tacl/db_manager.py @@ -49,8 +49,8 @@ class DBManager (object): (label, row['id'])) def add_ngram (self, text_id, ngram, size, count): - """Adds a TextNGram row specifying the `count` of `ngram` - appearing in `text_id`. + """Stores parameter values for inserting a TextNGram row + specifying the `count` of `ngram` appearing in `text_id`. :param text_id: database ID of the Text :type text_id: `int` @@ -62,10 +62,10 @@ class DBManager (object): :type count: `int` """ - # Add a new TextNGram record. self._parameters.append((text_id, ngram, size, count)) def add_ngrams (self): + """Adds TextNGram rows using the stored parameter values.""" self._conn.executemany( '''INSERT INTO TextNGram (text, ngram, size, count) VALUES (?, ?, ?, ?)''', self._parameters)
Corrected docstrings to match code.
ajenhl_tacl
train
py
590ff9308d872f8565cde19e6156afadfba6ad62
diff --git a/hazelcast/src/main/java/com/hazelcast/security/permission/ConnectorPermission.java b/hazelcast/src/main/java/com/hazelcast/security/permission/ConnectorPermission.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/security/permission/ConnectorPermission.java +++ b/hazelcast/src/main/java/com/hazelcast/security/permission/ConnectorPermission.java @@ -60,6 +60,8 @@ public class ConnectorPermission extends InstancePermission { mask |= READ; } else if (ActionConstants.ACTION_WRITE.equals(action)) { mask |= WRITE; + } else { + throw new IllegalArgumentException("Configured action[" + action + "] is not supported"); } } return mask;
throw exception if an unsupported action is used for ConnectorPermission
hazelcast_hazelcast
train
java
910dbbaa9140a0ad04c90d3d6e9e077668933b67
diff --git a/operations.js b/operations.js index <HASH>..<HASH> 100644 --- a/operations.js +++ b/operations.js @@ -121,6 +121,7 @@ Operations.prototype.getInReq = function getInReq(id) { Operations.prototype.addOutReq = function addOutReq(req) { var self = this; + req.operations = self; self.requests.out[req.id] = req; self.pending.out++; @@ -130,6 +131,7 @@ Operations.prototype.addOutReq = function addOutReq(req) { Operations.prototype.addInReq = function addInReq(req) { var self = this; + req.operations = self; self.requests.in[req.id] = req; self.pending.in++;
Operations: store req.operations reference
uber_tchannel-node
train
js
71d1bea149ebf2b1265760d892653492191c875f
diff --git a/src/ReactCardFlip.js b/src/ReactCardFlip.js index <HASH>..<HASH> 100644 --- a/src/ReactCardFlip.js +++ b/src/ReactCardFlip.js @@ -29,13 +29,13 @@ class ReactCardFlip extends React.Component { flipper: { position: 'relative', transformStyle: 'preserve-3d', - transition: '0.6s' + transition: `${this.props.flipSpeedBackToFront}s` }, flipperFlip: { position: 'relative', transform: 'rotateY(180deg)', transformStyle: 'preserve-3d', - transition: '0.6s' + transition: `${this.props.flipSpeedFrontToBack}s` }, front: { WebkitBackfaceVisibility: 'hidden', @@ -84,7 +84,15 @@ ReactCardFlip.propTypes = { return new Error(`${componentName} requires two children.`); } }, + flipSpeedBackToFront: React.PropTypes.number, + flipSpeedFrontToBack: React.PropTypes.number, isFlipped: React.PropTypes.bool }; +ReactCardFlip.defaultProps = { + flipSpeedBackToFront: 0.6, + flipSpeedFrontToBack: 0.6, + isFlipped: false +}; + export default ReactCardFlip;
Add props to allow users to control speed of flip animation for front and back starting flips.
AaronCCWong_react-card-flip
train
js
82af91315353be48c6bb955fe251545190f1c62d
diff --git a/src/factories.js b/src/factories.js index <HASH>..<HASH> 100644 --- a/src/factories.js +++ b/src/factories.js @@ -1,3 +1,6 @@ +import util from 'util'; + + export function createChainCreator(chainFactory, render) { // This Proxy initiates the chain, and must return a new Chain const handler = { @@ -53,23 +56,16 @@ function createChain(chainName, chainFactory, render) { function createHandler(chain, methodName, render) { const handlers = { - name() { - return {}; - }, toString() { return () => render(chain) }, - inspect() { - return {}; - }, - valueOf() { - return () => render(chain) + // Called with console.log(chain) -- single arg + [util.inspect.custom]() { + return () => 'Chain: ' + util.inspect(render(chain)) }, + // Called with console.log('arg', chain) -- multiple args [Symbol.toPrimitive]() { - return () => render(chain) - }, - [Symbol.toStringTag]() { - return {} + return () => 'Chain: '+ util.inspect(render(chain)); }, __repr__() { return () => chain.members;
Cleanup console.log output with better Symbol handlers
jbmusso_zer
train
js
932cd9708a3cfbb2d7d4f9e6f3501d79ae542ba2
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index <HASH>..<HASH> 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1018,3 +1018,12 @@ class SaltReturnAssertsMixIn(object): return self.assertNotEqual( self.__getWithinSaltReturn(ret, keys), comparison ) + + +class ClientCase(AdaptedConfigurationTestCaseMixIn, TestCase): + ''' + A base class containing relevant options for starting the various Salt + Python API entrypoints + ''' + def get_opts(self): + return salt.config.client_config(self.get_config_file_path('master'))
Added new TestCase for testing the *Client interfaces
saltstack_salt
train
py
a96ce5e947f6559b66661fe09fdaf26d82bf6838
diff --git a/lib/heroku_san/api.rb b/lib/heroku_san/api.rb index <HASH>..<HASH> 100644 --- a/lib/heroku_san/api.rb +++ b/lib/heroku_san/api.rb @@ -4,8 +4,6 @@ module HerokuSan class API def initialize(options = {}) @options = options - @options[:api_key] ||= auth_token - @heroku_api = Heroku::API.new(@options) end def sh(app, *command) @@ -23,7 +21,7 @@ module HerokuSan end def method_missing(name, *args) - @heroku_api.send(name, *args) + heroku_api.send(name, *args) rescue Heroku::API::Errors::ErrorWithResponse => error status = error.response.headers["Status"] msg = JSON.parse(error.response.body)['error'] rescue '???' @@ -34,6 +32,13 @@ module HerokuSan private + def heroku_api + @heroku_api ||= begin + @options[:api_key] ||= auth_token + Heroku::API.new(@options) + end + end + def auth_token ENV['HEROKU_API_KEY'] || Bundler.with_clean_env { `heroku auth:token`.chomp } rescue Errno::ENOENT
Defer evaluation of the Heroku auth token - HerokuSan::API was trying to evaluate the auth token at construction time, instead of waiting until it was actually needed, if ever. - Fixes #<I>
jqr_heroku_san
train
rb
176b5bf3c3452f326ecec785cade0bdeb6f5f780
diff --git a/src/main/com/mongodb/util/JSON.java b/src/main/com/mongodb/util/JSON.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/util/JSON.java +++ b/src/main/com/mongodb/util/JSON.java @@ -298,9 +298,6 @@ class JSONParser { case '{': value = parseObject(name); break; - case '/': - value = parsePatter(); - break; default: throw new JSONParseException(s, pos); } @@ -365,31 +362,6 @@ class JSONParser { _callback.gotDouble(name, (Double)value); } } - // XXX kill parsePattern? - public Pattern parsePatter(){ - read( '/' ); - - StringBuilder buf = new StringBuilder(); - - char current = read(); - while( current != '/'){ - buf.append( current ); - current = read(); - } - - int flags = 0; - - while ( pos < s.length() ){ - current = s.charAt( pos ); - if ( Character.isWhitespace( current ) || - ! Character.isLetter( current ) ) - break; - flags |= Bytes.regexFlag( current ); - current = read(); - } - - return Pattern.compile( buf.toString() , flags ); - } /** * Read the current character, making sure that it is the expected character.
Cleanup from last commit. Code to parse regex values moved
mongodb_mongo-java-driver
train
java
aabb384a20fb550f04c239df189fa0679000894b
diff --git a/src/js/mep-feature-volume.js b/src/js/mep-feature-volume.js index <HASH>..<HASH> 100644 --- a/src/js/mep-feature-volume.js +++ b/src/js/mep-feature-volume.js @@ -209,7 +209,12 @@ if (t.container.is(':visible')) { // set initial volume positionVolumeHandle(player.options.startVolume); - + + // mutes the media and sets the volume icon muted if the initial volume is set to 0 + if (player.options.startVolume === 0) { + media.setMuted(true); + } + // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements if (media.pluginType === 'native') { media.setVolume(player.options.startVolume);
0 startVolume mutes the media and sets the sound icon to be muted as well (to match the dragging functionality of the volume slider)
mediaelement_mediaelement
train
js
70b64ac88c912015353f813636aa3639dd3c4832
diff --git a/routing/dht/query.go b/routing/dht/query.go index <HASH>..<HASH> 100644 --- a/routing/dht/query.go +++ b/routing/dht/query.go @@ -229,7 +229,7 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) { // make sure we're connected to the peer. // FIXME abstract away into the network layer if conns := r.query.dht.host.Network().ConnsToPeer(p); len(conns) == 0 { - log.Error("not connected. dialing.") + log.Debug("not connected. dialing.") notif.PublishQueryEvent(r.runCtx, &notif.QueryEvent{ Type: notif.DialingPeer,
drop error log down to debug License: MIT
ipfs_go-ipfs
train
go
11eff3fe394822252f75bc54a9f039866e34f877
diff --git a/tests/unit/algorithms/TransientMultiPhysicsTest.py b/tests/unit/algorithms/TransientMultiPhysicsTest.py index <HASH>..<HASH> 100644 --- a/tests/unit/algorithms/TransientMultiPhysicsTest.py +++ b/tests/unit/algorithms/TransientMultiPhysicsTest.py @@ -39,7 +39,7 @@ class TransientMultiPhysicsTest: pore_diameter="pore.diameter", throat_diameter="throat.diameter") # phase and physics - self.air = op.phases.Air(network=self.net) + self.air = op.phase.Air(network=self.net) self.phys = op.physics.GenericPhysics(network=self.net, phase=self.air, geometry=self.geo)
Changed phases to phase in Multiphysics test
PMEAL_OpenPNM
train
py
ca34d8b7069bbefbcb1b27ff614b585ae298c703
diff --git a/php/WP_CLI/Loggers/Quiet.php b/php/WP_CLI/Loggers/Quiet.php index <HASH>..<HASH> 100644 --- a/php/WP_CLI/Loggers/Quiet.php +++ b/php/WP_CLI/Loggers/Quiet.php @@ -2,22 +2,45 @@ namespace WP_CLI\Loggers; +/** + * Quiet logger only logs errors. + */ class Quiet { - function info( $message ) { + /** + * Informational messages aren't logged. + * + * @param string $message Message to write. + */ + public function info( $message ) { // nothing } - function success( $message ) { + /** + * Success messages aren't logged. + * + * @param string $message Message to write. + */ + public function success( $message ) { // nothing } - function warning( $message ) { + /** + * Warning messages aren't logged. + * + * @param string $message Message to write. + */ + public function warning( $message ) { // nothing } - function error( $message ) { + /** + * Write an error message to STDERR, prefixed with "Error: ". + * + * @param string $message Message to write. + */ + public function error( $message ) { fwrite( STDERR, \WP_CLI::colorize( "%RError:%n $message\n" ) ); } -} +}
PHPdoc for the Quiet logger
wp-cli_export-command
train
php
79e8715b8a89ccb8bf1a9e2408f0f84b61844087
diff --git a/java/src/com/google/template/soy/jssrc/internal/JsType.java b/java/src/com/google/template/soy/jssrc/internal/JsType.java index <HASH>..<HASH> 100644 --- a/java/src/com/google/template/soy/jssrc/internal/JsType.java +++ b/java/src/com/google/template/soy/jssrc/internal/JsType.java @@ -145,8 +145,7 @@ public final class JsType { private static final JsType LIT_HTML = builder() - // Always require a thunk to simulate CallParamContent nodes. - .addType("function():lit_element.TemplateResult") + .addType("lit_element.TemplateResult") .addRequire(GoogRequire.createWithAlias("litElement", "lit_element")) .setPredicate(TypePredicate.NO_OP) .build();
Allow template types to be usable from Wiz components. PiperOrigin-RevId: <I>
google_closure-templates
train
java
2450e8efc6717094f30651333983f8c750028113
diff --git a/lib/pseudohiki/htmlformat.rb b/lib/pseudohiki/htmlformat.rb index <HASH>..<HASH> 100644 --- a/lib/pseudohiki/htmlformat.rb +++ b/lib/pseudohiki/htmlformat.rb @@ -86,10 +86,6 @@ module PseudoHiki end end - class CommentOutNodeFormatter < self - def visit(tree); ""; end - end - class HeadingNodeFormatter < self def create_self_element(tree) super(tree).tap do |element| @@ -151,13 +147,13 @@ module PseudoHiki [ListNode, UL], [EnumNode, OL], [VerbatimNode, VERB], + [CommentOutNode, nil], [TableLeaf, TR], #Until here is for BlockParser ].each {|node_class, element| Formatter[node_class] = self.new(element) } #for InlineParser ImgFormat = self.new(IMG) #for BlockParser - Formatter[CommentOutNode] = CommentOutNodeFormatter.new(nil) Formatter[HeadingNode] = HeadingNodeFormatter.new(SECTION) Formatter[DescLeaf] = DescLeafFormatter.new(DT) Formatter[TableCellNode] = TableCellNodeFormatter.new(nil) @@ -227,7 +223,11 @@ module PseudoHiki end end end - end + + class << Formatter[CommentOutNode] + def visit(tree); ""; end + end + end class XhtmlFormat < HtmlFormat Formatter = HtmlFormat::Formatter.dup
deleted HtmlFormat::CommentOutNodeFormatter
nico-hn_PseudoHikiParser
train
rb
ad8526541028bd658c0ea57931ff01c47f35005d
diff --git a/source/rafcon/statemachine/states/state.py b/source/rafcon/statemachine/states/state.py index <HASH>..<HASH> 100644 --- a/source/rafcon/statemachine/states/state.py +++ b/source/rafcon/statemachine/states/state.py @@ -868,6 +868,11 @@ class State(Observable, yaml.YAMLObject): def is_root_state(self): return not isinstance(self.parent, State) + @property + def is_root_state_of_library(self): + from rafcon.statemachine.states.library_state import LibraryState + return isinstance(self.parent, LibraryState) + def finalize(self, outcome=None): """Finalize state
New state property: is_root_state_of_library
DLR-RM_RAFCON
train
py
a905c18298ff0b5d4f9eb2a0a58ae16920e021be
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,10 +44,10 @@ setup( license="GPL v2", description=description, long_description=open('README.rst').read() if exists('README.rst') else '', - install_requires=["fcswrite", # required by: fcs export - "h5py>=2.8.0", # required by: rtdc format - "imageio>=2.3.0", # required by: tdms format, avi export - "nptdms", # required by: tdms format + install_requires=["fcswrite>=0.4.1", # required by: fcs export + "h5py>=2.8.0", # required by: rtdc format + "imageio>=2.3.0", # required by: tdms format, avi export + "nptdms", # required by: tdms format "numpy>=1.9.0", "pathlib", "scipy>=0.12.0",
setup: add version deps for fcswrite
ZELLMECHANIK-DRESDEN_dclab
train
py
b48f0b9f440ce7fac4cd1d5380bea2b15ceda000
diff --git a/SwatDB/SwatDBRecordsetWrapper.php b/SwatDB/SwatDBRecordsetWrapper.php index <HASH>..<HASH> 100644 --- a/SwatDB/SwatDBRecordsetWrapper.php +++ b/SwatDB/SwatDBRecordsetWrapper.php @@ -605,6 +605,11 @@ abstract class SwatDBRecordsetWrapper extends SwatObject public function attachSubDataObjects($name, SwatDBRecordsetWrapper $sub_data_objects) { + if ($this->index_field === null) + throw new SwatDBException( + "Index field must be specified on this wrapper ". + "in order to attach sub-dataobjects."); + foreach ($this->objects as $object) { $value = $object->getInternalValue($name); if (isset($sub_data_objects[$value]))
Throw a message if trying to attach sub-dataobjects when no index-field is set on the wrapper. This will at least solve the problem where this just silently fails. Later we can think about removing the field altogether. svn commit r<I>
silverorange_swat
train
php
32d8d3442e57ecb6037b103319562eacdf7f5883
diff --git a/lib/api_hammer/active_record_cache_find_by.rb b/lib/api_hammer/active_record_cache_find_by.rb index <HASH>..<HASH> 100644 --- a/lib/api_hammer/active_record_cache_find_by.rb +++ b/lib/api_hammer/active_record_cache_find_by.rb @@ -107,8 +107,9 @@ module ActiveRecord def cache_key_for(find_attributes) attrs = find_attributes.map { |k,v| [k.to_s, v.to_s] }.sort_by(&:first).inject([], &:+) cache_key_prefix = ['cache_find_by', table_name] + @parser ||= URI.const_defined?(:Parser) ? URI::Parser.new : URI cache_key = (cache_key_prefix + attrs).map do |part| - (URI.const_defined?(:Parser) ? URI::Parser.new : URI).escape(part, /[^a-z0-9\-\.\_\~]/i) + @parser.escape(part, /[^a-z0-9\-\.\_\~]/i) end.join('/') end end
don't reinitialize uri parser constantly
notEthan_api_hammer
train
rb
5a4d97f75450da32a94db9883bdc1d09c8c8085e
diff --git a/framework/js/onsen.js b/framework/js/onsen.js index <HASH>..<HASH> 100644 --- a/framework/js/onsen.js +++ b/framework/js/onsen.js @@ -376,6 +376,21 @@ window.ons = (function(){ var deferred = ons._qService.defer(); popover.on('ons-popover:init', function(e) { + // Copy "style" attribute from parent. + var child = popover[0].querySelector('.popover'); + if (el[0].hasAttribute('style')) { + var parentStyle = el[0].getAttribute('style'), + childStyle = child.getAttribute('style'), + newStyle = (function(a, b) { + var c = + (a.substr(-1) === ';' ? a : a + ';') + + (b.substr(-1) === ';' ? b : b + ';'); + return c; + })(parentStyle, childStyle); + + child.setAttribute('style', newStyle); + } + deferred.resolve(e.component); });
Added ability to use a "style" attribute with the "ons-popover" compontent.
OnsenUI_OnsenUI
train
js
7b483c0ed03dfaa8b4bc963105c49f54e416fcc2
diff --git a/dbmail/models.py b/dbmail/models.py index <HASH>..<HASH> 100644 --- a/dbmail/models.py +++ b/dbmail/models.py @@ -790,8 +790,10 @@ class MailSubscriptionAbstract(models.Model): continue kwargs['backend'] = method.backend - extra_slug = '%s-%s' % (slug, method.backend.split('.')[-1]) + extra_slug = '%s-%s' % (slug, method.get_short_type()) use_slug = slug + + kwargs = method.update_notify_kwargs(**kwargs) try: if MailTemplate.get_template(slug=extra_slug): use_slug = extra_slug @@ -799,6 +801,12 @@ class MailSubscriptionAbstract(models.Model): pass db_sender(use_slug, method.address, **kwargs) + def update_notify_kwargs(self, **kwargs): + return kwargs + + def get_short_type(self): + return self.backend.split('.')[-1] + class Meta: abstract = True
added the ability to update instance kwargs in notify method
LPgenerator_django-db-mailer
train
py
202db4846bb2b7d5b15834272a3ad57bdfd85bf9
diff --git a/packages/list/package.js b/packages/list/package.js index <HASH>..<HASH> 100644 --- a/packages/list/package.js +++ b/packages/list/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'mdg:list', - version: '0.2.13', + version: '0.2.14', summary: 'A infinite-scroll list component', git: 'https://github.com/meteor/chromatic', documentation: null @@ -11,7 +11,6 @@ Package.onUse(function(api) { api.use([ 'ecmascript', 'mdg:borealis@0.2.5', - 'mdg:chromatic@0.2.6', 'underscore', 'mdg:form-components@0.2.7', 'mdg:animations@0.2.3'
remove chromatic dependency from mdg:list
meteor_chromatic
train
js
b65d192b60945ecc2856a6b7be2d10d12a5613d1
diff --git a/Evtx/Views.py b/Evtx/Views.py index <HASH>..<HASH> 100644 --- a/Evtx/Views.py +++ b/Evtx/Views.py @@ -127,6 +127,12 @@ def _make_template_xml_view(root_node, cache=None): return "".join(acc) +def to_xml_string(s): + s = xml_sax_escape(s, {'"': '&quot;'}) + s = s.encode("ascii", "xmlcharrefreplace").decode('ascii') + return s + + def _build_record_xml(record, cache=None): """ Note, the cache should be local to the Evtx.Chunk. @@ -144,7 +150,7 @@ def _build_record_xml(record, cache=None): subs_strs = [] for sub in root_node.fast_substitutions(): if isinstance(sub, str): - subs_strs.append((xml_sax_escape(sub, {'"': "&quot;"})).encode("ascii", "xmlcharrefreplace")) + subs_strs.append(to_xml_string(sub)) elif isinstance(sub, RootNode): subs_strs.append(rec(sub)) elif sub is None:
views: fix encoding of subs
williballenthin_python-evtx
train
py
3f995cbeeff2f1886120b13ef3bc226c0bd543e3
diff --git a/sdl/mouse.go b/sdl/mouse.go index <HASH>..<HASH> 100644 --- a/sdl/mouse.go +++ b/sdl/mouse.go @@ -15,13 +15,13 @@ static int SDL_CaptureMouse(SDL_bool enabled) { return -1; } -#endif #pragma message("SDL_MOUSEWHEEL_NORMAL is not supported before SDL 2.0.4") #define SDL_MOUSEWHEEL_NORMAL (0) #pragma message("SDL_MOUSEWHEEL_FLIPPED is not supported before SDL 2.0.4") #define SDL_MOUSEWHEEL_FLIPPED (0) +#endif */ import "C" import "unsafe"
sdl: mouse.go: Fix #endif not placed correctly
veandco_go-sdl2
train
go
f1f3f1760d76d5859f14cb3a8bb72dd923254926
diff --git a/lib/adhearsion/initializer.rb b/lib/adhearsion/initializer.rb index <HASH>..<HASH> 100644 --- a/lib/adhearsion/initializer.rb +++ b/lib/adhearsion/initializer.rb @@ -110,16 +110,19 @@ module Adhearsion def catch_termination_signal %w'INT TERM'.each do |process_signal| + logger.info "Received #{process_signal} signal. Shutting down." trap process_signal do Adhearsion::Process.shutdown end end trap 'QUIT' do + logger.info "Received QUIT signal. Hard shutting down." Adhearsion::Process.hard_shutdown end trap 'ABRT' do + logger.info "Received ABRT signal. Forcing stop." Adhearsion::Process.force_stop end end
[FEATURE] Log process signals and the action being taken #<I>
adhearsion_adhearsion
train
rb
1292db6ca3702e400b43cf322f9c10c90883f005
diff --git a/tests/Unit/Benchmark/Remote/ReflectorTest.php b/tests/Unit/Benchmark/Remote/ReflectorTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Benchmark/Remote/ReflectorTest.php +++ b/tests/Unit/Benchmark/Remote/ReflectorTest.php @@ -94,6 +94,10 @@ class ReflectorTest extends \PHPUnit_Framework_TestCase */ public function testMultipleClassKeywords() { + if (version_compare(phpversion(), '5.5', '<')) { + $this->markTestSkipped(); + } + $fname = __DIR__ . '/reflector/ClassWithClassKeywords.php'; $classHierarchy = $this->reflector->reflect($fname); $reflection = $classHierarchy->getTop();
Skip ::class test with PHP < <I>
phpbench_phpbench
train
php
66e7134335e1476c0d2bfa7d94d87fa14a266c1e
diff --git a/lib/6to5/transformation/modules/_default.js b/lib/6to5/transformation/modules/_default.js index <HASH>..<HASH> 100644 --- a/lib/6to5/transformation/modules/_default.js +++ b/lib/6to5/transformation/modules/_default.js @@ -138,7 +138,7 @@ DefaultFormatter.prototype.exportDeclaration = function (node, nodes) { }); var newDeclar = t.variableDeclaration(declar.kind, [decl]); - if (i === 0) t.inherits(newDeclar, declar); + if (i == 0) t.inherits(newDeclar, declar); nodes.push(newDeclar); } } else { diff --git a/lib/6to5/transformation/transformers/react.js b/lib/6to5/transformation/transformers/react.js index <HASH>..<HASH> 100644 --- a/lib/6to5/transformation/transformers/react.js +++ b/lib/6to5/transformation/transformers/react.js @@ -115,8 +115,8 @@ exports.XJSElement = { for (i in lines) { var line = lines[i]; - var isFirstLine = i === 0; - var isLastLine = i === lines.length - 1; + var isFirstLine = i == 0; + var isLastLine = i == lines.length - 1; // replace rendered whitespace tabs with spaces var trimmedLine = line.replace(/\t/g, ' ');
revert strict equals after #<I>
babel_babel
train
js,js
37127dde367c263d69ca4cee609f8769b935ea62
diff --git a/core/src/main/java/hudson/util/XStream2.java b/core/src/main/java/hudson/util/XStream2.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/util/XStream2.java +++ b/core/src/main/java/hudson/util/XStream2.java @@ -131,7 +131,6 @@ public class XStream2 extends XStream { * @param clazz a class which we expect to hold a non-{@code transient} field * @param field a field name in that class */ - @Restricted(NoExternalUse.class) // TODO could be opened up later public void addCriticalField(Class<?> clazz, String field) { reflectionConverter.addCriticalField(clazz, field); }
Like mentioned in the previous comment in code, the method should be used in the other project, like authorize-project that require a field to be set as critical. As discussed with Jesse and Oleg on Oct. 5, I can un-restrict the call to this method by plugins.
jenkinsci_jenkins
train
java
2de60ba257def338942ffc947efc03aea1a730c8
diff --git a/gns3server/compute/port_manager.py b/gns3server/compute/port_manager.py index <HASH>..<HASH> 100644 --- a/gns3server/compute/port_manager.py +++ b/gns3server/compute/port_manager.py @@ -44,7 +44,6 @@ class PortManager: self._used_udp_ports = set() server_config = Config.instance().get_section_config("Server") - remote_console_connections = server_config.getboolean("allow_remote_console") console_start_port_range = server_config.getint("console_start_port_range", 5000) console_end_port_range = server_config.getint("console_end_port_range", 10000)
Drop a useless line of code in port_manager
GNS3_gns3-server
train
py
d252f4249f1f5a88176a5b6ef1eaf733932cd0c0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -146,6 +146,7 @@ if __name__ == '__main__': setup( author='CERN', author_email='admin@inspirehep.net', + description='Inspire JSON schemas and utilities to use them.', install_requires=['jsonschema'], license='GPLv2', name='inspire-schemas',
Update setup.py Adding description
inspirehep_inspire-schemas
train
py
ae96119df528526f8d1efa65da72b44986f9f448
diff --git a/telemetry/PRESUBMIT.py b/telemetry/PRESUBMIT.py index <HASH>..<HASH> 100644 --- a/telemetry/PRESUBMIT.py +++ b/telemetry/PRESUBMIT.py @@ -10,8 +10,9 @@ PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101'] def _CommonChecks(input_api, output_api): results = [] - from build import update_docs - if update_docs.IsUpdateDocsNeeded(): + # TODO(nduca): This should call update_docs.IsUpdateDocsNeeded(). + # Disabled due to crbug.com/255326. + if False: update_docs_path = os.path.join( input_api.PresubmitLocalPath(), 'update_docs') assert os.path.exists(update_docs_path)
Disable telemetry doc presubmit Doc generation isn't stable across python revs, causing spurious presubmit errors. BUG=<I> TBR=tonyg NOTRY=True Review URL: <URL>
catapult-project_catapult
train
py
fd0ef76f14a78c4d992c41bb3e000115482a4960
diff --git a/contextMenu.js b/contextMenu.js index <HASH>..<HASH> 100644 --- a/contextMenu.js +++ b/contextMenu.js @@ -129,8 +129,15 @@ angular.module('ui.bootstrap.contextMenu', []) var leftCoordinate = event.pageX; var menuWidth = angular.element($ul[0]).prop('offsetWidth'); var winWidth = event.view.innerWidth; - if (leftCoordinate > menuWidth && winWidth - leftCoordinate < menuWidth) { - leftCoordinate = event.pageX - menuWidth; + var rightPadding = 5; + if (leftCoordinate > menuWidth && winWidth - leftCoordinate - rightPadding < menuWidth) { + leftCoordinate = winWidth - menuWidth - rightPadding; + } else if(winWidth - leftCoordinate < menuWidth) { + var reduceThreshold = 5; + if(leftCoordinate < reduceThreshold + rightPadding) { + reduceThreshold = leftCoordinate + rightPadding; + } + leftCoordinate = winWidth - menuWidth - reduceThreshold - rightPadding; } $ul.css({
fix: correct left coordinate being set when menu will overflow x-axis
Templarian_ui.bootstrap.contextMenu
train
js
72812572d32a3ab6e790826a28e660f73e73199d
diff --git a/shared/actions/chat.js b/shared/actions/chat.js index <HASH>..<HASH> 100644 --- a/shared/actions/chat.js +++ b/shared/actions/chat.js @@ -884,7 +884,7 @@ function * _loadInbox (action: ?LoadInbox): SagaGenerator<any, any> { chatInboxConversation: takeFromChannelMap(loadInboxChanMap, 'chat.1.chatUi.chatInboxConversation'), chatInboxFailed: takeFromChannelMap(loadInboxChanMap, 'chat.1.chatUi.chatInboxFailed'), finished: takeFromChannelMap(loadInboxChanMap, 'finished'), - timeout: call(delay, 10000), + timeout: call(delay, 30000), }) if (incoming.chatInboxConversation) {
Bump inbox timeout to <I>s
keybase_client
train
js
e53b6177fcb9bdae301746343be606547b90ae41
diff --git a/concrete/single_pages/dashboard/system/registration/authentication.php b/concrete/single_pages/dashboard/system/registration/authentication.php index <HASH>..<HASH> 100644 --- a/concrete/single_pages/dashboard/system/registration/authentication.php +++ b/concrete/single_pages/dashboard/system/registration/authentication.php @@ -1,6 +1,9 @@ <?php defined('C5_EXECUTE') or die('Access Denied.'); $json = Loader::helper('json'); +if (!isset($editmode)) { + $editmode = null; +} ?> <style> .table.authentication-types i.handle {
Avoid accessing an undefined var in system/registration/authentication
concrete5_concrete5
train
php
5ab72c884f558e34523045f6c01c8ff7eaebd6b8
diff --git a/config/platform/windows.rb b/config/platform/windows.rb index <HASH>..<HASH> 100644 --- a/config/platform/windows.rb +++ b/config/platform/windows.rb @@ -175,7 +175,7 @@ module RightScale # Path to right link configuration and internal usage scripts def private_bin_dir - File.join(company_program_files_dir, 'right_link', 'scripts', 'windows') + return pretty_path(File.join(sandbox_dir, 'right_link', 'scripts', 'windows')) end def sandbox_dir @@ -343,7 +343,14 @@ module RightScale value = arg.to_s escaped << (value.index(' ') ? "\"#{value}\"" : value) end - return escaped.join(" ") + + # let cmd do the extension resolution if no extension was given + ext = File.extname(executable_file_path) + if ext.nil? || ext.empty? + "cmd.exe /C \"#{escaped.join(" ")}\"" + else + escaped.join(" ") + end end # Formats a powershell command using the given script path and arguments.
use backslashes for bin dir. use cmd.exe for extension resolution when formatting a command and an extension was not given
rightscale_right_link
train
rb
c5755ba2a5c4d2c847458f8f30e51ad0a5c53e29
diff --git a/extras/sum_roll_dice.py b/extras/sum_roll_dice.py index <HASH>..<HASH> 100644 --- a/extras/sum_roll_dice.py +++ b/extras/sum_roll_dice.py @@ -13,7 +13,7 @@ def roll_dice(): while True: roll = random.randint(1, 6) sums += roll - if(input("Enter y or n to continue : ").upper()) == 'N': + if(raw_input("Enter y or n to continue : ").upper()) == 'N': print(sums) # prints the sum of the roll calls break
Fixed an issue that isnt an issue but whatever
area4lib_area4
train
py
cee7529c9a4f99731bd63930479facfba8d463b7
diff --git a/code/png.py b/code/png.py index <HASH>..<HASH> 100755 --- a/code/png.py +++ b/code/png.py @@ -2103,7 +2103,10 @@ class Reader: def iterscale(): for row in pixels: yield map(lambda x: int(round(x*factor)), row) - return width, height, iterscale(), meta + if maxval == targetmaxval: + return width, height, pixels, meta + else: + return width, height, iterscale(), meta def asRGB8(self): """Return the image data as an RGB pixels with 8-bits per
Optimize the (common?) case where the user requests the same bitdepth of the image. With this optimization the time to read a <I>x<I> image with no filters when from <I>s to <I>s.
drj11_pypng
train
py
b058b68a36832e665dc10e304a23579be943648d
diff --git a/src/main/java/org/scribe/model/Verb.java b/src/main/java/org/scribe/model/Verb.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/scribe/model/Verb.java +++ b/src/main/java/org/scribe/model/Verb.java @@ -7,5 +7,5 @@ package org.scribe.model; */ public enum Verb { - GET, POST, PUT, DELETE + GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE, PATCH }
Add support for HEAD, OPTIONS, TRACE and PATCH
scribejava_scribejava
train
java
000e2c5e53642491e03c851d62b53dcf9295eef5
diff --git a/openquake/engine/calculators/hazard/general.py b/openquake/engine/calculators/hazard/general.py index <HASH>..<HASH> 100644 --- a/openquake/engine/calculators/hazard/general.py +++ b/openquake/engine/calculators/hazard/general.py @@ -339,7 +339,7 @@ class BaseHazardCalculator(base.Calculator): n_imts, n_levels, n_sites) else: n_imts = len(self.hc.intensity_measure_types) - n_levels = None + n_levels = 0 # The output weight is a pure number which is proportional to the size # of the expected output of the calculator. For classical and disagg
Fixed the case of no levels Former-commit-id: <I>ddd<I>f1c<I>da<I>fdf1e<I>a<I>bb1
gem_oq-engine
train
py
90e0fd4ee2dbeb861fae26082b8b71a6756e645c
diff --git a/client/state/jetpack-connect/reducer.js b/client/state/jetpack-connect/reducer.js index <HASH>..<HASH> 100644 --- a/client/state/jetpack-connect/reducer.js +++ b/client/state/jetpack-connect/reducer.js @@ -117,8 +117,7 @@ export function jetpackConnectAuthorize( state = {}, action ) { export function jetpackSSO( state = {}, action ) { switch ( action.type ) { case JETPACK_CONNECT_SSO_QUERY_SET: - const queryObject = Object.assign( {}, action.queryObject ); - return Object.assign( {}, queryObject ); + return Object.assign( {}, action.queryObject ); case JETPACK_CONNECT_SSO_VALIDATE: return Object.assign( state, { isValidating: true } ); case JETPACK_CONNECT_SSO_AUTHORIZE:
State: Simplify logic in JETPACK_CONNECT_SSO_QUERY_SET
Automattic_wp-calypso
train
js
6ba247d5b41c4fe99d5d3c6539098e34adab1ec9
diff --git a/src/main/java/org/corpus_tools/annis/gui/security/SecurityConfiguration.java b/src/main/java/org/corpus_tools/annis/gui/security/SecurityConfiguration.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/corpus_tools/annis/gui/security/SecurityConfiguration.java +++ b/src/main/java/org/corpus_tools/annis/gui/security/SecurityConfiguration.java @@ -95,7 +95,15 @@ public class SecurityConfiguration { // Restrict access to our application. .and().authorizeRequests().anyRequest().authenticated() - // Not using Spring CSRF here to be able to use plain HTML for the login page + // Not using Spring CSRF here because Vaadin also has a + // Cross-site request forgery running. + // Spring will try to enforce an additional layer + // on the filtered resources, which conflicts with + // the Vaadin CSRF protection and make the frontend + // unusable. Disabling Spring CSRF is therefore + // safe, as long as Vaadin CSRF protection is + // activated (which it is per default). + // https://vaadin.com/blog/filter-based-spring-security-in-vaadin-applications .and().csrf().disable(); // We depend on IFrames embedded into the application
Add comment for reviewers in Sonacloud and other static code analysis tools. This seems to be reported as security issue by several automatic tools, but is not. Adding a more lengthy (and correct) explanation for humans that need to review this.
korpling_ANNIS
train
java
014dbb314e9978b7a140d2e7fd54bd844563818f
diff --git a/packages/server/src/application.js b/packages/server/src/application.js index <HASH>..<HASH> 100755 --- a/packages/server/src/application.js +++ b/packages/server/src/application.js @@ -30,7 +30,7 @@ export async function start (config, di, plugins) { } start['@Inject'] = ['config', 'di', 'plugins']; -export async function init (config, di, plugins) { +export async function init (di, plugins) { let application = express(); /* eslint-disable new-cap */ server = http.Server(application); @@ -79,7 +79,7 @@ export async function init (config, di, plugins) { // Always make sure the '*' handler happens last: application.get('*', renderIndex); } -init['@Inject'] = ['config', 'di', 'plugins']; +init['@Inject'] = ['di', 'plugins']; function injectPlugins (plugins, application, templatePath) { plugins = plugins.filter(plugin => plugin.description.hasUI);
chore(refactoring :hammer:) - removing unused dependency
TradeMe_tractor
train
js
ccf66ba6f34e4212eb86d8e613d8590d52e53d8e
diff --git a/tasks/quality.js b/tasks/quality.js index <HASH>..<HASH> 100644 --- a/tasks/quality.js +++ b/tasks/quality.js @@ -37,7 +37,7 @@ module.exports = function(grunt) { grunt.config('phplint', { all: defaultPatterns - }); + }); validate.push('phplint:all'); if (grunt.config.get('config.phpcs') != undefined) { @@ -105,7 +105,20 @@ module.exports = function(grunt) { } grunt.registerTask('validate', validate); - grunt.registerTask('analyze', analyze); + + if (analyze.length < 2) { + grunt.registerTask('analyze', analyze); + } + else { + grunt.loadNpmTasks('grunt-concurrent'); + grunt.config(['concurrent', 'analyze'], { + tasks: analyze, + options: { + logConcurrentOutput: true + } + }); + grunt.registerTask('analyze', ['concurrent:analyze']); + } grunt.config('help.validate', { group: 'Testing & Code Quality',
Wrap two or more analyze tasks in a concurrent process.
phase2_grunt-drupal-tasks
train
js
7d56ee5084e3ba30a500757b1fd5c29a987c8f56
diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js index <HASH>..<HASH> 100644 --- a/src/crypto/verification/request/VerificationRequest.js +++ b/src/crypto/verification/request/VerificationRequest.js @@ -157,11 +157,6 @@ export class VerificationRequest extends EventEmitter { return 0; } - /** the m.key.verification.request event that started this request, provided for compatibility with previous verification code */ - get event() { - return this._getEventByEither(REQUEST_TYPE) || this._getEventByEither(START_TYPE); - } - /** current phase of the request. Some properties might only be defined in a current phase. */ get phase() { return this._phase;
with the change in the linked react-sdk PR, `event` isn't used anymore
matrix-org_matrix-js-sdk
train
js
401f89bcbafd3c44bf326888078c2843a715bbf2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( long_description=__doc__, py_modules=['dj_static'], zip_safe=False, - install_requires=['static3'], + install_requires=['static'], include_package_data=True, platforms='any', classifiers=[
Switch back to original static lib, since it supports Python 3 now. Fixes #<I>
heroku-python_dj-static
train
py
304aa5744dd00a494287e08dc9593ad468ad6dcf
diff --git a/src/Umpirsky/PermissionsHandler/ScriptHandler.php b/src/Umpirsky/PermissionsHandler/ScriptHandler.php index <HASH>..<HASH> 100644 --- a/src/Umpirsky/PermissionsHandler/ScriptHandler.php +++ b/src/Umpirsky/PermissionsHandler/ScriptHandler.php @@ -9,6 +9,11 @@ class ScriptHandler { public static function setPermissions(CommandEvent $event) { + if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) { + $event->getIO()->write('No permissions setup is required on Windows.'); + return; + } + $event->getIO()->write('Setting up permissions.'); try {
Fixed error on Windows `ps aux` trigger error on Windows.
umpirsky_PermissionsHandler
train
php
6144786fa8e84f366e3c05c05ad5d8df5f4487a0
diff --git a/tests/unit/utils/test_ssdp.py b/tests/unit/utils/test_ssdp.py index <HASH>..<HASH> 100644 --- a/tests/unit/utils/test_ssdp.py +++ b/tests/unit/utils/test_ssdp.py @@ -13,6 +13,7 @@ from tests.support.mock import ( from salt.utils import ssdp import datetime +from salt.ext.six.moves import zip try: import pytest
Lintfix: W<I> (Python3 incompatibility)
saltstack_salt
train
py
c89c2a8381e0a261f5c92e7891e0637af0604c6e
diff --git a/Console/Command/EmailOrderReminderShell.php b/Console/Command/EmailOrderReminderShell.php index <HASH>..<HASH> 100644 --- a/Console/Command/EmailOrderReminderShell.php +++ b/Console/Command/EmailOrderReminderShell.php @@ -1,4 +1,5 @@ <?php + /** * EmailOrderReminderShell * @@ -19,12 +20,12 @@ class EmailOrderReminderShell extends AppShell public function main() { - if (! Configure::read('app.emailOrderReminderEnabled')) { + parent::main(); + + if (! Configure::read('app.emailOrderReminderEnabled') || ! Configure::read('app.db_config_FCS_CART_ENABLED')) { return; } - parent::main(); - App::uses('AppEmail', 'Lib'); $this->initSimpleBrowser(); // for loggedUserId @@ -46,12 +47,12 @@ class EmailOrderReminderShell extends AppShell $outString = ''; foreach ($customers as $customer) { - // kunde hat offene bestellungen, dh keine email verschicken + // customer has open orders, do not send email if (count($customer['ActiveOrders']) > 0) { continue; } - $Email = new CakeEmail(); + $Email = new AppEmail(); $Email->to($customer['Customer']['email']) ->template('Admin.email_order_reminder') ->emailFormat('html')
email order reminder considers if shop is disabled
foodcoopshop_foodcoopshop
train
php
21857f90375f93543259ef4ea7a4cbe234f017da
diff --git a/Gulpfile.js b/Gulpfile.js index <HASH>..<HASH> 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -149,4 +149,4 @@ gulp.task('shop-watch', function() { }); gulp.task('default', ['admin-js', 'admin-css', 'admin-img', 'shop-js', 'shop-css', 'shop-img']); -gulp.task('watch', ['admin-watch', 'shop-watch']); +gulp.task('watch', ['default', 'admin-watch', 'shop-watch']);
[Gulp] Add default task into gulp watch
Sylius_Sylius
train
js
f9e987f06c7ac8e3478ec081b984059d41dea8c1
diff --git a/src/test/java/org/cactoos/func/CallableOfTest.java b/src/test/java/org/cactoos/func/CallableOfTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/cactoos/func/CallableOfTest.java +++ b/src/test/java/org/cactoos/func/CallableOfTest.java @@ -60,11 +60,10 @@ public final class CallableOfTest { ); } - @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes") @Test(expected = Exception.class) public void wrapsRuntimeErrorFromRunnable() throws Exception { new CallableOf<>( - () -> { throw new RuntimeException(); } + () -> { throw new IllegalStateException(); } ).call(); }
(#<I>) Added unit tests for CallableOf As per PR review: * Now using IllegalStateException in `wrapsRuntimeErrorFromRunnable`
yegor256_cactoos
train
java
e08cde6159a6555cf125a787f7d7cefdfffbabe3
diff --git a/test/integration/containerized/test_cli_containerized.py b/test/integration/containerized/test_cli_containerized.py index <HASH>..<HASH> 100644 --- a/test/integration/containerized/test_cli_containerized.py +++ b/test/integration/containerized/test_cli_containerized.py @@ -25,6 +25,12 @@ def test_module_run(cli, project_fixtures, runtime): @pytest.mark.test_all_runtimes def test_playbook_run(cli, project_fixtures, runtime): + # Ensure the container environment variable is set so that Ansible fact gathering + # is able to detect it is running inside a container. + envvars_path = project_fixtures / 'containerized' / 'env' / 'envvars' + with envvars_path.open('a') as f: + f.write(f'container: {runtime}\n') + r = cli([ 'run', '--process-isolation-executable', runtime,
Set container env var for consistent test results
ansible_ansible-runner
train
py
1498a0cd42bd682b964d3dfd303762d996c50ff4
diff --git a/blockstack_client/scripts.py b/blockstack_client/scripts.py index <HASH>..<HASH> 100644 --- a/blockstack_client/scripts.py +++ b/blockstack_client/scripts.py @@ -537,6 +537,12 @@ def tx_get_unspents(address, utxo_client, min_confirmations=TX_MIN_CONFIRMATIONS Raise UTXOException on error """ + if min_confirmations is None: + min_confirmations = TX_MIN_CONFIRMATIONS + + if min_confirmations != TX_MIN_CONFIRMATIONS: + log.warning("Using UTXOs with {} confirmations instead of the default {}".format(min_confirmations, TX_MIN_CONFIRMATIONS)) + data = pybitcoin.get_unspents(address, utxo_client) try:
log when we use a different number of confirmations
blockstack_blockstack-core
train
py
110558d2c05febdd34edebedeee078566f12aac9
diff --git a/dist/goldenlayout.js b/dist/goldenlayout.js index <HASH>..<HASH> 100644 --- a/dist/goldenlayout.js +++ b/dist/goldenlayout.js @@ -2312,7 +2312,7 @@ lm.utils.copy( lm.controls.Header.prototype, { * @returns {void} */ _$destroy: function() { - this.emit( 'destroy' ); + this.emit( 'destroy', this ); for( var i = 0; i < this.tabs.length; i++ ) { this.tabs[ i ]._$destroy(); @@ -3424,7 +3424,7 @@ lm.utils.copy( lm.items.Component.prototype, { }, _$destroy: function() { - this.container.emit( 'destroy' ); + this.container.emit( 'destroy', this ); lm.items.AbstractContentItem.prototype._$destroy.call( this ); },
Passing this to destroy so we know what is destroyed
golden-layout_golden-layout
train
js
621d86920b8cb2acb0d2006b399ffa873cf4d94a
diff --git a/stagpy/config.py b/stagpy/config.py index <HASH>..<HASH> 100644 --- a/stagpy/config.py +++ b/stagpy/config.py @@ -416,7 +416,7 @@ class StagpyConfiguration: config_parser = configparser.ConfigParser() for sub_cmd in self.subs(): config_parser.add_section(sub_cmd) - for opt, opt_meta in sub_cmd.defaults(): + for opt, opt_meta in self[sub_cmd].defaults(): if opt_meta.conf_arg: if self.config.update: val = str(self[sub_cmd][opt])
Fix StagpyConfiguration.create_config method
StagPython_StagPy
train
py
00059be6f1c294c9ae25d4996ecd02c119e116c4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -98,8 +98,7 @@ setup( packages=[ "weka", "weka.core", - "weka.plot", - "wekaexamples" + "weka.plot" ], version="0.1.10", author='Peter "fracpete" Reutemann',
removed "wekaexamples" as package
fracpete_python-weka-wrapper
train
py
eb0b20784ea9b61a1e9161d92d5ce0f9781af443
diff --git a/secedgar/tests/filings/test_cik_validator.py b/secedgar/tests/filings/test_cik_validator.py index <HASH>..<HASH> 100644 --- a/secedgar/tests/filings/test_cik_validator.py +++ b/secedgar/tests/filings/test_cik_validator.py @@ -65,5 +65,4 @@ class TestCIKValidator: def test_params_reset_after_get_cik(self, ticker_lookups, client): validator = _CIKValidator(lookups=ticker_lookups, client=client) validator._get_cik(ticker_lookups[0]) - assert validator.params.get("CIK") is None - assert validator.params.get("company") is None + assert validator.params.get("CIK") is None and validator.params.get("company") is None
TEST: Combine asserts to test that both CIK and company cleared
coyo8_sec-edgar
train
py
fb5da0ab2b1f1034c7f4f12796d22af534f9e255
diff --git a/php/commands/export.php b/php/commands/export.php index <HASH>..<HASH> 100644 --- a/php/commands/export.php +++ b/php/commands/export.php @@ -68,7 +68,7 @@ class Export_Command extends WP_CLI_Command { define( 'YB_IN_BYTES', 1024 * ZB_IN_BYTES ); } - require WP_CLI_ROOT . '/export/functions.export.php'; + require WP_CLI_ROOT . '/php/export/functions.export.php'; } private function validate_args( $args ) {
Restore af<I>fe<I>c8d3b9df3c1fb<I>fddf<I>ac<I>fde5, which I accidentally overwrote :(
wp-cli_export-command
train
php
58c570433e69e10164fa0f941ef3af5440cafafd
diff --git a/ai/models.py b/ai/models.py index <HASH>..<HASH> 100644 --- a/ai/models.py +++ b/ai/models.py @@ -97,9 +97,6 @@ class SearchNode(object): def __eq__(self, other): return isinstance(other, SearchNode) and self.state == other.state - def __hash__(self): - return hash(self.state) - class SearchNodeCostOrdered(SearchNode): def __lt__(self, other):
Removed unused __hash__ method
simpleai-team_simpleai
train
py
bc1eb36354a38d97950ec1eddf226c73a9be1e5e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ var ROOT_HASH = constants.ROOT_HASH var PREV_HASH = constants.PREV_HASH var CUR_HASH = constants.CUR_HASH var PREFIX = constants.OP_RETURN_PREFIX -var NONCE = constants.NONCE +// var NONCE = constants.NONCE var CONFIRMATIONS_BEFORE_CONFIRMED = 10 var MAX_CHAIN_RETRIES = 3 var MAX_UNCHAIN_RETRIES = 10 @@ -1339,7 +1339,6 @@ Driver.prototype.putOnChain = function (entry) { Driver.prototype.sign = function (msg) { typeforce('Object', msg, true) // strict - typeforce('String', msg[NONCE]) if (!msg[SIGNEE]) { msg[SIGNEE] = this.myRootHash() + ':' + this.myCurrentHash() }
don't require nonce for sign
tradle_tim-old-engine
train
js
9b2efc924f39ef860ec721cbf7b0e01484137ea5
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,7 +29,7 @@ import shlex # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ["myst_parser"] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
Get myst_parser extension back to the conf. Refs: #<I>
candango_firenado
train
py
f94b5e3cd17c410bee837af5480f2e74b8d706f1
diff --git a/lib/Http.js b/lib/Http.js index <HASH>..<HASH> 100644 --- a/lib/Http.js +++ b/lib/Http.js @@ -11,6 +11,7 @@ var domain = require('domain'); var View = require('./View'); var Controller = require('./Controller'); var bodyParser = require('body-parser'); +var os = require('os'); // Load Generator Bind PolyFill require('generator-bind').polyfill(); @@ -37,6 +38,12 @@ class Http extends SandGrain { // Create Koa App this.app = express(); + // Set Standard Headers + this.app.use(function(req, res, next) { + res.append('X-Content-Location', os.hostname()); + next(); + }); + // Add Request Logger this.app.use(require('./middleware/logRequestTime')(this));
added x-content-location header
SandJS_http
train
js
e9283a3ce3967aed0d282e211941151938a60289
diff --git a/dataviews/operation.py b/dataviews/operation.py index <HASH>..<HASH> 100644 --- a/dataviews/operation.py +++ b/dataviews/operation.py @@ -115,8 +115,8 @@ class ViewOperation(param.ParameterizedFunction): stacks = val.values() if isinstance(val, GridLayout) else [val] # Initialize the list of data or coordinate grids if grids == []: - grids = [(DataGrid if isinstance(stack.type, DataLayer) - else CoordinateGrid)(view.bounds, view.shape, label=view.label) + grids = [(DataGrid if not isinstance(stack.type, (SheetLayer)) + else CoordinateGrid)(view.bounds, None, view.xdensity, view.ydensity, label=view.label) for stack in stacks] # Populate the grids for ind, stack in enumerate(stacks):
Fixes to handling of CoordinateGrids in ViewOperation ViewOperation now checks whether the type of View returned by a ViewOperation is a SheetLayer to determine whether to use a CoordinateGrid or DataGrid. Additionally xdensity and ydensity are passed directly rather than relying on fragile calculation computing densities from bounds and shape.
pyviz_holoviews
train
py
d8e0f85cf1b1de5ebc0121589bcad8c62efee127
diff --git a/autofit/database/model/model.py b/autofit/database/model/model.py index <HASH>..<HASH> 100644 --- a/autofit/database/model/model.py +++ b/autofit/database/model/model.py @@ -89,7 +89,10 @@ class Object(Base): ------- An instance of a concrete child of this class """ - if source is None or isinstance(source, np.ndarray): + if source is None or isinstance( + source, + (np.ndarray, np.dtype) + ): from .instance import NoneInstance instance = NoneInstance() elif isinstance(source, af.PriorModel):
don't store dtype in database
rhayes777_PyAutoFit
train
py
c04be40db151226497da01b41b4a0e83907f53ba
diff --git a/daemon_windows.go b/daemon_windows.go index <HASH>..<HASH> 100644 --- a/daemon_windows.go +++ b/daemon_windows.go @@ -65,6 +65,30 @@ func (windows *windowsRecord) Install(args ...string) (string, error) { } defer s.Close() + // set recovery action for service + // restart after 5 seconds for the first 3 times + // restart after 1 minute, otherwise + r := []mgr.RecoveryAction{ + mgr.RecoveryAction{ + Type: mgr.ServiceRestart, + Delay: 5000 * time.Millisecond, + }, + mgr.RecoveryAction{ + Type: mgr.ServiceRestart, + Delay: 5000 * time.Millisecond, + }, + mgr.RecoveryAction{ + Type: mgr.ServiceRestart, + Delay: 5000 * time.Millisecond, + }, + mgr.RecoveryAction{ + Type: mgr.ServiceRestart, + Delay: 60000 * time.Millisecond, + }, + } + // set reset period as a day + s.SetRecoveryActions(r, uint32(86400)) + return installAction + " completed.", nil }
Add: set recovery action for windows service
takama_daemon
train
go
49860a858af9ba68fc332ef914ae650c843e62d4
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -29,7 +29,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "1.5" +DEFAULT_VERSION = "1.4.1" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '1.5' +__version__ = '1.4.1'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py,py
b27c3cce5f7ee961a3cbc15b4da2a17971b5dc82
diff --git a/puzzle/plugins/vcf.py b/puzzle/plugins/vcf.py index <HASH>..<HASH> 100644 --- a/puzzle/plugins/vcf.py +++ b/puzzle/plugins/vcf.py @@ -24,6 +24,9 @@ class VcfPlugin(Plugin): def __init__(self): super(VcfPlugin, self).__init__() + self.db = None + self.individuals = None + self.case_obj = None def init_app(self, app): """Initialize plugin via Flask.""" @@ -36,11 +39,8 @@ class VcfPlugin(Plugin): )) self.pattern = app.config['PUZZLE_PATTERN'] - self.db = None - self.individuals = None - self.case_obj = None - if app.config['FAMILY_FILE']: + if app.config.get('FAMILY_FILE'): #If ped file we know there is only one vcf self.db = app.config['PUZZLE_ROOT'].replace('/', '|') self.individuals = self._get_family_individuals(
Fixed problem when FAMILY_FILE does not exist in config
robinandeer_puzzle
train
py
b01fa56028e5bc18e4f7ef1782c045a77ccb3dc3
diff --git a/src/discover.js b/src/discover.js index <HASH>..<HASH> 100644 --- a/src/discover.js +++ b/src/discover.js @@ -14,26 +14,19 @@ var SETTINGS_KEY = 'remotestorage:discover'; var cachedInfo = {}; /** - * Class: Discover - * * This function deals with the Webfinger lookup, discovering a connecting * user's storage details. * * The discovery timeout can be configured via * `config.discoveryTimeout` (in ms). * - * Arguments: - * - * userAddress - user@host - * - * Returns: - * - * A promise for an object with the following properties. + * @param {string} userAddress - user@host * - * href - Storage base URL, - * storageType - Storage type, - * authUrl - OAuth URL, - * properties - Webfinger link properties + * @returns {Promise} A promise for an object with the following properties. + * href - Storage base URL, + * storageType - Storage type, + * authUrl - OAuth URL, + * properties - Webfinger link properties **/ const Discover = function Discover(userAddress) {
Convert discover to JSDoc comments
remotestorage_remotestorage.js
train
js
05478166baffe2ca7a4fbceb4d898824a59c849d
diff --git a/packages/pob-release/index.js b/packages/pob-release/index.js index <HASH>..<HASH> 100644 --- a/packages/pob-release/index.js +++ b/packages/pob-release/index.js @@ -20,10 +20,6 @@ const availableVersions = [ 'minor', 'major', 'manual', - 'premajor', - 'preminor', - 'prepatch', - 'prerelease', ]; const packageJson = JSON.parse(readFileSync('./package.json'));
feat: remove useless premajor, preminor, prepatch and prerelease
christophehurpeau_pob-lerna
train
js
61d3013c8bd768aee89df11d776fab660124e10c
diff --git a/lib/phpunit/bootstrap.php b/lib/phpunit/bootstrap.php index <HASH>..<HASH> 100644 --- a/lib/phpunit/bootstrap.php +++ b/lib/phpunit/bootstrap.php @@ -196,9 +196,6 @@ if (PHPUNIT_UTIL) { return; } -// make sure tests do not run in parallel -phpunit_util::acquire_test_lock(); - // is database and dataroot ready for testing? list($errorcode, $message) = phpunit_util::testing_ready_problem(); if ($errorcode) { diff --git a/lib/setup.php b/lib/setup.php index <HASH>..<HASH> 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -463,8 +463,10 @@ setup_validate_php_configuration(); // Connect to the database setup_DB(); -// reset DB tables if (PHPUNIT_TEST and !PHPUNIT_UTIL) { + // make sure tests do not run in parallel + phpunit_util::acquire_test_lock(); + // reset DB tables phpunit_util::reset_database(); }
MDL-<I> fix concurrent run collision caused by setup reset
moodle_moodle
train
php,php
c855d378c857fed6dbba941eff3b2ee3debdfa2b
diff --git a/sprd/window/MessageDialogClass.js b/sprd/window/MessageDialogClass.js index <HASH>..<HASH> 100644 --- a/sprd/window/MessageDialogClass.js +++ b/sprd/window/MessageDialogClass.js @@ -9,7 +9,7 @@ define(["xaml!js/ui/Dialog"], function (Dialog) { }, _closeDialog: function (button) { - this.close(button); + this.close(button.confirm); } }); }); \ No newline at end of file
DEV-<I> - Switching product type provides error
spreadshirt_rAppid.js-sprd
train
js
b8c1e5393e8c7f087a7f79158d04f314f00422d0
diff --git a/Schema/SchemaState.php b/Schema/SchemaState.php index <HASH>..<HASH> 100644 --- a/Schema/SchemaState.php +++ b/Schema/SchemaState.php @@ -58,7 +58,7 @@ abstract class SchemaState $this->files = $files ?: new Filesystem; $this->processFactory = $processFactory ?: function (...$arguments) { - return Process::fromShellCommandline(...$arguments); + return Process::fromShellCommandline(...$arguments)->setTimeout(null); }; $this->handleOutputUsing(function () {
Update SchemaState Process to remove timeout (#<I>) As shown in Symphony Process docs: <URL> is an issue. Removing the timeout is great because running migrations could be seen as a long lived process by most users and developers.
illuminate_database
train
php
f8587c8377c07b4ae3af0c6a38d51ee390bdaaf4
diff --git a/sandbox_store.go b/sandbox_store.go index <HASH>..<HASH> 100644 --- a/sandbox_store.go +++ b/sandbox_store.go @@ -128,6 +128,12 @@ func (sb *sandbox) storeUpdate() error { retry: sbs.Eps = nil for _, ep := range sb.getConnectedEndpoints() { + // If the endpoint is not persisted then do not add it to + // the sandbox checkpoint + if ep.Skip() { + continue + } + eps := epState{ Nid: ep.getNetwork().ID(), Eid: ep.ID(),
Skip non-persistent endpoints in sandbox store If the endpoint and the corresponding network is not persistent then skip adding it into sandbox store.
docker_libnetwork
train
go
397bff23b3edd57cf39622b16f0908eafeb35d26
diff --git a/src/Generator.php b/src/Generator.php index <HASH>..<HASH> 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -4,6 +4,7 @@ namespace L5Swagger; use File; use Config; +use Swagger\Annotations\Server; class Generator { @@ -24,7 +25,16 @@ class Generator $swagger = \Swagger\scan($appDir, ['exclude' => $excludeDirs]); if (config('l5-swagger.paths.base') !== null) { - $swagger->basePath = config('l5-swagger.paths.base'); + $isVersion3 = version_compare(config('l5-swagger.swagger_version'), '3.0', '>='); + if ($isVersion3) { + $swagger->servers = [ + new Server(['url' => config('l5-swagger.paths.base')]), + ]; + } + + if (! $isVersion3) { + $swagger->basePath = config('l5-swagger.paths.base'); + } } $filename = $docDir.'/'.config('l5-swagger.paths.docs_json', 'api-docs.json');
OAS <I> uses servers specification instead of basePath (#<I>)
DarkaOnLine_L5-Swagger
train
php
7838c0de31981318ad7f5d6e7ee0c7f1ccd6d460
diff --git a/packages/@vue/cli-plugin-unit-mocha/setup.js b/packages/@vue/cli-plugin-unit-mocha/setup.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-plugin-unit-mocha/setup.js +++ b/packages/@vue/cli-plugin-unit-mocha/setup.js @@ -4,3 +4,5 @@ require('jsdom-global')(undefined, { pretendToBeVisual: true, url: 'http://local window.Date = Date // https://github.com/vuejs/vue-next/pull/2943 global.ShadowRoot = window.ShadowRoot + +global.SVGElement = window.SVGElement
fix(mocha): workaround the SVGElement issue in Vue (#<I>) related to <URL>
vuejs_vue-cli
train
js
26307869328d28aba3629115adc59077b007a942
diff --git a/src/XR.js b/src/XR.js index <HASH>..<HASH> 100644 --- a/src/XR.js +++ b/src/XR.js @@ -478,6 +478,15 @@ class XRInputSource { } module.exports.XRInputSource = XRInputSource; +class XRRay { + constructor() { + this.origin = new GlobalContext.DOMPoint(0, 0, 0, 1); + this.direction = new GlobalContext.DOMPoint(0, 0, 1, 0); + this.transformMatrix = Float32Array.from([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); + } +} +module.exports.XRRay = XRRay; + class XRInputPose { constructor() { this.emulatedPosition = false; diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -1467,6 +1467,7 @@ const _makeWindow = (options = {}, parent = null, top = null) => { window.XRViewport = XR.XRViewport; window.XRDevicePose = XR.XRDevicePose; window.XRInputSource = XR.XRInputSource; + window.XRRay = XR.XRRay; window.XRInputPose = XR.XRInputPose; window.XRInputSourceEvent = XR.XRInputSourceEvent; window.XRCoordinateSystem = XR.XRCoordinateSystem;
Add new XRRay to XR.js
exokitxr_exokit
train
js,js
aef6c207238fb0502eaa8a4cbe394ef3f31ead49
diff --git a/cacti/tests/common.py b/cacti/tests/common.py index <HASH>..<HASH> 100644 --- a/cacti/tests/common.py +++ b/cacti/tests/common.py @@ -29,7 +29,7 @@ INSTANCE_INTEGRATION = { E2E_METADATA = { 'start_commands': [ 'apt-get update', - 'apt-get install rrdtool librrd-dev libpython-dev build-essential -y', + 'apt-get install rrdtool librrd-dev libpython2-dev build-essential -y', 'pip install rrdtool', ] }
Fix tests by installing libpython2-dev instead of libpython-dev (#<I>)
DataDog_integrations-core
train
py
29c42b2b53eb27f65ad5f9406b2a827cbfed1f46
diff --git a/xibless/view.py b/xibless/view.py index <HASH>..<HASH> 100644 --- a/xibless/view.py +++ b/xibless/view.py @@ -1,3 +1,5 @@ +from __future__ import division + from collections import namedtuple, defaultdict from .base import GeneratedItem, Literal @@ -82,7 +84,8 @@ class View(GeneratedItem): else: x = ox + ow + margin if side in (Pack.Left, Pack.Right): - y = oy + # Align the widget "Y-middles" instead of "Y-lows" + y = oy + ((oh-h) / 2) elif side == Pack.Above: y = oy + oh + margin else:
When doing horizontal relative packing, align Y "middle points" instead of Y "low points".
hsoft_xibless
train
py
29dbf9724fc3a1d30d22bca35911d5e53a4a150a
diff --git a/libraries/lithium/tests/cases/core/LibrariesTest.php b/libraries/lithium/tests/cases/core/LibrariesTest.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/tests/cases/core/LibrariesTest.php +++ b/libraries/lithium/tests/cases/core/LibrariesTest.php @@ -15,8 +15,16 @@ use lithium\core\Libraries; class LibrariesTest extends \lithium\test\Unit { + protected $_cache = array(); + + public function setUp() { + $this->_cache = Libraries::cache(); + Libraries::cache(false); + } + public function tearDown() { Libraries::cache(false); + Libraries::cache($this->_cache); } public function testNamespaceToFileTranslation() {
Adding class cache management to test case of `\core\Libraries`
UnionOfRAD_framework
train
php
17edd02733e3fbfbd3d406984b6aacbe51602e65
diff --git a/core/src/main/java/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java b/core/src/main/java/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java +++ b/core/src/main/java/io/undertow/server/handlers/accesslog/DefaultAccessLogReceiver.java @@ -166,7 +166,7 @@ public class DefaultAccessLogReceiver implements AccessLogReceiver, Runnable, Cl } try { if (writer == null) { - writer = new BufferedWriter(new FileWriter(defaultLogFile)); + writer = new BufferedWriter(new FileWriter(defaultLogFile, true)); } for (String message : messages) { writer.write(message);
UNDERTOW-<I> Current access.log file gets overwritten if the server is restarted
undertow-io_undertow
train
java
ce0b58d57eea809008eb8a983ec9d2c9bf76e65c
diff --git a/octodns/provider/cloudflare.py b/octodns/provider/cloudflare.py index <HASH>..<HASH> 100644 --- a/octodns/provider/cloudflare.py +++ b/octodns/provider/cloudflare.py @@ -36,7 +36,7 @@ class CloudflareProvider(BaseProvider): ''' SUPPORTS_GEO = False # TODO: support SRV - UNSUPPORTED_TYPES = ('NAPTR', 'PTR', 'SOA', 'SRV', 'SSHFP') + UNSUPPORTED_TYPES = ('ALIAS', 'NAPTR', 'PTR', 'SOA', 'SRV', 'SSHFP') MIN_TTL = 120 TIMEOUT = 15 diff --git a/octodns/provider/route53.py b/octodns/provider/route53.py index <HASH>..<HASH> 100644 --- a/octodns/provider/route53.py +++ b/octodns/provider/route53.py @@ -173,7 +173,7 @@ class Route53Provider(BaseProvider): self._health_checks = None def supports(self, record): - return record._type != 'SSHFP' + return record._type not in ('ALIAS', 'SSHFP') @property def r53_zones(self):
Quick-fix disable ALIAS for Route<I> & Cloudflare Cloudflare could potentially support it, but their details are different enough that i'll need to be looked into specifically later.
github_octodns
train
py,py
fcce1d4f3010bf1de65820232cd6fff9eb886f9f
diff --git a/lib/riot-mongoid/has_association.rb b/lib/riot-mongoid/has_association.rb index <HASH>..<HASH> 100644 --- a/lib/riot-mongoid/has_association.rb +++ b/lib/riot-mongoid/has_association.rb @@ -4,7 +4,7 @@ module RiotMongoid def evaluate(model, *association_macro_info) assoc_type, assoc_name, options = association_macro_info - assoc = model.associations[assoc_name.to_s] + assoc = model.relations[assoc_name.to_s] options ||= {} if assoc_name.nil? fail("association name and potential options must be specified with this assertion macro") @@ -17,4 +17,4 @@ module RiotMongoid end end end -end \ No newline at end of file +end
update association macros for rc<I>
thumblemonks_riot-mongoid
train
rb
fcd675826b6be1c26a07e20418ca1569c260b8e8
diff --git a/lib/lwm2m-common.js b/lib/lwm2m-common.js index <HASH>..<HASH> 100644 --- a/lib/lwm2m-common.js +++ b/lib/lwm2m-common.js @@ -66,8 +66,11 @@ class Resource { } toValue() { + if (this.isExecutable()) { + return undefined; + } if (typeof(this.value) === 'function') { - return this.value.apply(this); + return Resource.from(this.value.apply(this)).value; } return this.value; } @@ -181,7 +184,7 @@ class Resource { return { type: LWM2M_TYPE.toString(this.type), acl: this.acl, - value: this.value + value: this.toValue() }; }
Fix an issue where a function value cannot be evaluated on creating a JSON string from a resource value
CANDY-LINE_node-red-contrib-lwm2m
train
js
8166bdc2e6f57232edffe5dd0dc354840f2b2245
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -77,7 +77,7 @@ end # Convert a resource into the corresponding BlockScore class. def resource_to_class(resource) - Kernel.const_get "BlockScore::#{resource.camelcase}" + Kernel.const_get "BlockScore::#{resource.camelcase.to_sym}" end module ResourceTest
<I> compatibility with const_get
BlockScore_blockscore-ruby
train
rb
167b92c2b7ed1029f96c8fce6173c9ac39d4ad5b
diff --git a/core.js b/core.js index <HASH>..<HASH> 100644 --- a/core.js +++ b/core.js @@ -991,17 +991,6 @@ class FakeDisplay extends MRDisplay { frameData.rightProjectionMatrix.set(this._projectionMatrix); } } */ -/* class MLMesh { - constructor() { - this.positions = new Float32Array(9); - this.normals = Float32Array.from([ - 0, 1, 0, - 0, 1, 0, - 0, 1, 0, - ]); - this.indices = Uint32Array.from([0, 1, 2]); - } -} */ class MLDisplay extends MRDisplay { constructor(window, displayId) { super('ML', window, displayId);
Remove dead MLMesh class from core
exokitxr_exokit
train
js
292f00d403e923ecc15c2f93b8caf9071d5c1ec6
diff --git a/aws/resource_aws_route53recoveryreadiness_resource_set.go b/aws/resource_aws_route53recoveryreadiness_resource_set.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_route53recoveryreadiness_resource_set.go +++ b/aws/resource_aws_route53recoveryreadiness_resource_set.go @@ -47,17 +47,6 @@ func resourceAwsRoute53RecoveryReadinessResourceSet() *schema.Resource { Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "resource_arn": { - Type: schema.TypeString, - Optional: true, - }, - "readiness_scopes": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, "component_id": { Type: schema.TypeString, Computed: true, @@ -126,6 +115,17 @@ func resourceAwsRoute53RecoveryReadinessResourceSet() *schema.Resource { }, }, }, + "readiness_scopes": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "resource_arn": { + Type: schema.TypeString, + Optional: true, + }, }, }, },
r/r<I>recread_resource_set: Order args
terraform-providers_terraform-provider-aws
train
go
98fc2ebe26f4e744cc9a668c90497627e04efbc8
diff --git a/src/S3/BatchDelete.php b/src/S3/BatchDelete.php index <HASH>..<HASH> 100644 --- a/src/S3/BatchDelete.php +++ b/src/S3/BatchDelete.php @@ -69,9 +69,11 @@ class BatchDelete implements PromisorInterface $fn = function (BatchDelete $that) use ($iter) { return $iter->each(function ($result) use ($that) { $promises = []; - foreach ($result['Contents'] as $object) { - if ($promise = $that->enqueue($object)) { - $promises[] = $promise; + if (is_array($results['Contents'])) { + foreach ($result['Contents'] as $object) { + if ($promise = $that->enqueue($object)) { + $promises[] = $promise; + } } } return $promises ? Promise\all($promises) : null;
Fix warning when doing batch delete and there are no object in S3 bucket
aws_aws-sdk-php
train
php
749a970f06b5309018350fbe2d597f605a436691
diff --git a/discovery/v1-experimental.js b/discovery/v1-experimental.js index <HASH>..<HASH> 100644 --- a/discovery/v1-experimental.js +++ b/discovery/v1-experimental.js @@ -115,7 +115,8 @@ DiscoveryV1Experimental.prototype.query = function(params, callback) { url: '/v1/environments/{environment_id}/collections/{collection_id}/query', method: 'GET', json: true, - qs: pick(params,['filter', 'aggregation', 'return', 'count']) + path: pick(params, ['environment_id', 'collection_id']), + qs: pick(params,['filter', 'aggregation', 'return', 'count', 'offset', 'query']) }, requiredParams: ['environment_id', 'collection_id'], defaultOptions: this._options
Fix tests and add query param Missed the param named `query` and fix the tests
watson-developer-cloud_node-sdk
train
js
929c618742189c661922ca80e238d2ca4226f3a6
diff --git a/spec/support/profiling.rb b/spec/support/profiling.rb index <HASH>..<HASH> 100644 --- a/spec/support/profiling.rb +++ b/spec/support/profiling.rb @@ -1,14 +1,15 @@ -require 'benchmark' -require 'method_profiler' - module SpecSupport def benchmark(&block) + require 'benchmark' + puts "Benchmark:" puts Benchmark.measure(&block) end def profile_methods + require 'method_profiler' + profiler = MethodProfiler.observe(Wasabi::Parser) yield puts profiler.report
only load profiling libs when they're needed
savonrb_wasabi
train
rb
584ed9b2c4a51170c338836ede2ba94b33d59c9b
diff --git a/test/e2e/downwardapi_volume.go b/test/e2e/downwardapi_volume.go index <HASH>..<HASH> 100644 --- a/test/e2e/downwardapi_volume.go +++ b/test/e2e/downwardapi_volume.go @@ -156,7 +156,7 @@ func downwardAPIVolumePod(name string, labels, annotations map[string]string, fi { Name: "client-container", Image: "gcr.io/google_containers/mounttest:0.6", - Command: []string{"/mt", "--break_on_expected_content=false", "--retry_time=10", "--file_content_in_loop=" + filePath}, + Command: []string{"/mt", "--break_on_expected_content=false", "--retry_time=120", "--file_content_in_loop=" + filePath}, VolumeMounts: []api.VolumeMount{ { Name: "podinfo",
rising timeout for mount-tester image
kubernetes_kubernetes
train
go
f3f5abfb4e112d064c43555889178cddd62ae763
diff --git a/SoftLayer/CLI/block/detail.py b/SoftLayer/CLI/block/detail.py index <HASH>..<HASH> 100644 --- a/SoftLayer/CLI/block/detail.py +++ b/SoftLayer/CLI/block/detail.py @@ -34,7 +34,7 @@ def cli(env, volume_id): if block_volume.get('storageTierLevel'): table.add_row([ 'Endurance Tier', - block_volume['storageTierLevel']['description'], + block_volume['storageTierLevel'], ]) table.add_row([ diff --git a/SoftLayer/CLI/file/detail.py b/SoftLayer/CLI/file/detail.py index <HASH>..<HASH> 100644 --- a/SoftLayer/CLI/file/detail.py +++ b/SoftLayer/CLI/file/detail.py @@ -43,7 +43,7 @@ def cli(env, volume_id): if file_volume.get('storageTierLevel'): table.add_row([ 'Endurance Tier', - file_volume['storageTierLevel']['description'], + file_volume['storageTierLevel'], ]) table.add_row([
storageTierLevel->description isn't a thing anymore
softlayer_softlayer-python
train
py,py
479c0732df288d7b1fa96f4177aead9f135ac885
diff --git a/examples/helloworld.py b/examples/helloworld.py index <HASH>..<HASH> 100644 --- a/examples/helloworld.py +++ b/examples/helloworld.py @@ -13,12 +13,6 @@ def main(): # use first device to do some tests lmn.set_device(devices[0]) - # obtain all registered devices from the LaMetric cloud - devices = lmn.get_devices() - - # select the first device for interaction - lmn.set_device(devices[0]) - # prepare a simple frame with an icon and some text sf = SimpleFrame("i210", "Hello World!")
removed duplicate lines (same as in README)
keans_lmnotify
train
py
2dff7165092f3edb4c64e2ebcd197574725c95e8
diff --git a/porespy/tools/__utils__.py b/porespy/tools/__utils__.py index <HASH>..<HASH> 100644 --- a/porespy/tools/__utils__.py +++ b/porespy/tools/__utils__.py @@ -6,6 +6,19 @@ from loguru import logger from tqdm import tqdm +def _is_ipython_notebook(): + try: + shell = get_ipython().__class__.__name__ + if shell == 'ZMQInteractiveShell': + return True # Jupyter notebook or qtconsole + elif shell == 'TerminalInteractiveShell': + return False # Terminal running IPython + else: + return False # Other type (?) + except NameError: + return False # Probably standard Python interpreter + + def config_logger(fmt, loglevel): # pragma: no cover r""" Configures loguru logger with the given format and log level. @@ -73,7 +86,7 @@ class Settings: # pragma: no cover '<level>{level: <8}</level> | ' \ '<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan>' \ '\n--> <level>{message}</level>' - _loglevel = "INFO" + _loglevel = "ERROR" if _is_ipython_notebook() else "INFO" config_logger(_logger_fmt, _loglevel) @property
Changed default loglevel to ERROR when operating in notebooks
PMEAL_porespy
train
py
1db13d91d7e6256e932857fb3b5bb6688ce0f480
diff --git a/blueprints/ember-flexberry/index.js b/blueprints/ember-flexberry/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-flexberry/index.js +++ b/blueprints/ember-flexberry/index.js @@ -248,9 +248,14 @@ module.exports = { }).then(function() { return _this.addBowerPackageToProject('semantic-ui','git://github.com/Flexberry/Semantic-UI.git#fixed-abort'); }).then(function() { + return _this.addAddonToProject({ name: 'ember-moment', target: '6.0.0' }).catch(function () { + return _this.removePackageFromProject('ember-cli-moment-shim').then(function () { + return _this.addAddonToProject({ name: 'ember-cli-moment-shim', target: '2.2.1' }); + }); + }); + }).then(function() { return _this.addAddonsToProject({ packages: [ - { name: 'ember-moment', target: '6.0.0' }, { name: 'ember-link-action', target: '0.0.34' }, { name: 'ember-cli-less', target: '1.5.4' }, { name: 'broccoli-jscs', target: '1.2.2' },
Fix install ember-moment in addon blueprint (#<I>)
Flexberry_ember-flexberry
train
js
3201723f105d25d6424c52a98cd07b31ccd965ae
diff --git a/contao/dca/tl_metamodel_searchable_pages.php b/contao/dca/tl_metamodel_searchable_pages.php index <HASH>..<HASH> 100644 --- a/contao/dca/tl_metamodel_searchable_pages.php +++ b/contao/dca/tl_metamodel_searchable_pages.php @@ -203,7 +203,6 @@ $GLOBALS['TL_DCA']['tl_metamodel_searchable_pages'] = array 'eval' => array ( 'includeBlankOption' => true, - 'mandatory' => true, 'chosen' => true ) ),
Remove mandatory from setFilter.
MetaModels_core
train
php
ae1d2b3173876e7062324aa61398fef9d0f59f79
diff --git a/test/data/event/partialLoadReady.php b/test/data/event/partialLoadReady.php index <HASH>..<HASH> 100644 --- a/test/data/event/partialLoadReady.php +++ b/test/data/event/partialLoadReady.php @@ -1,8 +1,8 @@ <?php //try very hard to disable output buffering -@ini_set("output_buffering", 0); -@apache_setenv("no-gzip", 1); -@ini_set("zlib.output_compression", 0); +//@ini_set("output_buffering", 0); +//@apache_setenv("no-gzip", 1); +//@ini_set("zlib.output_compression", 0); ob_start(); ?>
Neuter the partialLoadReady test until it's ngnix-ready
jquery_jquery
train
php
a922cd5afa816a45f7cc6db695db47438b87198e
diff --git a/tests/integration-tests/flake8_test.py b/tests/integration-tests/flake8_test.py index <HASH>..<HASH> 100644 --- a/tests/integration-tests/flake8_test.py +++ b/tests/integration-tests/flake8_test.py @@ -52,13 +52,13 @@ def test_smoke_flake8_v3(venv_flake8_v3): assert_service_messages( output, [ - ServiceMessage('testStarted', {'name': test2_name}), - ServiceMessage('testFailed', {'name': test2_name, 'message': "W391 blank line at end of file"}), - ServiceMessage('testFinished', {'name': test2_name}), - ServiceMessage('testStarted', {'name': test1_name}), ServiceMessage('testFailed', {'name': test1_name, 'message': "E302 expected 2 blank lines, found 1"}), ServiceMessage('testFinished', {'name': test1_name}), + + ServiceMessage('testStarted', {'name': test2_name}), + ServiceMessage('testFailed', {'name': test2_name, 'message': "W391 blank line at end of file"}), + ServiceMessage('testFinished', {'name': test2_name}), ])
Reverse expected output in flake8 v3 tests I guess upgrading to flake8==<I> caused the output order to change?
JetBrains_teamcity-messages
train
py
79e5027893a53b925923016607a35c9fa3ebac79
diff --git a/python/orca/test/bigdl/orca/tfpark/test_tf_dataset.py b/python/orca/test/bigdl/orca/tfpark/test_tf_dataset.py index <HASH>..<HASH> 100644 --- a/python/orca/test/bigdl/orca/tfpark/test_tf_dataset.py +++ b/python/orca/test/bigdl/orca/tfpark/test_tf_dataset.py @@ -326,6 +326,15 @@ class TestTFDataset(ZooTestCase): metrics=['accuracy']) model = KerasModel(seq) model.fit(dataset) + dataset = TFDataset.from_dataframe(val_df, + feature_cols=["feature"], + batch_per_thread=32) + model.predict(dataset).collect() + dataset = TFDataset.from_dataframe(val_df, + feature_cols=["feature"], + labels_cols=["label"], + batch_per_thread=32) + model.evaluate(dataset) if __name__ == "__main__":
Follow up supporting DataFrame in TFDataset (#<I>) * Fix TFDataset.from_dataframe * clean up
intel-analytics_BigDL
train
py
096880749936c55988dcbeaa0ef7d67b148509d3
diff --git a/lib/cli.rb b/lib/cli.rb index <HASH>..<HASH> 100644 --- a/lib/cli.rb +++ b/lib/cli.rb @@ -1,7 +1,11 @@ require 'rubygems' require 'thor' require 'appium_console/version' -require 'appium_lib/common/version' +begin + require 'appium_lib/common/version' +rescue LoadError + require 'appium_lib/version' +end require 'erb' require 'appium_console'
Fix LoadError Ref [refactor: re-struct directories](<URL>)
appium_ruby_console
train
rb
53934bd0a9f3db966f8301686a0228f6fa41d217
diff --git a/mod/data/lib.php b/mod/data/lib.php index <HASH>..<HASH> 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -3654,6 +3654,11 @@ function data_get_all_recordids($dataid, $selectdata = '', $params = null) { * @return array $recordids An array of record ids. */ function data_get_advance_search_ids($recordids, $searcharray, $dataid) { + // Check to see if we have any record IDs. + if (empty($recordids)) { + // Send back an empty search. + return array(); + } $searchcriteria = array_keys($searcharray); // Loop through and reduce the IDs one search criteria at a time. foreach ($searchcriteria as $key) {
MDL-<I> mod_data: Show no records message instead of error. When there are no records in the database module and a user does an advanced search. Show a message that there are no entries in the database.
moodle_moodle
train
php
39ce96284339b75347412932e34b4a31995d4a84
diff --git a/spec/DependencyInjection/GesdinetJWTRefreshTokenExtensionSpec.php b/spec/DependencyInjection/GesdinetJWTRefreshTokenExtensionSpec.php index <HASH>..<HASH> 100644 --- a/spec/DependencyInjection/GesdinetJWTRefreshTokenExtensionSpec.php +++ b/spec/DependencyInjection/GesdinetJWTRefreshTokenExtensionSpec.php @@ -33,7 +33,7 @@ class GesdinetJWTRefreshTokenExtensionSpec extends ObjectBehavior return new \ReflectionClass($args[0]); }); $container->addResource(Argument::any())->willReturn(null); - $container->addRemovedBindingIds(Argument::any())->willReturn(null); + $container->removeBindings(Argument::any())->willReturn(null); $container->removeBindings(Argument::any())->will(function () { });
Fix test (#<I>)
gesdinet_JWTRefreshTokenBundle
train
php