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
f7108609580428414d34e0b10d72da986fae93c7
diff --git a/packages/jetpack-blocks/src/blocks/tiled-gallery/view.js b/packages/jetpack-blocks/src/blocks/tiled-gallery/view.js index <HASH>..<HASH> 100644 --- a/packages/jetpack-blocks/src/blocks/tiled-gallery/view.js +++ b/packages/jetpack-blocks/src/blocks/tiled-gallery/view.js @@ -18,7 +18,8 @@ function handleObservedResize( galleries ) { handleObservedResize.pendingRaf = null; for ( const gallery of galleries ) { const { width: galleryWidth } = gallery.contentRect; - const rows = Array.from( gallery.target.childNodes ); + // We can't use childNodes becuase post content may contain unexpected text nodes + const rows = Array.from( gallery.target.querySelectorAll( '.tiled-gallery__row' ) ); rows.forEach( row => handleRowResize( row, galleryWidth ) ); } } );
Tiled gallery: Add safety for mangled block output (#<I>)
Automattic_wp-calypso
train
js
0a610c1ad79df91ef9d0282fb6a85436f79215aa
diff --git a/packages/editor/src/setup-bolt.js b/packages/editor/src/setup-bolt.js index <HASH>..<HASH> 100644 --- a/packages/editor/src/setup-bolt.js +++ b/packages/editor/src/setup-bolt.js @@ -566,7 +566,7 @@ export function setupBolt(editor) { </bolt-interactive-pathways>`, }); - // Commented this out because this work was superceded by above starters. But leaving because they're simpler and client may want to reinstate. + // Commented this out because this was superceded by above starters. But leaving because they're simpler and client may want to reinstate. // registerBoltComponent({ // name: 'bolt-interactive-pathways', // schema: pathwaysSchema,
chore(micro-journey): trigger refresh by changing text
bolt-design-system_bolt
train
js
df4cbabc835cfb144d32c438042ad26b89c20eef
diff --git a/lib/ruby_it/document.rb b/lib/ruby_it/document.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_it/document.rb +++ b/lib/ruby_it/document.rb @@ -137,11 +137,11 @@ module RubyIt path = path + "/" end if $verbose==1 then - print("Output redirection to #{path} \n") + puts("Output redirection to #{path} \n") end else - print("ERROR Output redirection path specified is not valid \n") - print("#{path} is not a valid directory \n") + $stderr.puts("ERROR Output redirection path specified is not valid \n") + $stderr.puts("#{path} is not a valid directory \n") #Set error code and exit exit 1 end
Updated to use stderr for error messages
morganp_RubyIt
train
rb
63ee5ebc1e97a9c802c85be7c5a6eb185d76d350
diff --git a/pylon/solver.py b/pylon/solver.py index <HASH>..<HASH> 100644 --- a/pylon/solver.py +++ b/pylon/solver.py @@ -171,13 +171,20 @@ class _Solver(object): if b.type == REFERENCE] x0 = (xmin + xmax) / 2.0 + x0[Va.i1:Va.iN + 1] = va_refs[0] # Angles set to first reference angle. if ny > 0: yvar = self.om.get_var("y") + # Largest y-value in CCV data - c = [y for g in generators for _,y in g.p_cost if - g.pcost_model == PW_LINEAR] + c = [] + for g in generators: + if g.pcost_model == PW_LINEAR: + for _, y in g.p_cost: + c.append(y) + + x0[yvar.i1:yvar.iN + 1] = max(c) * 1.1 return x0
Handling mixed poly/pwl costs in solver.
rwl_pylon
train
py
6a87b539ca282345c14b2d5459bb9b921e461d36
diff --git a/astrobase/checkplot.py b/astrobase/checkplot.py index <HASH>..<HASH> 100644 --- a/astrobase/checkplot.py +++ b/astrobase/checkplot.py @@ -255,11 +255,11 @@ def _make_periodogram(axes, # get the stamp try: - dss = skyview_stamp(objectinfo['ra'], - objectinfo['decl'], - convolvewith=finderconvolve, - cachedir=findercachedir, - verbose=verbose) + dss, dssheader = skyview_stamp(objectinfo['ra'], + objectinfo['decl'], + convolvewith=finderconvolve, + cachedir=findercachedir, + verbose=verbose) stamp = dss # inset plot it on the current axes
checkplot: fix another thing tests were ignoring until today
waqasbhatti_astrobase
train
py
2ae7a4c07f9bbfc35fafc941bd48b2be9429118e
diff --git a/lib/symbol.js b/lib/symbol.js index <HASH>..<HASH> 100644 --- a/lib/symbol.js +++ b/lib/symbol.js @@ -15,7 +15,7 @@ module.exports = function BlastSymbol(Blast, Collection, Bound, Obj) { * * @author Jelle De Loecker <[email protected]> * @since 0.5.11 - * @version 0.5.11 + * @version 0.5.12 * * @param {String} description */ @@ -28,7 +28,7 @@ module.exports = function BlastSymbol(Blast, Collection, Bound, Obj) { } // Create the actual symbol - symbol = Obj.create(HiddenSymbol.prototype); + symbol = Object.create(HiddenSymbol.prototype); // Make sure the description is a string this.__description = (description === undefined ? '' : String(description));
Fix Symbol polyfill failing because of Object.create
skerit_protoblast
train
js
a22879631fbeab99ed385ea52ec34b47d4aea18d
diff --git a/src/engine/sequencer.js b/src/engine/sequencer.js index <HASH>..<HASH> 100644 --- a/src/engine/sequencer.js +++ b/src/engine/sequencer.js @@ -174,7 +174,8 @@ class Sequencer { // A "null block" - empty branch. thread.popStack(); } - while (thread.peekStack()) { + // Save the current block ID to notice if we did control flow. + while ((currentBlockId = thread.peekStack()) !== 0) { let isWarpMode = thread.peekStackFrame().warpMode; if (isWarpMode && !thread.warpTimer) { // Initialize warp-mode timer if it hasn't been already. @@ -183,8 +184,6 @@ class Sequencer { thread.warpTimer.start(); } // Execute the current block. - // Save the current block ID to notice if we did control flow. - currentBlockId = thread.peekStack(); if (this.runtime.profiler !== null) { if (executeProfilerId === -1) { executeProfilerId = this.runtime.profiler.idByName(executeProfilerFrame);
Optimize stepThread by reducing the number of calls to peekStack
LLK_scratch-vm
train
js
66432f3821badf24d526f2d9205f36c0543219de
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 = 8 // Minor version component of the current release - VersionPatch = 7 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 8 // Minor version component of the current release + VersionPatch = 7 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string.
params: release geth <I>
ethereum_go-ethereum
train
go
862b3c13e615337275478be616fc3f5daa6981cc
diff --git a/lib/open_graph_reader/fetcher.rb b/lib/open_graph_reader/fetcher.rb index <HASH>..<HASH> 100644 --- a/lib/open_graph_reader/fetcher.rb +++ b/lib/open_graph_reader/fetcher.rb @@ -29,6 +29,8 @@ module OpenGraphReader @fetch_failed = false @connection = Faraday.default_connection.dup @connection.headers.replace(HEADERS) + @head_response = nil + @get_response = nil prepend_middleware Faraday::CookieJar if defined? Faraday::CookieJar prepend_middleware FaradayMiddleware::FollowRedirects if defined? FaradayMiddleware
Initialize all instance vars in the Fetcher
jhass_open_graph_reader
train
rb
69f4c02d3de92a0bfa6e9f8418af70c53da11409
diff --git a/salt/returners/__init__.py b/salt/returners/__init__.py index <HASH>..<HASH> 100644 --- a/salt/returners/__init__.py +++ b/salt/returners/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +''' +Returners Directory +'''
Add encoding and docstring for returners
saltstack_salt
train
py
4aa65f1c96e1efdd7ecc1b9f28a002e8b20eb04d
diff --git a/cmd/swarmctl/managers/list.go b/cmd/swarmctl/managers/list.go index <HASH>..<HASH> 100644 --- a/cmd/swarmctl/managers/list.go +++ b/cmd/swarmctl/managers/list.go @@ -3,6 +3,7 @@ package managers import ( "fmt" "os" + "sort" "text/tabwriter" "github.com/docker/swarm-v2/api" @@ -10,6 +11,20 @@ import ( "github.com/spf13/cobra" ) +type managersByID []*api.Member + +func (m managersByID) Len() int { + return len(m) +} + +func (m managersByID) Swap(i, j int) { + m[i], m[j] = m[j], m[i] +} + +func (m managersByID) Less(i, j int) bool { + return m[i].ID < m[j].ID +} + var ( listCmd = &cobra.Command{ Use: "ls", @@ -58,7 +73,9 @@ var ( output = func(n *api.Member) { fmt.Println(n.ID) } } - for _, n := range r.Managers { + sortedManagers := managersByID(r.Managers) + sort.Sort(sortedManagers) + for _, n := range sortedManagers { output(n) } return nil
Sorting managers by ID for manager ls
docker_swarmkit
train
go
e7f2334e0ad50ebeda6a94ccaa231960cc7c412f
diff --git a/fastlane/lib/fastlane/version.rb b/fastlane/lib/fastlane/version.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/version.rb +++ b/fastlane/lib/fastlane/version.rb @@ -1,5 +1,5 @@ module Fastlane - VERSION = '2.45.0'.freeze + VERSION = '2.46.0'.freeze DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze MINIMUM_XCODE_RELEASE = "7.0".freeze end
Version bump to <I> (#<I>)
fastlane_fastlane
train
rb
faf31131ab16a287d11be259ed652231cda81b45
diff --git a/lib/data_mapper/adapters/postgres_adapter.rb b/lib/data_mapper/adapters/postgres_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/adapters/postgres_adapter.rb +++ b/lib/data_mapper/adapters/postgres_adapter.rb @@ -5,8 +5,18 @@ module DataMapper module Adapters class PostgresAdapter < DataObjectsAdapter + + TYPES = DataObjectsAdapter::TYPES.merge!({ + DateTime => 'timestamp'.freeze + }) def create_with_returning?; true; end + + def drop_table_statement(model) + <<-EOS.compress_lines + DROP TABLE IF EXISTS #{quote_table_name(model.storage_name(name))} + EOS + end end # class PostgresAdapter
tweaked the postgres adapter to work with <I>
datamapper_dm-core
train
rb
75e69d82d985f82d08d01360abb758107a09022b
diff --git a/bcbio/variation/samtools.py b/bcbio/variation/samtools.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/samtools.py +++ b/bcbio/variation/samtools.py @@ -54,7 +54,11 @@ def prep_mpileup(align_bams, ref_file, max_read_depth, config, if want_bcf: cl += ["-D", "-S", "-u"] if target_regions: - cl += ["-l", bamprep.region_to_gatk(target_regions)] + str_regions = bamprep.region_to_gatk(target_regions) + if os.path.isfile(str_regions): + cl += ["-l", str_regions] + else: + cl += ["-r", str_regions] cl += align_bams return " ".join(cl) @@ -70,4 +74,5 @@ def _call_variants_samtools(align_bams, ref_file, config, target_regions, out_fi "| {bcftools} view -v -c -g - " "| {vcfutils} varFilter -D {max_read_depth} " "> {out_file}") + logger.info(cmd.format(**locals())) subprocess.check_call(cmd.format(**locals()), shell=True)
Correctly restrict samtools mpileup by region when no BED file of calling regions supplied
bcbio_bcbio-nextgen
train
py
21fdf29fb76b666c997985a359ddfc4c0dcf7c67
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup(name='workflows', download_url="https://github.com/DiamondLightSource/python-workflows/releases", version='1.1', install_requires=[ - 'enum-compat', + 'enum34;python_version<"3.4"', 'six', 'stomp.py', ],
Retire enum-compat package Instead use the setuptools syntax to require the package conditionally dependening on the Python version. This is supported since setuptools <I> which has been around since April <I>, so should really be available on all target platforms.
DiamondLightSource_python-workflows
train
py
e7faab2ecb81c4550419bd1522de9dd8a766e4f8
diff --git a/packages/core/src/tree/index.js b/packages/core/src/tree/index.js index <HASH>..<HASH> 100644 --- a/packages/core/src/tree/index.js +++ b/packages/core/src/tree/index.js @@ -133,8 +133,7 @@ export default class Tree extends React.Component { const selected = selectedKeys.indexOf(item.key) > -1; const noChild = !item.children; const itemIsOpen = openKeys.indexOf(item.key) > -1; - let iconItem = icon && typeof icon === 'function' ? icon(item, itemIsOpen, noChild) : 'caret-right'; - iconItem = icon && typeof icon === 'string' ? icon : 'caret-right'; + const iconItem = icon && typeof icon === 'function' ? icon(item, itemIsOpen, noChild) : (icon && typeof icon === 'string' && icon) || 'caret-right'; return ( <li key={idx}> <div className={classnames(`${prefixCls}-label`)}>
fix(Tree): Fix icon props issue.
uiwjs_uiw
train
js
b8365acc39e40eff53010662974df86adc4083bb
diff --git a/sdk/python/sawtooth_sdk/consensus/zmq_driver.py b/sdk/python/sawtooth_sdk/consensus/zmq_driver.py index <HASH>..<HASH> 100644 --- a/sdk/python/sawtooth_sdk/consensus/zmq_driver.py +++ b/sdk/python/sawtooth_sdk/consensus/zmq_driver.py @@ -67,7 +67,7 @@ class ZmqDriver(Driver): break try: - message = self._stream.receive().result(0.1) + message = self._stream.receive().result(10) except concurrent.futures.TimeoutError: continue
Increase Python ZmqDriver stream receive timeout <I> seems to be too low, and the messages never get through to the engine. There may be a more appropriate number than <I>.
hyperledger_sawtooth-core
train
py
c9f86ab5bf759f0f234bfeb58a405f395ccb0aa6
diff --git a/gcloud/storage/connection.py b/gcloud/storage/connection.py index <HASH>..<HASH> 100644 --- a/gcloud/storage/connection.py +++ b/gcloud/storage/connection.py @@ -338,6 +338,8 @@ class Connection(connection.Connection): :rtype: :class:`gcloud.storage.bucket.Bucket` :returns: The newly created bucket. + :raises: :class:`gcloud.storage.exceptions.ConnectionError` if + there is a confict (bucket already exists, invalid name, etc.) """ bucket = self.new_bucket(bucket) response = self.api_request(method='POST', path='/b',
Document exceptions (currently) raised from 'Connection.create_bucket'. Note that #<I> would change this (by adding fine-grained exceptions for <I>, <I>, etc.). Fixes #<I> (but should be revisited if #<I> lands).
googleapis_google-cloud-python
train
py
d82dfd55374cb91fb2aea175c88ce32a9ab7efb5
diff --git a/tests/test_common.py b/tests/test_common.py index <HASH>..<HASH> 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -5,8 +5,9 @@ def test_hex2bin(): assert common.hex2bin('6E406B') == "011011100100000001101011" def test_crc_decode(): - checksum = common.crc("8D406B902015A678D4D220AA4BDA") - assert checksum == "000000000000000000000000" + for i in range(5000): + checksum = common.crc("8D406B902015A678D4D220AA4BDA") + assert checksum == "000000000000000000000000" def test_crc_encode(): parity = common.crc("8D406B902015A678D4D220AA4BDA", encode=True)
Extended test to stress the CRC function.
junzis_pyModeS
train
py
705a78f334254fa34df557de0c67ea9139d0499c
diff --git a/src/ServerRequestFactory.php b/src/ServerRequestFactory.php index <HASH>..<HASH> 100644 --- a/src/ServerRequestFactory.php +++ b/src/ServerRequestFactory.php @@ -58,23 +58,6 @@ abstract class ServerRequestFactory } /** - * Populates a request object from the given $_SERVER array - * - * @param array $server - * @param ServerRequestInterface $request - * @return void - * @deprecated as of 0.7.0. Use fromGlobals(). - * @throws Exception\DeprecatedMethodException on all requests. - */ - public static function fromServer(array $server, ServerRequestInterface $request = null) - { - throw new Exception\DeprecatedMethodException(sprintf( - '%s is deprecated as of phly/http 0.7.0dev; always use fromGlobals()', - __METHOD__ - )); - } - - /** * Access a value in an array, returning a default value if not found * * Will also do a case-insensitive search if a case sensitive search fails.
Remove Server::fromServer - Deprecated as of <I>; time to remove.
phly_http
train
php
fc5de47b2b16399d6942a02d77d2dd19d588aff1
diff --git a/bootstrap-select.js b/bootstrap-select.js index <HASH>..<HASH> 100644 --- a/bootstrap-select.js +++ b/bootstrap-select.js @@ -635,7 +635,7 @@ keyCodeMap = { 32:' ', 48:'0', 49:'1', 50:'2', 51:'3', 52:'4', 53:'5', 54:'6', 55:'7', 56:'8', 57:'9', 59:';', 65:'a', 66:'b', 67:'c', 68:'d', 69:'e', 70:'f', 71:'g', 72:'h', 73:'i', 74:'j', 75:'k', 76:'l', - 77:'m', 78:'n', 79:'o', 80:'p', 81:'q', 82:'r', 83:'s', 84:'t', 85:'u', 86:'v', 87:'w', 88:'x', + 77:'m', 78:'n', 79:'o', 80:'p', 81:'q', 82:'r', 83:'s', 84:'t', 85:'u', 86:'v', 87:'w', 88:'x', 89:'y', 90:'z', 96:'0', 97:'1', 98:'2', 99:'3', 100:'4', 101:'5', 102:'6', 103:'7', 104:'8', 105:'9' };
[#<I>] Resolve trailing whitespace
snapappointments_bootstrap-select
train
js
7885295e3b6a3bfc92b52db96eeb4bc0da9a0a23
diff --git a/src/Mapper/Nette/RelationshipMapperHasOne.php b/src/Mapper/Nette/RelationshipMapperHasOne.php index <HASH>..<HASH> 100644 --- a/src/Mapper/Nette/RelationshipMapperHasOne.php +++ b/src/Mapper/Nette/RelationshipMapperHasOne.php @@ -86,8 +86,12 @@ class RelationshipMapperHasOne extends Object implements IRelationshipMapper protected function fetch(SqlBuilder $builder, $hasJoin, array $values) { - $primaryKey = $this->targetRepository->getMapper()->getStorageReflection()->getStoragePrimaryKey()[0]; $values = array_values(array_unique(array_filter($values))); + if (count($values) === 0) { + return new EntityContainer([]); + } + + $primaryKey = $this->targetRepository->getMapper()->getStorageReflection()->getStoragePrimaryKey()[0]; $builder->addWhere($primaryKey, $values); $builder->addSelect(($hasJoin ? 'DISTINCT ' : '') . $builder->getTableName() . '.*'); $result = $this->context->queryArgs($builder->buildSelectQuery(), $builder->getParameters());
[mapper] do not make a useless query in HasOne relationship mapper
nextras_orm
train
php
56d530a0b2585874be67caf00ad153f95cbc1d7e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ cwd = os.path.dirname(os.path.abspath(__name__)) long_description = open(os.path.join(cwd, 'README.rst'), 'r').read() setup(name='uModbus', - version='0.6.0a0', + version='0.6.0a1', author='Auke Willem Oosterhoff', author_email='[email protected]', description='Implementation of the Modbus protocol in pure Python.',
Bump to <I>a1 again.
AdvancedClimateSystems_uModbus
train
py
ff4ccb6eb0be9f37c795978ba7d416fb2ccdfdbd
diff --git a/db.go b/db.go index <HASH>..<HASH> 100644 --- a/db.go +++ b/db.go @@ -531,25 +531,21 @@ func (db *DB) Close() error { } // DisableCompactions disables compactions. -func (db *DB) DisableCompactions() error { +func (db *DB) DisableCompactions() { if db.compacting { db.cmtx.Lock() db.compacting = false db.logger.Log("msg", "compactions disabled") } - - return nil } // EnableCompactions enables compactions. -func (db *DB) EnableCompactions() error { +func (db *DB) EnableCompactions() { if !db.compacting { db.cmtx.Unlock() db.compacting = true db.logger.Log("msg", "compactions enabled") } - - return nil } // Snapshot writes the current data to the directory.
Remove unnecessary error from ToggleCompaction fns
prometheus_prometheus
train
go
8fc10ad9ee17e0060ebe5483b97fc559b248499d
diff --git a/src/AwsClient.php b/src/AwsClient.php index <HASH>..<HASH> 100644 --- a/src/AwsClient.php +++ b/src/AwsClient.php @@ -273,6 +273,12 @@ class AwsClient implements AwsClientInterface return new Waiter($this, $name, $args, $config); } + public function __sleep() + { + throw new \RuntimeException('Instances of ' . static::class + . ' cannot be serialized'); + } + /** * Get the signature_provider function of the client. * diff --git a/tests/AwsClientTest.php b/tests/AwsClientTest.php index <HASH>..<HASH> 100644 --- a/tests/AwsClientTest.php +++ b/tests/AwsClientTest.php @@ -322,4 +322,14 @@ class AwsClientTest extends \PHPUnit_Framework_TestCase 'version' => 'latest' ]); } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage Instances of Aws\AwsClient cannot be serialized + */ + public function testDoesNotPermitSerialization() + { + $client = $this->createClient(); + \serialize($client); + } }
Throw a clear \RuntimeException when attempting to serialize an AwsClient.
aws_aws-sdk-php
train
php,php
b5f95fee88c306a1d50becca9850c74000ea4e72
diff --git a/src/js/examples/App.js b/src/js/examples/App.js index <HASH>..<HASH> 100644 --- a/src/js/examples/App.js +++ b/src/js/examples/App.js @@ -1,14 +1,14 @@ define(function(require) { 'use strict'; - var Modal = require('drc/modal/Modal.min'); - var PieChart = require('drc/pie-chart/PieChart.min'); - var PortalMixins = require('drc/mixins/PortalMixins.min'); + var Modal = require('drc/modal/Modal'); + var PieChart = require('drc/pie-chart/PieChart'); + var PortalMixins = require('drc/mixins/PortalMixins'); var React = require('react'); - var Search = require('drc/search/Search.min'); - var Table = require('drc/table/Table.min'); - var TableStore = require('drc/table/TableStore.min'); - var Utils = require('drc/utils/Utils.min'); + var Search = require('drc/search/Search'); + var Table = require('drc/table/Table'); + var TableStore = require('drc/table/TableStore'); + var Utils = require('drc/utils/Utils'); var tableDefinition = { url: '/test/table',
Removed references to minified files.
dataminr_react-components
train
js
7b38fa881747d7fe29b1d4885d3bc18576409245
diff --git a/src/extensions/default/StaticServer/node/StaticServerDomain.js b/src/extensions/default/StaticServer/node/StaticServerDomain.js index <HASH>..<HASH> 100644 --- a/src/extensions/default/StaticServer/node/StaticServerDomain.js +++ b/src/extensions/default/StaticServer/node/StaticServerDomain.js @@ -107,15 +107,16 @@ maxerr: 50, node: true */ * for example, IPv4, IPv6, or a UNIX socket. */ function _cmdGetServer(path, cb) { - // TODO: should we have a maximum number of servers open at once? - if (_servers[path]) { - cb(null, _servers[path].address()); + // Make sure the key doesn't conflict with some built-in property of Object. + var pathKey = "LiveDev_" + path; + if (_servers[pathKey]) { + cb(null, _servers[pathKey].address()); } else { _createServer(path, function (err, server) { if (err) { cb(err, null); } else { - _servers[path] = server; + _servers[pathKey] = server; cb(null, server.address()); } });
Guard against key collisions in _servers object
adobe_brackets
train
js
df245a40f5dbe37ca620ee71f1a7930cfccb5e42
diff --git a/test/integration.js b/test/integration.js index <HASH>..<HASH> 100644 --- a/test/integration.js +++ b/test/integration.js @@ -30,7 +30,7 @@ var inputGlob = path.join(inputBase, './*.txt'); var outputBase = path.join(base, './out/'); var outputSymlink = path.join(symlinkDirpath, './foo'); var outputDirpathSymlink = path.join(outputDirpath, './foo'); -var content = testConstants.content; +var content = testConstants.contents; var clean = cleanup(base);
Fix: Reference correct property name in integration testing (#<I>)
gulpjs_vinyl-fs
train
js
4666fd26fb74e30c2de1a32fe9dfaedef3dc3ccd
diff --git a/werkzeug/wsgi.py b/werkzeug/wsgi.py index <HASH>..<HASH> 100644 --- a/werkzeug/wsgi.py +++ b/werkzeug/wsgi.py @@ -183,6 +183,9 @@ def get_input_stream(environ, safe_fallback=True): # If the content length is negative we're dealing with a WSGI # server that gives us a chunked response already dechunked which # however means we don't know the actual content length. + # + # XXX: check this behavior against gunicorn/mod_wsgi and other + # WSGI servers to make a better decision if content_length == -1: return stream
Added a note on content length fetching
pallets_werkzeug
train
py
1c711f493dd4797bd5b50227d48b680589fe0470
diff --git a/src/java/com/threerings/io/Streamer.java b/src/java/com/threerings/io/Streamer.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/io/Streamer.java +++ b/src/java/com/threerings/io/Streamer.java @@ -521,7 +521,7 @@ public class Streamer /** A simple predicate to filter "NotStreamable" members from a Streamable object's fields. */ protected static final Predicate<Field> _isStreamableFieldPred = new Predicate<Field>() { - @Override public boolean apply (Field obj) { + public boolean apply (Field obj) { return (obj.getAnnotation(NotStreamable.class) == null); } };
Google's Predicate is an interface, and the build server uses Java 5, and you can't use @Override in java 5 when implementing an interface method. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
0611b19b9572c6cba52b46607d64731192609ff1
diff --git a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/runtime/SpillingBarrier.java b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/runtime/SpillingBarrier.java index <HASH>..<HASH> 100644 --- a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/runtime/SpillingBarrier.java +++ b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/runtime/SpillingBarrier.java @@ -31,12 +31,12 @@ public final class SpillingBarrier implements OutputChannelForwarder { @Override public boolean forward(final TransferEnvelope transferEnvelope) throws IOException, InterruptedException { - if (!this.isReceiverRunning) { + /*if (!this.isReceiverRunning) { // TODO: Add this to the spilling queue return false; - } + }*/ return true; }
Temporarily disabled SpillingBarrier
apache_flink
train
java
ce255e80667cf519d89e6b2e914cefd4b9e660ca
diff --git a/test/e2e/specs/specs-calypso/wp-my-home-support-search-spec.js b/test/e2e/specs/specs-calypso/wp-my-home-support-search-spec.js index <HASH>..<HASH> 100644 --- a/test/e2e/specs/specs-calypso/wp-my-home-support-search-spec.js +++ b/test/e2e/specs/specs-calypso/wp-my-home-support-search-spec.js @@ -57,13 +57,16 @@ describe( `[${ host }] My Home "Get help" support search card: (${ screenSize }) ); } ); - it( 'Displays Default Results initially', async function () { - supportSearchComponent = await SupportSearchComponent.Expect( this.driver ); + // Skipped because it depends on the existing state. If the user does not have a pending purchase + // it may show only 5 results, but this test doesn't try to create a purchase. + it.skip( 'Displays Default Results initially', async function () { + // supportSearchComponent = await SupportSearchComponent.Expect( this.driver ); const resultsCount = await supportSearchComponent.getDefaultResultsCount(); assert.equal( resultsCount, 6, 'There are not 6 Default Results displayed.' ); } ); it( 'Returns API Search Results for valid search query', async function () { + supportSearchComponent = await SupportSearchComponent.Expect( this.driver ); await supportSearchComponent.searchFor( 'Domain' ); const searchResultsCount = await supportSearchComponent.getSearchResultsCount();
ci(e2e): Skip flaky test (#<I>) * Skip flaky test * Update test/e2e/specs/specs-calypso/wp-my-home-support-search-spec.js
Automattic_wp-calypso
train
js
1cb35085fa0f241d1fb029427a8b6298ed06b299
diff --git a/libkbfs/mdserver_errors.go b/libkbfs/mdserver_errors.go index <HASH>..<HASH> 100644 --- a/libkbfs/mdserver_errors.go +++ b/libkbfs/mdserver_errors.go @@ -40,13 +40,16 @@ type MDServerError struct { func (e MDServerError) ToStatus() (s keybase1.Status) { s.Code = StatusCodeMDServerError s.Name = "SERVER_ERROR" - s.Desc = e.Err.Error() + s.Desc = e.Error() return } // Error implements the Error interface for MDServerError. func (e MDServerError) Error() string { - return e.Err.Error() + if e.Err != nil { + return e.Err.Error() + } + return "Generic error" } // MDServerErrorBadRequest is a generic client-side error.
forward user auth signature to mdserver return serialized folderHandle log error
keybase_client
train
go
eb89967969437c3aa0a47c00f7af0147ba731afa
diff --git a/host/pybar/scans/scan_fei4_self_trigger.py b/host/pybar/scans/scan_fei4_self_trigger.py index <HASH>..<HASH> 100644 --- a/host/pybar/scans/scan_fei4_self_trigger.py +++ b/host/pybar/scans/scan_fei4_self_trigger.py @@ -21,7 +21,7 @@ class FEI4SelfTriggerScan(Fei4RunBase): "col_span": [1, 80], # defining active column interval, 2-tuple, from 1 to 80 "row_span": [1, 336], # defining active row interval, 2-tuple, from 1 to 336 "overwrite_enable_mask": False, # if True, use col_span and row_span to define an active region regardless of the Enable pixel register. If False, use col_span and row_span to define active region by also taking Enable pixel register into account. - "use_enable_mask_for_imon": False, # if True, apply inverted Enable pixel mask to Imon pixel mask + "use_enable_mask_for_imon": True, # if True, apply inverted Enable pixel mask to Imon pixel mask "no_data_timeout": 10, # no data timeout after which the scan will be aborted, in seconds "scan_timeout": 60, # timeout for scan after which the scan will be stopped, in seconds }
ENH: std. setting should always activate hit bus to make it work 'out of the box'
SiLab-Bonn_pyBAR
train
py
89a8a1e47818216d3963d5f562d3280b3f60f999
diff --git a/src/main/java/com/addicticks/net/httpsupload/HttpsFileUploader.java b/src/main/java/com/addicticks/net/httpsupload/HttpsFileUploader.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/addicticks/net/httpsupload/HttpsFileUploader.java +++ b/src/main/java/com/addicticks/net/httpsupload/HttpsFileUploader.java @@ -396,7 +396,7 @@ public class HttpsFileUploader { /** * Uploads a file. This is a convenience method of the more general - * {@link #upload(com.addicticks.net.httpsupload.HttpsFileUploaderConfig, java.util.Map, java.util.Map, com.addicticks.net.httpsupload.FileUploadProgress) uploadFile()}. + * {@link #upload(com.addicticks.net.httpsupload.HttpsFileUploaderConfig, java.util.Map, java.util.Map, com.addicticks.net.httpsupload.FileUploadProgress) upload(...) method}. * The method only uploads a single file and expects the destination field for * the file on the server to be named "file". *
Changed name of essential method from "uploadFile" to simply "upload".
Addicticks_httpsupload
train
java
92b51dab5305666474713cd735c0e5303393d0de
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,9 @@ def main(): tests_require=ldict['TESTS_REQUIRES'], extras_require=ldict['EXTRA_REQUIRES'], # Data - package_data={'niworkflows': ['data/t1-mni_registration*.json', 'viz/*.tpl']}, + package_data={'niworkflows': ['data/t1-mni_registration*.json', 'viz/*.tpl', + 'nipype/pipeline/engine/report_template.html', + 'nipype/external/d3.js']}, include_package_data=True, )
FIX: Add nipype resources for report generation
poldracklab_niworkflows
train
py
ec7fd69b48a677123c32a630d45518f3cfb0fce9
diff --git a/src/main/java/org/junit/internal/MethodSorter.java b/src/main/java/org/junit/internal/MethodSorter.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/junit/internal/MethodSorter.java +++ b/src/main/java/org/junit/internal/MethodSorter.java @@ -17,7 +17,7 @@ public class MethodSorter { if (i1 != i2) { return i1 < i2 ? -1 : 1; } - return MethodSorter.compare(m1.toString(), m2.toString()); + return NAME_ASCENDING.compare(m1, m2); } }; @@ -26,13 +26,13 @@ public class MethodSorter { */ public static Comparator<Method> NAME_ASCENDING= new Comparator<Method>() { public int compare(Method m1, Method m2) { - return MethodSorter.compare(m1.getName() + m1.toString(), m2.getName() + m2.toString()); + final int comparison = m1.getName().compareTo(m2.getName()); + if (comparison != 0) { + return comparison; + } + return m1.toString().compareTo(m2.toString()); } }; - - private static int compare(String s1, String s2) { - return s1.compareTo(s2); - } /** * Gets declared methods of a class in a predictable order, unless @FixMethodOrder(MethodSorters.JVM) is specified.
NAME_ASCENDING comparator is now more clear, DEFAULT delegates to NAME_ASCENDING in case the hash codes are equal. no more private compare method
junit-team_junit4
train
java
f9e50e5b477f10f55c0c4e5076a5e7a94feb35d9
diff --git a/Eloquent/Model.php b/Eloquent/Model.php index <HASH>..<HASH> 100644 --- a/Eloquent/Model.php +++ b/Eloquent/Model.php @@ -1155,7 +1155,9 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab public function getTable() { if (! isset($this->table)) { - return str_replace('\\', '', Str::snake(Str::plural(class_basename($this)))); + $this->setTable(str_replace( + '\\', '', Str::snake(Str::plural(class_basename($this))) + )); } return $this->table;
set table name for better performance (#<I>)
illuminate_database
train
php
7bf9c85341793e124f8be23f5fee80ffd8fe8a3c
diff --git a/code/fulfilment/OrderProcessor.php b/code/fulfilment/OrderProcessor.php index <HASH>..<HASH> 100644 --- a/code/fulfilment/OrderProcessor.php +++ b/code/fulfilment/OrderProcessor.php @@ -195,10 +195,7 @@ class OrderProcessor{ */ public function completePayment() { if(!$this->order->Paid){ - if(!$this->order->ReceiptSent){ - $this->sendReceipt(); - } - $this->order->extend('onPayment'); //a payment has been made + $this->order->extend('onPayment'); //place the order, if not already placed if($this->canPlace($this->order)){ $this->placeOrder(); @@ -213,6 +210,9 @@ class OrderProcessor{ } $this->order->extend('onPaid'); //all payment is settled } + if(!$this->order->ReceiptSent){ + $this->sendReceipt(); + } } }
Make sure order receipt is only sent once order updating has finished (so that sent data is correct). Fixes: #<I>
silvershop_silvershop-core
train
php
bc0ee18ec7ab592acfc0bb05e84da70c0d6c1464
diff --git a/dictobj_test.py b/dictobj_test.py index <HASH>..<HASH> 100644 --- a/dictobj_test.py +++ b/dictobj_test.py @@ -11,7 +11,13 @@ class TestDictionaryObject(unittest.TestCase): self.mutableDefault = MutableDictionaryObject((), None, b=4) def test_pickle(self): - pass + default = pickle.loads(pickle.dumps(self.default)) + self.assertEqual(default, self.default) + + mutable = pickle.loads(pickle.dumps(self.mutable)) + self.assertEqual(mutable, self.mutable) + mutable.a = 500 + self.assertNotEqual(mutable, self.mutable) def test_copy(self): m = MutableDictionaryObject(self.default) @@ -19,6 +25,7 @@ class TestDictionaryObject(unittest.TestCase): m.a = 2 self.assertNotEqual(m, self.default) + self.assertLess(m, self.default) def test_len(self): self.assertEqual(3, len(self.kinky))
When both objects have a default value of None, comparisons do not work correctly. These new tests catch that, even though a fix has not been generated yet.
grimwm_py-dictobj
train
py
2939506cfd1b3cce5e6a7f7f1982fbe280bf0df9
diff --git a/lxd/db/node.go b/lxd/db/node.go index <HASH>..<HASH> 100644 --- a/lxd/db/node.go +++ b/lxd/db/node.go @@ -39,8 +39,9 @@ var ClusterRoles = map[int]ClusterRole{} // Numeric type codes identifying different cluster member states. const ( - ClusterMemberStateCreated = 0 - ClusterMemberStatePending = 1 + ClusterMemberStateCreated = 0 + ClusterMemberStatePending = 1 + ClusterMemberStateEvacuated = 2 ) // NodeInfo holds information about a single LXD instance in a cluster.
lxd/db: Add ClusterMemberStateEvacuated
lxc_lxd
train
go
2284ceb9534175ad65bd419037778bd28382c299
diff --git a/test/__tests/events.js b/test/__tests/events.js index <HASH>..<HASH> 100644 --- a/test/__tests/events.js +++ b/test/__tests/events.js @@ -1232,12 +1232,14 @@ test( 'Inflight unsubscribe works (#1504)', t => { expect( 3 ); - ractive.on( 'foo', function first () { + function first () { t.ok( true ); ractive.off( 'foo', first ); - }); + } - ractive.on( 'foo', function second () { + ractive.on( 'foo', first ); + + ractive.on( 'foo', function () { t.ok( true ); });
accommodate more ie8 stupidity
ractivejs_ractive
train
js
ed5fcbfd48266d962744be4a5a872b891f1cd9cf
diff --git a/sea/cli.py b/sea/cli.py index <HASH>..<HASH> 100644 --- a/sea/cli.py +++ b/sea/cli.py @@ -98,8 +98,14 @@ class NewCmd(AbstractCommand): def opt(self, subparsers): p = subparsers.add_parser( 'new', aliases=['n'], help='Create Sea Project') + p.add_argument('project', help='project name') p.add_argument( - 'project', help='project name') + '--skip-git', action='store_true', + help='skip add git files and run git init') + p.add_argument( + '--skip-orator', action='store_true', help='skip orator') + p.add_argument( + '--skip-consul', action='store_true', help='skip consul') return p def run(self, args, extra=[]):
add skip params to cmd new
shanbay_sea
train
py
02858fdf089bce0e4bb7901ef8e5b13d61e91c01
diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -163,7 +163,7 @@ eos end def valid_include_file?(path, dir, safe) - !(outside_site_source?(path, dir, safe) || !File.file?(path)) + !outside_site_source?(path, dir, safe) && File.file?(path) end def outside_site_source?(path, dir, safe)
include: improve boolean logic in #valid_include_file?
jekyll_jekyll
train
rb
ac26de205e93c104a62eb737128a75e9b6ee4a27
diff --git a/hugolib/site.go b/hugolib/site.go index <HASH>..<HASH> 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -174,7 +174,7 @@ func (s *Site) loadTemplates() { } func (s *Site) primeTemplates() { - alias := "<!DOCTYPE html>\n <html>\n <head>\n <link rel=\"canonical\" href=\"{{ . }}\"/>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n <meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" />\n </head>\n </html>" + alias := "<!DOCTYPE html>\n <html>\n <head>\n <link rel=\"canonical\" href=\"{{ .Permalink }}\"/>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n <meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" />\n </head>\n </html>" t := s.Tmpl.New("alias") template.Must(t.Parse(alias))
Adding correct canonical link to alias pages
gohugoio_hugo
train
go
a2ad33a8e907e41e82468e8f7a09aa7f666ac23c
diff --git a/ipcalc.py b/ipcalc.py index <HASH>..<HASH> 100644 --- a/ipcalc.py +++ b/ipcalc.py @@ -343,13 +343,12 @@ class IP(object): >>> ip = IP("::1") >>> print repr(ip) - IP('0000:0000:0000:0000:0000:0000:0000:0001', mask=128, version=6) + IP('0000:0000:0000:0000:0000:0000:0000:0001', mask=128) ''' - return "%s('%s', mask=%d, version=%d)" % ( + return "%s('%s', mask=%d)" % ( self.__class__.__name__, self.dq, - self.mask, - self.v) + self.mask) def __hash__(self): return hash(self.to_tuple()) @@ -387,7 +386,7 @@ class IP(object): >>> ip = IP('127.0.0.1') >>> ip2 = ip.clone() >>> ip2 - IP('127.0.0.1', mask=32, version=4) + IP('127.0.0.1', mask=32) >>> ip is ip2 False >>> ip == ip2
Remove version=4 bit from repr.
tehmaze_ipcalc
train
py
ce64872ab6210c5d3ca75390be0b3e5abb93b5c6
diff --git a/pyzomato/pyzomato.py b/pyzomato/pyzomato.py index <HASH>..<HASH> 100755 --- a/pyzomato/pyzomato.py +++ b/pyzomato/pyzomato.py @@ -1,4 +1,4 @@ -from api import Api +from .api import Api class Pyzomato(object): 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='pyzomato', - version='0.3', + version='0.4', description='Python Zomato Api Wrapper', url='https://github.com/fatihsucu/pyzomato', author='Fatih Sucu',
Tested and fixed python3 compatibilty Fixes #3
fatihsucu_pyzomato
train
py,py
649121eaa9671888064cae87a66cc64d60032974
diff --git a/tests/Fixer/Symfony/MethodSeparationFixerTest.php b/tests/Fixer/Symfony/MethodSeparationFixerTest.php index <HASH>..<HASH> 100644 --- a/tests/Fixer/Symfony/MethodSeparationFixerTest.php +++ b/tests/Fixer/Symfony/MethodSeparationFixerTest.php @@ -115,6 +115,17 @@ class SomeClass } } '); + $cases[] = array('<?php +class SomeClass +{ + // This comment + // is multiline. + public function echoA() + { + echo "a"; + } +} +'); $cases[] = array( '<?php class SomeClass
MethodSeparationFixer - report bug
FriendsOfPHP_PHP-CS-Fixer
train
php
b0a1f8a00492829bd4634629e086fb57a31b8583
diff --git a/test/test_app.rb b/test/test_app.rb index <HASH>..<HASH> 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -1086,11 +1086,11 @@ context "Default keybindings" do @wiki = Gollum::Wiki.new(@path) @url = '/gollum/create/test' Precious::App.set(:gollum_path, @path) - Precious::App.set(:wiki_options, {}) end teardown do FileUtils.rm_rf(@path) + Precious::App.set(:wiki_options, {default_keybinding: nil}) end test 'keybinding unset' do
Refactor test teardown I saw a random (??) failure on the test on line <I>. This trivial chang e just ensures that the configuration under test (the default keybinding) is explicitly being set to `nil` after test runs.
gollum_gollum
train
rb
1974b35aa366c525ca3d6aa2fc8bec37aa4a069c
diff --git a/Console/PruneCommand.php b/Console/PruneCommand.php index <HASH>..<HASH> 100644 --- a/Console/PruneCommand.php +++ b/Console/PruneCommand.php @@ -62,7 +62,7 @@ class PruneCommand extends Command /** * Determine the models that should be pruned. * - * @return array + * @return \Illuminate\Support\Collection */ protected function models() {
[<I>] Fix return type in PruneCommand (#<I>)
illuminate_database
train
php
3f004f89620cdb18080b7d1d858e01974cd20532
diff --git a/src/UniAlteri/States/Factory/FactoryTrait.php b/src/UniAlteri/States/Factory/FactoryTrait.php index <HASH>..<HASH> 100644 --- a/src/UniAlteri/States/Factory/FactoryTrait.php +++ b/src/UniAlteri/States/Factory/FactoryTrait.php @@ -310,8 +310,9 @@ trait FactoryTrait //Load each state into proxy foreach ($statesList as $loadingStateName=>$finderLoader) { $stateObject = $finderLoader->buildState($loadingStateName); - $stateObject->setDIContainer($diContainerObject); - $stateObject->setPrivateMode($finderLoader !== $mainFinder); + $stateObject->setDIContainer($diContainerObject) + ->setPrivateMode($finderLoader !== $mainFinder) + ->setStatedClassName($finderLoader->getStatedClassName()) $proxyObject->registerState($loadingStateName, $stateObject); }
To set the stated class name of the origin of a state in the factory
TeknooSoftware_states
train
php
40555a96538768686dc88e16164dda492b883899
diff --git a/micawber/providers.py b/micawber/providers.py index <HASH>..<HASH> 100644 --- a/micawber/providers.py +++ b/micawber/providers.py @@ -175,7 +175,7 @@ def bootstrap_basic(cache=None, registry=None): # i pr.register('http://www.ifixit.com/Guide/View/\S+', Provider('http://www.ifixit.com/Embed')) pr.register('http://\S*imgur\.com/\S+', Provider('http://api.imgur.com/oembed')), - pr.register('https?://instagr(\.am|am\.com)/p/\S+', Provider('http://api.instagram.com/oembed')) + pr.register('https?://(www\.)?instagr(\.am|am\.com)/p/\S+', Provider('http://api.instagram.com/oembed')) # j pr.register('http://www.jest.com/(video|embed)/\S+', Provider('http://www.jest.com/oembed.json'))
Support www for instagram urls
coleifer_micawber
train
py
73c27a3e5ed5671953f4ccae7c41bbdc5b6c7b89
diff --git a/MAVProxy/modules/mavproxy_param.py b/MAVProxy/modules/mavproxy_param.py index <HASH>..<HASH> 100644 --- a/MAVProxy/modules/mavproxy_param.py +++ b/MAVProxy/modules/mavproxy_param.py @@ -210,7 +210,7 @@ class ParamModule(mp_module.MPModule): super(ParamModule, self).__init__(mpstate, "param", "parameter handling", public = True) self.pstate = ParamState(self.mav_param, self.logdir, self.vehicle_name, 'mav.parm') self.add_command('param', self.cmd_param, "parameter handling", - ["<fetch|download>", + ["<download>", "<set|show|fetch|help> (PARAMETER)", "<load|save|diff> (FILENAME)"]) if self.continue_mode and self.logdir != None:
param: fixed completion of param fetch
ArduPilot_MAVProxy
train
py
efe63420574f34355f0b578666d32bd80f6da87e
diff --git a/lib/formtastic/helpers/inputs_helper.rb b/lib/formtastic/helpers/inputs_helper.rb index <HASH>..<HASH> 100644 --- a/lib/formtastic/helpers/inputs_helper.rb +++ b/lib/formtastic/helpers/inputs_helper.rb @@ -529,9 +529,14 @@ module Formtastic out end - # A thin wrapper around Rails' `fields_for` helper to set `:builder => Formtastic::FormBuilder` - # for nesting forms. Can be used in the same way as `fields_for` (see the Rails documentation), - # but you'll also have access to Formtastic's helpers ({#input}, etc) inside the block. + # A thin wrapper around `ActionView::Helpers::FormBuilder#fields_for` helper to set + # `:builder => Formtastic::FormBuilder` for nesting forms inside the builder. Can be used in + # the same way, but you'll also have access to the helpers in `Formtastic::FormBuilder` + # (such as {#input}, etc) inside the block. + # + # @see http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-fields_for ActionView::Helpers::FormBuilder#fields_for + # @see http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-fields_for ActionView::Helpers::FormHelper#fields_for + # @see Formtastic::Helpers::FormHelper#semantic_fields_for # # @example # <% semantic_form_for @post do |post| %>
improve documentation of semantic_fields_for in FormBuilder
justinfrench_formtastic
train
rb
ea2d0199fce35ec26208da92ad9f838fa5df8bd7
diff --git a/src/main/java/water/api/HitRatio.java b/src/main/java/water/api/HitRatio.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/api/HitRatio.java +++ b/src/main/java/water/api/HitRatio.java @@ -63,10 +63,9 @@ public class HitRatio extends Request2 { if (max_k > predict.numCols()-1) throw new IllegalArgumentException("K cannot be larger than " + String.format("%,d", predict.numCols()-1)); - final Frame actual_predict = new Frame(predict.names(), predict.vecs()); + final Frame actual_predict = new Frame(predict.names().clone(), predict.vecs().clone()); actual_predict.replace(0, va); // place actual labels in first column hit_ratios = new HitRatioTask(max_k, seed).doAll(actual_predict).hit_ratios(); - return Response.done(this); } catch( Throwable t ) { return Response.error(t);
Bugfix in HitRatio request.
h2oai_h2o-2
train
java
4b84866db7030874be1ad6bb024361724dfaf1c1
diff --git a/chess/pgn.py b/chess/pgn.py index <HASH>..<HASH> 100644 --- a/chess/pgn.py +++ b/chess/pgn.py @@ -481,21 +481,14 @@ class Game(GameNode): @classmethod def from_board(cls, board): """Creates a game from the move stack of a :class:`~chess.Board()`.""" - # Undo all moves. - switchyard = collections.deque() - while board.move_stack: - switchyard.append(board.pop()) - # Setup the initial position. game = cls() - game.setup(board) + game.setup(board.root()) node = game # Replay all moves. - while switchyard: - move = switchyard.pop() + for move in board.move_stack: node = node.add_variation(move) - board.push(move) game.headers["Result"] = board.result() return game
Optimize chess.pgn.Game.from_board()
niklasf_python-chess
train
py
1850ee1f033a6df1311f1669548824f252f7f473
diff --git a/datadog_checks_base/datadog_checks/base/checks/base.py b/datadog_checks_base/datadog_checks/base/checks/base.py index <HASH>..<HASH> 100644 --- a/datadog_checks_base/datadog_checks/base/checks/base.py +++ b/datadog_checks_base/datadog_checks/base/checks/base.py @@ -491,12 +491,12 @@ class __AgentCheck(object): self, self.check_id, self._format_namespace(name, raw), status, tags, hostname, message ) - def _log_deprecation(self, deprecation_key): + def _log_deprecation(self, deprecation_key, *args): """ Logs a deprecation notice at most once per AgentCheck instance, for the pre-defined `deprecation_key` """ if not self._deprecations[deprecation_key][0]: - self.warning(self._deprecations[deprecation_key][1]) + self.warning(self._deprecations[deprecation_key][1].format(*args)) self._deprecations[deprecation_key][0] = True # TODO: Remove once our checks stop calling it
Allow deprecation notice strings to be formatted (#<I>)
DataDog_integrations-core
train
py
9a47d3987c47c397a5996afe2a838a4dd90e1805
diff --git a/lib/whoAmI.js b/lib/whoAmI.js index <HASH>..<HASH> 100644 --- a/lib/whoAmI.js +++ b/lib/whoAmI.js @@ -22,8 +22,12 @@ module.exports = function(uuid, owner, callback) { } else { if(!owner){ - // remove token from results object - delete devicedata.token; + if (devicedata.type == 'gateway' && devicedata.owner == undefined ){ + + } else { + // remove token from results object + delete devicedata.token; + } } console.log('Device whoami: ' + JSON.stringify(devicedata));
tweaked whoami to handle gateway discovery requests
octoblu_meshblu
train
js
9cae3799212bc885b4dba1f4ca9c6f61fa487816
diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index <HASH>..<HASH> 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -894,7 +894,7 @@ function glossary_search($course, $searchterms, $extended = 0, $glossary = NULL) foreach ( $glossaries as $glossary ) { $glos .= "$glossary->id,"; } - $glos = substr($ents,0,-1); + $glos = substr($glos,0,-1); } } else { $glos = $glossary->id;
fixed typo, undefined $ents
moodle_moodle
train
php
e07dc91d18146c86897a32eb2270156b0e204033
diff --git a/lib/node_modules/@stdlib/datasets/sotu/test/test.get_file.js b/lib/node_modules/@stdlib/datasets/sotu/test/test.get_file.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/datasets/sotu/test/test.get_file.js +++ b/lib/node_modules/@stdlib/datasets/sotu/test/test.get_file.js @@ -3,7 +3,7 @@ // MODULES // var tape = require( 'tape' ); -var proxyquire = require( 'proxyquire' ); +var proxyquire = require( 'proxyquire' ).noPreserveCache(); var isObject = require( '@stdlib/utils/is-object' ); // TODO: plain object var getFile = require( './../lib/get_file.js' );
Load modules fresh each time to address shared state issue
stdlib-js_stdlib
train
js
68ced63e51c25e243622ca96e5d8474ff8ca714d
diff --git a/php/WP_CLI/Runner.php b/php/WP_CLI/Runner.php index <HASH>..<HASH> 100644 --- a/php/WP_CLI/Runner.php +++ b/php/WP_CLI/Runner.php @@ -727,14 +727,16 @@ class Runner { if ( empty( $this->arguments ) ) $this->arguments[] = 'help'; - // Protect 'cli info' from most of the runtime - if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { + // Protect 'cli info' from most of the runtime, + // except when the command will be run over SSH + if ( 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] && ! $this->config['ssh'] ) { $this->_run_command(); exit; } - // Protect 'package' commands from most of the runtime too - if ( 'package' === $this->arguments[0] ) { + // Protect 'package' commands from most of the runtime too, + // except when the command will be run over SSH + if ( 'package' === $this->arguments[0] && ! $this->config['ssh'] ) { $this->_run_command(); exit; }
Permit managing packages and running `wp cli info` over SSH
wp-cli_export-command
train
php
c2d8f880b96fe9eab602a57dff7dd09ac41164bc
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -143,7 +143,7 @@ function lint (userConfig, fileOrDir, ignore) { lintErrors = solium.lint (sourceCode, userConfig); } catch (e) { console.log ( - 'An error occured while running the linter on ' + codeFileName + ':\n' + e + 'An error occured while running the linter on ' + codeFileName + ':\n' + e.stack ); return; }
print stack trace for error while running linter
duaraghav8_Ethlint
train
js
4cf51983df1a1f98364994a9965f0f3f1943116a
diff --git a/holoviews/plotting/mpl/element.py b/holoviews/plotting/mpl/element.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/mpl/element.py +++ b/holoviews/plotting/mpl/element.py @@ -515,7 +515,11 @@ class LegendPlot(ElementPlot): legend_position = param.ObjectSelector(objects=['inner', 'right', 'bottom', 'top', - 'left', 'best'], + 'left', 'best', + 'top_right', + 'top_left', + 'bottom_left', + 'bottom_right'], default='inner', doc=""" Allows selecting between a number of predefined legend position options. The predefined options may be customized in the @@ -529,7 +533,11 @@ class LegendPlot(ElementPlot): ncol=3, loc=3, mode="expand", borderaxespad=0.), 'bottom': dict(ncol=3, mode="expand", loc=2, bbox_to_anchor=(0., -0.25, 1., .102), - borderaxespad=0.1)} + borderaxespad=0.1), + 'top_right': dict(loc=1), + 'top_left': dict(loc=2), + 'bottom_left': dict(loc=3), + 'bottom_right': dict(loc=4)}
Matplotlib backend now supports same legend_position as bokeh Addresses issue #<I>
pyviz_holoviews
train
py
2f1718db30415d8891bdfc5335764df3d940e35d
diff --git a/server/request_handling_test.go b/server/request_handling_test.go index <HASH>..<HASH> 100644 --- a/server/request_handling_test.go +++ b/server/request_handling_test.go @@ -1249,7 +1249,8 @@ var _ = Describe("When a client connects", func() { Eventually(serverBackend.DestroyCallCount, 2*time.Second).Should(Equal(1)) Ω(serverBackend.DestroyArgsForCall(0)).Should(Equal("some-handle")) - Ω(time.Since(before)).Should(BeNumerically("~", graceTime, 100*time.Millisecond)) + Ω(time.Since(before)).Should(BeNumerically(">=", graceTime)) + Ω(time.Since(before)).Should(BeNumerically("<", graceTime+time.Second)) }) })
Change the assertion to be more lenient [finishes #<I>]
cloudfoundry_garden
train
go
82ecbfd927083f8be3747c168fdbe3e1c78ef875
diff --git a/spec/data_visitor_spec.rb b/spec/data_visitor_spec.rb index <HASH>..<HASH> 100644 --- a/spec/data_visitor_spec.rb +++ b/spec/data_visitor_spec.rb @@ -87,6 +87,7 @@ describe Shape::DataVisitor do it 'returns the raw visited data' do expect(subject).to include(:spouse) + expect(subject[:spouse]).to eq(nil) expect(subject[:children]).to eq([]) end end @@ -100,6 +101,7 @@ describe Shape::DataVisitor do it 'returns the raw visited data' do expect(subject).to include(:spouse) + expect(subject[:spouse]).to eq(nil) expect(subject[:children]).to eq([]) end end
Check both key & value on empty relations
robincurry_shape
train
rb
68a18294aea8770958d29543c30bc2f68e497e76
diff --git a/lib/licensed/sources/npm.rb b/lib/licensed/sources/npm.rb index <HASH>..<HASH> 100644 --- a/lib/licensed/sources/npm.rb +++ b/lib/licensed/sources/npm.rb @@ -147,7 +147,7 @@ module Licensed end def extract_version(parent, name) - parent.dig("_dependencies", name) || peer_dependency(parent, name) + parent&.dig("_dependencies", name) || peer_dependency(parent, name) end end end
Update lib/licensed/sources/npm.rb
github_licensed
train
rb
4a48443217c834209486ee4e7e716d3233abc78f
diff --git a/nats.go b/nats.go index <HASH>..<HASH> 100644 --- a/nats.go +++ b/nats.go @@ -1172,7 +1172,7 @@ func (nc *Conn) createConn() (err error) { var hosts []string u := nc.current.url - if net.ParseIP(u.Hostname()) == nil && (nc.Opts.Secure || u.Scheme == tlsScheme) { + if net.ParseIP(u.Hostname()) == nil { addrs, _ := net.LookupHost(u.Hostname()) for _, addr := range addrs { hosts = append(hosts, fmt.Sprintf("%s:%s", addr, u.Port()))
Expand for non-tls as well
nats-io_go-nats
train
go
a94b570dc6cbcea5fea5c3d1d22d2ec271344932
diff --git a/discovery/azure/azure_test.go b/discovery/azure/azure_test.go index <HASH>..<HASH> 100644 --- a/discovery/azure/azure_test.go +++ b/discovery/azure/azure_test.go @@ -201,3 +201,24 @@ func TestMapFromVMScaleSetVMWithTags(t *testing.T) { t.Errorf("Expected %v got %v", expectedVM, actualVM) } } + +func TestNewAzureResourceFromID(t *testing.T) { + for _, tc := range []struct { + id string + expected azureResource + }{ + { + id: "/a/b/c/group/d/e/f/name", + expected: azureResource{"name", "group"}, + }, + { + id: "/a/b/c/group/d/e/f/name/g/h", + expected: azureResource{"name", "group"}, + }, + } { + actual, _ := newAzureResourceFromID(tc.id, nil) + if !reflect.DeepEqual(tc.expected, actual) { + t.Errorf("Expected %v got %v", tc.expected, actual) + } + } +}
Add a unit test for newAzureResourceFromID in discovery/azure/azure.go. (#<I>) This PR is about adding a unit test for newAzureResourceFromID in discovery/azure/azure.go.
prometheus_prometheus
train
go
cc8624d43c0f3a5de2eeaf4b7819f20e5eb343b6
diff --git a/src/Crawler.php b/src/Crawler.php index <HASH>..<HASH> 100644 --- a/src/Crawler.php +++ b/src/Crawler.php @@ -218,8 +218,10 @@ class Crawler protected function normalizeUrl(Url $url) { if ($url->isRelative()) { + $url->setScheme($this->baseUrl->scheme) - ->setHost($this->baseUrl->host); + ->setHost($this->baseUrl->host) + ->setPort($this->baseUrl->port); } if ($url->isProtocolIndependent()) {
- Fix for normalizing relative links when using non-<I> ports
spatie_crawler
train
php
e7f2e62cec4b51b85a0594202906296697e577d3
diff --git a/framework/core/src/Support/Extensions/ExtensionsServiceProvider.php b/framework/core/src/Support/Extensions/ExtensionsServiceProvider.php index <HASH>..<HASH> 100644 --- a/framework/core/src/Support/Extensions/ExtensionsServiceProvider.php +++ b/framework/core/src/Support/Extensions/ExtensionsServiceProvider.php @@ -22,11 +22,12 @@ class ExtensionsServiceProvider extends ServiceProvider $providers = []; foreach ($extensions as $extension) { - if (file_exists($file = base_path().'/extensions/'.$extension.'/bootstrap.php')) { + if (file_exists($file = public_path().'/extensions/'.$extension.'/bootstrap.php') || + file_exists($file = base_path().'/extensions/'.$extension.'/bootstrap.php')) { $providers[$extension] = require $file; } } - // @todo store $providers somewhere so that extensions can talk to each other + // @todo store $providers somewhere (in Core?) so that extensions can talk to each other } }
Load extensions from the root directory, with precedence.
flarum_core
train
php
93084e507501ecc1b359daeb08f61a7c7c8f298d
diff --git a/test_isort.py b/test_isort.py index <HASH>..<HASH> 100644 --- a/test_isort.py +++ b/test_isort.py @@ -1027,7 +1027,7 @@ def test_long_line_comments(): "from foo.utils.fabric_stuff.stage import check_clean_stage, deploy_stage, sync_stage_envdir, " "update_stage_app, update_stage_cron # noqa\n") assert SortImports(file_contents=test_input).output == \ - ("from foo.utils.fabric_stuff.live import (check_clean_live, deploy_live, # noqa" - " sync_live_envdir, update_live_app, update_live_cron)" - "from foo.utils.fabric_stuff.stage import (check_clean_stage, deploy_stage, # noqa" - " sync_stage_envdir, update_stage_app, update_stage_cron)") + ("from foo.utils.fabric_stuff.live import (check_clean_live, deploy_live, # noqa\n" + " sync_live_envdir, update_live_app, update_live_cron)\n" + "from foo.utils.fabric_stuff.stage import (check_clean_stage, deploy_stage, # noqa\n" + " sync_stage_envdir, update_stage_app, update_stage_cron)\n")
Fix for issue #<I> complete
timothycrosley_isort
train
py
23da345676dcb0f81be048da5ef0890eabf93d88
diff --git a/src/Url.php b/src/Url.php index <HASH>..<HASH> 100644 --- a/src/Url.php +++ b/src/Url.php @@ -6,9 +6,9 @@ use G4\ValueObject\Exception\InvalidUrlException; class Url implements StringInterface { - CONST COLON_PARAMETER = ':'; - CONST FORWARD_SLASH_PARAMETER = '/'; - CONST QUESTION_MARK_PARAMETER = '?'; + const COLON_PARAMETER = ':'; + const FORWARD_SLASH_PARAMETER = '/'; + const QUESTION_MARK_PARAMETER = '?'; /** * @var string
<I> - Const keyword changed to lowercase.
g4code_value-object
train
php
efe833b126eb1caaa2900ab4bbbedbc6aba8b830
diff --git a/src/plugin.js b/src/plugin.js index <HASH>..<HASH> 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -416,7 +416,7 @@ var zoomPlugin = { chartInstance.$zoom = { _originalOptions: {} }; - var node = chartInstance.$zoom._node = chartInstance.chart.ctx.canvas; + var node = chartInstance.$zoom._node = chartInstance.ctx.canvas; resolveOptions(chartInstance, pluginOptions); var options = chartInstance.$zoom._options; @@ -617,7 +617,7 @@ var zoomPlugin = { }, beforeDatasetsDraw: function(chartInstance) { - var ctx = chartInstance.chart.ctx; + var ctx = chartInstance.ctx; if (chartInstance.$zoom._dragZoomEnd) { var xAxis = getXAxis(chartInstance);
Fix for chartjs <I> deprecated functions (#<I>)
chartjs_chartjs-plugin-zoom
train
js
4fba7015b4efe1b48f92141ca213f4f698f4e188
diff --git a/polyaxon/scheduler/spawners/templates/resource_manager.py b/polyaxon/scheduler/spawners/templates/resource_manager.py index <HASH>..<HASH> 100644 --- a/polyaxon/scheduler/spawners/templates/resource_manager.py +++ b/polyaxon/scheduler/spawners/templates/resource_manager.py @@ -340,7 +340,13 @@ class BaseResourceManager(object): init_context_mounts=None, sidecar_context_mounts=None, replicas=1): - metadata = client.V1ObjectMeta(name=resource_name, labels=labels, namespace=self.namespace) + annotations = None + if requests_tpu(resources): + annotations = get_tpu_annotations() + metadata = client.V1ObjectMeta(name=resource_name, + labels=labels, + namespace=self.namespace, + annotations=annotations) pod_spec = self.get_task_pod_spec( resource_name=resource_name,
Add missing TPU annotations for deployments. fixes #<I>
polyaxon_polyaxon
train
py
7efc5377ada189e707855b9e17e6159a1d350073
diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -565,7 +565,7 @@ class UrlGenerator implements UrlGeneratorContract */ public function isValidUrl($path) { - if (! preg_match('~^(#|//|https?://|mailto:|tel:)~', $path)) { + if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { return filter_var($path, FILTER_VALIDATE_URL) !== false; }
Match UrlGenerator changes from lumen (#<I>)
laravel_framework
train
php
7cfefa58059d7136705899b5f827f81fa40a7b0d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( author='Jacopo Cascioli', author_email='[email protected]', license='MIT', - version='0.1.0', + version='0.1.1', packages=find_packages(), tests_require=[ 'pytest',
chore(aratrum): version bump to <I>
Vesuvium_aratrum
train
py
854f7001eb541b34674ba6f1f2f794c25ca60de5
diff --git a/src/context/directory/handlers/hooks.js b/src/context/directory/handlers/hooks.js index <HASH>..<HASH> 100644 --- a/src/context/directory/handlers/hooks.js +++ b/src/context/directory/handlers/hooks.js @@ -31,6 +31,8 @@ function parse(context) { async function dump(context) { const hooks = [ ...context.assets.hooks || [] ]; + if (hooks.length < 1) return; + // Create Hooks folder const hooksFolder = path.join(context.filePath, constants.HOOKS_DIRECTORY); fs.ensureDirSync(hooksFolder);
Update check to test for length of hooks.
auth0_auth0-deploy-cli
train
js
8f8cc5a727825634e1dbd94e66730d0dbec5acd9
diff --git a/mishmash/util.py b/mishmash/util.py index <HASH>..<HASH> 100644 --- a/mishmash/util.py +++ b/mishmash/util.py @@ -17,7 +17,7 @@ def splitNameByPrefix(s): def sortByDate(things, prefer_recording_date=False): # XXX: Why just just make Album types sortable by intregating this def _sortkey(a): - return datePicker(a, prefer_recording_date=prefer_recording_date) + return datePicker(a, prefer_recording_date=prefer_recording_date) or 0 return sorted(things, key=_sortkey)
fix: Fix album sorts for missing dates
nicfit_MishMash
train
py
941ac8f5b9d4a3eb2d7b1a90eda2bcc3daa286e6
diff --git a/secedgar/__init__.py b/secedgar/__init__.py index <HASH>..<HASH> 100644 --- a/secedgar/__init__.py +++ b/secedgar/__init__.py @@ -1 +1 @@ -__version__ = '0.2.1' +__version__ = '0.2.2'
MAINT: Bump to <I>
coyo8_sec-edgar
train
py
efb7bdb12fbf2b883f7aa15b83e90ea06829ca6a
diff --git a/Bundle/ViewReferenceBundle/EventSubscriber/ViewReferenceSubscriber.php b/Bundle/ViewReferenceBundle/EventSubscriber/ViewReferenceSubscriber.php index <HASH>..<HASH> 100644 --- a/Bundle/ViewReferenceBundle/EventSubscriber/ViewReferenceSubscriber.php +++ b/Bundle/ViewReferenceBundle/EventSubscriber/ViewReferenceSubscriber.php @@ -6,6 +6,7 @@ use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Events; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Victoire\Bundle\CoreBundle\Entity\WebViewInterface; +use Victoire\Bundle\I18nBundle\Entity\ViewTranslation; use Victoire\Bundle\ViewReferenceBundle\Event\ViewReferenceEvent; use Victoire\Bundle\ViewReferenceBundle\ViewReferenceEvents; @@ -86,6 +87,11 @@ class ViewReferenceSubscriber implements \Doctrine\Common\EventSubscriber $event = new ViewReferenceEvent($entity); $this->dispatcher->dispatch(ViewReferenceEvents::UPDATE_VIEW_REFERENCE, $event); } + } else if ($entity instanceof ViewTranslation) { + $view = $entity->getTranslatable(); + $view->setCurrentLocale($entity->getLocale()); + $event = new ViewReferenceEvent($view); + $this->dispatcher->dispatch(ViewReferenceEvents::UPDATE_VIEW_REFERENCE, $event); } } }
if we are persisting a ViewTranslation, update it's redis ViewReference
Victoire_victoire
train
php
a17d16c8fe847abe4590d9712570880104a87d16
diff --git a/lib/discordrb/voice/network.rb b/lib/discordrb/voice/network.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/voice/network.rb +++ b/lib/discordrb/voice/network.rb @@ -163,7 +163,10 @@ module Discordrb::Voice # ... def connect # Connect websocket - @thread = Thread.new { init_ws } + @thread = Thread.new do + Thread.current[:discordrb_name] = 'vws' + init_ws + end @bot.debug('Started websocket initialization, now waiting for UDP discovery reply') @@ -175,6 +178,10 @@ module Discordrb::Voice send_udp_connection(ip, port, @udp_mode) end + def destroy + @thread.kill if @thread + end + private def heartbeat_loop diff --git a/lib/discordrb/voice/voice_bot.rb b/lib/discordrb/voice/voice_bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/voice/voice_bot.rb +++ b/lib/discordrb/voice/voice_bot.rb @@ -54,7 +54,7 @@ module Discordrb::Voice def destroy stop_playing - @ws_thread.kill if @ws_thread + @ws.destroy @encoder.destroy end
Properly destroy the network connection in VoiceBot.destroy
meew0_discordrb
train
rb,rb
e0a3a4385e29513589471ca5c4f7b6b86242348c
diff --git a/lib/components/addons/InfoBox.js b/lib/components/addons/InfoBox.js index <HASH>..<HASH> 100644 --- a/lib/components/addons/InfoBox.js +++ b/lib/components/addons/InfoBox.js @@ -116,11 +116,14 @@ var InfoBox = (exports.InfoBox = (function(_React$PureComponent) { if (!_canUseDom2.default || this.state[_constants.INFO_BOX]) { return } - var GoogleMapsInfobox = require(/* "google-maps-infobox" uses "google" as a global variable. Since we don't - * have "google" on the server, we can not use it in server-side rendering. - * As a result, we import "google-maps-infobox" here to prevent an error on - * a isomorphic server. - */ "google-maps-infobox") + + var _require = require(/* "google-maps-infobox" uses "google" as a global variable. Since we don't + * have "google" on the server, we can not use it in server-side rendering. + * As a result, we import "google-maps-infobox" here to prevent an error on + * a isomorphic server. + */ "google-maps-infobox"), + GoogleMapsInfobox = _require.InfoBox + var infoBox = new GoogleMapsInfobox() ;(0, _MapChildHelper.construct)( InfoBox.propTypes,
chore(lib): compile from src with `babel`
tomchentw_react-google-maps
train
js
e7ec3fe492a158c6351daf19cb38a56130fae2f7
diff --git a/azurerm/internal/services/storage/resource_arm_storage_account.go b/azurerm/internal/services/storage/resource_arm_storage_account.go index <HASH>..<HASH> 100644 --- a/azurerm/internal/services/storage/resource_arm_storage_account.go +++ b/azurerm/internal/services/storage/resource_arm_storage_account.go @@ -62,7 +62,7 @@ func resourceArmStorageAccount() *schema.Resource { ValidateFunc: ValidateArmStorageAccountName, }, - "resource_group_name": azure.SchemaResourceGroupNameDiffSuppress(), + "resource_group_name": azure.SchemaResourceGroupName(), "location": azure.SchemaLocation(),
r/storage_account: making the resource group name case sensitive
terraform-providers_terraform-provider-azurerm
train
go
e82525cf8e9503fdeccd356025a43dbefcd1bc7e
diff --git a/jquery.colorpicker.js b/jquery.colorpicker.js index <HASH>..<HASH> 100644 --- a/jquery.colorpicker.js +++ b/jquery.colorpicker.js @@ -713,12 +713,14 @@ this._setAltField(); } + if (this.opened) { + $.each(this.parts, function (index, part) { + part.repaint(); + }); + } + // callback this._callback(this.options.onSelect); - - $.each(this.parts, function (index, part) { - part.repaint(); - }); }, _intToHex: function (dec) {
fix by boutell; only repaint on change if opened.
vanderlee_colorpicker
train
js
9e0feb4381f889af25191acdd88750d8327c4103
diff --git a/xbox-live.js b/xbox-live.js index <HASH>..<HASH> 100644 --- a/xbox-live.js +++ b/xbox-live.js @@ -50,10 +50,15 @@ XBoxLive.prototype.fetch = function(type, gamertag, game, callback){ }; if (this.options && this.options.request) req = _.extend(req, this.options.request); request(req, function (error, response, body) { - var result = JSON.parse(body); - if(ob.sources[ob.source].postProcess) result = ob.sources[ob.source].postProcess(result); - if(result.code && result.message) callback(result); - else callback(error, result); + try { + var result = JSON.parse(body); + if(ob.sources[ob.source].postProcess) result = ob.sources[ob.source].postProcess(result); + if(result.code && result.message) callback(result); + else callback(error, result); + } + catch (E) { + callback (E); + } }); }; module.exports = XBoxLive; \ No newline at end of file
Added callback for failed reuest
khrome_xbox-live
train
js
de8d4a1434ba08319b1396b4a94febfd1d0acb33
diff --git a/hazelcast/src/main/java/com/hazelcast/cluster/MulticastService.java b/hazelcast/src/main/java/com/hazelcast/cluster/MulticastService.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/cluster/MulticastService.java +++ b/hazelcast/src/main/java/com/hazelcast/cluster/MulticastService.java @@ -147,7 +147,8 @@ public class MulticastService implements Runnable { final byte packetVersion = input.readByte(); if (packetVersion != Packet.VERSION) { logger.warning("Received a JoinRequest with a different packet version! This -> " - + Packet.VERSION + ", Incoming -> " + packetVersion); + + Packet.VERSION + ", Incoming -> " + packetVersion + + ", Sender -> " + datagramPacketReceive.getAddress()); return null; } try {
Add sender's address to warning on JoinRequest to be able to identify it.
hazelcast_hazelcast
train
java
91be6ac51e8f16f38ef3ad75ee8961503b6c0cb9
diff --git a/graphene-django/graphene_django/utils.py b/graphene-django/graphene_django/utils.py index <HASH>..<HASH> 100644 --- a/graphene-django/graphene_django/utils.py +++ b/graphene-django/graphene_django/utils.py @@ -16,16 +16,6 @@ except (ImportError, AttributeError): DJANGO_FILTER_INSTALLED = False -def get_type_for_model(schema, model): - schema = schema - types = schema.types.values() - for _type in types: - type_model = hasattr(_type, '_meta') and getattr( - _type._meta, 'model', None) - if model == type_model: - return _type - - def get_reverse_fields(model): for name, attr in model.__dict__.items(): # Django =>1.9 uses 'rel', django <1.9 uses 'related' @@ -42,15 +32,6 @@ def get_reverse_fields(model): yield related -class WrappedQueryset(LazyList): - - def __len__(self): - # Dont calculate the length using len(queryset), as this will - # evaluate the whole queryset and return it's length. - # Use .count() instead - return self._origin.count() - - def maybe_queryset(value): if isinstance(value, Manager): value = value.get_queryset()
Removed unused Django code
graphql-python_graphene
train
py
c87c52fcfe06dccea759181be4f89504964b5d99
diff --git a/test/specs/commands/reload.js b/test/specs/commands/reload.js index <HASH>..<HASH> 100644 --- a/test/specs/commands/reload.js +++ b/test/specs/commands/reload.js @@ -70,7 +70,6 @@ describe("E2E CLI `reload` with no files arg", function () { it("should make a http request with files arg over HTTPS", function (done) { browserSync.reset(); - process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; browserSync .create()
fix(cli:reload): support self-signed certificates with cli reload command - fixes #<I>
BrowserSync_browser-sync
train
js
bcd53d025242e2d5bb0750737e62ea305e82feaf
diff --git a/visidata/__init__.py b/visidata/__init__.py index <HASH>..<HASH> 100644 --- a/visidata/__init__.py +++ b/visidata/__init__.py @@ -151,6 +151,7 @@ import visidata.colorsheet from .deprecated import * import math +import random from math import * vd.finalInit()
[random-] import into globals for some commands #<I>
saulpw_visidata
train
py
430d2ca5c49548ac96d542d9bea58691038fe84d
diff --git a/test/integration/test-many-validations-for-same-property.js b/test/integration/test-many-validations-for-same-property.js index <HASH>..<HASH> 100644 --- a/test/integration/test-many-validations-for-same-property.js +++ b/test/integration/test-many-validations-for-same-property.js @@ -2,8 +2,8 @@ var common = require('../common'); var assert = require('assert'); common.createConnection(function (err, db) { - common.createModelTable('test_predefined_validation', db.driver.db, function () { - var TestModel = db.define('test_predefined_validation', common.getModelProperties(), { + common.createModelTable('test_many_validations_for_same_property', db.driver.db, function () { + var TestModel = db.define('test_many_validations_for_same_property', common.getModelProperties(), { validations: { name: [ db.validators.rangeLength(0, 20, 'error1'), // should not fail on this one
Fixes table name for last created test
dresende_node-orm2
train
js
d7fbd278bdd095c970533fe0b5f3d5d63c3919a0
diff --git a/src/shapes/rectangle.js b/src/shapes/rectangle.js index <HASH>..<HASH> 100644 --- a/src/shapes/rectangle.js +++ b/src/shapes/rectangle.js @@ -339,7 +339,7 @@ */ Object.defineProperty(me.Rect.prototype, "right", { get : function () { - return this.pos.x + this.width; + return (this.pos.x + this.width) || this.width; }, configurable : true }); @@ -369,7 +369,7 @@ */ Object.defineProperty(me.Rect.prototype, "bottom", { get : function () { - return this.pos.y + this.height; + return (this.pos.y + this.height) || this.height; }, configurable : true });
Fix me.Container bounding box computation - Was getting NaN because me.Rect `right` and `bottom` properties were adding -Infiity + Infinity - Solved by returning just the width (or height) when the addition results in NaN or 0
melonjs_melonJS
train
js
dd4b007c2051cb5d63286a74124fb770e1ff6cd2
diff --git a/tests/ci/reporter_tests.js b/tests/ci/reporter_tests.js index <HASH>..<HASH> 100644 --- a/tests/ci/reporter_tests.js +++ b/tests/ci/reporter_tests.js @@ -132,7 +132,7 @@ describe('test reporters', function(){ }) reporter.finish() var output = stream.read().toString() - assert.match(output, /<testsuite name="Testem Tests" tests="1" failures="0" timestamp="(.+)" time="([0-9]+)">/) + assert.match(output, /<testsuite name="Testem Tests" tests="1" failures="0" timestamp="(.+)" time="(\d+(\.\d+)?)">/) assert.match(output, /<testcase classname="phantomjs" name="it does &lt;cool> &quot;cool&quot; \'cool\' stuff"/) assertXmlIsValid(output)
Fixed xunit reporter test assertion time is now reported with ms, meaning it can include a ‘.’
testem_testem
train
js
2156940c3af739e27e8d914b3c2c4bdcbd3f36a9
diff --git a/lib/node_modules/@stdlib/utils/index.js b/lib/node_modules/@stdlib/utils/index.js index <HASH>..<HASH> 100644 --- a/lib/node_modules/@stdlib/utils/index.js +++ b/lib/node_modules/@stdlib/utils/index.js @@ -17,10 +17,14 @@ setReadOnly( utils, 'isLittleEndian', require( '@stdlib/utils/is-little-endian' setReadOnly( utils, 'moveProperty', require( '@stdlib/utils/move-property' ) ); setReadOnly( utils, 'noop', require( '@stdlib/utils/noop' ) ); setReadOnly( utils, 'evil', require( '@stdlib/utils/eval' ) ); +setReadOnly( utils, 'tryFunction', require( '@stdlib/utils/try-function' ) ); setReadOnly( utils, 'constructorName', require( '@stdlib/utils/constructorName' ) ); setReadOnly( utils, 'functionName', require( '@stdlib/utils/functionName' ) ); +// Feature detection: + + // Type checking: setReadOnly( utils, 'nativeClass', require( '@stdlib/utils/native-class' ) ); setReadOnly( utils, 'typeOf', require( '@stdlib/utils/type-of' ) );
Export util to wrap a fcn in a try/catch block
stdlib-js_stdlib
train
js
bd94e5c6aa38f762d3cbaeca867ec41965f766ec
diff --git a/bin/randomization_test.py b/bin/randomization_test.py index <HASH>..<HASH> 100755 --- a/bin/randomization_test.py +++ b/bin/randomization_test.py @@ -332,14 +332,6 @@ def main(opts, mut_df=None, frameshift_df=None): logger.info('Kept {0} mutations after droping mutations with missing ' 'information (Droped: {1})'.format(len(mut_df), orig_num_mut - len(mut_df))) - # specify genes to skip - if opts['kind'] == 'oncogene': - # find genes with tsg score above threshold to filter out for oncogene - # permutation test - non_tested_genes = utils._get_high_tsg_score(mut_df, opts['tsg_score']) - else: - # don't filter out genes for tsg permutation test - non_tested_genes = [] # count frameshifts if opts['kind'] != 'oncogene': @@ -367,7 +359,8 @@ def main(opts, mut_df=None, frameshift_df=None): if opts['seed'] is not None: logger.info('Pseudo Random Number Generator Seed: {0}'.format(opts['seed'])) - # perform permutation test + # don't filter out genes for tsg randomization-based test + non_tested_genes = [] bed_dict = utils.read_bed(opts['bed'], non_tested_genes) # Perform BH p-value adjustment and tidy up data for output
Removed tsg score filter
KarchinLab_probabilistic2020
train
py
abafcd2bb62c55c7eeba09169267c017d64ede3a
diff --git a/src/speech/recognizer.js b/src/speech/recognizer.js index <HASH>..<HASH> 100644 --- a/src/speech/recognizer.js +++ b/src/speech/recognizer.js @@ -38,7 +38,25 @@ const factory = (root) => { // Check browser support // This is done as early as possible, to make it as fast as possible for unsupported browsers if (!SpeechRecognition) { - return null; + console.error('The browser does not support speech recognition') + // return null; + return { + init: () => {}, + start: () => {}, + abort: () => {}, + pause: () => {}, + resume: () => {}, + debug: () => {}, + debug: () => {}, + setLanguage: () => {}, + addCommands: () => {}, + removeCommands: () => {}, + addCallback: () => {}, + removeCallback: () => {}, + isListening: () => {}, + getSpeechRecognizer: () => {}, + trigger: () => {}, + } } var commandsList = [];
Handle browser does not support speech recognition
alphara_vuics-vui-react
train
js
82a0a18e7a3860b19a9e289e6f41bd707c573819
diff --git a/lib/ddr/auth/ability_definitions/datastream_ability_definitions.rb b/lib/ddr/auth/ability_definitions/datastream_ability_definitions.rb index <HASH>..<HASH> 100644 --- a/lib/ddr/auth/ability_definitions/datastream_ability_definitions.rb +++ b/lib/ddr/auth/ability_definitions/datastream_ability_definitions.rb @@ -8,12 +8,13 @@ module Ddr # Datastreams not listed cannot be downloaded, except of # course by the :manage ability. DATASTREAM_DOWNLOAD_ABILITIES = { - Ddr::Datastreams::CONTENT => :download, - Ddr::Datastreams::DESC_METADATA => :read, - Ddr::Datastreams::EXTRACTED_TEXT => :download, - Ddr::Datastreams::FITS => :read, - Ddr::Datastreams::MULTIRES_IMAGE => :read, - Ddr::Datastreams::THUMBNAIL => :read, + Ddr::Datastreams::CONTENT => :download, + Ddr::Datastreams::DESC_METADATA => :read, + Ddr::Datastreams::EXTRACTED_TEXT => :download, + Ddr::Datastreams::FITS => :read, + Ddr::Datastreams::MULTIRES_IMAGE => :read, + Ddr::Datastreams::STRUCT_METADATA => :read, + Ddr::Datastreams::THUMBNAIL => :read, }.freeze def call
Add download ability definition for structMetadata datastream; closes #<I>
duke-libraries_ddr-models
train
rb
447a60f1cc252ed397581ff66848571948c21c04
diff --git a/modeltranslation/admin.py b/modeltranslation/admin.py index <HASH>..<HASH> 100755 --- a/modeltranslation/admin.py +++ b/modeltranslation/admin.py @@ -359,6 +359,7 @@ class TabbedDjangoJqueryTranslationAdmin(TranslationAdmin): """ class Media: js = ( + 'admin/js/jquery.init.js', 'modeltranslation/js/force_jquery.js', mt_settings.JQUERY_UI_URL, mt_settings.JQUERY_MB_BROWSER_URL,
fix TabbedTranslationAdmin in django <I> (close #<I>)
deschler_django-modeltranslation
train
py
4e319088db0dfb893f9a1117d772789df3a6958a
diff --git a/test/insert_snippet_test.rb b/test/insert_snippet_test.rb index <HASH>..<HASH> 100644 --- a/test/insert_snippet_test.rb +++ b/test/insert_snippet_test.rb @@ -37,7 +37,6 @@ describe SocialSnippet::Api::InsertSnippetApi do def add_tmp_repo_files(repo_dirpath, pkg) ::Dir.glob(::File.join repo_dirpath, "**", "*") do |s| next unless ::File.file?(s) - p "create file: #{s}" filepath = s[repo_dirpath.length..-1] pkg.add_directory ::File.dirname(filepath) pkg.add_file filepath, ::File.read(s) @@ -179,14 +178,17 @@ describe SocialSnippet::Api::InsertSnippetApi do ].join($/) end # prepare my-repo#1.0.1 - it do - expect(fake_core.api.insert_snippet(input)).to eq [ + let(:output) do + [ '/* @snippet<my-repo#1.0.1:func.c> */', 'func: 1.0.1', 'main', - ].join($/).freeze + ].join($/) end + subject { fake_core.api.insert_snippet(input) } + it { should eq output } + context "release 1.1.0" do prepare_repository do
insert_snippet_test: edit tests
social-snippet_social-snippet
train
rb
a2a8f188349ef4eaf75b99e7106cef261e5ee74c
diff --git a/lib/plugins/index.js b/lib/plugins/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/index.js +++ b/lib/plugins/index.js @@ -496,11 +496,12 @@ function getRulesFromPlugins(type, req, res, callback) { rulesCache.del(cacheKey); } } - if (data && data.pendingCallbacks) { - data.pendingCallbacks.forEach(function(cb) { + var pendingCallbacks = data && data.pendingCallbacks; + if (pendingCallbacks) { + delete data.pendingCallbacks; + pendingCallbacks.forEach(function(cb) { cb(err, body, values, raw); }); - delete data.pendingCallbacks; } body = (body || '') + (!isResRules && plugin._rules ? '\n' + plugin._rules : ''); if (body || values) {
feat: Supports cache the rules of plugin
avwo_whistle
train
js
1f8a00c7a1aa975dbe21c461c5d04e765fd5c9db
diff --git a/quilt/db.py b/quilt/db.py index <HASH>..<HASH> 100644 --- a/quilt/db.py +++ b/quilt/db.py @@ -88,6 +88,18 @@ class PatchSeries(object): _patches.extend(self._patches) self._patches = _patches + def add_patches(self, patches, after=None): + """ Add a list of patches to the patches list """ + if after is None: + self._patches.extend(patches) + else: + self._check_patch(after) + _patches = self.patches_before(after) + _patches.append(after) + _patches.extend(patches) + _patches.extend(self.patches_after(after)) + self._patches = _patches + def remove_patch(self, patch_name): """ Remove a patch from the patches list """ self._patches.remove(patch_name)
Add a PatchSeries method to add a list of patches Either it is possible to add the patches at the end of the current list or after a specified patch.
bjoernricks_python-quilt
train
py