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
|
---|---|---|---|---|---|
12490db67638276ddcc9f83e320f2b7a7d71fd4d
|
diff --git a/src/createDispatcher.js b/src/createDispatcher.js
index <HASH>..<HASH> 100644
--- a/src/createDispatcher.js
+++ b/src/createDispatcher.js
@@ -75,6 +75,15 @@ export default function createDispatcher() {
return Promise.resolve(res)
}
+ if (Promise.isPrototypeOf(action)) {
+ dispatcher.onNext(
+ Observable
+ .fromPromise(action)
+ .shareReplay()
+ )
+ return action
+ }
+
dispatcher.onNext(Observable.of(action))
return Promise.resolve(action)
},
|
Restore support for directly passing Promises to dispatch
|
kitten_fluorine
|
train
|
js
|
2aed51e706956c9dfe87b16024b39e96d71ca394
|
diff --git a/lib/bud/collections.rb b/lib/bud/collections.rb
index <HASH>..<HASH> 100644
--- a/lib/bud/collections.rb
+++ b/lib/bud/collections.rb
@@ -421,7 +421,7 @@ class Bud
def establish_connection(l)
@connections[l] = EventMachine::connect l[0], l[1], BudServer, @bud_instance
-
+ @connections.delete(l) if @connections[l].error?
end
def flush
@@ -442,7 +442,11 @@ class Bud
end
# puts "#{@bud_instance.ip_port} => #{the_locspec.inspect}: #{[@tabname, t].inspect}"
establish_connection(the_locspec) if @connections[the_locspec].nil?
- @connections[the_locspec].send_data [@tabname, t].to_msgpack
+ # if the connection failed, we silently ignore and let the tuples be cleared.
+ # if we didn't clear them here, we'd be clearing them at end-of-tick anyhow
+ unless @connections[the_locspec].nil?
+ @connections[the_locspec].send_data [@tabname, t].to_msgpack
+ end
end
end
@pending.clear
|
properly handle initial connection failure in BudChannel::flush
|
bloom-lang_bud
|
train
|
rb
|
713e6e62875dc6e99914d91bad23ad41518f70f6
|
diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php
index <HASH>..<HASH> 100644
--- a/cake/libs/controller/scaffold.php
+++ b/cake/libs/controller/scaffold.php
@@ -390,7 +390,7 @@ class Scaffold extends Object {
if ($this->ScaffoldModel->delete($id)) {
$message = __(
- sprintf('The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id),
+ sprintf('The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id)
);
if ($this->_validSession) {
$this->controller->Session->setFlash($message);
|
Fixing parse error that caused scaffold test to not run and not pass.
|
cakephp_cakephp
|
train
|
php
|
dc262f16e7aab9bcbb6c4a92a56b288ec6b21774
|
diff --git a/nightwatch.js b/nightwatch.js
index <HASH>..<HASH> 100644
--- a/nightwatch.js
+++ b/nightwatch.js
@@ -35,6 +35,7 @@ if (process.env.TRAVIS) {
module.exports = {
globals_path: './nightwatch-globals.js',
+ persist_globals: true,
// selenium: {
// start_process: true,
// server_path: require('selenium-server').path,
|
chore: persist global data on nightwatch
|
bolt-design-system_bolt
|
train
|
js
|
df1dae81285387d68a14a7ba511ae667bd33b9a3
|
diff --git a/lib/wp_api_client/connection.rb b/lib/wp_api_client/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/wp_api_client/connection.rb
+++ b/lib/wp_api_client/connection.rb
@@ -12,6 +12,7 @@ module WpApiClient
if configuration.oauth_credentials
faraday.use FaradayMiddleware::OAuth, configuration.oauth_credentials
end
+ faraday.use Faraday::Response::RaiseError
faraday.response :json, :content_type => /\bjson$/
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
end
|
Raise Exceptions on non-<I> response
|
duncanjbrown_wp-api-client
|
train
|
rb
|
7765aa9a301aba15c769b3362f808afd891c327c
|
diff --git a/bob/bio/spear/test/test_extractors.py b/bob/bio/spear/test/test_extractors.py
index <HASH>..<HASH> 100644
--- a/bob/bio/spear/test/test_extractors.py
+++ b/bob/bio/spear/test/test_extractors.py
@@ -45,7 +45,7 @@ def test_mfcc():
# read input wave file
rate, wav = _wav()
- extractor = bob.bio.base.load_resource("mfcc-60", "extractor")
+ extractor = bob.bio.base.load_resource("mfcc60", "extractor")
assert isinstance(extractor, bob.bio.spear.extractor.Cepstral)
# test the Cepstral extractor
|
Fix the naming of the mfcc<I> extractor.
|
bioidiap_bob.bio.spear
|
train
|
py
|
4d68edbe95cae8be2711347491a49e156c8b77a7
|
diff --git a/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java b/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java
index <HASH>..<HASH> 100755
--- a/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java
+++ b/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java
@@ -1311,8 +1311,9 @@ public class ODistributedStorage implements OStorage, OFreezableStorage, OAutosh
if (OScenarioThreadLocal.INSTANCE.get() == RUN_MODE.DEFAULT) {
- final StringBuilder cmd = new StringBuilder("create cluster ");
+ final StringBuilder cmd = new StringBuilder("create cluster `");
cmd.append(iClusterName);
+ cmd.append("`");
// EXECUTE THIS OUTSIDE LOCK TO AVOID DEADLOCKS
OCommandSQL commandSQL = new OCommandSQL(cmd.toString());
|
fixed create cluster command generation for support special characters.
|
orientechnologies_orientdb
|
train
|
java
|
577d62fe754650521a74ebbe6c0ae2a37b30129c
|
diff --git a/bulbs/api/views.py b/bulbs/api/views.py
index <HASH>..<HASH> 100644
--- a/bulbs/api/views.py
+++ b/bulbs/api/views.py
@@ -454,6 +454,8 @@ class ContentResolveViewSet(viewsets.ReadOnlyModelViewSet):
content = get_object_or_404(Content, pk=match.kwargs.get('pk'))
return Response(ContentSerializer().to_representation(content))
+ else:
+ raise Http404('Must specify content "url" param')
class CustomSearchContentViewSet(viewsets.GenericViewSet):
diff --git a/tests/api/test_content_api.py b/tests/api/test_content_api.py
index <HASH>..<HASH> 100644
--- a/tests/api/test_content_api.py
+++ b/tests/api/test_content_api.py
@@ -601,3 +601,7 @@ class TestContentResolveAPI(BaseAPITestCase):
r = self.api_client.get(reverse("content-resolve-list"),
dict(url="/r/1"))
self.assertEqual(r.status_code, 404)
+
+ def test_missing_param(self):
+ r = self.api_client.get(reverse("content-resolve-list"))
+ self.assertEqual(r.status_code, 404)
|
Raise <I> on missing "url" param
|
theonion_django-bulbs
|
train
|
py,py
|
a9a7bf022519a63b3a8127213c414485c289556f
|
diff --git a/ipmitool.go b/ipmitool.go
index <HASH>..<HASH> 100644
--- a/ipmitool.go
+++ b/ipmitool.go
@@ -92,9 +92,9 @@ func rawEncode(data []byte) []string {
n := len(data)
buf := make([]string, 0, n)
- // ipmitool raw wasn't happy with hex.Encode
+ // ipmitool needs every byte to be a separate argument
for i := 0; i < n; i++ {
- buf = append(buf, fmt.Sprintf("%#x", data[i:i+1]))
+ buf = append(buf, "0x"+hex.EncodeToString(data[i:i+1]))
}
return buf
|
Use hex.Encode instead of fmt.Sprintf
This makes it a little more clear what the arguments that ipmitool
expects look like.
|
vmware_goipmi
|
train
|
go
|
d02ac4082cfcb3980d55f5ae45b74e4226cfd9f3
|
diff --git a/lib/hyrax/engine.rb b/lib/hyrax/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/hyrax/engine.rb
+++ b/lib/hyrax/engine.rb
@@ -32,10 +32,28 @@ module Hyrax
end
config.after_initialize do
- begin
+ # Attempt to establish a connection before trying to do anything with it. This has to rescue
+ # StandardError instead of, e.g., ActiveRecord::ConnectionNotEstablished or ActiveRecord::NoDatabaseError
+ # because we can't be absolutely sure what the specific database adapter will raise. pg, for example,
+ # raises PG::ConnectionBad. There's no good common ancestor to assume. That's why this test
+ # is in its own tiny chunk of code – so we know that whatever the StandardError is, it's coming
+ # from the attempt to connect.
+ can_connect = begin
+ ActiveRecord::Base.connection
+ true
+ rescue StandardError
+ false
+ end
+
+ can_persist = can_connect && begin
Hyrax.config.persist_registered_roles!
Rails.logger.info("Hyrax::Engine.after_initialize - persisting registered roles!")
+ true
rescue ActiveRecord::StatementInvalid
+ false
+ end
+
+ unless can_persist
message = "Hyrax::Engine.after_initialize - unable to persist registered roles.\n"
message += "It is expected during the application installation - during integration tests, rails install.\n"
message += "It is UNEXPECTED if you are booting up a Hyrax powered application via `rails server'"
|
Provide more leniency for a missing database connection during initialization
Add comment justifying trapping StandardError
|
samvera_hyrax
|
train
|
rb
|
50accf5791888509af8c94622d0c5cb63fddda76
|
diff --git a/stanfordnlp/models/common/hlstm.py b/stanfordnlp/models/common/hlstm.py
index <HASH>..<HASH> 100644
--- a/stanfordnlp/models/common/hlstm.py
+++ b/stanfordnlp/models/common/hlstm.py
@@ -36,9 +36,9 @@ class HLSTMCell(nn.modules.rnn.RNNCellBase):
# vanilla LSTM computation
rec_input = torch.cat([input, hx[0]], 1)
i = F.sigmoid(self.Wi(rec_input))
- f = F.sigmoid(self.Wi(rec_input))
- o = F.sigmoid(self.Wi(rec_input))
- g = F.tanh(self.Wi(rec_input))
+ f = F.sigmoid(self.Wf(rec_input))
+ o = F.sigmoid(self.Wo(rec_input))
+ g = F.tanh(self.Wg(rec_input))
# highway gates
gate = F.sigmoid(self.gate(torch.cat([c_l_minus_one, hx[1], input], 1)))
|
Fix the alternative Highway LSTM implementation
|
stanfordnlp_stanza
|
train
|
py
|
e4f2958007772b42c80bdd339655a4706cb4b4c4
|
diff --git a/src/server/pkg/deploy/assets/assets.go b/src/server/pkg/deploy/assets/assets.go
index <HASH>..<HASH> 100644
--- a/src/server/pkg/deploy/assets/assets.go
+++ b/src/server/pkg/deploy/assets/assets.go
@@ -209,16 +209,21 @@ func ClusterRole() *rbacv1.ClusterRole {
Resources: []string{"pods"},
}, {
APIGroups: []string{""},
- Verbs: []string{"get", "list", "watch", "create", "delete"},
+ Verbs: []string{"get", "list", "watch", "create", "update", "delete"},
Resources: []string{"replicationcontrollers"},
}, {
APIGroups: []string{""},
- Verbs: []string{"get", "list", "watch", "create", "delete"},
+ Verbs: []string{"get", "list", "watch", "create", "update", "delete"},
Resources: []string{"services"},
}, {
APIGroups: []string{""},
Verbs: []string{"get", "list", "watch"},
Resources: []string{"endpoints"},
+ }, {
+ APIGroups: []string{""},
+ Verbs: []string{"get", "list", "watch", "create", "update", "delete"},
+ Resources: []string{"secrets"},
+ ResourceNames: []string{client.StorageSecretName},
}},
}
}
|
Adds secrets access to RBAC.
|
pachyderm_pachyderm
|
train
|
go
|
9c957df559d25091b22f0a266bc2a96adddb71ea
|
diff --git a/grimoire/elk/enrich.py b/grimoire/elk/enrich.py
index <HASH>..<HASH> 100644
--- a/grimoire/elk/enrich.py
+++ b/grimoire/elk/enrich.py
@@ -699,7 +699,7 @@ class Enrich(object):
return users_data
- def get_item_sh(self, item, roles=None):
+ def get_item_sh(self, item, roles=None, date_field=None):
"""
Add sorting hat enrichment fields for different roles
@@ -714,7 +714,10 @@ class Enrich(object):
if not roles:
roles = [author_field]
- item_date = parser.parse(item[self.get_field_date()])
+ if not date_field:
+ item_date = parser.parse(item[self.get_field_date()])
+ else:
+ item_date = parser.parse(item[date_field])
users_data = self.get_users_data(item)
|
[enrich][sh] Add support for getting the date field to be used for getting affiliations as a param
|
chaoss_grimoirelab-elk
|
train
|
py
|
8ffe910ebf5bb85ba15eab66341580d44d4d00fe
|
diff --git a/examples/wms-custom-proj.js b/examples/wms-custom-proj.js
index <HASH>..<HASH> 100644
--- a/examples/wms-custom-proj.js
+++ b/examples/wms-custom-proj.js
@@ -62,6 +62,7 @@ var map = new ol.Map({
view: new ol.View2D({
projection: projection,
center: [660000, 190000],
+ extent: extent,
zoom: 2
})
});
diff --git a/examples/wms-image-custom-proj.js b/examples/wms-image-custom-proj.js
index <HASH>..<HASH> 100644
--- a/examples/wms-image-custom-proj.js
+++ b/examples/wms-image-custom-proj.js
@@ -54,6 +54,7 @@ var map = new ol.Map({
view: new ol.View2D({
projection: projection,
center: [660000, 190000],
+ extent: extent,
zoom: 2
})
});
|
Apply center constraint in custom projection examples
|
openlayers_openlayers
|
train
|
js,js
|
5493ed73a9598132d93238e0fa89624a11138b8f
|
diff --git a/tls_assets.go b/tls_assets.go
index <HASH>..<HASH> 100644
--- a/tls_assets.go
+++ b/tls_assets.go
@@ -39,6 +39,8 @@ const (
EtcdComponent ClusterComponent = "etcd"
// CalicoComponent is the calico component.
CalicoComponent ClusterComponent = "calico"
+ // KubeStateMetricsComponent is the kube-state-metrics component.
+ KubeStateMetricsComponent ClusterComponent = "kube-state-metrics"
// ServiceAccountComponent is the service-account component.
ServiceAccountComponent ClusterComponent = "service-account"
// PrometheusComponent is the prometheus component.
@@ -76,6 +78,13 @@ var ClusterComponents = []ClusterComponent{
ServiceAccountComponent,
}
+// MonitoringComponents is a slice enumerating all the components that make up
+// monitoring.
+var MonitoringComponents = []ClusterComponent{
+ PrometheusComponent,
+ KubeStateMetricsComponent,
+}
+
// TLSAssetTypes is a slice enumerating all the TLS assets we need to boot the
// cluster.
var TLSAssetTypes = []TLSAssetType{CA, Crt, Key}
|
Adds kube state metrics component (#<I>)
|
giantswarm_certificatetpr
|
train
|
go
|
33fcff85d001c86a346b7006f4e41a0558abc9e8
|
diff --git a/src/Command/Project/ProjectCreateCommand.php b/src/Command/Project/ProjectCreateCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Project/ProjectCreateCommand.php
+++ b/src/Command/Project/ProjectCreateCommand.php
@@ -109,10 +109,10 @@ class ProjectCreateCommand extends CommandBase
// which allows the server a little more leeway to act on the
// initial request.
if (time() - $lastCheck >= $checkInterval) {
+ $lastCheck = time();
try {
// The API call will timeout after $checkTimeout seconds.
$subscription->refresh(['timeout' => $checkTimeout, 'exceptions' => false]);
- $lastCheck = time();
} catch (ConnectException $e) {
if (strpos($e->getMessage(), 'timed out') !== false) {
$this->debug($e->getMessage());
|
[project:create] be stricter about check interval
|
platformsh_platformsh-cli
|
train
|
php
|
f1d1cd2c8e20502ca8a720c112f7a726c5d7be90
|
diff --git a/html/htmlutil/htmlutil.go b/html/htmlutil/htmlutil.go
index <HASH>..<HASH> 100644
--- a/html/htmlutil/htmlutil.go
+++ b/html/htmlutil/htmlutil.go
@@ -1,5 +1,12 @@
package htmlutil
+import (
+ "html"
+ "strings"
+
+ "github.com/microcosm-cc/bluemonday"
+)
+
// ChartColor1 is the color palette for Google Charts as collected by
// Craig Davis here: https://gist.github.com/there4/2579834
var ChartColor1 = [...]string{
@@ -39,3 +46,19 @@ const (
RingCentralBlueHex = "#0073AE"
RingCentralGreyHex = "#585858"
)
+
+var bluemondayStrictPolicy = bluemonday.StrictPolicy()
+
+// HTMLToTextCondensed removes HTML tags, unescapes HTML entities,
+// and removes extra whitespace including non-breaking spaces.
+func HTMLToTextCondensed(s string) string {
+ return strings.Join(
+ strings.Fields(
+ strings.TrimSpace(
+ html.UnescapeString(
+ bluemondayStrictPolicy.Sanitize(s),
+ ),
+ )),
+ " ",
+ )
+}
|
add html.HTMLToTextCondensed
|
grokify_gotilla
|
train
|
go
|
4db5279b745585afdbfd20d66960b6f880660554
|
diff --git a/src/Widgets/Reports/BarChartReportWidget.php b/src/Widgets/Reports/BarChartReportWidget.php
index <HASH>..<HASH> 100644
--- a/src/Widgets/Reports/BarChartReportWidget.php
+++ b/src/Widgets/Reports/BarChartReportWidget.php
@@ -39,7 +39,7 @@ class BarChartReportWidget extends BaseReportGraphs
$options = [
'data' => $data,
- 'barColors' => ['#00a65a', '#f56954','#3c8ba8','#543cf4','#6954f5'],
+ 'barColors' => ['#00a65a', '#f56954', '#3c8ba8', '#543cf4', '#6954f5'],
'labels' => $labels,
'xkey' => explode(',', $report['info']['x_axis']),
'ykeys' => explode(',', $report['info']['y_axis'])
|
fixing phpcs with more colours given
|
QoboLtd_cakephp-search
|
train
|
php
|
459a485915e8e88298889d9ff9f78feef5b552ae
|
diff --git a/src/enforcers.js b/src/enforcers.js
index <HASH>..<HASH> 100644
--- a/src/enforcers.js
+++ b/src/enforcers.js
@@ -64,8 +64,8 @@ export let columnDescriptor = osom({
type: Any,
required: true,
validate (value) {
- let type = isFunction(value) ? value.name : value
- return isOneOf(COLUMN_TYPES, type)
+ let type = isFunction(value) ? value.name : String(value)
+ return isOneOf(COLUMN_TYPES, type.toLowerCase())
}
},
defaultTo: Any,
|
fix(enforcers): broken descriptor validation
Fix incorrect validation in `columnDescriptor` due to string casing. Also ensure that the `type` being checked is a string before casing it.
|
citycide_trilogy
|
train
|
js
|
832ef96188ff0ec6782fdbb9ceea729e3aa8681e
|
diff --git a/thefuck/rules/missing_space_before_subcommand.py b/thefuck/rules/missing_space_before_subcommand.py
index <HASH>..<HASH> 100644
--- a/thefuck/rules/missing_space_before_subcommand.py
+++ b/thefuck/rules/missing_space_before_subcommand.py
@@ -16,3 +16,6 @@ def match(command):
def get_new_command(command):
executable = _get_executable(command.script_parts[0])
return command.script.replace(executable, u'{} '.format(executable), 1)
+
+
+priority = 4000
|
#<I>: Lower priority of `missing_space_before_subcommand` rule
|
nvbn_thefuck
|
train
|
py
|
eb325981a77d6c0212b9b0676169563631001957
|
diff --git a/cairocffi/pixbuf.py b/cairocffi/pixbuf.py
index <HASH>..<HASH> 100644
--- a/cairocffi/pixbuf.py
+++ b/cairocffi/pixbuf.py
@@ -27,9 +27,11 @@ except ImportError:
__all__ = ['decode_to_image_surface']
gdk_pixbuf = dlopen(ffi, 'gdk_pixbuf-2.0', 'libgdk_pixbuf-2.0-0',
- 'libgdk_pixbuf-2.0.so')
-gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so')
-glib = dlopen(ffi, 'glib-2.0', 'libglib-2.0-0', 'libglib-2.0.so')
+ 'libgdk_pixbuf-2.0.so', 'libgdk_pixbuf-2.0.so.0')
+gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so',
+ 'libgobject-2.0.so.0')
+glib = dlopen(ffi, 'glib-2.0', 'libglib-2.0-0', 'libglib-2.0.so',
+ 'libglib-2.0.so.0')
try:
gdk = dlopen(ffi, 'gdk-3', 'gdk-x11-2.0', 'libgdk-win32-2.0-0',
'libgdk-x11-2.0.so')
|
Fix loading of gdk_pixbuf library on Ubuntu
|
Kozea_cairocffi
|
train
|
py
|
0fb8d82b8b241e5b9aaf68deabe8486ecea06596
|
diff --git a/lib/iso3166Data.js b/lib/iso3166Data.js
index <HASH>..<HASH> 100644
--- a/lib/iso3166Data.js
+++ b/lib/iso3166Data.js
@@ -367,8 +367,8 @@ module.exports = [
alpha3: 'CMR',
country_code: '237',
country_name: 'Cameroon',
- mobile_begin_with: ['7', '9'],
- phone_number_lengths: [8]
+ mobile_begin_with: ['6'],
+ phone_number_lengths: [9]
},
{
alpha2: 'CD',
|
New Cameroon phone numbering system since <I>
<URL>
|
AfterShip_phone
|
train
|
js
|
89b9a91de79cce3db6918ab2a45b8bad7798ee8f
|
diff --git a/src/Http/Controllers/Controller.php b/src/Http/Controllers/Controller.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/Controller.php
+++ b/src/Http/Controllers/Controller.php
@@ -4,6 +4,7 @@ namespace TCG\Voyager\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
+use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Storage;
@@ -15,6 +16,7 @@ use Validator;
abstract class Controller extends BaseController
{
use DispatchesJobs,
+ ValidatesRequests,
AuthorizesRequests,
AlertsMessages;
|
added ValidatesRequests in controller
|
laraveladminpanel_admin
|
train
|
php
|
40216023b1c2f6297dcbd3394ff0d9d596b668f8
|
diff --git a/padasip/filters/__init__.py b/padasip/filters/__init__.py
index <HASH>..<HASH> 100644
--- a/padasip/filters/__init__.py
+++ b/padasip/filters/__init__.py
@@ -263,6 +263,7 @@ def get_filter(name):
FILTER_CLASSES = [
FilterAP,
+ FilterGMCC,
FilterGNGD,
FilterLlncosh,
FilterLMF,
@@ -270,6 +271,7 @@ FILTER_CLASSES = [
FilterNLMF,
FilterNLMS,
FilterNSSLMS,
+ FilterOCNLMS,
FilterRLS,
FilterSSLMS,
]
|
Added GMCC and OCNLMS to __init__
|
matousc89_padasip
|
train
|
py
|
c752469d16b52731beacee95b113ec00736ba552
|
diff --git a/endless.go b/endless.go
index <HASH>..<HASH> 100644
--- a/endless.go
+++ b/endless.go
@@ -2,6 +2,7 @@ package endless
import (
"crypto/tls"
+ "errors"
"flag"
"fmt"
"log"
@@ -410,11 +411,12 @@ func (srv *endlessServer) hammerTime(d time.Duration) {
func (srv *endlessServer) fork() (err error) {
// only one server isntance should fork!
- runningServerReg.Lock()
- defer runningServerReg.Unlock()
if runningServersForked {
- return
+ return errors.New("another fork is running")
}
+ runningServerReg.Lock()
+ defer runningServerReg.Unlock()
+
runningServersForked = true
var files = make([]*os.File, len(runningServers))
|
fix: checking "runningServersForked" doesn't work expectedly after mutex lock when forking
|
fvbock_endless
|
train
|
go
|
2a4cc1cebd8796bce05a10d3c8de096dc604675f
|
diff --git a/config/initializers/access_rules.rb b/config/initializers/access_rules.rb
index <HASH>..<HASH> 100644
--- a/config/initializers/access_rules.rb
+++ b/config/initializers/access_rules.rb
@@ -59,7 +59,7 @@ AccessControl.map :require => [ :admin, :publisher, :contributor ] do |map|
project.menu "Articles", { :controller => "admin/content", :action => "index" }
project.submenu "All Articles", { :controller => "admin/content", :action => "index" }
project.submenu "New Article", { :controller => "admin/content", :action => "new" }
- project.submenu "Comments", { :controller => "admin/feedback", :action => "index" }
+ project.submenu "Feedback", { :controller => "admin/feedback", :action => "index" }
project.submenu "Categories", { :controller => "admin/categories", :action => "new" }
project.submenu "Tags", { :controller => "admin/tags", :action => "index" }
project.submenu "Article Types", { :controller => "admin/post_types", :action => "new" }
|
Consistent UI in admin sidebar for Feedback section - #<I>
Since admin "Feedback" page contains comments, pings and trackbacks,
have the sidebar item display same title as page itself. Helps provide
a consistent UI experience.
|
publify_publify
|
train
|
rb
|
3efe59aada479a50c3e9f93e423e034a5c100f28
|
diff --git a/EventListener/LayoutBoxSubscriber.php b/EventListener/LayoutBoxSubscriber.php
index <HASH>..<HASH> 100755
--- a/EventListener/LayoutBoxSubscriber.php
+++ b/EventListener/LayoutBoxSubscriber.php
@@ -14,7 +14,7 @@ namespace WellCommerce\Bundle\LayoutBundle\EventListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\PropertyAccess\PropertyAccess;
use WellCommerce\Bundle\AppBundle\Configurator\LayoutBoxConfiguratorInterface;
-use WellCommerce\Bundle\CoreBundle\Event\FormEvent;
+use WellCommerce\Component\Form\Event\FormEvent;
use WellCommerce\Bundle\CoreBundle\Event\ResourceEvent;
use WellCommerce\Bundle\CoreBundle\EventListener\AbstractEventSubscriber;
|
Moved FormEvent to Component
(cherry picked from commit ab<I>c4f4effc<I>d<I>ed<I>b<I>)
|
WellCommerce_WishlistBundle
|
train
|
php
|
3f57326b4e489e42cb1559362d84a34108e57ee3
|
diff --git a/tethne/readers/zotero.py b/tethne/readers/zotero.py
index <HASH>..<HASH> 100644
--- a/tethne/readers/zotero.py
+++ b/tethne/readers/zotero.py
@@ -386,7 +386,7 @@ class ZoteroParser(RDFParser):
self.full_text[fset_name][ident] = structuredfeature
-def read(path, corpus=True, index_by='uri', follow_links=True, **kwargs):
+def read(path, corpus=True, index_by='uri', follow_links=False, **kwargs):
"""
Read bibliographic data from Zotero RDF.
@@ -420,7 +420,7 @@ def read(path, corpus=True, index_by='uri', follow_links=True, **kwargs):
title and author names.
follow_links : bool
If ``True``, attempts to load full-text content from attached files
- (e.g. PDFs with embedded text).
+ (e.g. PDFs with embedded text). Default: False.
kwargs : kwargs
Passed to the :class:`.Corpus` constructor.
|
in Zotero reader, follow_links=False by default
|
diging_tethne
|
train
|
py
|
8923fad8a9b054fc4ec1f48aaa34916521cb167f
|
diff --git a/src/fury.js b/src/fury.js
index <HASH>..<HASH> 100644
--- a/src/fury.js
+++ b/src/fury.js
@@ -47,22 +47,11 @@ class Fury {
}
findAdapter(source, mediaType, method) {
- let adapter;
-
if (mediaType) {
- adapter = findAdapter(this.adapters, mediaType, method);
- } else {
- for (let i = 0; i < this.adapters.length; i += 1) {
- const current = this.adapters[i];
-
- if (current.detect && current.detect(source) && current[method]) {
- adapter = this.adapters[i];
- break;
- }
- }
+ return findAdapter(this.adapters, mediaType, method);
}
- return adapter;
+ return this.detect(source).filter(adapter => adapter[method])[0];
}
validate({ source, mediaType, adapterOptions }, done) {
|
refactor(findAdapter): Simplify and use detect method
|
apiaryio_fury.js
|
train
|
js
|
915d5fa4c4020536f2d41c21353b1477befa8af3
|
diff --git a/ot/optim.py b/ot/optim.py
index <HASH>..<HASH> 100644
--- a/ot/optim.py
+++ b/ot/optim.py
@@ -427,7 +427,7 @@ def solve_1d_linesearch_quad_funct(a, b, c):
f1 = a + f0 + df0
if a > 0: # convex
- minimum = min(1, max(0, -b / (2 * a)))
+ minimum = min(1, max(0, np.divide(-b, 2 * a)))
return minimum
else: # non convex
if f0 > f1:
|
python2 divide problem
|
rflamary_POT
|
train
|
py
|
edd9f067163a52061fb96d227b24b4e20be3e6a2
|
diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/lsctables.py
+++ b/glue/ligolw/lsctables.py
@@ -1,8 +1,4 @@
-<<<<<<< lsctables.py
# $Id$
-=======
-# $Id$
->>>>>>> 1.140.2.2
#
# Copyright (C) 2006 Kipp C. Cannon
#
|
Fixing artifacts from merge.
|
gwastro_pycbc-glue
|
train
|
py
|
677731259621a357214cf1787e219112a7301ec5
|
diff --git a/src/page_scrapers/__init__.py b/src/page_scrapers/__init__.py
index <HASH>..<HASH> 100644
--- a/src/page_scrapers/__init__.py
+++ b/src/page_scrapers/__init__.py
@@ -1,4 +1,4 @@
# Do not change this version manually.
# Versioning is managed by package_controller.
# To update the version run `pc version --patch | --minor | --major`
-__version__ = "2.1.0"
\ No newline at end of file
+__version__ = "2.2.0"
\ No newline at end of file
|
chore: <I>.
Updates the version from <I> to <I>.
|
alexseitsinger_page_scrapers
|
train
|
py
|
c1186a7f7dbc8297d38b1c4ee547deb06dface15
|
diff --git a/bcbio/variation/gatkjoint.py b/bcbio/variation/gatkjoint.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/gatkjoint.py
+++ b/bcbio/variation/gatkjoint.py
@@ -36,12 +36,13 @@ def _run_genomicsdb_import(vrn_files, region, out_file, data):
if not os.path.exists(out_dir):
with file_transaction(data, out_dir) as tx_out_dir:
broad_runner = broad.runner_from_config(data["config"])
+ cores = dd.get_cores(data)
params = ["-T", "GenomicsDBImport",
+ "--readerThreads", str(cores),
"--genomicsDBWorkspace", tx_out_dir,
"-L", bamprep.region_to_gatk(region)]
for vrn_file in vrn_files:
params += ["--variant", vrn_file]
- cores = dd.get_cores(data)
memscale = {"magnitude": 0.9 * cores, "direction": "increase"} if cores > 1 else None
broad_runner.run_gatk(params, memscale=memscale)
return out_dir
|
GATK4: GenomicsDBImport parallelization
Add multicore reading introduced in beta3 release.
|
bcbio_bcbio-nextgen
|
train
|
py
|
be62523e87c9f1e5faba4c6dedfadb7da3a22a04
|
diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php
index <HASH>..<HASH> 100644
--- a/src/Models/BaseElement.php
+++ b/src/Models/BaseElement.php
@@ -430,6 +430,7 @@ class BaseElement extends DataObject implements CMSPreviewable
break;
}
+ $templates[] = $value . $suffix . '_'. $this->getAreaRelationName();
$templates[] = $value . $suffix;
}
|
Adds ability to have templates for specific element areas
|
dnadesign_silverstripe-elemental
|
train
|
php
|
cb9abd3b8089e80b7eb210982d71a6efeb9ef9b0
|
diff --git a/src/python/dxpy/bindings/dxworkflow.py b/src/python/dxpy/bindings/dxworkflow.py
index <HASH>..<HASH> 100644
--- a/src/python/dxpy/bindings/dxworkflow.py
+++ b/src/python/dxpy/bindings/dxworkflow.py
@@ -473,7 +473,7 @@ class DXWorkflow(DXDataObject, DXExecutable):
:returns: Object handler of the newly created analysis
:rtype: :class:`~dxpy.bindings.dxanalysis.DXAnalysis`
- Run the associated workflow.
+ Run the associated workflow. See :meth:`dxpy.bindings.dxapplet.DXExecutable.run` for additional args.
When providing input for the workflow, keys should be of one of the following forms:
@@ -492,6 +492,5 @@ class DXWorkflow(DXDataObject, DXExecutable):
the "inputSpec" of this workflow's description if it has
been exported for this purpose)
- See :meth:`dxpy.bindings.dxapplet.DXExecutable.run` for the available args.
'''
return super(DXWorkflow, self).run(workflow_input, *args, **kwargs)
|
Clarify inheritance of args in DXWorkflow.run
|
dnanexus_dx-toolkit
|
train
|
py
|
38fda202470f228a1fded2f4298acdaec3c00ac7
|
diff --git a/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/contacts/ContactsSyncActor.java b/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/contacts/ContactsSyncActor.java
index <HASH>..<HASH> 100644
--- a/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/contacts/ContactsSyncActor.java
+++ b/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/contacts/ContactsSyncActor.java
@@ -61,7 +61,7 @@ public class ContactsSyncActor extends ModuleActor {
}
}
notifyState();
- // self().send(new PerformSync());
+ self().send(new PerformSync());
}
public void performSync() {
|
fix(core): recover contact sync
|
actorapp_actor-platform
|
train
|
java
|
f5d9443e9128bc9ffa3263d0f72475fc3358dbe9
|
diff --git a/lib/injectedlogger.rb b/lib/injectedlogger.rb
index <HASH>..<HASH> 100644
--- a/lib/injectedlogger.rb
+++ b/lib/injectedlogger.rb
@@ -6,7 +6,7 @@ module InjectedLogger
# inject a default logger in case no one has set one for you:
#
# module MyLogger
- # InjectedLogger.inject do
+ # InjectedLogger.declare do
# require 'logger'
# # parameters are inject() params, none is required, but if
# # logger is not present, a default one will be used.
|
injectedlogger: fix typo in comments
|
unleashed_injectedlogger
|
train
|
rb
|
fae4730bade312914693c0a9b0afcd3f23ea82a7
|
diff --git a/commands/pull_request.go b/commands/pull_request.go
index <HASH>..<HASH> 100644
--- a/commands/pull_request.go
+++ b/commands/pull_request.go
@@ -279,11 +279,7 @@ func createPullRequestMessage(base, head, fullBase, fullHead string) (string, er
}
if tmplate := github.GetPullRequestTemplate(); tmplate != "" {
- if defaultMsg != "" {
- defaultMsg = defaultMsg + tmplate
- } else {
- defaultMsg = tmplate
- }
+ defaultMsg = github.GeneratePRTemplate(defaultMsg)
}
cs := git.CommentChar()
|
Implement GeneratePRTemplate in pull_request.go
Implements the GeneratePRTemplate in pull_request.go instead of the
custom logic that previously existed in the file. Addresses:
* Title being defaulted as the first line of the template
* Commit messages not defaulting as the title only properly
|
github_hub
|
train
|
go
|
51c6b348599d660f43318318333917fe0803548c
|
diff --git a/docker/client.py b/docker/client.py
index <HASH>..<HASH> 100644
--- a/docker/client.py
+++ b/docker/client.py
@@ -1038,11 +1038,11 @@ class Client(requests.Session):
res = self._post(url)
self._raise_for_status(res)
- def wait(self, container):
+ def wait(self, container, timeout=None):
if isinstance(container, dict):
container = container.get('Id')
url = self._url("/containers/{0}/wait".format(container))
- res = self._post(url, timeout=None)
+ res = self._post(url, timeout=timeout)
self._raise_for_status(res)
json_ = res.json()
if 'StatusCode' in json_:
|
Added timeout param to Client.wait
|
docker_docker-py
|
train
|
py
|
a49f903ebdb8445912699d4d23001f409af0d9e0
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1948,10 +1948,21 @@ function pages(options, callback) {
limit: apos.sanitizeInteger(data.limit, 50),
skip: apos.sanitizeInteger(data.skip, 0)
};
+ var ids;
if (data.term !== undefined) {
options.titleSearch = data.term;
} else if (data.values !== undefined) {
- criteria._id = { $in: data.values };
+ ids = [];
+ if (data.values.length && (typeof(data.values[0]) === 'object')) {
+ ids = _.pluck(data.values, 'value');
+ } else {
+ ids = data.values;
+ }
+ if (!ids.length) {
+ criteria._id = '_never_happens';
+ } else {
+ criteria._id = { $in: ids };
+ }
} else {
// Since arrays in REST queries are ambiguous,
// treat the absence of either parameter as an
@@ -1982,8 +1993,8 @@ function pages(options, callback) {
}
var pages = results.pages;
// Put the pages in id order, $in does NOT do this
- if (data.values) {
- pages = apos.orderById(data.values, pages);
+ if (ids) {
+ pages = apos.orderById(ids, pages);
}
return res.send(
JSON.stringify(_.map(pages, function(snippet) {
|
page autocomplete route accepts an array of objects with 'value' properties as an alternative to a flat array of ids
|
apostrophecms-legacy_apostrophe-pages
|
train
|
js
|
b518360a9b5148af59915cd2e7a61031754a433b
|
diff --git a/lib/mongoose-paginate.js b/lib/mongoose-paginate.js
index <HASH>..<HASH> 100644
--- a/lib/mongoose-paginate.js
+++ b/lib/mongoose-paginate.js
@@ -1,4 +1,3 @@
-
/**
* @list dependencies
**/
@@ -28,7 +27,7 @@ mongoose.Model.paginate = function(q, pageNumber, resultsPerPage, callback) {
if (error) {
callback(error, null, null);
} else {
- var pageCount = Math.floor(count / resultsPerPage);
+ var pageCount = Math.ceil(count / resultsPerPage);
if (pageCount == 0) {
pageCount = 1;
};
@@ -39,4 +38,4 @@ mongoose.Model.paginate = function(q, pageNumber, resultsPerPage, callback) {
});
};
-/* EOF */
\ No newline at end of file
+/* EOF */
|
Fixed pageCount math operation
You have to return the smallest integer greater than or equal to a number.
So if count/resultsPerPage = <I> you need pageCount=2 and not =1 ;)
|
edwardhotchkiss_mongoose-paginate
|
train
|
js
|
c054eb9f236909227e1b2ed459f1337115142a97
|
diff --git a/km3pipe/pumps/hdf5.py b/km3pipe/pumps/hdf5.py
index <HASH>..<HASH> 100644
--- a/km3pipe/pumps/hdf5.py
+++ b/km3pipe/pumps/hdf5.py
@@ -168,6 +168,7 @@ class HDF5Sink(Module):
trigger_mask = evt.trigger_mask
frame_index = evt.frame_index
+ self.event_info.setdefault('event_id', []).append(self.index)
self.event_info.setdefault('time', []).append(timestamp)
self.event_info.setdefault('det_id', []).append(det_id)
self.event_info.setdefault('mc_id', []).append(mc_id)
|
Adds event id to event info
|
tamasgal_km3pipe
|
train
|
py
|
f754880968ba6684f6d273fd92f5efb297ed6efb
|
diff --git a/lxd/main_init.go b/lxd/main_init.go
index <HASH>..<HASH> 100644
--- a/lxd/main_init.go
+++ b/lxd/main_init.go
@@ -16,6 +16,12 @@ import (
"github.com/lxc/lxd/shared"
)
+type poolType string
+
+const poolTypeAny poolType = ""
+const poolTypeLocal poolType = "local"
+const poolTypeRemote poolType = "remote"
+
type cmdInitData struct {
Node initDataNode `yaml:",inline"`
Cluster *initDataCluster `json:"cluster" yaml:"cluster"`
|
main/init: Define poolType type and constants
Uses concept of "any" rather than "all" to align with instancetype.Any constant.
|
lxc_lxd
|
train
|
go
|
341351e6ab304c36f00c71685fbf1580a2da584b
|
diff --git a/src/localimport/__init__.py b/src/localimport/__init__.py
index <HASH>..<HASH> 100755
--- a/src/localimport/__init__.py
+++ b/src/localimport/__init__.py
@@ -12,10 +12,7 @@ import typing as t
import zipfile
if t.TYPE_CHECKING:
- from importlib.machinery import ModuleSpec
- from types import ModuleType
- class _MetaPathFinder(t.Protocol):
- def find_spec(self, fullname: str, path: t.Optional[t.Sequence[str]], target: t.Optional[ModuleType] = ...) -> t.Optional[ModuleSpec]: ...
+ from sys import _MetaPathFinder
def is_local(filename: str, pathlist: t.List[str]) -> bool:
|
import _MetaPathFinder from sys under typing
|
NiklasRosenstein_py-localimport
|
train
|
py
|
264acd48de0f4b59848c621fafb9cc620ac3ecf3
|
diff --git a/application/Config/Database.php b/application/Config/Database.php
index <HASH>..<HASH> 100644
--- a/application/Config/Database.php
+++ b/application/Config/Database.php
@@ -92,7 +92,7 @@ class Database extends \CodeIgniter\Database\Config
// Under Travis-CI, we can set an ENV var named 'DB_GROUP'
// so that we can test against multiple databases.
- if ($group = getenv('DB_GROUP'))
+ if ($group = getenv('DB'))
{
if (is_file(TESTPATH.'travis/Database.php'))
{
|
Ooops. Missed changing env var name
|
codeigniter4_CodeIgniter4
|
train
|
php
|
ba984b1bafb646a91ba007e597ab5d5d594b78b9
|
diff --git a/simulator/src/main/java/com/hazelcast/simulator/coordinator/TestCaseRunner.java b/simulator/src/main/java/com/hazelcast/simulator/coordinator/TestCaseRunner.java
index <HASH>..<HASH> 100644
--- a/simulator/src/main/java/com/hazelcast/simulator/coordinator/TestCaseRunner.java
+++ b/simulator/src/main/java/com/hazelcast/simulator/coordinator/TestCaseRunner.java
@@ -344,7 +344,7 @@ final class TestCaseRunner implements TestPhaseListener {
private static final class TestCaseAbortedException extends RuntimeException {
- TestPhase testPhase;
+ private TestPhase testPhase;
TestCaseAbortedException(String message, TestPhase testPhase) {
super(message);
|
Minor cleanup in TestCaseRunner.
|
hazelcast_hazelcast-simulator
|
train
|
java
|
bc289093566effd1e5b78ed0af5e2f3a049e88bb
|
diff --git a/tests/test_binary_vdf.py b/tests/test_binary_vdf.py
index <HASH>..<HASH> 100644
--- a/tests/test_binary_vdf.py
+++ b/tests/test_binary_vdf.py
@@ -14,7 +14,7 @@ class BinaryVDF(unittest.TestCase):
def test_simple(self):
pairs = [
('a', 'test'),
- ('a2', b'\xff\xfe0\x041\x042\x043\x04'.decode('utf-16')),
+ ('a2', b'\xd0\xb0\xd0\xb1\xd0\xb2\xd0\xb3'.decode('utf-8')),
('bb', 1),
('bb2', -500),
('ccc', 1.0),
|
fix failing test after dd<I>fb1 change
|
ValvePython_vdf
|
train
|
py
|
c3a1d227379e54cefd6a4f167b4cfd9fd0fd73b1
|
diff --git a/test/unit/dependency_test.rb b/test/unit/dependency_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/dependency_test.rb
+++ b/test/unit/dependency_test.rb
@@ -127,7 +127,7 @@ class DependencyTest < ActiveSupport::TestCase
dependency = Dependency.create(gem_dependency: @gem_dependency, version: @version)
assert !dependency.new_record?
assert !dependency.errors[:base].present?
- assert_nil Rubygem.find_by_name(@rubygem_name)
+ assert_nil Rubygem.find_by(name: @rubygem_name)
assert_equal "other-name", dependency.unresolved_name
assert_equal "other-name", dependency.name
@@ -152,7 +152,7 @@ class DependencyTest < ActiveSupport::TestCase
dependency = Dependency.create(gem_dependency: @gem_dependency)
assert dependency.new_record?
assert dependency.errors[:rubygem].present?
- assert_nil Rubygem.find_by_name("")
+ assert_nil Rubygem.find_by(name: "")
end
end
|
use new finder syntax for dependency model test
|
rubygems_rubygems.org
|
train
|
rb
|
d467590b79bfb9a07349c050246191be74dce991
|
diff --git a/ext_tables.php b/ext_tables.php
index <HASH>..<HASH> 100644
--- a/ext_tables.php
+++ b/ext_tables.php
@@ -48,9 +48,11 @@ if (TYPO3_MODE == 'BE') {
/***************
- * BackendLayoutDataProvider
+ * BackendLayoutDataProvider for versions below 7.4
*/
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider'][$_EXTKEY] = 'BK2K\BootstrapPackage\Hooks\Options\BackendLayoutDataProvider';
+if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 7004000) {
+ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider']['pagets'] = 'BK2K\BootstrapPackage\Hooks\Options\BackendLayoutDataProvider';
+}
/***************
|
[TASK] Disable BackendLayoutDataProvider for TYPO3 versions below <I> and adapt registration to core provider prefix for PageTS
|
benjaminkott_bootstrap_package
|
train
|
php
|
ee44aee1ca5652ce598568bef0c973ed0b19be1a
|
diff --git a/plugins/common/shim/example/cmd/main.go b/plugins/common/shim/example/cmd/main.go
index <HASH>..<HASH> 100644
--- a/plugins/common/shim/example/cmd/main.go
+++ b/plugins/common/shim/example/cmd/main.go
@@ -30,7 +30,7 @@ var err error
//
// shim.AddInput(myInput)
//
-// // now the shim.Run() call as below.
+// // now the shim.Run() call as below. Note the shim is only intended to run a single plugin.
//
func main() {
// parse command line options
@@ -52,7 +52,7 @@ func main() {
os.Exit(1)
}
- // run the input plugin(s) until stdin closes or we receive a termination signal
+ // run a single plugin until stdin closes or we receive a termination signal
if err := shim.Run(*pollInterval); err != nil {
fmt.Fprintf(os.Stderr, "Err: %s\n", err)
os.Exit(1)
|
clarify docs around shim plugin loading
|
influxdata_telegraf
|
train
|
go
|
f0bfcd505efb816e51a2caa8e1fad3e522b4a2d1
|
diff --git a/bakery/tasks.py b/bakery/tasks.py
index <HASH>..<HASH> 100644
--- a/bakery/tasks.py
+++ b/bakery/tasks.py
@@ -17,17 +17,17 @@ def run(command, cwd = None, log = None):
p = subprocess.Popen(command, shell = True, cwd = cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
if log:
- log.write('\n@@Command: %s' % command)
- log.write('\n@@Output: %s' % stdout)
+ log.write('\nCommand: %s' % command)
+ log.write('\nOutput: %s' % stdout)
if stderr:
- log.write('\n@@Error: %s' % stderr)
+ log.write('\nError: %s' % stderr)
def prun(command, cwd, log=None):
p = subprocess.Popen(command, shell = True, cwd = cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout = p.communicate()[0]
if log:
- log.write('\n@@Command: %s' % command)
- log.write('\n@@Output: %s' % stdout)
+ log.write('\nCommand: %s' % command)
+ log.write('\nOutput: %s' % stdout)
return stdout
@job
|
Removing @@ from log output so it looks cleaner
|
googlefonts_fontbakery
|
train
|
py
|
5caecb07e34acde19763cf8341e3db2ce465cdeb
|
diff --git a/src/rpc/client.js b/src/rpc/client.js
index <HASH>..<HASH> 100644
--- a/src/rpc/client.js
+++ b/src/rpc/client.js
@@ -3,7 +3,7 @@ import { isAddress } from '../wallet'
import semver from 'semver'
import { RPC_VERSION, DEFAULT_RPC, NEO_NETWORK } from '../consts'
-const versionRegex = /NEO: (\d+\.\d+\.\d+)/
+const versionRegex = /NEO:(\d+\.\d+\.\d+)/
/**
* @class RPCClient
* @classdesc
diff --git a/test/integration/rpc/query.js b/test/integration/rpc/query.js
index <HASH>..<HASH> 100644
--- a/test/integration/rpc/query.js
+++ b/test/integration/rpc/query.js
@@ -216,7 +216,7 @@ describe('Query', function () {
.then((res) => {
console.log(res)
res.result.should.have.all.keys(['port', 'nonce', 'useragent'])
- res.result.useragent.should.match(/NEO: (\d+\.\d+\.\d+)/)
+ res.result.useragent.should.match(/NEO:(\d+\.\d+\.\d+)/)
})
})
|
rpc(client): fix regex string for getVersion
cherrypicked from dev to fix failing integration tests
|
CityOfZion_neon-js
|
train
|
js,js
|
c74490c6edf07964a2011c8fb0c356ed3564ac2e
|
diff --git a/juicer/juicer/Juicer.py b/juicer/juicer/Juicer.py
index <HASH>..<HASH> 100644
--- a/juicer/juicer/Juicer.py
+++ b/juicer/juicer/Juicer.py
@@ -42,7 +42,7 @@ class Juicer(object):
# get list of all repos, then parse down to the ones we want
url = self.base_url + '/repositories/'
- _r = self.get(url)
+ _r = self.jc.get(url)
repo_list = simplejson.loads(str(_r.content))
|
use common get (no longer part of self)
|
juicer_juicer
|
train
|
py
|
de1512e4025f77c109ce4a28a0c881be9109bd77
|
diff --git a/src/Config.php b/src/Config.php
index <HASH>..<HASH> 100644
--- a/src/Config.php
+++ b/src/Config.php
@@ -2,8 +2,6 @@
namespace Fei\Service\Connect\Client;
-use Fei\Service\Connect\Common\ProfileAssociation\Message\RequestMessageInterface;
-
/**
* Class Config
*
@@ -121,21 +119,6 @@ class Config
callable $callback,
$profileAssociationPath = '/connect/profile-association'
) {
- $parameters = (new \ReflectionFunction($callback))->getParameters();
-
- if (!isset($parameters[0]) || $parameters[0]->getClass() == null ||
- ($parameters[0]->getClass()->getName() != RequestMessageInterface::class &&
- !in_array(RequestMessageInterface::class, $parameters[0]->getClass()->getInterfaceNames())
- )
- ) {
- throw new \LogicException(
- sprintf(
- 'First parameter of the profile association callback must be a type of %s',
- RequestMessageInterface::class
- )
- );
- }
-
$this->profileAssociationCallback = $callback;
$this->profileAssociationPath = $profileAssociationPath;
|
Remove callback signature control on profile association callback setter
|
flash-global_connect-client
|
train
|
php
|
33421ae8c6f8de4361103a3fd588c74424480c7c
|
diff --git a/h2o-core/src/main/java/water/fvec/Vec.java b/h2o-core/src/main/java/water/fvec/Vec.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/fvec/Vec.java
+++ b/h2o-core/src/main/java/water/fvec/Vec.java
@@ -916,10 +916,7 @@ public class Vec extends Keyed<Vec> {
public EnumWrappedVec toEnum() {
if( isEnum() ) return adaptTo(domain()); // Use existing domain directly
if( !isInt() ) throw new IllegalArgumentException("Enum conversion only works on integer columns");
- int min, max;
- // Right now, limited to small dense integers.
- if( (min=(int)min()) < 0 || (max=(int)max()) > 1000000 )
- throw new IllegalArgumentException("Enum conversion only works on small integers, but min="+min()+" and max = "+max());
+ int min = (int) min(), max = (int) max();
// try to do the fast domain collection
long domain[] = (min >=0 && max < Integer.MAX_VALUE-4) ? new CollectDomainFast(max).doAll(this).domain() : new CollectDomain().doAll(this).domain();
if( domain.length > Categorical.MAX_ENUM_SIZE )
|
Adds change that was accidentally left out of commit f2f<I>b1ed<I>c8d7ab<I>d<I>d<I>b<I>d0 [f2f<I>b1]
|
h2oai_h2o-3
|
train
|
java
|
ae8f9e1137f7b444e5a137db73b5a514388858a4
|
diff --git a/lib/express/static.js b/lib/express/static.js
index <HASH>..<HASH> 100644
--- a/lib/express/static.js
+++ b/lib/express/static.js
@@ -43,13 +43,14 @@ exports.File = Class({
send: function(request) {
var cache, file = this.path
- if (set('cache static files') && (cache = request.cache.get(file)))
- request.contentType(cache.type),
- request.halt(200, cache.content, 'binary')
+ if (set('cache static files') && (cache = request.cache.get(file))) {
+ request.contentType(cache.type)
+ return request.halt(200, cache.content, 'binary')
+ }
path.exists(file, function(exists){
- if (!exists) request.halt()
+ if (!exists) return request.halt()
posix.stat(file).addCallback(function(stats){
- if (!stats.isFile()) request.halt()
+ if (!stats.isFile()) return request.halt()
posix.cat(file, 'binary').addCallback(function(content){
request.contentType(file)
if (set('cache static files'))
|
bug fix for static.send method. request.halt() didn't return appropriately
|
expressjs_express
|
train
|
js
|
49cb1a289f19565132824e67bb83a2e255b13c8a
|
diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go
index <HASH>..<HASH> 100644
--- a/integration-cli/docker_cli_run_unix_test.go
+++ b/integration-cli/docker_cli_run_unix_test.go
@@ -114,7 +114,7 @@ func getCgroupPaths(test string) map[string]string {
for _, line := range strings.Split(test, "\n") {
parts := strings.Split(line, ":")
if len(parts) != 3 {
- fmt.Printf("unexpected file format for /proc/self/cgroup - %q", line)
+ fmt.Printf("unexpected file format for /proc/self/cgroup - %q\n", line)
continue
}
cgroupPaths[parts[1]] = parts[2]
@@ -132,7 +132,7 @@ func TestRunContainerWithCgroupParent(t *testing.T) {
t.Fatalf("failed to read '/proc/self/cgroup - %v", err)
}
selfCgroupPaths := getCgroupPaths(string(data))
- selfCpuCgroup, found := selfCgroupPaths["cpu"]
+ selfCpuCgroup, found := selfCgroupPaths["memory"]
if !found {
t.Fatalf("unable to find self cpu cgroup path. CgroupsPath: %v", selfCgroupPaths)
}
|
Update --cgroup-parent cli integration test to use "memory" cgroup for detecting the test's
cgroups path instead of CPU.
Docker-DCO-<I>-
|
moby_moby
|
train
|
go
|
dcb77081ca9047148fd408cccdc4675abe9edad4
|
diff --git a/src/behavior.js b/src/behavior.js
index <HASH>..<HASH> 100644
--- a/src/behavior.js
+++ b/src/behavior.js
@@ -119,9 +119,9 @@ var behavior = (function() {
return;
if(container.childNodes.length > 0)
- cursor.moveAfter(container.lastChild);
+ cursor.moveAtEnd(container);
else
- cursor.moveBefore(container);
+ cursor.moveAtBeginning(container);
cursor.setSelection();
fragment = document.createDocumentFragment();
@@ -152,15 +152,15 @@ var behavior = (function() {
switch(direction) {
case 'before':
previous = block.previous(element);
- if(previous) {
- cursor.moveAfter(previous);
+ if (previous) {
+ cursor.moveAtEnd(previous);
cursor.setSelection();
}
break;
case 'after':
next = block.next(element);
- if(next) {
- cursor.moveBefore(next);
+ if (next) {
+ cursor.moveAtBeginning(next);
cursor.setSelection();
}
break;
|
Use correct Cursor move methods
The new #moveAtBeginning and #moveAtEnd are the correct methods to place the cursor at the beginning or end of a container.
|
livingdocsIO_editable.js
|
train
|
js
|
9c5734870fe8d6f23f2073307a14b0eb086b7ce7
|
diff --git a/build/task.js b/build/task.js
index <HASH>..<HASH> 100644
--- a/build/task.js
+++ b/build/task.js
@@ -1,4 +1,4 @@
-var Walker = require( 'Walker' ),
+var Walker = require( 'walker' ),
path = require( 'path' ),
fs = require( 'fs' ),
handlebars = require( 'handlebars' ),
@@ -48,4 +48,4 @@ module.exports = function() {
fs.writeFileSync( __dirname + '/ns.js', ns );
fs.writeFile( indexWritePath, indexTemplate( data ), done );
});
-};
\ No newline at end of file
+};
|
Fix issue including files with incorrect capitalisation on case-sensitive filesystesm (e.g. Linux)
|
golden-layout_golden-layout
|
train
|
js
|
e0852485d61a350ffc821ad21c2472067dc8de86
|
diff --git a/metric_tank/metric_tank.go b/metric_tank/metric_tank.go
index <HASH>..<HASH> 100644
--- a/metric_tank/metric_tank.go
+++ b/metric_tank/metric_tank.go
@@ -113,6 +113,7 @@ var metricsActive met.Gauge
var metricsToEsOK met.Count
var metricsToEsFail met.Count
var esPutDuration met.Timer
+var clusterPrimary met.Gauge
func main() {
startupTime = time.Now()
@@ -324,6 +325,7 @@ func initMetrics(stats met.Backend) {
metricsToEsOK = stats.NewCount("metrics_to_es.ok")
metricsToEsFail = stats.NewCount("metrics_to_es.fail")
esPutDuration = stats.NewTimer("es_put_duration", 0)
+ clusterPrimary = stats.NewGauge("cluster.primary", 0)
// run a collector for some global stats
go func() {
@@ -339,6 +341,13 @@ func initMetrics(stats met.Backend) {
alloc.Value(int64(m.Alloc))
totalAlloc.Value(int64(m.TotalAlloc))
sysBytes.Value(int64(m.Sys))
+ var px int64
+ if clusterStatus.IsPrimary() {
+ px = 1
+ } else {
+ px = 0
+ }
+ clusterPrimary.Value(px)
case update := <-totalPoints:
currentPoints += update
}
|
Track cluster primary status in statsd
|
grafana_metrictank
|
train
|
go
|
5d1139ea71b8d36fc4d9ef040aa00698e9b797c4
|
diff --git a/core-bundle/src/Resources/contao/controllers/FrontendIndex.php b/core-bundle/src/Resources/contao/controllers/FrontendIndex.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/controllers/FrontendIndex.php
+++ b/core-bundle/src/Resources/contao/controllers/FrontendIndex.php
@@ -12,7 +12,6 @@ namespace Contao;
use Contao\CoreBundle\Exception\AccessDeniedException;
use Contao\CoreBundle\Exception\PageNotFoundException;
-use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
@@ -43,8 +42,6 @@ class FrontendIndex extends \Frontend
* Run the controller
*
* @return Response
- *
- * @throws AccessDeniedException
*/
public function run()
{
@@ -80,9 +77,15 @@ class FrontendIndex extends \Frontend
}
/**
- * @param \PageModel|\Model\Collection $pageModel
+ * Render a page
+ *
+ * @param Model\Collection|PageModel[]|PageModel $pageModel
*
- * @return RedirectResponse|Response
+ * @return Response
+ *
+ * @throws \LogicException
+ * @throws PageNotFoundException
+ * @throws AccessDeniedException
*/
public function renderPage($pageModel)
{
|
[Core] Fix the phpDoc comments
|
contao_contao
|
train
|
php
|
9717432920d106fe84543af6822a6be8624fef11
|
diff --git a/lib/vagrant.rb b/lib/vagrant.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant.rb
+++ b/lib/vagrant.rb
@@ -339,4 +339,6 @@ if Vagrant.plugins_enabled?
end
raise Vagrant::Errors::PluginLoadError, message: e.to_s
end
+else
+ global_logger.debug("Plugin loading is currently disabled.")
end
|
Add logger output when plugin loading is disabled
|
hashicorp_vagrant
|
train
|
rb
|
6ff642720e8321ee3d108af47b1ceda1d6f875d0
|
diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -32,7 +32,7 @@ type Options = {|
srcRoot?: string,
staticRoot?: string,
template?: string,
- cspDirectives?: object
+ cspDirectives?: Object
|}
*/
@@ -49,7 +49,7 @@ type InternalOptions = {|
srcRoot: string,
staticRoot: string,
template: string,
- cspDirectives: object
+ cspDirectives: Object
|}
*/
|
Object is the type, not object
|
github_webpack-config-github
|
train
|
js
|
b5df2d409b121c10c2ace71fb2ac5ff3b2ef662e
|
diff --git a/nanolyse/version.py b/nanolyse/version.py
index <HASH>..<HASH> 100644
--- a/nanolyse/version.py
+++ b/nanolyse/version.py
@@ -1 +1 @@
-__version__ = "1.1.2"
+__version__ = "1.1.3"
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ setup(
url='https://github.com/wdecoster/nanolyse',
author='Wouter De Coster',
author_email='[email protected]',
- license='MIT',
+ license='GPLv3',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
|
fix license field in setup.py
as requested by <URL>
|
wdecoster_nanolyse
|
train
|
py,py
|
c20b21881afd29ce221e6376af03e45959fdda2d
|
diff --git a/chess/gaviota.py b/chess/gaviota.py
index <HASH>..<HASH> 100644
--- a/chess/gaviota.py
+++ b/chess/gaviota.py
@@ -38,10 +38,6 @@ LOGGER = logging.getLogger(__name__)
NOSQUARE = 64
NOINDEX = -1
-WHITES = 1 << 6
-BLACKS = 1 << 7
-
-NOPIECE = 0
PAWN = 1
KNIGHT = 2
BISHOP = 3
@@ -49,20 +45,6 @@ ROOK = 4
QUEEN = 5
KING = 6
-wK = KING | WHITES
-wP = PAWN | WHITES
-wN = KNIGHT | WHITES
-wB = BISHOP | WHITES
-wR = ROOK | WHITES
-wQ = QUEEN | WHITES
-
-bK = KING | BLACKS
-bP = PAWN | BLACKS
-bN = KNIGHT | BLACKS
-bB = BISHOP | BLACKS
-bR = ROOK | BLACKS
-bQ = QUEEN | BLACKS
-
MAX_KKINDEX = 462
MAX_PPINDEX = 576
MAX_PpINDEX = 24 * 48
|
Remove unused constants from chess.gaviota
|
niklasf_python-chess
|
train
|
py
|
1b6137504c92cb31b750f72746fd64e58a9fe38d
|
diff --git a/processing/src/main/java/io/druid/query/UnionDataSource.java b/processing/src/main/java/io/druid/query/UnionDataSource.java
index <HASH>..<HASH> 100644
--- a/processing/src/main/java/io/druid/query/UnionDataSource.java
+++ b/processing/src/main/java/io/druid/query/UnionDataSource.java
@@ -101,4 +101,12 @@ public class UnionDataSource implements DataSource
{
return dataSources.hashCode();
}
+
+ @Override
+ public String toString()
+ {
+ return "UnionDataSource{" +
+ "dataSources=" + dataSources +
+ '}';
+ }
}
|
Add toString for better logging
|
apache_incubator-druid
|
train
|
java
|
c3d6458062896b44ac4a2020f93b761fd9886065
|
diff --git a/src/Providers/AuthServiceProvider.php b/src/Providers/AuthServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Providers/AuthServiceProvider.php
+++ b/src/Providers/AuthServiceProvider.php
@@ -135,10 +135,6 @@ class AuthServiceProvider extends ServiceProvider
'ability' => config('cortex.auth.models.ability'),
]);
- // Register attributes entities
- ! app()->bound('rinvex.attributes.entities') || app('rinvex.attributes.entities')->push('admin');
- ! app()->bound('rinvex.attributes.entities') || app('rinvex.attributes.entities')->push('member');
- ! app()->bound('rinvex.attributes.entities') || app('rinvex.attributes.entities')->push('manager');
// Override middlware
$this->overrideMiddleware($router);
|
Drop rinvex/laravel-attributes reference as it's no longer required by this package
|
rinvex_cortex-auth
|
train
|
php
|
fbbae9df78643cb4569ee81444ba8edf37f666ff
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -14,7 +14,7 @@
import sys
import os
-from .s3upload import __version__
+from s3upload import __version__
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
|
Fix import in sphinx conf.
|
mattaustin_django-storages-s3upload
|
train
|
py
|
2330537ee70874f5182433428ac1fe69d875dca6
|
diff --git a/fedmsg/tests/test_hub.py b/fedmsg/tests/test_hub.py
index <HASH>..<HASH> 100644
--- a/fedmsg/tests/test_hub.py
+++ b/fedmsg/tests/test_hub.py
@@ -21,8 +21,6 @@ import os
from time import sleep, time
from uuid import uuid4
-from unittest import TestCase
-
from moksha.tests.test_hub import simulate_reactor
from moksha.hub.hub import MokshaHub
from moksha.hub import CentralMokshaHub
@@ -72,7 +70,7 @@ def test_init_missing_endpoint():
context = FedMsgContext(**config)
-class TestHub(TestCase):
+class TestHub(unittest.TestCase):
def setUp(self):
config = load_config()
@@ -229,3 +227,7 @@ class TestHub(TestCase):
# Verify that we received no message.
eq_(len(messages_received), 0)
+
+
+if __name__ == '__main__':
+ unittest.main()
|
Bootstrap for test_hub.
|
fedora-infra_fedmsg
|
train
|
py
|
67a2264ac6b3f88ccc0addedb7578ab55b5a98e8
|
diff --git a/src/Builder.php b/src/Builder.php
index <HASH>..<HASH> 100644
--- a/src/Builder.php
+++ b/src/Builder.php
@@ -220,7 +220,7 @@ class Builder implements BuilderInterface
};
$strategy = $closure->bindTo(null, $strategy[0]);
}
- $slug = $this->slug.Map::DELIMITER.$slug;
+ $slug = empty($slug) ? $this->slug : $this->slug.Map::DELIMITER.$slug;
return new Behavior($slug, $strategy, $this->logger);
}
|
Now the Behavior gets created correctly when there is a single word slug. In that case the behavior slug is equal to the feature slug
|
zumba_swivel
|
train
|
php
|
736c3c4ce5d133dd87a29c5e24f905199c10f759
|
diff --git a/lib/tablelib.php b/lib/tablelib.php
index <HASH>..<HASH> 100644
--- a/lib/tablelib.php
+++ b/lib/tablelib.php
@@ -528,7 +528,7 @@ class flexible_table {
}
else {
// took out nowrap for accessibility, might need replacement
- echo '<th class="header c'.$index.$this->column_class[$column].'" '.$this->make_styles_string($this->column_style[$column]).' scope="col">'.$this->headers[$index].$icon_sort.'<div class="commands">'.$icon_hide.'</div></th>';
+ echo '<th class="header c'.$index.$this->column_class[$column].'" '.$this->make_styles_string($this->column_style[$column]).' scope="col" style="white-space:nowrap;">'.$this->headers[$index].$icon_sort.'<div class="commands">'.$icon_hide.'</div></th>';
}
}
|
putting nowarp back into table with proper style
|
moodle_moodle
|
train
|
php
|
219533dae0a46c328fbada86df568cbca270f63a
|
diff --git a/spec/cassette_spec.rb b/spec/cassette_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cassette_spec.rb
+++ b/spec/cassette_spec.rb
@@ -247,10 +247,6 @@ describe VCR::Cassette do
end
end
- after do
- VCR::Config.clear_hooks
- end
-
it "loads the recorded interactions from the library yml file" do
VCR::Config.cassette_library_dir = File.expand_path(File.dirname(__FILE__) + "/fixtures/#{YAML_SERIALIZATION_VERSION}/cassette_spec")
cassette = VCR::Cassette.new('example', :record => record_mode)
@@ -324,10 +320,6 @@ describe VCR::Cassette do
end
end
- after do
- VCR::Config.clear_hooks
- end
-
it "should update interactions before they're recorded" do
recorded_interactions = [
VCR::HTTPInteraction.new('req_sig_1', 'response_1')
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -29,6 +29,7 @@ RSpec.configure do |config|
VCR::Config.default_cassette_options = { :record => :new_episodes }
VCR::Config.stub_with :fakeweb
+ VCR::Config.clear_hooks
WebMock.allow_net_connect!
WebMock.reset!
|
Clear vcr hooks in global rspec hooks.
|
vcr_vcr
|
train
|
rb,rb
|
a9a7a204faf77e23bfae3e1af11eef92a92c8b48
|
diff --git a/src/Controllers/Upload.php b/src/Controllers/Upload.php
index <HASH>..<HASH> 100644
--- a/src/Controllers/Upload.php
+++ b/src/Controllers/Upload.php
@@ -103,8 +103,7 @@ class Upload implements ControllerProviderInterface, ServiceProviderInterface
);
}
}
-
- return new JsonResponse($result);
+ return new JsonResponse($result, 200, array('Content-Type' => 'text/plain'));
} else {
list($namespace, $prefix) = $parser($handler);
}
@@ -114,7 +113,11 @@ class Upload implements ControllerProviderInterface, ServiceProviderInterface
$namespace = $app['upload.namespace'];
}
- return new JsonResponse($controller->uploadFile($app, $request, $namespace));
+ return new JsonResponse(
+ $controller->uploadFile($app, $request, $namespace),
+ 200,
+ array('Content-Type' => 'text/plain')
+ );
};
$ctr->match('/{namespace}', $func)
->value('namespace', 'files')
|
force json response to send text/plain header
|
bolt_bolt
|
train
|
php
|
673bd79b783c2237bfa822e1c8ffd9e8b02d89f0
|
diff --git a/lib/util.js b/lib/util.js
index <HASH>..<HASH> 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -397,7 +397,9 @@ module.exports = {
else if (pageData.browsertime)
return pageData.browsertime[0].pageData.url;
else if (pageData.gpsi)
- return pageData.gpsi.id;
+ return pageData.gpsi.id;
+ else if (pageData.webpagetest)
+ return pageData.webpagetest.response.data.testUrl;
return 'undefined';
},
|
use the url from wpt if that is the only system that is used
|
sitespeedio_sitespeed.io
|
train
|
js
|
b39f9d0736fba695a70b9cab2ab5b60c394c0d46
|
diff --git a/salt/returners/mongo_future_return.py b/salt/returners/mongo_future_return.py
index <HASH>..<HASH> 100644
--- a/salt/returners/mongo_future_return.py
+++ b/salt/returners/mongo_future_return.py
@@ -263,9 +263,13 @@ def get_jids():
Return a list of job ids
'''
conn, mdb = _get_conn(ret=None)
- ret = []
- name = mdb.jobs.distinct('jid')
- ret.append(name)
+ map = "function() { emit(this.jid, this); }"
+ reduce = "function (key, values) { return values[0]; }"
+ result = mdb.jobs.inline_map_reduce(map, reduce)
+ ret = {}
+ for r in result:
+ jid = r['_id']
+ ret[jid] = salt.utils.jid.format_jid_instance(jid, r['value'])
return ret
|
Return dict from get_jids() in mongo_future returner
|
saltstack_salt
|
train
|
py
|
8377b701c4ece415de6d6284ddcf5b8b57d91e55
|
diff --git a/lib/base/RequestClient.js b/lib/base/RequestClient.js
index <HASH>..<HASH> 100644
--- a/lib/base/RequestClient.js
+++ b/lib/base/RequestClient.js
@@ -20,6 +20,7 @@ var RequestClient = function() {};
* @param {object} [opts.data] - The request data
* @param {int} [opts.timeout=30000] - The request timeout in milliseconds
* @param {boolean} [opts.allowRedirects] - Should the client follow redirects
+ * @param {boolean} [opts.forever] - Set to true to use the forever-agent
*/
RequestClient.prototype.request = function(opts) {
opts = opts || {};
@@ -44,7 +45,7 @@ RequestClient.prototype.request = function(opts) {
url: opts.uri,
method: opts.method,
headers: opts.headers,
- forever: true,
+ forever: opts.forever === false ? false : true,
};
if (!_.isNull(opts.data)) {
|
Add 'forever' as an option to RequestClient request method. (#<I>)
|
twilio_twilio-node
|
train
|
js
|
9ecee5b375776e57e522f30aa92375dae9d61aae
|
diff --git a/troposphere/ssm.py b/troposphere/ssm.py
index <HASH>..<HASH> 100644
--- a/troposphere/ssm.py
+++ b/troposphere/ssm.py
@@ -108,6 +108,19 @@ class Targets(AWSProperty):
}
+class S3OutputLocation(AWSProperty):
+ props = {
+ 'OutputS3BucketName': (basestring, False),
+ 'OutputS3KeyPrefix': (basestring, False),
+ }
+
+
+class InstanceAssociationOutputLocation(AWSProperty):
+ props = {
+ 'S3Location': (S3OutputLocation, False),
+ }
+
+
class Association(AWSObject):
resource_type = "AWS::SSM::Association"
@@ -116,6 +129,7 @@ class Association(AWSObject):
'DocumentVersion': (basestring, False),
'InstanceId': (basestring, False),
'Name': (basestring, True),
+ 'OutputLocation': (InstanceAssociationOutputLocation, False),
'Parameters': (dict, False),
'ScheduleExpression': (basestring, False),
'Targets': ([Targets], False),
|
Add OutputLocation to SSM::Association
|
cloudtools_troposphere
|
train
|
py
|
6723e343532e115df5e8e4afec2130f67269aa3c
|
diff --git a/sensu_plugin/check.py b/sensu_plugin/check.py
index <HASH>..<HASH> 100644
--- a/sensu_plugin/check.py
+++ b/sensu_plugin/check.py
@@ -30,7 +30,7 @@ class SensuPluginCheck(SensuPlugin):
m = self.plugin_info['message']
if not m is None and not (m[0] is None and len(m) == 1):
- msg = ": {}".format(' '.join(str(message) for message in m))
+ msg = ": {0}".format(' '.join(str(message) for message in m))
- print("{} {}{}".format(self.check_name(),
+ print("{0} {1}{2}".format(self.check_name(),
self.plugin_info['status'], msg))
|
Make compatible with python 2.x
|
sensu-plugins_sensu-plugin-python
|
train
|
py
|
9501fe954e64d307e41807faa78879d8b1faf196
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -56,7 +56,7 @@ master_doc = 'index'
# General information about the project.
project = 'choix'
-copyright = '2015-2017, Lucas Maystre'
+copyright = '2015-2018, Lucas Maystre'
author = 'Lucas Maystre'
# The version info for the project you're documenting, acts as replacement for
@@ -66,7 +66,7 @@ author = 'Lucas Maystre'
# The short X.Y version.
version = '0.3'
# The full version, including alpha/beta/rc tags.
-release = '0.3.0'
+release = '0.3.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ def readme():
setup(
name='choix',
- version='0.3.0',
+ version='0.3.1',
author='Lucas Maystre',
author_email='[email protected]',
description="Inference algorithms for models based on Luce's choice axiom.",
|
New release, testing auto-deploy with Travis CI.
The only change present in this release is a new format for the README file,
which will hopefully display better on PyPI.
|
lucasmaystre_choix
|
train
|
py,py
|
8637b3e20a6791ac193aefecd25b81c0253746da
|
diff --git a/src/StreamWrapper.php b/src/StreamWrapper.php
index <HASH>..<HASH> 100644
--- a/src/StreamWrapper.php
+++ b/src/StreamWrapper.php
@@ -16,11 +16,13 @@ class StreamWrapper
* @param integer $timeout Timeout.
* @param integer $typeStream Type of stream.
*
- * @return stream
+ * @return resource
*/
public function getStreamSocketClient($address, &$errno, &$errstr, $timeout, $typeStream)
{
- return stream_socket_client($address, $errno, $errstr, $timeout, $typeStream);
+ $stream = stream_socket_client($address, $errno, $errstr, $timeout, $typeStream);
+ stream_set_timeout($stream, $timeout);
+ return $stream;
}
/**
|
BUGFIX: Without calling stream_set_timeout the timeout is not respected
|
repejota_phpnats
|
train
|
php
|
3072c0afc8f37b55692ccc00ce978d1bc102a652
|
diff --git a/github/teams.go b/github/teams.go
index <HASH>..<HASH> 100644
--- a/github/teams.go
+++ b/github/teams.go
@@ -452,7 +452,7 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r
}
// TeamAddTeamRepoOptions specifies the optional parameters to the
-// TeamsService.AddTeamRepo method.
+// TeamsService.AddTeamRepoByID and TeamsService.AddTeamRepoBySlug methods.
type TeamAddTeamRepoOptions struct {
// Permission specifies the permission to grant the team on this repository.
// Possible values are:
|
docs fix: correct a comment (#<I>)
|
google_go-github
|
train
|
go
|
4b645d4fc77cb79ec015650df6ae08dc71f64dde
|
diff --git a/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/bots/FixIntegerQuantityPrecisionsBot.java b/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/bots/FixIntegerQuantityPrecisionsBot.java
index <HASH>..<HASH> 100644
--- a/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/bots/FixIntegerQuantityPrecisionsBot.java
+++ b/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/bots/FixIntegerQuantityPrecisionsBot.java
@@ -160,6 +160,9 @@ public class FixIntegerQuantityPrecisionsBot implements EntityDocumentProcessor
dataFetcher = new WikibaseDataFetcher(connection,
Datamodel.SITE_WIKIDATA);
+ // Do not retrieve data that we don't care about here:
+ dataFetcher.getFilter().excludeAllLanguages();
+ dataFetcher.getFilter().excludeAllSiteLinks();
String timeStamp = new SimpleDateFormat("yyyyMMdd'T'HHmmss")
.format(new Date());
|
Do not fetch data that we do not need here
|
Wikidata_Wikidata-Toolkit
|
train
|
java
|
f8138ae62eb5e854d802a31b99b17e0bf4556064
|
diff --git a/datatableview/helpers.py b/datatableview/helpers.py
index <HASH>..<HASH> 100644
--- a/datatableview/helpers.py
+++ b/datatableview/helpers.py
@@ -149,7 +149,7 @@ def format_date(format_string, localize=False, key=None):
value = key(value)
else:
value = kwargs.get('default_value', value)
- if value is None:
+ if not value: # Empty or missing default_value
return ""
if localize:
value = localtime(value)
|
Fix #<I> - Potential bad data
I think something else was potentially going on in #<I>. Perhaps the db
backend was storing a blank string instead of a null.
|
pivotal-energy-solutions_django-datatable-view
|
train
|
py
|
17cd98d4be31170d7acd483d514cae16b52fcb56
|
diff --git a/tests/test_account.py b/tests/test_account.py
index <HASH>..<HASH> 100644
--- a/tests/test_account.py
+++ b/tests/test_account.py
@@ -29,6 +29,7 @@ from canvasapi.outcome import OutcomeGroup, OutcomeLink
from canvasapi.outcome_import import OutcomeImport
from canvasapi.paginated_list import PaginatedList
from canvasapi.rubric import Rubric
+from canvasapi.scope import Scope
from canvasapi.sis_import import SisImport
from canvasapi.user import User
from canvasapi.content_migration import ContentMigration, Migrator
@@ -1185,3 +1186,11 @@ class TestAccount(unittest.TestCase):
scope_list = [scope for scope in scopes]
self.assertEqual(len(list(scopes)), 2)
+ self.assertTrue(isinstance(scopes, PaginatedList))
+ self.assertTrue(isinstance(scope_list[0], Scope))
+
+ self.assertEqual(scope_list[0].resource, "users")
+ self.assertEqual(scope_list[1].resource, "users")
+
+ self.assertEqual(scope_list[0].verb, "PUT")
+ self.assertEqual(scope_list[1].verb, "GET")
|
Finished writing the test method for get_scopes
|
ucfopen_canvasapi
|
train
|
py
|
279d05d9d8963e9be5a54af7701f5ace9c9d2e5c
|
diff --git a/lib/parser.js b/lib/parser.js
index <HASH>..<HASH> 100644
--- a/lib/parser.js
+++ b/lib/parser.js
@@ -31,12 +31,17 @@ function Parser(options) {
this._onError = this._options.errorHandler || console.error;
this._fileCache = {};
this.dynamicIncludeSrc = [];
+ this.staticIncludeSrc = [];
}
Parser.prototype.getDynamicIncludeSrc = function () {
return _.clone(this.dynamicIncludeSrc);
};
+Parser.prototype.getStaticIncludeSrc = function () {
+ return _.clone(this.staticIncludeSrc);
+};
+
Parser.prototype._preprocess = function (element, context, config) {
let self = this;
element.attribs = element.attribs || {};
@@ -68,6 +73,9 @@ Parser.prototype._preprocess = function (element, context, config) {
return element; // only keep url path for dynamic
}
+ // is static include file
+ this.staticIncludeSrc.push({from: context.cwf, to: filePath});
+
let isIncludeSrcMd = utils.getExtName(filePath) === 'md';
try {
|
Add array of files included during preprocess
|
MarkBind_markbind
|
train
|
js
|
e3eeb9c2e497d40c0361df536ea06ab2e574d2be
|
diff --git a/resources/lang/en-US/forms.php b/resources/lang/en-US/forms.php
index <HASH>..<HASH> 100644
--- a/resources/lang/en-US/forms.php
+++ b/resources/lang/en-US/forms.php
@@ -168,7 +168,7 @@ return [
'analytics' => [
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
- 'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
+ 'analytics_piwik_url' => 'URL of your Piwik instance',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'localization' => [
@@ -229,6 +229,11 @@ return [
'timezone' => 'Select Timezone',
],
+ 'seo' => [
+ 'title' => 'SEO Title',
+ 'description' => 'SEO Description',
+ ],
+
// Buttons
'add' => 'Add',
'save' => 'Save',
|
New translations forms.php (English)
|
CachetHQ_Cachet
|
train
|
php
|
b8f342e7b8625dbb5f1829df850314720de479ac
|
diff --git a/data/handleDB.php b/data/handleDB.php
index <HASH>..<HASH> 100644
--- a/data/handleDB.php
+++ b/data/handleDB.php
@@ -910,5 +910,5 @@ class DbHandleApplication extends Application
}
}
-$application = new DbHandleApplication('Database handler for CompatInfo', '1.20.0');
+$application = new DbHandleApplication('Database handler for CompatInfo', '1.21.0');
$application->run();
|
Bump new version <I>
|
llaville_php-compatinfo-db
|
train
|
php
|
7f385a6bbf67ab780ab86c941cbd426f9b003834
|
diff --git a/workflow/controller/steps.go b/workflow/controller/steps.go
index <HASH>..<HASH> 100644
--- a/workflow/controller/steps.go
+++ b/workflow/controller/steps.go
@@ -102,13 +102,18 @@ func (woc *wfOperationCtx) executeSteps(nodeName string, tmplCtx *templateresolu
childNodes = append(childNodes, node)
}
}
- tmpl, err := stepsCtx.tmplCtx.GetTemplate(&step)
- if err != nil {
- return err
- }
- err = woc.processAggregateNodeOutputs(tmpl, stepsCtx.scope, prefix, childNodes)
- if err != nil {
- return err
+ if len(childNodes) > 0 {
+ // Expanded child nodes should be created from the same template.
+ tmpl := woc.wf.GetStoredTemplate(&childNodes[0])
+ if tmpl == nil {
+ return errors.InternalErrorf("Template of step node '%s' not found", childNode)
+ }
+ err := woc.processAggregateNodeOutputs(tmpl, stepsCtx.scope, prefix, childNodes)
+ if err != nil {
+ return err
+ }
+ } else {
+ woc.log.Infof("Step '%s' has no expanded child nodes", childNode)
}
} else {
woc.processNodeOutputs(stepsCtx.scope, prefix, childNode)
|
Use stored templates to raggregate step outputs (#<I>)
|
argoproj_argo
|
train
|
go
|
f5e670b7a7975debd1138d0e919367a23bf59275
|
diff --git a/event/src/test/java/com/proofpoint/event/client/DummyEventClass.java b/event/src/test/java/com/proofpoint/event/client/DummyEventClass.java
index <HASH>..<HASH> 100644
--- a/event/src/test/java/com/proofpoint/event/client/DummyEventClass.java
+++ b/event/src/test/java/com/proofpoint/event/client/DummyEventClass.java
@@ -1,6 +1,6 @@
package com.proofpoint.event.client;
-@EventType("test:type=version1,name=dummy")
+@EventType("Dummy")
public class DummyEventClass
{
private final double doubleValue;
diff --git a/sample-server/src/main/java/com/proofpoint/platform/sample/PersonEvent.java b/sample-server/src/main/java/com/proofpoint/platform/sample/PersonEvent.java
index <HASH>..<HASH> 100644
--- a/sample-server/src/main/java/com/proofpoint/platform/sample/PersonEvent.java
+++ b/sample-server/src/main/java/com/proofpoint/platform/sample/PersonEvent.java
@@ -4,7 +4,7 @@ import com.google.common.base.Preconditions;
import com.proofpoint.event.client.EventField;
import com.proofpoint.event.client.EventType;
-@EventType("test:type=person")
+@EventType("Person")
public class PersonEvent
{
public static PersonEvent personAdded(String personId, Person person)
|
Use V2 event naming for test and sample events
|
airlift_airlift
|
train
|
java,java
|
74f1f2700eec82539ad6677bb57a8b59b5e67ff5
|
diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -655,20 +655,27 @@ func (c *Connection) checkExchanges() {
return err == nil
}
+ var updated bool
if c.readState() == connectionStartClose {
- if c.inbound.count() > 0 || !moveState(connectionStartClose, connectionInboundClosed) {
+ if c.inbound.count() == 0 && moveState(connectionStartClose, connectionInboundClosed) {
+ updated = true
+ }
+ // If there was no update to the state, there's no more processing to do.
+ if !updated {
return
}
}
if c.readState() == connectionInboundClosed {
- if c.outbound.count() > 0 || !moveState(connectionInboundClosed, connectionClosed) {
- return
+ if c.outbound.count() == 0 && moveState(connectionInboundClosed, connectionClosed) {
+ updated = true
}
}
- // If the state was updated, call the onCloseStateChange event.
- c.callOnCloseStateChange()
+ if updated {
+ c.log.Debugf("checkExchanges updated connection state to %v", c.readState())
+ c.callOnCloseStateChange()
+ }
}
// Close starts a graceful Close which will first reject incoming calls, reject outgoing calls
|
Fix checkExchanges logic to call onCloseStateChange on all state changes
|
uber_tchannel-go
|
train
|
go
|
df8d52dacb356904c583279dc28ad5cf05f90f18
|
diff --git a/lib/sidekiq/limit_fetch.rb b/lib/sidekiq/limit_fetch.rb
index <HASH>..<HASH> 100644
--- a/lib/sidekiq/limit_fetch.rb
+++ b/lib/sidekiq/limit_fetch.rb
@@ -21,7 +21,7 @@ module Sidekiq::LimitFetch
end
def retrieve_work
- queue, job = redis_brpop *Queues.acquire, Sidekiq::BasicFetch::TIMEOUT
+ queue, job = redis_brpop(Queues.acquire)
Queues.release_except(queue)
UnitOfWork.new(queue, job) if job
end
@@ -32,8 +32,14 @@ module Sidekiq::LimitFetch
private
- def redis_brpop(*args)
- return if args.size < 2
- Sidekiq.redis {|it| it.brpop *args }
+ TIMEOUT = Sidekiq::BasicFetch::TIMEOUT
+
+ def redis_brpop(queues)
+ if queues.empty?
+ sleep TIMEOUT # there are no queues to handle, so lets sleep
+ [] # and return nothing
+ else
+ Sidekiq.redis { |it| it.brpop *queues, TIMEOUT }
+ end
end
end
|
Don't let #retrieve_work to short-circuit when there are no queues to handle. Fix #<I>
BIG
|
brainopia_sidekiq-limit_fetch
|
train
|
rb
|
8ae7124bee1b9fc7344de0a7517ff96c62ed0f3b
|
diff --git a/wfdb/io/record.py b/wfdb/io/record.py
index <HASH>..<HASH> 100644
--- a/wfdb/io/record.py
+++ b/wfdb/io/record.py
@@ -2048,17 +2048,14 @@ def sampfreq(record_name, pn_dir=None):
>>> ECG 4 500
"""
- dir_name, base_record_name = os.path.split(record_name)
- dir_name = os.path.abspath(dir_name)
-
if (pn_dir is not None) and ('.' not in pn_dir):
dir_list = pn_dir.split(os.sep)
pn_dir = posixpath.join(dir_list[0], get_version(dir_list[0]),
*dir_list[1:])
- record = rdheader(record_name, pn_dir=pn_dir).__dict__
- samps_per_frame = [record['fs']*samp for samp in record['samps_per_frame']]
- sig_name = record['sig_name']
+ record = rdheader(record_name, pn_dir=pn_dir)
+ samps_per_frame = [record.fs*samp for samp in record.samps_per_frame]
+ sig_name = record.sig_name
for sig,samp in zip(sig_name, samps_per_frame):
print('{}\t{}'.format(sig,samp))
|
Refactors code / removes previously used code
|
MIT-LCP_wfdb-python
|
train
|
py
|
21afda2506f8dd0ccb22fb30a650d2d5754ad404
|
diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go
index <HASH>..<HASH> 100644
--- a/wallet/wallet_test.go
+++ b/wallet/wallet_test.go
@@ -87,7 +87,7 @@ func TestBtcAddressSerializer(t *testing.T) {
func TestWalletCreationSerialization(t *testing.T) {
createdAt := &BlockStamp{}
w1, err := NewWallet("banana wallet", "A wallet for testing.",
- []byte("banana"), btcwire.MainNet, createdAt)
+ []byte("banana"), btcwire.MainNet, createdAt, 100)
if err != nil {
t.Error("Error creating new wallet: " + err.Error())
return
|
Fix tests for new NewWallet func signature.
|
btcsuite_btcwallet
|
train
|
go
|
013cb6d653cb886ac88032347b7c8e34726e007d
|
diff --git a/faker/providers/phone_number/no_NO/__init__.py b/faker/providers/phone_number/no_NO/__init__.py
index <HASH>..<HASH> 100644
--- a/faker/providers/phone_number/no_NO/__init__.py
+++ b/faker/providers/phone_number/no_NO/__init__.py
@@ -4,7 +4,7 @@ from .. import Provider as PhoneNumberProvider
class Provider(PhoneNumberProvider):
formats = (
- '+47#########',
+ '+47########',
'+47 ## ## ## ##',
'## ## ## ##',
'## ## ## ##',
|
Correct number of digits in norwegian phonenumbers (#<I>)
|
joke2k_faker
|
train
|
py
|
6829ae96359b1e65ef081b767d8148c2941dbc0f
|
diff --git a/examples/payments/CreditCard/createUi.php b/examples/payments/CreditCard/createUi.php
index <HASH>..<HASH> 100644
--- a/examples/payments/CreditCard/createUi.php
+++ b/examples/payments/CreditCard/createUi.php
@@ -48,7 +48,7 @@ if (strpos($gatewayEnv, 'SG') !== false) {
}
if (isset($_GET['amount'])) {
- $startAmount = 70;
+ $paymentAction = $_GET['paymentAction'];
}
$amount = new Amount($startAmount, $currency);
|
Change amount for non3ds tests
|
wirecard_paymentSDK-php
|
train
|
php
|
2905e4f3d1776614e8700e5202dcabda970f7509
|
diff --git a/src/lib/localize.js b/src/lib/localize.js
index <HASH>..<HASH> 100644
--- a/src/lib/localize.js
+++ b/src/lib/localize.js
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, {Component} from 'react';
+import {getDisplayName} from 'lib';
export default function localize(Comp) {
class LocalizedComponent extends Component {
@@ -18,7 +19,7 @@ export default function localize(Comp) {
return <Comp localize={this.localize} {...this.props} />;
}
}
-
+ LocalizedComponent.displayName = `Localized${getDisplayName(Comp)}`;
LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {};
LocalizedComponent.contextTypes.dictionaries = PropTypes.object;
LocalizedComponent.contextTypes.locale = PropTypes.string;
|
Make names of localized components more descriptive
|
plotly_react-chart-editor
|
train
|
js
|
68686e2292b022e4d94f44e9e433d0ada9747a8b
|
diff --git a/paypal/pro/helpers.py b/paypal/pro/helpers.py
index <HASH>..<HASH> 100644
--- a/paypal/pro/helpers.py
+++ b/paypal/pro/helpers.py
@@ -131,7 +131,11 @@ class PayPalWPP(object):
raise DeprecationWarning
def getTransactionDetails(self, params):
- raise NotImplementedError
+ defaults = {"method": "GetTransactionDetails"}
+ required = L("transactionid")
+
+ nvp_obj = self._fetch(params, required, defaults)
+ return nvp_obj
def massPay(self, params):
raise NotImplementedError
@@ -140,12 +144,8 @@ class PayPalWPP(object):
raise NotImplementedError
def updateRecurringPaymentsProfile(self, params):
- """
- Requires `profileid` and `action` params.
- Action must be either "Cancel", "Suspend", or "Reactivate".
- """
defaults = {"method": "UpdateRecurringPaymentsProfile"}
- required = L("profileid action")
+ required = L("profileid")
nvp_obj = self._fetch(params, required, defaults)
return nvp_obj
|
Slip on copy/paste docs. Added support for GetTransactionDetails
|
spookylukey_django-paypal
|
train
|
py
|
0d3afedf02b64fcf4dbff3b1a723898a2285e59e
|
diff --git a/client/html/lib/classic/js/arcavias.js b/client/html/lib/classic/js/arcavias.js
index <HASH>..<HASH> 100644
--- a/client/html/lib/classic/js/arcavias.js
+++ b/client/html/lib/classic/js/arcavias.js
@@ -193,7 +193,7 @@ jQuery(document).ready( function($) {
var resize = function() {
var jqwin = $(window);
var left = (jqwin.width() - container.outerWidth()) / 2;
- var top = (jqwin.height() - container.outerHeight()) / 2;
+ var top = jqwin.scrollTop() + (jqwin.height() - container.outerHeight()) / 2;
container.css("left", (left>0 ? left : 0 ));
container.css("top", (top>0 ? top : 0 ));
|
Displays basket in the middle of the viewport
|
Arcavias_arcavias-core
|
train
|
js
|
465e1456b668eab18ac1ba73592073a923aa0b16
|
diff --git a/tests/acceptance/connect-e2e-test.js b/tests/acceptance/connect-e2e-test.js
index <HASH>..<HASH> 100644
--- a/tests/acceptance/connect-e2e-test.js
+++ b/tests/acceptance/connect-e2e-test.js
@@ -49,6 +49,27 @@ test('should subscribe and unsubscribe when components are created/destroyed', f
});
});
+test('es2015 class based components subscribe and unsubscribe when components are created/destroyed', function(assert) {
+ visit('/clazz');
+ andThen(() => {
+ assert.equal(currentURL(), '/clazz');
+ assert.equal(subscribed, 1);
+ assert.equal(unsubscribed, 0);
+ });
+ click('.dashboard-link');
+ andThen(() => {
+ assert.equal(currentURL(), '/dashboard');
+ assert.equal(subscribed, 2);
+ assert.equal(unsubscribed, 1);
+ });
+ click('.clazz-link');
+ andThen(() => {
+ assert.equal(currentURL(), '/clazz');
+ assert.equal(subscribed, 3);
+ assert.equal(unsubscribed, 2);
+ });
+});
+
test('components without state should not subscribe or unsubscribe', function(assert) {
visit('/empty');
andThen(() => {
|
TESTS: added test to confirm unsubscribe is fired from willDestroy
|
ember-redux_ember-redux
|
train
|
js
|
991f9943ab2c7621fba4234d366beac4cfbb23b5
|
diff --git a/src/core/utils/index.js b/src/core/utils/index.js
index <HASH>..<HASH> 100644
--- a/src/core/utils/index.js
+++ b/src/core/utils/index.js
@@ -42,4 +42,22 @@ utils.assetCache = new (require('../../loader/AssetCache'))();
*/
utils.parseTextKeys = require('./parseTextKeys');
+/**
+ * Convert degrees to radians
+ * @param value
+ * @returns {number}
+ */
+utils.degToRad = function(value){
+ return value * CONST.DEG_TO_RAD;
+};
+
+/**
+ * Convert radians to degrees
+ * @param value
+ * @returns {number}
+ */
+utils.radToDeg = function(value){
+ return value * CONT.RAD_TO_DEG;
+};
+
module.exports = utils;
\ No newline at end of file
|
added some utils to convert degrees and radians
|
Nazariglez_perenquen
|
train
|
js
|
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.