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
1a231bf3db468cc759337447e9b79a0e9f83e7d7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -127,7 +127,7 @@ def package_assets(example_path): ### dependencies ### _required = [ - 'bokeh >=0.12.13', # not strictly required but shouldn't be problematic + 'bokeh >=0.12.15', # not strictly required but shouldn't be problematic 'cartopy >=0.14.2', # prevents pip alone (requires external package manager) 'holoviews >=1.10.1', 'numpy >=1.0',
Bumped bokeh version requirement
pyviz_geoviews
train
py
49e5797bc03d60431e3ccc2a086fb9f8ffbb53cb
diff --git a/util/pkg/vfs/gsfs.go b/util/pkg/vfs/gsfs.go index <HASH>..<HASH> 100644 --- a/util/pkg/vfs/gsfs.go +++ b/util/pkg/vfs/gsfs.go @@ -19,7 +19,6 @@ package vfs import ( "bytes" "encoding/base64" - "encoding/hex" "fmt" "io" "net/http" @@ -351,7 +350,7 @@ func (p *GSPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) { return nil, nil } - md5Bytes, err := hex.DecodeString(md5) + md5Bytes, err := base64.StdEncoding.DecodeString(md5) if err != nil { return nil, fmt.Errorf("Etag was not a valid MD5 sum: %q", md5) }
Google Cloud Storage md5 decoding fix The MD5 is presented base<I> encoded; we were trying to decode it as hex.
kubernetes_kops
train
go
b3a67a8bd488848f692ca9a4425407de69d81548
diff --git a/api-server.py b/api-server.py index <HASH>..<HASH> 100755 --- a/api-server.py +++ b/api-server.py @@ -58,7 +58,7 @@ def custom_background_code(): def main(): parser = argparse.ArgumentParser() - group = parser.add_mutually_exclusive_group() + group = parser.add_mutually_exclusive_group(required=True) group.add_argument("-m", "--mainnet", action="store_true", default=False, help="Use MainNet instead of the default TestNet") group.add_argument("-p", "--privnet", action="store_true", default=False,
need to manually specify the network to run on
CityOfZion_neo-python
train
py
9d89b3b62048ed4f828ff982a9b3ed3a448bd561
diff --git a/tests/system/Database/Live/ModelTest.php b/tests/system/Database/Live/ModelTest.php index <HASH>..<HASH> 100644 --- a/tests/system/Database/Live/ModelTest.php +++ b/tests/system/Database/Live/ModelTest.php @@ -212,7 +212,7 @@ class ModelTest extends CIDatabaseTestCase $record = $model->first(); - $this->assertEquals(1, count($record)); + $this->assertInstanceOf('stdClass', $record); $this->assertEquals('foo', $record->key); }
Fix tests for no primary key first call.
codeigniter4_CodeIgniter4
train
php
8ecdda68fb0a8ea2eb8cd32aa0ce433c5638cb4e
diff --git a/lib/Doctrine/MongoDB/Query/Builder.php b/lib/Doctrine/MongoDB/Query/Builder.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/MongoDB/Query/Builder.php +++ b/lib/Doctrine/MongoDB/Query/Builder.php @@ -566,8 +566,8 @@ class Builder /** * Set sort and erase all old sorts. * - * @param $fieldName - * @param null $order + * @param string $fieldName + * @param string $order * @return Builder */ public function sort($fieldName, $order = null) @@ -613,8 +613,8 @@ class Builder /** * Specify a map reduce operation for this query. * - * @param $map - * @param $reduce + * @param string $map + * @param string $reduce * @param array $out * @param array $options * @return Builder
Added parameter types wherver it was missing in PHPDoc blocks.
doctrine_mongodb
train
php
0f40819966d0d98414626d77c4f5ef6ba671e1e0
diff --git a/lib/active_remote/rpc.rb b/lib/active_remote/rpc.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/rpc.rb +++ b/lib/active_remote/rpc.rb @@ -13,8 +13,7 @@ module ActiveRemote # Execute an RPC call to the remote service and return the raw response. # def remote_call(rpc_method, request_args) - remote = self.new - remote.execute(rpc_method, request_args) + rpc.execute(rpc_method, request_args) end # Return a protobuf request object for the given rpc request. @@ -32,6 +31,12 @@ module ActiveRemote def request_type(rpc_method) service_class.rpcs[rpc_method].request_type end + + # TODO: Make this a first class citizen instead of embedding it inside + # the remote class + def rpc + self.new + end end # Invoke an RPC call to the service for the given rpc method. @@ -58,7 +63,11 @@ module ActiveRemote # Execute an RPC call to the remote service and return the raw response. # def remote_call(rpc_method, request_args) - self.execute(rpc_method, request_args) + rpc.execute(rpc_method, request_args) + end + + def rpc + self.class.rpc end private
Execute RPC calls using .rpc instead of instances Currently, the RPC module is mixed into ARem::Base. This is a bad pattern that couples the RPC layer with the data model. Instead, there should be a clean separation much like AR's database connection. This is the first step in unraveling all the things.
liveh2o_active_remote
train
rb
712de32caed02af976b1a0aff132e321178f6bb5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -8,8 +8,8 @@ setup( version=version, author='Tarken', author_email='?', - maintainer = 'Mikhail Korobov', - maintainer_email='kmike84@gmail.com', +# maintainer = 'Mikhail Korobov', +# maintainer_email='kmike84@gmail.com', packages=['excel_response'],
pypi shows me instead of Tarken if maintainer meta info is in distutils options.
tarkatronic_django-excel-response
train
py
b82213381f0f183bd9efb4828112e0f2ee95c14a
diff --git a/pyramid_swagger/__about__.py b/pyramid_swagger/__about__.py index <HASH>..<HASH> 100644 --- a/pyramid_swagger/__about__.py +++ b/pyramid_swagger/__about__.py @@ -12,7 +12,7 @@ __title__ = "pyramid_swagger" __summary__ = "Swagger tools for use in pyramid webapps" __uri__ = "" -__version__ = "0.3.2" +__version__ = "0.4.0" __author__ = "Scott Triglia" __email__ = "striglia@yelp.com"
Bump to <I> now that path validation is implemented
striglia_pyramid_swagger
train
py
ca6fbc35cae4a1e6a9126fe638bb6006221634fe
diff --git a/werkzeug/wrappers.py b/werkzeug/wrappers.py index <HASH>..<HASH> 100644 --- a/werkzeug/wrappers.py +++ b/werkzeug/wrappers.py @@ -1003,13 +1003,13 @@ class BaseResponse(object): the cookie should last only as long as the client's browser session. :param expires: should be a `datetime` object or UNIX timestamp. + :param path: limits the cookie to a given path, per default it will + span the whole domain. :param domain: if you want to set a cross-domain cookie. For example, ``domain=".example.com"`` will set a cookie that is readable by the domain ``www.example.com``, ``foo.example.com`` etc. Otherwise, a cookie will only be readable by the domain that set it. - :param path: limits the cookie to a given path, per default it will - span the whole domain. :param secure: If `True`, the cookie will only be available via HTTPS :param httponly: disallow JavaScript to access the cookie. This is an extension to the cookie standard and probably not
Reorder `path` param docstring in set_cookie This is minor change which simply reorders the parameter documention in BaseResponse.set_cookie such that the order matches the order in which the parameters are defined in the method signature.
pallets_werkzeug
train
py
7614798f9c855720dcf3db7db9ec55b88211aba9
diff --git a/billy/site/urls.py b/billy/site/urls.py index <HASH>..<HASH> 100644 --- a/billy/site/urls.py +++ b/billy/site/urls.py @@ -3,4 +3,5 @@ from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^api/', include('billy.site.api.urls')), (r'^browse/', include('billy.site.browse.urls')), + (r'^web/', include('billy.site.web.urls')), )
included /web/ urls
openstates_billy
train
py
3564ecf4fe8cad83cb61a607a41ac287bceb2ea8
diff --git a/openquake/hazardlib/imt.py b/openquake/hazardlib/imt.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/imt.py +++ b/openquake/hazardlib/imt.py @@ -20,7 +20,7 @@ types. import operator -__all__ = ('PGA', 'PGV', 'PGD', 'SA', 'IA', 'CSV', 'RSD', 'MMI') +__all__ = ('PGA', 'PGV', 'PGD', 'SA', 'IA', 'CAV', 'RSD', 'MMI') class _IMT(tuple):
Fixes error in imt file - CSV changed to CAV
gem_oq-engine
train
py
2c7a99df559753d995fc181733d9204433082921
diff --git a/test/RedisCommandsTest.php b/test/RedisCommandsTest.php index <HASH>..<HASH> 100644 --- a/test/RedisCommandsTest.php +++ b/test/RedisCommandsTest.php @@ -1285,6 +1285,21 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase { ); $this->assertEquals(array(1, 2, 3, 10, 30, 100), $this->redis->listRange('ordered', 0, -1)); + // with parameter GET + $this->redis->pushTail('uids', 1003); + $this->redis->pushTail('uids', 1001); + $this->redis->pushTail('uids', 1002); + $this->redis->pushTail('uids', 1000); + $sortget = array( + 'uid:1000' => 'foo', 'uid:1001' => 'bar', + 'uid:1002' => 'hoge', 'uid:1003' => 'piyo' + ); + $this->redis->setMultiple($sortget); + $this->assertEquals( + array_values($sortget), + $this->redis->sort('uids', array('get' => 'uid:*')) + ); + // wront type RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) { $test->redis->set('foo', 'bar');
Added missing test for SORT ... GET
imcj_predis
train
php
0b9eba7078824065a8cd34d0c0bf3b652746777b
diff --git a/lib/pg_search/features/tsearch.rb b/lib/pg_search/features/tsearch.rb index <HASH>..<HASH> 100644 --- a/lib/pg_search/features/tsearch.rb +++ b/lib/pg_search/features/tsearch.rb @@ -42,7 +42,7 @@ module PgSearch # If :prefix is true, then the term will have :* appended to the end. # If :negated is true, then the term will have ! prepended to the front. terms = [ - ('!' if negated), + (Compatibility.build_quoted('!') if negated), Compatibility.build_quoted("' "), term_sql, Compatibility.build_quoted(" '"),
Use Compatibility.build_quoted to fix <I> support The version of Arel that Active Record <I> uses requires string literals to be quoted.
Casecommons_pg_search
train
rb
52c998d5c35a080c403c2ac3a8eec49c43ff1ccc
diff --git a/notemplate.js b/notemplate.js index <HASH>..<HASH> 100644 --- a/notemplate.js +++ b/notemplate.js @@ -48,7 +48,7 @@ function getWindow(str) { window.setTimeout = function(fun, tt) { fun(); }; window.run(jquery); window.setTimeout = tempfun; - jqueryPatches(window.jQuery); + window.jQuery.ajax = window.jQuery.globalEval = function() {}; return window; } @@ -70,17 +70,6 @@ function outer($nodes) { return ret; } -function jqueryPatches($) { - // jQuery monkey-patch - $.buildFragmentOrig = $.buildFragment; - $.buildFragment = function(args, nodes, scripts) { - var r = $.buildFragmentOrig(args, nodes, scripts); - // or else script.contentText will be run, this is a security risk - if (Array.isArray(scripts)) scripts.length = 0; - return r; - }; -} - function merge(view, options, callback) { var window = view.window; var $ = window.$;
Disable jQuery ajax and globalEval, prevents some script tags to be prepended to head, or to be eval'd.
edasarl_express-notemplate
train
js
ec0f2a4feb6b76642f764d1c06f0d3c3760d7dc8
diff --git a/lib/svtplay_dl/subtitle/__init__.py b/lib/svtplay_dl/subtitle/__init__.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/subtitle/__init__.py +++ b/lib/svtplay_dl/subtitle/__init__.py @@ -2,10 +2,9 @@ import xml.etree.ElementTree as ET import json import re from svtplay_dl.log import log -from svtplay_dl.utils import is_py2, is_py3, decode_html_entities +from svtplay_dl.utils import is_py2, is_py3, decode_html_entities, HTTP from svtplay_dl.utils.io import StringIO from svtplay_dl.output import output -from requests import Session from requests import __build__ as requests_version import platform @@ -16,7 +15,7 @@ class subtitle(object): self.subtitle = None self.options = options self.subtype = subtype - self.http = Session() + self.http = HTTP(options) self.subfix = subfix def download(self):
subtitle: use HTTP from utils instead of requets.
spaam_svtplay-dl
train
py
dce3f366cc76c13842fc034d698aa714717f9a2f
diff --git a/pymongo/__init__.py b/pymongo/__init__.py index <HASH>..<HASH> 100644 --- a/pymongo/__init__.py +++ b/pymongo/__init__.py @@ -70,7 +70,7 @@ SLOW_ONLY = 1 ALL = 2 """Profile all operations.""" -version_tuple = (3, 0, 2, 'dev0') +version_tuple = (3, 0, 2, '.dev0') def get_version_string(): if isinstance(version_tuple[-1], str):
Start <I> with proper formatting.
mongodb_mongo-python-driver
train
py
9e6e94b47959f90d505cec15962f8e161db552b9
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -431,10 +431,12 @@ class App * Runs app and echo rendered template. * * @throws \atk4\core\Exception + * @throws ExitApplicationException */ public function run() { try { + $this->run_called = true; $this->hook('beforeRender'); $this->is_rendering = true; @@ -457,9 +459,11 @@ class App } echo $this->html->template->render(); - } catch(ExitApplicationException $e) - { + } catch (ExitApplicationException $e) { + $this->callExit(); + } catch (\Throwable $e) { + $this->caughtException($e); } } @@ -923,7 +927,16 @@ class App } if (!$this->run_called) { - $this->run(); + try { + $this->run(); + } catch (ExitApplicationException $e) { + // already in shutdown + } catch (\Exception $e) { + $this->caughtException($e); + } + + // call with true to trigger beforeExit event + $this->callExit(true); } } );
refactor on shutdown for ExitApplicationException
atk4_ui
train
php
ff4f56d8bdcca9c1f93675ebe5976b770bb5c3e6
diff --git a/src/linear-converter.js b/src/linear-converter.js index <HASH>..<HASH> 100644 --- a/src/linear-converter.js +++ b/src/linear-converter.js @@ -82,7 +82,7 @@ module.exports = function factory(Decimal) { * @return {Boolean} whether the presets are equivalent or not */ api.equivalentPresets = function equivalentPresets(presetA, presetB) { - return [api.getCoefficientA, api.getCoefficientB].every(function(coefficient) { + return [api.getCoefficientB, api.getCoefficientA].every(function(coefficient) { return coefficient(presetA).equals(coefficient(presetB)); }); };
perf: check coef b for equiv first as it is less expensive
javiercejudo_linear-converter
train
js
a0708a1412dbabf1dc7a564017f08df980710480
diff --git a/src/search/QuickOpen.js b/src/search/QuickOpen.js index <HASH>..<HASH> 100644 --- a/src/search/QuickOpen.js +++ b/src/search/QuickOpen.js @@ -264,7 +264,7 @@ define(function (require, exports, module) { (regInfo[1] && isNaN(regInfo[1])) || (regInfo[3] && isNaN(regInfo[3]))) { - return; + return null; } result = {
Return null instead of just undefined
adobe_brackets
train
js
002ec781e49c97a09b0984234f218acc38a343f7
diff --git a/src/Native5/Route/HttpRequest.php b/src/Native5/Route/HttpRequest.php index <HASH>..<HASH> 100644 --- a/src/Native5/Route/HttpRequest.php +++ b/src/Native5/Route/HttpRequest.php @@ -72,14 +72,11 @@ class HttpRequest implements Request * @param mixed $key Param to retrieve based on key * * @access public - * @return void + * @return mixed Request param value */ public function getParam($key) { - if(isset($this->_rawRequest[$key])) - return $this->_rawRequest[$key]; - return null; - + isset($this->_rawRequest[$key]) ? $this->_rawRequest[$key] : null; }//end getParam() @@ -97,6 +94,19 @@ class HttpRequest implements Request /** + * hasParam + * + * @param mixed $key Param to check based on key + * + * @access public + * @return boolean True if request has the param, false otherwise + */ + public function hasParam($key) + { + isset($this->_rawRequest[$key]) ? true : false; + } + + /** * setKeys * * @param mixed $keys Mandatory Keys or not.
Added hasParam method to HttpRequest
native5_native5-sdk-client-php
train
php
e7f5cdb9ffd788a6f2e739e01b12f451df6e808a
diff --git a/themes-root/pressbooks-publisher-one/pb-catalog.php b/themes-root/pressbooks-publisher-one/pb-catalog.php index <HASH>..<HASH> 100644 --- a/themes-root/pressbooks-publisher-one/pb-catalog.php +++ b/themes-root/pressbooks-publisher-one/pb-catalog.php @@ -250,7 +250,7 @@ $h1_title = __( 'Catalog', 'pressbooks' ); ?> </div> <!-- end .catalog-content--> <div class="footer"> - <p> <a href="/">PressBooks: the CMS for Books.</a></p> + <p> <a href="http://pressbooks.com">PressBooks: the CMS for Books.</a></p> </div> </div> <!-- end .catalog-content-wrap -->
Ticket #<I>: 6. footer should link to pressbooks.com
pressbooks_pressbooks
train
php
917722be1642a9ceae2e7cb6f30452cd7a80f52a
diff --git a/graftm/tree_decorator.py b/graftm/tree_decorator.py index <HASH>..<HASH> 100644 --- a/graftm/tree_decorator.py +++ b/graftm/tree_decorator.py @@ -228,7 +228,8 @@ class TreeDecorator: self._rename(node, '; '.join(tax_string_array)) node.tax = len(tax_string_array) logging.info("Writing decorated tree to file: %s" % output_tree) - self.tree.write(path=output_tree, schema="newick") + if output_tree: + self.tree.write(path=output_tree, schema="newick") if output_tax: self._write_consensus_strings(output_tax)
do not attempt to write tree if no output file is provided
geronimp_graftM
train
py
491c8ab4c1e867c160b2a550356cfb18f9e2f047
diff --git a/rpc/lib/server/http_server.go b/rpc/lib/server/http_server.go index <HASH>..<HASH> 100644 --- a/rpc/lib/server/http_server.go +++ b/rpc/lib/server/http_server.go @@ -25,7 +25,7 @@ func StartHTTPServer(listenAddr string, handler http.Handler, logger log.Logger) } proto, addr = parts[0], parts[1] - logger.Info(fmt.Sprintf("Starting RPC HTTP server on %s socket %v", proto, addr)) + logger.Info(fmt.Sprintf("Starting RPC HTTP server on %s", listenAddr)) listener, err = net.Listen(proto, addr) if err != nil { return nil, errors.Errorf("Failed to listen on %v: %v", listenAddr, err) @@ -49,7 +49,7 @@ func StartHTTPAndTLSServer(listenAddr string, handler http.Handler, certFile, ke } proto, addr = parts[0], parts[1] - logger.Info(fmt.Sprintf("Starting RPC HTTPS server on %s socket %v", proto, addr)) + logger.Info(fmt.Sprintf("Starting RPC HTTPS server on %s (cert: %q, key: %q)", listenAddr, certFile, keyFile)) listener, err = net.Listen(proto, addr) if err != nil { return nil, errors.Errorf("Failed to listen on %v: %v", listenAddr, err)
[rpc/lib] log cert and key files in StartHTTPAndTLSServer
tendermint_tendermint
train
go
23234ba732aa1afc9d21cd6995439a9b1ba4bd5c
diff --git a/src/Storage/Repository.php b/src/Storage/Repository.php index <HASH>..<HASH> 100644 --- a/src/Storage/Repository.php +++ b/src/Storage/Repository.php @@ -50,10 +50,12 @@ class Repository implements ObjectRepository */ public function create($params = [], ClassMetadata $metadata = null) { - $entity = $this->getEntityBuilder()->create($params, $metadata); - $preEventArgs = new HydrationEvent($params, ['entity' => $entity, 'repository' => $this]); + $params = new ArrayObject($params); + $preEventArgs = new HydrationEvent($params, ['repository' => $this]); $this->event()->dispatch(StorageEvents::PRE_HYDRATE, $preEventArgs); - $this->event()->dispatch(StorageEvents::POST_HYDRATE, $preEventArgs); + $entity = $this->getEntityBuilder()->create($params, $metadata); + $postEventArgs = new HydrationEvent($params, ['entity' => $entity, 'repository' => $this]); + $this->event()->dispatch(StorageEvents::POST_HYDRATE, $postEventArgs); return $entity; } @@ -325,7 +327,7 @@ class Repository implements ObjectRepository /** * Saves a single object. * - * @param object $entity The entity to delete. + * @param object $entity The entity to save. * @param bool $silent Suppress events * * @return bool
improve logic of hydration events on create
bolt_bolt
train
php
de4ed1ee7f13528598443b5deafd131b47eb340b
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -269,7 +269,6 @@ module Puppet::Network::HTTP::Handler end def configure_profiler(request_params) - Puppet.debug(request_params.to_yaml) if request_params.include?(:profile) Puppet::Util::Profiler.current = Puppet::Util::Profiler::WallClock.new(Puppet.method(:debug), request_params.object_id) else
(Maint) Remove accidentally added debug line I had added the debug of the request parameters at some point in order to understand what they were. That had accidentally been committed.
puppetlabs_puppet
train
rb
c1939b713602b6752150d3fd1b974f022baeec58
diff --git a/querier.go b/querier.go index <HASH>..<HASH> 100644 --- a/querier.go +++ b/querier.go @@ -413,12 +413,15 @@ func (s *populatedChunkSeries) Next() bool { for s.set.Next() { lset, chks := s.set.At() - from := -1 - for i, c := range chks { - if c.MaxTime < s.mint { - from = i - continue + for len(chks) > 0 { + if chks[0].MaxTime >= s.mint { + break } + chks = chks[1:] + } + + // Break out at the first chunk that has no overlap with mint, maxt. + for i, c := range chks { if c.MinTime > s.maxt { chks = chks[:i] break @@ -429,7 +432,6 @@ func (s *populatedChunkSeries) Next() bool { } } - chks = chks[from+1:] if len(chks) == 0 { continue }
Simply loop away from using tracking variables.
prometheus_prometheus
train
go
da8efbfac1a8ec839d215215518509e110725fb4
diff --git a/classes/String.php b/classes/String.php index <HASH>..<HASH> 100755 --- a/classes/String.php +++ b/classes/String.php @@ -12,6 +12,7 @@ */ class String { + use Module; /** * Fast string templating.
[New] String is now a Module
caffeina-core_core
train
php
15cf4bd73ba1e1fa60b3ddc94d8301517d8716d8
diff --git a/lib/techs/deps.js.js b/lib/techs/deps.js.js index <HASH>..<HASH> 100644 --- a/lib/techs/deps.js.js +++ b/lib/techs/deps.js.js @@ -19,7 +19,8 @@ exports.Tech = INHERIT(Tech, { getBuildResult: function(prefixes, suffix, outputDir, outputName) { - var deps = new Deps(this.getContext().opts.declaration.blocks); + var declaration = this.getContext().opts.declaration; + deps = new Deps(declaration.deps || declaration.blocks); return Q.when(deps.expandByFS(this), function() { return deps.stringify();
Deps format support in bemdecl
bem-archive_bem-tools
train
js
05c4e8ab96e12229d2bdca5811108b67c637a3ed
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ import hmmlearn VERSION = hmmlearn.__version__ -install_requires = ["scikit-learn>=0.16"] +install_requires = ["numpy", "scikit-learn>=0.16"] tests_require = install_requires + ["pytest"] docs_require = install_requires + [ "Sphinx", "sphinx-gallery", "numpydoc", "Pillow", "matplotlib"
adding numpy as dependency (fixes pip installation)
hmmlearn_hmmlearn
train
py
358c62078b4b753f7cc1e861bd49f33495d9dbff
diff --git a/resources/lang/pt-PT/cachet.php b/resources/lang/pt-PT/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/pt-PT/cachet.php +++ b/resources/lang/pt-PT/cachet.php @@ -33,6 +33,7 @@ return [ 'scheduled' => 'Manutenção Agendada', 'scheduled_at' => ', agendada :timestamp', 'posted' => 'Publicado :timestamp', + 'posted_at' => 'Posted at :timestamp', 'status' => [ 1 => 'Investigando', 2 => 'Identificado',
New translations cachet.php (Portuguese)
CachetHQ_Cachet
train
php
71cda7cf0f239f69f74ad1ebf30d447b69fa24ef
diff --git a/tests/support/pytest/helpers.py b/tests/support/pytest/helpers.py index <HASH>..<HASH> 100644 --- a/tests/support/pytest/helpers.py +++ b/tests/support/pytest/helpers.py @@ -6,6 +6,7 @@ """ import logging import os +import pathlib import shutil import tempfile import textwrap @@ -105,6 +106,8 @@ def temp_file(name=None, contents=None, directory=None, strip_first_newline=True try: if directory is None: directory = RUNTIME_VARS.TMP + elif isinstance(directory, pathlib.Path): + directory = str(directory) if name is not None: file_path = os.path.join(directory, name) @@ -126,12 +129,19 @@ def temp_file(name=None, contents=None, directory=None, strip_first_newline=True with salt.utils.files.fopen(file_path, "w") as wfh: wfh.write(file_contents) + log_contents = "{0} Contents {0}\n{1}\n{2} Contents {2}".format( + ">" * 15, file_contents, "<" * 15 + ) + log.debug("Created temp file: %s\n%s", file_path, log_contents) + else: + log.debug("Touched temp file: %s", file_path) yield file_path finally: try: os.unlink(file_path) + log.debug("Deleted temp file: %s", file_path) except OSError: # Already deleted pass
Add some log calls to know what's going on
saltstack_salt
train
py
f734770aa6938cb8dec7d11f9719875177d020fe
diff --git a/extensions/testlib/src/com/google/inject/testing/throwingproviders/CheckedProviderSubject.java b/extensions/testlib/src/com/google/inject/testing/throwingproviders/CheckedProviderSubject.java index <HASH>..<HASH> 100644 --- a/extensions/testlib/src/com/google/inject/testing/throwingproviders/CheckedProviderSubject.java +++ b/extensions/testlib/src/com/google/inject/testing/throwingproviders/CheckedProviderSubject.java @@ -1,5 +1,7 @@ package com.google.inject.testing.throwingproviders; +import static com.google.common.base.Strings.lenientFormat; +import static com.google.common.truth.Fact.simpleFact; import static com.google.common.truth.Truth.assertAbout; import com.google.common.truth.FailureMetadata; @@ -106,7 +108,7 @@ public final class CheckedProviderSubject<T, P extends CheckedProvider<T>> } void doFail(String format, Object... args) { - failWithRawMessage(format, args); + failWithoutActual(simpleFact(lenientFormat(format, args))); } } }
Migrated from Subject.failWithRawMessage to Subject.failWithoutActual ------------- Created by MOE: <URL>
sonatype_sisu-guice
train
java
78a66785d72dececde55264828a25a53b92d23de
diff --git a/src/main/java/pro/zackpollard/telegrambot/api/chat/message/send/SendableVoiceMessage.java b/src/main/java/pro/zackpollard/telegrambot/api/chat/message/send/SendableVoiceMessage.java index <HASH>..<HASH> 100644 --- a/src/main/java/pro/zackpollard/telegrambot/api/chat/message/send/SendableVoiceMessage.java +++ b/src/main/java/pro/zackpollard/telegrambot/api/chat/message/send/SendableVoiceMessage.java @@ -137,6 +137,14 @@ public class SendableVoiceMessage implements SendableMessage, ReplyingOptions, N return this; } + /** + * *Optional* + * Sets the caption you want to send with the message + * + * @param caption The caption you want to send with the message + * + * @return The builder object + */ public SendableVoiceMessage.SendableVoiceMessageBuilder caption(String caption) { this.caption = caption;
Add in missed documentation for new caption method
zackpollard_JavaTelegramBot-API
train
java
a2019ff749147ad7241ecafb6eb0bfc84e61cdd1
diff --git a/packages/core/parcel-bundler/src/Resolver.js b/packages/core/parcel-bundler/src/Resolver.js index <HASH>..<HASH> 100644 --- a/packages/core/parcel-bundler/src/Resolver.js +++ b/packages/core/parcel-bundler/src/Resolver.js @@ -24,7 +24,7 @@ class Resolver { filename: parent, paths: this.options.paths, modules: builtins, - extensions: ['.js', '.json'], + extensions: Object.keys(this.options.extensions), packageFilter(pkg, pkgfile) { // Expose the path to the package.json file pkg.pkgfile = pkgfile;
Support resolving all extensions that are registered
parcel-bundler_parcel
train
js
7ac3c9a0f2ae198141da14ed4eb5e6a3966d958c
diff --git a/src/Jigsaw.php b/src/Jigsaw.php index <HASH>..<HASH> 100644 --- a/src/Jigsaw.php +++ b/src/Jigsaw.php @@ -70,7 +70,7 @@ class Jigsaw protected function buildSite($useCache) { - $this->outputPaths = $this->siteBuilder + $output = $this->siteBuilder ->setUseCache($useCache) ->build( $this->getSourcePath(), @@ -78,6 +78,8 @@ class Jigsaw $this->siteData ); + $this->outputPaths = $output->keys(); + return $this; } diff --git a/src/SiteBuilder.php b/src/SiteBuilder.php index <HASH>..<HASH> 100644 --- a/src/SiteBuilder.php +++ b/src/SiteBuilder.php @@ -97,8 +97,10 @@ class SiteBuilder { $this->consoleOutput->writeWritingFiles(); - return $files->map(function ($file) use ($destination) { - return $this->writeFile($file, $destination); + return $files->mapWithKeys(function ($file) use ($destination) { + $outputLink = $this->writeFile($file, $destination); + + return [$outputLink => $file->inputFile()]; }); }
Include InputFile details when in collection returned from build()
tightenco_jigsaw
train
php,php
3c02caf8112537cd33269f6c90f7c5eccf7561ae
diff --git a/plugins/guests/linux/cap/rsync.rb b/plugins/guests/linux/cap/rsync.rb index <HASH>..<HASH> 100644 --- a/plugins/guests/linux/cap/rsync.rb +++ b/plugins/guests/linux/cap/rsync.rb @@ -11,14 +11,14 @@ module VagrantPlugins machine.communicate.tap do |comm| comm.sudo("mkdir -p '#{opts[:guestpath]}'") - comm.sudo("find '#{opts[:guestpath]}' ! -user vagrant -print0 | " + + comm.sudo("find '#{opts[:guestpath]}' ! -user #{username} -print0 | " + "xargs -0 -r chown -v #{username}:") end end def self.rsync_post(machine, opts) machine.communicate.tap do |comm| - comm.sudo("find '#{opts[:guestpath]}' ! -user vagrant -print0 | " + + comm.sudo("find '#{opts[:guestpath]}' ! -user #{username} -print0 | " + "xargs -0 -r chown -v #{opts[:owner]}:#{opts[:group]}") end end
guests/linux: check for proper owner [GH-<I>]
hashicorp_vagrant
train
rb
26e0fe44bf57b6f63ecdc2fea5a31fe699673bf3
diff --git a/tests/CookieConsentMiddlewareTest.php b/tests/CookieConsentMiddlewareTest.php index <HASH>..<HASH> 100644 --- a/tests/CookieConsentMiddlewareTest.php +++ b/tests/CookieConsentMiddlewareTest.php @@ -43,7 +43,7 @@ class CookieConsentMiddlewareTest extends TestCase } /** @test */ - public function it_does_not_use_a_sucre_cookie_if_session_secure_is_false() + public function it_does_not_use_a_secure_cookie_if_session_secure_is_false() { config(['session.secure' => false]);
Fix spelling of test name from sucre to secure (#<I>) I (heart) sucre cookies, but I suppose we're not testing for that here ;) `it_does_not_use_a_sucre_cookie_if_session_secure_is_false`
spatie_laravel-cookie-consent
train
php
a0f7fc061ca37ab992e320bd3d1b7b130e500469
diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index <HASH>..<HASH> 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -20,9 +20,6 @@ from pandas.formats.printing import pprint_thing import pandas.util.testing as tm -if not expr._USE_NUMEXPR: - numexpr = pytest.importorskip('numexpr') - _frame = DataFrame(randn(10000, 4), columns=list('ABCD'), dtype='float64') _frame2 = DataFrame(randn(100, 4), columns=list('ABCD'), dtype='float64') _mixed = DataFrame({'A': _frame['A'].copy(), @@ -50,6 +47,7 @@ _mixed_panel = Panel(dict(ItemA=_mixed, ItemB=(_mixed + 3))) _mixed2_panel = Panel(dict(ItemA=_mixed2, ItemB=(_mixed2 + 3))) +@pytest.mark.skipif(not expr._USE_NUMEXPR, reason='not using numexpr') class TestExpressions(tm.TestCase): def setUp(self):
TST: control skipping of numexpr tests if its installed / used
pandas-dev_pandas
train
py
0b2052f6997817ef6feb409b4fd9875848fc9705
diff --git a/spyderlib/widgets/projectexplorer.py b/spyderlib/widgets/projectexplorer.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/projectexplorer.py +++ b/spyderlib/widgets/projectexplorer.py @@ -594,11 +594,14 @@ class ExplorerTreeWidget(OneColumnTree): def get_source_project(self, fname): """Return project which contains source *fname*""" - for project in self.projects: - if project.is_file_in_project(fname): - return project - else: - return self.default_project + return self.default_project # See Issue 490 + # See Issue 490: always using the default project to avoid performance + # issues with 'rope' when dealing with projects containing large files +# for project in self.projects: +# if project.is_file_in_project(fname): +# return project +# else: +# return self.default_project def get_project_from_name(self, name): for project in self.projects:
(Fixes Issue <I>) Editor: code completion was sometimes very slow when editing files within a Spyder project
spyder-ide_spyder
train
py
19fe5b079b9be9901bbba80791e7c2d5aa2fede2
diff --git a/Kwf/Rest/Controller/Model.php b/Kwf/Rest/Controller/Model.php index <HASH>..<HASH> 100644 --- a/Kwf/Rest/Controller/Model.php +++ b/Kwf/Rest/Controller/Model.php @@ -87,6 +87,8 @@ class Kwf_Rest_Controller_Model extends Kwf_Rest_Controller protected function _applySelectQuery($select, $query) { + $query = trim($query); + if (!$query) return; $ors = array(); if (!$this->_queryColumns) { throw new Kwf_Exception("_queryColumns are required");
skip query select if query is empty
koala-framework_koala-framework
train
php
dc74d3fb486852349d53069fd37d7e8c212326d6
diff --git a/lib/autokey/model/abstract_hotkey.py b/lib/autokey/model/abstract_hotkey.py index <HASH>..<HASH> 100644 --- a/lib/autokey/model/abstract_hotkey.py +++ b/lib/autokey/model/abstract_hotkey.py @@ -45,7 +45,7 @@ class AbstractHotkey(AbstractWindowFilter): modifiers.sort() self.modifiers = modifiers self.hotKey = key - if key is not None: + if key is not None and TriggerMode.HOTKEY not in self.modes: self.modes.append(TriggerMode.HOTKEY) def unset_hotkey(self):
Fix for TriggerMode.HOTKEY (3) showing up in modes in the save file twice
autokey_autokey
train
py
fc3527b8c7458a2884a1c0b744eab1d6802ba704
diff --git a/Pullable.js b/Pullable.js index <HASH>..<HASH> 100644 --- a/Pullable.js +++ b/Pullable.js @@ -12,7 +12,7 @@ import { ActivityIndicator, } from 'react-native'; -import styles from './style/index.css.js'; +import styles from './style/index.css'; // const padding = 2; //scrollview与外面容器的距离 const pullOkMargin = 100; //下拉到ok状态时topindicator距离顶部的距离 @@ -161,7 +161,7 @@ export default class extends Component { let topIndicator; if (this.props.topIndicatorRender == null) { topIndicator = ( - <View style={{flex: 1, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', height: defaultTopIndicatorHeight}}> + <View style={{flexDirection: 'row', justifyContent: 'center', alignItems: 'center', height: defaultTopIndicatorHeight}}> <ActivityIndicator size="small" color="gray" /> {this.state.pulling ? <Text>下拉刷新...</Text> : null} {this.state.pullok ? <Text>松开刷新......</Text> : null}
fix a bug, let topindicator component expand
greatbsky_react-native-pull
train
js
25731abe90d3a81c7cbaff13e78320b2c588a561
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -57,6 +57,12 @@ function toSlack (jiraMD) { // Subscript .replace(/~([^~]*)~/g, '_$1') + // Pre-formatted text + .replace(/{noformat}/g, '```') + + // Un-named Links + .replace(/\[([^|{}\\^~[\]\s"`]+\.[^|{}\\^~[\]\s"`]+)\]/g, '<$1>') + // Smart Links .replace(/\[([^[\]|]+?)\|([^[\]|]+?)\|(smart-link)\]/g, '<$1>') @@ -66,12 +72,6 @@ function toSlack (jiraMD) { // Code Block .replace(/\{code(:([a-z]+))?\}([^]*)\{code\}/gm, '```$2$3```') - // Pre-formatted text - .replace(/{noformat}/g, '```') - - // Un-named Links - .replace(/\[([^|{}\\^~[\]\s"`]+\.[^|{}\\^~[\]\s"`]+)\]/g, '<$1>') - // Named Links .replace(/\[([^[\]|]+?)\|([^[\]|]+?)\]/g, '<$2|$1>')
Moved un-named and named links replace above strikethrough
shaunburdick_jira2slack
train
js
2142e1393063e6d75f5b46c6be12f8a2041154a9
diff --git a/shared/chat/conversation/messages/message-popup/attachment/index.js b/shared/chat/conversation/messages/message-popup/attachment/index.js index <HASH>..<HASH> 100644 --- a/shared/chat/conversation/messages/message-popup/attachment/index.js +++ b/shared/chat/conversation/messages/message-popup/attachment/index.js @@ -29,9 +29,9 @@ type Props = { const AttachmentPopupMenu = (props: Props) => { const items = [ - 'Divider', ...(props.yourMessage ? [ + 'Divider', { danger: true, disabled: !props.onDelete,
Show only one divider on attachments that aren't yours. (#<I>)
keybase_client
train
js
3b0b47c60ad9ad6031191f21b0c90dc5d3c06de6
diff --git a/checker/tests/upstream_test.py b/checker/tests/upstream_test.py index <HASH>..<HASH> 100644 --- a/checker/tests/upstream_test.py +++ b/checker/tests/upstream_test.py @@ -45,7 +45,6 @@ class PyFontaineSubsetTest(TestCase): def tearDown(self): library.collections = self.old_collections - @tags('required') def test_font_coverage_subset_100(self): """ Is font fully coveraged subsets """ library.collections = ['subsets'] @@ -53,14 +52,10 @@ class PyFontaineSubsetTest(TestCase): contents = Builder.xml_(tree).doc.toprettyxml(indent=" ") docroot = lxml.etree.fromstring(contents) for orth in docroot.xpath('//orthography'): - try: - value = int(orth.xpath('./percentCoverage/text()')[0]) - if value != 100: - self.fail('%s coveraged only %s' % ( - orth.xpath('./commonName/text()')[0], value)) - break - except (ValueError, IndexError): - pass + value = int(orth.xpath('./percentCoverage/text()')[0]) + if value != 100: + self.fail('%s coveraged only %s%%' % ( + orth.xpath('./commonName/text()')[0], value)) class SimpleBulkTest(TestCase):
Improved error message for test on coverage of subset #<I>
googlefonts_fontbakery
train
py
234c722cfbe66814254ab0d8f67d16b0b774f4d5
diff --git a/tasks/leaptask/l2_unit1.py b/tasks/leaptask/l2_unit1.py index <HASH>..<HASH> 100644 --- a/tasks/leaptask/l2_unit1.py +++ b/tasks/leaptask/l2_unit1.py @@ -176,7 +176,7 @@ class Line(Shape): """ x = (x1 + x2) / 2 y = (y1 + y2) / 2 - super().__init__(x, y, color, gl=gl.GL_LINES, line_width=line_width) + super().__init__(color, gl=gl.GL_LINES, line_width=line_width) self.x1 = x1 self.y1 = y1 self.x2 = x2 diff --git a/tasks/setup.py b/tasks/setup.py index <HASH>..<HASH> 100644 --- a/tasks/setup.py +++ b/tasks/setup.py @@ -5,7 +5,7 @@ import setuptools setuptools.setup( name="leaptask", - version="0.0.16", + version="0.0.17", author="Vic Wang", author_email="305880887@qq.com", description='leap task',
update leaptask to <I>
XRDX_pyleap
train
py,py
381ff81e104dc478f9bfff26c7e1f3511b290949
diff --git a/pynubank/nubank.py b/pynubank/nubank.py index <HASH>..<HASH> 100644 --- a/pynubank/nubank.py +++ b/pynubank/nubank.py @@ -141,6 +141,10 @@ class Nubank: feed = self.get_card_feed() return list(filter(lambda x: x['category'] == 'transaction', feed['events'])) + def get_card_payments(self): + feed = self.get_card_feed() + return list(filter(lambda x: x['category'] == 'payment', feed['events'])) + def get_bills(self): if self._bills_url is not None: request = self._client.get(self._bills_url)
feat: Add payments list filter to credit cards (#<I>)
andreroggeri_pynubank
train
py
54033dfe242f7da9aefd9a9297a75a20a8851592
diff --git a/Collector/ThemeCollector.php b/Collector/ThemeCollector.php index <HASH>..<HASH> 100644 --- a/Collector/ThemeCollector.php +++ b/Collector/ThemeCollector.php @@ -98,6 +98,16 @@ final class ThemeCollector extends DataCollector /** * {@inheritdoc} */ + public function reset(): void + { + $this->data['used_theme'] = null; + $this->data['used_themes'] = []; + $this->data['themes'] = []; + } + + /** + * {@inheritdoc} + */ public function getName(): string { return 'sylius_theme';
Add reset method to DataCollectors, needed for SF4 compat
Sylius_SyliusThemeBundle
train
php
50738ff358a94f99a2839f1379f3373716379b43
diff --git a/test/unit/models/classes/xml/XmlEditorTest.php b/test/unit/models/classes/xml/XmlEditorTest.php index <HASH>..<HASH> 100644 --- a/test/unit/models/classes/xml/XmlEditorTest.php +++ b/test/unit/models/classes/xml/XmlEditorTest.php @@ -8,6 +8,7 @@ use oat\taoQtiTest\models\xmlEditor\XmlEditor; use PHPUnit\Framework\MockObject\MockObject; use qtism\data\storage\xml\XmlDocument; use qtism\data\storage\xml\XmlStorageException; +use SplObjectStorage; use taoQtiTest_models_classes_QtiTestConverterException; use \taoQtiTest_models_classes_QtiTestService; use taoQtiTest_models_classes_QtiTestServiceException; @@ -116,15 +117,18 @@ EOL; "preConditions" => [ ], "branchRules" => [ - ] + ], + "observers" => new SplObjectStorage(), ] ], "testFeedbacks" => [ - ] + ], + "observers" => new SplObjectStorage(), ] ], "testFeedbacks" => [ - ] + ], + "observers" => new SplObjectStorage(), ]; $this->qtiTestServiceMock
fix: Fixed breaking test, added observers from qti-sdk.
oat-sa_extension-tao-testqti
train
php
6326ecc3f1501c15ec36b48a98c03355a1535bbd
diff --git a/apiserver/facades/controller/instancepoller/merge.go b/apiserver/facades/controller/instancepoller/merge.go index <HASH>..<HASH> 100644 --- a/apiserver/facades/controller/instancepoller/merge.go +++ b/apiserver/facades/controller/instancepoller/merge.go @@ -38,7 +38,9 @@ func newMergeMachineLinkLayerOp( // Build (state.ModelOperation) returns the transaction operations used to // merge incoming provider link-layer data with that in state. -func (o *mergeMachineLinkLayerOp) Build(_ int) ([]txn.Op, error) { +func (o *mergeMachineLinkLayerOp) Build(attempt int) ([]txn.Op, error) { + o.ClearProcessed() + if err := o.PopulateExistingDevices(); err != nil { return nil, errors.Trace(err) } @@ -52,7 +54,9 @@ func (o *mergeMachineLinkLayerOp) Build(_ int) ([]txn.Op, error) { return nil, jujutxn.ErrNoOperations } - o.normaliseIncoming() + if attempt == 0 { + o.normaliseIncoming() + } if err := o.PopulateExistingAddresses(); err != nil { return nil, errors.Trace(err)
Ensures that ClearProcessed is called before each transaction build attempt when setting provider-sourced link-layer data.
juju_juju
train
go
baecd7a0e0e8ee1cb1a781f32a4a1fa9987cc15a
diff --git a/billy/tests/importers/test_filters.py b/billy/tests/importers/test_filters.py index <HASH>..<HASH> 100644 --- a/billy/tests/importers/test_filters.py +++ b/billy/tests/importers/test_filters.py @@ -13,3 +13,13 @@ def test_phone_filter(): ] for num in numbers: assert phone_filter(num) == number + + +def test_phone_filter_country(): + number = "1-555-606-0842" + numbers = [ + "+1-(555)-606-0842", + "+1 (555) 606-0842" + ] + for num in numbers: + assert phone_filter(num) == number
Adding in a country code checker
openstates_billy
train
py
3ade0793a465cf9793758d9f4f15e20afecf31f9
diff --git a/src/main/java/edu/jhu/gm/data/bayesnet/BayesNetReader.java b/src/main/java/edu/jhu/gm/data/bayesnet/BayesNetReader.java index <HASH>..<HASH> 100644 --- a/src/main/java/edu/jhu/gm/data/bayesnet/BayesNetReader.java +++ b/src/main/java/edu/jhu/gm/data/bayesnet/BayesNetReader.java @@ -18,6 +18,7 @@ import edu.jhu.gm.model.Var; import edu.jhu.gm.model.Var.VarType; import edu.jhu.gm.model.VarConfig; import edu.jhu.gm.model.VarSet; +import edu.jhu.prim.util.math.FastMath; public class BayesNetReader { @@ -84,7 +85,9 @@ public class BayesNetReader { // The double is the last value on the line. double value = Double.parseDouble(assns[assns.length-1]); - + // Factor graphs store the log value. + value = FastMath.log(value); + // Get the factor for this configuration, creating a new one if necessary. VarSet vars = config.getVars(); ExplicitFactor f = factorMap.get(vars);
Bug fix: taking log of BayesNet Reader inputs
mgormley_pacaya
train
java
5fdd4755a97ec98bf1533cfc824a6b1c5484bf87
diff --git a/starlink/ndfpack/Ndf.py b/starlink/ndfpack/Ndf.py index <HASH>..<HASH> 100644 --- a/starlink/ndfpack/Ndf.py +++ b/starlink/ndfpack/Ndf.py @@ -93,7 +93,10 @@ class Ndf(object): self.label = indf.label self.title = indf.title self.units = indf.units - self.wcs = indf.gtwcs() + try: + self.wcs = indf.gtwcs() + except NotImplementedError: + self.wcs = None # Read the axes self.axes = []
Storing wcs attribute depends on starlink.Ast being available
sfgraves_starlink-pyhds
train
py
dea0e91d6207b14ac8ead0374b4b709fc3873563
diff --git a/simulator/src/main/java/com/hazelcast/simulator/common/ShutdownThread.java b/simulator/src/main/java/com/hazelcast/simulator/common/ShutdownThread.java index <HASH>..<HASH> 100644 --- a/simulator/src/main/java/com/hazelcast/simulator/common/ShutdownThread.java +++ b/simulator/src/main/java/com/hazelcast/simulator/common/ShutdownThread.java @@ -32,7 +32,7 @@ public abstract class ShutdownThread extends Thread { protected ShutdownThread(String name, AtomicBoolean shutdownStarted, boolean shutdownLog4j) { super(name); - setDaemon(true); + setDaemon(false); this.shutdownStarted = shutdownStarted; this.shutdownLog4j = shutdownLog4j;
Fixed cut off logs in worker by making the ShutdownThread a user thread, so the Worker doesn't stop before the shutdown is completed.
hazelcast_hazelcast-simulator
train
java
f6a1dc30201f306bd50c1f679a5f156e45927cc0
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,6 @@ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) +require 'tempfile' +require 'securerandom' require 'simplecov' SimpleCov.start do
add some requirement into spec_helper
tamashii-io_tamashii-common
train
rb
4f6fb19662331afd90539103cd0d2691e72c54b9
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -293,6 +293,27 @@ module ActiveRecord result.rows.first.first end + # Sets the sequence of a table's primary key to the specified value. + def set_pk_sequence!(table, value, pk = nil, sequence = nil) #:nodoc: + unless pk and sequence + default_pk, default_sequence = pk_and_sequence_for(table) + pk ||= default_pk + sequence ||= default_sequence + end + + if pk + if sequence + quoted_sequence = quote_column_name(sequence) + + select_value <<-end_sql, 'SCHEMA' + SELECT setval('#{quoted_sequence}', #{value}) + end_sql + else + @logger.warn "#{table} has primary key #{pk} with no default sequence" if @logger + end + end + end + # Resets the sequence of a table's primary key to the maximum value. def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc: unless pk and sequence
Added region sequencing of primary keys for Postgres. Skip setting sequence on a table create if the value is 0 since it will start the first value at 1 anyway. This fixes the PG error 'setval: value 0 is out of bounds for sequence vms_id_seq...' encountered when migrating a new DB. BugzID: <I>,<I>,<I>,<I>
rails_rails
train
rb
5e7565a8a84a0448a94a95b1da2c7393c9531b0d
diff --git a/src/main/java/org/fit/layout/impl/DefaultLogicalArea.java b/src/main/java/org/fit/layout/impl/DefaultLogicalArea.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/fit/layout/impl/DefaultLogicalArea.java +++ b/src/main/java/org/fit/layout/impl/DefaultLogicalArea.java @@ -61,6 +61,12 @@ public class DefaultLogicalArea extends GenericTreeNode implements LogicalArea } @Override + public Area getFirstArea() + { + return ((Vector<Area>) areas).firstElement(); + } + + @Override public int getAreaCount() { return areas.size(); diff --git a/src/main/java/org/fit/layout/model/LogicalArea.java b/src/main/java/org/fit/layout/model/LogicalArea.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/fit/layout/model/LogicalArea.java +++ b/src/main/java/org/fit/layout/model/LogicalArea.java @@ -21,6 +21,8 @@ public interface LogicalArea extends AreaTreeNode<LogicalArea> public List<Area> getAreas(); + public Area getFirstArea(); + public int getAreaCount(); public void setText(String text);
API extension: first area in a logical area
FitLayout_api
train
java,java
67c985bc86afc56a04edca366e8e59db8febfeca
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -60,7 +60,7 @@ gulp.task('styles-formio', () => { return gulp.src([`${tmpFolder}/components/formio/formio.component.scss`]) .pipe(sass().on('error', sass.logError)) .pipe(cleanCSS({compatibility: 'ie8'})) - .pipe(replace(/content\:'\\/g, "content:'\\\\")) + .pipe(replace(/\\/g, "\\\\")) .pipe(gulp.dest(`${tmpFolder}/components/formio`)); }); @@ -68,7 +68,7 @@ gulp.task('styles-builder', () => { return gulp.src([`${tmpFolder}/components/formbuilder/formbuilder.component.scss`]) .pipe(sass().on('error', sass.logError)) .pipe(cleanCSS({compatibility: 'ie8'})) - .pipe(replace(/content\:'\\/g, "content:'\\\\")) + .pipe(replace(/\\/g, "\\\\")) .pipe(gulp.dest(`${tmpFolder}/components/formbuilder`)); });
Fix replasing backslashes for all cases
formio_angular-formio
train
js
42c89e5b8abc8cfb92d6abcfd261af8520961690
diff --git a/lib/rubocop/cop/mixin/autocorrect_alignment.rb b/lib/rubocop/cop/mixin/autocorrect_alignment.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/mixin/autocorrect_alignment.rb +++ b/lib/rubocop/cop/mixin/autocorrect_alignment.rb @@ -74,7 +74,7 @@ module RuboCop def autocorrect_line(corrector, line_begin_pos, expr, column_delta, heredoc_ranges) range = calculate_range(expr, line_begin_pos, column_delta) - # We must not change indentation of heredoc stings. + # We must not change indentation of heredoc strings. return if heredoc_ranges.any? { |h| within?(range, h) } if column_delta > 0
Heredocs don't sting (bees and wasps do)
rubocop-hq_rubocop
train
rb
a551686d37c08e485f4576dc35dc4265f0c6eee6
diff --git a/lib/discover/local.go b/lib/discover/local.go index <HASH>..<HASH> 100644 --- a/lib/discover/local.go +++ b/lib/discover/local.go @@ -179,8 +179,11 @@ func (c *localClient) recvAnnouncements(b beacon.Interface) { } if newDevice { + // Force a transmit to announce ourselves, if we are ready to do + // so right away. select { case c.forcedBcastTick <- time.Now(): + default: } } }
lib/discovery: Receiving a new announcement should be non-blocking Pretty sure the intention of the select was for it to be non-blocking. Not that it will matter almost ever.
syncthing_syncthing
train
go
d343fbe4f58a4453e19ca292c092ecbea2d3be52
diff --git a/lib/Models/REpresentationalStateTransferCatalogFunction.js b/lib/Models/REpresentationalStateTransferCatalogFunction.js index <HASH>..<HASH> 100644 --- a/lib/Models/REpresentationalStateTransferCatalogFunction.js +++ b/lib/Models/REpresentationalStateTransferCatalogFunction.js @@ -43,12 +43,6 @@ function REpresentationalStateTransferCatalogFunction(terria) { this.url = undefined; /** - * Gets or sets the identifier of this REST process. This property is observable. - * @type {String} - */ - this.identifier = undefined; - - /** * Gets or sets whether to use key value pairs (KVP) embedded in Execute URL, or whether to make a POST request * with XML data. * @type {Boolean}
removed unnecessary identifier from copying WPS
TerriaJS_terriajs
train
js
ae6f47ff63a8d381fe4e98c25469244a27ecd125
diff --git a/spec/buffers_spec.js b/spec/buffers_spec.js index <HASH>..<HASH> 100644 --- a/spec/buffers_spec.js +++ b/spec/buffers_spec.js @@ -229,22 +229,30 @@ function model(type) { }; -describe('a standard buffer with an appropriate model', function() { - it('conforms to the model', function() { +describe('a standard buffer', function() { + it('conforms to the standard buffer model', function() { expect(buf(CHECKED)).toConformTo(model(CHECKED)); }); }); -describe('a standard buffer with an appropriate model', function() { - it('conforms to the model', function() { +describe('a dropping buffer', function() { + it('conforms to the dropping buffer model', function() { expect(buf(DROPPING)).toConformTo(model(DROPPING)); }); }); -describe('a standard buffer with an appropriate model', function() { - it('conforms to the model', function() { +describe('a sliding buffer', function() { + it('conforms to the sliding buffer model', function() { expect(buf(SLIDING)).toConformTo(model(SLIDING)); }); }); + + +// sanity check +describe('a standard buffer', function() { + it('does not conform to the dropping buffer model', function() { + expect(buf(CHECKED)).not.toConformTo(model(DROPPING)); + }); +});
improve test descriptions and add a check for failing conformity
odf_ceci-buffers
train
js
728b33edd98abbb4c9582e38a91a6e3ddc827704
diff --git a/src/APIRequest/RequestFactory/GenericRequestFactory.php b/src/APIRequest/RequestFactory/GenericRequestFactory.php index <HASH>..<HASH> 100644 --- a/src/APIRequest/RequestFactory/GenericRequestFactory.php +++ b/src/APIRequest/RequestFactory/GenericRequestFactory.php @@ -50,11 +50,6 @@ class GenericRequestFactory implements RequestFactory { $urlQueryData = []; if($urlQueryString = $parsedURL->getQueryString()) { parse_str($urlQueryString, $urlQueryData); - - //In case it's unable to be parsed, default to no params - if($urlQueryData === null) { - $urlQueryData = []; - } } $apiKey = $parsedURL->getAPIKey();
remove unreachable statement, under the assumption that str_parse cant fail
johnvandeweghe_LunixREST
train
php
cbcea987d33f5ed03b1d53bcccff73d7f30c517c
diff --git a/src/worker/scheduler/Scheduler.js b/src/worker/scheduler/Scheduler.js index <HASH>..<HASH> 100644 --- a/src/worker/scheduler/Scheduler.js +++ b/src/worker/scheduler/Scheduler.js @@ -4,11 +4,12 @@ import { merge } from "lodash-es"; // Internal dependencies. import Task from "./Task"; + const DEFAULT_CONFIGURATION = { pollTime: 50, }; -class Scheduler { +export default class Scheduler { /** * Initializes a Scheduler. * @@ -57,7 +58,7 @@ class Scheduler { tick() { this.executeNextTask() .then( () => { - setTimeout( this.tick, this._configuration.pollTime ); + this._pollHandle = setTimeout( this.tick, this._configuration.pollTime ); } ); } @@ -69,6 +70,7 @@ class Scheduler { stopPolling() { clearTimeout( this._pollHandle ); this._pollHandle = null; + this._started = false; } /** @@ -148,5 +150,3 @@ class Scheduler { } ); } } - -export default Scheduler;
Fix polling start and handle not being set or updated
Yoast_YoastSEO.js
train
js
ac63ed573b4a5b511fb54eeda4dd3f38c9659688
diff --git a/command/format.go b/command/format.go index <HASH>..<HASH> 100644 --- a/command/format.go +++ b/command/format.go @@ -1,7 +1,6 @@ package command import ( - "bytes" "encoding/json" "errors" "fmt" @@ -53,17 +52,15 @@ var Formatters = map[string]Formatter{ } // An output formatter for json output of an object -type JsonFormatter struct { -} +type JsonFormatter struct{} func (j JsonFormatter) Output(ui cli.Ui, secret *api.Secret, data interface{}) error { - b, err := json.Marshal(data) - if err == nil { - var out bytes.Buffer - json.Indent(&out, b, "", "\t") - ui.Output(out.String()) + b, err := json.MarshalIndent(data, "", " ") + if err != nil { + return err } - return err + ui.Output(string(b)) + return nil } // An output formatter for yaml output format of an object
Output JSON with spaces not tabs
hashicorp_vault
train
go
6e718a3cb22c0e2cd8744d2be859d74665df48f6
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -69,7 +69,7 @@ describe( 'buble', () => { var commandFile = path.resolve( dir, 'command.sh' ); var command = fs.readFileSync( commandFile, 'utf-8' ) - .replace( 'buble', 'node ' + binFile ); + .replace( 'buble', 'node "' + binFile + '"' ); child_process.exec( command, { cwd: dir }, ( err, stdout, stderr ) => {
fix cli test to work in directories with uncommon names
bublejs_buble
train
js
743d2ee5ba282f119b0270961fb4afc5594b93ef
diff --git a/peer/main.go b/peer/main.go index <HASH>..<HASH> 100644 --- a/peer/main.go +++ b/peer/main.go @@ -42,7 +42,6 @@ import ( var logger = logging.MustGetLogger("main") // Constants go here. -const fabric = "hyperledger" const cmdRoot = "core" // The main command describes the service and
Remove unused constant fabric The constant "fabric" is not used in new release. Change-Id: Ie<I>ba<I>f<I>fda<I>dbe<I>fa9f<I>c
hyperledger_fabric
train
go
05315b808f1f2b221918726e9678ab45f0bd3f14
diff --git a/tds.go b/tds.go index <HASH>..<HASH> 100644 --- a/tds.go +++ b/tds.go @@ -1263,6 +1263,7 @@ initiate_connection: p.Host = sess.routedServer p.Port = uint64(sess.routedPort) if !p.HostInCertificateProvided && p.TLSConfig != nil { + p.TLSConfig = p.TLSConfig.Clone() p.TLSConfig.ServerName = sess.routedServer } goto initiate_connection
keep tls config in sync with msdsn host (#<I>)
denisenkom_go-mssqldb
train
go
d24ae7b54922fc9931e3d16c40f636fc4bd7d7d4
diff --git a/MAVProxy/modules/mavproxy_misseditor/__init__.py b/MAVProxy/modules/mavproxy_misseditor/__init__.py index <HASH>..<HASH> 100644 --- a/MAVProxy/modules/mavproxy_misseditor/__init__.py +++ b/MAVProxy/modules/mavproxy_misseditor/__init__.py @@ -199,7 +199,8 @@ class MissionEditorModule(mp_module.MPModule): def mavlink_packet(self, m): - self.mavlink_message_queue.put(m) + if m.get_type() in ['WAYPOINT_COUNT','MISSION_COUNT', 'WAYPOINT', 'MISSION_ITEM']: + self.mavlink_message_queue.put(m) def process_mavlink_packet(self, m): '''handle an incoming mavlink packet''' @@ -209,6 +210,8 @@ class MissionEditorModule(mp_module.MPModule): #No "return" statement should be put in this method! self.gui_event_queue_lock.acquire() + # if you add processing for an mtype here, remember to add it + # to mavlink_packet, above if mtype in ['WAYPOINT_COUNT','MISSION_COUNT']: if (self.num_wps_expected == 0): #I haven't asked for WPs, or these messages are duplicates
misseditor: only enqueue specific message types Optimisation
ArduPilot_MAVProxy
train
py
679be0627afd8431f540cedef215b06d29fcbaa8
diff --git a/backbone-associations.js b/backbone-associations.js index <HASH>..<HASH> 100644 --- a/backbone-associations.js +++ b/backbone-associations.js @@ -618,7 +618,10 @@ cleanup:function () { _.each(this.relations, function (relation) { var val = this.attributes[relation.key]; - val && (val.parents = _.difference(val.parents, [this])); + if(val) { + val._proxyCallback && val.off("all", val._proxyCallback, this); + val.parents = _.difference(val.parents, [this]); + } }, this); this.off(); },
cleanup method don't unbind _proxyCallback from a relationValue
dhruvaray_backbone-associations
train
js
0253cc1c9a0c44693b1fed659a0d83d04cc23ac9
diff --git a/imgaug/augmenters/contrast.py b/imgaug/augmenters/contrast.py index <HASH>..<HASH> 100644 --- a/imgaug/augmenters/contrast.py +++ b/imgaug/augmenters/contrast.py @@ -301,12 +301,11 @@ class _ContrastFuncWrapper(meta.Augmenter): def _augment_images(self, images, random_state, parents, hooks): nb_images = len(images) - seeds = random_state.randint(0, 10**6, size=(1+nb_images,)) - per_channel = self.per_channel.draw_samples((nb_images,), random_state=ia.new_random_state(seeds[0])) + rss = ia.derive_random_states(random_state, 1+nb_images) + per_channel = self.per_channel.draw_samples((nb_images,), random_state=rss[0]) result = images - for i, (image, per_channel_i, seed) in enumerate(zip(images, per_channel, seeds[1:])): - rs = ia.new_random_state(seed) + for i, (image, per_channel_i, rs) in enumerate(zip(images, per_channel, rss[1:])): nb_channels = 1 if per_channel_i <= 0.5 else image.shape[2] samples_i = [param.draw_samples((nb_channels,), random_state=rs) for param in self.params1d] if per_channel_i > 0.5:
Improve random state generation in contrast augs
aleju_imgaug
train
py
a437e195fffc9120ecb57ed2169775a9116b59e4
diff --git a/index.es6.js b/index.es6.js index <HASH>..<HASH> 100644 --- a/index.es6.js +++ b/index.es6.js @@ -2,8 +2,8 @@ import algoliasearchHelper from 'algoliasearch-helper'; import toFactory from 'to-factory'; -import InstantSearch from './dist-es6-module/lib/InstantSearch.js'; -import version from './dist-es6-module/lib/version.js'; +import InstantSearch from './lib/InstantSearch.js'; +import version from './lib/version.js'; // import instantsearch from 'instantsearch.js'; // -> provides instantsearch object without connectors and widgets
fix(es): wrong path to files (#<I>)
algolia_instantsearch.js
train
js
30a9229f38fbdf91d5a058c97dd3de05e4e162d2
diff --git a/clientv3/lease.go b/clientv3/lease.go index <HASH>..<HASH> 100644 --- a/clientv3/lease.go +++ b/clientv3/lease.go @@ -351,6 +351,8 @@ func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) { for { select { case <-time.After(500 * time.Millisecond): + case <-stream.Context().Done(): + return case <-l.donec: return case <-l.stopCtx.Done():
clientv3: check stream context in lease keep alive send loop If no leases are being kept alive, a connection reset would leak the send routine since it would only test the stream when sending keep alives. Fixes #<I>
etcd-io_etcd
train
go
21a28948aa0054305b496e3aec1e01db64b3d2f6
diff --git a/lib/nexpose/global_settings.rb b/lib/nexpose/global_settings.rb index <HASH>..<HASH> 100644 --- a/lib/nexpose/global_settings.rb +++ b/lib/nexpose/global_settings.rb @@ -123,7 +123,7 @@ module Nexpose # Internal method for parsing XML for whether asset linking in enabled. def parse_asset_linking_from_xml(xml) - enabled = false + enabled = true if elem = REXML::XPath.first(xml, '//AssetCorrelation[@enabled]') enabled = elem.attribute('enabled').value.to_i == 1 end
Update #parse_asset_linking_from_xml's default return value By default Nexpose customers have this value enabled. Customers who have set it false will have the element in their global settings and therefore have it correctly mutated to false in the lines that follow this default value.
rapid7_nexpose-client
train
rb
e10a487668eceb77014c1b1d6f43fca280f1420a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -16,14 +16,16 @@ module.exports = function(points, z, resolution, breaks, done){ var gridResult = grid(squareBBox, resolution); var data = []; - gridResult.features.forEach(function(pt){ - tinResult.features.forEach(function(triangle){ + for (var i = 0; i < gridResult.features.length; i++) { + var pt = gridResult.features[i]; + for (var j = 0; j < tinResult.features.length; j++) { + var triangle = tinResult.features[j]; if (inside(pt, triangle)) { pt.properties = {}; pt.properties[z] = planepoint(pt, triangle); } - }); - }); + } + } var depth = Math.sqrt(gridResult.features.length); for (var x=0; x<depth; x++){
Optimize, this yields about <I>% boost
turf-junkyard_turf-isolines
train
js
5e4db70fd0860b07a0da104bb041c802f9d96c21
diff --git a/core/server/mail.js b/core/server/mail.js index <HASH>..<HASH> 100644 --- a/core/server/mail.js +++ b/core/server/mail.js @@ -16,7 +16,7 @@ function GhostMailer(opts) { // *This promise should always resolve to avoid halting Ghost::init*. GhostMailer.prototype.init = function () { var self = this; - if (config().mail && config().mail.transport && config().mail.options) { + if (config().mail && config().mail.transport) { this.createTransport(); return when.resolve(); } @@ -53,7 +53,7 @@ GhostMailer.prototype.detectSendmail = function () { }; GhostMailer.prototype.createTransport = function () { - this.transport = nodemailer.createTransport(config().mail.transport, _.clone(config().mail.options)); + this.transport = nodemailer.createTransport(config().mail.transport, _.clone(config().mail.options) || {}); }; GhostMailer.prototype.usingSendmail = function () {
Don't require mail.options to be set
TryGhost_Ghost
train
js
e039258faca0a2f4724f95e9a2b9dc54cf5a28ed
diff --git a/plugins/hudson/reporter.rb b/plugins/hudson/reporter.rb index <HASH>..<HASH> 100644 --- a/plugins/hudson/reporter.rb +++ b/plugins/hudson/reporter.rb @@ -36,7 +36,7 @@ class Hudson end def common - @base.failures & @other.failures + prefix(' ', @base.failures & @other.failures) end def prefix(str, array)
prefix common failed tests with ' ', so all have prefix
mikz_october
train
rb
e2987241040917672467af613c14a301aeeff940
diff --git a/src/utils/pageToGenerator.js b/src/utils/pageToGenerator.js index <HASH>..<HASH> 100644 --- a/src/utils/pageToGenerator.js +++ b/src/utils/pageToGenerator.js @@ -7,18 +7,21 @@ function* pageToGenerator(pageFn) { let bank = []; let fetchPromise = Promise.resolve(); while (bank.length > 0 || nextPageExists) { - if (bank.length > 0) { - yield Promise.resolve(bank.shift()); - } else { - fetchPromise = fetchPromise.then(pageFn).then(function(response) { - nextPageExists = !!response.pages.next; - bank = response.data; - return bank.shift(); - }); + fetchPromise = fetchPromise.then(function() { + if (bank.length === 0) { + return pageFn().then(function(response) { + nextPageExists = !!response.pages.next; + bank = response.data; - yield fetchPromise; - } + return bank.shift(); + }); + } + + return bank.shift(); + }); + + yield fetchPromise; } }
page-to-generator funciton fixes Simplify and fix issue where promises weren't chaining correctly
BadgeUp_badgeup-browser-client
train
js
4f099bf076218eb7ee3f23c42e1a8d342db6d6a4
diff --git a/src/Hodor/MessageQueue/Adapter/ConfigInterface.php b/src/Hodor/MessageQueue/Adapter/ConfigInterface.php index <HASH>..<HASH> 100644 --- a/src/Hodor/MessageQueue/Adapter/ConfigInterface.php +++ b/src/Hodor/MessageQueue/Adapter/ConfigInterface.php @@ -5,7 +5,7 @@ namespace Hodor\MessageQueue\Adapter; interface ConfigInterface { /** - * @return string + * @return array */ public function getAdapterFactoryConfig();
Fix PHPdoc that was causing PhpStorm warnings in AdapterFactory
hold-the-door_ravens
train
php
8327d47f2821af8af31d5c380284227ef41ede96
diff --git a/tests/test_ro_functional.py b/tests/test_ro_functional.py index <HASH>..<HASH> 100644 --- a/tests/test_ro_functional.py +++ b/tests/test_ro_functional.py @@ -211,7 +211,7 @@ class RHTest(BaseTest): url = (tests.CLICONFIG.REDHAT_URL or "https://bugzilla.redhat.com/xmlrpc.cgi") bzclass = RHBugzilla - bzversion = (4, 4) + bzversion = (5, 0) test0 = BaseTest._testBZVersion test01 = lambda s: BaseTest._testInfoProducts(s, 125,
tests: bugzilla.redhat.com is now bugzilla5
python-bugzilla_python-bugzilla
train
py
86a0db38c3847e151445512041adcb9012872c25
diff --git a/lib/helpscout/client.rb b/lib/helpscout/client.rb index <HASH>..<HASH> 100644 --- a/lib/helpscout/client.rb +++ b/lib/helpscout/client.rb @@ -891,6 +891,8 @@ module HelpScout url = "/customers.json" begin + # We need to set reload flag to true to receive created object back + customer[:reload] = true item = Client.create_item(@auth, url, customer.to_json) Customer.new(item) rescue StandardError => e
create_customer(customer) method expected that API will return JSON for newly created customer. But this worked only if we passed 'reload' parameter explicitely. If we didn't Customer object with all empty fields was created and this has no sense. Now create_customer method will always add 'reload' flag to request.
hramos_helpscout
train
rb
20de692cff2411ae90f541127c65c47e0abe01ef
diff --git a/servers/servertcp_handler.js b/servers/servertcp_handler.js index <HASH>..<HASH> 100644 --- a/servers/servertcp_handler.js +++ b/servers/servertcp_handler.js @@ -123,8 +123,8 @@ function _handleReadCoilsOrInputDiscretes(requestBuffer, vector, unitID, callbac msg: "Invalid length" }); - var cb = buildCb(i); var i = 0; + var cb = buildCb(i); var promiseOrValue = null; if (isGetCoil && vector.getCoil.length === 3) {
Fix var beeing used before assignment (#<I>)
yaacov_node-modbus-serial
train
js
d0550ea5ab8315e3aa9161b0a87768a261032798
diff --git a/lib/lock_and_cache.rb b/lib/lock_and_cache.rb index <HASH>..<HASH> 100644 --- a/lib/lock_and_cache.rb +++ b/lib/lock_and_cache.rb @@ -177,7 +177,6 @@ module LockAndCache end ensure done = true - lock_extender.exit if lock_extender.alive? lock_extender.join if lock_extender.status.nil? end end
don't be too eager to kill the lock extender thread
seamusabshere_lock_and_cache
train
rb
160aa512a146daa6b93d989a76c347f1869bdc3a
diff --git a/config/src/main/java/org/springframework/security/config/authentication/AuthenticationProviderBeanDefinitionParser.java b/config/src/main/java/org/springframework/security/config/authentication/AuthenticationProviderBeanDefinitionParser.java index <HASH>..<HASH> 100644 --- a/config/src/main/java/org/springframework/security/config/authentication/AuthenticationProviderBeanDefinitionParser.java +++ b/config/src/main/java/org/springframework/security/config/authentication/AuthenticationProviderBeanDefinitionParser.java @@ -31,7 +31,6 @@ public class AuthenticationProviderBeanDefinitionParser implements BeanDefinitio public BeanDefinition parse(Element element, ParserContext parserContext) { RootBeanDefinition authProvider = new RootBeanDefinition(DaoAuthenticationProvider.class); - authProvider.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); authProvider.setSource(parserContext.extractSource(element)); Element passwordEncoderElt = DomUtils.getChildElementByTagName(element, Elements.PASSWORD_ENCODER);
Remove "infrastructure" type from authentication provider bean.
spring-projects_spring-security
train
java
bc27d96b8cef11894eebc8f8e8e673c7ef3499d6
diff --git a/IRI.php b/IRI.php index <HASH>..<HASH> 100644 --- a/IRI.php +++ b/IRI.php @@ -497,7 +497,7 @@ class IRI // http://tools.ietf.org/html/rfc3986#appendix-B $regex = '|^((?P<scheme>[^:/?#]+):)?' . '((?P<doubleslash>//)(?P<authority>[^/?#]*))?(?P<path>[^?#]*)' . - '((?<querydef>\?)(?P<query>[^#]*))?(#(?P<fragment>.*))?|'; + '((?P<querydef>\?)(?P<query>[^#]*))?(#(?P<fragment>.*))?|'; preg_match($regex, $iri, $match); // Extract scheme
Use only Python-style subpatterns to be compatible with older PCRE versions This closes #4 and fixes lanthaler/JsonLD#<I>
lanthaler_IRI
train
php
bcd79a2febe44e52693b74e0575bbfbeacb945e7
diff --git a/tests/Api/StatsTest.php b/tests/Api/StatsTest.php index <HASH>..<HASH> 100644 --- a/tests/Api/StatsTest.php +++ b/tests/Api/StatsTest.php @@ -49,15 +49,27 @@ class StatsTest extends MauticApiTestCase 'asset_downloads', 'audit_log', 'campaign_lead_event_log', + 'campaign_leads', 'channel_url_trackables', + 'companies_leads', + 'dynamic_content_lead_data', + 'dynamic_content_stats', 'email_stats', 'email_stats_devices', 'focus_stats', 'form_submissions', + 'ip_addresses', + 'lead_categories', 'lead_companies_change_log', + 'lead_devices', + 'lead_donotcontact', + 'lead_frequencyrules', + 'lead_lists', 'lead_points_change_log', 'lead_stages_change_log', + 'lead_utmtags', 'page_hits', + 'page_redirects', 'point_lead_action_log', 'point_lead_event_log', 'push_notification_stats',
New stats tables added to the test
mautic_api-library
train
php
c6b20e4c14a49e13e936392cfa473f788c40a14f
diff --git a/publish.js b/publish.js index <HASH>..<HASH> 100644 --- a/publish.js +++ b/publish.js @@ -129,21 +129,7 @@ const tasks = new Listr([{ enabled, }, { title: 'Publishing to npm', - // task: (ctx) => exec('./node_modules/.bin/np', [ctx.version]), - task: (ctx) => exec('./node_modules/.bin/np', ['0.3.0']), - enabled, -}, { - title: 'Sync with GitHub', - task: () => { - return new Promise((resolve, reject) => { - repo.remote_push((err) => { - if (err) { - return reject(err); - } - return resolve(); - }); - }); - }, + task: (ctx) => exec('./node_modules/.bin/np', [ctx.version]) enabled, }]);
Update publish script (sync unnecessary, version should be automated).
ben-eb_caniuse-lite
train
js
a7483b8cc9427e378cc722b55547dc92d67aa22c
diff --git a/lib/specjour/printer.rb b/lib/specjour/printer.rb index <HASH>..<HASH> 100644 --- a/lib/specjour/printer.rb +++ b/lib/specjour/printer.rb @@ -127,8 +127,10 @@ module Specjour def stopping summarize_reports - record_performance unless Specjour.interrupted? - print_missing_tests if tests_to_run.any? + unless Specjour.interrupted? + record_performance + print_missing_tests if tests_to_run.any? + end end def summarize_reports
Don't print queued tests when process interrupts
sandro_specjour
train
rb
7eb41457657ed6d818877061d28d6a098d7a8594
diff --git a/HydraServer/python/HydraServer/lib/data.py b/HydraServer/python/HydraServer/lib/data.py index <HASH>..<HASH> 100644 --- a/HydraServer/python/HydraServer/lib/data.py +++ b/HydraServer/python/HydraServer/lib/data.py @@ -696,6 +696,8 @@ def _process_incoming_data(data, user_id=None, source=None): if d.metadata is not None: metadata_dict = json.loads(d.metadata) + else: + metadata_dict={} metadata_keys = [k.lower() for k in metadata_dict] if user_id is not None and 'user_id' not in metadata_keys:
Upload the latest versions of Excel App and GAMS build to Apps folder Fix issue of metadata_dict being null when updating the scenario
hydraplatform_hydra-base
train
py
484fa7c32e0fa9ddb4f8cca50990fcefc9ca8d76
diff --git a/internal/pkg/platform/platform_matcher.go b/internal/pkg/platform/platform_matcher.go index <HASH>..<HASH> 100644 --- a/internal/pkg/platform/platform_matcher.go +++ b/internal/pkg/platform/platform_matcher.go @@ -128,16 +128,16 @@ func WantedPlatforms(ctx *types.SystemContext) ([]imgspecv1.Platform, error) { if ctx != nil && ctx.ArchitectureChoice != "" { wantedArch = ctx.ArchitectureChoice } - wantedOS := runtime.GOOS - if ctx != nil && ctx.OSChoice != "" { - wantedOS = ctx.OSChoice - } - wantedVariant := getCPUVariant(runtime.GOOS, runtime.GOARCH) if ctx != nil && ctx.VariantChoice != "" { wantedVariant = ctx.VariantChoice } + wantedOS := runtime.GOOS + if ctx != nil && ctx.OSChoice != "" { + wantedOS = ctx.OSChoice + } + var wantedPlatforms []imgspecv1.Platform if wantedVariant != "" && compatibility[wantedArch] != nil { wantedPlatforms = make([]imgspecv1.Platform, 0, len(compatibility[wantedArch]))
Move architecture+variant logic together, separate from wantedOS The architecture+variant choices interact, and are orthogonal from OS. Should not change behavior.
containers_image
train
go
0f84d515bb53beae7cbbc3c15cfc9da92ab46096
diff --git a/test/end2end_test.go b/test/end2end_test.go index <HASH>..<HASH> 100644 --- a/test/end2end_test.go +++ b/test/end2end_test.go @@ -134,7 +134,7 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* return nil, grpc.Errorf(codes.DataLoss, "expected an :authority metadata: %v", md) } if err := grpc.SendHeader(ctx, md); err != nil { - return nil, fmt.Errorf("grpc.SendHeader(%v, %v) = %v, want %v", ctx, md, err, nil) + return nil, fmt.Errorf("grpc.SendHeader(_, %v) = %v, want %v", md, err, nil) } grpc.SetTrailer(ctx, testTrailerMetadata) }
Remove printing context from end2end_test UnaryCall()
grpc_grpc-go
train
go
52876d605ad090c428f57e7ef04e3ebd19e1f812
diff --git a/filters/github.py b/filters/github.py index <HASH>..<HASH> 100644 --- a/filters/github.py +++ b/filters/github.py @@ -1,7 +1,8 @@ import re ISSUE = '^.*?`(.*)`.*?$' -FULL_ISSUE = '`#{3} <https://github.com/{0}/{1}/{2}/{3}>`_' +SAME_PROJ_FULL_ISSUE = '`#{3} <https://github.com/{0}/{1}/{2}/{3}>`_' +DIFF_PROJ_FULL_ISSUE = '`{1}#{3} <https://github.com/{0}/{1}/{2}/{3}>`_' def github_expand(line, name, organisation): @@ -22,9 +23,14 @@ def github_expand(line, name, organisation): elif len(tokens) == 2: if tokens[0] == 'PR': tokens = [organisation, name, 'pull'] + tokens[1:] + elif tokens[0] != '': + tokens = [organisation, tokens[0], 'issues'] + tokens[1:] else: tokens = [organisation, name, 'issues'] + tokens[1:] - reference = FULL_ISSUE.format(*tokens) + if tokens[1] != name: + reference = DIFF_PROJ_FULL_ISSUE.format(*tokens) + else: + reference = SAME_PROJ_FULL_ISSUE.format(*tokens) return re.sub('`(.*)`', reference, line) else: return result
:sparkles: shorter syntax for referencing different project's issue
moremoban_moban-handlebars
train
py
d8d619811e64fb0b013bafbefa70d6004980c00e
diff --git a/blockchain/reactor.go b/blockchain/reactor.go index <HASH>..<HASH> 100644 --- a/blockchain/reactor.go +++ b/blockchain/reactor.go @@ -197,7 +197,13 @@ FOR_LOOP: // not thread safe access for peerless and numPending but should be fine log.Debug("Consensus ticker", "peerless", bcR.pool.peerless, "pending", bcR.pool.numPending, "total", bcR.pool.numTotal) // NOTE: this condition is very strict right now. may need to weaken - if bcR.pool.numPending == maxPendingRequests && bcR.pool.peerless == bcR.pool.numPending { + // if the max amount of requests are pending and peerless + // and we have some peers (say > 5), then we're caught up + maxPending := bcR.pool.numPending == maxPendingRequests + maxPeerless := bcR.pool.peerless == bcR.pool.numPending + o, i, _ := bcR.sw.NumPeers() + enoughPeers := o+i > 5 + if maxPending && maxPeerless && enoughPeers { log.Warn("Time to switch to consensus reactor!", "height", bcR.pool.height) bcR.pool.Stop() stateDB := dbm.GetDB("state")
dont switch off fast sync unless we have enough peers to know
tendermint_tendermint
train
go
6f716524ac17c030a3bcb7cee8022e8c1cd735a9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- from setuptools import setup version = "0.1.0"
Added utf-8 unicoding
metric-learn_metric-learn
train
py
0fbd3c07affc2b846f9eb23c02556418f4a266ab
diff --git a/master/buildbot/test/unit/test_db_steps.py b/master/buildbot/test/unit/test_db_steps.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/unit/test_db_steps.py +++ b/master/buildbot/test/unit/test_db_steps.py @@ -285,7 +285,7 @@ class Tests(interfaces.InterfaceTests): return url['name'] # order is not guaranteed though - self.assertEqual([stepdict['urls']], + self.assertEqual(stepdict['urls'], [{'name': u'foo', 'url': u'bar'}]) @defer.inlineCallbacks
stepdict['urls'] is already a list
buildbot_buildbot
train
py
240e33e58a61a63579c003d85fbda63de615c3c7
diff --git a/safe/gui/widgets/dock.py b/safe/gui/widgets/dock.py index <HASH>..<HASH> 100644 --- a/safe/gui/widgets/dock.py +++ b/safe/gui/widgets/dock.py @@ -1322,10 +1322,7 @@ class Dock(QtGui.QDockWidget, FORM_CLASS): return analysis - def add_above_layer( - self, - existing_layer, - new_layer): + def add_above_layer(self, existing_layer, new_layer): """Add a layer (e.g. impact layer) above another layer in the legend. .. versionadded:: 3.2
Use single line for method signature in add_above_layer as per @ismailsunni's PR review for #<I>
inasafe_inasafe
train
py
170c7cc689de8b149743ba1af4ce93245c6a7487
diff --git a/spec/methods_spec.rb b/spec/methods_spec.rb index <HASH>..<HASH> 100644 --- a/spec/methods_spec.rb +++ b/spec/methods_spec.rb @@ -116,9 +116,9 @@ describe EnvExt::Methods do end end - describe "#terminal" do - it "should determine the current Terminal" do - expect(subject.terminal).to eq(term) + describe "#term" do + it "should determine the current TERM" do + expect(subject.term).to eq(term) end context "when COLORTERM and TERM are set" do @@ -130,11 +130,17 @@ describe EnvExt::Methods do end it "should check COLORTERM before the TERM variable" do - expect(subject.terminal).to eq('gnome-terminal') + expect(subject.term).to eq('gnome-terminal') end end end + describe "#terminal" do + it "should be an alias to #term" do + expect(subject.terminal).to be == subject.term + end + end + describe "#debug" do it "should check if DEBUG was set" do expect(subject).to be_debug
Added specs for Methods#term.
postmodern_env
train
rb
1d21373d9c074d436e74a914082471404b5291b5
diff --git a/lib/plugins/aws/provider/awsProvider.js b/lib/plugins/aws/provider/awsProvider.js index <HASH>..<HASH> 100644 --- a/lib/plugins/aws/provider/awsProvider.js +++ b/lib/plugins/aws/provider/awsProvider.js @@ -260,6 +260,11 @@ class AwsProvider { ].join(''); message = errorMessage; userStats.track('user_awsCredentialsNotFound'); + // We do not want to trigger the retry mechanism for credential errors + return BbPromise.reject(Object.assign( + new this.serverless.classes.Error(message, err.statusCode), + { providerError: _.assign({}, err, { retryable: false }) } + )); } return BbPromise.reject(Object.assign( new this.serverless.classes.Error(message, err.statusCode),
Do not retry credential errors
serverless_serverless
train
js
2e326eba7040042e7b4e9974ebd46aaa6b03dc4f
diff --git a/integration-cli/docker_api_swarm_test.go b/integration-cli/docker_api_swarm_test.go index <HASH>..<HASH> 100644 --- a/integration-cli/docker_api_swarm_test.go +++ b/integration-cli/docker_api_swarm_test.go @@ -503,7 +503,8 @@ func (s *DockerSwarmSuite) TestAPISwarmManagerRestore(c *check.C) { d3.RestartNode(c) d3.GetService(c, id) - d3.Kill() + err := d3.Kill() + assert.NilError(c, err) time.Sleep(1 * time.Second) // time to handle signal d3.StartNode(c) d3.GetService(c, id)
Add missing error-check in TestAPISwarmManagerRestore
moby_moby
train
go
6d451849f1bfa1a5bb5a0f0f2490402c76eaba58
diff --git a/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java b/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java index <HASH>..<HASH> 100644 --- a/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java +++ b/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java @@ -140,7 +140,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform } public static boolean shouldSkip(String name, List<String> excludes, List<String> includes) { - return excludes.contains(name) || deemedInternalName(name) || (!includes.isEmpty() && !includes.contains(name)); + return (excludes != null && excludes.contains(name)) || deemedInternalName(name) || (includes != null && !includes.isEmpty() && !includes.contains(name)); } public static boolean shouldSkipOnDescriptor(Map genericsSpec, String descriptor, List<ClassNode> excludeTypes, List<ClassNode> includeTypes) {
GROOVY-<I>: @Delegate should support including/excluding which methods are delegated to using an interface spec (handle super interfaces)
apache_groovy
train
java