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
0eee7277c2f36eaa59c8ae1a369c552c21722984
diff --git a/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py b/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py index <HASH>..<HASH> 100755 --- a/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py +++ b/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py @@ -95,8 +95,7 @@ class PublishMeshCopService(thread_cert.TestCase): self.simulator.go(5) self.check_meshcop_service(br, host) - def check_meshcop_service(self, br, host): - instance_name = r'OpenThread' + def check_meshcop_service(self, br, host, instance_name='OpenThread_BorderRouter'): data = host.discover_mdns_service(instance_name, '_meshcop._udp', None) sb_data = data['txt']['sb'].encode('raw_unicode_escape') state_bitmap = int.from_bytes(sb_data, byteorder='big')
[tests] update meshcop service instance name in test case (#<I>) This commit aims to update the meshcop service instance name in test_publish_meshcop_service.py to make it consistent with the change on ot-br-posix side.
openthread_openthread
train
py
23d01b017800e1c7d49c85a5097753bc4670bb2d
diff --git a/src/cartodb.js b/src/cartodb.js index <HASH>..<HASH> 100644 --- a/src/cartodb.js +++ b/src/cartodb.js @@ -11,9 +11,6 @@ /** * global variables */ - window.cdb.god = new Backbone.Model(); - - window.JST = window.JST || {}; cdb.files = [ @@ -41,6 +38,9 @@ cdb.init = function(ready) { cdb._loadJST(); + + window.cdb.god = new Backbone.Model(); + ready && ready(); }
Loads god after Backbone
CartoDB_carto.js
train
js
d61d9f0208235ef2fec9a03f4b9b46d10bf7cbee
diff --git a/test/commands/break_test.rb b/test/commands/break_test.rb index <HASH>..<HASH> 100644 --- a/test/commands/break_test.rb +++ b/test/commands/break_test.rb @@ -169,6 +169,20 @@ module Byebug check_error_includes 'No file named asf' end + def test_setting_breakpoint_with_bad_relative_path_doesnt_crash + enter 'break ../relative/path.rb:8' + debug_code(program) + + check_error_includes 'No file named ../relative/path.rb' + end + + def test_setting_breakpoint_with_relative_path_adds_the_breakpoint + enter 'break ./test/commands/break_test.rb:8' + debug_code(program) + + check_output_includes(/Successfully created breakpoint with id/) + end + def test_setting_breakpoint_to_invalid_line_does_not_create_breakpoint enter 'break 14'
Add a couple of tests for relative paths
deivid-rodriguez_byebug
train
rb
96bd2fd62acca2131e7273549c665e4fb010b825
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -171,7 +171,7 @@ DailymotionAPI.prototype.api = function(verb, endpoint, data, callback) { } var opts = { - url: DM_API_ROOT + endpoint, + uri: DM_API_ROOT + endpoint, method: verb.toUpperCase(), // always UPPERCASEPLS auth: { // DM auth bearer: this.credentials.access_token @@ -182,7 +182,7 @@ DailymotionAPI.prototype.api = function(verb, endpoint, data, callback) { switch (opts.method) { case 'GET': // append query string - opts.url += url.format({ query: data }); + opts.uri += url.format({ query: data }); break; case 'POST': // use form param opts.form = data; @@ -238,8 +238,8 @@ DailymotionAPI.prototype.upload = function(options) { // Progress Handle - check progress every 3 seconds progresshwnd = setInterval(function() { request({ - url: progressURL, method: 'GET', + uri: progressURL, auth: { bearer: this.credentials.access_token }, @@ -253,8 +253,8 @@ DailymotionAPI.prototype.upload = function(options) { // Proceed to upload request({ - url: uploadURL, method: 'POST', + uri: uploadURL, auth: { bearer: this.credentials.access_token },
Moved request params to uri instead of url
OtaK_dailymotion-sdk-node
train
js
44108531c3136fca130921cb0abb283c6636ecbd
diff --git a/meshio/msh_io/msh4.py b/meshio/msh_io/msh4.py index <HASH>..<HASH> 100644 --- a/meshio/msh_io/msh4.py +++ b/meshio/msh_io/msh4.py @@ -105,11 +105,15 @@ def _read_entities(f, is_ascii, int_size, data_size): num_physicals, = fromfile(f, c_ulong, 1) physical_tags[d][tag] = list(fromfile(f, c_int, num_physicals)) if d > 0: # discard tagBREP{Vert,Curve,Surfaces} - num_BREP_vert, = fromfile(f, c_ulong, 1) - fromfile(f, c_int, num_BREP_vert) + num_BREP_, = fromfile(f, c_ulong, 1) + fromfile(f, c_int, num_BREP_) + if not is_ascii: + line = f.readline().decode("utf-8").strip() + assert line == "" line = f.readline().decode("utf-8").strip() assert line == "$EndEntities" + print('Physical tags:', physical_tags) return physical_tags
take care reading line-breaks in binary MSH4 entities #<I>
nschloe_meshio
train
py
ecaed18260aa1c74dc507bac2481c6d03e4b7706
diff --git a/lib/chef/knife/backup_restore.rb b/lib/chef/knife/backup_restore.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/backup_restore.rb +++ b/lib/chef/knife/backup_restore.rb @@ -47,7 +47,7 @@ module ServerBackup ui.warn "Backup is at least 1 day old" if (Time.now - File.atime(config[:backup_dir])) > 86400 ui.confirm "Do you want to restore backup, possibly overwriting exisitng data" validate! - components = name_args.empty? ? COMPONENTS.keys : name_args + components = name_args.empty? ? COMPONENTS : name_args Array(components).each { |component| self.send(component) } end
fix COMPONENT keys for restore also
mdxp_knife-backup
train
rb
5545c9ccb6571a14d2355f8842ac5c2421183489
diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java index <HASH>..<HASH> 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java +++ b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java @@ -396,7 +396,7 @@ public final class Tools { /** * Try to get the primary {@link java.net.InetAddress} of the primary network interface with - * fallback to the local loopback address (usually {@code 127.0.0.1} or {@link ::1}. + * fallback to the local loopback address (usually {@code 127.0.0.1} or {@code ::1}. * * @return The primary {@link java.net.InetAddress} of the primary network interface * or the loopback address as fallback.
Fix broken Javadoc for Tools#guessPrimaryNetworkAddress()
Graylog2_graylog2-server
train
java
0e81865be6c6000bf5e20ca280d956c1e7fac744
diff --git a/packages/dai/src/eth/TransactionObject.js b/packages/dai/src/eth/TransactionObject.js index <HASH>..<HASH> 100644 --- a/packages/dai/src/eth/TransactionObject.js +++ b/packages/dai/src/eth/TransactionObject.js @@ -130,8 +130,8 @@ export default class TransactionObject extends TransactionLifeCycle { let tx; const startTime = new Date(); log(`waiting for transaction ${this.hash.substring(8)}... to mine`); - for (let i = 0; i < 24; i++) { - // 2 minutes max + for (let i = 0; i < 120; i++) { + // 10 minutes max tx = await this._web3Service.getTransaction(this.hash); if ((tx || {}).blockHash) break; log('not mined yet');
CDP-<I> Increase tx max tracking duration to <I> mins
makerdao_dai.js
train
js
425f11c7a538f57545305564f8bdc66789d2ea59
diff --git a/roaring.go b/roaring.go index <HASH>..<HASH> 100644 --- a/roaring.go +++ b/roaring.go @@ -198,7 +198,7 @@ func (rb *Bitmap) String() string { buffer.WriteString("...") break } - buffer.WriteString(strconv.Itoa(int(i.Next()))) + buffer.WriteString(strconv.FormatInt(int64(i.Next()), 10)) if i.HasNext() { // todo: optimize buffer.WriteString(",") } diff --git a/roaring_test.go b/roaring_test.go index <HASH>..<HASH> 100644 --- a/roaring_test.go +++ b/roaring_test.go @@ -8,6 +8,15 @@ import ( "strconv" "testing" ) +func TestStringer(t *testing.T) { + v := NewBitmap() + for i := uint32(0); i < 10; i++ { + v.Add(i) + } + if v.String() != "{0,1,2,3,4,5,6,7,8,9}" { + t.Error("bad string output") + } +} func TestFastCard(t *testing.T) { Convey("fast card", t, func() {
Testing stringer, and avoiding negative values for large integers.
RoaringBitmap_roaring
train
go,go
837cfc563e9e07075868111acbc2f63dab2bb1f6
diff --git a/bors/app/config.py b/bors/app/config.py index <HASH>..<HASH> 100644 --- a/bors/app/config.py +++ b/bors/app/config.py @@ -25,10 +25,6 @@ class AppConf: services_by_name = {} # type: dict def __init__(self, config=None): - # Bail if we've been loaded before - if self.conf is not None: - return - data = DEFAULT_CONFIG.copy() dict_merge(data, config) self.conf = ConfSchema().load(data).data
Removed conf singleton logic
RobotStudio_bors
train
py
71c50bd9e67df11fe8254fb127454f84373e15e2
diff --git a/resource/resourceadapters/apiserver.go b/resource/resourceadapters/apiserver.go index <HASH>..<HASH> 100644 --- a/resource/resourceadapters/apiserver.go +++ b/resource/resourceadapters/apiserver.go @@ -96,8 +96,12 @@ func (ex *httpDownloadRequestExtractor) NewResourceOpener(req *http.Request) (re return nil, errors.Trace(err) } + // TODO(ericsnow) We will need to get the macaroon from state. + var csMac *macaroon.Macaroon + opener := &resourceOpener{ st: resources, + csMac: csMac, userID: unit.Tag(), unit: unit, } diff --git a/resource/resourceadapters/opener.go b/resource/resourceadapters/opener.go index <HASH>..<HASH> 100644 --- a/resource/resourceadapters/opener.go +++ b/resource/resourceadapters/opener.go @@ -28,7 +28,6 @@ func (ro *resourceOpener) OpenResource(name string) (resource.Opened, error) { } cURL, _ := ro.unit.CharmURL() - // TODO(ericsnow) We will need an actual macaroon here. csOpener := newCharmstoreOpener(cURL, ro.csMac) client, err := csOpener.NewClient() if err != nil {
Move a TODO to the correct spot.
juju_juju
train
go,go
f931290e58b2e62b56eca55b1ef45c794886e6cb
diff --git a/activejob/lib/active_job/exceptions.rb b/activejob/lib/active_job/exceptions.rb index <HASH>..<HASH> 100644 --- a/activejob/lib/active_job/exceptions.rb +++ b/activejob/lib/active_job/exceptions.rb @@ -28,8 +28,12 @@ module ActiveJob # end def retry_on(exception, wait: 3.seconds, attempts: 5, queue: nil, priority: nil) rescue_from exception do |error| - logger.error "Retrying #{self.class} in #{wait} seconds, due to a #{exception}. The original exception was #{error.cause.inspect}." - retry_job wait: wait, queue: queue, priority: priority if executions < attempts + if executions < attempts + logger.error "Retrying #{self.class} in #{wait} seconds, due to a #{exception}. The original exception was #{error.cause.inspect}." + retry_job wait: wait, queue: queue, priority: priority + else + logger.error "Discarded #{self.class} due to a #{exception} which reoccurred on #{executions} attempts. The original exception was #{error.cause.inspect}." + end end end
Proper logging when we bail on retrying after X attempts
rails_rails
train
rb
7339c83472c8443d1c6f018947e164ca82a63be7
diff --git a/src/CfdiUtils/CadenaOrigen/SaxonbCliBuilder.php b/src/CfdiUtils/CadenaOrigen/SaxonbCliBuilder.php index <HASH>..<HASH> 100644 --- a/src/CfdiUtils/CadenaOrigen/SaxonbCliBuilder.php +++ b/src/CfdiUtils/CadenaOrigen/SaxonbCliBuilder.php @@ -62,7 +62,7 @@ class SaxonbCliBuilder extends AbstractXsltBuilder if (0 !== $execution->exitStatus()) { throw new XsltBuildException('Transformation error'); } - if ('<?xml version="1.0" encoding="UTF-8"?>' === trim($execution->lastLine())) { + if ('<?xml version="1.0" encoding="UTF-8"?>' === trim($execution->output())) { throw new XsltBuildException('Transformation error'); } return trim($execution->output());
Fix SanxonbCliBuilder to take last line of execution correctly
eclipxe13_CfdiUtils
train
php
684f7561f18d58685e2a8b66fc349b9b2e1a9583
diff --git a/packages/jsio.js b/packages/jsio.js index <HASH>..<HASH> 100644 --- a/packages/jsio.js +++ b/packages/jsio.js @@ -291,7 +291,10 @@ }; ctx.jsio = bind(this, importer, ctx, pkgPath); - if(pkgPath != 'base') { ctx.jsio('from base import *'); } + if(pkgPath != 'base') { + ctx.jsio('from base import *'); + ctx.logging.__create(pkgPath, ctx); + } // TODO: FIX for "trailing ." case var cwd = ENV.getCwd(); @@ -301,7 +304,6 @@ ctx.jsio.__dir = i > 0 ? makeRelativePath(filePath.substring(0, i), cwd) : ''; ctx.jsio.__filename = i > 0 ? filePath.substring(i) : filePath; ctx.jsio.__path = pkgPath; - return ctx; }; @@ -333,7 +335,7 @@ } if(!item.external) { - var newContext = makeContext(item.from, module.filePath); + var newContext = makeContext(pkg, module.filePath); execModule(newContext, module); modules[pkg] = newContext.exports; } else {
create a logger for each context
gameclosure_js.io
train
js
83790c227c140dd50e5aa4ecf2502fc01dfb198a
diff --git a/lib/roar/rails/rails3_0_strategy.rb b/lib/roar/rails/rails3_0_strategy.rb index <HASH>..<HASH> 100644 --- a/lib/roar/rails/rails3_0_strategy.rb +++ b/lib/roar/rails/rails3_0_strategy.rb @@ -1,7 +1,7 @@ module Roar::Rails module Responder module VersionStrategy - def prepare_model!(model) + def prepare_model_for(format, model, *args) # rails <= 3.1 compatibility. #display gets called for empty responses # >= 3.2 fixes by calling #head, not #display for all empty bodies (PUT, DELETE) return model if respond_to?("empty_#{format}_resource") && model == empty_resource diff --git a/lib/roar/rails/responder.rb b/lib/roar/rails/responder.rb index <HASH>..<HASH> 100644 --- a/lib/roar/rails/responder.rb +++ b/lib/roar/rails/responder.rb @@ -6,7 +6,7 @@ module Roar::Rails return super end - model = controller.prepare_model_for(format, model, options) + model = prepare_model_for(format, model, options) super end @@ -18,6 +18,12 @@ module Roar::Rails end end + module PrepareModel + def prepare_model_for(format, model, options) # overwritten in VersionStrategy/3.0. + controller.prepare_model_for(format, model, options) + end + end + include PrepareModel include VersionStrategy end end
make empty body PUTs etc work in rails <I>, again.
apotonick_roar-rails
train
rb,rb
7536e57bdbe65fad24c2a6ae40258d1ef4681509
diff --git a/benchbuild/utils/actions.py b/benchbuild/utils/actions.py index <HASH>..<HASH> 100644 --- a/benchbuild/utils/actions.py +++ b/benchbuild/utils/actions.py @@ -213,7 +213,6 @@ class StepClass(type): original_call = attrs['__call__'] attrs['__call__'] = to_step_result(original_call) - original_str = attrs['__str__'] attrs['__str__'] = prepend_status(original_str) return super(StepClass, mcs).__new__(mcs, name, bases, attrs)
utils/actions: remove second original_str definition
PolyJIT_benchbuild
train
py
c9b2066053de2a80391e2dff66f20150df36b069
diff --git a/apps/pattern-lab/.boltrc.js b/apps/pattern-lab/.boltrc.js index <HASH>..<HASH> 100644 --- a/apps/pattern-lab/.boltrc.js +++ b/apps/pattern-lab/.boltrc.js @@ -8,6 +8,7 @@ module.exports = { startPath: 'pattern-lab/index.html', plConfigFile: './config/config.yml', verbosity: 1, + schemaErrorReporting: 'cli', webpackDevServer: true, extraTwigNamespaces: { 'bolt': {
feat: Set schema error reporting to cli for pattern lab (BDS-<I>)
bolt-design-system_bolt
train
js
60ea36824276aedb20bcbcacea41d6e337fe91b3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='lime', - version='0.1.1.14', + version='0.1.1.15', description='Local Interpretable Model-Agnostic Explanations for machine learning classifiers', url='http://github.com/marcotcr/lime', author='Marco Tulio Ribeiro',
Changed version to <I>
marcotcr_lime
train
py
e3ae81a59a59c9d0ad0f20a8cb4ed1b04a85ff3a
diff --git a/exchangelib/protocol.py b/exchangelib/protocol.py index <HASH>..<HASH> 100644 --- a/exchangelib/protocol.py +++ b/exchangelib/protocol.py @@ -41,7 +41,7 @@ class BaseProtocol: SESSION_POOLSIZE = 1 # We want only 1 TCP connection per Session object. We may have lots of different credentials hitting the server and # each credential needs its own session (NTLM auth will only send credentials once and then secure the connection, - # so a connection can only handle requests for one credential). Having multiple connections ser Session could + # so a connection can only handle requests for one credential). Having multiple connections per Session could # quickly exhaust the maximum number of concurrent connections the Exchange server allows from one client. CONNECTIONS_PER_SESSION = 1 # The number of times a session may be reused before creating a new session object. 'None' means "infinite".
[FIX]typo on method doc (#<I>)
ecederstrand_exchangelib
train
py
fef33671c41843370ccffddba91d30e0ade9e160
diff --git a/pmxbot/commands.py b/pmxbot/commands.py index <HASH>..<HASH> 100644 --- a/pmxbot/commands.py +++ b/pmxbot/commands.py @@ -5,6 +5,7 @@ import string import csv import urllib.parse import datetime +import functools from typing import Dict, cast import dateutil.parser @@ -425,7 +426,20 @@ def password(rest): return ''.join(passwd) -def get_insult(session=requests.Session()): [email protected]_cache() +def _get_session(): + retry_strategy = requests.packages.urllib3.util.retry.Retry( + total=3, + ) + adapter = requests.adapters.HTTPAdapter(max_retries=retry_strategy) + session = requests.Session() + session.mount("https://", adapter) + session.mount("http://", adapter) + + return session + + +def get_insult(): """ Load a random insult from autoinsult. """ @@ -433,7 +447,7 @@ def get_insult(session=requests.Session()): ins_type = random.randrange(4) url = f'http://autoinsult.com/?style={ins_type}' insre = re.compile('<div class="insult" id="insult">(.*?)</div>') - resp = session.get(url) + resp = _get_session().get(url) resp.raise_for_status() return insre.search(resp.text).group(1), ins_type
Implement requests-based retries for autoinsult session.
yougov_pmxbot
train
py
8da703fb4339085fd742309e90c9afc232b060b1
diff --git a/gandi/cli/modules/cert.py b/gandi/cli/modules/cert.py index <HASH>..<HASH> 100644 --- a/gandi/cli/modules/cert.py +++ b/gandi/cli/modules/cert.py @@ -47,7 +47,12 @@ class Certificate(GandiModule): def package_list(cls, options=None): """ list possible certificate packages """ options = options or {} - return cls.safe_call('cert.package.list', options) + try: + return cls.safe_call('cert.package.list', options) + except UsageError as err: + if err.code == 150020: + return [] + raise @classmethod def list(cls, options=None):
Handle Ote case where no cert api is exported.
Gandi_gandi.cli
train
py
18d30ae04448dde1f950359433a2886736a7c915
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -1,6 +1,7 @@ package piper import ( + "crypto/tls" "encoding/json" "fmt" "io" @@ -12,7 +13,7 @@ import ( "github.com/gorilla/websocket" ) -func NewClientPipe(host string, opts Opts, logger *log.Logger) (*Pipe, error) { +func NewClientPipe(host string, opts Opts, tlsConfig *tls.Config, logger *log.Logger) (*Pipe, error) { encoded, err := json.Marshal(opts) if err != nil { return nil, err @@ -20,7 +21,10 @@ func NewClientPipe(host string, opts Opts, logger *log.Logger) (*Pipe, error) { h := http.Header{} h.Add("X-Pipe-Opts", string(encoded)) url := fmt.Sprintf("ws://%s", host) - conn, _, err := websocket.DefaultDialer.Dial(url, h) + dialer := websocket.Dialer{ + TLSClientConfig: tlsConfig, + } + conn, _, err := dialer.Dial(url, h) if err != nil { return nil, err }
allow custom TLS config for client pipe connections
eldarion-gondor_piper
train
go
7718c8ce17e7d9befa3c069d357bfb95714340e6
diff --git a/lib/how_is/cli.rb b/lib/how_is/cli.rb index <HASH>..<HASH> 100644 --- a/lib/how_is/cli.rb +++ b/lib/how_is/cli.rb @@ -91,11 +91,11 @@ module HowIs def self.validate_options!(options) return if options[:help] || options[:version] - if options[:date] && !options[:repository] && !options[:config] - missing_argument("expected wither --repository or --config.") - end - - if !options[:date] + if options[:date] + if !options[:repository] && !options[:config] + missing_argument("--repository or --config.") + end + else missing_argument("--date") end end
refactor validate_options!(), again.
duckinator_inq
train
rb
200027f73a99f18eeeae4395be9622c65590916f
diff --git a/fireplace/cards/gvg/neutral_epic.py b/fireplace/cards/gvg/neutral_epic.py index <HASH>..<HASH> 100644 --- a/fireplace/cards/gvg/neutral_epic.py +++ b/fireplace/cards/gvg/neutral_epic.py @@ -29,7 +29,7 @@ class GVG_106: # Enhance-o Mechano class GVG_107: def action(self): - for target in self.controller.field: + for target in self.controller.field.exclude(self): tag = random.choice((GameTag.WINDFURY, GameTag.TAUNT, GameTag.DIVINE_SHIELD)) yield SetTag(target, {tag: True})
Exclude Enhance-o Mechano from its own buff targets
jleclanche_fireplace
train
py
ed67ed1fed0ca4f961f214cc2d626b1c124779f3
diff --git a/sos/plugins/block.py b/sos/plugins/block.py index <HASH>..<HASH> 100644 --- a/sos/plugins/block.py +++ b/sos/plugins/block.py @@ -44,8 +44,9 @@ class Block(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): if disk.startswith("ram"): continue disk_path = os.path.join('/dev/', disk) + self.add_udev_info(disk_path) + self.add_udev_info(disk_path, attrs=True) self.add_cmd_output([ - "udevadm info -ap /sys/block/%s" % (disk), "parted -s %s unit s print" % (disk_path), "fdisk -l %s" % disk_path ])
[block] Use add_udev_info for block devices Updates the block plugin to use the new add_udev_info() method, once with an attribute walk and once without. Resolves: #<I>
sosreport_sos
train
py
8650c801a26c14e3887c89c8bb2448b810c6cb32
diff --git a/py/code/excinfo.py b/py/code/excinfo.py index <HASH>..<HASH> 100644 --- a/py/code/excinfo.py +++ b/py/code/excinfo.py @@ -194,7 +194,9 @@ class FormattedExcinfo(object): traceback = excinfo.traceback if self.tbfilter: traceback = traceback.filter() - recursionindex = traceback.recursionindex() + recursionindex = None + if excinfo.errisinstance(RuntimeError): + recursionindex = traceback.recursionindex() last = traceback[-1] entries = [] extraline = None diff --git a/py/code/testing/test_excinfo.py b/py/code/testing/test_excinfo.py index <HASH>..<HASH> 100644 --- a/py/code/testing/test_excinfo.py +++ b/py/code/testing/test_excinfo.py @@ -351,6 +351,8 @@ raise ValueError() def exconly(self, tryshort): return "EXC" + def errisinstance(self, cls): + return False excinfo = FakeExcinfo() class FakeRawTB(object):
[svn r<I>] only check for Recursion if we have a RuntimeError --HG-- branch : trunk
vmalloc_dessert
train
py,py
958cb85ffd2dc744ebd514f08e36983f91741dc6
diff --git a/universe/__init__.py b/universe/__init__.py index <HASH>..<HASH> 100644 --- a/universe/__init__.py +++ b/universe/__init__.py @@ -24,6 +24,12 @@ from universe.remotes import docker_remote from universe.rewarder import merge_infos from universe.runtimes.registration import runtime_spec +__all__ = [ + 'configuration', 'envs', 'error', 'kube', 'pyprofile', 'remotes', 'rewarder', 'runtimes', + 'scoreboard', 'spaces', 'twisty', 'utils', 'vectorized', 'vncdriver', 'wrappers', + 'configure_logging', 'docker_image', 'enable_logfile', + 'logger', 'extra_logger'] + def docker_image(runtime_id): logger.warn('DEPRECATION WARNING: universe.docker_image(runtime_id) is deprecated and will be removed soon. Use runtime_spec(runtime_id).image instead. ') return runtime_spec(runtime_id).image
Don't export temp vars like id
openai_universe
train
py
ee286ed8ba0caa49e8bb410c0eedb672e8502d1c
diff --git a/src/main/java/org/apache/maven/plugin/nar/Linker.java b/src/main/java/org/apache/maven/plugin/nar/Linker.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/apache/maven/plugin/nar/Linker.java +++ b/src/main/java/org/apache/maven/plugin/nar/Linker.java @@ -213,7 +213,7 @@ public class Linker } else if ( name.equals( "msvc" ) ) { - NarUtil.runCommand( "link", new String[] { "/version" }, null, null, out, err, dbg, log ); + NarUtil.runCommand( "link", new String[] { "/?" }, null, null, out, err, dbg, log ); Pattern p = Pattern.compile( "\\d+\\.\\d+\\.\\d+" ); Matcher m = p.matcher( out.toString() ); if ( m.find() )
Use the /? option of link.exe to determine its version This is probably the most robust solution for <URL>
maven-nar_nar-maven-plugin
train
java
df9a1b989cde22b78766fc9b276f129ecb4ae25b
diff --git a/py/h2o_glm.py b/py/h2o_glm.py index <HASH>..<HASH> 100644 --- a/py/h2o_glm.py +++ b/py/h2o_glm.py @@ -28,7 +28,8 @@ def pickRandGlmParams(paramDict, params): if params['link'] not in ('tweedie'): params['link'] = None if params['family'] == 'binomial': - if params['link'] not in ('logit', 'identity', 'log', 'inverse', 'familyDefault'): + # only logit and log + if params['link'] not in ('logit', 'log', 'familyDefault'): params['link'] = None if params['family'] == 'gaussian': if params['link'] not in ('identity', 'log', 'inverse', 'familyDefault'):
only logit and log allowed for binomial glm
h2oai_h2o-2
train
py
a3911a91a6e275f4512f2904cc33d55e17000212
diff --git a/ezp/Persistence/Content/Type/Handler.php b/ezp/Persistence/Content/Type/Handler.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Content/Type/Handler.php +++ b/ezp/Persistence/Content/Type/Handler.php @@ -33,6 +33,7 @@ interface Handler /** * @param mixed $groupId + * @todo Throw exception if group is not found, also if group contains types */ public function deleteGroup( $groupId ); @@ -109,6 +110,7 @@ interface Handler * @param mixed $groupId * @param mixed $contentTypeId * @param int $version + * @todo Throw exception if last group on content type (hence, it should be deleted instead) */ public function unlink( $groupId, $contentTypeId, $version );
PHPDoc: Add some todo's from meeting minutes so they are exposed in api
ezsystems_ezpublish-kernel
train
php
f3a613d41ee6a94b2acca171cba87592c5ca202e
diff --git a/translator/package.go b/translator/package.go index <HASH>..<HASH> 100644 --- a/translator/package.go +++ b/translator/package.go @@ -553,6 +553,13 @@ func (c *PkgContext) translateFunctionBody(stmts []ast.Stmt, sig *types.Signatur c.Indent(func() { c.Printf("if (Go$err.constructor !== Go$Panic) { Go$err = Go$wrapJavaScriptError(Go$err); };") c.Printf("Go$errorStack.push({ frame: Go$getStackDepth(), error: Go$err });") + if resultNames == nil { + zeros := make([]string, sig.Results().Len()) + for i := range zeros { + zeros[i] = c.zeroValue(sig.Results().At(i).Type()) + } + c.Printf("return %s;", strings.Join(zeros, ", ")) + } }) c.Printf("} finally {") c.Indent(func() {
Fixed method return values when recovered from panic.
gopherjs_gopherjs
train
go
b736a4dfba6a70974a619e13873935a76963c201
diff --git a/Http/Response.php b/Http/Response.php index <HASH>..<HASH> 100644 --- a/Http/Response.php +++ b/Http/Response.php @@ -34,7 +34,7 @@ class Response */ public function __construct($response) { - list($this->raw_headers, $this->body) = explode("\r\n\r\n", $response, 2); + @list($this->raw_headers, $this->body) = explode("\r\n\r\n", $response, 2); $this->buildHeaders($this->raw_headers); }
Prevent list() from generating a NOTICE warning on responses with empty an body.
doctrine_orientdb-odm
train
php
a4d487a80615db24de4ff81fd5fd35e34ef45d0e
diff --git a/docs/quantum.config.js b/docs/quantum.config.js index <HASH>..<HASH> 100644 --- a/docs/quantum.config.js +++ b/docs/quantum.config.js @@ -89,17 +89,6 @@ module.exports = { }, resources: [ { - files: [ - 'node_modules/hexagon-js/dist/hexagon-light/**/*', - '!node_modules/hexagon-js/dist/hexagon-light/favicon/*', - '!node_modules/hexagon-js/dist/hexagon-light/hexagon.variables*', - '!node_modules/hexagon-js/dist/hexagon-light/hexagon.print*' - ], - base: 'node_modules/hexagon-js/dist/hexagon-light', - dest: 'resources/hexagon-js', - watch: false - }, - { files: 'src/resources/**/*', dest: 'resources', watch: true
Remove config for copying hexagon-js in the site - it is not used
ocadotechnology_quantumjs
train
js
590ce3f3b810c2ea651e5c08be007bb4f1e8eb2e
diff --git a/tornado/web.py b/tornado/web.py index <HASH>..<HASH> 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -919,7 +919,7 @@ class RequestHandler(object): return self.clear() - reason = None + reason = kwargs.get('reason') if 'exc_info' in kwargs: exception = kwargs['exc_info'][1] if isinstance(exception, HTTPError) and exception.reason:
Fixes bug disallowing custom-made reason phrase The send_error method is, I believe, supposed to allow sending an HTTP reason phrase that is not one of the standard ones. This change corrects an apparent bug which made this impossible. With the correction, specifying an 'error' keyword argument to send_error actually sends the specified reason phrase to the client.
tornadoweb_tornado
train
py
df00da81a5df8204b3b126f72da966771cbca80e
diff --git a/lib/tty/screen.rb b/lib/tty/screen.rb index <HASH>..<HASH> 100644 --- a/lib/tty/screen.rb +++ b/lib/tty/screen.rb @@ -196,7 +196,7 @@ module TTY lines = run_command('tput', 'lines').to_i cols = run_command('tput', 'cols').to_i [lines, cols] if nonzero_column?(lines) - rescue Errno::ENOENT + rescue IOError, SystemCallError end module_function :size_from_tput @@ -209,7 +209,7 @@ module TTY return unless out size = out.split.map(&:to_i) size if nonzero_column?(size[1]) - rescue Errno::ENOENT + rescue IOError, SystemCallError end module_function :size_from_stty
Change to capture generic IO errors to make the calls more robust
piotrmurach_tty-screen
train
rb
e92cd253f91e947c837c17284b5bc5de15679f66
diff --git a/shipane_sdk/client.py b/shipane_sdk/client.py index <HASH>..<HASH> 100644 --- a/shipane_sdk/client.py +++ b/shipane_sdk/client.py @@ -136,7 +136,7 @@ class Client(object): self.__send_request(request, timeout) def query(self, client=None, navigation=None, timeout=None): - request = Request('GET', self.__create_url(client, '', navigation=navigation)) + request = Request('GET', self.__create_url(client, 'reports', navigation=navigation)) response = self.__send_request(request, timeout) json = response.json() df = pd.DataFrame(json['dataTable']['rows'], columns=json['dataTable']['columns'])
Comply change of API from / to /reports
sinall_ShiPanE-Python-SDK
train
py
ff2b77bb2882f0af6697eb4b8f4972d906e1564f
diff --git a/src/pixi/textures/RenderTexture.js b/src/pixi/textures/RenderTexture.js index <HASH>..<HASH> 100644 --- a/src/pixi/textures/RenderTexture.js +++ b/src/pixi/textures/RenderTexture.js @@ -174,6 +174,7 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle var children = displayObject.children; //TODO -? create a new one??? dont think so! + var originalWorldTransform = displayObject.worldTransform; displayObject.worldTransform = PIXI.mat3.create();//sthis.indetityMatrix; // modify to flip... displayObject.worldTransform[4] = -1; @@ -212,6 +213,8 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle this.renderGroup.setRenderable(displayObject); this.renderGroup.render(this.projection); } + + displayObject.worldTransform = originalWorldTransform; }
fix RenderTexture stage flipping
drkibitz_node-pixi
train
js
b1a51f97ed6967a2c0502462d256cab867ec53fb
diff --git a/scraper/code_gov/__init__.py b/scraper/code_gov/__init__.py index <HASH>..<HASH> 100644 --- a/scraper/code_gov/__init__.py +++ b/scraper/code_gov/__init__.py @@ -339,6 +339,7 @@ class CodeGovProject(dict): # *name: [string] The project name project['name'] = repository['software_title'] + logger.debug('Software Title: %s', project['name']) # *description: [string] A description of the project project['description'] = repository['description']
Added debug logging of software title
LLNL_scraper
train
py
e218fb4b836abfcb4687fdfa13d1ab119b97b98c
diff --git a/Flame/Modules/DI/ModulesExtension.php b/Flame/Modules/DI/ModulesExtension.php index <HASH>..<HASH> 100644 --- a/Flame/Modules/DI/ModulesExtension.php +++ b/Flame/Modules/DI/ModulesExtension.php @@ -296,14 +296,9 @@ class ModulesExtension extends Nette\DI\CompilerExtension $router = $builder->getDefinition('router'); // Init collections - $routerFactories = []; - - foreach (array_keys($builder->findByTag(self::TAG_ROUTER)) as $serviceName) { - $service = $builder->getDefinition($serviceName); - - // Try to get priority from service tag - $priority = $service->getTag(self::TAG_ROUTER); + $routerFactories = array(); + foreach ($builder->findByTag(self::TAG_ROUTER) as $serviceName => $priority) { // Priority is not defined... if (is_bool($priority)) { // ...use default value
- Added php <I> support - Services cycle optimalization
flame-org_Modules
train
php
f1b61ce9d56e97dcd5481aaa4a831b36d8174cce
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -1343,6 +1343,9 @@ module Discordrb def send_heartbeat(sequence = nil) sequence ||= @sequence + + raise_event(HeartbeatEvent.new(self)) + LOGGER.out("Sending heartbeat with sequence #{sequence}") data = { op: Opcodes::HEARTBEAT,
Actually raise the heartbeat event once a heartbeat is sent
meew0_discordrb
train
rb
9300a20c194cc3be27b13d10b7471cbccdec926c
diff --git a/lib/mores.rb b/lib/mores.rb index <HASH>..<HASH> 100644 --- a/lib/mores.rb +++ b/lib/mores.rb @@ -1,7 +1,10 @@ %w[ version - block_initialize - linked_list - succession - immutable_struct ].each { |file| require_relative "mores/#{file}" } + +[ + [Mores, :BlockInitialize, 'block_initialize'], + [Mores, :LinkedList, 'linked_list' ], + [Mores, :Succession, 'succession' ], + [Mores, :ImmutableStruct, 'immutable_struct'], +].each { |(mod, name, file)| mod.autoload name, "mores/#{file}" }
use autoload for types since this is more of a 'grab-bag' lib
michaeljpetter_mores
train
rb
085981ea4b7d6dc1f86a2d4f65874ba24207f77d
diff --git a/abl/vpath/base/fs.py b/abl/vpath/base/fs.py index <HASH>..<HASH> 100644 --- a/abl/vpath/base/fs.py +++ b/abl/vpath/base/fs.py @@ -539,11 +539,12 @@ class URI(object): @rtype: Bunch @return: backend specific information about self. """ + print 'in info: %s' % self return self.connection.info(self) @with_connection - def update(self): - return self.connection.update(self) + def update(self, recursive=True): + return self.connection.update(self, recursive) @with_connection def sync(self, other, options=''): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name="AbletonVPath", - version="0.2", + version="0.3", description="A OO-abstraction of file-systems", author="Stephan Diehl", author_email="[email protected]",
added recursive arg to checkout command
AbletonAG_abl.vpath
train
py,py
6daf19dbd3b838f168cf549591ddefd3b1b59eb6
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java index <HASH>..<HASH> 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java @@ -154,6 +154,12 @@ public class SmackReactor { return scheduledAction; } + /** + * Cancels the scheduled action. + * + * @param scheduledAction the scheduled action to cancel. + * @return <code>true</code> if the scheduled action was still pending and got removed, <code>false</code> otherwise. + */ boolean cancel(ScheduledAction scheduledAction) { return scheduledActions.remove(scheduledAction); }
[core] Add javadoc to SmackReactor.cancel(ScheduledAction)
igniterealtime_Smack
train
java
b7ad320e7c13d8e75357188604f797ce60162666
diff --git a/Storyshots.test.js b/Storyshots.test.js index <HASH>..<HASH> 100644 --- a/Storyshots.test.js +++ b/Storyshots.test.js @@ -1,13 +1,3 @@ import initStoryshots from "@storybook/addon-storyshots"; -// Workaround for https://github.com/storybooks/storybook/issues/2509 -jest.mock("react-dom", () => { - return { - render: () => null, - unmountComponentAtNode: () => null, - findDOMNode: () => { - return {}; - } - }; -}); initStoryshots();
refactor(snapshots config): remove old workaround
CraveFood_farmblocks
train
js
c3699ec387ac6c76afbecd7981ede98188570eda
diff --git a/mongoctl/objects/replicaset_cluster.py b/mongoctl/objects/replicaset_cluster.py index <HASH>..<HASH> 100644 --- a/mongoctl/objects/replicaset_cluster.py +++ b/mongoctl/objects/replicaset_cluster.py @@ -592,7 +592,7 @@ class ReplicaSetCluster(Cluster): (force and version_diff >= 0)) realized_config = self.read_rs_config() - if got_the_memo(realized_config): + if not got_the_memo(realized_config): log_verbose("Really? Config version %s? " "Let me double-check that ..." % "unchanged" if realized_config else "unavailable")
more cromulently verify acceptance of the updated cluster configuration
mongolab_mongoctl
train
py
5d2e297bb371f8087d96c75d7a4d05b3c0f5d01c
diff --git a/onelogin/saml/SignatureVerifier.py b/onelogin/saml/SignatureVerifier.py index <HASH>..<HASH> 100644 --- a/onelogin/saml/SignatureVerifier.py +++ b/onelogin/saml/SignatureVerifier.py @@ -75,6 +75,12 @@ def verify(document, signature, _etree=None, _tempfile=None, _subprocess=None, if _os is None: _os = os + signatureNodes = document.xpath("//ds:Signature", namespaces={'ds': 'http://www.w3.org/2000/09/xmldsig#'}) + + parent_id_container = 'urn:oasis:names:tc:SAML:2.0:assertion:Assertion' + if signatureNodes and signatureNodes[0].getparent().tag == '{urn:oasis:names:tc:SAML:2.0:protocol}Response': + parent_id_container = 'urn:oasis:names:tc:SAML:2.0:protocol:Response' + xmlsec_bin = _get_xmlsec_bin() verified = False @@ -117,7 +123,7 @@ def verify(document, signature, _etree=None, _tempfile=None, _subprocess=None, '--pubkey-cert-pem', cert_filename, '--id-attr:ID', - 'urn:oasis:names:tc:SAML:2.0:assertion:Assertion', + parent_id_container, xml_filename, ]
Support Signature on Response and on Assertion
onelogin_python3-saml
train
py
424edc8f8e2c80f857f467de291185bd02bb9902
diff --git a/datastore-core/src/main/java/org/opencb/datastore/core/QueryResult.java b/datastore-core/src/main/java/org/opencb/datastore/core/QueryResult.java index <HASH>..<HASH> 100644 --- a/datastore-core/src/main/java/org/opencb/datastore/core/QueryResult.java +++ b/datastore-core/src/main/java/org/opencb/datastore/core/QueryResult.java @@ -54,13 +54,13 @@ public class QueryResult extends ObjectMap { } private void initialize() { - this.put("id", ""); + this.put("id", null); this.put("dbTime", -1); this.put("numResults", 0); this.put("numTotalResults", 0); - this.put("warning", ""); - this.put("error", ""); - this.put("resultType", ""); + this.put("warning", null); + this.put("error", null); + this.put("resultType", null); this.put("result", new ArrayList<>()); }
QueryResult string fields initialized as null instead of the empty string
opencb_datastore
train
java
d2c8a83bb2c75067834c0e210a4b129a849621b3
diff --git a/lib/types.js b/lib/types.js index <HASH>..<HASH> 100644 --- a/lib/types.js +++ b/lib/types.js @@ -842,14 +842,6 @@ module.exports = function (expect) { } }); - if (typeof Buffer !== 'undefined') { - expect.addType({ - name: 'Buffer', - base: 'binaryArray', - identify: Buffer.isBuffer - }); - } - [8, 16, 32].forEach(function (numBits) { ['Int', 'Uint'].forEach(function (intOrUint) { var constructorName = intOrUint + numBits + 'Array', @@ -868,6 +860,14 @@ module.exports = function (expect) { }, this); }, this); + if (typeof Buffer !== 'undefined') { + expect.addType({ + name: 'Buffer', + base: 'binaryArray', + identify: Buffer.isBuffer + }); + } + expect.addType({ name: 'string', identify: function (value) {
Define the Buffer type after Uint8Array. Fixes tests with node.js <I> where Buffers are Uint8Arrays under the hood.
unexpectedjs_unexpected
train
js
11ce34cfcf3cd85796cd3e653ac7d29528275cf5
diff --git a/odl/contrib/fom/supervised.py b/odl/contrib/fom/supervised.py index <HASH>..<HASH> 100644 --- a/odl/contrib/fom/supervised.py +++ b/odl/contrib/fom/supervised.py @@ -69,7 +69,10 @@ def mean_squared_error(data, ground_truth, mask=None, normalized=False): diff = data - ground_truth fom = l2_normSquared(diff) - fom /= data.space.one().norm()**2 + + # Volume of space + vol = l2_normSquared(data.space.one()) + fom /= vol if normalized: fom /= (l2_normSquared(data) + l2_normSquared(ground_truth)) @@ -124,6 +127,10 @@ def mean_absolute_error(data, ground_truth, mask=None, normalized=False): diff = data - ground_truth fom = l1_norm(diff) + # Volume of space + vol = l1_norm(data.space.one()) + fom /= vol + if normalized: fom /= (l1_norm(data) + l1_norm(ground_truth))
BUG/ENH: update fom normalization in mean abs and mean sqr error.
odlgroup_odl
train
py
883810b53328b302aa765ccf9d228bd73c046cac
diff --git a/utils/compile.go b/utils/compile.go index <HASH>..<HASH> 100644 --- a/utils/compile.go +++ b/utils/compile.go @@ -9,7 +9,7 @@ import ( // General compile function func Compile(script string) ([]byte, error) { - asm, errors := mutan.Compile(strings.NewReader(script), false) + byteCode, errors := mutan.Compile(strings.NewReader(script), false) if len(errors) > 0 { var errs string for _, er := range errors { @@ -20,7 +20,7 @@ func Compile(script string) ([]byte, error) { return nil, fmt.Errorf("%v", errs) } - return ethutil.Assemble(asm...), nil + return byteCode, nil } func CompileScript(script string) ([]byte, []byte, error) {
Using mutan assembler stage
ethereum_go-ethereum
train
go
85aa29b95dcd195adab31c27a9cb7cb78fbc91e3
diff --git a/alembic/versions/38c9c18d342e_add_new_mdapi_rule.py b/alembic/versions/38c9c18d342e_add_new_mdapi_rule.py index <HASH>..<HASH> 100644 --- a/alembic/versions/38c9c18d342e_add_new_mdapi_rule.py +++ b/alembic/versions/38c9c18d342e_add_new_mdapi_rule.py @@ -64,6 +64,6 @@ def downgrade(): print "Found %i rules" % len(rules) for rule in rules: - rule.filter.remove_rule(session, path) + rule.filter.remove_rule(session, path, rule.id) session.commit()
Fix an older fmn downgrade script.
fedora-infra_fmn.lib
train
py
a13daa8a6e74a31f6e5ee44139def0a263b00f9e
diff --git a/test/backend/memoize_test.rb b/test/backend/memoize_test.rb index <HASH>..<HASH> 100644 --- a/test/backend/memoize_test.rb +++ b/test/backend/memoize_test.rb @@ -60,9 +60,6 @@ class I18nBackendMemoizeTest < I18nBackendSimpleTest backend = backend_impl.new memoized_lookup = backend.send(:memoized_lookup) - # make the 'default_proc' execution artificially slower to help reproduce : - default_proc = memoized_lookup.default_proc - memoized_lookup.default_proc = Proc.new { |h, k| sleep 0.1; default_proc.call(h, k) } assert_equal "[:foo, :scoped, :sample]", backend.translate('foo', scope = [:scoped, :sample])
Concurrent::Mmap does not expose default_proc bf<I>cc<I>a<I>b3eed<I>d8d1c<I>e<I>b8d<I>b2 changed underlying implementation from Hash to Concurrent.map which removes the ability to test this way.
ruby-i18n_i18n
train
rb
fdcd1a6fdeed153249f5ab6ddeef4593bbfe27d5
diff --git a/flask_user/tokens.py b/flask_user/tokens.py index <HASH>..<HASH> 100644 --- a/flask_user/tokens.py +++ b/flask_user/tokens.py @@ -19,7 +19,7 @@ class TokenManager(object): key = secret + precursor else: key = secret.encode("utf-8") + precursor - self.cipher = AES.new(key[0:16]) + self.cipher = AES.new(key[0:16], AES.MODE_ECB) # Create signer to sign tokens self.signer = TimestampSigner(secret) @@ -73,4 +73,4 @@ class TokenManager(object): is_valid = False has_expired = False id = None - return (is_valid, has_expired, id) \ No newline at end of file + return (is_valid, has_expired, id)
Specify the default mode for the AES cipher By specifying the mode for the AES cipher the code is compatible with both PyCrypto & PyCryptodome which requires the mode to be specified
lingthio_Flask-User
train
py
64f823574716d1fb999f6ff3c2862c4b9744528d
diff --git a/dockertest.go b/dockertest.go index <HASH>..<HASH> 100644 --- a/dockertest.go +++ b/dockertest.go @@ -172,6 +172,7 @@ type RunOptions struct { ExtraHosts []string CapAdd []string SecurityOpt []string + DNS []string WorkingDir string NetworkID string Labels map[string]string @@ -284,6 +285,7 @@ func (d *Pool) RunWithOptions(opts *RunOptions) (*Resource, error) { CapAdd: opts.CapAdd, SecurityOpt: opts.SecurityOpt, Privileged: opts.Privileged, + DNS: opts.DNS, }, NetworkingConfig: &networkingConfig, })
Add dns option to RunOptions (#<I>)
ory_dockertest
train
go
1eb6cc12decc227d8b8ea7767b14153986b816bd
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -930,7 +930,7 @@ window.CodeMirror = (function() { function paddingTop(display) {return display.lineSpace.offsetTop;} function paddingLeft(display) { - var e = removeChildrenAndAdd(display.measure, elt("pre")).appendChild(elt("span", "x")); + var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x")); return e.offsetLeft; }
Fix selection drawing in non-left-aligned text
codemirror_CodeMirror
train
js
ed3e154dcfc464a0a8e84840546225536ae5aa55
diff --git a/niworkflows/viz/utils.py b/niworkflows/viz/utils.py index <HASH>..<HASH> 100644 --- a/niworkflows/viz/utils.py +++ b/niworkflows/viz/utils.py @@ -79,7 +79,7 @@ def as_svg(image, filename='temp.svg'): line = re.sub(' height="[0-9]+[a-z]*"', '', line) line = re.sub(' width="[0-9]+[a-z]*"', '', line) svg_start = i - if svg_start is not None + if svg_start is not None: svg_lines_corrected.append(line) image_svg = svg_lines_corrected # strip out extra DOCTYPE, etc headers return '\n'.join(image_svg) # straight up giant string
pylint before commiting...
poldracklab_niworkflows
train
py
52035e84289f5340831857695316d84b48389f93
diff --git a/src/main/java/ch/ralscha/extdirectspring/controller/RouterController.java b/src/main/java/ch/ralscha/extdirectspring/controller/RouterController.java index <HASH>..<HASH> 100644 --- a/src/main/java/ch/ralscha/extdirectspring/controller/RouterController.java +++ b/src/main/java/ch/ralscha/extdirectspring/controller/RouterController.java @@ -244,6 +244,7 @@ public class RouterController implements InitializingBean { return null; } + @SuppressWarnings({ "rawtypes", "unchecked" }) @RequestMapping(value = "/router", method = RequestMethod.POST, params = "!extAction") public void router(HttpServletRequest request, HttpServletResponse response, Locale locale) throws IOException { @@ -284,9 +285,9 @@ public class RouterController implements InitializingBean { && !ExtDirectStoreResponse.class.isAssignableFrom(result.getClass()) && configuration.isAlwaysWrapStoreResponse()) { if (result instanceof Collection) { - result = new ExtDirectStoreResponse<Collection<?>>((Collection<?>) result); + result = new ExtDirectStoreResponse((Collection) result); } else { - result = new ExtDirectStoreResponse<Object>(result); + result = new ExtDirectStoreResponse(result); } }
Revert the cast change. Does not work if not done exactly this way
ralscha_extdirectspring
train
java
cf0227ba6bf4abfe61bca7c5f016e363e9783047
diff --git a/splunklib/client.py b/splunklib/client.py index <HASH>..<HASH> 100644 --- a/splunklib/client.py +++ b/splunklib/client.py @@ -285,6 +285,12 @@ def connect(**kwargs): """ return Service(**kwargs).login() +# In preparation for adding Storm support, we added an +# intermediary class between Service and Context. Storm's +# API is not going to be the same as enterprise Splunk's +# API, so we will derive both Service (for enterprise Splunk) +# and StormService for (Splunk Storm) from _BaseService, and +# put any shared behavior on it. class _BaseService(Context): pass
Add comments on why we put in _BaseService.
splunk_splunk-sdk-python
train
py
b63510ee41f7c5ebfc368058352eeb6d5e94aab8
diff --git a/autograd/core.py b/autograd/core.py index <HASH>..<HASH> 100644 --- a/autograd/core.py +++ b/autograd/core.py @@ -43,7 +43,7 @@ def jacobian(fun, argnum=0): dummy.outshape = getshape(val) return list(np.ravel(val)) - concatenate = lambda lst: np.concatenate(map(np.atleast_1d, lst)) + concatenate = lambda lst: np.concatenate(list(map(np.atleast_1d, lst))) @attach_name_and_doc(fun, argnum, 'Jacobian') def gradfun(*args, **kwargs):
add back list call (needed two)
HIPS_autograd
train
py
ab8f44e19d5f3bb489cb93efa4262536e4df89da
diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py index <HASH>..<HASH> 100644 --- a/custodian/vasp/handlers.py +++ b/custodian/vasp/handlers.py @@ -1016,9 +1016,9 @@ class IncorrectSmearingHandler(ErrorHandler): # check whether bandgap is zero, tetrahedron smearing was used # and relaxation is performed. if (v.eigenvalue_band_properties[0] == 0 and - v.incar.get("ISMEAR", 1) < -3 and - v.incar.get("NSW", 0) > 1): - return True + v.incar.get("ISMEAR", 1) < -3 and + v.incar.get("NSW", 0) > 1): + return True except Exception: pass return False
Fixed pycodestyle linting errors.
materialsproject_custodian
train
py
cbc76b4ecafc9657d4e833c229b7c57cd591d50d
diff --git a/modules/quality-immutable-object/src/test/java/net/sf/qualitycheck/immutableobject/ImmutableObjectGeneratorTest.java b/modules/quality-immutable-object/src/test/java/net/sf/qualitycheck/immutableobject/ImmutableObjectGeneratorTest.java index <HASH>..<HASH> 100644 --- a/modules/quality-immutable-object/src/test/java/net/sf/qualitycheck/immutableobject/ImmutableObjectGeneratorTest.java +++ b/modules/quality-immutable-object/src/test/java/net/sf/qualitycheck/immutableobject/ImmutableObjectGeneratorTest.java @@ -528,7 +528,7 @@ public class ImmutableObjectGeneratorTest { settings.builderImplementsInterface(true); final String file = "Car.java"; - assertEquals(readReferenceImmutable(file), readInterfaceAndGenerate(file, settings.build())); + assertEquals(readReferenceImmutable(file).replace("\r", ""), readInterfaceAndGenerate(file, settings.build()).replace("\r", "")); } @Test(expected = IllegalStateOfArgumentException.class)
Remove \r so that test will also work on Windows, when compare file is from Unix
before_quality-check
train
java
914ccb5dd0d7600e79363914bc069d729fa23760
diff --git a/python/tree/tree.py b/python/tree/tree.py index <HASH>..<HASH> 100644 --- a/python/tree/tree.py +++ b/python/tree/tree.py @@ -240,8 +240,10 @@ class Tree(object): environ['default'] = cfg.defaults() # set the filesystem envvar to sas_base_dir - if environ['default']['FILESYSTEM'] == self._file_replace: - environ['default']['FILESYSTEM'] = self.sasbasedir + filesystem = 'FILESYSTEM' if 'FILESYSTEM' in environ[ + 'default'] else 'filesystem' if 'filesystem' in environ['default'] else None + if environ['default'][filesystem] == self._file_replace: + environ['default'][filesystem] = self.sasbasedir # add all sections into the tree environ sections = sections if sections else cfg.sections()
making tree work with upper or lowercase FILESYSTEM
sdss_tree
train
py
1d57ccbc6f80a506e5c3867976793310e9148f03
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index <HASH>..<HASH> 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -697,7 +697,7 @@ module ActionMailer #:nodoc: def perform_delivery_smtp(mail) destinations = mail.destinations mail.ready_to_send - sender = (mail['return-path'] && mail['return-path'].spec) || mail.from + sender = (mail['return-path'] && mail['return-path'].spec) || mail['from'] smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port]) smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto)
<I> compatibility - don't pass an array as the from address as this ends up generating invalid SMTP commands.
rails_rails
train
rb
b9a53c47f66dbc41e3e9ba8bd29932d1ca6a589f
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index <HASH>..<HASH> 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -397,9 +397,20 @@ class TestSdistTest(unittest.TestCase): filename = filename.decode('latin-1') self.assertFalse(filename in cmd.filelist.files) else: - # No conversion takes place under Python 2 and the file - # is included. We shall keep it that way for BBB. - self.assertTrue(filename in cmd.filelist.files) + # Under Python 2 there seems to be no decoding of the + # filelist. However, due to decode and encoding of the + # file name to utf-8 + try: + #This seems a bit iffy, but not really what else + #since cmd.filelist.files is not encoded, but + #want to write out the manifest as UTF-8/ + + #This is how one expected the filename to be decoded + fs_enc = sys.getfilesystemencoding() + filename.decode(fs_enc) + self.assertTrue(filename in cmd.filelist.files) + except UnicodeDecodeError: + self.assertFalse(filename in cmd.filelist.files) class TestDummyOutput(environment.ZippedEnvironment):
test_sdist: change the latin1 test to match the behavior of write_manifest
pypa_setuptools
train
py
f6d679960d48f569e2451a3b2a6f56954051becc
diff --git a/languagetool-language-modules/de/src/test/java/org/languagetool/rules/de/GermanSpellerRuleTest.java b/languagetool-language-modules/de/src/test/java/org/languagetool/rules/de/GermanSpellerRuleTest.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/de/src/test/java/org/languagetool/rules/de/GermanSpellerRuleTest.java +++ b/languagetool-language-modules/de/src/test/java/org/languagetool/rules/de/GermanSpellerRuleTest.java @@ -189,6 +189,7 @@ public class GermanSpellerRuleTest { assertFirstSuggestion("bisien", "bisschen", rule, lt); assertFirstSuggestion("Gruessen", "Grüßen", rule, lt); assertFirstSuggestion("Matschscheibe", "Mattscheibe", rule, lt); + assertFirstSuggestion("Pearl-Harbour", "Pearl Harbor", rule, lt); } @Test
[de] suggest 'Pearl Harbor' + test
languagetool-org_languagetool
train
java
2b3226a65790ff195fd69c03a5ad479ca55e43b5
diff --git a/v3/jest.config.js b/v3/jest.config.js index <HASH>..<HASH> 100644 --- a/v3/jest.config.js +++ b/v3/jest.config.js @@ -11,7 +11,6 @@ module.exports = { ], moduleFileExtensions: [...defaults.moduleFileExtensions, "ts", "tsx"], moduleNameMapper: { - '^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1', // This regex should match the packages that we want compiled from source // through `ts-jest`, as opposed to loaded from their output files in // `dist`.
We will not be doing this cross-package module mapping in `@apollo/server`. I'm pretty sure.
apollographql_apollo-server
train
js
d490ca8161efb7b1b27d5d01adb37d4f13d420e4
diff --git a/group/lib.php b/group/lib.php index <HASH>..<HASH> 100644 --- a/group/lib.php +++ b/group/lib.php @@ -542,8 +542,8 @@ function groups_get_potential_members($courseid, $roleid = null, $cohortid = nul } if ($cohortid) { - $cohortjoin = "JOIN {cohort_members} cm ON cm.userid = u.id - JOIN {cohort} c ON c.id = cm.cohortid"; + $cohortjoin = "JOIN {cohort_members} cm ON (cm.userid = u.id AND cm.cohortid = :cohortid)"; + $params['cohortid'] = $cohortid; } else { $cohortjoin = ""; }
MDL-<I> fixed incorrect cohort condition when auto-creating groups
moodle_moodle
train
php
f1c0c8e094b98d99d77b4a386222051c35e3cefe
diff --git a/src/Query/LaravelQuery.php b/src/Query/LaravelQuery.php index <HASH>..<HASH> 100644 --- a/src/Query/LaravelQuery.php +++ b/src/Query/LaravelQuery.php @@ -322,7 +322,7 @@ class LaravelQuery implements IQueryProvider /** * @param ResourceSet $resourceSet The entity set containing the entity to fetch * @param object $sourceEntityInstance The source entity instance - * @param object $data The New data for the entity instance. + * @param object $data the New data for the entity instance * * @returns object|null returns the newly created model if successful, * or null if model creation failed.
Apply fixes from StyleCI (#<I>)
Algo-Web_POData-Laravel
train
php
78df1da7d6b5d8d6a9d06db7d19168a2c39b8643
diff --git a/src/progressbar.js b/src/progressbar.js index <HASH>..<HASH> 100644 --- a/src/progressbar.js +++ b/src/progressbar.js @@ -235,14 +235,14 @@ Path.prototype.animate = function animate(progress, opts, cb) { opts = {}; } - var newOpts = opts; + var passedOpts = opts; // Copy default opts to new object so defaults are not modified var defaultOpts = extend({}, this._opts); opts = extend(defaultOpts, opts); var shiftyEasing = this._easing(opts.easing); - var values = this._resolveFromAndTo(progress, shiftyEasing, opts); + var values = this._resolveFromAndTo(progress, shiftyEasing, passedOpts); this.stop();
Fix bug where original opts were not passed to _resolveTromAndTo
kimmobrunfeldt_progressbar.js
train
js
2a4b617f72358321e8e03321006bc8b6490fb9b1
diff --git a/lib/strategies/OAuth2.js b/lib/strategies/OAuth2.js index <HASH>..<HASH> 100644 --- a/lib/strategies/OAuth2.js +++ b/lib/strategies/OAuth2.js @@ -2,7 +2,9 @@ * Module dependencies */ -var URL = require('url') +var pkg = require('../../package.json') + , agent = 'Anvil Connect/' + pkg.version + , URL = require('url') , util = require('util') , Strategy = require('passport-strategy') , request = require('superagent') @@ -101,7 +103,7 @@ function authorizationCodeGrant (code, done) { req.set('Authorization', 'Basic ' + this.base64credentials()); } - req.set('user-agent', 'Anvil Connect/0.1.26') + req.set('user-agent', agent) req.end(function (res) { done(null, res.body); @@ -127,7 +129,7 @@ function userInfo (token, done) { req.set('Authorization', 'Bearer ' + token); } - req.set('user-agent', 'Anvil Connect/0.1.26') + req.set('user-agent', agent) req.end(function (res) { done(null, res.body);
user agent variable w/version from package.json
anvilresearch_connect
train
js
39e79920e07e91152b3a9c50148cd57b5fa24fde
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -201,8 +201,6 @@ function esprintf(formatString) { var allowSign = specifier.allowSign; var prefix = specifier.prefix; - ret = ret.toString().replace('-', ''); - var fullPrefix = (forcePrecisionOrPrefix ? prefix : '') + ( (forceSign && allowSign === '+' && value > 0) ? '+' : (
Removed weird replacing rule I don't remember adding
SimonSchick_esprintf
train
js
a2ee8512c553f20155f01255236987bc4f09e938
diff --git a/environ/__init__.py b/environ/__init__.py index <HASH>..<HASH> 100644 --- a/environ/__init__.py +++ b/environ/__init__.py @@ -38,6 +38,7 @@ __author_email__ = '[email protected]' __maintainer__ = 'Serghei Iakovlev' __maintainer_email__ = '[email protected]' __url__ = 'https://django-environ.readthedocs.org' -__description__ = 'Configure Django made easy.' # noqa - -from .environ import * +__description__ = ( + 'django-environ allows you to utilize 12factor inspired environment ' + 'variables to configure your Django application.' +)
Update project description, fix redefinition of import
joke2k_django-environ
train
py
c31649b252ab5e59eb948c48419b267790a77416
diff --git a/Controller/Component/StripeComponent.php b/Controller/Component/StripeComponent.php index <HASH>..<HASH> 100644 --- a/Controller/Component/StripeComponent.php +++ b/Controller/Component/StripeComponent.php @@ -70,7 +70,8 @@ class StripeComponent extends Component { 'statement_descriptor', 'receipt_email', 'application_fee', - 'shipping' + 'shipping', + 'source' ); /**
Adds source param for use with saved card tokens
chronon_CakePHP-StripeComponent-Plugin
train
php
cc0f10f1e87b3191468dc3493d700a0b48f0a67e
diff --git a/mongokat/document.py b/mongokat/document.py index <HASH>..<HASH> 100644 --- a/mongokat/document.py +++ b/mongokat/document.py @@ -105,14 +105,14 @@ class Document(dict): def unset_fields(self, fields): """ Removes this list of fields from both the local object and the DB. """ - for f in fields: - if f in self: - del self[f] - self.mongokat_collection.update_one({"_id": self["_id"]}, {"$unset": { f: 1 for f in fields }}) + for f in fields: + if f in self: + del self[f] + def reload(self): """ allow to refresh the document, so after using update(), it could reload @@ -180,15 +180,15 @@ class Document(dict): apply_on = dotdict(self) + self._initialized_with_doc = False + + self.mongokat_collection.update_one({"_id": self["_id"]}, {"$set": data}, **kwargs) + for k, v in data.iteritems(): apply_on[k] = v self.update(dict(apply_on)) - self._initialized_with_doc = False - - self.mongokat_collection.update_one({"_id": self["_id"]}, {"$set": data}, **kwargs) - def __generate_skeleton(self, doc, struct, path=""): for key in struct:
Execute update before applying it to the current document so that any change processed by a before_save trigger will be taken into account
pricingassistant_mongokat
train
py
44b1a4a02b4f3d87143aace5a4d87827180a7f12
diff --git a/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java b/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java +++ b/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java @@ -5,7 +5,6 @@ import hudson.model.DownloadService.Downloadable; import hudson.model.Node; import hudson.model.TaskListener; import net.sf.json.JSONObject; -import org.kohsuke.stapler.DataBoundConstructor; import java.io.IOException; import java.util.Arrays; @@ -26,7 +25,6 @@ import java.net.URL; public abstract class DownloadFromUrlInstaller extends ToolInstaller { public final String id; - @DataBoundConstructor protected DownloadFromUrlInstaller(String id) { // this installer implementation is designed for platform independent binary, // and as such we don't provide the label support
Does not make much sense to put @DataBoundConstructor on an abstract class. (Stapler <I> rejects it, I think correctly.)
jenkinsci_jenkins
train
java
d87d30ef42c71cf78ff5c3ecb3c5149c55562766
diff --git a/metrics-core/src/main/java/com/codahale/metrics/ScheduledReporter.java b/metrics-core/src/main/java/com/codahale/metrics/ScheduledReporter.java index <HASH>..<HASH> 100644 --- a/metrics-core/src/main/java/com/codahale/metrics/ScheduledReporter.java +++ b/metrics-core/src/main/java/com/codahale/metrics/ScheduledReporter.java @@ -172,7 +172,7 @@ public abstract class ScheduledReporter implements Closeable, Reporter { public void run() { try { report(); - } catch (Exception ex) { + } catch (Throwable ex) { LOG.error("Exception thrown from {}#report. Exception was suppressed.", ScheduledReporter.this.getClass().getSimpleName(), ex); } }
Suppress all kinds of Throwables raised by report() (#<I>) See <URL>
dropwizard_metrics
train
java
983201aa814e66949f32282c37f2adc1ea8ee308
diff --git a/lib/IDS/Report.php b/lib/IDS/Report.php index <HASH>..<HASH> 100644 --- a/lib/IDS/Report.php +++ b/lib/IDS/Report.php @@ -100,8 +100,6 @@ class IDS_Report implements Countable, IteratorAggregate { if ($this->hasEvent($name)) { return $this->events[$name]; } - - return false; } /** @@ -231,7 +229,7 @@ class IDS_Report implements Countable, IteratorAggregate { } } - return isset($output) ? $output : ''; + return isset($output) ? $output : false; } }
changed return value of __toString if no events are given
PHPIDS_PHPIDS
train
php
d210e884ac50a3c884d6eb2ef6d8c0448d20794d
diff --git a/lib/geoengineer/resources/aws/rds/aws_rds_cluster_instance.rb b/lib/geoengineer/resources/aws/rds/aws_rds_cluster_instance.rb index <HASH>..<HASH> 100644 --- a/lib/geoengineer/resources/aws/rds/aws_rds_cluster_instance.rb +++ b/lib/geoengineer/resources/aws/rds/aws_rds_cluster_instance.rb @@ -4,7 +4,6 @@ # {https://www.terraform.io/docs/providers/aws/r/db_instance.html Terraform Docs} ######################################################################## class GeoEngineer::Resources::AwsRdsClusterInstance < GeoEngineer::Resource - validate -> { validate_required_attributes([:password, :username, :name]) if new? } validate -> { validate_required_attributes([:db_subnet_group_name]) unless publicly_accessible } validate -> { validate_required_attributes([:cluster_identifier, :instance_class, :engine]) }
Removes invalid fields from aws_rds_cluster_instance This removes the validation to require `name`, `username`, and `password` fields from `aws_rds_cluster_instance`. These are set on `aws_rds_cluster` rather than on the instance itself.
coinbase_geoengineer
train
rb
a93980d73942059b43c1141f66b1de93fcd5fd85
diff --git a/src/Simpleue/Queue/SqsQueue.php b/src/Simpleue/Queue/SqsQueue.php index <HASH>..<HASH> 100644 --- a/src/Simpleue/Queue/SqsQueue.php +++ b/src/Simpleue/Queue/SqsQueue.php @@ -28,6 +28,14 @@ class SqsQueue implements Queue { $this->setQueues($queueName); } + public function setVisibilityTimeout($visibilityTimeout) { + $this->visibilityTimeout = $visibilityTimeout; + } + + public function setMaxWaitingSeconds($maxWaitingSeconds) { + $this->maxWaitingSeconds = $maxWaitingSeconds; + } + public function setSourceQueueUrl($queueUrl) { $this->sourceQueueUrl = $queueUrl; }
Add setters for Visibility Timeout and Max Waiting seconds in SqsQueue client
javibravo_simpleue
train
php
d33762d12f680ed40076867b5d0e46003a0d0fbe
diff --git a/test/commands/trace_test.rb b/test/commands/trace_test.rb index <HASH>..<HASH> 100644 --- a/test/commands/trace_test.rb +++ b/test/commands/trace_test.rb @@ -45,7 +45,7 @@ module Byebug end def test_tracevar_stop_makes_program_stop_when_global_var_changes - enter 'tracevar $VERBOSE stop', 'break 10', 'cont', 'untracevar $VERBOSE' + enter 'tracevar $VERBOSE stop', 'cont 10', 'untracevar $VERBOSE' debug_proc(@example) { assert_equal 8, state.line } end
Consistency with the previous, similar test
deivid-rodriguez_byebug
train
rb
77c022411b119e1685d69d380ba4f88bd81b3a26
diff --git a/src/obj.js b/src/obj.js index <HASH>..<HASH> 100644 --- a/src/obj.js +++ b/src/obj.js @@ -146,7 +146,7 @@ void function (root) { function set_default(obj, key, value, pred) { function valid_keyp(){ return (pred && pred(obj[key], key, obj)) - || !(key in obj) } + || !(hasp(obj, key)) } if (!valid_keyp()) obj[key] = value return obj[key]
src/obj: Makes set-default only care about properties defined directly in the object, in case a predicate function is not given.
sorellabs_black
train
js
c0351143c14c54429c125b90f39b6daf503aa0a1
diff --git a/src/anyconfig/globals/datatypes.py b/src/anyconfig/globals/datatypes.py index <HASH>..<HASH> 100644 --- a/src/anyconfig/globals/datatypes.py +++ b/src/anyconfig/globals/datatypes.py @@ -27,6 +27,6 @@ class IOInfo(typing.NamedTuple): extension: str -IOI_KEYS: typing.Tuple[typing.Optional[typing.Any]] = IOInfo._fields +IOI_KEYS: typing.Tuple[str, ...] = IOInfo._fields # vim:sw=4:ts=4:et:
fix: correct an wrong type hint to .globals.IOI_KEYS
ssato_python-anyconfig
train
py
357e421fe87c21c9cb8252333d4bf5f5d1d26dfa
diff --git a/mwparserfromhell/nodes/text.py b/mwparserfromhell/nodes/text.py index <HASH>..<HASH> 100644 --- a/mwparserfromhell/nodes/text.py +++ b/mwparserfromhell/nodes/text.py @@ -39,6 +39,9 @@ class Text(Node): def __strip__(self, normalize, collapse): return self + def __showtree__(self, write, get, mark): + write(str(self).encode("unicode_escape").decode("utf8")) + @property def value(self): """The actual text itself."""
Text nodes should now appear a bit better in tree form.
earwig_mwparserfromhell
train
py
5d44bea2f4a41d9b932d7cff7ec347a9dd2af0cb
diff --git a/tests/plugins/dns_list_base.js b/tests/plugins/dns_list_base.js index <HASH>..<HASH> 100644 --- a/tests/plugins/dns_list_base.js +++ b/tests/plugins/dns_list_base.js @@ -5,7 +5,7 @@ function _set_up(callback) { this.backup = {}; // needed for tests - this.plugin = Plugin('dns_list_base'); + this.plugin = new Plugin('dns_list_base'); callback(); } @@ -83,13 +83,21 @@ exports.multi = { }; this.plugin.multi('127.0.0.2', 'bl.spamcop.net', cb); }, + 'spamhaus XML': function (test) { + test.expect(1); + var cb = function (err, zone, a, pending) { + test.equal(null, err); + test.done(); + }; + this.plugin.multi('127.0.0.2', 'xbl.spamhaus.org', cb); + }, 'spamcop + spamhaus XBL': function (test) { test.expect(6); var cb = function (err, zone, a, pending) { test.equal(null, err); test.ok(zone); test.ok(a); - if (0===pending) { + if (pending === 0) { test.done(); } };
add another test to dns_list_base to determine if the issue is with XML or multi
haraka_Haraka
train
js
c2b95efcc87005fca76803ea926267e9ed15a2df
diff --git a/lib/juvet/configuration.rb b/lib/juvet/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/juvet/configuration.rb +++ b/lib/juvet/configuration.rb @@ -4,6 +4,7 @@ require_relative "configuration/mapping" module Juvet class Configuration def adapter(options=nil) + return @adapter if options.nil? @adapter ||= Juvet::Configuration::Adapter.new(options) end diff --git a/spec/juvet/configuration_spec.rb b/spec/juvet/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/juvet/configuration_spec.rb +++ b/spec/juvet/configuration_spec.rb @@ -2,7 +2,7 @@ describe Juvet::Configuration do subject { described_class.new } it "has a default repository adapter" do - expect(subject.adapter).to be_instance_of Juvet::Configuration::Adapter + expect(subject.adapter({})).to be_instance_of Juvet::Configuration::Adapter end it "has a default mapping" do @@ -13,12 +13,13 @@ describe Juvet::Configuration do subject { described_class.new } it "builds the mapping" do + subject.adapter({}) expect(subject.mapping).to receive(:build).and_call_original subject.load! end it "builds the adapter" do - expect(subject.adapter).to receive(:build).with(Juvet::Mapper) + expect(subject.adapter({})).to receive(:build).with(Juvet::Mapper) subject.load! end end
Return the adapter if the options are not passed in
tatsuio_juvet
train
rb,rb
e5fe2e64710c4b21fdbbcee4813b19ffb7343741
diff --git a/test/common/compute/server-test.js b/test/common/compute/server-test.js index <HASH>..<HASH> 100644 --- a/test/common/compute/server-test.js +++ b/test/common/compute/server-test.js @@ -241,9 +241,7 @@ JSON.parse(fs.readFileSync(__dirname + '/../../configs/providers.json')) JSON.parse(helpers.loadFixture('rackspace/auth.json'))); nock('https://' + client.serversUrl) .get('/v1.0/537645/flavors/detail.json') - .reply(200, helpers.loadFixture('rackspace/flavors.json'), {}) - .get('/v1.0/537645/flavors/detail.json') - .reply(200, helpers.loadFixture('rackspace/flavors.json'), {}) + .reply(200, helpers.loadFixture('rackspace/serverFlavors.json'), {}) .get('/v1.0/537645/images/detail.json') .reply(200, helpers.loadFixture('rackspace/images.json'), {}) .get('/v1.0/537645/images/detail.json')
[tests] change to use the serversFlavors and not flavors for databases
pkgcloud_pkgcloud
train
js
18b06c47598246568af3bdeb1f69e85f270be78e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,8 @@ ext_modules = [ Extension('phoebe.algorithms.cmarching', sources=['phoebe/algorithms/mrch.c'], libraries = ['m']), + Extension('phoebe.atmospheres.froche', + sources=['phoebe/atmospheres/froche.f']), ] setup(
Added Extension for froche to setup.py
phoebe-project_phoebe2
train
py
bcc99e2179ff0ecfcfae4f550c6cbaca02a2c1cd
diff --git a/src/modules/livestatus_broker/livestatus.py b/src/modules/livestatus_broker/livestatus.py index <HASH>..<HASH> 100644 --- a/src/modules/livestatus_broker/livestatus.py +++ b/src/modules/livestatus_broker/livestatus.py @@ -133,7 +133,7 @@ class LiveStatus: 'retry_interval' : { }, 'scheduled_downtime_depth' : { 'converter' : int }, 'state' : { 'converter' : int, 'prop' : 'state_id' }, - 'state_type' : { 'converter' : int }, + 'state_type' : { 'converter' : int, 'prop' : 'state_type_id' }, 'statusmap_image' : { }, 'total_services' : { }, 'worst_service_hard_state' : { }, @@ -298,7 +298,7 @@ class LiveStatus: 'retry_interval' : { }, 'scheduled_downtime_depth' : { 'converter' : int }, 'state' : { 'converter' : int, 'prop' : 'state_id' }, - 'state_type' : { 'converter' : int }, + 'state_type' : { 'converter' : int, 'prop' : 'state_type_id' }, }, Contact : { # in progress
*Fix a bug in livestatus. state_type is now a number instead of HARD/SOFT
Alignak-monitoring_alignak
train
py
455350176c87a53e1eab8ae849370b1938cfbb58
diff --git a/routes/account.js b/routes/account.js index <HASH>..<HASH> 100644 --- a/routes/account.js +++ b/routes/account.js @@ -168,7 +168,11 @@ function accountRoutes (server, options, next) { method: 'DELETE', path: '/session/account', config: { - auth: false + auth: false, + validate: { + query: validations.accountQuery, + failAction: joiFailAction + } }, handler: function (request, reply) { var sessionId = toBearerToken(request)
fix(routes): DELETE /session/account?include=foobar * * * This commit was sponsored by Neighbourhoodie You can hire Neighbourhoodie for all your Hoodie / CouchDB / Offline First needs <URL>
hoodiehq_hoodie-account-server
train
js
e7195380e1b0eba3e3f680d3ab0482005bb0ef8c
diff --git a/pandas/tests/window/test_expanding.py b/pandas/tests/window/test_expanding.py index <HASH>..<HASH> 100644 --- a/pandas/tests/window/test_expanding.py +++ b/pandas/tests/window/test_expanding.py @@ -137,6 +137,14 @@ def test_expanding_count_default_min_periods_with_null_values(constructor): tm.assert_equal(result, expected) [email protected]("constructor", [Series, DataFrame]) +def test_expanding_count_with_min_periods_exceeding_series_length(constructor): + # GH 25857 + result = constructor(range(5)).expanding(min_periods=6).count() + expected = constructor([np.nan, np.nan, np.nan, np.nan, np.nan]) + tm.assert_equal(result, expected) + + @pytest.mark.parametrize( "df,expected,min_periods", [
TST: test for expanding window with min_periods GH<I> (#<I>)
pandas-dev_pandas
train
py
cb7d2cf8083c9796527a40ec2f3dcfd055dac324
diff --git a/rrrspec-client/lib/rrrspec.rb b/rrrspec-client/lib/rrrspec.rb index <HASH>..<HASH> 100644 --- a/rrrspec-client/lib/rrrspec.rb +++ b/rrrspec-client/lib/rrrspec.rb @@ -3,7 +3,7 @@ require 'active_support/core_ext' require 'active_support/time' require 'socket' require 'logger' -Time.zone_default = Time.find_zone!('Asia/Tokyo') +Time.zone_default = Time.find_zone!(Time.now.zone) require 'rrrspec/configuration' require 'rrrspec/redis_models'
Changing default time zone from 'Asia/Tokyo' to system time zone.
cookpad_rrrspec
train
rb
e46f74c16f77bf8aad6fa2db8a3b7a1761da3850
diff --git a/ballet/eng/misc.py b/ballet/eng/misc.py index <HASH>..<HASH> 100644 --- a/ballet/eng/misc.py +++ b/ballet/eng/misc.py @@ -3,6 +3,7 @@ import numpy as np import pandas as pd from scipy.special import boxcox1p from scipy.stats import skew +from sklearn.preprocessing import FunctionTransformer from sklearn.utils.validation import check_is_fitted from ballet.eng.base import ( @@ -17,11 +18,12 @@ __all__ = [ ] -class IdentityTransformer(SimpleFunctionTransformer): +class IdentityTransformer(FunctionTransformer): """Simple transformer that passes through its input""" def __init__(self): - super().__init__(funcy.identity) + super().__init__(func=funcy.identity, inverse_func=funcy.identity, + validate=False, check_inverse=False) class BoxCoxTransformer(ConditionalTransformer):
Implement IdentityTransformer using FunctionTransformer Get access to inverse_transform
HDI-Project_ballet
train
py
b708fdf7d3e3cdf49c49b8a087f548b72658459e
diff --git a/spec/dummy/db/seeds.rb b/spec/dummy/db/seeds.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/db/seeds.rb +++ b/spec/dummy/db/seeds.rb @@ -1,5 +1,5 @@ NoCms::Pages::Page.delete_all -NoCms::Pages::Block.delete_all +NoCms::Blocks::Block.delete_all NoCms::Pages::Page.create!( title: Faker::Lorem.sentence,
Change NoCms::Pages::Block by NoCms::Blocks::Block Delete nocms-blocks instead nocms-pages blocks on dummy app's seeds
simplelogica_nocms-pages
train
rb
776eaea3c81f01d4d37142ce462dbfa1b96707b3
diff --git a/src/FactoryTrait.php b/src/FactoryTrait.php index <HASH>..<HASH> 100644 --- a/src/FactoryTrait.php +++ b/src/FactoryTrait.php @@ -65,7 +65,7 @@ trait FactoryTrait $object = $this->normalizeClassName($object); - return new $object($defaults); + return $this->factory(new $object(), $defaults); } /**
didn't pass defaults to factory if object is classname
atk4_core
train
php
904cc121b83ecfaacba25433a7911a2541b2c312
diff --git a/docs/exts/docs_build/third_party_inventories.py b/docs/exts/docs_build/third_party_inventories.py index <HASH>..<HASH> 100644 --- a/docs/exts/docs_build/third_party_inventories.py +++ b/docs/exts/docs_build/third_party_inventories.py @@ -24,7 +24,7 @@ THIRD_PARTY_INDEXES = { 'mongodb': 'https://pymongo.readthedocs.io/en/3.11.3', 'pandas': 'https://pandas.pydata.org/pandas-docs/stable', 'python': 'https://docs.python.org/3', - 'requests': 'https://requests.readthedocs.io/en/master', + 'requests': 'https://requests.readthedocs.io/en/stable', 'sqlalchemy': 'https://docs.sqlalchemy.org/en/latest', 'google-api-core': 'https://googleapis.dev/python/google-api-core/latest', 'google-cloud-automl': 'https://googleapis.dev/python/automl/latest',
Change requests intersphinx inventory to 'stable' (#<I>) It was using 'master', but the URL is no longer available. We could use 'main', but 'stable' seems much more sensible.
apache_airflow
train
py
ef2f6e0375990f77d95526d37185a4e351dc59c3
diff --git a/core/src/main/java/fr/putnami/pwt/core/widget/client/TableColumn.java b/core/src/main/java/fr/putnami/pwt/core/widget/client/TableColumn.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/fr/putnami/pwt/core/widget/client/TableColumn.java +++ b/core/src/main/java/fr/putnami/pwt/core/widget/client/TableColumn.java @@ -38,6 +38,8 @@ public class TableColumn<T> extends AbstractTableColumn<T> implements private String path; + private String headerText; + public TableColumn() { } @@ -86,6 +88,7 @@ public class TableColumn<T> extends AbstractTableColumn<T> implements TableEditorTH<T> headerCell = new TableEditorTH<T>(); headerCell.setPath(path); headerCell.setColspan(getColspan()); + headerCell.setText(headerText); for (AbstractTableColumnAspect aspect : getAspects()) { if (aspect.getColumnPath() == null) { aspect.setColumnPath(path); @@ -115,6 +118,10 @@ public class TableColumn<T> extends AbstractTableColumn<T> implements add((IsWidget) child); } + public void setHeaderText(String headerText) { + this.headerText = headerText; + } + @Override public void clear() { throw new UnsupportedOperationException("TableColumn does not support clear()");
[core][feature] Set Table column header text
Putnami_putnami-web-toolkit
train
java
e477115b1a81ff826ac1464eb818872ad884b5f2
diff --git a/nodeshot/interoperability/models/layer_external.py b/nodeshot/interoperability/models/layer_external.py index <HASH>..<HASH> 100755 --- a/nodeshot/interoperability/models/layer_external.py +++ b/nodeshot/interoperability/models/layer_external.py @@ -72,6 +72,7 @@ class LayerExternal(models.Model): raise ValidationError(_('Required config key "%s" missing from external layer configuration' % key)) try: + self.synchronizer.config = config self.synchronizer.clean() except ImproperlyConfigured as e: raise ValidationError(e.message)
interoperability: load new config before validating
ninuxorg_nodeshot
train
py
ea64b5127c25cfe70b1fff2a6fea032125b42363
diff --git a/mmcv/cnn/bricks/conv.py b/mmcv/cnn/bricks/conv.py index <HASH>..<HASH> 100644 --- a/mmcv/cnn/bricks/conv.py +++ b/mmcv/cnn/bricks/conv.py @@ -35,7 +35,7 @@ def build_conv_layer(cfg, *args, **kwargs): layer_type = cfg_.pop('type') if layer_type not in CONV_LAYERS: - raise KeyError(f'Unrecognized norm type {layer_type}') + raise KeyError(f'Unrecognized layer type {layer_type}') else: conv_layer = CONV_LAYERS.get(layer_type)
fix typo in conv.py (#<I>) Fix typo in conv.py.
open-mmlab_mmcv
train
py
5dcdeb6bae045e712f4df6f4b79799db7365f726
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ if cffi: setup( name='zstandard', - version='0.0.1', + version='0.1', description='Zstandard bindings for Python', long_description=open('README.rst', 'r').read(), url='https://github.com/indygreg/python-zstandard',
Bump release to <I>
indygreg_python-zstandard
train
py
4f1ea444f4bfdb7cd80ba9ab40f0a4b4f1a57741
diff --git a/data/php b/data/php index <HASH>..<HASH> 100755 --- a/data/php +++ b/data/php @@ -49,7 +49,7 @@ $applyMapping = function ($argument) use ($projectDirHost, $projectDirGuest, $ho if (!is_dir($homeDirHost . '/scripts/')) { mkdir($homeDirHost . '/scripts/', 0777, true); } - if (!is_dir($filePath)) { + if (is_file($filePath)) { copy($filePath, $homeDirHost . '/scripts/' . basename($filePath)); } $argument = $homeDirGuest . '/scripts/' . basename($filePath);
use is_file instead of is_dir to check if a path is a file that should be copied to the guest-machine
cargomedia_vagrant-phpstorm-tunnel
train
php