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
0e82b4eb2f49873be0e84e8deaf10eaee813733b
diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -64,7 +64,7 @@ module Jekyll return @url if @url url = if permalink - if uses_relative_permalinks + if site.config['relative_permalinks'] File.join(@dir, permalink) else permalink
Use site config to determine whether permalinks should be relative.
jekyll_jekyll
train
rb
47c744e536a7907ad38e9dc62f346f739e9b16c7
diff --git a/main/core/Controller/FileController.php b/main/core/Controller/FileController.php index <HASH>..<HASH> 100644 --- a/main/core/Controller/FileController.php +++ b/main/core/Controller/FileController.php @@ -274,7 +274,7 @@ class FileController extends AbstractApiController private function stream(ResourceNode $resourceNode) { //temporary because otherwise injected resource must have the "open" right - $this->checkPermission('OPEN', new ResourceCollection([$resourceNode]), [], true); + $this->checkPermission('OPEN', $resourceNode, [], true); // free the session as soon as possible // see https://github.com/claroline/CoreBundle/commit/7cee6de85bbc9448f86eb98af2abb1cb072c7b6b
Fixes permissions for file streaming (#<I>)
claroline_Distribution
train
php
0b2d7205af22539da74b909baf27d347bad76bd9
diff --git a/shoebot/core/nodebox.py b/shoebot/core/nodebox.py index <HASH>..<HASH> 100644 --- a/shoebot/core/nodebox.py +++ b/shoebot/core/nodebox.py @@ -535,7 +535,7 @@ class NodeBot(Bot): else: return txt - def textpath(self, txt, x, y, width=None, height=1000000, draw=True, **kwargs): + def textpath(self, txt, x, y, width=None, height=1000000, draw=False, **kwargs): ''' Draws an outlined path of the input text '''
set default in textpath() to 'draw=False' via shoebot main branch - hv_francesco
shoebot_shoebot
train
py
9807abe49809774e912a478d2be12a46285e9da2
diff --git a/test/unit/plugins/guests/suse/cap/change_host_name_test.rb b/test/unit/plugins/guests/suse/cap/change_host_name_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/plugins/guests/suse/cap/change_host_name_test.rb +++ b/test/unit/plugins/guests/suse/cap/change_host_name_test.rb @@ -22,13 +22,14 @@ describe "VagrantPlugins::GuestSUSE::Cap::ChangeHostName" do let(:cap) { caps.get(:change_host_name) } let(:name) { "banana-rama.example.com" } + let(:basename) { "banana-rama" } it "sets the hostname" do comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) cap.change_host_name(machine, name) - expect(comm.received_commands[1]).to match(/echo '#{name}' > \/etc\/HOSTNAME/) - expect(comm.received_commands[1]).to match(/hostname '#{name}'/) + expect(comm.received_commands[1]).to match(/echo '#{basename}' > \/etc\/HOSTNAME/) + expect(comm.received_commands[1]).to match(/hostname '#{basename}'/) end it "does not change the hostname if already set" do
Adjusted test to work with new implementation
hashicorp_vagrant
train
rb
731babf7e21f5e958c01da07d14d87b81ce1c12a
diff --git a/examples/sampleserver.py b/examples/sampleserver.py index <HASH>..<HASH> 100644 --- a/examples/sampleserver.py +++ b/examples/sampleserver.py @@ -71,8 +71,12 @@ class ConcreteServer(OpenIDServer): 'openid.identity': req.identity, 'openid.trust_root': req.trust_root, 'openid.return_to': req.return_to, - 'openid.assoc_handle': req.assoc_handle, } + + assoc_handle = req.get('assoc_handle') + if assoc_handle is not None: + args['openid.assoc_handle'] = req.assoc_handle + return append_args(addr + '?action=openid', args) def get_setup_response(self, req):
[project @ Fix bug in sample server.]
openid_python-openid
train
py
e8aab9dc5167d4c117aa67a875f02dd42c2950b7
diff --git a/src/test/java/io/github/bonigarcia/wdm/test/watcher/DisableCspFirefoxTest.java b/src/test/java/io/github/bonigarcia/wdm/test/watcher/DisableCspFirefoxTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/github/bonigarcia/wdm/test/watcher/DisableCspFirefoxTest.java +++ b/src/test/java/io/github/bonigarcia/wdm/test/watcher/DisableCspFirefoxTest.java @@ -36,12 +36,12 @@ class DisableCspFirefoxTest { static final Logger log = getLogger(lookup().lookupClass()); - WebDriverManager wdm; + WebDriverManager wdm = WebDriverManager.firefoxdriver().watch() + .disableCsp(); WebDriver driver; @BeforeEach void setup() { - wdm = WebDriverManager.firefoxdriver().watch().disableCsp(); driver = wdm.create(); }
Change logic for creating wdm in watch test
bonigarcia_webdrivermanager
train
java
309ecb9873aaf37a40392ca62ef7c90324995af3
diff --git a/src/Extension/ProductVariationsExtension.php b/src/Extension/ProductVariationsExtension.php index <HASH>..<HASH> 100644 --- a/src/Extension/ProductVariationsExtension.php +++ b/src/Extension/ProductVariationsExtension.php @@ -208,7 +208,9 @@ class ProductVariationsExtension extends DataExtension )->innerJoin( 'SilverShop_Variation', '"SilverShop_Variation_AttributeValues"."SilverShop_VariationID" = "SilverShop_Variation"."ID"' - )->where("TypeID = $type AND \"SilverShop_Variation\".\"ProductID\" = " . $this->owner->ID); + )->where( + "TypeID = $type AND \"SilverShop_Variation\".\"ProductID\" = " . $this->owner->ID + )->sort('"SilverShop_Variation"."Sort" ASC'); if (!Product::config()->allow_zero_price) { $list = $list->where('"SilverShop_Variation"."Price" > 0');
Use the sort as defined in the variation (#<I>)
silvershop_silvershop-core
train
php
bbcf7b384949cdb6c842d61132ba654a599000b6
diff --git a/hbmqtt/broker.py b/hbmqtt/broker.py index <HASH>..<HASH> 100644 --- a/hbmqtt/broker.py +++ b/hbmqtt/broker.py @@ -370,7 +370,7 @@ class Broker: if client_session.clean_session: # Delete existing session and create a new one - if client_session.client_id is not None: + if client_session.client_id is not None and client_session.client_id != "": self.delete_session(client_session.client_id) else: client_session.client_id = gen_client_id()
correctly handle CONNECT with zero-length client_id Zero-length client_ids in CONNECT packets show up in the payload as empty strings, not None; the broker should generate a new id for these connections.
beerfactory_hbmqtt
train
py
a7813e580c882088dc5effbda8ba787b50300cec
diff --git a/tests/test_main.py b/tests/test_main.py index <HASH>..<HASH> 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -40,6 +40,9 @@ class TestIdentifyVcs(unittest.TestCase): identify_vcs(repo_url) self.assertEqual(identify_vcs(repo_url, guess=True), "hg") + repo_url = "https://[email protected]/pydanny/static" + self.assertEqual(identify_vcs(repo_url, guess=True), "hg") + def test_svn(self): # easy check repo_url = "http://svn.code.sf.net/p/docutils/code/trunk"
added bitbucket case to tests. Close #1
pydanny_watdarepo
train
py
98e5138dfb7eb2149620e529ac0ddb1f5f07b3e4
diff --git a/salt/states/archive.py b/salt/states/archive.py index <HASH>..<HASH> 100644 --- a/salt/states/archive.py +++ b/salt/states/archive.py @@ -7,6 +7,7 @@ Archive states. import logging import os import tarfile +from contextlib import closing log = logging.getLogger(__name__) @@ -131,7 +132,7 @@ def extracted(name, files = __salt__['archive.un{0}'.format(archive_format)](filename, name) else: if tar_options is None: - with tarfile.open(filename, 'r') as tar: + with closing(tarfile.open(filename, 'r')) as tar: files = tar.getnames() tar.extractall(name) else:
Using a closing context with the with block
saltstack_salt
train
py
adf64e236aa5cfca8d06aeeeba533a2b7ce155fb
diff --git a/lib/chronuscop_client/railtie.rb b/lib/chronuscop_client/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/chronuscop_client/railtie.rb +++ b/lib/chronuscop_client/railtie.rb @@ -21,6 +21,9 @@ module ChronuscopClient # reading the YAML file (app/config/chronuscop.yml) ChronuscopClient.configuration_object.load_yaml_configuration + # Setting the I18n backend for the rails application. + I18n.backend = I18n::Backend::KeyValue.new(Redis.new(:db => ChronuscopClient.configuration_object.redis_db_number)) + # creating a new synchronizer object. ChronuscopClient.synchronizer_object = ChronuscopClient::Synchronizer.new(ChronuscopClient.configuration_object.redis_db_number) ChronuscopClient.synchronizer_object.start
Finished setting the I<I>n backend in the gem.
ajeychronus_chronuscop_client
train
rb
07a03e6fcc69916f8ba447f3adba1d243048de62
diff --git a/packages/xod-fs/src/utils.js b/packages/xod-fs/src/utils.js index <HASH>..<HASH> 100644 --- a/packages/xod-fs/src/utils.js +++ b/packages/xod-fs/src/utils.js @@ -10,25 +10,21 @@ export const resolvePath = R.compose( ); // :: string -> boolean -export const isDirectoryExists = R.compose( - R.tryCatch( - R.compose( - R.invoker(0, 'isDirectory'), - fs.statSync - ), - R.F +export const isDirectoryExists = R.tryCatch( + R.compose( + R.invoker(0, 'isDirectory'), + fs.statSync, + resolvePath ), - resolvePath + R.F ); // :: string -> boolean -export const isFileExists = R.compose( - R.tryCatch( - R.compose( - R.invoker(0, 'isFile'), - fs.statSync - ), - R.F +export const isFileExists = R.tryCatch( + R.compose( + R.invoker(0, 'isFile'), + fs.statSync, + resolvePath ), - resolvePath + R.F );
refactor(xod-fs): refactor `isFileExists` and `isDirectoryExists` functions
xodio_xod
train
js
164fcb294636e0138f9dccdc9691a074b64ed1a3
diff --git a/playground/examples/tidal.js b/playground/examples/tidal.js index <HASH>..<HASH> 100644 --- a/playground/examples/tidal.js +++ b/playground/examples/tidal.js @@ -50,7 +50,7 @@ drums.tidal( '[kd ch]*2 sd [kd*2 sd] oh' ) // pattern to alternate which member is played. drums.tidal( '< kd sd kd oh > ch*2' ) -// we can use thte {} brackets to play two +// we can use 'curly' {} brackets to play two // sounds at once drums.tidal( '< kd sd kd {oh,kd} > ch*2' )
Replacing a misspelled word with an alternative
charlieroberts_gibber.audio.lib
train
js
9fb029c32c878ff1961c6f4f8210e3a51c552489
diff --git a/lib/bot.js b/lib/bot.js index <HASH>..<HASH> 100644 --- a/lib/bot.js +++ b/lib/bot.js @@ -154,7 +154,7 @@ module.exports = ( function () { const self = this, logInCallback = function ( err, data ) { - if (data == null) { + if (data === null || typeof data === 'undefined') { self.error('Logging in failed: no data received'); callback(err || new Error(`Logging in failed: no data received`)); } else if ( !err && typeof data.lgusername !== 'undefined' ) {
Changed to long-form null/undefined check
macbre_nodemw
train
js
68b34db523f8fce70c56f9ec20dcb5b6f2ca900a
diff --git a/bin/obfuscate_pwd.rb b/bin/obfuscate_pwd.rb index <HASH>..<HASH> 100755 --- a/bin/obfuscate_pwd.rb +++ b/bin/obfuscate_pwd.rb @@ -1,9 +1,9 @@ #!/usr/bin/env ruby -require File.join(File.dirname(__FILE__),"..","lib","birst_command") +require "birst_command" -begin - puts Obfuscate.obfuscate(ARGV[0]) -rescue +if ARGV[0] + puts Birst_Command::Obfuscate.obfuscate(ARGV[0]) +else puts "USAGE: ./obfuscate_pwd <plaintxt password>" end diff --git a/lib/birst_command/version.rb b/lib/birst_command/version.rb index <HASH>..<HASH> 100644 --- a/lib/birst_command/version.rb +++ b/lib/birst_command/version.rb @@ -1,3 +1,3 @@ module Birst_Command - VERSION = "0.1.0" + VERSION = "0.1.1" end
BugFix: obfuscate_pwd was not working when bundled as gem Need to require 'birst_command'
gnilrets_Birst_Command
train
rb,rb
c0096e9556a6a2c7c407d63b0f8ca05da41aa567
diff --git a/lib/ashton/version.rb b/lib/ashton/version.rb index <HASH>..<HASH> 100644 --- a/lib/ashton/version.rb +++ b/lib/ashton/version.rb @@ -1,3 +1,3 @@ module Ashton - VERSION = "0.1.1" + VERSION = "0.1.3" end
Updated version so I could push a new copy of the gem
gosu_ashton
train
rb
ab746d068e6b193ed3db170b79d489f5ab782069
diff --git a/api/query.go b/api/query.go index <HASH>..<HASH> 100644 --- a/api/query.go +++ b/api/query.go @@ -1,6 +1,7 @@ package api import ( + "code.google.com/p/gorest" "github.com/matttproud/prometheus/rules" "github.com/matttproud/prometheus/rules/ast" "time" @@ -13,9 +14,15 @@ func (serv MetricsService) Query(Expr string, Json string, Start string, End str timestamp := time.Now() - format := ast.TEXT + rb := serv.ResponseBuilder() + var format ast.OutputFormat if Json != "" { format = ast.JSON + rb.SetContentType(gorest.Application_Json) + } else { + format = ast.TEXT + rb.SetContentType(gorest.Text_Plain) } + return ast.EvalToString(exprNode, &timestamp, format) }
Set correct Content-Type header based on output format.
prometheus_prometheus
train
go
94c65b04d5b9cc0ee7bfbe8813200fe8674980bb
diff --git a/source/rafcon/mvc/selection.py b/source/rafcon/mvc/selection.py index <HASH>..<HASH> 100644 --- a/source/rafcon/mvc/selection.py +++ b/source/rafcon/mvc/selection.py @@ -67,6 +67,9 @@ class Selection(Observable): def __len__(self): return len(self.__selected) + def __contains__(self, item): + return item in self.__selected + def __getitem__(self, key): return [s for s in self.__selected][key]
Add __contains__ method to Selection class With this, one can write "if model in selection" instead of having to write "if model in selection.get_all()"
DLR-RM_RAFCON
train
py
5cef1b5bec5a3829e65015cbeaa541b5f29ffea3
diff --git a/client/js/Panels/DiagramDesigner/ModelEditor/ModelEditorControl.DiagramDesignerWidgetEventHandlers.js b/client/js/Panels/DiagramDesigner/ModelEditor/ModelEditorControl.DiagramDesignerWidgetEventHandlers.js index <HASH>..<HASH> 100644 --- a/client/js/Panels/DiagramDesigner/ModelEditor/ModelEditorControl.DiagramDesignerWidgetEventHandlers.js +++ b/client/js/Panels/DiagramDesigner/ModelEditor/ModelEditorControl.DiagramDesignerWidgetEventHandlers.js @@ -181,6 +181,10 @@ define(['logManager', registry[nodePropertyNames.Registry.lineStyle] = {}; _.extend(registry[nodePropertyNames.Registry.lineStyle], this._DEFAULT_LINE_STYLE); + if (params.visualStyle) { + _.extend(registry[nodePropertyNames.Registry.lineStyle], params.visualStyle); + } + var p = { "parentId": this.currentNodeInfo.id, "sourceId": sourceId, "targetId": targetId,
connections visual props are saved on creation (if any) Former-commit-id: 0f0a7dfb<I>cfc1a6d<I>d<I>ad<I>e<I>d<I>fab
webgme_webgme-engine
train
js
281e157f57639ff574d2b929f623e227bd76f04e
diff --git a/squad/core/comparison.py b/squad/core/comparison.py index <HASH>..<HASH> 100644 --- a/squad/core/comparison.py +++ b/squad/core/comparison.py @@ -174,7 +174,7 @@ class TestComparison(BaseComparison): ).prefetch_related( 'build', 'environment', - ).only('id') + ).only('build', 'environment') test_runs_ids = {} for test_run in test_runs:
core: comparison: fix fetching less data from testrun This fixes dd<I>a8cb<I>d<I>e<I>b6a9f7a<I>fe0a<I>, which attempted to prevent unnecessary data from loading. I assumed that Django would still prefetch "build" and "environment", but it didn't. This caused collateral unnecessary load of same build and environment. This explicitly says that only build, environment and id are fetched from the db
Linaro_squad
train
py
ac20b6a499342c46856842d380d743b1aa44698f
diff --git a/lib/discordrb/commands/command_bot.rb b/lib/discordrb/commands/command_bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/commands/command_bot.rb +++ b/lib/discordrb/commands/command_bot.rb @@ -172,6 +172,7 @@ module Discordrb::Commands # @return [String, nil] the command's result, if there is any. def execute_command(name, event, arguments, chained = false) debug("Executing command #{name} with arguments #{arguments}") + return unless @commands command = @commands[name] unless command event.respond @attributes[:command_doesnt_exist_message].gsub('%command%', name.to_s) if @attributes[:command_doesnt_exist_message]
Do a nil check against a CommandBot's commands in execute_command
meew0_discordrb
train
rb
1370cb6109e8e061dcda43bd38cd424b37ac727b
diff --git a/src/Ratchet/Http/Guzzle/Http/Message/RequestFactory.php b/src/Ratchet/Http/Guzzle/Http/Message/RequestFactory.php index <HASH>..<HASH> 100644 --- a/src/Ratchet/Http/Guzzle/Http/Message/RequestFactory.php +++ b/src/Ratchet/Http/Guzzle/Http/Message/RequestFactory.php @@ -4,6 +4,23 @@ use Guzzle\Http\Message\RequestFactory as GuzzleRequestFactory; use Guzzle\Http\EntityBody; class RequestFactory extends GuzzleRequestFactory { + + protected static $ratchetInstance; + + /** + * {@inheritdoc} + */ + public static function getInstance() + { + // @codeCoverageIgnoreStart + if (!static::$ratchetInstance) { + static::$ratchetInstance = new static(); + } + // @codeCoverageIgnoreEnd + + return static::$ratchetInstance; + } + /** * {@inheritdoc} */
This modification gives Ratchet its own RequestFactory instance. This way you can use guzzle as REST Client.
ratchetphp_Ratchet
train
php
b186d868ece2b6e1aee2222cb6e8b8140cf4763d
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java index <HASH>..<HASH> 100644 --- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java @@ -651,7 +651,7 @@ public class WorkflowTemplateServiceClient implements BackgroundResource { * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - private final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateRequest request) { + public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateRequest request) { return updateWorkflowTemplateCallable().call(request); }
Regenerate clients (#<I>)
googleapis_google-cloud-java
train
java
b6f563193f2a277d3eb2ed9f29772c8893a4c934
diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index <HASH>..<HASH> 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -8,7 +8,7 @@ from codecs import open as open1 from setuptools import setup, find_packages -VERSION = "0.4.50" +VERSION = "0.4.51" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers',
aks-preview: version bump (#<I>)
Azure_azure-cli-extensions
train
py
0aa49c1ec7244c11799073b132cf543bf4d9550e
diff --git a/src/scs_core/data/json.py b/src/scs_core/data/json.py index <HASH>..<HASH> 100644 --- a/src/scs_core/data/json.py +++ b/src/scs_core/data/json.py @@ -123,9 +123,8 @@ class JSONReport(JSONable): tmp_filename = '.'.join((filename, str(int(time.time())))) try: - f = open(tmp_filename, 'w') - f.write(jstr + '\n') - f.close() + with open(tmp_filename, 'w') as f: + f.write(jstr + '\n') except FileNotFoundError: # the containing directory does not exist (yet) return False
Refactored MultiPersistentJSONable
south-coast-science_scs_core
train
py
b5c864fbf2358b3179862d5b1d22160c3bd0d6b1
diff --git a/channel.go b/channel.go index <HASH>..<HASH> 100644 --- a/channel.go +++ b/channel.go @@ -274,8 +274,8 @@ func (ch *Channel) sendOpen(msg message) (err error) { func (ch *Channel) dispatch(msg message) { switch m := msg.(type) { case *channelClose: - ch.connection.closeChannel(ch, newError(m.ReplyCode, m.ReplyText)) ch.send(&channelCloseOk{}) + ch.connection.closeChannel(ch, newError(m.ReplyCode, m.ReplyText)) case *channelFlow: ch.notifyM.RLock()
First send a channel.close-ok, then release local resources This way if a channel with the same ID is opened concurrently, the server will first see a channel.close-ok for it and release it. This is the same idea as #<I>.
streadway_amqp
train
go
cbc65c7f311a366aa3618a18c1a439a72f482218
diff --git a/scripts/partialBuild.js b/scripts/partialBuild.js index <HASH>..<HASH> 100644 --- a/scripts/partialBuild.js +++ b/scripts/partialBuild.js @@ -12,7 +12,7 @@ rollupConfig.plugins.push(partialBuildPlugin); rollup.rollup(rollupConfig).then(function(bundle) { return bundle.generate(rollupConfig.output); }).then(function(result) { - process.stdout.write(result.code); + result.output.forEach(x => process.stdout.write(x.code)) }); function partialBuild(options) {
fix: partial build (#<I>) * fixed partial build output * write multiple chunks
ramda_ramda
train
js
2bee5954318eda3aa3335a9853a2f241f3e158cc
diff --git a/src/Core/Loader.php b/src/Core/Loader.php index <HASH>..<HASH> 100644 --- a/src/Core/Loader.php +++ b/src/Core/Loader.php @@ -72,11 +72,6 @@ class Loader $this->load_widgets(); - // Now all core files are loaded, turn on output buffer until a view is dispatched. - if (! \ob_get_level()) { - \ob_start(); - } - $this->load_theme(); } diff --git a/src/Templating/View.php b/src/Templating/View.php index <HASH>..<HASH> 100644 --- a/src/Templating/View.php +++ b/src/Templating/View.php @@ -43,12 +43,6 @@ class View */ public function render($slug, $data = []) { - /* - * When Snap first boots up, it starts the output buffer. - * Now we have a matched view, we can flush any partials (such as the page <head>). - */ - \ob_end_flush(); - if ($this->current_view !== null) { throw new Templating_Exception('Views should not be nested'); }
buffering can conflict with static cache plugins
snapwp_snap-core
train
php,php
0530d5909e9ca420ac668fde858c7c56a85bdfe4
diff --git a/src/Lucid/QueryBuilder/methods.js b/src/Lucid/QueryBuilder/methods.js index <HASH>..<HASH> 100644 --- a/src/Lucid/QueryBuilder/methods.js +++ b/src/Lucid/QueryBuilder/methods.js @@ -451,6 +451,8 @@ methods.scope = function (target) { */ methods.ids = function (target) { return function () { + const serializer = new target.HostModel.QuerySerializer(target, this) + serializer._decorateQuery() return target.modelQueryBuilder.select(target.HostModel.primaryKey).pluck(target.HostModel.primaryKey) } } @@ -465,6 +467,8 @@ methods.ids = function (target) { */ methods.pair = function (target) { return function (lhs, rhs) { + const serializer = new target.HostModel.QuerySerializer(target, this) + serializer._decorateQuery() return target.modelQueryBuilder.select(lhs, rhs).reduce(function (result, row) { result[row[lhs]] = row[rhs] return result
fix(soft-deletes): pairs and ids ignore soft deleted Closes #<I>
adonisjs_adonis-lucid
train
js
8c94b4b51ceb3315e21774a10b7b7c4c9362cb5a
diff --git a/lib/omnibus/packagers/mac_dmg.rb b/lib/omnibus/packagers/mac_dmg.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/packagers/mac_dmg.rb +++ b/lib/omnibus/packagers/mac_dmg.rb @@ -25,9 +25,9 @@ module Omnibus end setup do - clean_disks create_directory(dmg_stage) remove_file(writable_dmg) + clean_disks end build do
Move clean disks after dmg_stage directory creation so that the command can execute correctly.
chef_omnibus
train
rb
659e6f9f1bf0f7302a55c6a6df2024bdc346b18d
diff --git a/bundles/org.eclipse.orion.client.ui/web/embeddedEditor/builder/javascriptPlugin.build.almond-js.js b/bundles/org.eclipse.orion.client.ui/web/embeddedEditor/builder/javascriptPlugin.build.almond-js.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/embeddedEditor/builder/javascriptPlugin.build.almond-js.js +++ b/bundles/org.eclipse.orion.client.ui/web/embeddedEditor/builder/javascriptPlugin.build.almond-js.js @@ -24,6 +24,11 @@ almond: 'requirejs/almond', i18n: 'requirejs/i18n', text: 'requirejs/text', + esprima: "esprima/esprima", + estraverse: "estraverse/estraverse", + escope: "escope/escope", + logger: "javascript/logger", + doctrine: 'doctrine/doctrine', 'orion/bootstrap': 'embeddedEditor/builder/buildFrom/bootstrap' }, name: "almond",
Bug <I> - Stand alone editor: consume-ability improvement.-- refined the build script
eclipse_orion.client
train
js
6b226535b5c3e5465c54f2773b111411ce255221
diff --git a/salt/grains/core.py b/salt/grains/core.py index <HASH>..<HASH> 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -536,7 +536,7 @@ def _virtual(osdata): # Tested on Fedora 10 / 2.6.27.30-170.2.82 with xen # Tested on Fedora 15 / 2.6.41.4-1 without running xen elif isdir('/sys/bus/xen'): - if 'xen' in __salt__['cmd.run']('dmesg').lower(): + if 'xen:' in __salt__['cmd.run']('dmesg').lower(): grains['virtual_subtype'] = 'Xen PV DomU' elif os.listdir('/sys/bus/xen/drivers'): # An actual DomU will have several drivers
Added : to xen grep, because otherwise it would match kernel messages like: skipping TxEn test for device [<I>:<I>f] subsystem [<I>:<I>]
saltstack_salt
train
py
665c6998649e7b8c99afcaa0e133b71f4a83e917
diff --git a/src/Medoo.php b/src/Medoo.php index <HASH>..<HASH> 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -234,9 +234,7 @@ class Medoo } $option = $options['option'] ?? []; - $commands = (isset($options['command']) && is_array($options['command'])) ? - $options['command'] : - []; + $commands = []; switch ($this->type) { @@ -469,6 +467,10 @@ class Medoo ); } + if (isset($options['command']) && is_array($options['command'])) { + $commands = array_merge($commands, $options['command']); + } + foreach ($commands as $value) { $this->pdo->exec($value); }
[update] the default commands can be overridden by the connection command option. #<I>
catfan_Medoo
train
php
7b0f9f619565a7dd4ee3ba2478fa10237fd6353e
diff --git a/packages/ember-testing/lib/helpers.js b/packages/ember-testing/lib/helpers.js index <HASH>..<HASH> 100644 --- a/packages/ember-testing/lib/helpers.js +++ b/packages/ember-testing/lib/helpers.js @@ -19,6 +19,7 @@ Ember.Test.onInjectHelpers(function() { function visit(app, url) { Ember.run(app, app.handleURL, url); + app.__container__.lookup('router:main').location.setURL(url); return wait(app); }
Ember testing update url in visit helper
emberjs_ember.js
train
js
dca66e9adc94ca9a635b3cb1d4eba5e2721ecbfc
diff --git a/lib/rango/rango.rb b/lib/rango/rango.rb index <HASH>..<HASH> 100644 --- a/lib/rango/rango.rb +++ b/lib/rango/rango.rb @@ -66,6 +66,7 @@ module Rango # @since 0.0.1 def interactive ARGV.delete("-i") # otherwise irb will read it + ENV["RACK_ENV"] = Rango.environment # for racksh unless try_require("racksh/boot") Rango.logger.info("For more goodies install racksh gem") try_require "irb/completion" # some people can have ruby compliled without readline @@ -77,7 +78,7 @@ module Rango end # clever environments support - attribute :development_environments, ["development", "test", "spec", "cucumber"] + attribute :development_environments, ["development"] attribute :testing_environments, ["test", "spec", "cucumber"] attribute :production_environments, ["stage", "production"] @@ -86,7 +87,7 @@ module Rango questionable :production, lambda { self.production_environments.include?(Rango.environment) } def environment?(environment) - self.environment.eql?(environment.to_sym) + self.environment.eql?(environment.to_s) end end end
Fixed Rango#environment?, removed test-like environments from development_environments and exported ENV[RACK_ENV] in Rango.interactive
botanicus_rango
train
rb
44e82fddb9232bbff2ac7088b70f41ab07d574b2
diff --git a/test/lib/utils.js b/test/lib/utils.js index <HASH>..<HASH> 100644 --- a/test/lib/utils.js +++ b/test/lib/utils.js @@ -44,6 +44,7 @@ exports.setupCouch = function (opts, callback) { if (err) { return callback(err); } + process.setMaxListeners(100); process.on('exit', function (code) { couch.once('stop', function () { process.exit(code);
remove memory leak warning for process event emitter during tests * * * This commit was sponsored by The Hoodie Firm. You can hire The Hoodie Firm: <URL>
hoodiehq-archive_hoodie-plugins-manager
train
js
6f54a507d4951f34ba469986c1fb2d6bdf12c8db
diff --git a/isort/main.py b/isort/main.py index <HASH>..<HASH> 100755 --- a/isort/main.py +++ b/isort/main.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#!/usr/bin/env python ''' Tool for sorting imports alphabetically, and automatically separated into sections. Copyright (C) 2013 Timothy Edmund Crosley
Remove unconventional space after shebang While allowed by most tools, it is very unconventional.
timothycrosley_isort
train
py
610418617d0e58d5be780704f2799271cc1473b5
diff --git a/marathon/models/app.py b/marathon/models/app.py index <HASH>..<HASH> 100644 --- a/marathon/models/app.py +++ b/marathon/models/app.py @@ -37,7 +37,9 @@ class MarathonApp(MarathonResource): def __init__(self, cmd=None, constraints=None, container=None, cpus=None, env=None, executor=None, health_checks=None, id=None, instances=None, mem=None, ports=None, tasks=None, uris=None): self.cmd = cmd - self.constraints = constraints or [] + self.constraints = [ + c if isinstance(c, MarathonConstraint) else MarathonConstraint(*c) + for c in (constraints or [])] self.container = container self.cpus = cpus self.env = env @@ -93,4 +95,4 @@ class MarathonApp(MarathonResource): 'ports': self.ports, 'tasks': [t.json_encode() for t in self.tasks], 'uris': self.uris - } \ No newline at end of file + }
Bug Fix: Cannot define constraints with a tuple of strings
thefactory_marathon-python
train
py
81005d7caaa3eabdb68234f0b1c59fa19385e669
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -49,10 +49,12 @@ mirage.client = function client(primus) { }); }; + var session; + primus.on('outgoing::url', function url(options) { var querystring = primus.querystring(options.query || ''); - querystring._mirage = session; + querystring._mirage = (session = session || primus.guid()); options.query = primus.querystringify(querystring); }); };
[fix] Actually set the guid;
primus_mirage
train
js
1ae61a5ce2ff242e07d41c8187b3cfd7a5d76760
diff --git a/src/mergadoclient/HttpClient.php b/src/mergadoclient/HttpClient.php index <HASH>..<HASH> 100644 --- a/src/mergadoclient/HttpClient.php +++ b/src/mergadoclient/HttpClient.php @@ -59,6 +59,26 @@ class HttpClient } + public function requestAsync($url, $method = 'GET', $data = []) { + + $stack = HandlerStack::create(); + $stack->push(ApiMiddleware::auth()); + $client = new Client(['handler' => $stack]); + + $promise = $client->requestAsync($method, $url, [ + 'headers' => [ + 'Authorization' => 'Bearer '.$this->token + ], + 'json' => $data, + 'content-type' => 'application/json' + ]); + + return $promise; + + } + + + /** * @param AccessToken $token * @return $this
Added requestAsync method to HttpClient Added async methods to ApiClient
mergado_mergado-api-client-php
train
php
320c2e5edb023e3399b4a097cc215f871e6e563d
diff --git a/lib/index.cjs.js b/lib/index.cjs.js index <HASH>..<HASH> 100644 --- a/lib/index.cjs.js +++ b/lib/index.cjs.js @@ -1,5 +1,6 @@ import jwtDecode, { InvalidTokenError } from "./index"; const wrapper = jwtDecode; +wrapper.default = jwtDecode; wrapper.InvalidTokenError = InvalidTokenError; export default wrapper; \ No newline at end of file
Add cjs compatibility with default export This allows to use the ESM default import syntax in environments where the import resolves to the CJS build. This allows to create type definitions that work with both ESM and CJS environments.
auth0_jwt-decode
train
js
17eff440dd0b7b07378d7d0592874760eb09e9f4
diff --git a/idx/memory/find_cache_test.go b/idx/memory/find_cache_test.go index <HASH>..<HASH> 100644 --- a/idx/memory/find_cache_test.go +++ b/idx/memory/find_cache_test.go @@ -89,3 +89,14 @@ func TestFindCache(t *testing.T) { }) } + +func BenchmarkTreeFromPath(b *testing.B) { + numPaths := 1000 + paths := getSeriesNames(10, numPaths, "benchmark") + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + p := i % numPaths + treeFromPath(paths[p]) + } +}
add benchmark for treeFromPath
grafana_metrictank
train
go
6f77e1cec48afc1db2b813780c75461034a06c95
diff --git a/tm-monitor/main.go b/tm-monitor/main.go index <HASH>..<HASH> 100644 --- a/tm-monitor/main.go +++ b/tm-monitor/main.go @@ -11,7 +11,7 @@ import ( monitor "github.com/tendermint/tools/tm-monitor/monitor" ) -var version = "0.3.0" +var version = "0.3.1" var logger = log.NewNopLogger()
update tm-monitor version to <I>
tendermint_tendermint
train
go
6f239621004418a61e783a7fffc0c1bb56a9259d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ setup( "Topic :: Software Development :: Libraries :: Python Modules", ], + use_2to3 = True, long_description = """\ Iron.io common library ----------------------
modified: setup.py added distribute's 2to3 option for python 3 compatibility
iron-io_iron_core_python
train
py
0a0737de5e56f251b1ff4d929d5af155e0b9ff91
diff --git a/lib/voom/presenters/dsl/components/actions/base.rb b/lib/voom/presenters/dsl/components/actions/base.rb index <HASH>..<HASH> 100644 --- a/lib/voom/presenters/dsl/components/actions/base.rb +++ b/lib/voom/presenters/dsl/components/actions/base.rb @@ -34,13 +34,20 @@ module Voom def extract_dynamic_params(hash) HashExt::Traverse.traverse(hash) do |k, v| if v.respond_to?(:to_hash) || v.respond_to?(:dynamic_parameter) - [k, v.to_hash] + [k, clean_dynamic_values(v.to_hash)] else [nil, nil] end end end + # This is an attempt to fix an intermittent bug where "params" would end up in the list of + # values when using `last_response`. + def clean_dynamic_values(hash) + hash[:value].delete(:params) if hash.has_key?(:value) && hash[:value].is_a?(Array) + hash + end + def extract_params(hash) HashExt::Traverse.traverse(hash) do |k, v| if v.respond_to?(:dynamic_parameter)
Attempt at fixing a very elusive bug when using `last_response` in an action.
rx_presenters
train
rb
e03773937965e515ceb43c23f98ba3b58a4c76d9
diff --git a/cleancat/base.py b/cleancat/base.py index <HASH>..<HASH> 100644 --- a/cleancat/base.py +++ b/cleancat/base.py @@ -930,7 +930,7 @@ class PolymorphicField(Dict): ) return self.type_map[field_type].clean( - {k: v for k, v in value.items() if k != field_type} + {k: v for k, v in value.items() if k != self.type_field} ) diff --git a/tests/test_base.py b/tests/test_base.py index <HASH>..<HASH> 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1034,6 +1034,18 @@ def test_polymorphic_field(): poly_field.clean({'type': '1', 'option-0': 'data'}) +def test_polymorphic_field_2(): + class Option(Dict): + def clean(self, value): + value = super(Option, self).clean(value) + if 'option' not in value: + raise ValidationError('option not in data') + return value['option'] + + poly_field = PolymorphicField(type_map={'option': Option()}) + assert poly_field.clean({'type': 'option', 'option': 1}) == 1 + + def test_embedded_factory(): class SumTwoInts(Schema): a = Integer(required=True)
Fix field removal in PolymorphicField
closeio_cleancat
train
py,py
0b9e50b3e19629b24ff7d3ee57078d0dccdfc183
diff --git a/lib/runtime/index.js b/lib/runtime/index.js index <HASH>..<HASH> 100644 --- a/lib/runtime/index.js +++ b/lib/runtime/index.js @@ -12,10 +12,6 @@ var Entry = require("./entry.js"); // specific module objects, or for Module.prototype (where implemented), // to make the runtime available throughout the entire module system. exports.enable = function (mod) { - if (typeof mod.resolve !== "function") { - throw new Error("module.resolve not implemented"); - } - if (mod.link !== moduleLink) { mod.link = moduleLink; mod["export"] = moduleExport;
Don't complain about missing module.resolve until necessary. Calling require("reify/lib/runtime").enable(Module.prototype) before Module.prototype.resolve has been defined is fine, as long as the resolve method is defined before module.link calls it. If it's still undefined then, an exception will be thrown, which fulfills the same purpose as the exception removed by this commit.
benjamn_reify
train
js
f10f2e3d7584e4b6ea42f3779cc85997b7121d82
diff --git a/webapps/client/scripts/navigation/controllers/cam-layout-ctrl.js b/webapps/client/scripts/navigation/controllers/cam-layout-ctrl.js index <HASH>..<HASH> 100644 --- a/webapps/client/scripts/navigation/controllers/cam-layout-ctrl.js +++ b/webapps/client/scripts/navigation/controllers/cam-layout-ctrl.js @@ -7,25 +7,6 @@ define([ var $ = angular.element; var $bdy = $('body'); - function navsOpen() { - return $bdy.hasClass('filters-column-open') || - $bdy.hasClass('list-column-open'); - } - - function isNavChild(el) { - return $(el).parents('.task-filters, .task-list').length > 0; - } - - - $bdy.click(function(evt) { - if (navsOpen() && - !isNavChild(evt.target) && - !evt.isDefaultPrevented()) { - $bdy.removeClass('filters-column-open list-column-open'); - } - }); - - return [ '$scope', function(
impr(layout): only the toggler should trigger collapse / expand Related to: CAM-<I>
camunda_camunda-bpm-platform
train
js
3ef2d789f09f629dd0c649a02ff309689e200a0f
diff --git a/unit_testing.py b/unit_testing.py index <HASH>..<HASH> 100644 --- a/unit_testing.py +++ b/unit_testing.py @@ -13,6 +13,7 @@ class TestW2N(unittest.TestCase): self.assertEqual(w2n.word_to_num('eleven'),11) self.assertEqual(w2n.word_to_num('nineteen billion and nineteen'),19000000019) self.assertEqual(w2n.word_to_num('one hundred and forty two'),142) + self.assertEqual(w2n.word_to_num('one hundred thirty-five'),135) if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/word2number/w2n.py b/word2number/w2n.py index <HASH>..<HASH> 100644 --- a/word2number/w2n.py +++ b/word2number/w2n.py @@ -63,6 +63,7 @@ indian_number_system = { """ def word_to_num(number_sentence): number_sentence = number_sentence.lower() + number_sentence = number_sentence.replace('-', ' ') split_words = number_sentence.split() # split sentence into words clean_numbers = [] # removing and, & etc. for word in split_words:
Added support for dash-splitted 2-digit numbers. Like thirty-five
akshaynagpal_w2n
train
py,py
2083a0104eab24f9abf2caaf777912cec54dd052
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -48,7 +48,7 @@ return array( 'version' => '20.2.2', 'author' => 'Open Assessment Technologies, CRP Henri Tudor', 'requires' => array( - 'generis' => '>=7.9.6', + 'generis' => '>=7.9.9', ), 'models' => array( 'http://www.tao.lu/Ontologies/TAO.rdf',
New version with DBAL instead of PDO requires new generis
oat-sa_tao-core
train
php
8b98d31bbe7a2f02d1c8e7dafadbeadcafbdd8e5
diff --git a/tests/get_free_port.py b/tests/get_free_port.py index <HASH>..<HASH> 100644 --- a/tests/get_free_port.py +++ b/tests/get_free_port.py @@ -2,12 +2,8 @@ import tangelo.util def test_get_free_port(): - for _ in xrange(100): + for _ in xrange(1000): free_port = tangelo.util.get_free_port() print "Got free port: %d" % (free_port) - yield check_port, free_port - - -def check_port(port): - assert port > 1024 + assert free_port > 1024
Preventing the get_free_port() test from cluttering the output This also strengthens the test, now that screen clutter is not an issue
Kitware_tangelo
train
py
ce27ef7adb7f9e8348281f82db1ce5d17cf7ff87
diff --git a/peer_test.go b/peer_test.go index <HASH>..<HASH> 100644 --- a/peer_test.go +++ b/peer_test.go @@ -385,11 +385,11 @@ func TestPeerSelectionPreferIncoming(t *testing.T) { }, } - ctx, cancel := NewContext(time.Second) - defer cancel() - for _, tt := range tests { WithVerifiedServer(t, nil, func(ch *Channel, hostPort string) { + ctx, cancel := NewContext(time.Second) + defer cancel() + selectedIncoming := make(map[string]int) selectedOutgoing := make(map[string]int) selectedUnconnected := make(map[string]int)
Create context inside of the test function Avoid timeouts if a previous test failed, since the context may now already be past the deadline and will cause future failures
uber_tchannel-go
train
go
763d74687f3706f8fdc1012b575b10aa71b41081
diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index <HASH>..<HASH> 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -89,8 +89,7 @@ class ComponentStatusChangedNotification extends Notification ->line($content) ->action(trans('notifications.component.status_update.mail.action'), cachet_route('status-page')) ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])) - //TODO: Translate the text below - ->line('Manage your subscriptions at ' . cachet_route('subscribe.manage', $notifiable->verify_code)); + ->line(trans('cachet.subscriber.manage') . ' ' . cachet_route('subscribe.manage', $notifiable->verify_code)); } /**
Uses the translation cachet.subscriber.manage. When a component's status changes or when an incident is created/updated, an email is sent to every people that has subscribed. At the end of the mail a link to manage its subscription has been introduced. Now, it uses the translation.
CachetHQ_Cachet
train
php
78f90353f162668208718263db23867df9d8961d
diff --git a/coupons/models.py b/coupons/models.py index <HASH>..<HASH> 100644 --- a/coupons/models.py +++ b/coupons/models.py @@ -69,6 +69,7 @@ class Coupon(models.Model): users = models.ManyToManyField( user_model, verbose_name=_("Users"), null=True, blank=True, through='CouponUser', help_text=_("You may specify a list of users you want to restrict this coupon to.")) + users_limit = models.PositiveIntegerField(_("User limit"), default=1) created_at = models.DateTimeField(_("Created at"), auto_now_add=True) redeemed_at = models.DateTimeField(_("Redeemed at"), blank=True, null=True) valid_until = models.DateTimeField(
add a user limit field to coupon with default of 1 like before
byteweaver_django-coupons
train
py
7c244f46db29c1c5556b2989eef2e57153f7cc34
diff --git a/libkbfs/block_journal.go b/libkbfs/block_journal.go index <HASH>..<HASH> 100644 --- a/libkbfs/block_journal.go +++ b/libkbfs/block_journal.go @@ -268,7 +268,7 @@ func (j *blockJournal) readJournal(ctx context.Context) ( // refs won't have to upload any new bytes. (This might // be wrong if all references to a block were deleted // since the addref entry was appended.) - if e.Op == blockPutOp { + if e.Op == blockPutOp && !e.Ignore { b, err := j.getDataSize(id) // Ignore ENOENT errors, since users like // BlockServerDisk can remove block data without
block_journal: ignore the byes of ignored blocks on a restart Issue: KBFS-<I>
keybase_client
train
go
08137b46eb1844f86b03210d770717b9fa66aef2
diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/v2/PollStrategy.java b/azure-client-runtime/src/main/java/com/microsoft/azure/v2/PollStrategy.java index <HASH>..<HASH> 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/v2/PollStrategy.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/v2/PollStrategy.java @@ -234,11 +234,11 @@ abstract class PollStrategy { } /** - * @erturn The data for the strategy. + * @return The data for the strategy. */ public abstract Serializable strategyData(); SwaggerMethodParser methodParser() { return this.methodParser; } -} \ No newline at end of file +}
Fix spelling in PollStrategy Javadoc (#<I>)
Azure_azure-sdk-for-java
train
java
a72970ae6bd4dc5e17c717670719c1b8b0e48862
diff --git a/AuthManager.php b/AuthManager.php index <HASH>..<HASH> 100755 --- a/AuthManager.php +++ b/AuthManager.php @@ -4,9 +4,7 @@ namespace Illuminate\Auth; use Closure; use Illuminate\Contracts\Auth\Factory as FactoryContract; -use Illuminate\Support\Str; use InvalidArgumentException; -use LogicException; class AuthManager implements FactoryContract {
Apply fixes from StyleCI (#<I>)
illuminate_auth
train
php
b2442470769ffdf4fd95b4726f3f6d8892f76fb2
diff --git a/src/BouncerServiceProvider.php b/src/BouncerServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/BouncerServiceProvider.php +++ b/src/BouncerServiceProvider.php @@ -2,6 +2,8 @@ namespace Silber\Bouncer; +use Silber\Bouncer\Database\Role; +use Silber\Bouncer\Database\Ability; use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Auth\Access\Gate;
Bug fix missing use statements for Ability and Role Classes in ServiceProvider.
JosephSilber_bouncer
train
php
5fab6e6f5f0e802ccfed77c3e60335986d489a6b
diff --git a/holodeck/packagemanager.py b/holodeck/packagemanager.py index <HASH>..<HASH> 100644 --- a/holodeck/packagemanager.py +++ b/holodeck/packagemanager.py @@ -79,18 +79,14 @@ def world_info(world_name, world_config=None, initial_indent="", next_indent=" print(sensor_indent, sensor) -def install(package_name, holodeck_path="."): +def install(package_name): """Installs a holodeck package. Positional Arguments: package_name -- the name of the package to install """ - # using util.get_holodeck_path() as a default value causes a compilation error if HOLODECKPATH does not exist - # "." is used instead - if holodeck_path == ".": - holodeck_path = util.get_holodeck_path() - + holodeck_path = util.get_holodeck_path() binary_website = "http://pcc.byu.edu/holodeck/" if package_name not in packages:
Removed code to recheck holodeck path Recently implemented similar functionality in util.py
BYU-PCCL_holodeck
train
py
312d0b5b357c70be3ffcc91c13a0b8b78a12821f
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -7,9 +7,20 @@ var sut = require("./index"); var lib = require("./lib"); var quick_check = function (describe_string, it_string, it_func) { return describe(describe_string, function () { - return _.times(500, function (n) { + var times = 500; + var counter; + before(function () { + counter = 0; + }); + after(function () { + assert.strictEqual(counter, times); + }); + return _.times(times, function (n) { n = n + 1; - return it(it_string + " (try #" + n + ")", function () { return it_func; }); + return it(it_string + " (try #" + n + ")", function () { + it_func(); + counter = counter + 1; + }); }); }); };
test(quick_check): add sanity check on number of tests executed
janraasch_javascript-commitment
train
js
129dc03cfc9ff736f6dc0e6357dabdd4cda74cc5
diff --git a/tests/test_callstack.py b/tests/test_callstack.py index <HASH>..<HASH> 100644 --- a/tests/test_callstack.py +++ b/tests/test_callstack.py @@ -47,7 +47,7 @@ def test_empty_stack(): cs = cs.ret(None) nose.tools.assert_equal(cs.current_function_address, 0) - nose.tools.assert_equal(cs.current_stack_pointer, None) + nose.tools.assert_equal(cs.current_stack_pointer, 0) if __name__ == "__main__": test_empty_stack()
missed a spot on test_callstack
angr_angr
train
py
dcca6efd750bd42062fe9cb3ecb822a7cae75d19
diff --git a/tests/test_protocol.py b/tests/test_protocol.py index <HASH>..<HASH> 100644 --- a/tests/test_protocol.py +++ b/tests/test_protocol.py @@ -70,9 +70,6 @@ class TransportMock(unittest.mock.Mock): self.loop.call_soon(self.close) self._eof = True - def is_closing(self): - return self._closing - def close(self): # Simulate how actual transports drop the connection. if not self._closing:
Simplify mock. The code that was using this no longer exists.
aaugustin_websockets
train
py
e188020a7f484dc10ebbad76ab2defd2da56a6e2
diff --git a/testRunner.js b/testRunner.js index <HASH>..<HASH> 100755 --- a/testRunner.js +++ b/testRunner.js @@ -139,6 +139,7 @@ async function check(file) { result = result.split(' - undefined').join('x'); result = result.split(' `undefined`').join('x'); result = result.split('_undefined').join('x'); + result = result.split('undefined error').join('x'); if (ok && result.indexOf('undefined')>=0) { message = 'Ok except for undefined references'; ok = false;
fix: more undefined in text fields
Mermade_widdershins
train
js
891f61a8c9cf1f82b062ed957178956a3672908b
diff --git a/gcloud_requests/credentials_watcher.py b/gcloud_requests/credentials_watcher.py index <HASH>..<HASH> 100644 --- a/gcloud_requests/credentials_watcher.py +++ b/gcloud_requests/credentials_watcher.py @@ -62,3 +62,8 @@ class CredentialsWatcher(Thread): with self.watch_list_updated: self.watch_list.append(credentials) self.watch_list_updated.notify() + + def unwatch(self, credentials): + with self.watch_list_updated: + self.watch_list.remove(credentials) + self.watch_list_updated.notify() diff --git a/gcloud_requests/proxy.py b/gcloud_requests/proxy.py index <HASH>..<HASH> 100644 --- a/gcloud_requests/proxy.py +++ b/gcloud_requests/proxy.py @@ -71,6 +71,9 @@ class RequestsProxy(object): self.credentials = credentials _credentials_watcher.watch(credentials) + def __del__(self): + _credentials_watcher.unwatch(self.credentials) + def request(self, uri, method="GET", body=None, headers=None, redirections=5, connection_type=None, retries=0, refresh_attempts=0): # noqa session = self._get_session() headers = headers.copy() if headers is not None else {}
unwatch credentials once proxies get gc'd
LeadPages_gcloud_requests
train
py,py
bee453e79cd0a16dadf51b915560fb5a6eaec835
diff --git a/MAVProxy/modules/mavproxy_console.py b/MAVProxy/modules/mavproxy_console.py index <HASH>..<HASH> 100644 --- a/MAVProxy/modules/mavproxy_console.py +++ b/MAVProxy/modules/mavproxy_console.py @@ -6,8 +6,6 @@ import os, sys, math, time -mpstate = None - from MAVProxy.modules.lib import wxconsole from MAVProxy.modules.lib import textconsole from MAVProxy.modules.mavproxy_map import mp_elevation @@ -66,6 +64,7 @@ def init(_mpstate): def unload(): '''unload module''' + mpstate.console.close() mpstate.console = textconsole.SimpleConsole() def estimated_time_remaining(lat, lon, wpnum, speed):
console: Console window now closes when module is unloaded.
ArduPilot_MAVProxy
train
py
88f199b9a2052e54b04bf9a0e3c9b5316ed5fa1b
diff --git a/testproj/urls.py b/testproj/urls.py index <HASH>..<HASH> 100644 --- a/testproj/urls.py +++ b/testproj/urls.py @@ -14,12 +14,12 @@ from testproj import views # args, kwargs, *args, **kwargs urlpatterns = patterns('', - (r'^home$', 'testproj.views.home'), - (r'^home-callable$', views.home), + (r'home/$', 'testproj.views.home'), + (r'home-callable/$', views.home), - url('r^about/$', 'testproj.views.about'), - url('r^about-named/$', 'testproj.views.about', name='about'), - url('r^about-with-default-args/$', 'testproj.views.about', {'testing': True }), + url(r'about/$', 'testproj.views.about'), + url(r'about-named/$', 'testproj.views.about', name='about'), + url(r'about-with-default-args/$', 'testproj.views.about', {'testing': True }), (r'protected/$', views.protected), (r'protected-and-cached/$', views.protected_and_cached),
Reformatted some url patterns.
jkocherhans_alto
train
py
8cbbf89b8abeb9a811d14d65c3c2327d8ba54ba2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -116,6 +116,9 @@ setup( 'invenio_base.apps': [ 'invenio_records = invenio_records:InvenioRecords', ], + 'invenio_base.api_apps': [ + 'invenio_records = invenio_records:InvenioRecords', + ], 'invenio_celery.tasks': [ 'invenio_records = invenio_records.tasks.api', ],
installation: entry point fix * Installs extension on API application in order to support JSONRef replacement in the API application.
inveniosoftware_invenio-records
train
py
e7e8a7d8358791115034179cede5447d2744f47e
diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index <HASH>..<HASH> 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -145,6 +145,18 @@ class TestHeuristcs < Minitest::Test }) end + def test_m_by_heuristics + assert_heuristics({ + "Objective-C" => all_fixtures("Objective-C", "*.m"), + "Mercury" => all_fixtures("Mercury", "*.m"), + "MUF" => all_fixtures("MUF", "*.m"), + "M" => all_fixtures("M", "MDB.m"), + "Mathematica" => all_fixtures("Mathematica", "*.m") - all_fixtures("Mathematica", "Problem12.m"), + "Matlab" => all_fixtures("Matlab", "create_ieee_paper_plots.m"), + "Limbo" => all_fixtures("Limbo", "*.m") + }) + end + # Candidate languages = ["C++", "Objective-C"] def test_obj_c_by_heuristics # Only calling out '.h' filenames as these are the ones causing issues
Tests for .m heuristic rules
github_linguist
train
rb
0922e28ad7e6cb43af96bc28a60fc77d4a139ba9
diff --git a/spec/gettext_i18n_rails/haml_parser_spec.rb b/spec/gettext_i18n_rails/haml_parser_spec.rb index <HASH>..<HASH> 100644 --- a/spec/gettext_i18n_rails/haml_parser_spec.rb +++ b/spec/gettext_i18n_rails/haml_parser_spec.rb @@ -23,11 +23,13 @@ describe GettextI18nRails::HamlParser do end end - it "should parse the 1.9" do - with_file '= _("xxxx", x: 1)' do |path| - parser.parse(path, []).should == [ - ["xxxx", "#{path}:1"] - ] + it "should parse the 1.9 if ruby_version is 1.9" do + if RUBY_VERSION =~ /^1\.9/ + with_file '= _("xxxx", x: 1)' do |path| + parser.parse(path, []).should == [ + ["xxxx", "#{path}:1"] + ] + end end end
Only run spec for <I> when ruby_version is <I>.. this fixes the travis ree testrun
grosser_gettext_i18n_rails
train
rb
8c4a1cf67f2c96f5385ac0fe62dffd40dc3fc00f
diff --git a/app/helpers/govuk_elements_errors_helper.rb b/app/helpers/govuk_elements_errors_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/govuk_elements_errors_helper.rb +++ b/app/helpers/govuk_elements_errors_helper.rb @@ -28,7 +28,7 @@ module GovukElementsErrorsHelper child_objects = attribute_objects object nested_child_objects = child_objects.map { |o| attributes(o, parent_object) } - (child_objects + nested_child_objects).flatten + (child_objects + nested_child_objects).flatten - [object] end def self.attribute_objects object
Remove parent object from attributes(object) when present Assure attributes(object) does not return object in returned array.
ministryofjustice_govuk_elements_form_builder
train
rb
e4dc3cee457afe27b026d9badad41b635cf25de8
diff --git a/lib/discordrb/commands/command_bot.rb b/lib/discordrb/commands/command_bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/commands/command_bot.rb +++ b/lib/discordrb/commands/command_bot.rb @@ -79,7 +79,7 @@ module Discordrb::Commands parse_self: attributes[:parse_self], shard_id: attributes[:shard_id], num_shards: attributes[:num_shards], - redact_token: attributes[:redact_token]) + redact_token: attributes.key?(:redact_token) ? attributes[:redact_token] : true) @prefix = attributes[:prefix] @attributes = {
Set redact_token to true if none is given during CommandBot passthrough (so the entire thing *actually works* on CommandBot)
meew0_discordrb
train
rb
f5823252bb90a984480995cd8ed6c5a6a8dd83a4
diff --git a/tests/support/mock.py b/tests/support/mock.py index <HASH>..<HASH> 100644 --- a/tests/support/mock.py +++ b/tests/support/mock.py @@ -95,8 +95,10 @@ if NO_MOCK is False: class MockFH(object): - def __init__(self, filename, read_data): + def __init__(self, filename, read_data, *args, **kwargs): self.filename = filename + self.call_args = (filename,) + args + self.call_kwargs = kwargs self.empty_string = b'' if isinstance(read_data, six.binary_type) else '' self.read_data = self._iterate_read_data(read_data) self.read = Mock(side_effect=self._read) @@ -316,7 +318,7 @@ class MockOpen(object): # Contents were not an exception, so proceed with creating the # mocked filehandle. pass - ret = MockFH(name, file_contents) + ret = MockFH(name, file_contents, *args, **kwargs) self.filehandles.setdefault(name, []).append(ret) return ret except KeyError:
Track call args/kwargs in MockFH This allows for them to be verified in tests
saltstack_salt
train
py
f965cec37121e2fa58bd37d590f257f37117c042
diff --git a/src/TwentyOneRunFactory.php b/src/TwentyOneRunFactory.php index <HASH>..<HASH> 100644 --- a/src/TwentyOneRunFactory.php +++ b/src/TwentyOneRunFactory.php @@ -408,7 +408,7 @@ class TwentyOneRunFactory implements Factory ), SortOrderConfig::create( AttributeCode::fromString('created_at'), - SortOrderDirection::create(SortOrderDirection::ASC) + SortOrderDirection::create(SortOrderDirection::DESC) ), ]; }
Issue #<I>: Descend sorting by creation date
lizards-and-pumpkins_catalog
train
php
61f63bd9e8f576c4b7b673171dc7262bd3c26ae8
diff --git a/test/integration.js b/test/integration.js index <HASH>..<HASH> 100644 --- a/test/integration.js +++ b/test/integration.js @@ -35,20 +35,20 @@ test('should work with a single pid', async t => { test('should work with an array of pids', async t => { const child = spawn( 'node', - ['-e', 'console.log(123); var c = 0; while(true) {c = Math.pow(c, c);}'], + ['-e', 'console.log(`123`); setInterval(() => {}, 1000)'], { windowsHide: true } ) const ppid = process.pid const pid = child.pid - await t.notThrows(() => + await t.notThrowsAsync( new Promise((resolve, reject) => { child.stdout.on('data', d => resolve(d.toString())) child.stderr.on('data', d => reject(d.toString())) child.on('error', reject) - child.on('exit', reject) + child.on('exit', code => reject(new Error('script exited with code ' + code))) }), - 'script not executed' + 'script not executed' ) const pids = [ppid, pid]
test: os x deterministic
soyuka_pidusage
train
js
d4d0e0b4504fb0b6ba6c1cca237cabe022a4de48
diff --git a/revapi-java/src/main/java/org/revapi/java/compilation/ClassTreeInitializer.java b/revapi-java/src/main/java/org/revapi/java/compilation/ClassTreeInitializer.java index <HASH>..<HASH> 100644 --- a/revapi-java/src/main/java/org/revapi/java/compilation/ClassTreeInitializer.java +++ b/revapi-java/src/main/java/org/revapi/java/compilation/ClassTreeInitializer.java @@ -149,7 +149,7 @@ final class ClassTreeInitializer { } } - if (LOG.isInfoEnabled()) { + if (LOG.isTraceEnabled()) { time = System.currentTimeMillis() - time; final int[] num = new int[1]; environment.getTree().searchUnsafe(JavaElement.class, true, new Filter<JavaElement>() { @@ -164,10 +164,7 @@ final class ClassTreeInitializer { return true; } }, null); - LOG.info("Tree init took " + time + "ms. The resulting tree has " + num[0] + " elements."); - } - - if (LOG.isTraceEnabled()) { + LOG.trace("Tree init took " + time + "ms. The resulting tree has " + num[0] + " elements."); LOG.trace("Public API class tree in {} initialized to: {}", environment.getApi(), environment.getTree()); } }
Output class tree init times only on trace level.
revapi_revapi
train
java
315dfd43d5777f2b823d5b3a7e5d2bbc64f6b90d
diff --git a/lib/wns.js b/lib/wns.js index <HASH>..<HASH> 100644 --- a/lib/wns.js +++ b/lib/wns.js @@ -156,8 +156,10 @@ var obtainAccessToken = function (context) { // queue up the context until the accessToken is obtained var key = getClientKey(context); - if (pendingNotifications[key]) + if (pendingNotifications[key]) { pendingNotifications[key].push(context); + return; + } else pendingNotifications[key] = [ context ];
Fix simultaneous send requests while obtaining token If you are sending a push notification for the first time, a token will be retrieved. During that time, if you attempt to send another message, it gets queued, but produces a fatal error. This is because a new request for a new token is made.
tjanczuk_wns
train
js
8bbe72075e4e16442c4e28d999edee12e294329e
diff --git a/params/version.go b/params/version.go index <HASH>..<HASH> 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 8 // Minor version component of the current release - VersionPatch = 17 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 8 // Minor version component of the current release + VersionPatch = 17 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string. diff --git a/swarm/version/version.go b/swarm/version/version.go index <HASH>..<HASH> 100644 --- a/swarm/version/version.go +++ b/swarm/version/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 0 // Major version component of the current release - VersionMinor = 3 // Minor version component of the current release - VersionPatch = 5 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 0 // Major version component of the current release + VersionMinor = 3 // Minor version component of the current release + VersionPatch = 5 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string.
params, swarm: release Geth <I> and Swar <I>
ethereum_go-ethereum
train
go,go
e4db6afabeb9617f42648a7ee6ced98dc01ad2cb
diff --git a/tests/minifier.js b/tests/minifier.js index <HASH>..<HASH> 100644 --- a/tests/minifier.js +++ b/tests/minifier.js @@ -7,6 +7,10 @@ input, output; + test('`minifiy` exists', function() { + ok(minify); + }); + test('parsing non-trivial markup', function() { equal(minify('<p title="</p>">x</p>'), '<p title="</p>">x</p>'); equal(minify('<p title=" <!-- hello world --> ">x</p>'), '<p title=" <!-- hello world --> ">x</p>'); @@ -92,10 +96,6 @@ }); }); - test('`minifiy` exists', function() { - ok(minify); - }); - test('options', function() { input = '<p>blah<span>blah 2<span>blah 3</span></span></p>'; equal(minify(input), input);
test for minify() should come first
kangax_html-minifier
train
js
5f2545cff6a1ff7adf14edc33fa6a1a73bd9a68b
diff --git a/examples/nips17_adversarial_competition/run_attacks_and_defenses.py b/examples/nips17_adversarial_competition/run_attacks_and_defenses.py index <HASH>..<HASH> 100644 --- a/examples/nips17_adversarial_competition/run_attacks_and_defenses.py +++ b/examples/nips17_adversarial_competition/run_attacks_and_defenses.py @@ -447,7 +447,7 @@ def compute_and_save_scores_and_ranking(attacks_output, # higher scores are better. defense_scores = (np.sum(accuracy_on_attacks, axis=0) + np.sum(accuracy_on_targeted_attacks, axis=0)) - attack_scores = (attacks_output.dataset_image_count + attack_scores = (attacks_output.dataset_image_count * len(defenses_output) - np.sum(accuracy_on_attacks, axis=1)) targeted_attack_scores = np.sum(hit_target_class, axis=1) write_ranking(os.path.join(output_dir, 'defense_ranking.csv'),
Fix bug in computation of attack score for Adversarial competition.
tensorflow_cleverhans
train
py
f4d1e6258927cb171cb7fc8a90a3cba546a2aee5
diff --git a/rulengine/__init__.py b/rulengine/__init__.py index <HASH>..<HASH> 100644 --- a/rulengine/__init__.py +++ b/rulengine/__init__.py @@ -1,7 +1,7 @@ from rulengine.core import RuleOperator from rulengine.conditions import execute_condition -VERSION = (0, 0, 5) +VERSION = (0, 0, 6) __version__ = '.'.join(map(str, VERSION))
version bumped to <I>
baranbartu_rulengine
train
py
b54dfe5052226ad5c353208b039b06adf4da51f5
diff --git a/packages/plugin-phone/src/call.js b/packages/plugin-phone/src/call.js index <HASH>..<HASH> 100644 --- a/packages/plugin-phone/src/call.js +++ b/packages/plugin-phone/src/call.js @@ -832,11 +832,14 @@ const Call = SparkPlugin.extend({ offerToReceiveAudio: recvOnly || !!options.constraints.audio, offerToReceiveVideo: recvOnly || !!options.constraints.video }); + + this.media.set({ + audio: options.constraints.audio, + video: options.constraints.video + }); } this.media.set({ - audio: options.constraints.audio, - video: options.constraints.video, offerToReceiveAudio: options.offerOptions.offerToReceiveAudio, offerToReceiveVideo: options.offerOptions.offerToReceiveVideo });
fix(plugin-phone): Fix options setting for _join
webex_spark-js-sdk
train
js
36f7147fcd3142db70c49468a01cde64d0687de4
diff --git a/src/test/java/com/github/kongchen/smp/integration/utils/PetIdToStringModelConverter.java b/src/test/java/com/github/kongchen/smp/integration/utils/PetIdToStringModelConverter.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/github/kongchen/smp/integration/utils/PetIdToStringModelConverter.java +++ b/src/test/java/com/github/kongchen/smp/integration/utils/PetIdToStringModelConverter.java @@ -10,6 +10,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Iterator; +/** + * A ModelConverter used for testing adding custom model converters. + */ public class PetIdToStringModelConverter extends AbstractModelConverter { public PetIdToStringModelConverter() { @@ -26,7 +29,6 @@ public class PetIdToStringModelConverter extends AbstractModelConverter { } catch (ClassNotFoundException e) { throw new RuntimeException(e); } - return iterator.hasNext() ? iterator.next().resolveProperty(type, modelConverterContext, annotations, iterator) : - super.resolveProperty(type, modelConverterContext, annotations, iterator); + return super.resolveProperty(type, modelConverterContext, annotations, iterator); } }
Added comments to PetIdToStringModelConverter
kongchen_swagger-maven-plugin
train
java
040593d6ee513103028f9bea942bc7529ddfafdf
diff --git a/src/SessionTracker.php b/src/SessionTracker.php index <HASH>..<HASH> 100644 --- a/src/SessionTracker.php +++ b/src/SessionTracker.php @@ -2,6 +2,9 @@ namespace Bugsnag; +use Exception; +use InvalidArgumentException; + class SessionTracker { /**
Add missing imports in SessionTracker
bugsnag_bugsnag-php
train
php
ec5857079964f86764fddd303ca1caf606f23475
diff --git a/src/PlaygroundDesign/Module.php b/src/PlaygroundDesign/Module.php index <HASH>..<HASH> 100644 --- a/src/PlaygroundDesign/Module.php +++ b/src/PlaygroundDesign/Module.php @@ -202,10 +202,10 @@ class Module implements $serviceManager = $e->getApplication()->getServiceManager(); $options = $serviceManager->get('playgroundcore_module_options'); + $translator = $serviceManager->get('translator'); $locale = $options->getLocale(); if (!empty($locale)) { //translator - $translator = $serviceManager->get('translator'); $translator->setLocale($locale); // plugins
PLAYGROUND-<I>, fix translation user
gregorybesson_PlaygroundDesign
train
php
d085e34668afde11beceedc0106bf82253c819d1
diff --git a/aeron-driver/src/main/java/io/aeron/driver/IpcPublication.java b/aeron-driver/src/main/java/io/aeron/driver/IpcPublication.java index <HASH>..<HASH> 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/IpcPublication.java +++ b/aeron-driver/src/main/java/io/aeron/driver/IpcPublication.java @@ -233,7 +233,7 @@ public class IpcPublication implements DriverManagedResource break; } - if (Status.ACTIVE == status && consumerPosition == lastConsumerPosition) + if (consumerPosition == lastConsumerPosition) { if (producerPosition() > consumerPosition && timeNs > (timeOfLastConsumerPositionChange + unblockTimeoutNs))
[Java] Keep checking for blocked IpcPublication even when inactive.
real-logic_aeron
train
java
e2c2bdf7b0a5a133cca5d624ec7b09054ef2e1d4
diff --git a/serviced/cmd.go b/serviced/cmd.go index <HASH>..<HASH> 100644 --- a/serviced/cmd.go +++ b/serviced/cmd.go @@ -127,7 +127,7 @@ func init() { flag.Var(&options.zookeepers, "zk", "Specify a zookeeper instance to connect to (e.g. -zk localhost:2181 )") flag.BoolVar(&options.repstats, "reportstats", true, "report container statistics") flag.StringVar(&options.statshost, "statshost", "127.0.0.1:8443", "host:port for container statistics") - flag.IntVar(&options.statsperiod, "statsperiod", 1, "Period (seconds) for container statistics reporting") + flag.IntVar(&options.statsperiod, "statsperiod", 60, "Period (seconds) for container statistics reporting") flag.StringVar(&options.mcusername, "mcusername", "scott", "Username for the Zenoss metric consumer") flag.StringVar(&options.mcpasswd, "mcpasswd", "tiger", "Password for the Zenoss metric consumer") options.mount = make(ListOpts, 0)
change metric sampling rate to 1 minute
control-center_serviced
train
go
0b1881a9c1e6e2dba273a071e480042208c1ee08
diff --git a/src/AdapterInterface.php b/src/AdapterInterface.php index <HASH>..<HASH> 100644 --- a/src/AdapterInterface.php +++ b/src/AdapterInterface.php @@ -130,4 +130,16 @@ interface AdapterInterface * @return \React\Promise\PromiseInterface */ public function rename($fromPath, $toPath); + + /** + * @param string $path + * @return \React\Promise\PromiseInterface + */ + public function readlink($path); + + /** + * @param string $path + * @return \React\Promise\PromiseInterface + */ + public function symlink($path); }
readlink and symlink methods added to adapter contract
reactphp_filesystem
train
php
20f3b2c1ac7bc9f13b6067d7246ad680704f8d45
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -100,5 +100,6 @@ setuptools.setup( "requests" ], url="https://github.com/CellProfiler/prokaryote", - version=version + version=version, + zip_safe = False )
Flailing - guess what, pip decided to install as zipped egg, lot of good that does!
CellProfiler_prokaryote
train
py
a3b2677633d7791fd9f27f9740327ee5653fffe4
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/validation/XbaseJavaValidator.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/validation/XbaseJavaValidator.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/validation/XbaseJavaValidator.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/validation/XbaseJavaValidator.java @@ -354,4 +354,11 @@ public class XbaseJavaValidator extends AbstractXbaseJavaValidator { return conformanceComputer.isConformant(left, right); } + protected boolean isConformant(JvmTypeReference left, JvmTypeReference right) { + return conformanceComputer.isConformant(left, right); + } + + protected ITypeProvider getTypeProvider() { + return typeProvider; + } }
[xtend] Inferred return type for dispatch method is the same as the one for the dispatching method - inherited return types and explicitly defined return types have higher precedence, though - see <URL>
eclipse_xtext-extras
train
java
3e5e33ab4381a11209d24a89ba55b65ef7f4c7dc
diff --git a/src/Robo/RoboTasks.php b/src/Robo/RoboTasks.php index <HASH>..<HASH> 100644 --- a/src/Robo/RoboTasks.php +++ b/src/Robo/RoboTasks.php @@ -203,6 +203,14 @@ class RoboTasks extends \Robo\Tasks implements LoggerAwareInterface /** @var RoboFile|CollectionBuilder $collection */ $collection = $this->collectionBuilder(); + // Skip database drop and create incase mysql_bin is not set + $mysqlBin = $this->config(Config::KEY_ENV . '/' . Config::KEY_MYSQL_BIN); + if (empty($mysqlBin)) { + $collection->progressMessage('mySQL database managing skipped'); + + return $collection; + } + // Drop Database if ($dropDatabase === true) { $taskDropDatabase = $this->taskMysqlCommand();
[TASK] skip mysql database drop and create in case mysql bin is not set
mwr_magedeploy2
train
php
8ced1f6abfc0d9b5915f1341612236ccda6cc78d
diff --git a/src/QueryHelper.php b/src/QueryHelper.php index <HASH>..<HASH> 100644 --- a/src/QueryHelper.php +++ b/src/QueryHelper.php @@ -15,7 +15,7 @@ trait QueryHelper foreach ((array)$this as $i => $element) { $i = (string)$i; if (is_string($element)) { - return $element; + continue; } if ($element instanceof Label && ($element->getElement()->name() == $index
ehm, continue, not return
monolyth-php_formulaic
train
php
ab0e5eec4c0debaa7d7a700c56086ecdb897db17
diff --git a/app/scripts/tests/setup.js b/app/scripts/tests/setup.js index <HASH>..<HASH> 100644 --- a/app/scripts/tests/setup.js +++ b/app/scripts/tests/setup.js @@ -1,5 +1,4 @@ var jsdom = require('jsdom').jsdom; - var exposedProperties = ['window', 'navigator', 'document']; global.document = jsdom(''); @@ -21,3 +20,10 @@ global.navigator = { const noop = () => null require.extensions['.scss'] = noop require.extensions['.png'] = noop + +//// +// Sinon-Chai +//// +import chai from 'chai' +import sinonChai from 'sinon-chai' +chai.use(sinonChai)
Add Sinon-Chai setup when run tests with Mocha.
nossas_bonde-client
train
js
7d5b898b0270df4493f5e094b5bb2fa86679ec37
diff --git a/app/controllers/caboose/application_controller.rb b/app/controllers/caboose/application_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/caboose/application_controller.rb +++ b/app/controllers/caboose/application_controller.rb @@ -3,6 +3,7 @@ module Caboose protect_from_forgery before_filter :before_before_action + helper :all def before_before_action
Added all helpers to application controller
williambarry007_caboose-cms
train
rb
032e338589f377a09d1b33cac81aa779639d030d
diff --git a/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/NodeData.php b/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/NodeData.php index <HASH>..<HASH> 100644 --- a/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/NodeData.php +++ b/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/NodeData.php @@ -44,11 +44,14 @@ use TYPO3\TYPO3CR\Utility; * }, * indexes={ * @ORM\Index(name="parentpath_sortingindex",columns={"parentpathhash", "sortingindex"}), - * @ORM\Index(name="parentpath",columns={"parentpath"},options={"length": 255}), + * @ORM\Index(name="parentpath",columns={"parentpath"}), * @ORM\Index(name="identifierindex",columns={"identifier"}), * @ORM\Index(name="nodetypeindex",columns={"nodetype"}) * } * ) + * + * The parentpath index above is actually limited to a size of 255 characters in the corresponding MySQL migration, + * something that cannot be expressed through the annotation. */ class NodeData extends AbstractNodeData {
TASK: Remove option from Index annotation It is not supported (like in later versions). Leave a comment instead,
neos_neos-development-collection
train
php
2142bace0cfa24ad5b4ae7a136aa81cbf2767d5f
diff --git a/lib/raven/transports/http.rb b/lib/raven/transports/http.rb index <HASH>..<HASH> 100644 --- a/lib/raven/transports/http.rb +++ b/lib/raven/transports/http.rb @@ -56,7 +56,7 @@ module Raven end def ssl_configuration - (configuration.ssl.dup || {}).merge!( + (configuration.ssl || {}).merge( :verify => configuration.ssl_verification, :ca_file => configuration.ssl_ca_file )
Can't 'dup' a nil, besides I can just regular-merge.
getsentry_raven-ruby
train
rb
045f7f5643539b21f6f46ee1ce2daee76f74a954
diff --git a/telethon/tl/session.py b/telethon/tl/session.py index <HASH>..<HASH> 100644 --- a/telethon/tl/session.py +++ b/telethon/tl/session.py @@ -163,7 +163,8 @@ class Session: rows = [] for p_id, p_hash in data.get('entities', []): - rows.append((p_id, p_hash, None, None, None)) + if p_hash is not None: + rows.append((p_id, p_hash, None, None, None)) return rows except UnicodeDecodeError: return [] # No entities
Assert hash is not None when migrating from JSON sessions
LonamiWebs_Telethon
train
py
9de04a358216946f08335d210600c4f42477c334
diff --git a/src/File.php b/src/File.php index <HASH>..<HASH> 100644 --- a/src/File.php +++ b/src/File.php @@ -30,13 +30,16 @@ class File extends Field $scale = m('scale'); $scale->resize($upload->fullPath(), $upload->name(), $upload->uploadDir); } + + // TODO: Work with upload real and URL paths + $urlPath = $upload->path().$upload->name(); /** @var \samson\activerecord\materialfield $field Save path to file in DB */ $field = Field::fromMetadata($_GET['e'], $_GET['f'], $_GET['i']); - $field->save($file_path); + $field->save($urlPath); // Return upload object for further usage - return array('status' => 1, 'path' => $upload->fullPath()); + return array('status' => 1, 'path' => $urlPath); } /** Delete file controller */
Fixed full path to support internal web-application paths
samsonos_cms_input_upload
train
php
90d3cd6c2c8e5a530ada28f11aa8a504d0fa3682
diff --git a/goscale/themes/context_processors.py b/goscale/themes/context_processors.py index <HASH>..<HASH> 100644 --- a/goscale/themes/context_processors.py +++ b/goscale/themes/context_processors.py @@ -9,7 +9,8 @@ def theme(request): # set config site_theme = settings.THEME static_theme_url = '%sthemes/%s/static/' % (settings.STATIC_URL, site_theme) - config = {} + static_common_url = '%sthemes/common/static/' % settings.STATIC_URL + config = {} settings_list = ['GOSCALE_BOOTSTRAP_THEMES', 'GOSCALE_BOOTSTRAP_THEME', 'GOSCALE_AJAXLINKS', 'GOSCALE_AJAXLINKS_EXCEPTIONS'] for setting in settings_list: @@ -20,6 +21,7 @@ def theme(request): 'site': get_current_site(request), 'GOSCALE_THEME': site_theme, 'STATIC_THEME_URL': static_theme_url, + 'STATIC_COMMON_URL': static_common_url, 'goscale_config': config, 'goscale_bootstrap_theme': theme if theme else conf.GOSCALE_BOOTSTRAP_THEME, 'goscale_config_json': simplejson.dumps(config),
goscale/themes/context_processors.py
sternoru_goscalecms
train
py
e87d65a43b99e0be33f26f66015ded31bb333c1f
diff --git a/spec/collins/api/asset_spec.rb b/spec/collins/api/asset_spec.rb index <HASH>..<HASH> 100644 --- a/spec/collins/api/asset_spec.rb +++ b/spec/collins/api/asset_spec.rb @@ -119,6 +119,18 @@ describe Collins::Api::Asset do end end + context "#count" do + include_context "collins api" + def method; :get end + def uri; "/api/assets?page=0&size=1" end + + it "basic use-case" do + api.returns 200, CollinsFixture.data('find_no_details.json') + total = subject.count + total.should == 3 + end + end + context "#get" do include_context "collins api" def method; :get end
Add basic unit test for the assets count method
tumblr_collins_client
train
rb
11f873dad7bc033e67e6ef1ef247be9918cde2f7
diff --git a/resource_aws_cloudfront_distribution.go b/resource_aws_cloudfront_distribution.go index <HASH>..<HASH> 100644 --- a/resource_aws_cloudfront_distribution.go +++ b/resource_aws_cloudfront_distribution.go @@ -6,6 +6,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/errwrap" "github.com/hashicorp/terraform/helper/resource" @@ -527,6 +528,12 @@ func resourceAwsCloudFrontDistributionRead(d *schema.ResourceData, meta interfac resp, err := conn.GetDistribution(params) if err != nil { + if errcode, ok := err.(awserr.Error); ok && errcode.Code() == "NoSuchDistribution" { + log.Printf("[WARN] No Distribution found: %s", d.Id()) + d.SetId("") + return nil + } + return err }
providers/aws: cloudfront distribution <I> should mark as gone (#<I>)
terraform-providers_terraform-provider-aws
train
go