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 |
|---|---|---|---|---|---|
d05152c04125ba6a4c5bcf1e44810d5257295360 | diff --git a/trustar/TruStar.py b/trustar/TruStar.py
index <HASH>..<HASH> 100644
--- a/trustar/TruStar.py
+++ b/trustar/TruStar.py
@@ -58,23 +58,29 @@ class TruStar(object):
Attempt to convert a string timestamp in to a TruSTAR compatible format for submission.
Will return current time with UTC time zone if None
:param date_time: int that is epoch time, or string/datetime object containing date, time, and ideally timezone
+ examples of supported timestamp formats: 1487890914, 1487890914000, "2017-02-23T23:01:54", "2017-02-23T23:01:54+0000"
"""
try:
+ # identify type of timestamp and convert to datetime object
if isinstance(date_time, int):
- # converts epoch int ms to datetime object in s
datetime_dt = datetime.fromtimestamp(date_time)
elif isinstance(date_time, str):
datetime_dt = dateutil.parser.parse(date_time)
elif isinstance(date_time, datetime):
datetime_dt = date_time
+
+ # if timestamp is none of the formats above, error message is printed and timestamp is set to current time by default
except Exception as e:
print(e)
datetime_dt = datetime.now()
+ # if timestamp is timezone naive, add timezone
if not datetime_dt.tzinfo:
timezone = get_localzone()
+
# add system timezone
datetime_dt = timezone.localize(datetime_dt)
+
# convert to UTC
datetime_dt = datetime_dt.astimezone(pytz.utc) | Add javadoc comments to normalize_timestamp in TruStar | trustar_trustar-python | train | py |
01cd6dab06e42a63a4240cd57eef9331179cf091 | diff --git a/bt/backtest.py b/bt/backtest.py
index <HASH>..<HASH> 100644
--- a/bt/backtest.py
+++ b/bt/backtest.py
@@ -70,14 +70,18 @@ class Backtest(object):
else:
# get values for all securities in tree and divide by root values
# for security weights
- vals = pd.DataFrame({x.name: x.values for x in
- self.strategy.members if
- isinstance(x, bt.core.SecurityBase)})
+ vals = {}
+ for m in self.strategy.members:
+ if isinstance(m, bt.core.SecurityBase):
+ if m.name in vals:
+ vals[m.name] += m.values
+ else:
+ vals[m.name] = m.values
+ vals = pd.DataFrame(vals)
+
+ # divide by root strategy values
vals = vals.div(self.strategy.values, axis=0)
- # combine securities with same ticker
- vals = vals.groupby(vals.columns, axis=1).sum()
-
# save for future use
self._sweights = vals | fixed bug in calc of security weights | pmorissette_bt | train | py |
9c08ccd8896412ab3856fcc9d5f0b2ec84967ad4 | diff --git a/actionpack/lib/action_controller/deprecated/base.rb b/actionpack/lib/action_controller/deprecated/base.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/deprecated/base.rb
+++ b/actionpack/lib/action_controller/deprecated/base.rb
@@ -154,7 +154,6 @@ module ActionController
deprecated_config_accessor :helpers_path
deprecated_config_accessor :javascripts_dir
deprecated_config_accessor :page_cache_directory
- deprecated_config_accessor :page_cache_extension
deprecated_config_accessor :protected_instance_variables
deprecated_config_accessor :relative_url_root, "relative_url_root is ineffective. Please stop using it"
deprecated_config_accessor :stylesheets_dir | page_cache_extension is delegating to config so no need to deprecate | rails_rails | train | rb |
2b295229b05b84b68563f397b06d8abddcc4df3a | diff --git a/pydoop/hadoop_utils.py b/pydoop/hadoop_utils.py
index <HASH>..<HASH> 100644
--- a/pydoop/hadoop_utils.py
+++ b/pydoop/hadoop_utils.py
@@ -319,11 +319,17 @@ class HadoopVersion(object):
def is_exe(fpath):
- return os.path.exists(fpath) and os.access(fpath, os.X_OK)
+ """
+ Path references an executable file.
+ """
+ return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
def is_readable(fpath):
- return os.path.exists(fpath) and os.access(fpath, os.R_OK)
+ """
+ Path references a readable file.
+ """
+ return os.path.isfile(fpath) and os.access(fpath, os.R_OK)
def extract_text(node): | Test specifically for executable/readable *files* | crs4_pydoop | train | py |
197afb65aee9040c648cf76a619ccb0485f4c8a1 | diff --git a/src/build/intro.js b/src/build/intro.js
index <HASH>..<HASH> 100644
--- a/src/build/intro.js
+++ b/src/build/intro.js
@@ -1,4 +1,4 @@
-/*!
+/**
* CLDR JavaScript Library v@VERSION
* http://jquery.com/
*
@@ -8,6 +8,10 @@
*
* Date: @DATE
*/
+/*!
+ * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier
+ * http://git.io/h4lmVg
+ */
(function( root, factory ) {
if ( typeof define === "function" && define.amd ) {
diff --git a/src/build/intro.min.js b/src/build/intro.min.js
index <HASH>..<HASH> 100644
--- a/src/build/intro.min.js
+++ b/src/build/intro.min.js
@@ -1,4 +1,4 @@
/*!
- * CLDR JavaScript Library v@VERSION @DATE Released under the MIT license
+ * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/ | Minor fix
- Make minified intro comment resistent to minification only. Full intro comment
should be allowed to be removed on third-party code minification;
- Update minified intro license information; | rxaviers_cldrjs | train | js,js |
df4889b282512c85071ef4ba4673448a0ac880de | diff --git a/lib/lita/rspec/handler.rb b/lib/lita/rspec/handler.rb
index <HASH>..<HASH> 100644
--- a/lib/lita/rspec/handler.rb
+++ b/lib/lita/rspec/handler.rb
@@ -62,14 +62,14 @@ module Lita
end
def to(route)
- @context.allow(Authorization).to @context.receive(
- :user_in_group?
- ).and_return(true)
- @context.expect_any_instance_of(
- @context.described_class
- ).public_send(@method, @context.receive(route))
+ m = @method
+ b = @message_body
- @context.send_message(@message_body)
+ @context.instance_eval do
+ allow(Authorization).to receive(:user_in_group?).and_return(true)
+ expect_any_instance_of(described_class).public_send(m, receive(route))
+ send_message(b)
+ end
end
end
end | Use #instance_eval to make RouteMatcher#to more readable. | litaio_lita | train | rb |
9d87563c72ba8f15d0af24a6d5123c5256f375bc | diff --git a/hamster/widgets/__init__.py b/hamster/widgets/__init__.py
index <HASH>..<HASH> 100644
--- a/hamster/widgets/__init__.py
+++ b/hamster/widgets/__init__.py
@@ -35,6 +35,8 @@ from tags import TagCellRenderer
from reportchooserdialog import ReportChooserDialog
+from facttree import FactTree
+
# handy wrappers
def add_hint(entry, hint):
entry.hint = hint | moved the fact tree out to a widget | projecthamster_hamster | train | py |
5362c5b51a10f930e2039cb58cef7cf6a21035dd | diff --git a/pyof/v0x01/asynchronous/packet_in.py b/pyof/v0x01/asynchronous/packet_in.py
index <HASH>..<HASH> 100644
--- a/pyof/v0x01/asynchronous/packet_in.py
+++ b/pyof/v0x01/asynchronous/packet_in.py
@@ -19,9 +19,9 @@ class PacketInReason(enum.Enum):
"""Reason why this packet is being sent to the controller."""
#: No matching flow
- OFPR_NO_MATCH = 1
+ OFPR_NO_MATCH = 0
#: Action explicitly output to controller
- OFPR_ACTION = 2
+ OFPR_ACTION = 1
# Classes | Fixing PacketInReason Enumeration to start at '0' | kytos_python-openflow | train | py |
ee3b27ba053b632fa30e78606ba0988e9a1de82a | diff --git a/scout_apm/core_agent_manager.py b/scout_apm/core_agent_manager.py
index <HASH>..<HASH> 100644
--- a/scout_apm/core_agent_manager.py
+++ b/scout_apm/core_agent_manager.py
@@ -138,7 +138,7 @@ class CoreAgentDownloader():
full_url=self.full_url(),
filepath=self.package_location))
req = requests.get(self.full_url(), stream=True)
- with open(self.package_location) as f:
+ with open(self.package_location, 'wb') as f:
for chunk in req.iter_content(1024 * 1000):
f.write(chunk) | Open the download path of core agent as "wb" | scoutapp_scout_apm_python | train | py |
7fe1b4b0a7b66c8fe930784b7b61e8c9e6608610 | diff --git a/bitmap/bitmap.go b/bitmap/bitmap.go
index <HASH>..<HASH> 100644
--- a/bitmap/bitmap.go
+++ b/bitmap/bitmap.go
@@ -79,7 +79,7 @@ func (me *Bitmap) AddRange(begin, end int) {
if begin >= end {
return
}
- me.lazyRB().AddRange(uint32(begin), uint32(end))
+ me.lazyRB().AddRange(uint64(begin), uint64(end))
}
func (me *Bitmap) Remove(i int) {
@@ -174,6 +174,6 @@ func (me *Bitmap) RemoveRange(begin, end int) *Bitmap {
if me.rb == nil {
return me
}
- me.rb.RemoveRange(uint32(begin), uint32(end))
+ me.rb.RemoveRange(uint64(begin), uint64(end))
return me
} | bitmap: RoaringBitmap has moved to uint<I> | anacrolix_missinggo | train | go |
cdd2f4dced0d9ec684806c0ae4ab3505f1cf09a9 | diff --git a/lib/stax/mixin/ecs.rb b/lib/stax/mixin/ecs.rb
index <HASH>..<HASH> 100644
--- a/lib/stax/mixin/ecs.rb
+++ b/lib/stax/mixin/ecs.rb
@@ -133,16 +133,15 @@ module Stax
def containers
my.ecs_services.each do |s|
Aws::Ecs.tasks(service_name: s.physical_resource_id, desired_status: options[:status].upcase).each do |t|
- task = t.task_arn.split('/').last
- taskdef = t.task_definition_arn.split('/').last
- debug("Containers for task #{task} #{taskdef}")
+ task = t.task_arn.split('/').last
+ debug("Containers for task #{task}")
print_table t.containers.map { |c|
[
c.name,
c.container_arn.split('/').last,
color(c.last_status, COLORS),
c.network_interfaces.map(&:private_ipv_4_address).join(','),
- taskdef,
+ t.task_definition_arn.split('/').last,
c.exit_code,
c.reason,
] | do not need to double-up taskdef in output | rlister_stax | train | rb |
1b12f69fab1cc275357fe2c6180ee60f5ccb934c | diff --git a/src/Cookie.php b/src/Cookie.php
index <HASH>..<HASH> 100644
--- a/src/Cookie.php
+++ b/src/Cookie.php
@@ -329,8 +329,11 @@ final class Cookie {
$headerStr .= '; expires='.$expiryTimeStr;
}
- if (!is_null($maxAgeStr)) {
- $headerStr .= '; Max-Age='.$maxAgeStr;
+ // The `Max-Age` property is supported on PHP 5.5+ only (https://bugs.php.net/bug.php?id=23955).
+ if (\PHP_VERSION_ID >= 50500) {
+ if (!is_null($maxAgeStr)) {
+ $headerStr .= '; Max-Age='.$maxAgeStr;
+ }
}
if (!empty($path) || $path === 0) { | Output the 'Max-Age' property on PHP <I>+ only | delight-im_PHP-Cookie | train | php |
3ba5182a6509109b13d2c845a328972031531c3b | diff --git a/pmagpy/validate_upload3.py b/pmagpy/validate_upload3.py
index <HASH>..<HASH> 100644
--- a/pmagpy/validate_upload3.py
+++ b/pmagpy/validate_upload3.py
@@ -174,7 +174,7 @@ def cv(row, col_name, arg, current_data_model, df, con):
cell_values = cell_value.split(":")
cell_values = [c.strip() for c in cell_values]
for value in cell_values:
- if str(value).lower() in [str(v).lower() for v in vocabulary[col_name]]:
+ if str(value).lower() in [str(v.encode('utf-8')).lower() for v in vocabulary[col_name]]:
continue
elif value.lower() == "none":
continue | deal appropriately with unicode encoding errors with non utf-8 characters in controlled vocabularies | PmagPy_PmagPy | train | py |
64cf6a2b53c1fb4be28c451900ed92dab39ee618 | diff --git a/python_modules/libraries/dagster-aws/setup.py b/python_modules/libraries/dagster-aws/setup.py
index <HASH>..<HASH> 100644
--- a/python_modules/libraries/dagster-aws/setup.py
+++ b/python_modules/libraries/dagster-aws/setup.py
@@ -42,7 +42,11 @@ if __name__ == "__main__":
extras_require={
"redshift": ["psycopg2-binary"],
"pyspark": ["dagster-pyspark"],
- "test": ["moto>=2.2.8", "requests-mock"],
+ "test": [
+ "moto>=2.2.8",
+ "requests-mock",
+ "xmltodict==0.12.0", # pinned until moto>=3.1.9 (https://github.com/spulec/moto/issues/5112)
+ ],
},
zip_safe=False,
) | pin xmltodict to fix aws test failures, until moto <I> (#<I>)
* pin xmltodict to fix aws test failures, until moto <I>
* add comment | dagster-io_dagster | train | py |
264b65d30c092ba5ae13b28df3402b90ae583b64 | diff --git a/custodia/httpd/server.py b/custodia/httpd/server.py
index <HASH>..<HASH> 100644
--- a/custodia/httpd/server.py
+++ b/custodia/httpd/server.py
@@ -245,6 +245,7 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
'version': self.request_version,
'headers': self.headers,
'body': self.body}
+ logger.debug("REQUEST: %r", request)
try:
response = self.pipeline(self.server.config, request)
if response is None: | Add incoming requests to debug log | latchset_custodia | train | py |
c7f3fdf70c57dcaba02cf5132c9cf7b6609e5fa8 | diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -1610,6 +1610,9 @@ function clean_filename($string) {
$string = eregi_replace("\.\.", "", $string);
$string = eregi_replace("[^(-|[:alnum:]|\.)]", "_", $string);
$string = eregi_replace(",", "_", $string);
+ $string = eregi_replace("/", "_", $string);
+ $string = eregi_replace("\(", "_", $string);
+ $string = eregi_replace("\)", "_", $string);
return eregi_replace("_+", "_", $string);
} | Modified the clean_filename() function to strip parenthesis and slashes.
Not really sure if the method used is <I>% correct ot no so, if you can
check it....
Perhpas I should make the stripping in backup process, istead of using this
central function. What do you think? | moodle_moodle | train | php |
1b313972492c1259db23c5481986bb21d2309dec | diff --git a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
index <HASH>..<HASH> 100644
--- a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
+++ b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
@@ -432,14 +432,20 @@ public class SslHandler extends ByteToMessageDecoder implements ChannelOutboundH
/**
* Sends an SSL {@code close_notify} message to the specified channel and
* destroys the underlying {@link SSLEngine}.
+ *
+ * @deprecated use {@link Channel#close()} or {@link ChannelHandlerContext#close()}
*/
+ @Deprecated
public ChannelFuture close() {
return close(ctx.newPromise());
}
/**
* See {@link #close()}
+ *
+ * @deprecated use {@link Channel#close()} or {@link ChannelHandlerContext#close()}
*/
+ @Deprecated
public ChannelFuture close(final ChannelPromise promise) {
final ChannelHandlerContext ctx = this.ctx;
ctx.executor().execute(new Runnable() { | Deprecate methods on SslHandler that have other replacements
Motivation:
SslHandler has multiple methods which have better replacements now or are obsolete. We should mark these as `@Deprecated`.
Modifications:
Mark methods as deprecated.
Result:
API cleanup preparation. | netty_netty | train | java |
5d6046cd7d01ff9a717947ca0aa94d5b9ce6a231 | diff --git a/spyderlib/utils/introspection/base.py b/spyderlib/utils/introspection/base.py
index <HASH>..<HASH> 100644
--- a/spyderlib/utils/introspection/base.py
+++ b/spyderlib/utils/introspection/base.py
@@ -7,6 +7,7 @@
"""
Introspection utilities used by Spyder
"""
+
from __future__ import print_function
import imp
import os
@@ -14,7 +15,6 @@ import os.path as osp
import re
import time
import functools
-from collections import OrderedDict
from spyderlib.baseconfig import DEBUG, get_conf_path, debug_print
from spyderlib.py3compat import PY2
@@ -61,7 +61,7 @@ def memoize(obj):
See https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize
"""
- cache = obj.cache = OrderedDict()
+ cache = obj.cache = {}
@functools.wraps(obj)
def memoizer(*args, **kwargs): | Python <I> compatibility: Remove usage of OrderedDict (it was added in <I>) | spyder-ide_spyder | train | py |
dd78bf19c63affa1f6c05ca3ef82f402eddd56b6 | diff --git a/kappa/context.py b/kappa/context.py
index <HASH>..<HASH> 100644
--- a/kappa/context.py
+++ b/kappa/context.py
@@ -35,7 +35,7 @@ import placebo
LOG = logging.getLogger(__name__)
DebugFmtString = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
-InfoFmtString = '...%(message)s'
+InfoFmtString = '-> %(message)s'
class Context(object): | Make output look a little nicer | garnaat_kappa | train | py |
5136f2347c48d618d04be90544ecac47b598c660 | diff --git a/spyder/widgets/variableexplorer/collectionseditor.py b/spyder/widgets/variableexplorer/collectionseditor.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/variableexplorer/collectionseditor.py
+++ b/spyder/widgets/variableexplorer/collectionseditor.py
@@ -1421,8 +1421,13 @@ class CollectionsEditor(QDialog):
self.setWindowTitle(self.widget.get_title())
if icon is None:
self.setWindowIcon(ima.icon('dictedit'))
- # Make the dialog act as a window
- self.setWindowFlags(Qt.Window)
+
+ if sys.platform == 'darwin':
+ # See: https://github.com/spyder-ide/spyder/issues/9051
+ self.setWindowFlags(Qt.Tool)
+ else:
+ # Make the dialog act as a window
+ self.setWindowFlags(Qt.Window)
@Slot()
def save_and_close_enable(self): | Make several varexp editors stay on top | spyder-ide_spyder | train | py |
253bb495dff78067cf10d62cf8f983b9bfd6e52f | diff --git a/rtbhouse_sdk/reports_api.py b/rtbhouse_sdk/reports_api.py
index <HASH>..<HASH> 100644
--- a/rtbhouse_sdk/reports_api.py
+++ b/rtbhouse_sdk/reports_api.py
@@ -106,14 +106,11 @@ class ReportsApiSession:
raise ReportsApiException('Invalid response format')
def _get_from_cursor(self, path, params=None):
- params = (params or {}).copy()
- params['limit'] = MAX_CURSOR_ROWS_LIMIT
- res = self._get(path, params=params)
+ res = self._get(path, params={**params, 'limit': MAX_CURSOR_ROWS_LIMIT })
rows = res['rows']
while res['nextCursor']:
- params['nextCursor'] = res['nextCursor']
- res = self._get(path, params=params)
+ res = self._get(path, params={ 'nextCursor': res['nextCursor'], 'limit': MAX_CURSOR_ROWS_LIMIT })
rows.extend(res['rows'])
return rows | Updated SDK to reflect changes in api (#8) | rtbhouse-apps_rtbhouse-python-sdk | train | py |
a5d08dce937e8c859bfa2e091d2c2eabf35f0cae | diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php
index <HASH>..<HASH> 100644
--- a/lib/classes/plugin_manager.php
+++ b/lib/classes/plugin_manager.php
@@ -654,6 +654,10 @@ class core_plugin_manager {
return 'git';
}
+ if (is_file($pluginroot.'/.git')) {
+ return 'git-submodule';
+ }
+
if (is_dir($pluginroot.'/CVS')) {
return 'cvs';
}
diff --git a/lib/classes/update/deployer.php b/lib/classes/update/deployer.php
index <HASH>..<HASH> 100644
--- a/lib/classes/update/deployer.php
+++ b/lib/classes/update/deployer.php
@@ -181,6 +181,10 @@ class deployer {
return 'git';
}
+ if (is_file($pluginroot.'/.git')) {
+ return 'git-submodule';
+ }
+
if (is_dir($pluginroot.'/CVS')) {
return 'cvs';
} | MDL-<I> admin: Check if the plugin is a git submodule on uninstalling
Credit goes to PJ King. I was trying to add unit tests for this new
behaviour but it turned out there are many hard-coded dependencies and
it's not easy to make the whole machinery support alternative location
of testable (fake) plugins. | moodle_moodle | train | php,php |
9ffed1133b2f8fdfe6e7a650e689055c525f7122 | diff --git a/lib/database/index.js b/lib/database/index.js
index <HASH>..<HASH> 100644
--- a/lib/database/index.js
+++ b/lib/database/index.js
@@ -79,7 +79,7 @@ exports.checkExternalCouch = function (couch_url, callback) {
return /^welcome/i.test(prop)
})
- if (vendor !== 'couchdb' || vendor !== 'express-pouchdb') {
+ if (vendor !== 'couchdb' && vendor !== 'express-pouchdb') {
log.warn(
'database',
'You are not running an official CouchDB distribution, ' + | fix(database): correctly detect untested vendors
* * *
This commit was sponsored by The Hoodie Firm.
You can hire The Hoodie Firm:
<URL> | hoodiehq_hoodie-server | train | js |
e5f72f2adef45617e69fa42bd10c2d4d0b32bb1a | diff --git a/cmd/juju/application/addunit.go b/cmd/juju/application/addunit.go
index <HASH>..<HASH> 100644
--- a/cmd/juju/application/addunit.go
+++ b/cmd/juju/application/addunit.go
@@ -51,7 +51,7 @@ Add two units of mysql to existing machines 3 and 4:
juju add-unit mysql -n 2 --to 3,4
-Add three units of mysql, one to machine 7 and the others to new
+Add three units of mysql, one to machine 3 and the others to new
machines:
juju add-unit mysql -n 3 --to 3 | One patch did not belong in develop. | juju_juju | train | go |
ae2c199f0551a2ffb37e06952f2769417038ea41 | diff --git a/tests/TestCase/View/Helper/UrlHelperTest.php b/tests/TestCase/View/Helper/UrlHelperTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/View/Helper/UrlHelperTest.php
+++ b/tests/TestCase/View/Helper/UrlHelperTest.php
@@ -343,6 +343,19 @@ class UrlHelperTest extends TestCase
}
/**
+ * Test image with `Asset.timestamp` = force
+ *
+ * @return void
+ */
+ public function testImageTimestampForce()
+ {
+ Configure::write('Asset.timestamp', 'force');
+
+ $result = $this->Helper->image('cake.icon.png');
+ $this->assertRegExp('/' . preg_quote('img/cake.icon.png?', '/') . '[0-9]+/', $result);
+ }
+
+ /**
* test css
*
* @return void | Check if a generated image url has a timestamp when `Asset.timestamp` = force. | cakephp_cakephp | train | php |
308362dd9f4eac9be66ff1282e0cec8b27dc596c | diff --git a/notification/notification.class.inc.php b/notification/notification.class.inc.php
index <HASH>..<HASH> 100644
--- a/notification/notification.class.inc.php
+++ b/notification/notification.class.inc.php
@@ -48,6 +48,16 @@ class PodioNotificationAPI {
return json_decode($response->getBody(), TRUE);
}
}
+
+ /**
+ * Returns the number of unread notifications for the active user.
+ */
+ public function getNewCount() {
+ $response = $this->podio->request('/notification/inbox/new/count');
+ if ($response) {
+ return json_decode($response->getBody(), TRUE);
+ }
+ }
/**
* Returns the notifications in the inbox that has already been viewed. | Add method for getting new inbox count | podio-community_podio-php | train | php |
0666a894e20a181f8849035635342c06cefd1f4d | diff --git a/app/Module/IndividualFactsTabModule.php b/app/Module/IndividualFactsTabModule.php
index <HASH>..<HASH> 100644
--- a/app/Module/IndividualFactsTabModule.php
+++ b/app/Module/IndividualFactsTabModule.php
@@ -950,6 +950,6 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf
{
// We don't actually displaye these facts, but they are displayed
// outside the tabs/sidebar systems. This just forces them to be excluded here.
- return new Collection(['NAME', 'SEX']);
+ return new Collection(['NAME', 'SEX', 'OBJE']);
}
} | Fix: #<I> - level 1 media objects should not appear in the facts/events tab | fisharebest_webtrees | train | php |
3bf9f8d1854b9f874292cabf332cefad43c3de3a | diff --git a/src/com/google/javascript/jscomp/ConformanceRules.java b/src/com/google/javascript/jscomp/ConformanceRules.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/ConformanceRules.java
+++ b/src/com/google/javascript/jscomp/ConformanceRules.java
@@ -2147,7 +2147,7 @@ public final class ConformanceRules {
return Optional.absent();
}
JSType elementType = compiler.getTypeRegistry().getGlobalType("Element");
- if (type.isSubtypeOf(elementType)) {
+ if (elementType != null && type.isSubtypeOf(elementType)) {
return Optional.of(propertyName);
}
return Optional.absent(); | Fix crashes due to lack of typing info.
PiperOrigin-RevId: <I> | google_closure-compiler | train | java |
d8cebd808b19e04fd453caea58632cfcb6c1db71 | diff --git a/src/Layer.js b/src/Layer.js
index <HASH>..<HASH> 100644
--- a/src/Layer.js
+++ b/src/Layer.js
@@ -159,15 +159,22 @@ export default class Layer {
addTo (map, beforeLayerID) {
// Manage errors, whether they are an Evented Error or a common Error
try {
- map.once('error', () => { this._waitForMapToLoad(map, beforeLayerID); });
+ map.once('error', (data) => {
+ console.warn(data.error.message);
+ this._waitForMapToLoad(map, beforeLayerID);
+ });
map.addLayer(this, beforeLayerID);
} catch (error) {
+ const STYLE_ERROR_REGEX = /Style is not done loading/;
+ if (!STYLE_ERROR_REGEX.test(error)) {
+ throw new CartoRuntimeError(`Error adding layer to map: ${error}`);
+ }
this._waitForMapToLoad(map, beforeLayerID);
}
}
_waitForMapToLoad (map, beforeLayerID) {
- map.once('load', () => {
+ map.on('load', () => {
map.addLayer(this, beforeLayerID);
});
} | Manage errors, evented or common type | CartoDB_carto-vl | train | js |
4ffdb0950451534678faab064a809f645ed58b41 | diff --git a/source/application/controllers/oxstart.php b/source/application/controllers/oxstart.php
index <HASH>..<HASH> 100644
--- a/source/application/controllers/oxstart.php
+++ b/source/application/controllers/oxstart.php
@@ -37,6 +37,8 @@ class oxStart extends oxUBase
if ( 'oxstart' == oxRegistry::getConfig()->getRequestParameter( 'cl' ) || $this->isAdmin() )
return;
+ $oProcessor = $this->_getServerNodeProcessor();
+ $oProcessor->process();
}
/** | ESDEV-<I> Save information about frontend servers so it could be used for license check.
Adding call of nodes processor to appInit. | OXID-eSales_oxideshop_ce | train | php |
867d44dda15e7b09fb94892243a2307a237f7979 | diff --git a/src/test/java/org/eluder/coveralls/maven/plugin/service/AppveyorTest.java b/src/test/java/org/eluder/coveralls/maven/plugin/service/AppveyorTest.java
index <HASH>..<HASH> 100755
--- a/src/test/java/org/eluder/coveralls/maven/plugin/service/AppveyorTest.java
+++ b/src/test/java/org/eluder/coveralls/maven/plugin/service/AppveyorTest.java
@@ -30,7 +30,6 @@ import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
import static org.junit.Assert.*;
@@ -83,4 +82,8 @@ public class AppveyorTest {
assertEquals("10", new Appveyor(env()).getPullRequest());
}
+ @Test
+ public void testGetJobId() {
+ assertEquals("54de3316c44f", new Appveyor(env()).getJobId());
+ }
} | Unit test for Appveyor job id. | trautonen_coveralls-maven-plugin | train | java |
636e16b3a7dcaf4788af427f457a55d889ca658a | diff --git a/backends.py b/backends.py
index <HASH>..<HASH> 100644
--- a/backends.py
+++ b/backends.py
@@ -234,7 +234,7 @@ class TensorflowBackend(AbstractBackend):
def shape(self, x):
if self.tf.executing_eagerly():
- return x.shape
+ return list(int(d) for d in x.shape)
else:
return self.tf.unstack(self.tf.shape(x)) | fix for tf eager backend to make shape hashable | arogozhnikov_einops | train | py |
7b25ef25028ddb1ea148e14da39f369ca8ab4012 | diff --git a/seleniumbase/plugins/base_plugin.py b/seleniumbase/plugins/base_plugin.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/plugins/base_plugin.py
+++ b/seleniumbase/plugins/base_plugin.py
@@ -100,13 +100,14 @@ class Base(Plugin):
error states, we want to make sure that they don't show up in
the nose output as errors.
"""
- self.__log_all_options_if_none_specified(test)
if (err[0] == errors.BlockedTest or
err[0] == errors.SkipTest or
err[0] == errors.DeprecatedTest):
print err[1].__str__().split('''-------------------- >> '''
'''begin captured logging'''
''' << --------------------''', 1)[0]
+ else:
+ self.__log_all_options_if_none_specified(test)
def handleError(self, test, err, capt=None):
""" | Don't log on fake error states such as SkipTest. | seleniumbase_SeleniumBase | train | py |
bc40b89e8fa04645942a34324790bd08f33ac635 | diff --git a/src/widgets/current-refined-values/current-refined-values.js b/src/widgets/current-refined-values/current-refined-values.js
index <HASH>..<HASH> 100644
--- a/src/widgets/current-refined-values/current-refined-values.js
+++ b/src/widgets/current-refined-values/current-refined-values.js
@@ -168,6 +168,13 @@ currentRefinedValues({
* container: '#current-refined-values',
* clearAll: 'after',
* clearsQuery: true,
+ * attributes: [
+ * {name: 'free_shipping', label: 'Free shipping'},
+ * {name: 'price', label: 'Price'},
+ * {name: 'brand', label: 'Brand'},
+ * {name: 'category', label: 'Category'},
+ * ],
+ * onlyListedAttributes: true,
* })
* );
*/ | chore(showcase): Better config for current refinements | algolia_instantsearch.js | train | js |
b80f39e748550062d527778c57670185ec44359a | diff --git a/gravity/process_manager/__init__.py b/gravity/process_manager/__init__.py
index <HASH>..<HASH> 100644
--- a/gravity/process_manager/__init__.py
+++ b/gravity/process_manager/__init__.py
@@ -106,9 +106,9 @@ class BaseProcessManager(object, metaclass=ABCMeta):
registered_instance_names = self.config_manager.get_registered_instances()
unknown_instance_names = []
if instance_names:
- for i, n in enumerate(instance_names):
+ for n in instance_names:
if n not in registered_instance_names:
- unknown_instance_names.append(instance_names.pop(i))
+ unknown_instance_names.append(n)
elif registered_instance_names:
instance_names = registered_instance_names
else: | Don't pop from passed in instance_names
We may be passing in tuples. Not sure which one is the bug, but not
manipulating passed in values wins by default for me. | galaxyproject_gravity | train | py |
92cdab5afdc8bb000d869bed40fd3840804b8b06 | diff --git a/course/lib.php b/course/lib.php
index <HASH>..<HASH> 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -751,10 +751,10 @@ function print_course_admin_links($course, $width=180) {
$course->teachers = get_string("defaultcourseteachers");
}
$admindata[]="<a href=\"teacher.php?id=$course->id\">$course->teachers...</a>";
- $adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
+ $adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<a href=\"student.php?id=$course->id\">$course->students...</a>";
- $adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
+ $adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
$admindata[]="<a href=\"$CFG->wwwroot/backup/backup.php?id=$course->id\">".get_string("backup")."...</a>";
$adminicon[]="<img src=\"$pixpath/i/backup.gif\" height=16 width=16 alt=\"\">"; | Put user images on teacher and student links | moodle_moodle | train | php |
00d3f9070e15e514430e5dbb2aec602547c3c92d | diff --git a/retrofit/src/main/java/retrofit/android/AndroidLog.java b/retrofit/src/main/java/retrofit/android/AndroidLog.java
index <HASH>..<HASH> 100644
--- a/retrofit/src/main/java/retrofit/android/AndroidLog.java
+++ b/retrofit/src/main/java/retrofit/android/AndroidLog.java
@@ -16,7 +16,15 @@ public class AndroidLog implements RestAdapter.Log {
@Override public void log(String message) {
for (int i = 0, len = message.length(); i < len; i += LOG_CHUNK_SIZE) {
int end = Math.min(len, i + LOG_CHUNK_SIZE);
- Log.d(tag, message.substring(i, end));
+ logChunk(message.substring(i, end));
}
}
+
+ public void logChunk(String chunk) {
+ Log.d(getTag(), chunk);
+ }
+
+ public String getTag() {
+ return tag;
+ }
} | AndroidLog: Added getTag() and logChunk() methods
… for easier subclassing. | square_retrofit | train | java |
d6253ea8a4f6bd22321a218c247fb363c42a70d8 | diff --git a/lib/sprockets/cached_environment.rb b/lib/sprockets/cached_environment.rb
index <HASH>..<HASH> 100644
--- a/lib/sprockets/cached_environment.rb
+++ b/lib/sprockets/cached_environment.rb
@@ -55,7 +55,7 @@ module Sprockets
def build_asset_hash(filename, bundle = true)
key = [
'asset-hash',
- self.digest.hexdigest,
+ self.digest.hexdigest, # FIXME: Avoid Env#digest
filename,
bundle,
file_hexdigest(filename), | Todo to avoid env digest for later | rails_sprockets | train | rb |
2485cb204b1c42282261dbe2378614b631bd8fcc | diff --git a/test/setup.js b/test/setup.js
index <HASH>..<HASH> 100644
--- a/test/setup.js
+++ b/test/setup.js
@@ -24,6 +24,8 @@ before(function(done) {
e.browser.client = webdriverio.remote({
desiredCapabilities: {
+ browserName: 'chrome',
+ version: '42',
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
},
host: 'ondemand.saucelabs.com', | Require latest version of Chrome stable to do tests due to incompatibilities. | nodecg_nodecg | train | js |
c63efb4efc4063eb365b19d6f0422b05b59544ed | diff --git a/src/transports/file/__specs__/file.spec.js b/src/transports/file/__specs__/file.spec.js
index <HASH>..<HASH> 100644
--- a/src/transports/file/__specs__/file.spec.js
+++ b/src/transports/file/__specs__/file.spec.js
@@ -68,7 +68,7 @@ describe('transports/file/file', function () {
var testFile = new file.File(path.join(tmpDir.path, 'test.txt'));
testFile.writeLine('1'.repeat(4096));
- testFile.crop(8);
+ testFile.crop(7 + os.EOL.length);
expect(fs.readFileSync(testFile.path, 'utf8'))
.toEqual('[log cropped]' + os.EOL + '1111111' + os.EOL + os.EOL); | fix(file): Test on Windows | megahertz_electron-log | train | js |
f81d771f0657ae8375b84a77a059812cce5d6fd9 | diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -153,6 +153,17 @@ module ActiveRecord
end
end
+ # Returns the AssociationReflection object specified in the <tt>:through</tt> option
+ # of a HasMantThrough or HasOneThrough association. Example:
+ #
+ # class Post < ActiveRecord::Base
+ # has_many :taggings
+ # has_many :tags, :through => :taggings
+ # end
+ #
+ # tags_reflection = Post.reflect_on_association(:tags)
+ # taggings_reflection = tags_reflection.through_reflection
+ #
def through_reflection
@through_reflection ||= options[:through] ? active_record.reflect_on_association(options[:through]) : false
end | doc: ActiveRecord::Reflection::AssociationReflection#through_reflection
Added documentation demonstrating the use of #through_reflection for
finding intervening reflection objects for HasManyThrough
and HasOneThrough. | rails_rails | train | rb |
9f20f93a2ad1148b1cc647bda4186ce4c6abe484 | diff --git a/libraries/lithium/test/filter/Profiler.php b/libraries/lithium/test/filter/Profiler.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/test/filter/Profiler.php
+++ b/libraries/lithium/test/filter/Profiler.php
@@ -167,8 +167,8 @@ class Profiler extends \lithium\test\Filter {
}
if (!isset($totals[$title]['format'])) {
- $f = static::$_formatters[static::$_metrics[$title]['format']];
- $totals[$title]['formatter'] = $f;
+ $format = static::$_metrics[$title]['format'];
+ $totals[$title]['formatter'] = static::$_formatters[$format];
}
}
} | Updated Profiler filter assignment to be more descriptive | UnionOfRAD_framework | train | php |
1f41e73195b5c8b5e2ef10faaf69f586706c352f | diff --git a/test/func/alias.js b/test/func/alias.js
index <HASH>..<HASH> 100644
--- a/test/func/alias.js
+++ b/test/func/alias.js
@@ -58,6 +58,8 @@ describe('updateAliasSet', () => {
afterEach(function () {
return truncateTables(bookshelf, [
+ 'bookbrainz.alias_set__alias',
+ 'bookbrainz.alias_set',
'bookbrainz.alias',
'musicbrainz.language'
]);
diff --git a/test/func/identifier.js b/test/func/identifier.js
index <HASH>..<HASH> 100644
--- a/test/func/identifier.js
+++ b/test/func/identifier.js
@@ -54,6 +54,8 @@ describe('updateIdentifierSet', () => {
afterEach(function () {
return truncateTables(bookshelf, [
+ 'bookbrainz.identifier_set__identifier',
+ 'bookbrainz.identifier_set',
'bookbrainz.identifier',
'bookbrainz.identifier_type'
]); | fix(test): also truncate associated tables in func set tests | bookbrainz_bookbrainz-data-js | train | js,js |
3acfaa5738e67b1d6472d83158c1389bcf4f5434 | diff --git a/FluentDOM.php b/FluentDOM.php
index <HASH>..<HASH> 100644
--- a/FluentDOM.php
+++ b/FluentDOM.php
@@ -963,7 +963,7 @@ class FluentDOM implements RecursiveIterator, SeekableIterator, Countable, Array
$result = $this->_spawn();
foreach ($this->_array as $node) {
$previous = $node->previousSibling;
- while ($previous instanceof DOMNode && !$this->isNode($previous)) {
+ while ($previous instanceof DOMNode && !$this->_isNode($previous)) {
$previous = $previous->previousSibling;
}
if (!empty($previous)) { | FluentDOM:
- fixed: missing underscore in _isNode() call in method prevSiblings() | ThomasWeinert_FluentDOM | train | php |
a6c0a75f9a897f2f2003b696840467ad170d6a1b | diff --git a/eth/backend.go b/eth/backend.go
index <HASH>..<HASH> 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -467,7 +467,7 @@ func (self *Ethereum) minedBroadcastLoop() {
for obj := range self.minedBlockSub.Chan() {
switch ev := obj.(type) {
case core.NewMinedBlockEvent:
- self.protocolManager.BroadcastBlock(ev.Block)
+ self.protocolManager.BroadcastBlock(ev.Block.Hash(), ev.Block)
}
}
} | eth: fixed proper BroadcastBlock for mined blocks | ethereum_go-ethereum | train | go |
d3f2c677f5498891350ad17154f20ceaef51b212 | diff --git a/trollimage/colormap.py b/trollimage/colormap.py
index <HASH>..<HASH> 100644
--- a/trollimage/colormap.py
+++ b/trollimage/colormap.py
@@ -272,7 +272,7 @@ class Colormap(object):
if num_bands1 == num_bands2:
return cmap1, cmap2
if 4 in (num_bands1, num_bands2):
- return cmap1.to_rgba(), cmap1.to_rgba()
+ return cmap1.to_rgba(), cmap2.to_rgba()
raise ValueError("Can't normalize colors of colormaps. Unexpected "
f"number of bands: {num_bands1} and {num_bands2}.") | Fix typo in Colormap color normalization | pytroll_trollimage | train | py |
4fe063b2e5d06f5743be6a53770d8be56416b7c6 | diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Command/CreateProjectCommand.php
+++ b/src/Composer/Command/CreateProjectCommand.php
@@ -104,6 +104,9 @@ EOT
$this->updatePreferredOptions($config, $input, $preferSource, $preferDist, true);
+ if ($input->getOption('dev')) {
+ $io->writeError('<warning>You are using the deprecated option "dev". Dev packages are installed by default now.</warning>');
+ }
if ($input->getOption('no-custom-installers')) {
$io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
$input->setOption('no-plugins', true); | Added missing deprecation warning in create-project. | composer_composer | train | php |
57b688dad3036114771a8f0ee055aefb6690ef6d | diff --git a/redg-runtime/src/main/java/com/btc/redg/runtime/jdbc/RedGDatabaseUtil.java b/redg-runtime/src/main/java/com/btc/redg/runtime/jdbc/RedGDatabaseUtil.java
index <HASH>..<HASH> 100644
--- a/redg-runtime/src/main/java/com/btc/redg/runtime/jdbc/RedGDatabaseUtil.java
+++ b/redg-runtime/src/main/java/com/btc/redg/runtime/jdbc/RedGDatabaseUtil.java
@@ -125,11 +125,6 @@ public class RedGDatabaseUtil {
throw new InsertionFailedException("SQL execution failed", e);
}
}
- try {
- connection.commit();
- } catch (SQLException e) {
- throw new InsertionFailedException("Commit failed", e);
- }
}
private static Function<RedGEntity, PreparedStatement> prepareStatement(final Connection connection) { | Do not commit RedG data insertions | btc-ag_redg | train | java |
80652d181a8c85575dc85c8b908bdc9aea55bae1 | diff --git a/sark/enum.py b/sark/enum.py
index <HASH>..<HASH> 100644
--- a/sark/enum.py
+++ b/sark/enum.py
@@ -267,7 +267,7 @@ class EnumMemberComments(object):
"name={name!r},"
" reqular={regular!r},"
" repeat={repeat!r})").format(
- name="{}.{}".format(enum_member.enum.name, enum_member.name),
+ name="{}.{}".format(enum_member.parent.name, enum_member.name),
regular=self.regular,
repeat=self.repeat, )
@@ -325,12 +325,12 @@ class EnumMember(object):
return idaapi.get_enum_member_serial(self.cid)
@property
- def enum(self):
+ def parent(self):
"""Get the enum holding the member."""
return Enum(eid=idaapi.get_enum_member_enum(self.cid))
def __repr__(self):
- return "<EnumMember(name='{}.{}')>".format(self.enum.name, self.name)
+ return "<EnumMember(name='{}.{}')>".format(self.parent.name, self.name)
def iter_bitmasks(eid): | Minor refactoring to the `Enum` class to allow more consistent naming with the `Struct` class (different branch) | tmr232_Sark | train | py |
b055d815fa266e1425c96c104d6cd33b0ccdab81 | diff --git a/lib/services/api/ec2-2013-02-01.js b/lib/services/api/ec2-2013-02-01.js
index <HASH>..<HASH> 100644
--- a/lib/services/api/ec2-2013-02-01.js
+++ b/lib/services/api/ec2-2013-02-01.js
@@ -9232,8 +9232,7 @@ module.exports = {
Primary: {
type: 'boolean'
}
- },
- name: 'PrivateIpAddressesSet'
+ }
},
flattened: true
},
@@ -9241,7 +9240,7 @@ module.exports = {
type: 'integer'
}
},
- name: 'NetworkInterfaceSet'
+ name: 'NetworkInterface'
},
flattened: true
}, | Fix issue with EC2.requestSpotInstances | aws_aws-sdk-js | train | js |
f08f36d1d9396b3ad65b5d6469d9487651f97898 | diff --git a/cmsplugin_zinnia/__init__.py b/cmsplugin_zinnia/__init__.py
index <HASH>..<HASH> 100644
--- a/cmsplugin_zinnia/__init__.py
+++ b/cmsplugin_zinnia/__init__.py
@@ -1,5 +1,5 @@
"""cmsplugin_zinnia"""
-__version__ = '0.6'
+__version__ = '0.7'
__license__ = 'BSD License'
__author__ = 'Fantomas42' | Bumping to version <I> | django-blog-zinnia_cmsplugin-zinnia | train | py |
804f6166f1f666784b01b0ecf2fffca9276af6b7 | diff --git a/decayedlog.go b/decayedlog.go
index <HASH>..<HASH> 100644
--- a/decayedlog.go
+++ b/decayedlog.go
@@ -403,7 +403,7 @@ func (d *DecayedLog) PutBatch(b *Batch) (*ReplaySet, error) {
// idempotent.
replayBytes := batchReplayBkt.Get(b.id)
if replayBytes != nil {
- replays = &ReplaySet{}
+ replays = NewReplaySet()
return replays.Decode(bytes.NewReader(replayBytes))
} | ensure replays is fully initialized before using it | lightningnetwork_lightning-onion | train | go |
d08b825607f81df097414d787e25e94b3a109cfe | diff --git a/lib/middleman/core_extensions/builder.rb b/lib/middleman/core_extensions/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/middleman/core_extensions/builder.rb
+++ b/lib/middleman/core_extensions/builder.rb
@@ -20,11 +20,11 @@ module Middleman::CoreExtensions::Builder
self.class.build_reroute(&block)
end
- def reroute_builder(desination, request_path)
- result = [desination, request_path]
+ def reroute_builder(destination, request_path)
+ result = [destination, request_path]
build_reroute.each do |block|
- output = instance_exec(desination, request_path, &block)
+ output = instance_exec(destination, request_path, &block)
if output
result = output
break
@@ -34,4 +34,4 @@ module Middleman::CoreExtensions::Builder
result
end
end
-end
\ No newline at end of file
+end | Fix typo desination -> destination | middleman_middleman | train | rb |
78d7eb6f6f04e485a96ee63f2b249bcca1cdbe1c | diff --git a/thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/SpringTemplateEngine.java b/thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/SpringTemplateEngine.java
index <HASH>..<HASH> 100755
--- a/thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/SpringTemplateEngine.java
+++ b/thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/SpringTemplateEngine.java
@@ -58,8 +58,6 @@ public class SpringTemplateEngine
implements ISpringTemplateEngine, MessageSourceAware {
- private static final SpringStandardDialect SPRINGSTANDARD_DIALECT = new SpringStandardDialect();
-
private MessageSource messageSource = null;
private MessageSource templateEngineMessageSource = null;
@@ -69,7 +67,7 @@ public class SpringTemplateEngine
public SpringTemplateEngine() {
super();
// This will set the SpringStandardDialect, overriding the Standard one set in the super constructor
- super.setDialect(SPRINGSTANDARD_DIALECT);
+ super.setDialect(new SpringStandardDialect());
} | Modified the way SpringStandardDialect is initialized in SpringTemplateEngine (startup time) | thymeleaf_thymeleaf | train | java |
0582dcc1f7aafe50e25a21c792ea1b3367ea5881 | diff --git a/pynspect/__init__.py b/pynspect/__init__.py
index <HASH>..<HASH> 100644
--- a/pynspect/__init__.py
+++ b/pynspect/__init__.py
@@ -16,4 +16,4 @@ data structures.
"""
-__version__ = "0.15"
+__version__ = "0.16" | DEPLOY: Increased package version to '<I>' to build new distribution. | honzamach_pynspect | train | py |
ccd58a8840d68488b23120a22cc4b0c8a8991aa2 | diff --git a/wol/wol.go b/wol/wol.go
index <HASH>..<HASH> 100644
--- a/wol/wol.go
+++ b/wol/wol.go
@@ -70,7 +70,6 @@ func sendMagicPacket(macAddr string) error {
// Run one of the supported commands
func runCommand(cmd string, args []string, aliases map[string]string) error {
var err error
- fmt.Printf("The aliases map is: %v\n", aliases)
switch cmd {
case "alias":
@@ -103,9 +102,16 @@ func runCommand(cmd string, args []string, aliases map[string]string) error {
case "wake":
if len(args) > 0 {
- err = sendMagicPacket(args[0])
+ macAddr := args[0]
+
+ // If we got an alias - use that as the mac addr
+ if val, ok := aliases[macAddr]; ok {
+ macAddr = val
+ }
+
+ err = sendMagicPacket(macAddr)
if err == nil {
- fmt.Printf("Magic packet sent successfully to %s\n", args[0])
+ fmt.Printf("Magic packet sent successfully to %s\n", macAddr)
}
} else {
err = errors.New("No mac address specified to wake command") | aliasing working :) | sabhiram_go-wol | train | go |
66ba3ceac8ceffdbbd37d78fe1dee1ee87966152 | diff --git a/lib/build-test-actions.js b/lib/build-test-actions.js
index <HASH>..<HASH> 100644
--- a/lib/build-test-actions.js
+++ b/lib/build-test-actions.js
@@ -53,7 +53,7 @@ var actionsForTestFunctions = function (test, ancestors, helper, stats) {
name: test.name,
type: 'test',
description: test.description(stats.suiteCount, stats.fileCounts[test.file]),
- suiteNames: test.ancestorNames,
+ ancestorNames: test.ancestorNames,
isAssociatedWithATest: true,
children: _.flatten([
beforeEachActions(helper, test, ancestors),
diff --git a/test/plugin-test.js b/test/plugin-test.js
index <HASH>..<HASH> 100644
--- a/test/plugin-test.js
+++ b/test/plugin-test.js
@@ -43,7 +43,7 @@ module.exports = function (finalCallbackPhew) {
wrappers: {
test: function (runTest, metadata, cb) {
if (_.startsWith(metadata.name, 'ignore') ||
- _.some(metadata.suiteNames, function (suiteName) {
+ _.some(metadata.ancestorNames, function (suiteName) {
return _.startsWith(suiteName, 'ignore')
})) {
cb(null) | rename suiteNames to ancestorNames
Thinking about a scheme for uniquely identifying tests & suites in
order to call back the results of each | testdouble_teenytest | train | js,js |
5fc63b962032891b03620ef62e6e9dd485a5f538 | diff --git a/lib/overcommit/subprocess.rb b/lib/overcommit/subprocess.rb
index <HASH>..<HASH> 100644
--- a/lib/overcommit/subprocess.rb
+++ b/lib/overcommit/subprocess.rb
@@ -51,7 +51,7 @@ module Overcommit
err.rewind
out.rewind
- Result.new(process.exit_code, out.read, err.read)
+ Result.new(process.exit_code, to_utf8(out.read), to_utf8(err.read))
end
# Spawns a new process in the background using the given array of
@@ -83,6 +83,23 @@ module Overcommit
%w[cmd.exe /c] + [args.join(' ')]
end
+ # Convert string from current locale to utf-8
+ #
+ # When running commands under windows the command output is using
+ # current system locale (depends on system lanuage) not UTF-8
+ #
+ # @param process [String]
+ # @return [String]
+ def to_utf8(string)
+ if Encoding.locale_charmap == 'UTF-8'
+ return string
+ end
+
+ ec = Encoding::Converter.new(Encoding.locale_charmap, 'UTF-8')
+ # Convert encoding, alternatively simple: string.scrub will suffice
+ ec.convert(string)
+ end
+
# @param process [ChildProcess]
# @return [Array<IO>]
def assign_output_streams(process) | Fix encoding of process output under windows (#<I>)
* Fix encoding of process output under windows
Output of commands under windows is not UTF-8 by default, this
can lead to "invalid byte sequence in UTF-8" error on sylink check
* Fix coding style
* Fix invalid converter setting (UTF-8 to UTF-8) | sds_overcommit | train | rb |
6bf883f29bdc3f396dc8d05c670f3a29b1141cc7 | diff --git a/resources/lang/ar-SA/dashboard.php b/resources/lang/ar-SA/dashboard.php
index <HASH>..<HASH> 100644
--- a/resources/lang/ar-SA/dashboard.php
+++ b/resources/lang/ar-SA/dashboard.php
@@ -137,7 +137,7 @@ return [
// Metrics
'metrics' => [
- 'metrics' => 'Metrics',
+ 'metrics' => 'المقاييس',
'add' => [
'title' => 'Create a metric',
'message' => 'You should add a metric.', | New translations dashboard.php (Arabic) | CachetHQ_Cachet | train | php |
eac5267fe2dc1c0f4b472a7b704778f767bca03e | diff --git a/lib/coral_core.rb b/lib/coral_core.rb
index <HASH>..<HASH> 100644
--- a/lib/coral_core.rb
+++ b/lib/coral_core.rb
@@ -91,6 +91,7 @@ require 'multi_json'
require 'digest/sha1'
require 'optparse'
require 'thread'
+require 'tmpdir'
#--- | Adding a require of the tmpdir gem in the coral loader. | coralnexus_corl | train | rb |
efc01aa58c80587a06aaf6e227768a8261bd245e | diff --git a/smartfields/__init__.py b/smartfields/__init__.py
index <HASH>..<HASH> 100644
--- a/smartfields/__init__.py
+++ b/smartfields/__init__.py
@@ -1,7 +1,7 @@
# Major, minor, revision
-VERSION = (1, 0, 7)
+VERSION = (1, 0, 8)
def get_version():
return "%s.%s.%s" % VERSION | bumped up a version to update pypi package | lehins_django-smartfields | train | py |
08467a12c625247c6f9a16bc9788dc98fab8ef58 | diff --git a/lib/image_processing/mini_magick.rb b/lib/image_processing/mini_magick.rb
index <HASH>..<HASH> 100644
--- a/lib/image_processing/mini_magick.rb
+++ b/lib/image_processing/mini_magick.rb
@@ -181,10 +181,10 @@ module ImageProcessing
def apply_define(magick, options)
options.each do |namespace, settings|
- namespace = namespace.to_s.gsub("_", "-")
+ namespace = namespace.to_s.tr("_", "-")
settings.each do |key, value|
- key = key.to_s.gsub("_", "-")
+ key = key.to_s.tr("_", "-")
magick.define "#{namespace}:#{key}=#{value}"
end | perf (#<I>) | janko_image_processing | train | rb |
0ae0bfce040f2cae0ac5269e1e745a4027161e89 | diff --git a/bfw_modules_info.php b/bfw_modules_info.php
index <HASH>..<HASH> 100644
--- a/bfw_modules_info.php
+++ b/bfw_modules_info.php
@@ -1,3 +1,4 @@
<?php
$modulePath = 'src';
+$configFiles = array('config.php');
?>
\ No newline at end of file | Fix bfw_modules_info.php for view config file | bfw-systems_controller | train | php |
73a2f42491a2f6bfa5ef5c9d7704a667e4b347f7 | diff --git a/src/ossos-pipeline/ossos/gui/models/imagemanager.py b/src/ossos-pipeline/ossos/gui/models/imagemanager.py
index <HASH>..<HASH> 100644
--- a/src/ossos-pipeline/ossos/gui/models/imagemanager.py
+++ b/src/ossos-pipeline/ossos/gui/models/imagemanager.py
@@ -1,3 +1,5 @@
+import time
+
__author__ = "David Rusk <drusk@uvic.ca>"
from ossos.gui import events, logger
@@ -63,11 +65,15 @@ class ImageManager(object):
)
def get_cutout(self, reading):
+ if reading is None:
+ raise KeyError("Bad Reading")
try:
return self._cutouts[reading]
except KeyError as err:
- logger.info(str(err)+str(reading))
- raise ImageNotLoadedException(reading)
+ print "Image {} not yet available. retrying in 3 seconds.".format(reading)
+ time.sleep(3)
+ self.download_singlet_for_reading(reading, focus=None, needs_apcor=True)
+ return self.get_cutout(reading)
def download_triplets_for_workunit(self, workunit):
if workunit in self._workunits_downloaded_for_triplets: | added some feedback when application is waiting for file from VOS. | OSSOS_MOP | train | py |
a588ac00492c765911727ab3ad9f6d2b80077200 | diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
+++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php
@@ -206,18 +206,26 @@ trait InteractsWithDatabase
*/
protected function getTable($table)
{
- $entity = $this->getModelEntity($table);
-
- return $entity ? $entity->getTable() : $table;
+ return $this->getModelEntity($table)?->getTable() ?: $table;
}
+ /**
+ * Get the table connection specified in the given model.
+ *
+ * @param \Illuminate\Database\Eloquent\Model|string $table
+ * @return string|null
+ */
protected function getTableConnection($table)
{
- $entity = $this->getModelEntity($table);
-
- return $entity ? $entity->getConnectionName() : null;
+ return $this->getModelEntity($table)?->getConnectionName();
}
+ /**
+ * Get the model entity from the given model or string
+ *
+ * @param \Illuminate\Database\Eloquent\Model|string $table
+ * @return \Illuminate\Database\Eloquent\Model|null
+ */
protected function getModelEntity($table)
{
return is_subclass_of($table, Model::class) ? (new $table) : null; | Added doc blocks and make use of the null safe operator instead of using a temp var | laravel_framework | train | php |
762aafa96675c0fe8531fc3e10c040004c89fb8c | diff --git a/fixtureless/factory.py b/fixtureless/factory.py
index <HASH>..<HASH> 100644
--- a/fixtureless/factory.py
+++ b/fixtureless/factory.py
@@ -78,3 +78,11 @@ def save_instances(iterable):
for instance in iterable:
instance.save()
yield instance
+
+
+def create(*args):
+ return Factory().create(*args)
+
+
+def build(*args):
+ return Factory().build(*args) | Adding a simple create and build method for api ease | ricomoss_django-fixtureless | train | py |
1fc268b5603b6ec1ddf59d6a4ae646c27e27d296 | diff --git a/src/SAML2/AuthnRequestFactory.php b/src/SAML2/AuthnRequestFactory.php
index <HASH>..<HASH> 100644
--- a/src/SAML2/AuthnRequestFactory.php
+++ b/src/SAML2/AuthnRequestFactory.php
@@ -31,6 +31,9 @@ use Surfnet\SamlBundle\Http\Exception\InvalidRequestException;
use Symfony\Component\HttpFoundation\Request;
use XMLSecurityKey;
+/**
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
class AuthnRequestFactory
{
/** | Suppress PHPMD warning, coupling is allowed in this case
It provides bridging functionality between the configured
private key, the simplesamlphp\saml2 private key
loading mechanism and the private key structure needed
by the SAML2_AuthnRequest. This adds some classes that
are not required for the core functionality, but are
still required to get the bridging functionality to work | OpenConext_Stepup-saml-bundle | train | php |
d3f6498fca55406f47c037327982850a11f7b17e | diff --git a/autopep8.py b/autopep8.py
index <HASH>..<HASH> 100755
--- a/autopep8.py
+++ b/autopep8.py
@@ -1840,10 +1840,9 @@ def main():
assert not opts.recursive
filenames = args[:1]
- if sys.version_info[0] >= 3:
- output = sys.stdout
- else:
- output = codecs.getwriter('utf-8')(sys.stdout)
+ output = codecs.getwriter('utf-8')(sys.stdout.buffer
+ if sys.version_info[0] >= 3
+ else sys.stdout)
output = LineEndingWrapper(output) | Use codecs.getwriter() for Python 3
This makes things work the same as in Python 2, where we were always
outputting as Unicode. | hhatto_autopep8 | train | py |
06869265002ab0fff6ea3943191b3ac1bf228f5d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(name='tweet_parser',
packages=find_packages(),
scripts=["tools/parse_tweets.py"],
- version='1.0.1.dev1',
+ version='1.0.2.dev1',
license='MIT',
author='Fiona Pigott',
author_email='fpigott@twitter.com', | different version of the pkg in setup.py | twitterdev_tweet_parser | train | py |
4cc4700fd4346ae9b653099d81b7988b3058ef3c | diff --git a/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java b/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java
index <HASH>..<HASH> 100644
--- a/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java
+++ b/core/common/src/main/java/alluxio/underfs/BaseUnderFileSystem.java
@@ -50,8 +50,8 @@ public abstract class BaseUnderFileSystem implements UnderFileSystem {
* @param ufsConf UFS configuration
*/
protected BaseUnderFileSystem(AlluxioURI uri, UnderFileSystemConfiguration ufsConf) {
- mUri = Preconditions.checkNotNull(uri);
- mUfsConf = Preconditions.checkNotNull(ufsConf);
+ mUri = Preconditions.checkNotNull(uri, "uri");
+ mUfsConf = Preconditions.checkNotNull(ufsConf, "ufsConf");
}
@Override | [SMALLFIX] Supply the variable name to Preconditions.checkNotNull in BaseUnderFileSystem.java | Alluxio_alluxio | train | java |
9602d9df8b73d7819d110a54aa78fd8a63ad4f08 | diff --git a/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/rasterable/RasterableModel.java b/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/rasterable/RasterableModel.java
index <HASH>..<HASH> 100644
--- a/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/rasterable/RasterableModel.java
+++ b/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/rasterable/RasterableModel.java
@@ -140,7 +140,7 @@ public class RasterableModel extends FeatureModel implements Rasterable
if (enabled)
{
final int index = getRasterIndex(transformable.getY());
- if (index >= 0)
+ if (index > 0)
{
raster = rastersAnim.get(index);
} | #<I>: Raster minimum index fixed. | b3dgs_lionengine | train | java |
5245f6e4b34f1409b7bff5c068251bec8be5f93b | diff --git a/src/ResourceGenerator.php b/src/ResourceGenerator.php
index <HASH>..<HASH> 100644
--- a/src/ResourceGenerator.php
+++ b/src/ResourceGenerator.php
@@ -194,7 +194,7 @@ class ResourceGenerator
'.php_cs ' .
' --allow-risky=yes -q -v --stop-on-violation --using-cache=no';
- system($command, $null);
+ exec($command);
}
private function out(string $message) | Use exec instead of system, don't want any output shown | php-api-clients_resource-generator | train | php |
dc16822223c7693134bc4fed33e996c39586ca92 | diff --git a/src/lib/client.js b/src/lib/client.js
index <HASH>..<HASH> 100755
--- a/src/lib/client.js
+++ b/src/lib/client.js
@@ -58,7 +58,7 @@ function Client(config) {
_.each(EsApiClient.prototype, _.bind(function (Fn, prop) {
if (Fn.prototype instanceof clientAction.ApiNamespace) {
- this[prop] = new Fn(this.transport);
+ this[prop] = new Fn(this.transport, this);
}
}, this));
diff --git a/src/lib/client_action.js b/src/lib/client_action.js
index <HASH>..<HASH> 100644
--- a/src/lib/client_action.js
+++ b/src/lib/client_action.js
@@ -24,8 +24,9 @@ exports._resolveUrl = resolveUrl;
exports.ApiNamespace = function () {};
exports.namespaceFactory = function () {
- function ClientNamespace(transport) {
+ function ClientNamespace(transport, client) {
this.transport = transport;
+ this.client = client;
}
ClientNamespace.prototype = new exports.ApiNamespace(); | pass client instance to namespaceFactory | elastic_elasticsearch-js | train | js,js |
4218892cff41425cfeda27701485a8754a6b25a8 | diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -203,7 +203,7 @@ class Chef
end
else # windows
- raise "Windows hostnames cannot contain a period." if new_resource.hostname.match?(/./)
+ raise "Windows hostnames cannot contain a period." if new_resource.hostname.match?(/\./)
# suppress EC2 config service from setting our hostname
if ::File.exist?('C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml') | Don't fail on every hostname with windows
Look for periods instead of the regex value . | chef_chef | train | rb |
41ab9bf1ebca493832021e3eb8d199b50f6c0e79 | diff --git a/src/Transport/Http.php b/src/Transport/Http.php
index <HASH>..<HASH> 100644
--- a/src/Transport/Http.php
+++ b/src/Transport/Http.php
@@ -89,7 +89,7 @@ class Http extends AbstractTransport
// Let's only apply this value if the number of ms is greater than or equal to "1".
// In case "0" is passed as an argument, the value is reset to its default (300 s)
- if ($connectTimeoutMs > 1) {
+ if ($connectTimeoutMs >= 1) {
\curl_setopt($conn, \CURLOPT_CONNECTTIMEOUT_MS, $connectTimeoutMs);
} | Fix minimal value for connect timeout (#<I>) | ruflin_Elastica | train | php |
58bb0e1b230771118a1cb68efb59aa3ef10b085f | diff --git a/src/ima-plugin.js b/src/ima-plugin.js
index <HASH>..<HASH> 100644
--- a/src/ima-plugin.js
+++ b/src/ima-plugin.js
@@ -187,6 +187,24 @@ const ImaPlugin = function(player, options) {
contentSrc, adsResponse, playOnLoad);
}.bind(this);
+ /**
+ * Sets the content of the video player. You should use this method instead
+ * of setting the content src directly to ensure the proper ads request is
+ * used when the video content is loaded.
+ * @param {?string} contentSrc The URI for the content to be played. Leave
+ * blank to use the existing content.
+ * @param {?Object} adsRequest The ads request to be requested when the
+ * content loads. Leave blank to use the existing ads request.
+ * @param {?boolean} playOnLoad True to play the content once it has loaded,
+ * false to only load the content but not start playback.
+ */
+ this.setContentWithAdsResponse =
+ function(contentSrc, adsRequest, playOnLoad) {
+ this.controller.setContentWithAdsRequest(
+ contentSrc, adsRequest, playOnLoad);
+ }.bind(this);
+
+
/**
* Changes the flag to show or hide the ad countdown timer. | Added setContentWithAdsRequest to ima-plugin. | googleads_videojs-ima | train | js |
0f41127773826109211563f18f04b871beb2b979 | diff --git a/abilian/web/forms/widgets.py b/abilian/web/forms/widgets.py
index <HASH>..<HASH> 100644
--- a/abilian/web/forms/widgets.py
+++ b/abilian/web/forms/widgets.py
@@ -605,8 +605,8 @@ class DateTimeInput(object):
if field_value:
value = datetime.strptime(field_value, '%d/%m/%Y %H:%M')
- date_value = value.strftime('%d/%m/%Y') if value else None
- time_value = value.strftime('%H:%M') if value else None
+ date_value = value.strftime('%d/%m/%Y') if value else u''
+ time_value = value.strftime('%H:%M') if value else u''
return (
Markup(u'<input class="datetimepicker" type="hidden" id="{id}" name="{id}" value="{date} {time}" />\n' | datetimeinput: don't use None but empty string for empty value | abilian_abilian-core | train | py |
2e49324c20f006824091135eb46761222ef194c1 | diff --git a/spec/dummy/app/models/article.rb b/spec/dummy/app/models/article.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/app/models/article.rb
+++ b/spec/dummy/app/models/article.rb
@@ -1,3 +1,2 @@
class Article < ActiveRecord::Base
- attr_accessible :body, :title
end
diff --git a/spec/dummy/app/models/user.rb b/spec/dummy/app/models/user.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/app/models/user.rb
+++ b/spec/dummy/app/models/user.rb
@@ -1,3 +1,2 @@
class User < ActiveRecord::Base
- attr_accessible :locale, :name
end
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -50,7 +50,7 @@ module Dummy
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
- # config.active_record.whitelist_attributes = true
+ config.active_record.whitelist_attributes = false
# Enable the asset pipeline
# config.assets.enabled = true | let's not attr_accessible, thanks | jcasimir_locale_setter | train | rb,rb,rb |
dcef159ba3b99f98a6a60266c7eb3835427fe1d1 | diff --git a/lib/Widget/Widget.php b/lib/Widget/Widget.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/Widget.php
+++ b/lib/Widget/Widget.php
@@ -249,7 +249,12 @@ class Widget extends WidgetProvider
}
if (2 == func_num_args()) {
- return $temp[$name] = func_get_arg(1);
+ if (isset($this->widgets[$name])) {
+ $this->widgets[$name]->option(func_get_arg(1));
+ } else {
+ $temp[$name] = func_get_arg(1);
+ }
+ return $this;
}
return isset($temp[$name]) ? $temp[$name] : null; | synced the config to instaned widget | twinh_wei | train | php |
aa5ef2f7ff70baff27f85689690e90afa1f1c39c | diff --git a/lib/stripe/webhook.rb b/lib/stripe/webhook.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe/webhook.rb
+++ b/lib/stripe/webhook.rb
@@ -9,6 +9,11 @@ module Stripe
def self.construct_event(payload, sig_header, secret, tolerance: DEFAULT_TOLERANCE)
Signature.verify_header(payload, sig_header, secret, tolerance: tolerance)
+ # It's a good idea to parse the payload only after verifying it. We use
+ # `symbolize_names` so it would otherwise be technically possible to
+ # flood a target's memory if they were on an older version of Ruby that
+ # doesn't GC symbols. It also decreases the likelihood that we receive a
+ # bad payload that fails to parse and throws an exception.
data = JSON.parse(payload, symbolize_names: true)
Event.construct_from(data)
end | Add comment so the post-verify parse change doesn't regress | stripe_stripe-ruby | train | rb |
38cd400a7594d2ab3a3a37e538aebb11daf5c591 | diff --git a/lib/View/Button.php b/lib/View/Button.php
index <HASH>..<HASH> 100644
--- a/lib/View/Button.php
+++ b/lib/View/Button.php
@@ -55,6 +55,11 @@ class View_Button extends View_HtmlElement {
return parent::render();
}
+ function link($page,$args=array()){
+ $this->setElement('a');
+ $this->setAttr('href',$this->api->url($page,$args));
+ return $this;
+ }
// }}}
// {{{ Click handlers | add $button->link(page) for simple use of button as a link | atk4_atk4 | train | php |
b270cace6f0262c503402c5491cfebead092d9d7 | diff --git a/controller/deployer/main.go b/controller/deployer/main.go
index <HASH>..<HASH> 100644
--- a/controller/deployer/main.go
+++ b/controller/deployer/main.go
@@ -21,6 +21,8 @@ type context struct {
log log15.Logger
}
+const workerCount = 10
+
func main() {
log := log15.New("app", "deployer")
@@ -46,8 +48,9 @@ func main() {
}
pgxpool, err := pgx.NewConnPool(pgx.ConnPoolConfig{
- ConnConfig: pgxcfg,
- AfterConnect: que.PrepareStatements,
+ ConnConfig: pgxcfg,
+ AfterConnect: que.PrepareStatements,
+ MaxConnections: workerCount,
})
if err != nil {
log.Error("Failed to create a pgx.ConnPool", "err", err)
@@ -58,7 +61,7 @@ func main() {
q := que.NewClient(pgxpool)
wm := que.WorkMap{"deployment": cxt.HandleJob}
- workers := que.NewWorkerPool(q, wm, 10)
+ workers := que.NewWorkerPool(q, wm, workerCount)
go workers.Start()
shutdown.BeforeExit(func() { workers.Shutdown() }) | controller/deployer: Set postgres pool MaxConnections
This defaults to 5 but we run <I> workers, so bump it to <I>. | flynn_flynn | train | go |
83894899ef45a4e52ccdce7fcc5b858bb24d8aa3 | diff --git a/activiti-engine/src/main/java/org/activiti/DbProcessEngineBuilder.java b/activiti-engine/src/main/java/org/activiti/DbProcessEngineBuilder.java
index <HASH>..<HASH> 100644
--- a/activiti-engine/src/main/java/org/activiti/DbProcessEngineBuilder.java
+++ b/activiti-engine/src/main/java/org/activiti/DbProcessEngineBuilder.java
@@ -186,7 +186,8 @@ public class DbProcessEngineBuilder {
} else if ("check-version".equals(dbSchemaStrategy)) {
this.dbSchemaStrategy = DbSchemaStrategy.CHECK_VERSION;
} else {
- throw new ActivitiException("unknown db.schema.strategy: '"+dbSchemaStrategy+"': should be 'create-drop' or 'check-version'");
+ throw new ActivitiException("unknown db.schema.strategy: '"+dbSchemaStrategy
+ +"': should be 'create', 'create-drop' or 'check-version'");
}
} | Added 'create' to DbSchemaStrategy, since I needed it for testing (rebooting the processEgine) | camunda_camunda-bpm-platform | train | java |
6bc20f2f60cb60b30c41210d620bbafb43a90a9f | diff --git a/spec/features/renalware/adding_pd_regimes_spec.rb b/spec/features/renalware/adding_pd_regimes_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/features/renalware/adding_pd_regimes_spec.rb
+++ b/spec/features/renalware/adding_pd_regimes_spec.rb
@@ -20,7 +20,7 @@ module Renalware
select 'CAPD 4 exchanges per day', from: 'Treatment'
select 'Star Brand, Lucky Brand Green–2.34', from: 'Bag Type'
- fill_in 'Volume', with: '250'
+ select '2500', from: 'Volume (ml)'
uncheck 'Sunday'
uncheck 'Thursday'
@@ -32,7 +32,7 @@ module Renalware
within('.current-regime') do
expect(page).to have_content('Regime Start Date: 15/06/2015')
expect(page).to have_content('CAPD 4 exchanges per day')
- expect(page).to have_content('Bag type: Green–2.34, Volume: 250ml, No. per week: 5, Days: Mon, Tue, Wed, Fri, Sat')
+ expect(page).to have_content('Bag type: Green–2.34, Volume: 2500ml, No. per week: 5, Days: Mon, Tue, Wed, Fri, Sat')
expect(page).to have_content('On additional HD?: Yes')
end
end | Updated feature spec tests for adding_pd_regimes to work with changed pd regime bag volume input - now fixed options. | airslie_renalware-core | train | rb |
e148c74493fbb3e57cc164df7e37a03ccdcd71b0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -26,6 +26,7 @@ class TestCommand(Command):
'django.contrib.contenttypes',
'bakery',
)
+ BUILD_DIR="./build/"
)
from django.core.management import call_command
import django | Added BUILD_DIR to setup.py tests | datadesk_django-bakery | train | py |
796a98691abe5f5c438bd27c2e0362651912762c | diff --git a/src/exchange/information/information.controller.js b/src/exchange/information/information.controller.js
index <HASH>..<HASH> 100644
--- a/src/exchange/information/information.controller.js
+++ b/src/exchange/information/information.controller.js
@@ -82,7 +82,7 @@ angular
shouldDisplaySSLRenew () {
const now = moment();
const sslExpirationDate = moment(this.exchange.sslExpirationDate);
- const aMonthBeforeSSLExpirationDate = sslExpirationDate.subtract(30, "days");
+ const aMonthBeforeSSLExpirationDate = sslExpirationDate.subtract(1, "months");
const isAlreadyExpired = now.isAfter(sslExpirationDate);
const canRenewBeforeExpiration = now.isAfter(aMonthBeforeSSLExpirationDate);
@@ -95,7 +95,7 @@ angular
getSSLRenewTooltipText () {
const now = moment();
const sslExpirationDate = moment(this.exchange.sslExpirationDate);
- const aMonthBeforeSSLExpirationDate = sslExpirationDate.subtract(30, "days");
+ const aMonthBeforeSSLExpirationDate = sslExpirationDate.subtract(1, "months");
if (this.hasSSLTask) {
return this.services.translator.tr("exchange_action_renew_ssl_info"); | :ambulance: fix(*): replaced <I> days by 1 month | ovh-ux_ovh-module-exchange | train | js |
1b69494625bcdd4e362daca8d5cf2e4efd925888 | diff --git a/ontrack-web/src/app/view/view.admin.predefined-validation-stamps.js b/ontrack-web/src/app/view/view.admin.predefined-validation-stamps.js
index <HASH>..<HASH> 100644
--- a/ontrack-web/src/app/view/view.admin.predefined-validation-stamps.js
+++ b/ontrack-web/src/app/view/view.admin.predefined-validation-stamps.js
@@ -57,7 +57,7 @@ angular.module('ot.view.admin.predefined-validation-stamps', [
$scope.editValidationStampImage = function (predefinedValidationStamp) {
otStructureService.changeImage(predefinedValidationStamp, {
title: 'Image for predefined validation stamp ' + predefinedValidationStamp.name
- });
+ }).then(loadPredefinedValidationStamps);
};
}) | #<I> Image upload - reloading the list | nemerosa_ontrack | train | js |
f14c7a9419d89c9fab99c0a3b337a9d9b7839fe5 | diff --git a/tests/index.js b/tests/index.js
index <HASH>..<HASH> 100644
--- a/tests/index.js
+++ b/tests/index.js
@@ -58,4 +58,31 @@ describe('connectSequence.run(req, res, next, middlewares)', function () {
expect(_req.ids).to.contain('third')
expect(_req.ids).to.contain('fourth')
})
+
+ it('should run all the middlewares in the same order than the given array', function () {
+ var _req = {
+ ids: []
+ }
+ var _res = {}
+ var _next = function (req, res, next) {
+ req.ids.push('last')
+ }
+ var first = function (req, res, next) {
+ req.ids.push('first')
+ }
+ var second = function (req, res, next) {
+ req.ids.push('second')
+ }
+ var third = function (req, res, next) {
+ req.ids.push('third')
+ }
+ var fourth = function (req, res, next) {
+ req.ids.push('fourth')
+ }
+ var mids = [first, second, third, fourth]
+
+ connectSequence.run(_req, _res, _next, mids)
+
+ expect(_req.ids.join()).to.equal('first,second,third,fourth,last')
+ })
}) | it should run all the middlewares in the same order than the given array | sirap-group_connect-sequence | train | js |
ced85f2bbe053b887d986e89923c0a4a12dc1ee9 | diff --git a/src/ApcQueryLocator.php b/src/ApcQueryLocator.php
index <HASH>..<HASH> 100644
--- a/src/ApcQueryLocator.php
+++ b/src/ApcQueryLocator.php
@@ -40,12 +40,12 @@ final class ApcQueryLocator implements QueryLocatorInterface
public function get($queryName)
{
$sqlId = $this->nameSpace . $queryName;
- $sql = apc_fetch($sqlId);
+ $sql = apcu_fetch($sqlId);
if ($sql !== false) {
return $sql;
}
$sql = $this->query->get($queryName);
- apc_store($sqlId, $sql);
+ apcu_store($sqlId, $sql);
return $sql;
}
@@ -56,12 +56,12 @@ final class ApcQueryLocator implements QueryLocatorInterface
public function getCountQuery($queryName)
{
$sqlId = $this->nameSpace . $queryName;
- $sql = apc_fetch($sqlId);
+ $sql = apcu_fetch($sqlId);
if ($sql !== false) {
return $sql;
}
$sql = $this->query->getCountQuery($queryName);
- apc_store($sqlId, $sql);
+ apcu_store($sqlId, $sql);
return $sql;
} | apc* to apcu* | koriym_Koriym.QueryLocator | train | php |
6649f742629ec5354e969e2bf965a71ecd287461 | diff --git a/lib/git-process/github_configuration.rb b/lib/git-process/github_configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/git-process/github_configuration.rb
+++ b/lib/git-process/github_configuration.rb
@@ -102,6 +102,9 @@ module GitHubService
Octokit.configure do |c|
c.api_endpoint = api_endpoint(base_url)
c.web_endpoint = web_endpoint(base_url)
+ c.faraday_config do |f|
+ #f.response :logger
+ end
end
end
diff --git a/lib/git-process/github_pull_request.rb b/lib/git-process/github_pull_request.rb
index <HASH>..<HASH> 100644
--- a/lib/git-process/github_pull_request.rb
+++ b/lib/git-process/github_pull_request.rb
@@ -34,8 +34,8 @@ module GitHub
end
- def pull_requests
- @pull_requests ||= client.pull_requests(repo)
+ def pull_requests(state = 'open', opts = {})
+ @pull_requests ||= client.pull_requests(repo, state, opts)
end | Updated pull_requests to be able to specify options. | jdigger_git-process | train | rb,rb |
fb38c111e6f0947945de16185716d4cf490b098f | diff --git a/src/JamesPath/Ast/ElementsBranchNode.php b/src/JamesPath/Ast/ElementsBranchNode.php
index <HASH>..<HASH> 100644
--- a/src/JamesPath/Ast/ElementsBranchNode.php
+++ b/src/JamesPath/Ast/ElementsBranchNode.php
@@ -18,7 +18,7 @@ class ElementsBranchNode extends AbstractNode
public function search($value)
{
if ($result = $this->node->search($value)) {
- return new MultiMatch((array) $result);
+ return $result instanceof MultiMatch ? $result : new MultiMatch((array) $result);
}
} | Not creating a new MultiMatch if is already one | jmespath_jmespath.php | train | php |
5f06248800ddc90187653b535dd916a95e1407ef | diff --git a/lib/falkorlib/version.rb b/lib/falkorlib/version.rb
index <HASH>..<HASH> 100644
--- a/lib/falkorlib/version.rb
+++ b/lib/falkorlib/version.rb
@@ -19,7 +19,7 @@ module FalkorLib #:nodoc:
# MAJOR: Defines the major version
# MINOR: Defines the minor version
# PATCH: Defines the patch version
- MAJOR, MINOR, PATCH = 0, 5, 4
+ MAJOR, MINOR, PATCH = 0, 5, 5
module_function | bump to version '<I>' | Falkor_falkorlib | train | rb |
559fff9395b392cedda7febde44f112cdc1e207a | diff --git a/lib/entry.js b/lib/entry.js
index <HASH>..<HASH> 100644
--- a/lib/entry.js
+++ b/lib/entry.js
@@ -18,6 +18,8 @@
var log = require('logmagic').local('entry');
var optimist = require('optimist')
+var path = require('path');
+
var webApp = require('./web/app');
var Deployinator = require('./dreadnot').Deployinator;
var plugins = require('./plugins');
@@ -27,11 +29,11 @@ exports.run = function() {
optimist = optimist.usage('Usage: $0 -p [port] -c [/path/to/settings.js] -s [/path/to/stack/directory/]');
optimist = optimist['default']('p', 8000);
- optimisc = optimist['default']('c', '../local_settings');
+ optimisc = optimist['default']('c', './local_settings');
optimisc = optimist['default']('s', './stacks');
argv = optimist.argv;
- config = require(argv.c).config;
+ config = require(path.resolve(argv.c)).config;
d = new Deployinator(config, argv.s);
d.init(function(err) { | fix bug resolving relative config paths | racker_dreadnot | train | js |
99615aa5f7a598034beae6e470f1b4f3bea5fb2e | diff --git a/lib/whenever/command_line.rb b/lib/whenever/command_line.rb
index <HASH>..<HASH> 100644
--- a/lib/whenever/command_line.rb
+++ b/lib/whenever/command_line.rb
@@ -66,22 +66,23 @@ module Whenever
end
def write_crontab(contents)
- tmp_cron_file = Tempfile.new('whenever_tmp_cron').path
- File.open(tmp_cron_file, File::WRONLY | File::APPEND) do |file|
- file << contents
- end
+ tmp_cron_file = Tempfile.open('whenever_tmp_cron')
+ tmp_cron_file << contents
+ tmp_cron_file.fsync
command = ['crontab']
command << "-u #{@options[:user]}" if @options[:user]
- command << tmp_cron_file
+ command << tmp_cron_file.path
if system(command.join(' '))
action = 'written' if @options[:write]
action = 'updated' if @options[:update]
puts "[write] crontab file #{action}"
+ tmp_cron_file.close!
exit(0)
else
warn "[fail] Couldn't write crontab; try running `whenever' with no options to ensure your schedule file is valid."
+ tmp_cron_file.close!
exit(1)
end
end | fix file not found error when running under JRuby
(cherry picked from commit 1ca<I>c<I>fb<I>b2a6cd<I>deb<I>d<I>e) | javan_whenever | train | rb |
267669a2d107cadc7e817cba0f4b66e7cc3c16f4 | diff --git a/src/main/java/picocli/CommandLine.java b/src/main/java/picocli/CommandLine.java
index <HASH>..<HASH> 100644
--- a/src/main/java/picocli/CommandLine.java
+++ b/src/main/java/picocli/CommandLine.java
@@ -14438,7 +14438,9 @@ public class CommandLine {
if (argSpec.arity().max > 1) {
desc += " at index " + optionParamIndex;
}
- desc += " (" + argSpec.paramLabel() + ")";
+ if (argSpec.arity().max > 0) {
+ desc += " (" + argSpec.paramLabel() + ")";
+ }
}
} else {
desc = prefix + "positional parameter at index " + ((PositionalParamSpec) argSpec).index() + " (" + argSpec.paramLabel() + ")"; | Print paramLabel only when it could exist | remkop_picocli | train | java |
1c220d4180014132e87d06c9547a220af2553123 | diff --git a/fd.go b/fd.go
index <HASH>..<HASH> 100644
--- a/fd.go
+++ b/fd.go
@@ -30,8 +30,10 @@ import (
// Internal files' names to be assigned are specified via optional filenames
// argument.
//
-// Use net.FileConn() if you're receiving a network connection. Don't
-// forget to close the returned *os.File though.
+// You need to close all files in the returned slice. The slice can be
+// non-empty even if this function returns an error.
+//
+// Use net.FileConn() if you're receiving a network connection.
func Get(via *net.UnixConn, num int, filenames []string) ([]*os.File, error) {
if num < 1 {
return nil, nil | document that Get can return some files on errors
As ParseUnixRights can return an error after some file descriptors are
appended to the res slice, the caller must close file descriptors even
if the error is returned. | ftrvxmtrx_fd | train | go |
4db35aeb8d0a174919b884d89eb4098c3aa2a198 | diff --git a/lib/verifyUser.js b/lib/verifyUser.js
index <HASH>..<HASH> 100755
--- a/lib/verifyUser.js
+++ b/lib/verifyUser.js
@@ -53,7 +53,7 @@ module.exports = {
'searchEntry', function (entry) {
data.raw = entry.object;
data.valid = true;
- if (Number(entry.object.lockoutTime) == 0) {
+ if (Number(entry.object.lockoutTime) == 0 || typeof entry.object.lockoutTime == 'undefined') {
if (config.debug) {
console.log(
"account not locked and valid!" | Added lockoutTime undefined to be unlocked
AD does not have a lockoutTime variable if the account has never been locked. Was treating lockoutTime == null as locked, but this is not the case. | T4cC0re_ldap-verifyuser | train | js |
3bb8b89a735b45f2cec934a6d22a646094fd9c09 | diff --git a/src/ol-ext/format.js b/src/ol-ext/format.js
index <HASH>..<HASH> 100644
--- a/src/ol-ext/format.js
+++ b/src/ol-ext/format.js
@@ -21,14 +21,6 @@ export function createTopoJsonFmt (options) {
}
class GeoJSON extends BaseGeoJSON {
- adaptOptions (options) {
- return {
- dataProjection: this.defaultDataProjection,
- featureProjection: this.defaultFeatureProjection,
- ...options,
- }
- }
-
writeGeometryObject (geometry, options) {
if (isCircle(geometry)) {
geometry = createCircularPolygon(geometry.getCenter(), geometry.getRadius())
@@ -37,7 +29,6 @@ class GeoJSON extends BaseGeoJSON {
}
writeFeatureObject (feature, options) {
- options = this.adaptOptions(options)
const object = /** @type {GeoJSONFeature} */ ({
'type': 'Feature',
}) | custom geojson fmt: work through public methods | ghettovoice_vuelayers | train | js |
d9559c724732b466c9c906c37cec1f2794201b43 | diff --git a/src/sagemaker/model.py b/src/sagemaker/model.py
index <HASH>..<HASH> 100644
--- a/src/sagemaker/model.py
+++ b/src/sagemaker/model.py
@@ -1581,9 +1581,6 @@ class ModelPackage(Model):
container_def = {"ModelPackageName": model_package_name}
- if self.env != {}:
- container_def["Environment"] = self.env
-
self._ensure_base_name_if_needed(model_package_name.split("/")[-1])
self._set_model_name_if_needed() | fix: remove specifying env-vars when creating model from model package (#<I>) | aws_sagemaker-python-sdk | train | py |
e7adde64832bd7c9b7891693079074fe65d80bb1 | diff --git a/src/mattermostdriver/endpoints/elasticsearch.py b/src/mattermostdriver/endpoints/elasticsearch.py
index <HASH>..<HASH> 100644
--- a/src/mattermostdriver/endpoints/elasticsearch.py
+++ b/src/mattermostdriver/endpoints/elasticsearch.py
@@ -8,3 +8,8 @@ class Elasticsearch(Base):
return self.client.post(
self.endpoint + '/test'
)
+
+ def purge_all_elasticsearch_indexes(self):
+ return self.client.post(
+ self.endpoint + '/purge_indexes'
+ ) | elasticsearch: Update api endpoints | Vaelor_python-mattermost-driver | train | py |
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.