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
|
---|---|---|---|---|---|
834d90537975846d74b2bae0748e8ed5c0d3c9bf
|
diff --git a/lib/excon/ssl_socket.rb b/lib/excon/ssl_socket.rb
index <HASH>..<HASH> 100644
--- a/lib/excon/ssl_socket.rb
+++ b/lib/excon/ssl_socket.rb
@@ -130,7 +130,7 @@ module Excon
end
rescue OpenSSL::SSL::SSLError
raise
- rescue Errno::ETIMEDOUT
+ rescue Errno::ETIMEDOUT, Timeout::Error
raise Excon::Errors::Timeout.new('connect timeout reached')
end
|
also include Timeout.timeout errors
|
excon_excon
|
train
|
rb
|
a5874a5cd4ad7d7da1111a8f8f962a38f301a29d
|
diff --git a/backbone-baseview.js b/backbone-baseview.js
index <HASH>..<HASH> 100644
--- a/backbone-baseview.js
+++ b/backbone-baseview.js
@@ -332,6 +332,7 @@
renderByKey: function (key, options) {
var subViews = this.getByType(key) || this.get(key);
if (!_.isArray(subViews)) { subViews = [subViews]; }
+ options = options || {};
return this._render(subViews, options.appendTo || options.useLocation, options.clearLocations);
},
/**
|
Fixed bug with undefined options in renderByKey
|
1stdibs_backbone-base-and-form-view
|
train
|
js
|
6ff02643a66b1e25ac3edca94433ac7c7e781f7d
|
diff --git a/parquet-hadoop/src/main/java/parquet/hadoop/example/GroupReadSupport.java b/parquet-hadoop/src/main/java/parquet/hadoop/example/GroupReadSupport.java
index <HASH>..<HASH> 100644
--- a/parquet-hadoop/src/main/java/parquet/hadoop/example/GroupReadSupport.java
+++ b/parquet-hadoop/src/main/java/parquet/hadoop/example/GroupReadSupport.java
@@ -31,8 +31,9 @@ public class GroupReadSupport extends ReadSupport<Group> {
public parquet.hadoop.api.ReadSupport.ReadContext init(
Configuration configuration, Map<String, String> keyValueMetaData,
MessageType fileSchema) {
- // TODO: support requestedSchema
- return new ReadContext(fileSchema);
+ String partialSchemaString = configuration.get(ReadSupport.PARQUET_READ_SCHEMA);
+ MessageType requestedProjection = getSchemaForRead(fileSchema, partialSchemaString);
+ return new ReadContext(requestedProjection);
}
@Override
|
Implemented partial schema for GroupReadSupport
|
apache_parquet-mr
|
train
|
java
|
c00f1b460b5ddd48e3940c53ca39d7771a0ca356
|
diff --git a/store/store.go b/store/store.go
index <HASH>..<HASH> 100644
--- a/store/store.go
+++ b/store/store.go
@@ -448,10 +448,6 @@ func (s *Store) Load(r io.Reader) (int, error) {
if err != nil && err != io.EOF {
return len(queries), err
}
- if cmd == "BEGIN TRANSACTION" ||
- cmd == "COMMIT" {
- continue
- }
if cmd == "" {
if err == io.EOF {
break
@@ -463,7 +459,7 @@ func (s *Store) Load(r io.Reader) (int, error) {
}
if len(queries) > 0 {
- _, err := s.Execute(queries, false, true)
+ _, err := s.Execute(queries, false, false)
if err != nil {
return len(queries), err
}
|
Accept BEGIN and COMMIT on load()
|
rqlite_rqlite
|
train
|
go
|
e43fe45d247b3949391c039124098776abef8983
|
diff --git a/core/frontend/src/cards/js/video.js b/core/frontend/src/cards/js/video.js
index <HASH>..<HASH> 100644
--- a/core/frontend/src/cards/js/video.js
+++ b/core/frontend/src/cards/js/video.js
@@ -120,6 +120,8 @@
const isPlaying = !!(videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);
if (isPlaying) {
handleOnPause();
+ } else {
+ handleOnPlay();
}
}
});
@@ -141,7 +143,6 @@
}
const handleOnPause = () => {
- largePlayIcon.classList.remove("kg-video-hide-animated");
videoOverlay.classList.remove("kg-video-hide-animated");
pauseIconContainer.classList.add("kg-video-hide");
playIconContainer.classList.remove("kg-video-hide");
|
Removed play icon on video player after first play
refs <URL>
|
TryGhost_Ghost
|
train
|
js
|
bf5cd348723d42ee75c833378ec05a7e6490f1f2
|
diff --git a/classes/collection/ElementCollection.php b/classes/collection/ElementCollection.php
index <HASH>..<HASH> 100644
--- a/classes/collection/ElementCollection.php
+++ b/classes/collection/ElementCollection.php
@@ -44,7 +44,7 @@ abstract class ElementCollection extends Extendable
/**
* Return new clone collection
- * @return ElementCollection
+ * @return $this
*/
protected function returnClone()
{
|
Fix annotation in returnClone method
|
lovata_oc-toolbox-plugin
|
train
|
php
|
6506b746455f5f62ce00fe0dd894384aa58183f3
|
diff --git a/lib/rbbt/util/log/progress/report.rb b/lib/rbbt/util/log/progress/report.rb
index <HASH>..<HASH> 100644
--- a/lib/rbbt/util/log/progress/report.rb
+++ b/lib/rbbt/util/log/progress/report.rb
@@ -117,6 +117,8 @@ module Log
1
end
end
+
+ thr = 0.0000001 if thr == 0
if mean.nil? or mean.to_i > 1
str = "#{ Log.color :blue, thr.to_i.to_s } per sec."
|
Fix ProgressBar report failing on no ticks
|
mikisvaz_rbbt-util
|
train
|
rb
|
89dd8c8788fff32472755071857fc0b789be4237
|
diff --git a/Lib/fontParts/base/point.py b/Lib/fontParts/base/point.py
index <HASH>..<HASH> 100644
--- a/Lib/fontParts/base/point.py
+++ b/Lib/fontParts/base/point.py
@@ -4,6 +4,7 @@ from fontParts.base.base import (
dynamicProperty, reference
)
from fontParts.base import normalizers
+from fontParts.base.errors import FontPartsError
from fontParts.base.deprecated import DeprecatedPoint, RemovedPoint
@@ -164,13 +165,15 @@ class BasePoint(BaseObject, TransformationMixin, PointPositionMixin, SelectionMi
)
def _get_base_smooth(self):
- # XXX should this only allow True for certain point types?
+ if self.type == "offcurve":
+ raise FontPartsError("The smooth attribute is not available in off-curve points.")
value = self._get_smooth()
value = normalizers.normalizeBoolean(value)
return value
def _set_base_smooth(self, value):
- # XXX should this only allow True for certain point types?
+ if self.type == "offcurve":
+ raise FontPartsError("The smooth attribute is not available in off-curve points.")
value = normalizers.normalizeBoolean(value)
self._set_smooth(value)
|
Don't allow access to smooth in off-curve points.
|
robotools_fontParts
|
train
|
py
|
efe1134b9369dd4385b2461d8d9c8de74dc207bc
|
diff --git a/spyder/plugins/ipythonconsole/plugin.py b/spyder/plugins/ipythonconsole/plugin.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/ipythonconsole/plugin.py
+++ b/spyder/plugins/ipythonconsole/plugin.py
@@ -154,10 +154,7 @@ class IPythonConsole(SpyderPluginWidget):
layout.addWidget(self.infowidget)
# Label to inform users how to get out of the pager
- self.pager_label = QLabel(
- _("You are in the pager now. Press <b>Q</b> to get out of it"),
- self
- )
+ self.pager_label = QLabel(_("Press <b>Q</b> to exit pager"), self)
self.pager_label.setStyleSheet(
"background-color: #3775A9;"
"margin: 0px 4px 4px 4px;"
|
IPython console: Change pager label text according to review
|
spyder-ide_spyder
|
train
|
py
|
2b41e4e176f264a1ee2ff07813190e446571ec4a
|
diff --git a/src/Codeception/Template/Wpbrowser.php b/src/Codeception/Template/Wpbrowser.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Template/Wpbrowser.php
+++ b/src/Codeception/Template/Wpbrowser.php
@@ -599,7 +599,7 @@ modules:
populate: true
cleanup: true
waitlock: 10
- url: '%WP_URL%'
+ url: '%TEST_SITE_WP_URL%'
urlReplacement: true
tablePrefix: '%TEST_SITE_TABLE_PREFIX%'
WPBrowser:
|
Use %TEST_SITE_WP_URL% instead of %WP_URL%
When generating the standard suite configurations, there is only one occurence of %WP_URL%, but many of %TEST_SITE_WP_URL%. As %WP_URL% is not set automatically in the env file, this should be changed.
|
lucatume_wp-browser
|
train
|
php
|
d3e06056400b318e2f8f1398a3d6b3864d5bcb86
|
diff --git a/dynetx/algorithms/assortativity.py b/dynetx/algorithms/assortativity.py
index <HASH>..<HASH> 100644
--- a/dynetx/algorithms/assortativity.py
+++ b/dynetx/algorithms/assortativity.py
@@ -35,7 +35,6 @@ def __label_frequency(g: dn.DynGraph, u: object, nodes: list, labels: list, hier
t = t_dist[v]
a_v = a_v[t]
-
# indicator function that exploits label hierarchical structure
sgn[v] = 1 if a_u == a_v else __distance(label, a_u, a_v, hierarchies)
v_neigh = list(g.neighbors(v, t_dist[v]))
@@ -83,8 +82,8 @@ def __normalize(u: object, scores: list, max_dist: int, alphas: list):
for alpha in alphas:
norm = sum([(d ** -alpha) for d in range(1, max_dist + 1)])
- for profile in scores[str(alpha)]:
- scores[str(alpha)][profile][u] /= norm
+ for profile in scores["%.2f" % alpha]:
+ scores["%.2f" % alpha][profile][u] /= norm
return scores
|
:arrow_up: bufgfix delta conformity
|
GiulioRossetti_dynetx
|
train
|
py
|
a1335c96886f60bb14e25353ec0d09fa310e5b4b
|
diff --git a/perceval/backends/core/meetup.py b/perceval/backends/core/meetup.py
index <HASH>..<HASH> 100644
--- a/perceval/backends/core/meetup.py
+++ b/perceval/backends/core/meetup.py
@@ -375,6 +375,10 @@ class MeetupClient(HttpClient, RateLimitHandler):
super().setup_rate_limit_handler(sleep_for_rate=sleep_for_rate,
min_rate_to_sleep=min_rate_to_sleep)
+ def calculate_time_to_reset(self):
+ """Number of seconds to wait. They are contained in the rate limit reset header"""
+ return self.rate_limit_reset_ts
+
def events(self, group, from_date=DEFAULT_DATETIME):
"""Fetch the events pages of a given group."""
diff --git a/tests/test_meetup.py b/tests/test_meetup.py
index <HASH>..<HASH> 100644
--- a/tests/test_meetup.py
+++ b/tests/test_meetup.py
@@ -779,7 +779,7 @@ class TestMeetupClient(unittest.TestCase):
wait_to_reset = 1
http_requests = setup_http_server(rate_limit=0,
- reset_rate_limit=int(time.time()) + wait_to_reset)
+ reset_rate_limit=wait_to_reset)
client = MeetupClient('aaaa', max_items=2,
min_rate_to_sleep=2,
|
[meetup] Adapt tests to assess the sleep for rate
This patch adapts the tests used to asses the sleep for rate,
according to the new method __calculate_seconds_to_reset
of the generic HTTP client
|
chaoss_grimoirelab-perceval
|
train
|
py,py
|
4f092b5e1be4ea277fc3e2ff585e0abb151c6005
|
diff --git a/view/frontend/web/js/view/payment/method-renderer/applepay.js b/view/frontend/web/js/view/payment/method-renderer/applepay.js
index <HASH>..<HASH> 100755
--- a/view/frontend/web/js/view/payment/method-renderer/applepay.js
+++ b/view/frontend/web/js/view/payment/method-renderer/applepay.js
@@ -189,8 +189,8 @@ define(
var paymentRequest = {
currencyCode: CheckoutCom.getPaymentConfig()['quote_currency'],
countryCode: billingAddress.countryId,
- requiredShippingContactFields: ['postalAddress','name'],
- requiredBillingContactFields: ['postalAddress','name'],
+ requiredShippingContactFields: ['postalAddress'],
+ requiredBillingContactFields: ['postalAddress'],
lineItems: self.getLineItems(),
shippingMethods: self.getShippingMethods(),
billingContact: {
|
Apple Pay contact field requirements
Removed contact name from billing and shipping requirements.
|
checkout_checkout-magento2-plugin
|
train
|
js
|
96dcbba7dcdcf5f99944d7358aacd9344631b0fb
|
diff --git a/lib/schemas.js b/lib/schemas.js
index <HASH>..<HASH> 100644
--- a/lib/schemas.js
+++ b/lib/schemas.js
@@ -549,7 +549,7 @@ Tokenizer.prototype._endOfString = function () {
pos++;
}
}
- throw this.error('unterminated string at ' + this._pos);
+ throw this.error('unterminated string');
};
/**
|
Slightly improve error message.
The error when parsing an unterminated IDL string would have redundant
position information.
[ci skip]
|
cdapio_ui-schema-parser
|
train
|
js
|
f013b46906d9e2f098ff235110c43c8552fdfd9b
|
diff --git a/spec/typhoid/multi_spec.rb b/spec/typhoid/multi_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/typhoid/multi_spec.rb
+++ b/spec/typhoid/multi_spec.rb
@@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'json'
+
describe Typhoid::Multi do
context "making multiple requests" do
def new_typhoeus?
diff --git a/spec/typhoid/parser_spec.rb b/spec/typhoid/parser_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/typhoid/parser_spec.rb
+++ b/spec/typhoid/parser_spec.rb
@@ -57,7 +57,7 @@ module Typhoid
end
it "has no body" do
- Parser.new(empty_body).parse.should be_nil
+ expect(Parser.new(empty_body).parse).to be_nil
end
end
end
|
Updated parser spec to use expect syntax
|
sportngin_typhoid
|
train
|
rb,rb
|
87fb7a7ebe1d79143324412bbcebab585b34bcbf
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -14,7 +14,7 @@ function classNames() {
}));
}
}
- return classes.join(' ') || '';
+ return classes.join(' ');
}
module.exports = classNames;
|
Removing unnecessary guard, see #4
|
JedWatson_classnames
|
train
|
js
|
aa7cccad940725599dfbf4c3ba9a67248d421a28
|
diff --git a/openstack_dashboard/dashboards/settings/user/forms.py b/openstack_dashboard/dashboards/settings/user/forms.py
index <HASH>..<HASH> 100644
--- a/openstack_dashboard/dashboards/settings/user/forms.py
+++ b/openstack_dashboard/dashboards/settings/user/forms.py
@@ -14,6 +14,7 @@
from datetime import datetime # noqa
import pytz
+import string
from django.conf import settings
from django import shortcuts
@@ -49,6 +50,7 @@ class UserSettingsForm(forms.SelfHandlingForm):
def get_language_display_name(code, desc):
try:
desc = translation.get_language_info(code)['name_local']
+ desc = string.capwords(desc)
except KeyError:
# If a language is not defined in django.conf.locale.LANG_INFO
# get_language_info raises KeyError
|
Country names in capital letters
Use of capwords function to format country names in user setting screen.
Change-Id: Ic<I>c1e0ccfda<I>f<I>c<I>b9ff5d2f<I>c<I>
Closes-Bug: #<I>
|
openstack_horizon
|
train
|
py
|
e989bf0c80e56155b2a8c10d2c33c1d04c29abd8
|
diff --git a/scripts/experiments/run_experiments.py b/scripts/experiments/run_experiments.py
index <HASH>..<HASH> 100644
--- a/scripts/experiments/run_experiments.py
+++ b/scripts/experiments/run_experiments.py
@@ -111,7 +111,7 @@ class DepParseExpParamsRunner(ExpParamsRunner):
if self.queue == "mem":
# Override qsub_args to exclude "-l h_vmem=%dM"
- self.qsub_args = re.sub("-l h_vmem=(\S+)", "-l virtual_free=\1", self.qsub_args)
+ self.qsub_args = re.sub("-l h_vmem=", "-l virtual_free=", self.qsub_args)
def get_experiments(self):
all = DPExpParams()
|
Fixing bug with h_vmem replacement by virutal_free
git-svn-id: svn+ssh://external.hltcoe.jhu.edu/home/hltcoe/mgormley/public/repos/dep_parse_filtered/trunk@<I> <I>f-cb4b-<I>-8b<I>-c<I>bcb<I>
|
mgormley_pacaya
|
train
|
py
|
b5835646eb7791f911a773019609da6d622abe45
|
diff --git a/registry/config.go b/registry/config.go
index <HASH>..<HASH> 100644
--- a/registry/config.go
+++ b/registry/config.go
@@ -29,10 +29,6 @@ type serviceConfig struct {
const (
// DefaultNamespace is the default namespace
DefaultNamespace = "docker.io"
- // DefaultRegistryVersionHeader is the name of the default HTTP header
- // that carries Registry version info
- DefaultRegistryVersionHeader = "Docker-Distribution-Api-Version"
-
// IndexHostname is the index hostname
IndexHostname = "index.docker.io"
// IndexServer is used for user auth and image search
|
registry: remove const for 'Docker-Distribution-Api-Version' header
This header was used for fallbacks to v1 registries, but it's no longer
used, and marked optional / legacy in the OCI distribution-spec:
<URL>
|
moby_moby
|
train
|
go
|
2dae873b5837dc40e9cb1fb2d4de57c6ed990d23
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -708,6 +708,9 @@ Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return arrayIndexOf(this, val, byteOffset, encoding)
}
if (typeof val === 'number') {
+ // Numbers will be interpreted as unsigned 8-bit integer values between
+ // `0` and `255`.
+ val &= 0xFF
if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
}
@@ -735,7 +738,7 @@ function hexWrite (buf, string, offset, length) {
// must be an even number of digits
var strLen = string.length
- if (strLen % 2 !== 0) throw new Error('Invalid hex string')
+ if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
|
Fix: treat numbers as unsigned 8-bit for .indexOf and .includes
Caught by the new node.js tests
|
feross_buffer
|
train
|
js
|
e9373329b7466d94edf567aa61e7f88185082cc4
|
diff --git a/Controller/Component/CrudComponent.php b/Controller/Component/CrudComponent.php
index <HASH>..<HASH> 100644
--- a/Controller/Component/CrudComponent.php
+++ b/Controller/Component/CrudComponent.php
@@ -371,6 +371,9 @@ class CrudComponent extends Component {
}
$this->request->data = $this->collection->trigger('afterFind', array($this->request->data));
}
+
+ // Trigger a beforeRender
+ $this->collection->trigger('beforeRender');
}
/**
@@ -477,7 +480,9 @@ class CrudComponent extends Component {
// Initialize Collection and load callbacks
$this->collection = new CrudCollection();
$this->collection->loadAll($this->_callbacks['common']);
- $this->collection->loadAll($this->_callbacks[$action]);
+ if (isset($this->_callbacks[$action])) {
+ $this->collection->loadAll($this->_callbacks[$action]);
+ }
// If the Api plugin has been loaded and we are in API request, load Api callback
if (CakePlugin::loaded('Api') && $this->request->is('api')) {
|
Adding missing beforeRender event for editAction and sanity check for custom callback actions
|
FriendsOfCake_crud-json-api
|
train
|
php
|
681295b4646f5468712c29af849fc7a07a2dd638
|
diff --git a/asammdf/blocks/mdf_v4.py b/asammdf/blocks/mdf_v4.py
index <HASH>..<HASH> 100755
--- a/asammdf/blocks/mdf_v4.py
+++ b/asammdf/blocks/mdf_v4.py
@@ -980,13 +980,17 @@ class MDF4(object):
comment = channel_group.acq_source.comment
if comment:
- comment_xml = ET.fromstring(comment)
- common_properties = comment_xml.find(".//common_properties")
- for e in common_properties:
- name = e.get("name")
- if name == "ChannelNo":
- grp.CAN_id = f"CAN{e.text}"
- break
+ try:
+ comment_xml = ET.fromstring(comment)
+ except ET.ParseError:
+ pass
+ else:
+ common_properties = comment_xml.find(".//common_properties")
+ for e in common_properties:
+ name = e.get("name")
+ if name == "ChannelNo":
+ grp.CAN_id = f"CAN{e.text}"
+ break
if grp.CAN_id:
if message_name == "CAN_DataFrame":
|
ignore parsing error of comment in mdf_v4._process_can_logging
|
danielhrisca_asammdf
|
train
|
py
|
0b4097748016395b14ecdc316d2095eb7c968f2a
|
diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go
index <HASH>..<HASH> 100644
--- a/core/vm/gas_table.go
+++ b/core/vm/gas_table.go
@@ -60,7 +60,7 @@ func memoryGasCost(mem *Memory, newMemSize uint64) (uint64, error) {
// as argument:
// CALLDATACOPY (stack position 2)
// CODECOPY (stack position 2)
-// EXTCODECOPY (stack poition 3)
+// EXTCODECOPY (stack position 3)
// RETURNDATACOPY (stack position 2)
func memoryCopierGas(stackpos int) gasFunc {
return func(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) {
|
core/vm: fix typo in comment (#<I>)
|
ethereum_go-ethereum
|
train
|
go
|
4933f46a342141affa677ebb9bc47f385c664ff6
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -83,10 +83,4 @@ exports.validateOptions = function (options) {
if (!options.app_id) {
throw new Error('Missing app id in options.app_id');
}
- if (!options.admins) {
- throw new Error('Missing app admin db name in options.admins');
- }
- if (!options.queue) {
- throw new Error('Missing message queue client in options.queue');
- }
};
diff --git a/test/test-hoodie-db.js b/test/test-hoodie-db.js
index <HASH>..<HASH> 100644
--- a/test/test-hoodie-db.js
+++ b/test/test-hoodie-db.js
@@ -14,9 +14,7 @@ tests['HoodieDB - validate options'] = function (base_opts) {
return function (test) {
var options = {
db: 'http://bar:baz@foo',
- app_id: 'id1234',
- admins: '_users',
- queue: {}
+ app_id: 'id1234'
};
// no errors on complete options object
HoodieDB(options, function (err, hoodie) {
|
remove requirement to pass queue and admins db as options to HoodieDB
|
hoodiehq-archive_hoodie-plugins-api
|
train
|
js,js
|
9e4be1a8c48feb0cdca5a67007cb6a69c2a597f8
|
diff --git a/cherrypy/process/plugins.py b/cherrypy/process/plugins.py
index <HASH>..<HASH> 100644
--- a/cherrypy/process/plugins.py
+++ b/cherrypy/process/plugins.py
@@ -460,7 +460,7 @@ class BackgroundTask(threading.Thread):
it won't delay stopping the whole process.
"""
- def __init__(self, interval, function, args=[], kwargs={}, bus=None):
+ def __init__(self, interval, function, args=[], kwargs={}, bus=None, *, daemon=True):
threading.Thread.__init__(self)
self.interval = interval
self.function = function
@@ -468,6 +468,10 @@ class BackgroundTask(threading.Thread):
self.kwargs = kwargs
self.running = False
self.bus = bus
+ if daemon is not None:
+ self.daemon = daemon
+ else:
+ self.daemon = current_thread().daemon
def cancel(self):
self.running = False
@@ -487,9 +491,6 @@ class BackgroundTask(threading.Thread):
# Quit on first error to avoid massive logs.
raise
- def _set_daemon(self):
- return True
-
class Monitor(SimplePlugin):
"""WSPBus listener to periodically run a callback in its own thread."""
|
Python<I> doesn't use setdaemon for initializing the daemon var anymore
So BackgroundTask would always use the current threads daemon mode on py<I>
|
cherrypy_cheroot
|
train
|
py
|
2e4138aa5c8240d134610d1b00073d09359c8cf9
|
diff --git a/core/src/main/java/io/grpc/BindableService.java b/core/src/main/java/io/grpc/BindableService.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/grpc/BindableService.java
+++ b/core/src/main/java/io/grpc/BindableService.java
@@ -35,11 +35,11 @@ package io.grpc;
* Provides a way to bind instance of service implementation to server.
*
* <p>It is used by service's abstract class generated by compiler (eg.:
- * RouteGuideGrpc.AbstractRouteGuide for RouteGuide service) and lets implementation classes to be
+ * RouteGuideGrpc.RouteGuideImplBase for RouteGuide service) and lets implementation classes to be
* bind to server.
*
* <pre><code>
- * class RouteGuideService extends RouteGuideGrpc.AbstractRouteGuide {
+ * class RouteGuideService extends RouteGuideGrpc.RouteGuideImplBase {
* // ...
* }
*
|
core: Fix doc to refer to ImplBase
|
grpc_grpc-java
|
train
|
java
|
0f7b483e13aa5d8399ac2c74979b138eba016ff8
|
diff --git a/tests/Pagination/PaginationBootstrapPresenterTest.php b/tests/Pagination/PaginationBootstrapPresenterTest.php
index <HASH>..<HASH> 100755
--- a/tests/Pagination/PaginationBootstrapPresenterTest.php
+++ b/tests/Pagination/PaginationBootstrapPresenterTest.php
@@ -115,7 +115,7 @@ class PaginationBootstrapPresenterTest extends PHPUnit_Framework_TestCase {
$presenter = $this->getPresenter();
$output = $presenter->getStart();
- $this->assertEquals('<li class="active"><span>1</a></li><li><a href="http://foo.com?page=2">2</a></li><li class="disabled"><span>...</span></li>', $output);
+ $this->assertEquals('<li class="active"><span>1</span></li><li><a href="http://foo.com?page=2">2</a></li><li class="disabled"><span>...</span></li>', $output);
}
|
fix unit tests, again, missed this one!
|
laravel_framework
|
train
|
php
|
3ee2b92fda52b261cf423e0fc3f65767a0cf5b1d
|
diff --git a/src/commands/init.js b/src/commands/init.js
index <HASH>..<HASH> 100644
--- a/src/commands/init.js
+++ b/src/commands/init.js
@@ -14,13 +14,13 @@ import { error, warning, info, ok } from '../helpers/style';
const templates = [{
name: 'Simple Roc App',
description: 'A simple start on a generic web application',
- identifier: 'web',
- repo: 'vgno/roc-template-web'
+ identifier: 'web-app',
+ repo: 'rocjs/roc-template-web-app'
}, {
name: 'Simple Roc React App',
description: 'A simple start on a React web application',
- identifier: 'web-react',
- repo: 'vgno/roc-template-web-react'
+ identifier: 'web-app-react',
+ repo: 'rocjs/roc-template-web-app-react'
}];
/**
|
Updated the default templates paths, uses the new ones
|
rocjs_roc
|
train
|
js
|
2bf466493cf399959a13d38cae6b2bcc81dc4e7d
|
diff --git a/tests/beautify-tests.js b/tests/beautify-tests.js
index <HASH>..<HASH> 100644
--- a/tests/beautify-tests.js
+++ b/tests/beautify-tests.js
@@ -480,6 +480,13 @@ function run_beautifier_tests(test_obj)
bt('if(a) b()');
+ opts.decode_characters = false;
+ bt('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz"', '"\\x22\\x27", \'\\x22\\x27\', "\\x5c", \'\\x5c\', "\\xff and \\xzz"');
+ opts.decode_characters = true;
+ bt('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz"', '"\\"\'", \'"\\\'\', "\\\\", \'\\\\\', "\\xff and \\xzz"');
+ opts.decode_characters = false;
+
+
bt('3.*7;', '3. * 7;')
bt('import foo.*;', 'import foo.*;') // actionscript's import
test_fragment('function f(a: a, b: b)') // actionscript
|
Added tests for the decode_characters option in the JavaScript test file.
|
beautify-web_js-beautify
|
train
|
js
|
f7930469cf13df94b746799626a8eaa56da2e5a9
|
diff --git a/lib/apollo_upload_server/graphql_data_builder.rb b/lib/apollo_upload_server/graphql_data_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/apollo_upload_server/graphql_data_builder.rb
+++ b/lib/apollo_upload_server/graphql_data_builder.rb
@@ -23,7 +23,8 @@ module ApolloUploadServer
splited_path = path.split('.')
# splited_path => 'variables.input.profile_photo'; splited_path[0..-2] => ['variables', 'input']
# dig from first to penultimate key, and merge last key with value as file
- field = operations.dig(*splited_path[0..-2])
+
+ field = get_parent_field(operations, splited_path)
assign_file(field, splited_path, params[file_index])
end
end
@@ -49,6 +50,20 @@ module ApolloUploadServer
nil
end
+ def get_parent_field(operations, splited_path)
+ # returns parent element of file field
+
+ splited_path[0..-2].inject(operations) do |element, key|
+ case element
+ when Array
+ element[Integer(key)]
+ else
+ element[key]
+ end
+ end
+ end
+
+
def assign_file(field, splited_path, file)
if field.is_a? Hash
field.merge!(splited_path.last => file)
|
[BUGFIX] - digging into operation fields through array
|
jetruby_apollo_upload_server-ruby
|
train
|
rb
|
1bc71a8fa6a5ae5b44c94bac579ccc7cf05055de
|
diff --git a/tests/FdfFileTest.php b/tests/FdfFileTest.php
index <HASH>..<HASH> 100644
--- a/tests/FdfFileTest.php
+++ b/tests/FdfFileTest.php
@@ -5,12 +5,15 @@ class FdfFileTest extends \PHPUnit_Framework_TestCase
{
public function testFdfFileCreation() {
$data = array(
- "standard" => "nothing special here",
- "umlauts-in-value" => "öäüÖÄÜ",
- "öäüÖÄÜ" => "umlauts in key",
+ 'name' => 'Jürgen čárka čČćĆđĐ мирано',
+ 'email' => '[email protected]',
'checkbox 1' => 'Yes',
'checkbox 2' => 0,
'radio 1' => 2,
+ "umlauts-in-value" => "öäüÖÄÜ",
+ "öäüÖÄÜ" => "umlauts in key",
+ "special-in-value" => "ۧ&()",
+ "€ key" => "special in key",
);
$oFdfFile = new FdfFile($data, null, null, __DIR__);
|
Tests > FdfFile >> Slightly changed data array used by testFdfFileCreation()
|
mikehaertl_php-pdftk
|
train
|
php
|
61e7a4a774b79866733713fb13d14e329ba2d949
|
diff --git a/pyquil/__init__.py b/pyquil/__init__.py
index <HASH>..<HASH> 100644
--- a/pyquil/__init__.py
+++ b/pyquil/__init__.py
@@ -1 +1,4 @@
__version__ = "2.0.0.dev0"
+
+from pyquil.quil import Program
+from pyquil.api import QVMConnection, QPUConnection
|
Top level imports (#<I>)
|
rigetti_pyquil
|
train
|
py
|
edc78d0d58dadc0c0aa4e1d9547b2eba8e775c48
|
diff --git a/src/Service/Config/Config.php b/src/Service/Config/Config.php
index <HASH>..<HASH> 100644
--- a/src/Service/Config/Config.php
+++ b/src/Service/Config/Config.php
@@ -130,6 +130,12 @@ class Config extends Fallback
$this->debugFuncList = explode(',', $this->getSetting('debugMethods'));
}
+ /**
+ * Set the directory path, according to the overwrites for:
+ * - Chunk files
+ * - Log files
+ * - Configuration files
+ */
protected function initDirectories()
{
// Set the chunks folder.
|
Added an overlooked php doc comment.
|
brainworxx_kreXX
|
train
|
php
|
e18be3b63dfbf211c9097301d4737739a3087444
|
diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go
index <HASH>..<HASH> 100644
--- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go
+++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go
@@ -283,7 +283,20 @@ func (s *store) GuaranteedUpdate(
transformContext := authenticatedDataString(key)
for {
if err := preconditions.Check(key, origState.obj); err != nil {
- return err
+ // If our data is already up to date, return the error
+ if !mustCheckData {
+ return err
+ }
+
+ // It's possible we were working with stale data
+ // Actually fetch
+ origState, err = getCurrentState()
+ if err != nil {
+ return err
+ }
+ mustCheckData = false
+ // Retry
+ continue
}
ret, ttl, err := s.updateState(origState, tryUpdate)
|
UPSTREAM: <I>: GuaranteedUpdate, retry on precondition check failure if we are working with cached data
|
openshift_origin
|
train
|
go
|
3bfb283efbf1aa5aec545ed5fb2da196f1b72359
|
diff --git a/pymlconf/__init__.py b/pymlconf/__init__.py
index <HASH>..<HASH> 100644
--- a/pymlconf/__init__.py
+++ b/pymlconf/__init__.py
@@ -6,5 +6,5 @@ from .errors import ConfigurationAlreadyInitializedError, \
ConfigurationNotInitializedError
-__version__ = '1.0.0'
+__version__ = '1.0.1'
diff --git a/pymlconf/models.py b/pymlconf/models.py
index <HASH>..<HASH> 100644
--- a/pymlconf/models.py
+++ b/pymlconf/models.py
@@ -234,7 +234,7 @@ class DeferredRoot:
)
return cls._instance
- def initialize(self, *args, force=False, **kw):
+ def initialize(self, init_value, context=None, force=False):
"""
Initialize the configuration manager
@@ -247,5 +247,5 @@ class DeferredRoot:
'Configuration manager object is already initialized.'
)
- self.__class__._instance = Root(*args, **kw)
+ self.__class__._instance = Root(init_value, context=context)
|
Fixing a bug in DeferredRoot
|
pylover_pymlconf
|
train
|
py,py
|
5bb5538961c0f2a6c25edce1d3755ee2f761ce24
|
diff --git a/src/models/StyledComponent.js b/src/models/StyledComponent.js
index <HASH>..<HASH> 100644
--- a/src/models/StyledComponent.js
+++ b/src/models/StyledComponent.js
@@ -61,7 +61,7 @@ export default (ComponentStyle: any) => {
/* eslint-disable react/prop-types */
render() {
const { className, children } = this.props
- const theme = this.state.theme || {}
+ const theme = this.state.theme
const executionContext = Object.assign({}, this.props, { theme })
const generatedClassName = componentStyle.generateAndInjectStyles(executionContext)
diff --git a/src/models/StyledNativeComponent.js b/src/models/StyledNativeComponent.js
index <HASH>..<HASH> 100644
--- a/src/models/StyledNativeComponent.js
+++ b/src/models/StyledNativeComponent.js
@@ -58,7 +58,7 @@ const createStyledNativeComponent = (target: Target, rules: RuleSet, parent?: Ta
/* eslint-disable react/prop-types */
render() {
const { style, children } = this.props
- const theme = this.state.theme || {}
+ const theme = this.state.theme
const generatedStyles = inlineStyle.generateStyleObject({ theme })
const propsForElement = Object.assign({}, this.props)
|
- Remove empty object fallback for theme in styledComponents so that it doesn't overwrite any defaultProps for theme placed on the styledComponent.
- Remove empty object fallback for theme in styledNativeComponents so that it doesn't overwrite any defaultProps for theme placed on the styledComponent.
|
styled-components_styled-components
|
train
|
js,js
|
18662aff04a9a304bf5eb00f16e2c3952c5ed2c3
|
diff --git a/src/Target/DoctrineORM/DoctrineORM.php b/src/Target/DoctrineORM/DoctrineORM.php
index <HASH>..<HASH> 100644
--- a/src/Target/DoctrineORM/DoctrineORM.php
+++ b/src/Target/DoctrineORM/DoctrineORM.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace RulerZ\Target\DoctrineORM;
+use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use RulerZ\Compiler\Context;
@@ -43,8 +44,15 @@ class DoctrineORM extends AbstractSqlTarget
{
$aliases = implode('', $context['root_aliases']);
$entities = implode('', $context['root_entities']);
+ $joined = '';
+ /** @var Expr\Join[] $joins */
+ foreach ($context['joins'] as $rootEntity => $joins) {
+ foreach ($joins as $join) {
+ $joined .= $join->getAlias().$join->getJoin();
+ }
+ }
- return $aliases.$entities;
+ return $aliases.$entities.$joined;
}
/**
|
ensure different executors are used for different query builders
when the same rule is reused for several different query builders
the current identifier assumes they can use the same executor, which
now will join any determined joins from a different incompatible querybuilder
potentially joining the same alias and table again
|
K-Phoen_rulerz
|
train
|
php
|
55be856f63efff3880e03be752b4936f610ec8f4
|
diff --git a/eZ/Publish/Core/FieldType/Url/Type.php b/eZ/Publish/Core/FieldType/Url/Type.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/FieldType/Url/Type.php
+++ b/eZ/Publish/Core/FieldType/Url/Type.php
@@ -82,7 +82,7 @@ class Type extends FieldType
*/
protected function checkValueStructure(BaseValue $value)
{
- if (!is_string($value->link)) {
+ if (null !== $value->link && !is_string($value->link)) {
throw new InvalidArgumentType(
'$value->link',
'string',
@@ -90,7 +90,7 @@ class Type extends FieldType
);
}
- if (isset($value->text) && !is_string($value->text)) {
+ if (null !== $value->text && !is_string($value->text)) {
throw new InvalidArgumentType(
'$value->text',
'string',
|
EZP-<I>: Error <I> after filling Text field in URL field type (#<I>)
|
ezsystems_ezpublish-kernel
|
train
|
php
|
11034d28eef2f3c2b8cbfee90e714371687c312a
|
diff --git a/erizo_controller/erizoController/erizoController.js b/erizo_controller/erizoController/erizoController.js
index <HASH>..<HASH> 100644
--- a/erizo_controller/erizoController/erizoController.js
+++ b/erizo_controller/erizoController/erizoController.js
@@ -383,6 +383,10 @@ var listen = function () {
//Gets 'sendDataStream' messages on the socket in order to write a message in a dataStream.
socket.on('sendDataStream', function (msg) {
+ if (socket.room.streams[msg.id] === undefined){
+ log.warn('Trying to send Data from a non-initialized stream ', msg);
+ return;
+ }
var sockets = socket.room.streams[msg.id].getDataSubscribers(), id;
for (id in sockets) {
if (sockets.hasOwnProperty(id)) {
@@ -399,6 +403,10 @@ var listen = function () {
//Gets 'updateStreamAttributes' messages on the socket in order to update attributes from the stream.
socket.on('updateStreamAttributes', function (msg) {
+ if (socket.room.streams[msg.id] === undefined){
+ log.warn('Trying to update atributes from a non-initialized stream ', msg);
+ return;
+ }
var sockets = socket.room.streams[msg.id].getDataSubscribers(), id;
socket.room.streams[msg.id].setAttributes(msg.attrs);
for (id in sockets) {
|
Added check before sending data or updating attributes
in erizoController
|
lynckia_licode
|
train
|
js
|
a75e3a008acac84b3f3066407d889c45b8a56297
|
diff --git a/pgpy/pgp.py b/pgpy/pgp.py
index <HASH>..<HASH> 100644
--- a/pgpy/pgp.py
+++ b/pgpy/pgp.py
@@ -2098,7 +2098,7 @@ class PGPKey(Armorable, ParentRef, PGPObject):
"""
hash_algo = prefs.pop('hash', None)
- sig = PGPSignature.new(SignatureType.DirectlyOnKey, self.key_algorithm, hash_algo, self.fingerprint.keyid, prefs.pop('created', None))
+ sig = PGPSignature.new(SignatureType.DirectlyOnKey, self.key_algorithm, hash_algo, self.fingerprint.keyid, created=prefs.pop('created', None))
# signature options that only make sense when adding a revocation key
sensitive = prefs.pop('sensitive', False)
|
Fix up minor bug introduced in #<I>
|
SecurityInnovation_PGPy
|
train
|
py
|
ec6f74a7b3ac745bf235352f219fbb81f1eca53f
|
diff --git a/h2o-algos/src/main/java/hex/ensemble/StackedEnsembleMojoWriter.java b/h2o-algos/src/main/java/hex/ensemble/StackedEnsembleMojoWriter.java
index <HASH>..<HASH> 100644
--- a/h2o-algos/src/main/java/hex/ensemble/StackedEnsembleMojoWriter.java
+++ b/h2o-algos/src/main/java/hex/ensemble/StackedEnsembleMojoWriter.java
@@ -3,11 +3,11 @@ package hex.ensemble;
import hex.Model;
import hex.MultiModelMojoWriter;
import hex.StackedEnsembleModel;
+import water.DKV;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
-import water.DKV;
public class StackedEnsembleMojoWriter extends MultiModelMojoWriter<StackedEnsembleModel,
StackedEnsembleModel.StackedEnsembleParameters, StackedEnsembleModel.StackedEnsembleOutput> {
@@ -20,7 +20,7 @@ public class StackedEnsembleMojoWriter extends MultiModelMojoWriter<StackedEnsem
@Override
public String mojoVersion() {
- return "1.0";
+ return "1.00";
}
@Override
|
Changed Mojo version of StackedEnsemble from <I> to <I>. (#<I>)
|
h2oai_h2o-3
|
train
|
java
|
cdf796f968ba501844ca412032b917bbfb0fec5d
|
diff --git a/spec/dbi.rb b/spec/dbi.rb
index <HASH>..<HASH> 100644
--- a/spec/dbi.rb
+++ b/spec/dbi.rb
@@ -46,7 +46,7 @@ describe 'DBI::DatabaseHandle#one_transaction' do
thread1 = Thread.new do
value = $dbh.sc "SELECT c1 FROM many_col_table WHERE id = 1;"
value.should.equal 10
- sleep 5 # seconds
+ sleep 2 # seconds
$dbh.u "UPDATE many_col_table SET c1 = ?", ( value + 1 )
end
@@ -69,7 +69,7 @@ describe 'DBI::DatabaseHandle#one_transaction' do
thread1 = Thread.new do
$dbh.one_transaction do |dbh|
value = dbh.sc "SELECT c1 FROM many_col_table WHERE id = 1;"
- sleep 5 # seconds
+ sleep 2 # seconds
dbh.u "UPDATE many_col_table SET c1 = ?", ( value + 1 )
end
end
|
Reduced sleep time so specs don't take so long.
|
Pistos_m4dbi
|
train
|
rb
|
2625f18daec6d513857f4c5e180642c0171224e6
|
diff --git a/lib/transform.js b/lib/transform.js
index <HASH>..<HASH> 100644
--- a/lib/transform.js
+++ b/lib/transform.js
@@ -30,7 +30,7 @@ var findFirstNodeAfter = exports.findFirstNodeAfter = function(ast, code, type)
traverse(ast, {
pre: function(node) {
- if(node && node.type !== 'Line' && recast.print(node).code === code) {
+ if(node && node.type !== 'Line' && node.type !== 'Block' && recast.print(node).code === code) {
next = true;
}
diff --git a/test/transform.test.js b/test/transform.test.js
index <HASH>..<HASH> 100644
--- a/test/transform.test.js
+++ b/test/transform.test.js
@@ -158,12 +158,18 @@ describe('transforms', () => {
it('addToArrayInObject for hook objects', () => {
const ast = transform.parse(`
exports.before = {
- all: [],
+ all: [
+ // otherCommentedOut();
+ /* commentedOut() */
+ ],
create: [addUser()]
}
exports.after = {
- all: [],
+ all: [
+ // otherCommentedOut()
+ /* commentedOut() */
+ ],
create: [addUser({ some: 'test' })]
}
`);
|
Test and fix for commented out hooks (#<I>)
|
feathersjs_generator-feathers
|
train
|
js,js
|
598a7793587f39ecfe932fff829070a7864a0058
|
diff --git a/lib/unparser/emitter/repetition.rb b/lib/unparser/emitter/repetition.rb
index <HASH>..<HASH> 100644
--- a/lib/unparser/emitter/repetition.rb
+++ b/lib/unparser/emitter/repetition.rb
@@ -24,7 +24,7 @@ module Unparser
def dispatch
write(MAP.fetch(node.type), WS)
visit(condition)
- indented { visit(body) }
+ emit_body
k_end
end
diff --git a/spec/integration/unparser/spike_spec.rb b/spec/integration/unparser/spike_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/unparser/spike_spec.rb
+++ b/spec/integration/unparser/spike_spec.rb
@@ -946,6 +946,11 @@ describe Unparser, 'spike' do
context 'while' do
assert_source <<-RUBY
while false
+ end
+ RUBY
+
+ assert_source <<-RUBY
+ while false
3
end
RUBY
@@ -954,6 +959,11 @@ describe Unparser, 'spike' do
context 'until' do
assert_source <<-RUBY
until false
+ end
+ RUBY
+
+ assert_source <<-RUBY
+ until false
3
end
RUBY
|
Handle nil bodies of while/unless statements
|
mbj_unparser
|
train
|
rb,rb
|
e7f1050793c3e3f550680d77806fb87dde812a9a
|
diff --git a/plot/__init__.py b/plot/__init__.py
index <HASH>..<HASH> 100644
--- a/plot/__init__.py
+++ b/plot/__init__.py
@@ -161,6 +161,13 @@ def __parse_args(arg_string=None):
)
args.add_argument(
+ '-D', '--density',
+ dest='density',
+ action='store_true',
+ help='Density coloration; much slower renders',
+ )
+
+ args.add_argument(
'infile',
nargs='?',
action='store',
@@ -309,8 +316,11 @@ def graph(args):
if ytype == _dt:
yy = [to_timestamp(yv) for yv in y]
- xy = np.vstack([xx, yy])
- z = gaussian_kde(xy)(xy)
+ if args.density:
+ xy = np.vstack([xx, yy])
+ z = gaussian_kde(xy)(xy)
+ else:
+ z = 'b'
logger.info('Drawing scatter..')
plt.scatter(x, y, c=z, s=dot_size, edgecolor='', cmap=cmap)
|
added plot denisty flag for additional coloration
|
bibby_itch
|
train
|
py
|
a445fc47daf64f19c2feee959ff812525e74b63b
|
diff --git a/cmd/jujud/agent/unit/manifolds.go b/cmd/jujud/agent/unit/manifolds.go
index <HASH>..<HASH> 100644
--- a/cmd/jujud/agent/unit/manifolds.go
+++ b/cmd/jujud/agent/unit/manifolds.go
@@ -24,14 +24,12 @@ import (
"github.com/juju/juju/worker/upgrader"
)
-type manifoldFactory func(config ManifoldsConfig) (dependency.Manifold, error)
-
var (
- registeredManifolds = make(map[string]manifoldFactory)
+ registeredManifolds = make(map[string]func(ManifoldsConfig) (dependency.Manifold, error))
)
// RegisterManifold adds the worker to the list of workers to start.
-func RegisterManifold(name string, newManifold manifoldFactory) error {
+func RegisterManifold(name string, newManifold func(ManifoldsConfig) (dependency.Manifold, error)) error {
if _, ok := registeredManifolds[name]; ok {
return errors.Errorf("%q manifold already registered", name)
}
|
Drop manifoldFactory.
|
juju_juju
|
train
|
go
|
d0e13ca0bac23262ef6dc0c0bdca4b7f511e68af
|
diff --git a/lib/sfn/callback/stack_policy.rb b/lib/sfn/callback/stack_policy.rb
index <HASH>..<HASH> 100644
--- a/lib/sfn/callback/stack_policy.rb
+++ b/lib/sfn/callback/stack_policy.rb
@@ -4,13 +4,20 @@ module Sfn
class Callback
class StackPolicy < Callback
+ # @return [Smash] cached policies
attr_reader :policies
+ # Overload to init policy cache
+ #
+ # @return [self]
def initialize(*args)
super
@policies = Smash.new
end
+ # Submit all cached policies
+ #
+ # @param args [Hash]
def submit_policy(args)
ui.warn "Policy submission not currently enabled!"
ui.info "Currently cached policies for upload: #{@policies.inspect}"
@@ -18,6 +25,16 @@ module Sfn
alias_method :after_create, :submit_policy
alias_method :after_update, :submit_policy
+ # Update all policies to allow resource destruction
+ def before_destroy(args)
+ ui.warn "Policy modification for deletion not currently enabled!"
+ end
+
+ # Remove all policies
+ def after_destroy(args)
+ ui.warn "Policy removal not currently enabled!"
+ end
+
# Generate stack policy for stack and cache for the after hook
# to handle
#
|
Include stubs for required items
|
sparkleformation_sfn
|
train
|
rb
|
c3b021688a6daef2972864b08e5cbe156e3ede13
|
diff --git a/src/PatternLab/Console/Commands/ServerCommand.php b/src/PatternLab/Console/Commands/ServerCommand.php
index <HASH>..<HASH> 100644
--- a/src/PatternLab/Console/Commands/ServerCommand.php
+++ b/src/PatternLab/Console/Commands/ServerCommand.php
@@ -49,7 +49,7 @@ class ServerCommand extends Command {
$host = $port ? $host.":".$port : $host.":8080";
// start-up the server with the router
- Console::writeInfo("server started on ".$host.". use ctrl+c to exit...");
+ Console::writeInfo("server started on http://".$host.". use ctrl+c to exit...");
passthru("cd ".$publicDir." && ".$_SERVER["_"]." -S ".$host." ".$coreDir."/server/router.php");
}
|
adding http:// prefix to url so it is clickable
|
pattern-lab_patternlab-php-core
|
train
|
php
|
45bd588bda8a848f8e311e255d88fb6761b660e0
|
diff --git a/src/models/marker.js b/src/models/marker.js
index <HASH>..<HASH> 100644
--- a/src/models/marker.js
+++ b/src/models/marker.js
@@ -30,7 +30,11 @@ const Marker = Model.extend({
this._super(name, value, parent, binds, persistent);
this.on("change", "space", this.updateSpaceReferences.bind(this));
- utils.defer(() => _this.updateSpaceReferences());
+ },
+
+ setInterModelListeners() {
+ this._super();
+ this.updateSpaceReferences()
},
updateSpaceReferences() {
|
set space references after toolmodel is set up completely
|
vizabi_vizabi
|
train
|
js
|
4394cc5b1b9983e067f3b01ec749c6fd32ef3f46
|
diff --git a/utility.py b/utility.py
index <HASH>..<HASH> 100644
--- a/utility.py
+++ b/utility.py
@@ -193,7 +193,11 @@ def wait_for_port(host, port, closed=False, timeout=30):
else:
continue
conn = socket.socket(*addrinfo[0][:3])
- conn.settimeout(max(remaining, 5))
+ if remaining is None:
+ conn_timeout = 5
+ else:
+ conn_timeout = max(remaining, 5)
+ conn.settimeout(conn_timeout)
try:
conn.connect(sockaddr)
except socket.timeout:
|
Set timeout without comparing int to None.
|
juju_juju
|
train
|
py
|
382de2dc695dcccae0307d0e221aee2129b2c232
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -22,7 +22,8 @@ const defaultGenerators = {
};
function mergeTreesIfNeeded(trees, options) {
- return trees.length === 1 ? trees[0] : new MergeTrees(trees, options);
+ let mergedOptions = _.assign({ overwrite: true }, options);
+ return trees.length === 1 ? trees[0] : new MergeTrees(trees, mergedOptions);
}
function buildOptions(customOpts = {}, env) {
|
Add overwrite flag to MergeTrees
Solves problem of having same files in different folders.
|
ivanvotti_ember-svg-jar
|
train
|
js
|
5a66487555f83b61e3d26e211faab6864219fc0b
|
diff --git a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java
index <HASH>..<HASH> 100644
--- a/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java
+++ b/twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java
@@ -58,6 +58,7 @@ public class HttpClientImpl implements HttpClient, HttpResponseCode, java.io.Ser
isJDK14orEarlier = 1.5d > Double.parseDouble(versionStr);
}
if (ConfigurationContext.getInstance().isDalvik()) {
+ isJDK14orEarlier = false;
// quick and dirty workaround for TFJ-296
// it must be an Android/Dalvik/Harmony side issue!!!!
System.setProperty("http.keepAlive", "false");
@@ -131,7 +132,7 @@ public class HttpClientImpl implements HttpClient, HttpResponseCode, java.io.Ser
BufferedInputStream in = new BufferedInputStream(
param.hasFileBody() ? param.getFileBody() : new FileInputStream(param.getFile())
);
- int buff = 0;
+ int buff;
while ((buff = in.read()) != -1) {
out.write(buff);
}
|
TFJ-<I> ensure that Twitter4J accepts HTTP proxy server configuration on Android platform
|
Twitter4J_Twitter4J
|
train
|
java
|
67747ca08fc899f680d4192e0556a11ff341ea67
|
diff --git a/pkg/kubelet/image_manager.go b/pkg/kubelet/image_manager.go
index <HASH>..<HASH> 100644
--- a/pkg/kubelet/image_manager.go
+++ b/pkg/kubelet/image_manager.go
@@ -267,7 +267,7 @@ func (im *realImageManager) freeSpace(bytesToFree int64, freeTime time.Time) (in
spaceFreed := int64(0)
for _, image := range images {
// Images that are currently in used were given a newer lastUsed.
- if image.lastUsed.After(freeTime) {
+ if image.lastUsed.Equal(freeTime) || image.lastUsed.After(freeTime) {
break
}
|
allow equality to avoid flaky on clock
|
kubernetes_kubernetes
|
train
|
go
|
c95fc9d135bb68c90f0e638b00b364f19c6ec103
|
diff --git a/feedstail/feedstail.py b/feedstail/feedstail.py
index <HASH>..<HASH> 100644
--- a/feedstail/feedstail.py
+++ b/feedstail/feedstail.py
@@ -58,10 +58,10 @@ def loop():
global tail
entries = parse(config.url).entries
- if number is not None and number < len(entries):
- entries = entries[:number]
+ if number is not None and number <= len(entries):
for entry in entries[number:]:
tail = [entry] + tail[:100]
+ entries = entries[:number]
if config.reverse:
entries.reverse()
|
[fix] condition for -n on the len of entries and change order of code
With the previous order I was walking an empty list in the for loop ...
|
YoloSwagTeam_feedstail
|
train
|
py
|
a42ddd7b6444b736ae8d16f96edb53f88870a7c8
|
diff --git a/lib/nydp/version.rb b/lib/nydp/version.rb
index <HASH>..<HASH> 100644
--- a/lib/nydp/version.rb
+++ b/lib/nydp/version.rb
@@ -1,3 +1,3 @@
module Nydp
- VERSION = "0.4.2"
+ VERSION = "0.4.3"
end
|
version: bump to <I>
|
conanite_nydp
|
train
|
rb
|
231bc8ce65b66784381f2e735430cec0b9314873
|
diff --git a/src/gridstack.js b/src/gridstack.js
index <HASH>..<HASH> 100644
--- a/src/gridstack.js
+++ b/src/gridstack.js
@@ -700,6 +700,7 @@
};
GridStack.prototype.resizable = function (el, val) {
+ var self = this;
el = $(el);
el.each(function (index, el) {
el = $(el);
@@ -709,7 +710,7 @@
}
node.no_resize = !(val || false);
- if (node.no_resize) {
+ if (node.no_resize || self._is_one_column_mode()) {
el.resizable('disable');
}
else {
@@ -720,6 +721,7 @@
};
GridStack.prototype.movable = function (el, val) {
+ var self = this;
el = $(el);
el.each(function (index, el) {
el = $(el);
@@ -729,7 +731,7 @@
}
node.no_move = !(val || false);
- if (node.no_move) {
+ if (node.no_move || self._is_one_column_mode()) {
el.draggable('disable');
}
else {
|
Fix resize/move issue in one column mode
Calling resizable() and movable() with 'true' no longer makes nodes resizable/movable in one column mode, fixes <I>.
|
gridstack_gridstack.js
|
train
|
js
|
7ed5c0e07ae49f40ab341f17a6d76ba4039c072c
|
diff --git a/graphql_jwt/middleware.py b/graphql_jwt/middleware.py
index <HASH>..<HASH> 100644
--- a/graphql_jwt/middleware.py
+++ b/graphql_jwt/middleware.py
@@ -63,6 +63,7 @@ class JSONWebTokenMiddleware:
elif hasattr(context, 'user'):
if hasattr(context, 'session'):
context.user = get_user(context)
+ self.cached_authentication.insert(info.path, context.user)
else:
context.user = AnonymousUser()
|
Added session user to cached_authentication for JWT argument authentication
|
flavors_django-graphql-jwt
|
train
|
py
|
0b6e4708d46d99b68988ecfd91436d8d1e4e801f
|
diff --git a/schema/union.go b/schema/union.go
index <HASH>..<HASH> 100644
--- a/schema/union.go
+++ b/schema/union.go
@@ -121,11 +121,10 @@ func (s *UnionField) FieldsMethodDef() string {
getBody += fmt.Sprintf("r.%v = %v\n", f.Name(), constructor.ConstructorMethod())
}
if f.WrapperType() == "" {
- getBody += fmt.Sprintf("return r.%v", f.Name())
+ getBody += fmt.Sprintf("return r.%v\n", f.Name())
} else {
- getBody += fmt.Sprintf("return (*%v)(&r.%v)", f.WrapperType(), f.Name())
+ getBody += fmt.Sprintf("return (*%v)(&r.%v)\n", f.WrapperType(), f.Name())
}
- getBody += "\nbreak\n"
}
return fmt.Sprintf(unionFieldTemplate, s.GoType(), s.unionEnumType(), getBody)
}
|
Don't break after returning in a generated Union method (#<I>)
To prevent an 'unreachable code' error with go vet, we should avoid breaking after a return in a switch case as defined in schema/union.go. This has no observable effect on the code and is simply a fix to get the generated go files to pass static analysis.
|
actgardner_gogen-avro
|
train
|
go
|
937153a92f5b6ac3818ebfce6a11cda71fb631f8
|
diff --git a/src/managers/GuildMemberManager.js b/src/managers/GuildMemberManager.js
index <HASH>..<HASH> 100644
--- a/src/managers/GuildMemberManager.js
+++ b/src/managers/GuildMemberManager.js
@@ -5,6 +5,7 @@ const { Error, TypeError, RangeError } = require('../errors');
const GuildMember = require('../structures/GuildMember');
const Collection = require('../util/Collection');
const { Events, OPCodes } = require('../util/Constants');
+const SnowflakeUtil = require('../util/Snowflake');
/**
* Manages API methods for GuildMembers and stores their cache.
@@ -263,7 +264,7 @@ class GuildMemberManager extends BaseManager {
user: user_ids,
query,
time = 120e3,
- nonce = Date.now().toString(16),
+ nonce = SnowflakeUtil.generate(),
force = false,
} = {}) {
return new Promise((resolve, reject) => {
|
fix(GuildMemberManager): Use actually random nonce in fetch (#<I>)
|
discordjs_discord.js
|
train
|
js
|
c65924cc3e3f51b7c20bf98cb2b92cffe2f63dd8
|
diff --git a/kuyruk/kuyruk.py b/kuyruk/kuyruk.py
index <HASH>..<HASH> 100644
--- a/kuyruk/kuyruk.py
+++ b/kuyruk/kuyruk.py
@@ -64,6 +64,7 @@ class Kuyruk:
@contextmanager
def connection(self) -> Iterator[amqp.Connection]:
"""Returns a new connection as a context manager."""
+ TCP_USER_TIMEOUT = 18 # constant is available on Python 3.6+.
conn = amqp.Connection(
host="%s:%s" % (self.config.RABBIT_HOST, self.config.RABBIT_PORT),
userid=self.config.RABBIT_USER,
@@ -72,6 +73,7 @@ class Kuyruk:
connect_timeout=self.config.RABBIT_CONNECT_TIMEOUT,
read_timeout=self.config.RABBIT_READ_TIMEOUT,
write_timeout=self.config.RABBIT_WRITE_TIMEOUT,
+ socket_settings={TCP_USER_TIMEOUT: self.config.RABBIT_CONNECT_TIMEOUT},
)
conn.connect()
logger.info('Connected to RabbitMQ')
|
make tcp user timeout equal to connect timeout
|
cenkalti_kuyruk
|
train
|
py
|
76a7d6bc2bc6c0ac4783af3e1b157178720eee17
|
diff --git a/code/libraries/koowa/libraries/behavior/abstract.php b/code/libraries/koowa/libraries/behavior/abstract.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/libraries/behavior/abstract.php
+++ b/code/libraries/koowa/libraries/behavior/abstract.php
@@ -171,10 +171,13 @@ abstract class KBehaviorAbstract extends KCommandCallbackAbstract implements KBe
*/
public function getHandle()
{
- $callbacks = $this->getCommandCallbacks();
+ if($this->isSupported())
+ {
+ $callbacks = $this->getCommandCallbacks();
- if(!empty($callbacks)) {
- return parent::getHandle();
+ if(!empty($callbacks)) {
+ return parent::getHandle();
+ }
}
return false;
|
re #<I> : Check if the behavior is supported before returning a object handle.
|
joomlatools_joomlatools-framework
|
train
|
php
|
c30a4e001ce5a007601a7d0c32b8ceef62c18dc3
|
diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py
index <HASH>..<HASH> 100644
--- a/src/saml2/mdstore.py
+++ b/src/saml2/mdstore.py
@@ -66,6 +66,7 @@ classnames = {
ENTITY_CATEGORY = "http://macedir.org/entity-category"
ENTITY_CATEGORY_SUPPORT = "http://macedir.org/entity-category-support"
+ASSURANCE_CERTIFICATION = "urn:oasis:names:tc:SAML:attribute:assurance-certification"
REQ2SRV = {
# IDP
@@ -1243,6 +1244,15 @@ class MetadataStore(MetaData):
attributes = self.entity_attributes(entity_id)
return attributes.get(ENTITY_CATEGORY_SUPPORT, [])
+ def assurance_certifications(self, entity_id):
+ assurance_certifications = (
+ certification
+ for name, values in self.entity_attributes(entity_id).items()
+ if name == ASSURANCE_CERTIFICATION
+ for certification in values
+ )
+ return assurance_certifications
+
def entity_attributes(self, entity_id):
"""
Get all entity attributes for an entry in the metadata.
|
Add mdstore method to extract assurance certifications
|
IdentityPython_pysaml2
|
train
|
py
|
1770bd570c1b20a91a9eef6e19ee66289783e52f
|
diff --git a/mqemitter-redis.js b/mqemitter-redis.js
index <HASH>..<HASH> 100644
--- a/mqemitter-redis.js
+++ b/mqemitter-redis.js
@@ -91,7 +91,7 @@ MQEmitterRedis.prototype.close = function (cb) {
}
MQEmitterRedis.prototype._subTopic = function (topic) {
- return topic.replace(this._opts.wildcardOne, '*')
+ return topic.replace(new RegExp(this._opts.wildcardOne.replace(/([/,!\\^${}[\]().*+?|<>\-&])/g, '\\$&'), 'g'), '*')
.replace(this._opts.wildcardSome, '*')
}
|
fixed Redis subscriber adapter, replace all occurrence of `wildcardOne` symbol ('+') in topic
|
mcollina_mqemitter-redis
|
train
|
js
|
cbe058ceb4fe34a2d4c8a341c2b5c0570941a094
|
diff --git a/credstash.py b/credstash.py
index <HASH>..<HASH> 100755
--- a/credstash.py
+++ b/credstash.py
@@ -377,6 +377,9 @@ def getAllSecrets(version="", region=None, table="credential-store",
else:
names = set(x["name"] for x in secrets)
+ if len(names) == 0:
+ return dict()
+
pool = ThreadPool(min(len(names), THREAD_POOL_MAX_SIZE))
results = pool.map(
lambda credential: getSecret(credential, version, region, table, context, dynamodb, kms, **kwargs),
|
check for empty names list in getall
|
fugue_credstash
|
train
|
py
|
311cba971d4f49c929ad04a7ed465c54e2978498
|
diff --git a/pkg/localkube/kubelet.go b/pkg/localkube/kubelet.go
index <HASH>..<HASH> 100644
--- a/pkg/localkube/kubelet.go
+++ b/pkg/localkube/kubelet.go
@@ -35,7 +35,7 @@ func StartKubeletServer(lk LocalkubeServer) func() error {
config.Containerized = lk.Containerized
config.AllowPrivileged = true
- config.Config = "/etc/kubernetes/manifests"
+ config.PodManifestPath = "/etc/kubernetes/manifests"
// Networking
config.ClusterDomain = lk.DNSDomain
|
Manual merge fix for <I> to build.
|
kubernetes_minikube
|
train
|
go
|
2505b59486dc10ebd622307adee31dc1ee6fccec
|
diff --git a/js/ugen.js b/js/ugen.js
index <HASH>..<HASH> 100644
--- a/js/ugen.js
+++ b/js/ugen.js
@@ -192,6 +192,9 @@ const createProperty = function( obj, propertyName, __wrappedObject, timeProps,
store.__wrapped__.widget.clear()
}
+ prop.value.from = from
+ prop.value.to = to
+
return obj
},
@@ -543,6 +546,8 @@ const Ugen = function( gibberishConstructor, description, Audio, shouldUsePool =
const sum = dest.mods.concat( dest.preModValue )
const add = Gibber.binops.Add( ...sum )
+ // below works for oscillators, above works for instruments...
+ //const add = Gibber.Gibberish.binops.Add( ...sum )
add.__useMapping = false
dest.ugen[ dest.name ] = add
|
fix for fades and storing some comments on binop adds
|
charlieroberts_gibber.audio.lib
|
train
|
js
|
d9fe58767817e7f3008bd62c577bd0367dd4434c
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -76,7 +76,7 @@ setup(
'prepare-infrastructure=foremast.runner:prepare_infrastructure',
'foremast-infrastructure=foremast.runner:prepare_infrastructure',
'prepare-onetime-pipeline=foremast.runner:prepare_onetime_pipeline',
- 'foremast-onetime-pipeline=foremast.runner:prepare_onetime_pipeline',
+ 'foremast-pipeline-onetime=foremast.runner:prepare_onetime_pipeline',
'create-scaling-policy=foremast.runner:create_scaling_policy',
'foremast-scaling-policy=foremast.runner:create_scaling_policy',
'rebuild_pipelines=foremast.runner:rebuild_pipelines',
|
changed name of onetime-pipeline to pipeline-onetime
|
foremast_foremast
|
train
|
py
|
c33ab118f8207f2fe6226a01587ee1e950055873
|
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb
index <HASH>..<HASH> 100644
--- a/railties/test/abstract_unit.rb
+++ b/railties/test/abstract_unit.rb
@@ -18,3 +18,11 @@ if defined?(RAILS_ROOT)
else
RAILS_ROOT = File.dirname(__FILE__)
end
+
+def uses_gem(gem_name, test_name, version = '> 0')
+ gem gem_name.to_s, version
+ require gem_name.to_s
+ yield
+rescue LoadError
+ $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
+end
diff --git a/railties/test/fcgi_dispatcher_test.rb b/railties/test/fcgi_dispatcher_test.rb
index <HASH>..<HASH> 100644
--- a/railties/test/fcgi_dispatcher_test.rb
+++ b/railties/test/fcgi_dispatcher_test.rb
@@ -1,6 +1,7 @@
require 'abstract_unit'
-begin
+uses_gem "fcgi", "0.8.7" do
+
require 'action_controller'
require 'fcgi_handler'
@@ -260,7 +261,4 @@ class RailsFCGIHandlerPeriodicGCTest < Test::Unit::TestCase
assert_nil @handler.when_ready
end
end
-
-rescue LoadError => e
- raise unless e.message =~ /fcgi/
-end
+end # uses_gem "fcgi"
|
Properly skip fcgi tests if the gem is not installed
|
rails_rails
|
train
|
rb,rb
|
31dab4e7ff9f0af243ad089f43d88690e2d129f8
|
diff --git a/pkg/mountinfo/mountinfo_linux.go b/pkg/mountinfo/mountinfo_linux.go
index <HASH>..<HASH> 100644
--- a/pkg/mountinfo/mountinfo_linux.go
+++ b/pkg/mountinfo/mountinfo_linux.go
@@ -131,9 +131,11 @@ func parseMountFrom(file io.Reader) (mountInfos, error) {
if err == io.EOF {
break
}
+
fields := strings.Fields(line)
if len(fields) != expectedNumFieldsPerLine {
- return nil, fmt.Errorf("wrong number of fields (expected %d, got %d): %s", expectedNumFieldsPerLine, len(fields), line)
+ // ignore incorrect lines.
+ continue
}
// Freq should be an integer.
diff --git a/pkg/mountinfo/mountinfo_linux_test.go b/pkg/mountinfo/mountinfo_linux_test.go
index <HASH>..<HASH> 100644
--- a/pkg/mountinfo/mountinfo_linux_test.go
+++ b/pkg/mountinfo/mountinfo_linux_test.go
@@ -214,7 +214,6 @@ func TestReadProcMountFrom(t *testing.T) {
// Error cases where parsing fails with invalid Freq and Pass params.
{
errorCases := []string{
- "/dev/0 /path/to/mount\n",
"/dev/1 /path/to/mount type flags a 0\n",
"/dev/2 /path/to/mount type flags 0 b\n",
}
|
ignore more tokens in some mountinfo entries (#<I>)
it seems to be legitimate to have `mountinfo` lines
to have keywords with spaces such as
```
rootfs overlay / overlay rw,relatime,lowerdir...
```
This was not expected, but for our requirement
we can just ignore this and move forward.
fixes #<I>
|
minio_minio
|
train
|
go,go
|
fad5f9139759fc52d323aac10ebbd41bed015468
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -13,6 +13,7 @@ module.exports = function (grunt) {
['jshint', 'main'],
['jshint', 'lib'],
['jshint', 'bindings'],
+ ['jshint', 'tests'],
['jsonlint', 'all'],
];
@@ -64,6 +65,7 @@ module.exports = function (grunt) {
'jshint:main',
'jshint:lib',
'jshint:bindings',
+ 'jshint:tests',
'jsonlint:all',
]);
diff --git a/grunt/config/lint/jshint.js b/grunt/config/lint/jshint.js
index <HASH>..<HASH> 100644
--- a/grunt/config/lint/jshint.js
+++ b/grunt/config/lint/jshint.js
@@ -22,4 +22,10 @@ module.exports = {
jshintrc: 'bindings/.jshintrc',
},
},
+ tests: {
+ src: ['tests/**/*.js'],
+ options: {
+ jshintrc: 'tests/.jshintrc',
+ },
+ },
};
|
Enable jshint:tests in Gruntfile
|
l20n_l20n.js
|
train
|
js,js
|
c390b93bc146d46820a400b1bd96e2fda0bd97de
|
diff --git a/spatialist/ancillary.py b/spatialist/ancillary.py
index <HASH>..<HASH> 100644
--- a/spatialist/ancillary.py
+++ b/spatialist/ancillary.py
@@ -199,9 +199,9 @@ def finder(target, matchlist, foldermode=0, regex=False, recursive=True):
return sorted(out)
else:
- raise TypeError("if parameter 'target' is a file, "
- "it must be a zip or tar archive:\n {}"
- .format(target))
+ raise RuntimeError("if parameter 'target' is a file, "
+ "it must be a zip or tar archive:\n {}"
+ .format(target))
else:
raise RuntimeError("if parameter 'target' is of type str, "
"it must be a directory or a file:\n {}"
diff --git a/spatialist/tests/test_ancillary.py b/spatialist/tests/test_ancillary.py
index <HASH>..<HASH> 100644
--- a/spatialist/tests/test_ancillary.py
+++ b/spatialist/tests/test_ancillary.py
@@ -91,6 +91,9 @@ def test_finder(tmpdir, testdata):
with pytest.raises(RuntimeError):
anc.finder('foobar', ['test*'], foldermode=2)
+
+ with pytest.raises(RuntimeError):
+ anc.finder(testdata['tif'], ['test*'], foldermode=2)
def test_rescale():
|
[ancillary.finder] TypeError->RuntimeError if target file is neither zip nor tar
|
johntruckenbrodt_spatialist
|
train
|
py,py
|
0b0577ce56ac191dccc742905f27ccbd36346f20
|
diff --git a/itests/src/test/java/org/ops4j/pax/wicket/it/lifecycle/tracker/WicketApplicationTrackTest.java b/itests/src/test/java/org/ops4j/pax/wicket/it/lifecycle/tracker/WicketApplicationTrackTest.java
index <HASH>..<HASH> 100644
--- a/itests/src/test/java/org/ops4j/pax/wicket/it/lifecycle/tracker/WicketApplicationTrackTest.java
+++ b/itests/src/test/java/org/ops4j/pax/wicket/it/lifecycle/tracker/WicketApplicationTrackTest.java
@@ -57,11 +57,11 @@ public final class WicketApplicationTrackTest extends PaxWicketIntegrationTest {
@Test
public final void testAppicationTraker() throws Exception {
- sleep(2000);
+ sleep(5000);
Bundle paxWicketBundle = getPaxWicketServiceBundle(bundleContext);
Bundle simpleAppBundle = getBundleBySymbolicName(bundleContext, "org.ops4j.pax.wicket.samples.navigation");
assertNotNull(simpleAppBundle);
- assertEquals(simpleAppBundle.getState(), Bundle.ACTIVE);
+ assertEquals(Bundle.ACTIVE, simpleAppBundle.getState());
ServiceReference[] beforeStopServices = paxWicketBundle.getRegisteredServices();
assertNotNull(beforeStopServices);
assertEquals(3, beforeStopServices.length);
|
[PAXWICKET-<I>] increased sleep period to make test run on Hudson
|
ops4j_org.ops4j.pax.wicket
|
train
|
java
|
be502c838838e223db8bed71eadef2e957156337
|
diff --git a/metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/log/MetaqDailyRollingFileAppender.java b/metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/log/MetaqDailyRollingFileAppender.java
index <HASH>..<HASH> 100644
--- a/metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/log/MetaqDailyRollingFileAppender.java
+++ b/metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/log/MetaqDailyRollingFileAppender.java
@@ -17,7 +17,8 @@ import org.apache.log4j.spi.LoggingEvent;
*/
public class MetaqDailyRollingFileAppender extends DailyRollingFileAppender {
- private int logBufferSize = 20;
+ private int logBufferSize = Integer.valueOf(System.getProperty(
+ "metaq.log4j.daily.rolling.file.appender.log.bufferSize", "20"));
private LinkedList<LoggingEvent> events;
|
Make log buffer size as an environment variable
|
killme2008_Metamorphosis
|
train
|
java
|
3193ebbbab819da18587a537b975acbc9aef440e
|
diff --git a/src/Entity/Attribute.php b/src/Entity/Attribute.php
index <HASH>..<HASH> 100644
--- a/src/Entity/Attribute.php
+++ b/src/Entity/Attribute.php
@@ -115,6 +115,11 @@ class Attribute {
public $lookupTypes;
/**
+ * @var string
+ */
+ public $dateTimeBehavior;
+
+ /**
* Attribute constructor.
*
* @param SimpleXMLElement $attribute
@@ -153,6 +158,10 @@ class Attribute {
$this->type = (string) $attribute->AttributeType;
+ if ( $this->type === 'DateTime' ) {
+ $this->dateTimeBehavior = (string)$attribute->DateTimeBehavior->Value;
+ }
+
/* Determine the Type of the Attribute */
$attributeList = $attribute->attributes();
$attributeType = AbstractClient::stripNS( (string) $attributeList['type'] );
|
Add support for DateTimeBehavior
|
AlexaCRM_php-crm-toolkit
|
train
|
php
|
9cf4b0f33956aef43706f9261a0cb2e22faf16a8
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,11 @@ import sys
from setuptools import setup, Extension
import codecs
+try:
+ ModuleNotFoundError
+except NameError:
+ ModuleNotFoundError = ImportError
+
def read(fname):
with codecs.open(fname, 'r', 'latin') as f:
return f.read()
|
Fix clean install of Python <I>
If using Python <I> and don't have numpy installed before hand this error will occur: `NameError: name 'ModuleNotFoundError' is not defined`
|
SheffieldML_GPy
|
train
|
py
|
a4ae33c5863cbe8463309841c95a93bf543f0080
|
diff --git a/tests/test_genanki.py b/tests/test_genanki.py
index <HASH>..<HASH> 100644
--- a/tests/test_genanki.py
+++ b/tests/test_genanki.py
@@ -99,6 +99,24 @@ class TestWithCollection:
assert imported_deck['name'] == 'foodeck'
+ def test_generated_deck_has_valid_cards(self):
+ """
+ Generates a deck with several notes and verifies that the nid/ord combinations on the generated cards make sense.
+
+ Catches a bug that was fixed in 08d8a139.
+ """
+ deck = genanki.Deck(123456, 'foodeck')
+ deck.add_note(genanki.Note(TEST_CN_MODEL, ['a', 'b', 'c'])) # 2 cards
+ deck.add_note(genanki.Note(TEST_CN_MODEL, ['d', 'e', 'f'])) # 2 cards
+ deck.add_note(genanki.Note(TEST_CN_MODEL, ['g', 'h', 'i'])) # 2 cards
+
+ self.import_package(genanki.Package(deck))
+
+ cards = [self.col.getCard(i) for i in self.col.findCards('')]
+
+ # the bug causes us to fail to generate certain cards (e.g. the second card for the second note)
+ assert len(cards) == 6
+
def test_card_isEmpty__with_2_fields__succeeds(self):
"""Tests for a bug in an early version of genanki where notes with <4 fields were not supported."""
deck = genanki.Deck(123456, 'foodeck')
|
Add test for bug introduced in <I>d8a<I>
|
kerrickstaley_genanki
|
train
|
py
|
e00c478256612c177401bfdf10d9a10b4d747cd6
|
diff --git a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java
index <HASH>..<HASH> 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialValueBox.java
@@ -735,6 +735,7 @@ public class MaterialValueBox<T> extends AbstractValueWidget<T> implements HasCh
return errorMixin;
}
+ @Ignore
public ValueBoxBase<T> getValueBoxBase() {
return valueBoxBase;
}
|
Fix an issue with MaterialValueBox editors.
|
GwtMaterialDesign_gwt-material
|
train
|
java
|
6c6d726ddc30bf29b82a8558e9953fc4a5514e90
|
diff --git a/src/lang/en/fields.php b/src/lang/en/fields.php
index <HASH>..<HASH> 100644
--- a/src/lang/en/fields.php
+++ b/src/lang/en/fields.php
@@ -10,7 +10,7 @@ return array(
'reset' => 'Reset',
'enterEmail' => 'Please Enter Email Address',
'signIn' => 'Please Sign In',
- 'forgetPassword' => 'Forget Password',
+ 'forgetPassword' => 'Forgot Password',
'rememberMe' => 'Remember Me',
'login' => 'Login',
'sendReminder' => 'Send Reminder',
|
A grammar issue is corrected (Forgot Password).
|
serverfireteam_panel
|
train
|
php
|
563ecc98e01a0ad1ecb10cd4d4d4c4c43f81b9ff
|
diff --git a/RdKafkaConsumer.php b/RdKafkaConsumer.php
index <HASH>..<HASH> 100644
--- a/RdKafkaConsumer.php
+++ b/RdKafkaConsumer.php
@@ -169,6 +169,12 @@ class RdKafkaConsumer implements Consumer
$message->setPartition($kafkaMessage->partition);
$message->setKafkaMessage($kafkaMessage);
+ // Merge headers passed from Kafka with possible earlier serialized payload headers. Prefer Kafka's.
+ // Note: Requires phprdkafka >= 3.1.0
+ if (isset($kafkaMessage->headers)) {
+ $message->setHeaders(array_merge($message->getHeaders(), $kafkaMessage->headers));
+ }
+
return $message;
default:
throw new \LogicException($kafkaMessage->errstr(), $kafkaMessage->err);
|
Allow reading headers from Kafka Message headers
A simpler part of #<I>, adds just the consumption part. This makes
headers accessible in the consumer in case another application makes
use of those, be it PHP or not.
|
php-enqueue_rdkafka
|
train
|
php
|
a8e3e3f8eaad485bd4cd023d1387b32531639467
|
diff --git a/werkzeug/contrib/securecookie.py b/werkzeug/contrib/securecookie.py
index <HASH>..<HASH> 100644
--- a/werkzeug/contrib/securecookie.py
+++ b/werkzeug/contrib/securecookie.py
@@ -57,7 +57,7 @@ r"""
return SecureCookie.unserialize(data, SECRET_KEY)
def application(environ, start_response):
- request = Request(environ, start_response)
+ request = Request(environ)
# get a response object here
response = ...
@@ -77,7 +77,7 @@ r"""
return SecureCookie.load_cookie(self, secret_key=COOKIE_SECRET)
def application(environ, start_response):
- request = Request(environ, start_response)
+ request = Request(environ)
# get a response object here
response = ...
|
Fixed example in docstring
Removed start_response as an argument for Request in both examples
|
pallets_werkzeug
|
train
|
py
|
f4c42ca85203417444e600c25040aeb91425e707
|
diff --git a/controllers/socket/handler/lobby.go b/controllers/socket/handler/lobby.go
index <HASH>..<HASH> 100644
--- a/controllers/socket/handler/lobby.go
+++ b/controllers/socket/handler/lobby.go
@@ -239,6 +239,13 @@ func (Lobby) LobbyCreate(so *wsevent.Client, args struct {
}
if models.MapRegionFormatExists(lob.MapName, lob.RegionCode, lob.Type) {
+ if reservation.ID != 0 {
+ err := context.Delete(reservation.ID, player.SteamID)
+ for err != nil {
+ err = context.Delete(reservation.ID, player.SteamID)
+ }
+ }
+
return errors.New("Your region already has a lobby with this map and format.")
}
diff --git a/models/lobby.go b/models/lobby.go
index <HASH>..<HASH> 100644
--- a/models/lobby.go
+++ b/models/lobby.go
@@ -215,8 +215,8 @@ func (lobby *Lobby) Delete() {
if lobby.ServemeID != 0 {
context := helpers.GetServemeContext(lobby.ServerInfo.Host)
err := context.Delete(lobby.ServemeID, lobby.CreatedBySteamID)
- if err != nil {
- logrus.Error(err)
+ for err != nil {
+ err = context.Delete(lobby.ServemeID, lobby.CreatedBySteamID)
}
}
|
Make sure reservation is dleted
|
TF2Stadium_Helen
|
train
|
go,go
|
04da344dd75dec49ea2aa41dd27b9939fe99837a
|
diff --git a/pystache/template.py b/pystache/template.py
index <HASH>..<HASH> 100644
--- a/pystache/template.py
+++ b/pystache/template.py
@@ -68,8 +68,9 @@ class Template(object):
Arguments:
- template: a template string as a unicode string. Behavior is
- undefined if the string has type str.
+ template: a template string that is either unicode, or of type
+ str and encoded using the encoding named by the default_encoding
+ keyword argument.
load_template: the function for loading partials. The function should
accept a single template_name parameter and return a template as
@@ -362,6 +363,10 @@ class Template(object):
attribute has been set to a non-None value, in which case the
return value has type str and is encoded using that encoding.
+ If the template string is not unicode, it is first converted to
+ unicode using the default_encoding and decode_errors attributes.
+ See the Template constructor's docstring for more information.
+
Arguments:
context: a dictionary, Context, or object (e.g. a View instance).
|
Updated docstrings for issue #<I>.
|
defunkt_pystache
|
train
|
py
|
0944c08226a17370ba3fedee9af3cce765b5c300
|
diff --git a/scripts/deploy.js b/scripts/deploy.js
index <HASH>..<HASH> 100755
--- a/scripts/deploy.js
+++ b/scripts/deploy.js
@@ -5,7 +5,7 @@ if (process.argv.length <= 2 || !/\d+\.\d+\.\d+.*/.test(process.argv[2])) {
process.exit(1);
}
-const version = process.argv[2];
+const version = process.argv[2].replace('v', '');
const spawn = require('cross-spawn');
const exec = require('child_process').execSync;
|
make sure `v` prefix is replaced with empty string
|
TrueCar_gluestick
|
train
|
js
|
e7fa54f3f768cde29bfb81bc1e7d6a5d153f2fdc
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,6 +11,9 @@ try:
os.path.dirname(__file__), 'README.txt' )).read()
except IOError: readme = ''
+package_data = find_package_data(where='feedjack', package='feedjack')
+package_data.setdefault('', list()).append('README.txt')
+
setup(
name = 'Feedjack',
version = '12.06.1',
@@ -52,5 +55,6 @@ setup(
zip_safe = False,
packages = find_packages(),
- package_data = find_package_data(where='feedjack', package='feedjack'),
+ package_data = package_data,
+ exclude_package_data = {'': ['README.*']},
scripts = ['feedjack/bin/feedjack_update.py'] )
|
setup: included README.txt in the tarball
|
mk-fg_feedjack
|
train
|
py
|
7bef4ae1abae10e4509f7cf0756033dc9478282a
|
diff --git a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
index <HASH>..<HASH> 100644
--- a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
+++ b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
@@ -58,7 +58,7 @@ class DefaultSettings {
private static Map<String, String> defaults() {
Map<String, String> defaults = new HashMap<String, String>();
defaults.put(ProcessConstants.CLUSTER_NAME, "sonarqube");
- defaults.put(ProcessConstants.SEARCH_JAVA_OPTS, "-Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true " +
+ defaults.put(ProcessConstants.SEARCH_JAVA_OPTS, "-Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true " +
"-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly " +
"-XX:+HeapDumpOnOutOfMemoryError");
defaults.put(ProcessConstants.SEARCH_JAVA_ADDITIONAL_OPTS, "");
|
Increase default ES max heap size from <I>m to 1G
|
SonarSource_sonarqube
|
train
|
java
|
9b7776cf8840dc14fbad05f462c6b9bbdce54557
|
diff --git a/app/controllers/multiauth/sessions_controller.rb b/app/controllers/multiauth/sessions_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/multiauth/sessions_controller.rb
+++ b/app/controllers/multiauth/sessions_controller.rb
@@ -4,10 +4,13 @@ module Multiauth
# see http://github.com/intridea/omniauth/wiki/Auth-Hash-Schema
fields = env["omniauth.auth"] || request.env['rack.auth']
- puts ">>>>>>>>> #{user_signed_in?} #{self.current_user}"
if user_signed_in?
self.current_user.connect(fields)
- redirect_to user_path(self.current_user)
+ if respond_to?(:after_sign_in_path_for)
+ redirect_to after_sign_in_path_for(self.current_user)
+ else
+ redirect_to user_path(self.current_user)
+ end
return
elsif (@user = User.authenticate(fields)) && ([email protected]_record?)
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => fields["provider"].titleize
|
call to 'after_sign_in_path_for' if it is defined
|
dcu_multiauth
|
train
|
rb
|
901d5048a2c92de6080a68aa1779fd7ed4a50dd9
|
diff --git a/src/2D.js b/src/2D.js
index <HASH>..<HASH> 100644
--- a/src/2D.js
+++ b/src/2D.js
@@ -667,8 +667,32 @@ Crafty.c("2D", {
*/
flip: function (dir) {
dir = dir || "X";
- this["_flip" + dir] = true;
- this.trigger("Change");
+ if(!this["_flip" + dir]) {
+ this["_flip" + dir] = true;
+ this.trigger("Change");
+ }
+ },
+
+ /**@
+ * #.flip
+ * @comp 2D
+ * @trigger Change - when the entity has unflipped
+ * @sign public this .unflip(String dir)
+ * @param dir - Unflip direction
+ *
+ * Unflip entity on passed direction (if it's flipped)
+ *
+ * @example
+ * ~~~
+ * this.unflip("X")
+ * ~~~
+ */
+ unflip: function (dir) {
+ dir = dir || "X";
+ if(this["_flip" + dir]) {
+ this["_flip" + dir] = false;
+ this.trigger("Change");
+ }
},
/**
|
* Added a 2D.unflip(dir) method for unflipping a sprite
* Adjusted how "Change" is triggered in 2D.flip(dir) to only occur if a flip takes place
|
craftyjs_Crafty
|
train
|
js
|
370c5fc03898f577b15ed77e4ee1d4ac51faf009
|
diff --git a/lib/formtastic/helpers.rb b/lib/formtastic/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/formtastic/helpers.rb
+++ b/lib/formtastic/helpers.rb
@@ -9,7 +9,6 @@ module Formtastic
autoload :FormHelper, 'formtastic/helpers/form_helper'
autoload :InputHelper, 'formtastic/helpers/input_helper'
autoload :InputsHelper, 'formtastic/helpers/inputs_helper'
- autoload :LabelHelper, 'formtastic/helpers/label_helper'
autoload :Reflection, 'formtastic/helpers/reflection'
autoload :Enum, 'formtastic/helpers/enum'
end
|
Update helpers.rb
There is no such labels_helper
|
justinfrench_formtastic
|
train
|
rb
|
bc11454e1c70fbaff0c2236bf2911b4bd8096dea
|
diff --git a/ocrmypdf/main.py b/ocrmypdf/main.py
index <HASH>..<HASH> 100755
--- a/ocrmypdf/main.py
+++ b/ocrmypdf/main.py
@@ -134,12 +134,27 @@ behavior is to exit in this case without producing a file. You can use the
option --skip-text to ignore pages with text, or --force-ocr to rasterize
all objects on the page and produce an image-only PDF as output.
+ ocrmypdf --skip-text file_with_some_text_pages.pdf output.pdf
+
+ ocrmypdf --force-ocr word_document.pdf output.pdf
+
If you are concerned about long-term archiving of PDFs, use the default option
--output-type pdfa which converts the PDF to a standardized PDF/A-2b. This
converts images to sRGB colorspace, removes some features from the PDF such
as Javascript or forms. If you want to minimize the number of changes made to
your PDF, use --output-type pdf.
+If OCRmyPDF is given an image file as input, it will attempt to convert the
+image to a PDF before processing. For more control over the conversion of
+images to PDF, use the Python package img2pdf or other image to PDF software.
+
+For example, this command uses img2pdf to convert all .png files beginning
+with the 'page' prefix to a PDF, fitting each image on A4-sized paper, and
+sending the result to OCRmyPDF through a pipe. img2pdf is a dependency of
+ocrmypdf so it is already installed.
+
+ img2pdf --pagesize A4 page*.png | ocrmypdf - myfile.pdf
+
""")
parser.add_argument(
|
Help text: example of shell pipeline with img2pdf
|
jbarlow83_OCRmyPDF
|
train
|
py
|
7bbe08fafb54739dc5dc9ae7c5faf46fe055fc45
|
diff --git a/src/Extension/SimpleExtension.php b/src/Extension/SimpleExtension.php
index <HASH>..<HASH> 100644
--- a/src/Extension/SimpleExtension.php
+++ b/src/Extension/SimpleExtension.php
@@ -3,6 +3,7 @@
namespace Bolt\Extension;
use Bolt\Events\ControllerEvents;
+use Bolt\Extension\StorageTrait;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -23,6 +24,7 @@ abstract class SimpleExtension extends AbstractExtension implements ServiceProvi
use NutTrait;
use TwigTrait;
use TranslationTrait;
+ use StorageTrait;
/**
* {@inheritdoc}
@@ -35,6 +37,7 @@ abstract class SimpleExtension extends AbstractExtension implements ServiceProvi
$this->extendAssetServices();
$this->extendNutService();
$this->extendTranslatorService();
+ $this->extendRepositoryMapping();
$this->registerServices($app);
}
|
Imported StorageTrait and implemented into SimpleExtension by default.
<URL>
|
bolt_bolt
|
train
|
php
|
9892b1fb98543ea3df809badedde6877980d2cbe
|
diff --git a/spec/sro/uuic_spec.rb b/spec/sro/uuic_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/sro/uuic_spec.rb
+++ b/spec/sro/uuic_spec.rb
@@ -10,4 +10,12 @@ describe Sro::Uuid do
expect(pattern).to match(uuid)
end
end
+
+ context "#version5" do
+ it "matches the pattern" do
+ uuid = subject.version5
+ pattern = subject.pattern
+ expect(uuid).to match(pattern)
+ end
+ end
end
|
(red) Write failing test => Sro::Uuid#version5 matches the pattern
|
amorphid_sro
|
train
|
rb
|
02f3e499c123bbcd209650fb36f224b2cd5d1ee2
|
diff --git a/lib/GitFakeFs.js b/lib/GitFakeFs.js
index <HASH>..<HASH> 100644
--- a/lib/GitFakeFs.js
+++ b/lib/GitFakeFs.js
@@ -357,6 +357,8 @@ var GitFakeFs = module.exports = function GitFakeFs(repositoryOrPath, config) {
cb(getTreeOrBlobErr);
} else if (getTreeOrBlobErr) {
cb(null, workingCopyNames);
+ } else if (fsReaddirErr) {
+ cb(null, names);
} else {
cb(null, _.unique(names.concat(workingCopyNames)));
}
|
readdir with fallBackToWorkingCopy: Handle the case where a directory that exists in the repo doesn't exist in the working copy.
|
papandreou_node-gitfakefs
|
train
|
js
|
6d9860cac8e1951c12a784d3d71ebc4d3c4297ca
|
diff --git a/lib/eiscp/message.rb b/lib/eiscp/message.rb
index <HASH>..<HASH> 100644
--- a/lib/eiscp/message.rb
+++ b/lib/eiscp/message.rb
@@ -18,7 +18,7 @@ module EISCP
# REGEX
- REGEX = /(?<start>!)?(?<unit_type>(\d|x))?(?<command>[A-Z]{3})\s?(?<parameter>.*)(?<end>(\x0D|\x0A|\x1A|\x19))?/
+ REGEX = /(?<start>!)?(?<unit_type>(\d|x))?(?<command>[A-Z]{3})\s?(?<parameter>.*)(?<end>\x1A)?/
def initialize(command, parameter, unit_type = "1", start = "!")
if unit_type == nil
diff --git a/lib/eiscp/receiver.rb b/lib/eiscp/receiver.rb
index <HASH>..<HASH> 100644
--- a/lib/eiscp/receiver.rb
+++ b/lib/eiscp/receiver.rb
@@ -29,7 +29,7 @@ module EISCP
@model = array[0]
@port = array[1].to_i
@area = array[2]
- @mac_address = array[3]
+ @mac_address = array[3].split("\x19")[0]
return self
end
end
|
modified array to only end messages with \x1A
|
mikerodrigues_onkyo_eiscp_ruby
|
train
|
rb,rb
|
f7c058e0bd25f27f0389b7eb55d943bd77710426
|
diff --git a/activeweb/src/main/java/org/javalite/activeweb/RequestUtils.java b/activeweb/src/main/java/org/javalite/activeweb/RequestUtils.java
index <HASH>..<HASH> 100644
--- a/activeweb/src/main/java/org/javalite/activeweb/RequestUtils.java
+++ b/activeweb/src/main/java/org/javalite/activeweb/RequestUtils.java
@@ -601,6 +601,25 @@ public class RequestUtils {
return headers;
}
+ /**
+ * @param name name of an object in session
+ *
+ * @return object in session, or null.
+ */
+ public Object session(String name){
+ return RequestContext.getHttpRequest().getSession().getAttribute(name);
+ }
+
+ /**
+ * Sets an object on a current session.
+ *
+ * @param name name of object
+ * @param value value of object
+ */
+ public void session(String name, Object value){
+ RequestContext.getHttpRequest().getSession().getAttribute(name);
+ }
+
public static String getRequestProperties(){
StringBuilder sb = new StringBuilder();
HttpServletRequest request = RequestContext.getHttpRequest();
|
#<I> CSRF filter - added convenience methods
|
javalite_activejdbc
|
train
|
java
|
48abb2cb12539bfb8cc3c95a6adb8283880bd7ae
|
diff --git a/src/utils/breakpoint/astBreakpointLocation.js b/src/utils/breakpoint/astBreakpointLocation.js
index <HASH>..<HASH> 100644
--- a/src/utils/breakpoint/astBreakpointLocation.js
+++ b/src/utils/breakpoint/astBreakpointLocation.js
@@ -1,9 +1,12 @@
+// @flow
+
import { getSymbols } from "../parser";
import { containsPosition } from "../parser/utils/helpers";
+import type { Scope } from "../parser/types";
import type { Location, Source } from "debugger-html";
-function findClosestScope(functions, location) {
+function findClosestScope(functions: Scope[], location: Location) {
return functions.reduce((found, currNode) => {
if (
currNode.name === "anonymous" ||
|
add astbreakpoints flowtypes (#<I>)
|
firefox-devtools_debugger
|
train
|
js
|
8d78d65e5947f0dc117d2d3d11d4a9d62a5d48bc
|
diff --git a/annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java b/annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java
index <HASH>..<HASH> 100644
--- a/annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java
+++ b/annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java
@@ -307,6 +307,7 @@ public class ResultViewPanel extends VerticalLayout implements
{
resultPanelList.add(panel);
resultLayout.addComponent(panel);
+ panel.setSegmentationLayer(selectedSegmentationLayer);
}
if (projectQueue != null && !newPanels.isEmpty() && currentResults < numberOfResults)
|
do not ignore predefined base text segmentation on first load
|
korpling_ANNIS
|
train
|
java
|
6d9628f699c56378451f7c21314c1a4849d71805
|
diff --git a/lib/Application/ClassMemberReferences.php b/lib/Application/ClassMemberReferences.php
index <HASH>..<HASH> 100644
--- a/lib/Application/ClassMemberReferences.php
+++ b/lib/Application/ClassMemberReferences.php
@@ -70,7 +70,7 @@ class ClassMemberReferences
$filesystem = $this->filesystemRegistry->get($scope);
$results = [];
- $filePaths = $filesystem->fileList()->phpFiles();
+ $filePaths = $filesystem->fileList()->existing()->phpFiles();
// we can discount any files that do not contain the method name.
if ($memberName) {
|
Class member references, filter non-existing
|
phpactor_phpactor
|
train
|
php
|
273a189e98bdbc13a7d6af0f109752cb65d2239c
|
diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php
index <HASH>..<HASH> 100644
--- a/cake/libs/controller/component.php
+++ b/cake/libs/controller/component.php
@@ -23,6 +23,18 @@ App::import('Controller', 'ComponentCollection', false);
* controller logic that can be composed into a controller. Components also
* provide request life-cycle callbacks for injecting logic at specific points.
*
+ * ## Life cycle callbacks
+ *
+ * Components can provide several callbacks that are fired at various stages of the request
+ * cycle. The available callbacks are:
+ *
+ * - `initialize()` - Fired before the controller's beforeFilter method.
+ * - `startup()` - Fired after the controller's beforeFilter method.
+ * - `beforeRender()` - Fired before the view + layout are rendered.
+ * - `shutdown()` - Fired after the action is complete and the view has been rendered
+ * but before Controller::afterFilter().
+ * - `beforeRedirect()` - Fired before a redirect() is done.
+ *
* @package cake
* @subpackage cake.cake.libs.controller
* @link http://book.cakephp.org/view/993/Components
|
Adding some documentation about component callbacks.
|
cakephp_cakephp
|
train
|
php
|
a54bd88d41a73428fbf79218dd561f4c6f750b92
|
diff --git a/lib/pdk/cli/exec.rb b/lib/pdk/cli/exec.rb
index <HASH>..<HASH> 100644
--- a/lib/pdk/cli/exec.rb
+++ b/lib/pdk/cli/exec.rb
@@ -1,3 +1,5 @@
+require 'pdk'
+
module PDK
module CLI
module Exec
|
(maint) Ensure pdk/cli/exec works standalone
|
puppetlabs_pdk
|
train
|
rb
|
52258b0c9be546cd85ed7a1ed90a3aa74c5e2263
|
diff --git a/DependencyInjection/SidusFilterExtension.php b/DependencyInjection/SidusFilterExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/SidusFilterExtension.php
+++ b/DependencyInjection/SidusFilterExtension.php
@@ -56,6 +56,7 @@ class SidusFilterExtension extends Extension
$configuration,
]
);
+ $definition->setPublic(false);
$container->setDefinition('sidus_filter.configuration.'.$code, $definition);
}
}
|
Minor refactoring: generated services are now private
|
VincentChalnot_SidusFilterBundle
|
train
|
php
|
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.