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 |
|---|---|---|---|---|---|
a7015bd0d4371ca3ff1487e3c1373106f1925e0c | diff --git a/src/com/google/bitcoin/core/Block.java b/src/com/google/bitcoin/core/Block.java
index <HASH>..<HASH> 100644
--- a/src/com/google/bitcoin/core/Block.java
+++ b/src/com/google/bitcoin/core/Block.java
@@ -33,7 +33,7 @@ import static com.google.bitcoin.core.Utils.*;
* you grab it from a downloaded {@link BlockChain}.
*/
public class Block extends Message {
- private static final long serialVersionUID = -2834162413473103042L;
+ private static final long serialVersionUID = 2738848929966035281L;
static final long ALLOWED_TIME_DRIFT = 2 * 60 * 60; // Same value as official client.
/** A value for difficultyTarget (nBits) that allows half of all possible hash solutions. Used in unit testing. */ | Change serialVer on Block. Patch from Andreas. | bitcoinj_bitcoinj | train | java |
a3667a43aa3b7f05c96fa3d3329c8a041c910145 | diff --git a/pyp2rpm/logger.py b/pyp2rpm/logger.py
index <HASH>..<HASH> 100644
--- a/pyp2rpm/logger.py
+++ b/pyp2rpm/logger.py
@@ -16,11 +16,11 @@ class LoggerWriter(object):
self.errors = None
def write(self, message):
- if message != '\n':
- self.level(message)
+ if message not in ('\n', ''):
+ self.level(message.rstrip('\n'))
def flush(self):
- self.level(sys.stderr)
+ pass
class LevelFilter(logging.Filter):
diff --git a/pyp2rpm/metadata_extractors.py b/pyp2rpm/metadata_extractors.py
index <HASH>..<HASH> 100644
--- a/pyp2rpm/metadata_extractors.py
+++ b/pyp2rpm/metadata_extractors.py
@@ -388,7 +388,7 @@ class DistMetadataExtractor(SetupPyMetadataExtractor):
raise SystemExit(3)
with utils.ChangeDir(os.path.dirname(setup_py)):
- with utils.RedirectStdStreams(stdout=os.devnull,
+ with utils.RedirectStdStreams(stdout=LoggerWriter(logger.debug),
stderr=LoggerWriter(logger.warning)):
extract_distribution.run_setup(setup_py, 'bdist_rpm') | Fix aborting redirection of streams to logger
- redirect stdout to logging debug level | fedora-python_pyp2rpm | train | py,py |
1f9fa92e56f425f64257e19a146339b57450ae76 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,21 @@ setup(
scripts=['bypy.py', 'bypygui.pyw'],
keywords = ['bypy', 'bypy.py', 'baidu pcs', 'baidu yun', 'baidu pan', 'baidu netdisk',
'baidu cloud storage', 'baidu personal cloud storage',
- '百度云', '百度云盘', '百度网盘', '百度个人云存储']
+ '百度云', '百度云盘', '百度网盘', '百度个人云存储'],
+ classifiers = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Intended Audience :: End Users/Desktop',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'License :: OSI Approved :: MIT License',
+ 'Natural Language :: English',
+ 'Operating System :: MacOS :: MacOS X',
+ 'Operating System :: Microsoft :: Windows',
+ 'Operating System :: POSIX',
+ 'Programming Language :: Python',
+ 'Topic :: Utilities',
+ 'Topic :: Internet :: WWW/HTTP']
)
# vim: set fileencoding=utf-8 | Add in classifiers in setup.py | houtianze_bypy | train | py |
7f1653bb5b022db6a799f23a40709ebf382cebfd | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@ SETUP_REQ = [
]
TESTS_REQ = [
- 'hypothesis==3.38.0',
+ 'hypothesis==3.38.3',
'hypothesis-pytest==0.19.0',
'py==1.5.2',
'pytest==3.2.5', | update to latest hypothesis (<I>) | jab_bidict | train | py |
4cea163d8ceac9d2bf38e7f4f391ab8e8e7d4483 | diff --git a/lib/mongoid/relations/referenced/many_to_many.rb b/lib/mongoid/relations/referenced/many_to_many.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/relations/referenced/many_to_many.rb
+++ b/lib/mongoid/relations/referenced/many_to_many.rb
@@ -173,8 +173,16 @@ module Mongoid # :nodoc:
# @return [ Many ] The relation.
#
# @since 2.0.0.rc.1
- def substitute(target, options = {})
- tap { target ? (@target = target.to_a; bind(options)) : (@target = unbind(options)) }
+ def substitute(new_target, options = {})
+ tap do |relation|
+ if new_target
+ binding.unbind(options)
+ relation.target = new_target.to_a
+ bind(options)
+ else
+ relation.target = unbind(options)
+ end
+ end
end
# Unbinds the base object to the inverse of the relation. This occurs | Fixing replacement of an existing many-to-many relation. Fixes #<I>. | mongodb_mongoid | train | rb |
0566ce190724c89cb933b012a7657f440d218c7d | diff --git a/src/main/java/eu/hansolo/tilesfx/skins/TimelineTileSkin.java b/src/main/java/eu/hansolo/tilesfx/skins/TimelineTileSkin.java
index <HASH>..<HASH> 100644
--- a/src/main/java/eu/hansolo/tilesfx/skins/TimelineTileSkin.java
+++ b/src/main/java/eu/hansolo/tilesfx/skins/TimelineTileSkin.java
@@ -664,16 +664,6 @@ public class TimelineTileSkin extends TileSkin {
}
stdDeviation = Statistics.getChartDataStdDev(reducedDataList);
- if (DATA.getValue() <= tile.getLowerThreshold()) {
- tile.showNotifyRegion(true);
- tile.setTooltipText("Value below lower threshold");
- } else if (DATA.getValue() >= tile.getThreshold()) {
- tile.showNotifyRegion(true);
- tile.setTooltipText("Value above upper threshold");
- } else {
- tile.showNotifyRegion(false);
- tile.setTooltipText("");
- }
analyse(reducedDataList); | Removed automatic handling of notify region in TimelineTileSkin | HanSolo_tilesfx | train | java |
c0b0fa0e29e34c2a93ee94a678722bbfca61618a | diff --git a/dispatch/modules/auth/actions.py b/dispatch/modules/auth/actions.py
index <HASH>..<HASH> 100644
--- a/dispatch/modules/auth/actions.py
+++ b/dispatch/modules/auth/actions.py
@@ -40,12 +40,13 @@ def list_actions(count=25):
if action.object_type == 'article':
try:
article = Article.objects.get(parent_id=action.object_id, head=True)
- meta = {}
- meta['author'] = action.person.full_name
- meta['headline'] = article.headline
- meta['article_url'] = article.get_absolute_url()
- meta['count'] = count
- meta['action'] = SINGULAR[action.action] if count == 1 else PLURAL[action.action]
+ meta = {
+ 'author': action.person.full_name,
+ 'headline': article.headline,
+ 'article_url': article.get_absolute_url(),
+ 'count': count,
+ 'action': SINGULAR[action.action] if count == 1 else PLURAL[action.action],
+ }
except:
continue | changed how fields in the meta obj is defined | ubyssey_dispatch | train | py |
575329500de496f803275418df8cb02508417b04 | diff --git a/codenerix/static/codenerix/js/codenerix.js b/codenerix/static/codenerix/js/codenerix.js
index <HASH>..<HASH> 100644
--- a/codenerix/static/codenerix/js/codenerix.js
+++ b/codenerix/static/codenerix/js/codenerix.js
@@ -1348,7 +1348,6 @@ if (typeof(get_static)=="undefined") {
} else {
var result = "/static/"+path;
}
- console.log("get_static("+path+"): "+result);
return result;
};
}
diff --git a/codenerix/views.py b/codenerix/views.py
index <HASH>..<HASH> 100644
--- a/codenerix/views.py
+++ b/codenerix/views.py
@@ -529,7 +529,7 @@ class GenBase(object):
# Constants
BASE_URL = getattr(settings, 'BASE_URL', '')
- DEFAULT_STATIC_PARTIAL_ROWS = 'codenerix/partials/rows.html'
+ DEFAULT_STATIC_PARTIAL_ROWS = os.path.join(settings.STATIC_URL, 'codenerix/partials/rows.html')
def dispatch(self, *args, **kwargs):
# Save arguments in the environment | DEFAULT_STATIC_PARTIAL_ROWS now address to the right path | codenerix_django-codenerix | train | js,py |
a2cd54cee7f8a70d1145426f2174c293fe8454fd | diff --git a/scripts/config/travis.js b/scripts/config/travis.js
index <HASH>..<HASH> 100644
--- a/scripts/config/travis.js
+++ b/scripts/config/travis.js
@@ -2,7 +2,8 @@
module.exports = {
expUsername: process.env.EXP_USERNAME,
expPassword: process.env.EXP_PASSWORD,
- expReleaseChannel: process.env.EXP_CHANNEL || process.env.TRAVIS_PULL_REQUEST_BRANCH,
+ expReleaseChannel:
+ process.env.EXP_CHANNEL || process.env.TRAVIS_PULL_REQUEST_BRANCH || process.env.TRAVIS_BRANCH,
githubUsername: process.env.GITHUB_USERNAME,
githubToken: process.env.GITHUB_TOKEN,
githubOrg: (process.env.TRAVIS_REPO_SLUG || '').split('/')[0], | Fix non-pr release branches for Travis | FormidableLabs_appr | train | js |
7d3ea01edb618818e760575711b406d0919e26b5 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -14,3 +14,7 @@ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../spec/dummy/db
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
SchemaComments.setup
+
+Dir.chdir(File.expand_path("../../spec/dummy", __FILE__)) do
+ system('RAILS_ENV=test bin/rake db:create')
+end | Call rake db:create to create database for test | akm_schema_comments | train | rb |
107c8345113f7ad74c0cdcb69a607795e361031c | diff --git a/public/absync.js b/public/absync.js
index <HASH>..<HASH> 100644
--- a/public/absync.js
+++ b/public/absync.js
@@ -168,7 +168,7 @@
// If we have no configured socket.io connection yet, remember to register it later.
if( !_absyncProvider.__ioSocket ) {
- if( _absyncProvider.__registerLater.length > 9999 ) {
+ if( _absyncProvider.__registerLater.length > 8192 ) {
// Be defensive, something is probably not right here.
return null;
} | [TASK] Use base2 upper limit in in range check | oliversalzburg_absync | train | js |
870dbd00035de04342b8c2f588b47c358503033c | diff --git a/src/pp.js b/src/pp.js
index <HASH>..<HASH> 100644
--- a/src/pp.js
+++ b/src/pp.js
@@ -131,16 +131,6 @@ function hasHardLine(doc) {
});
}
-function _makeIndent(n) {
- var s = "";
-
- for (var i = 0; i < n; i++) {
- s += " ";
- }
-
- return s;
-}
-
const MODE_BREAK = 1;
const MODE_FLAT = 2;
@@ -347,7 +337,7 @@ function print(w, doc) {
pos = 0;
} else {
- out.push("\n" + _makeIndent(ind));
+ out.push("\n" + " ".repeat(ind));
pos = ind;
} | Use js native String.repeat() (#<I>) | josephfrazier_prettier_d | train | js |
7fb6462ae68b59e6eac4dc2ff0a79a3bca484a4a | diff --git a/croppie.js b/croppie.js
index <HASH>..<HASH> 100755
--- a/croppie.js
+++ b/croppie.js
@@ -599,6 +599,7 @@
zoomer.step = '0.0001';
zoomer.value = 1;
zoomer.style.display = self.options.showZoomer ? '' : 'none';
+ zoomer.setAttribute('aria-label', 'zoom');
self.element.appendChild(wrap);
wrap.appendChild(zoomer); | Accessibility Label (Again)
- Adds label to input | Foliotek_Croppie | train | js |
369f38cf6ab13f443a1ee71415f08a35675f30a8 | diff --git a/lib/generate_models.rb b/lib/generate_models.rb
index <HASH>..<HASH> 100644
--- a/lib/generate_models.rb
+++ b/lib/generate_models.rb
@@ -181,7 +181,7 @@ unless IS_TEST
index_file = File.open('app/assets/javascripts/index.js', 'w')
index_file.puts "module.exports.Result = require('./Result.js').Result;"
index_file.puts "module.exports.ResultSchema = require('./Result.js').ResultSchema;"
- datatypes.each do |datatype|
+ datatypes.each do |datatype, _|
index_file.puts "module.exports.#{datatype} = require('./#{datatype}.js').#{datatype};"
index_file.puts "module.exports.#{datatype}Schema = require('./#{datatype}.js').#{datatype}Schema;"
end | Adjusting generator script JS require loop | projecttacoma_cqm-models | train | rb |
c336c403c36943815cb3ab2b7fa67093010ee05f | diff --git a/imgaug/imgaug.py b/imgaug/imgaug.py
index <HASH>..<HASH> 100644
--- a/imgaug/imgaug.py
+++ b/imgaug/imgaug.py
@@ -1523,6 +1523,9 @@ class BoundingBox(object):
y2=self.y2 if y2 is None else y2
)
+ def deepcopy(self, x1=None, y1=None, x2=None, y2=None):
+ return self.copy(x1=x1, y1=y1, x2=x2, y2=y2)
+
def __repr__(self):
return self.__str__()
@@ -1675,7 +1678,7 @@ class BoundingBoxesOnImage(object):
"""
# Manual copy is far faster than deepcopy for KeypointsOnImage,
# so use manual copy here too
- bbs = [BoundingBox(x1=bb.x1, y1=bb.y1, x2=bb.x2, y2=bb.y2) for bb in self.bounding_boxes]
+ bbs = [bb.deepcopy() for bb in self.bounding_boxes]
return BoundingBoxesOnImage(bbs, tuple(self.shape))
def __repr__(self): | Add deepcopy() to BoundingBox | aleju_imgaug | train | py |
4e86b17e734074af0317f9b0c40167f45fd0ca91 | diff --git a/gin.go b/gin.go
index <HASH>..<HASH> 100644
--- a/gin.go
+++ b/gin.go
@@ -318,6 +318,7 @@ func (engine *Engine) RunUnix(file string) (err error) {
return
}
defer listener.Close()
+ os.Chmod(file, 0777)
err = http.Serve(listener, engine)
return
} | Set socket to recieve writes (#<I>)
* Set socket to recieve writes
* Update gin.go | gin-gonic_gin | train | go |
c474427b0d930b7be932b6f54787cddd38b398bc | diff --git a/wishlib/si.py b/wishlib/si.py
index <HASH>..<HASH> 100644
--- a/wishlib/si.py
+++ b/wishlib/si.py
@@ -44,7 +44,7 @@ def inside_softimage():
return False
-def show_qt(qt_class):
+def show_qt(qt_class, modal=False):
"""
Shows and raise a pyqt window inside softimage ensuring it's not duplicated
(if it's duplicated then raise the old one).
@@ -53,13 +53,19 @@ def show_qt(qt_class):
"""
dialog = None
anchor = sianchor()
+ # look for a previous instance
for i in anchor.children():
if type(i).__name__ == qt_class.__name__:
dialog = i
+ # if there's no previous instance then create a new one
if not dialog:
dialog = qt_class(anchor)
- dialog.show()
- dialog.raise_() # ensures dialog window is on top
+ # show dialog
+ if modal:
+ dialog.exec_()
+ else:
+ dialog.show()
+ dialog.raise_() # ensures dialog window is on top
# DECORATORS | show_qt() now supports modal mode | csaez_wishlib | train | py |
c1f98938eb166c4c1f51b74ffd157697d83fef11 | diff --git a/util.go b/util.go
index <HASH>..<HASH> 100644
--- a/util.go
+++ b/util.go
@@ -12,26 +12,14 @@ func (w WriterFunc) Close() error {
return nil
}
-type chunkWriter struct {
- io.Writer
- chunk int
-}
-
-func ChunkWriter(w io.Writer, chunk int) io.Writer {
- return &chunkWriter{
- Writer: w,
- chunk: chunk,
- }
-}
-
-func (w *chunkWriter) Write(p []byte) (n int, err error) {
+func WriteInChunks(w io.Writer, p []byte, chunk int) (n int, err error) {
var m int
for len(p[n:]) > 0 {
- if n+w.chunk <= len(p) {
- m, err = w.Writer.Write(p[n : n+w.chunk])
+ if chunk <= len(p[n:]) {
+ m, err = w.Write(p[n : n+chunk])
} else {
- m, err = w.Writer.Write(p[n:])
+ m, err = w.Write(p[n:])
}
n += m | ChunkWriter replaced with single function WriteInChunks | djherbis_nio | train | go |
008f1b8136c3f1b58f26397ad3a1599ec3e3c7fd | diff --git a/src/main/java/io/dropwizard/flyway/cli/DbCommand.java b/src/main/java/io/dropwizard/flyway/cli/DbCommand.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/dropwizard/flyway/cli/DbCommand.java
+++ b/src/main/java/io/dropwizard/flyway/cli/DbCommand.java
@@ -34,7 +34,6 @@ public class DbCommand<T extends Configuration> extends AbstractFlywayCommand<T>
@Override
public void configure(final Subparser subparser) {
- super.configure(subparser);
for (AbstractFlywayCommand<T> subCommand : subCommands.values()) {
final Subparser cmdParser = subparser.addSubparsers()
.addParser(subCommand.getName()) | Prevent duplicate initialization of subparser in Flyway commands
Fixes #3 | dropwizard_dropwizard-flyway | train | java |
659a9e327d511e7de4375122cefb3ac46f22daeb | diff --git a/vncdotool/rfb.py b/vncdotool/rfb.py
index <HASH>..<HASH> 100644
--- a/vncdotool/rfb.py
+++ b/vncdotool/rfb.py
@@ -141,7 +141,7 @@ class RFBClient(Protocol):
log.msg("Using protocol version %.3f" % version)
parts = str(version).split('.')
self.transport.write(
- b"RFB %03d.%03d\n" % (int(parts[0]), int(parts[1])))
+ bytes("RFB %03d.%03d\n" % (int(parts[0]), int(parts[1])), 'ascii'))
self._packet[:] = [buffer]
self._packet_len = len(buffer)
self._handler = self._handleExpected
@@ -631,8 +631,8 @@ class RFBDes(pyDes.des):
for i in range(8):
if bsrc & (1 << i):
btgt = btgt | (1 << 7-i)
- newkey.append(chr(btgt))
- super(RFBDes, self).setKey(newkey)
+ newkey.append(btgt)
+ super(RFBDes, self).setKey(bytes(newkey))
# --- test code only, see vncviewer.py | RFB Python3 fix: tuple issue addressed, key issue addressed | sibson_vncdotool | train | py |
9d20fa88ad006c4f205d8a50c3ae809d1a93c927 | diff --git a/src/render.js b/src/render.js
index <HASH>..<HASH> 100644
--- a/src/render.js
+++ b/src/render.js
@@ -65,14 +65,13 @@ module.exports = function render() {
var changed = [];
this.featureIds.forEach((id) => {
- let featureInternal = this.features[id].internal(mode);
+ let feature = this.features[id];
+ let featureInternal = feature.internal(mode);
var coords = JSON.stringify(featureInternal.geometry.coordinates);
- if (this.ctx.store.needsUpdate(featureInternal)) {
+ if (feature.isValid() && this.ctx.store.needsUpdate(feature.toGeoJSON())) {
this.featureHistory[id] = coords;
- if (this.features[id].isValid()) {
- changed.push(this.features[id].toGeoJSON());
- }
+ changed.push(feature.toGeoJSON());
}
if (featureInternal.geometry.type !== 'Point' && this.features[id].isValid()) { | Fix issue where the draw.changed event payload returned all features instead of just the changed features. | mapbox_mapbox-gl-draw | train | js |
0efaf5890336b28b8e5e0564d5d8459921246597 | diff --git a/packages/video/video.showcase.js b/packages/video/video.showcase.js
index <HASH>..<HASH> 100644
--- a/packages/video/video.showcase.js
+++ b/packages/video/video.showcase.js
@@ -108,6 +108,23 @@ export default {
/>
</View>
)
+ },
+ {
+ type: "story",
+ name: "no poster image",
+ component: () => (
+ <View>
+ <Text style={{ marginTop: 10, marginBottom: 10 }}>Mobile size:</Text>
+ <Video {...defaultVideoProps} poster={null} />
+ <Text style={{ marginTop: 20, marginBottom: 10 }}>Desktop size:</Text>
+ <Video
+ {...defaultVideoProps}
+ height={374}
+ poster={null}
+ width={664}
+ />
+ </View>
+ )
}
]
}; | chore: add storybook story for videos without poster images (#<I>) | newsuk_times-components | train | js |
011f4b038b94dc0c5fa959809c3f8827bc8ad07c | diff --git a/core/error.rb b/core/error.rb
index <HASH>..<HASH> 100644
--- a/core/error.rb
+++ b/core/error.rb
@@ -3,7 +3,9 @@ class Exception < `Error`
def self.new(message = '')
%x{
- return new Error(message);
+ var err = new Error(message);
+ err._klass = #{self};
+ return err;
}
end | Ensure instances of Exception get the right klass set on them | opal_opal | train | rb |
cf60c1603dce6f73e0735b576cab0fe38a4d6c83 | diff --git a/tests/classical_psha_based_unittest.py b/tests/classical_psha_based_unittest.py
index <HASH>..<HASH> 100644
--- a/tests/classical_psha_based_unittest.py
+++ b/tests/classical_psha_based_unittest.py
@@ -27,7 +27,7 @@ HAZARD_CURVE = shapes.FastCurve(
LOSS_RATIO_EXCEEDANCE_MATRIX = [[0.695, 0.858, 0.990, 1.000], \
[0.266, 0.510, 0.841, 0.999]]
-class ClassicalPshaBasedTestCase(unittest.TestCase):
+class ClassicalPSHABasedTestCase(unittest.TestCase):
# loss curve tests
def setUp(self): | Renamed probabilistic_scenario in classical_psha_based | gem_oq-engine | train | py |
1598dbd3910f4ac9206d9dc8c58a18951a613eff | diff --git a/findimports.py b/findimports.py
index <HASH>..<HASH> 100755
--- a/findimports.py
+++ b/findimports.py
@@ -85,7 +85,6 @@ import doctest
import linecache
import optparse
import os
-import sys
import pickle
import re
import sys | removed re-import of sys lib | mgedmin_findimports | train | py |
5862eab2fc44c4693725909678f2954011667492 | diff --git a/etrago/cluster/disaggregation.py b/etrago/cluster/disaggregation.py
index <HASH>..<HASH> 100644
--- a/etrago/cluster/disaggregation.py
+++ b/etrago/cluster/disaggregation.py
@@ -488,20 +488,7 @@ class UniformDisaggregation(Disaggregation):
ws = weight.sum(axis=len(loc))
for bus_id in filtered.index:
values = clt * weight.loc[loc + (bus_id,)] / ws
- # Ok. The stuff below looks complicated, but there's a
- # reason for it and it is weird.
- # Use git blame and see the accompanying commit message
- # for an explanation.
- for size in count(3):
- column = ''.join(
- random.choice(string.ascii_uppercase)
- for _ in range(size))
- if column not in pn_t[s].columns:
- break
- pn_t[s].loc[:, column] = values
- pn_t[s].rename(
- columns={column: bus_id},
- inplace=True)
+ pn_t[s].insert(len(pn_t[s].columns), bus_id, values)
def transfer_results(self, *args, **kwargs): | Replace overly complicated solution with `insert`
Thankfully `DataFrame.insert` doesn't suffer from the same deficiency as
`DataFrame.loc[:, column] =` which makes it a suitable replacement for
the ad hoc workaround. | openego_eTraGo | train | py |
b28748d88a93360be5a26b177b21d65721ec2c3e | diff --git a/zeno/test/testing_utils.py b/zeno/test/testing_utils.py
index <HASH>..<HASH> 100644
--- a/zeno/test/testing_utils.py
+++ b/zeno/test/testing_utils.py
@@ -3,6 +3,8 @@ import os
import sys
import fcntl
+import tempfile
+
from ioflo.base.consoling import getConsole
from zeno.common.stacked import HA
@@ -85,9 +87,10 @@ class PortDispenser:
port numbers. It leverages the filesystem lock mechanism to ensure there
are no overlaps.
"""
- def __init__(self, ip: str):
+ def __init__(self, ip: str, filename: str=None):
self.ip = ip
- self.FILE = "portmutex3.{}.txt".format(ip)
+ self.FILE = filename or os.path.join(tempfile.gettempdir(),
+ 'zeno-portmutex.{}.txt'.format(ip))
self.minPort = 6000
self.maxPort = 9999
self.initFile() | PortDispensor now uses a system-supplied temporary directory and an intelligent filename when one is not provided to it. | hyperledger_indy-plenum | train | py |
0e1db75382d8c573bb1a6642587d1c791410e165 | diff --git a/src/js/services/twitter.js b/src/js/services/twitter.js
index <HASH>..<HASH> 100644
--- a/src/js/services/twitter.js
+++ b/src/js/services/twitter.js
@@ -33,9 +33,12 @@ module.exports = function(shariff) {
return {
popup: true,
shareText: {
- 'cs': 'sdílet',
'en': 'tweet',
- 'zh': '分享'
+ 'ja': 'のつぶやき',
+ 'ko': '짹짹',
+ 'ru': 'твит',
+ 'sr': 'твеет',
+ 'zh': '鸣叫'
},
name: 'twitter',
faName: 'fa-twitter', | twitter - correct and add translations
Correct zh translation from "share" to "tweet" (translated), remove cs translation, add ja, ko, ru, sr so all languages show "tweet" (translated). | heiseonline_shariff | train | js |
a6235418fb95dd1966012c2f41e4b5efa5786679 | diff --git a/src/edit/handler/Edit.Poly.js b/src/edit/handler/Edit.Poly.js
index <HASH>..<HASH> 100644
--- a/src/edit/handler/Edit.Poly.js
+++ b/src/edit/handler/Edit.Poly.js
@@ -218,7 +218,6 @@ L.Edit.Poly = L.Handler.extend({
marker1._middleRight = marker2._middleLeft = marker;
onDragStart = function () {
-
var i = marker2._index;
marker._index = i;
@@ -245,6 +244,7 @@ L.Edit.Poly = L.Handler.extend({
onDragEnd = function () {
marker.off('dragstart', onDragStart, this);
marker.off('dragend', onDragEnd, this);
+ marker.off('touchmove', onDragStart, this);
this._createMiddleMarker(marker1, marker);
this._createMiddleMarker(marker, marker2);
@@ -259,7 +259,8 @@ L.Edit.Poly = L.Handler.extend({
marker
.on('click', onClick, this)
.on('dragstart', onDragStart, this)
- .on('dragend', onDragEnd, this);
+ .on('dragend', onDragEnd, this)
+ .on('touchmove', onDragStart, this);
this._markerGroup.addLayer(marker);
}, | Allow touch devices to drag ghost markers in polylines and polygons. | Leaflet_Leaflet.draw | train | js |
9d8a37b4a6cec55e7277e37903f0a403c2356092 | diff --git a/modules/orbitsoftBidAdapter.js b/modules/orbitsoftBidAdapter.js
index <HASH>..<HASH> 100644
--- a/modules/orbitsoftBidAdapter.js
+++ b/modules/orbitsoftBidAdapter.js
@@ -25,7 +25,7 @@ let styleParamsMap = {
};
export const spec = {
code: BIDDER_CODE,
- aliases: ['oas', '152media'], // short code and customer aliases
+ aliases: ['oas', 'mediafuseLift'], // short code and customer aliases
isBidRequestValid: function (bid) {
switch (true) {
case !('params' in bid): | Added MediaFuse Lift alias to Orbitsoft adapter (#<I>) | prebid_Prebid.js | train | js |
5e95858395a2f98e3922606e943356429f91db52 | diff --git a/framework/gii/CCodeModel.php b/framework/gii/CCodeModel.php
index <HASH>..<HASH> 100644
--- a/framework/gii/CCodeModel.php
+++ b/framework/gii/CCodeModel.php
@@ -351,4 +351,17 @@ abstract class CCodeModel extends CFormModel
$result=trim(strtolower(str_replace('_',' ',preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $name))));
return $ucwords ? ucwords($result) : $result;
}
+
+ /**
+ * Converts a class name into a variable name with the first letter in lower case.
+ * This method is provided because lcfirst() PHP function is only available for PHP 5.3+.
+ * @param string the class name
+ * @return string the variable name converted from the class name
+ * @since 1.1.4
+ */
+ public function class2var($name)
+ {
+ $name[0]=strtolower($name[0]);
+ return $name;
+ }
}
\ No newline at end of file | (Fixes issue <I>) | yiisoft_yii | train | php |
5cdd8b5d61d4acc5bbcc56a2e9aaf98ca5fabeee | diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go
index <HASH>..<HASH> 100644
--- a/cmd/ipfs/daemon.go
+++ b/cmd/ipfs/daemon.go
@@ -45,7 +45,20 @@ For example, to change the 'Gateway' port:
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8082
-Make sure to restart the daemon after.`,
+The API address can be changed the same way:
+
+ ipfs config Addresses.API /ip4/127.0.0.1/tcp/5002
+
+Make sure to restart the daemon after changing addresses.
+
+By default, the gateway is only accessible locally. To expose it to other computers
+in the network, use 0.0.0.0 as the ip address:
+
+ ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
+
+Be careful if you expose the API. It is a security risk, as anyone could use control
+your node remotely. If you need to control the node remotely, make sure to protect
+the port as you would other services or database (firewall, authenticated proxy, etc).`,
},
Options: []cmds.Option{ | expand the ports documentation
i took @jbenet's suggestion, but reorganised it a bit to *not* suggest what is actually warned against later. :) | ipfs_go-ipfs | train | go |
3ccbb9fcfc74c1524260c23a7e2d8561c2ca8d02 | diff --git a/tests/Geometries/LineStringTest.php b/tests/Geometries/LineStringTest.php
index <HASH>..<HASH> 100644
--- a/tests/Geometries/LineStringTest.php
+++ b/tests/Geometries/LineStringTest.php
@@ -21,7 +21,7 @@ class LineStringTest extends BaseTestCase
public function testFromWKT()
{
- $linestring = LineString::fromWKT('LINESTRING(0 0, 1 1, 2 2)');
+ $linestring = LineString::fromWkt('LINESTRING(0 0, 1 1, 2 2)');
$this->assertInstanceOf(LineString::class, $linestring);
$this->assertEquals(3, $linestring->count());
diff --git a/tests/Geometries/MultiPointTest.php b/tests/Geometries/MultiPointTest.php
index <HASH>..<HASH> 100644
--- a/tests/Geometries/MultiPointTest.php
+++ b/tests/Geometries/MultiPointTest.php
@@ -7,7 +7,7 @@ class MultiPointTest extends BaseTestCase
{
public function testFromWKT()
{
- $multipoint = MultiPoint::fromWKT('MULTIPOINT((0 0),(1 0),(1 1))');
+ $multipoint = MultiPoint::fromWkt('MULTIPOINT((0 0),(1 0),(1 1))');
$this->assertInstanceOf(MultiPoint::class, $multipoint);
$this->assertEquals(3, $multipoint->count()); | Fix test cases for MultiPointTest::testFromWKT() and LineStringTest::testFromWKT() | njbarrett_laravel-postgis | train | php,php |
c17c356de3e7f841f2f9b36dd7cc515d09d9d926 | diff --git a/tests/Library/test_config.inc.php b/tests/Library/test_config.inc.php
index <HASH>..<HASH> 100644
--- a/tests/Library/test_config.inc.php
+++ b/tests/Library/test_config.inc.php
@@ -58,7 +58,7 @@ require_once OX_BASE_PATH . 'core/oxfunctions.php';
// As in new bootstrap to get db instance.
$oConfigFile = new OxConfigFile(OX_BASE_PATH . "config.inc.php");
OxRegistry::set("OxConfigFile", $oConfigFile);
-if ($testType == 'acceptance') {
+if ($sTestType == 'acceptance') {
oxRegistry::set("oxConfig", oxNew('oxConfig'));
} else {
oxRegistry::set("oxConfig", new oxConfig()); | ESDEV-<I> Change test_config
Change testype variable name
(cherry picked from commit 9b<I>c4d) | OXID-eSales_oxideshop_ce | train | php |
b993893e309db3706f9809dd3cc84856d57c2f0f | diff --git a/test/test_jsonschema_draft4.rb b/test/test_jsonschema_draft4.rb
index <HASH>..<HASH> 100644
--- a/test/test_jsonschema_draft4.rb
+++ b/test/test_jsonschema_draft4.rb
@@ -867,24 +867,6 @@ class JSONSchemaDraft4Test < Test::Unit::TestCase
assert(!JSON::Validator.validate(schema,data,:list => true))
end
- def test_list_option_reusing_schemas
- schema_hash = {
- "$schema" => "http://json-schema.org/draft-04/schema#",
- "type" => "object",
- "properties" => { "a" => { "type" => "integer" } }
- }
-
- uri = URI.parse('http://example.com/item')
- schema = JSON::Schema.new(schema_hash, uri)
- JSON::Validator.add_schema(schema)
-
- data = {"a" => 1}
- assert(JSON::Validator.validate(uri.to_s, data))
-
- data = [{"a" => 1}]
- assert(JSON::Validator.validate(uri.to_s, data, :list => true))
- end
-
def test_self_reference
schema = { | Moving list option reuse to new test file | ruby-json-schema_json-schema | train | rb |
2b69538899d5d0d03ab4f41d08fc3fa78adc544d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,20 @@ def main():
description='Python bindings for Nylas, the next-generation email platform.',
license="MIT",
keywords="inbox app appserver email nylas",
- url='https://github.com/nylas/nylas-python'
+ url='https://github.com/nylas/nylas-python',
+ long_description_content_type='text/markdown',
+ long_description='''
+# Nylas REST API Python bindings
+[](https://travis-ci.org/nylas/nylas-python)
+[](https://codecov.io/gh/nylas/nylas-python)
+
+Python bindings for the Nylas REST API. https://www.nylas.com/docs
+
+The Nylas APIs power applications with email, calendar, and contacts CRUD and bi-directional sync from any inbox in the world.
+
+Nylas is compatible with 100% of email service providers, so you only have to integrate once.
+No more headaches building unique integrations against archaic and outdated IMAP and SMTP protocols.''',
+
) | Set package description for pypi | nylas_nylas-python | train | py |
88694e1812c64bd0410b709c92c68568c1cbfb07 | diff --git a/ipyrad/assemble/jointestimate.py b/ipyrad/assemble/jointestimate.py
index <HASH>..<HASH> 100644
--- a/ipyrad/assemble/jointestimate.py
+++ b/ipyrad/assemble/jointestimate.py
@@ -311,6 +311,9 @@ def stackarray(data, sample):
pairdealer = izip(*[iter(clusters)] * 2)
# we subsample, else ... (could e.g., use first 10000 loci).
+ # limit maxlen b/c some ref clusters can create huge contigs
+ hidepth = min(10000, hidepth)
+ maxlen = min(150, maxlen)
dims = (hidepth, maxlen, 4)
stacked = np.zeros(dims, dtype=np.uint64)
@@ -363,6 +366,9 @@ def stackarray(data, sample):
stacked[nclust, :catg.shape[0], :] = catg
nclust += 1
+ # bail out when nclusts have been done
+ if nclust == hidepth:
+ done = True
## drop the empty rows in case there are fewer loci than the size of array
newstack = stacked[stacked.sum(axis=2) > 0] | limit nclusts and maxlen in step4 for faster processing | dereneaton_ipyrad | train | py |
f881f8e309c62fe64e113bd67de96dd0b2659ed0 | diff --git a/source/Core/UtilsObject.php b/source/Core/UtilsObject.php
index <HASH>..<HASH> 100644
--- a/source/Core/UtilsObject.php
+++ b/source/Core/UtilsObject.php
@@ -27,7 +27,6 @@ use OxidEsales\Eshop\Core\Edition\EditionSelector;
use OxidEsales\Eshop\Core\Exception\SystemComponentException;
use OxidEsales\Eshop\Core\Module\ModuleChainsGenerator;
use OxidEsales\Eshop\Core\Module\ModuleVariablesLocator;
-use OxidEsales\Eshop\Core\Exception\SystemComponentException;
use ReflectionClass;
use ReflectionException; | ESDEV-<I> Fix UtilsObject during rebase | OXID-eSales_oxideshop_ce | train | php |
d2898b527a77d1e5b726ef52788d39ba6c33fd60 | diff --git a/lib/resource/Account.js b/lib/resource/Account.js
index <HASH>..<HASH> 100644
--- a/lib/resource/Account.js
+++ b/lib/resource/Account.js
@@ -94,7 +94,20 @@ Account.prototype.getApiKeys = function getApiKeys(options,callback) {
Account.prototype.save = function saveAccount(){
var self = this;
- var args = arguments;
+
+ var args = Array.prototype.slice.call(arguments);
+
+ // If customData, then inject our own callback and invalidate the
+ // customData resource cache when the account finishes saving.
+ if (self.customData) {
+ var originalCallback = args.length > 0 && typeof args[args.length - 1] === 'function' ?
+ args.pop() : function nop() {};
+
+ args.push(function newCallback() {
+ self.dataStore._evict(self.customData.href, originalCallback);
+ });
+ }
+
self._applyCustomDataUpdatesIfNecessary(function(){
Account.super_.prototype.save.apply(self, args);
}); | fix cache eviction of customData when calling account.save() | stormpath_stormpath-sdk-node | train | js |
44af893ca39e84bc095f6d6669ecb05829cd5870 | diff --git a/bundles/org.eclipse.orion.client.core/web/orion/commands.js b/bundles/org.eclipse.orion.client.core/web/orion/commands.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/commands.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/commands.js
@@ -169,7 +169,12 @@ define(['i18n!orion/nls/messages', 'require', 'dojo', 'dijit', 'orion/uiUtils',
var CommandPopupMenuItem = dojo.declare(dijit.PopupMenuItem, {
// Override setter for 'label' attribute to prevent the use of innerHTML
_setLabelAttr: function(content) {
- this.containerNode.textContent = content;
+ if (typeof content === "string") {
+ this.containerNode.textContent = content;
+ } else {
+ dojo.empty(this.containerNode);
+ this.containerNode.appendChild(content);
+ }
}
}); | Bug <I> - Make CommandPopupMenuItem consistent with other dijit wrappers
-Support a DomNode for its 'label' attribute | eclipse_orion.client | train | js |
b65c349e20e0befa95d1ccd7fcb7a5cdb9436ab8 | diff --git a/lib/parinfer.js b/lib/parinfer.js
index <HASH>..<HASH> 100644
--- a/lib/parinfer.js
+++ b/lib/parinfer.js
@@ -1006,6 +1006,10 @@ function updateRememberedParenTrail(result) {
}
else {
trail.endX = result.parenTrail.endX;
+ if (result.returnParens) {
+ var opener = result.parenTrail.openers[result.parenTrail.openers.length-1];
+ opener.closer.trail = trail;
+ }
}
}
diff --git a/lib/sandbox.js b/lib/sandbox.js
index <HASH>..<HASH> 100644
--- a/lib/sandbox.js
+++ b/lib/sandbox.js
@@ -9,8 +9,9 @@ const parinferTest = require('./test');
const parinfer = require('./parinfer');
const code = `
-(foo
- |)
+(bar
+ |(foo)
+ )
`;
console.log(parinferTest.smartMode(code, {printParensOnly: true})); | mark leading close-parens as paren trails in the paren tree | shaunlebron_parinfer | train | js,js |
73d94a4d307f289f7bc62f7ca770ab8e17e33d75 | diff --git a/jaraco/stream/test_gzip.py b/jaraco/stream/test_gzip.py
index <HASH>..<HASH> 100644
--- a/jaraco/stream/test_gzip.py
+++ b/jaraco/stream/test_gzip.py
@@ -5,7 +5,7 @@ from six.moves import urllib, map, BaseHTTPServer
import pkg_resources
import pytest
-from more_itertools.recipes import flatten
+from more_itertools.recipes import flatten, consume
from jaraco.stream import gzip
@@ -60,3 +60,14 @@ def test_lines_from_stream(gzip_stream):
result = json.loads(second_line.rstrip('\n,'))
assert isinstance(result, dict)
assert 'id' in result
+
+
+def test_lines_completes(gzip_stream):
+ """
+ When reading lines from a gzip stream, the operation should complete
+ when the stream is exhausted.
+ """
+ chunks = gzip.read_chunks(gzip_stream)
+ streams = gzip.load_streams(chunks)
+ lines = flatten(map(gzip.lines_from_stream, streams))
+ consume(lines) | Add test capturing failure to complete. Ref #2. | jaraco_jaraco.stream | train | py |
5af763a4c84cfbd67230fed8c43e2ed8be0a3b81 | diff --git a/lib/flipper-active_record.rb b/lib/flipper-active_record.rb
index <HASH>..<HASH> 100644
--- a/lib/flipper-active_record.rb
+++ b/lib/flipper-active_record.rb
@@ -1,4 +1,4 @@
-require 'activesupport/lazy_load_hooks'
+require 'active_support/lazy_load_hooks'
ActiveSupport.on_load(:active_record) do
require 'flipper/adapters/active_record' | Fix typo in lib/flipper-active_record.rb | jnunemaker_flipper | train | rb |
37dc417289c19dfa38a0d47adbabd57be174e08d | diff --git a/bqplot/traits.py b/bqplot/traits.py
index <HASH>..<HASH> 100644
--- a/bqplot/traits.py
+++ b/bqplot/traits.py
@@ -264,6 +264,8 @@ class PandasDataFrame(Instance):
# Hence, we should set the following as the args
if len(args) == 0:
new_args = (None, (default_value,))
+ else:
+ new_args = args
super(PandasDataFrame, self).__init__(*new_args, **kwargs)
self.tag(to_json=self._to_json, from_json=self._from_json)
@@ -337,6 +339,8 @@ class PandasSeries(Instance):
# Hence, we should set the following as the args.
if len(args) == 0:
new_args = (None, (default_value,))
+ else:
+ new_args = args
super(PandasSeries, self).__init__(*new_args, **kwargs)
self.tag(to_json=self._to_json, from_json=self._from_json) | fixing issue when only args are passed | bloomberg_bqplot | train | py |
70d580b715c92ff63ffa28b69c045849521c23f7 | diff --git a/jquery-meteor-blaze.js b/jquery-meteor-blaze.js
index <HASH>..<HASH> 100644
--- a/jquery-meteor-blaze.js
+++ b/jquery-meteor-blaze.js
@@ -142,6 +142,21 @@ module.exports = function(jQuery, underscore) {
//Return the reactive values as array
return reactive.values();
};
+ else if (reactive.values)
+ //Set hepler
+ helper[key] = function() {
+ //Return the reactive values as array
+ return reactive.values();
+ };
+ else if (reactive.get)
+ //Set hepler
+ helper[key] = function() {
+ //Return the reactive var
+ return reactive.get();
+ };
+ else
+ //Error
+ throw new Error("Unknown reactive type, neither jQuery.Meteor.ReactiveVar nor jQuery.Meteor.ReactiveObjectMap, and doesn't have values() nor get());
//Add helper
obj.instance.helpers(helper);
}); | Support unknown types by get/values methods | eface2face_jquery-meteor-blaze | train | js |
44dfe4cc37d5462c1b3077f09621bc5a4612466a | diff --git a/tests/TalRepeatTest.php b/tests/TalRepeatTest.php
index <HASH>..<HASH> 100644
--- a/tests/TalRepeatTest.php
+++ b/tests/TalRepeatTest.php
@@ -144,7 +144,7 @@ class TalRepeatTest extends PHPTAL_TestCase
$tpl = $this->newPHPTAL();
$tpl->setSource('<tal:block tal:repeat="node nodes"><tal:block tal:condition="php:repeat.node.index==4">(len=${nodes/length})</tal:block>${repeat/node/key}${node/tagName}</tal:block>');
- $tpl->nodes = $a = $doc->getElementsByTagName('*');
+ $tpl->nodes = $doc->getElementsByTagName('*');
$this->assertEquals('0a1b2c3d(len=7)4e5f6g', $tpl->execute()); | Removed a leftover from debug | phptal_PHPTAL | train | php |
aa61b9a2e3418620fb89b8a1787ad6e5a7788590 | diff --git a/src/sap.ui.core/src/sap/ui/test/opaQunit.js b/src/sap.ui.core/src/sap/ui/test/opaQunit.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/test/opaQunit.js
+++ b/src/sap.ui.core/src/sap/ui/test/opaQunit.js
@@ -291,12 +291,17 @@ sap.ui.define([
// assertion is async, push results when ready
var oAssertionPromise = fnAssertion.apply(oParams.appWindow, arguments)
.always(function (oResult) {
- qunitThis.push(
- oResult.result,
- oResult.actual,
- oResult.expected,
- oResult.message
- );
+ if ( typeof qunitThis.pushResult === "function" ) {
+ qunitThis.pushResult(oResult);
+ } else {
+ // fallback for QUnit < 1.22.0
+ qunitThis.push(
+ oResult.result,
+ oResult.actual,
+ oResult.expected,
+ oResult.message
+ );
+ }
});
// schedule async assertion promise on waitFor flow so test waits till assertion is ready | [INTERNAL] opaQUnit: avoid deprecation warning when reporting assertions
The method QUnit.push has been deprecated and should be replaced
with QUnit.assert.pushResult where available. As our version <I> does
not yet contain pushResult, a check is needed before using either
method.
Change-Id: If6d<I>db9a8a<I>f<I>fa1e3ec<I> | SAP_openui5 | train | js |
7298ac1ed3384ccd8e94f1f79f50e0842f8f5047 | diff --git a/mysql/MySQLdb.py b/mysql/MySQLdb.py
index <HASH>..<HASH> 100644
--- a/mysql/MySQLdb.py
+++ b/mysql/MySQLdb.py
@@ -110,7 +110,9 @@ insert_values = re.compile(r'values\s(\(.+\))', re.IGNORECASE)
def escape_dict(d):
d2 = {}
- for k,v in d.items(): d2[k] = "'%s'" % escape_string(str(v))
+ for k,v in d.items():
+ if v is None: d2[k] = "NULL"
+ else: d2[k] = "'%s'" % escape_string(str(v))
return d2 | User-contributed fix: Convert None to NULL correctly when passing a
dictionary as the parameters to execute. | PyMySQL_mysqlclient-python | train | py |
48ddbfc31a516fee1e26c3f882d4087b7783dd07 | diff --git a/api/server.go b/api/server.go
index <HASH>..<HASH> 100644
--- a/api/server.go
+++ b/api/server.go
@@ -27,7 +27,7 @@ import (
"gopkg.in/tylerb/graceful.v1"
)
-const Version = "0.12.3-rc5"
+const Version = "0.12.3"
func getProvisioner() (string, error) {
provisioner, err := config.GetString("provisioner")
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,7 +51,7 @@ copyright = u'2015, Globo.com'
version = '0.12'
# The full version, including alpha/beta/rc tags.
-release = '0.12.3-rc1'
+release = '0.12.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. | api/server: bump to <I> | tsuru_tsuru | train | go,py |
d1429505e961b1ec0057fc30038fe430f41a8975 | diff --git a/galpy/potential_src/TwoPowerSphericalPotential.py b/galpy/potential_src/TwoPowerSphericalPotential.py
index <HASH>..<HASH> 100644
--- a/galpy/potential_src/TwoPowerSphericalPotential.py
+++ b/galpy/potential_src/TwoPowerSphericalPotential.py
@@ -147,7 +147,7 @@ class TwoPowerSphericalPotential(Potential):
2010-08-08 - Written - Bovy (NYU)
"""
r= m.sqrt(R**2.+z**2.)
- return (self.a/r)**self.alpha/(1.+r/self.a)**(self.beta-self.alpha)
+ return (self.a/r)**self.alpha/(1.+r/self.a)**(self.beta-self.alpha)/4./m.pi/self.a**3.
def _potIntegrandTransform(t,alpha,beta):
"""Internal function that transforms the integrand such that the integral becomes finite-ranged""" | consistent normalization of density wrt force in TwoPower | jobovy_galpy | train | py |
866054391e41d33d11a2b9141797ebc5ff727214 | diff --git a/lib/keyring_liberator.rb b/lib/keyring_liberator.rb
index <HASH>..<HASH> 100644
--- a/lib/keyring_liberator.rb
+++ b/lib/keyring_liberator.rb
@@ -36,7 +36,8 @@ module CocoaPodsKeys
def self.save_keyring(keyring)
keys_dir.mkpath
- if get_keyring_named(keyring)
+ existing = get_keyring_named(keyring.name)
+ if existing && yaml_path_for_path(existing.path) != yaml_path_for_path(keyring.path)
ui = Pod::UserInterface
ui.puts "About to create a duplicate keyring file for project #{keyring.name.green}"
ui.puts "\nPress enter to continue, or `ctrl + c` to cancel" | need to check the keyring path, because this was returning 'true' when there was only ONE keyring | orta_cocoapods-keys | train | rb |
203afa9c0fa73627f5edcf5e6ad8d26f7875d5a7 | diff --git a/netpyne/utils.py b/netpyne/utils.py
index <HASH>..<HASH> 100644
--- a/netpyne/utils.py
+++ b/netpyne/utils.py
@@ -145,7 +145,7 @@ def _delete_module(modname):
except:
pass
-def importCell (fileName, cellName, cellArgs = None, s = False):
+def importCell (fileName, cellName, cellArgs = None, cellInstance = False):
h.initnrn()
varList = mechVarList() # list of properties for all density mechanisms and point processes
origGlob = getGlobals(varList['mechs'].keys()+varList['pointps'].keys())
@@ -155,7 +155,7 @@ def importCell (fileName, cellName, cellArgs = None, s = False):
''' Import cell from HOC template or python file into framework format (dict of sections, with geom, topol, mechs, syns)'''
if fileName.endswith('.hoc') or fileName.endswith('.tem'):
h.load_file(fileName)
- if not s:
+ if not cellInstance:
if isinstance(cellArgs, dict):
cell = getattr(h, cellName)(**cellArgs) # create cell using template, passing dict with args
else: | in utils.py renamed s with cellInstance | Neurosim-lab_netpyne | train | py |
7f94a568dc79ef94d8bb4502609d78118f8491bd | diff --git a/README.md b/README.md
index <HASH>..<HASH> 100644
--- a/README.md
+++ b/README.md
@@ -45,10 +45,5 @@ If you've defined a finalize coffesript function you can also use it with:
Band.caffeine_map_reduce('playing_stats').caffeine_finalize('playing_stats').out(inline: 1)
```
-
-## ToDo
-At the moment, only [mongoid](http://mongoid.org/) ODM gem is supported.
-Hopefully [mongomapper](http://mongomapper.com/) is supported soon too.
-
## License
This project uses [*MIT-LICENSE*](http://en.wikipedia.org/wiki/MIT_License).
diff --git a/lib/mongo_coffee.rb b/lib/mongo_coffee.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_coffee.rb
+++ b/lib/mongo_coffee.rb
@@ -15,7 +15,3 @@ if defined? Mongoid
include MongoCoffee::Mongoid::MapReduce
end
end
-
-# TODO: Add finders and MapReduce support for Mongomapper
-if defined? Mongomapper
-end
diff --git a/lib/mongo_coffee/version.rb b/lib/mongo_coffee/version.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_coffee/version.rb
+++ b/lib/mongo_coffee/version.rb
@@ -1,3 +1,3 @@
module MongoCoffee
- VERSION = "0.3.3"
+ VERSION = "1.0.0"
end | No 'mongomapper' support for a long time | gguerrero_mongo_coffee | train | md,rb,rb |
ea759b8e9773d6633122add6270ff6d5658597c7 | diff --git a/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb b/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb
index <HASH>..<HASH> 100644
--- a/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb
+++ b/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb
@@ -21,14 +21,3 @@ test_name '(PUP-3997) Puppet User and Group on agents only' do
end
end
end
-
-# The codedir setting should be passed into the puppetserver
-# initialization method, like is done for other required settings
-# confdir & vardir. For some reason, puppetserver gets confused
-# if this is not done, and tries to manage a directory:
-# /opt/puppetlabs/agent/cache/.puppet/code, which is a combination
-# of the default master-var-dir in puppetserver, and the user
-# based codedir.
-step "(SERVER-347) Set required codedir setting on puppetserver"
-on master, puppet("config set codedir /etc/puppetlabs/code --section master")
- | (maint) Remove codedir workaround
The workaround for pointing the master's codedir to
/etc/puppetlabs/code is no longer required now that commit f<I>efe<I>
in puppet-server[1] has been promoted.
[1] <URL> | puppetlabs_puppet | train | rb |
ef1fac4c01e484d5fa340b1baf11961a9ba6575e | diff --git a/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java b/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
index <HASH>..<HASH> 100644
--- a/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
+++ b/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
@@ -1079,8 +1079,10 @@ public class DefaultBlockMaster extends CoreMaster implements BlockMaster {
}
}
}
- LOG.warn("{} invalid blocks found on worker {} in total", invalidBlockCount,
- workerInfo.getWorkerAddress().getHost());
+ if (invalidBlockCount > 0) {
+ LOG.warn("{} invalid blocks found on worker {} in total", invalidBlockCount,
+ workerInfo.getWorkerAddress().getHost());
+ }
}
/**
@@ -1103,8 +1105,10 @@ public class DefaultBlockMaster extends CoreMaster implements BlockMaster {
workerInfo.updateToRemovedBlock(true, block);
}
}
- LOG.warn("{} blocks marked as orphaned from worker {}", orphanedBlockCount,
- workerInfo.getWorkerAddress().getHost());
+ if (orphanedBlockCount > 0) {
+ LOG.warn("{} blocks marked as orphaned from worker {}", orphanedBlockCount,
+ workerInfo.getWorkerAddress().getHost());
+ }
}
@Override | Log warning on orphaned blocks
Log a warning on unrecognized/orphaned blocks from worker only when the
counts are >0
This is a follow-up for <URL> | Alluxio_alluxio | train | java |
4ee297408f8e472f0f8524fdcd13d29f7071bc39 | diff --git a/api/client.go b/api/client.go
index <HASH>..<HASH> 100644
--- a/api/client.go
+++ b/api/client.go
@@ -8,12 +8,15 @@ import (
"os"
"strings"
"sync"
+ "time"
)
var (
errRedirect = errors.New("redirect")
defaultHTTPClientSetup sync.Once
- defaultHTTPClient = &http.Client{}
+ defaultHTTPClient = &http.Client{
+ Timeout: time.Second * 5,
+ }
)
// Config is used to configure the creation of the client. | added a sensible default timeout for the vault client | hashicorp_vault | train | go |
baa4f7089da865e4184e59fa49ac63d21ffdd413 | diff --git a/bokeh/models/widgets/layouts.py b/bokeh/models/widgets/layouts.py
index <HASH>..<HASH> 100644
--- a/bokeh/models/widgets/layouts.py
+++ b/bokeh/models/widgets/layouts.py
@@ -184,7 +184,8 @@ class SimpleApp(Widget):
def args_for_func(self, func):
args = {}
for k,v in self.widget_dict.items():
- args[k] = v.value
+ if hasattr(v, 'value'):
+ args[k] = v.value
args['app'] = self
args = arg_filter(func, args)
return args | avoid layout breaking when simpleapp is managing a widget that does not have a value attribute, like a Button | bokeh_bokeh | train | py |
28be9566ded376f7b86d98ed5a86029edbc0c5c4 | diff --git a/languagetool-language-modules/en/src/main/java/org/languagetool/language/English.java b/languagetool-language-modules/en/src/main/java/org/languagetool/language/English.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/en/src/main/java/org/languagetool/language/English.java
+++ b/languagetool-language-modules/en/src/main/java/org/languagetool/language/English.java
@@ -374,6 +374,16 @@ public class English extends Language implements AutoCloseable {
theInsertionID, "the_ins_rule_description", theInsertionMessages);
rules.add(theInsertionRule);
}
+ String missingTheID = "MISSING_THE";
+ RemoteRuleConfig missingTheConfig = RemoteRuleConfig.getRelevantConfig(missingTheID, configs);
+ if (missingTheConfig != null) {
+ Map<String, String> missingTheMessages = new HashMap<>();
+ missingTheMessages.put("MISSING_THE", "the_ins_rule_ins_the");
+ Rule missingTheRule = GRPCRule.create(messageBundle,
+ missingTheConfig,
+ missingTheID, "the_ins_rule_description", missingTheMessages);
+ rules.add(missingTheRule);
+ }
return rules;
}
} | activated another GRPCRule (MISSING_THE) | languagetool-org_languagetool | train | java |
f8c671198efed02f04be5f0f6abc2119f5f632a6 | diff --git a/lib/it.rb b/lib/it.rb
index <HASH>..<HASH> 100644
--- a/lib/it.rb
+++ b/lib/it.rb
@@ -14,7 +14,7 @@ module It
# It outside of your views. See documentation at Helper#it
def self.it(identifier, options = {})
options.stringify_keys!
- Parser.new(I18n.t(identifier, :locale => options["locale"]), options).process
+ Parser.new(I18n.t(identifier, :locale => (options["locale"] || I18n.locale)), options).process
end
# Creates a new link to be used in +it+.
diff --git a/lib/it/helper.rb b/lib/it/helper.rb
index <HASH>..<HASH> 100644
--- a/lib/it/helper.rb
+++ b/lib/it/helper.rb
@@ -40,7 +40,7 @@ module It
#
def it(identifier, options = {})
options.stringify_keys!
- It::Parser.new(t(identifier, :locale => options["locale"]), options).process
+ It::Parser.new(t(identifier, :locale => (options["locale"] || I18n.locale)), options).process
end
end
end | Set locale explicitly if not given
Apparently i<I>n-active_record has a different behaviour. | iGEL_it | train | rb,rb |
50829a5c05b218aed75987505951098abf478dc9 | diff --git a/phonenumberutil.go b/phonenumberutil.go
index <HASH>..<HASH> 100644
--- a/phonenumberutil.go
+++ b/phonenumberutil.go
@@ -3063,6 +3063,8 @@ func buildNationalNumberForParsing(
func isNumberMatchWithNumbers(firstNumberIn, secondNumberIn *PhoneNumber) MatchType {
// Make copies of the phone number so that the numbers passed in are not edited.
var firstNumber, secondNumber *PhoneNumber
+ firstNumber = &PhoneNumber{}
+ secondNumber = &PhoneNumber{}
proto.Merge(firstNumber, firstNumberIn)
proto.Merge(secondNumber, secondNumberIn)
// First clear raw_input, country_code_source and | Nil object cannot be proto merged (#<I>) | ttacon_libphonenumber | train | go |
178864a43450399f011d660d6bc176fe0c27ce8c | diff --git a/push_notifications/fields.py b/push_notifications/fields.py
index <HASH>..<HASH> 100644
--- a/push_notifications/fields.py
+++ b/push_notifications/fields.py
@@ -6,9 +6,9 @@ from django.db import models, connection
from django.utils.translation import ugettext_lazy as _
try:
- from django.utils.six import with_metaclass
+ from django.utils import six
except ImportError:
- from six import with_metaclass
+ import six
__all__ = ["HexadecimalField", "HexIntegerField"]
@@ -29,7 +29,7 @@ class HexadecimalField(forms.CharField):
super(HexadecimalField, self).__init__(*args, **kwargs)
-class HexIntegerField(with_metaclass(models.SubfieldBase, models.BigIntegerField)):
+class HexIntegerField(six.with_metaclass(models.SubfieldBase, models.BigIntegerField)):
"""
This field stores a hexadecimal *string* of up to 64 bits as an unsigned integer
on *all* backends including postgres.
@@ -60,7 +60,7 @@ class HexIntegerField(with_metaclass(models.SubfieldBase, models.BigIntegerField
return value
def to_python(self, value):
- if isinstance(value, str):
+ if isinstance(value, six.string_types):
return value
if value is None:
return "" | HexIntegerField: Fix a deserialization issue on Python 2
Thanks @Microserf for noticing | jazzband_django-push-notifications | train | py |
676a38041285cfba83bae0827b11090faeae18b3 | diff --git a/lib/octokit/client/issues.rb b/lib/octokit/client/issues.rb
index <HASH>..<HASH> 100644
--- a/lib/octokit/client/issues.rb
+++ b/lib/octokit/client/issues.rb
@@ -28,7 +28,8 @@ module Octokit
# @client = Octokit::Client.new(:login => 'foo', :password => 'bar')
# @client.list_issues
def list_issues(repository = nil, options = {})
- paginate "#{Repository.new(repository).path}/issues", options
+ path = repository ? "#{Repository.new(repository).path}/issues" : "issues"
+ paginate path, options
end
alias :issues :list_issues | Correctly generate issues path
Previously `Repository.new(nil)` would return `nil` so our path would
be `/issues`. It now correctly raises an error so if a repository
isn't specified then we want the issues for the user so the path
should be `issues`. | octokit_octokit.rb | train | rb |
a43c2ae60809c72e1902622da1bcb5cfb772c988 | diff --git a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java
index <HASH>..<HASH> 100644
--- a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java
+++ b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraRhoListener.java
@@ -4,6 +4,8 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
+import java.sql.Date;
+import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map; | EMBPD<I> - added missing imports
added missing imports | rhomobile_rhodes | train | java |
e459b29fb4117dac66be241e1ddb9fa9ce67594c | diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -44,7 +44,7 @@ module ActionController
def assign_parameters(routes, controller_path, action, parameters = {})
parameters = parameters.symbolize_keys
- extra_keys = routes.extra_keys(parameters.merge(:controller => controller_path, :action => action))
+ generated_path, extra_keys = routes.generate_extras(parameters.merge(:controller => controller_path, :action => action))
non_path_parameters = {}
path_parameters = {}
@@ -97,6 +97,7 @@ module ActionController
@env['rack.input'] = StringIO.new(data)
end
+ @env["PATH_INFO"] ||= generated_path
path_parameters[:controller] = controller_path
path_parameters[:action] = action | default `PATH_INFO` to the generated path
we were already generating a path in the previous code (it was just not
returned), so lets just use the already computed path to popluate the
PATH_INFO header | rails_rails | train | rb |
9a4ff739e8805e182f262c1bf7dc80b5469911e7 | diff --git a/hamster/db.py b/hamster/db.py
index <HASH>..<HASH> 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -78,16 +78,9 @@ class Storage(storage.Storage):
self.__setup.im_func.complete = True
self.run_fixtures()
- self.config = GconfStore()
-
- runtime.dispatcher.add_handler('gconf_on_day_start_changed', self.__on_day_start_changed)
- self.day_start = self.config.get_day_start()
__setup.complete = False
-
- def __on_day_start_changed(self, event, new_minutes):
- self.day_start = self.config.get_day_start()
def __get_category_list(self):
return self.fetchall("SELECT * FROM categories ORDER BY category_order")
@@ -474,8 +467,10 @@ class Storage(storage.Storage):
query += " ORDER BY a.start_time"
end_date = end_date or date
- #FIXME: add preference to set that
- split_time = self.day_start
+ from configuration import GconfStore
+ day_start = GconfStore().get_day_start()
+
+ split_time = day_start
datetime_from = dt.datetime.combine(date, split_time)
datetime_to = dt.datetime.combine(end_date, split_time) + dt.timedelta(days = 1) | don't need the whole config machinery just to get day start | projecthamster_hamster | train | py |
202dac8dcd45e306d9ff30ac2cf721583fe21913 | diff --git a/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgreSQL.java b/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgreSQL.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgreSQL.java
+++ b/src/main/java/com/opentable/db/postgres/embedded/EmbeddedPostgreSQL.java
@@ -414,7 +414,9 @@ public class EmbeddedPostgreSQL implements Closeable
private static List<String> system(String... command)
{
try {
- final Process process = new ProcessBuilder(command).start();
+ final ProcessBuilder builder = new ProcessBuilder(command);
+ builder.redirectError(ProcessBuilder.Redirect.INHERIT);
+ final Process process = builder.start();
Preconditions.checkState(0 == process.waitFor(), "Process %s failed\n%s", Arrays.asList(command), IOUtils.toString(process.getErrorStream()));
try (InputStream stream = process.getInputStream()) {
return IOUtils.readLines(stream); | Fix bug seen in teamcity builds: bind stderr to the parent process's stderr | opentable_otj-pg-embedded | train | java |
4075f330e283368f572f18275a61409d4806f6b2 | diff --git a/providers/json-rpc-provider.js b/providers/json-rpc-provider.js
index <HASH>..<HASH> 100644
--- a/providers/json-rpc-provider.js
+++ b/providers/json-rpc-provider.js
@@ -2,15 +2,13 @@
// See: https://github.com/ethereum/wiki/wiki/JSON-RPC
-var inherits = require('inherits');
-
var Provider = require('./provider.js');
var utils = (function() {
return {
- defineProperty: require('ethers-utils/properties.js').defineProperty,
+ defineProperty: require('ethers-utils/properties').defineProperty,
- hexlify: require('ethers-utils/convert.js').hexlify,
+ hexlify: require('ethers-utils/convert').hexlify,
}
})(); | Using Provider.inherits. | ethers-io_ethers.js | train | js |
3f2177670c758734e1ffbd43c1dfdbcc18c8e108 | diff --git a/structr-ui/src/main/resources/structr/js/model.js b/structr-ui/src/main/resources/structr/js/model.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/model.js
+++ b/structr-ui/src/main/resources/structr/js/model.js
@@ -18,7 +18,7 @@
*/
var StructrModel = {
objects: {},
- callbacks: [],
+ callbacks: {},
obj: function(id) {
return StructrModel.objects[id];
},
@@ -223,15 +223,15 @@ var StructrModel = {
}
if (engine) {
-
+
if (engine.graph.nodes(id)) {
try { engine.graph.dropNode(id); } catch (e) {}
}
-
+
if (engine.graph.edges(id)) {
try { engine.graph.dropEdge(id); } catch (e) {}
}
-
+
engine.refresh();
} | changed callbacks variable initialization to `{}` as otherwise accessing it via console is tedious | structr_structr | train | js |
7622d838b84cd4a38e8af234ed8a4538498dd4f2 | diff --git a/packages/ui-scripts/lib/publish-latest.js b/packages/ui-scripts/lib/publish-latest.js
index <HASH>..<HASH> 100644
--- a/packages/ui-scripts/lib/publish-latest.js
+++ b/packages/ui-scripts/lib/publish-latest.js
@@ -41,7 +41,7 @@ const { createNPMRCFile } = require('./utils/npm')
try {
const pkgJSON = getPackageJSON()
// Arguments
- // 1: version to publish. If current version, use 'current' otherwise e.g.: 8.1.3
+ // 1: version to publish. If current version, use 'current' or don't bass anything. Otherwise e.g.: 8.1.3
// 2: publish type. defaults to current. If set to 'maintenance', it will publish with vx_maintenance tag
// e.g.: ui-scripts --publish-latest 5.12.2 maintenance
const releaseVersion = | chore(ui-scripts): fix comments | instructure_instructure-ui | train | js |
7143acb8d019e60cc01c73295047aaaab4a14e4a | diff --git a/library/src/main/java/com/alexvasilkov/gestures/transition/internal/FromRecyclerViewListener.java b/library/src/main/java/com/alexvasilkov/gestures/transition/internal/FromRecyclerViewListener.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/alexvasilkov/gestures/transition/internal/FromRecyclerViewListener.java
+++ b/library/src/main/java/com/alexvasilkov/gestures/transition/internal/FromRecyclerViewListener.java
@@ -70,7 +70,7 @@ public class FromRecyclerViewListener<ID> implements ViewsCoordinator.OnRequestV
int position = mRecyclerView.getChildAdapterPosition(view);
if (mId != null && mId.equals(mTracker.getIdForPosition(position))) {
View from = mTracker.getViewForPosition(position);
- if (from != null) mAnimator.setFromView(mId, view);
+ if (from != null) mAnimator.setFromView(mId, from);
}
} | Fixed FromRecyclerViewListener logic, one more time | alexvasilkov_GestureViews | train | java |
05ac9fa68f6e26a6d963b8987793ba8c11ff0c95 | diff --git a/lib/polipus.rb b/lib/polipus.rb
index <HASH>..<HASH> 100644
--- a/lib/polipus.rb
+++ b/lib/polipus.rb
@@ -121,7 +121,7 @@ module Polipus
@storage.include_query_string_in_uuid = @options[:include_query_string_in_saved_page]
- @urls = [urls].flatten.map{ |url| url.is_a?(URI) ? url : URI(url) }
+ @urls = [urls].flatten.map{ |url| URI(url) }
@urls.each{ |url| url.path = '/' if url.path.empty? }
execute_plugin 'on_initialize' | Remove unnecessary check if it is an URI
Kernel.URI is doing this by itself | taganaka_polipus | train | rb |
4bb1c53276b7f16a4a6cb8e22fd9daa72f4ba2a1 | diff --git a/test/cursor_test.js b/test/cursor_test.js
index <HASH>..<HASH> 100644
--- a/test/cursor_test.js
+++ b/test/cursor_test.js
@@ -945,27 +945,6 @@ var tests = testCase({
});
});
});
- },
-
- shouldHandleThrowingNextObjectCallback : function(test) {
- client.createCollection('test_throwing_in_nextObject_callback', function(err, collection) {
- collection.insert({'x':1}, {safe:true}, function(err, doc) {
- test.equal(err, null);
- collection.find(function(err, cursor) {
- test.equal(err, null);
-
- var times = 0;
- cursor.nextObject(function(err, doc) {
- ++times;
- test.equal(times, 1);
- if (times > 1) return test.done();
- //test.equal(err, null);
- //test.equal(1, doc.x);
- throw new Error("KaBoom!");
- });
- });
- });
- });
}
}) | remove double callback test
now that the test passes, its throwing (which is what
we want) but theres no way to catch it anymore for
nice tests - or maybe there is, i just haven't figured
it out. | mongodb_node-mongodb-native | train | js |
2a8b0ba1b291813c760bc8ace5af5707fbd371c9 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -63,8 +63,8 @@ module.exports = function (grunt) {
'}\n',
jqueryVersionCheck: '+function ($) {\n' +
' var version = $.fn.jquery.split(\' \')[0].split(\'.\')\n' +
- ' if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {\n' +
- ' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery version 1.9.1 or higher\')\n' +
+ ' if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 3)) {\n' +
+ ' throw new Error(\'Bootstrap\\\'s JavaScript requires at least jQuery v1.9.1 but less than v3.0.0\')\n' +
' }\n' +
'}(jQuery);\n\n', | Check for jQuery >= 3.
Reword jQuery version mismatch error message since jQuery v3 isn't supported. | twbs_bootstrap | train | js |
a4852520d2e4008a9708f5f8adfa4bc37fb0ceba | diff --git a/test/unit/RouterTest.php b/test/unit/RouterTest.php
index <HASH>..<HASH> 100644
--- a/test/unit/RouterTest.php
+++ b/test/unit/RouterTest.php
@@ -3,11 +3,26 @@
namespace SwoftTest\Console\Unit;
use PHPUnit\Framework\TestCase;
+use function bean;
+use ReflectionException;
+use Swoft\Bean\Exception\ContainerException;
/**
* Class RouterTest
*/
class RouterTest extends TestCase
{
+ /**
+ * @throws ReflectionException
+ * @throws ContainerException
+ */
+ public function testBasic(): void
+ {
+ $router = bean('cliRouter');
+ $this->assertTrue($router->count() > 0);
+ $router->setIdAliases(['run' => 'serve:run']);
+ $this->assertNotEmpty($list = $router->getIdAliases());
+ $this->assertSame('serve:run', $list['run']);
+ }
} | update some logic for tcp proto | swoft-cloud_swoft-console | train | php |
20144400a86b395438bc3d9015690985dc955e52 | diff --git a/test/index-spec.js b/test/index-spec.js
index <HASH>..<HASH> 100644
--- a/test/index-spec.js
+++ b/test/index-spec.js
@@ -56,7 +56,7 @@ describe('Base', function() {
describe('Fire', function() {
it('Should return the request body on success.', function(done) {
- hookcord.Fire("", {link: fullLink}, {conbtent: 'unit test'})
+ hookcord.Fire("", {link: fullLink}, {content: 'unit test'})
.then(
function(x) {
if (x) { | Stupid Unit Test Error Fix | maxrumsey_hookcord | train | js |
c222b221327a1d52338d4f34656f3b8dacfd10ad | diff --git a/plugin/common/init.go b/plugin/common/init.go
index <HASH>..<HASH> 100644
--- a/plugin/common/init.go
+++ b/plugin/common/init.go
@@ -137,6 +137,7 @@ func (p *HashicorpPlugin) Call(funcName string, args ...interface{}) (interface{
func (p *HashicorpPlugin) Quit() error {
// kill hashicorp plugin process
+ log.Warn().Msg("quit hashicorp plugin process")
pluginHost.Quit()
return nil
}
diff --git a/runner.go b/runner.go
index <HASH>..<HASH> 100644
--- a/runner.go
+++ b/runner.go
@@ -9,8 +9,11 @@ import (
"net/http"
"net/http/httputil"
"net/url"
+ "os"
+ "os/signal"
"strconv"
"strings"
+ "syscall"
"testing"
"time"
@@ -213,6 +216,18 @@ func initPlugin(path string) (plugin common.Plugin, err error) {
go ga.SendEvent(event)
}()
plugin, err = common.Init(path)
+
+ // catch Interrupt and SIGTERM signals to ensure plugin quitted
+ c := make(chan os.Signal)
+ signal.Notify(c, os.Interrupt, syscall.SIGTERM)
+ go func() {
+ <-c
+ if plugin != nil {
+ plugin.Quit()
+ }
+ os.Exit(1)
+ }()
+
return
} | feat: catch Interrupt and SIGTERM signals to ensure plugin quitted | HttpRunner_HttpRunner | train | go,go |
370213d686473d6d52233b4b89c42d1ef87174b8 | diff --git a/knights/parse.py b/knights/parse.py
index <HASH>..<HASH> 100644
--- a/knights/parse.py
+++ b/knights/parse.py
@@ -2,7 +2,7 @@
import ast
from importlib import import_module
-from .lexer import tokenise, Token
+from .lexer import tokenise, TokenType
class Node(object):
@@ -91,17 +91,17 @@ class Parser:
return list(self.parse_node())
def parse_node(self):
- for mode, token in self.stream:
- if mode == Token.load:
- self.load_library(token)
+ for token in self.stream:
+ if token.mode == TokenType.load:
+ self.load_library(token.token)
continue
- elif mode == Token.text:
- node = TextNode(self, token)
- elif mode == Token.var:
- node = VarNode(self, token)
- elif mode == Token.block:
+ elif token.mode == TokenType.text:
+ node = TextNode(self, token.token)
+ elif token.mode == TokenType.var:
+ node = VarNode(self, token.token)
+ elif token.mode == TokenType.block:
# magicks go here
- bits = [x.strip() for x in token.strip().split(' ', 1)]
+ bits = [x.strip() for x in token.token.strip().split(' ', 1)]
tag_name = bits.pop(0)
func = self.tags[tag_name]
node = func(self, *bits) | Fix patch for Token class changeover | funkybob_knights-templater | train | py |
16c51b71ef37ce047bd4875e32ddcba7f9e6298f | diff --git a/tests/activeExpressionTests.js b/tests/activeExpressionTests.js
index <HASH>..<HASH> 100644
--- a/tests/activeExpressionTests.js
+++ b/tests/activeExpressionTests.js
@@ -106,7 +106,7 @@ describe('Active Expressions', function() {
assert(obj.a + obj.b == 3, "Solver failed: " + obj.a + ", " + obj.b)
});
- it("should run a basic aexpr", () => {
+ it("runs a basic aexpr", () => {
var obj = {a: 2, b: 3};
let spy = sinon.spy();
@@ -119,7 +119,7 @@ describe('Active Expressions', function() {
expect(spy.calledOnce).to.be.true;
});
- it("should allow to uninstall an aexpr", () => {
+ it("uninstalls an aexpr (and reinstalls it afterwards)", () => {
var obj = {a: 2, b: 3};
let spy = sinon.spy();
@@ -132,5 +132,11 @@ describe('Active Expressions', function() {
obj.a = 42;
expect(spy.called).to.be.false;
+
+ expr.installListeners();
+
+ obj.a = 3;
+
+ expect(spy.calledOnce).to.be.true;
});
}); | added test for reinstalling an aexpr | active-expressions_active-expressions | train | js |
b5b56734148c8b54a9d711212111e75a32b43441 | diff --git a/lib/connection.js b/lib/connection.js
index <HASH>..<HASH> 100644
--- a/lib/connection.js
+++ b/lib/connection.js
@@ -24,15 +24,16 @@ module.exports = (function () {
this.config = _.extend(config, defaults);
},
ensureDB = function (database) {
+ var dbProps = (typeof database === 'object') ? database : { name: database };
var deferred = Q.defer();
server.list().then(function (dbs) {
var dbExists = _.find(dbs, function (db) {
- return db.name === database.name;
+ return db.name === dbProps.name;
});
if (dbExists) {
- deferred.resolve(server.use(database));
+ deferred.resolve(server.use(dbProps));
} else {
- server.create(database).then(function (db) {
+ server.create(dbProps).then(function (db) {
deferred.resolve(db);
});
} | Changed the connection config to be more like waterline where "database" is not an object but it contains the name of the database. This change is backwards compatible with previous configurations.
Example: <URL> | appscot_sails-orientdb | train | js |
ae68813fbfc2ebd21b3e90af111c519a68185511 | diff --git a/SoftLayer/CLI/core.py b/SoftLayer/CLI/core.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/CLI/core.py
+++ b/SoftLayer/CLI/core.py
@@ -141,7 +141,6 @@ def cli(env,
else:
# Create SL Client
client = SoftLayer.create_client_from_env(
- transport=SoftLayer.RestTransport(),
proxy=proxy,
config_file=config,
) | Set default transport for CLI back to XMLRPC | softlayer_softlayer-python | train | py |
de9c82edcd1c106fd6903e86efa63a4284a0c06e | diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/View/Helper/FormHelperTest.php
+++ b/tests/TestCase/View/Helper/FormHelperTest.php
@@ -5172,7 +5172,7 @@ class FormHelperTest extends TestCase
{
extract($this->dateRegex);
- $result = $this->Form->day('Model.field', array('value' => false));
+ $result = $this->Form->day('Model.field', array('value' => ''));
$expected = array(
array('select' => array('name' => 'Model[field][day]')),
array('option' => array('selected' => 'selected', 'value' => '')), | Fix failing test.
false => current day now. '' maps to ''. | cakephp_cakephp | train | php |
9dc70bbfe30cca857eb2d90a4d2c9e0fe0ff7969 | diff --git a/core/unit_tests/streaming/test_transfer.py b/core/unit_tests/streaming/test_transfer.py
index <HASH>..<HASH> 100644
--- a/core/unit_tests/streaming/test_transfer.py
+++ b/core/unit_tests/streaming/test_transfer.py
@@ -1952,5 +1952,6 @@ def _tempdir_maker():
return _tempdir_mgr
+
_tempdir = _tempdir_maker()
del _tempdir_maker
diff --git a/docs/bigquery_snippets.py b/docs/bigquery_snippets.py
index <HASH>..<HASH> 100644
--- a/docs/bigquery_snippets.py
+++ b/docs/bigquery_snippets.py
@@ -591,5 +591,6 @@ def main():
for item in to_delete:
item.delete()
+
if __name__ == '__main__':
main()
diff --git a/docs/pubsub_snippets.py b/docs/pubsub_snippets.py
index <HASH>..<HASH> 100644
--- a/docs/pubsub_snippets.py
+++ b/docs/pubsub_snippets.py
@@ -456,5 +456,6 @@ def main():
for item in to_delete:
item.delete()
+
if __name__ == '__main__':
main() | Lint fixes needed for the latest (<I>) pycodestyle. | googleapis_google-cloud-python | train | py,py,py |
f0d8757c36ff18cb3a13a14571950fc66884475f | diff --git a/benchbuild/utils/log.py b/benchbuild/utils/log.py
index <HASH>..<HASH> 100644
--- a/benchbuild/utils/log.py
+++ b/benchbuild/utils/log.py
@@ -17,7 +17,8 @@ def configure_plumbum_log():
if settings.CFG["debug"]:
plumbum_local.setLevel(logging.DEBUG)
plumbum_local.addHandler(plumbum_hdl)
- plumbum_local.propagate = False
+ plumbum_format = logging.Formatter('$> %(message)s')
+ plumbum_hdl.setFormatter(plumbum_format)
def configure_parse_log(): | utils/log: random logging format change | PolyJIT_benchbuild | train | py |
1da587b55ee258ec5cd18bab5b02077bf08f8385 | diff --git a/spec/functional/resource/msu_package_spec.rb b/spec/functional/resource/msu_package_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/functional/resource/msu_package_spec.rb
+++ b/spec/functional/resource/msu_package_spec.rb
@@ -19,7 +19,7 @@
require "spec_helper"
require "chef/provider/package/cab"
-describe Chef::Resource::MsuPackage, :win2012r2_only do
+describe Chef::Resource::MsuPackage, :win2012r2_only, :appveyor_only do
let(:package_name) { "Package_for_KB2959977" }
let(:package_source) { "https://download.microsoft.com/download/3/B/3/3B320C07-B7B1-41E5-81F4-79EBC02DF7D3/Windows8.1-KB2959977-x64.msu" } | Only run msu_package functional tests on Appveyor
Choosing an MSU that works on a system but shouldn't be installed is hard / impossible.
These tests work on appveyor but break the build in Jenkins. For now, let them just run on
appveyor. | chef_chef | train | rb |
46dcb711e9c26193bc5f49bb28fc4215017112b9 | diff --git a/externs/w3c_indexeddb.js b/externs/w3c_indexeddb.js
index <HASH>..<HASH> 100644
--- a/externs/w3c_indexeddb.js
+++ b/externs/w3c_indexeddb.js
@@ -34,6 +34,9 @@ Window.prototype.mozIndexedDB;
Window.prototype.webkitIndexedDB;
/** @type {IDBFactory} */
+Window.prototype.msIndexedDB;
+
+/** @type {IDBFactory} */
Window.prototype.indexedDB;
/**
@@ -232,10 +235,21 @@ Window.prototype.webkitIDBRequest;
/**
* @constructor
+ * @implements {EventTarget}
* @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
*/
function IDBRequest() {}
+/** @override */
+IDBRequest.prototype.addEventListener = function(type, listener, useCapture) {};
+
+/** @override */
+IDBRequest.prototype.removeEventListener =
+ function(type, listener, useCapture) {};
+
+/** @override */
+IDBRequest.prototype.dispatchEvent = function(evt) {};
+
/**
* @constructor
* @extends {IDBRequest} | Have IDBRequest implement EventTarget.
Add msIndexedDB as another alias.
R=nicksantos
DELTA=<I> (<I> added, 0 deleted, 0 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-compiler | train | js |
b7d0803afd9335862accfc79dee047a6b0e67ad6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@ with open('README.rst', 'r') as fh:
setup(
name='localshop',
- version='0.5.0',
+ version='0.6.0-dev',
author='Michael van Tellingen',
author_email='michaelvantellingen@gmail.com',
url='http://github.com/mvantellingen/localshop', | Bump to <I>-dev | mvantellingen_localshop | train | py |
05d4692e9fddefba46fe8ab275afe86574904233 | diff --git a/commands/command_track.go b/commands/command_track.go
index <HASH>..<HASH> 100644
--- a/commands/command_track.go
+++ b/commands/command_track.go
@@ -49,6 +49,7 @@ func trackCommand(cmd *cobra.Command, args []string) {
for _, k := range knownPaths {
if t == k.Path {
isKnownPath = true
+ break
}
} | Breaking when a known path was found, no need to continue the iteration | git-lfs_git-lfs | train | go |
a05143cf23f1d5a482834eae04dd2192293c7547 | diff --git a/ceph_deploy/tests/test_cli_new.py b/ceph_deploy/tests/test_cli_new.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/tests/test_cli_new.py
+++ b/ceph_deploy/tests/test_cli_new.py
@@ -2,6 +2,7 @@ import re
import subprocess
import uuid
+import pytest
from mock import patch
from ceph_deploy import conf
@@ -20,6 +21,18 @@ def test_help(tmpdir, cli):
assert 'optional arguments' in result
+def test_bad_no_mon(tmpdir, cli):
+ with pytest.raises(cli.Failed) as err:
+ with cli(
+ args=['ceph-deploy', 'new'],
+ stderr=subprocess.PIPE,
+ ) as p:
+ result = p.stderr.read()
+ assert 'usage: ceph-deploy new' in result
+ assert 'too few arguments' in result
+ assert err.value.status == 2
+
+
def test_write_global_conf_section(tmpdir, cli):
fake_ip_addresses = lambda x: ['10.0.0.1'] | [RM-<I>] Add test for missing host(s) to 'new' cmd | ceph_ceph-deploy | train | py |
a866c9c7f0e727a63d4ec3cb44c03bf18e51fd63 | diff --git a/src/pyvesync/vesyncfan.py b/src/pyvesync/vesyncfan.py
index <HASH>..<HASH> 100644
--- a/src/pyvesync/vesyncfan.py
+++ b/src/pyvesync/vesyncfan.py
@@ -14,7 +14,7 @@ class VeSyncAir131(VeSyncBaseDevice):
body = helpers.req_body(self.manager, 'devicedetail')
head = helpers.req_headers(self.manager)
- r, _ = helpers.call_api('/131airpurifier/v1/device/deviceDetail',
+ r, _ = helpers.call_api('/131airPurifier/v1/device/deviceDetail',
method='post', headers=head, json=body)
if r is not None and helpers.check_response(r, 'airpur_detail'): | Fix typo in get_details in air purifier object | markperdue_pyvesync | train | py |
25d3c73162043b3bce4a0e993b6d502fc4a4fd95 | diff --git a/cmd/healthcheck-router.go b/cmd/healthcheck-router.go
index <HASH>..<HASH> 100644
--- a/cmd/healthcheck-router.go
+++ b/cmd/healthcheck-router.go
@@ -40,7 +40,9 @@ func registerHealthCheckRouter(router *mux.Router) {
// Cluster check handler to verify cluster is active
healthRouter.Methods(http.MethodGet).Path(healthCheckClusterPath).HandlerFunc(httpTraceAll(ClusterCheckHandler))
+ healthRouter.Methods(http.MethodHead).Path(healthCheckClusterPath).HandlerFunc(httpTraceAll(ClusterCheckHandler))
healthRouter.Methods(http.MethodGet).Path(healthCheckClusterReadPath).HandlerFunc(httpTraceAll(ClusterReadCheckHandler))
+ healthRouter.Methods(http.MethodHead).Path(healthCheckClusterReadPath).HandlerFunc(httpTraceAll(ClusterReadCheckHandler))
// Liveness handler
healthRouter.Methods(http.MethodGet).Path(healthCheckLivenessPath).HandlerFunc(httpTraceAll(LivenessCheckHandler)) | add HEAD for cluster healthcheck (#<I>)
fixes #<I> | minio_minio | train | go |
ee0c913aa2915d7dc495547cbca0f0e3e4a7d363 | diff --git a/lib/outputimage.py b/lib/outputimage.py
index <HASH>..<HASH> 100644
--- a/lib/outputimage.py
+++ b/lib/outputimage.py
@@ -232,8 +232,18 @@ class OutputImage:
scihdr.update('NCOMBINE', self.parlist[0]['nimages'])
# If BUNIT keyword was found and reset, then
+
if self.bunit is not None:
- scihdr.update('BUNIT',self.bunit,comment="Units of science product")
+ comment_str = "Units of science product"
+ if self.bunit.lower()[:5] == 'count':
+ comment_str = "counts * gain = electrons"
+ scihdr.update('BUNIT',self.bunit,comment=comment_str)
+ else:
+ # check to see whether to update already present BUNIT comment
+ if scihdr.has_key('bunit') and scihdr['bunit'].lower()[:5]== 'count':
+ comment_str = "counts * gain = electrons"
+ scihdr.update('BUNIT',scihdr['bunit'],comment=comment_str)
+
if self.wcs:
# Update WCS Keywords based on PyDrizzle product's value | Comment for BUNIT keyword was revised to define 'counts * gain = electrons' when BUNIT is in units of counts or counts/s. WJH
git-svn-id: <URL> | spacetelescope_drizzlepac | train | py |
0fd9f5e483aeb16fed1b15ffb1d3b8016e847361 | diff --git a/st_reg/consistency.py b/st_reg/consistency.py
index <HASH>..<HASH> 100644
--- a/st_reg/consistency.py
+++ b/st_reg/consistency.py
@@ -1,14 +1,7 @@
# -*- coding: utf-8 -*-
"""Module de validation the states number"""
-import sys
-
-if sys.version >= '3':
- import .states.ac as ac
-else:
- import states.ac as ac
-
-
+import states.ac as ac
import states.al as al
import states.am as am
import states.ap as ap
@@ -36,7 +29,6 @@ import states.sp as sp
import states.se as se
import states.to as to
-
def check(st_reg_number, state_index):
"""
This function is like a Facade to another modules that | Back to regular python 2 imports | matheuscas_pyIE | train | py |
fed145107f54a94a44214fa8ab6d57c729f7dc7e | diff --git a/lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb b/lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb
+++ b/lib/generators/surveyor/templates/db/migrate/create_survey_translations.rb
@@ -14,6 +14,6 @@ class CreateSurveyTranslations < ActiveRecord::Migration
end
def self.down
- drop_table :surveys
+ drop_table :survey_translations
end
end | Ref. <I> - Fixes migration. | NUBIC_surveyor | train | rb |
75e638f95baaf7b7d4a3f1188f5c0082b67bad36 | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -3868,8 +3868,8 @@ func (s *Server) applyDropContinuousQueryCommand(m *messaging.Message) error {
// RunContinuousQueries will run any continuous queries that are due to run and write the
// results back into the database
func (s *Server) RunContinuousQueries() error {
- s.mu.Lock()
- defer s.mu.Unlock()
+ s.mu.RLock()
+ defer s.mu.RUnlock()
for _, d := range s.databases {
for _, c := range d.continuousQueries { | Use a read lock for running continuous queries | influxdata_influxdb | train | go |
bb3edba5b70a497cc60fabf9545ff179a4f99157 | diff --git a/bugsnag.go b/bugsnag.go
index <HASH>..<HASH> 100644
--- a/bugsnag.go
+++ b/bugsnag.go
@@ -186,6 +186,7 @@ func startSessionTracking() {
})
if sessionTracker != nil {
Config.logf(configuredMultipleTimes)
+ } else {
+ sessionTracker = sessions.NewSessionTracker(&sessionTrackingConfig)
}
- sessionTracker = sessions.NewSessionTracker(&sessionTrackingConfig)
} | [fix] Don't make new session tracker if it exists | bugsnag_bugsnag-go | train | go |
8c3c5f646089eb70d7c9c9198715ee3c6ee40887 | diff --git a/lib/cli/cli.js b/lib/cli/cli.js
index <HASH>..<HASH> 100644
--- a/lib/cli/cli.js
+++ b/lib/cli/cli.js
@@ -450,6 +450,13 @@ module.exports.parseCommandLine = function parseCommandLine() {
'e.g. "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"',
group: 'Chrome'
})
+ .option('browsertime.chrome.chromedriverPath', {
+ alias: 'chrome.chromedriverPath',
+ describe:
+ "Path to custom Chromedriver binary. Make sure to use a Chromedriver version that's compatible with " +
+ "the version of Chrome you're using",
+ group: 'Chrome'
+ })
.option('browsertime.chrome.cdp.performance', {
alias: 'chrome.cdp.performance',
type: 'boolean', | cli: set which chromedriver to use | sitespeedio_sitespeed.io | train | js |
51f477a88ce3eede0f0a65b1f058f634056a9c58 | diff --git a/code/DMSDocument.php b/code/DMSDocument.php
index <HASH>..<HASH> 100644
--- a/code/DMSDocument.php
+++ b/code/DMSDocument.php
@@ -2,8 +2,10 @@
class DMSDocument extends DataObject implements DMSDocumentInterface {
static $db = array(
- "Filename" => "Text",
- "Folder" => "Text"
+ "Filename" => "Varchar(255)",
+ "Folder" => "Varchar(255)",
+ "Title" => 'Varchar(1024)',
+ "Description" => 'Text',
);
static $many_many = array(
@@ -46,6 +48,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
$this->Pages()->removeAll();
}
+
/**
* Adds a metadata tag to the Document. The tag has a category and a value.
* Each category can have multiple values by default. So: addTag("fruit","banana") addTag("fruit", "apple") will add two items.
diff --git a/code/ea-specific/DocumentType.php b/code/ea-specific/DocumentType.php
index <HASH>..<HASH> 100644
--- a/code/ea-specific/DocumentType.php
+++ b/code/ea-specific/DocumentType.php
@@ -0,0 +1,11 @@
+<?php
+
+class DocumentType extends DataObject {
+ static $db = array(
+ 'Name' => 'Varchar(255)'
+ );
+
+ static $has_many = array(
+ 'Documents' => 'EADocument'
+ );
+} | ENHANCEMENT: adding document type one to many relation to specific EA extension of the DMS | silverstripe_silverstripe-dms | train | php,php |
b3ef5edf7c169a03048dfed6276b5942d2649947 | diff --git a/spec/node/tag-spec.js b/spec/node/tag-spec.js
index <HASH>..<HASH> 100644
--- a/spec/node/tag-spec.js
+++ b/spec/node/tag-spec.js
@@ -424,6 +424,14 @@ describe("Tag", function() {
});
+ it("ignores null elements", function() {
+
+ var br = h({ tagName: "div" }, ["child1", null, "child2"]);
+ var html = br.toHtml();
+ expect(html).toBe("<div>child1child2</div>");
+
+ });
+
});
});
\ No newline at end of file
diff --git a/src/node/tag.js b/src/node/tag.js
index <HASH>..<HASH> 100644
--- a/src/node/tag.js
+++ b/src/node/tag.js
@@ -268,7 +268,9 @@ Tag.prototype.toHtml = function() {
html += this.props.innerHTML;
} else {
for (var i = 0; i < len ; i++) {
- html += children[i].toHtml();
+ if (children[i]) {
+ html += children[i].toHtml();
+ }
}
}
html += voidElements[this.tagName] ? "" : "</" + this.tagName + ">"; | Ignores null children for HTML rendering. | crysalead-js_dom-layer | train | js,js |
d31c98af2ed943dec1aacfdf67782c18605e30d5 | diff --git a/src/pt-BR/validation.php b/src/pt-BR/validation.php
index <HASH>..<HASH> 100644
--- a/src/pt-BR/validation.php
+++ b/src/pt-BR/validation.php
@@ -34,7 +34,7 @@ return [
'different' => 'Os campos :attribute e :other deverão conter valores diferentes.',
'digits' => 'O campo :attribute deverá conter :digits dígitos.',
'digits_between' => 'O campo :attribute deverá conter entre :min a :max dígitos.',
- 'dimensions' => 'The :attribute has invalid image dimensions.',
+ 'dimensions' => 'O valor indicado para o campo :attribute não é uma dimensão de imagem válida.',
'distinct' => 'O campo :attribute contém um valor duplicado.',
'email' => 'O campo :attribute não contém um endereço de email válido.',
'exists' => 'O valor selecionado para o campo :attribute é inválido.', | Dimension value for pt-BR
Translation for the dimension value missing in the pt-BR translation | caouecs_Laravel-lang | train | php |
397ff8b4105f72ed27282704a4ed847675c4bf0d | diff --git a/lib/magic_grid/html_grid.rb b/lib/magic_grid/html_grid.rb
index <HASH>..<HASH> 100644
--- a/lib/magic_grid/html_grid.rb
+++ b/lib/magic_grid/html_grid.rb
@@ -92,8 +92,6 @@ module MagicGrid
class: 'full-width ui-widget-header',
colspan: @grid.columns.count)
end
- else
- ''.html_safe
end
end | nil is html_safe | rmg_magic_grid | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.