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 |
|---|---|---|---|---|---|
3efa736c60cee3f3777d93ce850027b771c33aee | diff --git a/main/core/Entity/Organization/Organization.php b/main/core/Entity/Organization/Organization.php
index <HASH>..<HASH> 100644
--- a/main/core/Entity/Organization/Organization.php
+++ b/main/core/Entity/Organization/Organization.php
@@ -357,8 +357,10 @@ class Organization
*/
public function addGroup(Group $group)
{
- $this->groups->add($group);
- $group->getOrganizations()->add($this);
+ if (!$this->groups->contains($group)) {
+ $this->groups->add($group);
+ $group->getOrganizations()->add($this);
+ }
}
/**
@@ -366,7 +368,7 @@ class Organization
*/
public function removeGroup(Group $group)
{
- $this->groups->remove($group);
+ $this->groups->removeElement($group);
$group->getOrganizations()->removeElement($this);
} | [CoreBundle] Organization group collection handling. (#<I>) | claroline_Distribution | train | php |
ca2d62214a04304bf2f4a8bdef3ed83d91482f87 | diff --git a/extensions/authclient/views/redirect.php b/extensions/authclient/views/redirect.php
index <HASH>..<HASH> 100644
--- a/extensions/authclient/views/redirect.php
+++ b/extensions/authclient/views/redirect.php
@@ -8,11 +8,12 @@ use yii\helpers\Json;
$redirectJavaScript = <<<EOL
function popupWindowRedirect(url, enforceRedirect) {
- if (window.opener) {
- window.close();
+ if (window.opener && !window.opener.closed) {
if (enforceRedirect === undefined || enforceRedirect) {
window.opener.location = url;
}
+ window.opener.focus();
+ window.close();
} else {
window.location = url;
} | AuthClient js redirect advanced. | yiisoft_yii-core | train | php |
fb256ca29f2eacdd96e8f72ee3c970cf656b6e1d | diff --git a/application/Espo/ORM/DB/Query/Base.php b/application/Espo/ORM/DB/Query/Base.php
index <HASH>..<HASH> 100644
--- a/application/Espo/ORM/DB/Query/Base.php
+++ b/application/Espo/ORM/DB/Query/Base.php
@@ -448,7 +448,7 @@ abstract class Base
if (!empty($fieldDefs['select'])) {
$part = $fieldDefs['select'];
} else {
- if (!empty($fieldDefs['notStorable'])) {
+ if (!empty($fieldDefs['notStorable']) || !empty($fieldDefs['noSelect'])) {
continue;
}
$part = $this->getFieldPath($entity, $attribute[0]); | orm noSelect param | espocrm_espocrm | train | php |
4f9e9c3b71c20e31c1fe5e0d55a0b16b2c04ef75 | diff --git a/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java b/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java
index <HASH>..<HASH> 100644
--- a/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java
+++ b/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java
@@ -78,6 +78,7 @@ public class ApplicationModuleFinder implements ModuleFinder {
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.jboss.modules")));
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.jboss.msc")));
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.jboss.shrinkwrap")));
+ builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.wildfly.swarm.configuration")));
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("javax.api")));
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("sun.jdk"))); | Fix for the classloader issue bbrowning saw around config-api. | wildfly-swarm-archive_ARCHIVE-wildfly-swarm | train | java |
f4de94c6d8dfa5acd2510d025b3ce7704cc28490 | diff --git a/drivers/docker/utils.go b/drivers/docker/utils.go
index <HASH>..<HASH> 100644
--- a/drivers/docker/utils.go
+++ b/drivers/docker/utils.go
@@ -156,12 +156,12 @@ func authFromHelper(helperName string) authBackend {
cmd.Stdin = strings.NewReader(repoInfo.Index.Name)
output, err := cmd.Output()
if err != nil {
- switch err.(type) {
- default:
- return nil, err
- case *exec.ExitError:
- return nil, fmt.Errorf("%s with input %q failed with stderr: %s", helper, repo, err.Error())
+ exitErr, ok := err.(*exec.ExitError)
+ if ok {
+ return nil, fmt.Errorf(
+ "%s with input %q failed with stderr: %s", helper, repo, exitErr.Stderr)
}
+ return nil, err
}
var response map[string]string | docker: improve error message for auth helper
The error returned from the stdlib's `exec` package is always a message with
the exit code of the exec'd process, not any error message that process might
have given us. This results in opaque failures for the Nomad user. Cast to an
`ExitError` so that we can access the output from stderr. | hashicorp_nomad | train | go |
26a4e2069e4216e686b6f7209dc21fd40aaeecb3 | diff --git a/src/Authorizer.php b/src/Authorizer.php
index <HASH>..<HASH> 100644
--- a/src/Authorizer.php
+++ b/src/Authorizer.php
@@ -54,7 +54,7 @@ class Authorizer
// We store our (authenticated) token inside the token storage
$this->tokenStorage = new TokenStorage();
if(array_key_exists('tokenstorage',$_SESSION)){
- $this->tokenStorage->setToken($_SESSION['tokenstorage']);
+ $this->tokenStorage->setToken($_SESSION['tokenstorage']->getToken());
} else {
$token = new UsernamePasswordToken("general","general","main", array());
$this->tokenStorage->setToken($token);
@@ -87,4 +87,4 @@ class Authorizer
{
return strpos($haystack, $needle) !== false;
}
-}
\ No newline at end of file
+} | revert back to getToken() | Erdiko_authorize | train | php |
823ec4c3c6782b84fbce0238798e10e5edd1b1e9 | diff --git a/src/components/shared/Button/Close.js b/src/components/shared/Button/Close.js
index <HASH>..<HASH> 100644
--- a/src/components/shared/Button/Close.js
+++ b/src/components/shared/Button/Close.js
@@ -1,15 +1,15 @@
// @flow
-import React, { PropTypes } from "react";
+import React from "react";
import Svg from "../Svg";
import "./Close.css";
-type CloseButtonType = {
- handleClick: any,
+type Props = {
+ handleClick: Function,
buttonClass?: string,
tooltip?: string
};
-function CloseButton({ handleClick, buttonClass, tooltip }: CloseButtonType) {
+function CloseButton({ handleClick, buttonClass, tooltip }: Props) {
return (
<div
className={buttonClass ? `close-btn ${buttonClass}` : "close-btn"}
@@ -21,8 +21,4 @@ function CloseButton({ handleClick, buttonClass, tooltip }: CloseButtonType) {
);
}
-CloseButton.propTypes = {
- handleClick: PropTypes.func.isRequired
-};
-
export default CloseButton; | Switch Close Button from PropType to Flow Props (#<I>) | firefox-devtools_debugger | train | js |
3095cdca0296d3cc71fc17b54d9214b4db6229fb | diff --git a/mailin.php b/mailin.php
index <HASH>..<HASH> 100644
--- a/mailin.php
+++ b/mailin.php
@@ -77,6 +77,14 @@ class Mailin
{
return $this->post("sms",json_encode(array("text"=>$text,"tag"=>$tag,"web_url"=>$web_url,"from"=>$from,"to"=>$to)));
}
+ public function create_sms_campaign($camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date)
+ {
+ return $this->post("sms",json_encode(array("name"=>$camp_name,"sender"=>$sender,"content"=>$content,"bat"=>$bat_sent,"listid"=>$listids,"exclude_list"=>$exclude_list, "scheduled_date"=>$scheduled_date)));
+ }
+ public function update_sms_campaign($id,$camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date)
+ {
+ return $this->put("sms/".$id,json_encode(array("name"=>$camp_name,"sender"=>$sender,"content"=>$content,"bat"=>$bat_sent,"listid"=>$listids,"exclude_list"=>$exclude_list, "scheduled_date"=>$scheduled_date)));
+ }
public function get_campaigns($type)
{
return $this->get("campaign",json_encode(array("type"=>$type))); | added functions for SMS campaign create/edit | mailin-api_mailin-api-php | train | php |
a50efa5683b64c9a814571b6b3105ae6977b69d6 | diff --git a/Templating/Helper/BlockHelper.php b/Templating/Helper/BlockHelper.php
index <HASH>..<HASH> 100644
--- a/Templating/Helper/BlockHelper.php
+++ b/Templating/Helper/BlockHelper.php
@@ -431,12 +431,12 @@ class BlockHelper extends Helper
$results = array();
foreach ($this->eventDispatcher->getListeners($eventName) as $listener) {
- if (is_object($listener[0])) {
+ if ($listener instanceof \Closure) {
+ $results[] = '{closure}()';
+ } elseif (is_object($listener[0])) {
$results[] = get_class($listener[0]);
} elseif (is_string($listener[0])) {
$results[] = $listener[0];
- } elseif ($listener instanceof \Closure) {
- $results[] = '{closure}()';
} else {
$results[] = 'Unknown type!';
} | Bugfix: Reordered if statements in BlockHelper (#<I>) | sonata-project_SonataBlockBundle | train | php |
cda33d1217747838e90f140e182916f3a27cd818 | diff --git a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMail.java b/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMail.java
index <HASH>..<HASH> 100644
--- a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMail.java
+++ b/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMail.java
@@ -99,7 +99,7 @@ public class GreenMail implements GreenMailOperations {
}
}
}
- managers = null;
+ managers = new Managers();
services = null;
} | Reinitialize managers directly after stop so we can call methods like setUser on them | greenmail-mail-test_greenmail | train | java |
2d40996966e7e1faad27f06ca6f77903188ac5ba | diff --git a/dist/hello.js b/dist/hello.js
index <HASH>..<HASH> 100644
--- a/dist/hello.js
+++ b/dist/hello.js
@@ -658,14 +658,6 @@ hello.utils.extend( hello, {
hello.utils.extend( hello.utils, {
- forEach : function(collection, fn){
- if (collection && collection.length) {
- for (var i = 0; i < collection.length; i += 1) {
- fn(collection[i]);
- }
- }
- },
-
// Append the querystring to a url
// @param string url
// @param object parameters | Revert dist/hello.js (prevent noisy diff). | MrSwitch_hello.js | train | js |
795f09840403d2c1eaad9ef9c534ca12f62e36ef | diff --git a/test/mithril.mount.js b/test/mithril.mount.js
index <HASH>..<HASH> 100644
--- a/test/mithril.mount.js
+++ b/test/mithril.mount.js
@@ -333,12 +333,11 @@ describe("m.mount()", function () {
})
}))
- list.pop()
+ list = []
refresh(true)
- // TODO: These fail.
- // expect(spies[1]).to.have.been.called
- // expect(spies[2]).to.have.been.called
+ expect(spies[1]).to.have.been.called
+ expect(spies[2]).to.have.been.called
expect(spies[3]).to.have.been.called
})
@@ -374,17 +373,15 @@ describe("m.mount()", function () {
})
}))
- list.pop()
+ list = []
refresh(true)
- // TODO: These fail.
- // expect(spies1[1]).to.have.been.called
- // expect(spies1[2]).to.have.been.called
+ expect(spies1[1]).to.have.been.called
+ expect(spies1[2]).to.have.been.called
expect(spies1[3]).to.have.been.called
- // TODO: These fail.
- // expect(spies2[1]).to.have.been.called
- // expect(spies2[2]).to.have.been.called
+ expect(spies2[1]).to.have.been.called
+ expect(spies2[2]).to.have.been.called
expect(spies2[3]).to.have.been.called
}) | Fix onunload test case
- the previous test only remove last item on array, but expect all
subcomponent's onunload to be called. This PR change it by clear that
array.
- uncomment previous test case that marked fail. | MithrilJS_mithril.js | train | js |
c99956d3e03392bc2bd513c8f1a48ed6ab27c1e4 | diff --git a/lib/levelup.js b/lib/levelup.js
index <HASH>..<HASH> 100644
--- a/lib/levelup.js
+++ b/lib/levelup.js
@@ -220,7 +220,7 @@ LevelUP.prototype = {
, batch: function (arr, options_, callback_) {
var callback, options, keyEncoding, valueEncoding, err
- if (!this.isOpen()) {
+ if (!this.isOpen() && !this.isClosed()) {
return this.once('ready', function () {
this.batch(arr, options_, callback_)
}) | fix deferred batch: !isOpen() && !isClosed() | Level_leveldown-mobile | train | js |
7d2d77769b2321526c0d8dc888bcdcb264e02e94 | diff --git a/lib/sugarcrm/base.rb b/lib/sugarcrm/base.rb
index <HASH>..<HASH> 100644
--- a/lib/sugarcrm/base.rb
+++ b/lib/sugarcrm/base.rb
@@ -131,7 +131,7 @@ module SugarCRM; class Base
# Saves the current object, checks that required fields are present.
# returns true or false
def save
- return false if !changed?
+ return false if !(new_record? || changed?)
return false if !valid?
begin
save! | try saving record if record is new
will load errors into hash (for Rails compatibility) | chicks_sugarcrm | train | rb |
3faf605ca419e623f9335ee5cc0cbf1789ed7c25 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -748,7 +748,7 @@ function Monoxide() {
if (!q.$refetch) return next(null, null);
self.query({
$collection: q.$collection,
- $id: this.rawResponse.insertedId,
+ $id: this.rawResponse.insertedId.toString(),
}, function(err, res) {
if (err == 'Not found') return next('Document creation failed');
next(err, res);
@@ -1447,7 +1447,7 @@ function Monoxide() {
var oidLeaf = _.get(doc, node.docPath);
if (_.isUndefined(oidLeaf)) return; // Ignore undefined
if (!self.utilities.isObjectID(oidLeaf)) {
- _.set(doc, node.docPath, self.utilities.objectID(oidLeaf));
+ _.set(outDoc, node.docPath, self.utilities.objectID(oidLeaf));
}
}); | BUGFIX: Fixes to OID population | hash-bang_Monoxide | train | js |
57a182442f9f1e581434445fc3b63a4a4454a061 | diff --git a/core/Db/Schema/Myisam.php b/core/Db/Schema/Myisam.php
index <HASH>..<HASH> 100644
--- a/core/Db/Schema/Myisam.php
+++ b/core/Db/Schema/Myisam.php
@@ -511,7 +511,7 @@ class Myisam implements SchemaInterface
// note that the token_auth value is anonymous, which is assigned by default as well in the Login plugin
$db = Db::get();
$db->query("INSERT INTO " . Common::prefixTable("user") . "
- VALUES ( 'anonymous', '', 'anonymous', 'anonymous@example.org', 'anonymous', '" . Date::factory('now')->getDatetime() . "' );");
+ VALUES ( 'anonymous', '', 'anonymous', 'anonymous@example.org', 'anonymous', 0, '" . Date::factory('now')->getDatetime() . "' );");
}
/** | refs #<I> fix adding anonymous user is not possible | matomo-org_matomo | train | php |
d2d5d9aa89208b80c520f47be7e9656307bf87b6 | diff --git a/spec/unit/postmark/client_spec.rb b/spec/unit/postmark/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/postmark/client_spec.rb
+++ b/spec/unit/postmark/client_spec.rb
@@ -30,15 +30,16 @@ describe Postmark::Client do
to yield_successive_args(*collection)
end
+ # Only Ruby >= 2.0.0 supports Enumerator#size
it 'lazily calculates the collection size',
- :skip_ruby_version => '1.8.7' do
+ :skip_ruby_version => ['1.8.7', '1.9'] do
allow(subject.http_client).
to receive(:get).exactly(1).times.and_return(response)
- expect(subject.find_each(path, name, :count => 2).size).to eq(10)
+ collection = subject.find_each(path, name, :count => 2)
+ expect(collection.size).to eq(10)
end
- it 'iterates over the collection to find its size',
- :exclusive_for_ruby_version => '1.8.7' do
+ it 'iterates over the collection to count it' do
allow(subject.http_client).
to receive(:get).exactly(5).times.and_return(response)
expect(subject.find_each(path, name, :count => 2).count).to eq(10) | Fix tests failing on Ruby <I> and JRuby in <I> mode. | wildbit_postmark-gem | train | rb |
3eeae52817d6c21a5e58af2e333a48bd5a401cac | diff --git a/spec/unit/rdf_spec.rb b/spec/unit/rdf_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/rdf_spec.rb
+++ b/spec/unit/rdf_spec.rb
@@ -17,7 +17,7 @@ describe 'RDF functionality of BEL language objects' do
it "provides a URI based on namespace name" do
stable_prefix = 'http://www.openbel.org/bel/namespace/'
- expect(HGNC.to_uri).to eq(stable_prefix + 'hgnc-human-genes/')
+ expect(HGNC.to_uri).to eq(stable_prefix + 'hgnc-human-genes')
end
end | fix rdf uri in spec test | OpenBEL_bel.rb | train | rb |
a025530e43ec0d96461f1b2bd55c3c422aa9ad94 | diff --git a/openfisca_web_api/tests/test_simulate.py b/openfisca_web_api/tests/test_simulate.py
index <HASH>..<HASH> 100644
--- a/openfisca_web_api/tests/test_simulate.py
+++ b/openfisca_web_api/tests/test_simulate.py
@@ -26,7 +26,6 @@
import json
from nose.tools import assert_equal
-from unittest.case import SkipTest
from webob import Request
from . import common
@@ -54,8 +53,6 @@ def test_simulate_with_invalid_body():
def test_simulate_with_test_case():
- raise SkipTest('Gives a 400. I am unable to fix because proper request is undocumented.')
-
test_case = {
'scenarios': [
{ | Don't skip simulate test anymore. | openfisca_openfisca-web-api | train | py |
a051e31700c5ff82c30db9568f4546a84ee4311c | diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -135,8 +135,8 @@ function table_column($table, $oldfield, $field, $type="integer", $size="10",
$dbinfo = $db->ServerInfo();
$dbver = substr($dbinfo['version'],0,3);
- $field = "$field";
//to prevent conflicts with reserved words
+ $field = "\"$field\"";
$oldfield = "\"$oldfield\"";
switch (strtolower($type)) { | To fix postgres column renaming. | moodle_moodle | train | php |
24c2b4a50a205bf711f23c9d4b9665a07a8288f4 | diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb
index <HASH>..<HASH> 100644
--- a/lib/ffi_yajl/ffi/encoder.rb
+++ b/lib/ffi_yajl/ffi/encoder.rb
@@ -4,8 +4,7 @@ require 'ffi_yajl/ffi'
module FFI_Yajl
module FFI
module Encoder
- def do_yajl_encode(obj, yajl_gen_opts = {}, opts)
-
+ def do_yajl_encode(obj, yajl_gen_opts, opts)
yajl_gen = FFI_Yajl.yajl_gen_alloc(nil);
# configure the yajl encoder | args aren't actually optional
and the caller ensures the hashes are initialized, so drop the
defensive programming. | chef_ffi-yajl | train | rb |
83b37dbb367e7fceb41ad103f9bd26653c026868 | diff --git a/lib/gitlab/request.rb b/lib/gitlab/request.rb
index <HASH>..<HASH> 100644
--- a/lib/gitlab/request.rb
+++ b/lib/gitlab/request.rb
@@ -1,4 +1,5 @@
require 'httparty'
+require 'json'
module Gitlab
# @private | By not including the 'json' gem the Request class is unable to find
JSON
NameError:
uninitialized constant Gitlab::Request::JSON | NARKOZ_gitlab | train | rb |
0cd5283ae5d0505ce50cab2fbea0debda68c53b7 | diff --git a/slave/ls340.py b/slave/ls340.py
index <HASH>..<HASH> 100644
--- a/slave/ls340.py
+++ b/slave/ls340.py
@@ -257,8 +257,19 @@ class LS340(IEC60488):
:ivar loop2: Am instance of the Loop class, representing the second control
loop.
:ivar logging: A Boolean value, enabling or disabling data logging.
+ :ivar program_status: The status of the currently running program
+ represented by the following tuple: *(<program>, <status>)*. If
+ program is zero, it means that no program is running.
"""
+ PROGRAM_STATUS = [
+ 'No errors',
+ 'Too many call commands',
+ 'Too many repeat commands',
+ 'Too many end repeat commands',
+ 'The control channel setpoint is not in temperature',
+ ]
+
def __init__(self, connection, scanner=None):
super(LS340, self).__init__(connection)
self.scanner = scanner
@@ -286,6 +297,9 @@ class LS340(IEC60488):
# =====================
self.logging = Command('LOG?', 'LOG', Boolean)
+ self.program_status = Command(('PGMRUN?',
+ [Integer, Enum(self.PROGRAM_STATUS)]))
+
def clear_alarm(self):
"""Clears the alarm status for all inputs."""
self.connection.write('ALMRST') | Implemented program status command, closes #<I> | p3trus_slave | train | py |
9b20b1cc0fe6bc2e327bcf791c5d824655585ec5 | diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -368,7 +368,7 @@ module ActionDispatch
end
def dispatcher(raise_on_name_error)
- @set.dispatcher raise_on_name_error
+ Routing::RouteSet::Dispatcher.new raise_on_name_error
end
end
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -385,10 +385,6 @@ module ActionDispatch
@prepend.each { |blk| eval_block(blk) }
end
- def dispatcher(raise_on_name_error)
- Routing::RouteSet::Dispatcher.new raise_on_name_error
- end
-
module MountedHelpers
extend ActiveSupport::Concern
include UrlFor | pull up dispatcher allocation
the dispatcher class isn't configurable anymore, so pull up allocation
to the method that needs it. | rails_rails | train | rb,rb |
2ef24b1e688e55b3704648322228ce6d6e04f309 | diff --git a/xbmc-provider/src/main/java/com/github/kmbulebu/nicknack/providers/xbmc/XbmcClient.java b/xbmc-provider/src/main/java/com/github/kmbulebu/nicknack/providers/xbmc/XbmcClient.java
index <HASH>..<HASH> 100644
--- a/xbmc-provider/src/main/java/com/github/kmbulebu/nicknack/providers/xbmc/XbmcClient.java
+++ b/xbmc-provider/src/main/java/com/github/kmbulebu/nicknack/providers/xbmc/XbmcClient.java
@@ -136,6 +136,8 @@ public class XbmcClient {
}
stopRequested = false;
websocketUri = uri;
+ client.setConnectTimeout(2000);
+ client.setMaxIdleTimeout(0);
client.start();
final ClientUpgradeRequest request = new ClientUpgradeRequest(); | Added timeouts to xbmc client connect. | kmbulebu_NickNack | train | java |
31ab707879376db530e7e4c46bb9917a8f4ed96d | diff --git a/pylp/lib/dest.py b/pylp/lib/dest.py
index <HASH>..<HASH> 100644
--- a/pylp/lib/dest.py
+++ b/pylp/lib/dest.py
@@ -30,11 +30,7 @@ def get_path(dest, file, cwd = None):
if not os.path.isabs(dest):
dest = os.path.join(cwd, dest)
- if file.base:
- relative = os.path.relpath(file.path, file.base)
- else:
- relative = os.path.basename(file.path)
-
+ relative = os.path.relpath(file.path, file.base)
return os.path.join(dest, relative) | Remove 'file.base' condition because files have always a base | pylp_pylp | train | py |
e4e1f774cf52caaa08d6f3729b889586519aac0c | diff --git a/test/user.js b/test/user.js
index <HASH>..<HASH> 100644
--- a/test/user.js
+++ b/test/user.js
@@ -8,7 +8,7 @@ var proxyquire = require('proxyquire');
var file = require('../lib/actions/file');
var async = require('async');
-describe('Generator.user', function () {
+describe('Generator#user', function () {
it('is exposed on the Base generator', function () {
assert.equal(require('../lib/actions/user'), require('../lib/base').prototype.user);
@@ -16,16 +16,14 @@ describe('Generator.user', function () {
describe('.git', function () {
- before(function (done) {
+ before(function () {
this.cwd = process.cwd();
this.tmp = shell.tempdir();
shell.cd(this.tmp);
file.mkdir('subdir');
- async.parallel([
- shell.exec.bind(shell, 'git init --quiet'),
- shell.exec.bind(shell, 'git config --local user.name Yeoman'),
- shell.exec.bind(shell, 'git config --local user.email yo@yeoman.io'),
- ], function () { done(); });
+ shell.exec('git init --quiet');
+ shell.exec('git config --local user.name Yeoman');
+ shell.exec('git config --local user.email yo@yeoman.io');
});
after(function () { | Run git command synchronously (Fix #<I>) | yeoman_environment | train | js |
a6e274c2dd8579768eef4ac51c19738a65009b97 | diff --git a/lib/array_logic/version.rb b/lib/array_logic/version.rb
index <HASH>..<HASH> 100644
--- a/lib/array_logic/version.rb
+++ b/lib/array_logic/version.rb
@@ -1,10 +1,14 @@
module ArrayLogic
- VERSION = "0.2.0"
+ VERSION = "0.2.1"
end
# History
# =======
#
+# Version 0.2.1
+# =============
+# Improved handling of errors in functions and add != operator
+#
# Version 0.2.0
# =============
# Adds functions: sum, count and average | Bump to version <I> | reggieb_array_logic | train | rb |
051a510eb63c71361604c365b65b5ac6d17b7329 | diff --git a/js/src/forum/addComposerAutocomplete.js b/js/src/forum/addComposerAutocomplete.js
index <HASH>..<HASH> 100644
--- a/js/src/forum/addComposerAutocomplete.js
+++ b/js/src/forum/addComposerAutocomplete.js
@@ -172,7 +172,7 @@ export default function addComposerAutocomplete() {
}
// Prevent the dropdown from going off screen on mobile
- top = Math.max(-parent.offset().top, top);
+ top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);
left = Math.max(-parent.offset().left, left);
dropdown.show(left, top); | Fix dropdown going off top of screen
The previous solution didn't properly account for document scroll, so when replying to posts, the parent offset would be extremely large, and it'd fall back to the top coordinate, which is out of bounds on small screens. | flarum_mentions | train | js |
47d6282e54c7df66f4ef9bc765e69d6db8e43acd | diff --git a/peerconn.go b/peerconn.go
index <HASH>..<HASH> 100644
--- a/peerconn.go
+++ b/peerconn.go
@@ -1403,10 +1403,13 @@ func (c *Peer) receiveChunk(msg *pp.Message) error {
// waiting for it to be written to storage.
piece.unpendChunkIndex(chunkIndex(req.ChunkSpec, t.chunkSize))
- // Cancel pending requests for this chunk.
- for c := range t.conns {
- c.postCancel(req)
- }
+ // Cancel pending requests for this chunk from *other* peers.
+ t.iterPeers(func(p *Peer) {
+ if p == c {
+ return
+ }
+ p.postCancel(req)
+ })
err := func() error {
cl.unlock() | Don't cancel request on current peer when receiving chunk | anacrolix_torrent | train | go |
1d21993decf3ec3faa4be808c41b81b53b9f7c9f | diff --git a/test/pagination_test.rb b/test/pagination_test.rb
index <HASH>..<HASH> 100644
--- a/test/pagination_test.rb
+++ b/test/pagination_test.rb
@@ -23,6 +23,12 @@ class PaginationTest < Minitest::Test
assert_equal "Relation loaded", error.message
end
+ def test_limit_relation_clone
+ products = Product.search("*")
+ assert_equal 10, products.limit(10).limit_value
+ assert_equal 10000, products.limit_value
+ end
+
def test_no_limit
names = 20.times.map { |i| "Product #{i}" }
store_names names | Added clone test [skip ci] | ankane_searchkick | train | rb |
96dc9d69a2dae465e9bc6e58f02a5fc289554a45 | diff --git a/lib/moneta/adapters/redis.rb b/lib/moneta/adapters/redis.rb
index <HASH>..<HASH> 100644
--- a/lib/moneta/adapters/redis.rb
+++ b/lib/moneta/adapters/redis.rb
@@ -26,7 +26,11 @@ module Moneta
# number as a time to live in seconds.
def key?(key, options = {})
with_expiry_update(key, default: nil, **options) do
- @backend.exists(key)
+ if @backend.respond_to?(:exists?)
+ @backend.exists?(key)
+ else
+ @backend.exists(key)
+ end
end
end | Supporting exists? while retaining exists | moneta-rb_moneta | train | rb |
5e4f296057192e351db929b55b801a97dc6f329f | diff --git a/core/lib/mno_enterprise/version.rb b/core/lib/mno_enterprise/version.rb
index <HASH>..<HASH> 100644
--- a/core/lib/mno_enterprise/version.rb
+++ b/core/lib/mno_enterprise/version.rb
@@ -1,3 +1,3 @@
module MnoEnterprise
- VERSION = '3.0.2'
+ VERSION = '3.0.3'
end | Preparing for <I> release | maestrano_mno-enterprise | train | rb |
72f75ec7acd003ccea303601b9f33170301582ec | diff --git a/cherrypy/lib/sessions.py b/cherrypy/lib/sessions.py
index <HASH>..<HASH> 100644
--- a/cherrypy/lib/sessions.py
+++ b/cherrypy/lib/sessions.py
@@ -688,8 +688,8 @@ def init(storage_type='ram', path=None, path_header=None, name='session_id',
"""Initialize session object (using cookies).
storage_type
- One of 'ram', 'file', 'postgresql'. This will be used
- to look up the corresponding class in cherrypy.lib.sessions
+ One of 'ram', 'file', 'postgresql', 'memcached'. This will be
+ used to look up the corresponding class in cherrypy.lib.sessions
globals. For example, 'file' will use the FileSession class.
path | Updating the documentation as per #<I> | cherrypy_cheroot | train | py |
6efb806cc2f4debd12dc929adb8df3aca74f20f5 | diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go
index <HASH>..<HASH> 100644
--- a/internal/ui/ui_js.go
+++ b/internal/ui/ui_js.go
@@ -21,7 +21,6 @@ import (
"github.com/gopherjs/webgl"
"github.com/hajimehoshi/ebiten/internal/opengl"
"strconv"
- "time"
)
var canvas js.Object
@@ -32,7 +31,12 @@ func Use(f func(*opengl.Context)) {
}
func DoEvents() {
- time.Sleep(0)
+ // TODO: requestAnimationFrame is not called when the window is not activated.
+ ch := make(chan struct{})
+ js.Global.Get("window").Call("requestAnimationFrame", func() {
+ close(ch)
+ })
+ <-ch
}
func Terminate() { | Stabilize FPS for JS | hajimehoshi_ebiten | train | go |
c6f5a0e8190915f35cb2b98ca64c8013f1156c88 | diff --git a/errors.go b/errors.go
index <HASH>..<HASH> 100644
--- a/errors.go
+++ b/errors.go
@@ -95,7 +95,7 @@ var (
// ErrTruncateNeeded is returned when the value log gets corrupt, and requires truncation of
// corrupt data to allow Badger to run properly.
- ErrTruncateNeeded = errors.New("Data corruption detected. Value log truncate required to run DB. This would result in data loss.")
+ ErrTruncateNeeded = errors.New("Value log truncate required to run DB. This might result in data loss.")
)
// Key length can't be more than uint16, as determined by table::header. | Fix the wordings of error message. | dgraph-io_badger | train | go |
59337707489db6fd3f842e35b4eb3cef62ccced7 | diff --git a/sparklines/__main__.py b/sparklines/__main__.py
index <HASH>..<HASH> 100644
--- a/sparklines/__main__.py
+++ b/sparklines/__main__.py
@@ -122,7 +122,7 @@ def main():
a = args = p.parse_args()
if args.version:
- print('0.4.1')
+ print('0.4.2') # FIXME: needs to be taken again from setup.py...
sys.exit()
numbers = args.nums | Change output for -V to <I> | deeplook_sparklines | train | py |
cf756d138898027caef107b1d2db21301ec035aa | diff --git a/ui/RenderingEngine.js b/ui/RenderingEngine.js
index <HASH>..<HASH> 100644
--- a/ui/RenderingEngine.js
+++ b/ui/RenderingEngine.js
@@ -58,6 +58,8 @@ function _create(state, vel) {
if (vel._isVirtualComponent) {
console.assert(parent, "A Component should have a parent.");
comp = new vel.ComponentClass(parent, vel.props);
+ // HACK: making sure that we have the right props
+ vel.props = comp.props
comp.__htmlConfig__ = vel._copyHTMLConfig();
} else if (vel._isVirtualHTMLElement) {
comp = new Component.Element(parent, vel); | Make sure to use right props. | substance_substance | train | js |
6a28d466670c0a2d8871ae72b09bcb4bec92f365 | diff --git a/libraries/lithium/tests/cases/test/ReportTest.php b/libraries/lithium/tests/cases/test/ReportTest.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/tests/cases/test/ReportTest.php
+++ b/libraries/lithium/tests/cases/test/ReportTest.php
@@ -75,7 +75,7 @@ class ReportTest extends \lithium\test\Unit {
$report->run();
$result = $report->render("stats");
- $this->assertPattern("#1./.*1.*passes,.*0.*fails.*0.*exceptions#s", $result);
+ $this->assertPattern("#1.*1.*passes,.*0.*fails.*0.*exceptions#s", $result);
}
public function testSingleFilter() { | Correcting test pattern, dropping requirement for slash as separator. | UnionOfRAD_framework | train | php |
e8968f5cb8ab4cb44b41a343ac8d48d8be8dd5f9 | diff --git a/src/Exceptions/CharonErrorHandler.php b/src/Exceptions/CharonErrorHandler.php
index <HASH>..<HASH> 100644
--- a/src/Exceptions/CharonErrorHandler.php
+++ b/src/Exceptions/CharonErrorHandler.php
@@ -7,6 +7,7 @@ use CatLab\Charon\Exceptions\NoInputDataFound;
use CatLab\Requirements\Exceptions\ValidationException;
use Exception;
use CatLab\Charon\Exceptions\EntityNotFoundException;
+use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Class Handler
@@ -27,6 +28,7 @@ class CharonErrorHandler
switch (get_class($exception)) {
case EntityNotFoundException::class:
+ case ModelNotFoundException::class:
return $this->jsonResponse('Resource not found', $exception->getMessage(), 404);
case NoInputDataFound::class: | Working on fixing the soft deletes on courses. | CatLabInteractive_charon-laravel | train | php |
41e8b6f8928f42acb861efac8367bcf92a8a990e | diff --git a/test/blackbox/blackbox-separate-components.js b/test/blackbox/blackbox-separate-components.js
index <HASH>..<HASH> 100644
--- a/test/blackbox/blackbox-separate-components.js
+++ b/test/blackbox/blackbox-separate-components.js
@@ -527,6 +527,7 @@ suite('blackbox: separate gearslothd processes', function() {
function(callback) {
worker3 = new MultiserverWorker(conf.servers, 'test', test__at_func_3.bind(null, done));
worker3.on('connect', function(){
+ callback();
});
},
function(callback) { | corrected a test, all tests pass | meetings_gearsloth | train | js |
2c995e50fbd1ac4aae6f863c371eca00aa065d75 | diff --git a/src/cjs.js b/src/cjs.js
index <HASH>..<HASH> 100644
--- a/src/cjs.js
+++ b/src/cjs.js
@@ -1005,6 +1005,11 @@ cjs.ArrayConstraint = ArrayConstraint;
//
var defaulthash = function(key) { return ""+key; };
+var get_str_hash_fn = function(prop_name) {
+ return function(key) {
+ return key[prop_name]();
+ };
+};
var MapConstraint = function(options) {
options = extend({
hash: defaulthash,
@@ -1014,7 +1019,7 @@ var MapConstraint = function(options) {
values: []
}, options);
this._equality_check = options.equals;
- this._hash = options.hash;
+ this._hash = isString(options.hash) ? get_str_hash_fn(options.hash) : options.hash;
this._values = {};
this._unsubstantiated_values = {}; | Hashes may be expressed as a string to represent a property name to call | soney_constraintjs | train | js |
e626219b2f1102da6e3e1880bd9b98577cc22abc | diff --git a/TYPO3.TYPO3CR/Classes/T3_TYPO3CR_RangeIterator.php b/TYPO3.TYPO3CR/Classes/T3_TYPO3CR_RangeIterator.php
index <HASH>..<HASH> 100644
--- a/TYPO3.TYPO3CR/Classes/T3_TYPO3CR_RangeIterator.php
+++ b/TYPO3.TYPO3CR/Classes/T3_TYPO3CR_RangeIterator.php
@@ -195,6 +195,7 @@ class T3_TYPO3CR_RangeIterator implements T3_phpCR_RangeIteratorInterface {
* @author Karsten Dambekalns <karsten@typo3.org>
*/
public function rewind() {
+ $this->position = 0;
reset($this->elements);
} | (TYPO3CR) rewind() in RangeIterator no resets the position as well. I broke this with r<I>.
Original-Commit-Hash: da<I>cf5e<I>c<I>da0bae<I>af<I>f<I>a3 | neos_neos-development-collection | train | php |
6c5ccca4cdef2be9aa84a037b94c45b6855bf469 | diff --git a/server/application/application.go b/server/application/application.go
index <HASH>..<HASH> 100644
--- a/server/application/application.go
+++ b/server/application/application.go
@@ -1064,7 +1064,7 @@ func (s *Server) RunResourceAction(ctx context.Context, q *application.ResourceA
Version: q.Version,
Group: q.Group,
}
- res, config, _, err := s.getAppResource(ctx, rbacpolicy.ActionGet, resourceRequest)
+ res, config, _, err := s.getAppResource(ctx, rbacpolicy.ActionOverride, resourceRequest)
if err != nil {
return nil, err
} | Running application actions should require `override` privileges not `get` (#<I>) | argoproj_argo-cd | train | go |
e3c3b69b4ce9248dff7e413d03ff6eaf9a1d494a | diff --git a/py2pack/py2pack.py b/py2pack/py2pack.py
index <HASH>..<HASH> 100644
--- a/py2pack/py2pack.py
+++ b/py2pack/py2pack.py
@@ -37,7 +37,7 @@ from pprint import pprint
warnings.filterwarnings('ignore', 'Module argparse was already imported') # Filter a UserWarning from Jinja2
import jinja2
-__version__ = '0.4.3.1'
+__version__ = '0.4.3.2'
class ProxiedTransport(xmlrpclib.Transport):
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -59,7 +59,7 @@ setup(
url='http://github.com/saschpe/py2pack',
scripts=['scripts/py2pack'],
packages=['py2pack'],
- package_data={'py2pack': ['templates/*']},
+ package_data={'py2pack': ['templates/*', 'suse_spdx_license_map.p']},
data_files=[('share/doc/py2pack', ['AUTHORS', 'LICENSE', 'README.rst']),
('share/doc/py2pack/html', ['docs/py2pack.html']),
#('share/doc/py2pack/pdf', ['docs/py2pack.pdf']), | Release <I>
Bugfix release, should be in binary distros too ;-) | openSUSE_py2pack | train | py,py |
6dcc92c93ab754b2b0c0be337867d6d5e9e84725 | diff --git a/lib/wired/version.rb b/lib/wired/version.rb
index <HASH>..<HASH> 100644
--- a/lib/wired/version.rb
+++ b/lib/wired/version.rb
@@ -1,3 +1,3 @@
module Wired
- VERSION = '0.0.1'
+ VERSION = '0.0.2'
end | upped version to <I> | wirelab_wired | train | rb |
73f6b1f808c96899bf8685cf347e29437311279b | diff --git a/lib/Redmine/Api/Project.php b/lib/Redmine/Api/Project.php
index <HASH>..<HASH> 100644
--- a/lib/Redmine/Api/Project.php
+++ b/lib/Redmine/Api/Project.php
@@ -103,7 +103,7 @@ class Project extends AbstractApi
$xml = new \SimpleXMLElement('<?xml version="1.0"?><project></project>');
foreach ($params as $k => $v) {
- if ('tracker_ids' == $k) {
+ if ('tracker_ids' == $k && is_array($v)) {
$trackers = $xml->addChild('tracker_ids', '');
$trackers->addAttribute('type', 'array');
foreach ($v as $id) { | accept trackers ids array for creating a project | kbsali_php-redmine-api | train | php |
dc46bd1b192863b98b10f3a30a25c0f3ffe2848f | diff --git a/cq/appengine/config/config.go b/cq/appengine/config/config.go
index <HASH>..<HASH> 100644
--- a/cq/appengine/config/config.go
+++ b/cq/appengine/config/config.go
@@ -123,14 +123,14 @@ type refKey struct {
}
func validateConfigGroup(ctx *validation.Context, group *v2.ConfigGroup) {
- re, _ := regexp.Compile("^[a-zA-Z][a-zA-Z0-9_-]*$")
+ re, _ := regexp.Compile("^[a-zA-Z][a-zA-Z0-9_-]{0,39}$")
switch {
case group.Name == "":
// TODO(crbug/1063508): make this an error.
ctx.Warningf("please, specify `name` for monitoring and analytics")
case !re.MatchString(group.Name):
// TODO(crbug/1063508): make this an error.
- ctx.Warningf("`name` must match '^[a-zA-Z][a-zA-Z0-9 _.-]*$': %q", group.Name)
+ ctx.Warningf("`name` must match %q but %q given", re, group.Name)
}
if len(group.Gerrit) == 0 { | cq: limit config group name to <I> chars and fix warning.
Previously, warning included incorrect regexp suggesting that
spaces are allowed.
R=qyearsley, yiwzhang
Change-Id: I<I>c1ffc9d<I>f<I>bc<I>aab<I>e0eb2a<I>
Reviewed-on: <URL> | luci_luci-go | train | go |
4f191f774b1b8e6a303bf6bb1225a593742caa1e | diff --git a/funfactory/manage.py b/funfactory/manage.py
index <HASH>..<HASH> 100644
--- a/funfactory/manage.py
+++ b/funfactory/manage.py
@@ -60,14 +60,15 @@ def setup_environ(manage_file, settings=None):
sys.path[:0] = new_sys_path
from django.core.management import execute_manager, setup_environ
- if os.path.isfile(os.path.join(os.getcwd(), 'settings_local.py')):
- import settings_local as settings
- import warnings
- warnings.warn("Using settings_local.py is deprecated. See "\
- "http://playdoh.readthedocs.org/en/latest/upgrading.html",
- DeprecationWarning)
- else:
- import settings
+ if not settings:
+ if os.path.isfile(os.path.join(os.getcwd(), 'settings_local.py')):
+ import settings_local as settings
+ import warnings
+ warnings.warn("Using settings_local.py is deprecated. See "
+ "http://playdoh.readthedocs.org/en/latest/upgrading.html",
+ DeprecationWarning)
+ else:
+ import settings
current_settings = settings
# If we want to use django settings anywhere, we need to set up the | bustage fix to comply with the old behaviour of manage where you could override the settings as a parameter | mozilla_funfactory | train | py |
636de20197aa2bd2d1ee8e9f6c6cd84d42b11270 | diff --git a/ryu/services/protocols/ovsdb/manager.py b/ryu/services/protocols/ovsdb/manager.py
index <HASH>..<HASH> 100644
--- a/ryu/services/protocols/ovsdb/manager.py
+++ b/ryu/services/protocols/ovsdb/manager.py
@@ -60,8 +60,13 @@ class OVSDB(app_manager.RyuApp):
return True
while True:
- # TODO(jkoelker) SSL Certificate Fingerprint check
- sock, client_address = server.accept()
+ try:
+ # TODO(jkoelker) SSL Certificate Fingerprint check
+ sock, client_address = server.accept()
+
+ except:
+ self.logger.exception('Error accepting connection')
+ continue
if not check(client_address[0]):
sock.shutdown(socket.SHUT_RDWR) | protocols/ovsdb: Handle accept() errors
An exception during server.accept() should not cause the server thread
to terminate. Log the exception and continue instead. | osrg_ryu | train | py |
5b8cb7416f658f13fd35236941fc7ce556730c91 | diff --git a/src/Jasny/DB/MySQL/Table.php b/src/Jasny/DB/MySQL/Table.php
index <HASH>..<HASH> 100644
--- a/src/Jasny/DB/MySQL/Table.php
+++ b/src/Jasny/DB/MySQL/Table.php
@@ -299,7 +299,7 @@ class Table extends \Jasny\DB\Table
switch ($i) {
case 0: $key = $fieldtype; break;
case 1: $key = preg_replace('/\s*\(.+?\)/', '', $fieldtype); break;
- case 2: $key = preg_replace('/\s*\(/', '', $fieldtype); break;
+ case 2: $key = preg_replace('/\s*\(.+$/', '', $fieldtype); break;
}
if (isset(self::$castTypes[$key])) return self::$castTypes[$key]; | Fixed issue with type on MySQL\Table | jasny_db | train | php |
40e20dccc7debea40d074072084632751741542c | diff --git a/lib/plugins/helper/list.js b/lib/plugins/helper/list.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/helper/list.js
+++ b/lib/plugins/helper/list.js
@@ -230,7 +230,7 @@ exports.list_archives = function(options){
if (!monthly.length) continue;
- item(i + '/' + (j < 10 ? '0' + j : j), moment({year: i, month: j - 1}).format(format), monthly.length);
+ item(i + '/' + (j < 10 ? '0' + j : j) + '/', moment({year: i, month: j - 1}).format(format), monthly.length);
}
} | Fix issue #<I>, add tail `/` to archive links | hexojs_hexo | train | js |
1f553c92e55aee70745c523acd705580aced46dd | diff --git a/lib/Persistence/Doctrine/Handler/CollectionHandler.php b/lib/Persistence/Doctrine/Handler/CollectionHandler.php
index <HASH>..<HASH> 100644
--- a/lib/Persistence/Doctrine/Handler/CollectionHandler.php
+++ b/lib/Persistence/Doctrine/Handler/CollectionHandler.php
@@ -198,7 +198,7 @@ class CollectionHandler implements CollectionHandlerInterface
{
$data = $this->queryHandler->loadCollectionData($collectionId, $status);
- return (int)$data[0]['type'] === Collection::TYPE_NAMED;
+ return isset($data[0]['type']) && (int)$data[0]['type'] === Collection::TYPE_NAMED;
}
/** | Make sure array element exists before using it | netgen-layouts_layouts-core | train | php |
11511d1bbabcf653aa4d047551a6cbf50458833f | diff --git a/src/Gossamer/Pesedget/Commands/BulkSaveCommand.php b/src/Gossamer/Pesedget/Commands/BulkSaveCommand.php
index <HASH>..<HASH> 100644
--- a/src/Gossamer/Pesedget/Commands/BulkSaveCommand.php
+++ b/src/Gossamer/Pesedget/Commands/BulkSaveCommand.php
@@ -2,13 +2,10 @@
namespace Gossamer\Pesedget\Commands;
use Gossamer\Pesedget\Commands\AbstractCommand;
-use Gossamer\Pesedget\Entities\OneToManyChildInterface;
use Gossamer\Pesedget\Database\QueryBuilder;
-use Gossamer\Pesedget\Entities\AbstractI18nEntity;
-use Gossamer\Pesedget\Entities\MultiRowInterface;
-use Gossamer\Pesedget\Entities\OneToManyJoinInterface;
-class SaveCommand extends AbstractCommand {
+
+class BulkSaveCommand extends AbstractCommand {
/** | minor tweek to bulk insert command | dmeikle_pesedget | train | php |
fe2b32d24ef032070b46ca7b9430242fda1980d3 | diff --git a/web/concrete/src/Tree/Type/Topic.php b/web/concrete/src/Tree/Type/Topic.php
index <HASH>..<HASH> 100644
--- a/web/concrete/src/Tree/Type/Topic.php
+++ b/web/concrete/src/Tree/Type/Topic.php
@@ -115,7 +115,7 @@ class Topic extends Tree
if (is_array($row) && $row['treeID']) {
$this->setPropertiesFromArray($row);
- return $tree;
+ return $this;
}
} | $tree is really $this
Former-commit-id: <I>b<I>b<I>c<I>ed<I>b0a<I>cd<I>d<I>acf<I> | concrete5_concrete5 | train | php |
13e29629c5307f94ab1c47aea2a3e03f67d96e71 | diff --git a/sdk/eventhub/azure-eventhubs-checkpointstoreblob-aio/tests/test_storage_blob_partition_manager.py b/sdk/eventhub/azure-eventhubs-checkpointstoreblob-aio/tests/test_storage_blob_partition_manager.py
index <HASH>..<HASH> 100644
--- a/sdk/eventhub/azure-eventhubs-checkpointstoreblob-aio/tests/test_storage_blob_partition_manager.py
+++ b/sdk/eventhub/azure-eventhubs-checkpointstoreblob-aio/tests/test_storage_blob_partition_manager.py
@@ -28,7 +28,7 @@ def get_live_storage_blob_client():
container_str = str(uuid.uuid4())
blob_service_client = BlobServiceClient.from_connection_string(storage_connection_str)
blob_service_client.create_container(container_str)
- container_client = ContainerClient.from_connection_string(storage_connection_str, container=container_str)
+ container_client = ContainerClient.from_connection_string(storage_connection_str, container_str)
return container_str, container_client | Update ep livetest according to storage-blob-b4 (#<I>) | Azure_azure-sdk-for-python | train | py |
59bb7ba3ed26eeebb9a2059e85e84371db2ae7d9 | diff --git a/models.py b/models.py
index <HASH>..<HASH> 100644
--- a/models.py
+++ b/models.py
@@ -1353,6 +1353,7 @@ class Deposition(object):
if not t.authorize(None, 'create'):
raise ForbiddenAction('create')
+ # Note: it is correct to pass 'type' and not 't' below to constructor.
obj = cls(None, type=type, user_id=user.get_id())
return obj
@@ -1369,8 +1370,11 @@ class Deposition(object):
type = DepositionType.get(type)
try:
- workflow_object = BibWorkflowObject.query.filter_by(
- id=object_id
+ workflow_object = BibWorkflowObject.query.filter(
+ BibWorkflowObject.id == object_id,
+ # id_user!=0 means current version, as opposed to some snapshot
+ # version.
+ BibWorkflowObject.id_user != 0,
).one()
except NoResultFound:
raise DepositionDoesNotExists(object_id)
@@ -1391,6 +1395,8 @@ class Deposition(object):
if user:
params.append(BibWorkflowObject.id_user == user.get_id())
+ else:
+ params.append(BibWorkflowObject.id_user != 0)
if type:
params.append(Workflow.name == type.get_identifier()) | deposit: snapshot object fix
* Fixes issue with snapshots of workflow objects being accessible via
the deposit interface. | inveniosoftware_invenio-deposit | train | py |
9f1bd98fcc5b55887a12b72499456a9ae9233978 | diff --git a/tests/func/experiments/test_experiments.py b/tests/func/experiments/test_experiments.py
index <HASH>..<HASH> 100644
--- a/tests/func/experiments/test_experiments.py
+++ b/tests/func/experiments/test_experiments.py
@@ -1,6 +1,10 @@
+import pytest
+
from tests.func.test_repro_multistage import COPY_SCRIPT
+# https://github.com/iterative/dvc/issues/4401
+@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_new_simple(tmp_dir, scm, dvc, mocker):
tmp_dir.gen("copy.py", COPY_SCRIPT)
tmp_dir.gen("params.yaml", "foo: 1") | Mark test_new_simple as flaky (#<I>)
It is for short period of time till it gets resolved
See: #<I> | iterative_dvc | train | py |
54931afa8bdf605aa0cde88a7f0e62acca80b25a | diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientsRegistrar.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientsRegistrar.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientsRegistrar.java
+++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientsRegistrar.java
@@ -190,8 +190,6 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
private void validate(Map<String, Object> attributes) {
if (StringUtils.hasText((String) attributes.get("value"))) {
- Assert.isTrue(!StringUtils.hasText((String) attributes.get("name")),
- "Either name or value can be specified, but not both");
Assert.isTrue(!StringUtils.hasText((String) attributes.get("serviceId")),
"Either name (serviceId) or value can be specified, but not both");
} | Remove assertion that fails in spring <I>.x
Need to make this class <I>.x compatible.
see gh-<I> | spring-cloud_spring-cloud-netflix | train | java |
aef0d296c9820e6d0552cd8211ef8e6336687158 | diff --git a/tasks/load-options.js b/tasks/load-options.js
index <HASH>..<HASH> 100644
--- a/tasks/load-options.js
+++ b/tasks/load-options.js
@@ -8,7 +8,8 @@
'use strict';
-var requireDirectory = require('require-directory');
+var requireDirectory = require('require-directory'),
+ path = require('path');
module.exports = function (grunt, options) {
@@ -21,7 +22,7 @@ module.exports = function (grunt, options) {
// Load configuration.
options.configFolders.forEach(function (configFolder) {
- var src = options.folder + '/' + configFolder;
+ var src = path.resolve(path.join(options.folder, configFolder));
if (grunt.file.exists(src) && grunt.file.isDir(src)) {
var obj = requireDirectory(module, src);
Object.keys(obj).forEach(function (prop) {
@@ -33,7 +34,7 @@ module.exports = function (grunt, options) {
// Load tasks.
options.taskFolders.forEach(function (taskFolder) {
- var src = options.folder + '/' + taskFolder;
+ var src = path.resolve(path.join(options.folder, taskFolder));
if (grunt.file.exists(src) && grunt.file.isDir(src)) {
grunt.loadTasks(src);
} | Fix for downstream require-directory issues, make paths system-independent | chriszarate_grunt-load-options | train | js |
b0f74b5a96c9ad9b8652c28e19349761f4a540f1 | diff --git a/src/Api/Transaction/Capture.php b/src/Api/Transaction/Capture.php
index <HASH>..<HASH> 100644
--- a/src/Api/Transaction/Capture.php
+++ b/src/Api/Transaction/Capture.php
@@ -51,7 +51,7 @@ class Capture extends Transaction
/**
* Set the track and trace code
*
- * @param int $tracktrace
+ * @param string $tracktrace
*/
public function setTracktrace($tracktrace)
{
diff --git a/src/Transaction.php b/src/Transaction.php
index <HASH>..<HASH> 100644
--- a/src/Transaction.php
+++ b/src/Transaction.php
@@ -502,9 +502,9 @@ class Transaction
/**
* Capture a transaction
*
- *
- * @param array $options
- * @param $transactionId
+ * @param string $transactionId
+ * @param string|null $amount
+ * @param string|null $tracktrace
* @return bool
* @throws Error\Api
* @throws Error\Error | Changed tracktrace to string instead of int and edited the dockblock | paynl_sdk | train | php,php |
20808318bddd324d71e1cbe67426c7b7dd5e39a8 | diff --git a/app.js b/app.js
index <HASH>..<HASH> 100644
--- a/app.js
+++ b/app.js
@@ -246,7 +246,11 @@ async.waterfall([
}
], function(err, results) {
var rm, user;
- if (err) {
+ if (err && err.name == "NoSuchThingError") {
+ // Clear the cookie and continue
+ res.clearCookie("rememberme", {path: "/"});
+ next();
+ } else if (err) {
next(err);
} else { | Don't die on bad RM cookie | e14n_pump.io-client-app | train | js |
1ae28ef4c13d27639a3f92ef910f2842918305c3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ setup(
packages=packages,
package_dir={'rwslib': 'rwslib'},
include_package_data=True,
- install_requires=['requests','lxml','httpretty'],
+ install_requires=['requests', 'lxml', 'httpretty', 'six'],
license=open('LICENSE.txt').read(),
zip_safe=False,
test_suite='rwslib.tests.all_tests',
@@ -43,5 +43,7 @@ setup(
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: Implementation :: PyPy',
),
) | Updated dependencies
Added extra classifiers | mdsol_rwslib | train | py |
e0c59b8e89620b69ba4294491b6acd265e1e02e3 | diff --git a/libraries/joomla/database/driver/pdo.php b/libraries/joomla/database/driver/pdo.php
index <HASH>..<HASH> 100644
--- a/libraries/joomla/database/driver/pdo.php
+++ b/libraries/joomla/database/driver/pdo.php
@@ -944,6 +944,31 @@ abstract class JDatabaseDriverPdo extends JDatabaseDriver
*/
public function __sleep()
{
- return array();
+ $serializedProperties = array();
+
+ $reflect = new ReflectionClass($this);
+ $properties = $reflect->getProperties();
+ $staticProperties = $reflect->getStaticProperties();
+ foreach ($properties as $key => $property)
+ {
+ if (strcmp($property->name, 'connection') !== 0 && !array_key_exists($property->name, $staticProperties))
+ {
+ array_push($serializedProperties, $property->name);
+ }
+ }
+
+ return $serializedProperties;
+ }
+
+ /**
+ * Wake up after serialization
+ *
+ * @return array
+ *
+ * @since 12.3
+ */
+ public function __wakeup()
+ {
+ $this->__construct($this->options);
}
} | All properties except PDO ones are serialized | joomla_joomla-framework | train | php |
2479fb42f0a9bb45c2e82f11efc73c0a75fc492c | diff --git a/notifier/notifier_test.go b/notifier/notifier_test.go
index <HASH>..<HASH> 100644
--- a/notifier/notifier_test.go
+++ b/notifier/notifier_test.go
@@ -590,8 +590,13 @@ func TestHangingNotifier(t *testing.T) {
close(done)
}()
+ var calledOnce bool
// Setting up a bad server. This server hangs for 2 seconds.
badServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if calledOnce {
+ t.Fatal("hanging server called multiple times")
+ }
+ calledOnce = true
select {
case <-done:
case <-time.After(2 * time.Second):
@@ -672,8 +677,8 @@ func TestHangingNotifier(t *testing.T) {
}()
select {
- case <-time.After(300 * time.Millisecond):
- t.Fatalf("Timeout after 300 milliseconds, targets not synced in time.")
+ case <-time.After(1 * time.Second):
+ t.Fatalf("Timeout after 1 second, targets not synced in time.")
case <-changed:
// The good server has been hit in less than 3 seconds, therefore
// targets have been updated before a second call could be made to the | Improve notifier queue test to reduce flakiness (#<I>) | prometheus_prometheus | train | go |
9ab61256ba9b368cb50a147a22a596f852b6e084 | diff --git a/openvidu-browser/config/typedoc.js b/openvidu-browser/config/typedoc.js
index <HASH>..<HASH> 100644
--- a/openvidu-browser/config/typedoc.js
+++ b/openvidu-browser/config/typedoc.js
@@ -13,7 +13,9 @@ module.exports = {
exclude: [
"**/OpenViduInternal/Interfaces/Private/**",
"**/OpenViduInternal/WebRtcStats/WebRtcStats.ts",
- "**/OpenViduInternal/WebRtcPeer/WebRtcPeer.ts"
+ "**/OpenViduInternal/WebRtcPeer/WebRtcPeer.ts",
+ "**/OpenViduInternal/ScreenSharing/**",
+ "**/OpenViduInternal/KurentoUtils/**"
],
excludeExternals: true,
excludePrivate: true, | openvidu-browser: exclude js files from Typedoc | OpenVidu_openvidu | train | js |
f202e423d96249b679af5db91073a5adbf025340 | diff --git a/test/src/Provider/MicrosoftTest.php b/test/src/Provider/MicrosoftTest.php
index <HASH>..<HASH> 100644
--- a/test/src/Provider/MicrosoftTest.php
+++ b/test/src/Provider/MicrosoftTest.php
@@ -32,6 +32,14 @@ class MicrosoftTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($this->provider->state);
}
+ public function testUrlAuthorize()
+ {
+ $url = $this->provider->urlAuthorize();
+ $uri = parse_url($url);
+
+ $this->assertEquals('/oauth20_authorize.srf', $uri['path']);
+ }
+
public function testUrlAccessToken()
{
$url = $this->provider->urlAccessToken(); | Add test to cover Provider\Microsoft::urlAuthorize() | thephpleague_oauth2-client | train | php |
73d62c307be0c4021d85961191cdb1caedad9d16 | diff --git a/pymysql/cursors.py b/pymysql/cursors.py
index <HASH>..<HASH> 100644
--- a/pymysql/cursors.py
+++ b/pymysql/cursors.py
@@ -103,12 +103,14 @@ class Cursor(object):
#Worst case it will throw a Value error
return conn.escape(args)
- def execute(self, query, args=None):
- '''Execute a query'''
- conn = self._get_db()
+ def mogrify(self, query, args=None):
+ """
+ Returns the exact string that is sent to the database by calling the
+ execute() method.
- while self.nextset():
- pass
+ This method follows the extension to the DB API 2.0 followed by Psycopg.
+ """
+ conn = self._get_db()
if PY2: # Use bytes on Python 2 always
encoding = conn.encoding
@@ -131,6 +133,15 @@ class Cursor(object):
if args is not None:
query = query % self._escape_args(args, conn)
+ return query
+
+ def execute(self, query, args=None):
+ '''Execute a query'''
+ while self.nextset():
+ pass
+
+ query = self.mogrify(query, args)
+
result = self._query(query)
self._executed = query
return result | Add mogrify to Cursor, which returns the exact string to be executed
This method is an extension to the DB API <I> also used by Psycopg.
See <URL> | PyMySQL_PyMySQL | train | py |
226916d641dce4c6044f2571e83ceb73fcc17929 | diff --git a/Stub/StubIntlDateFormatter.php b/Stub/StubIntlDateFormatter.php
index <HASH>..<HASH> 100644
--- a/Stub/StubIntlDateFormatter.php
+++ b/Stub/StubIntlDateFormatter.php
@@ -40,10 +40,16 @@ class StubIntlDateFormatter
public function format($timestamp)
{
+ $regExp = "/('(M+|y+|d+|[^Myd])|M+|y+|d+)/";
+
$callback = function($matches) use ($timestamp) {
$pattern = $matches[0];
$length = strlen($pattern);
+ if ("'" === $pattern[0]) {
+ return substr($pattern, 1);
+ }
+
switch ($pattern[0]) {
case 'M':
$matchLengthMap = array(
@@ -83,7 +89,7 @@ class StubIntlDateFormatter
}
};
- $formatted = preg_replace_callback('/(M+|y+|d+)/', $callback, $this->getPattern());
+ $formatted = preg_replace_callback($regExp, $callback, $this->getPattern());
return $formatted;
} | [Locale] add support for escaping, give specifics on implementation used in tests | symfony_locale | train | php |
d6e6cbcdd0eb9c313f8f8b016153dee086cd406a | diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php
index <HASH>..<HASH> 100644
--- a/src/Console/InstallCommand.php
+++ b/src/Console/InstallCommand.php
@@ -48,10 +48,14 @@ class InstallCommand extends Command
*/
protected function registerTelescopeServiceProvider()
{
+ if (($appConfig = file_get_contents(config_path('app.php'))) && str_contains($appConfig, "App\Providers\TelescopeServiceProvider::class")) {
+ return;
+ }
+
file_put_contents(config_path('app.php'), str_replace(
"App\\Providers\EventServiceProvider::class,".PHP_EOL,
"App\\Providers\EventServiceProvider::class,".PHP_EOL." App\Providers\TelescopeServiceProvider::class,".PHP_EOL,
- file_get_contents(config_path('app.php'))
+ $appConfig
));
}
} | Fix registering telescope service provider multiple times | laravel_telescope | train | php |
2cdb9b45de4c03ba851e84ba4eb09fa673b9c47d | diff --git a/js/exmo.js b/js/exmo.js
index <HASH>..<HASH> 100644
--- a/js/exmo.js
+++ b/js/exmo.js
@@ -128,8 +128,12 @@ module.exports = class exmo extends Exchange {
let response = await this.publicGetOrderBook (this.extend ({
'pair': market['id'],
}, params));
- let orderbook = response[market['id']];
- return this.parseOrderBook (orderbook, undefined, 'bid', 'ask');
+ let result = response[market['id']];
+ let orderbook = this.parseOrderBook (result, undefined, 'bid', 'ask');
+ return this.extend (orderbook, {
+ 'bids': this.sortBy (orderbook['bids'], 0, true),
+ 'asks': this.sortBy (orderbook['asks'], 0),
+ });
}
parseTicker (ticker, market = undefined) { | fix exmo to pass orderbook tests #<I> | ccxt_ccxt | train | js |
a040cf5d4a2c8643f65e08ceebe858203be9d061 | diff --git a/src/Happyr/Doctrine/Specification/Spec.php b/src/Happyr/Doctrine/Specification/Spec.php
index <HASH>..<HASH> 100644
--- a/src/Happyr/Doctrine/Specification/Spec.php
+++ b/src/Happyr/Doctrine/Specification/Spec.php
@@ -5,6 +5,7 @@ namespace Happyr\Doctrine\Specification;
use Happyr\Doctrine\Specification\Spec\AsArray;
use Happyr\Doctrine\Specification\Spec\Comparison;
use Happyr\Doctrine\Specification\Spec\In;
+use Happyr\Doctrine\Specification\Spec\Like;
use Happyr\Doctrine\Specification\Spec\IsNull;
use Happyr\Doctrine\Specification\Spec\LogicX;
use Happyr\Doctrine\Specification\Spec\Not;
@@ -87,4 +88,9 @@ class Spec
{
return new Comparison(Comparison::GTE, $field, $value, $dqlAlias);
}
+
+ public static function like($field, $value, $format = Like::CONTAINS, $dqlAlias = null)
+ {
+ return new Like($field, $value, $format, $dqlAlias);
+ }
} | Adds factory method for "like" spec | Happyr_Doctrine-Specification | train | php |
739c81134e4f77ec69a8fb2ba99e3f40380fb635 | diff --git a/snapshots.go b/snapshots.go
index <HASH>..<HASH> 100644
--- a/snapshots.go
+++ b/snapshots.go
@@ -72,8 +72,12 @@ func (CreateSnapshot) asyncResponse() interface{} {
func (ss Snapshot) ListRequest() (ListCommand, error) {
// Restricted cannot be applied here because it really has three states
req := &ListSnapshots{
- ID: ss.ID,
- Name: ss.Name,
+ ID: ss.ID,
+ Name: ss.Name,
+ VolumeID: ss.VolumeID,
+ SnapshotType: ss.SnapshotType,
+ ZoneID: ss.ZoneID,
+ // TODO: tags
}
return req, nil | Snapshot: fix list request (#<I>) | exoscale_egoscale | train | go |
99812132ff196127f3bf106a706714114b0f6bb1 | diff --git a/guide/src/html.js b/guide/src/html.js
index <HASH>..<HASH> 100644
--- a/guide/src/html.js
+++ b/guide/src/html.js
@@ -21,7 +21,7 @@ module.exports = class HTML extends React.Component {
);
}
return (
- <html {...this.props.htmlAttributes} lang="en-au">
+ <html {...this.props.htmlAttributes} lang="en">
<head>
<meta name="referrer" content="origin" />
<link | Only give the language, not the country code. | cultureamp_cultureamp-style-guide | train | js |
f816e0441a84839e61f3c45ed5f4f25a8cede5f9 | diff --git a/unsync/unsync.py b/unsync/unsync.py
index <HASH>..<HASH> 100644
--- a/unsync/unsync.py
+++ b/unsync/unsync.py
@@ -10,7 +10,7 @@ from typing import Generic, TypeVar
class unsync(object):
thread_executor = concurrent.futures.ThreadPoolExecutor()
- process_executor = concurrent.futures.ProcessPoolExecutor()
+ process_executor = None
loop = asyncio.new_event_loop()
thread = None
unsync_functions = {}
@@ -50,6 +50,8 @@ class unsync(object):
future = self.func(*args, **kwargs)
else:
if self.cpu_bound:
+ if unsync.process_executor is None:
+ unsync.process_executor = concurrent.futures.ProcessPoolExecutor()
future = unsync.process_executor.submit(
_multiprocess_target, (self.func.__module__, self.func.__name__), *args, **kwargs)
else: | Enable running unsync in environments without multiprocessing
E.g. iOS | alex-sherman_unsync | train | py |
6a8d8f77a7af8bc2a2de76c77bba6fee0a846fea | diff --git a/js/lib/mediawiki.DOMPostProcessor.js b/js/lib/mediawiki.DOMPostProcessor.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.DOMPostProcessor.js
+++ b/js/lib/mediawiki.DOMPostProcessor.js
@@ -868,8 +868,9 @@ function encapsulateTemplates( env, doc, tplRanges) {
// If tcEnd is a table, and it has a dsr-start that
// is smaller than tsStart, then this could be
// a foster-parented scenario.
- if (hasNodeName(tcEnd, 'table') && dp2.dsr[0] < dp1.dsr[0]) {
- dp1.dsr[0] = dp2.dsr[0];
+ var endDsr = dp2.dsr[0];
+ if (hasNodeName(tcEnd, 'table') && endDsr !== null && endDsr < dp1.dsr[0]) {
+ dp1.dsr[0] = endDsr;
}
}
if (dp1.dsr[0] !== null && dp1.dsr[1] !== null) { | Check if dsr value is null before comparing it against something.
* When merging DSR values from range-start and range-end check
if the dsr values are non-null.
* Eliminates all semantic/syntactic errors from
en: Ontario (electoral district)
Change-Id: I<I>d7ab5f2b<I>ea<I>d<I>c<I>d<I>da<I>bb | wikimedia_parsoid | train | js |
166f878bdc7642b287b7215af262fef7e1f99b6c | diff --git a/pexconn_test.go b/pexconn_test.go
index <HASH>..<HASH> 100644
--- a/pexconn_test.go
+++ b/pexconn_test.go
@@ -18,7 +18,7 @@ func TestPexConnState(t *testing.T) {
cl.initLogger()
torrent := cl.newTorrent(metainfo.Hash{}, nil)
addr := &net.TCPAddr{IP: net.IPv6loopback, Port: 4747}
- c := cl.newConnection(nil, false, addr, "")
+ c := cl.newConnection(nil, false, addr, "", "")
c.PeerExtensionIDs = make(map[pp.ExtensionName]pp.ExtensionNumber)
c.PeerExtensionIDs[pp.ExtensionNamePex] = pexExtendedId
c.writerCond.L.Lock() | Fix change in Client.newConnection | anacrolix_torrent | train | go |
657b2798df3720ea2cfc358f3feecf822e5cabd2 | diff --git a/tests/test-timber-image.php b/tests/test-timber-image.php
index <HASH>..<HASH> 100644
--- a/tests/test-timber-image.php
+++ b/tests/test-timber-image.php
@@ -43,7 +43,7 @@ class TimberImageTest extends WP_UnitTestCase {
$data = array();
$file_loc = $this->copyTestImage('stl.jpg');
$upload_dir = wp_upload_dir();
- $new_file = TimberImageHelper::resize($upload_dir['url'].'/stl.jpg', 500);
+ $new_file = TimberImageHelper::resize($upload_dir['url'].'/stl.jpg', 500, true);
$path_to_image = TimberHelper::get_rel_url($new_file, true);
$location_of_image = ABSPATH.$path_to_image;
$size = getimagesize($location_of_image);
@@ -54,7 +54,7 @@ class TimberImageTest extends WP_UnitTestCase {
$data = array();
$file_loc = $this->copyTestImage('stl.jpg');
$upload_dir = wp_upload_dir();
- $new_file = TimberImageHelper::resize($upload_dir['url'].'/stl.jpg', 500, 300);
+ $new_file = TimberImageHelper::resize($upload_dir['url'].'/stl.jpg', 500, 300, true);
$path_to_image = TimberHelper::get_rel_url($new_file, true);
$location_of_image = ABSPATH.$path_to_image;
$size = getimagesize($location_of_image); | tests should force resize of images | timber_timber | train | php |
139b03af7c2d7e70a26591424f82f09a02132198 | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -1080,10 +1080,20 @@ jQuery.each( {
};
});
-jQuery.each( [ "height", "width" ], function(i,n){
+jQuery.each( [ "Height", "Width" ], function(i,name){
+ var n = name.toLowerCase();
+
jQuery.fn[ n ] = function(h) {
- return h == undefined ?
- ( this.length ? jQuery.css( this[0], n ) : null ) :
- this.css( n, h.constructor == String ? h : h + "px" );
+ return this[0] == window ?
+ jQuery.browser.safari && self["inner" + name] ||
+ jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) ||
+ document.body["client" + name] :
+
+ this[0] == document ?
+ Math.max( document.body["scroll" + name], document.body["offset" + name] ) :
+
+ h == undefined ?
+ ( this.length ? jQuery.css( this[0], n ) : null ) :
+ this.css( n, h.constructor == String ? h : h + "px" );
};
}); | Landing a version of $(document)/$(window) .width()/.height(). It won't win any awards, but it'll hold us over for this release. | jquery_jquery | train | js |
0f8ff53b4d965cd41172bd74d09b1a81ce7349e0 | diff --git a/src/Codeception/Module/WPLoader.php b/src/Codeception/Module/WPLoader.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Module/WPLoader.php
+++ b/src/Codeception/Module/WPLoader.php
@@ -216,7 +216,7 @@ class WPLoader extends Module
if ($loadOnly) {
$this->debug('WPLoader module will load WordPress when all other modules initialized.');
- $this->addAction(Events::SUITE_INIT, [$this, '_loadWordpress'], 10);
+ $this->addAction(Events::SUITE_BEFORE, [$this, '_loadWordpress'], -10);
return;
} else {
@@ -734,18 +734,6 @@ class WPLoader extends Module
$output->writeln('<error>' . implode(PHP_EOL, $lines) . '</error>');
}
- protected function loadWordPressAfterDb()
- {
- $matchingModule = null;
-
- $this->debug(sprintf(
- 'Module WPLoader will initialize after module %s initialized',
- $matchingModule
- ));
-
- $this->_loadWordpress();
- }
-
public function _wordPressRedirectHandler($location, $status)
{
$this->loadRedirections [$location] = $status; | fix(WPLoader) fix *Db loading order issue, again | lucatume_wp-browser | train | php |
31597bbd18f309954eceaf3420382a0d6799404b | diff --git a/examples/amp/pages/index.js b/examples/amp/pages/index.js
index <HASH>..<HASH> 100644
--- a/examples/amp/pages/index.js
+++ b/examples/amp/pages/index.js
@@ -18,6 +18,22 @@ export default () => {
<h1>The Cat (AMP-first Page)</h1>
<Byline author="Dan Zajdband" />
<p className="caption">Meowwwwwwww</p>
+ <amp-img
+ alt="Mountains"
+ width="550"
+ height="368"
+ layout="responsive"
+ src="https://amp.dev/static/inline-examples/images/mountains.webp"
+ >
+ <amp-img
+ alt="Mountains"
+ fallback=""
+ width="550"
+ height="368"
+ layout="responsive"
+ src="https://amp.dev/static/inline-examples/images/mountains.jpg"
+ ></amp-img>
+ </amp-img>
<p>
Cat ipsum dolor <a href={isAmp ? '/dog?amp=1' : '/dog'}>sit amet</a>,
eat grass, throw it back up but refuse to leave cardboard box or groom | added amp-img example with fallback attribute (#<I>) | zeit_next.js | train | js |
d621c51b2ce1c2e1781ffb44b15c2a76a5ee0069 | diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Factory.php
+++ b/src/Composer/Factory.php
@@ -353,12 +353,12 @@ class Factory
}
$composer = null;
- chdir($config->get('home'));
try {
+ chdir($config->get('home'));
$composer = self::createComposer($io, null, $disablePlugins, false);
} catch (\Exception $e) {
}
- chdir($oldCwd);
+ @chdir($oldCwd);
return $composer;
} | Bullet-proof global composer instantiation | mothership-ec_composer | train | php |
00ef83b6e4d5fc9b95c263b129356ec8ebfd118e | diff --git a/lib/PHPSemVer/Trigger/Functions/BodyChanged.php b/lib/PHPSemVer/Trigger/Functions/BodyChanged.php
index <HASH>..<HASH> 100644
--- a/lib/PHPSemVer/Trigger/Functions/BodyChanged.php
+++ b/lib/PHPSemVer/Trigger/Functions/BodyChanged.php
@@ -52,7 +52,7 @@ class BodyChanged extends AbstractTrigger
return null;
}
- if ($old->stmts == $new->stmts) {
+ if ($old->stmts === $new->stmts) {
return false;
} | Trigger\BodyChanged: Circular references solved | ScreamingDev_phpsemver | train | php |
6fb77c08109c5a4d4537280fe291fb921ad7b28d | diff --git a/octodns/provider/azuredns.py b/octodns/provider/azuredns.py
index <HASH>..<HASH> 100644
--- a/octodns/provider/azuredns.py
+++ b/octodns/provider/azuredns.py
@@ -337,6 +337,8 @@ class AzureProvider(BaseProvider):
)
return self._dns_client_handle
+ def _set_dns_client(self, client)
+ self.dns_client_handle = client
def __init__(self, id, client_id, key, directory_id, sub_id,
@@ -352,7 +354,7 @@ class AzureProvider(BaseProvider):
self._dns_client_key = key
self._dns_client_directory_id = directory_id
self._dns_client_subscription_id = sub_id
- self._dns_client = property(_get_dns_client)
+ self._dns_client = property(_get_dns_client, _set_dns_client)
self._resource_group = resource_group
self._azure_zones = set() | Add set DNS client logic if needed for testing | github_octodns | train | py |
9ed12dec0b04d6f36017ce35aef45e5983ef3be0 | diff --git a/examples/standalone-amok/controller.js b/examples/standalone-amok/controller.js
index <HASH>..<HASH> 100644
--- a/examples/standalone-amok/controller.js
+++ b/examples/standalone-amok/controller.js
@@ -1,6 +1,10 @@
// example controller
var amok = require('amokjs');
+// example for http amok mode
+// amok.setMode('http');
+// amok.setExternalUrl('http://httpbin.org');
+
// example directory setup
// amok.setResponsesDirectory('new/responses'); | updating example project with references to http mode | sauliuz_amokjs | train | js |
137deb38290169135819e7d6564b18c758e4b47d | diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js
index <HASH>..<HASH> 100644
--- a/generators/generator-base-private.js
+++ b/generators/generator-base-private.js
@@ -912,12 +912,15 @@ module.exports = class extends Generator {
}
const mainGeneratorJhipsterVersion = packagejs.version;
const blueprintJhipsterVersion = blueprintPackageJson.dependencies && blueprintPackageJson.dependencies['generator-jhipster'];
- if (blueprintJhipsterVersion && mainGeneratorJhipsterVersion !== blueprintJhipsterVersion) {
- this.error(
- `The installed ${chalk.yellow(
- blueprintPkgName
- )} blueprint targets JHipster v${blueprintJhipsterVersion} and is not compatible with this JHipster version. Either update the blueprint or JHipster. You can also disable this check using --skip-checks at your own risk`
- );
+ if (blueprintJhipsterVersion) {
+ if (mainGeneratorJhipsterVersion !== blueprintJhipsterVersion) {
+ this.error(
+ `The installed ${chalk.yellow(
+ blueprintPkgName
+ )} blueprint targets JHipster v${blueprintJhipsterVersion} and is not compatible with this JHipster version. Either update the blueprint or JHipster. You can also disable this check using --skip-checks at your own risk`
+ );
+ }
+ return;
}
const blueprintPeerJhipsterVersion =
blueprintPackageJson.peerDependencies && blueprintPackageJson.peerDependencies['generator-jhipster']; | Fix warning when blueprint is compatible with generator-jhipster (#<I>) | jhipster_generator-jhipster | train | js |
fc6aab4afd613cff6d3f82e584eee5f24a4cf615 | diff --git a/ants/segmentation/atropos.py b/ants/segmentation/atropos.py
index <HASH>..<HASH> 100644
--- a/ants/segmentation/atropos.py
+++ b/ants/segmentation/atropos.py
@@ -77,6 +77,7 @@ def atropos(a, x, i='Kmeans[3]', m='[0.2,1x1]', c='[5,0]',
>>> img = ants.resample_image(img, (64,64), 1, 0)
>>> mask = ants.get_mask(img)
>>> ants.atropos( a = img, m = '[0.2,1x1]', c = '[2,0]', i = 'kmeans[3]', x = mask )
+ >>> seg2 = ants.atropos( a = img, m = '[0.2,1x1]', c = '[2,0]', i = seg['probabilityimages'], x = mask, priorweight=0.25 )
"""
probs = mktemp(prefix='antsr', suffix='prob%02d.nii.gz')
tdir = probs.replace(os.path.basename(probs),'') | DOC: prior-based segmentation | ANTsX_ANTsPy | train | py |
335243c683f5daf6dd69414ec88a3c19aae966a2 | diff --git a/src/BayesianModel.py b/src/BayesianModel.py
index <HASH>..<HASH> 100644
--- a/src/BayesianModel.py
+++ b/src/BayesianModel.py
@@ -298,10 +298,10 @@ class BayesianModel(nx.DiGraph):
-------
>>> student.add_nodes('diff', 'intel', 'grades')
>>> student.add_edges(('diff', 'intel'), ('grades',))
- >>> student.set_states('diff', ('hard', 'easy'))
- >>> student.set_states('intel', ('smart', 'avg', 'dumb'))
- >>> student.set_states('grades', ('A', 'B', 'C'))
- >>> student.set_observation({'grades': 'A'})
+ >>> student.add_states('diff', ('hard', 'easy'))
+ >>> student.add_states('intel', ('smart', 'avg', 'dumb'))
+ >>> student.add_states('grades', ('A', 'B', 'C'))
+ >>> student.add_observations({'grades': 'A'})
>>> student.active_trail_nodes('diff')
['diff', 'intel']
""" | Changed the Example in docstring of active_node_trails to reflect the new function-names | pgmpy_pgmpy | train | py |
30c3a7f0fb9577282bc3ede59c4dea6e5b5c1b95 | diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py
index <HASH>..<HASH> 100644
--- a/salt/modules/lxc.py
+++ b/salt/modules/lxc.py
@@ -1357,7 +1357,7 @@ def create(name,
'Only one of \'template\' and \'image\' is permitted'
)
- options = select('options')
+ options = select('options') or {}
backing = select('backing')
if vgname and not backing:
backing = 'lvm'
@@ -1378,7 +1378,7 @@ def create(name,
'templates',
'lxc',
'salt_tarball')
- profile['imgtar'] = img_tar
+ options['imgtar'] = img_tar
if config:
cmd += ' -f {0}'.format(config)
if template:
@@ -1415,7 +1415,10 @@ def create(name,
output_loglevel='trace')
_clear_context()
if ret['retcode'] == 0 and exists(name):
- return True
+ c_state = state(name)
+ return {'result': True,
+ 'changes': {'old': None, 'new': c_state},
+ 'state': c_state}
else:
if exists(name):
# destroy the container if it was partially created | Fix creation of container from image
Also changed return data for create() to match destroy(), clone(), etc. | saltstack_salt | train | py |
e0ac5d44a0520ebb31cd8cd274a95cff0fa7a357 | diff --git a/lib/fog/dnsimple/dns.rb b/lib/fog/dnsimple/dns.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/dnsimple/dns.rb
+++ b/lib/fog/dnsimple/dns.rb
@@ -80,7 +80,7 @@ module Fog
def request(params)
params[:headers] ||= {}
key = "#{@dnsimple_email}:#{@dnsimple_password}"
- params[:headers].merge!({ "Authorization" => "Basic " + Base64.strict_encode64(key).chomp,
+ params[:headers].merge!({ "Authorization" => "Basic " + Base64.encode64(data).gsub("\n",''),
"Accept" => "application/json",
"Content-Type" => "application/json" }) | Use gsub for Ruby <I> compatibility. | fog_fog | train | rb |
80c3a1823b7f723ca4296ab916793b8bb14b102e | diff --git a/Autoloader.php b/Autoloader.php
index <HASH>..<HASH> 100644
--- a/Autoloader.php
+++ b/Autoloader.php
@@ -1,7 +1,7 @@
<?php
/*!
* Radium
- * Copyright (C) 2011-2012 Jack P.
+ * Copyright (C) 2011-2013 Jack P.
* https://github.com/nirix
*
* This file is part of Radium.
@@ -64,7 +64,6 @@ class Autoloader
*/
public static function registerNamespace($vendor, $location)
{
- static::$namespaces[$vendor] = $location;
Loader::registerNamespace($vendor, $location);
} | No need to store the registered namespaces in the autoloader. | nirix_radium | train | php |
409f4ad4ed811cfd87aeedec20a44ab5fd7bb52c | diff --git a/src/terra/Factory/EnvironmentFactory.php b/src/terra/Factory/EnvironmentFactory.php
index <HASH>..<HASH> 100644
--- a/src/terra/Factory/EnvironmentFactory.php
+++ b/src/terra/Factory/EnvironmentFactory.php
@@ -360,7 +360,19 @@ class EnvironmentFactory
// Add "overrides" to docker-compose.
if (isset($this->config['docker_compose']['overrides']) && is_array($this->config['docker_compose']['overrides'])) {
foreach ($this->config['docker_compose']['overrides'] as $service => $info) {
- $compose[$service] = array_merge_recursive($compose[$service], $info);
+
+ // For each service, loop through properties.
+ foreach ($info as $property_name => $property_value) {
+
+ // If the property is an array (like environment variables) merge it.
+ if (is_array($property_value)) {
+ $compose[$service][$property_name] = array_merge_recursive($compose[$service][$property_name], $property_value);
+ }
+ // If property is not an array, replace it.
+ else {
+ $compose[$service][$property_name] = $property_value;
+ }
+ }
}
} | Making docker compose overrides in .terra.yml work for string and array properties. | terra-ops_terra-cli | train | php |
2324700400d94853dd38c768f47824032ab285c0 | diff --git a/test/benchmark.py b/test/benchmark.py
index <HASH>..<HASH> 100644
--- a/test/benchmark.py
+++ b/test/benchmark.py
@@ -31,7 +31,7 @@ def benchmark(package_name):
@benchmark('markdown')
def run_markdown(package):
with open(TEST_FILE, 'r', encoding='utf-8') as fin:
- return package.markdown(fin.read(), extensions=['fenced_code', 'tables', 'footnotes'])
+ return package.markdown(fin.read(), extensions=['fenced_code', 'tables'])
@benchmark('mistune')
def run_mistune(package): | tests(benchmark): don't include 'footnotes' markdown module (#<I>)
... because mistletoe actually only implements footlinks. | miyuchina_mistletoe | train | py |
201a3af3d0cc3b65c8660e51660f7805dff191f0 | diff --git a/example/controller/old/post/multipart.py b/example/controller/old/post/multipart.py
index <HASH>..<HASH> 100644
--- a/example/controller/old/post/multipart.py
+++ b/example/controller/old/post/multipart.py
@@ -132,7 +132,7 @@ class MultipartHandler(dpHandler):
self.action_identifier = request_uri[1] if len(request_uri) > 1 else None
self.options = request_uri[2] if len(request_uri) > 2 else None
self.content_length = self.request.headers['Content-Length'] if 'Content-Length' in self.request.headers else 0
- self.content_length = self.helper.numeric.long(self.content_length)
+ self.content_length = self.helper.numeric.cast.long(self.content_length)
self.received_length = 0
self.stx = None
self.btx = None | helper.numeric.math new added and refactoring. | why2pac_dp-tornado | train | py |
94fbf979aee6fa6ac6267674e279546dcaa6c28b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,8 +8,8 @@ from setuptools import setup, find_packages
requires = [
'awscli>=1.8.9,<2.0.0',
'prompt-toolkit==0.52',
- 'boto3>=1.2.1',
- 'configobj>=5.0.6',
+ 'boto3>=1.2.1,<2.0.0',
+ 'configobj>=5.0.6,<6.0.0',
] | Lock deps to major versions
Just general future proofing. Assuming the packages
follow semver (we do for boto3), we shouldn't jump up to
new major versions automatically. | awslabs_aws-shell | train | py |
417a32e8c9e0ea942790bd1a5384152bff830944 | diff --git a/src/frontend/org/voltdb/messaging/ForeignHost.java b/src/frontend/org/voltdb/messaging/ForeignHost.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/messaging/ForeignHost.java
+++ b/src/frontend/org/voltdb/messaging/ForeignHost.java
@@ -41,7 +41,7 @@ public class ForeignHost {
// The amount of time we allow between messages from a host
// before deciding that it must be dead. In millis.
- static final int DEAD_HOST_TIMEOUT_THRESHOLD = 1000;
+ static final int DEAD_HOST_TIMEOUT_THRESHOLD = 10000;
private final Connection m_connection;
private final FHInputHandler m_handler; | Increase the failure detection timeout to <I> seconds. | VoltDB_voltdb | train | java |
d944f9e665988c073e9eab1a81b3b09c50a78506 | diff --git a/test/output.js b/test/output.js
index <HASH>..<HASH> 100644
--- a/test/output.js
+++ b/test/output.js
@@ -1,3 +1,4 @@
+import path from 'path';
import test from 'ava';
import randomstring from 'randomstring';
import fs from 'fs-extra';
@@ -14,14 +15,16 @@ test('--output works', async t => {
});
test('preserve order with large number of files', async t => {
- const outputFile = tempy.file();
+ const tmp = tempy.directory();
+ const outputFile = path.join(tmp, 'output');
+
const outputFilePromises = [];
const filepaths = [];
const expected = [];
// eslint-disable-next-line no-magic-numbers
for (let i = 0; i < 100; i++) {
- const filepath = tempy.file();
+ const filepath = path.join(tmp, `file-${i}`);
const content = randomstring.generate();
filepaths.push(filepath); | test: improve test with large number of files | pvdlg_ncat | train | js |
a9c195d5d765cc6604aab3fab3a1ac08a6551287 | diff --git a/app/state.js b/app/state.js
index <HASH>..<HASH> 100644
--- a/app/state.js
+++ b/app/state.js
@@ -47,8 +47,8 @@ const initialState = {
y: 380,
},
},
- 8: {
- id: 8,
+ 5: {
+ id: 5,
typeId: 5,
patchId: 1,
position: {
diff --git a/test/reducersSpec.js b/test/reducersSpec.js
index <HASH>..<HASH> 100644
--- a/test/reducersSpec.js
+++ b/test/reducersSpec.js
@@ -1,5 +1,5 @@
import * as Actions from '../app/actions';
-import { initialState } from '../app/state';
+import initialState from '../app/state';
import { newId, nodes, lastId, copyNode } from '../app/reducers';
import chai from 'chai';
diff --git a/test/stateSpec.js b/test/stateSpec.js
index <HASH>..<HASH> 100644
--- a/test/stateSpec.js
+++ b/test/stateSpec.js
@@ -1,5 +1,5 @@
import { assert } from 'chai';
-import { initialState } from '../app/state';
+import initialState from '../app/state';
describe('Initial state', () => {
describe('node types', () => { | fix(tests): fix tests for merged version | xodio_xod | train | js,js,js |
368430912efae2dfde3f51bf9eb41d16234ef32f | diff --git a/src/Krystal/Db/Sql/QueryBuilder.php b/src/Krystal/Db/Sql/QueryBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Krystal/Db/Sql/QueryBuilder.php
+++ b/src/Krystal/Db/Sql/QueryBuilder.php
@@ -767,7 +767,11 @@ final class QueryBuilder implements QueryBuilderInterface, QueryObjectInterface
if ($value instanceof RawSqlFragmentInterface) {
$value = $value->getFragment();
}
-
+
+ if ($value instanceof RawBindingInterface) {
+ $value = $value->getTarget();
+ }
+
$this->append(sprintf(' %s %s %s ', $this->quote($column), $operator, $value));
return $this;
} | Accept instance of RawBinding as well | krystal-framework_krystal.framework | train | php |
a5b55ee56132c38ed0ad70e3891d0ae5242b4759 | diff --git a/lib/fine_ants/adapters/vanguard.rb b/lib/fine_ants/adapters/vanguard.rb
index <HASH>..<HASH> 100644
--- a/lib/fine_ants/adapters/vanguard.rb
+++ b/lib/fine_ants/adapters/vanguard.rb
@@ -46,7 +46,7 @@ module FineAnts
private
def verify_login!
- find ".lastLogon"
+ find_link "Log off"
rescue Capybara::ElementNotFound
raise FineAnts::LoginFailedError.new
end | they changed their CSS. yay | searls_fine-ants | train | rb |
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.