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
09a1af3c6b9561ae98a2aff37c6e4d55ecd7f641
diff --git a/lib/match/options.rb b/lib/match/options.rb index <HASH>..<HASH> 100644 --- a/lib/match/options.rb +++ b/lib/match/options.rb @@ -46,7 +46,7 @@ module Match default_value: false), FastlaneCore::ConfigItem.new(key: :team_id, short_option: "-b", - env_name: "MATCH_TEAM_ID", + env_name: "FASTLANE_TEAM_ID", description: "The ID of your team if you're in multiple teams", optional: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id), @@ -55,7 +55,7 @@ module Match end), FastlaneCore::ConfigItem.new(key: :team_name, short_option: "-l", - env_name: "MATCH_TEAM_NAME", + env_name: "FASTLANE_TEAM_NAME", description: "The name of your team if you're in multiple teams", optional: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
Renamed team env variables
fastlane_fastlane
train
rb
76da34adc54fb20f74285e5c1bae4441aaf58e39
diff --git a/lib/ev3/adapter.js b/lib/ev3/adapter.js index <HASH>..<HASH> 100644 --- a/lib/ev3/adapter.js +++ b/lib/ev3/adapter.js @@ -69,6 +69,6 @@ Adapter.prototype.close = function(cb){ var sp = this.serialPort; sp.write(Adapter.commands.TERMINATE, function(){ sp.close(); - cb(); + if(cb) cb(); }) } \ No newline at end of file
fixed problem with Adapter.close() and not specifying callback
hflw_node-robot
train
js
96b6de1ce706b12d8eae6c5b80657127a6300285
diff --git a/packages/react-static/src/browser/components/RouteData.js b/packages/react-static/src/browser/components/RouteData.js index <HASH>..<HASH> 100644 --- a/packages/react-static/src/browser/components/RouteData.js +++ b/packages/react-static/src/browser/components/RouteData.js @@ -53,9 +53,11 @@ const RouteData = withStaticInfo( // Show a spinner and prefetch the data // TODO:suspense - This will become a suspense resource if (shouldLoadData(routeInfo)) { + // To make sure route info will be fetched for 404 pages we should use the returned route info path (if any) instead of the original path + const targetRouteInfoPath = routeInfo ? routeInfo.path : routePath ;(async () => { await Promise.all([ - prefetch(routeInfo.path, { priority: true }), + prefetch(targetRouteInfoPath, { priority: true }), new Promise(resolve => setTimeout(resolve, process.env.REACT_STATIC_MIN_LOAD_TIME) ),
Fix fetching route data for non-preloaded routes (#<I>)
nozzle_react-static
train
js
4d47013a007ca07edbc1af543e3faf28ecbfddb2
diff --git a/tests/Picnik/Requests/Word/AbstractWordRequestTest.php b/tests/Picnik/Requests/Word/AbstractWordRequestTest.php index <HASH>..<HASH> 100644 --- a/tests/Picnik/Requests/Word/AbstractWordRequestTest.php +++ b/tests/Picnik/Requests/Word/AbstractWordRequestTest.php @@ -52,7 +52,7 @@ class AbstractWordRequestTest extends TestCase $r = $this->getAbstractInstance(); $r->useCanonical(); - $this->assertTrue($r->getParameters()['useCanonical']); + $this->assertSame('true', $r->getParameters()['useCanonical']); } public function testUsingCanonicalWithFalseParameter() @@ -60,7 +60,7 @@ class AbstractWordRequestTest extends TestCase $r = $this->getAbstractInstance(); $r->useCanonical(false); - $this->assertFalse($r->getParameters()['useCanonical']); + $this->assertSame('false', $r->getParameters()['useCanonical']); } public function testUsingCanonicalWithNoneBooleanParameter()
Update test case to cover issue #1. - Test cases covering the `useCanonical` method have been updated to ensure that the output parameter is being converted into a string representation of the boolean value. This covers the bug in issue #1.
alanly_picnik
train
php
42359c7e14419ce0a2440c09f309432c1721c461
diff --git a/BAC0/bokeh/BokehServer.py b/BAC0/bokeh/BokehServer.py index <HASH>..<HASH> 100644 --- a/BAC0/bokeh/BokehServer.py +++ b/BAC0/bokeh/BokehServer.py @@ -41,7 +41,7 @@ class BokehServer(Thread): self.task() def startServer(self): - if 'win' in sys.platform: + if 'win32' in sys.platform: commandToExecute = "bokeh.bat serve" else: commandToExecute = "bokeh serve"
MacOS = darwin.... cannot use win in sys.platform to distinguish windows...
ChristianTremblay_BAC0
train
py
76a1a58581081a9fd0f0f042c62b946e44dd064e
diff --git a/src/SyHolloway/MrColor/ExtensionCollection.php b/src/SyHolloway/MrColor/ExtensionCollection.php index <HASH>..<HASH> 100644 --- a/src/SyHolloway/MrColor/ExtensionCollection.php +++ b/src/SyHolloway/MrColor/ExtensionCollection.php @@ -59,12 +59,12 @@ class ExtensionCollection return $result; } - public static function registerExtension(Extension $extension) + public function registerExtension(Extension $extension) { $this->extensions[] = $extension; } - public static function deregisterExtension(Extension $extension) + public function deregisterExtension(Extension $extension) { foreach ($this->extensions as $key => $posext) { //If objects of same class
Remove static keywords from registerExtension and deregisterExtension
syhol_mrcolor
train
php
842b1802d99344f6ce0b0182b1a5b39dd2a5f551
diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -1652,7 +1652,9 @@ class ModelWriteTest extends BaseModelTest { $TestModel->id = 2; $data = array('Tag' => array('Tag' => array(2))); - $TestModel->save($data); + $result = $TestModel->save($data); + + $this->assertEquals($data['Tag'], $result['Tag']); $result = $TestModel->findById(2); $expected = array(
add assert that habtm save does not return false
cakephp_cakephp
train
php
0b1583024906107956ee46463c8ee9e1cd040ec3
diff --git a/html2markdown.py b/html2markdown.py index <HASH>..<HASH> 100644 --- a/html2markdown.py +++ b/html2markdown.py @@ -6,6 +6,10 @@ import bs4 from bs4 import BeautifulSoup import re +import sys +if sys.version_info.major > 2: + unicode = str + _supportedTags = ( # NOTE: will be ignored if they have unsupported attributes (cf. _supportedAttributes) 'blockquote',
WA to provide python 3.x compatibility
dlon_html2markdown
train
py
53b3a357e097e30aa176d8aa3c0cd0431c9a092a
diff --git a/src/Silex/ControllerCollection.php b/src/Silex/ControllerCollection.php index <HASH>..<HASH> 100644 --- a/src/Silex/ControllerCollection.php +++ b/src/Silex/ControllerCollection.php @@ -21,6 +21,18 @@ use Symfony\Component\HttpFoundation\Request; * until flush() is called, at which point all controllers are frozen and * converted to a RouteCollection. * + * __call() forwards method-calls to Route, but returns instance of ControllerCollection + * listing Route's methods below, so that IDEs know they are valid + * + * @method \Silex\ControllerCollection assert(string $variable, string $regexp) + * @method \Silex\ControllerCollection value(string $variable, mixed $default) + * @method \Silex\ControllerCollection convert(string $variable, mixed $callback) + * @method \Silex\ControllerCollection method(string $method) + * @method \Silex\ControllerCollection requireHttp() + * @method \Silex\ControllerCollection requireHttps() + * @method \Silex\ControllerCollection before(mixed $callback) + * @method \Silex\ControllerCollection after(mixed $callback) + * * @author Igor Wiedler <igor@wiedler.ch> * @author Fabien Potencier <fabien@symfony.com> */
Update phpDoc for ControllerCollection
silexphp_Silex
train
php
da99df08b6e778a09601c4cd92b5792b41ed1f1d
diff --git a/tweepy/models.py b/tweepy/models.py index <HASH>..<HASH> 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -52,17 +52,17 @@ class User(Model): self._api.destroy_friendship(user_id=self.id) self.following = False - def lists_memberships(self): - return self._api.lists_memberships(user=self.screen_name) + def lists_memberships(self, *args, **kargs): + return self._api.lists_memberships(user=self.screen_name, *args, **kargs) - def lists_subscriptions(self): - return self._api.lists_subscriptions(user=self.screen_name) + def lists_subscriptions(self, *args, **kargs): + return self._api.lists_subscriptions(user=self.screen_name, *args, **kargs) - def lists(self): - return self._api.lists(user=self.screen_name) + def lists(self, *args, **kargs): + return self._api.lists(user=self.screen_name, *args, **kargs) - def followers_ids(self): - return self._api.followers_ids(user_id=self.id) + def followers_ids(self, *args, **kargs): + return self._api.followers_ids(user_id=self.id, *args, **kargs) class DirectMessage(Model):
Allow for pagination and other parameters for some helper methods in User model. Merged from bwesterb/tweepy @5c7a<I>de1ee<I>fae8c4a1eef<I>c<I>cb<I>e<I>
tweepy_tweepy
train
py
4f13c898d0de73343eae00aed4d200f789dbe64d
diff --git a/test/Query.js b/test/Query.js index <HASH>..<HASH> 100644 --- a/test/Query.js +++ b/test/Query.js @@ -226,6 +226,17 @@ describe('Query', function (){ done(); }); }); + + it('Basic Query on SGI ascending', function (done) { + var Dog = dynamoose.model('Dog'); + + Dog.query('breed').eq('Jack Russell Terrier').ascending().exec(function (err, dogs) { + should.not.exist(err); + dogs.length.should.eql(4); + dogs[0].ownerId.should.eql(1); + done(); + }); + }); it('Basic Query on SGI limit 1', function (done) {
Adding Query.ascending test
dynamoosejs_dynamoose
train
js
2db64e0ce4283142802ace45c2a92c88b237325e
diff --git a/public/javascript/pump.js b/public/javascript/pump.js index <HASH>..<HASH> 100644 --- a/public/javascript/pump.js +++ b/public/javascript/pump.js @@ -2621,11 +2621,10 @@ var Pump = (function(_, $, Backbone) { $.fn.wysihtml5.defaultOptions["customTemplates"] = Pump.wysihtml5Tmpl; }; - Pump.refreshStreams = function() { + Pump.getStreams = function() { - var major, - minor, - content; + var content, + streams = {}; if (Pump.body && Pump.body.content) { if (Pump.body.content.userContent) { @@ -2641,17 +2640,25 @@ var Pump = (function(_, $, Backbone) { if (content) { if (content.majorStreamView) { - major = content.majorStreamView.collection; - major.fetch({update: true, remove: false}); + streams.major = content.majorStreamView.collection; } if (content.minorStreamView) { - minor = content.minorStreamView.collection; - minor.fetch({update: true, remove: false}); + streams.minor = content.minorStreamView.collection; } } - return true; + return streams; + }; + + // Refreshes the current visible streams + + Pump.refreshStreams = function() { + var streams = Pump.getStreams(); + + _.each(streams, function(stream, name) { + stream.fetch({update: true, remove: false}); + }); }; // Our socket.io socket
Make the stream update separate from getting current streams
pump-io_pump.io
train
js
aa8b7941dd40374a1b8abb8a41ad7ba868b399bd
diff --git a/bosh-dev/lib/bosh/dev/vcloud/micro_bosh_deployment_cleaner.rb b/bosh-dev/lib/bosh/dev/vcloud/micro_bosh_deployment_cleaner.rb index <HASH>..<HASH> 100644 --- a/bosh-dev/lib/bosh/dev/vcloud/micro_bosh_deployment_cleaner.rb +++ b/bosh-dev/lib/bosh/dev/vcloud/micro_bosh_deployment_cleaner.rb @@ -11,6 +11,7 @@ module Bosh::Dev::VCloud @env = env @manifest = manifest @logger = Logging.logger(STDERR) + @logger.instance_variable_set(:@logdev, OpenStruct.new(dev: 'fake-dev')) end def clean
Set logger.dev ivar that is expected by vcloud cpi
cloudfoundry_bosh
train
rb
269933d34deb8ac065cd3f5599a97b98a38fa348
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -18,8 +18,10 @@ var getAssertionMessage = function (assert) { var getResultsMessage = function (results) { var failureOutput = ''; - for (var i = 0; i < results.failures.length; i++) { - failureOutput += chalk.red(figures.cross) + ' ' + chalk.dim(results.failures[i].name) + '\n'; + if (results.failures) { + results.failures.forEach(function (failure) { + failureOutput += chalk.red(figures.cross) + ' ' + chalk.dim(failure.name) + '\n'; + }); } var passed = results.pass;
Check for failures and use foreach
Jameskmonger_tap-heart
train
js
624873707630afb8029656b81b96c4254341e876
diff --git a/moco-runner/src/test/java/com/github/dreamhead/moco/MocoWebsocketStandaloneTest.java b/moco-runner/src/test/java/com/github/dreamhead/moco/MocoWebsocketStandaloneTest.java index <HASH>..<HASH> 100644 --- a/moco-runner/src/test/java/com/github/dreamhead/moco/MocoWebsocketStandaloneTest.java +++ b/moco-runner/src/test/java/com/github/dreamhead/moco/MocoWebsocketStandaloneTest.java @@ -92,9 +92,9 @@ public class MocoWebsocketStandaloneTest extends AbstractMocoStandaloneTest { public Endpoint(final URI uri) { try { + clearMessage(); WebSocketContainer container = ContainerProvider.getWebSocketContainer(); container.connectToServer(this, uri); - clearMessage(); } catch (Exception e) { throw new RuntimeException(e); }
fixed endpoint in websocket standalone test
dreamhead_moco
train
java
b5c97668034e455e6e56f037473c7b9da8d8f08a
diff --git a/cliff/commandmanager.py b/cliff/commandmanager.py index <HASH>..<HASH> 100644 --- a/cliff/commandmanager.py +++ b/cliff/commandmanager.py @@ -9,6 +9,18 @@ import pkg_resources LOG = logging.getLogger(__name__) +class EntryPointWrapper(object): + """Wrap up a command class already imported to make it look like a plugin. + """ + + def __init__(self, name, command_class): + self.name = name + self.command_class = command_class + + def load(self): + return self.command_class + + class CommandManager(object): """Discovers commands and handles lookup based on argv data. """ @@ -26,6 +38,9 @@ class CommandManager(object): def __iter__(self): return iter(self.commands.items()) + def add_command(self, name, command_class): + self.commands[name] = EntryPointWrapper(name, command_class) + def find_command(self, argv): """Given an argument list, find a command and return the processor and any remaining arguments. @@ -42,5 +57,5 @@ class CommandManager(object): cmd_factory = cmd_ep.load() return (cmd_factory, name, search_args) else: - raise ValueError('Did not find command processor for %r' % + raise ValueError('Unknown command %r' % (argv,))
provide an internal API for applications to register commands without going through setuptools (used for help handler)
dreamhost_cliff-tablib
train
py
9f33f69ea94a56fed070db7b76c782f34f26f29a
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,6 +20,7 @@ require 'equivalent-xml' require 'equivalent-xml/rspec_matchers' require 'database_cleaner' require 'support/features' +require 'byebug' unless ENV['TRAVIS'] if ENV['COVERAGE'] require 'simplecov'
Require byebug for debugging
samvera_hyrax
train
rb
1e557890d6a0624f7089176ce558d930535ba8da
diff --git a/compliance_checker/cf/cf.py b/compliance_checker/cf/cf.py index <HASH>..<HASH> 100644 --- a/compliance_checker/cf/cf.py +++ b/compliance_checker/cf/cf.py @@ -1487,6 +1487,7 @@ class CFBaseCheck(BaseCheck): valid_dim = True valid_coord = True valid_cdim = True + result = None coords = var.coordinates.split(' ') for coord in coords: @@ -1524,8 +1525,9 @@ class CFBaseCheck(BaseCheck): (valid_in_variables and valid_dim and valid_coord and valid_cdim), \ ('var', name, 'is_reduced_horizontal_grid'), \ reasoning) - - ret_val.append(result) + + if result: + ret_val.append(result) return ret_val
Fixed bug of result referenced before assignment.
ioos_compliance-checker
train
py
41d27922203c31eba88ef60078b5eb0adfc39576
diff --git a/bcbio/pipeline/alignment.py b/bcbio/pipeline/alignment.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/alignment.py +++ b/bcbio/pipeline/alignment.py @@ -60,6 +60,8 @@ def align_to_sort_bam(fastq1, fastq2, aligner, data): else: out_bam = _align_from_fastq(fastq1, fastq2, aligner, data["align_ref"], data["sam_ref"], names, align_dir, data["config"]) + runner = broad.runner_from_config(data["config"]) + runner.run_fn("picard_index", out_bam) return out_bam def _can_pipe(aligner, fastq_file):
Enforce indexing following alignment to avoid multiple index runs at subsequent parallelized steps
bcbio_bcbio-nextgen
train
py
204782006f56d49bbc1ed6d3c857552e9d0e8df6
diff --git a/js/tooltip.js b/js/tooltip.js index <HASH>..<HASH> 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -366,7 +366,7 @@ this.locateTip(); // Additional tab/focus handlers for non-inline items - if (this.settings.container) { + if (this.settings.container && this.isDialog) { this._focuser = new CFW_Focuser({ element: this.$target[0], autoFocus: false,
Tooltip: Adjust focus handling for items using container option (#<I>)
cast-org_figuration
train
js
199f5f7878062ca17a98e079f2dbe1205e2ed898
diff --git a/lz4.go b/lz4.go index <HASH>..<HASH> 100644 --- a/lz4.go +++ b/lz4.go @@ -6,6 +6,7 @@ package lz4 import "C" import ( + "errors" "fmt" "unsafe" ) @@ -25,14 +26,12 @@ func clen(s []byte) C.int { // Uncompress with a known output size. len(out) should be equal to // the length of the uncompressed out. -func Uncompress(in, out []byte) (err error) { - read := int(C.LZ4_uncompress(p(in), p(out), clen(out))) - - if read != len(in) { - err = fmt.Errorf("uncompress read %d bytes should have read %d", - read, len(in)) +func Uncompress(in, out []byte) (error) { + if int(C.LZ4_decompress_safe(p(in), p(out), clen(in), clen(out))) < 0 { + return errors.New("Malformed compression stream") } - return + + return nil } // CompressBound calculates the size of the output buffer needed by
Use LZ4_decompress_safe instead of LZ4_uncompress LZ4_uncompress is deprecated and has security problems.
cloudflare_golz4
train
go
9fc357c1fe09962d5cf8f206b6dfe4be3a85bec6
diff --git a/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java b/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java +++ b/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionOptimistic.java @@ -304,6 +304,9 @@ public class OTransactionOptimistic extends OTransactionRealAbstract { case ORecordOperation.UPDATED: database.executeSaveRecord(iRecord, iClusterName, iRecord.getRecordVersion(), iRecord.getRecordType(), false, OPERATION_MODE.SYNCHRONOUS, false, null, null); + final ORecordOperation txRecord = getRecordEntry(iRecord.getIdentity()); + if (txRecord != null) + txRecord.record = iRecord; break; case ORecordOperation.DELETED: database.executeDeleteRecord(iRecord, iRecord.getRecordVersion(), false, false, OPERATION_MODE.SYNCHRONOUS, false);
Record duplication warning in TX was fixed.
orientechnologies_orientdb
train
java
0116f45c7f7b369ef1c54f2680e44eae69917cd5
diff --git a/spyderlib/widgets/tabs.py b/spyderlib/widgets/tabs.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/tabs.py +++ b/spyderlib/widgets/tabs.py @@ -128,6 +128,7 @@ class BaseTabs(QTabWidget): icon=get_icon("browse_tab.png"), tip=_("Browse tabs")) self.browse_tabs_menu = QMenu(self) + self.browse_tabs_menu.setStyleSheet('font-size:8pt;') self.browse_button.setMenu(self.browse_tabs_menu) self.browse_button.setPopupMode(self.browse_button.InstantPopup) self.connect(self.browse_tabs_menu, SIGNAL("aboutToShow()"), @@ -139,6 +140,7 @@ class BaseTabs(QTabWidget): def update_browse_tabs_menu(self): """Update browse tabs menu""" self.browse_tabs_menu.clear() + self.browse_tabs_menu.setStyleSheet('font-size:8pt;') names = [] dirnames = [] for index in range(self.count()):
The tabs on my MBP Retina are enormous. This makes them smaller (similar to Spyder on Windows).
spyder-ide_spyder
train
py
b63aee5a1cbeb07ba28ae35adc4902339c348ccd
diff --git a/nap-www/napwww/lib/base.py b/nap-www/napwww/lib/base.py index <HASH>..<HASH> 100644 --- a/nap-www/napwww/lib/base.py +++ b/nap-www/napwww/lib/base.py @@ -17,26 +17,20 @@ class BaseController(WSGIController): requires_auth = True - def __init__(self): - """ Constructor - - Currently only deals with the authentication options. + + def __before__(self): + """ Perform actions before action method is invoked. + Deals with authentication. """ # set authentication options o = AuthOptions( { 'username': session.get('user'), - 'authoritative_source': 'nipap_www' + 'authoritative_source': 'nipap' }) - - def __before__(self): - """ Perform actions before action method is invoked. - Deals with authentication. - """ - # verify that user is logged in if self.requires_auth and 'user' not in session: log.error(self.requires_auth)
Moved auth options to __before__ method I really need to look up whether objects of controller classes are created for each request or if they are reused...
SpriteLink_NIPAP
train
py
b66e0db8ec77a0dca9908a17e6ea7fb42fd54db7
diff --git a/lib/cfoundry/version.rb b/lib/cfoundry/version.rb index <HASH>..<HASH> 100644 --- a/lib/cfoundry/version.rb +++ b/lib/cfoundry/version.rb @@ -1,4 +1,4 @@ module CFoundry # :nodoc: # CFoundry library version number. - VERSION = "0.7.0.rc6".freeze + VERSION = "0.7.0.rc7".freeze end
Bump to <I>.rc7
cloudfoundry-attic_cfoundry
train
rb
1f718e2a2382ea47759b96c94e9297ca45fe3c76
diff --git a/src/Factories/Entity/Host.php b/src/Factories/Entity/Host.php index <HASH>..<HASH> 100644 --- a/src/Factories/Entity/Host.php +++ b/src/Factories/Entity/Host.php @@ -76,6 +76,13 @@ class Host extends AbstractEntity public $publicEndpoints; /** + * List of instances on host + * + * @var array + */ + public $instanceIds; + + /** * The labels on a host. * * @var string[] diff --git a/src/Factories/Entity/Service.php b/src/Factories/Entity/Service.php index <HASH>..<HASH> 100644 --- a/src/Factories/Entity/Service.php +++ b/src/Factories/Entity/Service.php @@ -120,5 +120,12 @@ class Service extends AbstractEntity * @var string */ public $transitioningProgress; - + + /** + * List of instances for the service + * + * @var array + */ + public $instanceIds; + } \ No newline at end of file
Add `instanceId` property to Service and Host
benmag_laravel-rancher
train
php,php
0091908f6c5d83b42607ca2e8b81833de69889d8
diff --git a/anpy/dossier_from_opendata.py b/anpy/dossier_from_opendata.py index <HASH>..<HASH> 100644 --- a/anpy/dossier_from_opendata.py +++ b/anpy/dossier_from_opendata.py @@ -149,7 +149,10 @@ def download_open_data_doslegs(legislature): ), } filename, file_url = files[legislature] - return convert_dossiers_open_data_file(download_open_data_file(filename, file_url)) + data = download_open_data_file(filename, file_url) + if filename is None: + data = convert_dossiers_open_data_file(data) + return data def an_text_url(identifiant, code):
[opendata] fix regression introduced by previous commit <I>a<I>a<I>d<I>f0c<I>e<I>e<I>f6 the <I>th legislature dosleg open-data was converted even if that's not needed
regardscitoyens_anpy
train
py
6f213b2df678c9deffc5328401bd4c87440633ec
diff --git a/lib/yamlish.js b/lib/yamlish.js index <HASH>..<HASH> 100644 --- a/lib/yamlish.js +++ b/lib/yamlish.js @@ -48,6 +48,7 @@ function encode (obj, indent) { var spaces = new Array(maxLength + 1).join(" ") + indent += " " return "\n" + indent + keys.map(function (k, i) { var niceKey = niceKeys[i] return niceKey + spaces.substr(niceKey.length)
Objects should be indented
tapjs_node-tap
train
js
6126e9caa12f5f11c8a0cd22be8019cf43afb6b5
diff --git a/log.js b/log.js index <HASH>..<HASH> 100644 --- a/log.js +++ b/log.js @@ -1,4 +1,5 @@ -var assert = require('assert'); +const assert = require('assert'); +const MESSAGE = Symbol.for('message'); module.exports = function (options) { options = options || {}; @@ -29,7 +30,7 @@ module.exports = function (options) { message: 'foo' }; - info.raw = JSON.stringify(info); + info[MESSAGE] = JSON.stringify(info); var result = instance.log(info); assert(true, result); }); @@ -40,7 +41,7 @@ module.exports = function (options) { message: 'foo' }; - info.raw = JSON.stringify(info); + info[MESSAGE] = JSON.stringify(info); var result = instance.log(info, function () { assert(true, result); done(); @@ -57,7 +58,7 @@ module.exports = function (options) { message: 'foo' }; - info.raw = JSON.stringify(info); + info[MESSAGE] = JSON.stringify(info); instance.log(info); }); });
[fix minor] Migrate support to `info[MESSAGE]`.
winstonjs_abstract-winston-transport
train
js
4d737081a059fa20c1331aae19785305ee2c368f
diff --git a/lib/slidercalc.js b/lib/slidercalc.js index <HASH>..<HASH> 100644 --- a/lib/slidercalc.js +++ b/lib/slidercalc.js @@ -50,6 +50,7 @@ exports.getEndPoint = function (sliderType, sliderLength, points) { case 'pass-through': if (!points || points.length < 2) { return undefined; } if (points.length == 2) { return pointOnLine(points[0], points[1], sliderLength); } + if (points.length > 3) { return exports.getEndPoint('bezier', sliderLength, points); } var p1 = points[0]; var p2 = points[1];
use bezier to compute endpoint if pass-through have more than 3 points
nojhamster_osu-parser
train
js
f9de807dc1f89e5a20398ca9c796c722296e0c2e
diff --git a/src/LdapClient.php b/src/LdapClient.php index <HASH>..<HASH> 100644 --- a/src/LdapClient.php +++ b/src/LdapClient.php @@ -617,12 +617,17 @@ class LdapClient /** * Returns the error message * - * @return string error message + * @return string * * @since 1.0 */ public function getErrorMsg() { + if (!$this->isBound || !$this->isConnected()) + { + return ''; + } + return @ldap_error($this->resource); } @@ -720,7 +725,9 @@ class LdapClient 'TCP6', 'Reserved (12)', 'URL', - 'Count'); + 'Count' + ); + $len = strlen($networkaddress); if ($len > 0) @@ -757,7 +764,7 @@ class LdapClient * @param string $password Clear text password to encrypt * @param string $type Type of password hash, either md5 or SHA * - * @return string Encrypted password + * @return string * * @since 1.0 */
Check for connection on get error, codestyle
joomla-framework_ldap
train
php
ad1f6b5376a0668342fb658d85e9050e633f1db7
diff --git a/easybatch-core/src/main/java/io/github/benas/easybatch/core/impl/NoOpRecordReader.java b/easybatch-core/src/main/java/io/github/benas/easybatch/core/impl/NoOpRecordReader.java index <HASH>..<HASH> 100644 --- a/easybatch-core/src/main/java/io/github/benas/easybatch/core/impl/NoOpRecordReader.java +++ b/easybatch-core/src/main/java/io/github/benas/easybatch/core/impl/NoOpRecordReader.java @@ -37,7 +37,8 @@ class NoOpRecordReader implements RecordReader { /** * {@inheritDoc} */ - public void open() { } + public void open() { + } /** * {@inheritDoc} @@ -68,6 +69,7 @@ class NoOpRecordReader implements RecordReader { /** * {@inheritDoc} */ - public void close() { } + public void close() { + } }
[sonar] fix sonar issue : Right curly braces should be located at the beginning of lines of code
j-easy_easy-batch
train
java
cb863956886762c0d85f0e8d2989dd2d84d7bd45
diff --git a/scripts/addCaseToAssessments.js b/scripts/addCaseToAssessments.js index <HASH>..<HASH> 100644 --- a/scripts/addCaseToAssessments.js +++ b/scripts/addCaseToAssessments.js @@ -119,7 +119,6 @@ module.exports = function(file, api, options) { } }); if (index > -1) { - console.log(index); funcExp.value.params.splice(index, 1); } })
Remove console.log from addCaseToAssessments script.
quailjs_quail
train
js
58cf5686eab9019cc01e202e846a6bbc70a3301d
diff --git a/params/version.go b/params/version.go index <HASH>..<HASH> 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 10 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 10 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string.
params: release Geth <I>
ethereum_go-ethereum
train
go
fa91dad2cb6d25ff263fc34d3e9fbdbaeeb150fe
diff --git a/tests/Feature/BuilderTest.php b/tests/Feature/BuilderTest.php index <HASH>..<HASH> 100644 --- a/tests/Feature/BuilderTest.php +++ b/tests/Feature/BuilderTest.php @@ -63,6 +63,30 @@ class BuilderTest extends TestCase $this->assertSame(15, $paginator->perPage()); } + public function test_it_can_paginate_raw_without_custom_query_callback() + { + $this->prepareScoutSearchMockUsing('Laravel'); + + $paginator = SearchableUserModel::search('Laravel')->paginateRaw(); + + $this->assertSame(50, $paginator->total()); + $this->assertSame(4, $paginator->lastPage()); + $this->assertSame(15, $paginator->perPage()); + } + + public function test_it_can_paginate_raw_with_custom_query_callback() + { + $this->prepareScoutSearchMockUsing('Laravel'); + + $paginator = SearchableUserModel::search('Laravel')->query(function ($builder) { + return $builder->where('id', '<', 11); + })->paginateRaw(); + + $this->assertSame(10, $paginator->total()); + $this->assertSame(1, $paginator->lastPage()); + $this->assertSame(15, $paginator->perPage()); + } + protected function prepareScoutSearchMockUsing($searchQuery) { $engine = m::mock('MeiliSearch\Client');
Added tests for paginateRaw (#<I>)
laravel_scout
train
php
01ff8952ab66b72c737960f3f8c369011c9d31fb
diff --git a/tools/harness-thci/OpenThread.py b/tools/harness-thci/OpenThread.py index <HASH>..<HASH> 100644 --- a/tools/harness-thci/OpenThread.py +++ b/tools/harness-thci/OpenThread.py @@ -3219,7 +3219,7 @@ class OpenThreadTHCI(object): return dua def __addDefaultDomainPrefix(self): - self.configBorderRouter(P_dp=1, P_slaac_preferred=1, P_stable=1, P_on_mesh=1, P_default=1) + self.configBorderRouter(P_dp=1, P_stable=1, P_on_mesh=1, P_default=1) def __setDUA(self, sDua): """specify the DUA before Thread Starts."""
[thci] do not set `P_slaac` flag for Domain prefix (#<I>) According to the Thread Specification the `P_slaac` flag should be set to false for the Domain prefix.
openthread_openthread
train
py
4884d9c17d7d53a613e866ad0bf30425abec3951
diff --git a/lib/neography/index.rb b/lib/neography/index.rb index <HASH>..<HASH> 100644 --- a/lib/neography/index.rb +++ b/lib/neography/index.rb @@ -27,7 +27,7 @@ module Neography if self.inspect == "Neography::Node" nodes = [] - results = args.size > 1 ? db.find_node_index(*args) : db.get_node_index(*args) + results = db.find_node_index(*args) return nil unless results results.each do |r| node = self.new(r) @@ -37,7 +37,7 @@ module Neography nodes.size > 1 ? nodes : nodes.first else rels = [] - results = args.size > 1 ? db.find_relationship_index(*args) : db.get_relationship_index(*args) + results = db.find_relationship_index(*args) return nil unless results results.each do |r| rel = self.new(r, db)
need another method for find_exact
maxdemarzi_neography
train
rb
1196223d9e33a583c9cea1dcc5e2ae40f7d3eb8e
diff --git a/service/server/host/src/main/java/com/emc/pravega/service/server/host/ServiceStarter.java b/service/server/host/src/main/java/com/emc/pravega/service/server/host/ServiceStarter.java index <HASH>..<HASH> 100644 --- a/service/server/host/src/main/java/com/emc/pravega/service/server/host/ServiceStarter.java +++ b/service/server/host/src/main/java/com/emc/pravega/service/server/host/ServiceStarter.java @@ -7,6 +7,7 @@ package com.emc.pravega.service.server.host; import com.emc.pravega.common.Exceptions; import com.emc.pravega.common.cluster.Host; +import com.emc.pravega.common.metrics.MetricsConfig; import com.emc.pravega.common.metrics.MetricsProvider; import com.emc.pravega.common.metrics.StatsProvider; import com.emc.pravega.service.contracts.StreamSegmentStore; @@ -89,6 +90,7 @@ public final class ServiceStarter { Exceptions.checkNotClosed(this.closed, this); log.info("Initializing metrics provider ..."); + MetricsProvider.initialize(builderConfig.getConfig(MetricsConfig::new)); statsProvider = MetricsProvider.getMetricsProvider(); statsProvider.start();
Missed initialization in ServiceStarter (#<I>)
pravega_pravega
train
java
6205a9a6cb23fcb60b759aab553f2f53822f8f60
diff --git a/etcdserver/stats/server.go b/etcdserver/stats/server.go index <HASH>..<HASH> 100644 --- a/etcdserver/stats/server.go +++ b/etcdserver/stats/server.go @@ -123,17 +123,11 @@ func (ss *ServerStats) SendAppendReq(reqSize int) { ss.Lock() defer ss.Unlock() - now := time.Now() - - if ss.State != raft.StateLeader { - ss.State = raft.StateLeader - ss.LeaderInfo.Name = ss.ID - ss.LeaderInfo.StartTime = now - } + ss.becomeLeader() ss.sendRateQueue.Insert( &RequestStats{ - SendingTime: now, + SendingTime: time.Now(), Size: reqSize, }, ) @@ -144,7 +138,10 @@ func (ss *ServerStats) SendAppendReq(reqSize int) { func (ss *ServerStats) BecomeLeader() { ss.Lock() defer ss.Unlock() + ss.becomeLeader() +} +func (ss *ServerStats) becomeLeader() { if ss.State != raft.StateLeader { ss.State = raft.StateLeader ss.LeaderInfo.Name = ss.ID
etcdserver: stats/server - refactored removed code duplicacy and improved readability #<I>
etcd-io_etcd
train
go
30cdd7e7257b95ac87f502adf86f876a40b77e6f
diff --git a/test/regtests/forwardcurve_regtests.py b/test/regtests/forwardcurve_regtests.py index <HASH>..<HASH> 100644 --- a/test/regtests/forwardcurve_regtests.py +++ b/test/regtests/forwardcurve_regtests.py @@ -1,7 +1,7 @@ from regtest import RegressionTestCase -from dcf.curves.forwardcurves import ForwardCurve +from dcf.curves.curve import ForwardCurve class ForwardCurveRegTests(RegressionTestCase): diff --git a/test/unittests/forwardcurve_tests.py b/test/unittests/forwardcurve_tests.py index <HASH>..<HASH> 100755 --- a/test/unittests/forwardcurve_tests.py +++ b/test/unittests/forwardcurve_tests.py @@ -12,7 +12,7 @@ from unittest import TestCase -from dcf.curves.forwardcurves import ForwardCurve +from dcf.curves.curve import ForwardCurve from dcf.curves.interestratecurve import ZeroRateCurve
* added more ForwardCurve tests
pbrisk_dcf
train
py,py
89a463a57aa94515a3d35caa1880d7c4c14d986a
diff --git a/lib/settings.rb b/lib/settings.rb index <HASH>..<HASH> 100644 --- a/lib/settings.rb +++ b/lib/settings.rb @@ -1,5 +1,5 @@ class Settings < ActiveRecord::Base - @@defaults = (defined?(SettingsDefaults) ? SettingsDefaults::DEFAULTS : {}).with_indifferent_access + # @@defaults = (defined?(SettingsDefaults) ? SettingsDefaults::DEFAULTS : {}).with_indifferent_access class SettingNotFound < RuntimeError; end @@ -44,6 +44,9 @@ class Settings < ActiveRecord::Base #retrieve a setting value by [] notation def self.[](var_name) + #Ensure defaults are loaded + @@defaults ||= (defined?(SettingsDefaults) ? SettingsDefaults::DEFAULTS : {}).with_indifferent_access + #retrieve a setting var_name = var_name.to_s
[Settings] Rolled patch from Diego Algorta Casamayou that makes defaults work properly. git-svn-id: <URL>
ledermann_rails-settings
train
rb
180f3d8250a54ad7fecfdf897293637f603b24a9
diff --git a/media/js/gmap.js b/media/js/gmap.js index <HASH>..<HASH> 100755 --- a/media/js/gmap.js +++ b/media/js/gmap.js @@ -288,6 +288,12 @@ function initialize() { $( "#view-radio" ).buttonset(); + document.getElementById('radio1').checked=true; + document.getElementById('radio2').checked=false; + document.getElementById('radio3').checked=false; + document.getElementById('radio4').checked=false; + $("#view-radio").buttonset("refresh"); + /* Type an address and go to that address on the map */ $('#search-address').bind('keypress', function(e) {
now the buttonset is ALWAYS initially set to Map
ninuxorg_nodeshot
train
js
e8b8f83f126c2b715e8ee3df2e432b3b7a64c853
diff --git a/compiler/natives/src/math/math.go b/compiler/natives/src/math/math.go index <HASH>..<HASH> 100644 --- a/compiler/natives/src/math/math.go +++ b/compiler/natives/src/math/math.go @@ -7,10 +7,10 @@ import ( ) var math = js.Global.Get("Math") -var zero float64 = 0 -var posInf = 1 / zero -var negInf = -1 / zero -var nan = 0 / zero +var _zero float64 = 0 +var posInf = 1 / _zero +var negInf = -1 / _zero +var nan = 0 / _zero func Acos(x float64) float64 { return math.Call("acos", x).Float()
Fix math package conflict with natives introduced in Go <I>. math.FMA() implementation introduced a non-exported function zero(), which conflicted with out own variable. Resolved the conflict by renaming our variable. Original commit by @visualfc: <URL>
gopherjs_gopherjs
train
go
ca3395c587e15bb3e078760813f9fc7b8dcebbcd
diff --git a/src/scripts/utils/request.js b/src/scripts/utils/request.js index <HASH>..<HASH> 100644 --- a/src/scripts/utils/request.js +++ b/src/scripts/utils/request.js @@ -26,6 +26,7 @@ var Request = { handleRequest(path, options, function (path, options) { request.post(config.scitran.url + path) .set(options.headers) + .query(options.query) .send(options.body) .end(function (err, res) { handleResponse(err, res, callback);
added query params to POSTs
OpenNeuroOrg_openneuro
train
js
d2f6122e3442aa9155d342658fd1fce1f1537206
diff --git a/resources/lang/en-US/cachet.php b/resources/lang/en-US/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/en-US/cachet.php +++ b/resources/lang/en-US/cachet.php @@ -33,6 +33,7 @@ return [ 'scheduled' => 'Scheduled Maintenance', 'scheduled_at' => ', scheduled :timestamp', 'posted' => 'Posted :timestamp', + 'posted_at' => 'Posted at :timestamp', 'status' => [ 1 => 'Investigating', 2 => 'Identified',
New translations cachet.php (English)
CachetHQ_Cachet
train
php
5c3a5f9e8b1cc90b51d91bf1e2034f10ef8612c2
diff --git a/src/Tabs/Tabs.js b/src/Tabs/Tabs.js index <HASH>..<HASH> 100644 --- a/src/Tabs/Tabs.js +++ b/src/Tabs/Tabs.js @@ -17,6 +17,12 @@ export class Tabs extends React.PureComponent { }; } + UNSAFE_componentWillReceiveProps(nextProps) { + if (nextProps.selectedIndex !== this.props.selectedIndex) { + this.setState({ "selectedIndex": nextProps.selectedIndex }); + } + } + _setSelectedIndex = (index, event) => { this.setState({ "selectedIndex": index });
Adding cwrp to Tabs.js
DigitalRiver_react-atlas
train
js
5c4c0e1494f8f10bc7f783bd7f56ab2f1228831a
diff --git a/plugins/inputs/zookeeper/zookeeper.go b/plugins/inputs/zookeeper/zookeeper.go index <HASH>..<HASH> 100644 --- a/plugins/inputs/zookeeper/zookeeper.go +++ b/plugins/inputs/zookeeper/zookeeper.go @@ -17,7 +17,7 @@ import ( "github.com/influxdata/telegraf/plugins/inputs" ) -var zookeeperFormatRE = regexp.MustCompile(`^zk_(\w+)\s+([\w\.\-]+)`) +var zookeeperFormatRE = regexp.MustCompile(`^zk_(\w[\w\.\-]*)\s+([\w\.\-]+)`) // Zookeeper is a zookeeper plugin type Zookeeper struct {
improve mntr regex to match user specific keys. (#<I>) * improve mntr regex to match user specific keys. * Update plugins/inputs/zookeeper/zookeeper.go
influxdata_telegraf
train
go
e800a3854f234a034906a6d8ad60b9c33cf829f0
diff --git a/src/unity/python/turicreate/test/test_json.py b/src/unity/python/turicreate/test/test_json.py index <HASH>..<HASH> 100644 --- a/src/unity/python/turicreate/test/test_json.py +++ b/src/unity/python/turicreate/test/test_json.py @@ -23,6 +23,7 @@ import math import os import pandas import pytz +import six import string import sys import unittest @@ -110,11 +111,11 @@ class JSONTest(unittest.TestCase): def _assertEqual(self, x, y): if type(x) in [long,int]: self.assertTrue(type(y) in [long,int]) - elif type(x) in [str, unicode]: - self.assertTrue(type(y) in [str,unicode]) + elif isinstance(x, six.string_types): + self.assertTrue(isinstance(y, six.string_types)) else: self.assertEqual(type(x), type(y)) - if isinstance(x, (str, unicode)): + if isinstance(x, six.string_types): self.assertEqual(str(x), str(y)) elif isinstance(x, SArray): _SFrameComparer._assert_sarray_equal(x, y)
Fix test_json.py failure in Python 3 (#<I>) The test for `(str, unicode)` should be done instead using `six.string_types` since there is no `unicode` type in Python 3.
apple_turicreate
train
py
7902fda7adbaadd18d207f1d93610c00dc63a3ce
diff --git a/tcases-lib/src/main/java/org/cornutum/tcases/Tcases.java b/tcases-lib/src/main/java/org/cornutum/tcases/Tcases.java index <HASH>..<HASH> 100755 --- a/tcases-lib/src/main/java/org/cornutum/tcases/Tcases.java +++ b/tcases-lib/src/main/java/org/cornutum/tcases/Tcases.java @@ -890,7 +890,7 @@ public class Tcases if( testDefFile == null && inputDefFile != null) { // No, derive default from input file. - testDefFile = new File( inputDir, projectName + "-Test.xml"); + testDefFile = new File( projectName + "-Test.xml"); } // Identify base test definition file. @@ -910,7 +910,7 @@ public class Tcases outputFile = // ... JUnit test class file, if generating JUnit options.isJUnit() && inputDefFile != null - ? new File( inputDir, projectName.replaceAll( "\\W+", "") + "Test.java") + ? new File( projectName.replaceAll( "\\W+", "") + "Test.java") // ... else test definition file. : testDefFile;
For test def and output file, default must be relative paths that can later apply properly to the appropriate parent dirs
Cornutum_tcases
train
java
6dd89d30b03370da91451eaac3e3d422bdb38616
diff --git a/lxd/instance/drivers/driver_lxc.go b/lxd/instance/drivers/driver_lxc.go index <HASH>..<HASH> 100644 --- a/lxd/instance/drivers/driver_lxc.go +++ b/lxd/instance/drivers/driver_lxc.go @@ -5594,6 +5594,8 @@ func (d *lxc) Console(protocol string) (*os.File, chan error, error) { cmd.Process.Kill() }() + d.state.Events.SendLifecycle(d.project, lifecycle.InstanceConsole.Event(d, log.Ctx{"type": instance.ConsoleTypeConsole})) + return ptx, chDisconnect, nil }
lxd/instance/drivers/driver/lxc: handle Console lifecycle events
lxc_lxd
train
go
aee4c16f629aded7281e268e5f684bad5105da89
diff --git a/Fields/IntField.php b/Fields/IntField.php index <HASH>..<HASH> 100644 --- a/Fields/IntField.php +++ b/Fields/IntField.php @@ -14,6 +14,11 @@ class IntField extends NumberField */ protected $type = 'number'; + public function __construct() + { + $this->setAttribute('step', '1'); + } + public function check() { if (!$this->required && !$this->value) { diff --git a/Fields/NumberField.php b/Fields/NumberField.php index <HASH>..<HASH> 100644 --- a/Fields/NumberField.php +++ b/Fields/NumberField.php @@ -23,6 +23,11 @@ class NumberField extends Field * Maximum value */ protected $max = null; + + public function __construct() + { + $this->setAttribute('step', 'any'); + } public function __sleep() {
Number default step is now any, Int default step is now 1
Gregwar_Formidable
train
php,php
556b6ec22c94c5791cb9dc60b2e2c801ccb552f2
diff --git a/src/connection/enterprise/actions.js b/src/connection/enterprise/actions.js index <HASH>..<HASH> 100644 --- a/src/connection/enterprise/actions.js +++ b/src/connection/enterprise/actions.js @@ -39,7 +39,8 @@ export function logIn(id) { return logInSSO(id, ssoConnection); } - logInAD(id, findADConnectionWithoutDomain(m)); + // TODO: should we call this corporateConnection? + logInAD(id, enterpriseConnection(m)); } export function logInHRD(id, connection = undefined) {
Fix connection selection for enterprise user/pass
auth0_lock
train
js
5e20a3bd89bba1973e551c8c89c74cca4fa166f0
diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index <HASH>..<HASH> 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -186,6 +186,9 @@ class IntegrationTest extends GatewayTestCase $this->assertEquals('Transaction is approved.', $statusResponse->getMessage()); } + /** + * Test an Authorize message that also create's a card in FAC's system from the data in the authorize message. + */ public function testAuthorizeWithCreateCard() { $transactionId = uniqid();
Added some missing documentation in the integration test class.
Strikewood_omnipay-first-atlantic-commerce
train
php
d0ba3858d0604fd81c186963099edec5e6e9145b
diff --git a/dipper/models/GenomicFeature.py b/dipper/models/GenomicFeature.py index <HASH>..<HASH> 100644 --- a/dipper/models/GenomicFeature.py +++ b/dipper/models/GenomicFeature.py @@ -35,7 +35,7 @@ class Feature(): 'is_about': 'IAO:00000136', 'has_subsequence': 'RO:0002524', 'is_subsequence_of': 'RO:0002525', - 'has_staining_intensity': 'GENO:0000626', + 'has_staining_intensity': 'GENO:0000207', # was GENO:0000626 (staining_intensity), but changing to has_sequence_attribute 'upstream_of_sequence_of': 'RO:0002528', 'downstream_of_sequence_of': 'RO:0002529'
replace has_staining_intensity --> has_sequence_attribute OP curie * GENO was refactored, and has_staining_intensity (GENO:<I>) was deprecated. this concept was directed to be replaced by has_sequence_attribute (GENO:<I>). leaving the dictionary key the same, but changing the value of the ontology term it is mapped to. * addresses #<I>
monarch-initiative_dipper
train
py
e095585356e9fedafb729ef64f8b26f5a1453aba
diff --git a/master/buildbot/status/web/baseweb.py b/master/buildbot/status/web/baseweb.py index <HASH>..<HASH> 100644 --- a/master/buildbot/status/web/baseweb.py +++ b/master/buildbot/status/web/baseweb.py @@ -406,8 +406,8 @@ class WebStatus(service.MultiService): # this will be replaced once we've been attached to a parent (and # thus have a basedir and can reference BASEDIR) root = static.Data("placeholder", "text/plain") - #httplog = os.path.abspath(os.path.join(self.master.basedir, "http.log")) - self.site = server.Site(root) #RotateLogSite(root, logPath=httplog) + httplog = os.path.abspath(os.path.join(self.master.basedir, "http.log")) + self.site = RotateLogSite(root, logPath=httplog) # the following items are accessed by HtmlResource when it renders # each page.
revert debugging change, accidentally committed
buildbot_buildbot
train
py
8d693dea33e1f004c68da1e942187f945bf19499
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -576,7 +576,12 @@ class State(object): ''' Execute the aggregation systems to runtime modify the low chunk ''' - if self.functions['config.option']('mod_aggregate') and not low.get('__agg__'): + agg_opt = self.functions['config.option']('mod_aggregate') + if agg_opt is True: + agg_opt = [low['state']] + else: + return low + if low['state'] in agg_opt and not low.get('__agg__'): agg_fun = '{0}.mod_aggregate'.format(low['state']) if agg_fun in self.states: try:
Make mod_aggregate more flexible to configure
saltstack_salt
train
py
517f656c618a8e7e8d86281d618ea3980c41f521
diff --git a/classes/ezperflogger.php b/classes/ezperflogger.php index <HASH>..<HASH> 100644 --- a/classes/ezperflogger.php +++ b/classes/ezperflogger.php @@ -599,6 +599,7 @@ class eZPerfLogger implements eZPerfLoggerProvider, eZPerfLoggerLogger, eZPerfLo self::$timeAccumulatorList[$val]['count'] = self::$timeAccumulatorList[$val]['count'] + 1; } $thisTime = $stopTime - self::$timeAccumulatorList[$val]['temp_time']; + unset( self::$timeAccumulatorList[$val]['temp_time'] ); self::$timeAccumulatorList[$val]['time'] = $thisTime + self::$timeAccumulatorList[$val]['time']; if ( $thisTime > self::$timeAccumulatorList[$val]['maxtime'] ) {
shave off a bit of ram when measuring time; will now generate a php warning when calling stop() without a previous start()
gggeek_ezperformancelogger
train
php
12c681f9c3637638f3bc36fde67b2c4d01216d12
diff --git a/tests/DSQ/Expression/BasicExpressionTest.php b/tests/DSQ/Expression/BasicExpressionTest.php index <HASH>..<HASH> 100644 --- a/tests/DSQ/Expression/BasicExpressionTest.php +++ b/tests/DSQ/Expression/BasicExpressionTest.php @@ -10,7 +10,6 @@ namespace DSQ\Test\Expression; use DSQ\Expression\BasicExpression; -use DSQ\Lucene\BasicLuceneExpression; /** * Unit tests for class FirstClass @@ -44,18 +43,4 @@ class BasicExpressionTest extends \PHPUnit_Framework_TestCase $this->assertEquals('bad-type', $this->expression->getType()); } - - public function testEscapeDoNothingOnLuceneExpressions() - { - $expr = new BasicLuceneExpression('foo'); - - $this->assertEquals($expr, BasicLuceneExpression::escape($expr)); - } - - public function testEscapePhraseDoNothingOnLuceneExpressions() - { - $expr = new BasicLuceneExpression('foo'); - - $this->assertEquals($expr, BasicLuceneExpression::escape_phrase($expr)); - } } \ No newline at end of file
Now basic expression escapes values when converting to string.
nicmart_DSQExpression
train
php
fd9a20ac8101e1e7b815f6495679f9f33faa5163
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/FindBugsMessageFormat.java b/findbugs/src/java/edu/umd/cs/findbugs/FindBugsMessageFormat.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/FindBugsMessageFormat.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/FindBugsMessageFormat.java @@ -97,7 +97,14 @@ public class FindBugsMessageFormat { result.append("?>?" + fieldNum + "/" + args.length + "???"); } else { BugAnnotation field = args[fieldNum]; - result.append(field.format(key)); + String formatted = ""; + try { formatted = field.format(key); + } catch (IllegalArgumentException iae) { + // unknown key -- not unprecedented when reading xml generated by older versions of findbugs + formatted = "\u00BF"+fieldNum+".(key="+key+")?"; // "\u00BF" is inverted question mark + System.err.println(iae.getMessage()+" in FindBugsMessageFormat"); // FIXME: log this error better + } + result.append(formatted); } pat = pat.substring(end + 1);
unknown key was leaving gui in a bad state git-svn-id: <URL>
spotbugs_spotbugs
train
java
97150c055dd5a3a54fede1e2a22d569d2430e0f2
diff --git a/Consumption/QueueConsumer.php b/Consumption/QueueConsumer.php index <HASH>..<HASH> 100644 --- a/Consumption/QueueConsumer.php +++ b/Consumption/QueueConsumer.php @@ -190,7 +190,7 @@ class QueueConsumer throw new ConsumptionInterruptedException(); } - if ($message = $consumer->receive($timeout = 1)) { + if ($message = $consumer->receive($timeout = 5000)) { $logger->info('Message received'); $logger->debug('Headers: {headers}', ['headers' => new VarExport($message->getHeaders())]); $logger->debug('Properties: {properties}', ['properties' => new VarExport($message->getProperties())]);
[consumption][bug] Receive timeout is in miliseconds. Set it to <I>. Five sec.
php-enqueue_enqueue
train
php
7008cd3b479bd19700a5b676d569cfd4f77f5622
diff --git a/salt/transport/__init__.py b/salt/transport/__init__.py index <HASH>..<HASH> 100644 --- a/salt/transport/__init__.py +++ b/salt/transport/__init__.py @@ -2,7 +2,7 @@ ''' Encapsulate the different transports available to Salt. Currently this is only ZeroMQ. ''' -from __future__ import absolute_import +from __future__ import absolute_import, print_function import time import os import threading @@ -329,12 +329,12 @@ class LocalChannel(Channel): #data = json.loads(load) #{'path': 'apt-cacher-ng/map.jinja', 'saltenv': 'base', 'cmd': '_serve_file', 'loc': 0} #f = open(data['path']) - f = open(load['path']) - ret = { - 'data': ''.join(f.readlines()), - 'dest': load['path'], - } - print 'returning', ret + with salt.utils.fopen(load['path']) as fh_: + ret = { + 'data': ''.join(fh_.readlines()), + 'dest': load['path'], + } + print('returning {0}'.format(ret)) else: # end of buffer ret = {
Use print function, and Salt's `fopen`
saltstack_salt
train
py
2ab01436a1f47773a96fe6c9a1b80fb003c85fe7
diff --git a/app/addons/documents/tests/resourcesSpec.js b/app/addons/documents/tests/resourcesSpec.js index <HASH>..<HASH> 100644 --- a/app/addons/documents/tests/resourcesSpec.js +++ b/app/addons/documents/tests/resourcesSpec.js @@ -31,9 +31,9 @@ define([ }); }); - it('does not remove an id attribute', function () { + it('creates the right api-url with an absolute url', function () { - assert.ok(/file:/.test(collection.urlRef(''))); + assert.ok(/file:/.test(collection.urlRef())); }); });
tests: fix description for test the test tests that the right api-url is returned (no relative url for the app, but an absolute for the url) PR: #<I> PR-URL: <URL>
apache_couchdb-fauxton
train
js
fd9e8e253256e4a48b7f6b1dbe9b201290e9432a
diff --git a/src/stages/Stage.js b/src/stages/Stage.js index <HASH>..<HASH> 100644 --- a/src/stages/Stage.js +++ b/src/stages/Stage.js @@ -195,7 +195,7 @@ Stage.prototype.emitRenderInvalid = function() { /** - * Add a {@link Layer} into the stage. + * Add a {@link Layer layer} into the stage. * @param {Layer} layer * @throws An error if the layer already belongs to the stage. */ @@ -258,7 +258,8 @@ Stage.prototype.removeAllLayers = function() { /** - * Return a list of all {@link Layer layers} contained in the stage. + * Returns a list of all {@link Layer layers} belonging to the stage. The + * returned list is in display order, background to foreground. * @return {Layer[]} */ Stage.prototype.listLayers = function() { @@ -268,7 +269,7 @@ Stage.prototype.listLayers = function() { /** - * Return whether the stage contains a {@link Layer}. + * Return whether the stage contains a {@link Layer layer}. * @param {Layer} layer * @return {boolean} */ @@ -278,7 +279,7 @@ Stage.prototype.hasLayer = function(layer) { /** - * Move a {@link Layer} to the given position in the stack. + * Move a {@link Layer layer} to the given position in the stack. * @param {Layer} layer * @param {Number} i * @throws An error if the layer does not belong to the stage or the new
Clarify that Stage#listLayers returns the layers in display order.
google_marzipano
train
js
655e06477f3ee2af66337bc848ec2d44b868bca3
diff --git a/examples/web/src/components/Root/index.js b/examples/web/src/components/Root/index.js index <HASH>..<HASH> 100644 --- a/examples/web/src/components/Root/index.js +++ b/examples/web/src/components/Root/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { BrowserRouter as Router, Route, Switch, Link } from 'react-router-dom' +import { HashRouter as Router, Route, Switch, Link } from 'react-router-dom' import { generate100, generate10k } from 'models/generate' import Button from 'components/Button'
change: replace the BrowserRouter with the HashRouter
Nozbe_WatermelonDB
train
js
e1d77ff5b4259ed63e45fd9a9ec7c35a458bd16a
diff --git a/__test__/recaptcha/ReCaptcha.spec.js b/__test__/recaptcha/ReCaptcha.spec.js index <HASH>..<HASH> 100644 --- a/__test__/recaptcha/ReCaptcha.spec.js +++ b/__test__/recaptcha/ReCaptcha.spec.js @@ -12,11 +12,11 @@ describe("recaptcha/ReCaptcha", () => { }; it("render", () => { - let props = { sitekey: "6LckQA8TAAAAAKf4TxLtciRBYphKF5Uq4jRrImJD", - render: "explicit", - lang: "en" }; - let wrapper = mount(getComponent(props)); - chai.assert.equal(wrapper.find(ReCaptcha).length, 1); - chai.assert.equal(wrapper.find(Recaptcha).length, 1); + // let props = { sitekey: "6LckQA8TAAAAAKf4TxLtciRBYphKF5Uq4jRrImJD", + // render: "explicit", + // lang: "en" }; + // let wrapper = mount(getComponent(props)); + // chai.assert.equal(wrapper.find(ReCaptcha).length, 1); + // chai.assert.equal(wrapper.find(Recaptcha).length, 1); }); });
test removed because at travis does not work. looking about problem.
robeio_robe-react-ui
train
js
9529d0e7e5d3d3aecdacfd54afe3933112f492de
diff --git a/plugin/wavesurfer.regions.js b/plugin/wavesurfer.regions.js index <HASH>..<HASH> 100644 --- a/plugin/wavesurfer.regions.js +++ b/plugin/wavesurfer.regions.js @@ -151,7 +151,7 @@ WaveSurfer.Region = { var regionEl = document.createElement('region'); regionEl.className = 'wavesurfer-region'; regionEl.title = this.formatTime(this.start, this.end); - regionEl.setAttribute("data-id", this.id); + regionEl.setAttribute('data-id', this.id); var width = this.wrapper.scrollWidth; this.style(regionEl, {
Changed double quotes to simple ones.
katspaugh_wavesurfer.js
train
js
f0d52ed66aea0e80f95f2d1f2bb561542d6f5b73
diff --git a/lib/endpoint.js b/lib/endpoint.js index <HASH>..<HASH> 100644 --- a/lib/endpoint.js +++ b/lib/endpoint.js @@ -194,14 +194,14 @@ Endpoint.prototype.playCollect = function( opts, cb) { opts.terminators = opts.terminators || '#' ; opts.invalidFile = opts.invalidFile || 'silence_stream://250' ; opts.varName = 'myDigitBuffer' ; + opts.regexp = opts.regexp || '^\\d+[' + opts.terminators + ']' ; opts.digitTimeout = opts.digitTimeout || 8000 ; var args = [] ; - ['min', 'max', 'tries', 'timeout', 'terminators', 'file', 'invalidFile','varName','digitTimeout'] + ['min', 'max', 'tries', 'timeout', 'terminators', 'file', 'invalidFile', 'regexp','varName','digitTimeout'] .forEach(function(prop) { args.push( opts[prop] ) ; }) ; - if( opts.regexp ) { args.push(opts.regexp); } this._conn.execute('play_and_get_digits', args.join(' '), function(evt){ if('play_and_get_digits' !== evt.getHeader('variable_current_application')) {
reworked regexp on playcollect again
davehorton_drachtio-fsmrf
train
js
bdf61554f4439dc7a665ef4c7d83457f38d30cef
diff --git a/nodeconductor/cost_tracking/__init__.py b/nodeconductor/cost_tracking/__init__.py index <HASH>..<HASH> 100644 --- a/nodeconductor/cost_tracking/__init__.py +++ b/nodeconductor/cost_tracking/__init__.py @@ -61,7 +61,11 @@ class CostTrackingRegister(object): @classmethod def get_consumables(cls, resource): - strategy = cls.registered_resources[resource.__class__] + try: + strategy = cls.registered_resources[resource.__class__] + except KeyError: + raise TypeError('Resource %s is not registered for cost tracking. Make sure that its strategy ' + 'is added to CostTrackingRegister' % resource.__class__.__name__) return strategy.get_consumables(resource) # XXX: deprecated. Should be removed.
Raise meaningful error if resource isn't registered - nc-<I>
opennode_waldur-core
train
py
4440942078e69756026e4cd92e205f30932ed324
diff --git a/client_test.go b/client_test.go index <HASH>..<HASH> 100644 --- a/client_test.go +++ b/client_test.go @@ -784,7 +784,7 @@ func TestCanGetUserlist(t *testing.T) { select { case <-waitEnd: case <-time.After(time.Second * 3): - t.Fatal("no userlist recieved") + t.Fatal("no userlist received") } }
fix spelling mistake: received instead of recieved
gempir_go-twitch-irc
train
go
9d0731727fd75548cdbfbf945774ffc1c59faff7
diff --git a/unit_tests.php b/unit_tests.php index <HASH>..<HASH> 100755 --- a/unit_tests.php +++ b/unit_tests.php @@ -57,19 +57,15 @@ function testStoreAndGet() { $bucket = $client->bucket('bucket'); $rand = rand(); - $now = new DateTime(); $obj = $bucket->newObject('foo', $rand); $obj->store(); $obj = $bucket->get('foo'); - $changed = $obj->getLastModified(); - $diff = $changed->diff($now); test_assert($obj->exists()); test_assert($obj->getBucket()->getName() == 'bucket'); test_assert($obj->getKey() == 'foo'); test_assert($obj->getData() == $rand); - test_assert($diff->format('%s') == '0'); /* difference should be less than a second */ } function testStoreAndGetWithoutKey() {
Reverted PR<I> unit test addition. The additional assertion fails apparently because timezone differences are not took into account.
basho_riak-php-client
train
php
f78e101cf2205f7527f184133968cd1c4e917f28
diff --git a/pycbc/ahope/ahope_utils.py b/pycbc/ahope/ahope_utils.py index <HASH>..<HASH> 100644 --- a/pycbc/ahope/ahope_utils.py +++ b/pycbc/ahope/ahope_utils.py @@ -484,7 +484,7 @@ class Node(pipeline.CondorDAGNode): # Changing this from set(tags) to enforce order. It might make sense # for all jobs to have file names with tags in the same order. - all_tags = job.tags + all_tags = copy.deepcopy(job.tags) for tag in tags: if tag not in all_tags: all_tags.append(tag)
Ensure that tags are not edited by make_and_add_input
gwastro_pycbc
train
py
7df049f38f8ade43ca2df91a00856dfe2bf9993c
diff --git a/src/js/justifiedGallery.js b/src/js/justifiedGallery.js index <HASH>..<HASH> 100755 --- a/src/js/justifiedGallery.js +++ b/src/js/justifiedGallery.js @@ -321,6 +321,15 @@ }; /** + * Clear the building row data to be used for a new row + */ + JustifiedGallery.prototype.clearBuildingRow = function () { + this.buildingRow.entriesBuff = []; + this.buildingRow.aspectRatio = 0; + this.buildingRow.width = 0; + }; + + /** * Justify the building row, preparing it to * * @param isLastRow @@ -382,15 +391,6 @@ }; /** - * Clear the building row data to be used for a new row - */ - JustifiedGallery.prototype.clearBuildingRow = function () { - this.buildingRow.entriesBuff = []; - this.buildingRow.aspectRatio = 0; - this.buildingRow.width = 0; - }; - - /** * Flush a row: justify it, modify the gallery height accordingly to the row height * * @param isLastRow
move clearBuildingRow() down
miromannino_Justified-Gallery
train
js
e6b254c4f0b269a6adcf129d04f5f7e6b2a9af6c
diff --git a/pyswip/easy.py b/pyswip/easy.py index <HASH>..<HASH> 100644 --- a/pyswip/easy.py +++ b/pyswip/easy.py @@ -85,7 +85,7 @@ class Atom(object): def __str__(self): if self.chars is not None: - return self.chars + return self.value else: return self.__repr__() @@ -181,7 +181,7 @@ class Variable(object): def __str__(self): if self.chars is not None: - return self.chars + return self.value else: return self.__repr__()
Let the __str__ method of Atom and Variable use value instead of chars in order to prevent returning a bytes object
yuce_pyswip
train
py
4cc283a8fadabd7e5ed139e539d91ef620cce299
diff --git a/lib/htmlgrid/composite.rb b/lib/htmlgrid/composite.rb index <HASH>..<HASH> 100644 --- a/lib/htmlgrid/composite.rb +++ b/lib/htmlgrid/composite.rb @@ -22,6 +22,7 @@ # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid # +# Template -- htmlgrid -- 09.01.2012 -- mhatakeyama@ywesee.com # Template -- htmlgrid -- 23.10.2002 -- hwyss@ywesee.com require 'htmlgrid/grid' @@ -260,7 +261,7 @@ module HtmlGrid end def to_html(context) @grid.set_attributes(@attributes) - super << @grid.to_html(context) + super << @grid.to_html(context).force_encoding('utf-8') end private def back(model=@model, session=@session)
Added force_encoding('utf-8') to the return value of Grid#to_html method
zdavatz_htmlgrid
train
rb
10822c71c04a8a2368b59012b88cbbccf9c65d7c
diff --git a/anyconfig/globals.py b/anyconfig/globals.py index <HASH>..<HASH> 100644 --- a/anyconfig/globals.py +++ b/anyconfig/globals.py @@ -6,7 +6,7 @@ import logging AUTHOR = 'Satoru SATOH <ssat@redhat.com>' -VERSION = "0.0.3.10" +VERSION = "0.0.3.9" _LOGGING_FORMAT = "%(asctime)s %(name)s: [%(levelname)s] %(message)s"
revert version bump up to <I>: I merged many updates since then, so have to check carefully more before the next release
ssato_python-anyconfig
train
py
c16d385799a7589a6fc35ed95d018c123d2ffaed
diff --git a/lib/scoped_search/query_builder.rb b/lib/scoped_search/query_builder.rb index <HASH>..<HASH> 100644 --- a/lib/scoped_search/query_builder.rb +++ b/lib/scoped_search/query_builder.rb @@ -420,7 +420,7 @@ module ScopedSearch # Defines the to_sql method for AST AND/OR operators module LogicalOperatorNode def to_sql(builder, definition, &block) - fragments = children.map { |c| c.to_sql(builder, definition, &block) }.compact.map { |sql| "(#{sql})" } + fragments = children.map { |c| c.to_sql(builder, definition, &block) }.map { |sql| "(#{sql})" unless sql.blank? }.compact fragments.empty? ? nil : "#{fragments.join(" #{operator.to_s.upcase} ")}" end end
fixed issue #<I> illegal sql when external method return empty condition.
wvanbergen_scoped_search
train
rb
5bdf00108999b176648021c4a079001c8a80b8f4
diff --git a/rating/lib.php b/rating/lib.php index <HASH>..<HASH> 100644 --- a/rating/lib.php +++ b/rating/lib.php @@ -32,7 +32,7 @@ define ('RATING_AGGREGATE_MAXIMUM', 3); define ('RATING_AGGREGATE_MINIMUM', 4); define ('RATING_AGGREGATE_SUM', 5); -define ('RATING_SCALE_OUT_OF_5', 5); +define ('RATING_DEFAULT_SCALE', 5); /** * The rating class represents a single rating by a single user. It also contains a static method to retrieve sets of ratings. @@ -207,7 +207,7 @@ class rating implements renderable { * @param string $returnurl the url to return the user to after submitting a rating. Can be left null for ajax requests. * @return array the array of items with their ratings attached at $items[0]->rating */ - public static function load_ratings($context, $items, $aggregate=RATING_AGGREGATE_AVERAGE, $scaleid=RATING_SCALE_OUT_OF_5, $userid = null, $returnurl = null) { + public static function load_ratings($context, $items, $aggregate=RATING_AGGREGATE_AVERAGE, $scaleid=RATING_DEFAULT_SCALE, $userid = null, $returnurl = null) { global $DB, $USER, $PAGE, $CFG; if(empty($items)) {
rating MDL-<I> changed rating::load_ratings so the default scale constant has a better name
moodle_moodle
train
php
a98c5dd47186ebdcebd6945776624ce8fda6b872
diff --git a/tools/sarc.py b/tools/sarc.py index <HASH>..<HASH> 100755 --- a/tools/sarc.py +++ b/tools/sarc.py @@ -7,7 +7,7 @@ import struct import sys import typing -import yaz0 +import yaz0_util def _get_unpack_endian_character(big_endian: bool): return '>' if big_endian else '<' @@ -103,7 +103,7 @@ def read_file_and_make_sarc(f: typing.BinaryIO) -> typing.Optional[SARC]: f.seek(0) if first_data_group_fourcc != b"SARC": return None - data = yaz0.decompress(f) + data = yaz0_util.decompress(f.read()) elif magic == b"SARC": f.seek(0) data = f.read()
tools: Use custom yaz0 wrapper to improve perf Yep, spawning an external process is faster than the Python version.
zeldamods_sarc
train
py
00c3d735c327a10280f3d124252ab9ea3015d06e
diff --git a/src/com/google/javascript/rhino/jstype/InstanceObjectType.java b/src/com/google/javascript/rhino/jstype/InstanceObjectType.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/rhino/jstype/InstanceObjectType.java +++ b/src/com/google/javascript/rhino/jstype/InstanceObjectType.java @@ -46,7 +46,7 @@ import com.google.javascript.rhino.Node; /** * An object type that is an instance of some function constructor. */ -public final class InstanceObjectType extends PrototypeObjectType { +public class InstanceObjectType extends PrototypeObjectType { private static final long serialVersionUID = 1L; private final FunctionType constructor;
Make InstanceObjectType non-final to allow it to be mocked. R=nicksantos DELTA=1 (0 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
java
063946a544f6de1fb9fbdbb977fa378c31dfd994
diff --git a/src/main/java/com/github/seratch/jslack/api/methods/request/chat/ChatPostMessageRequest.java b/src/main/java/com/github/seratch/jslack/api/methods/request/chat/ChatPostMessageRequest.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/seratch/jslack/api/methods/request/chat/ChatPostMessageRequest.java +++ b/src/main/java/com/github/seratch/jslack/api/methods/request/chat/ChatPostMessageRequest.java @@ -76,7 +76,7 @@ public class ChatPostMessageRequest implements SlackApiRequest { /** * Disable Slack markup parsing by setting to `false`. Enabled by default. */ - private boolean mrkdwn; + private boolean mrkdwn = true; /** * URL to an image to use as the icon for this message. @@ -96,4 +96,4 @@ public class ChatPostMessageRequest implements SlackApiRequest { */ private boolean replyBroadcast; -} \ No newline at end of file +}
Fix #<I> mrkdwn appears to default to false, even though the Slack API spec says it should default to true
seratch_jslack
train
java
f4e77f3737347d0c73d9d911804db79d1d76dc28
diff --git a/lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb b/lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb index <HASH>..<HASH> 100644 --- a/lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb +++ b/lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb @@ -27,6 +27,8 @@ module StateMachine conditional_capture elsif @language.repetitionHandler.get_repetition(pLine) repetition_capture + elsif @language.aggregationHandler.get_aggregation(pLine) + aggregation_capture else return end @@ -50,6 +52,11 @@ module StateMachine end # @see OOStructuredState + def aggregation_capture + @language.set_state(@language.aggregationState) + end + + # @see OOStructuredState def execute(pElementFile, pLine) functionElement = @language.send("#{@functionIdentifier}Handler") .send("get_#{@functionIdentifier}", pLine)
Add aggregation to function behaviour
Kuniri_kuniri
train
rb
d4224bb8e760e919dc66f28eb345857887a40e63
diff --git a/anyconfig/tests/lib.py b/anyconfig/tests/lib.py index <HASH>..<HASH> 100644 --- a/anyconfig/tests/lib.py +++ b/anyconfig/tests/lib.py @@ -18,6 +18,12 @@ anyconfig.dump(c, "/dev/null", "yaml") """ +def check_output(cmd): + devnull = open('/dev/null', 'w') + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=devnull) + return proc.communicate()[0] + + class Test_00(unittest.TestCase): def setUp(self): @@ -31,10 +37,7 @@ class Test_00(unittest.TestCase): with open(self.script, 'w') as f: f.write(SCRIPT_TO_USE_ANYCONFIG) - args = ["python", self.script] - devnull = open('/dev/null', 'w') - - out = subprocess.check_output(args, stderr=devnull) - self.assertEquals(out, "") + out = check_output(["python", self.script]) + self.assertTrue(out in (b'', '')) # vim:sw=4:ts=4:et:
keep back and forward compatibility in anyconfig.tests.lib; subprocess.check_output is not available in python <I> and its output is not '' but b'' in python 3.x
ssato_python-anyconfig
train
py
9be7609509cecd1f7265fbb512aa7604e3893fe2
diff --git a/test/performance_test.rb b/test/performance_test.rb index <HASH>..<HASH> 100644 --- a/test/performance_test.rb +++ b/test/performance_test.rb @@ -96,7 +96,7 @@ describe 'SimpleXlsxReader Benchmark' do bench_exp(1,10000) end - bench_performance_linear 'parses sheets in linear time', 0.9999 do |n| + bench_performance_linear 'parses sheets in linear time', 0.999 do |n| raise "not enough sample data; asked for #{n}, only have #{@xml.sheets.size}"\ if @xml.sheets[n].nil?
travis-ci: turn down strictness of performance test Previously, the linear performance assertion could fail on slower machines (than a <I> Macbook Pro), but not by much. I don't think we need to assert four-nines of fit for the linear tests, three nines is probably good enough (and one more than the default, btw).
woahdae_simple_xlsx_reader
train
rb
9c597eae9a22c19c096c416c81d3496198ab6cd4
diff --git a/smart_open/smart_open_lib.py b/smart_open/smart_open_lib.py index <HASH>..<HASH> 100644 --- a/smart_open/smart_open_lib.py +++ b/smart_open/smart_open_lib.py @@ -945,6 +945,8 @@ class patch_pathlib(object): def _patch_pathlib(func): """Replace `Path.open` with `func`""" + if not PATHLIB_SUPPORT: + raise RuntimeError('install pathlib (or pathlib2) before using this function') old_impl = pathlib.Path.open pathlib.Path.open = func return old_impl
check PATHLIB_SUPPORT before monkey patch
RaRe-Technologies_smart_open
train
py
41317e871282d37a9673e65a0206672cf944043e
diff --git a/example_test.go b/example_test.go index <HASH>..<HASH> 100644 --- a/example_test.go +++ b/example_test.go @@ -8,8 +8,8 @@ import ( "encoding/hex" "fmt" + "github.com/btcsuite/btcwire" "github.com/conformal/btcec" - "github.com/conformal/btcwire" ) // This example demonstrates signing a message with a secp256k1 private key that
Update btcwire import paths to new location.
btcsuite_btcd
train
go
3f818d40a9882cebfaf060d21496f829053292ff
diff --git a/OpenPNM/Network/__GenericNetwork__.py b/OpenPNM/Network/__GenericNetwork__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Network/__GenericNetwork__.py +++ b/OpenPNM/Network/__GenericNetwork__.py @@ -727,7 +727,7 @@ class GenericNetwork(Core): if net._parent is self: raise Exception('This Network has been cloned, cannot trim') - if pores is not []: + if pores != []: pores = sp.array(pores,ndmin=1) Pkeep = sp.ones((self.num_pores(),),dtype=bool) Pkeep[pores] = False @@ -735,7 +735,7 @@ class GenericNetwork(Core): Ts = self.find_neighbor_throats(pores) if len(Ts)>0: Tkeep[Ts] = False - elif throats is not []: + elif throats != []: throats = sp.array(throats,ndmin=1) Tkeep = sp.ones((self.num_throats(),),dtype=bool) Tkeep[throats] = False
Reverted the is not [ ] back to != [ ] for now. We need to figure out what is going on here.
PMEAL_OpenPNM
train
py
0bff913ffe09e10271306c4af0bec40423df8d19
diff --git a/bin/whistle.js b/bin/whistle.js index <HASH>..<HASH> 100755 --- a/bin/whistle.js +++ b/bin/whistle.js @@ -116,7 +116,7 @@ program .option('-S, --storage [newStorageDir]', 'the new local storage directory', String, undefined) .option('-C, --copy [storageDir]', 'copy storageDir to newStorageDir', String, undefined) .option('-c, --dnsCache [time]', 'the cache time of DNS (30000ms by default)', String, undefined) - .option('-H, --host [host]', config.name + ' listening host(INADDR_ANY by default)', String, undefined) + .option('-H, --host [host]', config.name + ' listening host(:: or 0.0.0.0 by default)', String, undefined) .option('-p, --port [port]', config.name + ' listening port (' + config.port + ' by default)', parseInt, undefined) .option('-P, --uiport [uiport]', config.name + ' ui port (' + (config.port + 1) + ' by default)', parseInt, undefined) .option('-m, --middlewares [script path or module name]', 'express middlewares path (as: xx,yy/zz.js)', String, undefined)
feat: Add cli -H, -host to set the listening host
avwo_whistle
train
js
5078fd8a4d9b995f557f14d0f14c1093e4168ec9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ DEPENDENCIES = [ 'scipy>=0.17', 'pandas>=0.20', 'matplotlib>=2.0', - 'seaborn>=0.7.1', + 'seaborn>=0.8.1', 'f90nml>=0.21', 'argcomplete>=1.8', 'setuptools_scm>=1.15', diff --git a/stagpy/__init__.py b/stagpy/__init__.py index <HASH>..<HASH> 100644 --- a/stagpy/__init__.py +++ b/stagpy/__init__.py @@ -30,7 +30,8 @@ def _load_mpl(): mpl.use(conf.core.matplotback) plt = importlib.import_module('matplotlib.pyplot') if conf.core.useseaborn: - importlib.import_module('seaborn') + sns = importlib.import_module('seaborn') + sns.set() if conf.core.xkcd: plt.xkcd()
Bump saborn version to <I> and call set Since <I>, seaborn style is not applied by default, a call to sns.set is mandatory.
StagPython_StagPy
train
py,py
e31b46917779b917ab4be21c14ef17faa4cd3bf8
diff --git a/test/try_catch.asynct.js b/test/try_catch.asynct.js index <HASH>..<HASH> 100644 --- a/test/try_catch.asynct.js +++ b/test/try_catch.asynct.js @@ -14,14 +14,12 @@ exports ['emit mapper exceptions as error events'] = function (test) { s.write('{"a":1}\n{"') it(caughtError).equal(false) - s.write('b":2}\n{"c":}') + it(rows).deepEqual([ { a: 1 } ]) + + s.write('b":2}\n{"c":}\n') it(caughtError).equal(true) + it(rows).deepEqual([ { a: 1 }, { b: 2 } ]) + s.end() - - it(rows).deepEqual([ - { a: 1 }, - { b: 2 } - ]) - test.done() }
fix the test to write a newline so that the error actually triggers, check more things
dominictarr_split
train
js
af1441591d3dd16ed41e4c848d8dd8958673eee6
diff --git a/slave/buildslave/commands/hg.py b/slave/buildslave/commands/hg.py index <HASH>..<HASH> 100644 --- a/slave/buildslave/commands/hg.py +++ b/slave/buildslave/commands/hg.py @@ -118,7 +118,7 @@ class Mercurial(SourceBaseCommand): return self._clobber(dummy, dirname) # Purge was a success, then we need to update - return self._update2(res) + return res p = purgeCmd.start() p.addCallback(_clobber) @@ -238,9 +238,6 @@ class Mercurial(SourceBaseCommand): msg = "Clobber flag set. Doing clobbering" log.msg(msg) - def _vcfull(res): - return self.doVCFull() - return self.clobber(None, self.srcdir) return 0
_update2 will be call later in any case. Avoid calling it twice. And remove unused code.
buildbot_buildbot
train
py
9b942cb079a59676149dfa1657c5f25b9ba46b53
diff --git a/gremlin-test/src/main/java/com/tinkerpop/gremlin/AbstractGraphProvider.java b/gremlin-test/src/main/java/com/tinkerpop/gremlin/AbstractGraphProvider.java index <HASH>..<HASH> 100644 --- a/gremlin-test/src/main/java/com/tinkerpop/gremlin/AbstractGraphProvider.java +++ b/gremlin-test/src/main/java/com/tinkerpop/gremlin/AbstractGraphProvider.java @@ -102,8 +102,10 @@ public abstract class AbstractGraphProvider implements GraphProvider { } protected void readIntoGraph(final Graph g, final String path) throws IOException { + final File workingDirectory = computeTestDataRoot(this.getClass(), "kryo-working-directory"); + if (!workingDirectory.exists()) workingDirectory.mkdirs(); final GraphReader reader = KryoReader.build() - .workingDirectory(File.separator + "tmp") + .workingDirectory(workingDirectory.getAbsolutePath()) .custom(g.io().gremlinKryoSerializer()) .create(); try (final InputStream stream = AbstractGremlinTest.class.getResourceAsStream(path)) {
Move working directory for Kryo to target directory for tests Create the working directory if it does not exist.
apache_tinkerpop
train
java
3d61dae55b2e5cbfe44a752d8a84ecfcdcd809fd
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -134,6 +134,7 @@ public class StorageService implements IEndpointStateChangeSubscriber, StorageSe {{ put(Verb.MUTATION, Stage.MUTATION); put(Verb.BINARY, Stage.MUTATION); + put(Verb.READ_REPAIR, Stage.MUTATION); put(Verb.READ, Stage.READ); put(Verb.READ_RESPONSE, Stage.RESPONSE); put(Verb.STREAM_STATUS, Stage.MISC); // TODO does this really belong on misc? I've just copied old behavior here
Fix assertion error on read repair introduced by CASSANDRA-<I>. Patch by johan, review by jbellis. CASSANDRA-<I> git-svn-id: <URL>
Stratio_stratio-cassandra
train
java
9bfe358d4ac5c5705e9e819b1e00441e60e6fd10
diff --git a/gary/dynamics/nonlinear.py b/gary/dynamics/nonlinear.py index <HASH>..<HASH> 100644 --- a/gary/dynamics/nonlinear.py +++ b/gary/dynamics/nonlinear.py @@ -15,7 +15,7 @@ import numpy as np # Project from ..util import gram_schmidt -__all__ = ['lyapunov_spectrum', 'lyapunov_max'] +__all__ = ['lyapunov_spectrum', 'fast_lyapunov_max', 'lyapunov_max'] # Create logger logger = logging.getLogger(__name__)
Add fast lyapunov calc to all
adrn_gala
train
py
b8bcd8466f76cbeb53a0ecbdf5702cec578078ad
diff --git a/demo/index.php b/demo/index.php index <HASH>..<HASH> 100644 --- a/demo/index.php +++ b/demo/index.php @@ -200,11 +200,9 @@ $feed->handle_content_type(); // Use the embed() method to embed the enclosure into the page inline. echo '<div align="center">'; echo '<p>' . $enclosure->embed(array( - //'width' => '640', - //'height' => '480', 'audio' => './for_the_demo/place_audio.png', 'video' => './for_the_demo/place_video.png', - //'mediaplayer' => './for_the_demo/mediaplayer.swf', + 'mediaplayer' => './for_the_demo/mediaplayer.swf', 'alt' => '<img src="./for_the_demo/mini_podcast.png" class="download" border="0" title="Download the Podcast (' . $enclosure->get_extension() . '; ' . $enclosure->get_size() . ' MB)" />', 'altclass' => 'download' )) . '</p>';
Missed one file in the last commit.
simplepie_simplepie
train
php
c1c9c8dcf5bee8bdf885767751eebfff2ed49f7c
diff --git a/examples/lua_parser.py b/examples/lua_parser.py index <HASH>..<HASH> 100644 --- a/examples/lua_parser.py +++ b/examples/lua_parser.py @@ -99,13 +99,16 @@ keywords = { """.split() } vars().update(keywords) +any_keyword = pp.MatchFirst(keywords.values()).setName("<keyword>") comment_intro = pp.Literal("--") short_comment = comment_intro + pp.restOfLine long_comment = comment_intro + LBRACK + ... + RBRACK lua_comment = long_comment | short_comment -ident = ppc.identifier +# must use negative lookahead to ensure we don't parse a keyword as an identifier +ident = ~any_keyword + ppc.identifier + name = pp.delimitedList(ident, delim=".", combine=True) namelist = pp.delimitedList(name) @@ -274,6 +277,12 @@ if __name__ == "__main__": if t['foo'] then n = n + 1 end + if 10 > 8 then + n = n + 2 + end + if (10 > 8) then + n = n + 2 + end end """
Add lookahead on matching identifiers to ensure we aren't matching a keyword
pyparsing_pyparsing
train
py
4a9573a0215a64769a004b8b7460bf709c821d2e
diff --git a/test/model_test.js b/test/model_test.js index <HASH>..<HASH> 100644 --- a/test/model_test.js +++ b/test/model_test.js @@ -603,6 +603,27 @@ describe('Seraph Model', function() { }); }); + it('should not compute beyond a certain level if desired', function(done) { + var beer = model(db, 'Beer'); + var food = model(db, 'Food'); + var hop = model(db, 'Hop'); + food.compose(beer, 'matchingBeers', 'matches'); + beer.compose(hop, 'hops', 'contains_hop'); + + hop.addComputedField('compute_test', function(thing) { return true }); + + food.save({name:"Pinnekjøtt", matchingBeers: + {name:"Heady Topper", hops: {name: 'CTZ'}}, + }, function(err, meal) { + assert(!err); + food.read(meal.id, {computeLevels:1}, function(err, meal) { + assert(!err,err); + console.log(meal.matchingBeers); + assert(!meal.matchingBeers.hops.compute_test) + done(); + }); + }); + }); it('should allow implicit transformation of compositions', function(done) { var beer = model(db, 'Beer'); var food = model(db, 'Food');
add test for restricting levels of computation when reading a model
brikteknologier_seraph-model
train
js
1b02cfc8bcdb9569917eb954f2b59f686026cd9f
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -19,7 +19,7 @@ require_relative "../resource" require_relative "../http/simple" require "tmpdir" unless defined?(Dir.mktmpdir) -require "cgi" unless defined?(CGI) +require "addressable" unless defined?(Addressable) class Chef class Resource @@ -379,7 +379,7 @@ class Chef def build_repo(uri, distribution, components, trusted, arch, add_src = false) uri = make_ppa_url(uri) if is_ppa_url?(uri) - uri = CGI.escape(uri) + uri = Addressable::URI.parse(uri) components = Array(components).join(" ") options = [] options << "arch=#{arch}" if arch @@ -387,7 +387,7 @@ class Chef optstr = unless options.empty? "[" + options.join(" ") + "]" end - info = [ optstr, uri, distribution, components ].compact.join(" ") + info = [ optstr, uri.normalize.to_s, distribution, components ].compact.join(" ") repo = "deb #{info}\n" repo << "deb-src #{info}\n" if add_src repo
Properly fix encoding of the entire URI by using Addressable
chef_chef
train
rb
3dfadf01bf1c191875ad7c3dd92d308a4af72045
diff --git a/server/src/main/java/org/uiautomation/ios/server/instruments/InstrumentsVersion.java b/server/src/main/java/org/uiautomation/ios/server/instruments/InstrumentsVersion.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/uiautomation/ios/server/instruments/InstrumentsVersion.java +++ b/server/src/main/java/org/uiautomation/ios/server/instruments/InstrumentsVersion.java @@ -71,6 +71,11 @@ public class InstrumentsVersion implements CommandOutputListener { public String getBuild() { return build; } + + @Override + public String toString(){ + return "version:"+version+", build: "+build; + } }
making InstrumentsVersion debug a bit easier by adding a toString
ios-driver_ios-driver
train
java
a43287c4b924b0a526db74bb534a2b8e7ac81d7c
diff --git a/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java b/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java index <HASH>..<HASH> 100644 --- a/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java +++ b/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java @@ -69,6 +69,9 @@ public class HttpResponse extends Action { @JsonIgnore public String getBodyAsString() { + if (body == null) { + return ""; + } return new String(body, Charsets.UTF_8); }
#<I> - fixing NullPointerException when no body is provided in the verify call
jamesdbloom_mockserver
train
java
05b105c8657a6b7b8f57b470420769dd5a9324e5
diff --git a/blitzdb/backends/sql/queryset.py b/blitzdb/backends/sql/queryset.py index <HASH>..<HASH> 100644 --- a/blitzdb/backends/sql/queryset.py +++ b/blitzdb/backends/sql/queryset.py @@ -49,12 +49,9 @@ class QuerySet(BaseQuerySet): if self.objects: self.pop_objects = self.objects[:] - self.deserialized_objects = None - self.deserialized_pop_objects = None - self._it = None self.order_bys = order_bys - self.count = None - self.result = None + + self.revert() def limit(self,limit): self._limit = limit @@ -394,6 +391,13 @@ class QuerySet(BaseQuerySet): self.get_deserialized_objects() return self.deserialized_objects[key] + def revert(self): + self.deserialized_objects = None + self.deserialized_pop_objects = None + self._it = None + self.count = None + self.result = None + def pop(self,i = 0): if self.deserialized_objects is None: self.get_deserialized_objects()
Added revert to queryset.
adewes_blitzdb
train
py