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
|
---|---|---|---|---|---|
e315146236d95e8fee0ddaeca775141dbf34c7d3 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/db/raw/ODatabaseRaw.java b/core/src/main/java/com/orientechnologies/orient/core/db/raw/ODatabaseRaw.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/db/raw/ODatabaseRaw.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/db/raw/ODatabaseRaw.java
@@ -203,8 +203,11 @@ public class ODatabaseRaw implements ODatabase {
return storage.readRecord(databaseOwner, iRid, iFetchPlan);
} catch (Throwable t) {
- throw new ODatabaseException("Error on retrieving record " + iRid + " (cluster: "
- + storage.getPhysicalClusterNameById(iRid.clusterId) + ")", t);
+ if (iRid.isTemporary())
+ throw new ODatabaseException("Error on retrieving record using temporary RecordId: " + iRid, t);
+ else
+ throw new ODatabaseException("Error on retrieving record " + iRid + " (cluster: "
+ + storage.getPhysicalClusterNameById(iRid.clusterId) + ")", t);
}
} | Improved error message in case the RID is temporary | orientechnologies_orientdb | train | java |
0b375366881813adc17ae5cb1ab101a90636d474 | diff --git a/definitions/npm/body-parser_v1.x.x/flow_v0.30.x-/body-parser_v1.x.x.js b/definitions/npm/body-parser_v1.x.x/flow_v0.30.x-/body-parser_v1.x.x.js
index <HASH>..<HASH> 100644
--- a/definitions/npm/body-parser_v1.x.x/flow_v0.30.x-/body-parser_v1.x.x.js
+++ b/definitions/npm/body-parser_v1.x.x/flow_v0.30.x-/body-parser_v1.x.x.js
@@ -8,12 +8,12 @@ declare type bodyParser$Options = {
};
declare type bodyParser$OptionsText = bodyParser$Options & {
- reviever?: (key: string, value: any) => any;
+ reviver?: (key: string, value: any) => any;
strict?: boolean;
};
declare type bodyParser$OptionsJson = bodyParser$Options & {
- reviever?: (key: string, value: any) => any;
+ reviver?: (key: string, value: any) => any;
strict?: boolean;
}; | [body-parser_v1] Fix typo in revival method (#<I>) | flow-typed_flow-typed | train | js |
c30deae89130c0a2a577431744af8e646c3c0907 | diff --git a/Kwf/Controller/Action/User/LoginController.php b/Kwf/Controller/Action/User/LoginController.php
index <HASH>..<HASH> 100644
--- a/Kwf/Controller/Action/User/LoginController.php
+++ b/Kwf/Controller/Action/User/LoginController.php
@@ -258,8 +258,12 @@ class Kwf_Controller_Action_User_LoginController extends Kwf_Controller_Action
}
}
if ($user) {
- $users->loginUserRow($user, true);
$redirect = $this->_getParam('redirect');
+ if (is_array($user)) {
+ $redirect = $user['redirect'];
+ $user = $user['user'];
+ }
+ $users->loginUserRow($user, true);
if (!$redirect) $redirect = Kwf_Setup::getBaseUrl().'/';
Kwf_Util_Redirect::redirect($redirect);
} else { | Enable getUserToLoginByParams to define redirect
This is needed because saml does use kwf/user/login/auth url for
AuthnRequest. | koala-framework_koala-framework | train | php |
0364733a496666aa5651151b5759b090cf7943ba | diff --git a/spotify/http.py b/spotify/http.py
index <HASH>..<HASH> 100644
--- a/spotify/http.py
+++ b/spotify/http.py
@@ -577,7 +577,7 @@ class HTTPClient:
route = Route('GET', '/users/{user_id}', user_id=user_id)
return await self.request(route)
- async def search(self, q, queary_type, market='US', limit=20, offset=0):
+ async def search(self, q, queary_type='track,playlist,artist,album', market='US', limit=20, offset=0):
route = Route('GET', '/search')
payload = {'q': q, 'type': queary_type, 'limit': limit, 'offset': offset} | added default args on search http method | mental32_spotify.py | train | py |
012b0c75629cd1df42df98dd49175f1bd4804266 | diff --git a/liquibase-core/src/main/java/liquibase/serializer/core/xml/XMLChangeLogSerializer.java b/liquibase-core/src/main/java/liquibase/serializer/core/xml/XMLChangeLogSerializer.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/serializer/core/xml/XMLChangeLogSerializer.java
+++ b/liquibase-core/src/main/java/liquibase/serializer/core/xml/XMLChangeLogSerializer.java
@@ -264,7 +264,8 @@ public class XMLChangeLogSerializer implements ChangeLogSerializer {
|| (codePoint == '\t')
|| (codePoint == 0xB)
|| (codePoint == 0xC)
- || ((codePoint >= 0x20) && (codePoint <= 0xD7FF))
+ || ((codePoint >= 0x20) && (codePoint <= 0x7E))
+ || ((codePoint >= 0xA0) && (codePoint <= 0xD7FF))
|| ((codePoint >= 0xE000) && (codePoint <= 0xFFFD))
|| ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF))
) { | DVONE-<I> Liquibase: Snapshot: Invalid XML character during changelog snapshot
Catch more control chars now that isControlCharter is not used | liquibase_liquibase | train | java |
5fa34287354d65408283d2cfee0b879b26f4629d | diff --git a/pysat/tests/test_instrument.py b/pysat/tests/test_instrument.py
index <HASH>..<HASH> 100644
--- a/pysat/tests/test_instrument.py
+++ b/pysat/tests/test_instrument.py
@@ -768,7 +768,7 @@ class TestBasics():
"""Test string output with custom function """
def testfunc(self):
pass
- self.testInst.custom_attach(testfunc, 'modify')
+ self.testInst.custom_attach(testfunc)
self.out = self.testInst.__str__()
assert self.out.find('testfunc') > 0 | TST: Removed leftover 'modify' keyword in custom_attach | rstoneback_pysat | train | py |
b831cbaaf24e78ce1d793711cd5ec48684e7a072 | diff --git a/src/neo/IO/legacy/migrate.js b/src/neo/IO/legacy/migrate.js
index <HASH>..<HASH> 100644
--- a/src/neo/IO/legacy/migrate.js
+++ b/src/neo/IO/legacy/migrate.js
@@ -12,7 +12,7 @@ export default function migrateProject(data) {
commands: result.html.body.table.tbody.tr.map(row => (
{
command: row.td[0]._text || "",
- target: row.td[1]._text || "",
+ target: parseTarget(row.td[1]),
value: row.td[2]._text || ""
}
))
@@ -23,3 +23,15 @@ export default function migrateProject(data) {
return project;
}
+
+function parseTarget(targetCell) {
+ if (targetCell._text) {
+ if (targetCell._text instanceof Array) {
+ return targetCell._text.join("<br />");
+ } else {
+ return targetCell._text;
+ }
+ } else {
+ return "";
+ }
+} | parse target in its own function | SeleniumHQ_selenium-ide | train | js |
862eea9bafc5394a4dc6b18ab1df68bcf500c481 | diff --git a/src/widgets/refinement-list/refinement-list.js b/src/widgets/refinement-list/refinement-list.js
index <HASH>..<HASH> 100644
--- a/src/widgets/refinement-list/refinement-list.js
+++ b/src/widgets/refinement-list/refinement-list.js
@@ -141,7 +141,7 @@ refinementList({
* @property {boolean} isRefined True if the value is selected.
* @property {string} label The label to display.
* @property {string} value The value used for refining.
- * @property {string} highlighted The label highlighted (when using search for facet values).
+ * @property {string} highlighted The label highlighted (when using search for facet values). This value is displayed in the default template.
* @property {string} url The url with this refinement selected.
* @property {object} cssClasses Object containing all the classes computed for the item.
*/ | docs(refinementList): mention that highlight is displayed in the default template (#<I>) | algolia_instantsearch.js | train | js |
a8fa31505028bd0eefbb939be91b9bce14c5a0b5 | diff --git a/websocket.py b/websocket.py
index <HASH>..<HASH> 100644
--- a/websocket.py
+++ b/websocket.py
@@ -215,7 +215,7 @@ class WebSocketHandler(StreamRequestHandler):
self.request.send(message.encode())
# huge extended payload
- elif length <= 18446744073709551616L:
+ elif length < 18446744073709551616:
#print("sending extended frame of size %s", length)
self.request.send(b'\x81\x7f')
self.request.send(struct.pack(">Q", length)) # MUST be 64bits | Works with python2 and 3 now | Pithikos_python-websocket-server | train | py |
8b3e8a55d13673767f22d9bc6ee3acee9cf07909 | diff --git a/lib/fetch/callbacks.rb b/lib/fetch/callbacks.rb
index <HASH>..<HASH> 100644
--- a/lib/fetch/callbacks.rb
+++ b/lib/fetch/callbacks.rb
@@ -6,13 +6,18 @@ module Fetch
private
+ # Check if a callback has been used.
+ def callback?(name)
+ self.class.callbacks[name].any?
+ end
+
# Run specific callbacks.
#
# run_callbacks_for(:before_fetch)
# run_callbacks_for(:progress, 12) # 12 percent done
- def run_callbacks_for(callback, *args)
+ def run_callbacks_for(name, *args)
results = []
- self.class.callbacks[callback].each do |block|
+ self.class.callbacks[name].each do |block|
results << instance_exec(*args, &block)
end
results.last | Add method for checking for callbacks | bogrobotten_fetch | train | rb |
421add47430fa82688023d52fb05bfec0c50f816 | diff --git a/packages/__tests__/src/lib/ListenerCounter.js b/packages/__tests__/src/lib/ListenerCounter.js
index <HASH>..<HASH> 100644
--- a/packages/__tests__/src/lib/ListenerCounter.js
+++ b/packages/__tests__/src/lib/ListenerCounter.js
@@ -1,4 +1,11 @@
+const IGNORED_EVENTS = {
+ load: true, // ignore when jQuery detaches the load event from the window
+ message: true, // react dev tools attaches this on first component render
+ copy: true, // "
+ paste: true // "
+}
+
export class ListenerCounter {
constructor(el) {
@@ -12,13 +19,15 @@ export class ListenerCounter {
let origAddEventListened = el.addEventListener
let origRemoveEventListener = el.removeEventListener
- el.addEventListener = function() {
- t.delta++
+ el.addEventListener = function(eventName) {
+ if (!IGNORED_EVENTS[eventName]) {
+ t.delta++
+ }
return origAddEventListened.apply(el, arguments)
}
- el.removeEventListener = function(name) {
- if (name !== 'load') { // ignore when jQuery detaches the load event from the window
+ el.removeEventListener = function(eventName) {
+ if (!IGNORED_EVENTS[eventName]) {
t.delta--
}
return origRemoveEventListener.apply(el, arguments) | ignore react-dev-tools for eventlistening in tests | fullcalendar_fullcalendar | train | js |
48c393348351540dd332220e859fb8fb9d19e896 | diff --git a/src/UrlHandlers/RestHandler.php b/src/UrlHandlers/RestHandler.php
index <HASH>..<HASH> 100644
--- a/src/UrlHandlers/RestHandler.php
+++ b/src/UrlHandlers/RestHandler.php
@@ -19,6 +19,7 @@
namespace Rhubarb\RestApi\UrlHandlers;
use Rhubarb\Crown\DateTime\RhubarbDateTime;
+use Rhubarb\Crown\Exceptions\ClassMappingException;
use Rhubarb\Crown\Exceptions\CoreException;
use Rhubarb\Crown\Exceptions\ForceResponseException;
use Rhubarb\Crown\Exceptions\RhubarbException;
@@ -101,11 +102,9 @@ abstract class RestHandler extends UrlHandler
return $provider;
}
- if (AuthenticationProvider::getProvider()) {
- $className = AuthenticationProvider::getProvider();
-
- return new $className();
- }
+ try {
+ return AuthenticationProvider::getProvider();
+ } catch( ClassMappingException $er ){}
return null;
} | Fix issue with authentication when no provider registered | RhubarbPHP_Module.RestApi | train | php |
63150cd5a719dd521678ab9fa4ee045dc769999f | diff --git a/checks/check_channel_shuffle.py b/checks/check_channel_shuffle.py
index <HASH>..<HASH> 100644
--- a/checks/check_channel_shuffle.py
+++ b/checks/check_channel_shuffle.py
@@ -1,7 +1,8 @@
from imgaug import augmenters as iaa
import imgaug as ia
+import imgaug.random as iarandom
-ia.seed(1)
+iarandom.seed(1)
def main(): | Switch call of imgaug.seed() to imgaug.random.seed() | aleju_imgaug | train | py |
4d05d692fcf9dbcf42afcb5bea884c87fefd7594 | diff --git a/consul/server_test.go b/consul/server_test.go
index <HASH>..<HASH> 100644
--- a/consul/server_test.go
+++ b/consul/server_test.go
@@ -7,18 +7,17 @@ import (
"net"
"os"
"strings"
+ "sync/atomic"
"testing"
"time"
"github.com/hashicorp/consul/testutil"
)
-var nextPort = 15000
+var nextPort int32 = 15000
func getPort() int {
- p := nextPort
- nextPort++
- return p
+ return int(atomic.AddInt32(&nextPort, 1))
}
func tmpDir(t *testing.T) string { | Makes port selection atomic in unit tests. | hashicorp_consul | train | go |
042d31c69a01fff2b5ff2d7c726220aa24cb5fb2 | diff --git a/lib/objects/ssh/driver.rb b/lib/objects/ssh/driver.rb
index <HASH>..<HASH> 100644
--- a/lib/objects/ssh/driver.rb
+++ b/lib/objects/ssh/driver.rb
@@ -32,7 +32,7 @@ module Bcome::Ssh
@set_connection_wrangler ||= ::Bcome::Ssh::ConnectionWrangler.new(self)
end
- def foo
+ def pretty_ssh_config
config = {
user: user,
ssh_keys: ssh_keys, | renamed pretty ssh config to something more sensible | webzakimbo_bcome-kontrol | train | rb |
cc39cde3197ea033b5e45032de4a43fa3a93925e | diff --git a/tools/benchmark/cmd/storage-put.go b/tools/benchmark/cmd/storage-put.go
index <HASH>..<HASH> 100644
--- a/tools/benchmark/cmd/storage-put.go
+++ b/tools/benchmark/cmd/storage-put.go
@@ -74,7 +74,7 @@ func storagePutFunc(cmd *cobra.Command, args []string) {
if txn {
id := s.TxnBegin()
if _, err := s.TxnPut(id, keys[i], vals[i], lease.NoLease); err != nil {
- fmt.Errorf("txn put error: %v", err)
+ fmt.Fprintln(os.Stderr, "txn put error:", err)
os.Exit(1)
}
s.TxnEnd(id) | tools/benchmark/cmd: print error out to stderr | etcd-io_etcd | train | go |
488d3a49418f3e621ba8c7b67d08e7d0aa847292 | diff --git a/lib/ofx/financial_institution.rb b/lib/ofx/financial_institution.rb
index <HASH>..<HASH> 100644
--- a/lib/ofx/financial_institution.rb
+++ b/lib/ofx/financial_institution.rb
@@ -83,11 +83,14 @@ module OFX
@ofx_ssl_version = ssl_version
end
- def set_client(user_name, password)
+ def set_client(user_name, password, client_uid=nil)
inst_id = OFX::FinancialInstitutionIdentification.new(
@organization_name, @organization_id)
user_cred = OFX::UserCredentials.new(user_name, password)
@client = OFX::FinancialClient.new([[inst_id, user_cred]])
+ # caller can generate one-time with: SecureRandom.hex(16)
+ # see: http://wiki.gnucash.org/wiki/Setting_up_OFXDirectConnect_in_GnuCash_2#Chase_.22username_or_password_are_incorrect.22
+ @client.client_unique_identifier = client_uid
end
# anonymous can be used for ProfileRequest | As required for Chase, update set_client with CLIENTUID argument | baconpat_ofx_for_ruby | train | rb |
c86189ae02e0619bc6c1b4d39f6e52684b48f6e5 | diff --git a/lib/tests/filelib_test.php b/lib/tests/filelib_test.php
index <HASH>..<HASH> 100644
--- a/lib/tests/filelib_test.php
+++ b/lib/tests/filelib_test.php
@@ -1046,7 +1046,6 @@ EOF;
public static function create_draft_file($filedata = array()) {
global $USER;
- self::setAdminUser();
$fs = get_file_storage();
$filerecord = array(
@@ -1208,7 +1207,9 @@ EOF;
global $USER;
$this->resetAfterTest(true);
- $this->setAdminUser();
+ // The admin has no restriction for max file uploads, so use a normal user.
+ $user = $this->getDataGenerator()->create_user();
+ $this->setUser($user);
$fs = get_file_storage();
$file = self::create_draft_file(); | MDL-<I> filelib: Update to unit tests for maxbytes. | moodle_moodle | train | php |
3e70d34694d5ba0ad50c68281611b1a06da43388 | diff --git a/lib/Widget/Browser.php b/lib/Widget/Browser.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/Browser.php
+++ b/lib/Widget/Browser.php
@@ -63,14 +63,14 @@ class Browser extends AbstractWidget
*
* @var string
*/
- public $name;
+ protected $name;
/**
* The version of browser
*
* @var string
*/
- public $version;
+ protected $version;
/**
* Constructor
@@ -85,7 +85,7 @@ class Browser extends AbstractWidget
}
/**
- * Get the name of browser
+ * Returns the version of browser
*
* @return string
*/
@@ -128,4 +128,24 @@ class Browser extends AbstractWidget
$this->safari = true;
}
}
+
+ /**
+ * Returns the version of browser
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Returns the version of browser
+ *
+ * @return string
+ */
+ public function getVersion()
+ {
+ return $this->version;
+ }
} | added getName & getVersion for browser widget
maked $name and $version property to property | twinh_wei | train | php |
7f132f80651dfd7491cd818f8c7ac088e4a68652 | diff --git a/nazs/core/blocks.py b/nazs/core/blocks.py
index <HASH>..<HASH> 100644
--- a/nazs/core/blocks.py
+++ b/nazs/core/blocks.py
@@ -1,7 +1,7 @@
from django.utils.translation import ugettext as _
from django.dispatch import receiver
-from nazs.signals import menu_changed
+from nazs.signals import post_enable
from nazs.web import blocks, tables
import nazs
@@ -19,7 +19,7 @@ def menu():
return {'menu': nazs.menu()}
-@receiver(menu_changed)
+@receiver(post_enable)
def process_menu_change(sender, transport, **kwargs):
blocks.update(transport, 'core:menu')
diff --git a/nazs/signals.py b/nazs/signals.py
index <HASH>..<HASH> 100644
--- a/nazs/signals.py
+++ b/nazs/signals.py
@@ -15,6 +15,3 @@ post_disable = Signal()
# Module save signals
pre_save = Signal()
post_save = Signal()
-
-# Menu changed signal
-menu_changed = Signal() | Remove menu_changed signal
It was GUI related and it the end post_enable is the same | exekias_droplet | train | py,py |
a07a51abc4764a658a13f7f972c1dc864d0a8517 | diff --git a/asn1crypto/cms.py b/asn1crypto/cms.py
index <HASH>..<HASH> 100644
--- a/asn1crypto/cms.py
+++ b/asn1crypto/cms.py
@@ -130,15 +130,25 @@ class SetOfTime(SetOf):
_child_spec = Time
+class SetOfAny(SetOf):
+ _child_spec = Any
+
+
class CMSAttribute(Sequence):
_fields = [
('type', CMSAttributeType),
- ('values', Any),
+ ('values', None),
]
- _oid_pair = ('type', 'values')
_oid_specs = {}
+ def _values_spec(self):
+ return self._oid_specs.get(self['type'].native, SetOfAny)
+
+ _spec_callbacks = {
+ 'values': _values_spec
+ }
+
class CMSAttributes(SetOf):
_child_spec = CMSAttribute | Fix cms.CMSAttribute() to be able to parse unknown attribute constructs | wbond_asn1crypto | train | py |
7acd5e4a6ef74fe1b082c20f119556adf70c3944 | diff --git a/etreeutils/canonicalize.go b/etreeutils/canonicalize.go
index <HASH>..<HASH> 100644
--- a/etreeutils/canonicalize.go
+++ b/etreeutils/canonicalize.go
@@ -16,7 +16,7 @@ func TransformExcC14n(el *etree.Element, inclusiveNamespacesPrefixList string) e
prefixSet[prefix] = struct{}{}
}
- err := transformExcC14n(DefaultNSContext, EmptyNSContext, el, prefixSet)
+ err := transformExcC14n(DefaultNSContext, DefaultNSContext, el, prefixSet)
if err != nil {
return err
} | Treat the xml namespace as already declared during exclusive c<I>n | russellhaering_goxmldsig | train | go |
995a058b1669eb6b92151a3b6ae627e16eeb1455 | diff --git a/rinohlib/stylesheets/matcher.py b/rinohlib/stylesheets/matcher.py
index <HASH>..<HASH> 100644
--- a/rinohlib/stylesheets/matcher.py
+++ b/rinohlib/stylesheets/matcher.py
@@ -219,6 +219,9 @@ matcher('figure legend paragraph', Figure
matcher('table of contents section', Section.like('table of contents'))
+matcher('table of contents title',
+ Section.like('table of contents', level=1) / Heading)
+
matcher('table of contents', TableOfContents)
matcher('toc level 1', TableOfContentsEntry.like(depth=1)) | Selector for the ToC title
Requires level=1 to score higher than 'unnumbered heading 1'! | brechtm_rinohtype | train | py |
aef6b43a371efaff7e3a33ca999e5b8360e991e4 | diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js
index <HASH>..<HASH> 100644
--- a/src/bootstrap-table.js
+++ b/src/bootstrap-table.js
@@ -790,6 +790,7 @@
.on('click', '[name="btSelectAll"]', function () {
var checked = $(this).prop('checked');
that[checked ? 'checkAll' : 'uncheckAll']();
+ that.updateSelected();
});
}; | Update bootstrap-table.js
The current master branch version has a bug that selectAll checkbox not reflecting changes accordingly to highlight all rows in the table.
I located the problem is there is a missing update for the selection. | wenzhixin_bootstrap-table | train | js |
06c0db9bda615d567599d2d8671fc658537dfda7 | diff --git a/reflow-maven-skin/src/main/resources/js/reflow-skin.js b/reflow-maven-skin/src/main/resources/js/reflow-skin.js
index <HASH>..<HASH> 100644
--- a/reflow-maven-skin/src/main/resources/js/reflow-skin.js
+++ b/reflow-maven-skin/src/main/resources/js/reflow-skin.js
@@ -26,7 +26,7 @@
// Support for smooth scrolling and back button while scrolling
// Note: only run if smoothScroll is enabled
if (typeof($.smoothScroll) == typeof(Function)) {
- $('a[href*="#"]:not([href^="#carousel"])').live('click', function() {
+ $('a[href^="#"]:not([href^="#carousel"])').live('click', function() {
var slashedHash = '#/' + this.hash.slice(1);
if ( this.hash ) { | fixed smoothScroll + back history not working for anchor links to other pages: currently only using smoothScroll for in-page links | andriusvelykis_reflow-maven-skin | train | js |
8678b48e93e9851ce8410e58587b2d5915029296 | diff --git a/src/Teapot/HttpException.php b/src/Teapot/HttpException.php
index <HASH>..<HASH> 100644
--- a/src/Teapot/HttpException.php
+++ b/src/Teapot/HttpException.php
@@ -65,7 +65,7 @@ class HttpException extends \Exception implements StatusCode
public function render($prependHttp = true)
{
$string = $this->getCode() . ' ' . $this->getMessage();
- if ($prependHttp) {
+ if (true === $prependHttp) {
$string = 'HTTP/1.1 ' . $string;
}
return $string;
diff --git a/src/Teapot/StatusCode/RFC/RFC2326.php b/src/Teapot/StatusCode/RFC/RFC2326.php
index <HASH>..<HASH> 100644
--- a/src/Teapot/StatusCode/RFC/RFC2326.php
+++ b/src/Teapot/StatusCode/RFC/RFC2326.php
@@ -153,5 +153,5 @@ interface RFC2326
* @see http://www.ietf.org/rfc/rfc2326.txt
* @var integer
*/
- const DESTINATION_UNREACHABLE= 462;
+ const DESTINATION_UNREACHABLE = 462;
} | Fix issues as shown by Scrutinizer | shrikeh_teapot | train | php,php |
96c1167162cc26b50afbd14eeed0cd6bdb4b6384 | diff --git a/common/test/unit/com/thoughtworks/go/helper/P4TestRepo.java b/common/test/unit/com/thoughtworks/go/helper/P4TestRepo.java
index <HASH>..<HASH> 100644
--- a/common/test/unit/com/thoughtworks/go/helper/P4TestRepo.java
+++ b/common/test/unit/com/thoughtworks/go/helper/P4TestRepo.java
@@ -116,7 +116,7 @@ public class P4TestRepo extends TestRepo {
}
public String serverAndPort() {
- return SystemUtil.getLocalhostName() + ":" + port;
+ return "localhost:" + port;
}
public static P4TestRepo createP4TestRepo() throws IOException { | #<I> - Fix build.
Sometimes, if getHostname() doesn't resolve to a FQDN, then P4 tests fail. Use
localhost instead. | gocd_gocd | train | java |
c0b4ad4ace61f46bb9ac8c8d87de33e288476878 | diff --git a/spyder/widgets/sourcecode/tests/test_autoindent.py b/spyder/widgets/sourcecode/tests/test_autoindent.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/sourcecode/tests/test_autoindent.py
+++ b/spyder/widgets/sourcecode/tests/test_autoindent.py
@@ -153,6 +153,7 @@ def test_first_line():
"test_commented_brackets"),
("s = a[(a['a'] == l) & (a['a'] == 1)]['a']\n", "s = a[(a['a'] == l) & (a['a'] == 1)]['a']\n",
"test_balanced_brackets"),
+ ("a = (a # some comment\n", "a = (a # some comment\n ", "test_inline_comment"),
])
def test_indentation_with_spaces(text_input, expected, test_text):
text = get_indent_fix(text_input) | Add test indentation in lines with inline comments | spyder-ide_spyder | train | py |
e3e1505ee24ac9963be4e8586dbbf2555604311d | diff --git a/src/yimaJquery/Decorator/DefaultDecorator.php b/src/yimaJquery/Decorator/DefaultDecorator.php
index <HASH>..<HASH> 100644
--- a/src/yimaJquery/Decorator/DefaultDecorator.php
+++ b/src/yimaJquery/Decorator/DefaultDecorator.php
@@ -87,7 +87,8 @@ class DefaultDecorator extends AbstractDecorator
// looking for duplicated base library
if ($item['attributes']['src'] == $this->getBaseLibrary() && !$attachedBaseLib) {
$attachedBaseLib = true;
- } else {
+ } elseif ($item['attributes']['src'] == $this->getBaseLibrary()) {
+ // we have attached base library before
continue;
}
} | fix attaching file scripts after base library | YiMAproject_yimaJquery | train | php |
4fda854051f666fb1a2d1e12c34e3849241faffe | diff --git a/opbeat/contrib/celery/__init__.py b/opbeat/contrib/celery/__init__.py
index <HASH>..<HASH> 100644
--- a/opbeat/contrib/celery/__init__.py
+++ b/opbeat/contrib/celery/__init__.py
@@ -44,7 +44,6 @@ def register_signal(client):
def process_failure_signal(sender, task_id, exception, args, kwargs,
traceback, einfo, **kw):
client.captureException(
- exc_info=einfo.exc_info,
extra={
'task_id': task_id,
'task': sender, | use our exception catching mechanisms instead of using celery's exception
celery doesn't capture local vars, but we do, so that's nice. | elastic_apm-agent-python | train | py |
b9cade833283082a69d09fad51f62ba466a0d1c9 | diff --git a/releaf-core/app/assets/javascripts/releaf/include/search.js b/releaf-core/app/assets/javascripts/releaf/include/search.js
index <HASH>..<HASH> 100644
--- a/releaf-core/app/assets/javascripts/releaf/include/search.js
+++ b/releaf-core/app/assets/javascripts/releaf/include/search.js
@@ -113,7 +113,9 @@ jQuery(function ($) {
}
}
- collectAllElements();
+ if (options.rebind) {
+ collectAllElements();
+ }
});
$form.on('searchend', function () { | Optional form element rebinding on `searchresponse` event. | cubesystems_releaf | train | js |
358c7d6d17efd97a7c62e87bad46797e8f1e2988 | diff --git a/tests/suite/cms/form/field/JFormFieldTemplateStyleTest.php b/tests/suite/cms/form/field/JFormFieldTemplateStyleTest.php
index <HASH>..<HASH> 100644
--- a/tests/suite/cms/form/field/JFormFieldTemplateStyleTest.php
+++ b/tests/suite/cms/form/field/JFormFieldTemplateStyleTest.php
@@ -21,7 +21,7 @@ class JFormFieldTemplateStyleTest extends JoomlaTestCase
protected function setUp()
{
require_once JPATH_PLATFORM.'/cms/form/field/templatestyle.php';
- include_once dirname(dirname(dirname(__DIR__))) . '/joomla/form/inspectors.php';
+ include_once JPATH_TESTS . '/suite/joomla/form/inspectors.php';
}
/** | include insprectors.php with JPATH_TESTS | joomla_joomla-framework | train | php |
c6bd30d084e357c046175c728b7f993877cc45e5 | diff --git a/DiscordWebhooks/Client.php b/DiscordWebhooks/Client.php
index <HASH>..<HASH> 100644
--- a/DiscordWebhooks/Client.php
+++ b/DiscordWebhooks/Client.php
@@ -12,12 +12,17 @@ class Client
protected $avatar;
protected $message;
protected $embeds;
+ protected $tts;
public function __construct($url)
{
$this->url = $url;
}
+ public function tts($tts = false) {
+ $this->tts = $tts;
+ return $this;
+ }
public function username($username)
{
$this->username = $username;
@@ -48,6 +53,7 @@ class Client
'avatar_url' => $this->avatar,
'content' => $this->message,
'embeds' => $this->embeds,
+ 'tts' => $this->tts,
));
$ch = curl_init(); | added text-to-speech support | nopjmp_discord-webhooks | train | php |
e9b7dfbf9fd01a93490d4d1f6542ba08885c4eab | diff --git a/models/base.rb b/models/base.rb
index <HASH>..<HASH> 100644
--- a/models/base.rb
+++ b/models/base.rb
@@ -15,10 +15,18 @@ module Aquasync
field :deviceToken, type: String
field :isDeleted, type: Boolean
+ # UUID like 550e8400-e29b-41d4-a716-446655440000
+ validates :gid, format: { with: /^([0-9abcdef].*-?)$/}
+
before_save do
+ downcase_gid
set_ust
end
+ def downcase_gid
+ self.gid.downcase!
+ end
+
def set_ust
self.ust = Time.now.to_i
end | force gid to be lowercase and validation | AQAquamarine_aquasync_model | train | rb |
d8f5d81d6504405d7faa5679458626def1a61a66 | diff --git a/libkbfs/test_common.go b/libkbfs/test_common.go
index <HASH>..<HASH> 100644
--- a/libkbfs/test_common.go
+++ b/libkbfs/test_common.go
@@ -79,8 +79,6 @@ func MakeTestBlockServerOrBust(t logger.TestLogBackend,
}
}
-var libkbGOnce sync.Once
-
// MakeTestConfigOrBustLoggedInWithMode creates and returns a config
// suitable for unit-testing with the given mode and list of
// users. loggedInIndex specifies the index (in the list) of the user
@@ -146,13 +144,6 @@ func MakeTestConfigOrBustLoggedInWithMode(
}
runner.Run(t)
- libkbGOnce.Do(func() {
- // initialize libkb -- this probably isn't the best place to do this
- // but it seems as though the MDServer rpc client is the first thing to
- // use things from it which require initialization.
- libkb.G.Init()
- libkb.G.ConfigureLogging()
- })
// connect to server
mdServer = NewMDServerRemote(config, mdServerAddr, env.NewContext().NewRPCLogFactory()) | no more libkb G references, it's going away | keybase_client | train | go |
93e7894472a25cdc2c0a0a3e931d179b7d8ee2ed | diff --git a/tests/BrevityTest.php b/tests/BrevityTest.php
index <HASH>..<HASH> 100644
--- a/tests/BrevityTest.php
+++ b/tests/BrevityTest.php
@@ -6,8 +6,9 @@ class BrevityTest extends \PHPUnit_Framework_TestCase
private static function getTestData()
{
- $testdata = json_decode(
- file_get_contents(__DIR__ . '/../tests.json'), true);
+ $contents = file_get_contents(__DIR__ . '/../tests.json');
+ $contents = utf8_encode($contents);
+ $testdata = json_decode($contents, true);
return $testdata;
} | encode JSON file to UTF-8 | kylewm_brevity-php | train | php |
6e88f5fc7d95ef21b6147f832bb3d45d3dd58d36 | diff --git a/angr/analyses/identifier/identify.py b/angr/analyses/identifier/identify.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/identifier/identify.py
+++ b/angr/analyses/identifier/identify.py
@@ -328,7 +328,7 @@ class Identifier(Analysis):
if len(succ.unconstrained_successors) > 0:
s = succ.unconstrained_successors[0]
if s.history.jumpkind == "Ijk_Call":
- s.regs.eax = s.se.BVS("unconstrained_ret_%#x" % s.addr, s.arch.bits)
+ s.regs.eax = s.se.BVS("unconstrained_ret", s.arch.bits)
s.regs.ip = s.stack_pop()
s.history.jumpkind = "Ijk_Ret"
s.regs.ip = addr_trace[0] | Identifier: Fix a bug that calls .addr from an unconstrained state. | angr_angr | train | py |
b7a2183d82166018371702dd8f12dedc3f7945c4 | diff --git a/config/environments/production.rb b/config/environments/production.rb
index <HASH>..<HASH> 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -8,7 +8,6 @@ TypoBlog::Application.configure do
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
- config.action_view.cache_template_loading = true
# See everything in the log (default is :info)
# config.log_level = :debug
@@ -29,4 +28,4 @@ TypoBlog::Application.configure do
# config.threadsafe!
Migrator.offer_migration_when_available = true
-end
\ No newline at end of file
+end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index <HASH>..<HASH> 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -13,7 +13,6 @@ TypoBlog::Application.configure do
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching = false
- config.action_view.cache_template_loading = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
@@ -30,4 +29,4 @@ TypoBlog::Application.configure do
require 'ruby-debug'
Migrator.offer_migration_when_available = false
-end
\ No newline at end of file
+end | Remove cache_template_loading option.
It does not exist anymore. | publify_publify | train | rb,rb |
a554f5ea3cad306c09080df3763ae2b4f32629ed | diff --git a/lib/driver/pg.js b/lib/driver/pg.js
index <HASH>..<HASH> 100644
--- a/lib/driver/pg.js
+++ b/lib/driver/pg.js
@@ -192,6 +192,6 @@ var PgDriver = Base.extend({
});
exports.connect = function(config, callback) {
- var db = config.db || new pg.Client(config);
+ var db = config.db || new pg.Client(process.env.DATABASE_URL || config);
callback(null, new PgDriver(db));
}; | Added support for process.env.DATABASE_URL as used by heroku | db-migrate_node-db-migrate | train | js |
9e5401956fed358fa7fad566548c8da08752843a | diff --git a/lib/cb/version.rb b/lib/cb/version.rb
index <HASH>..<HASH> 100755
--- a/lib/cb/version.rb
+++ b/lib/cb/version.rb
@@ -1,3 +1,3 @@
module Cb
- VERSION = '5.6.0'
+ VERSION = '6.0.0'
end | Updating what arguments SS.Retrieve and SS.List take. this is NOT backwards compatible. | careerbuilder_ruby-cb-api | train | rb |
04eec7529017aa685d7d1f61328982df6a142064 | diff --git a/src/Zephyrus/Exceptions/IntrusionDetectionException.php b/src/Zephyrus/Exceptions/IntrusionDetectionException.php
index <HASH>..<HASH> 100644
--- a/src/Zephyrus/Exceptions/IntrusionDetectionException.php
+++ b/src/Zephyrus/Exceptions/IntrusionDetectionException.php
@@ -1,22 +1,38 @@
<?php namespace Zephyrus\Exceptions;
+use Zephyrus\Security\IntrusionDetection\IntrusionReport;
+
class IntrusionDetectionException extends \Exception
{
+ private IntrusionReport $report;
+
+ public function __construct(IntrusionReport $report)
+ {
+ parent::__construct();
+ $this->report = $report;
+ }
+
/**
- * @var array
+ * @return int
*/
- private $intrusionData;
-
- public function __construct(array $intrusionData)
+ public function getImpact(): int
{
- $this->intrusionData = $intrusionData;
+ return $this->report->getImpact();
}
/**
* @return array
*/
- public function getIntrusionData(): array
+ public function getDetectedIntrusions(): array
+ {
+ return $this->report->getDetectedIntrusions();
+ }
+
+ /**
+ * @return IntrusionReport
+ */
+ public function getReport(): IntrusionReport
{
- return $this->intrusionData;
+ return $this->report;
}
} | IDS exceptions now includes the report object | dadajuice_zephyrus | train | php |
b8e7854ada5c231c63e60ce0498fffbff65be46d | diff --git a/addon/hint/show-hint.js b/addon/hint/show-hint.js
index <HASH>..<HASH> 100644
--- a/addon/hint/show-hint.js
+++ b/addon/hint/show-hint.js
@@ -235,7 +235,10 @@
CodeMirror.on(hints, "click", function(e) {
var t = getHintElement(hints, e.target || e.srcElement);
- if (t && t.hintId != null) widget.changeActive(t.hintId);
+ if (t && t.hintId != null) {
+ widget.changeActive(t.hintId);
+ if (options.completeOnSingleClick) widget.pick();
+ }
});
CodeMirror.on(hints, "mousedown", function() { | [show-hint addon] Add completeOnSingleClick option
... to make a single-click pick a hint option instead of just
selecting it. | codemirror_CodeMirror | train | js |
5db6a838ad193e56070d86536209dc7f5c3712f2 | diff --git a/dustmaps/tests/test_iphas.py b/dustmaps/tests/test_iphas.py
index <HASH>..<HASH> 100644
--- a/dustmaps/tests/test_iphas.py
+++ b/dustmaps/tests/test_iphas.py
@@ -40,34 +40,12 @@ class TestIPHAS(unittest.TestCase):
def setUpClass(self):
t0 = time.time()
- # Set up IPHPAS query object
+ # Set up IPHAS query object
self._iphas = iphas.IPHASQuery()
t1 = time.time()
print('Loaded IPHAS test data in {:.5f} s.'.format(t1-t0))
- def _get_equ(self, d, dist=None):
- """
- Get Equatorial (ICRS) coordinates of test data point.
- """
- return coords.SkyCoord(
- d['ra']*units.deg,
- d['dec']*units.deg,
- distance=dist,
- frame='icrs'
- )
-
- def _get_gal(self, d, dist=None):
- """
- Get Galactic coordinates of test data point.
- """
- return coords.SkyCoord(
- d['l']*units.deg,
- d['b']*units.deg,
- distance=dist,
- frame='galactic'
- )
-
def test_bounds(self):
"""
Test that out-of-bounds coordinates return NaN reddening, and that | Remove unnecessary code from IPHAS test. | gregreen_dustmaps | train | py |
b840c88c73f19b509cc69135fdd78acb6c6690ea | diff --git a/src/com/google/javascript/jscomp/ConformanceRules.java b/src/com/google/javascript/jscomp/ConformanceRules.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/ConformanceRules.java
+++ b/src/com/google/javascript/jscomp/ConformanceRules.java
@@ -328,9 +328,10 @@ public final class ConformanceRules {
}
protected boolean isUsed(Node n) {
- return (NodeUtil.isAssignmentOp(n.getParent()))
- ? NodeUtil.isExpressionResultUsed(n.getParent())
- : NodeUtil.isExpressionResultUsed(n);
+ return !n.getParent().isName()
+ && ((NodeUtil.isAssignmentOp(n.getParent()))
+ ? NodeUtil.isExpressionResultUsed(n.getParent())
+ : NodeUtil.isExpressionResultUsed(n));
}
} | Skip var declaration in BanUnknownTypedClassPropsReferences and
BanUnknownDirectThisPropsReferences.
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
bb57b30ee39e361fba1b3e4a6dc4db7c8722d843 | diff --git a/src/OAuth/ResourceOwner/KeycloakResourceOwner.php b/src/OAuth/ResourceOwner/KeycloakResourceOwner.php
index <HASH>..<HASH> 100644
--- a/src/OAuth/ResourceOwner/KeycloakResourceOwner.php
+++ b/src/OAuth/ResourceOwner/KeycloakResourceOwner.php
@@ -19,6 +19,16 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/
final class KeycloakResourceOwner extends GenericOAuth2ResourceOwner
{
+ protected array $paths = [
+ 'identifier' => 'sub',
+ 'nickname' => 'preferred_username',
+ 'firstname' => 'given_name',
+ 'lastname' => 'family_name',
+ 'realname' => 'name',
+ 'email' => 'email',
+ 'profilepicture' => 'picture',
+ ];
+
public function getAuthorizationUrl($redirectUri, array $extraParameters = [])
{
return parent::getAuthorizationUrl($redirectUri, array_merge([ | Keycloak: default paths mapping for new created realm | hwi_HWIOAuthBundle | train | php |
44f0c749d57e74db54e6d920594636637338f85a | diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js
index <HASH>..<HASH> 100644
--- a/src/app/services/influxdb/influxdbDatasource.js
+++ b/src/app/services/influxdb/influxdbDatasource.js
@@ -259,7 +259,7 @@ function (angular, _, kbn, InfluxSeries) {
};
InfluxDatasource.prototype._saveDashboardTemp = function(data, title) {
- data[0].name = 'grafana.dashboard_temp_' + btoa(title);
+ data[0].name = 'grafana.temp_dashboard_' + btoa(title);
data[0].columns.push('expires');
data[0].points[0].push(this._getTempDashboardExpiresDate());
@@ -296,7 +296,7 @@ function (angular, _, kbn, InfluxSeries) {
var queryString = 'select dashboard from "grafana.dashboard_' + btoa(id) + '"';
if (isTemp) {
- queryString = 'select dashboard from "grafana.dashboard_temp_' + btoa(id) + '"';
+ queryString = 'select dashboard from "grafana.temp_dashboard_' + btoa(id) + '"';
}
return this._seriesQuery(queryString).then(function(results) { | Fix for InfluxDB temp dashboards, seperate series name prefix so they do not show up in dashboard search, #<I> | grafana_grafana | train | js |
86ad8e0456351dd9ae1ddaf8060d8e5f407703fe | diff --git a/jax/interpreters/batching.py b/jax/interpreters/batching.py
index <HASH>..<HASH> 100644
--- a/jax/interpreters/batching.py
+++ b/jax/interpreters/batching.py
@@ -413,9 +413,11 @@ def instantiate_bdim(size, axis, instantiate, bdim, x):
if type(instantiate) is tuple:
if type(bdim) is tuple:
return core.pack(map(_inst, instantiate, bdim, x))
- else:
+ elif type(bdim) is int or bdim is None:
bdims = (bdim,) * len(instantiate)
return core.pack(map(_inst, instantiate, bdims, x))
+ else:
+ raise TypeError(type(bdim))
elif type(instantiate) is bool:
if bdim is None:
return broadcast2(size, axis, x) if instantiate else x | make a batching.py utility function more defensive | tensorflow_probability | train | py |
7b63ce7d6dba4166b5fdb9d41fd3a18b29f34698 | diff --git a/src/frontend/org/voltdb/InvocationDispatcher.java b/src/frontend/org/voltdb/InvocationDispatcher.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/InvocationDispatcher.java
+++ b/src/frontend/org/voltdb/InvocationDispatcher.java
@@ -456,13 +456,14 @@ public final class InvocationDispatcher {
task.getSerializedSize(),
nowNanos);
if (!success) {
- // HACK: this return is for the DR agent so that it
- // will move along on duplicate replicated transactions
- // reported by the slave cluster. We report "SUCCESS"
- // to keep the agent from choking. ENG-2334
+ // when VoltDB.crash... is called, we close off the client interface
+ // and it might not be possible to create new transactions.
+ // Return an error.
return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE,
new VoltTable[0],
- ClientResponseImpl.IGNORED_TRANSACTION,
+ "VoltDB failed to create the transaction internally. It is possible this "
+ + "was caused by a node failure or intentional shutdown. If the cluster recovers, "
+ + "it should be safe to resend the work, as the work was never started.",
task.clientHandle);
} | ENG-<I>: Fix an error message that is confusing and inappropriate.
If VoltDB.crash...(..) blocks the CI, then new txns might fail to be created. The new error message reflects that. The pre-commit error message was leftover from DR and probably wrong on top of that. | VoltDB_voltdb | train | java |
50f866edc34f8077fd2c51a12e51f027909aebe5 | diff --git a/src/Auth/Entity/InfoInterface.php b/src/Auth/Entity/InfoInterface.php
index <HASH>..<HASH> 100644
--- a/src/Auth/Entity/InfoInterface.php
+++ b/src/Auth/Entity/InfoInterface.php
@@ -138,6 +138,8 @@ interface InfoInterface extends EntityInterface
/**
* Gets the profile Image of an user
+ *
+ * @return \Auth\Entity\UserImage
*/
public function getImage();
@@ -196,6 +198,22 @@ interface InfoInterface extends EntityInterface
public function getPostalCode();
/**
+ * Sets the users phone number
+ *
+ * @param string $phone
+ * @since 0.20
+ */
+ public function setPhone($phone);
+
+ /**
+ * Gets the users phone number
+ *
+ * @since 0.20
+ * @return string
+ */
+ public function getPhone();
+
+ /**
* Sets the users city
*
* @param string $city | [Applications] displays the correct agent in the applications detail page. Code Cleanups | yawik_auth | train | php |
53f1ffab404855c6f9e697042a2cf4fbc5513b8d | diff --git a/lib/read-metadata.js b/lib/read-metadata.js
index <HASH>..<HASH> 100644
--- a/lib/read-metadata.js
+++ b/lib/read-metadata.js
@@ -44,14 +44,14 @@ export default async function (path, {
throw e
}
- if (typeof pkg.name !== 'string') {
+ if (typeof pkg.name === 'string') {
+ name = pkg.name
+ } else {
name = basename(path)
if (!quiet && !isStatic) {
console.log(`> No \`name\` in \`package.json\`, using ${chalk.bold(name)}`)
}
- } else {
- name = pkg.name
}
description = pkg.description
@@ -106,14 +106,14 @@ export default async function (path, {
}
})
- if (!labels.name) {
+ if (labels.name) {
+ name = labels.name
+ } else {
name = basename(path)
if (!quiet) {
console.log(`> No \`name\` LABEL in \`Dockerfile\`, using ${chalk.bold(name)}`)
}
- } else {
- name = labels.name
}
description = labels.description | Fix code style :nail_care: (#<I>) | zeit_now-cli | train | js |
bd67e787fb90c411a23214855a13c8763aa368b8 | diff --git a/public/js/chrome/save.js b/public/js/chrome/save.js
index <HASH>..<HASH> 100644
--- a/public/js/chrome/save.js
+++ b/public/js/chrome/save.js
@@ -33,7 +33,7 @@ $document.on('saved', function updateSavedState() {
// updateSavedState();
-var saveChecksum = sessionStorage.getItem('checksum') || jsbin.state.checksum || false;
+var saveChecksum = jsbin.state.checksum || sessionStorage.getItem('checksum') || false;
if (saveChecksum) {
// remove the disabled class, but also remove the cancelling event handlers
diff --git a/public/js/editors/panel.js b/public/js/editors/panel.js
index <HASH>..<HASH> 100644
--- a/public/js/editors/panel.js
+++ b/public/js/editors/panel.js
@@ -421,7 +421,9 @@ function populateEditor(editor, panel) {
sessionURL = sessionStorage.getItem('url'),
changed = false;
- if (sessionURL !== template.url) {
+ // if we clone the bin, there will be a checksum on the state object
+ // which means we happily have write access to the bin
+ if (sessionURL !== template.url && !jsbin.state.checksum) {
// nuke the live saving checksum
sessionStorage.removeItem('checksum');
saveChecksum = false; | Completed @aron's clone/save with checksum stuff. | jsbin_jsbin | train | js,js |
da022e87480f09ec78f883ba6363661494fd3467 | diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go
index <HASH>..<HASH> 100644
--- a/pkg/proxy/proxy.go
+++ b/pkg/proxy/proxy.go
@@ -261,14 +261,14 @@ func (p *Proxy) ackProxyPort(pp *ProxyPort) error {
// Remove old rules, if any and for different port
if pp.rulesPort != 0 && pp.rulesPort != pp.proxyPort {
- scopedLog.Debugf("Removing old proxy port rules for %s:%d", pp.name, pp.rulesPort)
+ scopedLog.Infof("Removing old proxy port rules for %s:%d", pp.name, pp.rulesPort)
p.datapathUpdater.RemoveProxyRules(pp.rulesPort, pp.ingress, pp.name)
pp.rulesPort = 0
}
// Add new rules, if needed
if pp.rulesPort != pp.proxyPort {
// This should always succeed if we have managed to start-up properly
- scopedLog.Debugf("Adding new proxy port rules for %s:%d", pp.name, pp.proxyPort)
+ scopedLog.Infof("Adding new proxy port rules for %s:%d", pp.name, pp.proxyPort)
err := p.datapathUpdater.InstallProxyRules(pp.proxyPort, pp.ingress, pp.name)
if err != nil {
return fmt.Errorf("Can't install proxy rules for %s: %s", pp.name, err) | proxy: Make proxy port changes visible in info logs.
Make proxy port changes visible in logs at info level. This should not
add too much logging as proxy ports are supposedly relatively static
over time. | cilium_cilium | train | go |
473e4400a9de67044285a1693004cc2f3e759818 | diff --git a/docs/src/pages/premium-themes/instapaper/theme/instapaper/components/button.js b/docs/src/pages/premium-themes/instapaper/theme/instapaper/components/button.js
index <HASH>..<HASH> 100644
--- a/docs/src/pages/premium-themes/instapaper/theme/instapaper/components/button.js
+++ b/docs/src/pages/premium-themes/instapaper/theme/instapaper/components/button.js
@@ -35,7 +35,6 @@ export default ({ attach, nest, primary, theme, red, white, BUTTON, ICON }) => (
},
},
contained: {
- borderColor: primary.main,
boxShadow: theme.shadows[0],
'&$focusVisible': {
boxShadow: theme.shadows[0],
@@ -55,7 +54,6 @@ export default ({ attach, nest, primary, theme, red, white, BUTTON, ICON }) => (
},
},
containedPrimary: {
- color: theme.palette.common.white,
'&:hover': {
backgroundColor: primary.main,
}, | [docs] Instapaper, fix contained+secondary button border (#<I>)
* Fix Instapaper contained button border
Color mismatch for secondary+contained button.
backgroundColor changes to pink but borderColor remains blue.
This change fixes that
* fewer LOCs | mui-org_material-ui | train | js |
b8c15d5f947b45b7b2d705902599f6ce5e60a098 | diff --git a/course/import/groups/index.php b/course/import/groups/index.php
index <HASH>..<HASH> 100755
--- a/course/import/groups/index.php
+++ b/course/import/groups/index.php
@@ -164,11 +164,9 @@
$newgrpcoursecontext = get_context_instance(CONTEXT_COURSE, $newgroup->courseid);
///Users cannot upload groups in courses they cannot update.
- if (has_capability('moodle/course:update', $newgrpcoursecontext)){
+ if (!has_capability('moodle/course:update', $newgrpcoursecontext)){
notify("$newgroup->name ".get_string('notaddedto').$newgroup->coursename.get_string('notinyourcapacity'));
- }
-
- else {
+ } else {
if (get_record("groups","name",$groupname,"courseid",$newgroup->courseid) || !($newgroup->id = insert_record("groups", $newgroup))) {
//Record not added - probably because group is already registered | merged fix for MDL-<I>, groups import broken | moodle_moodle | train | php |
656326085e267cfa110a50e69ebcbcaf3b542c2d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,7 @@ def run_setup(exts):
ext_modules=exts,
name="preshed",
packages=["preshed"],
- version="0.42",
+ version="0.43",
author="Matthew Honnibal",
author_email="[email protected]",
url="http://github.com/syllog1sm/preshed",
@@ -81,7 +81,7 @@ def run_setup(exts):
'Intended Audience :: Science/Research',
'Programming Language :: Cython',
'Topic :: Scientific/Engineering'],
- install_requires=["murmurhash", "cymem"],
+ install_requires=["murmurhash", "cymem == 1.30"],
setup_requires=["headers_workaround"]
) | * Require specific cymem version, and increment this version, as otherwise wrong size is expected. | explosion_preshed | train | py |
b4cd756aa03784105724ad5bd20d3fb06a7b63fe | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -98,7 +98,9 @@ Fs.prototype.doFetchTree = decorators.uniqueOp('fetchTree', function fetchTree(o
if (!opts.branch) return Q.reject(errors.invalidArgs('No branch checkout'));
// If no update required, return current one (if not empty)
- if (!opts.update) tree = this.working.get();
+ var cachedTree = this.working.get();
+
+ if (!opts.update) tree = cachedTree;
if (tree && _.size(tree.entries) > 0 && (!opts.updateIfClean || _.size(tree.changes) > 0)) return Q();
return Q()
@@ -111,7 +113,9 @@ Fs.prototype.doFetchTree = decorators.uniqueOp('fetchTree', function fetchTree(o
// Update working tree
.then(function(newTree) {
that.working.fetch(opts.branch, newTree);
- that.emitWatch('fetch', '');
+
+ // Emit fetch, and signal tree changed if head has changed
+ that.emitWatch('fetch', '', (!cachedTree || cachedTree.sha != newTree.sha));
});
}); | Pass filesTreeChanged to event fetch | GitbookIO_repofs | train | js |
895d2f74ddebd577acd4e9bd69072937894dddc2 | diff --git a/spec/sippy_cup/scenario_spec.rb b/spec/sippy_cup/scenario_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/sippy_cup/scenario_spec.rb
+++ b/spec/sippy_cup/scenario_spec.rb
@@ -27,8 +27,7 @@ describe SippyCup::Scenario do
end
it "allows creating a blank scenario with no block" do
- subject.invite
- subject.to_xml.should =~ %r{INVITE sip:\[service\]@\[remote_ip\]:\[remote_port\] SIP/2.0}
+ subject.to_xml.should =~ %r{<scenario name="Test"/>}
end
describe '#wait_for_answer' do | This simple test shouldn't care about invites | mojolingo_sippy_cup | train | rb |
51ba02b64d0ff4205fcf0d6bfba9ec38b0492a17 | diff --git a/actioninteractor/lib/action_interactor/errors.rb b/actioninteractor/lib/action_interactor/errors.rb
index <HASH>..<HASH> 100644
--- a/actioninteractor/lib/action_interactor/errors.rb
+++ b/actioninteractor/lib/action_interactor/errors.rb
@@ -11,7 +11,7 @@ module ActionInteractor
attr_reader :errors
- def_delegators :@errors, :clear, :keys, :values, :[], :empty?, :any?
+ def_delegators :@errors, :clear, :keys, :values, :[], :empty?, :any?, :each, :each_pair
def initialize(*)
@errors = {}
diff --git a/actioninteractor/lib/action_interactor/results.rb b/actioninteractor/lib/action_interactor/results.rb
index <HASH>..<HASH> 100644
--- a/actioninteractor/lib/action_interactor/results.rb
+++ b/actioninteractor/lib/action_interactor/results.rb
@@ -11,7 +11,7 @@ module ActionInteractor
attr_reader :results
- def_delegators :@results, :clear, :keys, :values, :[]
+ def_delegators :@results, :clear, :keys, :values, :[], :empty?, :any?, :each, :each_pair
def initialize(*)
@results = {} | More delegation methods for interactor's errors / results | ryohashimoto_lightrails | train | rb,rb |
c259f5e7cb567d2d3ff1eeb0071b66f58b9c7749 | diff --git a/lib/geckodriver/helper.rb b/lib/geckodriver/helper.rb
index <HASH>..<HASH> 100755
--- a/lib/geckodriver/helper.rb
+++ b/lib/geckodriver/helper.rb
@@ -90,7 +90,7 @@ module Geckodriver
private
- def append_64_or_32(platform)
+ def append_64_or_32(platform, cfg)
cfg['host_cpu'] =~ /x86_64|amd64/ ? "#{platform}64" : "#{platform}32"
end | Fixes Argument Error
There is a mistake in the append_<I>_or_<I> function because cfg is not defined.
This fixes the error:
geckodriver-helper-<I>/lib/geckodriver/helper.rb:<I>:in `append_<I>_or_<I>': wrong number of arguments (given 2, expected 1) (ArgumentError) | DevicoSolutions_geckodriver-helper | train | rb |
9d2e628fffac9301234e2ac34ac749d430419a5c | diff --git a/src/livedumper/common.py b/src/livedumper/common.py
index <HASH>..<HASH> 100644
--- a/src/livedumper/common.py
+++ b/src/livedumper/common.py
@@ -1,6 +1,6 @@
"Common functions that may be used everywhere"
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
import os
import sys
diff --git a/src/livedumper/dumper.py b/src/livedumper/dumper.py
index <HASH>..<HASH> 100644
--- a/src/livedumper/dumper.py
+++ b/src/livedumper/dumper.py
@@ -1,6 +1,6 @@
"Livestreamer main class"
-from __future__ import print_function, division
+from __future__ import division, print_function, unicode_literals
import os
import re
diff --git a/src/livedumper_cli b/src/livedumper_cli
index <HASH>..<HASH> 100755
--- a/src/livedumper_cli
+++ b/src/livedumper_cli
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
+from __future__ import print_function, unicode_literals
+
import os
import sys
from argparse import ArgumentParser | Fix Python 2 compatibility, again
Forgot that Python 2 doesn't handle unicode strings very well... | thiagokokada_livedumper | train | py,py,livedumper_cli |
5862eba0d185a6fd29bdfedc13196fcb7457ec79 | diff --git a/core/query.go b/core/query.go
index <HASH>..<HASH> 100644
--- a/core/query.go
+++ b/core/query.go
@@ -190,7 +190,11 @@ func (self *Service) CatQueryStepHandler(msg *db.Message) {
for _, r := range rank_list {
pair_list = append(pair_list, *r.Pair)
}
- result = pair_list[:qs.N]
+ if len(pair_list) > 0 && len(pair_list) > qs.N {
+ result = pair_list[:qs.N]
+ } else {
+ result = pair_list
+ }
} else {
result = "NONE"
} | handle the top-n limit for small result sets | pilosa_pilosa | train | go |
c94351151f3121e51b8d4268ad2881733a2508dd | diff --git a/cmd/jujud/agent/model/manifolds_test.go b/cmd/jujud/agent/model/manifolds_test.go
index <HASH>..<HASH> 100644
--- a/cmd/jujud/agent/model/manifolds_test.go
+++ b/cmd/jujud/agent/model/manifolds_test.go
@@ -535,6 +535,7 @@ var expectedIAASModelManifoldsWithDependencies = map[string][]string{
"environ-tracker",
"is-responsible-flag",
"model-upgrade-gate",
+ "not-dead-flag",
"valid-credential-flag",
}, | Add not-dead to test. | juju_juju | train | go |
039955c7e274b7217f2b810635fba0c96ea4d7ef | diff --git a/flink-python/setup.py b/flink-python/setup.py
index <HASH>..<HASH> 100644
--- a/flink-python/setup.py
+++ b/flink-python/setup.py
@@ -220,7 +220,7 @@ run sdist.
scripts=scripts,
url='https://flink.apache.org',
license='https://www.apache.org/licenses/LICENSE-2.0',
- author='Flink Developers',
+ author='Apache Software Foundation',
author_email='[email protected]',
python_requires='>=3.5',
install_requires=['py4j==0.10.8.1', 'python-dateutil==2.8.0', 'apache-beam==2.15.0', | [hotfix] [python] Change the text of PyPI Author from `Flink Developers` to `Apache Software Foundation` (#<I>) | apache_flink | train | py |
78d5c9388880718ca02f3f92d7ac5bcb9f4e8986 | diff --git a/src/Commands/AddPersistentMenu.php b/src/Commands/AddPersistentMenu.php
index <HASH>..<HASH> 100644
--- a/src/Commands/AddPersistentMenu.php
+++ b/src/Commands/AddPersistentMenu.php
@@ -44,14 +44,14 @@ class AddPersistentMenu extends Command
*/
public function handle()
{
- $payload = config('services.botman.facebook.persistent_menu');
+ $payload = config('botman.facebook.persistent_menu');
if (! $payload) {
- $this->error('You need to add a Facebook menu payload data to your BotMan config in services.php.');
+ $this->error('You need to add a Facebook menu payload data to your BotMan Facebook config in facebook.php.');
exit;
}
- $response = $this->http->post('https://graph.facebook.com/v2.6/me/messenger_profile?access_token='.config('services.botman.facebook.token'),
+ $response = $this->http->post('https://graph.facebook.com/v2.6/me/messenger_profile?access_token='.config('botman.facebook.token'),
[], $payload);
$responseObject = json_decode($response->getContent()); | Fix wrong config path (#8)
Here was still the old config path. | botman_driver-facebook | train | php |
87722fe2eaf5575c22da07d8ba9d2c800bbcb86e | diff --git a/lib/s3-paging-stream.js b/lib/s3-paging-stream.js
index <HASH>..<HASH> 100644
--- a/lib/s3-paging-stream.js
+++ b/lib/s3-paging-stream.js
@@ -35,7 +35,8 @@ module.exports = function(req, fn, opts) {
stream.push(fn(obj));
});
- req = this.hasNextPage() ? this.nextPage() : null;
- if (!req) stream.push(null);
+ var nextPage = this.hasNextPage() ? this.nextPage() : null;
+ if (nextPage) nextPage.send(page_handler);
+ else stream.push(null);
}
}; | Fix an assumption around read/page_handler order of operations | pgherveou_gulp-awspublish | train | js |
42480c2252ac5e6663d07b09914e01768fa8b4ff | diff --git a/src/Task/AbstractTask.php b/src/Task/AbstractTask.php
index <HASH>..<HASH> 100644
--- a/src/Task/AbstractTask.php
+++ b/src/Task/AbstractTask.php
@@ -27,7 +27,8 @@ abstract class AbstractTask extends BaseTask
public function __construct($magentoBin = 'bin/magento')
{
- $this->command = "php $magentoBin";
+ $phpbin = PHP_BINARY;
+ $this->command = "$phpbin $magentoBin";
}
/**
@@ -49,7 +50,7 @@ abstract class AbstractTask extends BaseTask
public function run()
{
$command = $this->getCommand();
-
+
$this->printTaskInfo("$this->taskInfo : {command}", ['command' => $command]);
return $this->executeCommand($command);
@@ -67,4 +68,4 @@ abstract class AbstractTask extends BaseTask
return $this;
}
-}
\ No newline at end of file
+} | [TASK] use PHP_BINARY by default | mwr_robo-magento2 | train | php |
182d3399c093331e5cedd2a1a5da0d677d6e023a | diff --git a/src/Models/Export.php b/src/Models/Export.php
index <HASH>..<HASH> 100644
--- a/src/Models/Export.php
+++ b/src/Models/Export.php
@@ -48,7 +48,7 @@ class Export extends Model implements
public static function cascadeFileDeletion(File $file): void
{
- self::whereFileId($file->id)->get()->delete();
+ self::whereFileId($file->id)->first()->delete();
}
public function cancel(): void | fixed cascadesOnDeletion | laravel-enso_DataExport | train | php |
93f72854303e631eba7ab92321f7432d0d562f11 | diff --git a/library/Twitter/Form.php b/library/Twitter/Form.php
index <HASH>..<HASH> 100644
--- a/library/Twitter/Form.php
+++ b/library/Twitter/Form.php
@@ -177,12 +177,24 @@ class Twitter_Form extends Zend_Form
*/
public function render(Zend_View_Interface $view = null)
{
- if($this->getAttrib("horizontal"))
- {
- $this->addDecorator("Form", array("class" => "form-horizontal"));
- } else {
- $this->addDecorator("Form", array("class" => "form-vertical"));
- }
+ $formTypes = array( // avaible form types of Twitter Bootstrap form (i.e. classes)
+ 'horizontal',
+ 'inline',
+ 'vertical',
+ 'search'
+ );
+
+ $set = false;
+
+ foreach($formTypes as $type) {
+ if($this->getAttrib($type)) {
+ $this->addDecorator("Form", array("class" => "form-$type"));
+ $set = true;
+ }
+ }
+ if(true !== $set) { // if neither type was set, we set the default vertical class
+ $this->addDecorator("Form", array("class" => "form-vertical"));
+ }
return parent::render($view);
} | additional 2 form types to use: inline and search | komola_Bootstrap-Zend-Framework | train | php |
af2b51b28a06db3a830f7fa12eb5efaff57b3f47 | diff --git a/pychromecast/controllers/spotify.py b/pychromecast/controllers/spotify.py
index <HASH>..<HASH> 100644
--- a/pychromecast/controllers/spotify.py
+++ b/pychromecast/controllers/spotify.py
@@ -41,7 +41,8 @@ class SpotifyController(BaseController):
def callback():
"""Callback function"""
self.send_message({"type": TYPE_STATUS,
- "credentials": self.access_token})
+ "credentials": self.access_token,
+ "expiresIn": 3600})
self.launch(callback_function=callback) | Fix Spotify playback (#<I>)
Spotify now requires the expiresIn token in the message.
Tested to work with Harman Kardon Google Home smart speaker and Chromecast stick v1. | balloob_pychromecast | train | py |
863b489ef78617ea2e271f05ac758165a0af7761 | diff --git a/spec/mongo/client_spec.rb b/spec/mongo/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mongo/client_spec.rb
+++ b/spec/mongo/client_spec.rb
@@ -268,7 +268,7 @@ describe Mongo::Client do
end
it 'sets the heartbeat frequency' do
- expect(client.cluster.next_primary.heartbeat_frequency).to eq(2)
+ expect(client.cluster.options[:heartbeat_frequency]).to eq(client.options[:heartbeat_frequency])
end
end
end | RUBY-<I> Update client test to only check options without connecting | mongodb_mongo-ruby-driver | train | rb |
a08996734806623c5cf3ae55784d4cb8049a3d85 | diff --git a/dedupe/training.py b/dedupe/training.py
index <HASH>..<HASH> 100644
--- a/dedupe/training.py
+++ b/dedupe/training.py
@@ -1,7 +1,3 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# provides functions for selecting a sample of training data
-
from __future__ import annotations
import itertools | frozenset -> FrozenSet | dedupeio_dedupe | train | py |
b25b4841bc87ac923fb98e19611cae379693df50 | diff --git a/lettuce/plugins/xunit_output.py b/lettuce/plugins/xunit_output.py
index <HASH>..<HASH> 100644
--- a/lettuce/plugins/xunit_output.py
+++ b/lettuce/plugins/xunit_output.py
@@ -63,11 +63,11 @@ def enable(filename=None):
tc.appendChild(skip)
if step.failed:
- cdata = doc.createCDATASection(step.why.traceback)
+ cdata = doc.createCDATASection(step.why.traceback.encode('utf-8'))
failure = doc.createElement("failure")
if hasattr(step.why, 'cause'):
- failure.setAttribute("message", step.why.cause)
- failure.setAttribute("type", step.why.exception.__class__.__name__)
+ failure.setAttribute("message", step.why.cause.encode('utf-8'))
+ failure.setAttribute("type", step.why.exception.__class__.__name__.encode('utf-8'))
failure.appendChild(cdata)
tc.appendChild(failure) | trying to utf-8 encode all possible unicode strings | aloetesting_aloe_django | train | py |
4c8eadb17d8d9019681ca061104aef610a33f2a3 | diff --git a/gwpy/tests/compat.py b/gwpy/tests/compat.py
index <HASH>..<HASH> 100644
--- a/gwpy/tests/compat.py
+++ b/gwpy/tests/compat.py
@@ -25,3 +25,8 @@ if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
+
+try:
+ from unittest import mock
+except ImportError:
+ import mock
diff --git a/gwpy/tests/test_segments.py b/gwpy/tests/test_segments.py
index <HASH>..<HASH> 100644
--- a/gwpy/tests/test_segments.py
+++ b/gwpy/tests/test_segments.py
@@ -31,11 +31,6 @@ from six.moves import StringIO
import pytest
-try:
- from unittest import mock
-except ImportError:
- import mock
-
from glue.segments import PosInfinity
from glue.LDBDWClient import LDBDClientException
@@ -44,7 +39,7 @@ from gwpy.segments import (Segment, SegmentList,
from gwpy.io.registry import identify_format
from gwpy.plotter import (SegmentPlot, SegmentAxes)
-from compat import unittest
+from compat import (unittest, mock)
import common
import mockutils | tests: moved mock import to compat.py | gwpy_gwpy | train | py,py |
42484f04e3585635177d372d32cbae953fbf9751 | diff --git a/spec/netsuite/records/address_spec.rb b/spec/netsuite/records/address_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/netsuite/records/address_spec.rb
+++ b/spec/netsuite/records/address_spec.rb
@@ -134,6 +134,16 @@ describe NetSuite::Records::Address do
expect(addressbook.country.to_record).to eql ""
expect(addressbook.to_record["platformCommon:country"]).to eql ""
end
+
+ it 'changes the netsuite identifier based on the current API version' do
+ NetSuite::Configuration.api_version = '2015_1'
+ addressbook = NetSuite::Records::Address.new country: "GB"
+ expect(addressbook.to_record["platformCommon:country"]).to eql "_unitedKingdomGB"
+ NetSuite::Configuration.api_version = '2018_1'
+
+ addressbook = NetSuite::Records::Address.new country: "GB"
+ expect(addressbook.to_record["platformCommon:country"]).to eql "_unitedKingdom"
+ end
end
end | Test for country code definition change based on api version | NetSweet_netsuite | train | rb |
4173ee5b04ca9b2c1a23cc371c0a90c5deb4de4f | diff --git a/client/state/selectors/get-editor-close-config.js b/client/state/selectors/get-editor-close-config.js
index <HASH>..<HASH> 100644
--- a/client/state/selectors/get-editor-close-config.js
+++ b/client/state/selectors/get-editor-close-config.js
@@ -52,7 +52,7 @@ export default function getEditorCloseConfig( state, siteId, postType, fseParent
if ( ! lastNonEditorRoute || ! postType || doesRouteMatch( /^\/home\/?/ ) ) {
return {
url: `/home/${ getSiteSlug( state, siteId ) }`,
- label: translate( 'My Home' ),
+ label: translate( 'Dashboard' ),
};
} | Navigation Sidebar: Rename close label from My Home to Dashboard (#<I>) | Automattic_wp-calypso | train | js |
fb2458ec77c3096c762c9e706c58104a60afcd39 | diff --git a/lib/dbox/database.rb b/lib/dbox/database.rb
index <HASH>..<HASH> 100644
--- a/lib/dbox/database.rb
+++ b/lib/dbox/database.rb
@@ -83,6 +83,13 @@ module Dbox
make_fields(cols, res) if res
end
+ def update_metadata(fields)
+ set_str = fields.keys.map {|k| "#{k}=?" }.join(",")
+ @db.execute(%{
+ UPDATE metadata SET #{set_str};
+ }, *fields.values)
+ end
+
def root_dir
find_entry("WHERE parent_id is NULL")
end
diff --git a/lib/dbox/syncer.rb b/lib/dbox/syncer.rb
index <HASH>..<HASH> 100644
--- a/lib/dbox/syncer.rb
+++ b/lib/dbox/syncer.rb
@@ -23,7 +23,9 @@ module Dbox
end
def self.move(new_remote_path, local_path)
- # TODO implement
+ database = Database.load(local_path)
+ api.move(database.metadata[:remote_path], new_remote_path)
+ database.update_metadata(:remote_path => new_remote_path)
end
def self.api | Implemented move API on Syncer. | kenpratt_dbox | train | rb,rb |
f7787f50ea8042e245de75b4e96eac780efc6f57 | diff --git a/casper.js b/casper.js
index <HASH>..<HASH> 100644
--- a/casper.js
+++ b/casper.js
@@ -703,11 +703,9 @@
this.options.onPageInitialized.call(this, this.page);
}
if (isType(location, "string") && location.length > 0) {
- if (isType(then, "function")) {
- return this.open(location).then(then);
- } else {
- return this.open(location);
- }
+ return this.thenOpen(location, isType(then, "function") ? then : this.createStep(function(self) {
+ self.log("start page is loaded", "debug");
+ }));
}
return this;
}, | removed the obligation to add an empty step if start() would just suffice | casperjs_casperjs | train | js |
5052c2d3f53249f46eb681bc60896232a4619e5e | diff --git a/js/jquery.fileupload-ui.js b/js/jquery.fileupload-ui.js
index <HASH>..<HASH> 100644
--- a/js/jquery.fileupload-ui.js
+++ b/js/jquery.fileupload-ui.js
@@ -1,5 +1,5 @@
/*
- * jQuery File Upload User Interface Plugin 8.2
+ * jQuery File Upload User Interface Plugin 8.2.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@@ -129,7 +129,9 @@
done: function (e, data) {
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
- files = data.getFilesFromResponse(data),
+ getFilesFromResponse = data.getFilesFromResponse ||
+ that.options.getFilesFromResponse,
+ files = getFilesFromResponse(data),
template,
deferred;
if (data.context) { | Use getFilesFromResponse from options if not available as data property. Fixes #<I>. | blueimp_jQuery-File-Upload | train | js |
d47babacb297541b5c9cc140217a142cd270068a | diff --git a/project_generator/tools/gccarm.py b/project_generator/tools/gccarm.py
index <HASH>..<HASH> 100644
--- a/project_generator/tools/gccarm.py
+++ b/project_generator/tools/gccarm.py
@@ -65,7 +65,6 @@ class MakefileGccArm(Tool,Exporter):
def _libraries(self, key, value, data):
""" Add defined GCC libraries. """
- print data['source_files_lib']
for option in value:
if key == "libraries":
data['source_files_lib'].append(option)
@@ -103,8 +102,6 @@ class MakefileGccArm(Tool,Exporter):
data['compiler_options'] = []
for dic in data['misc']:
for k, v in dic.items():
- print k
- print v
self._libraries(k, v, data)
self._compiler_options(k, v, data)
self._optimization(k, v, data) | Removed debug prints from gccarm | project-generator_project_generator | train | py |
9493bab6e9a681ec5ed15a1a1537e3dd40e221fd | diff --git a/cherrypy/lib/static.py b/cherrypy/lib/static.py
index <HASH>..<HASH> 100644
--- a/cherrypy/lib/static.py
+++ b/cherrypy/lib/static.py
@@ -1,22 +1,24 @@
+import os
+import re
+import stat
+import mimetypes
+
try:
from io import UnsupportedOperation
except ImportError:
UnsupportedOperation = object()
-import mimetypes
+
+import cherrypy
+from cherrypy._cpcompat import ntob, unquote
+from cherrypy.lib import cptools, httputil, file_generator_limited
+
+
mimetypes.init()
mimetypes.types_map['.dwg'] = 'image/x-dwg'
mimetypes.types_map['.ico'] = 'image/x-icon'
mimetypes.types_map['.bz2'] = 'application/x-bzip2'
mimetypes.types_map['.gz'] = 'application/x-gzip'
-import os
-import re
-import stat
-
-import cherrypy
-from cherrypy._cpcompat import ntob, unquote
-from cherrypy.lib import cptools, httputil, file_generator_limited
-
def serve_file(path, content_type=None, disposition=None, name=None,
debug=False): | Reorganize imports to conform to convention | cherrypy_cheroot | train | py |
927d16c86fcb341f48ada156a0c63c9473113341 | diff --git a/src/Core/Form/View/Helper/SummaryForm.php b/src/Core/Form/View/Helper/SummaryForm.php
index <HASH>..<HASH> 100644
--- a/src/Core/Form/View/Helper/SummaryForm.php
+++ b/src/Core/Form/View/Helper/SummaryForm.php
@@ -170,13 +170,13 @@ class SummaryForm extends AbstractHelper
}
$dataAttributesMarkup = '';
- $dataAttributes = array_filter($form->getAttributes(), function ($key) {
- return preg_match('/^data-/', $key);
- }, ARRAY_FILTER_USE_KEY);
- foreach ($dataAttributes as $dataKey => $dataValue)
+ foreach ($form->getAttributes() as $dataKey => $dataValue)
{
- $dataAttributesMarkup .= sprintf(' %s="%s"', $dataKey, $dataValue);
+ if (preg_match('/^data-/', $dataKey))
+ {
+ $dataAttributesMarkup .= sprintf(' %s="%s"', $dataKey, $dataValue);
+ }
}
$markup = '<div class="panel panel-default" style="min-height: 100px;"' . $dataAttributesMarkup . '> | getting rid of PHP <I> ARRAY_FILTER_USE_KEY constant
refs gh-<I> | yawik_core | train | php |
44b5df3d7877bb4957d6a30955acaaaa42f18960 | diff --git a/packages/mdc-stepper/addon/-lib/stepper/foundation.js b/packages/mdc-stepper/addon/-lib/stepper/foundation.js
index <HASH>..<HASH> 100644
--- a/packages/mdc-stepper/addon/-lib/stepper/foundation.js
+++ b/packages/mdc-stepper/addon/-lib/stepper/foundation.js
@@ -95,4 +95,14 @@ export default class MDCStepperFoundation extends MDCFoundation {
return moved;
}
+
+ /**
+ * Move "active" to specified step id.
+ *
+ * @param {number} id Unique number for step.
+ * @return {boolean}
+ */
+ goto (stepId) {
+ return this.adapter_.activate (stepId);
+ }
}
diff --git a/packages/mdc-stepper/addon/-lib/stepper/index.js b/packages/mdc-stepper/addon/-lib/stepper/index.js
index <HASH>..<HASH> 100644
--- a/packages/mdc-stepper/addon/-lib/stepper/index.js
+++ b/packages/mdc-stepper/addon/-lib/stepper/index.js
@@ -105,7 +105,7 @@ export class MDCStepper extends MDCComponent {
/**
* Move "active" to specified step id.
- * This operation is similar to the MaterialStepper.setActive_(<number>).
+ *
* @param {number} id Unique number for step.
* @return {boolean}
*/ | Implemented the goto() method | onehilltech_ember-cli-mdc | train | js,js |
fe6f8c4c43394bb4c4be453bd2ae678d75691fcd | diff --git a/test/benchmarks.js b/test/benchmarks.js
index <HASH>..<HASH> 100644
--- a/test/benchmarks.js
+++ b/test/benchmarks.js
@@ -314,7 +314,7 @@ if (typeof window !== 'undefined') {
log(this.name +
' size ' + kb(size) +
' time ' + (1000 * this.stats.mean).toFixed(1) +
- ' variance ' + (1000 * this.stats.variance).toFixed(1));
+ ' variance ' + (1000 * 1000 * this.stats.variance).toFixed(1));
totalTime += this.stats.mean;
}
}); | Fix variance unit conversion.
If all values are scaled by a constant, the variance is scaled by the
square of that constant.
<URL> | jscs-dev_esprima-harmony | train | js |
579c67b6736e4e01e861573638551cdbb62721b1 | diff --git a/library/WT/Controller/Familybook.php b/library/WT/Controller/Familybook.php
index <HASH>..<HASH> 100644
--- a/library/WT/Controller/Familybook.php
+++ b/library/WT/Controller/Familybook.php
@@ -269,7 +269,7 @@ class WT_Controller_Familybook extends WT_Controller_Chart {
$sfamilies=$person->getSpouseFamilies();
$famcount = 0;
if ($this->show_spouse) {
- foreach ($sfamilies as $family) {
+ foreach ($sfamilies as $sfamily) {
$famcount++;
}
} | Fix code error in recent Familybook patch | fisharebest_webtrees | train | php |
8e2e0bc94db5124a66d9673443eb491afbb0655a | diff --git a/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java b/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java
index <HASH>..<HASH> 100644
--- a/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java
+++ b/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java
@@ -59,7 +59,7 @@ final class ProductResultInfoRetriever extends SupplementalInfoRetriever {
void retrieveSupplementalInfo() throws IOException {
String encodedProductID = URLEncoder.encode(productID, "UTF-8");
- String uri = "http://www.google." + LocaleManager.getProductSearchCountryTLD(context)
+ String uri = "https://www.google." + LocaleManager.getProductSearchCountryTLD(context)
+ "/m/products?ie=utf8&oe=utf8&scoring=p&source=zxing&q=" + encodedProductID;
CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.HTML); | Use HTTPS to send product queries to Google Shopping | zxing_zxing | train | java |
39845b8fe5e5d266396bff59bcf980a40116eda4 | diff --git a/src/EventListener/BackendEventsListener.php b/src/EventListener/BackendEventsListener.php
index <HASH>..<HASH> 100644
--- a/src/EventListener/BackendEventsListener.php
+++ b/src/EventListener/BackendEventsListener.php
@@ -559,10 +559,10 @@ class BackendEventsListener
if ($where) {
$query = $this->connection->createQueryBuilder()
- ->select($values->getPropertyValue('select_table') . '.*')
- ->from($values->getPropertyValue('select_table'))
+ ->select('sourceTable.*')
+ ->from($values->getPropertyValue('select_table'), 'sourceTable')
->where($where)
- ->orderBy($values->getPropertyValue('select_sorting') ?: $values->getPropertyValue('select_id'));
+ ->orderBy('sourceTable.' . ($values->getPropertyValue('select_sorting') ?: $values->getPropertyValue('select_id')));
try {
$query->execute(); | Hotfix add table alias 'sourceTable" at checkQuery as the same alias as select queryBuilder | MetaModels_attribute_select | train | php |
76e23ae11d0c44a1ed455e8acb35dcf618f7316d | diff --git a/horriblesubs-api.js b/horriblesubs-api.js
index <HASH>..<HASH> 100644
--- a/horriblesubs-api.js
+++ b/horriblesubs-api.js
@@ -312,8 +312,8 @@ module.exports = class HorribleSubsAPI {
const season = 1;
- const seasonal = /(.*).[Ss](\d)\s-\s(\d+).\[(\d{3,4}p)\]/i;
- const oneSeason = /(.*)\s-\s(\d+).\[(\d{3,4}p)\]/i;
+ const seasonal = /(.*).[Ss](\d)\s-\s(\d+)(?:v\d)?.\[(\d{3,4}p)\]/i;
+ const oneSeason = /(.*)\s-\s(\d+)(?:v\d)?.\[(\d{3,4}p)\]/i;
let slug, episode, quality;
if (label.match(seasonal)) {
data.slug = label.match(seasonal)[1].replace(/[,!]/gi, '').replace(/\s-\s/gi, ' ').replace(/[\+\s\']/g, '-').toLowerCase(); | Support for matching version episodes.
It appears that HorribleSubs replaces an episode and changes the name of the episode to <I>v2 in some cases.
This resulted in the getAnimeData result not showing result for episode <I>.
Example: <URL> | ChrisAlderson_horriblesubs-api | train | js |
b9108944664a4d91dc9f111a345bec4b53748dca | diff --git a/src/main/java/io/fabric8/maven/docker/access/log/LogRequestor.java b/src/main/java/io/fabric8/maven/docker/access/log/LogRequestor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/fabric8/maven/docker/access/log/LogRequestor.java
+++ b/src/main/java/io/fabric8/maven/docker/access/log/LogRequestor.java
@@ -181,12 +181,18 @@ public class LogRequestor extends Thread implements LogGetHandle {
throw new LogCallback.DoneException();
}
- try (InputStream is = response.getEntity().getContent()) {
+ final InputStream is = response.getEntity().getContent();
+
+ try {
while (true) {
if (!readStreamFrame(is)) {
return;
}
}
+ } finally {
+ if ((is != null) && (is.available() > 0)) {
+ is.close();
+ }
}
} | Revert part of #<I> to fix #<I> | fabric8io_docker-maven-plugin | train | java |
990c99a780b0949aede124d476ae77f9b4428f75 | diff --git a/src/Payload/AbstractPayload.php b/src/Payload/AbstractPayload.php
index <HASH>..<HASH> 100644
--- a/src/Payload/AbstractPayload.php
+++ b/src/Payload/AbstractPayload.php
@@ -52,8 +52,18 @@ abstract class AbstractPayload implements PayloadInterface {
public function getSuccess(): bool {
return $this->success;
}
-
- /**
+
+ /**
+ * @param bool $success
+ *
+ * @return void
+ */
+ public function setSuccess(bool $success): void {
+ $this->success = $success;
+ }
+
+
+ /**
* given an $index, return its data or $default if it doesn't exist
*
* @param string $index
diff --git a/src/Payload/PayloadInterface.php b/src/Payload/PayloadInterface.php
index <HASH>..<HASH> 100644
--- a/src/Payload/PayloadInterface.php
+++ b/src/Payload/PayloadInterface.php
@@ -17,7 +17,14 @@ interface PayloadInterface {
* @return bool
*/
public function getSuccess(): bool;
-
+
+ /**
+ * @param bool $success
+ *
+ * @return void
+ */
+ public function setSuccess(bool $success): void;
+
/**
* @param string $index
* @param mixed $default | added setSuccess to payload | dashifen_domain | train | php,php |
e098b9dfb55b4a1135e0e3d389779895ae64526d | diff --git a/fs/fs.go b/fs/fs.go
index <HASH>..<HASH> 100644
--- a/fs/fs.go
+++ b/fs/fs.go
@@ -84,12 +84,11 @@ func newFile(zf *zip.File, isDir bool) (*file, error) {
if err != nil {
return nil, err
}
+ defer rc.Close()
all, err := ioutil.ReadAll(rc)
if err != nil {
return nil, err
}
- rc.Close()
-
return &file{
FileInfo: zf.FileInfo(),
data: all, | close even if readall fails. | rakyll_statik | train | go |
f99f40a7d47a42477f9c6b2d0bdfb646c632763b | diff --git a/pyOutlook/core/message.py b/pyOutlook/core/message.py
index <HASH>..<HASH> 100644
--- a/pyOutlook/core/message.py
+++ b/pyOutlook/core/message.py
@@ -29,9 +29,6 @@ class Message(object):
self.to_recipients = to_recipients
def __str__(self):
- return self.__getattribute__('message_id')
-
- def __repr__(self):
return self.__getattribute__('subject')
def forward_message(self, to_recipients, forward_comment): | Removal of __repr__ method | JensAstrup_pyOutlook | train | py |
181a46944fc128314519ebf55c94384a428f992f | diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/batch/JobColumn.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/batch/JobColumn.java
index <HASH>..<HASH> 100644
--- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/batch/JobColumn.java
+++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/batch/JobColumn.java
@@ -185,7 +185,7 @@ public class JobColumn extends FinderColumn<JobNode> {
actions.add(itemActionFactory.view(placeRequest));
actions.add(new ItemAction.Builder<JobNode>()
.title(resources.constants().start())
- .constraint(Constraint.executable(BATCH_DEPLOYMENT_JOB_TEMPLATE, START_SERVERS))
+ .constraint(Constraint.executable(BATCH_DEPLOYMENT_JOB_TEMPLATE, START_JOB))
.handler(itm -> startJob(itm))
.build());
return actions; | Fix wrong operation name in security constraint for job column | hal_console | train | java |
33aea5a7645b09b3ad838dabdb84a3558f01edf1 | diff --git a/lib/code.js b/lib/code.js
index <HASH>..<HASH> 100644
--- a/lib/code.js
+++ b/lib/code.js
@@ -22,14 +22,19 @@ function Code(str, comment) {
var val = ctx.original || '';
var pos = str.slice(start).indexOf(val) + start;
- return {
- context: ctx,
- line: lineno,
- loc: {
- start: { line: lineno, pos: pos },
- end: { line: lineno, pos: pos + val.length }
+ this.context = ctx;
+ this.value = val.trim();
+ this.line = lineno;
+
+ this.loc = {
+ start: {
+ line: lineno,
+ pos: pos
},
- value: val.trim()
+ end: {
+ line: lineno,
+ pos: pos + val.length
+ }
};
} | make code context object more consistent with other classes | jonschlinkert_extract-comments | train | js |
52ec8752d89882dd9978a76e954615a0e3d1f7d5 | diff --git a/src/Symfony/Bundle/TwigBundle/Node/RouteNode.php b/src/Symfony/Bundle/TwigBundle/Node/RouteNode.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/TwigBundle/Node/RouteNode.php
+++ b/src/Symfony/Bundle/TwigBundle/Node/RouteNode.php
@@ -35,8 +35,15 @@ class RouteNode extends \Twig_Node
->write('echo $this->env->getExtension(\'templating\')->getContainer()->get(\'router\')->generate(')
->subcompile($this->getNode('route'))
->raw(', ')
- ->subcompile($this->getNode('route_attributes'))
- ->raw(', ')
+ ;
+
+ $attr = $this->getNode('route_attributes');
+ if ($attr) {
+ $compiler->subcompile($attr);
+ } else {
+ $compiler->raw('array()');
+ }
+ $compiler->raw(', ')
->raw($this->getAttribute('absolute') ? 'true' : 'false')
->raw(");")
; | When route_attributes is null an exception is raised. | symfony_symfony | train | php |
a12b5af7353c56813b564a0be23c30c85a46c52c | diff --git a/order/client.go b/order/client.go
index <HASH>..<HASH> 100644
--- a/order/client.go
+++ b/order/client.go
@@ -144,12 +144,11 @@ func (c Client) Pay(id string, params *stripe.OrderPayParams) (*stripe.Order, er
if params != nil {
body = &url.Values{}
-
+ commonParams = ¶ms.Params
if params.Source == nil && len(params.Customer) == 0 {
err := errors.New("Invalid order pay params: either customer or a source must be set")
return nil, err
}
-
// We can't use `AppendDetails` since that nests under `card`.
if params.Source != nil {
if len(params.Source.Token) > 0 { | Fix Pay() commonParams issue | stripe_stripe-go | train | go |
c9e0a379391f1d71c57aa2d4ce238b52dfbc840b | diff --git a/regions/io/ds9/write.py b/regions/io/ds9/write.py
index <HASH>..<HASH> 100644
--- a/regions/io/ds9/write.py
+++ b/regions/io/ds9/write.py
@@ -250,6 +250,11 @@ def _translate_ds9_meta(region, shape):
if dashes is not None:
meta['dashlist'] = f'{dashes[0]} {dashes[1]}'
+ rotation = meta.pop('rotation', None)
+ if rotation is not None:
+ meta['textangle'] = rotation
+ #meta['textrotate'] = 1
+
# ds9 meta keys
meta_keys = ['text', 'select', 'highlite', 'fixed', 'edit', 'move',
'rotate', 'delete', 'include', 'tag', 'source', | Add textangle to ds9 writer | astropy_regions | train | py |
cd2f17157b71bd79561bd138e1c03b7d9d1765d2 | diff --git a/analyzer_test.go b/analyzer_test.go
index <HASH>..<HASH> 100644
--- a/analyzer_test.go
+++ b/analyzer_test.go
@@ -21,8 +21,8 @@ import (
"sort"
"testing"
+ "github.com/go-openapi/loads/fmts"
"github.com/go-openapi/spec"
- "github.com/go-swagger/go-swagger/loads/fmts"
"github.com/stretchr/testify/assert"
) | rewrite for removal of loads package | go-openapi_analysis | train | go |
1c5e01c0136afd02bded92588410621e1274e633 | diff --git a/src/Docnet/JAPI.php b/src/Docnet/JAPI.php
index <HASH>..<HASH> 100644
--- a/src/Docnet/JAPI.php
+++ b/src/Docnet/JAPI.php
@@ -44,7 +44,7 @@ class JAPI
/**
* @var \Docnet\JAPI\Router
*/
- private $obj_router = NULL;
+ private static $obj_router = NULL;
/**
* When creating a new JAPI, hook up the shutdown function and set Config
@@ -134,12 +134,12 @@ class JAPI
*
* @return JAPI\Router
*/
- public function getRouter()
+ public static function getRouter()
{
- if (NULL === $this->obj_router) {
- $this->obj_router = new \Docnet\JAPI\Router();
+ if (NULL === self::$obj_router) {
+ self::$obj_router = new \Docnet\JAPI\Router();
}
- return $this->obj_router;
+ return self::$obj_router;
}
/**
@@ -149,7 +149,7 @@ class JAPI
*/
public function setRouter(\Docnet\JAPI\Interfaces\Router $obj_router)
{
- $this->obj_router = $obj_router;
+ self::$obj_router = $obj_router;
}
/** | router variable changed to static, so it could be accessible from other places than JAPI itself (we usually don't have the instance of JAPI to call the non-static method) | DocnetUK_php-japi | train | php |
8597e9acdfd0ea151dbdfb63fe0c0e8ba68dadb2 | diff --git a/snapcast/control/server.py b/snapcast/control/server.py
index <HASH>..<HASH> 100755
--- a/snapcast/control/server.py
+++ b/snapcast/control/server.py
@@ -46,6 +46,7 @@ _METHODS = [SERVER_GETSTATUS, SERVER_GETRPCVERSION, SERVER_DELETECLIENT,
GROUP_GETSTATUS, GROUP_SETMUTE, GROUP_SETSTREAM, GROUP_SETCLIENTS]
+# pylint: disable=too-many-public-methods
class Snapserver(object):
"""Represents a snapserver.""" | Disabling "too many public methods" linter error for the Snapserver class | happyleavesaoc_python-snapcast | train | py |
9971ae88d6329850580a5537823cfd51cac63410 | diff --git a/lib/traject/array_writer.rb b/lib/traject/array_writer.rb
index <HASH>..<HASH> 100644
--- a/lib/traject/array_writer.rb
+++ b/lib/traject/array_writer.rb
@@ -10,12 +10,15 @@ module Traject
#
# Recommend against using it with huge number of records, as it will
# of course store them all in memory.
+ #
+ # Uses Concurrent::Arrays internally, so should be safe for use as writer
+ # in concurrency scenarios.
class ArrayWriter
attr_reader :values, :contexts
def initialize
- @values = []
- @contexts = []
+ @values = Concurrent::Array.new
+ @contexts = Concurrent::Array.new
end
def put(context) | ArrayWriter is concurrency-safe now | traject_traject | train | rb |
Subsets and Splits