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
548733302c6b74b8a03387b0bdb011ff89aadc35
diff --git a/signalk-on-delta.js b/signalk-on-delta.js index <HASH>..<HASH> 100644 --- a/signalk-on-delta.js +++ b/signalk-on-delta.js @@ -5,9 +5,26 @@ module.exports = function(RED) { var node = this; var signalk = node.context().global.get('signalk') + var app = node.context().global.get('app') function on_delta(delta) { - node.send({ payload: delta }) + if ( delta.updates ) { + var copy = JSON.parse(JSON.stringify(delta)) + copy.updates = [] + delta.updates.forEach(update => { + if ( update.values && + (!update.$source || !update.$source.startsWith('signalk-node-red') )) { + copy.updates.push(update) + } + }) + + if ( copy.updates.length > 0 ) { + if ( copy.context == app.selfContext ) { + copy.context = 'vessels.self' + } + node.send({ payload: copy }) + } + } } signalk.on('delta', on_delta)
feature: filter out meta deltas and deltas from node red
SignalK_node-red-embedded
train
js
62b7533aa7747fa7c6c582b474f666a042a76327
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,8 @@ function checkDirectory(dir, ignoreDirs, deps, devDeps, options) { }); finder.on("file", function (filename) { - if (path.extname(filename) === ".js") { + var ext = path.extname(filename); + if (options.extensions.indexOf(ext) !== -1) { var modulesRequired = getModulesRequiredFromFilename(filename, options); if (util.isError(modulesRequired)) { invalidFiles[filename] = modulesRequired; @@ -111,6 +112,7 @@ function depCheck(rootDir, options, cb) { var pkg = options.package || require(path.join(rootDir, 'package.json')); var deps = filterDependencies(pkg.dependencies); var devDeps = filterDependencies(options.withoutDev ? [] : pkg.devDependencies); + options.extensions = options.extensions || ['.js']; var ignoreDirs = _([ '.git', '.svn',
Accept the extensions argument passed from options.
depcheck_depcheck
train
js
bab83c25bc6b0b897b1fa13e6fcea8bbbc9c87bd
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -20,7 +20,7 @@ var CodeMirror = (function() { // This mess creates the base DOM structure for the editor. wrapper.innerHTML = '<div style="overflow: hidden; position: relative; width: 1px; height: 0px;">' + // Wraps and hides input textarea - '<textarea style="position: absolute; width: 2px;" wrap="off" ' + + '<textarea style="position: absolute; width: 10000px;" wrap="off" ' + 'autocorrect="off" autocapitalize="off"></textarea></div>' + '<div class="CodeMirror-scroll cm-s-' + options.theme + '">' + '<div style="position: relative">' + // Set to the height of the text, causes scrolling
Make hidden textarea wide again This fixes (mostly) vertical cursor movement in IE
codemirror_CodeMirror
train
js
d17fa12524f8af1662aa03d043bb996f5d386a9a
diff --git a/domains/toolabstraction/maven/src/test/java/org/openengsb/maven/common/test/unit/TestMavenConnector.java b/domains/toolabstraction/maven/src/test/java/org/openengsb/maven/common/test/unit/TestMavenConnector.java index <HASH>..<HASH> 100755 --- a/domains/toolabstraction/maven/src/test/java/org/openengsb/maven/common/test/unit/TestMavenConnector.java +++ b/domains/toolabstraction/maven/src/test/java/org/openengsb/maven/common/test/unit/TestMavenConnector.java @@ -23,10 +23,12 @@ import java.util.Properties; import junit.framework.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.openengsb.maven.common.MavenConnector; import org.openengsb.maven.common.MavenResult; +@Ignore("tests do not run on hudson - locally they should run without any problems") public class TestMavenConnector { private Properties executionRequestProperties;
Set toolabstraction tests to ignore because they do not work on hudson.
openengsb_openengsb
train
java
2736dd6bf5912e83a7149b6344a0afda1e2cf3be
diff --git a/templates/includes/footer.php b/templates/includes/footer.php index <HASH>..<HASH> 100644 --- a/templates/includes/footer.php +++ b/templates/includes/footer.php @@ -16,7 +16,7 @@ if(!empty($this->data['htmlinject']['htmlContentPost'])) { <hr /> <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right" /> - Copyright &copy; 2007-2009 <a href="http://rnd.feide.no/">Feide RnD</a> + Copyright &copy; 2007-2010 <a href="http://rnd.feide.no/">Feide RnD</a> <br style="clear: right" />
Update copyright year in footer.
simplesamlphp_saml2
train
php
bf10808c1619fba6ac18104c99afd333ef78fa61
diff --git a/src/Crate/PDO/ArtaxExt/ClientInterface.php b/src/Crate/PDO/ArtaxExt/ClientInterface.php index <HASH>..<HASH> 100644 --- a/src/Crate/PDO/ArtaxExt/ClientInterface.php +++ b/src/Crate/PDO/ArtaxExt/ClientInterface.php @@ -27,6 +27,24 @@ use Artax\Response; interface ClientInterface { /** + * Set the URI + * + * @param string $uri + * + * @return void + */ + public function setUri($uri); + + /** + * Set the connection timeout + * + * @param int $timeout + * + * @return void + */ + public function setTimeout($timeout); + + /** * Execute the PDOStatement and return the response from server * * @param string $queryString
Reverted the removal of the methods in the ClientInterface because they broke a test
crate_crate-pdo
train
php
5c5345e78c1eb8d937216b155f3ffa8b8f905959
diff --git a/ryu/tests/integrated/common/docker_base.py b/ryu/tests/integrated/common/docker_base.py index <HASH>..<HASH> 100644 --- a/ryu/tests/integrated/common/docker_base.py +++ b/ryu/tests/integrated/common/docker_base.py @@ -133,7 +133,7 @@ class Command(object): if out.returncode == 0: return out LOG.error(out.stderr) - if try_times + 1 >= try_times: + if i + 1 >= try_times: break time.sleep(interval) raise CommandError(out)
scenario test: Fix the wrong retry check in command execution
osrg_ryu
train
py
fc3fe3d71d77319b742d2e27179008ba0c27ac68
diff --git a/src/main/java/org/spout/nbt/stream/NBTInputStream.java b/src/main/java/org/spout/nbt/stream/NBTInputStream.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/spout/nbt/stream/NBTInputStream.java +++ b/src/main/java/org/spout/nbt/stream/NBTInputStream.java @@ -190,7 +190,7 @@ public final class NBTInputStream implements Closeable { length = is.readInt(); Class<? extends Tag> clazz = childType.getTagClass(); - List<Tag> tagList = new ArrayList<Tag>(); + List<Tag> tagList = new ArrayList<Tag>(length); for (int i = 0; i < length; i++) { Tag tag = readTagPayload(childType, "", depth + 1); if (tag instanceof EndTag) {
Pre-sizes the arraylist for list tag to the given length
flow_nbt
train
java
9a5bde94e390634d00de88c479a992f561899d06
diff --git a/lib/active-profiling/ruby_profiler.rb b/lib/active-profiling/ruby_profiler.rb index <HASH>..<HASH> 100644 --- a/lib/active-profiling/ruby_profiler.rb +++ b/lib/active-profiling/ruby_profiler.rb @@ -14,7 +14,7 @@ module ActiveProfiling # * :disable_gc - temporarily disable the garbage collector for the # duration of the profiling session. The default is false. def ruby_profiler(options = {}) - return yield unless defined?(RubyProf) + return [ yield, nil ] unless defined?(RubyProf) options = { :measure_mode => RubyProf::PROCESS_TIME,
Return an Array even when we don't have RubyProf available.
dark-panda_active-profiling
train
rb
beb07fd2e481a27a7f802da4ae8a00e86ab47d1a
diff --git a/lib/fb_graph/connections/settings.rb b/lib/fb_graph/connections/settings.rb index <HASH>..<HASH> 100644 --- a/lib/fb_graph/connections/settings.rb +++ b/lib/fb_graph/connections/settings.rb @@ -51,6 +51,7 @@ module FbGraph :connection => :settings ) if succeeded + @settings ||= [] if value @settings << setting.to_sym else
@settings can be nil here
nov_fb_graph
train
rb
56dcab4bcc463aa00bc6ac64005dfca6c0777ded
diff --git a/lib/gem_footprint_analyzer/require_spy.rb b/lib/gem_footprint_analyzer/require_spy.rb index <HASH>..<HASH> 100644 --- a/lib/gem_footprint_analyzer/require_spy.rb +++ b/lib/gem_footprint_analyzer/require_spy.rb @@ -102,9 +102,10 @@ module GemFootprintAnalyzer # we're redirecting :require_relative to the regular :require kernels.each do |k| k.send :define_method, :require_relative do |name| + return require(name) if name.start_with?('/') + last_caller = caller(1..1).first relative_path = GemFootprintAnalyzer::RequireSpy.relative_path(last_caller, name) - require(relative_path) end end
Fix the spied version of require_relative So that it returns early when passed an absolute directory as a name.
irvingwashington_gem_footprint_analyzer
train
rb
49fd7b06ebd8759a815065d493db258104b91bee
diff --git a/resource_aws_s3_bucket_test.go b/resource_aws_s3_bucket_test.go index <HASH>..<HASH> 100644 --- a/resource_aws_s3_bucket_test.go +++ b/resource_aws_s3_bucket_test.go @@ -645,14 +645,20 @@ func testAccCheckAWSS3BucketPolicy(n string, policy string) resource.TestCheckFu Bucket: aws.String(rs.Primary.ID), }) - if err != nil { - if policy == "" { + if policy == "" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucketPolicy" { // expected return nil + } + if err == nil { + return fmt.Errorf("Expected no policy, got: %#v", *out.Policy) } else { return fmt.Errorf("GetBucketPolicy error: %v, expected %s", err, policy) } } + if err != nil { + return fmt.Errorf("GetBucketPolicy error: %v, expected %s", err, policy) + } if v := out.Policy; v == nil { if policy != "" {
provider/aws: Fix s3_bucket test for empty policy
terraform-providers_terraform-provider-aws
train
go
04dcc9378dc38d54eeb6a688d81e8b5e13446519
diff --git a/params/version.go b/params/version.go index <HASH>..<HASH> 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 10 // Minor version component of the current release - VersionPatch = 2 // Patch version component of the current release - VersionMeta = "stable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 10 // Minor version component of the current release + VersionPatch = 3 // Patch version component of the current release + VersionMeta = "unstable" // Version metadata to append to the version string ) // Version holds the textual version string.
params: begin <I> release cycle
ethereum_go-ethereum
train
go
29bb2409662399a5c5a8fb85285792467cb4f99a
diff --git a/docs/src/Iconography.js b/docs/src/Iconography.js index <HASH>..<HASH> 100644 --- a/docs/src/Iconography.js +++ b/docs/src/Iconography.js @@ -37,7 +37,7 @@ const IconList = props => hoverColor="blue" > <Flex mb={2} align="center" justify="center"> - <Icon name={icon} size={48} /> + <Icon name={icon} legacy={false} size={48} /> </Flex> </BlockLink> <Text align="center">
Only show new icons in docs
jrs-innovation-center_design-system
train
js
7c327a49fc4590cc61188b8c524ba33b14e96c21
diff --git a/src/Framework/BaseWebApplication.php b/src/Framework/BaseWebApplication.php index <HASH>..<HASH> 100644 --- a/src/Framework/BaseWebApplication.php +++ b/src/Framework/BaseWebApplication.php @@ -723,6 +723,7 @@ abstract class BaseWebApplication extends BaseConsoleApplication implements Fram return; } $app['current_user'] = $app['user']; + $request->attributes->set('current_user', $app['user']); $app['twig']->addGlobal('current_user', $app['user']); $request->attributes->set('current_username', $app['user']->getUsername()); });
Set current_user in request attributes (to detach from application)
Radvance_Radvance
train
php
f6309ea8cc38bec37898ea2eb60502d9bf5d3eba
diff --git a/modules/page/html/render/message.js b/modules/page/html/render/message.js index <HASH>..<HASH> 100644 --- a/modules/page/html/render/message.js +++ b/modules/page/html/render/message.js @@ -68,7 +68,7 @@ exports.create = function (api) { var rootMessage = {key: id, value} - // what happens in private stays in private! + // Apply the recps of the original root message to all replies. What happens in private stays in private! meta.recps.set(value.content.recps) var root = api.message.sync.root(rootMessage) || id
add comment about deriving recps on private message replies
ssbc_patchwork
train
js
86aa4f8cdf77fcfb1a998866732290ae4f7a7b9e
diff --git a/cfgstack/cfgstack.py b/cfgstack/cfgstack.py index <HASH>..<HASH> 100644 --- a/cfgstack/cfgstack.py +++ b/cfgstack/cfgstack.py @@ -77,7 +77,8 @@ class CfgStack (object): if isinstance (include, list): for f in include: for k, v in CfgStack ( - f, no_defaults = True).data.items (): + f, dirs = self.dirs, exts = self.exts, + no_defaults = True).data.items (): if isinstance (d.get (k), dict) and isinstance (v, dict): _dictmerge (d[k], v) else:
Pass search path when recursing
clearclaw_cfgstack
train
py
fe29964a8862aab20b48a2f7b13e2b92290b627a
diff --git a/lib/__internal/utils.js b/lib/__internal/utils.js index <HASH>..<HASH> 100644 --- a/lib/__internal/utils.js +++ b/lib/__internal/utils.js @@ -165,7 +165,7 @@ const serializeVariable = ({ key, typedValue }) => { } if (type === "date" && value instanceof Date) { - value = value.toISOString().replace(/Z$/, "UTC+00:00"); + value = value.toISOString().replace(/Z$/, "+0000"); } return { ...typedValue, value, type }; diff --git a/lib/__internal/utils.test.js b/lib/__internal/utils.test.js index <HASH>..<HASH> 100644 --- a/lib/__internal/utils.test.js +++ b/lib/__internal/utils.test.js @@ -267,7 +267,7 @@ describe("utils", () => { it("value should be converted to proper formatted string if type is date and value is an instance of date", () => { // given let dateStr = "2013-06-30T21:04:22.000+0200"; - let formattedDate = "2013-06-30T19:04:22.000UTC+00:00"; + let formattedDate = "2013-06-30T19:04:22.000+0000"; let dateObj = new Date(dateStr); let typedValue = { value: dateObj,
fix(serialization): adjust Date format related to CAM-<I>
camunda_camunda-external-task-client-js
train
js,js
0f8864f27fdb27fedcaca33f72f48981155b472e
diff --git a/leaflet-providers.js b/leaflet-providers.js index <HASH>..<HASH> 100644 --- a/leaflet-providers.js +++ b/leaflet-providers.js @@ -205,7 +205,7 @@ } }, Stamen: { - url: 'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.{ext}', + url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.png', options: { attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
https for Stamen (#<I> without the merge commit)
leaflet-extras_leaflet-providers
train
js
31845cd077e07d8bfb699f10ccca443798ebf45f
diff --git a/src/Common/Traits/TransientMutator.php b/src/Common/Traits/TransientMutator.php index <HASH>..<HASH> 100644 --- a/src/Common/Traits/TransientMutator.php +++ b/src/Common/Traits/TransientMutator.php @@ -8,7 +8,7 @@ * @license Apache 2.0 */ -namespace Chemem\Bingo\Functional\Common\Applicatives; +namespace Chemem\Bingo\Functional\Common\Traits; trait TransientMutator {
Replaced common/applicatives with common/traits
ace411_bingo-functional
train
php
519dc08132644d53d17f4257d5b2a77ef5d61395
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,12 +1,8 @@ #!/usr/bin/env python from os.path import exists -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +from setuptools import setup, find_packages -from setuptools import find_packages from tz_detect import __version__ setup(
Updating setup.py to use setuptools exclusively (as per recent seed changes)
adamcharnock_django-tz-detect
train
py
90d5b373b1144b1cbabe20434ecfb8f10dcfcf4f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- from setuptools import setup -from codecs import open from os import path +from io import open here = path.abspath(path.dirname(__file__)) @@ -11,8 +11,8 @@ with open(path.join(here, 'anpy', '__version.py')) as __version: exec(__version.read()) assert __version__ is not None -with open(path.join(here, 'README.md')) as readme: - LONG_DESC = readme.read().decode('utf-8') +with open(path.join(here, 'README.md'), encoding='utf-8') as readme: + LONG_DESC = readme.read() setup( name='anpy',
Make setup.py compatible with python 3
regardscitoyens_anpy
train
py
228468a11241eec5a9286cd1c440cc40f5d4780b
diff --git a/daemon.go b/daemon.go index <HASH>..<HASH> 100644 --- a/daemon.go +++ b/daemon.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. /* -Package daemon 0.1.2 for use with Go (golang) services. +Package daemon 0.1.3 for use with Go (golang) services. Package daemon provides primitives for daemonization of golang services. This package is not provide implementation of user daemon,
Bumped version number to <I>
takama_daemon
train
go
1dadba7c2a1bb2c06530e879b75e855338071c8c
diff --git a/app/controllers/katello/api/v2/systems_controller.rb b/app/controllers/katello/api/v2/systems_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/katello/api/v2/systems_controller.rb +++ b/app/controllers/katello/api/v2/systems_controller.rb @@ -158,6 +158,7 @@ class Api::V2::SystemsController < Api::V2::ApiController @system = System.new(system_params(params).merge(:environment => @environment, :content_view => @content_view)) sync_task(::Actions::Headpin::System::Create, @system) + @system.reload respond_for_create end
Reload system after orchestration is finished
Katello_katello
train
rb
df4dfc36e7f08ba3a23556faa36827d79903c8c7
diff --git a/lib/vagrant/machine_index.rb b/lib/vagrant/machine_index.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/machine_index.rb +++ b/lib/vagrant/machine_index.rb @@ -43,7 +43,7 @@ module Vagrant def initialize(data_dir) @data_dir = data_dir @index_file = data_dir.join("index") - @lock = Mutex.new + @lock = Monitor.new @machines = {} @machine_locks = {}
MachineIndex lock is a monitor to allow recursion
hashicorp_vagrant
train
rb
e9dfcc59d5e23cb2369cdb7d05270090baa6bf91
diff --git a/lxd/container_test.go b/lxd/container_test.go index <HASH>..<HASH> 100644 --- a/lxd/container_test.go +++ b/lxd/container_test.go @@ -138,7 +138,10 @@ func (suite *containerTestSuite) TestContainer_LoadFromDB() { suite.Req.Nil(err) // When loading from DB, we won't have a full LXC config + c.(*containerLXC).c = nil c.(*containerLXC).cConfig = false + c2.(*containerLXC).c = nil + c2.(*containerLXC).cConfig = false suite.Exactly( c,
lxd/containers: Don't diff go-lxc structs
lxc_lxd
train
go
e7fa7fc40f5c6f75dc1c2013678c3d44c4924056
diff --git a/openquake/calculators/extract.py b/openquake/calculators/extract.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/extract.py +++ b/openquake/calculators/extract.py @@ -202,13 +202,16 @@ def extract_realizations(dstore, dummy): @extract.add('tagcollection') def extract_tagcollection(dstore, what): """ - Extract the tag collection (/extract/tagcollection). + Extract the tag collection (/extract/tagcollection) + and the loss categories. """ dic = {} dic1, dic2 = dstore['assetcol/tagcol'].__toh5__() dic.update(dic1) dic.update(dic2) - return ArrayWrapper((), dic) + array = [name for name in dstore['assetcol/array'].dtype.names + if name.startswith(('value-', 'number', 'occupants_'))] + return ArrayWrapper(array, dic) @extract.add('assets')
While extracting the tagcollection, also extract loss categories Former-commit-id: <I>e6ff5f<I>f9d<I>c4ef9ffa<I>ab9b<I>eea9
gem_oq-engine
train
py
f697b42e7e90271990c829c034f7c2e9d4071ce1
diff --git a/pylp/lib/dest.py b/pylp/lib/dest.py index <HASH>..<HASH> 100644 --- a/pylp/lib/dest.py +++ b/pylp/lib/dest.py @@ -14,9 +14,9 @@ from pylp.lib.transformer import Transformer -def dest(path, **options): - return FileWriter(path, **options) +def dest(path, cwd = None): """Return a transformer that writes contents to local files.""" + return FileWriter(path, cwd) @@ -45,11 +45,11 @@ def write_file(path, contents): class FileWriter(Transformer): """Transformer that saves contents to local files.""" - def __init__(self, path, **options): + def __init__(self, path, cwd = None): super().__init__() self.dest = path - self.cwd = options.get('cwd') + self.cwd = cwd self.exe = ThreadPoolExecutor() self.loop = asyncio.get_event_loop()
Make second argument of 'pylp.dest' more explicit
pylp_pylp
train
py
86c14bf156edf850170f9f220d95b2aa36493def
diff --git a/app/models/ping.rb b/app/models/ping.rb index <HASH>..<HASH> 100644 --- a/app/models/ping.rb +++ b/app/models/ping.rb @@ -18,6 +18,14 @@ class Ping class << self OK_RETURN_CODE = 'ok' + PACKAGES = ["katello", + "candlepin", + "pulp", + "thumbslug", + "qpid", + "ldap_fluff", + "elasticsearch", + "foreman"] # # Calls "status" services in all backend engines. @@ -107,7 +115,8 @@ class Ping # get package information for katello and its components def packages - packages = `rpm -qa | egrep "katello|candlepin|pulp|thumbslug|qpid|foreman|ldap_fluff"` + names = PACKAGES.join("|") + packages = `rpm -qa | egrep "#{names}"` packages.split("\n").sort end end
Add elasticsearch package to ping information
Katello_katello
train
rb
0eee6ad9b73d4dadb41042de92a746a0dce28090
diff --git a/gphoto2cffi/gphoto2.py b/gphoto2cffi/gphoto2.py index <HASH>..<HASH> 100644 --- a/gphoto2cffi/gphoto2.py +++ b/gphoto2cffi/gphoto2.py @@ -391,7 +391,7 @@ class File(object): lib.gp_camera_file_get_info( self._cam._cam, self.directory.path.encode(), self.name.encode(), self.__info, self._cam._ctx) - lib.gp_camera_exit(self._cam, self._ctx) + lib.gp_camera_exit(self._cam._cam, self._cam._ctx) except errors.GPhoto2Error: raise ValueError("Could not get file info, are you sure the " "file exists on the device?")
Fix bug that arose when quering a File for its size
jbaiter_gphoto2-cffi
train
py
11d703fbf138caf5b6437f3c0c7c9e2239b95ec6
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -1448,6 +1448,8 @@ another: } func (me *Client) sendChunk(t *torrent, c *connection, r request) error { + // Count the chunk being sent, even if it isn't. + c.chunksSent++ b := make([]byte, r.Length) tp := t.Pieces[r.Index] tp.pendingWritesMutex.Lock() @@ -1470,7 +1472,6 @@ func (me *Client) sendChunk(t *torrent, c *connection, r request) error { Piece: b, }) uploadChunksPosted.Add(1) - c.chunksSent++ c.lastChunkSent = time.Now() return nil }
Count failed chunk sends against a connection
anacrolix_torrent
train
go
bd733c6635478fb8d0c3ff970a85d8e4fbe9e2ba
diff --git a/spec/ascii_plist/reader_spec.rb b/spec/ascii_plist/reader_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ascii_plist/reader_spec.rb +++ b/spec/ascii_plist/reader_spec.rb @@ -46,6 +46,21 @@ module AsciiPlist end end + describe 'reading annotations' do + let(:string) { '{a /*annotation*/ = ( b /*another annotation*/ )' } + let(:reader) { Reader.new(string) } + subject { reader.parse!.root_object } + + xit 'should read the annotations correctly' do + expect(subject).to eq AsciiPlist::Dictionary.new({ + AsciiPlist::String.new('a', 'annotation') => + AsciiPlist::Array.new([ + AsciiPlist::String.new('b', 'another annotation') + ]) + }, '') + end + end + describe 'reading root level dictionaries' do let(:string) { '{a = "a";"b" = b;"c" = "c"; d = d;}' }
Add failing spec for reading annotations
CocoaPods_Nanaimo
train
rb
5c301dd9b189ebf0923c23898c69b6d81c68c331
diff --git a/proctl/proctl_linux_amd64.go b/proctl/proctl_linux_amd64.go index <HASH>..<HASH> 100644 --- a/proctl/proctl_linux_amd64.go +++ b/proctl/proctl_linux_amd64.go @@ -279,7 +279,7 @@ func (dbp *DebuggedProcess) Next() error { pc-- } - f, l, _ := dbp.GoSymTable.PCToLine(pc) + _, l, fn := dbp.GoSymTable.PCToLine(pc) fde, err := dbp.FrameEntries.FDEForPC(pc) if err != nil { return err @@ -314,11 +314,9 @@ func (dbp *DebuggedProcess) Next() error { return err } - nf, nl, _ := dbp.GoSymTable.PCToLine(pc) - if nf == f && nl != l { - if fde.AddressRange.Cover(pc) { - break - } + _, nl, nfn := dbp.GoSymTable.PCToLine(pc) + if nfn == fn && nl != l { + break } }
Improve 'in current fn' check for Next impl
go-delve_delve
train
go
672bb5d0087dd44c9e05d1d3b66f64f2e3cc6805
diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py index <HASH>..<HASH> 100644 --- a/toot/tui/timeline.py +++ b/toot/tui/timeline.py @@ -171,6 +171,13 @@ class StatusDetails(urwid.Pile): yield ("pack", urwid.Divider()) yield ("pack", self.build_linebox(self.card_generator(card))) + yield ("pack", urwid.AttrWrap(urwid.Divider("-"), "gray")) + yield ("pack", urwid.Text([ + ("gray", "⤶ {} ".format(status.data["replies_count"])), + ("yellow" if status.reblogged else "gray", "♺ {} ".format(status.data["reblogs_count"])), + ("yellow" if status.favourited else "gray", "★ {}".format(status.data["favourites_count"])), + ])) + # Push things to bottom yield ("weight", 1, urwid.SolidFill(" ")) yield ("pack", urwid.Text([
Add reply, reblog and favourite counters
ihabunek_toot
train
py
0c69e980bbe2114626914e119aca83a50d5b4f9e
diff --git a/src/adapters/lokijs/worker/executor.js b/src/adapters/lokijs/worker/executor.js index <HASH>..<HASH> 100644 --- a/src/adapters/lokijs/worker/executor.js +++ b/src/adapters/lokijs/worker/executor.js @@ -58,11 +58,7 @@ export default class LokiExecutor { isCached(table: TableName<any>, id: RecordId): boolean { const cachedSet = this.cachedRecords.get(table) - if (!cachedSet) { - return false - } - - return cachedSet.has(id) + return cachedSet ? cachedSet.has(id) : false } markAsCached(table: TableName<any>, id: RecordId): void {
Inline `isCached` implementation
Nozbe_WatermelonDB
train
js
e75b19b837d60b3bb0388a9d0ec0ca656ae892fe
diff --git a/allennlp/semparse/domain_languages/nlvr_language.py b/allennlp/semparse/domain_languages/nlvr_language.py index <HASH>..<HASH> 100644 --- a/allennlp/semparse/domain_languages/nlvr_language.py +++ b/allennlp/semparse/domain_languages/nlvr_language.py @@ -117,7 +117,7 @@ class NlvrLanguage(DomainLanguage): # this field to know how many terminals to plan for. self.terminal_productions: Dict[str, str] = {} for name, type_ in self._function_types.items(): - self.terminal_productions[name] = "%s -> %s" % (type_, name) + self.terminal_productions[name] = f"{type_} -> {name}" # These first two methods are about getting an "agenda", which, given an input utterance, # tries to guess what production rules should be needed in the logical form.
Use f-string (#<I>)
allenai_allennlp
train
py
b8acfeba6b465dab8698109fc5fc56f8e031b82d
diff --git a/lib/git/trifle.rb b/lib/git/trifle.rb index <HASH>..<HASH> 100644 --- a/lib/git/trifle.rb +++ b/lib/git/trifle.rb @@ -29,8 +29,8 @@ module Git # needless to do more than this for the following methods # very neat BTW DELEGATORS = %W| - add_remote add branch branches - current_branch commit dir fetch + add add_remote apply branch branches + current_branch commit dir diff fetch log ls_files merge pull push reset remotes remove |.
now trifle forwards apply and diff
lacravate_git-trifle
train
rb
f321fb921cfc72576a64e8380f9f9851e4d8d566
diff --git a/src/sap.m/src/sap/m/SinglePlanningCalendarGrid.js b/src/sap.m/src/sap/m/SinglePlanningCalendarGrid.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/SinglePlanningCalendarGrid.js +++ b/src/sap.m/src/sap/m/SinglePlanningCalendarGrid.js @@ -2033,6 +2033,14 @@ sap.ui.define([ // Turn of the cycling this._oItemNavigation.setCycling(false); + //this way we do not hijack the browser back/forward navigation + this._oItemNavigation.setDisabledModifiers({ + sapnext: ["alt", "meta"], + sapprevious: ["alt", "meta"], + saphome : ["alt", "meta"], + sapend : ["meta"] + }); + // explicitly setting table mode this._oItemNavigation.setTableMode(true, true).setColumns(this._getColumns());
[INTERNAL] sap.m.SinglePlanningCalendarGrid: Default browser keyboard navigation is fixed - The default browser keyboard navigation with Alt + Left Arrow/Right Arrow is fixed Change-Id: I<I>f<I>cb<I>c<I>fcf<I>ff<I>ab9f8fc<I>a9cb5d
SAP_openui5
train
js
b47138ad43426e14e05920170389794330863377
diff --git a/js/base/Exchange.js b/js/base/Exchange.js index <HASH>..<HASH> 100644 --- a/js/base/Exchange.js +++ b/js/base/Exchange.js @@ -1385,7 +1385,7 @@ module.exports = class Exchange { const parts = marketId.split (delimiter) if (parts.length === 2) { const baseId = this.safeString (parts, 0); - const quoteId = this.safeString (parts, 0); + const quoteId = this.safeString (parts, 1); const base = this.safeCurrencyCode (baseId) const quote = this.safeCurrencyCode (quoteId) const symbol = base + '/' + quote
safeMarket handle spot delimiter #<I>
ccxt_ccxt
train
js
56e9c38161a5ff77fbb2c8a7d8745f243c905de3
diff --git a/mod/glossary/sql.php b/mod/glossary/sql.php index <HASH>..<HASH> 100644 --- a/mod/glossary/sql.php +++ b/mod/glossary/sql.php @@ -109,7 +109,7 @@ $where = ''; } - $sqlselect = "SELECT ge.id, $usernamefield $as pivot, u.id uid, ge.*"; + $sqlselect = "SELECT ge.id, $usernamefield $as pivot, u.id as uid, ge.*"; $sqlfrom = "FROM {$CFG->prefix}glossary_entries ge, {$CFG->prefix}user u"; $sqlwhere = "WHERE ge.userid = u.id AND (ge.approved != 0 $userid)
Merged from MOODLE_<I>_STABLE: Fix for postgres-invalid-sql (must have AS between field and alias)
moodle_moodle
train
php
e1e38e081bc54cc6f4a675f5af3cd0b71ebdbe05
diff --git a/packages/site/pages/components/badge.js b/packages/site/pages/components/badge.js index <HASH>..<HASH> 100644 --- a/packages/site/pages/components/badge.js +++ b/packages/site/pages/components/badge.js @@ -59,10 +59,8 @@ export default withServerProps(_ => ( <P>In either solid or stroked styles.</P> <Example.React includes={{ Badge }} - codes={[`<Badge>Badge</Badge>`].concat( - Object.keys(Badge.appearances).map( - a => `<Badge appearance={Badge.appearances.${a}}>Badge</Badge>` - ) + codes={Object.keys(Badge.appearances).map( + a => `<Badge appearance={Badge.appearances.${a}}>Badge</Badge>` )} />
fix(site): remove duplicate badge appearance example
pluralsight_design-system
train
js
ad736a8ae0cdae4ff0f58e9e757a454943e69823
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -34,15 +34,15 @@ void function (root) { var __old, black return target } - // Unpacks all modules in source. Utils go in `target` or the global obj - function unpack_all(kind, source, target) { - keys(root).forEach(function(module) { - module = root[module] + // Unpacks all modules in black. Utils go in `target` or the global obj + function unpack_all(kind, global) { + keys(this).forEach(function(module) { + module = root[this] if (!fnp(module)) unpack( kind - , source - , target || top + , this + , global || top , module.$box - , module) }) + , module) }, this) } // Transforms a generic method into a SLOOOOOOOOOOOW instance method.
Uses `this` to search for modules to unpack.
sorellabs_black
train
js
a7415336bc901f1661730f4f5a896e7b504c6d57
diff --git a/keychain/derivation.go b/keychain/derivation.go index <HASH>..<HASH> 100644 --- a/keychain/derivation.go +++ b/keychain/derivation.go @@ -96,6 +96,13 @@ const ( // session keys are limited to the lifetime of the session and are used // to increase privacy in the watchtower protocol. KeyFamilyTowerSession KeyFamily = 8 + + // KeyFamilyTowerID is the family of keys used to derive the public key + // of a watchtower. This made distinct from the node key to offer a form + // of rudimentary whitelisting, i.e. via knowledge of the pubkey, + // preventing others from having full access to the tower just as a + // result of knowing the node key. + KeyFamilyTowerID KeyFamily = 9 ) // KeyLocator is a two-tuple that can be used to derive *any* key that has ever
keychain/derivation: add KeyFamilyTowerKey distinct from NodeID
lightningnetwork_lnd
train
go
62db749b2e95422521edfd7dda3fc38478955173
diff --git a/test/test_Exceptions.py b/test/test_Exceptions.py index <HASH>..<HASH> 100644 --- a/test/test_Exceptions.py +++ b/test/test_Exceptions.py @@ -57,6 +57,14 @@ class TestUtil(unittest.TestCase): text = str(exc) self.assertEqual(text, "") + def test_hresult(self): + hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + self.assertEqual(hresult, SCARD_S_SUCCESS) + + hresult, hcard, dwActiveProtocol = SCardConnect( + hcontext, "INVALID READER NAME", SCARD_SHARE_SHARED, SCARD_PROTOCOL_ANY + ) + self.assertEqual(hresult, SCARD_E_UNKNOWN_READER) if __name__ == '__main__': unittest.main()
test_SCardGetErrorMessage: check the value of SCARD_E_UNKNOWN_READER macOS and Linux does not define the return type of PC/SC function the same way. So we check the returned value correspond to what PySCard has defined.
LudovicRousseau_pyscard
train
py
c001a4dd466fd294c0ffbe995892780a064ee200
diff --git a/pyontutils/integration_test_helper.py b/pyontutils/integration_test_helper.py index <HASH>..<HASH> 100644 --- a/pyontutils/integration_test_helper.py +++ b/pyontutils/integration_test_helper.py @@ -222,7 +222,7 @@ class _TestScriptsBase(unittest.TestCase): ' cannot test main, skipping.') return - if argv and argv[0] != script: + if argv and argv[0] != script.__name__.rsplit('.', 1)[-1]: os.system(' '.join(argv)) # FIXME error on this? try: @@ -271,6 +271,9 @@ class _TestScriptsBase(unittest.TestCase): for j_ind, argv in enumerate(argvs): mname = f'test_{i_ind + npaths:0>3}_{j_ind:0>3}_' + pex + if argv: + mname += '_' + '_'.join(argv).replace('-', '_') + #print('MPATH: ', module_path) test_main = cls.make_test_main(do_mains, post_main, module_path, argv, stem in mains, stem in tests, skip)
int test helper fixes and more informative names we were testing whether a string was not equal to a module, which was always going to return true, so now compare to the last element in the module path now also include argv in the generated test names, it makes the names annoyingly long in some cases, but if something fails then it is much easier to identify what command was actually issued
tgbugs_pyontutils
train
py
25eacad5cd5569e54c64afebd5f9b77b0574059c
diff --git a/lib/rubocop/cop/cop.rb b/lib/rubocop/cop/cop.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/cop.rb +++ b/lib/rubocop/cop/cop.rb @@ -57,13 +57,15 @@ module Rubocop sexp.each do |elem| if Array === elem if elem[0] == sym - parents << sexp + parents << sexp unless parents.include?(sexp) elem = elem[1..-1] end - each_parent_of(sym, elem) { |parent| parents << parent } + each_parent_of(sym, elem) do |parent| + parents << parent unless parents.include?(parent) + end end end - parents.uniq.each { |parent| yield parent } + parents.each { |parent| yield parent } end def each(sym, sexp)
Added elements to array only if they're not already in there instead of calling uniq afterwards.
rubocop-hq_rubocop
train
rb
7f20acc7e55da570a3fd850ffa23ae0faaf0d926
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -129,7 +129,12 @@ Tree.prototype.list = function (name, opts, cb) { } Tree.prototype._list = function (head, seq, names, opts, cb) { - var headIndex = this._inflate(seq, head.paths) + var headIndex + try { + headIndex = this._inflate(seq, head.paths) + } catch (e) { + return cb(e) + } var cmp = compare(split(head.name), names) var index = cmp < headIndex.length && headIndex[cmp] @@ -294,7 +299,12 @@ Tree.prototype._get = function (head, seq, names, record, opts, cb) { return cb(null, this._codec.decode(head.value)) } - var inflated = this._inflate(seq, head.paths) + var inflated + try { + inflated = this._inflate(seq, head.paths) + } catch (e) { + return cb(e) + } if (cmp >= inflated.length) return cb(notFound(names)) var index = inflated[cmp]
Catch _inflate errors and send them to the cb
mafintosh_append-tree
train
js
e6a83977554325d88ededcb348ade0923e00cc80
diff --git a/client/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryClientAbstract.java b/client/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryClientAbstract.java index <HASH>..<HASH> 100755 --- a/client/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryClientAbstract.java +++ b/client/src/main/java/com/orientechnologies/orient/enterprise/channel/binary/OChannelBinaryClientAbstract.java @@ -117,7 +117,7 @@ public abstract class OChannelBinaryClientAbstract extends OChannelBinary { } catch (Exception e) { // UNABLE TO REPRODUCE THE SAME SERVER-SIZE EXCEPTION: THROW AN IO EXCEPTION - rootException = OException.wrapException(new OIOException(iMessage), iPrevious); + rootException = OException.wrapException(new OSystemException(iMessage), iPrevious); } if (c != null)
fixed wrong retry in case of not found serialized exception in the client.
orientechnologies_orientdb
train
java
54aa5460c4545901af5d3ffb55510d0ff01d6aa4
diff --git a/src/main/java/net/jodah/typetools/TypeResolver.java b/src/main/java/net/jodah/typetools/TypeResolver.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/jodah/typetools/TypeResolver.java +++ b/src/main/java/net/jodah/typetools/TypeResolver.java @@ -109,7 +109,7 @@ public final class TypeResolver { accessSetter = new AccessMaker() { @Override public void makeAccessible(AccessibleObject object) throws Throwable { - overrideSetter.invoke(new Object[] {object, true}); + overrideSetter.invokeWithArguments(new Object[] {object, true}); } }; }
use invokeWithArguments instead of invoke to support Java <I> Java <I> changed the way the JVM handles varargs internally, meaning that new Object[] {...} can't be used as a substitute for varargs on Java 6 source level anymore. However, invokeWithArguments explicitly wants an Object[], so it still works.
jhalterman_typetools
train
java
f65dd93511dec56abb0c91a814fd77a2165f8e0d
diff --git a/spec/attr_enumerable/reduce_attr_spec.rb b/spec/attr_enumerable/reduce_attr_spec.rb index <HASH>..<HASH> 100644 --- a/spec/attr_enumerable/reduce_attr_spec.rb +++ b/spec/attr_enumerable/reduce_attr_spec.rb @@ -36,7 +36,7 @@ describe AttrEnumerable do ), method: :reduce_name, block: lambda { |r, x|r ||= ''; r = "#{r}#{x.upcase}"; r }, - expected: '0TANAKATANAKASUZUKI', + expected: '0TANAKATANAKASUZUKI' }, { case_no: 2, @@ -50,7 +50,7 @@ describe AttrEnumerable do ), method: :reduce_age, block: lambda { |r, x|r ||= 0; r += x + 1; r }, - expected: 127, + expected: 127 }, { case_no: 3, @@ -58,7 +58,7 @@ describe AttrEnumerable do klass: AttrEnumerablePersons.new([]), method: :reduce_name, block: lambda { |x|x += 1 }, - expected: 0, + expected: 0 } ]
Fix rubocop warning 'TrailingComma' in reduce_attr_spec.rb
tbpgr_tbpgr_utils
train
rb
986447c22682b3f24baacf3e8eec64bdf58866dc
diff --git a/src/ContaoCommunityAlliance/Composer/Plugin/Plugin.php b/src/ContaoCommunityAlliance/Composer/Plugin/Plugin.php index <HASH>..<HASH> 100644 --- a/src/ContaoCommunityAlliance/Composer/Plugin/Plugin.php +++ b/src/ContaoCommunityAlliance/Composer/Plugin/Plugin.php @@ -472,7 +472,7 @@ class Plugin } } - $this->contaoRoot = $root; + $this->contaoRoot = realpath($root); } $systemDir = $this->contaoRoot . DIRECTORY_SEPARATOR . 'system' . DIRECTORY_SEPARATOR;
Fix issue #<I> - Use realpath() for contao root to always have absolute pathes.
contao-community-alliance_composer-plugin
train
php
d45504d341ac9d78790153b2d0c1b0fda417a32a
diff --git a/lib/lita/mailgun_dropped_rate_repository.rb b/lib/lita/mailgun_dropped_rate_repository.rb index <HASH>..<HASH> 100644 --- a/lib/lita/mailgun_dropped_rate_repository.rb +++ b/lib/lita/mailgun_dropped_rate_repository.rb @@ -29,8 +29,8 @@ module Lita @mutex.synchronize do @store[domain] ||= [] @store[domain] << event_name - if @store[domain].size > 100 - @store[domain] = @store[domain].slice(-100, 100) + if @store[domain].size > 20 + @store[domain] = @store[domain].slice(-20, 20) end end true diff --git a/spec/mailgun_dropped_rate_repository_spec.rb b/spec/mailgun_dropped_rate_repository_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mailgun_dropped_rate_repository_spec.rb +++ b/spec/mailgun_dropped_rate_repository_spec.rb @@ -31,9 +31,9 @@ describe Lita::MailgunDroppedRateRepository do end end end - context "when a single domain records 101 events" do + context "when a single domain records 21 events" do before do - 101.times do + 21.times do repository.record("example.com", :delivered) end end @@ -49,7 +49,7 @@ describe Lita::MailgunDroppedRateRepository do end it "sets the total_count" do - expect(result.total).to eq(100) + expect(result.total).to eq(20) end it "includes the dropped rate" do
reduce history stored for each domain to <I> events * <I> should be plenty to decide if there's an issue or not * It's also low enough that low-volume domains that have an issue resolved should move into the green zone quicker
conversation_lita-mailgun
train
rb,rb
b27fa518c9ba30cd1eddc5060b4f152eec6c38c8
diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index <HASH>..<HASH> 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -110,12 +110,13 @@ class VideoDownload $process->run(); if (!$process->isSuccessful()) { $errorOutput = trim($process->getErrorOutput()); + $exitCode = $process->getExitCode(); if ($errorOutput == 'ERROR: This video is protected by a password, use the --video-password option') { - throw new PasswordException($errorOutput); + throw new PasswordException($errorOutput, $exitCode); } elseif (substr($errorOutput, 0, 21) == 'ERROR: Wrong password') { - throw new Exception(_('Wrong password')); + throw new Exception(_('Wrong password'), $exitCode); } else { - throw new Exception($errorOutput); + throw new Exception($errorOutput, $exitCode); } } else { return trim($process->getOutput());
feat: Add youtube-dl exit code to the exceptions
Rudloff_alltube
train
php
790130093e83480ecee33492f95d6c23fbbfa0c2
diff --git a/lib/shopify_app/webhooks_manager.rb b/lib/shopify_app/webhooks_manager.rb index <HASH>..<HASH> 100644 --- a/lib/shopify_app/webhooks_manager.rb +++ b/lib/shopify_app/webhooks_manager.rb @@ -30,7 +30,7 @@ module ShopifyApp end def destroy_webhooks - ShopifyAPI::Webhook.all.each do |webhook| + ShopifyAPI::Webhook.all.to_a.each do |webhook| ShopifyAPI::Webhook.delete(webhook.id) if is_required_webhook?(webhook) end diff --git a/test/shopify_app/webhooks_manager_test.rb b/test/shopify_app/webhooks_manager_test.rb index <HASH>..<HASH> 100644 --- a/test/shopify_app/webhooks_manager_test.rb +++ b/test/shopify_app/webhooks_manager_test.rb @@ -50,6 +50,12 @@ class ShopifyApp::WebhooksManagerTest < ActiveSupport::TestCase @manager.recreate_webhooks! end + test "#destroy_webhooks doesnt freak out if there are no webhooks" do + ShopifyAPI::Webhook.stubs(:all).returns(nil) + + @manager.destroy_webhooks + end + test "#destroy_webhooks makes calls to destroy webhooks" do ShopifyAPI::Webhook.stubs(:all).returns(Array.wrap(all_mock_webhooks.first)) ShopifyAPI::Webhook.expects(:delete).with(all_mock_webhooks.first.id)
sometimes the shopify api can return a nil to us. so lets make sure we dont try to call #each on nil
Shopify_shopify_app
train
rb,rb
2a9edcf455efdfa0e4eee748656d7f5c6761e2d5
diff --git a/src/tools/bubblechart/bubblechart-trail.js b/src/tools/bubblechart/bubblechart-trail.js index <HASH>..<HASH> 100644 --- a/src/tools/bubblechart/bubblechart-trail.js +++ b/src/tools/bubblechart/bubblechart-trail.js @@ -208,6 +208,15 @@ export default Class.extend({ }, + + _remove: function(trail, duration, d) { + this.actionsQueue[d[this.context.KEY]] = []; + if (trail) { // TODO: in some reason run twice + d3.select(this.entityTrails[d[this.context.KEY]].node().parentNode).remove(); + this.entityTrails[d[this.context.KEY]] = null; + } + }, + _resize: function(trail, duration, d) { var _context = this.context; if (_context.model.time.splash) {
Turn off trails: _context._trails[("_" + action)] is not a function (#<I>)
vizabi_vizabi
train
js
666c289e5979410e9299b2204cedee2bebb831a3
diff --git a/test/plugin/test_in_gc_stat.rb b/test/plugin/test_in_gc_stat.rb index <HASH>..<HASH> 100644 --- a/test/plugin/test_in_gc_stat.rb +++ b/test/plugin/test_in_gc_stat.rb @@ -27,13 +27,18 @@ class GCStatInputTest < Test::Unit::TestCase stub(GC).stat { stat } d = create_driver + d.end_if do + d.emit_count >= 2 + end d.run do - sleep 2 + sleep(0.1) until d.stop? end events = d.events assert(events.length > 0) - assert_equal(stat, events[0][2]) - assert(events[0][1].is_a?(Fluent::EventTime)) + events.each_index {|i| + assert_equal(stat, events[i][2]) + assert(events[i][1].is_a?(Fluent::EventTime)) + } end end
Use new end_if stop condition block
fluent_fluentd
train
rb
2b2129e72d69ac40c77334079b252eba1a3d9a54
diff --git a/lib/nexmo/config.rb b/lib/nexmo/config.rb index <HASH>..<HASH> 100644 --- a/lib/nexmo/config.rb +++ b/lib/nexmo/config.rb @@ -8,9 +8,9 @@ module Nexmo self.api_host = 'api.nexmo.com' self.api_key = ENV['NEXMO_API_KEY'] self.api_secret = ENV['NEXMO_API_SECRET'] - self.application_id = nil + self.application_id = ENV['NEXMO_APPLICATION_ID'] self.logger = (defined?(Rails.logger) && Rails.logger) || ::Logger.new(nil) - self.private_key = nil + self.private_key = ENV['NEXMO_PRIVATE_KEY_PATH'] ? File.read(ENV['NEXMO_PRIVATE_KEY_PATH']) : ENV['NEXMO_PRIVATE_KEY'] self.rest_host = 'rest.nexmo.com' self.signature_secret = ENV['NEXMO_SIGNATURE_SECRET'] self.signature_method = ENV['NEXMO_SIGNATURE_METHOD'] || 'md5hash'
Add support for additional environment variables * `ENV['NEXMO_APPLICATION_ID']` * `ENV['NEXMO_PRIVATE_KEY']` * `ENV['NEXMO_PRIVATE_KEY_PATH']`
Nexmo_nexmo-ruby
train
rb
09233a755ed81878e36f1d26f8c06880ad12bf6f
diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py index <HASH>..<HASH> 100644 --- a/pycm/pycm_obj.py +++ b/pycm/pycm_obj.py @@ -400,7 +400,7 @@ class ConfusionMatrix(): matrix = self.table if normalize: matrix = self.normalized_table - csv_matrix_file = open(name + "_matrix" + ".csv", "w") + csv_matrix_file = open(name + "_matrix" + ".csv", "w", encoding="utf-8") csv_matrix_data = csv_matrix_print( self.classes, matrix, header=header) csv_matrix_file.write(csv_matrix_data)
fix : minor bugs fixed. (encoding utf-8 added)
sepandhaghighi_pycm
train
py
5881417ec4a993194ba6d64b156ad6b5ffbca97c
diff --git a/python/ray/tests/test_multi_node.py b/python/ray/tests/test_multi_node.py index <HASH>..<HASH> 100644 --- a/python/ray/tests/test_multi_node.py +++ b/python/ray/tests/test_multi_node.py @@ -638,6 +638,13 @@ def test_multi_driver_logging(ray_start_regular): driver2_wait = Semaphore.options(name="driver2_wait").remote(value=0) main_wait = Semaphore.options(name="main_wait").remote(value=0) + # The creation of an actor is asynchronous. + # We need to wait for the completion of the actor creation, + # otherwise we can't get the actor by name. + ray.get(driver1_wait.locked.remote()) + ray.get(driver2_wait.locked.remote()) + ray.get(main_wait.locked.remote()) + # Params are address, semaphore name, output1, output2 driver_script_template = """ import ray
Fix bug that `test_multi_node.py::test_multi_driver_logging` hangs when GCS actor management is turned on (#<I>)
ray-project_ray
train
py
848d24bfd19c6c555ceed1d213ba7c11fed63a9b
diff --git a/osmdroid-android/src/org/osmdroid/tileprovider/MapTileProviderArray.java b/osmdroid-android/src/org/osmdroid/tileprovider/MapTileProviderArray.java index <HASH>..<HASH> 100644 --- a/osmdroid-android/src/org/osmdroid/tileprovider/MapTileProviderArray.java +++ b/osmdroid-android/src/org/osmdroid/tileprovider/MapTileProviderArray.java @@ -79,7 +79,9 @@ public class MapTileProviderArray extends MapTileProviderBase { public Drawable getMapTile(final MapTile pTile) { final Drawable tile = mTileCache.getMapTile(pTile); if (tile != null && !ExpirableBitmapDrawable.isDrawableExpired(tile)) { - + if (DEBUGMODE) { + logger.debug("MapTileCache succeeded for: " + pTile); + } return tile; } else { boolean alreadyInProgress = false;
put back a log message that I didn't intend to delete
osmdroid_osmdroid
train
java
04b249caee57f3afa7ceb08255aa7db709809e85
diff --git a/java/client/src/org/openqa/selenium/android/library/AndroidWebDriver.java b/java/client/src/org/openqa/selenium/android/library/AndroidWebDriver.java index <HASH>..<HASH> 100644 --- a/java/client/src/org/openqa/selenium/android/library/AndroidWebDriver.java +++ b/java/client/src/org/openqa/selenium/android/library/AndroidWebDriver.java @@ -130,7 +130,7 @@ public class AndroidWebDriver implements WebDriver, SearchContext, JavascriptExe // Timeouts in milliseconds private static final long LOADING_TIMEOUT = 30000L; private static final long START_LOADING_TIMEOUT = 700L; - static final long RESPONSE_TIMEOUT = 10000L; + static final long RESPONSE_TIMEOUT = 15000L; private static final long FOCUS_TIMEOUT = 1000L; private static final long POLLING_INTERVAL = 50L; static final long UI_TIMEOUT = 3000L;
DouniaBerrada: Increasing the response timeout for android. This is useful for executing lonnnnnng js scripts. r<I>
SeleniumHQ_selenium
train
java
a78fe670d6dc8bf3cd9e4392cbc1859f609c22e4
diff --git a/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/OperationParkerImpl.java b/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/OperationParkerImpl.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/OperationParkerImpl.java +++ b/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/OperationParkerImpl.java @@ -90,7 +90,7 @@ public class OperationParkerImpl implements OperationParker, LiveOperationsTrack } } - // Runs in operation thread, we can assume that + // Runs in operation thread, we can assume that // here we have an implicit lock for specific WaitNotifyKey. // see javadoc @Override @@ -177,7 +177,7 @@ public class OperationParkerImpl implements OperationParker, LiveOperationsTrack public void shutdown() { logger.finest("Stopping tasks..."); expirationTaskFuture.cancel(true); - expirationExecutor.shutdown(); + expirationExecutor.shutdownNow(); for (WaitSet waitSet : waitSetMap.values()) { waitSet.onShutdown(); }
Call shutdownNow while closing OperationParkerImpl (#<I>)
hazelcast_hazelcast
train
java
94eb8fdc9d4d91aceb4139a4a31e95f8899e20c6
diff --git a/src/inscriptis/html_properties.py b/src/inscriptis/html_properties.py index <HASH>..<HASH> 100644 --- a/src/inscriptis/html_properties.py +++ b/src/inscriptis/html_properties.py @@ -72,4 +72,4 @@ class Line(object): '\n' * self.margin_after)) def __str__(self): - return f"<Line: '{self.get_text().strip()}'>" + return "<Line: '{}'>".format(self.get_text().strip())
fix: python<I> issue.
weblyzard_inscriptis
train
py
bf62d62f1617b9b07ea099947e230e1c52182f6d
diff --git a/src/DataTable/utils/queryParams.js b/src/DataTable/utils/queryParams.js index <HASH>..<HASH> 100644 --- a/src/DataTable/utils/queryParams.js +++ b/src/DataTable/utils/queryParams.js @@ -702,7 +702,7 @@ export function getQueryParams({ qb.whereAll( getQueries(andFilters, qb, ccFields), additionalFilterToUse - ).andWhereAny(...allOrFilters); + ).orWhereAny(...allOrFilters); } catch (e) { if (urlConnected) { errorParsingUrlString = e;
or filters are now ored properly
TeselaGen_teselagen-react-components
train
js
536f2f39d5b4f7dc9e3d26ac435563008869903a
diff --git a/pdfconduit/__init__.py b/pdfconduit/__init__.py index <HASH>..<HASH> 100644 --- a/pdfconduit/__init__.py +++ b/pdfconduit/__init__.py @@ -5,7 +5,7 @@ from pdf.conduit import * try: from pdf.gui.gui import GUI GUI_INSTALLED = True - __all__.extend("GUI") + __all__.append("GUI") except ImportError: GUI_INSTALLED = False @@ -13,7 +13,7 @@ except ImportError: try: from pdf.modify import upscale, rotate, slicer MODIFY_INSTALLED = True - __all__.extend("slicer", "upscale", "rotate") + __all__.extend(["slicer", "upscale", "rotate"]) except ImportError: MODIFY_INSTALLED = False @@ -21,6 +21,8 @@ except ImportError: try: from pdf.convert import Flatten MODIFY_INSTALLED = True - __all__.extend("Flatten") + __all__.append("Flatten") except ImportError: MODIFY_INSTALLED = False + +print(__all__) \ No newline at end of file
Changed extend to append for non-lists
mrstephenneal_pdfconduit
train
py
5c556dc26ee06a9e7cec380da34684c0bec3c2c8
diff --git a/lib/bbcloud/servers.rb b/lib/bbcloud/servers.rb index <HASH>..<HASH> 100644 --- a/lib/bbcloud/servers.rb +++ b/lib/bbcloud/servers.rb @@ -6,11 +6,11 @@ module Brightbox end def server_type - @server_type ||= Type.new(flavor_id) + @server_type ||= (Type.new(flavor_id) if flavor_id) end def image - @image ||= Image.new(image_id) + @image ||= (Image.new(image_id) if image_id) end def attributes @@ -19,7 +19,7 @@ module Brightbox a[:created_at] = created_at a[:created_on] = fog_model.created_at.strftime("%Y-%m-%d") a[:type] = server_type - a[:zone] = Zone.new(zone_id) + a[:zone] = Zone.new(zone_id) if zone_id a[:hostname] = hostname a[:public_hostname] = public_hostname unless cloud_ips.empty? a
servers#list fix display of deleted servers. Fixes #<I>
brightbox_brightbox-cli
train
rb
58ab1c2cd53b51b57e425e4f4926b9d29de424be
diff --git a/js/tests/unit/carousel.spec.js b/js/tests/unit/carousel.spec.js index <HASH>..<HASH> 100644 --- a/js/tests/unit/carousel.spec.js +++ b/js/tests/unit/carousel.spec.js @@ -905,7 +905,7 @@ describe('Carousel', () => { }) describe('to', () => { - it('should go directement to the provided index', done => { + it('should go directly to the provided index', done => { fixtureEl.innerHTML = [ '<div id="myCarousel" class="carousel slide">', ' <div class="carousel-inner">',
test(carousel): french word in the wild (#<I>)
twbs_bootstrap
train
js
8dd683e79e9801be817c6032f37c314c0f254a45
diff --git a/lib/Thulium/Db/ModelQueryBuilder.php b/lib/Thulium/Db/ModelQueryBuilder.php index <HASH>..<HASH> 100644 --- a/lib/Thulium/Db/ModelQueryBuilder.php +++ b/lib/Thulium/Db/ModelQueryBuilder.php @@ -127,4 +127,14 @@ class ModelQueryBuilder return $this; } + function __clone() + { + $this->_query = clone $this->_query; + } + + function copy() + { + return clone $this; + } + } \ No newline at end of file diff --git a/test/lib/Thulium/Db/ModelQueryBuilderTest.php b/test/lib/Thulium/Db/ModelQueryBuilderTest.php index <HASH>..<HASH> 100644 --- a/test/lib/Thulium/Db/ModelQueryBuilderTest.php +++ b/test/lib/Thulium/Db/ModelQueryBuilderTest.php @@ -449,4 +449,21 @@ class ModelQueryBuilderTest extends DbTransactionalTestCase $this->assertCount(1, $products); $this->assertEquals($product, $products[0]); } + + /** + * @test + */ + public function shouldCloneBuilder() + { + //given + $product = Product::create(array('name' => 'a')); + $query = Product::where(); + + //when + $query->copy()->where(array('name' => 'other'))->count(); + + //then + $this->assertEquals($product, $query->fetch()); + } + } \ No newline at end of file
ModelQueryBuilder: added method 'copy'
letsdrink_ouzo
train
php,php
f9563e7fe2c2ca80d214e2cf2c2b02554ee3a048
diff --git a/libraries/lithium/data/Connections.php b/libraries/lithium/data/Connections.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/data/Connections.php +++ b/libraries/lithium/data/Connections.php @@ -188,10 +188,12 @@ class Connections extends \lithium\core\StaticObject { $class = Libraries::locate("adapter.data.source.{$config['type']}", $config['adapter']); } if (!$class) { - throw new Exception("{$config['type']} adapter {$config['adapter']} could not be found"); + throw new Exception( + "{$config['type']} adapter {$config['adapter']} could not be found" + ); } return new $class($config); } } -?> +?> \ No newline at end of file
removed newline at end of file and fixed an extra long line
UnionOfRAD_framework
train
php
c3dcf9d463285089c045a0963f23abf85b609288
diff --git a/pyof/v0x04/common/flow_match.py b/pyof/v0x04/common/flow_match.py index <HASH>..<HASH> 100644 --- a/pyof/v0x04/common/flow_match.py +++ b/pyof/v0x04/common/flow_match.py @@ -393,6 +393,25 @@ class Match(GenericStruct): self._unpack_attribute('oxm_match_fields', type(self).oxm_match_fields, buff[:offset+self.length], begin) + def get_field(self, field_type): + """Return the value for the 'field_type' field in oxm_match_fields. + + Args: + field_type (~pyof.v0x04.common.flow_match.OxmOfbMatchField, + ~pyof.v0x04.common.flow_match.OxmMatchFields): + The type of the OXM field you want the value. + + Returns: + The integer number of the 'field_type' if it exists. Otherwise + return None. + + """ + for field in self.oxm_match_fields: + if field.oxm_field == field_type: + return field.oxm_value + + return None + class OxmExperimenterHeader(GenericStruct): """Header for OXM experimenter match fields."""
[v0x<I>] Add Match.get_field method This method allows us to easily get the value for Match fields without the need to loop over them manually.
kytos_python-openflow
train
py
36df7e76c295e8be3065a6ad27e3053c0b3feb45
diff --git a/src/instrumentTest/java/com/couchbase/lite/ApiTest.java b/src/instrumentTest/java/com/couchbase/lite/ApiTest.java index <HASH>..<HASH> 100644 --- a/src/instrumentTest/java/com/couchbase/lite/ApiTest.java +++ b/src/instrumentTest/java/com/couchbase/lite/ApiTest.java @@ -305,10 +305,7 @@ public class ApiTest extends LiteTestCase { assertTrue(!doc.getCurrentRevision().isDeletion()); assertTrue(doc.delete()); assertTrue(doc.isDeleted()); - //After deleting a document, its currentRevision is nil - //https://github.com/couchbase/couchbase-lite-java-core/issues/92 assertNull(doc.getCurrentRevision()); - assertNotNull(doc.getCurrentRevision().isDeletion()); }
Remove another test assertion that did not make sense. <URL>
couchbase_couchbase-lite-android
train
java
bc4128873709c0175e72f13e7900f43683146fb3
diff --git a/src/test/locale/pa-in.js b/src/test/locale/pa-in.js index <HASH>..<HASH> 100644 --- a/src/test/locale/pa-in.js +++ b/src/test/locale/pa-in.js @@ -311,18 +311,6 @@ test('lenient ordinal parsing of number', function (assert) { } }); -test('meridiem', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); - } - } -}); - test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) {
Remove duplicate unit test This is already in common-locale.js and runs for all locales
moment_moment
train
js
9c6834a605b43b8bb6291036f0ff34a0682c2848
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -38,6 +38,9 @@ module.exports = { // I don't know how to get this to work with peerDependencies 'import/no-extraneous-dependencies': 0, + // going to try this going forward since I normally want to do export * from "./file" + 'import/prefer-default-export': 0, + // This doesn't play well with hooks and it doesn't mean much with Typescript to me 'consistent-return': 0,
chore(eslint): disabled prefer-default-export rule Going to play with this disabled for a bit since I normally need to do: ```ts export * from "./file"; ``` Right now I have to do multiple exports because of this rule: ```ts export { default as THING } from "./file" export * from "./file" ```
mlaursen_react-md
train
js
9d1822e7c6d1a8ffd636053d1e581948d6dddae5
diff --git a/javascript/CMSMain.AddForm.js b/javascript/CMSMain.AddForm.js index <HASH>..<HASH> 100644 --- a/javascript/CMSMain.AddForm.js +++ b/javascript/CMSMain.AddForm.js @@ -69,10 +69,11 @@ this.setSelected(true); }, setSelected: function(bool) { + var input = this.find('input'); this.toggleClass('selected', bool); - if(bool) { + if(bool && !input.is(':disabled')) { this.siblings().setSelected(false); - this.find('input').attr('checked', 'checked'); + input.attr('checked', 'checked'); } }, setEnabled: function(bool) {
MINOR Don't allow page type selection in add form when radio button is disabled
silverstripe_silverstripe-siteconfig
train
js
8d054f1c93655786f428b5bce8e9d91be2923e25
diff --git a/lib/controls/document.js b/lib/controls/document.js index <HASH>..<HASH> 100644 --- a/lib/controls/document.js +++ b/lib/controls/document.js @@ -21,3 +21,24 @@ function Document(container) { Document.prototype = Object.create(UIElement.prototype); Document.prototype.constructor = Document; + +Document.prototype.addDef = function (defsMarkup) { + if (!defsMarkup) throw new Error('DefsMarkup is required argument for Document.addDef() method'); + + var defs = getDefsElement(this._dom); + var defContent = require('../utils/domParser')(defsMarkup); + for (var i = 0; i < defContent.length; ++i) { + defs.appendChild(defContent[i]); + } +}; + +function getDefsElement(svgRoot) { + var children = svgRoot.childNodes; + for (var i = 0; children.length; ++i) { + if (children[i].localName === 'defs') return children[i]; + } + + var defs = require('../utils/svg')('defs'); + svgRoot.appendChild(defs); + return defs; +}
Added `addDef` method
anvaka_vivasvg
train
js
6204be8906efd51cc894c628c3e0748aeda26521
diff --git a/src/Test/WebTest/WebTestBase.php b/src/Test/WebTest/WebTestBase.php index <HASH>..<HASH> 100644 --- a/src/Test/WebTest/WebTestBase.php +++ b/src/Test/WebTest/WebTestBase.php @@ -205,7 +205,8 @@ class WebTestBase extends WebTestCase $doCheck = self::$client && !self::$conditionsChecked && $this->usesClient && self::$probablyWorking < 24 && !getenv('TestCaseDisableCheck') && ('PHPUnit_Framework_ExpectationFailedException' !== get_class($e) || - false === strpos($e->getMessage(), 'local problem ') + false === strpos($e->getMessage(), 'local problem ') && + false === strpos($e->getMessage(), '_routes.yml') ); if ($doCheck) { fwrite(STDOUT, " checking local problems - after a failure\n");
[Test] no failureCheck when SmokeTests reports "failure" of outdated _routes.yml
EmchBerger_cube-common-develop
train
php
966851621550edc227b6cd2e36bc2ff92486eb9a
diff --git a/lib/muster/version.rb b/lib/muster/version.rb index <HASH>..<HASH> 100644 --- a/lib/muster/version.rb +++ b/lib/muster/version.rb @@ -1,5 +1,5 @@ # Muster module Muster # Current version of Muster - VERSION = '0.0.11' + VERSION = '0.0.12' end
Updated version to <I>
claco_muster
train
rb
98b1c582189faee9ac40d81963008d94801f3837
diff --git a/src/structures/Message.js b/src/structures/Message.js index <HASH>..<HASH> 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -386,10 +386,10 @@ class Message extends Base { * @readonly */ get deletable() { - return ( + return Boolean( !this.deleted && - (this.author.id === this.client.user.id || - (this.guild && this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_MESSAGES, false))) + (this.author.id === this.client.user.id || + this.channel.permissionsFor?.(this.client.user)?.has(Permissions.FLAGS.MANAGE_MESSAGES)), ); }
fix(Message): update getters to take null permissions into account (#<I>) * fix(Message): update message#delete * refactor(Message): message#deletable avoid duplicate call * Update Message.js * fix(message): resolve syntax errors * chore(message): resolve linting issues (death to the gh web panel) * Update Message.js * death to the github web panel * Update src/structures/Message.js
discordjs_discord.js
train
js
35f4f48627efb2d09f21360e14b75e70d97d4fb5
diff --git a/lib/Core/Service/Mapper/ConfigMapper.php b/lib/Core/Service/Mapper/ConfigMapper.php index <HASH>..<HASH> 100644 --- a/lib/Core/Service/Mapper/ConfigMapper.php +++ b/lib/Core/Service/Mapper/ConfigMapper.php @@ -7,7 +7,7 @@ use Netgen\BlockManager\Config\Registry\ConfigDefinitionRegistryInterface; use Netgen\BlockManager\Core\Values\Config\Config; use Netgen\BlockManager\Core\Values\Config\ConfigCollection; -class ConfigMapper extends Mapper +class ConfigMapper { /** * @var \Netgen\BlockManager\Core\Service\Mapper\ParameterMapper
Remove unused extending of abstract Mapper class in ConfigMapper
netgen-layouts_layouts-core
train
php
49133c1aa0a13f595638038e9b4b7461c37a13f7
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -224,25 +224,13 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate if (func_num_args() == 2) { $value = $operator; - $operator = '==='; + $operator = '='; } return $this->filter($this->operatorForWhere($key, $operator, $value)); } /** - * Filter items by the given key value pair using loose comparison. - * - * @param string $key - * @param mixed $value - * @return static - */ - public function whereLoose($key, $value) - { - return $this->where($key, '=', $value); - } - - /** * Get an operator checker callback. * * @param string $key
Make Collection@where use loose comparison by default
illuminate_support
train
php
3289b8d4e23b67b0fb68260d796114e208add0b0
diff --git a/spec/kamerling/server/tcp_spec.rb b/spec/kamerling/server/tcp_spec.rb index <HASH>..<HASH> 100644 --- a/spec/kamerling/server/tcp_spec.rb +++ b/spec/kamerling/server/tcp_spec.rb @@ -25,9 +25,7 @@ module Kamerling describe Server::TCP do describe '#stop' do it 'stops the server' do - tcp = Server::TCP.new(addr: addr).start - addr = tcp.addr - tcp.stop + Server::TCP.new(addr: addr).start.stop run_all_threads -> { TCPSocket.open(*addr) }.must_raise Errno::ECONNREFUSED end
simplify Server::TCP#stop spec
chastell_kamerling
train
rb
cd579b65c434c640389e73ee98cb983524d11606
diff --git a/lib/sitemap.rb b/lib/sitemap.rb index <HASH>..<HASH> 100644 --- a/lib/sitemap.rb +++ b/lib/sitemap.rb @@ -160,7 +160,7 @@ module Sitemap private def get_data(object, data) - data.respond_to?(:call) ? data.call(object) : data + data.is_a?(Proc) ? data.call(object) : data end end
Using a more reliable way of determining if received data is a block.
viseztrance_rails-sitemap
train
rb
9632abce6cdc1358ad2c98cdadd3e5292a487968
diff --git a/intercom/__init__.py b/intercom/__init__.py index <HASH>..<HASH> 100644 --- a/intercom/__init__.py +++ b/intercom/__init__.py @@ -16,7 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. __author__ = 'OKso http://okso.me' -__version__ = '0.2' +__version__ = '0.2.1' from .relay import Relay from .controller import Controller diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ from setuptools import setup setup(name='Intercom', - version='0.2', + version='0.2.1', description='Messaging system for Home automation', author='OKso.me', author_email='@okso.me',
[enh] New bugfixes release
oksome_Intercom
train
py,py
9bb30a338432d96df68fcb6b70de760ae98a7ebf
diff --git a/buildAll_config.py b/buildAll_config.py index <HASH>..<HASH> 100755 --- a/buildAll_config.py +++ b/buildAll_config.py @@ -9,7 +9,7 @@ import subprocess # The build scripts expect the OpenSSL and Zlib src packages # to be in nassl's root folder -OPENSSL_DIR = join(getcwd(), 'openssl-1.0.2d') +OPENSSL_DIR = join(getcwd(), 'openssl-1.0.2e') # Warning: use a fresh Zlib src tree on Windows or build will fail # ie. do not use the same Zlib src folder for Windows and Unix build ZLIB_DIR = join(getcwd(), 'zlib-1.2.8')
Switched to OpenSSL <I>e in build config
nabla-c0d3_nassl
train
py
2fcdc9dc0bb108df959dbcbcbac064d09cdbe4e4
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,7 @@ require "navigator/action_view/instance_methods" require "pry" RSpec.configure do |config| - config.filter_run focus: true config.run_all_when_everything_filtered = true + config.treat_symbols_as_metadata_keys_with_true_values = true + config.filter_run focus: true end
Treat symbols and true values by default when running RSpec specs. [ci skip]
bkuhlmann_navigator
train
rb
3cb47c6cffd2715e56931336914016cbd9144bdb
diff --git a/impl/src/main/java/com/groupon/lex/metrics/timeseries/expression/RateExpression.java b/impl/src/main/java/com/groupon/lex/metrics/timeseries/expression/RateExpression.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/com/groupon/lex/metrics/timeseries/expression/RateExpression.java +++ b/impl/src/main/java/com/groupon/lex/metrics/timeseries/expression/RateExpression.java @@ -116,9 +116,9 @@ public class RateExpression implements TimeSeriesMetricExpression { @Override public TimeSeriesMetricDeltaSet apply(Context ctx) { - final Context previous = new PreviousContextWrapper(ctx, interval_ - .map(intv -> ctx.getTSData().getPreviousCollectionPairAt(intv)) - .orElseGet(() -> ctx.getTSData().getPreviousCollectionPair(1))); + final Context previous = new PreviousContextWrapper( + ctx, + ctx.getTSData().getPreviousCollectionPairAt(interval_.orElseGet(() -> ctx.getTSData().getCollectionInterval()))); final Duration collection_interval = new Duration( previous.getTSData().getCurrentCollection().getTimestamp(), ctx.getTSData().getCurrentCollection().getTimestamp());
Change how rate expression finds the previous collection.
groupon_monsoon
train
java
9e2b2c6806f65a159972d3930820713e1228213a
diff --git a/pyPodcastParser/Podcast.py b/pyPodcastParser/Podcast.py index <HASH>..<HASH> 100644 --- a/pyPodcastParser/Podcast.py +++ b/pyPodcastParser/Podcast.py @@ -254,10 +254,7 @@ class Podcast(): def set_owner(self): """Parses owner name and email then sets value""" - try: - owner = self.soup.find('itunes:owner') - except AttributeError: - owner = None + owner = self.soup.find('itunes:owner') try: self.owner_name = owner.find('itunes:name').string except AttributeError:
fixed unneeded try block in set_owner()
jrigden_pyPodcastParser
train
py
7fbe6691e19909c73b5144ba47f7a81244f67146
diff --git a/out_request.js b/out_request.js index <HASH>..<HASH> 100644 --- a/out_request.js +++ b/out_request.js @@ -515,12 +515,12 @@ TChannelOutRequest.prototype.onTimeout = function onTimeout(now) { } if (!self.res || self.res.state === States.Initial) { - self.end = now; self.timedOut = true; if (self.operations) { self.operations.checkLastTimeoutTime(now); self.operations.popOutReq(self.id); } + process.nextTick(deferOutReqTimeoutErrorEmit); }
out_request: set self.end in emitError() only
uber_tchannel-node
train
js
1097c162c68f22953b1a3d94de549d1da372a1b3
diff --git a/src/com/caverock/androidsvg/SVGParser.java b/src/com/caverock/androidsvg/SVGParser.java index <HASH>..<HASH> 100644 --- a/src/com/caverock/androidsvg/SVGParser.java +++ b/src/com/caverock/androidsvg/SVGParser.java @@ -590,6 +590,8 @@ public class SVGParser extends DefaultHandler radialGradient(attributes); } else if (localName.equalsIgnoreCase(TAG_STOP)) { stop(attributes); + } else if (localName.equalsIgnoreCase(TAG_A)) { + // do nothing } else { ignoring = true; ignoreDepth = 1;
Added nominal support for <a> so that its contents can be rendered.
BigBadaboom_androidsvg
train
java
feab0098ab26c7b602be25410c3afdb27a7112ed
diff --git a/src/main/java/net/openhft/chronicle/network/internal/lookuptable/FileBasedHostnamePortLookupTable.java b/src/main/java/net/openhft/chronicle/network/internal/lookuptable/FileBasedHostnamePortLookupTable.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/openhft/chronicle/network/internal/lookuptable/FileBasedHostnamePortLookupTable.java +++ b/src/main/java/net/openhft/chronicle/network/internal/lookuptable/FileBasedHostnamePortLookupTable.java @@ -294,5 +294,15 @@ public class FileBasedHostnamePortLookupTable implements HostnamePortLookupTable public int hashCode() { return Objects.hash(pid, hostname, port); } + + @Override + public String toString() { + return "ProcessScopedMapping{" + + "pid=" + pid + + ", hostname='" + hostname + '\'' + + ", port=" + port + + ", hasInetSocketAddress=" + (address != null) + + '}'; + } } }
Add toString method to ProcessScopedMapping
OpenHFT_Chronicle-Network
train
java
51c03f0d843e03c8ecbf035e09fc0af1d151a0fd
diff --git a/src/Drupal/DrupalExtension/Context/DrupalContext.php b/src/Drupal/DrupalExtension/Context/DrupalContext.php index <HASH>..<HASH> 100644 --- a/src/Drupal/DrupalExtension/Context/DrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/DrupalContext.php @@ -147,7 +147,7 @@ class DrupalContext extends MinkContext implements DrupalAwareInterface { * Override MinkContext::locatePath() to work around Selenium not supporting * basic auth. */ - protected function locatePath($path) { + public function locatePath($path) { $driver = $this->getSession()->getDriver(); if ($driver instanceof Selenium2Driver && isset($this->basic_auth)) { // Add the basic auth parameters to the base url. This only works for
Issue #<I> by langworthy: Fixed locatePath() should be public.
jhedstrom_drupalextension
train
php
b38305a5d4ec0e84543d97479b0d2ef2115e86c5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read(fname): setup( name='unleash', - version='0.4.3.dev1', + version='0.5.1.dev1', description=('Creates release commits directly in git, unleashes them on ' 'PyPI and pushes tags to github.'), long_description=read('README.rst'), diff --git a/unleash/__init__.py b/unleash/__init__.py index <HASH>..<HASH> 100644 --- a/unleash/__init__.py +++ b/unleash/__init__.py @@ -1 +1 @@ -__version__ = '0.4.3.dev1' +__version__ = '0.5.1.dev1'
Increased version to <I>.dev1 after release of <I>. (commit by unleash <I>.dev1)
mbr_unleash
train
py,py
7dcbdf37765c347b2ac304d847546c3c99ab263c
diff --git a/carrot/backends/pyamqplib.py b/carrot/backends/pyamqplib.py index <HASH>..<HASH> 100644 --- a/carrot/backends/pyamqplib.py +++ b/carrot/backends/pyamqplib.py @@ -172,6 +172,8 @@ class Backend(BaseBackend): def establish_connection(self): """Establish connection to the AMQP broker.""" conninfo = self.connection + if not conninfo.hostname: + raise KeyError("Missing hostname for AMQP connection.") if not conninfo.port: conninfo.port = self.default_port return Connection(host=conninfo.host,
amqplib: Raise KeyError if hostname isn't set, for a more friendly error message.
ask_carrot
train
py
083544823ca6a0974c702d65c494b633d2e151e0
diff --git a/peewee_migrate/auto.py b/peewee_migrate/auto.py index <HASH>..<HASH> 100644 --- a/peewee_migrate/auto.py +++ b/peewee_migrate/auto.py @@ -143,14 +143,17 @@ def diff_many(models1, models2, migrator=None, reverse=False): def model_to_code(Model, **kwargs): template = """class {classname}(pw.Model): {fields} +{meta} """ fields = INDENT + NEWLINE.join([ field_to_code(field, **kwargs) for field in Model._meta.sorted_fields if not (isinstance(field, pw.PrimaryKeyField) and field.name == 'id') ]) + meta = INDENT + NEWLINE.join(['class Meta:', + INDENT + 'db_table = "%s"' % Model._meta.db_table]) return template.format( classname=Model.__name__, - fields=fields + fields=fields, meta=meta ) diff --git a/tests/test_auto.py b/tests/test_auto.py index <HASH>..<HASH> 100644 --- a/tests/test_auto.py +++ b/tests/test_auto.py @@ -14,6 +14,7 @@ def test_auto(): code = model_to_code(Person_) assert code + assert 'db_table = "person"' in code changes = diff_many(models, [], migrator=migrator) assert len(changes) == 2
Support db_table in auto migrations.
klen_peewee_migrate
train
py,py
953ff6fbc85218750373c6229894da35d1aaf1ea
diff --git a/lib/dbf/record.rb b/lib/dbf/record.rb index <HASH>..<HASH> 100644 --- a/lib/dbf/record.rb +++ b/lib/dbf/record.rb @@ -42,7 +42,7 @@ module DBF key = key.to_s if attributes.has_key?(key) attributes[key] - elsif index = column_names.index(key) + elsif index = underscored_column_names.index(key) attributes[@columns[index].name] end end @@ -60,7 +60,7 @@ module DBF # @param [String, Symbol] method # @return [Boolean] def respond_to?(method, *args) - if column_names.include?(method.to_s) + if underscored_column_names.include?(method.to_s) true else super @@ -70,14 +70,15 @@ module DBF private def method_missing(method, *args) #nodoc + if index = underscored_column_names.index(method.to_s) attributes[@columns[index].name] else super end end - def column_names - @column_names ||= @columns.map {|column| column.underscored_name} + def underscored_column_names # nodoc + @underscored_column_names ||= @columns.map {|column| column.underscored_name} end def init_attribute(column) #nodoc
rename private column_names method
infused_dbf
train
rb
00b429769b1272235a3241db4d9f2eff32acd99d
diff --git a/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php b/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php @@ -76,8 +76,7 @@ class DataCollectorListener implements EventSubscriberInterface $this->dataCollector->collectSubmittedData($event->getForm()); // Assemble a form tree - // This is done again in collectViewVariables(), but that method - // is not guaranteed to be called (i.e. when no view is created) + // This is done again after the view is built, but we need it here as the view is not always created. $this->dataCollector->buildPreliminaryFormTree($event->getForm()); } }
Clarify a comment. The previous comment was lying since collectViewVariables() doesn't really call the buildPreliminaryFormTree() nor the buildFinalFormTree().
symfony_symfony
train
php
e3f0ae6068c06bf06650aa0d460daa28252b89ec
diff --git a/test/renderer/epics/github-publish-spec.js b/test/renderer/epics/github-publish-spec.js index <HASH>..<HASH> 100644 --- a/test/renderer/epics/github-publish-spec.js +++ b/test/renderer/epics/github-publish-spec.js @@ -156,7 +156,7 @@ describe('handleGistError', () => { }); describe('publishEpic', () => { - const input$ = Observable.of(PUBLISH_USER_GIST); + const input$ = Observable.of({ type: PUBLISH_USER_GIST }); const action$ = new ActionsObservable(input$); const store = { getState: function() { return this.state; }, state: { @@ -175,7 +175,7 @@ describe('publishEpic', () => { const responseActions = publishEpic(action$, store); const subscription = responseActions.subscribe( actionBuffer.push, // Every action that goes through should get stuck on an array - (err) => expect.fail(err, null), // It should not error in the stream + (err) => {}, // It should not error in the stream () => { expect(actionBuffer).to.deep.equal([]); // ; },
chore(EpicsTesting): Actually test epic.
nteract_nteract
train
js
186b9f31951f70870f95690badf43d313e1c6e09
diff --git a/lib/sfn/command/destroy.rb b/lib/sfn/command/destroy.rb index <HASH>..<HASH> 100644 --- a/lib/sfn/command/destroy.rb +++ b/lib/sfn/command/destroy.rb @@ -53,7 +53,7 @@ module Sfn nested_stack_cleanup!(n_stack) end nest_stacks = stack.template.fetch('Resources', {}).values.find_all do |resource| - resource['Type'] == stack.api.const_get(:RESOURCE_MAPPING).key(stack.class).to_s + resource['Type'] == stack.api.class.const_get(:RESOURCE_MAPPING).key(stack.class).to_s end.each do |resource| url = resource['Properties']['TemplateURL'] if(url)
Fix constant fetching for stack type comparison
sparkleformation_sfn
train
rb
3eca61280fe3ed37eee296379ea16b68029d1ed7
diff --git a/lib/search_engine.py b/lib/search_engine.py index <HASH>..<HASH> 100644 --- a/lib/search_engine.py +++ b/lib/search_engine.py @@ -3241,7 +3241,8 @@ def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf search_unit_in_bibrec(day1, day2), ap, aptext= _("No match within your time limits, " - "discarding this condition...")) + "discarding this condition..."), + of=of) except: if of.startswith("h"): req.write(create_error_box(req, verbose=verbose, ln=ln)) @@ -3261,7 +3262,8 @@ def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf search_pattern(req, pl, ap=0, ln=ln), ap, aptext=_("No match within your search limits, " - "discarding this condition...")) + "discarding this condition..."), + of=of) except: if of.startswith("h"): req.write(create_error_box(req, verbose=verbose, ln=ln))
removed another source of noise in the XML stream
inveniosoftware_invenio-records
train
py
9757c442a912e466d320a94cf2fd450add4cd02e
diff --git a/src/org/jgroups/blocks/TCPConnectionMap.java b/src/org/jgroups/blocks/TCPConnectionMap.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/blocks/TCPConnectionMap.java +++ b/src/org/jgroups/blocks/TCPConnectionMap.java @@ -84,7 +84,7 @@ public class TCPConnectionMap{ this.conn_expire_time = conn_expire_time; if(socket_factory != null) this.socket_factory=socket_factory; - this.srv_sock=Util.createServerSocket(socket_factory, service_name, bind_addr, srv_port, max_port); + this.srv_sock=Util.createServerSocket(this.socket_factory, service_name, bind_addr, srv_port, max_port); if(external_addr != null) local_addr=new IpAddress(external_addr, srv_sock.getLocalPort());
passed in incorrect SocketFactory
belaban_JGroups
train
java