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
0de7f30001e45623e58ee875ac4a554321094878
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,7 +6,9 @@ require "rails/test_help" require 'shoulda' require 'pry' require 'factory_girl' -FactoryGirl.find_definitions +if FactoryGirl.factories.first.nil? + FactoryGirl.find_definitions +end Rails.backtrace_cleaner.remove_silencers!
get factories loading properly for all types of test runs
tpickett66_archivist
train
rb
0085d9fccbcd52baeb53b8e2cc7c5858f29ff6a7
diff --git a/src/Bllim/Datatables/Datatables.php b/src/Bllim/Datatables/Datatables.php index <HASH>..<HASH> 100644 --- a/src/Bllim/Datatables/Datatables.php +++ b/src/Bllim/Datatables/Datatables.php @@ -402,13 +402,10 @@ class Datatables $columns = $schema->listTableColumns($table); foreach ($columns as $column_infos) { if($column_infos->getName() === $target_column) { - // $name = $column_infos->getName(); - // $type = $column_infos->getType()->getName(); - $length = $column_infos->getLength(); - // $default = $column_infos->getDefault(); - // var_dump($length);//debug - if(!empty($length) && $length < $column_max_size) - $column_max_size = $length; + $length = $column_infos->getLength(); + if(!empty($length) && $length < $column_max_size) { + $column_max_size = $length; + } break; } }
Tidying up codes and removing useless comments
yajra_laravel-datatables
train
php
41df5751d861040ef6afe83671abe52d2bfa13ea
diff --git a/Bundle/BlogBundle/Filter/CategoryFilter.php b/Bundle/BlogBundle/Filter/CategoryFilter.php index <HASH>..<HASH> 100644 --- a/Bundle/BlogBundle/Filter/CategoryFilter.php +++ b/Bundle/BlogBundle/Filter/CategoryFilter.php @@ -112,7 +112,7 @@ class CategoryFilter extends BaseFilter $categories = $this->filterQueryHandler->handle($options['widget'], BlogCategory::class); //getAll categories - $categoryQb = $this->getEntityManager()->getRepository('BlogCategory.php')->getAll(); + $categoryQb = $this->getEntityManager()->getRepository('VictoireBlogBundle:BlogCategory')->getAll(); //getAll published articles $articleQb = $this->getEntityManager()->getRepository('VictoireBlogBundle:Article')->getAll(true);
revert and fix BlogCategory call
Victoire_victoire
train
php
0fedca3238e1200fc208cab277b294971168b7fb
diff --git a/scapy.py b/scapy.py index <HASH>..<HASH> 100755 --- a/scapy.py +++ b/scapy.py @@ -10356,6 +10356,22 @@ def dhcp_request(iface=None,**kargs): return srp1(Ether(dst="ff:ff:ff:ff:ff:ff")/IP(src="0.0.0.0",dst="255.255.255.255")/UDP(sport=68,dport=67) /BOOTP(chaddr=hw)/DHCP(options=[("message-type","discover"),"end"]),iface=iface,**kargs) +def snmpwalk(dst, oid="1", community="public"): + try: + while 1: + r = sr1(IP(dst=dst)/UDP(sport=RandShort())/SNMP(community=community, PDU=SNMPnext(varbindlist=[SNMPvarbind(oid=oid)])),timeout=2, chainCC=1, verbose=0, retry=2) + if ICMP in r: + print repr(r) + break + if r is None: + print "No answers" + break + print "%-40s: %r" % (r[SNMPvarbind].oid.val,r[SNMPvarbind].value) + oid = r[SNMPvarbind].oid + + except KeyboardInterrupt: + pass + ##################### ## Reporting stuff ##
Added snmpwalk()
secdev_scapy
train
py
dfe68610e7fc34c244d5fc850534b1ddbfc46e92
diff --git a/public/assets/login.js b/public/assets/login.js index <HASH>..<HASH> 100644 --- a/public/assets/login.js +++ b/public/assets/login.js @@ -9,7 +9,6 @@ function login() { var recaptcha = $("#g-recaptcha-response").val(); toast("Validando dados!", 15000); post('login', 'login', {email: email, pass: pass, recaptcha: recaptcha}, function (g) { - clearToast(); if (typeof g === "string") { navigator.vibrate(100); loginFree = !0; diff --git a/public/assets/logout.js b/public/assets/logout.js index <HASH>..<HASH> 100644 --- a/public/assets/logout.js +++ b/public/assets/logout.js @@ -1,4 +1,3 @@ -clearToast(); toast("Saindo...", 3000); setCookieAnonimo().then(() => { app.loadView(HOME + "login");
clearToast remove because toast is clear itself
edineibauer_uebLogin
train
js,js
9bcd065da0477ed4ad4a4c619fe99ac164f53595
diff --git a/questionary/prompts/common.py b/questionary/prompts/common.py index <HASH>..<HASH> 100644 --- a/questionary/prompts/common.py +++ b/questionary/prompts/common.py @@ -18,13 +18,22 @@ from questionary.constants import ( INDICATOR_UNSELECTED, ) +# This is a cut-down version of `prompt_toolkit.formatted_text.AnyFormattedText` +# which does not exist in v2 of prompt_toolkit +FormattedText = Union[ + Text, + List[Tuple[Text, Text]], + List[Tuple[Text, Text, Callable[[Any], None]]], + None, +] + class Choice(object): """One choice in a select, rawselect or checkbox.""" def __init__( self, - title: Text, + title: FormattedText, value: Optional[Any] = None, disabled: Optional[Text] = None, checked: bool = False,
Accept style tuples in `title` argument annotation of `Choice` (#<I>)
tmbo_questionary
train
py
96429ff94f29ba6d14625e92ad7d0a8185568503
diff --git a/src/Psalm/ErrorBaseline.php b/src/Psalm/ErrorBaseline.php index <HASH>..<HASH> 100644 --- a/src/Psalm/ErrorBaseline.php +++ b/src/Psalm/ErrorBaseline.php @@ -285,7 +285,7 @@ class ErrorBaseline $baselineDoc->formatOutput = true; $xml = preg_replace_callback( - '/<files (psalm-version="[^"]+") (?:php-version="(.+)">\n)/', + '/<files (psalm-version="[^"]+") (?:php-version="(.+)"(\/?>)\n)/', /** * @param array<int, string> $matches */ @@ -301,7 +301,7 @@ class ErrorBaseline "\n" . ' "' . "\n" . - '>' . + $matches[3] . "\n"; }, $baselineDoc->saveXML()
apply pretty formatting when there are no issues (#<I>)
vimeo_psalm
train
php
064b2212376ea8d522dcfc796a233861ebff46a0
diff --git a/src/python/pants/base/worker_pool.py b/src/python/pants/base/worker_pool.py index <HASH>..<HASH> 100644 --- a/src/python/pants/base/worker_pool.py +++ b/src/python/pants/base/worker_pool.py @@ -8,6 +8,7 @@ from __future__ import (nested_scopes, generators, division, absolute_import, wi import threading import multiprocessing from multiprocessing.pool import ThreadPool +import os import signal import sys @@ -179,8 +180,8 @@ class SubprocPool(object): @staticmethod def worker_init(): - # Ignore sigint in workers since they are daemon procs and thus die with parent. - signal.signal(signal.SIGINT, signal.SIG_IGN) + # Exit quietly on sigint, otherwise we get {num_procs} keyboardinterrupt stacktraces spewn + signal.signal(signal.SIGINT, lambda *args: os._exit(0)) @classmethod def foreground(cls):
Exit workers on sigint rather than ignore Testing Done: <URL>
pantsbuild_pants
train
py
be7024bbd707b629e37b0cd93b6cfc9312a2a860
diff --git a/lib/transactions.js b/lib/transactions.js index <HASH>..<HASH> 100644 --- a/lib/transactions.js +++ b/lib/transactions.js @@ -60,12 +60,11 @@ function Transactions(client) { * @param {number} [timeLimit] - the maximum number of seconds that * the transaction should run before rolling back automatically * @param {boolean} [withState] - whether to return a Transaction - * object that can track the properties of the transaction - * @returns {string|transactions.Transaction} either a string - * transactionId (the default) or a Transaction object identifying - * the multi-statement transaction; in the next major release, - * the Transaction object will become the default and the string - * transactionId will be deprecated. + * object that can track the properties of the transaction + * @returns {transactions.Transaction|string} either a Transaction object + * (the default) or string transactionId identifying the multi-statement + * transaction; returning a string transactionId is deprecated and + * will be removed in the next major release. */ Transactions.prototype.open = function openTransaction() { var args = mlutil.asArray.apply(null, arguments); @@ -119,7 +118,7 @@ Transactions.prototype.open = function openTransaction() { ); operation.validStatusCodes = [303]; operation.outputTransform = openOutputTransform; - operation.withState = withState || false; + operation.withState = withState || true; return requester.startRequest(operation); };
fix(#<I>): make a transaction object the default return value For a transactions.read() Also update docs for returning a string transactionID. Returning a string transactionID is deprecated and will be removed in the next major release.
marklogic_node-client-api
train
js
811058fcf44c8502bb259e928bb92cb2e749787d
diff --git a/openquake/calculators/disaggregation.py b/openquake/calculators/disaggregation.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/disaggregation.py +++ b/openquake/calculators/disaggregation.py @@ -494,7 +494,7 @@ class DisaggregationCalculator(base.HazardCalculator): out = output_dict(self.shapedic, outputs) count = numpy.zeros(len(self.sitecol), U16) _disagg_trt = numpy.zeros(self.N, [(trt, float) for trt in self.trts]) - for (s, m, k), mat6 in results.items(): + for (s, m, k), mat6 in sorted(results.items()): imt = self.imts[m] for p, poe in enumerate(self.poes_disagg): mat5 = mat6[..., p, :]
Sorted the disagg results before saving them [skip CI]
gem_oq-engine
train
py
bc0cb6be01a34179924e8bc9e13ce99ea9188baa
diff --git a/theme/boost/classes/boostnavbar.php b/theme/boost/classes/boostnavbar.php index <HASH>..<HASH> 100644 --- a/theme/boost/classes/boostnavbar.php +++ b/theme/boost/classes/boostnavbar.php @@ -55,6 +55,9 @@ class boostnavbar implements \renderable { protected function prepare_nodes_for_boost(): void { global $PAGE; + // Remove the navbar nodes that already exist in the primary navigation menu. + $this->remove_items_that_exist_in_navigation($PAGE->primarynav); + // Defines whether section items with an action should be removed by default. $removesections = true; @@ -94,9 +97,6 @@ class boostnavbar implements \renderable { } } - $this->remove('myhome'); // Dashboard. - $this->remove('home'); - // Remove 'My courses' if we are in the module context. if ($this->page->context->contextlevel == CONTEXT_MODULE) { $this->remove('mycourses');
MDL-<I> theme_boost: Remove breadcrumb nodes that exist in primary nav Generally, we want to avoid displaying any breadcrumb nodes which are already present in the primary navigation menu. Currently, this is done by manually specifying which breadcrumb node (by its identification key) should be removed. This change provides more reliable, automatic removal of these breadcrum nodes by utilizing the exising method remove_items_that_exist_in_navigation().
moodle_moodle
train
php
74973659ce9dbf197067cb477bb1e7c4895baff4
diff --git a/src/TestSuite/IntegrationTestTrait.php b/src/TestSuite/IntegrationTestTrait.php index <HASH>..<HASH> 100644 --- a/src/TestSuite/IntegrationTestTrait.php +++ b/src/TestSuite/IntegrationTestTrait.php @@ -621,7 +621,8 @@ trait IntegrationTestTrait $props = [ 'url' => $url, 'session' => $session, - 'query' => $queryData + 'query' => $queryData, + 'files' => [], ]; if (is_string($data)) { $props['input'] = $data; diff --git a/src/TestSuite/MiddlewareDispatcher.php b/src/TestSuite/MiddlewareDispatcher.php index <HASH>..<HASH> 100644 --- a/src/TestSuite/MiddlewareDispatcher.php +++ b/src/TestSuite/MiddlewareDispatcher.php @@ -153,7 +153,8 @@ class MiddlewareDispatcher $environment, $spec['query'], $spec['post'], - $spec['cookies'] + $spec['cookies'], + $spec['files'] ); $request = $request->withAttribute('session', $spec['session']);
Pass uploaded files configured with configRequest() to ServerRequest.
cakephp_cakephp
train
php,php
f50f2c00e731a4ecc97f8f7d8882c34cfba7cd6e
diff --git a/src/Illuminate/Remote/Connection.php b/src/Illuminate/Remote/Connection.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Remote/Connection.php +++ b/src/Illuminate/Remote/Connection.php @@ -36,13 +36,6 @@ class Connection implements ConnectionInterface { protected $username; /** - * The authentication credential set. - * - * @var array - */ - protected $auth; - - /** * All of the defined tasks. * * @var array
Removing variable that's never used.
laravel_framework
train
php
f307fdc24668d3f4f48f49915cf793af18e4a376
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,9 @@ setup( install_requires=[ 'ase', 'pypif', - 'requests' ], - packages=find_packages(exclude=('tests', 'docs')) + extras_require={ + 'report': ["requests"], + }, + packages=find_packages(exclude=('tests', 'docs')), )
Move requests to extras Since `quality_report` is `False` by default.
CitrineInformatics_pif-dft
train
py
02e0e088451d12133f34c0a2673990eb62512051
diff --git a/server/gulpfile.js b/server/gulpfile.js index <HASH>..<HASH> 100644 --- a/server/gulpfile.js +++ b/server/gulpfile.js @@ -89,7 +89,7 @@ gulp.task('output-build-info', function () { // Capture changes from the last commit try { - execSync('git diff --quiet HEAD'); + execSync('git diff --quiet HEAD -- server'); } catch (err) { dirtyInfo = "-dirty"; }
fix(server): build-info dirty flag is capturing changes from all projects
mcdcorp_opentest
train
js
7e925bb9e58d900a66b1f0069f283d7ab7b0039c
diff --git a/synctool/src/test/java/org/duracloud/sync/walker/DirWalkerTest.java b/synctool/src/test/java/org/duracloud/sync/walker/DirWalkerTest.java index <HASH>..<HASH> 100644 --- a/synctool/src/test/java/org/duracloud/sync/walker/DirWalkerTest.java +++ b/synctool/src/test/java/org/duracloud/sync/walker/DirWalkerTest.java @@ -29,9 +29,9 @@ public class DirWalkerTest extends SyncTestBase { @Test public void testDirWalker() { - File tempDir = new File("target"); + File checkDir = new File("src"); List<File> dirs = new ArrayList<File>(); - dirs.add(tempDir); + dirs.add(checkDir); DirWalker dirWalker = new DirWalker(dirs); assertFalse(dirWalker.walkComplete()); @@ -44,7 +44,7 @@ public class DirWalkerTest extends SyncTestBase { } Collection tempDirFiles = - FileUtils.listFiles(tempDir, + FileUtils.listFiles(checkDir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
Changing this test to use a directory which does not change size in the course of the test. git-svn-id: <URL>
duracloud_duracloud
train
java
10691c8d2eab8ae1fc2f28eaa6585d8cb206c4e5
diff --git a/Generator.php b/Generator.php index <HASH>..<HASH> 100644 --- a/Generator.php +++ b/Generator.php @@ -172,6 +172,16 @@ abstract class Generator { } /** + * Setup some hook. + * + * @return void + */ + public function setUp() + { + // + } + + /** * Run the generator. * * @return int @@ -179,6 +189,8 @@ abstract class Generator { */ public function run() { + $this->setUp(); + if ($this->filesystem->exists($path = $this->getPath()) && ! $this->force) { throw new FileAlreadyExistsException($path);
Add setUp method: used for setup some condition of command
pingpong-labs_generators
train
php
ae6cda479748472530a892a88a4a6e0f372ac7c0
diff --git a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacketTest.java b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacketTest.java index <HASH>..<HASH> 100644 --- a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacketTest.java +++ b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/transport/mysql/packet/command/query/text/query/ComQueryPacketTest.java @@ -100,7 +100,7 @@ public final class ComQueryPacketTest { ShardingSchema shardingSchema = mock(ShardingSchema.class); Map<String, ShardingSchema> shardingSchemas = new HashMap<>(); shardingSchemas.put(ShardingConstant.LOGIC_SCHEMA_NAME, shardingSchema); - Field field = GlobalRegistry.class.getDeclaredField("shardingSchemas"); + Field field = GlobalRegistry.class.getDeclaredField("logicSchemas"); field.setAccessible(true); field.set(GlobalRegistry.getInstance(), shardingSchemas); }
modify ComQueryPacketTest.java
apache_incubator-shardingsphere
train
java
ff34971c48cb9fe4842b6a0a06d193e80ff49d16
diff --git a/src/Provider/DatabaseMenuProvider.php b/src/Provider/DatabaseMenuProvider.php index <HASH>..<HASH> 100644 --- a/src/Provider/DatabaseMenuProvider.php +++ b/src/Provider/DatabaseMenuProvider.php @@ -29,7 +29,7 @@ class DatabaseMenuProvider implements MenuProviderInterface */ protected $matcher; - public function __construct(BuilderInterface $builder, RequestStack $requestStack, MatcherInterface $matcher = null) + public function __construct(BuilderInterface $builder, RequestStack $requestStack, MatcherInterface $matcher) { $this->builder = $builder; $this->requestStack = $requestStack; @@ -48,10 +48,8 @@ class DatabaseMenuProvider implements MenuProviderInterface { $menu = $this->builder->build($name, $this->requestStack->getCurrentRequest()); - if ($this->matcher !== null) { - foreach ($menu->getChildren() as $child) { - $child->setCurrent($this->matcher->isCurrent($child)); - } + foreach ($menu->getChildren() as $child) { + $child->setCurrent($this->matcher->isCurrent($child)); } return $menu;
Reverted the optional matcher argument to a required one No need to have an optional/nullable matcher as this is included with knp menu bundle anyway
zicht_menu-bundle
train
php
27cd5c332305664540c2deb3a0fa7f41aea4a80f
diff --git a/lib/puppetdb_query/version.rb b/lib/puppetdb_query/version.rb index <HASH>..<HASH> 100644 --- a/lib/puppetdb_query/version.rb +++ b/lib/puppetdb_query/version.rb @@ -1,3 +1,3 @@ module PuppetDBQuery - VERSION = "0.0.33".freeze + VERSION = "0.0.34".freeze end
m<I>'s version bumper
m-31_puppetdb_query
train
rb
d50c2daf05624a6e45e510dc7987d4f762e48b43
diff --git a/src/components/dialog/QDialog.js b/src/components/dialog/QDialog.js index <HASH>..<HASH> 100644 --- a/src/components/dialog/QDialog.js +++ b/src/components/dialog/QDialog.js @@ -94,9 +94,8 @@ export default { this.$emit('input', val) }, show: () => { - this.$emit('show') - if (!this.$q.platform.is.desktop) { + this.$emit('show') return } @@ -109,6 +108,7 @@ export default { if (node.length) { node[0].focus() + this.$emit('show') return } } @@ -117,6 +117,7 @@ export default { if (node.length) { node[node.length - 1].focus() } + this.$emit('show') }, hide: () => { this.$emit('hide')
QDialog: emit show after focusing the element in dialog (#<I>) Allows simpler focusing of another elements in `@show` in userland. ref #<I>
quasarframework_quasar
train
js
b12cbe34fa56543cc4a8cbceda4c0ba3d8285cec
diff --git a/phy/cluster/manual/view_model.py b/phy/cluster/manual/view_model.py index <HASH>..<HASH> 100644 --- a/phy/cluster/manual/view_model.py +++ b/phy/cluster/manual/view_model.py @@ -157,7 +157,7 @@ class FeatureViewModel(BaseViewModel): # (n_spikes, n_channels, n_features) # because that's what the FeatureView expects currently. n_fet = self.model.n_features_per_channel - n_channels = self.model.n_channels + n_channels = len(self.model.channel_order) shape = (-1, n_channels, n_fet) features = features[:, :n_fet * n_channels].reshape(shape) # Scale factor.
Fixed bug in feature view model due to cluster order.
kwikteam_phy
train
py
85f099ef88678146c101d69287787733e2aa8146
diff --git a/billy/fulltext.py b/billy/fulltext.py index <HASH>..<HASH> 100644 --- a/billy/fulltext.py +++ b/billy/fulltext.py @@ -42,7 +42,10 @@ PUNCTUATION = re.compile('[%s]' % re.escape(string.punctuation)) def _clean_text(text): - text = text.encode('ascii', 'ignore') + if isinstance(text, unicode): + text = text.encode('ascii', 'ignore') + else: + text = text.decode('utf8', 'ignore').encode('ascii', 'ignore') text = text.replace(u'\xa0', u' ') # nbsp -> sp text = PUNCTUATION.sub(' ', text) # strip punctuation text = re.sub('\s+', ' ', text) # collapse spaces
try harder to clean up unicode
openstates_billy
train
py
99ad74b2239129e712d3d44d187a979e87c39ea3
diff --git a/allegedb/allegedb/cache.py b/allegedb/allegedb/cache.py index <HASH>..<HASH> 100644 --- a/allegedb/allegedb/cache.py +++ b/allegedb/allegedb/cache.py @@ -611,17 +611,3 @@ class EdgesCache(Cache): = self.db._make_edge(self.db.graph[graph], nodeA, nodeB, idx) Cache.store(self, graph, nodeA, nodeB, idx, branch, rev, ex) self.predecessors[(graph, nodeB)][nodeA][idx][branch][rev] = ex - # am i doin it right?? - kc = self._update_keycache( - (graph, nodeA), branch, rev, (nodeB, idx), ex - ) - self._validate_keycache( - self.parents[(graph, nodeA)][(nodeB, idx)], - kc, - branch, rev, (graph, nodeA, nodeB, idx) - ) - self._validate_keycache( - self.keys[(graph, nodeA, nodeB, idx)], - kc, - branch, rev, (graph, nodeA, nodeB, idx) - )
Delete some tests that didn't make sense They seem entirely redundant with the ones already in Cache.store, actually. I think I had more caching in mind to do and tried to get all Test Driven Development about it, but then forgot all about it?
LogicalDash_LiSE
train
py
39d0b32a24869db1ccb563fc59f256eb37d67a9e
diff --git a/lib/active_attr/version.rb b/lib/active_attr/version.rb index <HASH>..<HASH> 100644 --- a/lib/active_attr/version.rb +++ b/lib/active_attr/version.rb @@ -1,5 +1,5 @@ module ActiveAttr # Complete version string # @since 0.1.0 - VERSION = "0.6.0" + VERSION = "0.7.0.alpha1" end
Bump development version to <I>.alpha1
cgriego_active_attr
train
rb
ae77d1f53a729e14946e01dcc3596e81846166b8
diff --git a/tests/ServerTest.php b/tests/ServerTest.php index <HASH>..<HASH> 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -103,6 +103,15 @@ class ServerTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($eventsTable, $subscribedEventsReflection->getValue($this->server)); } + public function testUnubscribingUnknownEventThrowsInvalidArgumentException() + { + $handler = $this->getMockBuilder('\noFlash\CherryHttp\EventsHandlerInterface')->getMock(); + $this->server->setEventsHandler($handler); + + $this->setExpectedException('\InvalidArgumentException'); + $this->server->unsubscribeEvent('unknownEvent'); + } + public function testHearbeatIntervalCanBeSet() { $serverReflection = new \ReflectionObject($this->server);
Added test for unknown event unsubscription in Server.
kiler129_CherryHttp
train
php
5156cd5c895e1553228830c6e5b6102e96f8ec97
diff --git a/numexpr/expressions.py b/numexpr/expressions.py index <HASH>..<HASH> 100644 --- a/numexpr/expressions.py +++ b/numexpr/expressions.py @@ -15,8 +15,8 @@ import sys import threading import numpy -from distutils.version import LooseVersion -_np_version = LooseVersion(numpy.__version__) +from pkg_resources import parse_version +_np_version = parse_version(numpy.__version__) # Declare a double type that does not exist in Python space double = numpy.double @@ -282,7 +282,7 @@ def rtruediv_op(a, b): @ophelper def pow_op(a, b): - if (_np_version >= '1.12.0b1' and + if (_np_version >= parse_version('1.12.0b1') and b.astKind in ('int', 'long') and a.astKind in ('int', 'long') and numpy.any(b.value < 0)):
Better fix for gh-<I> distutils.LooseVersion does not handle correctly RC versions
pydata_numexpr
train
py
8b1a4a86e9e8edb4d7af8084eb0fcc8ed1f0982c
diff --git a/lib/node-libnmap.js b/lib/node-libnmap.js index <HASH>..<HASH> 100644 --- a/lib/node-libnmap.js +++ b/lib/node-libnmap.js @@ -15,7 +15,7 @@ var version = 'v0.2.0' , ipv6 = require('ip-address').v6 , netmask = require('netmask').Netmask , proc = require('child_process').exec - , nmap = function(options, fn) { + , nmap = function(options, abc) { 'use strict'; @@ -180,7 +180,7 @@ var version = 'v0.2.0' */ flatten: function (report) { return this.recursive(report.nmaprun); - }, + } }; /** @@ -220,7 +220,7 @@ var version = 'v0.2.0' , reports = []; if (opts.range > 0) - return fn(new Error("Range of hosts could not be created")); + return new Error("Range of hosts could not be created"); Object.keys(opts.range).forEach(function(block) { @@ -565,9 +565,9 @@ var version = 'v0.2.0' }); tools.worker(opts, function scan(err, data) { - if (err) cb(err); + if (err) return cb(err); - cb(null, data); + return cb(null, data); }); }; };
Removed undefined fn()
jas-_node-libnmap
train
js
b465f79bef8c9223c7258dff71d1f7c950d34287
diff --git a/container/docker/engine.py b/container/docker/engine.py index <HASH>..<HASH> 100644 --- a/container/docker/engine.py +++ b/container/docker/engine.py @@ -753,20 +753,22 @@ class Engine(BaseEngine): client.tag(image_id, repository, tag=image_buildstamp) logger.info('Pushing %s:%s...' % (repository, image_buildstamp)) - status = client.push(repository, + stream = client.push(repository, tag=image_buildstamp, stream=True) last_status = None - for line in status: - line = json.loads(line) - if type(line) is dict and 'error' in line: - logger.error(line['error']) - elif type(line) is dict and 'status' in line: - if line['status'] != last_status: - logger.info(line['status']) - last_status = line['status'] - else: - logger.debug(line) + for data in stream: + data = data.splitlines() + for line in data: + line = json.loads(line) + if type(line) is dict and 'error' in line: + logger.error(line['error']) + if type(line) is dict and 'status' in line: + if line['status'] != last_status: + logger.info(line['status']) + last_status = line['status'] + else: + logger.debug(line) def get_client(self): if not self._client:
Properly parse docker push output stream Properly parses the docker push output when multiple json lines from the data stream are returned
ansible_ansible-container
train
py
186c2f4e393ab1c60bf48b1a4f70153aebb2d2e5
diff --git a/lib/rexport/export_methods.rb b/lib/rexport/export_methods.rb index <HASH>..<HASH> 100644 --- a/lib/rexport/export_methods.rb +++ b/lib/rexport/export_methods.rb @@ -247,6 +247,8 @@ module Rexport #:nodoc: end end + export_items.reset + position = 0 rexport_fields.each do |rexport_field| position += 1
fix sorting of renamed fields
wwidea_rexport
train
rb
719ca8cb08a2d3011ce785b5360af8e98ba68beb
diff --git a/lib/tokenizer.js b/lib/tokenizer.js index <HASH>..<HASH> 100644 --- a/lib/tokenizer.js +++ b/lib/tokenizer.js @@ -138,7 +138,7 @@ Tokenizer.prototype = { ABORT: function ABORT(){}, - SKIP: function SKIP(val){this.value = val;}, + SKIP: function SKIP(amount){this.amount = amount;}, /** * Match parsed tokens, starting at offset, skipping any token "types" specified in *skipTypes* * @@ -481,8 +481,13 @@ if (match instanceof Tokenizer.prototype.ABORT) return null; - if (match instanceof Tokenizer.prototype.SKIP) - match = match.value; + if (match instanceof Tokenizer.prototype.SKIP) { + console.log('DOING SKIP!!!'); + return { + offset: offset + (match.amount || 0), + value: match + } + } if (match && (match instanceof Array)) { match.index = offset; @@ -551,8 +556,8 @@ return new Tokenizer.prototype.ABORT(); }; - context.skip = function(match) { - return new Tokenizer.prototype.SKIP(match); + context.skip = function(amount) { + return new Tokenizer.prototype.SKIP(amount); }; this.tokens = tokens;
Fixed bug in tokenizer with skipping tokens
th317erd_devoirjs
train
js
3a7a07f93ff17ee758a74e01f2c497cb7c304944
diff --git a/ui/js/directives/top_nav_bar.js b/ui/js/directives/top_nav_bar.js index <HASH>..<HASH> 100644 --- a/ui/js/directives/top_nav_bar.js +++ b/ui/js/directives/top_nav_bar.js @@ -40,12 +40,12 @@ treeherder.directive('thWatchedRepo', [ btnClass: "btn-view-nav-closed" }, "unsupported": { - icon: "", + icon: "fa-question", color: "treeUnavailable", btnClass: "btn-view-nav" }, "not retrieved yet": { - icon: "", + icon: "fa-spinner", color: "treeUnavailable", btnClass: "btn-view-nav" }
Bug <I> - Provide icons for repo btn states unsupported/not-retrieved
mozilla_treeherder
train
js
af9a238f852fb04fbfcdfa57b9b313426f579bd1
diff --git a/scripts/serverless.js b/scripts/serverless.js index <HASH>..<HASH> 100755 --- a/scripts/serverless.js +++ b/scripts/serverless.js @@ -448,7 +448,6 @@ processSpanPromise = (async () => { } } } - if (isHelpRequest || commands[0] === 'plugin') { processLog.debug('resolve variables in "plugins"'); // We do not need full config resolved, we just need to know what @@ -475,6 +474,12 @@ processSpanPromise = (async () => { if (!variablesMeta.size) return; // All properties successuflly resolved if (!ensureResolvedProperty('plugins')) return; + + // At this point we have all properties needed for `plugin install/uninstall` commands + if (commands[0] === 'plugin') { + return; + } + if (!ensureResolvedProperty('package\0path')) return; if (!ensureResolvedProperty('frameworkVersion')) return;
fix: Ensure to attempt minimal config resolution for plugin commands
serverless_serverless
train
js
fb9795a52f6abadcb14f8baf95540c12048e6e2f
diff --git a/messages.go b/messages.go index <HASH>..<HASH> 100644 --- a/messages.go +++ b/messages.go @@ -22,7 +22,7 @@ type Msg struct { User string `json:"user,omitempty"` Text string `json:"text,omitempty"` Timestamp string `json:"ts,omitempty"` - ThreadTimeStamp string `json:"thread_ts,omitempty"` + ThreadTimestamp string `json:"thread_ts,omitempty"` IsStarred bool `json:"is_starred,omitempty"` PinnedTo []string `json:"pinned_to, omitempty"` Attachments []Attachment `json:"attachments,omitempty"`
Rename ThreadTimeStamp to Threadtimestamp for consistency
nlopes_slack
train
go
77677ba87eb447f8b1dffc8cc30bc6a4cd6927b0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,27 @@ # -*- coding: utf-8 -*- +import os try: from setuptools import setup except ImportError: from distutils.core import setup +def walk_subpkg(name): + data_files = [] + package_dir = 'folium' + for parent, dirs, files in os.walk(os.path.join(package_dir, name)): + sub_dir = os.sep.join(parent.split(os.sep)[1:]) # remove package_dir from the path + for f in files: + data_files.append(os.path.join(sub_dir, f)) + return data_files + +pkg_data = { +'': ['*.js', + 'templates/*.html', + 'templates/*.js', + 'templates/*.txt'] + walk_subpkg('templates/tiles') +} + setup( name='folium', version='0.1.2', @@ -18,9 +35,5 @@ setup( 'Programming Language :: Python :: 2.7', 'License :: OSI Approved :: MIT License'], packages=['folium'], - package_data={'': ['*.js', - 'templates/*.html', - 'templates/*.js', - 'templates/*.txt', - 'plugins/*.js']} + package_data=pkg_data )
folium issue #<I> - fixed setup.py to package all the files in templates/tiles.
python-visualization_folium
train
py
945318e45a002579c557a60d1f4ea6601982bf16
diff --git a/fireplace/enums.py b/fireplace/enums.py index <HASH>..<HASH> 100644 --- a/fireplace/enums.py +++ b/fireplace/enums.py @@ -56,14 +56,50 @@ class GameTag(IntEnum): WINDFURY = 189 TAUNT = 190 STEALTH = 191 + SPELLPOWER = 192 DIVINE_SHIELD = 194 CHARGE = 197 CARDRACE = 200 + FACTION = 201 CARDTYPE = 202 + FREEZE = 208 + RECALL = 215 + DEATH_RATTLE = 217 + BATTLECRY = 218 + SECRET = 219 + COMBO = 220 CANT_ATTACK = 227 FROZEN = 260 ARMOR = 292 NUM_ATTACKS_THIS_TURN = 297 + OneTurnEffect = 338 + ADJACENT_BUFF = 350 + AURA = 362 + POISONOUS = 363 + + # flavor + ELITE = 114 + CARD_SET = 183 + CLASS = 199 + RARITY = 203 + + # unused + AttackVisualType = 251 + DevState = 268 + Collectible = 321 + ENCHANTMENT_BIRTH_VISUAL = 330 + ENCHANTMENT_IDLE_VISUAL = 331 + + # strings + TRIGGER_VISUAL = 32 + CARDTEXT_INHAND = 184 + CARDNAME = 185 + CardTextInPlay = 252 + TARGETING_ARROW_TEXT = 325 + ARTISTNAME = 342 + FLAVORTEXT = 351 + HOW_TO_EARN = 364 + HOW_TO_EARN_GOLDEN = 365 class PlayReq(IntEnum):
Add most currently-used GameTags
jleclanche_fireplace
train
py
56bd82ccebbdb49fb8adce5b1f1f78e410ae288d
diff --git a/mod/imscp/backup/moodle1/lib.php b/mod/imscp/backup/moodle1/lib.php index <HASH>..<HASH> 100644 --- a/mod/imscp/backup/moodle1/lib.php +++ b/mod/imscp/backup/moodle1/lib.php @@ -122,13 +122,18 @@ class moodle1_mod_imscp_handler extends moodle1_mod_handler { protected function parse_structure($data, $contextid) { global $CFG; - $temppath = $this->converter->get_tempdir_path(); - $manifestfilecontents = file_get_contents($temppath.'/moddata/resource/'.$data['id'].'/imsmanifest.xml'); + $manifestfile = $this->converter->get_tempdir_path().'/moddata/resource/'.$data['id'].'/imsmanifest.xml'; + if (!file_exists($manifestfile)) { + // todo add to conversion log + return null; + } + $manifestfilecontents = file_get_contents($manifestfile); if (empty($manifestfilecontents)) { + // todo add to conversion log return null; } require_once($CFG->dirroot.'/mod/imscp/locallib.php'); return imscp_parse_manifestfile($manifestfilecontents); } -} \ No newline at end of file +}
MDL-<I> IMS content package converter checks that the manifest file exists
moodle_moodle
train
php
e0c9d810e534508ee94229136e73b51e66811851
diff --git a/src/isEmptyFunction.js b/src/isEmptyFunction.js index <HASH>..<HASH> 100644 --- a/src/isEmptyFunction.js +++ b/src/isEmptyFunction.js @@ -2,7 +2,7 @@ module.exports = function(aFunc, istanbul) { var vStr = aFunc.toString(); var result = /^function\s*\S*\s*\((.|[\n\r\u2028\u2029])*\)\s*{[\s;]*}$/g.test(vStr); if (!result) { - if (!istanbul) try {istanbul = require('istanbul');} catch(e){} + if (!istanbul) try {istanbul = eval("require('istanbul')");} catch(e){} if (istanbul) result = /^function\s*\S*\s*\((.|[\n\r\u2028\u2029])*\)\s*{__cov_[\d\w_]+\.f\[.*\]\+\+;}$/.test(vStr); }
* [bug] the Webpack / Browserify / etc do not "conditional" requires the require gets executed at build time. closes #2
snowyu_inherits-ex.js
train
js
4107c82193991b5f77a314926f308fbbc7db805f
diff --git a/mongoctl/mongoctl.py b/mongoctl/mongoctl.py index <HASH>..<HASH> 100644 --- a/mongoctl/mongoctl.py +++ b/mongoctl/mongoctl.py @@ -3805,8 +3805,7 @@ class Server(DocumentWrapper): status['connection'] = True can_admin = True - if (admin and - self.is_auth() and + if (self.is_auth() and self.needs_to_auth("admin") and not self.has_auth_to("admin")): status['error'] = "Cannot authenticate"
Making is_administrable( ) more accurate by reverting get_status( ) to always attempt to auth
mongolab_mongoctl
train
py
6f0f94c23bb51346488feb039288d2b0065acc00
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index <HASH>..<HASH> 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -416,6 +416,7 @@ export var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({ //If we aren't on the map (yet), blow away the markers we know of if (!this._map) { this._needsClustering = []; + this._needsRemoving = []; delete this._gridClusters; delete this._gridUnclustered; }
Clear out _needsRemoving when clearLayers is called while we aren't on the map. Otherwise we'll try remove them when we are added, which breaks things. Refs #<I>
Leaflet_Leaflet.markercluster
train
js
0a39449694cf874c92a04d0b634d2dfe0627ac48
diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index <HASH>..<HASH> 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -153,6 +153,14 @@ describe('browser-window module', function () { }) w.loadURL('file://' + path.join(fixtures, 'api', 'did-fail-load-iframe.html')) }) + + it('does not crash in did-fail-provisional-load handler', function (done) { + w.webContents.once('did-fail-provisional-load', function () { + w.loadURL('http://somewhere-that-does-not.exist/') + done() + }) + w.loadURL('http://somewhere-that-does-not.exist/') + }) }) describe('BrowserWindow.show()', function () {
spec: loadUrl should not crash in did-fail-provisional-load handler
electron_electron
train
js
dc66f8f63274cb87e1e1436ef21bca81e3ca9038
diff --git a/lib/cuke_modeler/models/cell.rb b/lib/cuke_modeler/models/cell.rb index <HASH>..<HASH> 100644 --- a/lib/cuke_modeler/models/cell.rb +++ b/lib/cuke_modeler/models/cell.rb @@ -1,6 +1,5 @@ module CukeModeler - # A class modeling a single cell of a row. class Cell < Model include Sourceable
Break some more stuff Adding a break for the documentation and linting jobs, in order to see how they react.
enkessler_cuke_modeler
train
rb
09e8c50a5caf734410661b78ebcb5e0d8e3c7ad6
diff --git a/salt/engines/sqs_events.py b/salt/engines/sqs_events.py index <HASH>..<HASH> 100644 --- a/salt/engines/sqs_events.py +++ b/salt/engines/sqs_events.py @@ -167,4 +167,6 @@ def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): while True: if not q: q = sqs.get_queue(queue, owner_acct_id=owner_acct_id) + q.set_message_class(boto.sqs.message.RawMessage) + _process_queue(q, queue, fire_master, tag=tag, owner_acct_id=owner_acct_id, message_format=message_format)
Surpress boto WARNING during decode, reference: <URL>
saltstack_salt
train
py
dd7f9366229d0cf6761567f86192343d8d4d5698
diff --git a/src/lang/nl/lfm.php b/src/lang/nl/lfm.php index <HASH>..<HASH> 100644 --- a/src/lang/nl/lfm.php +++ b/src/lang/nl/lfm.php @@ -50,6 +50,7 @@ return [ 'error-instance' => 'Het geuploade bestand moet een instantie zijn van UploadedFile', 'error-invalid' => 'Ongeldig upload verzoek', 'error-other' => 'Er is een fout opgetreden: ', + 'error-size' => 'U heeft de maximale bestandsgrootte overschreden:', 'error-too-large' => 'De verzoek entiteit is te groot!', 'btn-upload' => 'Bestand uploaden',
Merge pull request #<I> from tvbeek/patch-1 * Add a missing dutch translation line * Update lfm.php
UniSharp_laravel-filemanager
train
php
217fba61859c0002a855d8ab3d62251d57aa5662
diff --git a/mnemosyned/daemon.go b/mnemosyned/daemon.go index <HASH>..<HASH> 100644 --- a/mnemosyned/daemon.go +++ b/mnemosyned/daemon.go @@ -3,6 +3,7 @@ package mnemosyned import ( "database/sql" "errors" + "fmt" "io" "net" "net/http" @@ -147,7 +148,7 @@ func (d *Daemon) Run() (err error) { interceptor := promgrpc.NewInterceptor(promgrpc.InterceptorOpts{}) d.clientOptions = []grpc.DialOption{ - grpc.WithUserAgent(subsystem), + grpc.WithUserAgent(fmt.Sprintf("%s:%s", subsystem, d.opts.Version)), grpc.WithStatsHandler(interceptor), grpc.WithDialer(interceptor.Dialer(func(addr string, timeout time.Duration) (net.Conn, error) { return net.DialTimeout("tcp", addr, timeout)
grpc user agent has service version as well
piotrkowalczuk_mnemosyne
train
go
0293134c5c14b811ea341c5d4ee11374e5e4acc8
diff --git a/ansible_runner/runner_config.py b/ansible_runner/runner_config.py index <HASH>..<HASH> 100644 --- a/ansible_runner/runner_config.py +++ b/ansible_runner/runner_config.py @@ -288,12 +288,12 @@ class RunnerConfig(object): output.debug("Not loading settings") self.settings = dict() - try: - if self.ssh_key_data is None: - self.ssh_key_data = self.loader.load_file('env/ssh_key', string_types) - except ConfigurationError: - output.debug("Not loading ssh key") - self.ssh_key_data = None + try: + if self.ssh_key_data is None: + self.ssh_key_data = self.loader.load_file('env/ssh_key', string_types) + except ConfigurationError: + output.debug("Not loading ssh key") + self.ssh_key_data = None self.idle_timeout = self.settings.get('idle_timeout', None) self.job_timeout = self.settings.get('job_timeout', None)
Revert accidental indentation change from ac<I>d0.
ansible_ansible-runner
train
py
e7d4a289c2a4eb0784d640654015d110bddf3fc8
diff --git a/test/core_tasks.js b/test/core_tasks.js index <HASH>..<HASH> 100644 --- a/test/core_tasks.js +++ b/test/core_tasks.js @@ -6,6 +6,7 @@ describe('Core: Tasks', function(){ var taskOutput = []; before(function(done){ + this.timeout(10000) specHelper.stopServer(0, function(api){ specHelper.prepare(0, function(api){ rawAPI = api; @@ -326,6 +327,7 @@ describe('Core: Tasks', function(){ }); it('tasks can be passed params and taskWorkers can work on thier own', function(done){ + this.timeout(10000) taskOutput = []; rawAPI.redis.client.flushdb(function(){ var worker = new rawAPI.taskProcessor({id: 1}); @@ -336,7 +338,7 @@ describe('Core: Tasks', function(){ taskOutput[0].should.equal('TEST'); worker.stop(); done(); - }, 1000) + }, rawAPI.tasks.cycleTimeMS * 2 + 1) }); }); });
update task tests to slower sample time:
actionhero_actionhero
train
js
c21856e70c5cb29a09fea9de938082e920792d26
diff --git a/aws-sdk-core/lib/aws-sdk-core/xml/parser.rb b/aws-sdk-core/lib/aws-sdk-core/xml/parser.rb index <HASH>..<HASH> 100644 --- a/aws-sdk-core/lib/aws-sdk-core/xml/parser.rb +++ b/aws-sdk-core/lib/aws-sdk-core/xml/parser.rb @@ -20,6 +20,21 @@ module Aws @engine = options[:engine] || self.class.engine end + # Parses the XML document, returning a parsed structure. + # + # If you pass a block, this will yield for XML + # elements that are not modeled in the rules given + # to the constructor. + # + # parser.parse(xml) do |path, value| + # puts "uhandled: #{path.join('/')} - #{value}" + # end + # + # The purpose of the unhandled callback block is to + # allow callers to access values such as the EC2 + # request ID that are part of the XML body but not + # part of the operation result. + # # @param [String] xml An XML document string to parse. # @param [Structure] target (nil) # @return [Structure]
Added clarifying docs.
aws_aws-sdk-ruby
train
rb
60a3708d76548bdc03fcfb7098bcd9d898fee72e
diff --git a/scripts/documentation/generate.js b/scripts/documentation/generate.js index <HASH>..<HASH> 100644 --- a/scripts/documentation/generate.js +++ b/scripts/documentation/generate.js @@ -139,14 +139,14 @@ async function execute() { await git.commit(message, [FINAL_SAVE_PATH]); console.info("\x1b[32m", `Changes committed to ${TARGET_BRANCH} branch`, "\x1b[0m"); - // Push changes + // Push changes and remove tmp folder await git.push(); console.info("\x1b[32m", `Changes pushed to remote`, "\x1b[0m"); + await rimraf(TMP_FOLDER); - // Come back to original branch and remove tmp folder + // Come back to original branch console.info("\x1b[32m", `Switching back to '${ORIGINAL_BRANCH}' branch`, "\x1b[0m"); await git.checkout(ORIGINAL_BRANCH); - await rimraf(TMP_FOLDER); }
Remove tmp folder at the end
djipco_webmidi
train
js
0f568ae572dc178acdcf30ab46c7e8ffb2605ad1
diff --git a/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java b/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java +++ b/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java @@ -457,6 +457,7 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo { // quotes // https://github.com/aleksandr-m/gitflow-maven-plugin/issues/3 branches = removeQuotes(branches); + branches = StringUtils.strip(branches); return branches; }
Strip some whitespace characters in find branches - closes #<I>
aleksandr-m_gitflow-maven-plugin
train
java
fdc41cd18d9168fc00216688875d24fe248c98f4
diff --git a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URL.java b/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URL.java index <HASH>..<HASH> 100644 --- a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URL.java +++ b/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URL.java @@ -1189,8 +1189,8 @@ public final class URL implements java.io.Serializable { if (handler == null) { try { if (protocol.equals("file")) { - handler = (URLStreamHandler)Class. - forName("sun.net.www.protocol.file.Handler").newInstance(); + // https://github.com/google/j2objc/issues/912 + handler = new sun.net.www.protocol.file.Handler(); } else if (protocol.equals("jar")) { throw new UnsupportedOperationException("Jar streams are not supported."); } else if (protocol.equals("http")) {
Issue #<I>: fixed file URLStreamHandler linking.
google_j2objc
train
java
a2311d3c09ba0885be7b127d3b87f74505069e2f
diff --git a/tensorflow_probability/python/vi/optimization.py b/tensorflow_probability/python/vi/optimization.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/vi/optimization.py +++ b/tensorflow_probability/python/vi/optimization.py @@ -135,10 +135,10 @@ def fit_surrogate_posterior(target_log_prob_fn, Default value: 'fit_surrogate_posterior'. Returns: - results: `Tensor` or nested structure of `Tensor`s, according to the - return type of `result_fn`. Each `Tensor` has an added leading dimension - of size `num_steps`, packing the trajectory of the result over the course - of the optimization. + results: `Tensor` or nested structure of `Tensor`s, according to the return + type of `trace_fn`. Each `Tensor` has an added leading dimension of size + `num_steps`, packing the trajectory of the result over the course of the + optimization. #### Examples
Fix a typo in the description of fit_surrogate_posterior
tensorflow_probability
train
py
09b99712d9fa6b66b8ebe46431b4dbf771d8481e
diff --git a/lib/rdo/colored_logger.rb b/lib/rdo/colored_logger.rb index <HASH>..<HASH> 100644 --- a/lib/rdo/colored_logger.rb +++ b/lib/rdo/colored_logger.rb @@ -15,9 +15,9 @@ module RDO self.formatter = Proc.new do |severity, time, prog, msg| case severity - when "DEBUG" then "\033[35mSQL\033[0m \033[36m~\033[0m %s\n" % msg - when "FATAL" then "\033[31mERROR ~ %s\033[0m\n" % msg - else "%s ~ %s\n" % [severity, msg] + when "DEBUG" then "\033[35mSQL\033[0m \033[36m~\033[0m %s#{$/}" % msg + when "FATAL" then "\033[31mERROR ~ %s\033[0m#{$/}" % msg + else "%s ~ %s#{$/}" % [severity, msg] end end end
Use cross-platform line-endings in logger
d11wtq_rdo
train
rb
bb22c67bc3da7d92ed9ea3acf6d27532e9855262
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -61,9 +61,9 @@ copyright = u'2015, Jeong-Yoon Lee' # built documents. # # The short X.Y version. -version = '0.4' +version = '0.5' # The full version, including alpha/beta/rc tags. -release = '0.4.4' +release = '0.5.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/kaggler/__init__.py b/kaggler/__init__.py index <HASH>..<HASH> 100644 --- a/kaggler/__init__.py +++ b/kaggler/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.4.4' +__version__ = '0.5.0' __all__ = ['const', 'data_io', 'feature_selection', diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ except ImportError: setup( name='Kaggler', - version='0.4.4', + version='0.5.0', author='Jeong-Yoon Lee', author_email='[email protected]',
update version number to <I>
jeongyoonlee_Kaggler
train
py,py,py
102cf5765202d0211059126df162bc36fbddecff
diff --git a/lenses/lens.py b/lenses/lens.py index <HASH>..<HASH> 100644 --- a/lenses/lens.py +++ b/lenses/lens.py @@ -24,7 +24,6 @@ lens_methods = [ ('norm_', baselens.NormalisingLens), ('setter_', baselens.SetterLens), ('traverse_', baselens.TraverseLens), - ('trivial_', baselens.TrivialLens), ('tuple_', baselens.TupleLens), ('values_', baselens.ValuesLens), ('zoomattr_', baselens.ZoomAttrLens), diff --git a/tests/test_lens.py b/tests/test_lens.py index <HASH>..<HASH> 100644 --- a/tests/test_lens.py +++ b/tests/test_lens.py @@ -216,7 +216,7 @@ def test_lens_divide(): # Testing that you can use sublenses through Lens properly def test_lens_trivial(): - assert lens(3).trivial_().get() == 3 + assert lens(3).get() == 3 def test_lens_getitem():
removed useless trivial lens access from api
ingolemo_python-lenses
train
py,py
6c57dd9fef8942adebc912f2508bf1377e94b362
diff --git a/lib/abn_search.rb b/lib/abn_search.rb index <HASH>..<HASH> 100644 --- a/lib/abn_search.rb +++ b/lib/abn_search.rb @@ -181,7 +181,7 @@ class ABNSearch else if !result[:legal_name].blank? && result[:legal_name].length > 2 result[:name] = result[:legal_name] - elsif !result[:legal_name].blank? + elsif !result[:legal_name2].blank? result[:name] = result[:legal_name2] end end @@ -192,4 +192,4 @@ class ABNSearch def valid? self.errors.size == 0 end -end \ No newline at end of file +end
fixed parse_search_results so that legal_name2 can be used as the name
Oneflare_abn_search
train
rb
c30f3210ca81632becfc3850e6d7bff5c67a3446
diff --git a/mobly/utils.py b/mobly/utils.py index <HASH>..<HASH> 100644 --- a/mobly/utils.py +++ b/mobly/utils.py @@ -19,7 +19,6 @@ import logging import os import platform import portpicker -import psutil import random import re import signal @@ -331,6 +330,10 @@ def stop_standing_subprocess(proc, kill_signal=signal.SIGTERM): Raises: Error: if the subprocess could not be stopped. """ + # Only import psutil when actually needed. + # psutil may cause import error in certain env. This way the utils module + # doesn't crash upon import. + import psutil pid = proc.pid logging.debug('Stopping standing subprocess %d', pid) process = psutil.Process(pid)
Localize `psutil` usage. (#<I>)
google_mobly
train
py
fa8c91d19e2fdc95e12db9cd902b091a57f65733
diff --git a/src/elements/NavLink.js b/src/elements/NavLink.js index <HASH>..<HASH> 100644 --- a/src/elements/NavLink.js +++ b/src/elements/NavLink.js @@ -1,8 +1,9 @@ import styled from 'styled-components'; import theme from '../theme'; -const NavLink = styled.a` +const NavLink = styled.div` + a { text-decoration: none; display: block; padding: 20px 30px; @@ -18,6 +19,7 @@ const NavLink = styled.a` font-weight: 800; font-size: 16px; } + } svg { margin-right: 10px; @@ -26,10 +28,14 @@ const NavLink = styled.a` } @media (max-width: 768px) { + + a { padding: 20px 0; margin-left: auto; margin-right: auto; text-align: center; + } + svg { margin-right: 0;
Nav Links style contained <a> tags.
mokko-labs_substance-ui-legacy
train
js
246440774f4ada810733300f09411004a7b405b1
diff --git a/src/api/helpers/generateWrappers.js b/src/api/helpers/generateWrappers.js index <HASH>..<HASH> 100644 --- a/src/api/helpers/generateWrappers.js +++ b/src/api/helpers/generateWrappers.js @@ -32,7 +32,7 @@ function generateWrappers(cls, types, prefixMap, metadata) { } = func; // Don't parse deprecated APIs - if (deprecatedSince === '1') { + if (deprecatedSince <= 2) { return; }
Fix ignore deprecated methods (ignore since 2)
neovim_node-client
train
js
8966e17b8982e089cb520b6aa9a78f4a7b120305
diff --git a/src/ol/renderer/dom/domtilelayerrenderer.js b/src/ol/renderer/dom/domtilelayerrenderer.js index <HASH>..<HASH> 100644 --- a/src/ol/renderer/dom/domtilelayerrenderer.js +++ b/src/ol/renderer/dom/domtilelayerrenderer.js @@ -79,15 +79,15 @@ ol.renderer.dom.TileLayer.prototype.renderFrame = return; } + var view2DState = frameState.view2DState; + var tileLayer = this.getTileLayer(); var tileSource = tileLayer.getTileSource(); var tileGrid = tileSource.getTileGrid(); - - var view2DState = frameState.view2DState; var z = tileGrid.getZForResolution(view2DState.resolution); - var tileRange = tileGrid.getTileRangeForExtentAndResolution( - frameState.extent, view2DState.resolution); var tileResolution = tileGrid.getResolution(z); + var tileRange = tileGrid.getTileRangeForExtentAndResolution( + frameState.extent, tileResolution); /** @type {Object.<number, Object.<string, ol.Tile>>} */ var tilesToDrawByZ = {};
Structure DOM renderer code to be more similar to WebGL renderer code
openlayers_openlayers
train
js
ae625872fe24a8f424862c04232f1b605f33545b
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -134,8 +134,8 @@ html_theme_options = { 'github_banner': True, 'show_powered_by': False, 'extra_nav_links': { - 'invenio-openaire@GitHub': 'http://github.com/inveniosoftware/invenio-openaire', - 'invenio-openaire@PyPI': 'http://pypi.python.org/pypi/invenio-openaire/', + 'invenio-openaire@GitHub': 'https://github.com/inveniosoftware/invenio-openaire', + 'invenio-openaire@PyPI': 'https://pypi.python.org/pypi/invenio-openaire/', } } @@ -326,3 +326,6 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None} + +# Autodoc configuraton. +autoclass_content = 'both'
docs: autodoc configuration and HTTPS fix * Replaces HTTP links with HTTPS where possible.
inveniosoftware_invenio-openaire
train
py
d03f143f63d9f7b32dacde1ae9e5b48bb07b9d3e
diff --git a/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java b/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java index <HASH>..<HASH> 100644 --- a/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java +++ b/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java @@ -133,6 +133,8 @@ public class JBossWSInvoker extends JAXWSMethodInvoker implements Invoker targetBean = this.getServiceObject(exchange); } + //[JBWS-3843] workaround: set the CallbackHandler threadlocal again; as a matter of fact, if that's in the Exchange, + //DIGEST auth is being used and that will cause the EJB layer to re-do authentication because of the bug CallbackHandler cbHandler = exchange.getInMessage().get(CallbackHandler.class); Object obj = null; try
[JBWS-<I>] Adding comment explaining the workaround; proper fix will come in PicketBox
jbossws_jbossws-cxf
train
java
61d7f1e9b5c370307fc45ecdb0f4a670efe8356f
diff --git a/geom_test.go b/geom_test.go index <HASH>..<HASH> 100644 --- a/geom_test.go +++ b/geom_test.go @@ -201,6 +201,11 @@ func TestGeoMIsInvert(t *testing.T) { cpx.Scale(1.5, 2.5) cpx.Translate(-2, -3) + cpx2 := GeoM{} + cpx2.Scale(2, 3) + cpx2.Rotate(0.234) + cpx2.Translate(100, 100) + cases := []struct { GeoM GeoM Invertible bool @@ -225,6 +230,10 @@ func TestGeoMIsInvert(t *testing.T) { GeoM: cpx, Invertible: true, }, + { + GeoM: cpx2, + Invertible: true, + }, } pts := []struct { diff --git a/internal/affine/geom.go b/internal/affine/geom.go index <HASH>..<HASH> 100644 --- a/internal/affine/geom.go +++ b/internal/affine/geom.go @@ -188,7 +188,7 @@ func (g *GeoM) det() float64 { if g == nil { return 1 } - return (g.a_1+1)*(g.d_1+1) - g.b - g.c + return (g.a_1+1)*(g.d_1+1) - g.b*g.c } func (g *GeoM) IsInvertible() bool {
affine: Bug fix: (*GeoM).det() was wrong (#<I>)
hajimehoshi_ebiten
train
go,go
5e6ec42e611ab3179b412b9e81074dd95e4c361e
diff --git a/FFmpegMovie.php b/FFmpegMovie.php index <HASH>..<HASH> 100644 --- a/FFmpegMovie.php +++ b/FFmpegMovie.php @@ -202,7 +202,7 @@ class FFmpegMovie implements Serializable { // Get information about file from ffmpeg $output = array(); - exec('ffmpeg -i '.$this->movieFile.' 2>&1', $output, $retVar); + exec('ffmpeg -i '.escapeshellarg($this->movieFile).' 2>&1', $output, $retVar); $this->ffmpegOut = join(PHP_EOL, $output); // No ffmpeg installed @@ -609,7 +609,7 @@ class FFmpegMovie implements Serializable { $frameFilePath = sys_get_temp_dir().uuid().'.jpg'; $frameTime = round((($framePos / $this->getFrameCount()) * $this->getDuration()), 4); - exec('ffmpeg -i '.$this->movieFile.' -vframes 1 -ss '.$frameTime.' '.$frameFilePath.' 2>&1', $out); + exec('ffmpeg -i '.escapeshellarg($this->movieFile).' -vframes 1 -ss '.$frameTime.' '.$frameFilePath.' 2>&1', $out); // Cannot write frame to the data storage if (!file_exists($frameFilePath)) {
Security hole patched with escapeshellarg()
char0n_ffmpeg-php
train
php
0d5773f41e1cd55035a868df29afbf6f30dd2863
diff --git a/lib/Podio.php b/lib/Podio.php index <HASH>..<HASH> 100644 --- a/lib/Podio.php +++ b/lib/Podio.php @@ -44,7 +44,7 @@ class Podio { if ($options && !empty($options['session_manager'])) { if (is_string($options['session_manager']) && class_exists($options['session_manager'])) { self::$session_manager = new $options['session_manager']; - } else if (is_object($options['session_manager']) && method_exists($options['session_manager'], 'get') && method_exists($options['session_manager'], 'get')) { + } else if (is_object($options['session_manager']) && method_exists($options['session_manager'], 'get') && method_exists($options['session_manager'], 'set')) { self::$session_manager = $options['session_manager']; } if (self::$session_manager) {
Both get and set functions should be checked in a session manager object, not twice get.
podio-community_podio-php
train
php
8ccc3f447d113d4136153294935ff977e5e581d6
diff --git a/spec/current_month_spec.rb b/spec/current_month_spec.rb index <HASH>..<HASH> 100644 --- a/spec/current_month_spec.rb +++ b/spec/current_month_spec.rb @@ -8,11 +8,11 @@ describe Beggar::CurrentMonth do end it 'returns weekdays' do - pending + current_month.weekdays.should == 21 end it 'returns weekdays until today' do - pending + current_month.weekdays_until_today.should == 13 end it 'returns weekdays in hours' do @@ -24,31 +24,32 @@ describe Beggar::CurrentMonth do end it 'returns weekdays progression' do - pending + current_month.weekdays_progression.should == 62 end it 'returns weekdays until date' do - pending + date = Date.new(2012, 2, 23) + current_month.weekdays_until(date).should == 17 end it 'returns first day of month' do - pending + current_month.first_day.should == Date.new(2012, 2, 1) end it 'returns last day of month' do - pending + current_month.last_day.should == Date.new(2012, 2, 29) end it 'returns year' do - pending + current_month.year.should == 2012 end it 'returns month' do - pending + current_month.month.should == 2 end it 'returns today' do - pending + current_month.today.should == Date.new(2012, 2, 17) end end
Add missing specs for CurrentMonth class
brtjkzl_beggar
train
rb
303970fae2583b858b3238ff045aeb424dddb2c0
diff --git a/classes/Util.php b/classes/Util.php index <HASH>..<HASH> 100644 --- a/classes/Util.php +++ b/classes/Util.php @@ -83,6 +83,7 @@ class QM_Util { self::$file_dirs['go-plugin'] = self::standard_dir( WPMU_PLUGIN_DIR . '/shared-plugins' ); self::$file_dirs['mu-plugin'] = self::standard_dir( WPMU_PLUGIN_DIR ); self::$file_dirs['vip-plugin'] = self::standard_dir( get_theme_root() . '/vip/plugins' ); + self::$file_dirs['theme'] = null; self::$file_dirs['stylesheet'] = self::standard_dir( get_stylesheet_directory() ); self::$file_dirs['template'] = self::standard_dir( get_template_directory() ); self::$file_dirs['other'] = self::standard_dir( WP_CONTENT_DIR ); @@ -152,9 +153,11 @@ class QM_Util { } else { $name = __( 'Theme', 'query-monitor' ); } + $type = 'theme'; break; case 'template': $name = __( 'Parent Theme', 'query-monitor' ); + $type = 'theme'; break; case 'other': // Anything else that's within the content directory should appear as
Specify a common component type for themes.
johnbillion_query-monitor
train
php
ef5cdd9b21bcaa026af1375d6149beb64b1b36e0
diff --git a/src/SidebarMenu.php b/src/SidebarMenu.php index <HASH>..<HASH> 100644 --- a/src/SidebarMenu.php +++ b/src/SidebarMenu.php @@ -41,12 +41,12 @@ class SidebarMenu extends \hipanel\base\Menu implements \yii\base\BootstrapInter 'tariffs' => [ 'label' => Yii::t('hipanel/finance', 'Tariffs'), 'url' => ['/finance/tariff/index'], - 'visible' => function () { return Yii::$app->user->can('support') ?: false; }, + 'visible' => function () { return Yii::$app->user->can('support'); }, ], 'holds' => [ 'label' => Yii::t('hipanel/finance', 'Held payments'), 'url' => ['/finance/held-payments/index'], - 'visible' => function () { return Yii::$app->user->can('resell') ?: false; }, + 'visible' => function () { return Yii::$app->user->can('resell'); }, ], ], ],
Removed Client and Seller filters from the AdvancedSearch view for non-support
hiqdev_hipanel-module-finance
train
php
07d3cbef203259b62538533d068ae1d77ae49553
diff --git a/src/shapes/labels.js b/src/shapes/labels.js index <HASH>..<HASH> 100644 --- a/src/shapes/labels.js +++ b/src/shapes/labels.js @@ -23,7 +23,7 @@ d3plus.shape.labels = function(vars,selection,enter,exit) { var align = t.anchor || vars.style.labels.align, tspan = this.tagName == "tspan", share = tspan ? this.parentNode.className.baseVal == "share" : this.className.baseVal == "share", - width = d3.select(this).node().getBBox().width, + width = d3.select(this).node().getComputedTextLength(), rtl = vars.style.labels.dir == "rtl" if (align == "middle" || share) {
fixed cross-browser problem with .getBBox() of tspan element
alexandersimoes_d3plus
train
js
e847fe371f62eebf00acd3bfc7b445b48763dd1a
diff --git a/lib/swag_dev/project/tools/vagrant/shell.rb b/lib/swag_dev/project/tools/vagrant/shell.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/tools/vagrant/shell.rb +++ b/lib/swag_dev/project/tools/vagrant/shell.rb @@ -16,6 +16,8 @@ class SwagDev::Project::Tools::Vagrant::Shell # @return [Hash] attr_reader :options + # Initialize a shell with given options + # # @param [Hash] def initialize(options = {}) @options = options @@ -71,9 +73,9 @@ class SwagDev::Project::Tools::Vagrant::Shell require 'rake' require 'rake/file_utils' - # rubocop:disable Style/CaseEquality - cmd.push(options) unless cmd.last === Hash - # rubocop:enable Style/CaseEquality + unless cmd.last.is_a?(Hash) and !cmd.last.empty? + cmd.push(options.clone) + end ::Rake::FileUtilsExt.sh(*cmd, &block) end
vagrant/shell (tools) minor bugfix
SwagDevOps_kamaze-project
train
rb
d9cffece6bd354949231ec56d442e48130d448f6
diff --git a/consumables/js/es2015/index.js b/consumables/js/es2015/index.js index <HASH>..<HASH> 100644 --- a/consumables/js/es2015/index.js +++ b/consumables/js/es2015/index.js @@ -135,8 +135,12 @@ export { * by searching for elements with `data-component-name` (e.g. `data-loading`) attribute * or upon DOM events (e.g. clicking) on such elements. * See each components' static `.init()` methods for details. + * + * HeaderNav is not instantiated - see PR https://github.ibm.com/Bluemix/bluemix-components/pull/1318 + * * @private */ + const init = () => { if (!settings.disableAutoInit) { FabButton.init(); @@ -145,7 +149,6 @@ const init = () => { Tab.init(); OverflowMenu.init(); Modal.init(); - HeaderNav.init(); Toolbars.init(); Loading.init(); Dropdown.init();
[6.x] Hotfix clash between Bluemix.Common and bluemix-components.js (#<I>) Remove auto init for HeaderNav
carbon-design-system_carbon-components
train
js
05ea3c30fca4a75e04ed5073a5646dd434bc58df
diff --git a/packages/veritone-widgets/src/widgets/EngineOutputExport/EngineCategoryConfigList.js b/packages/veritone-widgets/src/widgets/EngineOutputExport/EngineCategoryConfigList.js index <HASH>..<HASH> 100644 --- a/packages/veritone-widgets/src/widgets/EngineOutputExport/EngineCategoryConfigList.js +++ b/packages/veritone-widgets/src/widgets/EngineOutputExport/EngineCategoryConfigList.js @@ -38,7 +38,7 @@ export default class EngineCategoryConfigList extends Component { static propTypes = { tdos: arrayOf( shape({ - tdoId: string, + tdoId: string.isRequired, mentionId: string, startOffsetMs: number, stopOffsetMs: number diff --git a/packages/veritone-widgets/src/widgets/EngineOutputExport/index.js b/packages/veritone-widgets/src/widgets/EngineOutputExport/index.js index <HASH>..<HASH> 100644 --- a/packages/veritone-widgets/src/widgets/EngineOutputExport/index.js +++ b/packages/veritone-widgets/src/widgets/EngineOutputExport/index.js @@ -50,7 +50,7 @@ class EngineOutputExport extends Component { static propTypes = { tdos: arrayOf( shape({ - tdoId: string, + tdoId: string.isRequired, mentionId: string, startOffsetMs: number, stopOffsetMs: number
todId is required because the if the user toggles the includeMedia to true then we need to provide a tdoId.
veritone_veritone-sdk
train
js,js
e278338610aa901e712f954fe422466ac03f2fb9
diff --git a/src/server/pfs/server/api_server.go b/src/server/pfs/server/api_server.go index <HASH>..<HASH> 100644 --- a/src/server/pfs/server/api_server.go +++ b/src/server/pfs/server/api_server.go @@ -352,8 +352,14 @@ func putFileLogHelper(request *pfs.PutFileRequest, err error, duration time.Dura func (a *apiServer) putFileObj(objClient obj.Client, request *pfs.PutFileRequest, url *url.URL) (retErr error) { put := func(filePath string, objPath string) (thisRetErr error) { - request.Url = objPath - request.File.Path = filePath + logRequest := &pfs.PutFileRequest{ + FileType: request.FileType, + Delimiter: request.Delimiter, + Url: objPath, + File: request.File, + Recursive: request.Recursive, + } + logRequest.File.Path = filePath protorpclog.Log("pfs.API", "putFileObj", request, nil, nil, 0) defer func(start time.Time) { protorpclog.Log("pfs.API", "putFileObj", request, nil, retErr, time.Since(start))
Use fresh putFileRequest for logging Otherwise there's some contention around this object
pachyderm_pachyderm
train
go
a6a0b28d3437f903763e3b5edaf7581aa5ef468f
diff --git a/cobald/composite/factory.py b/cobald/composite/factory.py index <HASH>..<HASH> 100644 --- a/cobald/composite/factory.py +++ b/cobald/composite/factory.py @@ -54,7 +54,7 @@ class FactoryPool(CompositePool): except ZeroDivisionError: return 1. - def __init__(self, *children: Pool, factory: Callable[..., Pool], interval: float = 30): + def __init__(self, *children: Pool, factory: Callable[[], Pool], interval: float = 30): self._demand = sum(child.demand for child in children) #: children fulfilling our demand self._hatchery = set(children)
type hint for FactoryPool marks factory as taking no parameters
MatterMiners_cobald
train
py
0b580a7814511f5424c88436fa6878d0662f7054
diff --git a/vingd/__init__.py b/vingd/__init__.py index <HASH>..<HASH> 100644 --- a/vingd/__init__.py +++ b/vingd/__init__.py @@ -1,7 +1,7 @@ """Vingd API interface client.""" __title__ = 'vingd-api-python' -__version__ = '0.1.3' +__version__ = '0.1.4' __author__ = 'Radomir Stevanovic' __author_email__ = '[email protected]' __copyright__ = 'Copyright 2012 Vingd, Inc.'
bumped to <I>
vingd_vingd-api-python
train
py
5f4b6c42b0fff7cbaa46269381b891c7ab419644
diff --git a/lib/qunited/server.rb b/lib/qunited/server.rb index <HASH>..<HASH> 100644 --- a/lib/qunited/server.rb +++ b/lib/qunited/server.rb @@ -105,8 +105,9 @@ module QUnited end end - # Compile the CoffeeScript file with the given filename to JavaScript. Returns the full - # path of the compiled JavaScript file. The file is created in a temporary directory. + # Compile the CoffeeScript file with the given filename to JavaScript. Returns the compiled + # code as a string. Returns failing test JavaScript if CoffeeScript support is not installed. + # Also adds a failing test on compilation failure. def compile_coffeescript(file) begin require 'coffee-script' @@ -125,7 +126,18 @@ test('coffee-script gem must be installed to compile this file: #{file}', functi end compiled_js_file = Tempfile.new(["compiled_#{File.basename(file).gsub('.', '_')}", '.js']) - contents = CoffeeScript.compile(File.read(file)) + + begin + contents = CoffeeScript.compile(File.read(file)) + rescue => e + return <<-COMPILATION_ERROR_SCRIPT +module('CoffeeScript'); +test('CoffeeScript compilation error', function() { + ok(false, "#{e.message.gsub('"', '\"')}") +}); + COMPILATION_ERROR_SCRIPT + end + compiled_js_file.write contents compiled_js_file.close
Fail server tests on CoffeeScript compile failure
aaronroyer_qunited
train
rb
aad0e69359fa442cb5754a51cdddebcdc683fefd
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php index <HASH>..<HASH> 100644 --- a/core/Tracker/GoalManager.php +++ b/core/Tracker/GoalManager.php @@ -10,6 +10,7 @@ namespace Piwik\Tracker; use Exception; use Piwik\Common; +use Piwik\Container\StaticContainer; use Piwik\Date; use Piwik\Piwik; use Piwik\Plugin\Dimension\ConversionDimension; @@ -817,7 +818,6 @@ class GoalManager * @param $pattern_type * @param $url * @return bool - * @throws Exception */ protected function isGoalPatternMatchingUrl($goal, $pattern_type, $url) { @@ -852,7 +852,11 @@ class GoalManager $match = ($matched == 0); break; default: - throw new Exception(Piwik::translate('General_ExceptionInvalidGoalPattern', array($pattern_type))); + try { + StaticContainer::get('Psr\Log\LoggerInterface')->warning(Piwik::translate('General_ExceptionInvalidGoalPattern', array($pattern_type))); + } catch (\Exception $e) { + } + $match = false; break; } return $match;
Prevent tracking failures when invalid goal patterns are defined (#<I>) * Log warning instead of throwing an exception * add try/catch
matomo-org_matomo
train
php
86688c1b7adbe6d77831b473f3be355c5b652d7f
diff --git a/src/ExtendedMySql.php b/src/ExtendedMySql.php index <HASH>..<HASH> 100644 --- a/src/ExtendedMySql.php +++ b/src/ExtendedMySql.php @@ -3,6 +3,28 @@ namespace Codeception\Lib\Driver; -class ExtendedMySql extends MySql{ +class ExtendedMySql extends MySql +{ -} \ No newline at end of file + public function insertOrUpdate($tableName, array &$data) + { + $columns = array_map( + array($this, 'getQuotedName'), + array_keys($data) + ); + + $updateAssignments = array(); + foreach ($data as $key => $value) { + $updateAssignments[] = sprintf('%s=%s', $key, $value); + } + $updateAssignments = implode(', ', $updateAssignments); + + $query = sprintf( + "INSERT INTO %s (%s) VALUES (%s) ON DUPLICATE KEY UPDATE %s", + $this->getQuotedName($tableName), + implode(', ', $columns), + implode(', ', array_fill(0, count($data), '?')), + $updateAssignments + ); + } +} \ No newline at end of file
added the insertOrUpdate method to the ExtendedMySql class
lucatume_wp-browser
train
php
dc081720f2a562d24caadabc2a4ae8d70025254f
diff --git a/src/logger.js b/src/logger.js index <HASH>..<HASH> 100644 --- a/src/logger.js +++ b/src/logger.js @@ -4,7 +4,7 @@ import { format as fmt } from 'util'; import chalkModule from 'chalk'; const chalk = new chalkModule.constructor({ - enabled: process.stderr.isTTY, + enabled: process.stderr && process.stderr.isTTY, }); // Special chars.
Don't assume `process.stderr` is an object It's typically not set in Browserify.
SassDoc_sassdoc
train
js
3919af475fa12a2ecd42cea4425a3f3710989fcf
diff --git a/common/common.go b/common/common.go index <HASH>..<HASH> 100644 --- a/common/common.go +++ b/common/common.go @@ -39,7 +39,7 @@ const ( OverlayPreparedFilename = "overlay-prepared" PrivateUsersPreparedFilename = "private-users-prepared" - MetadataServicePort = 2375 + MetadataServicePort = 18112 MetadataServiceRegSock = "/run/rkt/metadata-svc.sock" DefaultLocalConfigDir = "/etc/rkt"
common: change the port number The previous port number was registered and reserved. Use a random high port number in the non-dynamic range.
rkt_rkt
train
go
4632ce571fccadc0ab7c26ea5bf16a52e1afcb3d
diff --git a/scripts/build_pyinstaller.py b/scripts/build_pyinstaller.py index <HASH>..<HASH> 100644 --- a/scripts/build_pyinstaller.py +++ b/scripts/build_pyinstaller.py @@ -130,10 +130,10 @@ def generate_static_css(): os.chdir(server_dir) compass_process = subprocess.Popen(['compass', 'compile']) compass_process.communicate() - # if compass_process.returncode != 0: - # print(script_tab + "ERROR: Compass returned with exit code: %s" % - # compass_process.returncode) - # return False + if compass_process.returncode != 0: + print(script_tab + "ERROR: Compass returned with exit code: %s" % + compass_process.returncode) + return False os.chdir(old_cwd) return True
ensures compass compile succeeds
Opentrons_opentrons
train
py
ba1539c0c415bebf7bf237cb91e0dc0c007b00bd
diff --git a/command/bdist_dumb.py b/command/bdist_dumb.py index <HASH>..<HASH> 100644 --- a/command/bdist_dumb.py +++ b/command/bdist_dumb.py @@ -71,12 +71,11 @@ class bdist_dumb (Command): self.run_command ('build') - install = self.reinitialize_command('install') + install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir self.announce ("installing to %s" % self.bdist_dir) - install.ensure_finalized() - install.run() + self.run_command('install') # And make an archive relative to the root of the # pseudo-installation tree.
Ensure sub-commands of "install" are reinitialized too. Run "install" the right way, by calling 'run_command()'.
pypa_setuptools
train
py
3ffb42ba905271811f2bf563920a678b7c1f57a1
diff --git a/DotNotationPointers.js b/DotNotationPointers.js index <HASH>..<HASH> 100644 --- a/DotNotationPointers.js +++ b/DotNotationPointers.js @@ -83,11 +83,17 @@ Object.defineProperty(DotNotationPointer.prototype, 'val', { } } }, set: function(value) { - if(this.propertyInfo.obj === undefined) { // create the path if it doesn't exist - createProperty(this) - } + if (value === undefined) { + if (this.propertyInfo.obj !== undefined) { + delete this.propertyInfo.obj[this.propertyInfo.last] + } + } else { + if(this.propertyInfo.obj === undefined) { // create the path if it doesn't exist + createProperty(this) + } - this.propertyInfo.obj[this.propertyInfo.last] = value + this.propertyInfo.obj[this.propertyInfo.last] = value + } } })
remove a property from the object if it's new value is set to 'undefined'
fresheneesz_mongo-parse
train
js
5d2f0f1116581a4d30aa98660917413cca3640fb
diff --git a/ansible_runner/runner.py b/ansible_runner/runner.py index <HASH>..<HASH> 100644 --- a/ansible_runner/runner.py +++ b/ansible_runner/runner.py @@ -178,7 +178,11 @@ class Runner(object): # option expecting should have already been written in ansible_runner.runner_config env_file_host = os.path.join(self.config.artifact_dir, 'env.list') with open(env_file_host, 'w') as f: - f.write('\n'.join(list(self.config.env.keys()))) + f.write( + '\n'.join( + ["{}={}".format(key, value) for key, value in self.config.env.items()] + ) + ) else: cwd = self.config.cwd pexpect_env = self.config.env
Write fully populated envfile to pass to podman Without this, manually reproducing the container's environment is really difficult.
ansible_ansible-runner
train
py
e620177d07f93c0af07e56afc93509e777accd9c
diff --git a/src/main/java/groovy/lang/NumberRange.java b/src/main/java/groovy/lang/NumberRange.java index <HASH>..<HASH> 100644 --- a/src/main/java/groovy/lang/NumberRange.java +++ b/src/main/java/groovy/lang/NumberRange.java @@ -644,7 +644,7 @@ public class NumberRange extends AbstractList<Comparable> implements Range<Compa // make the first fetch lazy too next = isAscending ? range.getFrom() : range.getTo(); if (!range.inclusiveLeft) { - next = next(); + next = isAscending ? increment(next, step) : decrement(next, step); } } else { next = isAscending ? increment(next, step) : decrement(next, step);
GROOVY-<I>: Fixed NumberRange.get not throwing at certain conditions With ranges like 0G<..<1G, the get method would erroneously return 1G instead of throwing an exception. This commit fixes that by directly incrementing the current value in the iterator instead of next() call.
apache_groovy
train
java
bf4f0ae1206548d83fde565f72a71d910a103ac2
diff --git a/salt/modules/network.py b/salt/modules/network.py index <HASH>..<HASH> 100644 --- a/salt/modules/network.py +++ b/salt/modules/network.py @@ -2106,7 +2106,7 @@ def fqdns(): results = pool.map(_lookup_fqdn, addresses) pool.close() pool.join() - except Exception as exc: + except Exception as exc: # pylint: disable=broad-except log.error("Exception while creating a ThreadPool for resolving FQDNs: %s", exc) for item in results:
Fix pylint issue
saltstack_salt
train
py
d97bfa41e01e245cfb9af80e4f5ad9e132aa64c4
diff --git a/lib/virtus/value_object.rb b/lib/virtus/value_object.rb index <HASH>..<HASH> 100644 --- a/lib/virtus/value_object.rb +++ b/lib/virtus/value_object.rb @@ -35,6 +35,7 @@ module Virtus include ::Virtus include InstanceMethods extend ClassMethods + private :attributes= end end diff --git a/spec/integration/virtus/value_object_spec.rb b/spec/integration/virtus/value_object_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/virtus/value_object_spec.rb +++ b/spec/integration/virtus/value_object_spec.rb @@ -40,7 +40,7 @@ describe Virtus::ValueObject do it 'writer methods are set to private' do private_methods = class_under_test.private_instance_methods private_methods.map! { |m| m.to_s } - private_methods.should include('latitude=', 'longitude=') + private_methods.should include('latitude=', 'longitude=', 'attributes=') end it 'attempts to call attribute writer methods raises NameError' do
Disallow mutation of ValueObjects via #attributes= * Increases consistency as mutations on value objects should be created via #with(mutations).
solnic_virtus
train
rb,rb
dc3f4f9ac57a4ae38e293e6ef87ce20817354058
diff --git a/lib/endpoints/class-wp-rest-users-controller.php b/lib/endpoints/class-wp-rest-users-controller.php index <HASH>..<HASH> 100755 --- a/lib/endpoints/class-wp-rest-users-controller.php +++ b/lib/endpoints/class-wp-rest-users-controller.php @@ -121,7 +121,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { $prepared_args['has_published_posts'] = true; } - if ( '' !== $prepared_args['search'] ) { + if ( ! empty( $prepared_args['search'] ) ) { $prepared_args['search'] = '*' . $prepared_args['search'] . '*'; }
Only add asterisks to the user query if there is a query present
WP-API_WP-API
train
php
332ba974953e495167197da0a578308e46e79f80
diff --git a/amino/algebra.py b/amino/algebra.py index <HASH>..<HASH> 100644 --- a/amino/algebra.py +++ b/amino/algebra.py @@ -3,6 +3,7 @@ from typing import GenericMeta, Any from types import SimpleNamespace from amino import List, Lists +from amino.util.string import ToStr class AlgebraMeta(GenericMeta): @@ -21,4 +22,8 @@ class AlgebraMeta(GenericMeta): cls.sub = sub return super().__new__(cls, name, bases, namespace, **kw) -__all__ = ('AlgebraMeta',) + +class Algebra(ToStr, metaclass=AlgebraMeta): + pass + +__all__ = ('AlgebraMeta', 'Algebra')
convenience base class `Algebra` inheriting `ToStr`
tek_amino
train
py
c290c519711600b22c8650789ac911c9fac13d8b
diff --git a/lib/assets/Css.js b/lib/assets/Css.js index <HASH>..<HASH> 100644 --- a/lib/assets/Css.js +++ b/lib/assets/Css.js @@ -69,10 +69,9 @@ extendWithGettersAndSetters(Css.prototype, { // CSSOM gets the @charset declaration mixed up with the first selector: try { this._parseTree = cssom.parse(this.text.replace(/@charset\s*([\'\"])\s*[\w\-]+\s*\1;/, "")); - } catch (e) { - var err = new Error('Parse error in ' + (this.url || 'inline Css' + (this.nonInlineAncestor ? ' in ' + this.nonInlineAncestor.url : '')) + '\n' + e.message); + } catch (err) { + err.message = 'Parse error in ' + (this.url || 'inline Css' + (this.nonInlineAncestor ? ' in ' + this.nonInlineAncestor.url : '')) + '\n' + err.message; if (this.assetGraph) { - err.styleSheet = {cssRules: []}; if ('styleSheet' in err) { err.message += '\nFalling back to using the ' + err.styleSheet.cssRules.length + ' parsed CSS rules'; this._parseTree = err.styleSheet;
asset.Css: Error details are no longer thrown away on caught css parse errors
assetgraph_assetgraph
train
js
d0d3d4344ba02638c9d42331fc6043a4c2437e18
diff --git a/terms/settings.py b/terms/settings.py index <HASH>..<HASH> 100644 --- a/terms/settings.py +++ b/terms/settings.py @@ -34,15 +34,13 @@ if hasattr(settings, 'TERMS_ADDITIONAL_IGNORED_TAGS'): TERMS_IGNORED_TAGS.extend(settings.TERMS_ADDITIONAL_IGNORED_TAGS) -TERMS_IGNORED_CLASSES = set( - getattr(settings, 'TERMS_IGNORED_CLASSES', - ( - 'cms_reset', - ) - ) +TERMS_IGNORED_CLASSES = getattr(settings, 'TERMS_IGNORED_CLASSES', + [ + 'cms_reset', + ] ) if hasattr(settings, 'TERMS_ADDITIONAL_IGNORED_CLASSES'): - TERMS_IGNORED_CLASSES |= set(settings.TERMS_ADDITIONAL_IGNORED_CLASSES) + TERMS_IGNORED_CLASSES.extend(settings.TERMS_ADDITIONAL_IGNORED_CLASSES) TERMS_IGNORED_IDS = getattr(settings, 'TERMS_IGNORED_IDS',
Defines TERMS_IGNORED_CLASSES as a list instead of a set.
BertrandBordage_django-terms
train
py
13ccf169f13d3c0844ddff043f3ae2c1ef3d3c30
diff --git a/zipline/utils/date_utils.py b/zipline/utils/date_utils.py index <HASH>..<HASH> 100644 --- a/zipline/utils/date_utils.py +++ b/zipline/utils/date_utils.py @@ -44,10 +44,10 @@ def EPOCH(utc_datetime): delta = utc_datetime - UNIX_EPOCH seconds = delta.total_seconds() ms = seconds * 1000 - return ms + return int(ms) def UN_EPOCH(ms_since_epoch): - seconds_since_epoch = ms_since_epoch / 1000 + seconds_since_epoch = float(ms_since_epoch) / 1000.0 delta = timedelta(seconds = seconds_since_epoch) dt = UNIX_EPOCH + delta return dt
encoding epoch as an int, rather than float.
quantopian_zipline
train
py
6211159aecd805fe100e053204e2b2677cea36c4
diff --git a/lib/json_api_client/query/builder.rb b/lib/json_api_client/query/builder.rb index <HASH>..<HASH> 100644 --- a/lib/json_api_client/query/builder.rb +++ b/lib/json_api_client/query/builder.rb @@ -81,8 +81,8 @@ module JsonApiClient end end when Array - table.map do - parse_related_links(*table) + table.map do |v| + parse_related_links(*v) end else table
fix handling of array definitions of related included links
JsonApiClient_json_api_client
train
rb
6b097ecf7f1438eef2e1f883c81a40d179ec771f
diff --git a/lib/swag_dev/project/tools/yardoc/watcher/_bootstrap.rb b/lib/swag_dev/project/tools/yardoc/watcher/_bootstrap.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/tools/yardoc/watcher/_bootstrap.rb +++ b/lib/swag_dev/project/tools/yardoc/watcher/_bootstrap.rb @@ -8,8 +8,7 @@ require 'listen/record/symlink_detector' # Listen >=2.8 # patch to silence duplicate directory errors. USE AT YOUR OWN RISK module Listen - # rubocop:disable Style/Documentation - # rubocop:disable Style/SignalException + # rubocop:disable all class Record class SymlinkDetector def _fail(_, _) @@ -17,6 +16,5 @@ module Listen end end end - # rubocop:enable Style/SignalException - # rubocop:enable Style/Documentation + # rubocop:enable all end
yardoc/watcher/_bootstrap (tools) disable rubocop
SwagDevOps_kamaze-project
train
rb
bb529041eef8db0a293a1538cb3b729efcb92368
diff --git a/mode/r/r.js b/mode/r/r.js index <HASH>..<HASH> 100644 --- a/mode/r/r.js +++ b/mode/r/r.js @@ -19,7 +19,7 @@ CodeMirror.defineMode("r", function(config) { for (var i = 0; i < words.length; ++i) res[words[i]] = true; return res; } - var commonAtoms = ["NULL", "NA", "Inf", "NaN", "NA_integer_", "NA_real_", "NA_complex_", "NA_character_"]; + var commonAtoms = ["NULL", "NA", "Inf", "NaN", "NA_integer_", "NA_real_", "NA_complex_", "NA_character_", "TRUE", "FALSE"]; var commonBuiltins = ["list", "quote", "bquote", "eval", "return", "call", "parse", "deparse"]; var commonKeywords = ["if", "else", "repeat", "while", "function", "for", "in", "next", "break"]; var commonBlockKeywords = ["if", "else", "repeat", "while", "function", "for"];
[r mode] Highlight TRUE/FALSE as atoms
codemirror_CodeMirror
train
js
399fc76bf530df0f7ce2aff64f95aa000f747e90
diff --git a/plenum/server/pool_req_handler.py b/plenum/server/pool_req_handler.py index <HASH>..<HASH> 100644 --- a/plenum/server/pool_req_handler.py +++ b/plenum/server/pool_req_handler.py @@ -25,7 +25,7 @@ class PoolRequestHandler(RequestHandler): self.state = state self.domainState = domainState - def validate(self, req: Request): + def validate(self, req: Request, config = None): typ = req.operation.get(TXN_TYPE) error = None if typ == NODE: diff --git a/plenum/server/req_handler.py b/plenum/server/req_handler.py index <HASH>..<HASH> 100644 --- a/plenum/server/req_handler.py +++ b/plenum/server/req_handler.py @@ -19,7 +19,7 @@ class RequestHandler: self.ledger = ledger self.state = state - def validate(self, req: Request, config): + def validate(self, req: Request, config = None): pass def applyReq(self, req: Request):
add config=None argument to validate method to make sub and super signatures match
hyperledger_indy-plenum
train
py,py
60dfd044395e7cf65a1d44c795eb43258cde83bf
diff --git a/discord/client.py b/discord/client.py index <HASH>..<HASH> 100644 --- a/discord/client.py +++ b/discord/client.py @@ -308,8 +308,9 @@ class ConnectionState(object): if server is not None: user_id = data['user']['id'] member = utils.find(lambda m: m.id == user_id, server.members) - server.members.remove(member) - self.dispatch('member_remove', member) + if member in server.members: + server.members.remove(member) + self.dispatch('member_remove', member) def handle_guild_member_update(self, data): server = self._get_server(data.get('guild_id'))
Check if member is in list for GUILD_MEMBER_REMOVE.
Rapptz_discord.py
train
py
fb0026d75cbb245f18e1c23ee5fd0a39d2e3370e
diff --git a/testarator.go b/testarator.go index <HASH>..<HASH> 100644 --- a/testarator.go +++ b/testarator.go @@ -77,7 +77,11 @@ func (s *Setup) SpinUp() error { return nil } - opt := &aetest.Options{AppID: "unittest", StronglyConsistentDatastore: true} + opt := &aetest.Options{ + AppID: "unittest", + StronglyConsistentDatastore: true, + SuppressDevAppServerLog: true, + } inst, err := aetest.NewInstance(opt) if err != nil { return err
Set SuppressDevAppServerLog option in aetest The latest appengine supports an option to suppress annoying logs in tests. This patch enables it. <URL>
favclip_testerator
train
go
2fe021f03cc05a79561c004ba3cea80991eb2c2f
diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index <HASH>..<HASH> 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -8,6 +8,7 @@ import ( "errors" "flag" "fmt" + "github.com/armon/go-metrics/prometheus" "io/ioutil" "net" "os" @@ -7103,9 +7104,11 @@ func TestFullConfig(t *testing.T) { AllowedPrefixes: []string{"oJotS8XJ"}, BlockedPrefixes: []string{"cazlEhGn"}, MetricsPrefix: "ftO6DySn", - PrometheusRetentionTime: 15 * time.Second, StatsdAddr: "drce87cy", StatsiteAddr: "HpFwKB8R", + PrometheusOpts: prometheus.PrometheusOpts{ + Expiration: 15 * time.Second, + }, }, TLSCipherSuites: []uint16{tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256}, TLSMinVersion: "pAOWafkR",
update runtime_test to handle PrometheusOpts expiry field change
hashicorp_consul
train
go
46e63026a9839f7d257e78315d48392a132f2639
diff --git a/lib/Ogone/AbstractResponse.php b/lib/Ogone/AbstractResponse.php index <HASH>..<HASH> 100644 --- a/lib/Ogone/AbstractResponse.php +++ b/lib/Ogone/AbstractResponse.php @@ -93,4 +93,13 @@ abstract class AbstractResponse implements Response { return $this->parameters[$key]; } + + /** + * Get all parameters + SHASIGN + * @return array + */ + public function toArray() + { + return $this->parameters + array('SHASIGN' => $this->shaSign); + } }
toArray method vanished from the PaymentResponse
marlon-be_marlon-ogone
train
php