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
a654c89a0a4e6b7db0ae4160a49549f8ac57dd2d
diff --git a/volumes.go b/volumes.go index <HASH>..<HASH> 100644 --- a/volumes.go +++ b/volumes.go @@ -62,6 +62,7 @@ func (Volume) ResourceType() string { // ListRequest builds the ListVolumes request func (vol Volume) ListRequest() (ListCommand, error) { req := &ListVolumes{ + ID: vol.ID, Name: vol.Name, Type: vol.Type, VirtualMachineID: vol.VirtualMachineID,
Fix ListVolumes call to allow search by ID (#<I>) This change fixes the `ListVolumes` to allow volumes search by ID.
exoscale_egoscale
train
go
f1363877d8782fbceb4dd53d38d538f57b7104de
diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -168,7 +168,7 @@ class Page implements PageInterface unset($process_fields[$field]); } } - $text_header = Grav::instance()['twig']->processString(json_encode($process_fields), ['page' => $this]); + $text_header = Grav::instance()['twig']->processString(json_encode($process_fields, JSON_UNESCAPED_UNICODE), ['page' => $this]); $this->header((object)(json_decode($text_header, true) + $ignored_fields)); } }
preserve accents in fields containing Twig expr. using unicode (#<I>) When a fields contain accentuated characters, reduce the risk of messing with it by passing unicode characters unescaped. Twig will deal with them. And fewer backslash-escaping problems will arise.
getgrav_grav
train
php
9d289c1457b7a724950ea553d2fa52f41656642a
diff --git a/packages/babel-plugin-transform-typescript/src/index.js b/packages/babel-plugin-transform-typescript/src/index.js index <HASH>..<HASH> 100644 --- a/packages/babel-plugin-transform-typescript/src/index.js +++ b/packages/babel-plugin-transform-typescript/src/index.js @@ -70,7 +70,7 @@ export default declare( if (node.definite || node.declare) { if (node.value) { throw path.buildCodeFrameError( - `Definietly assigned fields and fields with the 'declare' modifier cannot` + + `Definitely assigned fields and fields with the 'declare' modifier cannot` + ` be initialized here, but only in the constructor`, ); }
Fix small typo (#<I>)
babel_babel
train
js
ce067cb4a7385309a265c926c5988fe5e4da8ca4
diff --git a/src/JMS/PhpManipulator/TokenStream/AbstractToken.php b/src/JMS/PhpManipulator/TokenStream/AbstractToken.php index <HASH>..<HASH> 100644 --- a/src/JMS/PhpManipulator/TokenStream/AbstractToken.php +++ b/src/JMS/PhpManipulator/TokenStream/AbstractToken.php @@ -219,7 +219,7 @@ abstract class AbstractToken $indentation = ''; } - return $indentation . str_repeat(' ', abs($this->getStartColumn() - strlen($indentation))); + return $indentation . str_repeat(' ', $this->getStartColumn() - strlen($indentation)); } public function getStartColumn()
no need to use abs multiplier anymore
schmittjoh_php-manipulator
train
php
98beef2c2aee40786136b9ef5ae4dc1c63edcdcb
diff --git a/ui/src/kapacitor/components/config/TelegramConfig.js b/ui/src/kapacitor/components/config/TelegramConfig.js index <HASH>..<HASH> 100644 --- a/ui/src/kapacitor/components/config/TelegramConfig.js +++ b/ui/src/kapacitor/components/config/TelegramConfig.js @@ -58,7 +58,7 @@ const TelegramConfig = React.createClass({ You need a {' '} <a - href="https://docs.influxdata.com/kapacitor/v1.2/guides/event-handler-setup/#telegram-bot" + href="https://docs.influxdata.com/kapacitor/v1.3/guides/event-handler-setup/#telegram-setup" target="_blank" > Telegram Bot
Update link to the latest documentation version Link is not pointing to the last version of the documentation of kapacitor <I>
influxdata_influxdb
train
js
273d2e14c502b850bd7e010f99ef65c875ae81b1
diff --git a/tests/core/usage/filters_usage_test.py b/tests/core/usage/filters_usage_test.py index <HASH>..<HASH> 100644 --- a/tests/core/usage/filters_usage_test.py +++ b/tests/core/usage/filters_usage_test.py @@ -96,6 +96,22 @@ class TestCustomFilters: assert not secrets @staticmethod + def test_module_success(parser): + config = { + # Remove all filters, so we can test adding things back in. + 'filters_used': [], + } + + with transient_settings(config): + default_filters = set(get_settings().filters.keys()) + + module_path = 'detect_secrets.filters.heuristic.is_sequential_string' + assert module_path not in default_filters + with transient_settings(config): + parser.parse_args(['scan', '--filter', module_path]) + assert module_path in get_settings().filters + + @staticmethod @pytest.mark.parametrize( 'filepath', (
adding test case for successful use of module_path for custom filter
Yelp_detect-secrets
train
py
eb6c688c1061be814f56848bfdcb4d5bf9761ba3
diff --git a/packages/ad/src/ad.js b/packages/ad/src/ad.js index <HASH>..<HASH> 100644 --- a/packages/ad/src/ad.js +++ b/packages/ad/src/ad.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import { Subscriber } from "react-broadcast"; -import { View } from "react-native"; +import { View, Platform } from "react-native"; import { screenWidth } from "@times-components/utils"; import { getSlotConfig, prebidConfig, getPrebidSlotConfig } from "./utils"; import adInit from "./utils/ad-init"; @@ -99,7 +99,10 @@ class Ad extends Component { ? { height: 0, width: 0 } : { height: config.maxSizes.height, - width: config.maxSizes.width + width: + Platform.OS === "ios" || Platform.OS === "android" + ? screenWidth() + : config.maxSizes.width }; const AdComponent = (
feat: make ads <I>% width on native platforms (#<I>)
newsuk_times-components
train
js
e2fe23671be087e5fe5a1470ac3b7969e7fa664a
diff --git a/project_generator/project.py b/project_generator/project.py index <HASH>..<HASH> 100644 --- a/project_generator/project.py +++ b/project_generator/project.py @@ -331,6 +331,7 @@ class Project: # None is an error if exporter is None: result = -1 + logging.debug("Tool: %s was not found" % export_tool) continue self._fill_export_dict(export_tool) @@ -358,6 +359,7 @@ class Project: builder = ToolsSupported().get_tool(build_tool) # None is an error if builder is None: + logging.debug("Tool: %s was not found" % builder) result = -1 continue
Project - export/build - debug info if tool is not found
project-generator_project_generator
train
py
292f4fd22591fac9fe0fe028dca63a2acc14aa18
diff --git a/sliceinfo.py b/sliceinfo.py index <HASH>..<HASH> 100644 --- a/sliceinfo.py +++ b/sliceinfo.py @@ -122,6 +122,12 @@ class SliceInfo(object): tmp_taint_set.add(ref.tmp) # We also taint the stack pointer, so we could keep the stack balanced reg_taint_set.add(simuvex.Architectures[arch_name].sp_offset) + + # FIXME + # Ugly fix for debugging the dell firmware stuff + if irsb.addr == 0x40906cd0: + run_statements[irsb] |= set(range(0, 100)) + for stmt_id in statement_ids: # l.debug(reg_taint_set) refs = irsb.statements[stmt_id].refs
TEMPORARY EDIT FOR TESTING ON scott.
angr_angr
train
py
639910f4ecff324abf64937a689734e3cb314f9a
diff --git a/tests/unit/model/Model.js b/tests/unit/model/Model.js index <HASH>..<HASH> 100644 --- a/tests/unit/model/Model.js +++ b/tests/unit/model/Model.js @@ -352,6 +352,16 @@ describe('Model', function () { expect(Model.ensureModelArray(null)).to.eql([]); }); + it('loadRelated should return a QueryBuilder', function () { + var Model = modelClass('Model1'); + expect(Model.loadRelated([], '[]')).to.be.a(QueryBuilder); + }); + + it('$loadRelated should return a QueryBuilder', function () { + var Model = modelClass('Model1'); + expect(Model.fromJson({}).$loadRelated('[]')).to.be.a(QueryBuilder); + }); + it('loadRelated should throw if an invalid expression is given', function () { var Model = modelClass('Model1'); expect(function () {
add tests that loadRelated methods return query builders
Vincit_objection.js
train
js
211c67807ba2b34ba62ef2cb65c08d6585f0046f
diff --git a/einhorn/einhorn.go b/einhorn/einhorn.go index <HASH>..<HASH> 100644 --- a/einhorn/einhorn.go +++ b/einhorn/einhorn.go @@ -12,7 +12,7 @@ import ( // CountListeners returns the number of listener fd's passed by the master. func CountListeners() uint { - count, err := strconv.ParseUint(os.Getenv("EINHORN_FD_COUNT"), 10, 64) + count, err := strconv.ParseUint(os.Getenv("EINHORN_FD_COUNT"), 10, 32) if err != nil { return 0 }
uints are <I>-bit, so refuse to parse uint<I>s.
stripe_go-einhorn
train
go
8fb80540499d0f303d68150304fd896367313f94
diff --git a/IPython/html/widgets/widget_container.py b/IPython/html/widgets/widget_container.py index <HASH>..<HASH> 100644 --- a/IPython/html/widgets/widget_container.py +++ b/IPython/html/widgets/widget_container.py @@ -45,7 +45,7 @@ class ContainerWidget(DOMWidget): http://www.peterbe.com/plog/uniqifiers-benchmark which provides the inspiration for using this implementation. Below I've implemented the `f5` algorithm using Python comprehensions.""" - if new is not None and isinstance(new, list): + if new is not None: seen = {} def add_item(i): seen[i.model_id] = True
remove incorrect is instance check in children_changed
jupyter-widgets_ipywidgets
train
py
da46d6fa9a52e76c2f1bc1d0abd37d3ed3c3f3e0
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index <HASH>..<HASH> 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -1052,8 +1052,7 @@ class MainWindow(QMainWindow): _("PYTHONPATH manager"), None, icon=ima.icon('pythonpath'), triggered=self.show_path_manager, - tip=_("PYTHONPATH manager"), - menurole=QAction.ApplicationSpecificRole) + tip=_("PYTHONPATH manager")) from spyder.plugins.application.plugin import ( ApplicationActions, WinUserEnvDialog) winenv_action = None
Remove PYTHONPATH manager action its role It's really not necessary and leaves the Tools menu almost empty
spyder-ide_spyder
train
py
c5a0beb481f315c69879c70d96fc4c7888818aa3
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -45,6 +45,9 @@ Server.prototype._requestListener = function(req, res) { res.end(); } else if (req.method === 'POST') { + res.setHeader('Content-Type', req.headers['content-type']); + //res.setHeader("Content-Type","application/soap+xml"); + //res.setHeader("Encoding","utf-8"); var chunks = [], gunzip; if (compress && req.headers["content-encoding"] == "gzip") { gunzip = new compress.Gunzip;
response content-type will be ok Shouldn't the response headers depend on the request headers? I mean "application/soap+xml" is soap <I>, and "text/xml" is soap <I> Refer to JamesKyburz's commit d<I>cfb<I>d<I>ebd8efd<I>f8e<I>fab<I>cf3fc7ed
vpulim_node-soap
train
js
0d2f9f892855e2a5ad3c5b6fbef969c0c9812dfe
diff --git a/src/Core.php b/src/Core.php index <HASH>..<HASH> 100755 --- a/src/Core.php +++ b/src/Core.php @@ -175,7 +175,11 @@ } catch (Exception $e) { - self::$logger->critical($e->getMessage()); + if (self::$logger instanceof Logger) { + + self::$logger->critical($e->getMessage()); + + } $response = new ProblemResponse(); $response->send(AbstractResponse::HTTP_500, new Problem($e));
Fix a bug when logger was called while not initialized
Lou117_core
train
php
4b7c24651fa7649579dad4d9253e289001e206d0
diff --git a/Query/Builder.php b/Query/Builder.php index <HASH>..<HASH> 100755 --- a/Query/Builder.php +++ b/Query/Builder.php @@ -335,10 +335,23 @@ class Builder * Add a new select column to the query. * * @param array|mixed $column + * @param \Closure|\Illuminate\Database\Query\Builder|string|null $query * @return $this */ - public function addSelect($column) + public function addSelect($column, $query = null) { + if (is_string($column) && ( + $query instanceof self || + $query instanceof EloquentBuilder || + $query instanceof Closure + )) { + if (is_null($this->columns)) { + $this->select($this->from.'.*'); + } + + return $this->selectSub($query, $column); + } + $column = is_array($column) ? $column : func_get_args(); $this->columns = array_merge((array) $this->columns, $column);
Add the ability add a sub query select
illuminate_database
train
php
3fa4acf903a00aa36824e7c0781ad9085c84aafc
diff --git a/plugins/inputs/nginx_sts/nginx_sts.go b/plugins/inputs/nginx_sts/nginx_sts.go index <HASH>..<HASH> 100644 --- a/plugins/inputs/nginx_sts/nginx_sts.go +++ b/plugins/inputs/nginx_sts/nginx_sts.go @@ -13,7 +13,7 @@ import ( "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/internal" - "github.com/influxdata/telegraf/internal/tls" + "github.com/influxdata/telegraf/plugins/common/tls" "github.com/influxdata/telegraf/plugins/inputs" )
Update common/tls import path
influxdata_telegraf
train
go
02b3f021a6089a30e19b70ba27e1c0ef841a2391
diff --git a/thinc/types.py b/thinc/types.py index <HASH>..<HASH> 100644 --- a/thinc/types.py +++ b/thinc/types.py @@ -526,6 +526,9 @@ ArrayTypesFloat = Union[ ArrayTypes = Union[ ArrayTypesFloat, ArrayTypesInt, ] +Array1d = Union[Ints1d, Floats1d] +Array2d = Union[Ints2d, Floats2d] +Array3d = Union[Ints3d, Floats3d] class Generator(Iterator): @@ -571,8 +574,8 @@ RNNState = Tuple[Tuple[Floats2d, Floats2d], Floats2d] @dataclass class Ragged: - data: Array - lengths: Array + data: Array2d + lengths: Ints1d @dataclass @@ -583,8 +586,8 @@ class Padded: shrink the batch. """ - data: Array - size_at_t: Array + data: Array3d + size_at_t: Ints1d @dataclass
Add Array1d, Array2d, Array3d union types
explosion_thinc
train
py
eac0d6295d3cd3f2bf60d2399dee42f7248e9045
diff --git a/chainconsumer/colors.py b/chainconsumer/colors.py index <HASH>..<HASH> 100644 --- a/chainconsumer/colors.py +++ b/chainconsumer/colors.py @@ -27,7 +27,7 @@ class Colors(object): "o": "orange", "y": "yellow", "a": "amber", "p": "purple", "e": "grey", "lg": "lgreen", "lb": "lblue" } - self.default_colors = ["blue", "lgreen", "red", "purple", "yellow", "grey", + self.default_colors = ["blue", "green", "red", "purple", "yellow", "grey", "lblue", "magenta", "lgreen", "brown", "black", "orange"] def format(self, color):
Noticed that lgreen appeared twice in the default_colors list. Edited this such that the first instance of lgreen is replaced by green.
Samreay_ChainConsumer
train
py
f17f49beac646adf1b9bcf15bde4db02a583495c
diff --git a/lib/sensu-plugin/utils.rb b/lib/sensu-plugin/utils.rb index <HASH>..<HASH> 100644 --- a/lib/sensu-plugin/utils.rb +++ b/lib/sensu-plugin/utils.rb @@ -48,19 +48,19 @@ module Sensu end end -# Monkey Patching. - -class Array - def deep_merge(other_array, &merger) - concat(other_array).uniq - end -end - class Hash - def deep_merge(other_hash, &merger) - merger ||= proc do |key, old_value, new_value| - old_value.deep_merge(new_value, &merger) rescue new_value + def deep_merge(hash_one, hash_two) + merged = hash_one.dup + hash_two.each do |key, value| + merged[key] = case + when hash_one[key].is_a?(Hash) && value.is_a?(Hash) + deep_merge(hash_one[key], value) + when hash_one[key].is_a?(Array) && value.is_a?(Array) + hash_one[key].concat(value).uniq + else + value + end end - merge(other_hash, &merger) + merged end end
[deep_merge_fix] use the same deep_merge code that sensu core uses
sensu-plugins_sensu-plugin
train
rb
41f21fafa76e8dc1284650cd24aea2edd770e6b2
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -39,6 +39,12 @@ module ActiveRecord super(name, self.class.extract_value_from_default(default), sql_type, null) end + def type_cast(value) + return super unless sql_type == 'bytea' + + PGconn.unescape_bytea(value) if value + end + # :stopdoc: class << self attr_accessor :money_precision
pgcolumn knows how to typecast binary columns
rails_rails
train
rb
0f6fd581da4eed236068edc345ba08346c668989
diff --git a/littlepy/lp.py b/littlepy/lp.py index <HASH>..<HASH> 100644 --- a/littlepy/lp.py +++ b/littlepy/lp.py @@ -35,17 +35,18 @@ class LPProg(object): def eval_expression(expression, state): if isinstance(expression, Var): return state[str(expression)] + operands = {"a": expression.get("a"), "b": expression.get("b")} # print ("B:",expression) for operand in ["a", "b"]: if operand in expression and isinstance(expression[operand], Var): - expression[operand] = state[str(expression[operand])] + operands[operand] = state[str(expression[operand])] elif operand in expression and isinstance(expression[operand], dict): - expression[operand] = LPProg.eval_expression(expression[operand], state) + operands[operand] = LPProg.eval_expression(expression[operand], state) # print ("A:",expression) if expression["op"] in LPProg.uniaryOps: - return LPProg.uniaryOps[expression["op"]](expression["a"]) + return LPProg.uniaryOps[expression["op"]](operands["a"]) elif expression["op"] in LPProg.binaryOps: - return LPProg.binaryOps[expression["op"]](expression["a"],expression["b"]) + return LPProg.binaryOps[expression["op"]](operands["a"], operands["b"]) raise Exception("Unknown op") @staticmethod
Fixed bug where the variables were being replaced with the values for subsequent run.
derpferd_little-python
train
py
66317861519cce1f59c9529906efc5f9bca6d3db
diff --git a/lib/EntityManager.js b/lib/EntityManager.js index <HASH>..<HASH> 100644 --- a/lib/EntityManager.js +++ b/lib/EntityManager.js @@ -119,6 +119,7 @@ EntityManager.prototype.removeEntity = function (entity) { // Prevent any acecss and free entity._manager = null this._entityPool.recycle(entity) + entity.removeAllListeners() } /** diff --git a/test/entities-events.js b/test/entities-events.js index <HASH>..<HASH> 100644 --- a/test/entities-events.js +++ b/test/entities-events.js @@ -59,3 +59,29 @@ test('Component remove', function (t) { entity.addComponent(C).removeComponent(C) }) + +test('EventEmitter recycling', function (t) { + t.plan(2) + + function C () { } + + var m = nano() + + var entity = m.createEntity() + + entity.on('component added', function (T) { + t.ok('callback hit') + }) + + entity.addComponent(C) + + entity.remove() + + var entity2 = m.createEntity() + + t.equals(entity, entity2) + + entity2.addComponent(C) + + t.end() +})
clear eventemitters on entity removal
noffle_nano-ecs
train
js,js
f6b024e157d3aecf364894a1b24f1e51504b0e18
diff --git a/reader.go b/reader.go index <HASH>..<HASH> 100644 --- a/reader.go +++ b/reader.go @@ -70,10 +70,10 @@ func (r *reader) SetNonResponsive() { func (r *reader) SetReadahead(readahead int64) { r.mu.Lock() - defer r.mu.Unlock() r.readahead = readahead r.readaheadFunc = nil r.posChanged() + r.mu.Unlock() } // How many bytes are available to read. Max is the most we could require. @@ -248,8 +248,8 @@ func (r *reader) readOnceAt(ctx context.Context, b []byte, pos int64) (n int, er // Hodor func (r *reader) Close() error { r.t.cl.lock() - defer r.t.cl.unlock() r.t.deleteReader(r) + r.t.cl.unlock() return nil }
Inlineable (*reader).SetReadAhead and (*reader).Close (#<I>) Small fixes that prevent inlining of public functions
anacrolix_torrent
train
go
7af1eb7b4d4c0f65e4e5f33429d34fd79a5818f1
diff --git a/templates/generate_stuff.rb b/templates/generate_stuff.rb index <HASH>..<HASH> 100644 --- a/templates/generate_stuff.rb +++ b/templates/generate_stuff.rb @@ -295,5 +295,5 @@ unless ENV['TRAVIS'] run 'bin/rake db:import' end -run 'RAILS_ENV=test bin/rake db:setup' +run 'RAILS_ENV=test bundle exec rake db:setup'
try to create travis test db for sure
razum2um_lurker
train
rb
41eb81879f4fbeb67b70cbfd3d0c99e8211d90ef
diff --git a/src/Yubikey/Validate.php b/src/Yubikey/Validate.php index <HASH>..<HASH> 100644 --- a/src/Yubikey/Validate.php +++ b/src/Yubikey/Validate.php @@ -274,7 +274,7 @@ class Validate $signature = $this->generateSignature($params); $url = '/wsapi/2.0/verify?'.http_build_query($params).'&h='.$signature; - $hosts = ($multi == false) ? array(array_shift($this->hosts)) : $this->hosts; + $hosts = ($multi === false) ? array(array_shift($this->hosts)) : $this->hosts; return $this->request($url, $hosts, $otp, $nonce); }
changing == to == for boolean evaluation
enygma_yubikey
train
php
1d2fd9dbebf07d36a5e3f915a3640a38c3981e1b
diff --git a/modules/uadetector-core/src/main/java/net/sf/uadetector/UserAgentFamily.java b/modules/uadetector-core/src/main/java/net/sf/uadetector/UserAgentFamily.java index <HASH>..<HASH> 100644 --- a/modules/uadetector-core/src/main/java/net/sf/uadetector/UserAgentFamily.java +++ b/modules/uadetector-core/src/main/java/net/sf/uadetector/UserAgentFamily.java @@ -2736,6 +2736,11 @@ public enum UserAgentFamily { PATRIOTT("Patriott", Pattern.compile("Patriott")), /** + * Pattern is a web mining module for the Python programming language. + */ + PATTERN("Pattern", Pattern.compile("Pattern")), + + /** * PEAR HTTP_Request */ PEAR_HTTP_REQUEST("PEAR HTTP_Request", Pattern.compile("PEAR HTTP_Request")),
Added user agent family 'Pattern' (Pattern is a web mining module for the Python programming language.)
before_uadetector
train
java
f0608f6fedff4139d17e0121b133e144573d49f8
diff --git a/resources/example-behaviour.js b/resources/example-behaviour.js index <HASH>..<HASH> 100644 --- a/resources/example-behaviour.js +++ b/resources/example-behaviour.js @@ -29,11 +29,13 @@ pairs = [], i, pair, - adjusted; + adjusted, + modeFound = false; for (i = chunks.length - 1; i >= 0; --i) { pair = chunks[i].split('='); if (pair[0].toLowerCase() === 'mode') { pair[1] = newMode; + modeFound = true; } adjusted = encodeURIComponent(pair[0]); if (typeof pair[1] !== undefined) { @@ -41,8 +43,8 @@ } pairs.push(adjusted); } - if (pairs.length === 0) { - pairs[0] = 'mode=' + encodeURIComponent(newMode); + if (!modeFound) { + pairs.push('mode=' + encodeURIComponent(newMode)); } location.href = baseUrl + '?' + pairs.join('&'); };
Allow other params than 'mode' in example query string. Currently, if other params are present at the beginning of the query string, the mode switcher will not work. This situation can occur when a search criteria was entered in the examples index page. That criteria will be passed along to the example page via a query param.
openlayers_openlayers
train
js
2fce9e904f4d571d3ef3323500ee9c523ecdabd1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -112,7 +112,6 @@ See "Homepage" on GitHub for detail. 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', @@ -121,6 +120,8 @@ See "Homepage" on GitHub for detail. 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Topic :: System :: Installation/Setup', ], scripts=[
Update supported Python versions in setup.py. * Added Python <I>, <I>. * Dropped Python <I>. Because we can't run the test on Python <I> on CentOS 6 any more.
junaruga_rpm-py-installer
train
py
47950624a20c383529039a71f088f64213a8aeac
diff --git a/scripts/jenkins-build.py b/scripts/jenkins-build.py index <HASH>..<HASH> 100644 --- a/scripts/jenkins-build.py +++ b/scripts/jenkins-build.py @@ -14,7 +14,7 @@ bh.vepycall('easy_install', 'coverage') # have to install dev build of mock using pip directly because of pip bug: # https://github.com/pypa/pip/issues/145 -bh.vepycall('pip', 'install', 'mock==dev') +bh.vepycall('pip', 'install', 'http://www.voidspace.org.uk/downloads/mock-0.8.0beta4.tar.gz#egg=mock-dev') # install other jenkins requirements bh.pip_install_reqs('pip-jenkins-reqs.txt')
pip is killing Jenkins, again Ok, I don't have mock==dev in the local pypi cache, so I am getting an error. A direct URL should fix this.
blazelibs_blazeutils
train
py
bac9f28025e3b4da618f18581c92c0e584020cd7
diff --git a/lib/clearance/engine.rb b/lib/clearance/engine.rb index <HASH>..<HASH> 100644 --- a/lib/clearance/engine.rb +++ b/lib/clearance/engine.rb @@ -23,10 +23,7 @@ module Clearance app.config.filter_parameters += [:password, :token] end - config.app_middleware.insert_after( - ActionDispatch::ParamsParser, - Clearance::RackSession - ) + config.app_middleware.use(Clearance::RackSession) config.to_prepare do Clearance.configuration.reload_user_model
Add middleware at the bottom Rails 5 eliminates the `ParamsParser` middleware. The Clearance middleware itself seems to have no dependency on certain middleware running after it.
thoughtbot_clearance
train
rb
f23d22887b6756b1c8624aeb4732281f6b7c3229
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with open(README_PATH, "r") as README_FILE: setup( name="parse_this", - version="2.0.0", + version="2.0.1", description=( "Makes it easy to create a command line interface for any " "function, method or classmethod.."
Increment version to avoid pypi failing on same upload
bertrandvidal_parse_this
train
py
f7e25de808338e1b38ca2d2be8fe39abd47fb38c
diff --git a/spec/publish_ami.rb b/spec/publish_ami.rb index <HASH>..<HASH> 100755 --- a/spec/publish_ami.rb +++ b/spec/publish_ami.rb @@ -62,5 +62,5 @@ Dir.mktmpdir do |dir| YAML.dump(stemcell_properties, out ) end - %{tar cvzf light-#{stemcell_tgz} #{dir}} + %x{tar cvzf light-#{stemcell_tgz} #{dir}} end
Execute the tar to build a light stemcell
cloudfoundry_bosh
train
rb
0ec4af73a5a452e63fb2ac88829bc2ff74098a36
diff --git a/pgmpy/models/NaiveBayesModel.py b/pgmpy/models/NaiveBayesModel.py index <HASH>..<HASH> 100644 --- a/pgmpy/models/NaiveBayesModel.py +++ b/pgmpy/models/NaiveBayesModel.py @@ -212,6 +212,8 @@ class NaiveBayesModel(BayesianModel): >>> model.edges() [('A', 'D'), ('A', 'E'), ('A', 'B'), ('A', 'C')] """ + if parent_node not in data.columns: + raise ValueError("parent node {node} is not present in the given data".format(node=parent_node)) for child_node in data.columns: if child_node != parent_node: self.add_edge(parent_node, child_node)
adds error case in fit method of NaiveBayes
pgmpy_pgmpy
train
py
9d5e649c7ca06543d8f8e03d4f9593f19e47096d
diff --git a/src/Model/Table/SavedSearchesTable.php b/src/Model/Table/SavedSearchesTable.php index <HASH>..<HASH> 100644 --- a/src/Model/Table/SavedSearchesTable.php +++ b/src/Model/Table/SavedSearchesTable.php @@ -844,6 +844,30 @@ class SavedSearchesTable extends Table } /** + * Filter only current module fields. + * + * @param \Cake\ORM\Table $table Table instance + * @param array $fields Search fields + * @return array + */ + protected function _filterModuleFields(Table $table, array $fields) + { + if (empty($fields)) { + return []; + } + + foreach ($fields as $k => $v) { + if (false !== strpos($v, $table->getAlias() . '.')) { + continue; + } + + unset($fields[$k]); + } + + return $fields; + } + + /** * Prepare search query's where statement * * @param array $data request data
Filter provided fields to only include current table's fields (task #<I>)
QoboLtd_cakephp-search
train
php
659c0c2ca62d780bc638045b9eed2a53102d7378
diff --git a/presto-raptor/src/test/java/com/facebook/presto/raptor/integration/TestRaptorIntegrationSmokeTestMySql.java b/presto-raptor/src/test/java/com/facebook/presto/raptor/integration/TestRaptorIntegrationSmokeTestMySql.java index <HASH>..<HASH> 100644 --- a/presto-raptor/src/test/java/com/facebook/presto/raptor/integration/TestRaptorIntegrationSmokeTestMySql.java +++ b/presto-raptor/src/test/java/com/facebook/presto/raptor/integration/TestRaptorIntegrationSmokeTestMySql.java @@ -77,6 +77,7 @@ public class TestRaptorIntegrationSmokeTestMySql .put("storage.data-directory", new File(baseDir, "data").toURI().toString()) .put("storage.max-shard-rows", "2000") .put("backup.provider", "file") + .put("raptor.startup-grace-period", "10s") .put("backup.directory", new File(baseDir, "backup").getAbsolutePath()) .build();
Lower startup-grace-period for TestRaptorIntegrationSmokeTestMySql TestRaptorIntegrationSmokeTestMySql is flaky due to long startup grace period. Lower it to <I> seconds.
prestodb_presto
train
java
d2db0418059ce0abb0d16f1b60e6912d70675d52
diff --git a/egg/_gui.py b/egg/_gui.py index <HASH>..<HASH> 100644 --- a/egg/_gui.py +++ b/egg/_gui.py @@ -2353,6 +2353,11 @@ class TreeDictionary(BaseObject): def get_list_values(self, key): """ Returns the values for a list item of the specified key. + + Parameters + ---------- + key : string + Dictionary key to query. """ # Make sure it's a list if not self.get_type(key) in ['list']: @@ -2362,6 +2367,18 @@ class TreeDictionary(BaseObject): # Return a copy of the list values return list(self.get_widget(key).opts['values']) + def get_list_index(self, key): + """ + Returns the index of the currently selected list item of the specified + key. + + Parameters + ---------- + key : string + Dictionary key to query. + """ + return self.get_list_values(key).index(self.get_value(key)) + def get_dictionary(self, short_keys=False): """ Returns the list of parameters and a dictionary of values
Update _gui.py Ability to get the list index from TreeDictionary combo box.
Spinmob_spinmob
train
py
e9bc0dcae86d44665b643a8b873907ede7c78223
diff --git a/scout/commands/load/load_database.py b/scout/commands/load/load_database.py index <HASH>..<HASH> 100755 --- a/scout/commands/load/load_database.py +++ b/scout/commands/load/load_database.py @@ -52,7 +52,7 @@ def user(context, institute_id, user_name, user_mail): """Add a user to the database.""" adapter = context.obj['adapter'] - institute = adapter.institute(institute_id=institute_name) + institute = adapter.institute(institute_id=institute_id) if not institute: log.info("Institute {0} does not exist".format(institute_id))
Fixes type when loading a user from CLI. Fix #<I>
Clinical-Genomics_scout
train
py
8328aea7d2c316b676bd6695b8a3d1a7701796f3
diff --git a/language/parser/parser.go b/language/parser/parser.go index <HASH>..<HASH> 100644 --- a/language/parser/parser.go +++ b/language/parser/parser.go @@ -667,14 +667,6 @@ func parseField(parser *Parser) (ast.Field, error) { } else { name = nameOrAlias } - var selectionSet ast.SelectionSet - if peek(parser, lexer.TokenKind[lexer.BRACE_L]) { - sSet, err := parseSelectionSet(parser) - if err != nil { - return ast.Field{}, err - } - selectionSet = sSet - } arguments, err := parseArguments(parser) if err != nil { return ast.Field{}, err @@ -683,6 +675,14 @@ func parseField(parser *Parser) (ast.Field, error) { if err != nil { return ast.Field{}, err } + var selectionSet ast.SelectionSet + if peek(parser, lexer.TokenKind[lexer.BRACE_L]) { + sSet, err := parseSelectionSet(parser) + if err != nil { + return ast.Field{}, err + } + selectionSet = sSet + } return ast.Field{ Kind: kinds.Field, Alias: alias,
Fixed `TestParserParsesKitchenSink` test - Order of which tokens are parsed are important - Left 1 more failing `parser` test!
graphql-go_graphql
train
go
09ed13b270ee7a87e027a8c8cb029d9552e5b46f
diff --git a/rinoh/layout.py b/rinoh/layout.py index <HASH>..<HASH> 100644 --- a/rinoh/layout.py +++ b/rinoh/layout.py @@ -250,27 +250,15 @@ class ExpandingContainer(Container): `width` and `right` parameters. `max_height` is the maximum height this container can grow to.""" - height = Dimension(0) + height = DimensionAddition(Dimension(0)) super().__init__(name, parent, left, top, width, height, right, bottom) + self.height.addends.append(self._cursor) self.max_height = max_height or parent.remaining_height # FIXME: this assumption is correct for MaybeContainer, but not generally @property def remaining_height(self): return self.max_height - self.cursor - def advance(self, height, check_overflow=True): - """Advance the cursor by `height`. If this would expand the container - to become larger than its maximum height, an :class:`EndOfContainer` - exception is raised.""" - self._self_cursor.grow(height) - if check_overflow and self.max_height and self.remaining_height < 0: - raise EndOfContainer - self._expand(height) - - def _expand(self, height): - """Grow this container by `height`""" - self.height.grow(height) - class DownExpandingContainer(ExpandingContainer): """A container that is anchored at the top and expands downwards."""
ExpandingContainer.height was duplicating _cursor Automatically calculate height from the cursor. Fixes footnote container expansion.
brechtm_rinohtype
train
py
9dfbdb871d03e46bdb7a8fdc39aa4c9b1053dfcd
diff --git a/Resources/public/js/src/module/application/form.js b/Resources/public/js/src/module/application/form.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/src/module/application/form.js +++ b/Resources/public/js/src/module/application/form.js @@ -116,24 +116,24 @@ var _bindEnhancements = function(form) { var $form = $(form); - + // Date and time pickers if ($.isFunction($.fn.datetimepicker)) { $('input.date', $form).datetimepicker({ pickTime : false, - format : 'MM/DD/YY' + format : Orkestra.dateFormat || 'MM/DD/YY' }); - + $('input.timepicker', $form).datetimepicker({ useSeconds : false, pickDate : false, minuteStepping : 1, format : 'hh:mm A' }); - + $('input.datetimepicker', $form).datetimepicker({ useSeconds : false, - format : 'MM/DD/YY hh:mm A' + format : Orkestra.dateFormat + ' hh:mm A' || 'MM/DD/YY hh:mm A' }); }
added option to include global date format for datepickers
orkestra_OrkestraApplicationBundle
train
js
0387f70bfd2f4e923b028bec959bcccfd120e047
diff --git a/frojd_fabric/recipes/django_frojd.py b/frojd_fabric/recipes/django_frojd.py index <HASH>..<HASH> 100644 --- a/frojd_fabric/recipes/django_frojd.py +++ b/frojd_fabric/recipes/django_frojd.py @@ -1,3 +1,9 @@ -""" -TODO: Create customized recipe for the frojd demo server -""" +from frojd_fabric.hooks import hook +from frojd_fabric.ext import uwsgi +from frojd_fabric.recipes import django + + +@hook("after_deploy") +def after_deploy(): + uwsgi.reload() +
Created recipe that includes django but adds a uwsgi restart
Frojd_Fabrik
train
py
658da23d164eedd3ca214b292e31f244e648d647
diff --git a/tests/includes/properties/class-papi-property-editor-test.php b/tests/includes/properties/class-papi-property-editor-test.php index <HASH>..<HASH> 100644 --- a/tests/includes/properties/class-papi-property-editor-test.php +++ b/tests/includes/properties/class-papi-property-editor-test.php @@ -62,7 +62,6 @@ class Papi_Property_Editor_Test extends WP_UnitTestCase { $this->assertEquals( 'editor', $this->property->type ); $this->assertEquals( 'Text', $this->property->title ); $this->assertEquals( 'papi_editor', $this->property->slug ); - $this->assertTrue( $this->property->settings->editor ); } /**
Removed assertions test on code that dont exists any more
wp-papi_papi
train
php
cd1cf1448f189c5523da4a0df96304c15564884b
diff --git a/packages/create-react-microservice/src/commands/default.spec.js b/packages/create-react-microservice/src/commands/default.spec.js index <HASH>..<HASH> 100644 --- a/packages/create-react-microservice/src/commands/default.spec.js +++ b/packages/create-react-microservice/src/commands/default.spec.js @@ -497,11 +497,9 @@ describe('new Command().safelyCreateNpmScopeArg()', () => { '`', '´' ]; - specialChars.forEach(character => { - expect(instance.safelyCreateNpmScopeArg(`${character}foo-bar`)).toBe( - '@foo-bar/' - ); - }); + expect( + instance.safelyCreateNpmScopeArg(`${specialChars.join('')}foo-bar`) + ).toBe('@foo-bar/'); }); });
TASK: simplify new test for task #<I>
ImmoweltGroup_create-react-microservice
train
js
de0a1f92655897d358023121eb4dfdf443cee641
diff --git a/packages/cozy-pouch-link/src/PouchManager.js b/packages/cozy-pouch-link/src/PouchManager.js index <HASH>..<HASH> 100644 --- a/packages/cozy-pouch-link/src/PouchManager.js +++ b/packages/cozy-pouch-link/src/PouchManager.js @@ -116,12 +116,22 @@ export default class PouchManager { () => this.startReplicationLoop(), false ) + document.addEventListener( + 'offline', + () => this.stopReplicationLoop(), + false + ) + document.addEventListener( + 'online', + () => this.startReplicationLoop(), + false + ) this.listenerLaunched = true } } removeListener() { - if (this.listenerLaunched) { + if (isMobileApp() && this.listenerLaunched) { document.removeEventListener( 'pause', () => this.stopReplicationLoop(), @@ -137,6 +147,16 @@ export default class PouchManager { () => this.startReplicationLoop(), false ) + document.removeEventListener( + 'offline', + () => this.stopReplicationLoop(), + false + ) + document.removeEventListener( + 'online', + () => this.startReplicationLoop(), + false + ) this.listenerLaunched = false } }
feat: Stop Start replication when device is online/offline
cozy_cozy-client
train
js
33fd2fd85cb8a0d85036aa9f893e1d44d8850afd
diff --git a/tests/__init__.py b/tests/__init__.py index <HASH>..<HASH> 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import sys +import os from unittest import TestCase PY3 = sys.version_info[0] == 3 @@ -27,3 +28,7 @@ class CleoTestCase(TestCase): def mock(self): return mock + + def open_fixture(self, fixture): + with open(os.path.join(self.fixtures_path, fixture)) as fh: + return fh.read() diff --git a/tests/test_application.py b/tests/test_application.py index <HASH>..<HASH> 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -28,10 +28,6 @@ class ApplicationTest(CleoTestCase): 'fixtures' ) - def open_fixture(self, fixture): - with open(os.path.join(self.fixtures_path, fixture)) as fh: - return fh.read() - def ensure_static_command_help(self, application): for command in application.all().values(): command.set_help(
Move open_fixtures() method to CleoTestCase class.
sdispater_cleo
train
py,py
98550e1769591ff6583910305ea1d8fc6de522e9
diff --git a/test/Insteon.js b/test/Insteon.js index <HASH>..<HASH> 100644 --- a/test/Insteon.js +++ b/test/Insteon.js @@ -161,9 +161,33 @@ describe('Insteon Gateway (IP Interface)', function () { }); }); + it('emits \'close\' event', function(done) { + var gw = new Insteon(); + + gw.on('close', done); + gw.connect(host, function () { + gw.close(); + }); + }); + + it.only('emits \'error\' event', function(done) { + var gw = new Insteon(); + + gw.on('error', function(err, info) { + should.exist(err); + err.message.should.equal('test'); + done(); + }); + gw.connect(host, function () { + setTimeout(function() { + gw.socket.destroy(new Error("test")); + }, 100); + }); + }); + describe('Light commands', function () { - it('gets light\' informaion', function (done) { + it('gets light\'s informaion', function (done) { var gw = new Insteon(); var light = gw.light('112233'); var plan = new Plan(3, done);
Add tests for 'close' and 'error' events
automategreen_home-controller
train
js
041f56bd5ca479160fa3b12d05d09aa8c455c97d
diff --git a/dataviews/plotting/sheetplots.py b/dataviews/plotting/sheetplots.py index <HASH>..<HASH> 100644 --- a/dataviews/plotting/sheetplots.py +++ b/dataviews/plotting/sheetplots.py @@ -153,7 +153,7 @@ class VectorFieldPlot(Plot): max_magnitude = self._max_magnitude if self._max_magnitude else max(magnitudes) min_dist = self._min_dist if self._min_dist else self._get_min_dist(vfield) - if self.normalize_lengths: + if self.normalize_lengths and max_magnitude != 0: magnitudes = magnitudes / max_magnitude return (xs, ys, list((radians / np.pi) * 180),
Fixed bug in VectorFieldPlot magnitude normalization Division by zero error was raised when VectorField had zero magnitude, normalization now skipped.
pyviz_holoviews
train
py
1673be0722abd4b3e705da8e72c8d3be86cadadb
diff --git a/astropy_helpers/tests/test_setup_helpers.py b/astropy_helpers/tests/test_setup_helpers.py index <HASH>..<HASH> 100644 --- a/astropy_helpers/tests/test_setup_helpers.py +++ b/astropy_helpers/tests/test_setup_helpers.py @@ -2,6 +2,7 @@ import os import sys import stat import shutil +import warnings import contextlib import pytest @@ -12,6 +13,7 @@ from setuptools import Distribution from ..setup_helpers import get_package_info, register_commands from ..commands import build_ext +from ..utils import AstropyDeprecationWarning from . import reset_setup_helpers, reset_distutils_log, fix_hide_setuptools # noqa from . import run_setup, cleanup_import @@ -323,7 +325,8 @@ def test_build_docs(tmpdir, mode): elif mode == 'cli-l': run_setup('setup.py', ['build_docs', '-l']) elif mode == 'deprecated': - run_setup('setup.py', ['build_sphinx']) + with pytest.warns(AstropyDeprecationWarning): + run_setup('setup.py', ['build_sphinx']) elif mode == 'direct': # to check coverage with docs_dir.as_cwd(): from sphinx import main
Handle expected deprecation warning when testing build_sphinx
astropy_astropy-helpers
train
py
134263e9546ab78c91c24131a61ada7ce5e9d0d4
diff --git a/src/Zicht/Bundle/PageBundle/Security/Voter/PageVoter.php b/src/Zicht/Bundle/PageBundle/Security/Voter/PageVoter.php index <HASH>..<HASH> 100644 --- a/src/Zicht/Bundle/PageBundle/Security/Voter/PageVoter.php +++ b/src/Zicht/Bundle/PageBundle/Security/Voter/PageVoter.php @@ -30,7 +30,7 @@ class PageVoter extends AbstractVoter public function vote(TokenInterface $token, $object, array $attributes) { // check if class of this object is supported by this voter - if (!$this->supportsClass(get_class($object))) { + if (is_null($object) || (is_object($object) && !$this->supportsClass(get_class($object)))) { return VoterInterface::ACCESS_ABSTAIN; }
Fix PageVoter not abstaining non-supported classes # Conflicts: # CHANGELOG.md # src/Zicht/Bundle/PageBundle/Security/Voter/PageVoter.php
zicht_page-bundle
train
php
7d44b9fa2d53c95cdd75a523e5a17264e93237e2
diff --git a/pprofile.py b/pprofile.py index <HASH>..<HASH> 100755 --- a/pprofile.py +++ b/pprofile.py @@ -611,8 +611,6 @@ class StatisticalThread(threading.Thread, ProfileRunnerBase): def __exit__(self, exc_type, exc_val, exc_tb): self.stop() - self.profiler.total_time += time() - self._start_time - self._start_time = None self.join() def run(self):
fixup! Populate total time when stopping StatisticalThread.
vpelletier_pprofile
train
py
ce956505e3461e7c102217d008a0ad95bd7ed0e5
diff --git a/lib/cube_solver/cube.rb b/lib/cube_solver/cube.rb index <HASH>..<HASH> 100644 --- a/lib/cube_solver/cube.rb +++ b/lib/cube_solver/cube.rb @@ -133,7 +133,7 @@ module CubeSolver def unpermuted_locations_for(type) send(type).each_with_index.map do |cubie, location| - location == permuted_location_for(cubie) ? nil : location + location unless location == permuted_location_for(cubie) end.compact end
Remove ternary operator, don't need it here
chrishunt_rubiks-cube
train
rb
96dd78034edddac09389c1a230f8eb16e5611b29
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,7 @@ var concat = require('gulp-concat'); //buildConfig: var buildConf = require('./build.json'); -var sources = ['index.js','{component,application,helper,network,router,store,util,definition}/**/*']; +var sources = ['index.js', '{component,application,helper,network,router,store,util,definition}/**/*']; /********************** Linting files **********************/ @@ -141,7 +141,7 @@ gulp.task('browserify', function(){ //.pipe(source("focus-"+require('./package.json').version+".js")) .pipe(source("focus.js")) .pipe(gulp.dest('./dist/')) - .pipe(gulp.dest('../focus-components/dist')); + .pipe(gulp.dest('../focus-components/dist/js')); });
[build] build in ofcus-components.
KleeGroup_focus-core
train
js
4fb338b27988d046ae3cdd11667d669b4f532594
diff --git a/pkg/registry/core/service/storage/rest.go b/pkg/registry/core/service/storage/rest.go index <HASH>..<HASH> 100644 --- a/pkg/registry/core/service/storage/rest.go +++ b/pkg/registry/core/service/storage/rest.go @@ -512,7 +512,7 @@ func (al *RESTAllocStuff) handleClusterIPsForUpdatedService(oldService *api.Serv } // for pre dual stack (gate == off). Hardwired to ClusterIP and ignores all new fields -func (al *RESTAllocStuff) releaseServiceClusterIP(service *api.Service) (released map[api.IPFamily]string, err error) { +func (al *RESTAllocStuff) releaseClusterIP(service *api.Service) (released map[api.IPFamily]string, err error) { toRelease := make(map[api.IPFamily]string) // we need to do that to handle cases where allocator is no longer configured on @@ -539,7 +539,7 @@ func (al *RESTAllocStuff) releaseServiceClusterIPs(service *api.Service) (releas } if !utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) { - return al.releaseServiceClusterIP(service) + return al.releaseClusterIP(service) } toRelease := make(map[api.IPFamily]string)
Svc REST: rename releaseServiceClusterIP
kubernetes_kubernetes
train
go
ea68f09f79c39c8041a8ebb85e46df03c8d24a31
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100644 --- a/tests.py +++ b/tests.py @@ -4,5 +4,24 @@ from preconditions import PreconditionError, preconditions class InvalidPreconditionTests (TestCase): - def test_varargs_in_precondition(self): - self.assertRaises(PreconditionError, preconditions, lambda *a: a) + def test_varargs(self): + self.assertRaises(PreconditionError, preconditions, lambda *a: True) + + def test_kwargs(self): + self.assertRaises(PreconditionError, preconditions, lambda **kw: True) + + def test_unknown_nondefault_param(self): + # The preconditions refer to "x" but are applied to "a, b", so + # "x" is unknown: + p = preconditions(lambda x: True) + + self.assertRaises(PreconditionError, p, lambda a, b: a+b) + + def test_default_masks_param(self): + # Preconditions may have defaults as a hack to bind local + # variables (such as when declared syntactically inside loops), + # but this "closure hack" must not mask application function + # parameter names: + p = preconditions(lambda a, b='a stored value': True) + + self.assertRaises(PreconditionError, p, lambda a, b: a+b)
Add tests for other precondition definition errors.
nejucomo_preconditions
train
py
76a0ee98444fdf6593d6c592165db96a04aa1fc6
diff --git a/ui/app/projects/directives/pnc-build-configurations/pncBuildConfigurations.js b/ui/app/projects/directives/pnc-build-configurations/pncBuildConfigurations.js index <HASH>..<HASH> 100644 --- a/ui/app/projects/directives/pnc-build-configurations/pncBuildConfigurations.js +++ b/ui/app/projects/directives/pnc-build-configurations/pncBuildConfigurations.js @@ -40,9 +40,9 @@ scope: { pncProject: '=' }, - link: function (scope) { - scope.page = BuildConfigurationDAO.getPagedByProject({ projectId: scope.pncProject.id }); - } + controller: ['$scope', function ($scope) { + $scope.page = BuildConfigurationDAO.getPagedByProject({ projectId: $scope.pncProject.id }); + }] }; } ]);
NCL-<I> Link method replaced by controller
project-ncl_pnc
train
js
8793995f61d7dfa59e3510fe8643312ad97cd235
diff --git a/src/Bridge/UserRepository.php b/src/Bridge/UserRepository.php index <HASH>..<HASH> 100644 --- a/src/Bridge/UserRepository.php +++ b/src/Bridge/UserRepository.php @@ -32,8 +32,10 @@ class UserRepository implements UserRepositoryInterface */ public function getUserEntityByUserCredentials($username, $password, $grantType, ClientEntityInterface $clientEntity) { - if (is_null($model = config('auth.providers.users.model'))) { - throw new RuntimeException('Unable to determine user model from configuration.'); + $provider = config('auth.guards.api.provider'); + + if (is_null($model = config('auth.providers.'.$provider.'.model'))) { + throw new RuntimeException('Unable to determine authentication model from configuration.'); } if (method_exists($model, 'findForPassport')) { diff --git a/src/Token.php b/src/Token.php index <HASH>..<HASH> 100644 --- a/src/Token.php +++ b/src/Token.php @@ -70,7 +70,9 @@ class Token extends Model */ public function user() { - return $this->belongsTo(config('auth.providers.users.model')); + $provider = config('auth.guards.api.provider'); + + return $this->belongsTo(config('auth.providers.'.$provider.'.model')); } /**
Customisable Authentication Model users provider was set statically in the code. Changed to use one specified for api configuration
laravel_passport
train
php,php
9c032a7548e34b3ae69e068acdb776b8b879863f
diff --git a/src/frontend/org/voltdb/iv2/MpProcedureTask.java b/src/frontend/org/voltdb/iv2/MpProcedureTask.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/iv2/MpProcedureTask.java +++ b/src/frontend/org/voltdb/iv2/MpProcedureTask.java @@ -139,6 +139,8 @@ public class MpProcedureTask extends ProcedureTask "Failure while running system procedure " + txn.m_initiationMsg.getStoredProcedureName() + ", and system procedures can not be restarted.")); errorResp.m_sourceHSId = m_initiator.getHSId(); + m_txnState.setDone(); + m_queue.flush(getTxnId()); m_initiator.deliver(errorResp); if (hostLog.isDebugEnabled()) {
ENG-<I> flush mp queue for non-restartable (#<I>)
VoltDB_voltdb
train
java
b63d880af5add7489f9f06cf5749e238292206cf
diff --git a/mmcv/runner/runner.py b/mmcv/runner/runner.py index <HASH>..<HASH> 100644 --- a/mmcv/runner/runner.py +++ b/mmcv/runner/runner.py @@ -275,6 +275,7 @@ class Runner(object): self.data_loader = data_loader self.call_hook('before_train_epoch') + time.sleep(2) # Prevent possible deadlock during epoch transition for i, data_batch in enumerate(data_loader): self._inner_iter = i self.call_hook('before_train_iter') @@ -297,7 +298,7 @@ class Runner(object): self.mode = 'val' self.data_loader = data_loader self.call_hook('before_val_epoch') - + time.sleep(2) # Prevent possible deadlock during epoch transition for i, data_batch in enumerate(data_loader): self._inner_iter = i self.call_hook('before_val_iter')
Add sleep(2) during epoch transition (#<I>)
open-mmlab_mmcv
train
py
0e5af57f6088f6de6cb2cedba627922de72aed8f
diff --git a/util/execdetails/execdetails.go b/util/execdetails/execdetails.go index <HASH>..<HASH> 100644 --- a/util/execdetails/execdetails.go +++ b/util/execdetails/execdetails.go @@ -193,7 +193,7 @@ func (d ExecDetails) ToZapFields() (fields []zap.Field) { fields = append(fields, zap.String(strings.ToLower(ProcessTimeStr), strconv.FormatFloat(d.ProcessTime.Seconds(), 'f', -1, 64)+"s")) } if d.WaitTime > 0 { - fields = append(fields, zap.String(strings.ToLower(WaitTimeStr), strconv.FormatFloat(d.ProcessTime.Seconds(), 'f', -1, 64)+"s")) + fields = append(fields, zap.String(strings.ToLower(WaitTimeStr), strconv.FormatFloat(d.WaitTime.Seconds(), 'f', -1, 64)+"s")) } if d.BackoffTime > 0 { fields = append(fields, zap.String(strings.ToLower(BackoffTimeStr), strconv.FormatFloat(d.BackoffTime.Seconds(), 'f', -1, 64)+"s"))
log: tiny fix for expensive query log in execute detail (#<I>)
pingcap_tidb
train
go
5b2b138d24d4370c7bdc8d7e2a230479e569a0bd
diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index <HASH>..<HASH> 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -379,6 +379,8 @@ func (c *linuxContainer) start(process *Process) error { } func (c *linuxContainer) Signal(s os.Signal, all bool) error { + c.m.Lock() + defer c.m.Unlock() if all { return signalAllProcesses(c.cgroupManager, s) }
Synchronize the call to linuxContainer.Signal() linuxContainer.Signal() can race with another call to say Destroy() which clears the container's initProcess. This can cause a nil pointer dereference in Signal(). This patch will synchronize Signal() and Destroy() by grabbing the container's mutex as part of the Signal() call.
opencontainers_runc
train
go
d60e9fa8c2e76815382865ac97ed0f2c593c0647
diff --git a/src/toil/cwl/cwltoil.py b/src/toil/cwl/cwltoil.py index <HASH>..<HASH> 100755 --- a/src/toil/cwl/cwltoil.py +++ b/src/toil/cwl/cwltoil.py @@ -117,7 +117,7 @@ def resolve_indirect(d): if isinstance(v, StepValueFrom): ev[k] = v.do_eval(res, res[k]) else: - ev[k] = v + ev[k] = res[k] return ev else: return res
CWL: fix typo in resolve_indirect `resolve_indirect` translates tuples (keyword, dictionary) into context specific dictionaries for CWL jobs. When a set of values had both values that needed evaluation and indirect tuples, the evaluation logic would get non-eval objects from the original dictionary (`d`) instead of the resolved one (`res`). This fixes the typo to pass along resolved references when not running `do_eval`.
DataBiosphere_toil
train
py
ba6d862653154bb2a3e728abb198a3c52b73572c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ builtin_plugins = [ 'AssertionRewritingImporter = contexts.plugins.importing.assertion_rewriting:AssertionRewritingImporter', 'DecoratorBasedIdentifier = contexts.plugins.identification.decorators:DecoratorBasedIdentifier', 'NameBasedIdentifier = contexts.plugins.identification:NameBasedIdentifier', - 'FileSpecIdentifier = contexts.plugins.identification:FileSpecIdentifier', + 'FileSpecIdentifier = contexts.plugins.identification.filespec:FileSpecIdentifier', 'TeamCityReporter = contexts.plugins.reporting.teamcity:TeamCityReporter', 'DotsReporter = contexts.plugins.reporting.cli:DotsReporter', 'VerboseReporter = contexts.plugins.reporting.cli:VerboseReporter',
Fixing plugin name in setup.py
benjamin-hodgson_Contexts
train
py
6f702aeacfd034475a8f4c571f8b4ca6c2ee8760
diff --git a/guides/_plugins/api_doc.rb b/guides/_plugins/api_doc.rb index <HASH>..<HASH> 100644 --- a/guides/_plugins/api_doc.rb +++ b/guides/_plugins/api_doc.rb @@ -23,9 +23,9 @@ module GraphQLSite def link_to_img(img_path, img_title) full_img_path = "#{@context.registers[:site].baseurl}#{img_path}" <<-HTML - <a href="#{full_img_path}" target="_blank" class="img-link"> - <img src="#{full_img_path}" title="#{img_title}" alt="#{img_title}" /> - </a> +<a href="#{full_img_path}" target="_blank" class="img-link"> + <img src="#{full_img_path}" title="#{img_title}" alt="#{img_title}" /> +</a> HTML end end @@ -75,7 +75,7 @@ module GraphQLSite def render(context) <<-HTML.chomp - <a href="#{context["site"]["baseurl"]}/#{@path}">#{@text}</a> +<a href="#{context["site"]["baseurl"]}/#{@path}">#{@text}</a> HTML end
Remove indentation from heredoc so markdown doesn't treat it like code
rmosolgo_graphql-ruby
train
rb
1d2c96ad5e90e41259595fd49bdd082ce812c393
diff --git a/pkg/kubelet/images/image_manager_test.go b/pkg/kubelet/images/image_manager_test.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/images/image_manager_test.go +++ b/pkg/kubelet/images/image_manager_test.go @@ -145,8 +145,9 @@ func TestParallelPuller(t *testing.T) { cases := pullerTestCases() + useSerializedEnv := false for i, c := range cases { - puller, fakeClock, fakeRuntime, container := pullerTestEnv(c, false) + puller, fakeClock, fakeRuntime, container := pullerTestEnv(c, useSerializedEnv) for tick, expected := range c.expected { fakeRuntime.CalledFunctions = nil @@ -170,8 +171,9 @@ func TestSerializedPuller(t *testing.T) { cases := pullerTestCases() + useSerializedEnv := true for i, c := range cases { - puller, fakeClock, fakeRuntime, container := pullerTestEnv(c, true) + puller, fakeClock, fakeRuntime, container := pullerTestEnv(c, useSerializedEnv) for tick, expected := range c.expected { fakeRuntime.CalledFunctions = nil
Improve readability for image manager tests Use named variables so boolean arguments are more readable.
kubernetes_kubernetes
train
go
63914560240cd72a48b881620c6890244d2a48db
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,14 @@ #!/usr/bin/env python from setuptools import setup -from smr.version import __version__ setup( name='smr', - version=__version__, + version='0.0.1', description='SMR (Simple Map Reduce) is a simple tool for writing map-reduce jobs in python', long_description='SMR (Simple Map Reduce) is a simple tool for writing map-reduce jobs in python', author='Ivan Dyedov', author_email='ivan@dyedov.com', - url='', + url='https://github.com/idyedov/smr', packages=['smr'], install_requires=['boto>=2.27.0', 'paramiko>=1.13.0', 'psutil>=2.0.0'], entry_points={
duplicate version in setup.py for now
50onRed_smr
train
py
4ae1688561b9af94d9f8649b447609239253fdd0
diff --git a/cherrypy/wsgiserver/__init__.py b/cherrypy/wsgiserver/__init__.py index <HASH>..<HASH> 100644 --- a/cherrypy/wsgiserver/__init__.py +++ b/cherrypy/wsgiserver/__init__.py @@ -1690,6 +1690,14 @@ class CherryPyWSGIServer(object): """Accept a new connection and put it on the Queue.""" try: s, addr = self.socket.accept() + if addr is None: # sometimes this can happen + # figure out if AF_INET or AF_INET6. + if len(s.getsockname()) == 2: + # AF_INET + addr = ('0.0.0.0', 0) + else: + # AF_INET6 + addr = ('::', 0) prevent_socket_inheritance(s) if not self.ready: return
fix for ticket #<I>, CherryPy crashes if socket.accept() does not return a remote address
cherrypy_cheroot
train
py
469a90e97a000f23f2ab0bf494cdc8e1480a3dfa
diff --git a/pkg/test/server.go b/pkg/test/server.go index <HASH>..<HASH> 100644 --- a/pkg/test/server.go +++ b/pkg/test/server.go @@ -92,9 +92,18 @@ func RunAccessLogServer(ctx context.Context, als *AccessLogService, port uint) { grpcServer.GracefulStop() } +const grpcMaxConcurrentStreams = 1000000 + // RunManagementServer starts an xDS server at the given port. func RunManagementServer(ctx context.Context, server xds.Server, port uint) { - grpcServer := grpc.NewServer() + // gRPC golang library sets a very small upper bound for the number gRPC/h2 + // streams over a single TCP connection. If a proxy multiplexes requests over + // a single connection to the management server, then it might lead to + // availability problems. + var grpcOptions []grpc.ServerOption + grpcOptions = append(grpcOptions, grpc.MaxConcurrentStreams(grpcMaxConcurrentStreams)) + grpcServer := grpc.NewServer(grpcOptions...) + lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) if err != nil { log.WithError(err).Fatal("failed to listen")
add note for max streams (#<I>)
envoyproxy_go-control-plane
train
go
ba21c25061e1f1262312a2cd44c336bf76972f76
diff --git a/tcod/bsp.py b/tcod/bsp.py index <HASH>..<HASH> 100644 --- a/tcod/bsp.py +++ b/tcod/bsp.py @@ -207,16 +207,16 @@ class BSP(object): .. versionadded:: 8.3 """ - levels = [[self]] # type: List[List['BSP']] + levels = [] # type: List[List['BSP']] next = [self] # type: List['BSP'] while next: + levels.append(next) level = next # type: List['BSP'] next = [] for node in level: next.extend(node.children) - levels.append(next) - for level in levels[::-1]: - yield from level + while levels: + yield from levels.pop() def contains(self, x: int, y: int) -> bool: """Returns True if this node contains these coordinates.
Slightly better inverted_level_order implementation.
libtcod_python-tcod
train
py
a78092583fa021f65421dfd5f7045262dc218453
diff --git a/aiohttp/multipart.py b/aiohttp/multipart.py index <HASH>..<HASH> 100644 --- a/aiohttp/multipart.py +++ b/aiohttp/multipart.py @@ -252,12 +252,8 @@ class BodyPartReader(object): if self._at_eof: return b'' data = bytearray() - if self._length is None: - while not self._at_eof: - data.extend((yield from self.readline())) - else: - while not self._at_eof: - data.extend((yield from self.read_chunk(self.chunk_size))) + while not self._at_eof: + data.extend((yield from self.read_chunk(self.chunk_size))) if decode: return self.decode(data) return data @@ -377,12 +373,8 @@ class BodyPartReader(object): """ if self._at_eof: return - if self._length is None: - while not self._at_eof: - yield from self.readline() - else: - while not self._at_eof: - yield from self.read_chunk(self.chunk_size) + while not self._at_eof: + yield from self.read_chunk(self.chunk_size) @asyncio.coroutine def text(self, *, encoding=None):
do not use readline when reading the content of a part in the multipart reader
aio-libs_aiohttp
train
py
a806cad9ce8560a17732fc13dd12b02ebdabedef
diff --git a/server/src/main/java/com/orientechnologies/orient/server/tx/OTransactionRecordProxy.java b/server/src/main/java/com/orientechnologies/orient/server/tx/OTransactionRecordProxy.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/com/orientechnologies/orient/server/tx/OTransactionRecordProxy.java +++ b/server/src/main/java/com/orientechnologies/orient/server/tx/OTransactionRecordProxy.java @@ -58,15 +58,15 @@ public class OTransactionRecordProxy implements ORecordInternal<byte[]> { return false; } - public void pin() { + public OTransactionRecordProxy pin() { throw new UnsupportedOperationException(); } - public void setDirty() { + public OTransactionRecordProxy setDirty() { throw new UnsupportedOperationException(); } - public void unpin() { + public OTransactionRecordProxy unpin() { throw new UnsupportedOperationException(); } @@ -135,4 +135,8 @@ public class OTransactionRecordProxy implements ORecordInternal<byte[]> { public String toJSON() { return null; } + + public ORecord<byte[]> fromJSON(String iJson) { + return null; + } }
Changed void method for call in chain
orientechnologies_orientdb
train
java
e27254906beee371ff046557bf4c1293f2011885
diff --git a/src/de/mrapp/android/validation/validators/DisjunctiveValidator.java b/src/de/mrapp/android/validation/validators/DisjunctiveValidator.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/validation/validators/DisjunctiveValidator.java +++ b/src/de/mrapp/android/validation/validators/DisjunctiveValidator.java @@ -133,6 +133,16 @@ public class DisjunctiveValidator<Type> extends AbstractValidator<Type> { return new DisjunctiveValidator<>(context, resourceId, validators); } + /** + * Returns the single validators, the validator consists of. + * + * @return The single validators, the validator consists of, as an array of + * the type {@link Validator} + */ + public final Validator<Type>[] getValidators() { + return validators; + } + @Override public final boolean validate(final Type value) { for (Validator<Type> validator : validators) {
Added a method, which allows to retrieve the single validators, the validator consists of.
michael-rapp_AndroidMaterialValidation
train
java
ff70d93c40b95a4fe90e19a55a198b1eed27b021
diff --git a/src/main/java/org/openhim/mediator/engine/connectors/HTTPConnector.java b/src/main/java/org/openhim/mediator/engine/connectors/HTTPConnector.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/openhim/mediator/engine/connectors/HTTPConnector.java +++ b/src/main/java/org/openhim/mediator/engine/connectors/HTTPConnector.java @@ -228,7 +228,6 @@ public class HTTPConnector extends UntypedActor { SSLConnectionSocketFactory sslsf; if (sslTrustAll) { - log.warning("SSL: Creating connection using 'trust all' option"); sslsf = new SSLConnectionSocketFactory(sslContext, SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } else { sslsf = new SSLConnectionSocketFactory(sslContext);
Remove verbose warning Very verbose with heartbeats
jembi_openhim-mediator-engine-java
train
java
a0551a751eadf79f076e6e7235f1403df5a94e33
diff --git a/compiler/statements.go b/compiler/statements.go index <HASH>..<HASH> 100644 --- a/compiler/statements.go +++ b/compiler/statements.go @@ -203,18 +203,24 @@ func (c *funcContext) translateStmt(stmt ast.Stmt, label string) { case *types.Chan: okVar := c.newIdent(c.newVariable("_ok"), types.Typ[types.Bool]) + key := s.Key + tok := s.Tok + if key == nil { + key = ast.NewIdent("_") + tok = token.ASSIGN + } forStmt := &ast.ForStmt{ Body: &ast.BlockStmt{ List: []ast.Stmt{ &ast.AssignStmt{ Lhs: []ast.Expr{ - s.Key, + key, okVar, }, Rhs: []ast.Expr{ c.setType(&ast.UnaryExpr{X: c.newIdent(refVar, t), Op: token.ARROW}, types.NewTuple(types.NewVar(0, nil, "", t.Elem()), types.NewVar(0, nil, "", types.Typ[types.Bool]))), }, - Tok: s.Tok, + Tok: tok, }, &ast.IfStmt{ Cond: &ast.UnaryExpr{X: okVar, Op: token.NOT},
go<I>: fixed "range c {" for channels
gopherjs_gopherjs
train
go
602485522b644b36ac091200032e55ad0bd5a94d
diff --git a/lib/dragonfly/app.rb b/lib/dragonfly/app.rb index <HASH>..<HASH> 100644 --- a/lib/dragonfly/app.rb +++ b/lib/dragonfly/app.rb @@ -32,6 +32,7 @@ module Dragonfly end @server = Server.new(self) @job_definitions = JobDefinitions.new + @content_filename = Dragonfly::Response::DEFAULT_FILENAME end attr_reader :name @@ -195,12 +196,7 @@ module Dragonfly end attr_writer :trust_file_extensions - attr_accessor :content_disposition - - def content_filename - @content_filename ||= Dragonfly::Response::DEFAULT_FILENAME - end - attr_writer :content_filename + attr_accessor :content_disposition, :content_filename private
seems a bit hacky still but restored content_filename behaviour
markevans_dragonfly
train
rb
bb4245ed56791b6af2eecc0a69ee468514525e67
diff --git a/Classes/Neos/Neos/Ui/Domain/Model/Changes/AbstractCreate.php b/Classes/Neos/Neos/Ui/Domain/Model/Changes/AbstractCreate.php index <HASH>..<HASH> 100644 --- a/Classes/Neos/Neos/Ui/Domain/Model/Changes/AbstractCreate.php +++ b/Classes/Neos/Neos/Ui/Domain/Model/Changes/AbstractCreate.php @@ -162,9 +162,9 @@ abstract class AbstractCreate extends AbstractStructuralChange $this->applyNodeCreationHandlers($node); - $this->addDocumentNodeCreatedFeedback($node); - $this->finish($node); + // NOTE: we need to run "finish" before "addDocumentNodeCreatedFeedback" to ensure the new node already exists when the last feedback is processed + $this->addDocumentNodeCreatedFeedback($node); return $node; }
BUGFIX: when creating new documents, directly show the newly created document without this change, the ContentCanvas stayed empty because the node was not yet loaded, and thus no URL could be determined.
neos_neos-ui
train
php
38583363f1070103852148101051915a7549a612
diff --git a/src/test/java/integration/ScreenshotTest.java b/src/test/java/integration/ScreenshotTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/integration/ScreenshotTest.java +++ b/src/test/java/integration/ScreenshotTest.java @@ -20,9 +20,7 @@ import static com.codeborne.selenide.WebDriverRunner.getWebDriver; import static com.codeborne.selenide.WebDriverRunner.isHtmlUnit; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.junit.Assume.assumeFalse; public class ScreenshotTest extends IntegrationTest {
Selenide mixes names of screenshots in case of parallel run #<I>
selenide_selenide
train
java
6f2e426201f223b0178d966c340a5127bf36ab3c
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py index <HASH>..<HASH> 100644 --- a/OpenSSL/crypto.py +++ b/OpenSSL/crypto.py @@ -947,7 +947,7 @@ class X509Req(object): def sign(self, pkey, digest): """ - Sign the certificate signing request using the supplied key and digest. + Sign the certificate signing request with this key and digest type. :param pkey: The key pair to sign with. :type pkey: :py:class:`PKey` @@ -1068,7 +1068,7 @@ class X509(object): def sign(self, pkey, digest): """ - Sign the certificate using the supplied key and digest type. + Sign the certificate with this key and digest type. :param pkey: The key to sign with. :type pkey: :py:class:`PKey`
Consistency between all three sign methods
pyca_pyopenssl
train
py
9259e78f31f4c5f8faed6691341c283c262ec84b
diff --git a/lib/fastr/deferrable.rb b/lib/fastr/deferrable.rb index <HASH>..<HASH> 100644 --- a/lib/fastr/deferrable.rb +++ b/lib/fastr/deferrable.rb @@ -23,6 +23,10 @@ module Fastr EM.defer(operation, callback) end + def closed(&cb) + self.errback(&cb) + end + def finish self.succeed end
Added closed callback for deferrable responses.
chrismoos_fastr
train
rb
4d7e7c101097df594a524f5da0a75aacc38695d7
diff --git a/example/bootstrap/start.php b/example/bootstrap/start.php index <HASH>..<HASH> 100644 --- a/example/bootstrap/start.php +++ b/example/bootstrap/start.php @@ -17,7 +17,15 @@ $app->setRouter (include ('router.php')); \Neuron\Config::folder (__DIR__ . '/../config/'); // Optionally, set an environment -\Neuron\Config::environment ('development'); +$hostname = trim (file_get_contents ('/etc/hostname')); + +switch ($hostname) +{ + case 'my-computer': + case 'thijs-home-i7': + \Neuron\Config::environment ('development'); + break; +} // Set the template folder \Neuron\Core\Template::addPath (__DIR__ . '/../templates/');
Using hostname for environment selection in example.
CatLabInteractive_Neuron
train
php
235b0b909cf928cdde1cbc320d751373322c8c0c
diff --git a/src/Service/ActivityMonitor.php b/src/Service/ActivityMonitor.php index <HASH>..<HASH> 100644 --- a/src/Service/ActivityMonitor.php +++ b/src/Service/ActivityMonitor.php @@ -330,7 +330,7 @@ class ActivityMonitor // If the activity failed, show the complete log. $stdErr->writeln(' Description: ' . $description); $stdErr->writeln(' Log:'); - $stdErr->writeln($this->indent($activity->log)); + $stdErr->writeln($this->indent($this->formatLog($activity->readLog()))); break; } }
Use log stream in waitMultiple() The activity 'log' property is deprecated.
platformsh_platformsh-cli
train
php
c0f5b38647c507f80bbaff5c26a2b43a19ed8e9a
diff --git a/pkg/controller/route/routecontroller.go b/pkg/controller/route/routecontroller.go index <HASH>..<HASH> 100644 --- a/pkg/controller/route/routecontroller.go +++ b/pkg/controller/route/routecontroller.go @@ -214,12 +214,13 @@ func (rc *RouteController) updateNetworkingCondition(nodeName types.NodeName, ro if err == nil { return nil } - if i == updateNodeStatusMaxRetries || !errors.IsConflict(err) { + if !errors.IsConflict(err) { glog.Errorf("Error updating node %s: %v", nodeName, err) return err } glog.Errorf("Error updating node %s, retrying: %v", nodeName, err) } + glog.Errorf("Error updating node %s: %v", nodeName, err) return err }
Fix Judgment statement The 'i' can not be equal to updateNodeStatusMaxRetries in updateNetworkingCondition(), and can not get error. Let's update it.
kubernetes_kubernetes
train
go
8100f17382a836f111d70bf6c5ba285f8989e755
diff --git a/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java b/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java index <HASH>..<HASH> 100644 --- a/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java +++ b/dropwizard-health/src/main/java/io/dropwizard/health/ScheduledHealthCheck.java @@ -111,9 +111,13 @@ class ScheduledHealthCheck implements Runnable { sb.append(", healthCheck=").append(healthCheck); sb.append(", schedule=").append(schedule); sb.append(", state=").append(state); - sb.append(", healthyCheckCounter=").append(healthyCheckCounter); - sb.append(", unhealthyCheckCounter=").append(unhealthyCheckCounter); + sb.append(", healthyCheckCounter=").append(getCounterString(healthyCheckCounter)); + sb.append(", unhealthyCheckCounter=").append(getCounterString(unhealthyCheckCounter)); sb.append('}'); return sb.toString(); } + + private String getCounterString(Counter counter) { + return Counter.class.equals(counter.getClass()) ? String.valueOf(counter.getCount()) : counter.toString(); + } }
Append value of counter instead of toString output
dropwizard_dropwizard
train
java
d8b94b529676cc8dac94d3de209a55c99ee39cf2
diff --git a/ca/django_ca/models.py b/ca/django_ca/models.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/models.py +++ b/ca/django_ca/models.py @@ -60,7 +60,7 @@ class Watcher(models.Model): @classmethod def from_addr(cls, addr): name = None - match = re.match('(.*?)\s*<(.*)>', addr) + match = re.match(r'(.*?)\s*<(.*)>', addr) if match is not None: name, addr = match.groups()
make this a regex literal to avoid deprecation warnings in Python <I>
mathiasertl_django-ca
train
py
4a06a8858ce6e4e6e38afc5ad93b1cd4d9e3c33b
diff --git a/packages/xod-js/src/transpiler.js b/packages/xod-js/src/transpiler.js index <HASH>..<HASH> 100644 --- a/packages/xod-js/src/transpiler.js +++ b/packages/xod-js/src/transpiler.js @@ -139,7 +139,12 @@ const createConstants = R.curry((project, nodes) => // :: Patch -> Patch const clearNodeBoundValues = R.over( R.lensProp('nodes'), - R.map(R.omit(['boundValues'])) + R.map( + R.over( + R.lensProp('boundValues'), + R.empty + ) + ) ); // :: Project -> Patch -> Patch diff --git a/packages/xod-js/test/transpiler.spec.js b/packages/xod-js/test/transpiler.spec.js index <HASH>..<HASH> 100644 --- a/packages/xod-js/test/transpiler.spec.js +++ b/packages/xod-js/test/transpiler.spec.js @@ -64,7 +64,6 @@ describe('Transpiler', () => { boundValues: { in_A: { value: 10, - curried: true, }, }, }, @@ -356,7 +355,6 @@ describe('Transpiler', () => { boundValues: { in_A: { value: 10, - curried: true, }, }, },
tweak(xod-js): ensure that nodes have correct boundValues
xodio_xod
train
js,js
2b17988cb782429faf95d474142008006a373db9
diff --git a/lib/Cake/TestSuite/CakeTestLoader.php b/lib/Cake/TestSuite/CakeTestLoader.php index <HASH>..<HASH> 100644 --- a/lib/Cake/TestSuite/CakeTestLoader.php +++ b/lib/Cake/TestSuite/CakeTestLoader.php @@ -55,7 +55,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader { } elseif (!empty($params['app'])) { $result = APP_TEST_CASES; } else if (!empty($params['plugin']) && CakePlugin::loaded($params['plugin'])) { - $pluginPath = CakePLugin::path($params['plugin']); + $pluginPath = CakePlugin::path($params['plugin']); $result = $pluginPath . 'Test' . DS . 'Case'; } return $result;
Fixed small typo in CakeTestLoader.php.
cakephp_cakephp
train
php
4e3a8cc4dd57ea01b6718caf10f2d93b1e820ce9
diff --git a/eZ/Bundle/EzPublishCoreBundle/Tests/ConfigResolverTest.php b/eZ/Bundle/EzPublishCoreBundle/Tests/ConfigResolverTest.php index <HASH>..<HASH> 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Tests/ConfigResolverTest.php +++ b/eZ/Bundle/EzPublishCoreBundle/Tests/ConfigResolverTest.php @@ -36,10 +36,11 @@ class ConfigResolverTest extends \PHPUnit_Framework_TestCase * @param int $undefinedStrategy * @return \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver */ - private function getResolver( $defaultNS = 'ezsettings', $undefinedStrategy = ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION ) + private function getResolver( $defaultNS = 'ezsettings', $undefinedStrategy = ConfigResolver::UNDEFINED_STRATEGY_EXCEPTION, array $groupsBySiteAccess = array() ) { return new ConfigResolver( $this->siteAccess, + $groupsBySiteAccess, $this->containerMock, $defaultNS, $undefinedStrategy
Fixed: wrong initialization of the ConfigResolver in unit tests
ezsystems_ezpublish-kernel
train
php
7d8bbae5c427001645304d6ca4afe7e0eddc2f2a
diff --git a/angular-multi-select.js b/angular-multi-select.js index <HASH>..<HASH> 100644 --- a/angular-multi-select.js +++ b/angular-multi-select.js @@ -444,7 +444,7 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', '$ if ( e.type === 'click' || e.type === 'touchend' && $scope.scrolled === false ) { var checkboxes = document.querySelectorAll( '.checkboxLayer' ); - if ( e.target.className.indexOf === undefined || e.target.className.indexOf( 'multiSelect' ) { + if ( e.target.className.indexOf === undefined || e.target.className.indexOf( 'multiSelect' )) { for( i=0; i < checkboxes.length; i++ ) { checkboxes[i].className = 'multiSelect checkboxLayer hide'; }
Fixed a bug with if statement Added an if statement closing brace
alexandernst_angular-multi-select
train
js
f7c65002bcf5855bb1d9cfc03104d140016b87ef
diff --git a/src/java/voldemort/store/logging/LoggingStore.java b/src/java/voldemort/store/logging/LoggingStore.java index <HASH>..<HASH> 100644 --- a/src/java/voldemort/store/logging/LoggingStore.java +++ b/src/java/voldemort/store/logging/LoggingStore.java @@ -128,9 +128,9 @@ public class LoggingStore<K, V, T> extends DelegatingStore<K, V, T> { private void printTimedMessage(String operation, boolean success, long startNs) { if(logger.isDebugEnabled()) { double elapsedMs = (time.getNanoseconds() - startNs) / (double) Time.NS_PER_MS; - logger.debug(instanceName + operation + " operation on store '" + getName() - + "' completed " + (success ? "successfully" : "unsuccessfully") + " in " - + elapsedMs + " ms."); + logger.debug(instanceName + operation + " " + getName() + + " " + (success ? "successful" : "unsuccessful") + " in " + + elapsedMs + " ms"); } }
Reduce verbosity for access logs in LoggingStore
voldemort_voldemort
train
java
ecca3b1da95f0e621b04ec461e2f8c3f4405289f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ If you get errors, check the following things: """ setup(name='CleanerVersion', - version='1.2.2', + version='1.2.3', description='A versioning solution for relational data models', long_description='CleanerVersion is a solution that allows you to read and write multiple versions of an entry ' 'to and from your relational database. It allows to keep track of modifications on an object '
Bump minor version number to <I>
swisscom_cleanerversion
train
py
1f4c8ffbc2815a58bda5c7e7a91012b17073978b
diff --git a/test/extended/cmd/cmd.go b/test/extended/cmd/cmd.go index <HASH>..<HASH> 100644 --- a/test/extended/cmd/cmd.go +++ b/test/extended/cmd/cmd.go @@ -111,7 +111,7 @@ var _ = g.Describe("[Suite:openshift/test-cmd][Serial][Disruptive] test-cmd:", f {Name: "TEST_NAME", Value: currFilename[0 : len(currFilename)-3]}, {Name: "TEST_DATA", Value: "/var/tests/test/cmd/testdata"}, }, - 2*time.Minute, // FIXME: code still WIP, let's just see that it works + 5*time.Minute, ) e2e.Logf("Logs from the container: %s", log) o.Expect(errs).To(o.HaveLen(0))
run the e2e-cmd pods longer
openshift_origin
train
go
41b49cb6fbdba7bf82f2c8b16c302819022d3b6e
diff --git a/lib/devise_security_extension/models/password_archivable.rb b/lib/devise_security_extension/models/password_archivable.rb index <HASH>..<HASH> 100644 --- a/lib/devise_security_extension/models/password_archivable.rb +++ b/lib/devise_security_extension/models/password_archivable.rb @@ -49,10 +49,10 @@ module Devise # :nodoc: def archive_password if self.encrypted_password_changed? if self.class.password_archiving_count.to_i > 0 - if self.password_salt_change.nil? - self.old_passwords.create! :encrypted_password => self.encrypted_password_change.first - else + if self.respond_to?(:password_salt_change) and not self.password_salt_change.nil? self.old_passwords.create! :encrypted_password => self.encrypted_password_change.first, :password_salt => self.password_salt_change.first + else + self.old_passwords.create! :encrypted_password => self.encrypted_password_change.first end self.old_passwords.order('created_at DESC').offset(self.class.password_archiving_count).destroy_all else
Fixed crash when there is no password_salts column.
phatworx_devise_security_extension
train
rb
b5b610035ce846b067e39a1b5bcecd034ef8fe66
diff --git a/tests/test_base.py b/tests/test_base.py index <HASH>..<HASH> 100755 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -102,8 +102,8 @@ class TestNodemeta(object): c = Consul() for r in _should_support_node_meta(c): assert r().params == [] - assert r(node_meta={'env': 'prod', 'net': 1}).params == \ - [('node-meta', 'net:1'), ('node-meta', 'env:prod')] + assert sorted(r(node_meta={'env': 'prod', 'net': 1}).params) == \ + sorted([('node-meta', 'net:1'), ('node-meta', 'env:prod')]) class TestCB(object):
Ensure order doesn't affect node_meta unittest
cablehead_python-consul
train
py
fc47e79d035278db52d065c3d15bc4ba8f225680
diff --git a/lib/overcommit/hook_runner.rb b/lib/overcommit/hook_runner.rb index <HASH>..<HASH> 100644 --- a/lib/overcommit/hook_runner.rb +++ b/lib/overcommit/hook_runner.rb @@ -89,7 +89,7 @@ module Overcommit end rescue => ex status = :fail - output = "Hook raised unexpected error\n#{ex.message}" + output = "Hook raised unexpected error\n#{ex.message}\n#{ex.backtrace.join("\n")}" rescue Interrupt # At this point, interrupt has been handled and protection is back in # effect thanks to the InterruptHandler.
Include backtrace in exceptions raised by hooks This makes it easier to debug the underlying problem, which is usually what you want to do. Change-Id: Ic<I>c<I>f<I>f6be4eca<I>dbf<I>d<I>d<I>d3d4db Reviewed-on: <URL>
sds_overcommit
train
rb
c3f4548a2aa2699a753c9c8e553718154d3411d7
diff --git a/ArgusWeb/app/js/directives/charts/lineChart.js b/ArgusWeb/app/js/directives/charts/lineChart.js index <HASH>..<HASH> 100644 --- a/ArgusWeb/app/js/directives/charts/lineChart.js +++ b/ArgusWeb/app/js/directives/charts/lineChart.js @@ -76,8 +76,18 @@ angular.module('argus.directives.charts.lineChart', []) var endTime = scope.dateConfig.endTime; var GMTon = scope.dateConfig.gmt; var chartOptions = scope.chartConfig; - var agYMin = chartOptions.yAxis.min || chartOptions.yaxis.min; - var agYMax = chartOptions.yAxis.max || chartOptions.yaxis.max; + + var agYMin = undefined, agYMax = undefined; + //provide support for yaxis lower case situation. + if(chartOptions.yAxis){ + agYMin = chartOptions.yAxis.min; + agYMax = chartOptions.yAxis.max; + } + if(chartOptions.yaxis){ + agYMin = agYMin || chartOptions.yaxis.min; + agYMax = agYMax || chartOptions.yaxis.max; + } + if (isNaN(agYMin)) agYMin = undefined; if (isNaN(agYMax)) agYMax = undefined;
Fix an undefined yaxis/yAxis issue and cover all combinitions of yaxis/yAxis.min/max
salesforce_Argus
train
js
d568b3a647f0f53d0a609f1352131fb9e329170e
diff --git a/app/models/group.rb b/app/models/group.rb index <HASH>..<HASH> 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -47,11 +47,6 @@ class Group < ActiveRecord::Base name end - def name_with_path - return name if ancestors.empty? - "#{name} [#{ancestors.join ' > '}]" - end - def deletable? leaf_node? && memberships.reject(&:new_record?).empty? end
Remove unused method name_with_path is now implemented in GroupLister::ListedGroup, as it's only used when listing groups in the selector.
ministryofjustice_peoplefinder
train
rb
86b835b559791c7d080d17b2762d96143e195021
diff --git a/hanlp/common/component.py b/hanlp/common/component.py index <HASH>..<HASH> 100644 --- a/hanlp/common/component.py +++ b/hanlp/common/component.py @@ -513,6 +513,8 @@ class KerasComponent(Component, ABC): export_dir = self.export_model_for_serving(export_dir, show_hint=False, overwrite=overwrite) if not dry_run: del self.model # free memory + logger.info('The inputs of exported model is shown below.') + os.system(f'saved_model_cli show --all --dir {export_dir}/1') cmd = f'nohup tensorflow_model_server --model_name={os.path.splitext(os.path.basename(self.meta["load_path"]))[0]} ' \ f'--model_base_path={export_dir} --port={grpc_port} --rest_api_port={rest_api_port} ' \ f'>serve.log 2>&1 &'
hints for inputs of exported model
hankcs_HanLP
train
py
64300d765d95abbb5c28e62de3892abcf9ec006d
diff --git a/lib/restforce/concerns/api.rb b/lib/restforce/concerns/api.rb index <HASH>..<HASH> 100644 --- a/lib/restforce/concerns/api.rb +++ b/lib/restforce/concerns/api.rb @@ -395,7 +395,11 @@ module Restforce # # Returns the Restforce::SObject sobject record. def find(sobject, id, field = nil) - url = field ? "sobjects/#{sobject}/#{field}/#{URI.encode(id)}" : "sobjects/#{sobject}/#{id}" + if field + url = "sobjects/#{sobject}/#{field}/#{URI.encode(id)}" + else + url = "sobjects/#{sobject}/#{id}" + end api_get(url).body end @@ -409,7 +413,11 @@ module Restforce # field - External ID field to use (default: nil). # def select(sobject, id, select, field = nil) - path = field ? "sobjects/#{sobject}/#{field}/#{URI.encode(id)}" : "sobjects/#{sobject}/#{id}" + if field + path = "sobjects/#{sobject}/#{field}/#{URI.encode(id)}" + else + path = "sobjects/#{sobject}/#{id}" + end path << "?fields=#{select.join(',')}" if select && select.any? api_get(path).body
some workarounds for robocop.
restforce_restforce
train
rb
f2968eaba6c45a2cc81a29034b0b88bc7a2a4f7a
diff --git a/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ButtonRenderer.php b/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ButtonRenderer.php index <HASH>..<HASH> 100644 --- a/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ButtonRenderer.php +++ b/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ButtonRenderer.php @@ -364,6 +364,7 @@ class ButtonRenderer if ($command instanceof ToggleCommandInterface) { // Toggle has to trigger the javascript. $parameters['act'] = $command->getName(); + $parameters['id'] = $serializedModelId; return $parameters; }
Add id to toggler urls again They were accidentally removed when splitting out the ButtonRenderer
contao-community-alliance_dc-general
train
php
911cad381009a7a7dbe2723af37ddc5f96c2408b
diff --git a/lib/chef/provider/lwrp_base.rb b/lib/chef/provider/lwrp_base.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/lwrp_base.rb +++ b/lib/chef/provider/lwrp_base.rb @@ -84,7 +84,6 @@ class Chef provider_class = nil provider_name = filename_to_qualified_string(cookbook_name, filename) - # Add log entry if we override an existing light-weight provider. class_name = convert_to_class_name(provider_name) if Chef::Provider.const_defined?(class_name) diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/lwrp_base.rb +++ b/lib/chef/resource/lwrp_base.rb @@ -38,7 +38,6 @@ class Chef resource_class = nil rname = filename_to_qualified_string(cookbook_name, filename) - # Add log entry if we override an existing lightweight resource. class_name = convert_to_class_name(rname) if Resource.strict_const_defined?(class_name) Chef::Log.info("#{class_name} light-weight resource is already initialized -- Skipping loading #{filename}!")
Updates based on PR comments.
chef_chef
train
rb,rb