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
bd12da37a2163258422630641cdb237e8f8668e4
diff --git a/pandasdmx/api.py b/pandasdmx/api.py index <HASH>..<HASH> 100644 --- a/pandasdmx/api.py +++ b/pandasdmx/api.py @@ -59,11 +59,24 @@ class Request: def __getattr__(self, name): """Convenience methods.""" - return partial(self.get, Resource[name]) + try: + # Provide resource_type as a positional argument, so that the + # first positional argument to the convenience method is treated as + # resource_id + func = partial(self.get, Resource[name]) + except KeyError: + raise AttributeError + else: + # Modify the docstring to explain the argument fixed by the + # convenience method + func.__doc__ = self.get.__doc__.replace( + '.\n', + f' with resource_type={repr(name)}.\n', 1) + return func def __dir__(self): """Include convenience methods in dir().""" - return sorted(super().__dir__() + [ep.name for ep in Resource]) + return super().__dir__() + [ep.name for ep in Resource] def clear_cache(self): self.cache.clear()
(Re-)enable IPython tab completion of Request convenience methods (#<I>) * Remove redundant sort in Request.__dir__() * Modify Request.__getattr__ for IPython tab completion - Add a docstring to the convenience method for e.g. 'req.codelist?' in IPython. - Re-raise KeyError as AttributeError, as required by Python data model.
dr-leo_pandaSDMX
train
py
45dbc9e02056c62d795063c281e1f76162e3a3af
diff --git a/packages/react/src/components/Tile/Tile.js b/packages/react/src/components/Tile/Tile.js index <HASH>..<HASH> 100644 --- a/packages/react/src/components/Tile/Tile.js +++ b/packages/react/src/components/Tile/Tile.js @@ -124,6 +124,7 @@ export class ClickableTile extends Component { } = this.props; const classes = classNames( + `${prefix}--link`, `${prefix}--tile`, `${prefix}--tile--clickable`, {
fix(tile): add link class to clickable tile (#<I>)
carbon-design-system_carbon-components
train
js
b13754debb71194ceb3c99b179a4ebc2f5d3947b
diff --git a/stream-promise.js b/stream-promise.js index <HASH>..<HASH> 100644 --- a/stream-promise.js +++ b/stream-promise.js @@ -28,6 +28,7 @@ class StreamPromise extends FunStream { this[STREAM] = new PassThrough(Object.assign({objectMode: true}, this[OPTS])) this[PROMISE].then(promised => { const srcStream = fun(is.plainObject(promised) ? [promised] : promised) + if (promised == null) srcStream.end() return StreamPromise.isFun(srcStream) ? srcStream.pipe(this) : this.pipe(srcStream) }).catch(err => this.emit('error', err)) }
fix(stream-promise): empty promises should end their streams
iarna_funstream
train
js
00d4b697967125c4e074469125c930b84edc90ff
diff --git a/hydpy/auxs/anntools.py b/hydpy/auxs/anntools.py index <HASH>..<HASH> 100644 --- a/hydpy/auxs/anntools.py +++ b/hydpy/auxs/anntools.py @@ -6,10 +6,6 @@ A note for developers: some of the implemented features are to be applied during model simulations are in some other way performance-critical. Hence, the actual calculations are defined in the Cython extension module |annutils|. - ->>> from hydpy import pub ->>> pub.options.reprdigits = 6 - """ # import... @@ -843,6 +839,9 @@ parameter `ann` of element `?` has not been defined so far. pyplot.plot(xs_, ys_, **kwargs) +__test__ = {'ANN.weights_input': ANN.weights_input.__doc__} + + abctools.ParameterABC.register(ANN) abctools.ANNABC.register(ANN)
Include doctest of `ANN.weights_input` manually.
hydpy-dev_hydpy
train
py
6f0149d51d435c3d4dc7d979efdd55e93f8a8e41
diff --git a/spotinst/config.go b/spotinst/config.go index <HASH>..<HASH> 100644 --- a/spotinst/config.go +++ b/spotinst/config.go @@ -95,8 +95,8 @@ func SetAPIAddress(addr string) ClientOptionFunc { } } -// SetOauthAddress defines the address of the Spotinst OAuth API. -func SetOauthAddress(addr string) ClientOptionFunc { +// SetOAuthAddress defines the address of the Spotinst OAuth API. +func SetOAuthAddress(addr string) ClientOptionFunc { return func(c *clientConfig) { c.oauthAddress = addr }
spotinst/config: Rename SetOauthAddress to SetOAuthAddress
spotinst_spotinst-sdk-go
train
go
2ab7ad728953e16b0d359f68c842c4f122d1dba1
diff --git a/lang/lt/lang.php b/lang/lt/lang.php index <HASH>..<HASH> 100644 --- a/lang/lt/lang.php +++ b/lang/lt/lang.php @@ -27,6 +27,7 @@ 'states' => 'States', 'main_price_type' => 'Main price', 'price_include_tax' => 'Price includes taxes', + 'discount_price' => 'Discount price', ], 'menu' => [ 'main' => 'Catalog',
New translations lang.php (Lithuanian)
lovata_oc-shopaholic-plugin
train
php
1925ed49eae5192c360010a97ca5581bf7edacb5
diff --git a/src/main/java/net/mindengine/galen/parser/FileSyntaxException.java b/src/main/java/net/mindengine/galen/parser/FileSyntaxException.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/mindengine/galen/parser/FileSyntaxException.java +++ b/src/main/java/net/mindengine/galen/parser/FileSyntaxException.java @@ -15,8 +15,6 @@ ******************************************************************************/ package net.mindengine.galen.parser; -import java.io.PrintStream; -import java.io.PrintWriter; public class FileSyntaxException extends RuntimeException { @@ -53,19 +51,4 @@ public class FileSyntaxException extends RuntimeException { private String withFileInfo(String message) { return String.format("%s\n in %s:%d", message, filePath, line); } - - @Override - public void printStackTrace() { - printStackTrace(System.err); - } - - @Override - public void printStackTrace(PrintStream stream) { - stream.println("Error: " + getMessage()); - } - - @Override - public void printStackTrace(PrintWriter writer) { - writer.println("Error: " + getMessage()); - } }
Now printing the complete stacktrace in case of errors in spec file
galenframework_galen
train
java
637555fdf6285c8077297f326760d9d8a5112f28
diff --git a/tests/AnsiTest.php b/tests/AnsiTest.php index <HASH>..<HASH> 100644 --- a/tests/AnsiTest.php +++ b/tests/AnsiTest.php @@ -119,7 +119,7 @@ class AnsiTest extends TestBase $util = new UtilFactory($system); $this->cli->setUtil($util); - $this->shouldWrite("\e[m\e[32mI am green\e[0m\e[0m"); + $this->output->shouldReceive('write')->times(1); $this->shouldHavePersisted(); $this->cli->out("<green>I am green</green>");
Fix the unit test to not depend on the specific environment
thephpleague_climate
train
php
7a84b135ba3ea525bf7c98717bc5a4a5b0c92d34
diff --git a/private/protocol/eventstream/eventstreamapi/transport.go b/private/protocol/eventstream/eventstreamapi/transport.go index <HASH>..<HASH> 100644 --- a/private/protocol/eventstream/eventstreamapi/transport.go +++ b/private/protocol/eventstream/eventstreamapi/transport.go @@ -5,6 +5,6 @@ package eventstreamapi import "github.com/aws/aws-sdk-go/aws/request" -// This is a no-op for Go 1.18 and above. +// ApplyHTTPTransportFixes is a no-op for Go 1.18 and above. func ApplyHTTPTransportFixes(r *request.Request) { }
eventstreamapi: fixup golint function docstring (#<I>) Fixes docstring for new ApplyHTTPTransportFixes function added to eventstreampapi package.
aws_aws-sdk-go
train
go
119ebcda7140c709a70c62eaa6ae9473bd6be873
diff --git a/tests/HTMLPurifier/SimpleTest/Reporter.php b/tests/HTMLPurifier/SimpleTest/Reporter.php index <HASH>..<HASH> 100644 --- a/tests/HTMLPurifier/SimpleTest/Reporter.php +++ b/tests/HTMLPurifier/SimpleTest/Reporter.php @@ -45,6 +45,16 @@ class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter return $css; } + function getTestList() { + // hacky; depends on a specific implementation of paintPass, etc. + $list = parent::getTestList(); + $testcase = $list[1]; + if (class_exists($testcase, false)) $file = str_replace('_', '/', $testcase) . '.php'; + else $file = $testcase; + $list[1] = '<a href="index.php?file=' . $file . '">' . $testcase . '</a>'; + return $list; + } + } // vim: et sw=4 sts=4
Implement user-friendly links to test-cases on web tester.
Masterjoa_HTMLPurifier-standalone
train
php
82c0e3c92d2aa75d42c3838493b42f40102677ac
diff --git a/geojson/utils.py b/geojson/utils.py index <HASH>..<HASH> 100644 --- a/geojson/utils.py +++ b/geojson/utils.py @@ -14,7 +14,7 @@ def coords(obj): if 'features' in obj: for f in obj['features']: # For Python 2 compatibility - # See https://www.reddit.com/r/learnpython/comments/4rc15s/yield_from_and_python_27/ + # See https://www.reddit.com/r/learnpython/comments/4rc15s/yield_from_and_python_27/ # noqa: E501 for c in coords(f): yield c else:
Attempt to fix flake8 error.
jazzband_python-geojson
train
py
5b962ab4c2c99dde4fef72f8158898f42a534f2d
diff --git a/assets/js/bootstrap-datepicker.js b/assets/js/bootstrap-datepicker.js index <HASH>..<HASH> 100644 --- a/assets/js/bootstrap-datepicker.js +++ b/assets/js/bootstrap-datepicker.js @@ -940,6 +940,9 @@ }, _toggle_multidate: function(date){ + if (this.o.multidate === false || this.o.multidate <= 1) + return; + var ix = this.dates.contains(date); if (!date){ this.dates.clear();
do not deselect date when on single date mode
mozarcik_yii-datepicker
train
js
1af510455597374362e102402298b6e4516f6ad6
diff --git a/src/aspectlib/__init__.py b/src/aspectlib/__init__.py index <HASH>..<HASH> 100644 --- a/src/aspectlib/__init__.py +++ b/src/aspectlib/__init__.py @@ -112,7 +112,13 @@ class Yield(object): def mimic(wrapper, func): try: wrapper.__name__ = func.__name__ + except (TypeError, AttributeError): + pass + try: wrapper.__module__ = func.__module__ + except (TypeError, AttributeError): + pass + try: wrapper.__doc__ = func.__doc__ except (TypeError, AttributeError): pass
Finer grained handling in mimic.
ionelmc_python-aspectlib
train
py
8283bf8058974d9935e2614e03bc58ced44a3713
diff --git a/lib/Opauth/OpauthStrategy.php b/lib/Opauth/OpauthStrategy.php index <HASH>..<HASH> 100644 --- a/lib/Opauth/OpauthStrategy.php +++ b/lib/Opauth/OpauthStrategy.php @@ -171,7 +171,7 @@ class OpauthStrategy{ $iteration = intval($iteration); if ($iteration <= 0) return false; - for ($i = 0; $i < $iteration; ++$i) $input = sha1($input.$salt.$timestamp); + for ($i = 0; $i < $iteration; ++$i) $input = base_convert(sha1($input.$salt.$timestamp), 16, 36); return $input; }
base_convert to <I> for each interations
opauth_opauth
train
php
597792c98861853d131f7042cc9809fbfa95ff18
diff --git a/lib/quote.rb b/lib/quote.rb index <HASH>..<HASH> 100644 --- a/lib/quote.rb +++ b/lib/quote.rb @@ -35,7 +35,7 @@ class Quote raise Invalid, 'Date too old' unless current_date @date = current_date rescue Sequel::DatabaseError => ex - if ex.wrapped_exception.is_a?(PG::DatetimeFieldOverflow) + if ex.wrapped_exception.is_a?(PG::DataException) raise Invalid, 'Invalid date' else raise
Update rescued exception The converter API allows the date as parameter and it needs to be rescued with an invalid date, and the exception is `PG::InvalidDatetimeFormat`, so the safest solution was to use the first ancestor of this exception which is the same one as the current `PG::DatetimeFieldOverflow`.
fixerAPI_fixer
train
rb
7d99ba8d62d11d73446294a22425f8d39dbb79b9
diff --git a/src/main/java/com/authlete/common/dto/AuthorizationResponse.java b/src/main/java/com/authlete/common/dto/AuthorizationResponse.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/authlete/common/dto/AuthorizationResponse.java +++ b/src/main/java/com/authlete/common/dto/AuthorizationResponse.java @@ -701,7 +701,7 @@ import com.authlete.common.util.Utils; */ public class AuthorizationResponse extends ApiResponse { - private static final long serialVersionUID = 3L; + private static final long serialVersionUID = 4L; /** @@ -771,6 +771,7 @@ public class AuthorizationResponse extends ApiResponse private Action action; + private Service service; private Client client; private Display display; private int maxAge; @@ -806,6 +807,34 @@ public class AuthorizationResponse extends ApiResponse /** + * Get the information about the service. + * + * @return + * Information about the service. + * + * @since 1.23 + */ + public Service getService() + { + return service; + } + + + /** + * Set the information about the service. + * + * @param service + * Information about the service. + * + * @since 1.23 + */ + public void setService(Service service) + { + this.service = service; + } + + + /** * Get the information about the client application which has made * the authorization request. *
Added 'service' to 'AuthorizationResponse'.
authlete_authlete-java-common
train
java
743a8041d79326a1fd1495ba8951d09a9321df0d
diff --git a/test/rails/integration_test.rb b/test/rails/integration_test.rb index <HASH>..<HASH> 100644 --- a/test/rails/integration_test.rb +++ b/test/rails/integration_test.rb @@ -3,17 +3,41 @@ require_relative "../test_helper" require "dummy/config/environment" require "rails/test_help" # adds stuff like @routes, etc. - # ActiveRecord::Schema.define do - # create_table :artists do |table| - # table.column :name, :string - # table.timestamps - # end - # end +require "haml" +require "haml/template" # Thanks, Nathan! + +#ActiveRecord::Schema.define do + # create_table :artists do |table| + # table.column :name, :string + # table.timestamps + # end + +# create_table :songs do |table| +# table.column :title, :string +# table.column :album_id, :integer +# end + +# create_table :albums do |table| +# table.column :title, :string +# end +# end class RailsTest < ActionController::TestCase tests MusicianController - test "bla" do - get :index + # test "bla" do + # get :index + # end + + # test "rendering 1-n" do + # get :album_new + # end +end + +class HasOneAndHasManyTest < ActionController::TestCase + tests AlbumsController + + test "rendering 1-1 and 1-n" do + get :new end end \ No newline at end of file
integration test is ready for @gogogarrett.
trailblazer_reform
train
rb
c460ee90835c13f3d1141421d9cc2dfb9b46a9a8
diff --git a/lib/redfish/executor.rb b/lib/redfish/executor.rb index <HASH>..<HASH> 100644 --- a/lib/redfish/executor.rb +++ b/lib/redfish/executor.rb @@ -15,8 +15,6 @@ module Redfish class Executor def exec(context, asadmin_command, args = [], options = {}) - raise 'args should be an array' unless args.is_a?(Array) - cmd = build_command(context, asadmin_command, args, options) Redfish.debug("Executing #{cmd.join(' ')}") @@ -37,6 +35,7 @@ module Redfish end def build_command(context, asadmin_command, args = [], options = {}) + raise 'args should be an array' unless args.is_a?(Array) cmd = []
Move args check to the correct location
realityforge_redfish
train
rb
13645327fee88a57d17b85ded57afa088414cb5f
diff --git a/Service/PathReducer.php b/Service/PathReducer.php index <HASH>..<HASH> 100644 --- a/Service/PathReducer.php +++ b/Service/PathReducer.php @@ -68,9 +68,7 @@ class PathReducer // Get first random vertex and second random vertex. We can't use getVertexOrder(Vertices::ORDER_RANDOM) because // it does not return (random) key. $firstVertexIndex = $secondVertexIndex = 0; - // Exclude the last vertex and the last edge, because they will always in the reproduce path (at the end). - while ($firstVertexIndex === $secondVertexIndex || ($firstVertexIndex === $path->countVertices() - 1) || - ($secondVertexIndex === $path->countVertices() - 1)) { + while ($firstVertexIndex === $secondVertexIndex) { $firstVertexIndex = array_rand($vertices); $secondVertexIndex = array_rand($vertices); }
Don't exclude the last vertex and the last edge. They are not necessary always in the reproduce path
tienvx_mbt-bundle
train
php
d37cefa323ba96d09f1024a7aa7c21c4cd115411
diff --git a/git_archive_all.py b/git_archive_all.py index <HASH>..<HASH> 100755 --- a/git_archive_all.py +++ b/git_archive_all.py @@ -161,7 +161,7 @@ class GitArchiver(object): def add_file(file_path, arcname): archive.add(file_path, arcname) else: - raise RuntimeError("unknown format: {0}".format(output_format)) + raise ValueError("unknown format: {0}".format(output_format)) def archiver(file_path, arcname): self.LOG.debug("Compressing {0} => {1}...".format(file_path, arcname))
Raise ValueError if output format is not recognized.
Kentzo_git-archive-all
train
py
e20fcad468a1f4043ca4eaa70d931e2519ada6e2
diff --git a/ryu/lib/packet/arp.py b/ryu/lib/packet/arp.py index <HASH>..<HASH> 100644 --- a/ryu/lib/packet/arp.py +++ b/ryu/lib/packet/arp.py @@ -14,6 +14,8 @@ # limitations under the License. import struct + +from ryu.ofproto import ether from . import packet_base ARP_HW_TYPE_ETHERNET = 1 # ethernet hardware type @@ -55,3 +57,10 @@ class arp(packet_base.PacketBase): self.hlen, self.plen, self.opcode, self.src_mac, self.src_ip, self.dst_mac, self.dst_ip) + + +def arp_ip(opcode, src_mac, src_ip, dst_mac, dst_ip): + return arp(ARP_HW_TYPE_ETHERNET, ether.ETH_TYPE_IP, + 6, # ether mac address length + 4, # ipv4 address length, + opcode, src_mac, src_ip, dst_mac, dst_ip)
lib/packet/arp.py: add convenience function to create arp for ip Since ip case is most often used, introduce a convenience function for that.
osrg_ryu
train
py
fd1228b2d7e58b9b630644deda790725e3a1982d
diff --git a/mpd/client.go b/mpd/client.go index <HASH>..<HASH> 100644 --- a/mpd/client.go +++ b/mpd/client.go @@ -545,23 +545,7 @@ func (c *Client) List(uri string) ([]string, error) { c.text.StartResponse(id) defer c.text.EndResponse(id) - ret := make([]string, 0) - for { - line, err := c.text.ReadLine() - if err != nil { - return nil, err - } - - i := strings.Index(line, ": ") - if i > 0 { - ret = append(ret, line[i+2:]) - } else if line == "OK" { - break - } else { - return nil, textproto.ProtocolError("can't parse line: " + line) - } - } - return ret, nil + return readAttrsList("file") } // Stored playlists related commands
switched to readAttrsList
fhs_gompd
train
go
db736317bc71f446eae2c5b86be750e1679f0a2f
diff --git a/Form/Admin/ShopFormBuilder.php b/Form/Admin/ShopFormBuilder.php index <HASH>..<HASH> 100755 --- a/Form/Admin/ShopFormBuilder.php +++ b/Form/Admin/ShopFormBuilder.php @@ -54,7 +54,7 @@ class ShopFormBuilder extends AbstractFormBuilder $requiredData->addChild($this->getElement('select', [ 'name' => 'theme', 'label' => $this->trans('shop.label.theme'), - 'options' => $this->get('theme.dataset')->getResult('select'), + 'options' => $this->get('theme.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('theme.repository')) ]));
Fixed ShopForm (cherry picked from commit d<I>b0ee5b<I>bc<I>ba2c<I>a0c0f<I>d9c<I>)
WellCommerce_WishlistBundle
train
php
ba2b52364fa47a62028e709f1239d291d4e28c0e
diff --git a/visidata/editor.py b/visidata/editor.py index <HASH>..<HASH> 100644 --- a/visidata/editor.py +++ b/visidata/editor.py @@ -11,6 +11,7 @@ class SuspendCurses: 'Context manager to leave windowed mode on enter and restore it on exit.' def __enter__(self): curses.endwin() + signal.signal(signal.SIGTSTP, visidata.vd.tstp_signal) def __exit__(self, exc_type, exc_val, tb): newscr = curses.initscr() diff --git a/visidata/mainloop.py b/visidata/mainloop.py index <HASH>..<HASH> 100644 --- a/visidata/mainloop.py +++ b/visidata/mainloop.py @@ -1,6 +1,7 @@ import contextlib import os import curses +import signal import threading import time from unittest import mock @@ -222,6 +223,10 @@ def setupcolors(stdscr, f, *args): return f(stdscr, *args) def wrapper(f, *args): + # workaround for bug in curses.wrapper #899 + # https://stackoverflow.com/questions/31440392/curses-wrapper-messing-up-terminal-after-background-foreground-sequence + vd.tstp_signal = signal.getsignal(signal.SIGTSTP) + return curses.wrapper(setupcolors, f, *args) def run(*sheetlist):
[SuspendCurses] workaround for bug in curses.wrapper #<I>
saulpw_visidata
train
py,py
a3584fadc106652bb12b847decadc8d94c688f77
diff --git a/disque/pool.go b/disque/pool.go index <HASH>..<HASH> 100644 --- a/disque/pool.go +++ b/disque/pool.go @@ -5,6 +5,7 @@ import ( "log" "math/rand" "sync" + "sync/atomic" "time" "github.com/garyburd/redigo/redis" @@ -47,7 +48,7 @@ type Pool struct { pools map[string]*redis.Pool dialFunc DialFunc // for borrow tests - numBorrowed int + numBorrowed int64 } func (p *Pool) Size() int { @@ -135,7 +136,7 @@ func (p *Pool) getPool(addr string) *redis.Pool { pool.TestOnBorrow = func(c redis.Conn, t time.Time) error { // for testing - count how many borrows we did - p.numBorrowed++ + atomic.AddInt64(&p.numBorrowed, 1) if time.Since(t) > testOnBorrowInterval { _, err := c.Do("PING") return err
Increment numBorrowed atomically to avoid races
EverythingMe_go-disque
train
go
12ebe05a4c1392fd77f4cd48ef70100f10a09e5c
diff --git a/proton-c/bindings/python/proton/reactor.py b/proton-c/bindings/python/proton/reactor.py index <HASH>..<HASH> 100644 --- a/proton-c/bindings/python/proton/reactor.py +++ b/proton-c/bindings/python/proton/reactor.py @@ -538,7 +538,7 @@ class Connector(Handler): assert(reactor is not None) url = self.address.next() reactor.set_connection_host(connection, url.host, str(url.port)) - logging.info("connecting to %s..." % url) + logging.debug("connecting to %s..." % url) transport = Transport() if self.sasl_enabled: @@ -567,7 +567,7 @@ class Connector(Handler): self._connect(event.connection, event.reactor) def on_connection_remote_open(self, event): - logging.info("connected to %s" % event.connection.hostname) + logging.debug("connected to %s" % event.connection.hostname) if self.reconnect: self.reconnect.reset() self.transport = None @@ -587,7 +587,7 @@ class Connector(Handler): logging.info("Disconnected will try to reconnect after %s seconds" % delay) event.reactor.schedule(delay, self) else: - logging.info("Disconnected") + logging.debug("Disconnected") self.connection = None def on_timer_task(self, event):
PROTON-<I>: bump down the severity of reactor connection events
apache_qpid-proton
train
py
f6465abae47d69e2941e9640930a9e6d13035679
diff --git a/spec/unpoly/framework_spec.js b/spec/unpoly/framework_spec.js index <HASH>..<HASH> 100644 --- a/spec/unpoly/framework_spec.js +++ b/spec/unpoly/framework_spec.js @@ -25,12 +25,15 @@ describe('up.framework', function() { it('returns false if the document is missing a DOCTYPE, triggering quirks mode', function() { // Cannot use spyOnProperty() for document.compatMode, as document does not return a property descriptor. let oldCompatMode = document.compatMode + expect(oldCompatMode).toEqual('CSS1Compat') try { // Quirks mode is "BackCompat". Standards mode is "CSS1Compat". - Object.defineProperty(document, 'compatMode', { value: 'BackCompat' }) + Object.defineProperty(document, 'compatMode', { value: 'BackCompat', configurable: true }) expect(up.framework.isSupported()).toBe(false) } finally { - document.compatMode = oldCompatMode + Object.defineProperty(document, 'compatMode', { value: oldCompatMode, configurable: true }) + // Make sure we cleaned up correctly + expect(document.compatMode).toEqual(oldCompatMode) } })
Fix spec leaving browser in mocked quirks mode
unpoly_unpoly
train
js
f163a072fda01b74c7d9ddb7cd2669e26eca6790
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -482,7 +482,7 @@ NwBuilder.prototype.handleMacApp = function () { { name: self.options.appName, version: self.options.appVersion, - copyright: self._appPkg.copyright || false + copyright: self._appPkg.copyright }, self.options.macPlist ); diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -147,15 +147,15 @@ module.exports = { }, getPlistOptions: function(parsedParams, custom) { var obj = {}; - if(parsedParams.name !== undefined) { + if(parsedParams.name) { obj.CFBundleName = parsedParams.name; obj.CFBundleDisplayName = parsedParams.name; } - if(parsedParams.version !== undefined) { + if(parsedParams.version) { obj.CFBundleVersion = parsedParams.version; obj.CFBundleShortVersionString = 'Version ' + parsedParams.version; } - if(parsedParams.copyright !== undefined) { + if(parsedParams.copyright) { obj.NSHumanReadableCopyright = parsedParams.copyright; }
Fixed getPlistOptions inconsistency. See #<I>
nwjs-community_nw-builder
train
js,js
58eb15dc0863842df26fe2eda7a6b31684b3a826
diff --git a/src/Response/JSON.php b/src/Response/JSON.php index <HASH>..<HASH> 100755 --- a/src/Response/JSON.php +++ b/src/Response/JSON.php @@ -29,8 +29,11 @@ class JSON extends Model $headers['Status'] === 422 || $headers['Status'] === 400 )) { - print_r($headers); - exit; + throw new Exception([ + 'Message' => $errors, + 'Response' => $data, + 'Headers' => $headers + ]); } if ($headers['Status'] === 201 || $headers['Status'] === 200) { switch ($headers['Method']) {
throw catchable exception instead of exit in JSON response (#<I>) throw catchable exception instead of exit in JSON response
loduis_teamwork.com-project-management
train
php
be16a810967bb89bf12f1e838112785fe0a851d2
diff --git a/terminal_check_unix.go b/terminal_check_unix.go index <HASH>..<HASH> 100644 --- a/terminal_check_unix.go +++ b/terminal_check_unix.go @@ -1,4 +1,4 @@ -// +build linux aix +// +build linux aix zos // +build !js package logrus
Add build tag to enable a successful build for zos
sirupsen_logrus
train
go
297926fd8c776fe605a555c2ec8ae482524aba87
diff --git a/cheque.php b/cheque.php index <HASH>..<HASH> 100644 --- a/cheque.php +++ b/cheque.php @@ -195,12 +195,14 @@ class Cheque extends PaymentModule 'type' => 'text', 'label' => $this->l('Pay to the order of (name)'), 'name' => 'CHEQUE_NAME', + 'required' => true ), array( 'type' => 'textarea', 'label' => $this->l('Address'), 'desc' => $this->l('Address where the check should be sent to.'), 'name' => 'CHEQUE_ADDRESS', + 'required' => true ), ), 'submit' => array(
Update cheque.php Added "Required" indicator for the fields.
PrestaShop_ps_checkpayment
train
php
d95ae434f6112748d4b8e6adff66bf8c80cc293d
diff --git a/tests/Orkestra/Transactor/Tests/Transactor/NetworkMerchants/CardTransactorTest.php b/tests/Orkestra/Transactor/Tests/Transactor/NetworkMerchants/CardTransactorTest.php index <HASH>..<HASH> 100644 --- a/tests/Orkestra/Transactor/Tests/Transactor/NetworkMerchants/CardTransactorTest.php +++ b/tests/Orkestra/Transactor/Tests/Transactor/NetworkMerchants/CardTransactorTest.php @@ -190,6 +190,7 @@ class CardTransactorTest extends \PHPUnit_Framework_TestCase $request = $result->getData('request'); $this->assertArrayHasKey('cvv', $request); + $this->assertEquals('123', $request['cvv']); $this->assertArrayNotHasKey('firstname', $request); $this->assertArrayNotHasKey('lastname', $request); $this->assertArrayNotHasKey('address', $request); @@ -214,6 +215,7 @@ class CardTransactorTest extends \PHPUnit_Framework_TestCase $account->setAccountNumber('4111111111111111'); $account->setExpMonth(new Month(10)); $account->setExpYear(new Year(2010)); + $account->setCvv('123'); $credentials = new Credentials(); $credentials->setCredential('username', 'demo');
Added cvv field to account in CardTransactorTest
orkestra_orkestra-transactor
train
php
e6281ce9b2cacb271958c0c50508d51b61be6be2
diff --git a/Resource/GenericResource.php b/Resource/GenericResource.php index <HASH>..<HASH> 100644 --- a/Resource/GenericResource.php +++ b/Resource/GenericResource.php @@ -18,7 +18,13 @@ class GenericResource implements Resource */ public function __construct($path) { - $this->path = $path; + if (!strlen($path)) { + throw new \InvalidArgumentException('Path must not be empty.'); + } + if ($path[0] == '/') { + throw new \InvalidArgumentException('Path must not be absolute.'); + } + $this->path = rtrim($path, '/'); } /**
Add checks and trim trailing slash.
orbt_ResourceMirror
train
php
ce1f4ff73ae9ad91a3e1fd1ee104988d489c20c5
diff --git a/littlechef/runner.py b/littlechef/runner.py index <HASH>..<HASH> 100644 --- a/littlechef/runner.py +++ b/littlechef/runner.py @@ -187,6 +187,22 @@ def deploy_chef(gems="no", ask="yes", version="0.10", solo.install(distro_type, distro, gems, version, stop_client) solo.configure() + # Build a basic node file if there isn't one already with some properties from ohai + with settings(hide('stdout'), warn_only=True): + output = sudo('ohai -l warn') + if output.succeeded: + try: + ohai = json.loads(output) + node = {"run_list": []} + for prop in ["ipaddress", "platform", "platform_family", + "platform_version"]: + if ohai[prop]: + node[prop] = ohai[prop] + chef.save_config(node) + except json.JSONDecodeError: + abort("Could not parse ohai's output" + ":\n {0}".format(output)) + def recipe(recipe): """Apply the given recipe to a node
When deploying chef to a new node, create a node config file If one doesn't already exist, create a node configuration file with some properties from ohai (ipaddress, platform, platform_family, and platform_version right now). This is useful we we can perform some basic logic in littlechef based on these properties (e.g. changing env.shell for FreeBSD)
tobami_littlechef
train
py
039c10b2c6cf3528b52c3c98b631720cd078a51a
diff --git a/nodemcu-uploader.py b/nodemcu-uploader.py index <HASH>..<HASH> 100755 --- a/nodemcu-uploader.py +++ b/nodemcu-uploader.py @@ -422,6 +422,8 @@ if __name__ == '__main__': if len(destinations) == len(sources): uploader.prepare() for f, d in zip(sources, destinations): + if args.compile: + uploader.file_remove(os.path.splitext(d)[0]+'.lc') uploader.write_file(f, d, args.verify) if args.compile: uploader.file_compile(d)
Erase compiled version before uploading a new compile.
kmpm_nodemcu-uploader
train
py
fc6dbcc7038c2b030ef6a2dc8be5848499ccee1c
diff --git a/python/pyspark/sql/functions.py b/python/pyspark/sql/functions.py index <HASH>..<HASH> 100644 --- a/python/pyspark/sql/functions.py +++ b/python/pyspark/sql/functions.py @@ -1053,7 +1053,7 @@ _string_functions = { 'lower': 'Converts a string column to lower case.', 'upper': 'Converts a string column to upper case.', 'reverse': 'Reverses the string column and returns it as a new string column.', - 'ltrim': 'Trim the spaces from right end for the specified string value.', + 'ltrim': 'Trim the spaces from left end for the specified string value.', 'rtrim': 'Trim the spaces from right end for the specified string value.', 'trim': 'Trim the spaces from both ends for the specified string column.', }
Doc typo: ltrim = trim from left end, not right
apache_spark
train
py
cf0d40134c9369e061b15f51ceb366b079fcb443
diff --git a/cruddy/lambdaclient.py b/cruddy/lambdaclient.py index <HASH>..<HASH> 100644 --- a/cruddy/lambdaclient.py +++ b/cruddy/lambdaclient.py @@ -56,3 +56,36 @@ class LambdaClient(object): except botocore.exceptions.ClientError: LOG.exception('Could not call Lambda function %s', self.func_name) raise + + def list(self): + data = {'operation': 'list'} + return self.invoke(data) + + def get(self, item_id, decrypt=False): + data = {'operation': 'get', + 'id': item_id, + 'decrypt': decrypt} + return self.invoke(data) + + def create(self, item): + data = {'operation': 'create', + 'item': item} + return self.invoke(data) + + def delete(self, item_id): + data = {'operation': 'get', + 'id': item_id} + return self.invoke(data) + + def search(self, query): + data = {'operation': 'search', + 'query': query} + return self.invoke(data) + + def increment(self, item_id, counter_name, increment=1): + data = {'operation': 'increment_counter', + 'id': item_id, + 'counter_name': counter_name, + 'increment': increment} + return self.invoke(data) +
Add explicit methods to LambdaClient for the various operations.
Min-ops_cruddy
train
py
c1ce506dafcb6411cbfb887f43bcf82b8b2807c8
diff --git a/lib/SDPInfo.js b/lib/SDPInfo.js index <HASH>..<HASH> 100644 --- a/lib/SDPInfo.js +++ b/lib/SDPInfo.js @@ -1058,8 +1058,8 @@ SDPInfo.parse = function(string) const mediaInfo = new MediaInfo(mid,media); //Get ICE info - const ufrag = md.iceUfrag; - const pwd = md.icePwd; + const ufrag = String(md.iceUfrag); + const pwd = String(md.icePwd); //Create iceInfo sdpInfo.setICE(new ICEInfo(ufrag,pwd));
focus iceUfrag and icePwd to string
medooze_semantic-sdp-js
train
js
f6ea21a937d7bd095eb96b5c60b59291e143cdac
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,15 @@ const parser = module.exports = {}; -Object.defineProperty(Array.prototype, 'diff', { - enumerable: false, - value: function(a2) { - return this.concat(a2).filter((val, index, arr) => { - return arr.indexOf(val) === arr.lastIndexOf(val); - }); - } -}); +if (!Array.prototype.hasOwnProperty('diff')) { + Object.defineProperty(Array.prototype, 'diff', { + enumerable: false, + value: function(a2) { + return this.concat(a2).filter((val, index, arr) => { + return arr.indexOf(val) === arr.lastIndexOf(val); + }); + } + }); +} parser.parseName = function (name) { const salutations = ['mr', 'master', 'mister', 'mrs', 'miss', 'ms', 'dr', 'prof', 'rev', 'fr', 'judge', 'honorable', 'hon', 'tuan', 'sr', 'srta', 'br', 'pr', 'mx', 'sra'];
Don't redefine diff if it already exists (#<I>)
chovy_humanparser
train
js
6406a4d88c549dfcf7b56fe1f41c3c2b8697baad
diff --git a/core-bundle/contao/library/Contao/Automator.php b/core-bundle/contao/library/Contao/Automator.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/library/Contao/Automator.php +++ b/core-bundle/contao/library/Contao/Automator.php @@ -649,15 +649,15 @@ class Automator extends \System foreach (scan(TL_ROOT . '/' . $strDir) as $strFile) { - if (strncmp($strFile, '.', 1) === 0 || (substr($strFile, -4) != '.php' && substr($strFile, -4) != '.xlf') || in_array($strFile, $arrFiles)) + if (strncmp($strFile, '.', 1) !== 0 && (substr($strFile, -4) == '.php' || substr($strFile, -4) == '.xlf')) { - continue; + $arrFiles[] = substr($strFile, 0, -4); } - - $arrFiles[] = substr($strFile, 0, -4); } } + $arrFiles = array_values(array_unique($arrFiles)); + // Create one file per table foreach ($arrFiles as $strName) {
[Core] Ensure a unique language file array in the `Automator` class (see #<I>)
contao_contao
train
php
30f0eb52624c4ef6c33988f48e68cbd4616b1dee
diff --git a/adapters/mongoose.js b/adapters/mongoose.js index <HASH>..<HASH> 100644 --- a/adapters/mongoose.js +++ b/adapters/mongoose.js @@ -119,7 +119,7 @@ module.exports = function (model, opts) { if (opts.options.ref && opts.options.type) { return formatRef(opts.options.ref) + '._id'; } else if (_.isArray(opts.options.type) && opts.options.type.length && - opts.options.type[0].ref && !opts.options.type[0].type) { + opts.options.type[0].ref && opts.options.type[0].type) { return formatRef(opts.options.type[0].ref) + '._id'; } }
Fix condition in the ref and type check
ForestAdmin_forest-express-mongoose
train
js
1d0e6d0093102fe3a2057b9873d0f8734848ab61
diff --git a/lib/get.js b/lib/get.js index <HASH>..<HASH> 100644 --- a/lib/get.js +++ b/lib/get.js @@ -78,7 +78,7 @@ function requestAll_ (c, data, cb) { this.request('GET', uri, function (er, updates, _, res) { if (er) return cb(er, data) var headers = res.headers - , updated = data._updated || Date.parse(headers.date) + , updated = updates._updated || Date.parse(headers.date) Object.keys(updates).forEach(function (p) { data[p] = updates[p] })
Really use _updated flag from server
npm_npm-registry-client
train
js
31c0863d088488da5dd85e2cbe3c01c6b01aa4a2
diff --git a/system_tests/test_default.py b/system_tests/test_default.py index <HASH>..<HASH> 100644 --- a/system_tests/test_default.py +++ b/system_tests/test_default.py @@ -24,7 +24,5 @@ def test_application_default_credentials(verify_refresh): if EXPECT_PROJECT_ID is not None: assert project_id is not None - else: - assert project_id is None verify_refresh(credentials)
Fix system tests when running on GCE The new project ID logic for Cloud SDK invokes Cloud SDK directly. Cloud SDK helpfully falls back to the GCE project ID if the project ID is unset in the configuration. This breaks one of our previous expectations.
googleapis_google-auth-library-python
train
py
29a21c4e767d1ab38a64e4207bdc44217736136d
diff --git a/Model/Snapshot.php b/Model/Snapshot.php index <HASH>..<HASH> 100644 --- a/Model/Snapshot.php +++ b/Model/Snapshot.php @@ -103,6 +103,9 @@ abstract class Snapshot implements SnapshotInterface */ protected $parentId; + /** + * @deprecated since version 2.4 and will be removed in 3.0. + */ protected $sources; protected $target; @@ -387,18 +390,22 @@ abstract class Snapshot implements SnapshotInterface } /** - * {@inheritdoc} + * @deprecated since version 2.4 and will be removed in 3.0. */ public function setSources($sources) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + $this->sources = $sources; } /** - * {@inheritdoc} + * @deprecated since version 2.4 and will be removed in 3.0. */ public function getSource() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + return $this->sources; }
Added deprecation info to snapshot sources property
sonata-project_SonataPageBundle
train
php
2c556dbfbcba530aebf00a0d19189c97263dbf10
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -17,10 +17,10 @@ export function asyncActionCreator(type, config) { if (typeof config === 'function') config = {action: config}; // eslint-disable-line no-param-reassign const {client, server, schema} = config; - return payload => dispatch => { + return payload => (dispatch, ...args) => { const action = config.action || (isNode ? server : client); dispatch({type, payload}); - return action(payload).then( + return action(payload, dispatch, ...args).then( response => dispatch({ type: `${type}_${SUCCESS}`, payload,
allow getState to be passed to action (#2) Push all inner method arguments provided by async middleware to supplied action
andy-shea_redux-action-creator
train
js
b70ed70997137c8e848732fd3f60f98d7cfc522f
diff --git a/src/blocks/video.js b/src/blocks/video.js index <HASH>..<HASH> 100644 --- a/src/blocks/video.js +++ b/src/blocks/video.js @@ -9,7 +9,7 @@ module.exports = Block.extend({ // more providers at https://gist.github.com/jeffling/a9629ae28e076785a14f providers: { vimeo: { - regex: /(?:http[s]?:\/\/)?(?:www.)?vimeo\.com\/.+(?:\/)([^\/].*)+$/, + regex: /(?:http[s]?:\/\/)?(?:www.)?vimeo\.co(?:.+(?:\/)([^\/].*)+$)/, html: "<iframe src=\"<%= protocol %>//player.vimeo.com/video/<%= remote_id %>?title=0&byline=0\" width=\"580\" height=\"320\" frameborder=\"0\"></iframe>" }, youtube: {
Update video.js Further tweak to vimeo (had to add a hacky method to get it to behave on standard vimeo video addresses hence the missing 'm' on '.com' since branch reset isn't allowed which would have resulted in 2 groups being returned by other methods)
madebymany_sir-trevor-js
train
js
9a39ad5dacef1ca7854d410be156cb1b96fa401c
diff --git a/pymatgen/io/cp2k/outputs.py b/pymatgen/io/cp2k/outputs.py index <HASH>..<HASH> 100644 --- a/pymatgen/io/cp2k/outputs.py +++ b/pymatgen/io/cp2k/outputs.py @@ -1161,10 +1161,11 @@ class Cp2kOutput: # If number of site-projected dos == number of sites, assume they are bijective # and create the CompleteDos object + _ldoss = {} if len(ldoss) == len(self.initial_structure): for k in ldoss: - ldoss[self.initial_structure[int(k)-1]] = ldoss.pop(k) - self.data['cdos'] = CompleteDos(self.structures, total_dos=tdos, pdoss=ldoss) + _ldoss[self.initial_structure[int(k)-1]] = ldoss[k] + self.data['cdos'] = CompleteDos(self.structures, total_dos=tdos, pdoss=_ldoss) @staticmethod def _gauss_smear(densities, energies, npts, width):
LDOS indexing was incorrect.
materialsproject_pymatgen
train
py
675e7f0a6936bbe373e39b75835531cd8e842af1
diff --git a/templates/connect.php b/templates/connect.php index <HASH>..<HASH> 100755 --- a/templates/connect.php +++ b/templates/connect.php @@ -49,6 +49,9 @@ $require_license_key = $is_premium_only || ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) ); + + if ($is_pending_activation) + $require_license_key = false; ?> <div id="fs_connect" class="wrap<?php if ( ! $fs->is_enable_anonymous() || $is_pending_activation || $require_license_key ) {
[connect] If pending activation and anonymous mode disabled, don't show license key input.
Freemius_wordpress-sdk
train
php
d89b277343814264af661775200b2db322d1bc46
diff --git a/lb/roundrobin.go b/lb/roundrobin.go index <HASH>..<HASH> 100644 --- a/lb/roundrobin.go +++ b/lb/roundrobin.go @@ -103,6 +103,7 @@ func (s *ResultCache) mergeResults(oldResults []net.SRV, newResults []net.SRV) ( func (s *ResultCache) getNextResult(key string) (net.SRV, error) { var srv net.SRV + srvs := s.m[key].srvs i := s.m[key].i @@ -111,11 +112,11 @@ func (s *ResultCache) getNextResult(key string) (net.SRV, error) { } if len(srvs) <= i { - i = 0 + i = i % len(srvs) } srv = srvs[i] - s.m[key].i += 1 + s.m[key].i = i + 1 return srv, nil }
Fix roundrobin overflow bug.
benschw_srv-lb
train
go
7a184ec58d56df21b7be1ec15f5814fe95258103
diff --git a/src/Builder.php b/src/Builder.php index <HASH>..<HASH> 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -131,11 +131,10 @@ class Builder } $outfile = basename(substr($file, 0, strrpos($file, '.'))) - . '.sql'; + . '.sql'; file_put_contents($this->output . '/' . $outfile, $sql); $generated .= "- $outfile\n"; } - $this->log .= "Files generated:\n$generated"; } @@ -149,7 +148,7 @@ class Builder foreach ($vendors as $vendor => $vendor_configs) { $this->log .= "\nSwitch to vendor $vendor\n\n"; - if (is_null($vendor_configs)) { + if ($vendor_configs === null) { $vendor_configs = [null]; }
Update Builder::build() Code cleanup
aryelgois_yasql-php
train
php
78514acd495b6bf79f1ae3923dfce828b39d7c1b
diff --git a/lnd_test.go b/lnd_test.go index <HASH>..<HASH> 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -4103,7 +4103,8 @@ out: // Alice's side, leaving on 10k satoshis of available balance for bob. // There's a max payment amount, so we'll have to do this // incrementally. - amtToSend := int64(chanAmt) - 20000 + chanReserve := int64(chanAmt / 100) + amtToSend := int64(chanAmt) - chanReserve - 20000 amtSent := int64(0) for amtSent != amtToSend { // We'll send in chunks of the max payment amount. If we're @@ -4642,8 +4643,10 @@ func testAsyncPayments(net *lntest.NetworkHarness, t *harnessTest) { t.Fatalf("unable to get alice channel info: %v", err) } - // Calculate the number of invoices. - numInvoices := int(info.LocalBalance / paymentAmt) + // Calculate the number of invoices. We will deplete the channel + // all the way down to the channel reserve. + chanReserve := info.LocalBalance / 100 + numInvoices := int((info.LocalBalance - chanReserve) / paymentAmt) bobAmt := int64(numInvoices * paymentAmt) aliceAmt := info.LocalBalance - bobAmt
integration tests: accoount for channel reserve when sending payments.
lightningnetwork_lnd
train
go
fc6b27c47b0dee73264eb11b2080bfce829a8f2c
diff --git a/code/extensions/FluentFilteredExtension.php b/code/extensions/FluentFilteredExtension.php index <HASH>..<HASH> 100644 --- a/code/extensions/FluentFilteredExtension.php +++ b/code/extensions/FluentFilteredExtension.php @@ -106,7 +106,7 @@ class FluentFilteredExtension extends DataExtension */ public function augmentDataQueryCreation(SQLQuery $query, DataQuery $dataQuery) { - $dataQuery->setQueryParam('Fluent.FilterAdmin', Fluent::config()->FilterAdmin) + $dataQuery->setQueryParam('Fluent.FilterAdmin', Fluent::config()->FilterAdmin); $dataQuery->setQueryParam('Fluent.Locale', Fluent::current_locale()); $dataQuery->setQueryParam('Fluent.IsFrontend', Fluent::is_frontend()); }
FIX: Sorry I forgot a semicolor (^_^u)
tractorcow-farm_silverstripe-fluent
train
php
f5a7fa682a99ffd24beeaf210cd2e8d007a403db
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -1180,6 +1180,20 @@ const devices = [ // TuYa { + fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_hktqahrq'}], + model: 'WHD02', + vendor: 'TuYa', + description: 'Wall switch module', + toZigbee: preset.switch().toZigbee.concat([tz.moes_power_on_behavior]), + fromZigbee: preset.switch().fromZigbee.concat([fz.moes_power_on_behavior]), + exposes: preset.switch().exposes.concat([exposes.enum('power_on_behavior', ea.ALL, ['off', 'previous', 'on']) + .withDescription('Controls the behaviour when the device is powered on')]), + meta: {configureKey: 1}, + configure: async (device, coordinatorEndpoint, logger) => { + await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']); + }, + }, + { fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_mvn6jl7x'}, {modelID: 'TS011F', manufacturerName: '_TZ3000_raviyuvk'}], model: 'TS011F_2_gang_wall',
Add WHD<I> (#<I>) * Tuya wall switch module with power_on_behavior option * Update devices.js
Koenkk_zigbee-shepherd-converters
train
js
ec66dc06394b089b1491f31f989cceee23dad328
diff --git a/uncompyle6/parsers/parse24.py b/uncompyle6/parsers/parse24.py index <HASH>..<HASH> 100644 --- a/uncompyle6/parsers/parse24.py +++ b/uncompyle6/parsers/parse24.py @@ -19,6 +19,7 @@ class Python24Parser(Python25Parser): importstmt ::= filler LOAD_CONST import_as importfrom ::= filler LOAD_CONST IMPORT_NAME importlist2 POP_TOP + importstar ::= filler LOAD_CONST IMPORT_NAME IMPORT_STAR importmultiple ::= filler LOAD_CONST import_as imports_cont import_cont ::= filler LOAD_CONST import_as_cont @@ -26,9 +27,12 @@ class Python24Parser(Python25Parser): # Python 2.5+ omits POP_TOP POP_BLOCK while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_TOP POP_BLOCK COME_FROM + # Python 2.5+: + # call_stmt ::= expr POP_TOP + # expr ::= yield call_stmt ::= yield - # Python 2.5+ adds POP_TOP + # Python 2.5+ adds POP_TOP at the end gen_comp_body ::= expr YIELD_VALUE '''
<I> "import *" grammar rule
rocky_python-uncompyle6
train
py
aca9649ffd6962434f774141bf7d7178e61a181c
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100644 --- a/tests.py +++ b/tests.py @@ -4,7 +4,10 @@ import unittest import os +import myql + from yahoo_oauth import json_write_data, json_get_data +from yahoo_oauth import OAuth1 class testYahooOAuth(unittest.TestCase): """Class to tests Yahoo OAuth module @@ -23,3 +26,12 @@ class testYahooOAuth(unittest.TestCase): def test_2_json_get_data(self,): json_data = json_get_data('test.json') self.assertEquals(self.d,json_data) + + def test_oauth1(self,): + oauth = OAuth1(None, None, 'http://query.yahooapis.com/v1/yql',from_file='credentials.json') + yql = myql.MYQL(oauth=oauth) + response = yql.getGUID('josue_brunel') + self.assertEqual(response.status,200) + + def test_oauth2(self,): + pass
#5 : test for OAuth1 added
josuebrunel_yahoo-oauth
train
py
681531f7412cf9e7e3d729297bb9333908f6f760
diff --git a/app/controllers/storytime/dashboard/blog_posts_controller.rb b/app/controllers/storytime/dashboard/blog_posts_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/storytime/dashboard/blog_posts_controller.rb +++ b/app/controllers/storytime/dashboard/blog_posts_controller.rb @@ -11,6 +11,8 @@ module Storytime def create @post = current_post_type.new(post_params) + @post.blog = Storytime::Blog.friendly.find(params[:blog_id]) + @post.user = current_user @post.draft_user_id = current_user.id authorize @post
set user and blog in blog_posts controller
CultivateLabs_storytime
train
rb
e300bb742a42b3273e06dc05f9ae9951c416ef39
diff --git a/rapidoid-watch/src/main/java/org/rapidoid/io/watch/WatcherThread.java b/rapidoid-watch/src/main/java/org/rapidoid/io/watch/WatcherThread.java index <HASH>..<HASH> 100644 --- a/rapidoid-watch/src/main/java/org/rapidoid/io/watch/WatcherThread.java +++ b/rapidoid-watch/src/main/java/org/rapidoid/io/watch/WatcherThread.java @@ -98,7 +98,7 @@ public class WatcherThread extends AbstractLoopThread { } private void init(Path dir) { - Log.info("Registering directory watch", "dir", dir); + Log.debug("Registering directory watch", "dir", dir); try { WatchKey key = dir.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
DEBUG level for the Watch registration logs.
rapidoid_rapidoid
train
java
b647e519fed8c9113a95fc9db5364da489d15b24
diff --git a/lib/e9s/actionpack/action_view/base.rb b/lib/e9s/actionpack/action_view/base.rb index <HASH>..<HASH> 100644 --- a/lib/e9s/actionpack/action_view/base.rb +++ b/lib/e9s/actionpack/action_view/base.rb @@ -9,11 +9,6 @@ module ActionView end end.compact.join("\n") end - - def link(name, options = nil) - options = {:class => options || name.underscore} unless options.is_a?(Hash) - link_to name, "#", options - end end end
Not defining the helper method 'link' anymore
archan937_e9s
train
rb
77b17fa5703af5eef1a2cd13bdc8d7999d12e23f
diff --git a/django_countries/ioc_data.py b/django_countries/ioc_data.py index <HASH>..<HASH> 100644 --- a/django_countries/ioc_data.py +++ b/django_countries/ioc_data.py @@ -109,7 +109,7 @@ IOC_TO_ISO = { 'LBR': 'LR', 'LCA': 'LC', 'LES': 'LS', - 'LIB': 'LB', + 'LBN': 'LB', 'LIE': 'LI', 'LTU': 'LT', 'LUX': 'LU', @@ -255,7 +255,8 @@ IOC_HISTORICAL_TO_ISO = { 'SAU': 'SA', 'LYA': 'LY', 'LBY': 'LY', - 'LEB': 'LB', + 'LEB': 'LB', # Used from 1960-1964 + 'LIB': 'LB', # Used from 1964-2016 'LIC': 'LI', 'LIT': 'LT', 'MAG': 'MG', @@ -287,7 +288,7 @@ IOC_HISTORICAL_TO_ISO = { 'RUM': 'RO', 'SAF': 'ZA', 'SGL': 'SN', - 'SIN': 'SG', + 'SIN': 'SG', # Used from 1959-2016 'SLA': 'SL', 'SMA': 'SM', 'CEY': 'LK',
Modified Lebanon IOC code to LBN
SmileyChris_django-countries
train
py
3c730fd2c67a5fb4ddcd22aeb05fee62d203bf11
diff --git a/generators/cypress/index.js b/generators/cypress/index.js index <HASH>..<HASH> 100644 --- a/generators/cypress/index.js +++ b/generators/cypress/index.js @@ -154,6 +154,28 @@ module.exports = class extends BaseBlueprintGenerator { `projects.${_.kebabCase(this.baseName)}.architect.build.configurations.instrumenter`, {} ); + this.addWebpackConfig(`targetOptions.configuration === 'instrumenter' + ? { + module: { + rules: [ + { + test: /\.(js|ts)$/, + use: [ + { + loader: 'babel-loader', + options: { + plugins: ['istanbul'], + }, + } + ], + enforce: 'post', + include: path.resolve(__dirname, '../${constants.CLIENT_MAIN_SRC_DIR}'), + exclude: [/\.(e2e|spec)\.ts$/, /node_modules/, /(ngfactory|ngstyle)\.js/], + }, + ], + }, + } + : {}`); } }, };
Update generators/cypress/index.js
jhipster_generator-jhipster
train
js
1a196c1c9fa71ea459c4de1a44d1b02d8577e838
diff --git a/pipenv/core.py b/pipenv/core.py index <HASH>..<HASH> 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -461,7 +461,7 @@ def ensure_python(three=None, python=None): if not PYENV_INSTALLED: abort() else: - if (not PIPENV_DONT_USE_PYENV) and (SESSION_IS_INTERACTIVE): + if (not PIPENV_DONT_USE_PYENV) and (SESSION_IS_INTERACTIVE or PIPENV_YES): version_map = { # TODO: Keep this up to date! # These versions appear incompatible with pew:
Allow pyenv installs in non-interactive sessions in PIPENV_YES is set
pypa_pipenv
train
py
62f84c060f3a2f1e3dc5f73fc8d96b9f6c948e82
diff --git a/resources/lang/hu-HU/cachet.php b/resources/lang/hu-HU/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/hu-HU/cachet.php +++ b/resources/lang/hu-HU/cachet.php @@ -117,9 +117,18 @@ return [ ], ], + // Meta descriptions + 'meta' => [ + 'description' => [ + 'incident' => 'Details and updates about the :name incident that occurred on :date', + 'schedule' => 'Details about the scheduled maintenance period :name starting :startDate', + 'subscribe' => 'Subscribe to :app in order to receive updates of incidents and scheduled maintenance periods', + 'overview' => 'Maradjon mindig naprakész :app legújabb frissítéseivel.', + ], + ], + // Other 'home' => 'Kezdőoldal', - 'description' => 'Maradjon mindig naprakész :app legújabb frissítéseivel.', 'powered_by' => 'A motorháztető alatt a <a href="https://cachethq.io" class="links">Cachet</a> dolgozik.', 'timezone' => 'Időzóna: :timezone.', 'about_this_site' => 'A webhelyről',
New translations cachet.php (Hungarian)
CachetHQ_Cachet
train
php
3f2df3629d80c0fe45a743c095ed5cd169100f78
diff --git a/src/Engines/AlgoliaEngine.php b/src/Engines/AlgoliaEngine.php index <HASH>..<HASH> 100644 --- a/src/Engines/AlgoliaEngine.php +++ b/src/Engines/AlgoliaEngine.php @@ -171,7 +171,7 @@ class AlgoliaEngine extends Engine if (isset($models[$key])) { return $models[$key]; } - })->filter(); + })->filter()->values(); } /**
Chain `values` method in map function refer to my pull request in <URL>
laravel_scout
train
php
7acbaa315324def3fabf702ed0ff6337b8fc859f
diff --git a/code/libraries/koowa/libraries/controller/toolbar/actionbar.php b/code/libraries/koowa/libraries/controller/toolbar/actionbar.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/libraries/controller/toolbar/actionbar.php +++ b/code/libraries/koowa/libraries/controller/toolbar/actionbar.php @@ -173,7 +173,7 @@ abstract class KControllerToolbarActionbar extends KControllerToolbarAbstract protected function _commandExport(KControllerToolbarCommand $command) { //Get the states - $states = $this->getController()->getModel()->getState()->toArray(); + $states = $this->getController()->getModel()->getState()->getValues(); unset($states['limit']); unset($states['offset']); @@ -183,7 +183,7 @@ abstract class KControllerToolbarActionbar extends KControllerToolbarAbstract //Get the query options $query = http_build_query($states, '', '&'); $option = $this->getIdentifier()->package; - $view = $this->getIdentifier()->name; + $view = $this->getController()->getView()->getName(); $command->href = 'option=com_'.$option.'&view='.$view.'&'.$query; }
Fixed issue with generating wrong url for the CSV export button. The button was generating an url with the wrong params using toArray(). Now we only use the active set values using getValues().
joomlatools_joomlatools-framework
train
php
8419a77100659dd261acdaa1734a020446e34c46
diff --git a/denovonear/site_specific_rates.py b/denovonear/site_specific_rates.py index <HASH>..<HASH> 100755 --- a/denovonear/site_specific_rates.py +++ b/denovonear/site_specific_rates.py @@ -3,11 +3,6 @@ from denovonear.weights import WeightedChoice -try: - maketrans = str.maketrans -except AttributeError: - from string import maketrans - def get_codon_info(transcript, bp, boundary_dist): """ get the details of the codon which a variant resides in @@ -81,7 +76,7 @@ class SiteRates(object): bases = set(["A", "C", "G", "T"]) categories = ["missense", "nonsense", "synonymous", "splice_lof", "splice_region", "loss_of_function"] - transdict = maketrans("acgtuACGTU", "tgcaaTGCAA") + transdict = {"A": "T", "T": "A", "G": "C", "C": "G"} def __init__(self, gene, mut_dict, masked_sites=None): @@ -251,7 +246,7 @@ class SiteRates(object): ref_base = seq[1] alt = base if self.gene.strand == "-": - ref_base = ref_base.translate(self.transdict) - alt = alt.translate(self.transdict) + ref_base = self.transdict[ref_base] + alt = self.transdict[alt] self.rates["loss_of_function"].add_choice(cds_pos, rate, ref_base, alt)
fix error when getting base complement of alleles
jeremymcrae_denovonear
train
py
1e7f9ea6c453da0d1c0aa7007bf9b7482dae9027
diff --git a/lib/dbutils.js b/lib/dbutils.js index <HASH>..<HASH> 100644 --- a/lib/dbutils.js +++ b/lib/dbutils.js @@ -418,6 +418,7 @@ dbu.buildCondition = function buildCondition (pred) { case 'gt': cql += ' > ?'; params.push(predArg); keys.push(predKey); break; case 'le': cql += ' <= ?'; params.push(predArg); keys.push(predKey); break; case 'ge': cql += ' >= ?'; params.push(predArg); keys.push(predKey); break; + case 'neq': case 'ne': cql += ' != ?'; params.push(predArg); keys.push(predKey); break; case 'between': cql += ' >= ?' + ' AND '; params.push(predArg[0]); keys.push(predKey);
Minor: add 'neq' as a synonym for 'ne'
wikimedia_restbase-mod-table-cassandra
train
js
8c5a1553e3f3a7ca6a53849784a8c9bff1384ba1
diff --git a/fluent_contents/plugins/code/models.py b/fluent_contents/plugins/code/models.py index <HASH>..<HASH> 100644 --- a/fluent_contents/plugins/code/models.py +++ b/fluent_contents/plugins/code/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.utils.text import truncate_words from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem from fluent_contents.plugins.code import backend, appsettings @@ -17,4 +18,4 @@ class CodeItem(ContentItem): verbose_name_plural = _('Code snippets') def __unicode__(self): - return self.code + return truncate_words(self.code, 20)
Shorten the "repr" of the code plugin
django-fluent_django-fluent-contents
train
py
dc7fe643bffce4df5e2341972ab9a091f4572049
diff --git a/isochrones/observation.py b/isochrones/observation.py index <HASH>..<HASH> 100644 --- a/isochrones/observation.py +++ b/isochrones/observation.py @@ -367,15 +367,6 @@ class ObsNode(Node): self._Nstars = N return self._Nstars - def _recalc_Nstars(self): - N = {} - for n in self.get_model_nodes(): - if n.index not in N: - N[n.index] = 1 - else: - N[n.index] += 1 - self._Nstars = N - @property def systems(self): @@ -1059,11 +1050,11 @@ class ObservationTree(Node): @property def Nstars(self): - return self.children[0].Nstars + return sum([c.Nstars for c in self.children]) @property def systems(self): - return self.children[0].systems + return list(chain(*[c.systems for c in self.children])) def print_ascii(self, fout=None, p=None): pardict = None
changed stuff to allow for multiple children of root to participate
timothydmorton_isochrones
train
py
c05c13b7d73633052b680aa580d2dfacb237cbac
diff --git a/extension/phantom-pdf/lib/phantom.js b/extension/phantom-pdf/lib/phantom.js index <HASH>..<HASH> 100644 --- a/extension/phantom-pdf/lib/phantom.js +++ b/extension/phantom-pdf/lib/phantom.js @@ -118,6 +118,8 @@ Phantom.prototype._addRecipe = function(reporter) { deferred.reject(err); }); }); + }, function(err) { + deferred.reject(err); }); return deferred.promise;
initial commit of mongodb jaydata override
jsreport_jsreport-phantom-pdf
train
js
9ba221ecc44bade1bfd70180ea87be7d47dc4c24
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typing/XbaseTypeConformanceComputer.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typing/XbaseTypeConformanceComputer.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typing/XbaseTypeConformanceComputer.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typing/XbaseTypeConformanceComputer.java @@ -40,9 +40,7 @@ public class XbaseTypeConformanceComputer extends TypeConformanceComputer { return true; if (right == null) return false; - if (typeReferences.is(left, Void.class) && typeReferences.is(right, Void.TYPE)) - return true; - if (typeReferences.is(right, Void.class)) + if (typeReferences.is(right, Void.class) || typeReferences.is(right, Void.TYPE)) return true; if (functionConversion.isFunction(left) || functionConversion.isFunction(right)) return functionConversion.isConformant(left, right, ignoreGenerics);
[Xtend] made type conformance checks work with return expressions, added generation of SuppressWarnings('all')
eclipse_xtext-extras
train
java
5cdb6783edd4e14323276bdb14fb5bcac077d469
diff --git a/lib/state_machines/matcher_helpers.rb b/lib/state_machines/matcher_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/state_machines/matcher_helpers.rb +++ b/lib/state_machines/matcher_helpers.rb @@ -46,7 +46,7 @@ module StateMachines # In the above example, +same+ will match whichever the from state is. In # the case of the +ignite+ event, it is essential the same as the following: # - # transition :parked => :parked, :first_gear => :first_gear + # transition :idling => :idling, :first_gear => :first_gear def same LoopbackMatcher.instance end
docs: fix example for the `same` helper method (#<I>) [ci skip]
state-machines_state_machines
train
rb
36575d2651bde919ffa40f921083b2df55417dd8
diff --git a/src/DataTable/index.js b/src/DataTable/index.js index <HASH>..<HASH> 100644 --- a/src/DataTable/index.js +++ b/src/DataTable/index.js @@ -695,9 +695,11 @@ class ReactDataTable extends React.Component { return ( <div className={"tg-react-table-column-header"}> - <span title={displayName} className={"tg-react-table-name"}> - {renderTitleInner ? renderTitleInner : displayName + " "} - </span> + {displayName && ( + <span title={displayName} className={"tg-react-table-name"}> + {renderTitleInner ? renderTitleInner : displayName + " "} + </span> + )} {!sortDisabled && !isActionColumn && sortComponent} {!isActionColumn && filterMenu} </div>
fixes ugliness where not passing displayname would result in the string undefined
TeselaGen_teselagen-react-components
train
js
82ac6191d76d240b426a283ae32189c2b9f60cd8
diff --git a/pakefile_bootstrap.php b/pakefile_bootstrap.php index <HASH>..<HASH> 100644 --- a/pakefile_bootstrap.php +++ b/pakefile_bootstrap.php @@ -59,7 +59,9 @@ if ( !function_exists( 'pake_exception_default_handler' ) ) } } set_exception_handler( 'pake_exception_default_handler' ); -mb_internal_encoding( 'utf-8' ); +if (function_exists('mb_internal_encoding')) { + mb_internal_encoding( 'utf-8' ); +} // take over display of help - in case we want to modify some of it function run_help( $task=null, $args=array(), $cliopts=array() )
fix: mbstring is optional
gggeek_ezextensionbuilder
train
php
3e0090bdaaa198c09544064395789e09535aa774
diff --git a/src/Event/Event.php b/src/Event/Event.php index <HASH>..<HASH> 100644 --- a/src/Event/Event.php +++ b/src/Event/Event.php @@ -36,8 +36,6 @@ use CultuurNet\UDB3\Location; use CultuurNet\UDB3\MediaObject; use CultuurNet\UDB3\Title; use CultuurNet\UDB3\Translation; -use CultuurNet\UDB3\TranslationsString; -use CultuurNet\UDB3\XmlString; use ValueObjects\String\String; class Event extends EventSourcedAggregateRoot
III-<I>: Optimize use statements in Event
cultuurnet_udb3-php
train
php
004a8ea072d280aaaa0cf431115103750ea0854e
diff --git a/tests/mocha-reporter.js b/tests/mocha-reporter.js index <HASH>..<HASH> 100644 --- a/tests/mocha-reporter.js +++ b/tests/mocha-reporter.js @@ -24,6 +24,17 @@ const Runner = require('mocha/lib/runner'); // Reported to Mocha with: https://github.com/mochajs/mocha/issues/3920 Runner.immediately = process.nextTick; +// Speedup Bluebird's unhandled rejection notifications +// So they do not interfere with an async leaks detector (configured below) +const BbPromise = require('bluebird'); +/* eslint-disable no-underscore-dangle */ +BbPromise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + process.nextTick(() => this._notifyUnhandledRejection()); +}; +/* eslint-enable */ + module.exports = class ServerlessSpec extends Spec { constructor(runner) { super(runner);
Speedup unhandled rejection notifications It's to ensure it doesn't interfere with async leaks detection
serverless_serverless
train
js
ca2702ed0450e84e471094e7e365466dc2a2322c
diff --git a/lib/enumerize/attribute.rb b/lib/enumerize/attribute.rb index <HASH>..<HASH> 100644 --- a/lib/enumerize/attribute.rb +++ b/lib/enumerize/attribute.rb @@ -172,7 +172,7 @@ module Enumerize def #{name}=(values) @_#{name}_enumerized_set = Enumerize::Set.new(self, self.class.enumerized_attributes[:#{name}], values) - raw_values = #{name}.values.map(&:value) + raw_values = self.#{name}.values.map(&:value) if defined?(super) super raw_values @@ -184,7 +184,7 @@ module Enumerize _enumerized_values_for_validation['#{name}'] = values.respond_to?(:map) ? values.reject(&:blank?).map(&:to_s) : values - #{name} + self.#{name} end RUBY end
do not accesse the constat when the first letter of the attribute is capitalized
brainspec_enumerize
train
rb
526f4ab3d2a2941d1bc4a2c16df2546869a08c4c
diff --git a/src/aiomanhole.py b/src/aiomanhole.py index <HASH>..<HASH> 100644 --- a/src/aiomanhole.py +++ b/src/aiomanhole.py @@ -100,6 +100,7 @@ class InteractiveInterpreter: continue if codeobj is None: + # partial compile, wait until next line continue else: try:
Document more unobvious behaviour.
nathan-hoad_aiomanhole
train
py
8d2d74abe24dcbaa08f4d329bb516f99ad3fd183
diff --git a/openxc/controllers/serial.py b/openxc/controllers/serial.py index <HASH>..<HASH> 100644 --- a/openxc/controllers/serial.py +++ b/openxc/controllers/serial.py @@ -26,5 +26,5 @@ class SerialControllerMixin(Controller): # TODO need to wait until device is connected or errors out # that may be a bug in the bluetooth stack, see # https://bugzilla.redhat.com/show_bug.cgi?id=1060457 - time.sleep(2) + time.sleep(5) return super(SerialControllerMixin, self).complex_request(request, blocking)
Increase serial connection wait time (for rfcomm Bluetooth socket).
openxc_openxc-python
train
py
87704e8d446fd7698b8d7ae05482aa0f5f5dcc22
diff --git a/Configuration/TCA/tt_address.php b/Configuration/TCA/tt_address.php index <HASH>..<HASH> 100644 --- a/Configuration/TCA/tt_address.php +++ b/Configuration/TCA/tt_address.php @@ -404,8 +404,7 @@ return array( 'address' => array( 'showitem' => 'address, --linebreak--, city, zip, region, --linebreak--, - country, --linebreak--, - latitude, longitude', + country' 'canNotCollapse' => 1 ), 'building' => array(
[BUGFIX] Don't show latitude/longitude in FormEngine Due to a non-existing possibility to deal with float values other than float2 in the database, the two fields are removed for editing for now.
FriendsOfTYPO3_tt_address
train
php
b17f6482c159d8944257e951f39d078d1652f50b
diff --git a/components/apps.js b/components/apps.js index <HASH>..<HASH> 100644 --- a/components/apps.js +++ b/components/apps.js @@ -52,6 +52,10 @@ SteamUser.prototype.gamesPlayed = function(apps, force) { SteamUser.prototype.kickPlayingSession = function(callback) { this._send(SteamUser.EMsg.ClientKickPlayingSession, {}); this.once('playingState', function(blocked, playingApp) { + if (!callback) { + return; + } + if (blocked) { callback(new Error("Cannot kick other session")); } else {
Don't try to call callback for kickPlayingSession if there isn't one
DoctorMcKay_node-steam-user
train
js
43b96f1e937c125fded8a16fda03ed2e63296e7c
diff --git a/cmd/juju/commands/bootstrap.go b/cmd/juju/commands/bootstrap.go index <HASH>..<HASH> 100644 --- a/cmd/juju/commands/bootstrap.go +++ b/cmd/juju/commands/bootstrap.go @@ -963,7 +963,7 @@ See `[1:] + "`juju kill-controller`" + `.`) if cloud.Type == k8sconstants.CAASProviderType { if cloud.HostCloudRegion == caas.K8sCloudOther { - ctx.Infof("Unable to identify bootstrapped Kubernetes cluster") + ctx.Infof("Bootstrap to generic Kubernetes cluster") } else { ctx.Infof("Bootstrap to Kubernetes cluster identified as %s", cloud.HostCloudRegion)
Slight change to k8s bootstrap wording in log - Based on feedback we are changing the generic case of bootstrap messages.
juju_juju
train
go
b2310e502f3937e3289c79594349cd9f2945b7bc
diff --git a/pyemma/coordinates/clustering/interface.py b/pyemma/coordinates/clustering/interface.py index <HASH>..<HASH> 100644 --- a/pyemma/coordinates/clustering/interface.py +++ b/pyemma/coordinates/clustering/interface.py @@ -63,6 +63,9 @@ class AbstractClustering(StreamingTransformer, Model, ClusterMixin): self._index_states = [] self.n_jobs = n_jobs + def set_model_params(self, clustercenters=None): + self.clustercenters = clustercenters + @property def n_jobs(self): """ Returns number of jobs/threads to use during assignment of data. diff --git a/pyemma/coordinates/transform/tica.py b/pyemma/coordinates/transform/tica.py index <HASH>..<HASH> 100644 --- a/pyemma/coordinates/transform/tica.py +++ b/pyemma/coordinates/transform/tica.py @@ -40,7 +40,12 @@ __all__ = ['TICA'] class TICAModel(Model): - pass + def set_model_params(self, mean=None, cov_tau=None, cov=None, + cumvar=None, eigenvalues=None, eigenvectors=None): + self.update_model_params(cov=cov, cov_tau=cov_tau, + mean=mean, cumvar=cumvar, + eigenvalues=eigenvalues, + eigenvectors=eigenvectors) @decorator
impl set_model_params to make serialization of model work
markovmodel_PyEMMA
train
py,py
3c2947fb07c373ea4dac56be4db6c111867f6028
diff --git a/bct/algorithms/distance.py b/bct/algorithms/distance.py index <HASH>..<HASH> 100644 --- a/bct/algorithms/distance.py +++ b/bct/algorithms/distance.py @@ -145,7 +145,7 @@ def charpath(D, include_diagonal=False): lambda_ = np.sum(D[D != np.inf]) / len(np.where(D != np.inf)[0]) # eccentricity for each vertex (ignore inf) - ecc = np.max(D * (D != np.inf), axis=1) + ecc = np.array(np.ma.masked_equal(D, np.inf).max(axis=1)) # radius of graph radius = np.min(ecc) # but what about zeros? @@ -155,8 +155,8 @@ def charpath(D, include_diagonal=False): # efficiency: mean of inverse entries of D[G] n = len(D) + np.fill_diagonal(D, np.inf) # so that the inverse is 0 D = 1 / D # invert distance - np.fill_diagonal(D, 0) # set diagonal to 0 efficiency = np.sum(D) / (n * (n - 1)) # compute global efficiency return lambda_, efficiency, ecc, radius, diameter
resolve #<I>, fix runtime warnings in distance.charpath
aestrivex_bctpy
train
py
bbf0b4ca5ad2cdf091f1da19db83d265a6b4f655
diff --git a/src/ManipulationSequence.php b/src/ManipulationSequence.php index <HASH>..<HASH> 100644 --- a/src/ManipulationSequence.php +++ b/src/ManipulationSequence.php @@ -130,9 +130,9 @@ class ManipulationSequence implements IteratorAggregate return $argument; } } - - return; } + + return; } /* diff --git a/tests/Manipulations/OptimizeTest.php b/tests/Manipulations/OptimizeTest.php index <HASH>..<HASH> 100644 --- a/tests/Manipulations/OptimizeTest.php +++ b/tests/Manipulations/OptimizeTest.php @@ -21,6 +21,19 @@ class OptimizeTest extends TestCase } /** @test */ + public function it_can_optimize_an_image_when_using_apply() + { + $targetFile = $this->tempDir->path('optimized.jpg'); + + Image::load($this->getTestFile('test.jpg')) + ->apply() + ->optimize() + ->save($targetFile); + + $this->assertFileExists($targetFile); + } + + /** @test */ public function it_can_optimize_an_image_with_the_given_optimization_options() { $targetFile = $this->tempDir->path('optimized.jpg');
Fixes `optimize()` when used with `apply()` (#<I>) (#<I>) * Don't return after first group loop * Add tests
spatie_image
train
php,php
243ba70b33b5a570b9d350b7abd6c924599e0f63
diff --git a/lib/homesick.rb b/lib/homesick.rb index <HASH>..<HASH> 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -234,7 +234,7 @@ class Homesick < Thor if shell.yes?("This will destroy your castle irreversible! Are you sure?") unlink(name) - rm_r castle_dir(name) + rm_rf castle_dir(name) end end diff --git a/lib/homesick/actions.rb b/lib/homesick/actions.rb index <HASH>..<HASH> 100644 --- a/lib/homesick/actions.rb +++ b/lib/homesick/actions.rb @@ -105,6 +105,7 @@ class Homesick def rm_rf(dir) say_status "rm -rf #{dir}", '', :green unless options[:quiet] + system "rm -rf #{dir}" end def rm_link(target)
using rm_rf to avoid confirmations on delete
technicalpickles_homesick
train
rb,rb
90679ec3702bfea8b6cd372bbdafa3d6b85d0549
diff --git a/lib/DataManager/ArrayManager.php b/lib/DataManager/ArrayManager.php index <HASH>..<HASH> 100644 --- a/lib/DataManager/ArrayManager.php +++ b/lib/DataManager/ArrayManager.php @@ -356,6 +356,11 @@ abstract class ArrayManager implements \ArrayAccess,\Countable,\Iterator { return $data; } + + public function dataPrepareStoringAndFormat ($data) + { + return $data; + } }; } }
Fix ArrayManager (theorical)
julien-boudry_Condorcet
train
php
d646ef7a3722eb788b72e1f9209e568b1e3eacc3
diff --git a/openquake/engine/engine2.py b/openquake/engine/engine2.py index <HASH>..<HASH> 100644 --- a/openquake/engine/engine2.py +++ b/openquake/engine/engine2.py @@ -476,6 +476,7 @@ def del_haz_calc(hc_id): ' calculation: %s' ) + # check for a reference to hazard outputs assoc_outputs = models.RiskCalculation.objects.filter( hazard_output__oq_job__hazard_calculation=hc_id ) @@ -483,6 +484,7 @@ def del_haz_calc(hc_id): raise RuntimeError(msg % ', '.join([str(x.id) for x in assoc_outputs])) + # check for a reference to the hazard calculation itself assoc_calcs = models.RiskCalculation.objects.filter( hazard_calculation=hc_id )
engine2: Added a couple of comments to del_haz_calc. Former-commit-id: <I>f<I>eec<I>b<I>f<I>a<I>e0b<I>e7fb5e
gem_oq-engine
train
py
5994f9afc5de5d008b43f65a63bc6fb82665f5cb
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ class IterableAsyncStream { return this._pendingPromise; } this._pendingPromise = new Promise((resolve) => { - const dataBuffer = []; + let dataBuffer = []; this._writeData = (data) => { dataBuffer.push(data); if (dataBuffer.length === 1) { @@ -35,7 +35,7 @@ class IterableAsyncStream { } }; }); - const buffer = await this._pendingPromise; + let buffer = await this._pendingPromise; delete this._pendingPromise; return buffer; } @@ -47,9 +47,9 @@ class IterableAsyncStream { } async *createDataStream() { - const dataBufferStream = this.createDataBufferStream(); - for await (const dataBuffer of dataBufferStream) { - for (const data of dataBuffer) { + let dataBufferStream = this.createDataBufferStream(); + for await (let dataBuffer of dataBufferStream) { + for (let data of dataBuffer) { if (data === END_SYMBOL) { return; }
Use let instead of const were appropriate
SocketCluster_writable-consumable-stream
train
js
2735f5291fcfa75097880717d2880b2ea8287349
diff --git a/lib/fog/openstack/requests/compute/create_server.rb b/lib/fog/openstack/requests/compute/create_server.rb index <HASH>..<HASH> 100644 --- a/lib/fog/openstack/requests/compute/create_server.rb +++ b/lib/fog/openstack/requests/compute/create_server.rb @@ -12,15 +12,12 @@ module Fog } } - if options['metadata'] - data['server']['metadata'] = options['metadata'] - end - if options['accessIPv4'] - data['server']['accessIPv4'] = options['accessIPv4'] - end - if options['accessIPv6'] - data['server']['accessIPv6'] = options['accessIPv6'] + vanilla_options = ['metadata', 'accessIPv4', 'accessIPv6', + 'availability_zone', 'user_data'] + vanilla_options.select{|o| options[o]}.each do |key| + data['server'][key] = options[key] end + if options['personality'] data['server']['personality'] = [] for file in options['personality'] @@ -30,9 +27,7 @@ module Fog } end end - if options['availability_zone'] - data['server']['availability_zone'] = options['availability_zone'] - end + request( :body => MultiJson.encode(data), :expects => [200, 202],
Compact the way options are mapped to request.
fog_fog
train
rb
812ce99d4fa650086f3f491116ed6f1bc3456847
diff --git a/stabilizer/src/main/java/com/hazelcast/stabilizer/agent/workerjvm/WorkerJvmManager.java b/stabilizer/src/main/java/com/hazelcast/stabilizer/agent/workerjvm/WorkerJvmManager.java index <HASH>..<HASH> 100644 --- a/stabilizer/src/main/java/com/hazelcast/stabilizer/agent/workerjvm/WorkerJvmManager.java +++ b/stabilizer/src/main/java/com/hazelcast/stabilizer/agent/workerjvm/WorkerJvmManager.java @@ -114,6 +114,10 @@ public class WorkerJvmManager { Map<WorkerJvm, Future> futures = new HashMap<WorkerJvm, Future>(); for (WorkerJvm workerJvm : workers) { + if(workerJvm.oomeDetected){ + continue; + } + TestCommandFuture future = new TestCommandFuture(testCommand); TestCommandRequest request = new TestCommandRequest(); request.id = requestIdGenerator.incrementAndGet();
When oome, no calls needed on worker
hazelcast_hazelcast-simulator
train
java
1c8a05b611b8bf14ec680d6a7d9c447562504b00
diff --git a/src/client.js b/src/client.js index <HASH>..<HASH> 100644 --- a/src/client.js +++ b/src/client.js @@ -159,7 +159,9 @@ Client.prototype.close = function (err) { this._changeState(this.STATE_LOGOUT) clearTimeout(this._idleTimeout) this.logger.debug('Closing connection...') - return this.client.close(err) + return this.client.close(err).then(() => { + clearTimeout(this._idleTimeout) + }) } /**
There is a possible race condition between Idle and closing a connection Clear the idle timeout after that connection finishes closing Fixes emailjs/emailjs-imap-client#<I>
emailjs_emailjs-imap-client
train
js
b396130854fba1608ba797d9a1c3c7698b05608f
diff --git a/src/article/shared/EditEntityCommand.js b/src/article/shared/EditEntityCommand.js index <HASH>..<HASH> 100644 --- a/src/article/shared/EditEntityCommand.js +++ b/src/article/shared/EditEntityCommand.js @@ -27,8 +27,16 @@ export default class EditEntityCommand extends Command { const viewName = appState.get('viewName') if (viewName !== 'metadata') { const sel = params.selection + const nodeId = sel.nodeId context.editor.send('updateViewName', 'metadata') - context.articlePanel.refs.content.send('scrollTo', { nodeId: sel.nodeId }) + // HACK: using the ArticlePanel instance to get to the current editor + // so that we can dispatch 'executeCommand' + let editor = context.articlePanel.refs.content + editor.send('scrollTo', { nodeId }) + // HACK: this is a mess because context.api is a different instance after + // switching to metadata view + // TODO: we should extend ArticleAPI to allow for this + editor.api.selectFirstRequiredPropertyOfMetadataCard(nodeId) } } }
Set selection when editing an entity from manuscript view.
substance_texture
train
js
1d7b44a07ccf8064aebb0cb31c8703a43c016a77
diff --git a/languagetool-standalone/src/main/java/org/languagetool/gui/Main.java b/languagetool-standalone/src/main/java/org/languagetool/gui/Main.java index <HASH>..<HASH> 100644 --- a/languagetool-standalone/src/main/java/org/languagetool/gui/Main.java +++ b/languagetool-standalone/src/main/java/org/languagetool/gui/Main.java @@ -1100,8 +1100,8 @@ public final class Main { public void actionPerformed(ActionEvent e) { try { addLanguage(); - } catch (InstantiationException | IllegalAccessException ex) { - throw new RuntimeException(ex); + } catch (Exception ex) { + Tools.showError(ex); } } }
fix: loading an invalid rule file printed the error only to stdout instead of showing a dialog
languagetool-org_languagetool
train
java
578167fd9fff35be9e1eda2f4ff43df3b93d42fa
diff --git a/webapps/grunt/config/less.js b/webapps/grunt/config/less.js index <HASH>..<HASH> 100644 --- a/webapps/grunt/config/less.js +++ b/webapps/grunt/config/less.js @@ -27,12 +27,12 @@ module.exports = function(config, lessConfig, pathConfig) { options: { paths: includePaths, - compress: true, + compress: false, sourceMap: true, - sourceMapFilename: (pathConfig.plugin ? 'plugin' : 'styles') + '.css.map', - sourceMapURL: (pathConfig.plugin ? 'plugin' : 'styles') + '.css.map', - sourceMapFileInline: false + sourceMapFilename: outputFilepath + '.map', + sourceMapURL: './' + (pathConfig.plugin ? 'plugin' : 'styles') + '.css.map', + sourceMapFileInline: true }, files: file }; @@ -46,12 +46,12 @@ module.exports = function(config, lessConfig, pathConfig) { options: { paths: includePaths, - compress: true, + compress: false, sourceMap: true, - sourceMapFilename: 'styles-components.css.map', + sourceMapFilename: outputFilepath + '.map', sourceMapURL: './styles-components.css.map', - sourceMapFileInline: false + sourceMapFileInline: true }, files: file };
fix(less-build): correct the source map paths Related to CAM-<I>
camunda_camunda-bpm-platform
train
js
9957a355cf7db51d602a47377da69f5094229c9a
diff --git a/greycat/src/main/java/greycat/workers/MailboxRegistry.java b/greycat/src/main/java/greycat/workers/MailboxRegistry.java index <HASH>..<HASH> 100644 --- a/greycat/src/main/java/greycat/workers/MailboxRegistry.java +++ b/greycat/src/main/java/greycat/workers/MailboxRegistry.java @@ -15,8 +15,7 @@ */ package greycat.workers; -import java.util.LinkedList; -import java.util.Map; +import java.util.*; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; @@ -82,7 +81,9 @@ public class MailboxRegistry { public static final byte[] VOID_TASK_NOTIFY = new byte[0]; public void notifyMailboxes() { - mailboxMap.values().forEach(new Consumer<WorkerMailbox>() { + List<WorkerMailbox> valuesList = new ArrayList<>(mailboxMap.values()); + Collections.shuffle( valuesList ); + valuesList.forEach(new Consumer<WorkerMailbox>() { @Override public void accept(WorkerMailbox mailbox) { if (mailbox.canProcessGeneralTaskQueue()) {
Randomize workers wake-up Avoid that it's always the first GP worker taking the tasks
datathings_greycat
train
java
0a3a60bd6f9cb570e346ffef7953babf630ae8a3
diff --git a/test/geocoders/nominatim.py b/test/geocoders/nominatim.py index <HASH>..<HASH> 100644 --- a/test/geocoders/nominatim.py +++ b/test/geocoders/nominatim.py @@ -269,7 +269,13 @@ class BaseNominatimTestCase(with_metaclass(ABCMeta, object)): {"query": query, "extratags": True}, {}, ) - self.assertEqual(location.raw['extratags']['wikidata'], 'Q220728') + # Nominatim and OpenMapQuest contain the following in extratags: + # {'wikidata': 'Q220728', 'wikipedia': 'en:Flatiron Building'} + # But PickPoint *sometimes* returns the following instead: + # {'wikidata': 'Q1427377'} + # So let's simply consider just having the `wikidata` key + # in response a success. + self.assertTrue(location.raw['extratags']['wikidata']) class NominatimTestCase(BaseNominatimTestCase, GeocoderTestBase):
Nominatim tests: fix failing pickpoint extratags test
geopy_geopy
train
py
a93172d7fde7f899a0e68fc3ff2818c5b604f62f
diff --git a/lib/big_brother/version.rb b/lib/big_brother/version.rb index <HASH>..<HASH> 100644 --- a/lib/big_brother/version.rb +++ b/lib/big_brother/version.rb @@ -1,3 +1,3 @@ module BigBrother - VERSION = "0.6.4" + VERSION = "0.6.5" end
Bump verson to <I>
braintree_big_brother
train
rb
3f4e374911cddabe18acfb54c9fcf015733dd44b
diff --git a/twython/twython.py b/twython/twython.py index <HASH>..<HASH> 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -162,7 +162,6 @@ class Twython(object): if self.client is None: # If they don't do authentication, but still want to request # unprotected resources, we need an opener. - print proxies self.client = requests.session(proxies=proxies) # register available funcs to allow listing name when debugging.
fixed the mistake that prints proxies to console for debugging.
ryanmcgrath_twython
train
py
4e0da0a13f6979385227b85da2ea9c5f95f67bde
diff --git a/src/frontend/org/voltdb/sysprocs/saverestore/StreamSnapshotWritePlan.java b/src/frontend/org/voltdb/sysprocs/saverestore/StreamSnapshotWritePlan.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/sysprocs/saverestore/StreamSnapshotWritePlan.java +++ b/src/frontend/org/voltdb/sysprocs/saverestore/StreamSnapshotWritePlan.java @@ -150,7 +150,10 @@ public class StreamSnapshotWritePlan extends SnapshotWritePlan boolean deleteTuples = false; if (!table.getIsreplicated()) { predicate = createPredicateForTable(table, config); - deleteTuples = true; + // Only delete tuples if there is a predicate, e.g. elastic join + if (predicate != null) { + deleteTuples = true; + } } /*
ENG-<I>: Fix a bug in stream snapshot planning where it will delete all snapshotted tuples. It should only perform deletion if it's used for migrating partitioned table data.
VoltDB_voltdb
train
java
6d489a1004dc3f7fa1ebffb66f6cebc2a0278fe7
diff --git a/db_test.go b/db_test.go index <HASH>..<HASH> 100644 --- a/db_test.go +++ b/db_test.go @@ -707,7 +707,9 @@ func TestWALSegmentSizeOption(t *testing.T) { testutil.Ok(t, app.Commit()) } - files, err := ioutil.ReadDir(filepath.Join(db.Dir(), "wal")) + dbDir := db.Dir() + db.Close() + files, err := ioutil.ReadDir(filepath.Join(dbDir, "wal")) testutil.Assert(t, len(files) > 1, "current WALSegmentSize should result in more than a single WAL file.") testutil.Ok(t, err) for i, f := range files {
fix TestWALSegmentSizeOption for windows. (#<I>)
prometheus_prometheus
train
go