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 |
|---|---|---|---|---|---|
4d0309413e73dad16a6e9303d5add96a99ac0368 | diff --git a/tests/Asserts/ArtisanAssertsTest.php b/tests/Asserts/ArtisanAssertsTest.php
index <HASH>..<HASH> 100644
--- a/tests/Asserts/ArtisanAssertsTest.php
+++ b/tests/Asserts/ArtisanAssertsTest.php
@@ -11,6 +11,14 @@ class ArtisanAssertsTest extends TestCase
}
/** @test */
+ public function which_accepts_file_path_as_output_parameter()
+ {
+ $this->artisan('generic');
+
+ $this->seeArtisanOutput(__DIR__ . '/ArtisanAssertsTest/correct.output.txt');
+ }
+
+ /** @test */
public function it_has_dont_see_artisan_output_assertion()
{
$this->artisan('generic');
@@ -19,6 +27,14 @@ class ArtisanAssertsTest extends TestCase
}
/** @test */
+ public function which_also_accepts_file_path_as_output_parameter()
+ {
+ $this->artisan('generic');
+
+ $this->dontSeeArtisanOutput(__DIR__ . '/ArtisanAssertsTest/incorrect.output.txt');
+ }
+
+ /** @test */
public function it_has_see_artisan_table_output_assertion()
{
$this->artisan('table-output'); | ITT: Ability to use file path - tests added. | dmitry-ivanov_laravel-testing-tools | train | php |
038aaddb7f52e8034e87f9af83eab87d91e46f4e | diff --git a/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/get/OServerCommandGetStaticContent.java b/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/get/OServerCommandGetStaticContent.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/get/OServerCommandGetStaticContent.java
+++ b/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/get/OServerCommandGetStaticContent.java
@@ -97,7 +97,7 @@ public class OServerCommandGetStaticContent extends OServerCommandConfigurableAb
}
iResponse.setHeader(header);
- return super.beforeExecute(iRequest, iResponse);
+ return true;
}
@Override | Fixed cache problem: every static resource returned a no-cache header. This is the reason why the WebServer performed so bad | orientechnologies_orientdb | train | java |
70de62dee450638640cf1e83488847266fdbf5bf | diff --git a/classes/PHPTAL/Context.php b/classes/PHPTAL/Context.php
index <HASH>..<HASH> 100644
--- a/classes/PHPTAL/Context.php
+++ b/classes/PHPTAL/Context.php
@@ -499,10 +499,8 @@ function phptal_isempty($var)
*/
function phptal_true($var)
{
- if (is_callable($var, false, $callable_name)) {
- if ($callable_name === 'Closure::__invoke') {
- return $var();
- }
+ if (is_a($var, 'Closure')) {
+ return $var();
}
return $var && (!$var instanceof Countable || count($var));
}
@@ -544,10 +542,8 @@ function phptal_tostring($var)
return $xml;
}
}
- if (is_callable($var, false, $callable_name)) {
- if ($callable_name === 'Closure::__invoke') {
- return $var();
- }
+ if (is_a($var, 'Closure')) {
+ return $var();
}
return (string)$var;
} | Closures: Updating check for closure call for data type compatibility | phptal_PHPTAL | train | php |
46f6d3f99ff51ea0d6a83df300218c29376d7080 | diff --git a/protocol-designer/src/ui/steps/actions/__tests__/actions.test.js b/protocol-designer/src/ui/steps/actions/__tests__/actions.test.js
index <HASH>..<HASH> 100644
--- a/protocol-designer/src/ui/steps/actions/__tests__/actions.test.js
+++ b/protocol-designer/src/ui/steps/actions/__tests__/actions.test.js
@@ -18,6 +18,9 @@ describe('steps actions', () => {
pipettes: { mount: 'left' },
})
formLevel.getNextDefaultPipetteId.mockReturnValue(pipetteId)
+ stepFormSelectors._getStepFormData.mockReturnValue({
+ stepType: 'magnet',
+ })
})
test('action is created to populate form with default engage height to scale when engage magnet step', () => {
@@ -44,6 +47,7 @@ describe('steps actions', () => {
moduleId: magnetModule,
magnetAction: magnetAction,
engageHeight: '10.9',
+ stepType: 'magnet',
},
},
])
@@ -73,6 +77,7 @@ describe('steps actions', () => {
moduleId: magnetModule,
magnetAction: magnetAction,
engageHeight: null,
+ stepType: 'magnet',
},
},
]) | fix(protocol-designer): fix failing action test (#<I>) | Opentrons_opentrons | train | js |
f391ac9f8e8e4908527de968f9077834380a883b | diff --git a/src/WebinoImageThumb/PhpThumb/Plugin/Sharpen.php b/src/WebinoImageThumb/PhpThumb/Plugin/Sharpen.php
index <HASH>..<HASH> 100644
--- a/src/WebinoImageThumb/PhpThumb/Plugin/Sharpen.php
+++ b/src/WebinoImageThumb/PhpThumb/Plugin/Sharpen.php
@@ -2,7 +2,7 @@
namespace WebinoImageThumb\PhpThumb\Plugin;
-use PHPThumb\PHPThumb;
+use PHPThumb\GD as PHPThumb;
class Sharpen implements \PHPThumb\PluginInterface
{
@@ -34,4 +34,4 @@ class Sharpen implements \PHPThumb\PluginInterface
return $phpthumb;
}
-}
+}
\ No newline at end of file
diff --git a/src/WebinoImageThumb/WebinoImageThumb.php b/src/WebinoImageThumb/WebinoImageThumb.php
index <HASH>..<HASH> 100644
--- a/src/WebinoImageThumb/WebinoImageThumb.php
+++ b/src/WebinoImageThumb/WebinoImageThumb.php
@@ -80,4 +80,4 @@ class WebinoImageThumb
{
return new ExtraPlugins\Sharpen($offset, $matrix);
}
-}
+}
\ No newline at end of file | - The method getOldImage() does not seem to exist on object<PHPThumb\PHPThumb> (solved); | webino_WebinoImageThumb | train | php,php |
b2c5e3843f625787c55888ed8797880fad2f647a | diff --git a/src/iframeResizer.js b/src/iframeResizer.js
index <HASH>..<HASH> 100644
--- a/src/iframeResizer.js
+++ b/src/iframeResizer.js
@@ -17,7 +17,6 @@
msgHeaderLen = msgHeader.length,
msgId = '[iFrameSizer]', //Must match iframe msg ID
msgIdLen = msgId.length,
- page = '', //:'+location.href, //Uncoment to debug nested iFrames
pagePosition = null,
requestAnimationFrame = window.requestAnimationFrame,
resetRequiredMethods = {max:1,scroll:1,bodyScroll:1,documentElementScroll:1},
@@ -216,7 +215,7 @@
function checkIFrameExists(){
if (null === messageData.iframe) {
- warn('iFrame ('+messageData.id+') does not exist on ' + page);
+ warn(' IFrame ('+messageData.id+') not found');
return false;
}
return true; | Updated warning message for iFrame not found | davidjbradshaw_iframe-resizer | train | js |
4604e43088fa093a8bc31cf36a35c7249f0e8ba8 | diff --git a/src/server/pps/server/worker_pool.go b/src/server/pps/server/worker_pool.go
index <HASH>..<HASH> 100644
--- a/src/server/pps/server/worker_pool.go
+++ b/src/server/pps/server/worker_pool.go
@@ -307,3 +307,20 @@ func (a *apiServer) delWorkerPool(id string) {
defer a.workerPoolsLock.Unlock()
delete(a.workerPools, id)
}
+
+func workerClients(ctx context.Context, id string, etcdClient etcd.Client, etcdPrefix string) ([]workerpkg.WorkerClient, error) {
+ resp, err := etcdClient.Get(ctx, path.Join(etcdPrefix, workerEtcdPrefix, id), etcd.WithPrefix())
+ if err != nil {
+ return nil, err
+ }
+
+ var result []workerpkg.WorkerClient
+ for _, kv := range resp.Kvs {
+ conn, err := grpc.Dial(fmt.Sprintf("%s:%d", string(kv.Key), client.PPSWorkerPort), grpc.WithInsecure(), grpc.WithTimeout(5*time.Second))
+ if err != nil {
+ return nil, err
+ }
+ result = append(result, workerpkg.NewWorkerClient(conn))
+ }
+ return result, nil
+} | Adds a method to get workerClients for a pool. | pachyderm_pachyderm | train | go |
ce2f5e4a7a668ad5acc8f8ed028172723eff5c5d | diff --git a/lib/fakeredis/minitest.rb b/lib/fakeredis/minitest.rb
index <HASH>..<HASH> 100644
--- a/lib/fakeredis/minitest.rb
+++ b/lib/fakeredis/minitest.rb
@@ -3,7 +3,7 @@
#
# # Gemfile
# group :test do
-# gem 'rspec'
+# gem 'minitest'
# gem 'fakeredis', :require => 'fakeredis/minitest'
# end
# | fix doc that minitest is not rspec | guilleiguaran_fakeredis | train | rb |
1fdb52035cfb1b9d00db7cd6f42592f486dd6128 | diff --git a/src/Notificator.php b/src/Notificator.php
index <HASH>..<HASH> 100644
--- a/src/Notificator.php
+++ b/src/Notificator.php
@@ -10,12 +10,21 @@ namespace Lloople\Notificator;
class Notificator
{
+ /**
+ * @param string $message
+ * @param int $duration
+ */
public static function success(string $message, int $duration = 5000)
{
self::createNotification('success', $message, $duration);
}
+ /**
+ * @param string $type
+ * @param string $message
+ * @param int $duration
+ */
public static function createNotification(string $type, string $message, int $duration)
{
@@ -24,24 +33,30 @@ class Notificator
session()->flash('notifications.' . $notification->getId(), $notification);
}
- public static function getUniqueId(): string
- {
-
- return uniqid();
- }
-
+ /**
+ * @param string $message
+ * @param int $duration
+ */
public static function warning(string $message, int $duration = 5000)
{
self::createNotification('warning', $message, $duration);
}
+ /**
+ * @param string $message
+ * @param int $duration
+ */
public static function info(string $message, int $duration = 5000)
{
self::createNotification('info', $message, $duration);
}
+ /**
+ * @param string $message
+ * @param int $duration
+ */
public static function error(string $message, int $duration = 5000)
{ | Delete unused method and add PHPDoc | Lloople_laravel-notificator | train | php |
8c4e270fa4ead6f83810c0ccedce281c0f5469cd | diff --git a/classes/models/forum.php b/classes/models/forum.php
index <HASH>..<HASH> 100644
--- a/classes/models/forum.php
+++ b/classes/models/forum.php
@@ -130,4 +130,10 @@ class Forum extends Base
$this->subscription()->delete();
}
}
+
+ public function unsubscribe()
+ {
+ return $this->subscribe(false);
+ }
+
}
diff --git a/classes/models/topic.php b/classes/models/topic.php
index <HASH>..<HASH> 100644
--- a/classes/models/topic.php
+++ b/classes/models/topic.php
@@ -84,4 +84,9 @@ class Topic extends Base
}
}
+ public function unsubscribe()
+ {
+ return $this->subscribe(false);
+ }
+
} | Add more expressive methods for unsubscribing from forums and topics. | fluxbb_core | train | php,php |
ae0892d67fdca0ffe51b584f08e504d43bf5cfa4 | diff --git a/budou/budou.py b/budou/budou.py
index <HASH>..<HASH> 100644
--- a/budou/budou.py
+++ b/budou/budou.py
@@ -64,6 +64,7 @@ def main():
elif not sys.stdin.isatty():
source = sys.stdin.read()
else:
+ print(__doc__.split("\n\n")[1])
sys.exit()
result = parse( | Make sure "Usage" is displayed when no source is provided | google_budou | train | py |
5f7369a46ce92fdaf9464804ed3947974d2e9e63 | diff --git a/src/xhr.js b/src/xhr.js
index <HASH>..<HASH> 100644
--- a/src/xhr.js
+++ b/src/xhr.js
@@ -121,7 +121,7 @@ XHR.load = function(xhr, cfg, resolve, reject) {
if (cfg.cache) {
XHR.cache(xhr);
}
- var data = xhr.response || xhr.responseText;
+ var data = xhr.responseType ? xhr.response : xhr.responseText;
if (cfg.responseData && XHR.isData(data)) {
var ret = cfg.responseData(data);
data = ret === undefined ? data : ret; | only use response when responseType is present | esha_posterior | train | js |
cf05fd6322cc2493ea79ca5f0cbcc09650cde557 | diff --git a/salt/fileserver/svnfs.py b/salt/fileserver/svnfs.py
index <HASH>..<HASH> 100644
--- a/salt/fileserver/svnfs.py
+++ b/salt/fileserver/svnfs.py
@@ -732,6 +732,8 @@ def _file_lists(load, form):
env_root
)
ret['files'].add(os.path.join(repo['mountpoint'], rel_fn))
+ if repo['mountpoint']:
+ ret['dirs'].add(repo['mountpoint'])
# Convert all compiled sets to lists
for key in ret:
ret[key] = sorted(ret[key]) | Fix file.recurse on root of svnfs repo
This fixes a condition where a file.recurse fails on the root of an
svnfs repo when the repo has a mountpoint. See #<I>. | saltstack_salt | train | py |
4e24e25d326a3fc30267f7fa8d1cb32854546cca | diff --git a/tests/test_twitter.py b/tests/test_twitter.py
index <HASH>..<HASH> 100644
--- a/tests/test_twitter.py
+++ b/tests/test_twitter.py
@@ -41,7 +41,7 @@ def client_oauth(key, event_loop):
clients[key] = PeonyClient(auth=headers[key], **creds)
clients[key].loop = event_loop
- clients[key]._session = aiohttp.ClientSession(loop=event_loop)
+ clients[key]._session = aiohttp.ClientSession()
return clients[key] | tests: don't use pytest-asyncio loop (?)
I'm not sure, but it seems like the loop used by the tests is wrong
sometimes. | odrling_peony-twitter | train | py |
07b652614c0a0929cd1be42f862183e2806c8f5d | diff --git a/lib/middleware.js b/lib/middleware.js
index <HASH>..<HASH> 100644
--- a/lib/middleware.js
+++ b/lib/middleware.js
@@ -69,6 +69,9 @@ function createMiddleware(logger, fileList, emitter, injector) {
} else {
reverseContextFile = reverseContextFile.path;
}
+
+ log.debug(`Adding reverse context file ${reverseContextFile} to chunk ${typeof chunk}(${chunk.length})`);
+
chunk = chunk.replace('%REVERSE_CONTEXT%', reverseContextFile);
return includeScriptsIntoContext(includeServedOnly(files), log, injector, chunk, req);
} | Some more logs to help debug travis | sabberworm_karma-iframes | train | js |
0b31ec52ae1acf41470717294923749a4b45d443 | diff --git a/lib/adhearsion/process.rb b/lib/adhearsion/process.rb
index <HASH>..<HASH> 100644
--- a/lib/adhearsion/process.rb
+++ b/lib/adhearsion/process.rb
@@ -32,11 +32,6 @@ module Adhearsion
event :reset do
transition all => :booting
end
-
- def trigger_shutdown_events
- Events.trigger_immediately :shutdown
- end
-
end
def initialize
@@ -48,6 +43,10 @@ module Adhearsion
puts "Adhearsion transitioning from #{from} to #{to}."
end
+ def trigger_shutdown_events
+ Events.trigger_immediately :shutdown
+ end
+
def self.method_missing(method_name, *args, &block)
instance.send method_name, *args, &block
end | [FEATURE] Trigger shutdown events | adhearsion_adhearsion | train | rb |
e917ce4a06ad2cb902c755bf2b84701d0f8023f9 | diff --git a/options.go b/options.go
index <HASH>..<HASH> 100644
--- a/options.go
+++ b/options.go
@@ -43,8 +43,14 @@ func NewOptions() Options {
func optionsWithDefaults(opts Options) Options {
opts.Env = defaults.String(opts.Env, defaults.String(os.Getenv("GO_ENV"), "development"))
opts.LogLevel = defaults.String(opts.LogLevel, "debug")
- pwd, _ := os.Getwd()
- opts.LogDir = defaults.String(opts.LogDir, filepath.Join(pwd, "logs"))
+
+ if opts.Env == "test" {
+ opts.LogDir = os.TempDir()
+ } else {
+ pwd, _ := os.Getwd()
+ opts.LogDir = defaults.String(opts.LogDir, filepath.Join(pwd, "logs"))
+ }
+
if opts.SessionStore == nil {
opts.SessionStore = sessions.NewCookieStore([]byte(os.Getenv("SESSION_SECRET")))
} | this outputs the test logs to a tmp folder isntead of the folder were the tests run | gobuffalo_buffalo | train | go |
96b122d425828295e415da24c0fff14e59ca1c98 | diff --git a/go/client/cmd_chat_conv_info.go b/go/client/cmd_chat_conv_info.go
index <HASH>..<HASH> 100644
--- a/go/client/cmd_chat_conv_info.go
+++ b/go/client/cmd_chat_conv_info.go
@@ -97,8 +97,8 @@ func (c *CmdChatConvInfo) Run() error {
if info.Triple.TopicType != chat1.TopicType_CHAT {
topicType = fmt.Sprintf(" (%s)", info.Triple.TopicType)
}
- _, err = dui.Printf("ConversationName: %s%s\nConversationID: %v\n",
- utils.FormatConversationName(info, c.G().Env.GetUsername().String()), topicType, info.Id)
+ _, err = dui.Printf("ConversationName: %s%s\nConversationID: %v\nConvIDShort: %v\n",
+ utils.FormatConversationName(info, c.G().Env.GetUsername().String()), topicType, info.Id, info.Id.DbShortFormString())
return err
} | add convid short to conv info command (#<I>) | keybase_client | train | go |
755b5c60436d1ccb58be71fc18b637b51542a107 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -213,11 +213,11 @@ class IpfsRepo {
(err, res) => {
log('init', err, res)
if (err) {
- return callback(err)
- }
-
- if (!res.config) {
- return callback(new Error('repo is not initialized yet'))
+ return callback(Object.assign(new Error('repo is not initialized yet'),
+ {
+ code: 'ERR_REPO_NOT_INITIALIZED',
+ path: this.path
+ }))
}
callback()
} | feat: add uniform error to isInitialized
_isInitialized is used in several other repos to check the repo even being a pseudo private method
the error should be uniform for easier handling and not whatever this.config.exists(cb) or this.version.check(repoVersion, cb) returns on error | ipfs_js-ipfs-repo | train | js |
f04049c194318a35fdf726bd7749dad3eb55fd99 | diff --git a/core/Core/BackController.php b/core/Core/BackController.php
index <HASH>..<HASH> 100644
--- a/core/Core/BackController.php
+++ b/core/Core/BackController.php
@@ -57,30 +57,4 @@ class BackController
{
$this->action = $action;
}
-
- /**
- * Renvoie une instance de \phpGone\Renderer\Renderer
- *
- * @return \phpGone\Renderer\Renderer
- */
- public function getRenderer()
- {
- if (is_null($this->renderer)) {
- $this->setRenderer(new \phpGone\Renderer\Renderer());
- return $this->renderer;
- } else {
- return $this->renderer;
- }
- }
-
- /**
- * Défini l'attribut renderer
- *
- * @param \phpGone\Renderer\Renderer $renderer
- * @return void
- */
- private function setRenderer(\phpGone\Renderer\Renderer $renderer)
- {
- $this->renderer = $renderer;
- }
} | Remove renderer method in backController and format files | beMang_phpgone | train | php |
4838e5522a6a74a10ca49bda9f22750d21219ea3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -3,7 +3,7 @@
var path = require('path'),
chalk = require('chalk'),
childProcess = require('child_process'),
- phantomjs = require('phantomjs'),
+ phantomjs = require('phantomjs-prebuilt'),
binPath = phantomjs.path,
phantomjsRunnerDir = path.dirname(require.resolve('qunit-phantomjs-runner')); | Update phantomjs package name. | jonkemp_node-qunit-phantomjs | train | js |
8855b7b29dc1233632dd542b17566275578f1a5a | diff --git a/src/main/java/org/openqa/selenium/WebElement.java b/src/main/java/org/openqa/selenium/WebElement.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/openqa/selenium/WebElement.java
+++ b/src/main/java/org/openqa/selenium/WebElement.java
@@ -101,17 +101,6 @@ public interface WebElement extends SearchContext {
String getAttribute(String name);
/**
- * If the element is a checkbox this will toggle the elements state from selected to not
- * selected, or from not selected to selected.
- *
- * @return Whether the toggled element is selected (true) or not (false) after this toggle is
- * complete
- * @deprecated To be removed. Determine the current state using {@link #isSelected()}
- */
- @Deprecated
- boolean toggle();
-
- /**
* Determine whether or not this element is selected or not. This operation only applies to
* input elements such as checkboxes, options in a select and radio buttons.
* | SimonStewart: Deleting the deprecated toggle method
r<I> | appium_java-client | train | java |
4d0cf1e0c5720dc02f207aff2037f7781af8cf76 | diff --git a/bootstraps/react-dom-bootstrap.js b/bootstraps/react-dom-bootstrap.js
index <HASH>..<HASH> 100644
--- a/bootstraps/react-dom-bootstrap.js
+++ b/bootstraps/react-dom-bootstrap.js
@@ -82,7 +82,7 @@ function makeWebTagFactory(tagName) {
children.push(val)
}
}
- return React.createElement.call(React, tagName, props, children)
+ return React.createElement(tagName, props, ...children)
}
} | Splat children argument to stop react-js warning about array-contained children having a key property | marcuswestin_tags.js | train | js |
df540ab25086069107f27d32d6ca14fb7fdbacbe | diff --git a/server/client.js b/server/client.js
index <HASH>..<HASH> 100755
--- a/server/client.js
+++ b/server/client.js
@@ -9,6 +9,11 @@ var util = require('util'),
Stats = require('./stats.js');
+var next_client_id = 1;
+function generateClientId() {
+ return next_client_id++;
+}
+
var Client = function (websocket, opts) {
var that = this;
@@ -31,12 +36,8 @@ var Client = function (websocket, opts) {
// Clients address
this.real_address = this.websocket.meta.real_address;
- // A hash to identify this client instance
- this.hash = crypto.createHash('sha256')
- .update(this.real_address)
- .update('' + Date.now())
- .update(Math.floor(Math.random() * 100000).toString())
- .digest('hex');
+ // An ID to identify this client instance
+ this.id = generateClientId();
this.state = new State(this); | Switching client IDs from pointless expensive sha<I> hashes to simple ints | prawnsalad_KiwiIRC | train | js |
6daeb1687004c083d4e3cc72e883b0cab328eae2 | diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/application/agent_spec.rb
+++ b/spec/unit/application/agent_spec.rb
@@ -5,6 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/agent'
require 'puppet/application/agent'
require 'puppet/network/server'
+require 'puppet/network/handler'
require 'puppet/daemon'
describe Puppet::Application::Agent do
diff --git a/spec/unit/network/xmlrpc/client_spec.rb b/spec/unit/network/xmlrpc/client_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/network/xmlrpc/client_spec.rb
+++ b/spec/unit/network/xmlrpc/client_spec.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+require 'puppet/network/client'
Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") } | maint: Fix a test that was missing a require
Paired-with: Nick Lewis | puppetlabs_puppet | train | rb,rb |
504f7b18fe1037bf79da0119329f2aafdee4703a | diff --git a/thinc/initializers.py b/thinc/initializers.py
index <HASH>..<HASH> 100644
--- a/thinc/initializers.py
+++ b/thinc/initializers.py
@@ -52,7 +52,7 @@ def configure_uniform_init(
def normal_init(ops: Ops, shape: Shape, *, fan_in: int = -1) -> FloatsXd:
if fan_in == -1:
fan_in = shape[1]
- scale = ops.xp.sqrt(1.0 / fan_in)
+ scale = float(ops.xp.sqrt(1.0 / fan_in))
size = int(ops.xp.prod(ops.xp.asarray(shape)))
inits = numpy.random.normal(scale=scale, size=size).astype("float32")
inits = ops.reshape_f(inits, shape) | Cast scale to float in normal_init() for cupy (#<I>) | explosion_thinc | train | py |
81d36a14b5c41d3c444cb875b128d3dee01acef3 | diff --git a/harmonize.js b/harmonize.js
index <HASH>..<HASH> 100644
--- a/harmonize.js
+++ b/harmonize.js
@@ -21,6 +21,7 @@
*/
var child_process = require("child_process");
var isIojs = require("is-iojs");
+var tty = require('tty');
module.exports = function() {
if (typeof Proxy == 'undefined') { // We take direct proxies as our marker
@@ -35,7 +36,7 @@ module.exports = function() {
return;
}
- var node = child_process.spawn(process.argv[0], ['--harmony', '--harmony-proxies'].concat(process.argv.slice(1)), {});
+ var node = child_process.spawn(process.argv[0], ['--harmony', '--harmony-proxies'].concat(process.argv.slice(1)), { pty: tty.isatty(0) });
node.stdout.pipe(process.stdout);
node.stderr.pipe(process.stderr);
node.on("close", function(code) { | spawn with correct tty, resolves color issues | dcodeIO_node-harmonize | train | js |
49ad278e6f7efd54a3737b7f1fdc6264dfae9470 | diff --git a/api_test.go b/api_test.go
index <HASH>..<HASH> 100644
--- a/api_test.go
+++ b/api_test.go
@@ -69,6 +69,8 @@ var (
"virCopyLastError",
"virFreeError",
"virGetLastErrorMessage",
+ "virGetLastErrorCode",
+ "virGetLastErrorDomain",
"virResetLastError",
"virSaveLastError",
"virDefaultErrorFunc", | Blacklist virGetLastError{Code,Domain}
These methods will not be exposed to apps, since we always return
all errors. | libvirt_libvirt-go | train | go |
cd4f4f88e14dbdc76aea042ee3dea6b090358e29 | diff --git a/mutagen/id3.py b/mutagen/id3.py
index <HASH>..<HASH> 100644
--- a/mutagen/id3.py
+++ b/mutagen/id3.py
@@ -254,7 +254,8 @@ class ID3(DictProxy, mutagen.Metadata):
if self.f_extended:
extsize = self.__fullread(4)
- if (extsize.decode('ascii') if PY3 else extsize) in Frames:
+ frame_id = extsize.decode("ascii", "replace") if PY3 else extsize
+ if frame_id in Frames:
# Some tagger sets the extended header flag but
# doesn't write an extended header; in this case, the
# ID3 data follows immediately. Since no extended | don't raise decode error when checking for potential frame id | quodlibet_mutagen | train | py |
496d4859ff656e4aa41993ddbe031b29d58f179f | diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index <HASH>..<HASH> 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -128,7 +128,6 @@ EOS
gpg_opts.merge!(gen_sign_user_opts(from))
gpg_opts = HookManager.run("gpg-options",
{:operation => "sign", :options => gpg_opts}) || gpg_opts
-
begin
if GPGME.respond_to?('detach_sign')
sig = GPGME.detach_sign(format_payload(payload), gpg_opts)
@@ -443,16 +442,18 @@ private
# if gpgkey set for this account, then use that
# elsif only one account, then leave blank so gpg default will be user
# else set --local-user from_email_address
+ # NOTE: multiple signers doesn't seem to work with gpgme (2.0.2, 1.0.8)
+ #
def gen_sign_user_opts from
account = AccountManager.account_for from
account ||= AccountManager.default_account
if !account.gpgkey.nil?
- opts = {:signers => account.gpgkey}
+ opts = {:signer => account.gpgkey}
elsif AccountManager.user_emails.length == 1
# only one account
opts = {}
else
- opts = {:signers => from}
+ opts = {:signer => from}
end
opts
end | Multiple Signers did not work with gpgme <I>
Exchanged :signers with :signer, this seems to allow to create a
signature based on account or from.
Previously always the default or first private key had been used.
But I haven't communicated with the developers of gpgme. | sup-heliotrope_sup | train | rb |
723a272196f283eb142ac0bcb50be7891c805048 | diff --git a/test/deserializer_test.js b/test/deserializer_test.js
index <HASH>..<HASH> 100644
--- a/test/deserializer_test.js
+++ b/test/deserializer_test.js
@@ -6,7 +6,7 @@ var vows = require('vows')
, error_gallery = process.env.XMLRPC_ERROR_GALLERY
-vows.describe('deserialize').addBatch({
+vows.describe('Deserializer').addBatch({
'deserializeMethodResponse() called with': {
diff --git a/test/serializer_test.js b/test/serializer_test.js
index <HASH>..<HASH> 100644
--- a/test/serializer_test.js
+++ b/test/serializer_test.js
@@ -5,7 +5,7 @@ var vows = require('vows')
, Serializer = require('../lib/serializer')
-vows.describe('deserialize').addBatch({
+vows.describe('Serializer').addBatch({
'serializeMethodCall() called with': { | Minor renaming of (de)serializing tests. | baalexander_node-xmlrpc | train | js,js |
1b504ffe19a51127a84aaba9d63966a8cfa3b25f | diff --git a/Exceptions/InvalidKeyException.php b/Exceptions/InvalidKeyException.php
index <HASH>..<HASH> 100644
--- a/Exceptions/InvalidKeyException.php
+++ b/Exceptions/InvalidKeyException.php
@@ -16,7 +16,7 @@ class InvalidKeyException extends \LogicException
sprintf(
'The key \'%s\' does not exist on the collection.%s',
$offset,
- 0 !== count($validOffsets)
+ 0 !== \count($validOffsets)
? sprintf(' The valid keys are: \'%s\'', implode('\', \'', $validOffsets))
: ''
) | Collection | Use fqn for performance | aircury_collection | train | php |
aee73d67294c6cb8b152c5934ad4a139812c28f7 | diff --git a/pkg/client/record/event.go b/pkg/client/record/event.go
index <HASH>..<HASH> 100644
--- a/pkg/client/record/event.go
+++ b/pkg/client/record/event.go
@@ -176,7 +176,11 @@ func recordEvent(sink EventSink, event *api.Event, updateExistingEvent bool) boo
glog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err)
return true
case *errors.StatusError:
- glog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err)
+ if errors.IsAlreadyExists(err) {
+ glog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err)
+ } else {
+ glog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err)
+ }
return true
case *errors.UnexpectedObjectError:
// We don't expect this; it implies the server's response didn't match a | Do not log "event already exists" errors
When the server rejects an event because it has already been created, log it
at a very high level (debug) instead of the default level. Duplicate events
typically only occur due to programmer error or failure conditions, so they
can safely be ignored in production environments. | kubernetes_kubernetes | train | go |
bb31a0a4d699784d83b18e9a3993ec897ae362ff | diff --git a/libraries/lithium/g11n/Locale.php b/libraries/lithium/g11n/Locale.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/g11n/Locale.php
+++ b/libraries/lithium/g11n/Locale.php
@@ -143,6 +143,7 @@ class Locale extends \lithium\core\StaticObject {
* // returns array('zh_Hans_HK_REVISED', 'zh_Hans_HK', 'zh_Hans', 'zh', 'root')
* }}}
*
+ * @link http://www.unicode.org/reports/tr35/tr35-13.html#Locale_Inheritance
* @param string $locale A locale in an arbitrary form (i.e. `'en_US'` or `'EN-US'`).
* @return array Indexed array of locales (starting with the most specific one).
*/ | Adding reference to RFC to `Locale` class docblock. | UnionOfRAD_framework | train | php |
decf28d9f08a94fb19afb965b5c05aaa65b5eede | diff --git a/pyemu/plot/plot_utils.py b/pyemu/plot/plot_utils.py
index <HASH>..<HASH> 100644
--- a/pyemu/plot/plot_utils.py
+++ b/pyemu/plot/plot_utils.py
@@ -863,7 +863,7 @@ def ensemble_helper(ensemble,bins=10,facecolor='0.5',plot_cols=None,
# try:
# en.loc[:,pc].hist(bins=plot_bins,facecolor=fc,
# edgecolor="none",alpha=0.5,
- # normed=True,ax=ax)
+ # density=True,ax=ax)
# except Exception as e:
# logger.warn("error plotting histogram for {0}:{1}".
# format(pc,str(e)))
@@ -871,7 +871,7 @@ def ensemble_helper(ensemble,bins=10,facecolor='0.5',plot_cols=None,
#print(plot_bins)
#print(vals)
- ax.hist(vals,bins=plot_bins,edgecolor="none",alpha=0.5,normed=True,facecolor=fc)
+ ax.hist(vals,bins=plot_bins,edgecolor="none",alpha=0.5,density=True,facecolor=fc)
v = None
if deter_vals is not None:
for pc in plot_col: | Fixed tiny matplotlib whinge abour normed->density in hist | jtwhite79_pyemu | train | py |
eb4e3146819e6a86c031621f0471fdd32a970c8e | diff --git a/android/src/main/java/com/horcrux/svg/GroupView.java b/android/src/main/java/com/horcrux/svg/GroupView.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/horcrux/svg/GroupView.java
+++ b/android/src/main/java/com/horcrux/svg/GroupView.java
@@ -126,18 +126,21 @@ class GroupView extends RenderableView {
@Override
Path getPath(final Canvas canvas, final Paint paint) {
- final Path path = new Path();
+ if (mPath != null) {
+ return mPath;
+ }
+ mPath = new Path();
for (int i = 0; i < getChildCount(); i++) {
View node = getChildAt(i);
if (node instanceof VirtualView) {
VirtualView n = (VirtualView)node;
Matrix transform = n.mMatrix;
- path.addPath(n.getPath(canvas, paint), transform);
+ mPath.addPath(n.getPath(canvas, paint), transform);
}
}
- return path;
+ return mPath;
}
Path getPath(final Canvas canvas, final Paint paint, final Region.Op op) { | [android] Cache group paths. | react-native-community_react-native-svg | train | java |
c08461116cf1d085b65cc6c07dd52fa88cb0df19 | diff --git a/test/youtube-dl/support_test.rb b/test/youtube-dl/support_test.rb
index <HASH>..<HASH> 100644
--- a/test/youtube-dl/support_test.rb
+++ b/test/youtube-dl/support_test.rb
@@ -30,7 +30,7 @@ describe YoutubeDL::Support do
end
it 'should not have a newline char in the executable_path' do
- assert_match /youtube-dl\z/, @klass.executable_path
+ assert_match(/youtube-dl\z/, @klass.executable_path)
end
end
@@ -70,7 +70,7 @@ describe YoutubeDL::Support do
it 'should not symbolize capitalized keys' do
original = {"No-Man" => "don't capitalize this plz", "but" => "Do capitalize this"}
expected = {"No-Man" => "don't capitalize this plz", :but => "Do capitalize this"}
-
+
assert_equal(expected, @klass.symbolize_json(original))
end
end | Less ambiguous?
Thanks, Ruby syntax checker???? | layer8x_youtube-dl.rb | train | rb |
3150ea8df7571dd05fd63234b53895b7b5a3051d | diff --git a/src/watoki/cli/commands/DependentCommandGroup.php b/src/watoki/cli/commands/DependentCommandGroup.php
index <HASH>..<HASH> 100644
--- a/src/watoki/cli/commands/DependentCommandGroup.php
+++ b/src/watoki/cli/commands/DependentCommandGroup.php
@@ -26,6 +26,8 @@ class DependentCommandGroup extends CommandGroup {
$this->executed = array();
parent::execute($console, $arguments);
+
+ $console->out->writeLine('<<<<<<<<< done.');
}
protected function executeCommand($name, array $arguments, Console $console) {
@@ -45,6 +47,12 @@ class DependentCommandGroup extends CommandGroup {
$this->executeCommand($dependency['command'], $dependency['arguments'], $console);
}
+ if (count($this->queue) + count($this->executed) > 1) {
+ $console->out->writeLine('');
+ $console->out->writeLine('>>>>>>>>> ' . $name);
+ $console->out->writeLine('');
+ }
+
parent::executeCommand($name, $arguments, $console);
array_pop($this->queue); | Output of DependentCommandGroup | watoki_cli | train | php |
1b62a69be0ead7f270dcf1d16c65a3ff9fe41f40 | diff --git a/lib/weary/middleware/hmac_auth.rb b/lib/weary/middleware/hmac_auth.rb
index <HASH>..<HASH> 100644
--- a/lib/weary/middleware/hmac_auth.rb
+++ b/lib/weary/middleware/hmac_auth.rb
@@ -28,7 +28,7 @@ module Weary
# there's no difference in the headers when it's authenticated.
if ['POST', 'PUT'].include? e['REQUEST_METHOD']
e.update 'CONTENT_TYPE' => 'application/x-www-form-urlencoded'
- elsif e['REQUEST_METHOD'] == 'GET' && e['CONTENT_TYPE'].blank?
+ elsif e['REQUEST_METHOD'] == 'GET' && e['CONTENT_TYPE'].to_s == ''
e.update 'CONTENT_TYPE' => 'text/plain'
end
end | Remove call to blank? active_support method
Active support should not be a dependency. | biola_trogdir-api-client | train | rb |
f7113b3eba9482538447b1f470afdaebeadec2a9 | diff --git a/tests/Unit/Suites/Context/ContextBuilder/ContextCountryTest.php b/tests/Unit/Suites/Context/ContextBuilder/ContextCountryTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/Suites/Context/ContextBuilder/ContextCountryTest.php
+++ b/tests/Unit/Suites/Context/ContextBuilder/ContextCountryTest.php
@@ -42,7 +42,7 @@ class ContextCountryTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf(ContextPartBuilder::class, $this->contextCountry);
}
- public function testItReturnsTheCorrectCode()
+ public function testItReturnsTheCountryContextPartCode()
{
$this->assertSame(ContextCountry::CODE, $this->contextCountry->getCode());
} | Issue #<I>: Rename test to be more descriptive | lizards-and-pumpkins_catalog | train | php |
8f14583872cb0905323556f41fc3b053faac5345 | diff --git a/bin/validate.py b/bin/validate.py
index <HASH>..<HASH> 100644
--- a/bin/validate.py
+++ b/bin/validate.py
@@ -609,12 +609,13 @@ def rule(metadata_dir, out, ontology, gaferencer_file):
all_examples_valid = False
all_results += results
-
- try:
- with open(out, "w") as outfile:
- json.dump(rules.validation_report(all_results), outfile, indent=4)
- except Exception as e:
- raise click.ClickException("Could not write report to {}: ".format(out, e))
+
+ if out:
+ try:
+ with open(out, "w") as outfile:
+ json.dump(rules.validation_report(all_results), outfile, indent=4)
+ except Exception as e:
+ raise click.ClickException("Could not write report to {}: ".format(out, e))
if not all_examples_valid:
raise click.ClickException("At least one rule example was not validated.") | fixing how json report gets written | biolink_ontobio | train | py |
fdc336bbfb61d3f7032e94f1ec2bc53b1563c167 | diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/data.rb
+++ b/lib/discordrb/data.rb
@@ -499,7 +499,7 @@ module Discordrb
@afk_timeout = new_data[:afk_timeout] || new_data['afk_timeout'].to_i || @afk_timeout
afk_channel_id = new_data[:afk_channel_id] || new_data['afk_channel_id'].to_i || @afk_channel.id
- @afk_channel = @bot.channel(afk_channel_id) if !@afk_channel || afk_channel_id != @afk_channel.id
+ @afk_channel = @bot.channel(afk_channel_id) if !@afk_channel || (afk_channel_id != 0 && afk_channel_id != @afk_channel.id)
end
private | Only initialize the afk channel if the id isn't 0 | meew0_discordrb | train | rb |
df9112f903f3f18e27bbba3e77c6f75951d30b6c | diff --git a/azurerm/settings.py b/azurerm/settings.py
index <HASH>..<HASH> 100644
--- a/azurerm/settings.py
+++ b/azurerm/settings.py
@@ -4,7 +4,8 @@ azure_rm_endpoint = 'https://management.azure.com'
ACS_API = '2016-03-30'
BASE_API = '2015-01-01'
-COMP_API = '2016-03-30'
+#COMP_API = '2016-03-30'
+COMP_API = '2016-04-30-preview'
INSIGHTS_API = '2015-04-01'
INSIGHTS_METRICS_API = '2016-03-01'
INSIGHTS_PREVIEW_API = '2016-06-01' | Increment Compute API to <I>-<I>-<I>-preview | gbowerman_azurerm | train | py |
7cf71d19a49f4269f70c186a0d83dae0975703a4 | diff --git a/toc.js b/toc.js
index <HASH>..<HASH> 100644
--- a/toc.js
+++ b/toc.js
@@ -3,7 +3,7 @@ var TOCContainer = require("./toc-container-control");
var el = document.getElementsByClassName("on-this-page-container");
if (el.length) {
- new TOCContainer(el);
+ new TOCContainer(el.item(0));
} else {
console.log("An element with class 'on-this-page-container' is required");
} | Pass the first match an not the whole collection | bit-docs_bit-docs-html-toc | train | js |
ce166320b826baaf181224023358f91ace19cb89 | diff --git a/lib/resolver.js b/lib/resolver.js
index <HASH>..<HASH> 100644
--- a/lib/resolver.js
+++ b/lib/resolver.js
@@ -2,7 +2,9 @@
var goog = require('./goog');
// TODO(vojta): can we handle provide "same thing provided multiple times" ?
-var DependencyResolver = function() {
+var DependencyResolver = function(logger) {
+ var log = logger.create('closure');
+
// the state
var fileMap = Object.create(null);
var provideMap = Object.create(null);
@@ -29,8 +31,13 @@ var DependencyResolver = function() {
// resolve all dependencies first
fileMap[filepath].requires.forEach(function(dep) {
if (!alreadyResolvedMap[dep]) {
- // TODO(vojta): error if dep not provided
- resolveFile(provideMap[dep], files, alreadyResolvedMap);
+ if (provideMap[dep]) {
+ resolveFile(provideMap[dep], files, alreadyResolvedMap);
+ } else {
+ log.error('MISSING DEPENDENCY:', dep);
+ log.error('Did you forget to preprocess your source directory? Or did you leave off ' +
+ 'the google closure library deps.js file?');
+ }
}
}); | fix: Show error for a missing dependency.
This ensures that something is printed out for users who didn't add a mapping for one of their dependencies. Either they missed a deps.js file or they didn't preprocess all of their source files. The current behavior adds an undefined filepath which ends up causing the karma web-server to blow up when it trys to do indexOf on undefined. | karma-runner_karma-closure | train | js |
e3bcb52e5f2370ff08a4179ded5b319881d06a7f | diff --git a/bokeh/core/properties.py b/bokeh/core/properties.py
index <HASH>..<HASH> 100644
--- a/bokeh/core/properties.py
+++ b/bokeh/core/properties.py
@@ -715,7 +715,7 @@ class HasProps(with_metaclass(MetaHasProps, object)):
# instead of models, and takes a doc to look up the refs in
def _json_record_references(doc, v, result, recurse):
if v is None: return
- if isinstance(v, dict) and set(v.keys()) == set(['id', 'type']):
+ if isinstance(v, dict) and set(['id', 'type']).issubset(set(v.keys())):
if v['id'] not in result:
model = doc.get_model_by_id(v['id'])
HasProps._value_record_references(model, result, recurse) | accomodate subtypes in json_record_references | bokeh_bokeh | train | py |
d04ab2be0f81375da3a8ead94010a8e540ddd55f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,7 @@
module.exports = {
AppBar: require('./dist/js/app-bar.jsx'),
AppCanvas: require('./dist/js/app-canvas.jsx'),
- Constants: require('./dist/js/utils/constants.js'),
+ Checkbox: require('./dist/js/checkbox.jsx'),
DropDownMenu: require('./dist/js/drop-down-menu.jsx'),
Icon: require('./dist/js/icon.jsx'),
Input: require('./dist/js/input.jsx'),
@@ -11,5 +11,7 @@ module.exports = {
PaperButton: require('./dist/js/paper-button.jsx'),
Paper: require('./dist/js/paper.jsx'),
RadioButton: require('./dist/js/radio-button.jsx'),
- Toggle: require('./dist/js/toggle.jsx')
-};
\ No newline at end of file
+ Toggle: require('./dist/js/toggle.jsx'),
+ Toolbar: require('./dist/js/toolbar.jsx'),
+ ToolbarGroup: require('./dist/js/toolbar-group.jsx')
+}; | Update to latest mui-components | mui-org_material-ui | train | js |
db1e2c1095abb5d2a42426db540a1d815958f1fb | diff --git a/jest-common/src/main/java/io/searchbox/indices/Analyze.java b/jest-common/src/main/java/io/searchbox/indices/Analyze.java
index <HASH>..<HASH> 100644
--- a/jest-common/src/main/java/io/searchbox/indices/Analyze.java
+++ b/jest-common/src/main/java/io/searchbox/indices/Analyze.java
@@ -95,7 +95,7 @@ public class Analyze extends GenericResultAbstractAction {
}
public Builder filter(String filter) {
- return setParameter("filters", filter);
+ return setParameter("filter", filter);
}
/**
diff --git a/jest-common/src/test/java/io/searchbox/indices/AnalyzeTest.java b/jest-common/src/test/java/io/searchbox/indices/AnalyzeTest.java
index <HASH>..<HASH> 100644
--- a/jest-common/src/test/java/io/searchbox/indices/AnalyzeTest.java
+++ b/jest-common/src/test/java/io/searchbox/indices/AnalyzeTest.java
@@ -26,7 +26,7 @@ public class AnalyzeTest {
.tokenizer("keyword")
.filter("lowercase")
.build();
- assertEquals("/_analyze?tokenizer=keyword&filters=lowercase", analyze.getURI());
+ assertEquals("/_analyze?tokenizer=keyword&filter=lowercase", analyze.getURI());
}
@Test | Fix Analyze.Builder#filter(String)
The "filters" attribute was renamed to "filter". | searchbox-io_Jest | train | java,java |
0b2aa6b333f2cc23a397105fdff2b16bcda95cb8 | diff --git a/test/searchjoy_test.rb b/test/searchjoy_test.rb
index <HASH>..<HASH> 100644
--- a/test/searchjoy_test.rb
+++ b/test/searchjoy_test.rb
@@ -39,6 +39,18 @@ class SearchjoyTest < Minitest::Test
assert_equal "All Indices", search.search_type
end
+ def test_additional_attributes
+ Product.search("APPLE", track: {source: "web"})
+ search = Searchjoy::Search.last
+ assert_equal "web", search.source
+ end
+
+ def test_override_attributes
+ Product.search("APPLE", track: {search_type: "Item"})
+ search = Searchjoy::Search.last
+ assert_equal "Item", search.search_type
+ end
+
def test_no_track
Product.search("apple")
assert_equal 0, Searchjoy::Search.count
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -28,6 +28,7 @@ ActiveRecord::Migration.create_table :searchjoy_searches do |t|
t.timestamp :created_at
t.references :convertable, polymorphic: true, index: {name: "index_searchjoy_searches_on_convertable"}
t.timestamp :converted_at
+ t.string :source
end
class Product < ActiveRecord::Base | Added tests for additional attributes and overriding attributes | ankane_searchjoy | train | rb,rb |
86560ab12aee6df034013af8175f9e7eceaf216d | diff --git a/src/Checkout/OrderProcessor.php b/src/Checkout/OrderProcessor.php
index <HASH>..<HASH> 100644
--- a/src/Checkout/OrderProcessor.php
+++ b/src/Checkout/OrderProcessor.php
@@ -291,6 +291,7 @@ class OrderProcessor
$this->order->Status = 'Unpaid';
} else {
$this->order->Status = 'Paid';
+ $this->order->Paid = DBDatetime::now()->Rfc2822();
}
if (!$this->order->Placed) { | Fix OrderProcessor not setting the paid date when an order has nothing outstanding | silvershop_silvershop-core | train | php |
3d6d51bbacfe128e5c42fd35a0e895a95cb45b92 | diff --git a/test/query.js b/test/query.js
index <HASH>..<HASH> 100644
--- a/test/query.js
+++ b/test/query.js
@@ -47,9 +47,8 @@ describe('Monoxide - query', function() {
$count: true,
}, function(err, res) {
expect(err).to.not.be.ok;
- expect(res).to.be.an.object;
-
- expect(res).to.have.property('count', 2);
+ expect(res).to.be.a.number;
+ expect(res).to.be.equal(2);
finish();
}); | BUGFIX: Query test was using old syntax for {$count: true} returns | hash-bang_Monoxide | train | js |
8340262cb2cce91a7fbd42c0dec5f8ade2629e28 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,8 @@ setup(
'Environment :: Web Environment',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2'
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
],
author='Hans Meine',
author_email='hans_meine@gmx.net', | PY3: add trove classifier
at least, ctk-cli is passing superficial tests (e.g. with pyflakes-<I>)
and ctk-cli-indexer produced the same output with Python <I> and <I>. | commontk_ctk-cli | train | py |
c1d6198c500e151329f32b772a142cdbdabb5d3d | diff --git a/varify/phenotypes/management/subcommands/load.py b/varify/phenotypes/management/subcommands/load.py
index <HASH>..<HASH> 100644
--- a/varify/phenotypes/management/subcommands/load.py
+++ b/varify/phenotypes/management/subcommands/load.py
@@ -124,7 +124,7 @@ class Command(BaseCommand):
help='Load HGMD phenotypes and associations for INDELs.'),
)
- def load_hpo(self, cursor):
+ def load_hpo(self, cursor, using):
keys = ['gene_id', 'hpo_terms']
# Fetch, parse and load only genes that cleanly map to the gene table.
@@ -275,7 +275,8 @@ class Command(BaseCommand):
(
select
m.acc_num as hgmd_id,
- trim(both from regexp_replace(m.disease, '\s*\?$', '')) as disease, # noqa
+ trim(both from regexp_replace(m.disease, '\s*\?$', ''))
+ as disease,
m.gene,
m.pmid,
c.chromosome as chr, | Remove clumsy comment within a multi-line SQL statement
Fix load_hpo method to take the using argument.
From internal change on <I>/6 | chop-dbhi_varify | train | py |
a98a2dfcbbfa37efb124638f022950f372ca5950 | diff --git a/lib/bollettino/renderers/payer_renderer.rb b/lib/bollettino/renderers/payer_renderer.rb
index <HASH>..<HASH> 100644
--- a/lib/bollettino/renderers/payer_renderer.rb
+++ b/lib/bollettino/renderers/payer_renderer.rb
@@ -11,7 +11,7 @@ class Bollettino::Renderer::PayerRenderer < Bollettino::Renderer
write_text(image, [85, 315], payer.name[25..49])
write_text(image, [1508, 375], payer.name[0..22], KERNING_BOX_SMALLEST)
- write_text(image, [1508, 330], payer.name[22..44], KERNING_BOX_SMALLEST)
+ write_text(image, [1508, 330], payer.name[23..45], KERNING_BOX_SMALLEST)
end
def self.render_address(image, payer) | Fix overlapping in payer's name | interconn-isp_bollettino | train | rb |
974d9974fe1d6aaa0dc99f3abaec2159b2864f45 | diff --git a/provisioner/windows-restart/provisioner.go b/provisioner/windows-restart/provisioner.go
index <HASH>..<HASH> 100644
--- a/provisioner/windows-restart/provisioner.go
+++ b/provisioner/windows-restart/provisioner.go
@@ -114,6 +114,12 @@ var waitForRestart = func(p *Provisioner, comm packer.Communicator) error {
var cmd *packer.RemoteCmd
trycommand := TryCheckReboot
abortcommand := AbortReboot
+
+ // This sleep works around an azure/winrm bug. For more info see
+ // https://github.com/hashicorp/packer/issues/5257; we can remove the
+ // sleep when the underlying bug has been resolved.
+ time.Sleep(1 * time.Second)
+
// Stolen from Vagrant reboot checker
for {
log.Printf("Check if machine is rebooting...") | add workaround for azure bug. | hashicorp_packer | train | go |
d348cab0cfb983c6f32df320d01c36a128862e1f | diff --git a/deimos/usage.py b/deimos/usage.py
index <HASH>..<HASH> 100644
--- a/deimos/usage.py
+++ b/deimos/usage.py
@@ -18,5 +18,5 @@ def children(level=logging.DEBUG):
def rusage(target=resource.RUSAGE_SELF):
r = resource.getrusage(target)
fmt = "rss = %0.03fM user = %0.03f sys = %0.03f"
- return fmt % (r.ru_maxrss / (1024.0 * 1024.0), r.ru_utime, r.ru_stime)
+ return fmt % (r.ru_maxrss / 1024.0, r.ru_utime, r.ru_stime) | Fix memory reporting.
ru_maxrss is in kilobytes, not bytes... | mesosphere_deimos | train | py |
0cc61221ba082348748e7484baf98b48dbafdefa | diff --git a/attitude/orientation/__init__.py b/attitude/orientation/__init__.py
index <HASH>..<HASH> 100644
--- a/attitude/orientation/__init__.py
+++ b/attitude/orientation/__init__.py
@@ -1,4 +1,4 @@
-from __future__ import division
+from __future__ import division, print_function
from ..regression import Regression
import numpy as N
from scipy.linalg import eig
@@ -19,6 +19,7 @@ def axes(matrix):
class Orientation(object):
def __init__(self, coordinates):
+ assert len(coordinates) >= 3
self.fit = Regression(centered(coordinates))
values = self.fit.coefficients() | Added an assertion to prevent underfitting | davenquinn_Attitude | train | py |
dee1a17983a6a136fc86076f408bdf080e9d143f | diff --git a/src/Xmla.js b/src/Xmla.js
index <HASH>..<HASH> 100644
--- a/src/Xmla.js
+++ b/src/Xmla.js
@@ -5775,9 +5775,7 @@ Xmla.Dataset.Cellset.prototype = {
return this._idx < this._cellCount;
},
nextCell: function(){
- if (this._cellOrd === this._ord
- && this.hasMoreCells()
- ) {
+ if (this.hasMoreCells()) {
this._getCellNode();
}
this._ord += 1;
@@ -5858,7 +5856,7 @@ Xmla.Dataset.Cellset.prototype = {
}
},
getByIndex: function(index) {
- this._cellNodes.item(index);
+ return this._cellNodes.item(index);
},
getByOrdinal: function(ordinal) {
}, | Fixed some mddataset related code. | rpbouman_xmla4js | train | js |
d26d9224d13ddb88fb1892af0db38f0bfef52c55 | diff --git a/ArgusWeb/app/js/directives/charts/chart.js b/ArgusWeb/app/js/directives/charts/chart.js
index <HASH>..<HASH> 100644
--- a/ArgusWeb/app/js/directives/charts/chart.js
+++ b/ArgusWeb/app/js/directives/charts/chart.js
@@ -22,6 +22,7 @@ function(Metrics, ChartRenderingService, ChartDataProcessingService, ChartOption
ChartRenderingService.setChartContainer(element, newChartId, cssOpts);
scope.$on(dashboardCtrl.getSubmitBtnEventName(), function(event, controls) {
+
var data = {
metrics: scope.metrics,
annotations: scope.annotations,
@@ -109,6 +110,9 @@ function(Metrics, ChartRenderingService, ChartDataProcessingService, ChartOption
// LineChartService
+ // empty any previous content
+ $("#" + newChartId).empty();
+
LineChartService.render(newChartId, series);
// bind series data to highchart options | bug fix: empty chart container before re-rendering graph again, prevents duplicate graph. | salesforce_Argus | train | js |
68a9fcac0f1505d99786aedb414e5509df58eaa9 | diff --git a/pykeyboard/x11.py b/pykeyboard/x11.py
index <HASH>..<HASH> 100644
--- a/pykeyboard/x11.py
+++ b/pykeyboard/x11.py
@@ -229,7 +229,7 @@ class PyKeyboardEvent(PyKeyboardEventMeta):
The PyKeyboardEvent implementation for X11 systems (mostly linux). This
allows one to listen for keyboard input.
"""
- def __init__(self, display=None):
+ def __init__(self, capture=False, display=None):
self.display = Display(display)
self.display2 = Display(display)
self.ctx = self.display2.record_create_context(
@@ -263,7 +263,7 @@ class PyKeyboardEvent(PyKeyboardEventMeta):
#for i in range(len(self.display._keymap_codes)):
# print('{0}: {1}'.format(i, self.display._keymap_codes[i]))
- PyKeyboardEventMeta.__init__(self)
+ PyKeyboardEventMeta.__init__(self, capture)
def run(self):
"""Begin listening for keyboard input events.""" | X<I> PyKeyboardEvent __init__ should match its parent interface. | SavinaRoja_PyUserInput | train | py |
cefe5837b2d1ef5dabed20a3a362e8ddd82da58a | diff --git a/src/org/mozilla/javascript/NativeJavaTopPackage.java b/src/org/mozilla/javascript/NativeJavaTopPackage.java
index <HASH>..<HASH> 100644
--- a/src/org/mozilla/javascript/NativeJavaTopPackage.java
+++ b/src/org/mozilla/javascript/NativeJavaTopPackage.java
@@ -98,7 +98,9 @@ public class NativeJavaTopPackage
Context.reportRuntimeError0("msg.not.classloader");
return null;
}
- return new NativeJavaPackage(true, "", loader);
+ NativeJavaPackage pkg = new NativeJavaPackage(true, "", loader);
+ ScriptRuntime.setObjectProtoAndParent(pkg, scope);
+ return pkg;
}
public static void init(Context cx, Scriptable scope, boolean sealed) | Fix bug <I>: Regression: constructor form of Packages is broken | mozilla_rhino | train | java |
5c71ee075862e2595b3cf89a26e0c4240a0c12e6 | diff --git a/go/cmd/pfacct/radius.go b/go/cmd/pfacct/radius.go
index <HASH>..<HASH> 100644
--- a/go/cmd/pfacct/radius.go
+++ b/go/cmd/pfacct/radius.go
@@ -222,19 +222,13 @@ func (h *PfAcct) sendRadiusAccounting(r *radius.Request) {
}
func (h *PfAcct) radiusListen(w *sync.WaitGroup) *radius.PacketServer {
- var connStr string
- if h.Management.Vip != "" {
- connStr = h.Management.Vip + ":1813"
- } else {
- connStr = h.Management.Ip + ":1813"
- }
-
- addr, err := net.ResolveUDPAddr("udp", connStr)
+ connStr := "0.0.0.0:1813"
+ addr, err := net.ResolveUDPAddr("udp4", connStr)
if err != nil {
panic(err)
}
- pc, err := net.ListenUDP("udp", addr)
+ pc, err := net.ListenUDP("udp4", addr)
if err != nil {
panic(err)
} | Listen to all interfaces for accounting
Fixes #<I> | inverse-inc_packetfence | train | go |
e0b5dfd988db6ca2d83ccac7da997bd3b6775c12 | diff --git a/model/src/main/java/org/qsardb/model/Cargo.java b/model/src/main/java/org/qsardb/model/Cargo.java
index <HASH>..<HASH> 100644
--- a/model/src/main/java/org/qsardb/model/Cargo.java
+++ b/model/src/main/java/org/qsardb/model/Cargo.java
@@ -363,7 +363,12 @@ public class Cargo<C extends Container> implements Stateable, Resource {
static
private void store(Cargo<?> cargo, Storage storage) throws IOException {
- InputStream is = cargo.getInputStream();
+ InputStream is;
+ try {
+ is = cargo.getInputStream();
+ } catch (FileNotFoundException ex) {
+ return; // cargo without payload
+ }
try {
OutputStream os = storage.getOutputStream(cargo.qdbPath()); | Handle cargos with empty payloads | qsardb_qsardb | train | java |
c5f829591b48289c073354338349a2f4b2bbdfe0 | diff --git a/http/org_service.go b/http/org_service.go
index <HASH>..<HASH> 100644
--- a/http/org_service.go
+++ b/http/org_service.go
@@ -321,6 +321,10 @@ func (s *OrganizationService) FindOrganizations(ctx context.Context, filter plat
// CreateOrganization creates an organization.
func (s *OrganizationService) CreateOrganization(ctx context.Context, o *platform.Organization) error {
+ if o.Name == "" {
+ return kerrors.InvalidDataf("organization name is required")
+ }
+
url, err := newURL(s.Addr, organizationPath)
if err != nil {
return err | fix(http): prevent creation of nameless organizations | influxdata_influxdb | train | go |
f40d80d057577412a7d10429ec60b347f9929865 | diff --git a/firecloud/api.py b/firecloud/api.py
index <HASH>..<HASH> 100755
--- a/firecloud/api.py
+++ b/firecloud/api.py
@@ -627,13 +627,16 @@ def copy_config_to_repo(namespace, workspace, from_cnamespace,
### 1.3 Method Repository
###########################
-def list_repository_methods():
+def list_repository_methods(name=None):
"""List methods in the methods repository.
Swagger:
https://api.firecloud.org/#!/Method_Repository/listMethodRepositoryMethods
"""
- return __get("methods")
+ params = dict()
+ if name:
+ params['name'] = name
+ return __get("methods", params=params)
def list_repository_configs():
"""List configurations in the methods repository. | list_repository_methods() now accepts an optional name parameter, to provide a more performant means of checking for a single method | broadinstitute_fiss | train | py |
2d8fbeea6a37827e4a8f63f80fa6d8b7392221fc | diff --git a/src/Payum/Paypal/ExpressCheckout/Nvp/Api.php b/src/Payum/Paypal/ExpressCheckout/Nvp/Api.php
index <HASH>..<HASH> 100644
--- a/src/Payum/Paypal/ExpressCheckout/Nvp/Api.php
+++ b/src/Payum/Paypal/ExpressCheckout/Nvp/Api.php
@@ -302,6 +302,7 @@ class Api
'username' => null,
'password' => null,
'signature' => null,
+ 'subject' => null,
'return_url' => null,
'cancel_url' => null,
'sandbox' => null,
@@ -634,6 +635,10 @@ class Api
$fields['PWD'] = $this->options['password'];
$fields['USER'] = $this->options['username'];
$fields['SIGNATURE'] = $this->options['signature'];
+
+ if ($this->options['subject']) {
+ $fields['SUBJECT'] = $this->options['subject'];
+ }
}
/** | Add support for Subject authorization
If you're calling the API on behalf of a third-party merchant, you must specify the email address on file with PayPal of the third-party merchant or the merchant's account ID (sometimes called Payer ID). | Payum_Payum | train | php |
92c98a8529b58c35ebec1da00f42a1d272e29555 | diff --git a/lib/engineyard-serverside/deploy.rb b/lib/engineyard-serverside/deploy.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard-serverside/deploy.rb
+++ b/lib/engineyard-serverside/deploy.rb
@@ -146,7 +146,7 @@ module EY
def clean_environment
"unset BUNDLE_PATH BUNDLE_FROZEN BUNDLE_WITHOUT BUNDLE_BIN BUNDLE_GEMFILE"
# GIT_SSH needs to be defined in the environment for customers with private bundler repos in their Gemfile.
- ENV['GIT_SSH'] = "ssh -o 'StrictHostKeyChecking no' -o 'PasswordAuthentication no' -o 'LogLevel DEBUG' -i ~/.ssh/#{app}-deploy-key"
+ ENV['GIT_SSH'] = "ssh -o 'StrictHostKeyChecking no' -o 'PasswordAuthentication no' -o 'LogLevel DEBUG' -i ~/.ssh/#{c[:app]}-deploy-key"
end
# task | Fixed a wrong variable when setting GIT_SSH environment | engineyard_engineyard-serverside | train | rb |
f2b36a781e3f518f071689edde70949dd0b4c4c6 | diff --git a/indra/reach/reach_api.py b/indra/reach/reach_api.py
index <HASH>..<HASH> 100644
--- a/indra/reach/reach_api.py
+++ b/indra/reach/reach_api.py
@@ -38,10 +38,14 @@ def process_pubmed_abstract(pubmed_id, offline=False):
def process_text(text, citation=None, offline=False):
if offline:
+ if api_ruler is None:
+ print 'Cannot read offline because the REACH ApiRuler could not' +\
+ 'be instantiated.'
+ return None
try:
result_map = api_ruler.annotateText(text, 'fries')
except JavaException:
- print 'Could not process file %s.' % file_name
+ print 'Could not process text.'
return None
json_str = result_map.get('resultJson')
else:
@@ -64,6 +68,10 @@ def process_nxml_str(nxml_str, citation):
def process_nxml(file_name, citation=None, offline=False):
if offline:
+ if api_ruler is None:
+ print 'Cannot read offline because the REACH ApiRuler could not' +\
+ 'be instantiated.'
+ return None
try:
result_map = api_ruler.annotateNxml(file_name, 'fries')
except JavaException: | Error messages in REACH if ApiRuler could not be instantiated | sorgerlab_indra | train | py |
0c3cd562ed123c032761717f17a953ed42427ab4 | diff --git a/tests/test-rest-posts-controller.php b/tests/test-rest-posts-controller.php
index <HASH>..<HASH> 100644
--- a/tests/test-rest-posts-controller.php
+++ b/tests/test-rest-posts-controller.php
@@ -184,6 +184,9 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
$category_url = rest_url( '/wp/v2/posts/' . $this->post_id . '/terms/category' );
$this->assertEquals( $category_url, $cat_link['href'] );
+
+ $meta_links = $links['https://api.w.org/meta'];
+ $this->assertEquals( rest_url( '/wp/v2/posts/' . $this->post_id . '/meta' ), $meta_links[0]['href'] );
}
public function test_get_item_links_no_author() { | Add test case for Post's meta links | WP-API_WP-API | train | php |
93e44710dad8ddab03af8b601ae6b8fdce606cc7 | diff --git a/internal/service/ec2/ebs_snapshot.go b/internal/service/ec2/ebs_snapshot.go
index <HASH>..<HASH> 100644
--- a/internal/service/ec2/ebs_snapshot.go
+++ b/internal/service/ec2/ebs_snapshot.go
@@ -193,6 +193,7 @@ func resourceEBSSnapshotRead(d *schema.ResourceData, meta interface{}) error {
d.Set("kms_key_id", snapshot.KmsKeyId)
d.Set("volume_size", snapshot.VolumeSize)
d.Set("storage_tier", snapshot.StorageTier)
+ d.Set("volume_id", snapshot.VolumeId)
if snapshot.OutpostArn != nil {
d.Set("outpost_arn", snapshot.OutpostArn) | Set 'volume_id' during resource Read (for Import). | terraform-providers_terraform-provider-aws | train | go |
7267dc505fd0a3f9f74c604ccd35a8c5a3d365ce | diff --git a/lib/ronin/remote_file.rb b/lib/ronin/remote_file.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/remote_file.rb
+++ b/lib/ronin/remote_file.rb
@@ -49,5 +49,17 @@ module Ronin
# Tags
has_tags_on :tags
+ #
+ # Searches for all remote files that have been downloaded.
+ #
+ # @return [Array<RemoteFile>]
+ # The downloaded remote files.
+ #
+ # @since 1.0.0
+ #
+ def self.downloaded
+ all(:local_path.not => nil)
+ end
+
end
end | Added RemoteFile.downloaded. | ronin-ruby_ronin | train | rb |
05bdc3e5efe88abad7411a5a38626eea40728f09 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -151,7 +151,7 @@ html_theme = 'alabaster'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+#html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied | fixup! Move sphinx requirements to a file for readthedocs | pahaz_sshtunnel | train | py |
a6a6bb4af38301e660af36b106898ce14d395f5f | diff --git a/lxd/daemon.go b/lxd/daemon.go
index <HASH>..<HASH> 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -735,14 +735,13 @@ func (d *Daemon) init() error {
}
/* Print welcome message */
+ mode := "normal"
if d.os.MockMode {
- logger.Info(fmt.Sprintf("LXD %s is starting in mock mode", version.Version),
- log.Ctx{"path": shared.VarPath("")})
- } else {
- logger.Info(fmt.Sprintf("LXD %s is starting in normal mode", version.Version),
- log.Ctx{"path": shared.VarPath("")})
+ mode = "mock"
}
+ logger.Info("LXD is starting", log.Ctx{"version": version.Version, "mode": mode, "path": shared.VarPath("")})
+
/* List of sub-systems to trace */
trace := d.config.Trace | lxd/daemon: Modify LXD is starting message to use contextual logging | lxc_lxd | train | go |
95aa3e260e3964260ff8075a63b3c679955f78cf | diff --git a/pyocd/debug/breakpoints/manager.py b/pyocd/debug/breakpoints/manager.py
index <HASH>..<HASH> 100644
--- a/pyocd/debug/breakpoints/manager.py
+++ b/pyocd/debug/breakpoints/manager.py
@@ -1,5 +1,6 @@
# pyOCD debugger
# Copyright (c) 2015-2019 Arm Limited
+# Copyright (c) 2021 Chris Reed
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -127,7 +128,7 @@ class BreakpointManager(object):
free_hw_bp_count += 1
for bp in added:
likely_bp_type = self._select_breakpoint_type(bp, False)
- if bp.type == Target.BreakpointType.HW:
+ if likely_bp_type == Target.BreakpointType.HW:
free_hw_bp_count -= 1
return free_hw_bp_count > self.MIN_HW_BREAKPOINTS | BreakpointManager: fix bug in checking if HW BP can be added on flush.
The to-be-added hardware breakpoints were not counted correctly due
to not using the correct variable (probable copy/paste error). | mbedmicro_pyOCD | train | py |
839646c947c2be134dfc054222ec4e1a490b6259 | diff --git a/cmd2.py b/cmd2.py
index <HASH>..<HASH> 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -319,7 +319,8 @@ def get_paste_buffer():
"""
pb_str = pyperclip.paste()
- if six.PY2:
+ # If value returned from the clipboard is unicode and this is Python 2, convert to a "normal" Python 2 string first
+ if six.PY2 and not isinstance(pb_str, str):
import unicodedata
pb_str = unicodedata.normalize('NFKD', pb_str).encode('ascii', 'ignore') | Minor attempt at ruggedization of clipboard stuff in some weird cases on Python 2 | python-cmd2_cmd2 | train | py |
47bf0a3845cd74fb9bfa9c91b9d4d0a61c09cb77 | diff --git a/src/Core/Result.php b/src/Core/Result.php
index <HASH>..<HASH> 100644
--- a/src/Core/Result.php
+++ b/src/Core/Result.php
@@ -47,7 +47,7 @@ class Result extends Entity {
array(":LID" => $LINK->id,
":CID" => $CONTEXT->id, ":UID" => $user_id)
);
- $row = $stmt->fetch(PDO::FETCH_ASSOC);
+ $row = $stmt->fetch(\PDO::FETCH_ASSOC);
return $row;
} | One more bug - this is hard to test :( | tsugiproject_tsugi-php | train | php |
dd3bdc87fe9cefcfa61d70eb50ffc3702fc433fb | diff --git a/jaraco/itertools.py b/jaraco/itertools.py
index <HASH>..<HASH> 100644
--- a/jaraco/itertools.py
+++ b/jaraco/itertools.py
@@ -981,26 +981,25 @@ def list_or_single(iterable):
'a'
"""
warnings.warn("Use maybe_single", DeprecationWarning)
- return maybe_single(iterable, sequence=list)
+ return maybe_single(list(iterable))
-def maybe_single(iterable, sequence=tuple):
+def maybe_single(sequence):
"""
- Given an iterable, return the items as a sequence.
- If the iterable contains exactly one item, return
- that item. Correlary function to always_iterable.
+ Given a sequence, if it contains exactly one item,
+ return that item, otherwise return the sequence.
+ Correlary function to always_iterable.
- >>> maybe_single(iter('abcd'))
+ >>> maybe_single(tuple('abcd'))
('a', 'b', 'c', 'd')
>>> maybe_single(['a'])
'a'
"""
- result = sequence(iterable)
try:
- result, = result
+ single, = sequence
except ValueError:
- pass
- return result
+ return sequence
+ return single
def self_product(iterable): | Don't solicit the sequence as a parameter. Instead, expect the caller to supply a sequence. | jaraco_jaraco.itertools | train | py |
620866eabb6a9a9507936eee062da4d1b1d5d51c | diff --git a/source/rafcon/gui/interface.py b/source/rafcon/gui/interface.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/interface.py
+++ b/source/rafcon/gui/interface.py
@@ -10,6 +10,7 @@
# Rico Belder <rico.belder@dlr.de>
import os
+import glib
from rafcon.core import interface as core_interface
from rafcon.gui.runtime_config import global_runtime_config
from rafcon.gui.singleton import main_window_controller, library_manager
@@ -55,7 +56,13 @@ def open_folder(query, default_path=None):
library_paths = library_manager.library_root_paths
library_keys = sorted(library_paths)
for library_key in library_keys:
- dialog.add_shortcut_folder(library_paths[library_key])
+ try:
+ dialog.add_shortcut_folder(library_paths[library_key])
+ except glib.GError, e:
+ # this occurs if the shortcut file already exists
+ # unfortunately dialog.list_shortcut_folders() does not work
+ # that's why the error is caught
+ pass
response = dialog.run() | fix file chooser bug
fix case if the same folder is added to the shortcut_folders of the FileChooserDialog twice | DLR-RM_RAFCON | train | py |
00283f2546d2ef6575195eaf4d2314fe7fec4d4c | diff --git a/versionner/cli.py b/versionner/cli.py
index <HASH>..<HASH> 100755
--- a/versionner/cli.py
+++ b/versionner/cli.py
@@ -238,7 +238,7 @@ def execute(prog, argv):
if result.modified_files:
print('Changed' + (' and committed' if cfg.commit else '') + ' %(files)s files (%(changes)s changes)' % {
'files': result.modified_files,
- 'changes': result.changes,
+ 'changes': result.modifications,
})
return 0 | fixed name of property of CommandOutput | msztolcman_versionner | train | py |
996d602df3608420bdf27fac3060e284e917c869 | diff --git a/Model/ModelManager.php b/Model/ModelManager.php
index <HASH>..<HASH> 100644
--- a/Model/ModelManager.php
+++ b/Model/ModelManager.php
@@ -296,6 +296,17 @@ class ModelManager implements ModelManagerInterface
}
/**
+ * {@inheritDoc}
+ *
+ * The ORM implementation does nothing special but you still should use
+ * this method when using the id in a URL to allow for future improvements.
+ */
+ public function getUrlsafeIdentifier($entity)
+ {
+ return $this->getNormalizedIdentifier($entity);
+ }
+
+ /**
* {@inheritdoc}
*/
public function addIdentifiersToQuery($class, ProxyQueryInterface $queryProxy, array $idx) | implement dummy version of getUrlsafeIdentifier | sonata-project_SonataDoctrineORMAdminBundle | train | php |
27ec5610598ce51d792f9adadde8eab727481e7c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -53,7 +53,8 @@ const antd = {
Icon: require('./components/iconfont'),
Row: require('./components/layout').Row,
Col: require('./components/layout').Col,
- Spin: require('./components/spin')
+ Spin: require('./components/spin'),
+ Form: require('./components/form'),
};
antd.version = require('./package.json').version; | feat: add form to antd. | ant-design_ant-design | train | js |
dcd0ce18ed845927b213f9f12fc473de846d4599 | diff --git a/src/Http/routes.php b/src/Http/routes.php
index <HASH>..<HASH> 100644
--- a/src/Http/routes.php
+++ b/src/Http/routes.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/*
* This file is part of Eloquent Viewable.
* | revert: refactor: remove declare strict_type=1 from routes.php | cyrildewit_eloquent-viewable | train | php |
6f0a64ab2c4471b0e0c44406f154db89a07e6f4b | diff --git a/lib/dm-migrations/version.rb b/lib/dm-migrations/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-migrations/version.rb
+++ b/lib/dm-migrations/version.rb
@@ -1,5 +1,5 @@
module DataMapper
class Migration
- VERSION = "0.9.5"
+ VERSION = "0.9.6"
end
end
diff --git a/lib/migration.rb b/lib/migration.rb
index <HASH>..<HASH> 100644
--- a/lib/migration.rb
+++ b/lib/migration.rb
@@ -1,5 +1,5 @@
require 'rubygems'
-gem 'dm-core', '=0.9.5'
+gem 'dm-core', '=0.9.6'
require 'dm-core'
require 'benchmark'
require File.dirname(__FILE__) + '/sql'
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
@@ -11,7 +11,7 @@ def load_driver(name, default_uri)
lib = "do_#{name}"
begin
- gem lib, '=0.9.5'
+ gem lib, '>=0.9.5'
require lib
DataMapper.setup(name, default_uri)
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name] | Version Bump to <I>. | datamapper_dm-migrations | train | rb,rb,rb |
a60030d87c3396896ff2cbe2296cd1d532c7eaef | diff --git a/src/Robo/Commands/Tests/PhpUnitCommand.php b/src/Robo/Commands/Tests/PhpUnitCommand.php
index <HASH>..<HASH> 100644
--- a/src/Robo/Commands/Tests/PhpUnitCommand.php
+++ b/src/Robo/Commands/Tests/PhpUnitCommand.php
@@ -3,6 +3,7 @@
namespace Acquia\Blt\Robo\Commands\Tests;
use Acquia\Blt\Robo\BltTasks;
+use Acquia\Blt\Robo\Exceptions\BltException;
use Robo\Contract\VerbosityThresholdInterface;
/**
@@ -61,7 +62,11 @@ class PhpUnitCommand extends BltTasks {
if (isset($test['config'])) {
$task->option('--configuration', $test['config']);
}
- $task->run();
+ $result = $task->run();
+ $exit_code = $result->getExitCode();
+ if ($exit_code) {
+ throw new BltException("PHPUnit tests failed.");
+ }
}
} | Fixes #<I>: PHPUnit Fatal Error Doesn't Fail Build. (#<I>) | acquia_blt | train | php |
bdbb2cd8e49101dde476c14a9340f244673f1ece | diff --git a/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java b/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java
index <HASH>..<HASH> 100644
--- a/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java
+++ b/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java
@@ -128,6 +128,6 @@ class NetworkCache {
}
private static String filenameForUrl(String url, FileExtension extension, boolean isTemp) {
- return "lottie_cache_" + url.replaceAll("\\W+", "") + (isTemp ? extension.extension : extension.tempExtension());
+ return "lottie_cache_" + url.replaceAll("\\W+", "") + (isTemp ? extension.tempExtension(): extension.extension);
}
} | resove bug local cache not working (#<I>) | airbnb_lottie-android | train | java |
ed2f6a45d55e6d40b16ffa8e8767f96beb21e1fa | diff --git a/admin/jqadm/themes/admin-aux.js b/admin/jqadm/themes/admin-aux.js
index <HASH>..<HASH> 100644
--- a/admin/jqadm/themes/admin-aux.js
+++ b/admin/jqadm/themes/admin-aux.js
@@ -123,6 +123,7 @@ Aimeos.Media = {
this.$set(this.items[prefix + 'typeid'], idx, listtypeid);
this.$set(this.items['media.siteid'], idx, this.siteid);
this.$set(this.items['media.languageid'], idx, null);
+ this.$set(this.items['media.status'], idx, 1);
}, | Set status of new media items to "enabled" by default | aimeos_ai-admin-jqadm | train | js |
069355c90df49ca67d8924ea002950c1d7b5f9dc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,5 +36,8 @@ setup(name='anycall',
author_email='scm@smurn.org',
url='https://github.com/smurn/anycall',
packages=['anycall'],
- install_requires = ['twisted', 'utwist', 'bidict', 'twistit'],
+ install_requires = ['twisted>=15.0.0',
+ 'utwist>=0.1.2',
+ 'bidict>=0.3.1',
+ 'twistit>=0.2.0'],
) | Added version requirements to dependencies. | pydron_anycall | train | py |
60b4e807b1bb74eee76c4ce52a5e453026f3f46a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ os.environ.setdefault('CC', 'clang')
setup(
name='symsynd',
- version='0.8.1',
+ version='0.8.2',
url='http://github.com/getsentry/symsynd',
description='Helps symbolicating crash dumps.',
license='BSD',
diff --git a/symsynd/driver.py b/symsynd/driver.py
index <HASH>..<HASH> 100644
--- a/symsynd/driver.py
+++ b/symsynd/driver.py
@@ -123,7 +123,6 @@ class Driver(object):
if sym_resp == input_command:
raise SymbolicationError('Symbolizer echoed garbage.')
- sym_resp = proc.stdout.readline()
location_resp = proc.stdout.readline()
empty_line = proc.stdout.readline() | Fixed a bug that caused symbolication to fail | getsentry_symsynd | train | py,py |
02e7525ccd045fb80a93448994ec375785650fde | diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php
index <HASH>..<HASH> 100644
--- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php
+++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php
@@ -247,7 +247,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
, 'lst' => self::$record_1->get_serialize_key()
);
- $crawler = $this->client->request('POST', '/feeds/entry/UNKNOW/update/', $params);
+ $crawler = $this->client->request('POST', '/feeds/entry/99999999/update/', $params);
$response = $this->client->getResponse();
@@ -351,7 +351,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
$appbox = appbox::get_instance();
- $crawler = $this->client->request('POST', '/feeds/entry/UNKNOW/delete/');
+ $crawler = $this->client->request('POST', '/feeds/entry/9999999/delete/');
$response = $this->client->getResponse(); | fix testDelete & testDeleteNotFound | alchemy-fr_Phraseanet | train | php |
83ca0b40d07586d4c12ed8a8ee9e14e9a4c5cbc3 | diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb
index <HASH>..<HASH> 100644
--- a/omnibus/config/projects/chef.rb
+++ b/omnibus/config/projects/chef.rb
@@ -53,6 +53,16 @@ dependency "chef-complete"
package :rpm do
signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"]
+
+ unless rhel? && platform_version.satisfies?("< 6")
+ compression_level 1
+ compression_type :xz
+ end
+end
+
+package :deb do
+ compression_level 1
+ compression_type :xz
end
proj_to_work_around_cleanroom = self | Compress debs and rpms with xz | chef_chef | train | rb |
ef78d28e0d1dce4d8254895243604f0d4811bbac | diff --git a/test/query.js b/test/query.js
index <HASH>..<HASH> 100644
--- a/test/query.js
+++ b/test/query.js
@@ -244,6 +244,7 @@ describe('client.query()', function() {
});
stream.on('error', function(error){
expect(error).to.be.ok();
+ console.log(error);
expect(error.code).to.equal(status.AEROSPIKE_OK);
err++;
}); | For debugging scan aggregation failure | aerospike_aerospike-client-nodejs | train | js |
37cd852fcace5d147702d326983b60cfd691fc37 | diff --git a/js/lib/mediawiki.ApiRequest.js b/js/lib/mediawiki.ApiRequest.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.ApiRequest.js
+++ b/js/lib/mediawiki.ApiRequest.js
@@ -329,6 +329,8 @@ TemplateRequest.prototype._handleJSON = function ( error, data ) {
function PreprocessorRequest ( env, title, text ) {
ApiRequest.call(this, env, title);
+ this.queueKey = text;
+
// Temporary debugging hack for
// https://bugzilla.wikimedia.org/show_bug.cgi?id=49411
// Double-check the returned content language
@@ -337,7 +339,6 @@ function PreprocessorRequest ( env, title, text ) {
this.text = text;
- this.queueKey = text;
this.reqType = "Template Expansion";
var apiargs = { | Fix debug patch for content language
Change-Id: I<I>f5da<I>a<I>ecd<I>fa<I>fb<I>e3 | wikimedia_parsoid | train | js |
7b7db8f674f9a63602479b9101d0e0a2ea74aadb | diff --git a/ReText/editor.py b/ReText/editor.py
index <HASH>..<HASH> 100644
--- a/ReText/editor.py
+++ b/ReText/editor.py
@@ -20,7 +20,7 @@ import os
import re
import weakref
-from markups import MarkdownMarkup, ReStructuredTextMarkup
+from markups import MarkdownMarkup, ReStructuredTextMarkup, TextileMarkup
from ReText import globalSettings, tablemode, readFromSettings
from PyQt5.QtCore import pyqtSignal, QFileInfo, QRect, QSize, Qt
@@ -310,6 +310,8 @@ class ReTextEdit(QTextEdit):
imageText = '' % (QFileInfo(link).baseName(), link)
elif markupClass == ReStructuredTextMarkup:
imageText = '.. image:: %s' % link
+ elif markupClass == TextileMarkup:
+ imageText = '!%s!' % link
self.textCursor().insertText(imageText)
else: | editor: Support pasting images to Textile | retext-project_retext | train | py |
e2fb19f84a7d43a6dce7453e00541df93126aa5d | diff --git a/tests/connection.py b/tests/connection.py
index <HASH>..<HASH> 100644
--- a/tests/connection.py
+++ b/tests/connection.py
@@ -222,7 +222,3 @@ class Connection_(Spec):
def calls_invoke_Runner_run(self, invoke):
Connection('host').local('foo')
invoke.run.assert_called_with('foo')
-
- class sudo:
- def calls_Remote_with_sudo_call_and_response_configuration(self):
- skip() | I don't even know what this means | fabric_fabric | train | py |
9bb088c6f391964cce4904f81816419bf8018e72 | diff --git a/tests/e2e/end-to-end.tests.js b/tests/e2e/end-to-end.tests.js
index <HASH>..<HASH> 100644
--- a/tests/e2e/end-to-end.tests.js
+++ b/tests/e2e/end-to-end.tests.js
@@ -93,6 +93,7 @@ Test('end to end tests', function(t) {
Object.keys(require.cache).forEach(function(key) {
delete require.cache[key]
})
+ restore(Mongoose)
t.ok(true, 'DONE')
}) | bugfix: prevent test errors between runs due to residual data in db (#<I>) | JKHeadley_rest-hapi | train | js |
7663921d6b80b18c1e7c8e2cd89bff9761ca6b5e | diff --git a/salt/runner.py b/salt/runner.py
index <HASH>..<HASH> 100644
--- a/salt/runner.py
+++ b/salt/runner.py
@@ -59,7 +59,8 @@ class RunnerClient(object):
data['user'] = user
event.fire_event(data, tagify('ret', base=tag))
# this is a workaround because process reaping is defeating 0MQ linger
- time.sleep(2.0) # delat so 0MQ event gets out before runner process reaped
+ time.sleep(2.0) # delay so 0MQ event gets out before runner process
+ # reaped
def _verify_fun(self, fun):
''' | Two spaces before in-line comment. | saltstack_salt | train | py |
87e62cc3712034cbed3370fe0ae3bed8e8193763 | diff --git a/resources/lang/hu-HU/pagination.php b/resources/lang/hu-HU/pagination.php
index <HASH>..<HASH> 100644
--- a/resources/lang/hu-HU/pagination.php
+++ b/resources/lang/hu-HU/pagination.php
@@ -22,7 +22,7 @@ return [
|
*/
- 'previous' => 'Előző',
- 'next' => 'Következő',
+ 'previous' => 'Previous',
+ 'next' => 'Next',
]; | New translations pagination.php (Hungarian) | CachetHQ_Cachet | train | php |
8afa6d0dac0520d39822bcaf1cb72ad1dbb62f3c | diff --git a/packages/cozy-client/src/CozyClient.js b/packages/cozy-client/src/CozyClient.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-client/src/CozyClient.js
+++ b/packages/cozy-client/src/CozyClient.js
@@ -1,4 +1,4 @@
-import { StackLink } from './CozyLink'
+import StackLink from './StackLink'
import { QueryDefinition, Mutations } from './dsl'
import CozyStackClient from 'cozy-stack-client'
import {
diff --git a/packages/cozy-client/src/index.js b/packages/cozy-client/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-client/src/index.js
+++ b/packages/cozy-client/src/index.js
@@ -1,8 +1,9 @@
export { default } from './CozyClient'
export { default as CozyProvider } from './Provider'
+export { default as CozyLink } from './CozyLink'
+export { default as StackLink } from './StackLink'
export { default as connect } from './connect'
export { default as withMutation } from './withMutation'
-export { all, find } from './dsl'
export { default as Query } from './Query'
export { default as Mutations } from './Mutations'
export { default as compose } from 'lodash/flow' | fix: Ensure StackLink is exported | cozy_cozy-client | train | js,js |
c8c507c80ea28385caac72b682dd066e44943913 | diff --git a/rule_linux.go b/rule_linux.go
index <HASH>..<HASH> 100644
--- a/rule_linux.go
+++ b/rule_linux.go
@@ -144,7 +144,7 @@ func ruleHandle(rule *Rule, req *nl.NetlinkRequest) error {
req.AddData(nl.NewRtAttr(nl.FRA_OIFNAME, []byte(rule.OifName)))
}
if rule.Goto >= 0 {
- msg.Type = nl.FR_ACT_NOP
+ msg.Type = nl.FR_ACT_GOTO
b := make([]byte, 4)
native.PutUint32(b, uint32(rule.Goto))
req.AddData(nl.NewRtAttr(nl.FRA_GOTO, b)) | fix: fix ip rule goto bug | vishvananda_netlink | train | go |
2c520d90edef34dbf7db70d43bac21107b55ea72 | diff --git a/import_export/resources.py b/import_export/resources.py
index <HASH>..<HASH> 100644
--- a/import_export/resources.py
+++ b/import_export/resources.py
@@ -328,7 +328,9 @@ class Resource(object):
queryset = self.get_queryset()
headers = self.get_export_headers()
data = tablib.Dataset(headers=headers)
- for obj in queryset:
+ # Iterate without the queryset cache, to avoid wasting memory when
+ # exporting large datasets.
+ for obj in queryset.iterator():
data.append(self.export_resource(obj))
return data | Bypass the queryset cache in Resource.export().
Without this, even moderately large exports (<I>k rows or more) can
quickly exhaust a system's memory. | django-import-export_django-import-export | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.