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 |
|---|---|---|---|---|---|
86fd76a43c965111677abba8014f52df62ee7c2a | diff --git a/AlphaTwirl/Counter/GenericKeyComposerB.py b/AlphaTwirl/Counter/GenericKeyComposerB.py
index <HASH>..<HASH> 100755
--- a/AlphaTwirl/Counter/GenericKeyComposerB.py
+++ b/AlphaTwirl/Counter/GenericKeyComposerB.py
@@ -2,7 +2,7 @@
##____________________________________________________________________________||
class GenericKeyComposerB(object):
- """This class is a faster of GenericKeyComposer.
+ """This class is a faster version of GenericKeyComposer.
This class can be used with BEvents. | update the docstring in GenericKeyComposerB | alphatwirl_alphatwirl | train | py |
bb3cfefb5d919accc8f97da8e5995a4ed7dc5f59 | diff --git a/ryu/ofproto/nx_actions.py b/ryu/ofproto/nx_actions.py
index <HASH>..<HASH> 100644
--- a/ryu/ofproto/nx_actions.py
+++ b/ryu/ofproto/nx_actions.py
@@ -28,8 +28,6 @@ from ryu.ofproto.ofproto_parser import StringifyMixin
def generate(ofp_name, ofpp_name):
import sys
- import string
- import functools
ofp = sys.modules[ofp_name]
ofpp = sys.modules[ofpp_name]
@@ -582,10 +580,10 @@ def generate(ofp_name, ofpp_name):
kwargs['range_ipv6_max'] = (
type_desc.IPv6Addr.to_user(rest[:16]))
rest = rest[16:]
- if range_present & NX_NAT_RANGE_PROTO_MIN:
+ if range_present & nicira_ext.NX_NAT_RANGE_PROTO_MIN:
kwargs['range_proto_min'] = type_desc.Int2.to_user(rest[:2])
rest = rest[2:]
- if range_present & NX_NAT_RANGE_PROTO_MAX:
+ if range_present & nicira_ext.NX_NAT_RANGE_PROTO_MAX:
kwargs['range_proto_max'] = type_desc.Int2.to_user(rest[:2])
return cls(flags, **kwargs) | ofproto/nx_actions: Flake8 Fixes | osrg_ryu | train | py |
86c7d2d399da3cc939fb21962004aebdccd19ca3 | diff --git a/autotls.go b/autotls.go
index <HASH>..<HASH> 100644
--- a/autotls.go
+++ b/autotls.go
@@ -19,7 +19,17 @@ func RunWithManager(r http.Handler, m *autocert.Manager) error {
Handler: r,
}
- go http.ListenAndServe(":http", m.HTTPHandler(nil))
+ go http.ListenAndServe(":http", m.HTTPHandler(http.HandlerFunc(redirect)))
return s.ListenAndServeTLS("", "")
}
+
+func redirect(w http.ResponseWriter, req *http.Request) {
+ target := "https://" + req.Host + req.URL.Path
+
+ if len(req.URL.RawQuery) > 0 {
+ target += "?" + req.URL.RawQuery
+ }
+
+ http.Redirect(w, req, target, http.StatusTemporaryRedirect)
+} | chore: support http redirect to https (#<I>) | gin-gonic_autotls | train | go |
5dc039ccc0c51d02534863ef0bd40dbbf9954627 | diff --git a/raiden/transfer/state.py b/raiden/transfer/state.py
index <HASH>..<HASH> 100644
--- a/raiden/transfer/state.py
+++ b/raiden/transfer/state.py
@@ -95,7 +95,7 @@ class PaymentNetworkState(State):
__slots__ = (
'address',
- 'tokensidentifiers_to_tokennetworks',
+ 'tokenidentifiers_to_tokennetworks',
'tokenaddresses_to_tokennetworks',
)
@@ -108,7 +108,7 @@ class PaymentNetworkState(State):
raise ValueError('address must be an address instance')
self.address = address
- self.tokensidentifiers_to_tokennetworks = {
+ self.tokenidentifiers_to_tokennetworks = {
token_network.address: token_network
for token_network in token_network_list
}
@@ -125,7 +125,7 @@ class PaymentNetworkState(State):
isinstance(other, PaymentNetworkState) and
self.address == other.address and
self.tokenaddresses_to_tokennetworks == other.tokenaddresses_to_tokennetworks and
- self.tokensidentifiers_to_tokennetworks == other.tokensidentifiers_to_tokennetworks
+ self.tokenidentifiers_to_tokennetworks == other.tokenidentifiers_to_tokennetworks
)
def __ne__(self, other): | Remove extra `s` from tokensidentifiers_to_tokennetworks | raiden-network_raiden | train | py |
ab487ef7541874175e65529568ba97755905b3be | diff --git a/hangups/__main__.py b/hangups/__main__.py
index <HASH>..<HASH> 100644
--- a/hangups/__main__.py
+++ b/hangups/__main__.py
@@ -37,8 +37,10 @@ class UserInterface(object):
exit(1)
tornado_loop = urwid.TornadoEventLoop(ioloop.IOLoop.instance())
- self._urwid_loop = urwid.MainLoop(LoadingWidget(), URWID_PALETTE,
- event_loop=tornado_loop)
+ self._urwid_loop = urwid.MainLoop(
+ LoadingWidget(), URWID_PALETTE, event_loop=tornado_loop,
+ handle_mouse=False
+ )
self._client = hangups.Client(cookies, self.on_event)
future = self._client.connect()
ioloop.IOLoop.instance().add_future(future, lambda f: f.result()) | Disable mouse handling
Fixes copy and paste on chromebook's terminal. | tdryer_hangups | train | py |
363b7e17ebcce00a563b921d3c0d228b6b844c8e | diff --git a/keyring/tests/backends/test_Google.py b/keyring/tests/backends/test_Google.py
index <HASH>..<HASH> 100644
--- a/keyring/tests/backends/test_Google.py
+++ b/keyring/tests/backends/test_Google.py
@@ -2,6 +2,7 @@ import codecs
import base64
import cPickle
+import keyring.py27compat
from ..py30compat import unittest
from ..test_backend import BackendBasicTests
from keyring.backends import Google
@@ -18,7 +19,7 @@ def is_gdata_supported():
return True
def init_google_docs_keyring(client, can_create=True,
- input_getter=raw_input):
+ input_getter=keyring.py27compat.input):
credentials = SimpleCredential('foo', 'bar')
return Google.DocsKeyring(credentials,
'test_src', | Fix NameError on Python 3 in tests | jaraco_keyring | train | py |
43a3b5d696823d84e5b375bab5178a21b23a3825 | diff --git a/upnpclient/soap.py b/upnpclient/soap.py
index <HASH>..<HASH> 100644
--- a/upnpclient/soap.py
+++ b/upnpclient/soap.py
@@ -102,12 +102,12 @@ class SOAP(object):
# If the body of the error response contains XML then it should be a UPnP error,
# otherwise reraise the HTTPError.
try:
- err_xml = etree.fromstring(exc.response.text)
+ err_xml = etree.fromstring(exc.response.content)
except etree.XMLSyntaxError:
raise exc
raise SOAPError(*self._extract_upnperror(err_xml))
- xml_str = resp.text.strip()
+ xml_str = resp.content.strip()
try:
xml = etree.fromstring(xml_str)
except etree.XMLSyntaxError: | Use resp.content in soap client too. | flyte_upnpclient | train | py |
f1f1ab055781bc3735e28e36701b99d473282d86 | diff --git a/endpoints/cinema/index.js b/endpoints/cinema/index.js
index <HASH>..<HASH> 100644
--- a/endpoints/cinema/index.js
+++ b/endpoints/cinema/index.js
@@ -24,7 +24,7 @@ var getMovies = function (req, res, next) {
try {
$ = cheerio.load( body );
} catch (e) {
- exports.logError( e );
+ throw new Error( e );
}
// Base object to be added to | Throws a new Error | apis-is_apis | train | js |
00cd1af1a2834c8af92a80afe23d1415df02ecdb | diff --git a/tests/test_model_relations.py b/tests/test_model_relations.py
index <HASH>..<HASH> 100644
--- a/tests/test_model_relations.py
+++ b/tests/test_model_relations.py
@@ -35,15 +35,15 @@ class TestModelRelations:
self.prepare_testbed()
user = User(name='Joe').save()
employee = Employee(eid='E1', usr=user).save()
+ # need to wait a sec because we will query solr in the
+ # _save_backlinked_models of User object
+ sleep(1)
employee_from_db = Employee.objects.get(employee.key)
assert employee_from_db.usr.name == user.name
user_from_db = User.objects.get(user.key)
+
user_from_db.name = 'Joen'
- # pprint(user_from_db.clean_value())
- # FIXME: this 1 sec wait shouldn't be required
- sleep(1)
- # pprint(user_from_db.clean_value())
user_from_db.save()
employee_from_db = Employee.objects.get(employee.key)
assert employee_from_db.usr.name == user_from_db.name | we need to wait a sec to give enough time for riak/solr sync | zetaops_pyoko | train | py |
157680c2d08d1798e7d8689fb5c6d8fa35200111 | diff --git a/worker/uniter/util_test.go b/worker/uniter/util_test.go
index <HASH>..<HASH> 100644
--- a/worker/uniter/util_test.go
+++ b/worker/uniter/util_test.go
@@ -36,6 +36,7 @@ import (
"github.com/juju/juju/core/leadership"
corelease "github.com/juju/juju/core/lease"
"github.com/juju/juju/core/machinelock"
+ "github.com/juju/juju/core/model"
"github.com/juju/juju/core/status"
"github.com/juju/juju/juju/sockets"
"github.com/juju/juju/juju/testing"
@@ -958,7 +959,7 @@ func (s updateStatusHookTick) step(c *gc.C, ctx *context) {
type changeConfig map[string]interface{}
func (s changeConfig) step(c *gc.C, ctx *context) {
- err := ctx.application.UpdateCharmConfig(corecharm.Settings(s))
+ err := ctx.application.UpdateCharmConfig(model.GenerationCurrent, corecharm.Settings(s))
c.Assert(err, jc.ErrorIsNil)
} | Fixes uniter worker tests for generational charm config. | juju_juju | train | go |
da490c5db59571f863dc7537442789b539292c3a | diff --git a/gardenrunner/gardenrunner.go b/gardenrunner/gardenrunner.go
index <HASH>..<HASH> 100644
--- a/gardenrunner/gardenrunner.go
+++ b/gardenrunner/gardenrunner.go
@@ -140,7 +140,6 @@ func (r *Runner) Run(signals <-chan os.Signal, ready chan<- struct{}) error {
} else { // garden-runc
gardenArgs = appendDefaultFlag(gardenArgs, "--init-bin", r.binPath+"/init")
gardenArgs = appendDefaultFlag(gardenArgs, "--dadoo-bin", r.binPath+"/dadoo")
- gardenArgs = appendDefaultFlag(gardenArgs, "--kawasaki-bin", r.binPath+"/kawasaki")
gardenArgs = appendDefaultFlag(gardenArgs, "--nstar-bin", r.binPath+"/nstar")
gardenArgs = appendDefaultFlag(gardenArgs, "--tar-bin", r.binPath+"/tar")
gardenArgs = appendDefaultFlag(gardenArgs, "--runc-bin", r.binPath+"/runc") | Remove garden-runc kawasaki flag
* We need to add this back once the kawasaki dependency hits master of
garden-runc-release | cloudfoundry_inigo | train | go |
f094188780c41d665d08c7aa159968a81ca135ed | diff --git a/searx/search.py b/searx/search.py
index <HASH>..<HASH> 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -414,6 +414,9 @@ class Search(object):
self.categories.remove(category)
if not load_default_categories:
+ if not self.categories:
+ self.categories = list(set(engine['category']
+ for engine in self.engines))
return
# if no category is specified for this search, | [fix] display categories of the selected engines | asciimoo_searx | train | py |
ae532e43cb0acaffea0fb2541ee696a83dbd0dc8 | diff --git a/bliss/core/seq.py b/bliss/core/seq.py
index <HASH>..<HASH> 100644
--- a/bliss/core/seq.py
+++ b/bliss/core/seq.py
@@ -56,7 +56,7 @@ class Seq (object):
self.pathname = pathname
self.cmddict = cmddict or cmd.getDefaultCmdDict()
self.crc32 = None
- self.seqid = id
+ self.seqid = int(id)
self.lines = [ ]
self.header = { }
self.version = version
@@ -227,12 +227,12 @@ class Seq (object):
if 'seqid' in self.header:
self.seqid = self.header['seqid']
- else:
+ elif self.seqid is None:
self.log.error('No sequence id present in header.')
if 'version' in self.header:
self.version = self.header['version']
- else:
+ elif self.version is None:
self.log.warning('No version present in header. Defaulting to zero (0).')
self.version = 0 | Issue #<I>: Update seq.py to more gracefully handle errors | NASA-AMMOS_AIT-Core | train | py |
17173009efb5f757a466b3b7aefd21ba803e251a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup
setup(
name='laws',
packages=['laws'],
- version='0.6.2',
+ version='0.6.3',
description='-ls- for AWS EC2 instances',
long_description='https://github.com/cyrillk/laws/blob/master/README.md',
author='Kirill Kulikov', | Version bumped to <I> | kikulikov_laws | train | py |
b148088436395fb64061d81954c673bf6467abed | diff --git a/src/datatable/main.js b/src/datatable/main.js
index <HASH>..<HASH> 100644
--- a/src/datatable/main.js
+++ b/src/datatable/main.js
@@ -209,6 +209,14 @@ class DataTable extends Relation {
}
/**
+ * Returns index and field details in an object where key is the field name.
+ * @return {Object} field definitions
+ */
+ getFieldMap () {
+ return this.fieldMap;
+ }
+
+ /**
* It helps to define the sorting order of the returned data.
* This is similar to the orderBy functionality of the database
* you have to pass the array of array [['columnName', 'sortType(asc|desc)']] and the
diff --git a/src/datatable/relation.js b/src/datatable/relation.js
index <HASH>..<HASH> 100644
--- a/src/datatable/relation.js
+++ b/src/datatable/relation.js
@@ -24,6 +24,13 @@ class Relation {
// This will create a new fieldStore with the fields
nameSpace = fieldStore.createNameSpace(fieldArr, name);
this.columnNameSpace = nameSpace;
+ this.fieldMap = schema.reduce((acc, fieldDef, i) => {
+ acc[fieldDef.name] = {
+ index: i,
+ def: fieldDef
+ };
+ return acc;
+ }, {});
// If data is provided create the default colIdentifier and rowDiffset
this.rowDiffset = `0-${normalizeData[0] ? (normalizeData[0].length - 1) : 0}`;
this.colIdentifier = (schema.map(_ => _.name)).join(); | FSB-<I>: Add field definitions | chartshq_datamodel | train | js,js |
460772aaa6c124b78e9ded0410faf537d13775b5 | diff --git a/src/main/java/com/zandero/rest/data/RouteDefinition.java b/src/main/java/com/zandero/rest/data/RouteDefinition.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/zandero/rest/data/RouteDefinition.java
+++ b/src/main/java/com/zandero/rest/data/RouteDefinition.java
@@ -588,8 +588,13 @@ public class RouteDefinition {
public boolean requestHasBody() {
- // TODO: fix ... DELETE also has no body
- return !(HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method));
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/
+ // also see:
+ // https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)
+ return HttpMethod.POST.equals(method) ||
+ HttpMethod.PUT.equals(method) ||
+ HttpMethod.PATCH.equals(method) ||
+ HttpMethod.TRACE.equals(method);
}
public boolean hasBodyParameter() { | Fixed request has body method according to specs | zandero_rest.vertx | train | java |
48763dbda572adf5030b796832e365bc2547252a | diff --git a/src/createRequest.js b/src/createRequest.js
index <HASH>..<HASH> 100644
--- a/src/createRequest.js
+++ b/src/createRequest.js
@@ -105,9 +105,11 @@ var parseFMResponse = function (fmresultset) {
*/
var remapFields = function (fields) {
var obj = {};
- fields.forEach(function (field) {
- obj[field.$.name] = field.data[0]
- });
+ if (fields) {
+ fields.forEach(function (field) {
+ obj[field.$.name] = field.data[0]
+ });
+ }
return obj
}; | Fixing remaping field function for avoiding error | geistinteractive_fms-js | train | js |
7354c94143d3e64379a8d4672c174bb7e1ac13d4 | diff --git a/packages/vaex-jupyter/vaex/jupyter/_version.py b/packages/vaex-jupyter/vaex/jupyter/_version.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-jupyter/vaex/jupyter/_version.py
+++ b/packages/vaex-jupyter/vaex/jupyter/_version.py
@@ -1,2 +1,2 @@
-__version_tuple__ = (0, 5, 2, "dev.0")
-__version__ = '0.5.2-dev.0'
+__version_tuple__ = (0, 5, 2)
+__version__ = '0.5.2'
diff --git a/packages/vaex-meta/setup.py b/packages/vaex-meta/setup.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-meta/setup.py
+++ b/packages/vaex-meta/setup.py
@@ -22,7 +22,7 @@ install_requires = [
'vaex-hdf5>=0.6.0,<0.7',
'vaex-astro>=0.7.0,<0.8',
'vaex-arrow>=0.5.0,<0.6',
- 'vaex-jupyter>=0.5.2-dev.0,<0.6',
+ 'vaex-jupyter>=0.5.2,<0.6',
'vaex-ml>=0.10.0,<0.11',
# vaex-graphql it not on conda-forge yet
] | Release <I> of vaex-jupyter | vaexio_vaex | train | py,py |
06af5becf5f462ede1a52b3197d3a84a9c47957d | diff --git a/doubles/proxy.py b/doubles/proxy.py
index <HASH>..<HASH> 100644
--- a/doubles/proxy.py
+++ b/doubles/proxy.py
@@ -22,6 +22,3 @@ class Proxy(object):
else:
method_double = self._method_doubles[method_name] = MethodDouble(method_name, self._obj)
return method_double
-
- def __repr__(self):
- return "<Proxy({!r})>".format(self._obj) | Remove unused repr for Proxy. | uber_doubles | train | py |
6a58d671d4cb39ba5ab1c7c2b31bcd600b5feb28 | diff --git a/unicum/server.py b/unicum/server.py
index <HASH>..<HASH> 100644
--- a/unicum/server.py
+++ b/unicum/server.py
@@ -111,6 +111,8 @@ class Session(object):
item = dict(zip(keys, values))
elif isinstance(item, list):
item = [_prepickle(i) for i in item]
+ elif isinstance(item, tuple):
+ item = (_prepickle(i) for i in item)
elif isinstance(item, (bool, int, long, float, str)):
pass
else: | tuples work in _prepickle in server.py | pbrisk_unicum | train | py |
ff4a0a325962f76f0067effaed0bf8b58ab471b2 | diff --git a/lib/metasploit_data_models/active_record_models/host.rb b/lib/metasploit_data_models/active_record_models/host.rb
index <HASH>..<HASH> 100755
--- a/lib/metasploit_data_models/active_record_models/host.rb
+++ b/lib/metasploit_data_models/active_record_models/host.rb
@@ -23,10 +23,11 @@ module MetasploitDataModels::ActiveRecordModels::Host
validates_presence_of :workspace
scope :alive, where({'hosts.state' => 'alive'})
- scope :search,
- lambda { |*args| where(
- [%w{address hosts.name os_name os_flavor os_sp mac purpose comments}.map { |c| "#{c} ILIKE ?" }.join(" OR ")] + ["%#{args[0]}%"] * 8)
- }
+ scope :search, lambda { |*args| {:conditions =>
+ [ %w{hosts.name os_name os_flavor os_sp mac purpose comments}.map{|c| "#{c} ILIKE ?"}.join(" OR ") ] + [ "%#{args[0]}%" ] * 7 }
+ }
+ scope :address_search, lambda { |*args| {:conditions =>
+ [ "address=?",args[0]]}}
scope :tag_search,
lambda { |*args| where("tags.name" => args[0]).includes(:tags) } | Attempting to fix issue with hosts search | rapid7_metasploit_data_models | train | rb |
7a08ed319806eb5d2c3d83b4496a11d37a51aec4 | diff --git a/src/Package.php b/src/Package.php
index <HASH>..<HASH> 100644
--- a/src/Package.php
+++ b/src/Package.php
@@ -65,7 +65,8 @@ trait Package
{
try {
$v = self::getPackageVendor();
- } catch (LogicException $vendorException) {}
+ } catch (LogicException $vendorException) {
+ }
try {
$p = self::getPackageName(); | Apply fixes from StyleCI (#5) | CupOfTea696_Package | train | php |
b34f6d22de643a84536c67e5cfb3dad174d49e94 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -83,7 +83,6 @@ function getManifest(server, callback) {
assert('COMMENT' in manifest, 'Comment expected in manifest');
assert('CACHE' in manifest, 'Cache expected in manifest');
assert('NETWORK' in manifest, 'Network section expected in manifest');
- assert.deepEqual(manifest['NETWORK'], ['*'], 'Network section doesn\'t hold expected value'); //TODO: pull this from opts
assert.deepEqual(manifest['CACHE'].slice().sort(), manifest['CACHE'], 'Cache entries should be soted');
callback(null, manifest);
@@ -188,14 +187,18 @@ describe('Check initial data', function() {
getManifest(server, function(err, manifest) {
if (err) {
done(err);
+ server.stop();
return;
}
try {
console.log('CACHE is ' + JSON.stringify(manifest['CACHE']));
- server.stop();
+ assert.deepEqual(manifest['NETWORK'], ['*'], 'Network section doesn\'t hold expected value'); //TODO: pull this from opts
+ assert.deepEqual(manifest['CACHE'], INITIAL_URLS, 'Cache section doesn\'t hold expected value(s)');
done();
} catch (err) {
done(err);
+ } finally {
+ server.stop();
}
});
}); | Make sure server gets stopped even in error cases. Assert that initial url list is as expected | isaacsimmons_cache-manifest-generator | train | js |
d5556d9edb6a3798a0de24cd8ec5b981b44f004f | diff --git a/src/Http/Requests/Frontarea/RegistrationRequest.php b/src/Http/Requests/Frontarea/RegistrationRequest.php
index <HASH>..<HASH> 100644
--- a/src/Http/Requests/Frontarea/RegistrationRequest.php
+++ b/src/Http/Requests/Frontarea/RegistrationRequest.php
@@ -5,14 +5,14 @@ declare(strict_types=1);
namespace Cortex\Tenants\Http\Requests\Frontarea;
use Illuminate\Foundation\Http\FormRequest;
-use Rinvex\Fort\Exceptions\GenericException;
+use Cortex\Foundation\Exceptions\GenericException;
class RegistrationRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
- * @throws \Rinvex\Fort\Exceptions\GenericException
+ * @throws \Cortex\Foundation\Exceptions\GenericException
*
* @return bool
*/ | Move GenericException to cortex/foundation from rinvex/fort | rinvex_cortex-tenants | train | php |
0edd5157fdb3e7f9eed10c4017f3497720171a54 | diff --git a/lib/fog/libvirt/compute.rb b/lib/fog/libvirt/compute.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/libvirt/compute.rb
+++ b/lib/fog/libvirt/compute.rb
@@ -46,10 +46,10 @@ module Fog
require 'libvirt'
begin
- if options[:libvirt_user] and options[:libvirt_password]
+ if options[:libvirt_username] and options[:libvirt_password]
@connection = ::Libvirt::open_auth(@uri.uri, [::Libvirt::CRED_AUTHNAME, ::Libvirt::CRED_PASSPHRASE]) do |cred|
if cred['type'] == ::Libvirt::CRED_AUTHNAME
- res = options[:libvirt_user]
+ res = options[:libvirt_username]
elsif cred["type"] == ::Libvirt::CRED_PASSPHRASE
res = options[:libvirt_password]
else | Made libvirt username param consistent with other providers libvirt_user -> libvirt_username | fog_fog | train | rb |
622fc3f6d1b3d7df25dfb9a414ad7a394b97d1b8 | diff --git a/src/LabelCollection.php b/src/LabelCollection.php
index <HASH>..<HASH> 100644
--- a/src/LabelCollection.php
+++ b/src/LabelCollection.php
@@ -138,14 +138,9 @@ class LabelCollection implements \Countable
*/
public function filter(callable $filterFunction)
{
- $filteredLabels = [];
- foreach ($this->labels as $label) {
- if ($filterFunction($label)) {
- $filteredLabels[] = $label;
- }
- }
-
- return new LabelCollection($filteredLabels);
+ return new LabelCollection(
+ array_filter($this->labels, $filterFunction)
+ );
}
/** | III-<I> Use array_filter inside the filter method of LabelCollection. | cultuurnet_udb3-php | train | php |
5073171308a2bcb2192833c797d5b1c4029cd8b8 | diff --git a/tools/diagnose.py b/tools/diagnose.py
index <HASH>..<HASH> 100644
--- a/tools/diagnose.py
+++ b/tools/diagnose.py
@@ -110,6 +110,8 @@ def check_mxnet():
print('Commit Hash :', ch)
except ImportError:
print('No MXNet installed.')
+ except FileNotFoundError:
+ print('Hashtag not found. Not installed from pre-built package.')
except Exception as e:
import traceback
if not isinstance(e, IOError): | fix diagnose if hashtag not found. (#<I>) | apache_incubator-mxnet | train | py |
f589bc18f386b47f9ff64ab4ae526cc4c2a935db | diff --git a/peri/fft.py b/peri/fft.py
index <HASH>..<HASH> 100644
--- a/peri/fft.py
+++ b/peri/fft.py
@@ -100,6 +100,15 @@ if hasfftw:
@atexit.register
def goodbye():
save_wisdom(conf.get_wisdom())
+
+ # need to provide a function which conditionally normalizes the result of
+ # an ifft because fftw does not norm while numpy does
+ def fftnorm(arr):
+ return arr * arr.size
+
else:
fftkwargs = {}
fft = np.fft
+
+ def fftnorm(arr):
+ return arr | fft: adding fftnorm function so that fftw and numpy normalization are equal | peri-source_peri | train | py |
19226d062a5b4c474d95c33a50a278f6b3246398 | diff --git a/src/Commands/BootpackCreatePackage.php b/src/Commands/BootpackCreatePackage.php
index <HASH>..<HASH> 100644
--- a/src/Commands/BootpackCreatePackage.php
+++ b/src/Commands/BootpackCreatePackage.php
@@ -185,8 +185,8 @@ class BootpackCreatePackage extends Command
$this->comment('Registering the service provider in the current laravel application...');
Helpers::strReplaceFile(
- 'ConsoleTVs\\Bootpack\\BootpackServiceProvider::class',
- "ConsoleTVs\\Bootpack\\BootpackServiceProvider::class,\n\t\t"
+ 'App\\Providers\\RouteServiceProvider::class,',
+ "App\\Providers\\RouteServiceProvider::class,\n\t\t"
. $package->namespace . "\\" . ucfirst($p_name) . 'ServiceProvider::class',
base_path('config/app.php')
); | Update BootpackCreatePackage.php | ConsoleTVs_Bootpack | train | php |
23c20ebd6d912fbed60824bfb15d6fabcbd255f1 | diff --git a/test/permissions.js b/test/permissions.js
index <HASH>..<HASH> 100644
--- a/test/permissions.js
+++ b/test/permissions.js
@@ -5,23 +5,21 @@ var access = require('../lib/middleware/access')
var assert = require('assertmessage')
var http = require('http')
-var sandbox
-beforeEach(function (done) {
- if (sandbox) {
- sandbox.restore()
- }
- sandbox = sinon.sandbox.create()
- done()
-})
-
-describe('permissions', function () {
+describe('Permissions', function () {
var noop = function () {}
var res = { send: noop }
+ var sandbox
+
+ before(function () {
+ sandbox = sinon.sandbox.create()
+ })
beforeEach(function () {
+ sandbox.restore()
this.mock = sandbox.mock(res)
- this.mock.expects('send').once()
- .withArgs(403, { msg: http.STATUS_CODES[403] })
+ this.mock.expects('send').once().withArgs(403, {
+ msg: http.STATUS_CODES[403]
+ })
})
describe('with access that returns', function () { | refactor(tests): permissions | florianholzapfel_express-restify-mongoose | train | js |
49051fe57006997596ea898182c41ad91de983a3 | diff --git a/zappa/zappa.py b/zappa/zappa.py
index <HASH>..<HASH> 100644
--- a/zappa/zappa.py
+++ b/zappa/zappa.py
@@ -749,7 +749,7 @@ class Zappa(object):
integration.Credentials = credentials
integration.IntegrationHttpMethod = 'POST'
integration.IntegrationResponses = []
- # integration.PassthroughBehavior = 'NEVER'
+ integration.PassthroughBehavior = 'NEVER'
# integration.RequestParameters = {}
integration.RequestTemplates = content_mapping_templates
integration.Type = 'AWS'
@@ -1057,7 +1057,13 @@ class Zappa(object):
# Something has gone wrong.
# Is raising enough? Should we also remove the Lambda function?
- if result['Stacks'][0]['StackStatus'] == 'ROLLBACK_IN_PROGRESS':
+ if result['Stacks'][0]['StackStatus'] in [
+ 'DELETE_COMPLETE',
+ 'DELETE_IN_PROGRESS',
+ 'ROLLBACK_IN_PROGRESS',
+ 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS',
+ 'UPDATE_ROLLBACK_COMPLETE'
+ ]:
raise EnvironmentError("Stack creation failed. Please check your CloudFormation console. You may also need to `undeploy`.")
count = 0 | put passthrough back, add more stack failure cases | Miserlou_Zappa | train | py |
e8e4e72639eb6ab47394e80a4c6f4eed003ee13b | diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -150,7 +150,7 @@ module ActiveRecord
BLACKLISTED_CLASS_METHODS.include?(method_name.to_s) || class_method_defined_within?(method_name, Base)
end
- def class_method_defined_within?(name, klass, superklass = klass.superclass) # :nodoc
+ def class_method_defined_within?(name, klass, superklass = klass.superclass) # :nodoc:
if klass.respond_to?(name, true)
if superklass.respond_to?(name, true)
klass.method(name).owner != superklass.method(name).owner | Fixed syntax error in RDoc directive | rails_rails | train | rb |
7b7574210ef0d1e25b19f50d782d65dd471d22dd | diff --git a/core/src/main/java/hudson/tasks/MailSender.java b/core/src/main/java/hudson/tasks/MailSender.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/tasks/MailSender.java
+++ b/core/src/main/java/hudson/tasks/MailSender.java
@@ -363,5 +363,5 @@ public class MailSender {
public static boolean debug = false;
- private static final int MAX_LOG_LINES = 250;
+ private static final int MAX_LOG_LINES = Integer.getInteger(MailSender.class.getName()+".maxLogLines",250);
} | allowed this to be configured via a system property. Interim solution until we really fix the e-mail notification.
git-svn-id: <URL> | jenkinsci_jenkins | train | java |
1b26e74ff8633ad03bd83e03a1ad47859bd1e283 | diff --git a/src/Persistence/DbRepositoryBase.php b/src/Persistence/DbRepositoryBase.php
index <HASH>..<HASH> 100644
--- a/src/Persistence/DbRepositoryBase.php
+++ b/src/Persistence/DbRepositoryBase.php
@@ -145,14 +145,9 @@ abstract class DbRepositoryBase implements IObjectSetWithLoadCriteriaSupport
$this->validateHasRequiredColumns($sql, reset($rows));
- $table = $this->mapper->getPrimaryTable();
- $rowObjects = [];
+ $rowSet = $this->connection->getPlatform()->mapResultSetToPhpForm($this->mapper->getSelect()->getResultSetTableStructure(), $rows);
- foreach ($rows as $row) {
- $rowObjects[] = new Row($table, $row);
- }
-
- return $this->mapper->loadAll($this->loadingContext, $rowObjects);
+ return $this->mapper->loadAll($this->loadingContext, $rowSet->getRows());
}
protected function replaceQueryPlaceholders(string $sql) | Fix issue with loading objects from custom SQL query | dms-org_core | train | php |
32a6f12ee43946200962790931f1b52a3159ee51 | diff --git a/lib/buildpack/packager/package.rb b/lib/buildpack/packager/package.rb
index <HASH>..<HASH> 100644
--- a/lib/buildpack/packager/package.rb
+++ b/lib/buildpack/packager/package.rb
@@ -13,7 +13,7 @@ module Buildpack
def copy_buildpack_to_temp_dir(temp_dir)
FileUtils.cp_r(File.join(options[:root_dir], '.'), temp_dir)
- a_manifest = YAML.load_file(options[:manifest_path])
+ a_manifest = YAML.load_file(options[:manifest_path]).with_indifferent_access
unless options[:stack] == :any_stack
a_manifest = edit_manifest_for_stack(a_manifest)
end | Make symbols and strings both work.
Unclear how to predict which way a given manifest will get read.
[#<I>] | cloudfoundry_buildpack-packager | train | rb |
39b7d98286c6fbce0ba474cddae2d1a48d500fd9 | diff --git a/jquery.i18n.properties.js b/jquery.i18n.properties.js
index <HASH>..<HASH> 100644
--- a/jquery.i18n.properties.js
+++ b/jquery.i18n.properties.js
@@ -254,7 +254,7 @@
/** Language reported by browser, normalized code */
$.i18n.browserLang = function () {
- return normaliseLanguageCode(navigator.language /* Mozilla */ || navigator.userLanguage /* IE */);
+ return normaliseLanguageCode(navigator.languages[0] /* Mozilla 32+ */ || navigator.language /* Mozilla */ || navigator.userLanguage /* IE */);
}; | Issue <I>: Language detection should use navigator.languages when able
In Chrome / Firefox <I>+ the list of preferred languages is set in
the navigator.languages array, where the primary preferred language is
placed in index 0.
<URL> | jquery-i18n-properties_jquery-i18n-properties | train | js |
4bda41be1658be7672eb200b3ac9116883b275f8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,8 +3,17 @@ import os
import sys
from setuptools import setup, Extension, find_packages
-from Cython.Build import cythonize
+try:
+ from Cython.Build import cythonize
+except ImportError:
+ # note: This is only to cheat the RTD builds from single requirement file
+ # with -e flag. This package will be either distributed with C
+ # sources or as properly built wheels from Travis CI and Appveyor.
+ if os.environ.get('READTHEDOCS', None) == 'True':
+ cythonize = lambda x: x
+ else:
+ raise
try:
from pypandoc import convert | docs: try to hackaround the installation issues on RTD | swistakm_pyimgui | train | py |
637abcba241a69a1d9a8acf240855a6ed158cb64 | diff --git a/mock/mock.py b/mock/mock.py
index <HASH>..<HASH> 100644
--- a/mock/mock.py
+++ b/mock/mock.py
@@ -357,7 +357,11 @@ class _SentinelObject(object):
return 'sentinel.%s' % self.name
def __reduce__(self):
- return 'sentinel.%s' % self.name
+ return _unpickle_sentinel, (self.name, )
+
+
+def _unpickle_sentinel(name):
+ return getattr(sentinel, name)
class _Sentinel(object): | Serhiy's approach didn't work on Python 2 or <I> | testing-cabal_mock | train | py |
dfcfcf2a6437a3c16219781ca07028df3c786d05 | diff --git a/lib/rules/no-multiple-empty-lines.js b/lib/rules/no-multiple-empty-lines.js
index <HASH>..<HASH> 100644
--- a/lib/rules/no-multiple-empty-lines.js
+++ b/lib/rules/no-multiple-empty-lines.js
@@ -31,7 +31,7 @@ module.exports = function(context) {
lastLocation,
blankCounter = 0,
location,
- trimmedLines = lines.map(function(str){
+ trimmedLines = lines.map(function(str) {
return str.trim();
}); | Fix: resolve linting issue in (fixes #<I>) | eslint_eslint | train | js |
b60d9d83695ef26e1fb3395707869b6f717851c3 | diff --git a/s2reader/s2reader.py b/s2reader/s2reader.py
index <HASH>..<HASH> 100644
--- a/s2reader/s2reader.py
+++ b/s2reader/s2reader.py
@@ -49,6 +49,12 @@ class SentinelDataSet(object):
if self.is_zip:
self._zipfile = zipfile.ZipFile(self.path, 'r')
self._zip_root = os.path.basename(filename)
+ if not self._zip_root in self._zipfile.namelist():
+ self._zip_root = os.path.basename(filename) + ".SAFE/"
+ try:
+ assert self._zip_root in self._zipfile.namelist()
+ except:
+ raise IOError("unknown zipfile structure")
self.manifest_safe_path = os.path.join(
self._zip_root, "manifest.safe")
else: | handling different ZIP structure, if SAFE folder is root | ungarj_s2reader | train | py |
e19c75819c85ff73318a01b2d7fda0acb625bece | diff --git a/dcf/creditcurve.py b/dcf/creditcurve.py
index <HASH>..<HASH> 100644
--- a/dcf/creditcurve.py
+++ b/dcf/creditcurve.py
@@ -17,9 +17,24 @@ from interpolation import constant, linear, loglinear, logconstant
class CreditCurve(RateCurve):
""" generic curve for default probabilities (under construction) """
-
_forward_tenor = '1Y'
+ def cast(self, cast_type, **kwargs):
+ old_domain = kwargs.get('domain', self.domain)
+
+ if issubclass(cast_type, (SurvivalProbabilityCurve,)):
+ domain = kwargs.get('domain', self.domain)
+ origin = kwargs.get('origin', self.origin)
+ new_domain = list(domain) + [origin + '1d']
+ kwargs['domain'] = sorted(set(new_domain))
+
+ if issubclass(cast_type, (SurvivalProbabilityCurve,)):
+ domain = kwargs.get('domain', self.domain)
+ new_domain = list(domain) + [max(domain) + '1d']
+ kwargs['domain'] = sorted(set(new_domain))
+
+ return super(CreditCurve, self).cast(cast_type, **kwargs)
+
def get_survival_prob(self, start, stop=None): # aka get_discount_factor
if stop is None:
return self.get_survival_prob(self.origin, start) | adding credit curves + unit tests + cast | pbrisk_dcf | train | py |
de3f4e931bddc66205b11ead680515e525d04ec2 | diff --git a/tldap/backend/base.py b/tldap/backend/base.py
index <HASH>..<HASH> 100644
--- a/tldap/backend/base.py
+++ b/tldap/backend/base.py
@@ -165,6 +165,9 @@ class LDAPbase(object):
# Loop over list of search results
for result_item in result_list:
+ # skip searchResRef for now
+ if result_item['type'] != "searchResEntry":
+ continue
dn = result_item['dn']
attributes = result_item['raw_attributes']
# did we already retrieve this from cache? | Skip searchResRef results.
We don't support referrals. Yet.
Change-Id: Ieb4a<I>bb<I>b9ae4c5e<I>fbf9d<I>b<I> | Karaage-Cluster_python-tldap | train | py |
61e74d786d55159898776ae565a9f67a2a487f17 | diff --git a/lib/dataflow/nodes/compute_node.rb b/lib/dataflow/nodes/compute_node.rb
index <HASH>..<HASH> 100644
--- a/lib/dataflow/nodes/compute_node.rb
+++ b/lib/dataflow/nodes/compute_node.rb
@@ -221,6 +221,12 @@ module Dataflow
on_computing_started
start_time = Time.now
+ if data_node.present? && clear_data_on_compute != data_node.use_double_buffering
+ # make sure the data node has a compatible settings
+ data_node.use_double_buffering = clear_data_on_compute
+ data_node.save
+ end
+
# update this node's schema with the necessary fields
data_node&.update_schema(required_schema) | Force the data node to use double buffering when necessary. | Phybbit_dataflow-rb | train | rb |
0adc7003491f9fc0c3bf27a62a70602f18b2a955 | diff --git a/extensions/helper/Number.php b/extensions/helper/Number.php
index <HASH>..<HASH> 100644
--- a/extensions/helper/Number.php
+++ b/extensions/helper/Number.php
@@ -12,7 +12,8 @@
namespace cms_core\extensions\helper;
-use lihtium\core\Environment;
+use lithium\core\Environment;
+use NumberFormatter;
class Number extends \lithium\template\Helper { | Add missing deps to number helper. | bseries_cms_core | train | php |
91f0f99ca316d51e381ed860236232ed8fa81f49 | diff --git a/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java b/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
index <HASH>..<HASH> 100644
--- a/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
+++ b/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
@@ -161,7 +161,7 @@ public final class UnderFileSystemBlockReader implements BlockReader {
}
byte[] data = new byte[(int) bytesToRead];
int bytesRead = 0;
- Preconditions.checkNotNull(mUnderFileSystemInputStream);
+ Preconditions.checkNotNull(mUnderFileSystemInputStream, "mUnderFileSystemInputStream");
while (bytesRead < bytesToRead) {
int read;
try { | Passing variable name to Preconditions.checkNotNull (#<I>) | Alluxio_alluxio | train | java |
99dd818edcfae3fc36e3ce4ae613ac6636115c92 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -45,14 +45,14 @@ extras = {
"ml": ["numpy>=1.16,<1.17", "torch==1.0.0"],
"ner": ["sklearn-crfsuite>=0.3.6"],
"ssg": ["ssg>=0.0.6"],
- "thai2fit": ["emoji==0.5.1", "gensim==3.0", "numpy>=1.16,<1.17"],
+ "thai2fit": ["emoji==0.5.1", "gensim==3.1.0", "numpy>=1.16,<1.17"],
"thai2rom": ["torch==1.0.0", "numpy>=1.16,<1.17"],
"full": [
"artagger>=0.1.0.3",
"attacut>=1.0.4",
"emoji==0.5.1",
"epitran>=1.1",
- "gensim==3.0",
+ "gensim==3.1.0",
"numpy>=1.16,<1.17",
"pandas>=0.24,<0.25",
"pyicu>=2.3", | Move gensim up to <I> | PyThaiNLP_pythainlp | train | py |
4632e6dda27e13439a029a80035448855b580e98 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -22,6 +22,8 @@ import sys
sys.path.insert(0, os.path.abspath('..'))
+import pypika
+
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
@@ -35,7 +37,7 @@ extensions = [
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
- 'sphinx.ext.pngmath',
+ 'sphinx.ext.ingmath',
'sphinx.ext.viewcode',
]
@@ -63,9 +65,9 @@ author = 'Timothy Heys'
# built documents.
#
# The short X.Y version.
-version = '0.0.1'
+version = pypika.__version__
# The full version, including alpha/beta/rc tags.
-release = '0.0.1'
+release = pypika.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. | Updated pypika version in docs | kayak_pypika | train | py |
4aa7ec02a0898dc3a430eeddd323237477f22dbb | diff --git a/src/animations/animatedImage/index.js b/src/animations/animatedImage/index.js
index <HASH>..<HASH> 100644
--- a/src/animations/animatedImage/index.js
+++ b/src/animations/animatedImage/index.js
@@ -90,12 +90,13 @@ class AnimatedImage extends BaseComponent {
render() {
const {containerStyle, loader, ...others} = this.props;
return (
- <View testID={this.testID} style={containerStyle}>
+ <View style={containerStyle}>
<UIAnimatedImage
{...others}
style={[{opacity: this.state.opacity}, this.style]}
source={this.source}
onLoad={() => this.onLoad()}
+ testID={this.testID}
/>
{this.state.isLoading && loader && (
<View style={{...StyleSheet.absoluteFillObject, justifyContent: 'center'}}> | Fixed duplicate testID in AnimatedImage passed by Avatar (#<I>) | wix_react-native-ui-lib | train | js |
2e379d55cad16f086de862bedca2428efdbaa21a | diff --git a/src/defaults.js b/src/defaults.js
index <HASH>..<HASH> 100644
--- a/src/defaults.js
+++ b/src/defaults.js
@@ -44,7 +44,7 @@ module.exports = async (argv = {}) => {
const opts = mixinDeep(
{ project: { name, description: desc } },
defaults,
- { locals: await latestDeps() },
+ { locals: await latestDeps(argv.pkg) },
options,
); | fix: allow passing settings.pkg | tunnckoCoreLabs_charlike | train | js |
356c0e4ee096c74a46aeaa302d41a8b6309608d7 | diff --git a/ELiDE/ELiDE/calendar/__init__.py b/ELiDE/ELiDE/calendar/__init__.py
index <HASH>..<HASH> 100644
--- a/ELiDE/ELiDE/calendar/__init__.py
+++ b/ELiDE/ELiDE/calendar/__init__.py
@@ -43,7 +43,6 @@ class CalendarDropMenuButton(CalendarWidget, Button):
self.modalview.add_widget(container)
container.size = container.minimum_size
-
def on_options(self, *args):
if not self.modalview:
Clock.schedule_once(self.on_options, 0) | Delete extraneous whitespace | LogicalDash_LiSE | train | py |
4233bc9e72ba2c9d4134b428da671464856767a4 | diff --git a/failure.go b/failure.go
index <HASH>..<HASH> 100644
--- a/failure.go
+++ b/failure.go
@@ -38,13 +38,18 @@ type FailureRecord struct {
Error string
}
-// Record a failure for the currently running test. Most users will want to use
-// ExpectThat, ExpectEq, etc. instead of this function. Those that do want to
-// report arbitrary errors will probably be satisfied with AddFailure, which is
-// easier to use.
+// Record a failure for the currently running test (and continue running it).
+// Most users will want to use ExpectThat, ExpectEq, etc. instead of this
+// function. Those that do want to report arbitrary errors will probably be
+// satisfied with AddFailure, which is easier to use.
func AddFailureRecord(r FailureRecord)
// Call AddFailureRecord with a record whose file name and line number come
// from the caller of this function, and whose error string is created by
// calling fmt.Sprintf using the arguments to this function.
func AddFailure(format string, a ...interface{})
+
+// Immediately stop executing the running test, causing it to fail with the
+// failures previously recorded. Behavior is undefined if no failures have been
+// recorded.
+func AbortTest() | Declared AbortTest too. | jacobsa_ogletest | train | go |
a9884d6dc857e0b5ff2e808be2a56eb7c0d53a54 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1,5 +1,10 @@
-var Strategy = require('./strategy');
+'use strict';
+
+var Strategy = require('./strategy'),
+ ExtractJwt = require('./extract_jwt.js');
+
module.exports = {
- Strategy: Strategy
+ Strategy: Strategy,
+ ExtractJwt : ExtractJwt
}; | Export the jwt extraction functions. | und3fined_passport-auth-jwt | train | js |
7e544de7de5b97a3e51d80a58d9a23de18d0422e | diff --git a/nomenclate/ui/token_widget.py b/nomenclate/ui/token_widget.py
index <HASH>..<HASH> 100644
--- a/nomenclate/ui/token_widget.py
+++ b/nomenclate/ui/token_widget.py
@@ -12,14 +12,11 @@ print(QtWidgets.__file__)
class CustomCompleter(QtWidgets.QCompleter):
def __init__(self, options, parent=None):
self.options = QtCore.QStringListModel(options)
- super(CustomCompleter, self).__init__(parent=parent)
+ super(CustomCompleter, self).__init__(self.options, parent)
self.popup().setStyleSheet(str('QListView{ color: rgb(200, 200, 200); '
- 'background-color: rgba(200, 200, 200, .1);'
- '}'
- 'QListView::item:selected{ '
- 'background-color: rgba(255, 0, 0); }'))
- # always show all (filtered) completions
- self.setCompletionMode(self.PopupCompletion)
+ 'background-color: rgba(200, 200, 200, .4);'
+ '}'))
+ self.setCompletionMode(self.UnfilteredPopupCompletion)
class TokenLineEdit(QtWidgets.QLineEdit): | Just left Completer showing unfiltered results and moving on. | AndresMWeber_Nomenclate | train | py |
31d86bc07f2e64790a5cc2249ca87f952e36f7c3 | diff --git a/danceschool/core/forms.py b/danceschool/core/forms.py
index <HASH>..<HASH> 100644
--- a/danceschool/core/forms.py
+++ b/danceschool/core/forms.py
@@ -75,7 +75,7 @@ class CheckboxSelectMultipleWithDisabled(CheckboxSelectMultiple):
To make an option part of a separate "override" choice set, add a dictionary key {'override': True}
"""
- def render(self, name, value, attrs=None, choices=()):
+ def render(self, name, value, attrs=None, choices=(), renderer=None):
if value is None:
value = []
has_id = attrs and 'id' in attrs | Added renderer option for Django <I>+ compatibility | django-danceschool_django-danceschool | train | py |
88cee059aedd9adc7d36902b41e0d8a476e3efe0 | diff --git a/api/python/quilt3/api.py b/api/python/quilt3/api.py
index <HASH>..<HASH> 100644
--- a/api/python/quilt3/api.py
+++ b/api/python/quilt3/api.py
@@ -25,7 +25,7 @@ def copy(src, dest):
-ApiTelemetry("api.delete_package")
+@ApiTelemetry("api.delete_package")
def delete_package(name, registry=None, top_hash=None):
"""
Delete a package. Deletes only the manifest entries and not the underlying files. | Fixed missing @ for decorator (#<I>) | quiltdata_quilt | train | py |
32e0d8697628f148ef515f0319dbdaeb6080764a | diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Controller/Component/SecurityComponent.php
+++ b/lib/Cake/Controller/Component/SecurityComponent.php
@@ -16,6 +16,8 @@
* @since CakePHP(tm) v 0.10.8.2156
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('Component', 'Controller');
App::uses('String', 'Utility');
App::uses('Security', 'Utility');
diff --git a/lib/Cake/tests/cases/libs/controller/components/security.test.php b/lib/Cake/tests/cases/libs/controller/components/security.test.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/tests/cases/libs/controller/components/security.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/security.test.php
@@ -16,8 +16,9 @@
* @since CakePHP(tm) v 1.2.0.5435
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('SecurityComponent', 'Controller/Component');
App::uses('Controller', 'Controller');
-App::uses('SecurityComponent', 'Component');
/**
* TestSecurityComponent | Fixing sSecurity component tests | cakephp_cakephp | train | php,php |
24499f20e5d7061e2e686c873f9f4edb8f0f7bd8 | diff --git a/src/main/java/com/simpligility/maven/plugins/android/phase08preparepackage/DexMojo.java b/src/main/java/com/simpligility/maven/plugins/android/phase08preparepackage/DexMojo.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/simpligility/maven/plugins/android/phase08preparepackage/DexMojo.java
+++ b/src/main/java/com/simpligility/maven/plugins/android/phase08preparepackage/DexMojo.java
@@ -634,7 +634,7 @@ public class DexMojo extends AbstractAndroidMojo
Set< File> inputFiles = getDexInputFiles();
StringBuilder sb = new StringBuilder();
- sb.append( '"' ).append( StringUtils.join( inputFiles, File.pathSeparatorChar ) ).append( '"' );
+ sb.append( StringUtils.join( inputFiles, File.pathSeparatorChar ) );
commands.add( sb.toString() );
String executable = getAndroidSdk().getMainDexClasses().getAbsolutePath(); | Fix quotes problem with dex and multidex
- see <URL> | simpligility_android-maven-plugin | train | java |
1e4ba6a01db813714e4ba649d14da66d2d1f9473 | diff --git a/lib/graphql/client/hash_with_indifferent_access.rb b/lib/graphql/client/hash_with_indifferent_access.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/client/hash_with_indifferent_access.rb
+++ b/lib/graphql/client/hash_with_indifferent_access.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
require "active_support/inflector"
+require "forwardable"
module GraphQL
class Client | fix bug - missing require forwardable | github_graphql-client | train | rb |
a7d1608903825a4c2d781e5f8f709f26ed1bad03 | diff --git a/tweepy/cursor.py b/tweepy/cursor.py
index <HASH>..<HASH> 100644
--- a/tweepy/cursor.py
+++ b/tweepy/cursor.py
@@ -180,7 +180,7 @@ class PageIterator(BaseIterator):
def __init__(self, method, *args, **kwargs):
BaseIterator.__init__(self, method, *args, **kwargs)
- self.current_page = 0
+ self.current_page = 1
def next(self):
if self.limit > 0: | Start on page 1 for PageIterator | tweepy_tweepy | train | py |
344fc525e0952be4621aad5777088c18844f3edb | diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js
index <HASH>..<HASH> 100644
--- a/lib/model/txproposal.js
+++ b/lib/model/txproposal.js
@@ -169,6 +169,25 @@ TxProposal.prototype.getRawTx = function() {
return t.uncheckedSerialize();
};
+TxProposal.prototype.estimateFee = function(walletN) {
+ // Note: found empirically based on all multisig P2SH inputs and within m & n allowed limits.
+ var safetyMargin = 0.05;
+
+ var walletM = this.requiredSignatures;
+
+ var overhead = 4 + 4 + 9 + 9;
+ var inputSize = walletM * 72 + walletN * 36 + 44;
+ var outputSize = 34;
+ var nbInputs = this.inputs.length;
+ var nbOutputs = (_.isArray(this.outputs) ? this.outputs.length : 1) + 1;
+
+ var size = overhead + inputSize * nbInputs + outputSize * nbOutputs;
+
+ var fee = this.feePerKb * (size * (1 + safetyMargin)) / 1000;
+
+ // Round up to nearest bit
+ this.fee = parseInt((Math.ceil(fee / 100) * 100).toFixed(0));
+};
/**
* getTotalAmount | add fee estimation method to txp | bitpay_bitcore-wallet-service | train | js |
e805eff75bdc3b6f6c20e17ea7b226f8ad7afbbc | diff --git a/lib/moodle2cc/canvas/question.rb b/lib/moodle2cc/canvas/question.rb
index <HASH>..<HASH> 100644
--- a/lib/moodle2cc/canvas/question.rb
+++ b/lib/moodle2cc/canvas/question.rb
@@ -115,7 +115,7 @@ module Moodle2CC::Canvas
material = question.text
material = question.content || '' if material.nil?
- material.gsub!(/\{(.*?)\}/, '[\1]')
+ material = material.gsub(/\{(.*?)\}/, '[\1]')
material = RDiscount.new(material).to_html if question.format == 4 # markdown
@material = material | Don't modify question text in place | instructure_moodle2cc | train | rb |
97f69163a65dcf5dfa557e7114e857f5ef03bc8c | diff --git a/python/test/bigdl/dlframes/test_dl_image_transformer.py b/python/test/bigdl/dlframes/test_dl_image_transformer.py
index <HASH>..<HASH> 100644
--- a/python/test/bigdl/dlframes/test_dl_image_transformer.py
+++ b/python/test/bigdl/dlframes/test_dl_image_transformer.py
@@ -49,7 +49,7 @@ class TestDLImageTransformer():
# test, and withhold the support for Spark 1.5, until the unit test failure reason
# is clarified.
- if not self.sc.version.startswith("1.5"):
+ if not self.sc.version.startswith("1.5" and "3.0"):
image_frame = DLImageReader.readImages(self.image_path, self.sc)
transformer = DLImageTransformer(
Pipeline([Resize(256, 256), CenterCrop(224, 224), | [WIP] spark <I> (#<I>)
* spark <I> | intel-analytics_BigDL | train | py |
2e6a49ace961d2fb9bfeba896a328f5ffb7a29d7 | diff --git a/go/libkb/secret_store_file.go b/go/libkb/secret_store_file.go
index <HASH>..<HASH> 100644
--- a/go/libkb/secret_store_file.go
+++ b/go/libkb/secret_store_file.go
@@ -8,6 +8,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "runtime"
)
var ErrSecretForUserNotFound = NotFoundError{Msg: "No secret found for user"}
@@ -40,8 +41,11 @@ func (s *SecretStoreFile) StoreSecret(username NormalizedUsername, secret []byte
if err != nil {
return err
}
- if err := f.Chmod(0600); err != nil {
- return err
+ if runtime.GOOS != "windows" {
+ // os.Fchmod not supported on windows
+ if err := f.Chmod(0600); err != nil {
+ return err
+ }
}
if _, err := f.Write(secret); err != nil {
return err | Don't run chmod on file ptr in windows. | keybase_client | train | go |
3fcc9fb43800d68057b49e919b4ab39a733d07e8 | diff --git a/lib/transports/polling-jsonp.js b/lib/transports/polling-jsonp.js
index <HASH>..<HASH> 100644
--- a/lib/transports/polling-jsonp.js
+++ b/lib/transports/polling-jsonp.js
@@ -67,6 +67,13 @@ function JSONPPolling (opts) {
// append to query string
this.query.j = this.index;
+
+ // prevent spurious errors from being emitted when the window is unloaded
+ if (global.document && global.addEventListener) {
+ global.addEventListener('beforeunload', function () {
+ if (self.script) self.script.onerror = empty;
+ });
+ }
}
/**
@@ -82,7 +89,7 @@ util.inherits(JSONPPolling, Polling);
JSONPPolling.prototype.supportsBinary = false;
/**
- * Closes the socket
+ * Closes the socket.
*
* @api private
*/
@@ -108,7 +115,7 @@ JSONPPolling.prototype.doClose = function () {
*/
JSONPPolling.prototype.doPoll = function () {
- var self = this;
+ var self = this;
var script = document.createElement('script');
if (this.script) {
@@ -126,7 +133,6 @@ JSONPPolling.prototype.doPoll = function () {
insertAt.parentNode.insertBefore(script, insertAt);
this.script = script;
-
if (util.ua.gecko) {
setTimeout(function () {
var iframe = document.createElement('iframe'); | polling-jsonp: prevent spurious errors from being emitted when the window is unloaded | socketio_engine.io-client | train | js |
31f28f53dcdd937a96c131f5f097bfc3e5730d1b | diff --git a/pantsbuild_migration.py b/pantsbuild_migration.py
index <HASH>..<HASH> 100644
--- a/pantsbuild_migration.py
+++ b/pantsbuild_migration.py
@@ -257,7 +257,7 @@ def handle_path(path):
print('PROCESSING: %s' % path)
srcfile = BuildFile(path)
srcfile.process()
- elif path.endswith('.rst') or path.endswith('.sh') or path.endswith('pants.bootstrap') or path.endswith('taskdev.asc'):
+ elif path.endswith('.rst') or path.endswith('.sh') or path.endswith('pants.bootstrap'):
print('PROCESSING: %s' % path)
with open(path, 'r') as infile:
content = infile.read() | Don't try to edit the asc file.
(sapling split of <I>ef3ca<I>cee<I>e9dcaefeb7d1dd3ccd<I>ed5) | pantsbuild_pants | train | py |
91a3939bc1170edc4807bf206021bd240bdf0cc5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ from setuptools import setup
if TkVersion <= 8.5:
- message = "This version of ttkthemes does not support Tk 8.5 and earlier. Please install an earlier version."
+ message = "This version of ttkthemes does not support Tk 8.5 and earlier. Please install a later version."
raise RuntimeError(message) | Fix RuntimeError message upon installation with Tk <I> or earlier (#<I>) | RedFantom_ttkthemes | train | py |
5138a948a263e620de8f662fcd7cebd0e38ffbb3 | diff --git a/DependencyInjection/Compiler/AddDashboardWidgetsPass.php b/DependencyInjection/Compiler/AddDashboardWidgetsPass.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Compiler/AddDashboardWidgetsPass.php
+++ b/DependencyInjection/Compiler/AddDashboardWidgetsPass.php
@@ -25,17 +25,12 @@ class AddDashboardWidgetsPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container): void
{
- $ids = $container->findTaggedServiceIds('darvin_admin.dashboard_widget');
-
- if (empty($ids)) {
- return;
- }
+ $blacklist = $container->getParameter('darvin_admin.dashboard.blacklist');
+ $dashboard = $container->getDefinition('darvin_admin.dashboard');
+ $ids = $container->findTaggedServiceIds('darvin_admin.dashboard_widget');
(new TaggedServiceIdsSorter())->sort($ids);
- $dashboard = $container->getDefinition('darvin_admin.dashboard');
- $blacklist = $container->getParameter('darvin_admin.dashboard.blacklist');
-
foreach (array_keys($ids) as $id) {
if (!in_array($id, $blacklist)) {
$dashboard->addMethodCall('addWidget', [new Reference($id)]); | Simplify add dashboard widgets compiler pass. | DarvinStudio_DarvinAdminBundle | train | php |
e81bd5a7d092a5a1bbaf1ba6dc2287a9f6b9a130 | diff --git a/estnltk/estnltk/taggers/system/dict_taggers/phrase_tagger.py b/estnltk/estnltk/taggers/system/dict_taggers/phrase_tagger.py
index <HASH>..<HASH> 100644
--- a/estnltk/estnltk/taggers/system/dict_taggers/phrase_tagger.py
+++ b/estnltk/estnltk/taggers/system/dict_taggers/phrase_tagger.py
@@ -140,8 +140,8 @@ class PhraseTagger(Tagger):
for s in input_layer[i:i + len(tail) + 1])
span = EnvelopingSpan(base_span=base_span, layer=layer)
for record in self.vocabulary[phrase]:
- print(record)
- print(output_attributes)
+ #print(record)
+ #print(output_attributes)
annotation = Annotation(span, **{attr: record[attr]
for attr in output_attributes})
is_valid = self.decorator(span, annotation) | Removed printing from PhraseTaggr | estnltk_estnltk | train | py |
e4c738ad4fecd02986f4fce008b9216af8d6f328 | diff --git a/yalla-core.js b/yalla-core.js
index <HASH>..<HASH> 100644
--- a/yalla-core.js
+++ b/yalla-core.js
@@ -222,13 +222,12 @@ var yalla = (function () {
framework.getParentComponent = function(node){
var _node = node;
- while(_node.parentNode){
- var _parentNode = _node.parentNode;
- if('element' in _parentNode.attributes || _parentNode.nodeName == 'BODY'){
- return _parentNode;
+ do{
+ if('element' in _node.attributes || _node.nodeName == 'BODY'){
+ return _node;
}
_node = _node.parentNode;
- }
+ }while(_node)
return null;
}; | Enrich this object in .trigger. Todo for .bind and expression | yallajs_yalla | train | js |
251c47665253f4acfe1b6df62f8b8e75ef349823 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorClass.java b/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorClass.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorClass.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorClass.java
@@ -192,6 +192,10 @@ public class ORecordIteratorClass<REC extends ORecordInternal<?>> extends ORecor
current.clusterPosition = firstClusterPosition - 1;
}
+ record = getTransactionEntry();
+ if (record != null)
+ return (REC) record;
+
throw new NoSuchElementException();
} | Fixed bug on iterating class records inside a transaction | orientechnologies_orientdb | train | java |
e6ffd52e7225fdce02bb6f419aab3ece5e3f901f | diff --git a/polyaxon/polypod/notebook.py b/polyaxon/polypod/notebook.py
index <HASH>..<HASH> 100644
--- a/polyaxon/polypod/notebook.py
+++ b/polyaxon/polypod/notebook.py
@@ -130,7 +130,7 @@ class NotebookSpawner(ProjectJobSpawner):
"--port={port} "
"--ip=0.0.0.0 "
"--allow-root "
- "--NotebookApp.allow_origin='*' "
+ "--NotebookApp.allow_origin=* "
"--NotebookApp.token={token} "
"--NotebookApp.trust_xheaders=True "
"--NotebookApp.base_url={base_url} " | Remove quote around `allow_origin=*` | polyaxon_polyaxon | train | py |
8fedc0d9e917ca52d199f3940e10aa6b8a31d977 | diff --git a/src/Hint/HintContent.js b/src/Hint/HintContent.js
index <HASH>..<HASH> 100644
--- a/src/Hint/HintContent.js
+++ b/src/Hint/HintContent.js
@@ -50,7 +50,7 @@ const styles = theme => ({
position: 'absolute'
},
left: {
- left: -15,
+ left: -theme.hint.paddings.right,
paddingLeft: theme.hint.paddings.left,
paddingRight: theme.hint.paddings.right,
'& $icon': {
@@ -58,7 +58,7 @@ const styles = theme => ({
}
},
right: {
- left: 15,
+ left: theme.hint.paddings.right,
paddingLeft: theme.hint.paddings.right,
paddingRight: theme.hint.paddings.left,
'& $icon': { | fix: added hint container left and right position | rambler-digital-solutions_rambler-ui | train | js |
4c0cf74bdaa2d2701313b71010cc922959a43635 | diff --git a/src/nu/validator/servlet/Statistics.java b/src/nu/validator/servlet/Statistics.java
index <HASH>..<HASH> 100644
--- a/src/nu/validator/servlet/Statistics.java
+++ b/src/nu/validator/servlet/Statistics.java
@@ -107,8 +107,8 @@ public class Statistics {
"Logic errors in schema stats"), PARSER_XML_EXTERNAL(
"Parser set to XML with external entities"), PARSER_HTML4(
"Parser set to explicit HTML4 mode"),
- ABOUT_LEGACY_COMPAT("Doctype with\u300cSYSTEM \"about:legacy-compat\"\u300dfound"),
- XHTML1_SYSTEM_ID("Doctype with XHTML1 system ID found"),
+ ABOUT_LEGACY_COMPAT("Doctype with about:legacy-compat system ID"),
+ XHTML1_SYSTEM_ID("Doctype with XHTML1 system ID"),
XMLNS_FILTER( "XMLNS filter set"), LAX_TYPE(
"Being lax about HTTP content type"), IMAGE_REPORT(
"Image report"), SHOW_SOURCE("Show source"), SHOW_OUTLINE( | Slightly reword a stats description | validator_validator | train | java |
39195a8e8644528ff1f5fe5de5c192788794d853 | diff --git a/fsquery/fsquery.py b/fsquery/fsquery.py
index <HASH>..<HASH> 100644
--- a/fsquery/fsquery.py
+++ b/fsquery/fsquery.py
@@ -1,6 +1,6 @@
import os
import re
-
+import datetime
from shutil import copyfile
@@ -37,6 +37,14 @@ class FSNode :
def relative(self) :
return self.abs.replace(self.root,"")
+ def ts_changed(self) :
+ "TimeStamp of last changed time / date"
+ return os.path.getmtime(self.abs)
+
+ def changed(self) :
+ "Formatted last changed time / date"
+ return "%s"%datetime.datetime.fromtimestamp(self.ts_changed())
+
def isdir(self) :
"True if this FSNode is a directory"
return os.path.isdir(self.abs) | added time functions to FSNode | interstar_FSQuery | train | py |
8176d66a5c17fa5468c694f3ff39d367d2f6f370 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
from setuptools import find_packages, setup
import subprocess
-subprocess.call(["apt-get", "install", "libgeos-dev"])
+subprocess.call(["sudo", "apt-get", "install", "libgeos-dev"])
setup(name='dingo',
author='openego development group', | Try libgeos with sudo | openego_ding0 | train | py |
bfe3b917269ba7ad120b73cc11d67749bb750940 | diff --git a/aioauth_client.py b/aioauth_client.py
index <HASH>..<HASH> 100644
--- a/aioauth_client.py
+++ b/aioauth_client.py
@@ -505,7 +505,7 @@ class LichessClient(OAuth2Client):
if self.access_token:
headers['Authorization'] = "Bearer {}".format(self.access_token)
- return self._request(method, url, headers=headers, **aio_kwargs),
+ return self._request(method, url, headers=headers, **aio_kwargs)
class Meetup(OAuth1Client): | Fix TypeError: object tuple can't be used in 'await' expression | klen_aioauth-client | train | py |
b7e50e45cee9b7abf9486bb343a096acc79387df | diff --git a/lib/jazzy/doc_builder.rb b/lib/jazzy/doc_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/jazzy/doc_builder.rb
+++ b/lib/jazzy/doc_builder.rb
@@ -183,7 +183,7 @@ module Jazzy
doc[:structure] = source_module.doc_structure
doc[:module_name] = source_module.name
doc[:author_name] = source_module.author_name
- doc[:github_url] = source_module.github_url.to_s
+ doc[:github_url] = source_module.github_url
doc[:dash_url] = source_module.dash_url
doc[:path_to_root] = path_to_root
doc[:hide_name] = true
@@ -287,7 +287,7 @@ module Jazzy
doc[:tasks] = render_tasks(source_module, doc_model.children)
doc[:module_name] = source_module.name
doc[:author_name] = source_module.author_name
- doc[:github_url] = source_module.github_url.to_s
+ doc[:github_url] = source_module.github_url
doc[:dash_url] = source_module.dash_url
doc[:path_to_root] = path_to_root
doc.render | Fixed bug where "View on GitHub" was always shown | realm_jazzy | train | rb |
82112b9c77164a8961d93cfb49d916d4b4bc4384 | diff --git a/lib/support/chromePerflogParser.js b/lib/support/chromePerflogParser.js
index <HASH>..<HASH> 100644
--- a/lib/support/chromePerflogParser.js
+++ b/lib/support/chromePerflogParser.js
@@ -101,7 +101,15 @@ module.exports = {
entry.time = max(0, blocked) + max(0, dns) + max(0, connect) + send + wait + receive;
- //TODO: figure out how to correctly calculate startedDateTime for connections reused
+ // Calculate offset of any connection already in use and add
+ // it to the entries startedDateTime(ignore main page request)
+ if(response.connectionReused && (entry._requestId !== entry._frameId)) {
+ let requestSentDelta = entry._requestSentTime - entry._requestWillBeSentTime;
+ let newStartDateTime = entry._wallTime + requestSentDelta;
+ entry._requestSentDelta = requestSentDelta;
+ entry.startedDateTime = moment.unix(newStartDateTime).toISOString();
+ }
+
} else {
entry.timings = {
blocked: -1, | Used the delta from requestWillBeSent and requestSent and added it to the startedDateTime of reused connnections | sitespeedio_browsertime | train | js |
217848ca52864b6ad4556d18ba011d041534df01 | diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js
index <HASH>..<HASH> 100644
--- a/spec/api-browser-window-spec.js
+++ b/spec/api-browser-window-spec.js
@@ -82,7 +82,10 @@ describe('browser-window module', function () {
})
afterEach(function () {
- return closeWindow(w).then(function () { w = null })
+ return closeWindow(w).then(function () {
+ w = null
+ assert.equal(BrowserWindow.getAllWindows().length, 1)
+ })
})
describe('BrowserWindow.close()', function () { | Assert windows are not leaking across tests | electron_electron | train | js |
e8ddaa3cac2440a4521cd61eefc8844ead1186a2 | diff --git a/silverberg/client.py b/silverberg/client.py
index <HASH>..<HASH> 100644
--- a/silverberg/client.py
+++ b/silverberg/client.py
@@ -182,8 +182,11 @@ class CQLClient(object):
prep_query = prepare(query, args)
def _execute(client):
- return client.execute_cql3_query(prep_query,
- ttypes.Compression.NONE, consistency)
+ exec_d = client.execute_cql3_query(prep_query,
+ ttypes.Compression.NONE, consistency)
+ cancellable_d = defer.Deferred(lambda d: self.disconnect())
+ exec_d.chainDeferred(cancellable_d)
+ return cancellable_d
def _proc_results(result):
if result.type == ttypes.CqlResultType.ROWS:
diff --git a/silverberg/thrift_client.py b/silverberg/thrift_client.py
index <HASH>..<HASH> 100644
--- a/silverberg/thrift_client.py
+++ b/silverberg/thrift_client.py
@@ -109,7 +109,7 @@ class OnDemandThriftClient(object):
return d
def _notify_on_connect(self):
- d = Deferred()
+ d = Deferred(lambda d: self.disconnect())
self._waiting_on_connect.append(d)
return d | Query can be cancelled
Cancelling a running query will try to disconnect TCP connection | rackerlabs_silverberg | train | py,py |
901daf44f4a751e3efccb94f6b543e98e7b400b7 | diff --git a/encryption/src/main/java/se/simbio/encryption/Encryption.java b/encryption/src/main/java/se/simbio/encryption/Encryption.java
index <HASH>..<HASH> 100644
--- a/encryption/src/main/java/se/simbio/encryption/Encryption.java
+++ b/encryption/src/main/java/se/simbio/encryption/Encryption.java
@@ -14,6 +14,7 @@
package se.simbio.encryption;
import android.R.string;
+import android.os.Build;
import android.util.Base64;
import android.util.Log;
@@ -40,7 +41,7 @@ public class Encryption {
private String mCharsetName = "UTF8";
//base mode
private int mBase64Mode = Base64.DEFAULT;
- //type of aes key that will be created
+ //type of aes key that will be created, on KITKAT+ the API has changed, if you are getting problems please @see <a href="http://android-developers.blogspot.com.br/2013/12/changes-to-secretkeyfactory-api-in.html">http://android-developers.blogspot.com.br/2013/12/changes-to-secretkeyfactory-api-in.html</a>
private String mSecretKeyType = "PBKDF2WithHmacSHA1";
//value used for salting. can be anything
private String mSalt = "some_salt"; | Add an observation for possibles bugs in KitKat+ if you are supporting olders apis, because the API has change in <I>, to solve this problem, you just need to use the PBKDF2WithHmacSHA1And8bit more details please read <URL> | simbiose_Encryption | train | java |
86ededfe063c361f0481c9e820a9ae605d8a6086 | diff --git a/java/com/couchbase/lite/ApiTest.java b/java/com/couchbase/lite/ApiTest.java
index <HASH>..<HASH> 100644
--- a/java/com/couchbase/lite/ApiTest.java
+++ b/java/com/couchbase/lite/ApiTest.java
@@ -82,7 +82,7 @@ public class ApiTest extends LiteTestCase {
}
boolean readOnly = true;
boolean noReplicator = false;
- ManagerOptions options= new ManagerOptions(readOnly, noReplicator);
+ ManagerOptions options= new ManagerOptions(readOnly);
Manager roManager=new Manager(new File(manager.getDirectory()), options);
Assert.assertTrue(roManager!=null); | Remove noReplicator property from ManagerOptions -- no longer needed. | couchbase_couchbase-lite-android | train | java |
9e31852fc78b8d62b68dda1fb57ac5f50cb4bb03 | diff --git a/jaraco/util/string.py b/jaraco/util/string.py
index <HASH>..<HASH> 100644
--- a/jaraco/util/string.py
+++ b/jaraco/util/string.py
@@ -136,7 +136,7 @@ def trim(s):
is common due to indentation and formatting.
>>> trim("\n\tfoo = bar\n\t\tbar = baz\n")
- 'foo = bar\n\tbar = baz'
+ u'foo = bar\n\tbar = baz'
"""
return textwrap.dedent(s).strip() | Fixed failing doctest (unicode variation) | jaraco_jaraco.text | train | py |
04debd17388623867f413fc701b8b002d02bc2ea | diff --git a/ecs-init/engine/engine.go b/ecs-init/engine/engine.go
index <HASH>..<HASH> 100644
--- a/ecs-init/engine/engine.go
+++ b/ecs-init/engine/engine.go
@@ -261,7 +261,7 @@ func (e *Engine) PostStop() error {
err := e.loopbackRouting.RestoreDefault()
// Ignore error from Remove() as the netfilter might never have been
- // addred in the first place
+ // added in the first place
e.credentialsProxyRoute.Remove()
return err
} | Fix typo in comment (#<I>) | aws_amazon-ecs-agent | train | go |
405fab15c613bdf142540447eeb1242a474c4c91 | diff --git a/Kwf_js/EyeCandy/Lightbox/Lightbox.js b/Kwf_js/EyeCandy/Lightbox/Lightbox.js
index <HASH>..<HASH> 100644
--- a/Kwf_js/EyeCandy/Lightbox/Lightbox.js
+++ b/Kwf_js/EyeCandy/Lightbox/Lightbox.js
@@ -377,8 +377,14 @@ Kwf.EyeCandy.Lightbox.Styles.CenterBox = Ext.extend(Kwf.EyeCandy.Lightbox.Styles
var xy = this.lightbox.innerLightboxEl.getXY();
xy[0] = centerXy[0];
if (centerXy[1] < xy[1]) xy[1] = centerXy[1]; //move up, but not down
+ /*
+ //animation to new position disabled, buggy
this.lightbox.innerLightboxEl.setXY(xy, true);
this.lightbox.innerLightboxEl.setSize(originalSize); //set back to previous size for animation
this.lightbox.innerLightboxEl.setSize(newSize, null, true); //now animate to new size
+ */
+
+ //instead center unanimated
+ this.lightbox.innerLightboxEl.setXY(xy);
}
}); | disable animation when re-opening lightbox
it made unintentional animations | koala-framework_koala-framework | train | js |
2ec4bb1a13f857e87fe66b8d28e4f9cdfb049ee1 | diff --git a/lib/vagrant/ui/remote.rb b/lib/vagrant/ui/remote.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/ui/remote.rb
+++ b/lib/vagrant/ui/remote.rb
@@ -12,6 +12,11 @@ module Vagrant
# no-op
end
+ def ask(message, **opts)
+ opts[:style] ||= :detail
+ @client.input(message.gsub("%", "%%"), **opts)
+ end
+
# This method handles actually outputting a message of a given type
# to the console.
def say(type, message, opts={}) | Add remote override for #ask method | hashicorp_vagrant | train | rb |
c22634fbf81a899f5b5cacb8587aaba885fe60ff | diff --git a/spyder/widgets/sourcecode/base.py b/spyder/widgets/sourcecode/base.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/sourcecode/base.py
+++ b/spyder/widgets/sourcecode/base.py
@@ -55,7 +55,7 @@ class CompletionWidget(QListWidget):
self.setWindowFlags(Qt.SubWindow | Qt.FramelessWindowHint)
self.textedit = parent
self.completion_list = None
- self.case_sensitive = True
+ self.case_sensitive = False
self.enter_select = None
self.hide()
self.itemActivated.connect(self.item_selected)
@@ -85,8 +85,7 @@ class CompletionWidget(QListWidget):
if any(types):
for (c, t) in zip(completion_list, types):
icon = icons_map.get(t, 'no_match')
- #self.addItem(QListWidgetItem(ima.icon(icon), c))
- self.addItem(QListWidgetItem(c))
+ self.addItem(QListWidgetItem(ima.icon(icon), c))
else:
self.addItems(completion_list)
@@ -181,7 +180,6 @@ class CompletionWidget(QListWidget):
if completion_text:
for row, completion in enumerate(self.completion_list):
- #print(completion_text)
if not self.case_sensitive:
print(completion_text)
completion = completion.lower() | Editor: Minor fixes after PR #<I> | spyder-ide_spyder | train | py |
fa306e9c734528cbeb3902dce4e7257cd09387f0 | diff --git a/yandextank/plugins/Bfg/worker.py b/yandextank/plugins/Bfg/worker.py
index <HASH>..<HASH> 100644
--- a/yandextank/plugins/Bfg/worker.py
+++ b/yandextank/plugins/Bfg/worker.py
@@ -61,6 +61,15 @@ Gun: {gun.__class__.__name__}
Say the workers to finish their jobs and quit.
"""
self.quit.set()
+ while sorted([self.pool[i].is_alive() for i in xrange(len(self.pool))])[-1]:
+ time.sleep(1)
+ try:
+ while not self.task_queue.empty():
+ self.task_queue.get(timeout=0.1)
+ self.task_queue.close()
+ self.feeder.join()
+ except Exception, ex:
+ logger.info(ex)
def _feed(self):
""" | Update worker.py
Partially solves bfg zombie problem. You need to put os._exit(0) at the end of teardown to make sure instances are dead. | yandex_yandex-tank | train | py |
99b4d77d20df599bd0c3d4a5f87e9d2e0adf1172 | diff --git a/packages/hw-app-btc/src/Btc.js b/packages/hw-app-btc/src/Btc.js
index <HASH>..<HASH> 100644
--- a/packages/hw-app-btc/src/Btc.js
+++ b/packages/hw-app-btc/src/Btc.js
@@ -228,22 +228,25 @@ const tx1 = btc.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc
}
getTrustedInput(
- transport: Transport<*>,
indexLookup: number,
transaction: Transaction,
additionals: Array<string> = []
): Promise<string> {
- return getTrustedInput(transport, indexLookup, transaction, additionals);
+ return getTrustedInput(
+ this.transport,
+ indexLookup,
+ transaction,
+ additionals
+ );
}
getTrustedInputBIP143(
- transport: Transport<*>,
indexLookup: number,
transaction: Transaction,
additionals: Array<string> = []
): string {
return getTrustedInputBIP143(
- transport,
+ this.transport,
indexLookup,
transaction,
additionals | getTrustedInput* should not take a transport in param | LedgerHQ_ledgerjs | train | js |
d6df455e9336d1c57554f107fb822341ab076cbf | diff --git a/moa/src/main/java/moa/tasks/EvaluatePrequentialCV.java b/moa/src/main/java/moa/tasks/EvaluatePrequentialCV.java
index <HASH>..<HASH> 100644
--- a/moa/src/main/java/moa/tasks/EvaluatePrequentialCV.java
+++ b/moa/src/main/java/moa/tasks/EvaluatePrequentialCV.java
@@ -93,7 +93,7 @@ public class EvaluatePrequentialCV extends MainTask {
"File to append intermediate csv results to.", null, "csv", true);
public IntOption numFoldsOption = new IntOption("numFolds", 'w',
- "The number of folds (e.g. distributed models) to be use.", 10, 1, Integer.MAX_VALUE);
+ "The number of folds (e.g. distributed models) to be used.", 10, 1, Integer.MAX_VALUE);
public MultiChoiceOption validationMethodologyOption = new MultiChoiceOption(
"validationMethodology", 'a', "Validation methodology to use.", new String[]{ | Doing the same spelling correction to numFolds in EvaluatePrequentialCV | Waikato_moa | train | java |
f3a080fa96600cff29b540ca5d5a22af2ed2e8dd | diff --git a/src/prop-types/ref.js b/src/prop-types/ref.js
index <HASH>..<HASH> 100644
--- a/src/prop-types/ref.js
+++ b/src/prop-types/ref.js
@@ -1,5 +1,3 @@
import PropTypes from 'prop-types';
-export default PropTypes.shape({
- current: PropTypes.any,
-});
+export default PropTypes.object; | Use Object proptype for refs
Using shape with non-required keys is basically the same as using Object in the first place. And we cannot make the current key required here because at certain points in the component lifecycle it will be null. | juanca_react-aria-components | train | js |
c8d42aa18b7abd75e45e1fccdb04b763d1f5f992 | diff --git a/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java b/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java
index <HASH>..<HASH> 100644
--- a/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java
+++ b/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java
@@ -74,6 +74,7 @@ public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverl
public void addItem(final int location, final Item item) {
mItemList.add(location, item);
+ populate();
}
public boolean addItems(final List<Item> items) { | Update issue <I>
Status: ReadyForTesting
Added populate() call to addItem(int, Item) | osmdroid_osmdroid | train | java |
deb2c918ad9713e0436b6bdc5f45647be8caba17 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -121,6 +121,7 @@ gulp.task('conda:build', async () => {
if (os.platform() == 'win32') {
title('installing buildtools (must be running as Administrator)');
await spawnAsync(`npm install --global --production windows-build-tools`);
+ await spawnAsync(`npm config set msvs_version 2015 --global`);
}
title('installing microdrop'); | ensure msvs_version is <I> | Lucaszw_microdrop-feedstock | train | js |
30f2104df32e5a8836f708fcf563de1d5a7fec19 | diff --git a/mozilla_django_oidc/auth.py b/mozilla_django_oidc/auth.py
index <HASH>..<HASH> 100644
--- a/mozilla_django_oidc/auth.py
+++ b/mozilla_django_oidc/auth.py
@@ -28,7 +28,7 @@ def default_username_algo(email):
# this protects against data leakage because usernames are often
# treated as public identifiers (so we can't use the email address).
return base64.urlsafe_b64encode(
- hashlib.sha224(smart_bytes(email)).digest()
+ hashlib.sha1(smart_bytes(email)).digest()
).rstrip(b'=') | Replace sh<I> with sha1 in username_algo. | mozilla_mozilla-django-oidc | train | py |
87ce1337e62b1974b27e6a982604cda5f5b157ae | diff --git a/foxpuppet/windows/browser.py b/foxpuppet/windows/browser.py
index <HASH>..<HASH> 100644
--- a/foxpuppet/windows/browser.py
+++ b/foxpuppet/windows/browser.py
@@ -23,7 +23,7 @@ class BrowserWindow(BaseWindow):
"""Returns True if this is a Private Browsing window."""
self.switch_to()
- with self.selenium.context('chrome'):
+ with self.selenium.context(self.selenium.CONTEXT_CHROME):
return self.selenium.execute_script(
"""
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
@@ -42,7 +42,7 @@ class BrowserWindow(BaseWindow):
handles_before = self.selenium.window_handles
self.switch_to()
- with self.selenium.context('chrome'):
+ with self.selenium.context(self.selenium.CONTEXT_CHROME):
# Opens private or non-private window
self.selenium.find_element(*self._file_menu_button_locator).click()
if private: | Switch to class variables for context values (#<I>) | mozilla_FoxPuppet | train | py |
7e34d8d6ab06fcb9055312b0240041a1bfc41ae9 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -177,7 +177,7 @@ function processParameter(param,op,path,index,openapi) {
for (var mimetype of consumes) {
result.content[mimetype] = {};
if (param.description) result.content[mimetype].description = param.description;
- result.content[mimetype].schema = param.schema||{};
+ result.content[mimetype].schema = common.clone(param.schema)||{};
}
}
@@ -269,7 +269,7 @@ function processPaths(container,containerName,options,requestBodyCache,openapi)
response.content = {};
for (var mimetype of produces) {
response.content[mimetype] = {};
- response.content[mimetype].schema = response.schema;
+ response.content[mimetype].schema = common.clone(response.schema);
}
delete response.schema;
} | Clone schemas to prevent internal refs in yaml | wework_speccy | train | js |
423a5f59077d7c572ab4430a6a8bd1b8bef712ef | diff --git a/config/initializers/url_for_patch.rb b/config/initializers/url_for_patch.rb
index <HASH>..<HASH> 100644
--- a/config/initializers/url_for_patch.rb
+++ b/config/initializers/url_for_patch.rb
@@ -1,8 +1,8 @@
module ActionDispatch
module Routing
class RouteSet
-
- def url_for_with_storytime(options = {})
+
+ def handle_storytime_urls(options)
if options[:controller] == "storytime/posts" && options[:action] == "index"
options[:use_route] = "root_post_index" if Storytime::Site.first.root_page_content == "posts"
elsif options[:controller] == "storytime/posts" && options[:action] == "show"
@@ -35,14 +35,22 @@ module ActionDispatch
end
end
end
-
- url_for_without_storytime(options)
- rescue Exception => e
- # binding.pry
+ end
+
+ if Rails::VERSION::MINOR >= 2
+ def url_for_with_storytime(options, route_name = nil, url_strategy = UNKNOWN)
+ handle_storytime_urls(options)
+ url_for_without_storytime(options, route_name, url_strategy)
+ end
+ else
+ def url_for_with_storytime(options = {})
+ handle_storytime_urls(options)
+ url_for_without_storytime(options)
+ end
end
alias_method_chain :url_for, :storytime
+
end
end
-end
-
+end
\ No newline at end of file | Fix url_for_patch to work with rails <I> | CultivateLabs_storytime | train | rb |
35a8ba97af977d9f911345632d70b0855bb15bee | diff --git a/src/controllers/HubController.php b/src/controllers/HubController.php
index <HASH>..<HASH> 100644
--- a/src/controllers/HubController.php
+++ b/src/controllers/HubController.php
@@ -31,7 +31,9 @@ class HubController extends CrudController
$action = $event->sender;
$dataProvider = $action->getDataProvider();
$dataProvider->query->joinWith(['bindings']);
- $dataProvider->query->andWhere(['with_bindings' => 1]);
+ $dataProvider->query
+ ->andWhere(['with_bindings' => 1])
+ ->andWhere(['with_servers' => 1]);
},
'class' => ViewAction::class,
], | Added `with_servers` to HubController view | hiqdev_hipanel-module-server | train | php |
454b11039ffba3d5a5d61aff0f27a56cfba37130 | diff --git a/Samba/Connection.php b/Samba/Connection.php
index <HASH>..<HASH> 100644
--- a/Samba/Connection.php
+++ b/Samba/Connection.php
@@ -169,7 +169,7 @@ class sb_Samba_Connection {
public function ls($subdir = '', &$raw = NULL) {
$teststr = str_replace('\\', '-', $subdir);
- $nub = (preg_match('/[-?|\/?]*([\w -]+\.\w{1,4})/', $teststr))?'':'\*';
+ $nub = (preg_match('/[-?|\/?]*([\w \-]+\.\w{1,4})/', $teststr))?'':'\*';
$this->execute("ls $subdir".$nub, $raw_ls);
@@ -214,7 +214,7 @@ class sb_Samba_Connection {
*/
private function parseListing($listing, $subdir = '') {
$ret = new sb_Samba_Listing();
- $exp = '/^\s*([\w ]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/';
+ $exp = '/^\s*([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/';
preg_match_all($exp, $listing, $matches); | added support for dashes in filename | surebert_surebert-framework | train | php |
d47e4fe557d4688c5018ee804ce97c00018e2e8d | diff --git a/db/migrate/20150930183738_migrate_content_hosts.rb b/db/migrate/20150930183738_migrate_content_hosts.rb
index <HASH>..<HASH> 100644
--- a/db/migrate/20150930183738_migrate_content_hosts.rb
+++ b/db/migrate/20150930183738_migrate_content_hosts.rb
@@ -310,6 +310,8 @@ class MigrateContentHosts < ActiveRecord::Migration
fail _("Some backend services are not running: %s") % ping.inspect
end
+ ::Katello::System.where(:uuid => nil).destroy_all
+
ensure_one_system_per_hostname(MigrateContentHosts::System.all)
systems = get_systems_with_facts(MigrateContentHosts::System.all) | Fixes #<I> - handle systems with nil uuid on upgrade (#<I>) | Katello_katello | 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.