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
799d04afb29ddba819ba892eb48739addf2b24a9
diff --git a/src/adapters/adapter-type.js b/src/adapters/adapter-type.js index <HASH>..<HASH> 100644 --- a/src/adapters/adapter-type.js +++ b/src/adapters/adapter-type.js @@ -1,4 +1,4 @@ -import { PropTypes } from 'react' +import PropTypes from 'prop-types' /** * Adapter Type diff --git a/src/entanglement.spec.js b/src/entanglement.spec.js index <HASH>..<HASH> 100644 --- a/src/entanglement.spec.js +++ b/src/entanglement.spec.js @@ -1,4 +1,5 @@ -import React, { PropTypes, Component } from 'react' +import React, { Component } from 'react' +import PropTypes from 'prop-types' import { mount } from 'enzyme' import Entanglement from './entanglement'
import PropTypes from separate package, as recommended in React <I>
react-entanglement_react-entanglement
train
js,js
fa73b268d16c2947d4ddbdd22ca91d19732977db
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -100,7 +100,7 @@ class ServerlessIOpipePlugin { } checkForLocalPlugin(){ const {dependencies, devDependencies} = this.package; - if (dependencies['serverless-plugin-iopipe'] || devDependencies['serverless-plugin-iopipe']){ + if (dependencies['serverless-plugin-iopipe'] || devDependencies && devDependencies['serverless-plugin-iopipe']){ if (!options().preferLocal){ track({ action: 'plugin-installed-locally'
check for devDependencies before accessing (#<I>)
iopipe_serverless-plugin-iopipe
train
js
5bf471d50fe8e17cb3f681ad7297014d87aeddc3
diff --git a/DependencyInjection/WellCommerceCoreExtension.php b/DependencyInjection/WellCommerceCoreExtension.php index <HASH>..<HASH> 100755 --- a/DependencyInjection/WellCommerceCoreExtension.php +++ b/DependencyInjection/WellCommerceCoreExtension.php @@ -12,9 +12,7 @@ namespace WellCommerce\Bundle\CoreBundle\DependencyInjection; -use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader; /** * Class WellCommerceCoreExtension diff --git a/Doctrine/ORM/Blameable/UserCallable.php b/Doctrine/ORM/Blameable/UserCallable.php index <HASH>..<HASH> 100644 --- a/Doctrine/ORM/Blameable/UserCallable.php +++ b/Doctrine/ORM/Blameable/UserCallable.php @@ -13,7 +13,6 @@ namespace WellCommerce\Bundle\CoreBundle\Doctrine\ORM\Blameable; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; /**
Removed unused use statements (cherry picked from commit fe<I>e8e<I>c0ee<I>de<I>a5cb4deb<I>f<I>c<I>)
WellCommerce_WishlistBundle
train
php,php
c1b5c11839bada164944679e800cac40b216b919
diff --git a/flake8_mypy.py b/flake8_mypy.py index <HASH>..<HASH> 100644 --- a/flake8_mypy.py +++ b/flake8_mypy.py @@ -13,12 +13,14 @@ import traceback import attr import mypy.api -import pycodestyle __version__ = '17.3.2' +noqa = re.compile(r'# noqa\b', re.I).search + + def make_arguments(**kwargs): result = [] for k, v in kwargs.items(): @@ -194,7 +196,7 @@ class MypyChecker: yield self.adapt_error(T499(last_t499, 0, vars=(line,))) continue - if pycodestyle.noqa(self.lines[e.lineno - 1]): + if noqa(self.lines[e.lineno - 1]): continue yield self.adapt_error(e)
Avoid importing pycodestyle just for a regular expression
ambv_flake8-mypy
train
py
83f7b7c1cd61c3eebb75fee46a8961a2e2d3f3b3
diff --git a/lib/solargraph/code_map.rb b/lib/solargraph/code_map.rb index <HASH>..<HASH> 100755 --- a/lib/solargraph/code_map.rb +++ b/lib/solargraph/code_map.rb @@ -283,7 +283,7 @@ module Solargraph return api_map.get_global_variables else type = infer_signature_at(index) - end + end end end if type.nil? @@ -364,7 +364,10 @@ module Solargraph end end return [] if path.nil? - return api_map.yard_map.objects(path, ns_here) + if path.start_with?('Class<') + path.gsub!(/^Class<([a-z0-9_:]*)>#([a-z0-9_]*)$/i, '\\1.\\2') + end + api_map.yard_map.objects(path, ns_here) end # Infer the type of the signature located at the specified index.
Object resolution detects class methods.
castwide_solargraph
train
rb
455f9817d80c573fa30017b25eac12896a54a7ce
diff --git a/code/controllers/TimelineController.php b/code/controllers/TimelineController.php index <HASH>..<HASH> 100644 --- a/code/controllers/TimelineController.php +++ b/code/controllers/TimelineController.php @@ -167,6 +167,12 @@ class TimelineController extends ContentController { Requirements::css('microblog/javascript/jquery-textcomplete-0.3.7/jquery.textcomplete.css'); Requirements::css('microblog/css/timeline.css'); Requirements::css('microblog/javascript/highlight/googlecode.css'); + + // and attachment field requirements + Requirements::javascript(DROPZONE_DIR.'/javascript/dropzone.js'); + Requirements::javascript(DROPZONE_DIR.'/javascript/file_attachment_field.js'); + + Requirements::css(DROPZONE_DIR.'/css/file_attachment_field.css'); } public function IsEnabled($option) {
fix(TimelineController) Include file upload JS for general requirements includes
nyeholt_silverstripe-microblog
train
php
3c872255b29dc07f394cfe3e5c10f0e888c63a4c
diff --git a/lib/onebox/engine/imgur_onebox.rb b/lib/onebox/engine/imgur_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/imgur_onebox.rb +++ b/lib/onebox/engine/imgur_onebox.rb @@ -58,7 +58,7 @@ module Onebox <<-HTML <a href='#{escaped_url}' target='_blank' rel='noopener' class="onebox"> - <img src='#{og.get_secure_image}' #{og.title_attr} alt='Imgur' height='#{og.image_height}' width='#{og.image_width}'> + <img src='#{og.get_secure_image.chomp("?fb")}' #{og.title_attr} alt='Imgur'> </a> HTML end
FIX: show original imgur image (not cropped one) By default imgur includes cropped image link in OG tags as per facebook specified size. We do not want to show cropped image for image links so we are removing fb parameter from image links.
discourse_onebox
train
rb
524fd3766045ded4f2e2edc6aafaf1af25f04675
diff --git a/src/Core/Checkout/Order/SalesChannel/OrderService.php b/src/Core/Checkout/Order/SalesChannel/OrderService.php index <HASH>..<HASH> 100644 --- a/src/Core/Checkout/Order/SalesChannel/OrderService.php +++ b/src/Core/Checkout/Order/SalesChannel/OrderService.php @@ -3,7 +3,6 @@ namespace Shopware\Core\Checkout\Order\SalesChannel; use Shopware\Core\Checkout\Cart\SalesChannel\CartService; -use Shopware\Core\Content\Media\MediaService; use Shopware\Core\Framework\Validation\BuildValidationEvent; use Shopware\Core\Framework\Validation\DataBag\DataBag; use Shopware\Core\Framework\Validation\DataValidationDefinition; @@ -37,11 +36,6 @@ class OrderService private $cartService; /** - * @var MediaService - */ - private $mediaService; - - /** * @param ValidationServiceInterface|DataValidationFactoryInterface $orderValidationFactory */ public function __construct(
NTR - Remove unneeded property of OrderService
shopware_platform
train
php
b321a6255dcf935ff30dc8be19ec04cd31c10b24
diff --git a/distutils/tests/test_msvccompiler.py b/distutils/tests/test_msvccompiler.py index <HASH>..<HASH> 100644 --- a/distutils/tests/test_msvccompiler.py +++ b/distutils/tests/test_msvccompiler.py @@ -58,7 +58,7 @@ class Testmsvccompiler(support.TempdirManager): assert version >= 15 assert os.path.isdir(path) else: - raise unittest.SkipTest("VS 2017 is not installed") + pytest.skip("VS 2017 is not installed") @needs_winreg def test_get_vc2015(self): @@ -69,7 +69,7 @@ class Testmsvccompiler(support.TempdirManager): assert version >= 14 assert os.path.isdir(path) else: - raise unittest.SkipTest("VS 2015 is not installed") + pytest.skip("VS 2015 is not installed") class CheckThread(threading.Thread):
Prefer pytest for skip
pypa_setuptools
train
py
ce50348b5e79c3020e4916a8cb5ee1fc0a9adda7
diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index <HASH>..<HASH> 100755 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -538,15 +538,31 @@ abstract class ActiveRecord { */ final public function store() { + $this->beforeStore(); + if ($this->isPopulated()) { - return $this->update(); + $res = $this->update(); } else { - return $this->create(); + $res = $this->create(); } + + $this->afterStore(); + + return $res; } /** + * Trigger function called before store() method execution. + */ + protected function beforeStore() {} + + /** + * Trigger function called after store() method execution. + */ + protected function afterStore() {} + + /** * Create this object as new database record and will assign its primary key * as $id property. Null properties won’t be written in the new row. * Return TRUE if success.
changed methods beforeSave and afterSave in beforeStore and AfterStore
Viames_Pair
train
php
97cea2188a6a2af8dd10e3208111b3d1b9699331
diff --git a/Tests/ConnectionFactoryTest.php b/Tests/ConnectionFactoryTest.php index <HASH>..<HASH> 100644 --- a/Tests/ConnectionFactoryTest.php +++ b/Tests/ConnectionFactoryTest.php @@ -145,6 +145,7 @@ class FakeDriver implements Driver * @psalm-suppress InvalidReturnStatement * @psalm-suppress InvalidReturnType * @psalm-suppress UndefinedClass + * @psalm-suppress InvalidClass */ public function getDatabasePlatform(): AbstractPlatform {
Suppress `InvalidClass: Class, interface or enum Doctrine\DBAL\Platforms\MySQLPlatform has wrong casing`
doctrine_DoctrineBundle
train
php
bb18830aabd6f375a0aecf22e904896b0f44335a
diff --git a/alto/templates.py b/alto/templates.py index <HASH>..<HASH> 100644 --- a/alto/templates.py +++ b/alto/templates.py @@ -1,17 +1,21 @@ import os from django.conf import settings -from django.template import loader +from django.template import loader, TemplateDoesNotExist from django.template.loader_tags import ExtendsNode def find_template_source(name): + """ + Load the source code and origin of the first template that matches the + given name. + """ for loader_path in settings.TEMPLATE_LOADERS: template_loader = loader.find_template_loader(loader_path) try: source, origin = template_loader.load_template_source(name) - break - except Exception as e: - print e + except TemplateDoesNotExist: + continue + break return source, origin def find_parents(name, parents=None):
Cleaned up a bare except.
jkocherhans_alto
train
py
9efd8e06dc23bda7102058e4a1f29bb72f8335ab
diff --git a/PHPCI/Plugin/Mysql.php b/PHPCI/Plugin/Mysql.php index <HASH>..<HASH> 100644 --- a/PHPCI/Plugin/Mysql.php +++ b/PHPCI/Plugin/Mysql.php @@ -166,10 +166,11 @@ class Mysql implements \PHPCI\Plugin $args = array( ':import_file' => escapeshellarg($import_file), ':decomp_cmd' => $decomp_cmd, + ':host' => escapeshellarg($this->host), ':user' => escapeshellarg($this->user), ':pass' => escapeshellarg($this->pass), ':database' => ($database === null)? '': escapeshellarg($database), ); - return strtr('cat :import_file :decomp_cmd | mysql -u:user -p:pass :database', $args); + return strtr('cat :import_file :decomp_cmd | mysql -h:host -u:user -p:pass :database', $args); } }
Contribution Type: improvement / new feature Primary Area: plugins Description of change: Implemented using the same changes mentioned here: <URL>
dancryer_PHPCI
train
php
2fe9c050638c6e085d1ea472cd58805570cb42bc
diff --git a/lib/parslet/expression/treetop.rb b/lib/parslet/expression/treetop.rb index <HASH>..<HASH> 100644 --- a/lib/parslet/expression/treetop.rb +++ b/lib/parslet/expression/treetop.rb @@ -83,8 +83,8 @@ class Parslet::Expression::Treetop rule(:seq => sequence(:s)) { Parslet::Atoms::Sequence.new(*s) } rule(:unwrap => simple(:u)) { u } rule(:maybe => simple(:m)) { |d| d[:m].maybe } - rule(:string => simple(:s)) { Parslet::Atoms::Str.new(s) } - rule(:match => simple(:m)) { Parslet::Atoms::Re.new(m) } + rule(:string => simple(:s)) { Parslet::Atoms::Str.new(s.to_s) } + rule(:match => simple(:m)) { Parslet::Atoms::Re.new(m.to_s) } rule(:any => simple(:a)) { Parslet::Atoms::Re.new('.') } end
+ slices will not match at all positions, strings will
kschiess_parslet
train
rb
0a3d05a4759a9273cebe46c4a20be9ad8ff9bfbb
diff --git a/lib/request_log_analyzer.rb b/lib/request_log_analyzer.rb index <HASH>..<HASH> 100644 --- a/lib/request_log_analyzer.rb +++ b/lib/request_log_analyzer.rb @@ -10,7 +10,7 @@ Encoding.default_external = 'binary' if defined? Encoding and Encoding.respond_t module RequestLogAnalyzer # The current version of request-log-analyzer. - # This will be diplayed in output reports etc. + # This will be diplayed in output reports etc. VERSION = "1.3.4" # Loads constants in the RequestLogAnalyzer namespace using self.load_default_class_file(base, const) @@ -25,7 +25,7 @@ module RequestLogAnalyzer # <tt>const</tt>:: The constant to load from the base constant as a string or symbol. This should be 'Bar' or :Bar when the constant Foo::Bar is being loaded. def self.load_default_class_file(base, const) require "#{to_underscore("#{base.name}::#{const}")}" - base.const_get(const) + base.const_get(const) if base.const_defined?(const) end # Convert a string/symbol in camelcase (RequestLogAnalyzer::Controller) to underscores (request_log_analyzer/controller)
Fixed endless loop in dependency loader when the required file does not contain the expected class.
wvanbergen_request-log-analyzer
train
rb
d11b259613cd0f72ef548d2ba88ed950eb07f902
diff --git a/pyt/cfg.py b/pyt/cfg.py index <HASH>..<HASH> 100644 --- a/pyt/cfg.py +++ b/pyt/cfg.py @@ -78,12 +78,16 @@ class CFG(ast.NodeVisitor): orelse_test = None if isinstance(orelse_node[0], ast.If): - body_last = self.stmt_star_handler(orelse_node[0].body)[-1] + body_stmts = self.stmt_star_handler(orelse_node[0].body) + body_first = body_stmts[0] + body_last = body_stmts[-1] ref_to_parent_next_node.append(body_last) inner_test = self.orelse_handler(orelse_node[0].orelse, ref_to_parent_next_node) orelse_test = self.visit(orelse_node[0].test) orelse_test.outgoing.append(inner_test) + orelse_test.outgoing.append(body_first) + ref_to_parent_next_node.append(orelse_test) else: stmts = self.stmt_star_handler(orelse_node)
fix orelse_handler (used in visit_if) to contain outgoing edge from the test node to the first node of the body
python-security_pyt
train
py
30c0ea6bf6db15346ce5a510f60cb149ad0fda2e
diff --git a/ReText/window.py b/ReText/window.py index <HASH>..<HASH> 100644 --- a/ReText/window.py +++ b/ReText/window.py @@ -553,6 +553,7 @@ class ReTextWindow(QMainWindow): except: # For Python 3 self.setWindowTitle(self.tr('New document') + '[*] \u2014 ' + app_name) + self.docTypeChanged() self.modificationChanged(self.editBoxes[ind].document().isModified()) self.livePreviewEnabled = self.alpc[ind] if self.alpc[ind]:
changeIndex: Add docTypeChanged() call for cases when it's not called by setCurrentFile
retext-project_retext
train
py
59717d96e2fb18cd8516eea998dfd2877aff202c
diff --git a/bin/storjshare-status.js b/bin/storjshare-status.js index <HASH>..<HASH> 100755 --- a/bin/storjshare-status.js +++ b/bin/storjshare-status.js @@ -35,7 +35,7 @@ utils.connectToDaemon(config.daemonRpcPort, function(rpc, sock) { head: ['cyan', 'bold'], border: [] }, - colWidths: [45, 15, 10, 10, 10, 11, 10] + colWidths: [45, 10, 10, 10, 10, 11, 10] }); shares.forEach((share) => { let status = '?';
set status column back to <I> chars not adding additional messaging to the status column - it can go back down to <I> chars
storj_storjshare-daemon
train
js
7264aa32ccdad4b750b7937acbbf737251729e62
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='troposphere', - version='0.2.8', + version='0.2.9', description="AWS CloudFormation creation library", author="Mark Peek", author_email="[email protected]", diff --git a/troposphere/__init__.py b/troposphere/__init__.py index <HASH>..<HASH> 100644 --- a/troposphere/__init__.py +++ b/troposphere/__init__.py @@ -10,7 +10,7 @@ import types from . import validators -__version__ = "0.2.8" +__version__ = "0.2.9" # constants for DeletionPolicy Delete = 'Delete'
Bumping version to <I>
cloudtools_troposphere
train
py,py
055339a67cfca4903ae4dd80c2b5ac39f58a2a2c
diff --git a/src/org/jgroups/protocols/pbcast/STABLE.java b/src/org/jgroups/protocols/pbcast/STABLE.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/protocols/pbcast/STABLE.java +++ b/src/org/jgroups/protocols/pbcast/STABLE.java @@ -115,6 +115,7 @@ public class STABLE extends Protocol { /** The total number of bytes received from unicast and multicast messages */ @GuardedBy("received") + @ManagedAttribute(description="Bytes accumulated so far") private long num_bytes_received=0; private final Lock received=new ReentrantLock(); @@ -631,6 +632,7 @@ public class STABLE extends Protocol { // pass STABLE event down the stack, so NAKACK can garbage collect old messages down_prot.down(new Event(Event.STABLE, stable_digest)); + num_bytes_received=0; // reset, so all members have more or less the same value }
num_bytes_received is reset on STABILITY message
belaban_JGroups
train
java
2a8d3d5d220b3bd755babfab5d672dc5f120a9a2
diff --git a/driver/cassandra/cassandra_test.go b/driver/cassandra/cassandra_test.go index <HASH>..<HASH> 100644 --- a/driver/cassandra/cassandra_test.go +++ b/driver/cassandra/cassandra_test.go @@ -152,12 +152,6 @@ func TestMigrate(t *testing.T) { } func resetKeySpace(session *gocql.Session) error { - if err := session.Query(`DROP KEYSPACE migrate;`).Exec(); err != nil { - return err - } - - if err := session.Query(`CREATE KEYSPACE IF NOT EXISTS migrate WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`).Exec(); err != nil { - return err - } - return nil + session.Query(`DROP KEYSPACE migrate;`).Exec() + return session.Query(`CREATE KEYSPACE IF NOT EXISTS migrate WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`).Exec() }
Don't stop if migrate keyspace is not dropped
gemnasium_migrate
train
go
ac4b6abd1ff994f085b4dae5db5eabaf3298ae13
diff --git a/packages/core/src/PlayerContextProvider.js b/packages/core/src/PlayerContextProvider.js index <HASH>..<HASH> 100644 --- a/packages/core/src/PlayerContextProvider.js +++ b/packages/core/src/PlayerContextProvider.js @@ -111,7 +111,7 @@ export class PlayerContextProvider extends Component { constructor(props) { super(props); let currentTime = 0; - const activeTrackIndex = convertToNumberWithinIntervalBounds( + let activeTrackIndex = convertToNumberWithinIntervalBounds( props.startingTrackIndex, 0 ); @@ -127,6 +127,16 @@ export class PlayerContextProvider extends Component { initialStateSnapshot, props ); + const { + activeTrackIndex: a, + currentTime: c + } = restoredStateFromSnapshot; + if (typeof a === 'number') { + activeTrackIndex = a; + } + if (typeof c === 'number') { + currentTime = c; + } } catch (err) { logWarning(err); logWarning('Loading Cassette state from snapshot failed.');
Fix bug where initial track duration is always derived from first track.
benwiley4000_cassette
train
js
db539281b0c30ae16720560b4461663cc777fb9c
diff --git a/pysat/tests/test_methods_general.py b/pysat/tests/test_methods_general.py index <HASH>..<HASH> 100644 --- a/pysat/tests/test_methods_general.py +++ b/pysat/tests/test_methods_general.py @@ -33,7 +33,7 @@ class TestICONIVMCustom(): def setup(self): """Runs before every method to create a clean testing setup.""" # Load a test instrument - self.testInst = pysat.Instrument('pysat', 'testing', tag='12', + self.testInst = pysat.Instrument('pysat', 'testing', sat_id='12', clean_level='clean') self.testInst.load(2009, 1) self.Npts = len(self.testInst['uts']) @@ -63,7 +63,8 @@ class TestRemoveLeadTextXarray(TestICONIVMCustom): def setup(self): """Runs before every method to create a clean testing setup.""" # Load a test instrument - self.testInst = pysat.Instrument('pysat', 'testing2d_xarray', tag='12', + self.testInst = pysat.Instrument('pysat', 'testing2d_xarray', + sat_id='12', clean_level='clean') self.testInst.load(2009, 1) self.Npts = len(self.testInst['profiles'])
STY: use sat_id to reduce inst size in tests
rstoneback_pysat
train
py
0797fe2682a2681ad8476df505dc362bd85f20fa
diff --git a/client/js/app/utils/FunnelUtils.js b/client/js/app/utils/FunnelUtils.js index <HASH>..<HASH> 100644 --- a/client/js/app/utils/FunnelUtils.js +++ b/client/js/app/utils/FunnelUtils.js @@ -11,7 +11,8 @@ var STEP_PARAMS = [ 'timezone', 'filters', 'optional', - 'inverted' + 'inverted', + 'with_actors' ]; module.exports = { diff --git a/client/js/app/validations/StepValidations.js b/client/js/app/validations/StepValidations.js index <HASH>..<HASH> 100644 --- a/client/js/app/validations/StepValidations.js +++ b/client/js/app/validations/StepValidations.js @@ -65,4 +65,15 @@ module.exports = { }, + with_actors: { + + msg: '"with_actors" must be set to either true or false', + + validate: function(model) { + if (FormatUtils.isNullOrUndefined(model.inverted)) return false; + return typeof model.inverted === 'boolean'; + } + + }, + };
Add 'with_actors' to step params
keen_explorer
train
js,js
e1968acf743875231a9ddd47f5bc8a6a0c44c7ed
diff --git a/lib/gruff/base.rb b/lib/gruff/base.rb index <HASH>..<HASH> 100644 --- a/lib/gruff/base.rb +++ b/lib/gruff/base.rb @@ -674,8 +674,7 @@ module Gruff (0..@marker_count).each do |index| y = @graph_top + @graph_height - index.to_f * @increment_scaled - @d = @d.stroke(@marker_color) - @d = @d.stroke_width 1 + @d = @d.fill(@marker_color) @d = @d.line(@graph_left, y, @graph_right, y) marker_label = index * @increment + @minimum_value.to_f
Changed the way we use RMagick to draw horizontal line markers. Using fill instead of stroke ensures they are always 1px wide.
topfunky_gruff
train
rb
4ec721834999357a33d1490d39f204578c6d2dd2
diff --git a/catch-throwable/src/main/java/com/googlecode/catchexception/throwable/CatchThrowable.java b/catch-throwable/src/main/java/com/googlecode/catchexception/throwable/CatchThrowable.java index <HASH>..<HASH> 100644 --- a/catch-throwable/src/main/java/com/googlecode/catchexception/throwable/CatchThrowable.java +++ b/catch-throwable/src/main/java/com/googlecode/catchexception/throwable/CatchThrowable.java @@ -42,8 +42,8 @@ public class CatchThrowable { * not caught an throwable. Returns null if the caught throwable belongs to a class that is no longer * {@link ClassLoader loaded}. */ - public static <E extends Throwable> E caughtThrowable() { - return ThrowableHolder.<E> get(); + public static Throwable caughtThrowable() { + return ThrowableHolder.get(); } /**
Fix caughtThrowable for Java8
Codearte_catch-exception
train
java
4b50f48feca15c52ce7b736b9c05bd1d3b3bd70e
diff --git a/SwatDB/SwatDB.php b/SwatDB/SwatDB.php index <HASH>..<HASH> 100644 --- a/SwatDB/SwatDB.php +++ b/SwatDB/SwatDB.php @@ -221,7 +221,8 @@ class SwatDB extends SwatObject public static function queryOne($db, $sql, $type = null) { SwatDB::debug($sql); - $value = $db->queryOne($sql, $type); + $mdb2_type = $type === null ? true : $type; + $value = $db->queryOne($sql, $mdb2_type); if (MDB2::isError($value)) throw new SwatDBException($value); @@ -248,7 +249,8 @@ class SwatDB extends SwatObject public static function queryRow($db, $sql, $types = null) { SwatDB::debug($sql); - $row = $db->queryRow($sql, $types, MDB2_FETCHMODE_OBJECT); + $mdb2_types = $types === null ? true : $types; + $row = $db->queryRow($sql, $mdb2_types, MDB2_FETCHMODE_OBJECT); if (MDB2::isError($row)) throw new SwatDBException($row);
Allow MDB2 to guess types if they are not passed explicitly. svn commit r<I>
silverorange_swat
train
php
acbba97a410f7707154cdc9fa7496f3988646dc3
diff --git a/pandas/tests/frame/test_dtypes.py b/pandas/tests/frame/test_dtypes.py index <HASH>..<HASH> 100644 --- a/pandas/tests/frame/test_dtypes.py +++ b/pandas/tests/frame/test_dtypes.py @@ -4,7 +4,7 @@ from datetime import timedelta import numpy as np import pytest -from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype +from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, IntervalDtype import pandas as pd from pandas import ( @@ -699,14 +699,7 @@ class TestDataFrameDataTypes: expected = DataFrame({k: Categorical(d[k], dtype=dtype) for k in d}) tm.assert_frame_equal(result, expected) - @pytest.mark.parametrize( - "cls", - [ - pd.api.types.CategoricalDtype, - pd.api.types.DatetimeTZDtype, - pd.api.types.IntervalDtype, - ], - ) + @pytest.mark.parametrize("cls", [CategoricalDtype, DatetimeTZDtype, IntervalDtype]) def test_astype_categoricaldtype_class_raises(self, cls): df = DataFrame({"A": ["a", "a", "b", "c"]}) xpr = "Expected an instance of {}".format(cls.__name__)
CLN: some imports in pandas/tests/frame/test_dtypes.py (#<I>)
pandas-dev_pandas
train
py
5baf1e4b0ca6b4ee41dd3753db5a3144228abf1e
diff --git a/combine/checks/mixed_content.py b/combine/checks/mixed_content.py index <HASH>..<HASH> 100644 --- a/combine/checks/mixed_content.py +++ b/combine/checks/mixed_content.py @@ -15,6 +15,7 @@ class MixedContentCheck(Check): "img": {"attr": "src"}, "link": {"attr": "href", "ignore": {"rel": "profile"}}, "iframe": {"attr": "src"}, + # TODO missing script? but src needs to be optional (could be inline) } for type, cfg in to_check.items():
Add comment about missing mixed content for scripts
dropseed_combine
train
py
ef2a6f3e6534236996b46f96c5f20e5510592668
diff --git a/lib/ruby-fs-stack/familytree.rb b/lib/ruby-fs-stack/familytree.rb index <HASH>..<HASH> 100644 --- a/lib/ruby-fs-stack/familytree.rb +++ b/lib/ruby-fs-stack/familytree.rb @@ -192,6 +192,7 @@ module FamilytreeV2 r_type = get_relationship_type(options) with_id = options[r_type.to_sym] url = "#{Base}person/#{base_id}/#{r_type}/#{with_id}" + options.reject!{|k,v| k.to_s == 'spouse'} url += add_querystring(options) res = @fs_communicator.get(url) familytree = Org::Familysearch::Ws::Familytree::V2::Schema::FamilyTree.from_json JSON.parse(res.body) @@ -227,7 +228,7 @@ module FamilytreeV2 end def add_querystring(options) - params = options.reject{|k,v| ['parent','child','spouse','lineage','event'].include? k.to_s } + params = options.reject{|k,v| ['parent','child','lineage','event'].include? k.to_s } (params.empty?) ? '' : "?" + FsUtils.querystring_from_hash(params) end end
Minor bug fix. match was filtering out spouse params.
jimmyz_ruby-fs-stack
train
rb
10e2510a10c1491de29b41bad796068d809de5d6
diff --git a/packages/micro-journeys/src/utils/equalize-relative-heights.js b/packages/micro-journeys/src/utils/equalize-relative-heights.js index <HASH>..<HASH> 100644 --- a/packages/micro-journeys/src/utils/equalize-relative-heights.js +++ b/packages/micro-journeys/src/utils/equalize-relative-heights.js @@ -31,6 +31,7 @@ const validateItem = item => { */ const validateParamsForEqualizeRelativeHeights = items => { items.forEach((item, i) => { + const { container, elToEqualize, paddingEqualizationTarget } = item; if (!validateItem(item)) { throw new Error( `Element provided to equalizeRelativeHeights has no width. container: ${container.offsetWidth}, elToEqualize: ${elToEqualize.offsetWidth}, paddingEqualizationTarget: ${paddingEqualizationTarget.offsetWidth}`,
fix(micro-journeys): error code in equalizeRelativeHeights
bolt-design-system_bolt
train
js
c5a005c205fee995857fbc4fcd5ddf812706614a
diff --git a/yaks/lib/yaks/config.rb b/yaks/lib/yaks/config.rb index <HASH>..<HASH> 100644 --- a/yaks/lib/yaks/config.rb +++ b/yaks/lib/yaks/config.rb @@ -86,6 +86,10 @@ module Yaks runner(object, options).map end + def format(data, options = {}) + runner(data, options).format + end + def read(data, options = {}) runner(data, options).read end diff --git a/yaks/lib/yaks/runner.rb b/yaks/lib/yaks/runner.rb index <HASH>..<HASH> 100644 --- a/yaks/lib/yaks/runner.rb +++ b/yaks/lib/yaks/runner.rb @@ -17,6 +17,10 @@ module Yaks Pipeline.new([[:parse, serializer.inverse], [:format, formatter.inverse]]).insert_hooks(hooks).call(object, env) end + def format + Pipeline.new([[:format, formatter], [:primitivize, primitivizer]]).insert_hooks(hooks).call(object, env) + end + def map Pipeline.new([[:map, mapper]]).insert_hooks(hooks).call(object, env) end
Make yaks.format available analogues to yaks.map, yaks.read We already exposed several of the pipeline steps as isolated methods, this adds "format" to that list, so you can turn a Yaks::Resource into a formatted data structure targeting a specific output format, without serializing it to string.
plexus_yaks
train
rb,rb
5d3a0235d1989633c0149948ca98042c64c5bd29
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ const crypto = require('crypto') // the max interger that this VM can handle exports.MAX_INTEGER = new BN('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16) -exports.TWO_POW256 = new BN('115792089237316195423570985008687907853269984665640564039457584007913129639936') +exports.TWO_POW256 = new BN('10000000000000000000000000000000000000000000000000000000000000000', 16) // hex string of SHA3-256 hash of `null` exports.SHA3_NULL_S = 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
Use a more readable hex representation for TWO_PWO<I>
ethereumjs_ethereumjs-vm
train
js
841a41c48f98cf1f7e20246882438f2e93fbbc28
diff --git a/src/Factory/RequestBase.php b/src/Factory/RequestBase.php index <HASH>..<HASH> 100644 --- a/src/Factory/RequestBase.php +++ b/src/Factory/RequestBase.php @@ -325,7 +325,7 @@ class RequestBase // -------------------------------------------------------------------------- /** - * Set the refund object + * Set the refund object * * @param Resource\Refund|int $mRefund The refund to use for the request * @@ -391,7 +391,7 @@ class RequestBase $aData['fee'] = $iFee; } - if (!$this->oPaymentModel->setComplete($this->oPayment->id, $aData)) { + if (!$this->oPaymentModel->setProcessing($this->oPayment->id, $aData)) { throw new RequestException('Failed to update existing payment.'); }
Fixes a bug whereby processing payments were marked as complete
nails_module-invoice
train
php
369bcdd95a1f096924de601837545fef96f1df39
diff --git a/eulcommon/searchutil/templatetags/search_utils.py b/eulcommon/searchutil/templatetags/search_utils.py index <HASH>..<HASH> 100644 --- a/eulcommon/searchutil/templatetags/search_utils.py +++ b/eulcommon/searchutil/templatetags/search_utils.py @@ -4,7 +4,8 @@ register = template.Library() @register.inclusion_tag('searchutil/pagination.html') def pagination_links(paginator_page, show_pages, url_params=None, - first_page_label=None, last_page_label=None): + first_page_label=None, last_page_label=None, + page_url=''): '''Django template tag to display pagination links for a paginated list of items. @@ -19,6 +20,8 @@ def pagination_links(paginator_page, show_pages, url_params=None, list of pages to be shown) * optional last page label (only used when last page is not in list of pages to be shown) + * optional url to use for page links (only needed when the url is + different from the current one) Example use:: @@ -33,5 +36,6 @@ def pagination_links(paginator_page, show_pages, url_params=None, 'url_params': url_params, 'first_page_label': first_page_label, 'last_page_label': last_page_label, + 'page_url': page_url, }
add optional page_url to pagination_links to support page links at urls other than the current browser page
emory-libraries_eulcommon
train
py
88a7fa1f9c3b1749488967ae944c20e0d1972f26
diff --git a/core/Archive.php b/core/Archive.php index <HASH>..<HASH> 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -744,7 +744,10 @@ class Archive */ private function getArchiveGroupOfPlugin($plugin) { - if ($this->getPeriodLabel() != 'range') { + $periods = $this->params->getPeriods(); + $periodLabel = reset($periods)->getLabel(); + + if (Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $periodLabel)) { return self::ARCHIVE_ALL_PLUGINS_FLAG; }
Fix bug in core/Archive.php class where if VisitsSummary metrics are requested with another plugins' metrics while using a segment, the VisitsSummary metrics would not be selected. Piwik\Archive assumed VisitsSummary would only be in new archive if period = range.
matomo-org_matomo
train
php
fdaa63d1ff2d756c010533789da0bd4fe3585d99
diff --git a/closure/goog/base.js b/closure/goog/base.js index <HASH>..<HASH> 100644 --- a/closure/goog/base.js +++ b/closure/goog/base.js @@ -2377,11 +2377,10 @@ if (goog.DEPENDENCIES_ENABLED) { addNewerLanguageTranspilationCheck('es8', function() { return evalCheck('async () => 1, true'); }); - addNewerLanguageTranspilationCheck('es9', function() { - return evalCheck('({...rest} = {}), true'); - }); + // Object rest/spread. TODO(tbreisacher): Rename this to 'es9' if + // rest/spread end up being finalized in the 2018 spec. addNewerLanguageTranspilationCheck('es_next', function() { - return false; // assume it always need to transpile + return evalCheck('({...rest} = {}), true'); }); return requiresTranspilation; };
Automated g4 rollback of changelist <I>. *** Reason for rollback *** Causes some "$jscomp is not defined" errors *** Original change description *** Update support for ES9/ES_NEXT in base.js in preparation for adding ES9 as a mode to the compiler. RELNOTES: tweak tranpilation detection in preparation for adding ECMASCRIPT_<I> as a language mode. *** ------------- Created by MOE: <URL>
google_closure-library
train
js
4a8ddb71e19b7f13948b3cbcbe61ece8153ef3a0
diff --git a/examples/BoomApp/app/screens/settings/SettingsScreenClassic.js b/examples/BoomApp/app/screens/settings/SettingsScreenClassic.js index <HASH>..<HASH> 100644 --- a/examples/BoomApp/app/screens/settings/SettingsScreenClassic.js +++ b/examples/BoomApp/app/screens/settings/SettingsScreenClassic.js @@ -20,7 +20,7 @@ export default class SettingsScreenClassic extends Component { constructor(props) { super(props); this.state = { - themeIndex: ScreenService.currentThemeIndex + themeIndex: ScreenService.getCurrentThemeIndex() } } diff --git a/examples/BoomApp/app/util/ScreenService.js b/examples/BoomApp/app/util/ScreenService.js index <HASH>..<HASH> 100644 --- a/examples/BoomApp/app/util/ScreenService.js +++ b/examples/BoomApp/app/util/ScreenService.js @@ -74,7 +74,7 @@ themes[currentThemeIndex].setup(); export default ScreenService = { - currentThemeIndex, + getCurrentThemeIndex: () => currentThemeIndex, setCurrentThemeIndex: index => { currentThemeIndex = index; themes[currentThemeIndex].setup();
fix(BoomApp): fix settings screen
akveo_react-native-ui-kitten
train
js,js
afa1c64e38b9188b4e86295c45005020faa2d9a1
diff --git a/spec/cases/http_service_spec.rb b/spec/cases/http_service_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cases/http_service_spec.rb +++ b/spec/cases/http_service_spec.rb @@ -246,9 +246,17 @@ describe "Koala::HTTPService" do end it "logs verb, url and params to debug" do - args = KoalaTest::OrderedHash.new({"a" => :b, "c" => 3}) - log_message = "GET: anything params: #{args.inspect}" - Koala::Utils.logger.should_receive(:debug).with(log_message) + args = {"a" => :b, "c" => 3} + log_message_stem = "GET: anything params: " + Koala::Utils.logger.should_receive(:debug) do |log_message| + # unordered hashes are a bane + # Ruby in 1.8 modes tends to return different hash orderings, + # which makes checking the content of the stringified hash hard + # it's enough just to ensure that there's hash content in the string, I think + log_message.should include(log_message_stem) + log_message.match(/\{.*\}/).should_not be_nil + end + Koala::HTTPService.make_request("anything", args, "get") end end
Unordered hashes are a bane
arsduo_koala
train
rb
a38e9d680f2b724400fbeace6893e2e87ffb8bd4
diff --git a/fbchat_archive_parser/parser.py b/fbchat_archive_parser/parser.py index <HASH>..<HASH> 100644 --- a/fbchat_archive_parser/parser.py +++ b/fbchat_archive_parser/parser.py @@ -135,11 +135,11 @@ class FacebookChatHistory: self._clear_output() sys.stderr.write('The streaming parser crashed due to malformed ' 'XML. Falling back to the less strict/efficient ' - 'BeautifulSoup parser. This may take a while... ' - '\n') + 'python html.parser. It may take a while before ' + 'you see output... \n') sys.stderr.flush() from bs4 import BeautifulSoup - soup = BeautifulSoup(open(self.stream, 'r').read(), 'lxml') + soup = BeautifulSoup(open(self.stream, 'r').read(), 'html.parser') self.__process_element('end', soup.find('h1')) for thread_element in soup.find_all('div', class_='thread'): self.__process_element('start', thread_element)
Switched backup parser from lxml to html.parser to avoid external dependencies
ownaginatious_fbchat-archive-parser
train
py
90426d59c7bbeab0a810f95b169178045f22fd20
diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb index <HASH>..<HASH> 100644 --- a/lib/csvlint/validate.rb +++ b/lib/csvlint/validate.rb @@ -297,10 +297,10 @@ module Csvlint link_schema = nil @link_headers.each do |link_header| match = LINK_HEADER_REGEXP.match(link_header) - uri = match["uri"].gsub(/(^\<|\>$)/, "") - rel = match["rel-relationship"].gsub(/(^\"|\"$)/, "") + uri = match["uri"].gsub(/(^\<|\>$)/, "") rescue nil + rel = match["rel-relationship"].gsub(/(^\"|\"$)/, "") rescue nil param = match["param"] - param_value = match["param-value"].gsub(/(^\"|\"$)/, "") + param_value = match["param-value"].gsub(/(^\"|\"$)/, "") rescue nil if rel == "describedby" && param == "type" && ["application/csvm+json", "application/ld+json", "application/json"].include?(param_value) begin url = URI.join(@source_url, uri)
Catch errors if link headers are don't have particular values
theodi_csvlint.rb
train
rb
62c6c417b0e2902ba5d4f04cf4a3b01f7f420b76
diff --git a/interp/interp_test.go b/interp/interp_test.go index <HASH>..<HASH> 100644 --- a/interp/interp_test.go +++ b/interp/interp_test.go @@ -1646,8 +1646,8 @@ set +o pipefail "1\n\n", }, { - "a() { echo func; }; a; unset -f a; a", - "func\n\"a\": executable file not found in $PATH\nexit status 127 #JUSTERR", + "notinpath() { echo func; }; notinpath; unset -f notinpath; notinpath", + "func\n\"notinpath\": executable file not found in $PATH\nexit status 127 #JUSTERR", }, { "a=1; a() { echo func; }; unset -f a; echo $a", @@ -1658,8 +1658,8 @@ set +o pipefail "func\n\n", }, { - "a=1; a() { echo func; }; a; echo $a; unset a; a; echo $a; unset a; a", - "func\n1\nfunc\n\n\"a\": executable file not found in $PATH\nexit status 127 #JUSTERR", + "notinpath=1; notinpath() { echo func; }; notinpath; echo $notinpath; unset notinpath; notinpath; echo $notinpath; unset notinpath; notinpath", + "func\n1\nfunc\n\n\"notinpath\": executable file not found in $PATH\nexit status 127 #JUSTERR", }, { "unset PATH; [[ $PATH == '' ]]",
interp: fix the tests if "a" exists in $PATH Use a longer and less likely to exist program name. Fixes #<I>.
mvdan_sh
train
go
fde82c218f6f0f5b2203d5605b8bc3869334d36d
diff --git a/ecell4/util/simulation.py b/ecell4/util/simulation.py index <HASH>..<HASH> 100644 --- a/ecell4/util/simulation.py +++ b/ecell4/util/simulation.py @@ -307,6 +307,10 @@ def ensemble_simulations(N=1, *args, **kwargs): DummyObserver.append(self, data) self.__sqtot += self.trancate(data) ** 2 + if 'model' not in kwargs: + kwargs['model'] = ecell4.util.decorator.get_model( + kwargs.get('is_netfree', False), kwargs.get('without_reset', False)) + tmp = ecell4.util.run_simulation(*args, **kwargs) if errorbar:
Get a model from global variables when no model is given
ecell_ecell4
train
py
cdb8b88e9b1244f3f62ba40d581a6a3e53b06be9
diff --git a/spec/named_scopes/or_conditions_spec.rb b/spec/named_scopes/or_conditions_spec.rb index <HASH>..<HASH> 100644 --- a/spec/named_scopes/or_conditions_spec.rb +++ b/spec/named_scopes/or_conditions_spec.rb @@ -38,4 +38,8 @@ describe "Or conditions" do User.username_begins_with("ben").id_gt(10).age_not_nil.username_or_name_ends_with("ben").scope(:find).should == {:conditions => "((users.username LIKE '%ben') OR (users.name LIKE '%ben')) AND ((users.age IS NOT NULL) AND ((users.id > 10) AND (users.username LIKE 'ben%')))"} end + + it "should play nice with scopes on associations" do + lambda { User.name_or_company_name_like("ben") }.should_not raise_error(Searchlogic::NamedScopes::OrConditions::NoConditionSpecifiedError) + end end \ No newline at end of file
Added a failing test to check for raised exceptions on "OR" scopes that include valid association scopes.
binarylogic_searchlogic
train
rb
ea95a474f68909f51c892a1d907acc221df9f2fa
diff --git a/spyder/plugins/tests/test_projects.py b/spyder/plugins/tests/test_projects.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/tests/test_projects.py +++ b/spyder/plugins/tests/test_projects.py @@ -14,8 +14,8 @@ Tests for the Projects plugin. import pytest # Local imports -from spyder.utils import encoding from spyder.plugins.projects import Projects +from spyder.py3compat import to_text_string # ============================================================================= @@ -36,7 +36,7 @@ def projects(qtbot): def test_open_project(projects, tmpdir, test_directory): """Test that we can create a project in a given directory.""" # Create the directory - path = str(tmpdir.mkdir(test_directory)) + path = to_text_string(tmpdir.mkdir(test_directory)) # Open project in path projects.open_project(path=path)
Testing: Fix test_open_project in Python 2
spyder-ide_spyder
train
py
31a3bb10b4a1cc3566b2725b1215b2f1e8833b65
diff --git a/project_generator/project.py b/project_generator/project.py index <HASH>..<HASH> 100644 --- a/project_generator/project.py +++ b/project_generator/project.py @@ -194,7 +194,11 @@ class ProjectWorkspace: return result def build(self, tool): - logging.debug("Building a workspace is not currently not supported") + logging.info("Building a workspace is not currently not supported") + return -1 + + def clean(self, tool): + logging.info("Building a workspace is not currently not supported") return -1 class Project:
Build and clean for workspaces - not supported print addition
project-generator_project_generator
train
py
10fd6355135919c031d8e91620fa2ab216c9665f
diff --git a/chalice/deployer.py b/chalice/deployer.py index <HASH>..<HASH> 100644 --- a/chalice/deployer.py +++ b/chalice/deployer.py @@ -639,7 +639,11 @@ class LambdaDeploymentPackager(object): def _add_py_deps(self, zip, deps_dir): # type: (zipfile.ZipFile, str) -> None prefix_len = len(deps_dir) + 1 - for root, _, filenames in os.walk(deps_dir): + for root, dirnames, filenames in os.walk(deps_dir): + if root == deps_dir and 'chalice' in dirnames: + # Don't include any chalice deps. We cherry pick + # what we want to include in _add_app_files. + dirnames.remove('chalice') for filename in filenames: full_path = os.path.join(root, filename) zip_path = full_path[prefix_len:]
Don't include chalice from site-packages in zipfile This is handled elsewhere and will result in UserWarnings from the zipfile module about duplicate files.
aws_chalice
train
py
cb709df2e77469ec8fcf8223fd17fe4fce15fb79
diff --git a/tests/iTunes/ResponseTest.php b/tests/iTunes/ResponseTest.php index <HASH>..<HASH> 100644 --- a/tests/iTunes/ResponseTest.php +++ b/tests/iTunes/ResponseTest.php @@ -72,6 +72,11 @@ class iTunesResponseTest extends TestCase $this->assertFalse((new SandboxResponse([]))->isProduction()); } + public function testResponseMightHasNullableEmptyReceipt(): void + { + $this->assertNull((new ProductionResponse([]))->getLatestReceipt()); + } + public function testValidReceipt(): void { $response = new ProductionResponse(
Add test to cover case with nullable latestReceipt
aporat_store-receipt-validator
train
php
9d724a8d40a15aa91e0aa63414f6260ab9d69b21
diff --git a/gwpy/timeseries/statevector.py b/gwpy/timeseries/statevector.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/statevector.py +++ b/gwpy/timeseries/statevector.py @@ -505,7 +505,7 @@ class StateVector(TimeSeriesBase): %(timeseries-fetch2)s """ - new = StateVectorDict.fetch( + new = cls.DictClass.fetch( [channel], start, end, host=host, port=port, verbose=verbose, connection=connection)[channel] if bits:
StateVector.fetch: use DictClass should allow possible sub-classes to change the internally used DictClass
gwpy_gwpy
train
py
26609f5f65c7d57f6b4ced7b49c77bfef0516f70
diff --git a/src/LaraPress/Mail/MailServiceProvider.php b/src/LaraPress/Mail/MailServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/LaraPress/Mail/MailServiceProvider.php +++ b/src/LaraPress/Mail/MailServiceProvider.php @@ -15,7 +15,7 @@ class MailServiceProvider extends ServiceProvider { { if (config('mail.override_wordpress', false)) { - //include(__DIR__ . '/wp_mail.php'); + include(__DIR__ . '/wp_mail.php'); } } -} \ No newline at end of file +}
Update MailServiceProvider.php removed commented line to override wordpress email
lara-press_framework
train
php
6233eefc489b47bcc9e38f281041d26a4b702eec
diff --git a/lib/active_repository/finders.rb b/lib/active_repository/finders.rb index <HASH>..<HASH> 100644 --- a/lib/active_repository/finders.rb +++ b/lib/active_repository/finders.rb @@ -7,9 +7,7 @@ module ActiveRepository #:nodoc: if repository? super(id) else - object = (id == :all) ? all : PersistenceAdapter.find(self, id) - - serialize!(object) + serialize!(PersistenceAdapter.find(self, id)) end rescue Exception => e message = "Couldn't find #{self} with ID=#{id}" diff --git a/spec/support/shared_examples.rb b/spec/support/shared_examples.rb index <HASH>..<HASH> 100644 --- a/spec/support/shared_examples.rb +++ b/spec/support/shared_examples.rb @@ -141,16 +141,6 @@ shared_examples ".find" do end end - context "with :all" do - it "returns all records" do - records = Country.find(:all) - - records.should include(Country.first) - records.should include(Country.last) - records.size.should == 5 - end - end - context "with an array of ids" do it "returns all matching ids" do countries = Country.all
Removed :all option from find method
efreesen_active_repository
train
rb,rb
1276e7e7c51f564f62eed25b7926984fca156042
diff --git a/lib/composers/with_mobx.js b/lib/composers/with_mobx.js index <HASH>..<HASH> 100644 --- a/lib/composers/with_mobx.js +++ b/lib/composers/with_mobx.js @@ -3,11 +3,11 @@ import {autorun} from 'mobx'; export default function composeWithMobx(fn, L, E, options) { const onPropsChange = (props, onData) => { - const disposer = () => fn(props, onData); + const reactiveFn = () => fn(props, onData); - autorun(disposer); + autorun(reactiveFn); - return disposer(); + return reactiveFn(); }; return compose(onPropsChange, L, E, options);
#<I> Renamed disposer to reactiveFn to avoid ambiguity
arunoda_react-komposer
train
js
804fcbf2fce48fa4c9118701b84529e9e9c48fba
diff --git a/lib/svtplay_dl/service/mtvnn.py b/lib/svtplay_dl/service/mtvnn.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/service/mtvnn.py +++ b/lib/svtplay_dl/service/mtvnn.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import sys import re +import os import xml.etree.ElementTree as ET from svtplay_dl.service import Service, OpenGraphThumbMixin @@ -22,6 +23,13 @@ class Mtvnn(Service, OpenGraphThumbMixin): data = get_http_data(match.group(1)) xml = ET.XML(data) mediagen = xml.find("channel").find("item").find("{http://search.yahoo.com/mrss/}group") + title = xml.find("channel").find("item").find("title").text + if options.output_auto: + directory = os.path.dirname(options.output) + if len(directory): + options.output = "%s/%s" % (directory, title) + else: + options.output = title contenturl = mediagen.find("{http://search.yahoo.com/mrss/}content").attrib["url"] content = get_http_data(contenturl) xml = ET.XML(content)
mtvnn: override automagic name with a better one
spaam_svtplay-dl
train
py
0b785fbeaf7b82137c61606d4af56433ed47c36f
diff --git a/lib/entity_custom_help_option.js b/lib/entity_custom_help_option.js index <HASH>..<HASH> 100644 --- a/lib/entity_custom_help_option.js +++ b/lib/entity_custom_help_option.js @@ -1,4 +1,4 @@ -const program = require('@wikibasejs/commander') +const program = require('commander') const path = require('path') const logCommandExamples = require('./log_command_examples')
entity_custom_help_option: fix dependency
maxlath_wikidata-cli
train
js
2820071db1db04e39f27f750e5e30177161ca481
diff --git a/src/models/room.js b/src/models/room.js index <HASH>..<HASH> 100644 --- a/src/models/room.js +++ b/src/models/room.js @@ -380,6 +380,23 @@ Room.prototype.getLiveTimeline = function() { return this.getUnfilteredTimelineSet().getLiveTimeline(); }; + +/** + * Get the timestamp of the last message in the room + * + * @return {number} the timestamp of the last message in the room + */ +Room.prototype.getLastActiveTimestamp = function() { + const timeline = this.getLiveTimeline(); + const events = timeline.getEvents(); + if (events.length) { + const lastEvent = events[events.length - 1]; + return lastEvent.getTs(); + } else { + return Number.MIN_SAFE_INTEGER; + } +}; + /** * @param {string} myUserId the user id for the logged in member * @return {string} the membership type (join | leave | invite) for the logged in user
add method to get last active timestamp in room
matrix-org_matrix-js-sdk
train
js
b947c4aa737815b8fc32e0013a1d43bea5278cad
diff --git a/termsandconditions/tests.py b/termsandconditions/tests.py index <HASH>..<HASH> 100644 --- a/termsandconditions/tests.py +++ b/termsandconditions/tests.py @@ -314,6 +314,9 @@ class TermsAndConditionsTemplateTagsTestCase(TestCase): '{% load terms_tags %}' '{% show_terms_if_not_agreed slug="specific-terms" %}' ) + self.terms1 = TermsAndConditions.objects.create(slug="site-terms", name="Site Terms", + text="Site Terms and Conditions 1", version_number=1.0, + date_active="2012-01-01") def _make_context(self, url): """Build Up Context - Used in many tests""" @@ -358,7 +361,7 @@ class TermsAndConditionsTemplateTagsTestCase(TestCase): context = self._make_context('/test') result = show_terms_if_not_agreed(context) terms = TermsAndConditions.get_active(slug=DEFAULT_TERMS_SLUG) - self.assertDictEqual(result, {'terms': terms}) + self.assertEqual(result.get('not_agreed_terms'), [terms]) def test_show_terms_if_not_agreed_on_unprotected_url_not_agreed(self): """Check terms on unprotected url if not agreed"""
Updating tests to handle arrays of terms.
cyface_django-termsandconditions
train
py
7b4da8e5ac88df6d1c9124576d0b46a193d2f1c5
diff --git a/src/Dropbox/Models/BaseModel.php b/src/Dropbox/Models/BaseModel.php index <HASH>..<HASH> 100644 --- a/src/Dropbox/Models/BaseModel.php +++ b/src/Dropbox/Models/BaseModel.php @@ -33,7 +33,7 @@ class BaseModel implements ModelInterface * @param string $property * @return mixed */ - protected function getDataProperty($property) + public function getDataProperty($property) { return isset($this->data[$property]) ? $this->data[$property] : null; } diff --git a/src/Dropbox/Models/ModelInterface.php b/src/Dropbox/Models/ModelInterface.php index <HASH>..<HASH> 100644 --- a/src/Dropbox/Models/ModelInterface.php +++ b/src/Dropbox/Models/ModelInterface.php @@ -15,6 +15,6 @@ interface ModelInterface * @param string $property * @return mixed */ - protected function getDataProperty($property); + public function getDataProperty($property); } \ No newline at end of file
Access type fix of getDataProperty method
kunalvarma05_dropbox-php-sdk
train
php,php
5680cb3d737d422df10db42622ee1c11d1517590
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ with open('README.md', 'r', 'utf-8') as f: setup( name='webhoseio', packages=['webhoseio'], - version='0.3', + version='0.4', author='Ran Geva', author_email='[email protected]', url='https://github.com/Webhose/webhoseio-python', @@ -31,6 +31,8 @@ setup( 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4' + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6' ) -) \ No newline at end of file +)
added Programming Language :: Python :: <I>
Webhose_webhoseio-python
train
py
c936701ec9e712aa47be8993229858f24c9e7768
diff --git a/datanommer.models/tests/test_model.py b/datanommer.models/tests/test_model.py index <HASH>..<HASH> 100644 --- a/datanommer.models/tests/test_model.py +++ b/datanommer.models/tests/test_model.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. import copy +import datetime import os import pprint import sqlalchemy @@ -284,3 +285,13 @@ class TestModels(unittest.TestCase): eq_(p, 1) eq_(len(r), 1) eq_(r[0].msg_id, '2014-6552feeb-6dd9-4c39-9839-2c35f0a0f498') + + def test_timezone_awareness(self): + msg = copy.deepcopy(github_message) + datanommer.models.add(msg) + datanommer.models.session.flush() + + queried = datanommer.models.Message.query.one() + + t = queried.timestamp + eq_(t, datetime.datetime(2014, 6, 18, 21, 32, 44))
Add failing test wrt timezone awareness
fedora-infra_datanommer
train
py
8f1911fd6c13d5eeca8c2abbc2e83b9356223767
diff --git a/test/test-case-factory.js b/test/test-case-factory.js index <HASH>..<HASH> 100644 --- a/test/test-case-factory.js +++ b/test/test-case-factory.js @@ -225,10 +225,9 @@ class TestCaseFactory { _forkChild (runnerPath, args) { return new Promise((resolve, reject) => { console.log('Executing > ', runnerPath, args.join(' ')) - // const command = this._cover(runnerPath, args) - const command = {path: runnerPath, args} + const command = this._cover(runnerPath, args) const child = fork(command.path, command.args, { - stdio: [0, 'pipe', 'pipe', 'ipc'], + silent: true, cwd: this.testCasePath })
chore(build): try to fix the travis build
mucsi96_nightwatch-cucumber
train
js
d5da28508d0e138dde9ec10020d0873f6be05ee0
diff --git a/loaders/postgres.go b/loaders/postgres.go index <HASH>..<HASH> 100644 --- a/loaders/postgres.go +++ b/loaders/postgres.go @@ -150,21 +150,13 @@ func PgParseType(args *internal.ArgType, dt string, nullable bool) (int, string, asSlice = true typ = "byte" - case "date", "timestamp with time zone": + case "date", "timestamp with time zone", "time with time zone", "time without time zone", "timestamp without time zone": typ = "*time.Time" if nullable { nilVal = "pq.NullTime{}" typ = "pq.NullTime" } - case "time with time zone", "time without time zone", "timestamp without time zone": - nilVal = "0" - typ = "int64" - if nullable { - nilVal = "sql.NullInt64{}" - typ = "sql.NullInt64" - } - case "interval": typ = "*time.Duration"
Changing postgres time parsing behavior
xo_xo
train
go
eec14493944777fffcbd36183bee9d66c09775de
diff --git a/src/Widget.js b/src/Widget.js index <HASH>..<HASH> 100644 --- a/src/Widget.js +++ b/src/Widget.js @@ -82,8 +82,8 @@ OO.ui.Widget.prototype.setDisabled = function ( disabled ) { this.$element.attr( 'aria-disabled', isDisabled.toString() ); this.emit( 'disable', isDisabled ); this.updateThemeClasses(); + this.wasDisabled = isDisabled; } - this.wasDisabled = isDisabled; return this; };
Move line in Widget.setDisabled() up to where it belongs This line can't do anything outside of the `if`. Change-Id: I1ffb0ed<I>d<I>bfc1ad7dfa<I>e<I>b<I>d<I>f
wikimedia_oojs-ui
train
js
d885129bed2bab2a86295322703f4c9eb556bfa0
diff --git a/devices/danfoss.js b/devices/danfoss.js index <HASH>..<HASH> 100644 --- a/devices/danfoss.js +++ b/devices/danfoss.js @@ -45,7 +45,7 @@ module.exports = [ .withDescription('Whether or not the unit needs warm water. `false` No Heat Request or `true` Heat Request'), exposes.enum('setpoint_change_source', ea.STATE, ['manual', 'schedule', 'externally']) .withDescription('Values observed are `0` (manual), `1` (schedule) or `2` (externally)'), - exposes.climate().withSetpoint('occupied_heating_setpoint', 5, 32, 0.5).withLocalTemperature().withPiHeatingDemand() + exposes.climate().withSetpoint('occupied_heating_setpoint', 5, 35, 0.5).withLocalTemperature().withPiHeatingDemand() .withSystemMode(['heat']).withRunningState(['idle', 'heat'], ea.STATE), exposes.numeric('external_measured_room_sensor', ea.ALL) .withDescription('If `radiator_covered` is `true`: Set at maximum 30 minutes interval but not more often than every ' +
Change max temp from <I> to <I> for Danfoss Ally (#<I>) The technical specification lists a temperature range from 5 to <I> deg celsius. See here (MaxHeatSetpointLimit): <URL>
Koenkk_zigbee-shepherd-converters
train
js
89fadc7372a731e747bb486a1ef9229484ac069c
diff --git a/src/build-json.js b/src/build-json.js index <HASH>..<HASH> 100644 --- a/src/build-json.js +++ b/src/build-json.js @@ -58,7 +58,7 @@ const hardCodedReactHTMLAttributes = { 'color', 'height', 'width', - ] + ], } const getAttributeList = (jQuery, listTitleSelector) => {
fix(build-json.js): Change build-json.js
jackyho112_react-html-attributes
train
js
9ee8d484db7ecde11a908bfbed4afce40b3362b9
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -49,6 +49,10 @@ module.exports = function(config_hash) { } } else { Logger.logger.error({err: err}, 'unexpected error: @{!err.message}\n@{err.stack}') + if (!res.status || !res.send) { + Logger.logger.error('this is an error in express.js, please report this') + res.destroy() + } if (calls == 1) { res.status(500) res.send({error: 'internal server error'})
dealing with internal errors in express.js
verdaccio_verdaccio
train
js
d2be6543abd25c4201a70d7ba53085d8ca495c3a
diff --git a/src/Twilio.php b/src/Twilio.php index <HASH>..<HASH> 100644 --- a/src/Twilio.php +++ b/src/Twilio.php @@ -64,7 +64,7 @@ class Twilio { $debugTo = $this->config->getDebugTo(); - if ($debugTo !== null) { + if (!empty($debugTo)) { $to = $debugTo; }
Consider "" value for TWILIO_DEBUG_TO as null (#<I>)
laravel-notification-channels_twilio
train
php
a353c7596d104a231693843072e754e5fa9b94a2
diff --git a/src/main/java/com/constantcontact/components/emailcampaigns/EmailCampaignBase.java b/src/main/java/com/constantcontact/components/emailcampaigns/EmailCampaignBase.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/constantcontact/components/emailcampaigns/EmailCampaignBase.java +++ b/src/main/java/com/constantcontact/components/emailcampaigns/EmailCampaignBase.java @@ -6,6 +6,7 @@ import java.util.List; import com.constantcontact.components.Component; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -198,6 +199,7 @@ public abstract class EmailCampaignBase extends Component implements Serializabl * @return The Message Footer */ @JsonProperty("message_footer") + @JsonInclude(JsonInclude.Include.NON_NULL) public MessageFooter getMessageFooter() { return messageFooter; }
JSON serializer fix for campaign footer
constantcontact_java-sdk
train
java
3a05635eccb5957da56244c32b8245e68351b121
diff --git a/sportsref/decorators.py b/sportsref/decorators.py index <HASH>..<HASH> 100644 --- a/sportsref/decorators.py +++ b/sportsref/decorators.py @@ -128,6 +128,7 @@ def cache_html(func): if parsed.query: relURL += '?' + parsed.query noPathFN = re.sub(r'\.html?', '', sport + relURL.replace('/', '')) + # TODO: change this so we just hash the URL - far simpler file_hash = hashlib.md5() file_hash.update(noPathFN) file_hash = file_hash.hexdigest()
cache_html: added TODO about hashing
mdgoldberg_sportsref
train
py
3429fba0d07888e82e8a27453aec861e75c6f578
diff --git a/core/src/test/java/org/jenkins/ui/icon/IconSetTest.java b/core/src/test/java/org/jenkins/ui/icon/IconSetTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/jenkins/ui/icon/IconSetTest.java +++ b/core/src/test/java/org/jenkins/ui/icon/IconSetTest.java @@ -14,6 +14,6 @@ public class IconSetTest { @Test void testIconSetSize() { final Map<String, Icon> coreIcons = IconSet.icons.getCoreIcons(); - assertThat("icons", coreIcons.size(), greaterThanOrEqualTo(371)); + assertThat("icons", coreIcons.size(), greaterThanOrEqualTo(350)); } }
Lower 'reasonable' number of icons (fix master build) (#<I>)
jenkinsci_jenkins
train
java
8aee5a4056f9b93600dd86f8ac0c7cbbb874fa00
diff --git a/lib/dopv/infrastructure/base_node.rb b/lib/dopv/infrastructure/base_node.rb index <HASH>..<HASH> 100644 --- a/lib/dopv/infrastructure/base_node.rb +++ b/lib/dopv/infrastructure/base_node.rb @@ -122,11 +122,11 @@ module Dopv cores end - def get_memory(attrs={}, unit=:bytes) + def get_memory(attrs={}, unit=:byte) get_size(attrs.merge(:type => :memory, :unit => unit)) end - def get_storage(attrs={}, unit=:bytes) + def get_storage(attrs={}, unit=:byte) get_size(attrs.merge(:type => :storage, :unit => unit)) end end
Fix units in get_memory and get_storage methods
swisscom_dopv
train
rb
3cf586d855cd18a277e3e83c90c60e153e013298
diff --git a/tests/ci_depends.php b/tests/ci_depends.php index <HASH>..<HASH> 100644 --- a/tests/ci_depends.php +++ b/tests/ci_depends.php @@ -25,22 +25,16 @@ class PhpExtensions { $this->iniPath = php_ini_loaded_file(); $this->extensions = array( 'memcached' => array( - 'url' => 'http://pecl.php.net/get/memcached-1.0.2.tgz', - 'require' => array( - // memcached 1.0.2 does not build on PHP 5.4 - 'php' => array('<', '5.4') - ), + 'url' => 'http://pecl.php.net/get/memcached-2.0.1.tgz', + 'require' => array(), 'configure' => array(), 'ini' => array( 'extension=memcached.so' ) ), 'apc' => array( - 'url' => 'http://pecl.php.net/get/APC-3.1.9.tgz', - 'require' => array( - // apc 3.1.9 causes a segfault on PHP 5.4 - 'php' => array('<', '5.4') - ), + 'url' => 'http://pecl.php.net/get/APC-3.1.10.tgz', + 'require' => array(), 'configure' => array(), 'ini' => array( 'extension=apc.so',
Less skipped tests for PHP<I> with Travis
UnionOfRAD_lithium
train
php
bc2e95793a1fc4604b3e18f6d17221be5f42b4fe
diff --git a/sorters.go b/sorters.go index <HASH>..<HASH> 100644 --- a/sorters.go +++ b/sorters.go @@ -263,6 +263,8 @@ func NewFileSorter(TmpFolder FsPath) *FileSorter { for i := 0; i < 2; i++ { sortToken <- true } + TmpFolder.Join("mapOut").Remove() + TmpFolder.Join("sorted").Remove() return &FileSorter{ TmpFolder: TmpFolder, mapOuts: make(map[int]*mapOut), @@ -366,8 +368,6 @@ func (fs *FileSorter) NewReduceIterator(part int) (ReduceIterator, error) { return nil, err } - // fmt.Println("redIn written to", redIn.Path) - mo.reader, err = NewKVReader(redIn) if err != nil { return nil, err
FIX delete tmp folder before using it in FileSorter
daviddengcn_sophie
train
go
a0b18b02765b005dc4f0e3376461c30db600ebdb
diff --git a/anime.js b/anime.js index <HASH>..<HASH> 100644 --- a/anime.js +++ b/anime.js @@ -448,7 +448,7 @@ return { original: value, numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0], - strings: (typeof val === "string" || unit) ? value.split(rgx) : [] + strings: (is.str(val) || unit) ? value.split(rgx) : [] } }
Use helper function instead of standard typeof As suggested in bryanyee's review.
juliangarnier_anime
train
js
73faab103c7f222dc3926ce92d081481e6883f6d
diff --git a/sources/Tags.php b/sources/Tags.php index <HASH>..<HASH> 100644 --- a/sources/Tags.php +++ b/sources/Tags.php @@ -25,6 +25,13 @@ final class Tags $this->_aliases = $aliases; } + public function register(string $tag) + { + if (empty($this->_byTag[$tag])) { + $this->_byTag[$tag] = []; + } + } + public function add(string $tag, string $key, float $priority = null) { $key = $this->_aliases->resolve($key) ?: $key; diff --git a/tests/unit/TagsTest.php b/tests/unit/TagsTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/TagsTest.php +++ b/tests/unit/TagsTest.php @@ -68,6 +68,10 @@ class TagsTest extends \PHPUnit\Framework\TestCase $tags->add('t4', 't4', 1); verify($tags->keysByTag('t4'))->same(['t4']); verify($tags->tagsForKey('t4'))->same(['t4']); + + $tags->register('t5'); + verify($tags->hasTag('t5'))->true(); + verify($tags->keysByTag('t5'))->same([]); }); $this->specify('Check bad float priorities.', function () {
feature: add method "register" to Tags class
Moro4125_container7
train
php,php
b5b7595bc0441f2ec133ce79638cdd2f85c7fa7b
diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index <HASH>..<HASH> 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -164,7 +164,7 @@ class Scaffold { */ protected function _output() { $this->controller->afterFilter(); - echo($this->controller->output); + $this->controller->getResponse()->send(); } /**
Fixing issue in scaffold where it accessed $output, which no longer exists.
cakephp_cakephp
train
php
ba5d64ae7ccff413cb088f8192bcac98114457ce
diff --git a/tests/tools_dbmaint_unittest.py b/tests/tools_dbmaint_unittest.py index <HASH>..<HASH> 100644 --- a/tests/tools_dbmaint_unittest.py +++ b/tests/tools_dbmaint_unittest.py @@ -54,7 +54,7 @@ class RunCmdTestCase(unittest.TestCase): "ls terminated with exit code: 2\nls: cannot access " "/this/does/not/exist: No such file or directory\n", e.args[0]) else: - raise Exception("exception not raised") + self.fail("exception not raised") def test_run_cmd_with_errors_and_ignore_exit_code(self): """Invoke a command with errors but ignore the exit code.""" @@ -190,7 +190,7 @@ class PsqlTestCase(unittest.TestCase): self.assertEqual( "Please specify either an SQL script or a command.", e.args[0]) else: - raise Exception("exception not raised") + self.fail("exception not raised") def test_psql_with_neither_script_nor_command(self): """ @@ -204,7 +204,7 @@ class PsqlTestCase(unittest.TestCase): self.assertEqual( "Neither SQL script nor command specified.", e.args[0]) else: - raise Exception("exception not raised") + self.fail("exception not raised") class FindScriptsTestCase(unittest.TestCase):
Lars' review comments Former-commit-id: bece<I>f<I>d2c<I>c6cd3c<I>
gem_oq-engine
train
py
9e0702680bc66af2312070350615363c22121278
diff --git a/lxd/device/nic_ovn.go b/lxd/device/nic_ovn.go index <HASH>..<HASH> 100644 --- a/lxd/device/nic_ovn.go +++ b/lxd/device/nic_ovn.go @@ -233,7 +233,7 @@ func (d *nicOVN) Start() (*deviceConfig.RunConfig, error) { } // Add new OVN logical switch port for instance. - logicalPortName, err := network.OVNInstanceDevicePortAdd(d.network, d.inst.ID(), d.name, mac, ips) + logicalPortName, err := network.OVNInstanceDevicePortAdd(d.network, d.inst.ID(), d.inst.Name(), d.name, mac, ips) if err != nil { return nil, err }
lxd/device/nic/ovn: Updates usage of network.OVNInstanceDevicePortAdd to supply instance name for DNS records
lxc_lxd
train
go
657be31ae1cc86edf3cab42bbd552b7b2c3a5618
diff --git a/gnupg/_meta.py b/gnupg/_meta.py index <HASH>..<HASH> 100644 --- a/gnupg/_meta.py +++ b/gnupg/_meta.py @@ -995,7 +995,7 @@ class GPGBase(object): self._add_recipient_string(args, hidden_recipients, recp) ## ...and now that we've proven py3k is better... else: - log.debug("Don't know what to do with recipients: '%s'" + log.debug("Don't know what to do with recipients: %r" % recipients) result = self._result_map['crypt'](self)
Change a str to a repr in a log message.
isislovecruft_python-gnupg
train
py
c67fb1ad6ecdea7f310f884fa75f6d55f5ad10aa
diff --git a/generator/objects/Property.php b/generator/objects/Property.php index <HASH>..<HASH> 100644 --- a/generator/objects/Property.php +++ b/generator/objects/Property.php @@ -124,6 +124,9 @@ class Property { case $this->getType() === Object::PROPERTY_TYPE_BOOLEAN: case $this->getType() === Object::PROPERTY_TYPE_ENUM: return false; + //This to to improve detection of names that are the same plural/sing + case preg_match('/maximum of [2-9] <(?<model>[a-z]+)> elements/i', $this->getDescription()): + return true; default: return $this->getNameSingular() != $this->getName(); } @@ -294,6 +297,13 @@ class Property { } } + //Look for pointy bracketed references + if($result === null){ + if(preg_match('/<(?<model>[^>]+)>/i', $this->getDescription(), $matches)){ + $result = $this->getModel()->getAPI()->searchByKey(str_replace(' ', '', ucwords($matches['model'])), $ns_hint); + } + } + //I have tried very hard to avoid special cases! if($result === null){
Fixes #<I>, tracking property detection
calcinai_xero-php
train
php
d51b4f5ece5c57acb0012604568133fe0371263a
diff --git a/models/config.php b/models/config.php index <HASH>..<HASH> 100644 --- a/models/config.php +++ b/models/config.php @@ -25,9 +25,48 @@ namespace fluxbb; -class Config extends \FluxBB_BaseModel +use Cache; +use DB; + +class Config { + protected static $loaded = false; + + protected static $data = array(); + + protected static function data() + { + if (!static::$loaded) + { + static::$data = Cache::remember('fluxbb.config', function() + { + $data = DB::table('config')->get(); + $cache = array(); + + foreach ($data as $row) + { + $cache[$row->conf_name] = $row->conf_value; + } + + return $cache; + }, 24 * 60); + + static::$loaded = true; + } + + return static::$data; + } + + public static function get($key, $default = null) + { + $data = static::data(); - public static $table = 'config'; + if (array_key_exists($key, $data)) + { + return $data[$key]; + } + + return $default; + } }
#<I>: Add a basic config class with caching.
fluxbb_core
train
php
29ba6789b0c06a2fc70be476bb3677fcce6d5ca2
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -53,7 +53,7 @@ final class Configuration implements ConfigurationInterface public static function getPackageDir(): string { - return self::$packageDir ?? (self::$packageDir = dirname((new \ReflectionClass(AttributeIdInterface::class))->getFileName())); + return self::$packageDir ?? (self::$packageDir = dirname((string) (new \ReflectionClass(AttributeIdInterface::class))->getFileName())); } public function getConfigTreeBuilder(): TreeBuilder
update phpstan to <I> (#<I>)
msgphp_eav-bundle
train
php
38a4ecc00b3db9cce4d9b451dbdb170e3df2429c
diff --git a/lib/couchpenter.js b/lib/couchpenter.js index <HASH>..<HASH> 100644 --- a/lib/couchpenter.js +++ b/lib/couchpenter.js @@ -12,15 +12,22 @@ function Couchpenter() { function setUp(dbUrl, configFile, cb) { var conf = config.read(configFile), - db = new Db(dbUrl); - async.series([ - function (cb) { + db = new Db(dbUrl), + tasks = []; + + if (conf.databases) { + tasks.push(function (cb) { db.setDatabases(conf.databases, cb); - }, - function (cb) { + }); + } + + if (conf.documents) { + tasks.push(function (cb) { db.setDocuments(conf.documents, cb); - } - ], cb); + }); + } + + async.series(tasks, cb); } return {
Databases and documents properties are now optional.
cliffano_couchpenter
train
js
8c335dd12186b530f6343edbe4d304148f97f9b0
diff --git a/python/test/nbla_test_utils.py b/python/test/nbla_test_utils.py index <HASH>..<HASH> 100644 --- a/python/test/nbla_test_utils.py +++ b/python/test/nbla_test_utils.py @@ -593,10 +593,12 @@ def function_tester(rng, func, ref_func, inputs, continue v = vinputs[i] v.need_grad = backward[i] + for i in range(len(vinputs)): if vinputs[i] is None: continue v = vinputs[i] + if not backward[i]: continue f = o[0].parent @@ -616,7 +618,7 @@ def function_tester(rng, func, ref_func, inputs, true_g = v.g - g # Check accum=False - accum = [j != i for j in range(len(finputs))] + accum = [j != i for j, vv in enumerate(vinputs) if vv is not None] v.g = rng.randn(*v.shape) f.forward(finputs, o) f.backward(finputs, o, accum)
[python][test] Support function_tester with None inputs
sony_nnabla
train
py
20953e651f84c14bc0fe8ddca8f15d4fdf154603
diff --git a/bpm/src/main/java/org/jboss/pnc/bpm/causeway/BuildResultPushManager.java b/bpm/src/main/java/org/jboss/pnc/bpm/causeway/BuildResultPushManager.java index <HASH>..<HASH> 100644 --- a/bpm/src/main/java/org/jboss/pnc/bpm/causeway/BuildResultPushManager.java +++ b/bpm/src/main/java/org/jboss/pnc/bpm/causeway/BuildResultPushManager.java @@ -218,7 +218,7 @@ public class BuildResultPushManager { .queryById(buildRecord.getBuildConfigurationAuditedIdRev()); Map<String, String> genericParameters = buildConfigurationAudited.getGenericParameters(); if (executionRootName == null) { - if (genericParameters.containsKey(BREW_BUILD_NAME)) { + if (genericParameters.containsKey(BREW_BUILD_NAME.name())) { executionRootName = genericParameters.get(BREW_BUILD_NAME.name()); } else { throw new IllegalArgumentException(
Update bpm/src/main/java/org/jboss/pnc/bpm/causeway/BuildResultPushManager.java
project-ncl_pnc
train
java
74fc671fd22aa6dd56003be8c6e7a2a3b18216de
diff --git a/pyaccess/pyaccess.py b/pyaccess/pyaccess.py index <HASH>..<HASH> 100644 --- a/pyaccess/pyaccess.py +++ b/pyaccess/pyaccess.py @@ -134,7 +134,7 @@ class PyAccess(): def initializeAccVarDirect(my,gno,cat,nodeids,accvar): _pyaccess.initialize_acc_var(gno,cat,nodeids,accvar) - def initializeAccVar(my,cat,nodeids,accvar,preaggregate=1): + def initializeAccVar(my,cat,nodeids,accvar,preaggregate=0): if my.numgraphs == 1 and type(nodeids) <> type([]): nodeids = [nodeids] # allow passing node ids not as a list of lists when one graph for i in range(my.numgraphs):
set preaggregate to 1 by default
UDST_pandana
train
py
a93ea7ee928a1a8986bd0ac43f2d12887578a2af
diff --git a/ghost/admin/app/components/modals/upload-theme.js b/ghost/admin/app/components/modals/upload-theme.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/components/modals/upload-theme.js +++ b/ghost/admin/app/components/modals/upload-theme.js @@ -47,7 +47,8 @@ export default ModalComponent.extend({ actions: { validateTheme(file) { - let themeName = file.name.replace(/\.zip$/, ''); + let themeName = file.name.replace(/\.zip$/, '').replace(/[^\w@.]/gi, '-'); + let availableThemeNames = this.get('availableThemeNames'); this.set('file', file);
Replaces non ascii characters to dashes so that it's consistent with … (#<I>) refs #<I> - theme name normalisation - detect duplicates to show a popup to override a theme
TryGhost_Ghost
train
js
aac9560eb9090f479584647a79aea1d647124b39
diff --git a/lib/enumerize.rb b/lib/enumerize.rb index <HASH>..<HASH> 100644 --- a/lib/enumerize.rb +++ b/lib/enumerize.rb @@ -50,7 +50,10 @@ module Enumerize rescue LoadError end - if defined?(::RSpec) + begin + require 'rspec/matchers' + rescue LoadError + else require 'enumerize/integrations/rspec' end end
Require rspec/matchers before require enumerate/integrations/rspec. - `if defined?(::RSpec)` it fails to load the enumerize matcher properly when used with rails/spring. - similar to <URL>
brainspec_enumerize
train
rb
7da27ced81b6d9edc78c93cbd4401025797e1bc9
diff --git a/packages/xod-client-electron/src/app/workspaceActions.js b/packages/xod-client-electron/src/app/workspaceActions.js index <HASH>..<HASH> 100644 --- a/packages/xod-client-electron/src/app/workspaceActions.js +++ b/packages/xod-client-electron/src/app/workspaceActions.js @@ -3,7 +3,7 @@ import P from 'path'; import FS from 'fs'; import EventEmitter from 'events'; -import XP from 'xod-project'; +import * as XP from 'xod-project'; import { resolvePath, writeFile,
chore(xod-client-electron): fix merging mistakes
xodio_xod
train
js
f010da644841bdd05e10c18cef65b4161b349564
diff --git a/raiden/network/rpc/client.py b/raiden/network/rpc/client.py index <HASH>..<HASH> 100644 --- a/raiden/network/rpc/client.py +++ b/raiden/network/rpc/client.py @@ -906,11 +906,11 @@ class JSONRPCClient: def __init__( self, web3: Web3, - privkey: Optional[PrivateKey], + privkey: PrivateKey, gas_price_strategy: Callable = rpc_gas_price_strategy, block_num_confirmations: int = 0, ) -> None: - if privkey is None or len(privkey) != 32: + if len(privkey) != 32: raise ValueError("Invalid private key") if block_num_confirmations < 0:
JSONRPCClient requires a privatekey. The signature allowed for `None` to be used, but that resulted in a runtime error. Instead of having an error at runtime this enforces the caller to provide a privatekey statically. The privatekey is required because transactions are signed locally.
raiden-network_raiden
train
py
c0ca5f0a87dff932ab6adf6ddf1ec4c12f5566e3
diff --git a/src/Router.php b/src/Router.php index <HASH>..<HASH> 100644 --- a/src/Router.php +++ b/src/Router.php @@ -189,16 +189,16 @@ final class Router { } // if the route regex does not match the current request path else { - return false; + return null; } } - private function addRoute($expectedRequestMethod, $expectedRoute, $callback, $injectArgs = null) { + private function addRoute($expectedRequestMethod, $expectedRoute, $callback = null, $injectArgs = null) { if ($expectedRequestMethod === $this->requestMethod) { $matchedArgs = $this->matchRoute($expectedRoute); // if the route matches the current request - if ($matchedArgs !== false) { + if ($matchedArgs !== null) { // if a callback has been set if (isset($callback) && is_callable($callback)) { // if additional arguments to be injected have been pre-defined
Change signatures of internal methods to be more meaningful
delight-im_PHP-Router
train
php
94cc6c7691b6a31e3b33f335dd11d3d1165d5f13
diff --git a/api/app.go b/api/app.go index <HASH>..<HASH> 100644 --- a/api/app.go +++ b/api/app.go @@ -951,6 +951,15 @@ func unsetEnv(w http.ResponseWriter, r *http.Request, t auth.Token) error { return nil } +// title: set cname +// path: /apps/{app}/cname +// method: POST +// consume: application/x-www-form-urlencoded +// responses: +// 200: Ok +// 400: Invalid data +// 401: Unauthorized +// 404: App not found func setCName(w http.ResponseWriter, r *http.Request, t auth.Token) error { err := r.ParseForm() if err != nil {
api/app: add comments to describe set cname
tsuru_tsuru
train
go
9bc428a60ece0830223b5a6f477b348447183074
diff --git a/spec/ios/helpers/spec_helper.rb b/spec/ios/helpers/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/ios/helpers/spec_helper.rb +++ b/spec/ios/helpers/spec_helper.rb @@ -27,11 +27,6 @@ def protect_existing_address_book `mv \"#{AB_PATH}\" \"#{AB_PATH_BAK}\"` # Kernel.system "rm -rf \"#{AB_PATH_BAK}\"" # Kernel.system "mv \"#{AB_PATH}\" \"#{AB_PATH_BAK}\"" - - unless AddressBook.authorized? - warn "BLOCKING FOR AUTHORIZATION" - AddressBook.request_authorization - end end at_exit do @@ -41,4 +36,13 @@ at_exit do Kernel.system "mv \"#{AB_PATH_BAK}\" \"#{AB_PATH}\"" end +def wait_for_authorization + @semaphore = Dispatch::Semaphore.new(0) + AddressBook::AddrBook.new do + @semaphore.signal + end + @semaphore.wait +end + protect_existing_address_book +wait_for_authorization
cleaner way to wait for authorization before running specs
alexrothenberg_motion-addressbook
train
rb
db15cd847ad07d2492d885bdf3804b8f35ef02b1
diff --git a/command/exec_test.go b/command/exec_test.go index <HASH>..<HASH> 100644 --- a/command/exec_test.go +++ b/command/exec_test.go @@ -31,7 +31,7 @@ func TestExecCommand_implements(t *testing.T) { func TestExecCommandRun(t *testing.T) { t.Parallel() cfg := agent.TestConfig() - cfg.DisableRemoteExec = &agent.BoolFalse + cfg.DisableRemoteExec = agent.Bool(false) a := agent.NewTestAgent(t.Name(), cfg) defer a.Shutdown()
test: replace one more BoolFalse with agent.Bool()
hashicorp_consul
train
go
44f980c08a768e9fc49f1137e3c7dab2a547a820
diff --git a/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java b/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java +++ b/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java @@ -84,12 +84,12 @@ public final class CredentialReference implements Destroyable { static final SimpleAttributeDefinition credentialTypeAttribute; static final SimpleAttributeDefinition clearTextAttribute; - static ObjectTypeAttributeDefinition credentialReferenceAttributeDefinition; + static final ObjectTypeAttributeDefinition credentialReferenceAttributeDefinition; private final String credentialStoreName; private final String alias; private final String credentialType; - private char[] secret; + private volatile char[] secret; static { credentialStoreAttribute = new SimpleAttributeDefinitionBuilder(STORE, ModelType.STRING, true) @@ -154,7 +154,6 @@ public final class CredentialReference implements Destroyable { return secret; } - /** * Destroy the secret stored in this {@code Object}. */
[WFCORE-<I>] Make CredentialReference thread safe
wildfly_wildfly-core
train
java
28a942778c0be53f268c3c97c98cd01eac727300
diff --git a/js/jquery.cloudinary.js b/js/jquery.cloudinary.js index <HASH>..<HASH> 100644 --- a/js/jquery.cloudinary.js +++ b/js/jquery.cloudinary.js @@ -339,6 +339,12 @@ function crc32 (str) { return this; }; + $.fn.cloudinary_upload_url = function(remote_url) { + this.fileupload('option', 'formData').file = remote_url; + this.fileupload('add', { files: [ remote_url ] }); + delete(this.fileupload('option', 'formData').file); + } + $(function() { $("input.cloudinary-fileupload[type=file]").cloudinary_fileupload(); });
Helper method for uploading a remote url through the jquery fileupload plugin
cloudinary_cloudinary_js
train
js
2d6001acd642c7b1ba695fdf66ba3764424f4868
diff --git a/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_java_compile_integration.py b/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_java_compile_integration.py index <HASH>..<HASH> 100644 --- a/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_java_compile_integration.py +++ b/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_java_compile_integration.py @@ -3,6 +3,8 @@ import os +import pytest + from pants.fs.archive import archiver_for_path from pants.util.contextutil import temporary_dir from pants.util.dirutil import safe_walk @@ -202,6 +204,7 @@ class JavaCompileIntegrationTest(BaseCompileIT): self.assertEqual(guava_16_artifact_dir, guava_15_artifact_dir) self.assertEqual(len(os.listdir(guava_16_artifact_dir)), 2) + @pytest.mark.flaky(retries=1) # https://github.com/pantsbuild/pants/issues/8171 def test_java_compile_with_corrupt_remote(self): """Tests that a corrupt artifact in the remote cache still results in a successful compile.""" with self.temporary_workdir() as workdir, temporary_dir() as cachedir:
This test has been flaky far too long. (#<I>) First step towards killing the test. #<I>
pantsbuild_pants
train
py
e741be7d74694e1ffe446ca269c2fe614f181a14
diff --git a/tests/all.py b/tests/all.py index <HASH>..<HASH> 100755 --- a/tests/all.py +++ b/tests/all.py @@ -17,7 +17,8 @@ if "PYXMPP2_ETREE" not in os.environ: all_modules=[ "jid", "stream_reader", "xmppserializer", "stanza", "message", "presence", "iq", "stanzaprocessor", "streambase", "sasl_gsasl", "binding", "streamsasl", - "streamtls", "ext_version", + "streamtls", "roster", + "ext_version", # "cache", # "vcard", "disco", "dataforms", "interface" ]
roster tests added to tests/all.py
Jajcus_pyxmpp2
train
py
ba1a6d9935a5047cce55807a431e96c4eec53bcb
diff --git a/aeron-driver/src/main/java/io/aeron/driver/media/SendChannelEndpoint.java b/aeron-driver/src/main/java/io/aeron/driver/media/SendChannelEndpoint.java index <HASH>..<HASH> 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/media/SendChannelEndpoint.java +++ b/aeron-driver/src/main/java/io/aeron/driver/media/SendChannelEndpoint.java @@ -16,7 +16,6 @@ package io.aeron.driver.media; import io.aeron.driver.*; -import io.aeron.driver.status.ChannelEndpointStatus; import io.aeron.protocol.NakFlyweight; import io.aeron.protocol.StatusMessageFlyweight; import org.agrona.LangUtil; @@ -63,8 +62,6 @@ public class SendChannelEndpoint extends UdpChannelTransport nakMessagesReceived = context.systemCounters().get(NAK_MESSAGES_RECEIVED); statusMessagesReceived = context.systemCounters().get(STATUS_MESSAGES_RECEIVED); this.statusIndicator = statusIndicator; - - statusIndicator.setOrdered(ChannelEndpointStatus.INITIALIZING); } /**
[Java] Remove duplicate zeroing of counter.
real-logic_aeron
train
java
01c2cbd7e4e02a135e5336ec1df815f4da00e917
diff --git a/sir/pythia/pythia.py b/sir/pythia/pythia.py index <HASH>..<HASH> 100755 --- a/sir/pythia/pythia.py +++ b/sir/pythia/pythia.py @@ -80,8 +80,8 @@ class TestCase(object): # execute the command within the sandbox p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE) stdout, stderr = p.communicate() - stdout = str(stdout) - stderr = str(stderr) + stdout = str(stdout)[2:-1] + stderr = str(stderr)[2:-1] retcode = p.returncode state = sandbox_state(sandboxd)
tidied stdout and stderr strings
squaresLab_BugZoo
train
py
a1386b90ab32df04046b825e2e1dc82cebdef202
diff --git a/src/feat/common/run.py b/src/feat/common/run.py index <HASH>..<HASH> 100644 --- a/src/feat/common/run.py +++ b/src/feat/common/run.py @@ -176,6 +176,13 @@ def startup(processType, processName, daemonize=False, @param daemonizeTo: The directory that the daemon should run in. @type daemonizeTo: str """ + pid = getPid(rundir, processType, processName) + if pid: + if checkPidRunning(pid): + log.error(processType, + "%s is running with pid %d" % (processName, pid)) + sys.exit(1) + log.info(processType, "Starting %s '%s'", processType, processName) if daemonize:
Check for feat process running before starting a new one.
f3at_feat
train
py