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 |
|---|---|---|---|---|---|
7d766114c4b5ccaa8213fb3cb7d794445a61adb1 | diff --git a/main.js b/main.js
index <HASH>..<HASH> 100644
--- a/main.js
+++ b/main.js
@@ -27,7 +27,7 @@ Hsm = module.exports = function Hsm(server){
};
function onRequest(req,res){
- var i,href,event,u,en,pn,path,e,h;
+ var i,href,event,u,en,path,e,h;
h = this[hsm];
e = h[emitter];
@@ -44,18 +44,15 @@ function onRequest(req,res){
url: u
};
- en = req.method + ' ' + (pn = u.pathname);
+ en = req.method + ' ' + u.pathname;
if(h.listeners(en)) return e.give(en,event);
- if(h.listeners(pn)) return e.give(pn,event);
path = u.pathname.split('/');
path.pop();
while(path.length){
- en = (req.method + ' ' + (pn = path.join('/'))).trim();
+ en = path.join('/');
if(h.listeners(en)) return e.give(en,event);
- if(h.listeners(pn)) return e.give(pn,event);
-
path.pop();
} | Now individual urls and paths are treated in a different way | manvalls_hsm | train | js |
6926d313a39d3e72d1f3df94b7cedd2bf56addae | diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js b/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js
+++ b/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js
@@ -282,7 +282,8 @@ define([
match: "\\b(?:" + keywords.JSKeywords.join("|") + ")\\b",
name: "KEYWORD"
}, {
- match: "'.*?(?:'|$)",
+ id: "string_singleQuote",
+ match: "'(?:\\\\.|[^'])*(?:'|$)",
name: "STRING"
}, {
begin: "'[^'\\n]*\\\\\n",
@@ -320,13 +321,12 @@ define([
{
include: "orion.c-like"
}, {
+ include: "orion.js#string_singleQuote"
+ }, {
id: keywords,
match: "\\b(?:true|false|null)\\b",
name: "KEYWORD"
}, {
- match: "'.*?(?:'|$)",
- name: "STRING"
- }, {
/* override c-like#comment_singleline */
id: "comment_singleline"
}, { | Bug <I> - Single quoted strings containing escaped quote are not highlighted properly | eclipse_orion.client | train | js |
39d19cd61357e765fc15957e35b56d23f27fda40 | diff --git a/owslib/csw.py b/owslib/csw.py
index <HASH>..<HASH> 100644
--- a/owslib/csw.py
+++ b/owslib/csw.py
@@ -201,6 +201,7 @@ class CatalogueServiceWeb:
else:
# construct request
node0 = etree.Element(util.nspath_eval('csw:GetRecords', namespaces))
+ node0.set('xmlns:ows', namespaces['ows'])
node0.set('outputSchema', outputschema)
node0.set('outputFormat', format)
node0.set('version', self.version) | force ows namespace decl (for validating CSW servers and owslib clients using xml.etree) | geopython_OWSLib | train | py |
f46fe542d4e5966b781439bb26573e34c4d7384f | diff --git a/libgit/browser_file.go b/libgit/browser_file.go
index <HASH>..<HASH> 100644
--- a/libgit/browser_file.go
+++ b/libgit/browser_file.go
@@ -60,17 +60,22 @@ func (bf *browserFile) ReadAt(p []byte, off int64) (n int, err error) {
_ = r.Close()
}()
- // Skip past the data we don't care about, one chunk at a time.
dataToSkip := off
+ bufSize := dataToSkip
+ if bufSize > bf.maxBufSize {
+ bufSize = bf.maxBufSize
+ }
+ buf := make([]byte, bufSize)
+
+ // Skip past the data we don't care about, one chunk at a time.
for dataToSkip > 0 {
- bufSize := dataToSkip
- if bufSize > bf.maxBufSize {
- bufSize = bf.maxBufSize
+ toRead := int64(len(buf))
+ if dataToSkip < toRead {
+ toRead = dataToSkip
}
- buf := make([]byte, dataToSkip)
// Throwaway data.
- n, err := r.Read(buf)
+ n, err := r.Read(buf[:toRead])
if err != nil {
return 0, err
} | browser_file: fix buffer issues with ReadAt
Suggested by songgao.
Issue: #<I> | keybase_client | train | go |
1663f5ad879519544affc7364e18bfb7c9bfd0a9 | diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -859,7 +859,7 @@ module ActiveRecord
ActiveRecord::SchemaMigration.create_table
end
- def assume_migrated_upto_version(version, migrations_paths = ActiveRecord::Migrator.migrations_paths)
+ def assume_migrated_upto_version(version, migrations_paths)
migrations_paths = Array(migrations_paths)
version = version.to_i
sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name) | Don't set the default argument
It is always passed in | rails_rails | train | rb |
71650edfaba7d985381d32a25cd3013144f35c61 | diff --git a/forms.go b/forms.go
index <HASH>..<HASH> 100644
--- a/forms.go
+++ b/forms.go
@@ -53,7 +53,7 @@ func helper(opts tags.Options, help HelperContext, fn func(opts tags.Options) he
hn = n.(string)
delete(opts, "var")
}
- if opts["errors"] == nil {
+ if opts["errors"] == nil && help.Context.Value("errors") != nil {
opts["errors"] = help.Context.Value("errors")
}
form := fn(opts) | fixed issue with errors showing in html by accident | gobuffalo_plush | train | go |
19108b75be8513af789fe4cce05b373ff6aa3864 | diff --git a/lib/Rx/Observable/BaseObservable.php b/lib/Rx/Observable/BaseObservable.php
index <HASH>..<HASH> 100644
--- a/lib/Rx/Observable/BaseObservable.php
+++ b/lib/Rx/Observable/BaseObservable.php
@@ -468,7 +468,7 @@ abstract class BaseObservable implements ObservableInterface
function ($error) use ($d) {
$d->reject($error);
},
- function () use ($d, $value) {
+ function () use ($d, &$value) {
$d->resolve($value);
} | Make sure toPromise value is passed by reference | ReactiveX_RxPHP | train | php |
c3ab90da466e2c4479c9c1865f4302c9c8bdb8e9 | diff --git a/tests/extmod/ujson_loads.py b/tests/extmod/ujson_loads.py
index <HASH>..<HASH> 100644
--- a/tests/extmod/ujson_loads.py
+++ b/tests/extmod/ujson_loads.py
@@ -6,6 +6,8 @@ except:
def my_print(o):
if isinstance(o, dict):
print('sorted dict', sorted(o.items()))
+ elif isinstance(o, float):
+ print('%.3f' % o)
else:
print(o) | tests: Make printing of floats hopefully more portable. | micropython_micropython | train | py |
68fe1c518bfc2e5bff8af86e0590c3a8d0a3a6e5 | diff --git a/cassandra/connection.py b/cassandra/connection.py
index <HASH>..<HASH> 100644
--- a/cassandra/connection.py
+++ b/cassandra/connection.py
@@ -984,6 +984,8 @@ class ConnectionHeartbeat(Thread):
else:
connection.reset_idle()
else:
+ log.debug("Cannot send heartbeat message on connection (%s) to %s",
+ id(connection), connection.host)
# make sure the owner sees this defunt/closed connection
owner.return_connection(connection)
self._raise_if_stopped() | Add a debug message when the connection heartbeat failed due to a closed connection | datastax_python-driver | train | py |
fe86133704eb1d0ca41a8b62ea043473e7c0fb2b | diff --git a/lib/clean.js b/lib/clean.js
index <HASH>..<HASH> 100644
--- a/lib/clean.js
+++ b/lib/clean.js
@@ -273,9 +273,13 @@ var CleanCSS = {
}
});
- // empty elements
- if (options.removeEmpty)
- replace(/[^\}]+?\{\}/g, '');
+ if (options.removeEmpty) {
+ // empty elements
+ replace(/[^\{\}]+\{\}/g, '');
+
+ // empty @media declarations
+ replace(/@media [^\{]+\{\}/g, '');
+ }
// remove universal selector when not needed (*#id, *.class etc)
replace(/\*([\.#:\[])/g, '$1');
diff --git a/test/unit-test.js b/test/unit-test.js
index <HASH>..<HASH> 100644
--- a/test/unit-test.js
+++ b/test/unit-test.js
@@ -644,6 +644,14 @@ vows.describe('clean-units').addBatch({
'just a semicolon': [
'div { ; }',
''
+ ],
+ 'inside @media': [
+ "@media screen { .test {} } .test1 { color: green; }",
+ ".test1{color:green}"
+ ],
+ 'inside not empty @media': [
+ "@media screen { .test {} .some { display:none } }",
+ "@media screen{.some{display:none}}"
]
}, { removeEmpty: true }),
'skip empty elements': cssContext({ | Fixes #<I> - removing empty selectors from media query. | jakubpawlowicz_clean-css | train | js,js |
2f0192d47d1965f4f163e326807939ad85b74bf1 | diff --git a/framework/core/src/Forum/Content/Index.php b/framework/core/src/Forum/Content/Index.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Forum/Content/Index.php
+++ b/framework/core/src/Forum/Content/Index.php
@@ -75,10 +75,14 @@ class Index
$params = [
'sort' => $sort && isset($sortMap[$sort]) ? $sortMap[$sort] : '',
- 'filter' => compact('q'),
+ 'filter' => [],
'page' => ['offset' => ($page - 1) * 20, 'limit' => 20]
];
+ if ($q) {
+ $params['filter']['q'] = $q;
+ }
+
$apiDocument = $this->getApiDocument($request->getAttribute('actor'), $params);
$defaultRoute = $this->settings->get('default_route'); | Fix Index content, only use search when applicable. | flarum_core | train | php |
36a9b23f36ec602297dc35d3e4a044f225148f75 | diff --git a/clearly/safe_compiler.py b/clearly/safe_compiler.py
index <HASH>..<HASH> 100644
--- a/clearly/safe_compiler.py
+++ b/clearly/safe_compiler.py
@@ -66,7 +66,7 @@ def safe_compile_text(txt):
except ValueError:
if isinstance(node, ast.Name):
return node.id
- return repr(node)
+ return 'unsupported: {}'.format(type(node))
try:
txt = ast.parse(txt, mode='eval') | chore(clearly) mark unsupported nodes | rsalmei_clearly | train | py |
8d29ccbf7f61aa2ac1089b7565061d0441d92f6f | diff --git a/packages/patternfly-4/react-core/src/components/AboutModal/examples/SimpleAboutModal.js b/packages/patternfly-4/react-core/src/components/AboutModal/examples/SimpleAboutModal.js
index <HASH>..<HASH> 100644
--- a/packages/patternfly-4/react-core/src/components/AboutModal/examples/SimpleAboutModal.js
+++ b/packages/patternfly-4/react-core/src/components/AboutModal/examples/SimpleAboutModal.js
@@ -31,7 +31,7 @@ class SimpleAboutModal extends React.Component {
brandImageSrc={brandImg}
brandImageAlt="Patternfly Logo"
logoImageSrc={logoImg}
- logoImageAlt="AboutModal Logo"
+ logoImageAlt="Patternfly Logo"
heroImageSrc={heroImg}
>
<TextContent> | docs(AboutModal): update logo alt text to Patternfly Logo (#<I>) | patternfly_patternfly-react | train | js |
e4c5c3777cb6e97cd3587c0dd46e60455359dfca | diff --git a/slim/Request.php b/slim/Request.php
index <HASH>..<HASH> 100644
--- a/slim/Request.php
+++ b/slim/Request.php
@@ -185,7 +185,7 @@ class Request {
* @return The cookie value, or NULL if cookie not set
*/
public function cookie($name) {
- return isset($_COOKIE[$name]) ? $_COOKIE['name'] : null;
+ return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null;
}
/***** HELPERS *****/ | Fixing bug in Request::cookie | slimphp_Slim | train | php |
4a8065814ae46d38a264259bc527f9ee5d8cb76f | diff --git a/src/Utility/Import.php b/src/Utility/Import.php
index <HASH>..<HASH> 100644
--- a/src/Utility/Import.php
+++ b/src/Utility/Import.php
@@ -370,22 +370,18 @@ class Import
$pathInfo = pathinfo($this->_request->data('file.name'));
- $filename = $pathInfo['filename'];
- // add current timestamp
$time = new Time();
- $filename .= ' ' . $time->i18nFormat('yyyy-MM-dd HH:mm:ss');
- // add extensions
- $filename .= '.' . $pathInfo['extension'];
+ $timestamp = $time->i18nFormat('yyyy-MM-dd HH:mm:ss');
- $uploadPath .= $filename;
+ $path = $uploadPath . $timestamp . ' ' . $pathInfo['filename'] . '.' . $pathInfo['extension'];
- if (!move_uploaded_file($this->_request->data('file.tmp_name'), $uploadPath)) {
+ if (!move_uploaded_file($this->_request->data('file.tmp_name'), $path)) {
$this->_flash->error(__('Unable to upload file to the specified directory.'));
return '';
}
- return $uploadPath;
+ return $path;
}
/** | Prefix timestamp on filename (task #<I>) | QoboLtd_cakephp-csv-migrations | train | php |
842bd73f42abe245bf2b064a98ad5b888045ddd6 | diff --git a/docs/src/app/core.js b/docs/src/app/core.js
index <HASH>..<HASH> 100644
--- a/docs/src/app/core.js
+++ b/docs/src/app/core.js
@@ -607,6 +607,7 @@
var line = 0;
var lineFix;
var scopeNS;
+ var jsDocsName;
var parts = resource.text
.replace(/\r\n|\n\r|\r/g, '\n')
.replace(/\/\*+(\s*@cut.+\*)?\//g, '')
@@ -616,6 +617,9 @@
lineFix = 0;
if (idx % 2)
{
+ if (jsDocsName = code.match(/@name\s+([a-z0-9_\$\.]+)/i))
+ jsDocsName = jsDocsName[1];
+
if (code.match(/@annotation/))
{
skipDeclaration = true;
@@ -660,7 +664,7 @@
var name = m[3];
lineFix = (m[1].match(/\n/g) || []).length;
- createJsDocEntity(jsdoc[jsdoc.length - 1], ns + '.' + (clsPrefix ? clsPrefix + '.prototype.' : '') + name);
+ createJsDocEntity(jsdoc[jsdoc.length - 1], jsDocsName || ns + '.' + (clsPrefix ? clsPrefix + '.prototype.' : '') + name);
if (isClass)
clsPrefix = name; | add support for @name in jsDocs | basisjs_basisjs | train | js |
7b6ebd040d6fb05b5c32e5ff1e2bfc87d9767d7f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup (
name='jinja2-highlight',
- version='0.2.2',
+ version='0.3',
description='Jinja2 extension to highlight source code using Pygments',
keywords = 'syntax highlighting',
author='Tasos Latsas', | make release <I> to include readme file in package | tlatsas_jinja2-highlight | train | py |
5936e1cb529a4315450b269f6a123e0b590425d7 | diff --git a/ui/plugins/pinboard.js b/ui/plugins/pinboard.js
index <HASH>..<HASH> 100644
--- a/ui/plugins/pinboard.js
+++ b/ui/plugins/pinboard.js
@@ -46,6 +46,7 @@ treeherder.controller('PinboardCtrl',
}
$scope.classification.who = $scope.user.email;
thPinboard.save($scope.classification);
+ $rootScope.selectedJob = null;
} else {
thNotify.send("must be logged in to classify jobs", "danger");
} | unselect job after saving for pinned jobs | mozilla_treeherder | train | js |
3329f87b1488c84ec99989b8b25d528f6ff68ef4 | diff --git a/voice.go b/voice.go
index <HASH>..<HASH> 100644
--- a/voice.go
+++ b/voice.go
@@ -165,12 +165,16 @@ func (v *VoiceConnection) Close() {
v.Ready = false
v.speaking = false
+ v.log(LogInformational, "past lock")
if v.close != nil {
+ v.log(LogInformational, "closing v.close")
close(v.close)
v.close = nil
}
+ v.log(LogInformational, "past closing v.close")
if v.udpConn != nil {
+ v.log(LogInformational, "closing udp")
err := v.udpConn.Close()
if err != nil {
log.Println("error closing udp connection: ", err)
@@ -178,13 +182,16 @@ func (v *VoiceConnection) Close() {
v.udpConn = nil
}
+ v.log(LogInformational, "past closing udp")
if v.wsConn != nil {
+ v.log(LogInformational, "closing wsConn")
err := v.wsConn.Close()
if err != nil {
log.Println("error closing websocket connection: ", err)
}
v.wsConn = nil
}
+ v.log(LogInformational, "all done, returning")
}
// AddHandler adds a Handler for VoiceSpeakingUpdate events. | Added lots of temp logs into voice close func | bwmarrin_discordgo | train | go |
e1c7f764c560e88489aaa600d75c50883ea1e3bf | diff --git a/mongo/oplog.go b/mongo/oplog.go
index <HASH>..<HASH> 100644
--- a/mongo/oplog.go
+++ b/mongo/oplog.go
@@ -102,8 +102,12 @@ func (t *OplogTailer) loop() error {
// idsForLastTimestamp records the unique operation ids that have
// been reported for the most recently reported oplog
// timestamp. This is used to avoid re-reporting oplog entries
- // when the iterator is restarted. It's possible for there to be
- // many oplog entries for a given timestamp.
+ // when the iterator is restarted. These timestamps are unique for
+ // a given mongod but when there's multiple replicaset members
+ // it's possible for there to be multiple oplog entries for a
+ // given timestamp.
+ //
+ // See: http://docs.mongodb.org/v2.4/reference/bson-types/#timestamps
var idsForLastTimestamp []int64
for { | mongo: clarified description of idsForLastTimestamp | juju_juju | train | go |
32aad91a44b9ab5c47e09ce8bab7c10dca9a6eae | diff --git a/src/howler.core.js b/src/howler.core.js
index <HASH>..<HASH> 100644
--- a/src/howler.core.js
+++ b/src/howler.core.js
@@ -819,9 +819,9 @@
if (sound._node) {
if (self._webAudio) {
- // make sure the sound has been created
- if (!sound._node.bufferSource) {
- return self;
+ // Make sure the sound has been created.
+ if (sound._node.bufferSource) {
+ continue;
}
if (typeof sound._node.bufferSource.stop === 'undefined') {
@@ -890,9 +890,8 @@
if (sound._node) {
if (self._webAudio) {
- // make sure the sound's AudioBufferSourceNode has been created
+ // Make sure the sound's AudioBufferSourceNode has been created.
if (sound._node.bufferSource) {
-
if (typeof sound._node.bufferSource.stop === 'undefined') {
sound._node.bufferSource.noteOff(0);
} else { | Fix group pause issue
Thanks #<I> | goldfire_howler.js | train | js |
75e034a3a43c36242642ed29cb7fc9ac3df819a8 | diff --git a/lib/govspeak/html_validator.rb b/lib/govspeak/html_validator.rb
index <HASH>..<HASH> 100644
--- a/lib/govspeak/html_validator.rb
+++ b/lib/govspeak/html_validator.rb
@@ -18,7 +18,7 @@ class Govspeak::HtmlValidator
# Make whitespace in html tags consistent
def normalise_html(html)
- Nokogiri::HTML.parse(html).to_s
+ Nokogiri::HTML5.fragment(html).to_s
end
def govspeak_to_html | Use Nokogiri::HTML5#fragment for normalising html
This will use the Nokogump and the Gumbo HTML5 parser for HTML
normalisation, but as this is already required by Sanitize this
should be ok. Changing `parse => fragment` should have no effect
and will stip out superfluous elements such as html, head and body. | alphagov_govspeak | train | rb |
c4baa233bfbfe6652f14347f86b4f58a2b84beb9 | diff --git a/salt/loader.py b/salt/loader.py
index <HASH>..<HASH> 100644
--- a/salt/loader.py
+++ b/salt/loader.py
@@ -1243,7 +1243,8 @@ class LazyLoader(salt.utils.lazy.LazyDict):
except OSError:
pass
else:
- files = pycache_files + files
+ pycache_files.extend(files)
+ files = pycache_files
for filename in files:
try:
dirname, basename = os.path.split(filename) | Optimization: don't allocate a new list to concatenate | saltstack_salt | train | py |
586dfac5f47cee01584e8ff7749881b3d8ce657a | diff --git a/lib/watir-webdriver/elements/font.rb b/lib/watir-webdriver/elements/font.rb
index <HASH>..<HASH> 100644
--- a/lib/watir-webdriver/elements/font.rb
+++ b/lib/watir-webdriver/elements/font.rb
@@ -8,10 +8,4 @@ module Watir
FontCollection.new(self, extract_selector(args).merge(:tag_name => "font"))
end
end # Container
-
- class FontCollection < ElementCollection
- def element_class
- Font
- end
- end # FontCollection
end # Watir
\ No newline at end of file | Don't define FontCollection twice | watir_watir | train | rb |
d311c49101b52647d76f090b14eba4b9dd322542 | diff --git a/benchexec/tools/symbiotic.py b/benchexec/tools/symbiotic.py
index <HASH>..<HASH> 100644
--- a/benchexec/tools/symbiotic.py
+++ b/benchexec/tools/symbiotic.py
@@ -144,6 +144,8 @@ class Tool(OldSymbiotic):
return result.RESULT_FALSE_FREE
elif line.startswith('RESULT: false(valid-memtrack)'):
return result.RESULT_FALSE_MEMTRACK
+ elif line.startswith('RESULT: false(valid-memcleanup)'):
+ return result.RESULT_FALSE_MEMCLEANUP
elif line.startswith('RESULT: false(no-overflow)'):
return result.RESULT_FALSE_OVERFLOW
elif line.startswith('RESULT: false(termination)'): | symbiotic: parse results for memcleanup property | sosy-lab_benchexec | train | py |
ff7fb1622585843628b0cb203aa297cdf2fd8e3b | diff --git a/js/bitfinex2.js b/js/bitfinex2.js
index <HASH>..<HASH> 100644
--- a/js/bitfinex2.js
+++ b/js/bitfinex2.js
@@ -315,7 +315,7 @@ module.exports = class bitfinex2 extends bitfinex {
}
fetchMarkets () {
- return this.load_markets();
+ return this.loadMarkets ();
}
parseTicker (ticker, market = undefined) { | Fix spacing and camelCase method | ccxt_ccxt | train | js |
0ab430032bc990d2bcf228dd3fce2800fb217441 | diff --git a/yowsup/layers/protocol_messages/protocolentities/protomessage.py b/yowsup/layers/protocol_messages/protocolentities/protomessage.py
index <HASH>..<HASH> 100644
--- a/yowsup/layers/protocol_messages/protocolentities/protomessage.py
+++ b/yowsup/layers/protocol_messages/protocolentities/protomessage.py
@@ -34,7 +34,7 @@ class ProtomessageProtocolEntity(MessageProtocolEntity):
def toProtocolTreeNode(self):
node = super(ProtomessageProtocolEntity, self).toProtocolTreeNode()
- node.addChild(ProtoProtocolEntity(self.proto.SerializeToString()).toProtocolTreeNode())
+ node.addChild(ProtoProtocolEntity(self._proto.SerializeToString()).toProtocolTreeNode())
return node | [fix] fix protomessage.toProtocolTreeNode
It was using .proto which is overridden by subclasses to their
directly related child proto message, while protomessage should
deal with the parent Message (._proto) | tgalal_yowsup | train | py |
a94b08db25290c3f6aa69868f08a170a1153e017 | diff --git a/lib/day.rb b/lib/day.rb
index <HASH>..<HASH> 100644
--- a/lib/day.rb
+++ b/lib/day.rb
@@ -15,9 +15,12 @@ module Day
class Ru
# getting class variables from 'data' folder contents
- Dir.glob('../data/*.yml') do |yml|
+ prev_dir = Dir.pwd
+ Dir.chdir(File.join(File.dirname(__FILE__), '..', 'data'))
+ Dir.glob('*.yml') do |yml|
class_variable_set "@@#{yml.gsub('.yml', '')}".to_sym, YAML::load(File.read(yml))
end
+ Dir.chdir prev_dir
# TODO: - string to utf8 if Ruby version > 1.9
# - convert to lowercase with Unicode gem | change dir to previous after initialize class variables | grsmv_day | train | rb |
3feeb10d24afd7162c7323c540523f3b8025c379 | diff --git a/web/index.php b/web/index.php
index <HASH>..<HASH> 100755
--- a/web/index.php
+++ b/web/index.php
@@ -29,8 +29,8 @@ class scoilnetExample {
"api_key" => "d0d588d94c05b3e1e4e37159f1cf5458f645193f5b45f092874d5747628ce8a3",
];
- $this->defaultConfig = array('school_discipline' => '40,50');
-
+ // $this->defaultConfig = array('school_discipline' => '40,50');
+ $this->defaultConfig = array();
$this->scoilnetClient = new \OAuth2\ScoilnetClient($config);
} | Update code to support preselected facet values | Scoilnet_PhpSDK | train | php |
28cbf70e8dde4c881717120a3f3971be227ee1a7 | diff --git a/angr/simos.py b/angr/simos.py
index <HASH>..<HASH> 100644
--- a/angr/simos.py
+++ b/angr/simos.py
@@ -613,7 +613,10 @@ class SimLinux(SimOS):
for reloc in binary.relocs:
if reloc.symbol is None or reloc.resolvedby is None:
continue
- if reloc.resolvedby.type != 'STT_GNU_IFUNC':
+ try:
+ if reloc.resolvedby.elftype != 'STT_GNU_IFUNC':
+ continue
+ except AttributeError:
continue
gotaddr = reloc.addr + binary.rebase_addr
gotvalue = self.proj.loader.memory.read_addr_at(gotaddr) | Update for CLE api changes, check explicit elf symbol | angr_angr | train | py |
9d9f98ed06a5da818af6952183ae27958df248ad | diff --git a/src/customizer.js b/src/customizer.js
index <HASH>..<HASH> 100644
--- a/src/customizer.js
+++ b/src/customizer.js
@@ -64,8 +64,8 @@ var Customizer = extend(EventEmitter, /** @lends Customizer# */ {
_.extend(this, _.pick(options, optionKeys));
- if (!this._optimizer) {
- this._optimizer = new ConfigurationOptimizer(this.deviceAddress);
+ if (!this.optimizer) {
+ this.optimizer = new ConfigurationOptimizer(this.deviceAddress);
}
},
@@ -84,11 +84,11 @@ var Customizer = extend(EventEmitter, /** @lends Customizer# */ {
},
_getInitialConfiguration: function(oldConfig) {
- return this._optimizer.getInitialConfiguration(oldConfig);
+ return this.optimizer.getInitialConfiguration(oldConfig);
},
_optimizeConfiguration: function(oldConfig) {
- return this._optimizer.optimizeConfiguration(oldConfig);
+ return this.optimizer.optimizeConfiguration(oldConfig);
},
}); | Fix bug regarding wrong `optimizer` prop in Customizer. | danielwippermann_resol-vbus | train | js |
3040df9cbaa561b0aaba23692a41b9eb53628ba1 | diff --git a/nion/swift/test/DocumentController_test.py b/nion/swift/test/DocumentController_test.py
index <HASH>..<HASH> 100644
--- a/nion/swift/test/DocumentController_test.py
+++ b/nion/swift/test/DocumentController_test.py
@@ -124,6 +124,8 @@ class TestDocumentControllerClass(unittest.TestCase):
display_panel = DisplayPanel.DisplayPanel(document_controller, dict())
display_panel.set_displayed_data_item(data_item)
self.assertIsNotNone(weak_data_item())
+ display_panel.close()
+ display_panel.canvas_item.close()
document_controller.close()
document_controller = None
data_item = None | Minor garbage collection test improvement (be sure to release data panel). | nion-software_nionswift | train | py |
6931489733a568a98a452ba3581f70bc3d7d1dea | diff --git a/jax/version.py b/jax/version.py
index <HASH>..<HASH> 100644
--- a/jax/version.py
+++ b/jax/version.py
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.1.52"
+__version__ = "0.1.53" | update version for pypi | tensorflow_probability | train | py |
9543094c67ea50be93e359ea06e26bf7c243f81f | diff --git a/widgets/TbActiveForm.php b/widgets/TbActiveForm.php
index <HASH>..<HASH> 100644
--- a/widgets/TbActiveForm.php
+++ b/widgets/TbActiveForm.php
@@ -376,7 +376,7 @@ class TbActiveForm extends CActiveForm
));
echo '</div>';
echo '<div class="span4">';
- $this->widget('bootstrap.widgets.TbBootTimepicker', array(
+ $this->widget('bootstrap.widgets.TbTimepicker', array(
'htmlOptions'=>$options['time']['htmlOptions'],
'options'=>isset($options['time']['options'])?$options['time']['options']:array(),
'events'=>isset($options['time']['events'])?$options['time']['events']:array(), | This method needs refactoring... fixing typo bug for the moment | clevertech_YiiBooster | train | php |
17f1723c9c7400e092ab128d804f64a413db50aa | diff --git a/config/karma.conf.js b/config/karma.conf.js
index <HASH>..<HASH> 100644
--- a/config/karma.conf.js
+++ b/config/karma.conf.js
@@ -30,7 +30,7 @@ module.exports = function (config) {
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
- browsers: ['PhantomJS'],
+ browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome', | Update karma.conf.js | infernojs_inferno | train | js |
9ff3bdedced5643c3e888dc39bd2026952c8a4b7 | diff --git a/src/main/java/com/buschmais/jqassistant/commandline/task/ServerTask.java b/src/main/java/com/buschmais/jqassistant/commandline/task/ServerTask.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/buschmais/jqassistant/commandline/task/ServerTask.java
+++ b/src/main/java/com/buschmais/jqassistant/commandline/task/ServerTask.java
@@ -4,8 +4,8 @@ import com.buschmais.jqassistant.commandline.CliExecutionException;
import com.buschmais.jqassistant.core.plugin.api.PluginRepositoryException;
import com.buschmais.jqassistant.core.store.api.Store;
import com.buschmais.jqassistant.core.store.impl.EmbeddedGraphStore;
-import com.buschmais.jqassistant.scm.neo4jserver.api.Server;
-import com.buschmais.jqassistant.scm.neo4jserver.impl.ExtendedCommunityNeoServer;
+import com.buschmais.jqassistant.neo4jserver.api.Server;
+import com.buschmais.jqassistant.neo4jserver.impl.ExtendedCommunityNeoServer;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder; | Fixed import statements after updating the dependencies to jQAssistant projects. | buschmais_jqa-commandline-tool | train | java |
82d16e52cd0c6db8895609e9712ec3421d88cf7e | diff --git a/src/main/java/org/minimalj/frontend/editor/WizardStep.java b/src/main/java/org/minimalj/frontend/editor/WizardStep.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/minimalj/frontend/editor/WizardStep.java
+++ b/src/main/java/org/minimalj/frontend/editor/WizardStep.java
@@ -10,8 +10,6 @@ public interface WizardStep<T> {
public String getTitle();
- public String getDescription();
-
public T createObject();
public Form<T> createForm(); | WizardStep: removed getDescription. Not used anywhere | BrunoEberhard_minimal-j | train | java |
363e7a14ee87130b993f70fa4ea514d02acb24c2 | diff --git a/src/LeagueAPI/LeagueAPI.php b/src/LeagueAPI/LeagueAPI.php
index <HASH>..<HASH> 100644
--- a/src/LeagueAPI/LeagueAPI.php
+++ b/src/LeagueAPI/LeagueAPI.php
@@ -1988,6 +1988,9 @@ class LeagueAPI
*/
public function getStaticChampion( int $champion_id, bool $extended = false, string $locale = 'en_US', string $version = null ): StaticData\StaticChampionDto
{
+ if ($champion_id == -1)
+ return new StaticData\StaticChampionDto(["id" => -1, "name" => "None"], $this);
+
$result = $this->_makeStaticCall("RiotAPI\\DataDragonAPI\\DataDragonAPI::getStaticChampionByKey", $champion_id, $locale, $version);
if ($extended && $result)
{ | Workaroud for Match StaticData linking in case of "None" bans (#<I>) | dolejska-daniel_riot-api | train | php |
bbaf0f71624602a9751db86f001fde2ccfcdd9b4 | diff --git a/views/js/controller/TaoEventLog/show.js b/views/js/controller/TaoEventLog/show.js
index <HASH>..<HASH> 100644
--- a/views/js/controller/TaoEventLog/show.js
+++ b/views/js/controller/TaoEventLog/show.js
@@ -88,7 +88,12 @@ define([
sortable: true,
filterable: true,
transform: function(roles, row) {
- var list = roles ? roles.split(',') : [''];
+ var list = [''];
+
+ if (roles) {
+ list = roles.split(',');
+ }
+
row.roles_list = list.join('<br>');
return list.shift(); | Simplified rule in roles tranformer handler | oat-sa_extension-tao-eventlog | train | js |
a2527bf9998cbbc94353d254323ae5fcd9d488f9 | diff --git a/tasks/coffee.js b/tasks/coffee.js
index <HASH>..<HASH> 100644
--- a/tasks/coffee.js
+++ b/tasks/coffee.js
@@ -44,8 +44,10 @@ module.exports = function(grunt) {
}
});
- grunt.log.writeln(actionCounts.fileCreated + ' files created.');
- grunt.log.writeln(actionCounts.mapCreated + ' source map files created.');
+ grunt.log.ok(actionCounts.fileCreated + ' files created.');
+ if (actionCounts.mapCreated > 0) {
+ grunt.log.ok(actionCounts.mapCreated + ' source map files created.');
+ }
}); | Switch to "log.ok". Only show source map log if maps are created. | gruntjs_grunt-contrib-coffee | train | js |
8991bb17230da140baa7118152f989b4432c47f3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,7 @@ class BuildExt(build_ext):
setup(
name='toolkit',
version='0.0.1',
+ install_requires = ['numpy', 'scikit-learn'],
author='Princeton Neuroscience Institute and Intel Corporation',
author_email='bryn.keller@intel.com',
url='https://github.com/IntelPNI/toolkit', | Add numpy and scikit-learn dependencies in setup.py | brainiak_brainiak | train | py |
424da654484d4fb8ed86d44c2e22244d831bb94c | diff --git a/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java b/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
index <HASH>..<HASH> 100644
--- a/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
+++ b/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
@@ -183,7 +183,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
* The output directory. This generally maps to "target".
*/
@SuppressWarnings("CanBeFinal")
- @Parameter(defaultValue = "${project.build.directory}", required = true)
+ @Parameter(defaultValue = "${project.build.directory}", required = true, property = "outputDirectory")
private File outputDirectory;
/**
* This is a reference to the >reporting< sections | Allow outputDirectory to be set from a user-property on the commandline using -DoutputDirectory | jeremylong_DependencyCheck | train | java |
f15ed86e65eee43976cb49e2fee8ca1edbbfe0b0 | diff --git a/test/esp/credentials_test.rb b/test/esp/credentials_test.rb
index <HASH>..<HASH> 100644
--- a/test/esp/credentials_test.rb
+++ b/test/esp/credentials_test.rb
@@ -4,13 +4,13 @@ module ESP
class CredentialsTest < ActiveSupport::TestCase
context ESP::Credentials do
setup do
+ ESP::Credentials.access_key_id = nil
+ ESP::Credentials.secret_access_key = nil
@original_access_key_id = ENV['ESP_ACCESS_KEY_ID']
@original_secret_access_key = ENV['ESP_SECRET_ACCESS_KEY']
end
teardown do
- ESP::Credentials.access_key_id = nil
- ESP::Credentials.secret_access_key = nil
ENV['ESP_ACCESS_KEY_ID'] = @original_access_key_id
ENV['ESP_SECRET_ACCESS_KEY'] = @original_secret_access_key
end | Putting the cart before the horse. | EvidentSecurity_esp_sdk | train | rb |
20e95223dc19d3653929b2db768cc4e6b485b4e4 | diff --git a/pyvisa/rname.py b/pyvisa/rname.py
index <HASH>..<HASH> 100644
--- a/pyvisa/rname.py
+++ b/pyvisa/rname.py
@@ -184,7 +184,7 @@ class ResourceName(object):
rn.user = resource_name
return rn
except ValueError as ex:
- raise InvalidResourceName.bad_syntax(subclass.syntax,
+ raise InvalidResourceName.bad_syntax(subclass._visa_syntax,
resource_name, ex)
raise InvalidResourceName('Could not parse %s: unknown interface type' | Fixed bug in rname error reporting | pyvisa_pyvisa | train | py |
5301205a24600ae3d0f9d67d361f770d5137b438 | diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -440,7 +440,7 @@ function clean_param($param, $type) {
case PARAM_URL: // allow safe ftp, http, mailto urls
include_once($CFG->dirroot . '/lib/validateurlsyntax.php');
- if (!empty($param) && validateUrlSyntax($param, 's?H?S?F?E?u-P-a?I?p-f?q?r?')) {
+ if (!empty($param) && validateUrlSyntax($param, 's?H?S?F?E?u-P-a?I?p?f?q?r?')) {
// all is ok, param is respected
} else {
$param =''; // not really ok | MDL-<I> URL check is too restrictive, allow port | moodle_moodle | train | php |
c8124d2786990c6c8ce1587247b14f7a569d41f7 | diff --git a/lib/ronin/network/http.rb b/lib/ronin/network/http.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/network/http.rb
+++ b/lib/ronin/network/http.rb
@@ -144,6 +144,10 @@ module Ronin
# Request Class an UnknownRequest exception will be raised.
#
def HTTP.request(options={})
+ unless options[:method]
+ raise(ArgumentError,"the :method option must be specified",caller)
+ end
+
name = options[:method].to_s.capitalize
unless Net::HTTP.const_defined?(name)
diff --git a/spec/network/http_spec.rb b/spec/network/http_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/network/http_spec.rb
+++ b/spec/network/http_spec.rb
@@ -187,5 +187,11 @@ describe Network::HTTP do
req.class.should == Net::HTTP::Unlock
end
+
+ it "should raise an ArgumentError when :method is not specified" do
+ lambda {
+ Network::HTTP.request()
+ }.should raise_error(ArgumentError)
+ end
end
end | Make sure HTTP.request receives a :method option. | ronin-ruby_ronin | train | rb,rb |
308980ee2a5c85ba1600446d093edc921f9a71de | diff --git a/test/unit/effects.js b/test/unit/effects.js
index <HASH>..<HASH> 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -2133,7 +2133,11 @@ asyncTest( ".finish() is applied correctly when multiple elements were animated
ok( elems.eq( 0 ).queue().length, "non-empty queue for preceding element" );
ok( elems.eq( 2 ).queue().length, "non-empty queue for following element" );
elems.stop( true );
- start();
+
+ // setTimeout needed in order to avoid setInterval/setTimeout execution bug in FF
+ window.setTimeout(function() {
+ start();
+ }, 1000 );
}, 100 );
}); | Fix test for #<I> ticket. Close gh-<I> | jquery_jquery | train | js |
4dfb111fffd671b7d97d803309fda2904e3ca1c8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ please refer to the `srp module documentation`_.
'''
setup(name = 'srp',
- version = '1.0.18',
+ version = '1.0.19',
description = 'Secure Remote Password',
author = 'Tom Cocagne',
author_email = 'tom.cocagne@gmail.com', | Updated version to <I> | cocagne_pysrp | train | py |
35e75cd59afbeb081097cc0f41d1f84a1df1798f | diff --git a/ecell4/util/decorator.py b/ecell4/util/decorator.py
index <HASH>..<HASH> 100644
--- a/ecell4/util/decorator.py
+++ b/ecell4/util/decorator.py
@@ -219,10 +219,7 @@ class ReactionRulesCallback(Callback):
else:
raise RuntimeError, 'an invalid object was given [%s]' % (repr(obj))
-def get_model(is_netfree=False):
- global SPECIES_ATTRIBUTES
- global REACTION_RULES
-
+def get_model(is_netfree=False, without_reset=False):
if is_netfree:
m = ecell4.core.NetfreeModel()
else:
@@ -233,9 +230,17 @@ def get_model(is_netfree=False):
for rr in REACTION_RULES:
m.add_reaction_rule(rr)
+ if not without_reset:
+ reset_model()
+
+ return m
+
+def reset_model():
+ global SPECIES_ATTRIBUTES
+ global REACTION_RULES
+
SPECIES_ATTRIBUTES = []
REACTION_RULES = []
- return m
reaction_rules = functools.partial(ParseDecorator, ReactionRulesCallback)
species_attributes = functools.partial(ParseDecorator, SpeciesAttributesCallback) | get_model() does not always clear its state | ecell_ecell4 | train | py |
d4e3b25911e132d66afaa0ecf26d8e8e3c0cb73b | diff --git a/napalm/ios.py b/napalm/ios.py
index <HASH>..<HASH> 100644
--- a/napalm/ios.py
+++ b/napalm/ios.py
@@ -122,7 +122,7 @@ class IOSDriver(NetworkDriver):
new_file_full = self.gen_full_path(filename=new_file, file_system=new_file_system)
cmd = 'show archive config differences {} {}'.format(base_file_full, new_file_full)
- diff = self.device.send_command(cmd, delay_factor=1)
+ diff = self.device.send_command(cmd, delay_factor=1.5)
diff = self.normalize_compare_config(diff)
return diff.strip() | Increasing delay_factor for config compare | napalm-automation_napalm | train | py |
c129ffeead28f966d1d730a4f6a161d153458af7 | diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb
index <HASH>..<HASH> 100644
--- a/lib/haml/exec.rb
+++ b/lib/haml/exec.rb
@@ -319,7 +319,15 @@ END
::Sass::Plugin.on_creating_directory {|dirname| puts_action :directory, :green, dirname}
::Sass::Plugin.on_deleting_css {|filename| puts_action :delete, :yellow, filename}
::Sass::Plugin.on_compilation_error do |error, _, _|
- raise error unless error.is_a?(::Sass::SyntaxError)
+ unless error.is_a?(::Sass::SyntaxError)
+ if error.is_a?(Errno::ENOENT) && error.message =~ /^No such file or directory - (.*)$/ && $1 == @args[1]
+ flag = @options[:update] ? "--update" : "--watch"
+ error.message << "\n Did you mean: sass #{flag} #{@args[0]}:#{@args[1]}"
+ end
+
+ raise error
+ end
+
puts_action :error, :red, "#{error.sass_filename} (Line #{error.sass_line}: #{error.message})"
end | [Sass] Intelligently detect errors in --update/--watch usage. | sass_ruby-sass | train | rb |
68efecafedcd4767a05a4f22d648304503c2f188 | diff --git a/agent/local/state.go b/agent/local/state.go
index <HASH>..<HASH> 100644
--- a/agent/local/state.go
+++ b/agent/local/state.go
@@ -1175,6 +1175,9 @@ func (l *State) SyncChanges() error {
defer l.Unlock()
// Sync the node level info if we need to.
+ // At the start to guarantee sync even if services or checks fail,
+ // which is more likely because there are more syncs happening for them.
+
if l.nodeInfoInSync {
l.logger.Debug("Node info in sync")
} else {
@@ -1183,10 +1186,6 @@ func (l *State) SyncChanges() error {
}
}
- // We will do node-level info syncing at the end, since it will get
- // updated by a service or check sync anyway, given how the register
- // API works.
-
// Sync the services
// (logging happens in the helper methods)
for id, s := range l.services { | Update node info sync comment (#<I>) | hashicorp_consul | train | go |
02113f80c9379d68a0e826d378efd5fa480b2192 | diff --git a/version.js b/version.js
index <HASH>..<HASH> 100644
--- a/version.js
+++ b/version.js
@@ -1,3 +1,3 @@
if (enyo && enyo.version) {
- enyo.version.onyx = "2.4.0-pre.1";
+ enyo.version.onyx = "2.4.0-pre.2";
} | Update version string to <I>-pre<I> | enyojs_onyx | train | js |
8b0d2bef6f3ca2a078706ce419f074fba74e3796 | diff --git a/pull_into_place/structures.py b/pull_into_place/structures.py
index <HASH>..<HASH> 100644
--- a/pull_into_place/structures.py
+++ b/pull_into_place/structures.py
@@ -160,7 +160,7 @@ def read_and_calculate(workspace, pdb_paths):
score_table_pattern = re.compile(
r'^[A-Z]{3}(?:_[A-Z])?' # Residue name with optional tautomer.
r'(?::[A-Za-z_]+)?' # Optional patch type.
- r'_([1-9]+) ' # Residue number preceded by underscore.
+ r'_([0-9]+) ' # Residue number preceded by underscore.
) # The terminal space is important to match
# the full residue number. | Recognize residue numbers with 0's. | Kortemme-Lab_pull_into_place | train | py |
64e5b658b18c158b55f8d7680864aea83c35470c | diff --git a/typedload/dataloader.py b/typedload/dataloader.py
index <HASH>..<HASH> 100644
--- a/typedload/dataloader.py
+++ b/typedload/dataloader.py
@@ -433,8 +433,21 @@ def _unionload(l: Loader, value, type_) -> Any:
exceptions = []
- # Try all types
+ # Give a score to the types, [ (score, type), ... ]
+ scored: List[Tuple[int, Type]] = []
for t in args:
+ if (type(value) == list and is_list(t)) or \
+ (type(value) == dict and is_dict(t)) or \
+ (type(value) == frozenset and is_frozenset(t)) or \
+ (type(value) == set and is_set(t)) or \
+ (type(value) == tuple and is_tuple(t)):
+ score = 1
+ else:
+ score = 0
+ scored.append((score, t))
+
+ # Try all types
+ for _, t in sorted(scored, key= lambda x: x[0], reverse=True):
try:
return l.load(value, t, annotation=Annotation(AnnotationType.UNION, t))
except Exception as e: | Implement iterable scoring in unions
For example, if the value is a list and there is a list in the
possibilities of the union, give that a score of 1, and try it
before the other possibilities. | ltworf_typedload | train | py |
94d8c66e70074cf196f0a0b04a0047504b6f69a2 | diff --git a/flasgger/marshmallow_apispec.py b/flasgger/marshmallow_apispec.py
index <HASH>..<HASH> 100644
--- a/flasgger/marshmallow_apispec.py
+++ b/flasgger/marshmallow_apispec.py
@@ -82,6 +82,9 @@ class SwaggerView(MethodView):
def convert_schemas(d, definitions=None):
"""
Convert Marshmallow schemas to dict definitions
+
+ Also updates the optional definitions argument with any definitions
+ entries contained within the schema.
"""
if Schema is None:
raise RuntimeError('Please install marshmallow and apispec')
@@ -115,7 +118,8 @@ def convert_schemas(d, definitions=None):
else:
new[k] = v
- if len(definitions.keys()) > 0:
- new['definitions'] = definitions
+ # This key is not permitted anywhere except the very top level.
+ if 'definitions' in new:
+ del new['definitions']
return new
diff --git a/flasgger/utils.py b/flasgger/utils.py
index <HASH>..<HASH> 100644
--- a/flasgger/utils.py
+++ b/flasgger/utils.py
@@ -124,6 +124,7 @@ def get_specs(rules, ignore_verbs, optional_fields, sanitizer):
swag.update(
convert_schemas(apispec_swag, apispec_definitions)
)
+ swag['definitions'] = apispec_definitions
swagged = True | Fix erroneous extra definitions objects
Fixes #<I> | rochacbruno_flasgger | train | py,py |
0fe4ec57424e84d65737e591090ba1a1e5fdf01d | diff --git a/lib/DocblockResolver.php b/lib/DocblockResolver.php
index <HASH>..<HASH> 100644
--- a/lib/DocblockResolver.php
+++ b/lib/DocblockResolver.php
@@ -17,7 +17,9 @@ class DocblockResolver
}
if (preg_match('#inheritdoc#i', $node->getLeadingCommentAndWhitespaceText())) {
- return $class->parent()->methods()->get($node->getName())->type();
+ if ($class->parent()) {
+ return $class->parent()->methods()->get($node->getName())->type();
+ }
}
return Type::unknown(); | TODO: Added test for inheritdoc | phpactor_worse-reflection | train | php |
39b05c8548f4c39c3509e42d125736961c4cfdde | diff --git a/agents/lib/instance/right_script_provider.rb b/agents/lib/instance/right_script_provider.rb
index <HASH>..<HASH> 100644
--- a/agents/lib/instance/right_script_provider.rb
+++ b/agents/lib/instance/right_script_provider.rb
@@ -77,7 +77,9 @@ class Chef
# 3. Fork and wait
@mutex.synchronize do
- RightScale.popen25(sc_filename.gsub(' ', '\\ '), self, :on_read_stdout, :on_exit)
+ cmd = sc_filename.gsub(' ', '\\ ')
+ #RightScale.popen25(cmd, self, :on_read_stdout, :on_exit)
+ RightScale.popen3(cmd, self, :on_read_stdout, :on_read_stderr, :on_exit)
@exited_event.wait(@mutex)
end | Refs #<I> - Switch back to popen3 (it seems to cause less trouble). | rightscale_right_link | train | rb |
1dd10090466ef09af2b744b31dba26041061eb04 | diff --git a/lib/fluent/plugin/in_syslog.rb b/lib/fluent/plugin/in_syslog.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/plugin/in_syslog.rb
+++ b/lib/fluent/plugin/in_syslog.rb
@@ -80,16 +80,7 @@ module Fluent::Plugin
desc 'The prefix of the tag. The tag itself is generated by the tag prefix, facility level, and priority.'
config_param :tag, :string
desc 'The transport protocol used to receive logs.(udp, tcp)'
- config_param :protocol_type, default: :udp do |val|
- case val.downcase
- when 'tcp'
- :tcp
- when 'udp'
- :udp
- else
- raise Fluent::ConfigError, "syslog input protocol type should be 'tcp' or 'udp'"
- end
- end
+ config_param :protocol_type, :enum, list: [:tcp, :udp], default: :udp
desc 'If true, add source host to event record.'
config_param :include_source_host, :bool, default: false
desc 'Specify key of source host when include_source_host is true.'
@@ -149,6 +140,7 @@ module Fluent::Plugin
return
end
+ pri ||= record.delete('pri')
record[@source_host_key] = addr[2] if @include_source_host
emit(pri, time, record)
end | fix bug to miss to get priority from parsers with_priority enabled | fluent_fluentd | train | rb |
1c4d395d5a0445a60d3821179862636e4dc4509e | diff --git a/patroni/__init__.py b/patroni/__init__.py
index <HASH>..<HASH> 100644
--- a/patroni/__init__.py
+++ b/patroni/__init__.py
@@ -159,7 +159,10 @@ class Patroni(object):
self.api.shutdown()
except Exception:
logger.exception('Exception during RestApi.shutdown')
- self.ha.shutdown()
+ try:
+ self.ha.shutdown()
+ except Exception:
+ logger.exception('Exception during Ha.shutdown')
self.logger.shutdown()
diff --git a/tests/test_patroni.py b/tests/test_patroni.py
index <HASH>..<HASH> 100644
--- a/tests/test_patroni.py
+++ b/tests/test_patroni.py
@@ -174,6 +174,7 @@ class TestPatroni(unittest.TestCase):
@patch.object(Thread, 'join', Mock())
def test_shutdown(self):
self.p.api.shutdown = Mock(side_effect=Exception)
+ self.p.ha.shutdown = Mock(side_effect=Exception)
self.p.shutdown()
def test_check_psycopg2(self): | Handle exception from Ha.shutdown (#<I>)
During the shutdown Patroni is trying to update its status in the DCS.
If the DCS is inaccessible an exception might be raised. Lack of exception handling prevents logger thread from stopping.
Fixes <URL> | zalando_patroni | train | py,py |
993fdd7a32c3d306d9b1df262425f842cf593a24 | diff --git a/core/src/main/java/org/springframework/security/config/OrderedFilterBeanDefinitionDecorator.java b/core/src/main/java/org/springframework/security/config/OrderedFilterBeanDefinitionDecorator.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/springframework/security/config/OrderedFilterBeanDefinitionDecorator.java
+++ b/core/src/main/java/org/springframework/security/config/OrderedFilterBeanDefinitionDecorator.java
@@ -119,5 +119,9 @@ public class OrderedFilterBeanDefinitionDecorator implements BeanDefinitionDecor
public String getBeanName() {
return beanName;
}
+
+ public String toString() {
+ return getClass() + "[ delegate=" + delegate + "; order=" + getOrder() + "]";
+ }
}
} | Added better toString() method to OrderedFilterDecorator to make it report the delegate filter information. | spring-projects_spring-security | train | java |
e59e22b674435bb6d729b76f9a3f482247971b59 | diff --git a/tests/Stubs/DecoratedAtom.php b/tests/Stubs/DecoratedAtom.php
index <HASH>..<HASH> 100644
--- a/tests/Stubs/DecoratedAtom.php
+++ b/tests/Stubs/DecoratedAtom.php
@@ -6,11 +6,6 @@ class DecoratedAtom implements HasPresenter
{
public $myProperty = "bazinga";
- /**
- * Get the presenter class.
- *
- * @return string The class path to the presenter.
- */
public function getPresenterClass()
{
return DecoratedAtomPresenter::class; | Ditched a docblock | laravel-auto-presenter_laravel-auto-presenter | train | php |
1ff9225cddd1fcac45dab7032d2092bab14408d0 | diff --git a/test/lib/wed/key_test.js b/test/lib/wed/key_test.js
index <HASH>..<HASH> 100644
--- a/test/lib/wed/key_test.js
+++ b/test/lib/wed/key_test.js
@@ -25,7 +25,7 @@ describe("key", function () {
var k = key.makeKey(1);
assert.equal(k.which, 1);
assert.equal(k.keyCode, 1);
- assert.equal(k.charCode, 0);
+ assert.equal(k.charCode, 1);
assert.equal(k.ctrlKey, false);
assert.equal(k.altKey, false);
assert.equal(k.metaKey, false);
@@ -85,7 +85,7 @@ describe("key", function () {
it("matches a keypress key", function () {
var k = key.makeKey(1);
assert.isTrue(k.matchesEvent({which: 1, keyCode: 1,
- charCode: 0,
+ charCode: 1,
ctrlKey: false, altKey: false,
metaKey: false,
type: "keypress"}));
@@ -94,7 +94,7 @@ describe("key", function () {
it("returns false when not matching an event", function () {
var k = key.makeCtrlKey(1);
assert.isFalse(k.matchesEvent({which: 1, keyCode: 1,
- charCode: 0,
+ charCode: 1,
ctrlKey: false, altKey: false,
metaKey: false}));
}); | Bugfix: recent key changes made this test fail. | mangalam-research_wed | train | js |
2fa4d166252bbc8b8aa4a20101eaed1f38b5e1d5 | diff --git a/secretservice/secretservice.go b/secretservice/secretservice.go
index <HASH>..<HASH> 100644
--- a/secretservice/secretservice.go
+++ b/secretservice/secretservice.go
@@ -313,6 +313,9 @@ func (s *SecretService) PromptAndWait(prompt dbus.ObjectPath) (paths *dbus.Varia
var result PromptCompletedResult
select {
case signal := <-s.signalCh:
+ if signal == nil {
+ continue
+ }
if signal.Name != "org.freedesktop.Secret.Prompt.Completed" {
continue
} | continue on nil signal in secretservice prompt waiter (#<I>) | keybase_go-keychain | train | go |
a0f0ce9934a15f8d7ee628b23d38c6fc98bebbf1 | diff --git a/internal/services/batch/batch_application_data_source.go b/internal/services/batch/batch_application_data_source.go
index <HASH>..<HASH> 100644
--- a/internal/services/batch/batch_application_data_source.go
+++ b/internal/services/batch/batch_application_data_source.go
@@ -58,9 +58,8 @@ func dataSourceBatchApplicationRead(d *pluginsdk.ResourceData, meta interface{})
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
- resourceGroup := d.Get("resource_group_name").(string)
- name := d.Get("name").(string)
- accountName := d.Get("account_name").(string)
+ subscriptionId := meta.(*clients.Client).Account.SubscriptionId
+ id := parse.NewApplicationID(subscriptionId, d.Get("resource_group_name").(string), d.Get("account_name").(string), d.Get("name").(string))
resp, err := client.Get(ctx, resourceGroup, accountName, name)
if err != nil { | Use ID parser to build the Application ID | terraform-providers_terraform-provider-azurerm | train | go |
9ca520320872d9a927d9f42f6e7477c4a122ebfd | diff --git a/markov_clustering/mcl.py b/markov_clustering/mcl.py
index <HASH>..<HASH> 100644
--- a/markov_clustering/mcl.py
+++ b/markov_clustering/mcl.py
@@ -81,7 +81,8 @@ def add_self_loops(matrix, loop_value):
def prune(matrix, threshold):
"""
- Prune the matrix so that very small edges are removed
+ Prune the matrix so that very small edges are removed.
+ The maximum value in each column is never pruned.
:param matrix: The matrix to be pruned
:param threshold: The value below which edges will be removed
@@ -95,6 +96,12 @@ def prune(matrix, threshold):
pruned = matrix.copy()
pruned[pruned < threshold] = 0
+ # keep max value in each column. same behaviour for dense/sparse
+ num_cols = matrix.shape[1]
+ row_indices = matrix.argmax(axis=0).reshape((num_cols,))
+ col_indices = np.arange(num_cols)
+ pruned[row_indices, col_indices] = matrix[row_indices, col_indices]
+
return pruned | make sure columns are not zeroed entirely while pruning | GuyAllard_markov_clustering | train | py |
5240ea764ea27b35e5f820f92ba5c4ea02b8a524 | diff --git a/lib/foreman_remote_execution_core/fake_script_runner.rb b/lib/foreman_remote_execution_core/fake_script_runner.rb
index <HASH>..<HASH> 100644
--- a/lib/foreman_remote_execution_core/fake_script_runner.rb
+++ b/lib/foreman_remote_execution_core/fake_script_runner.rb
@@ -1,5 +1,6 @@
module ForemanRemoteExecutionCore
class FakeScriptRunner < ForemanTasksCore::Runner::Base
+ DEFAULT_REFRESH_INTERVAL = 1
@data = [] | Fixes #<I> - Added DEFAULT_REFRESH_INTERVAL constant | theforeman_foreman_remote_execution | train | rb |
bfcabd5f6b4d048993d04cf476ee206ce7c2c31e | diff --git a/lib/offsite_payments/integrations/payu_in.rb b/lib/offsite_payments/integrations/payu_in.rb
index <HASH>..<HASH> 100755
--- a/lib/offsite_payments/integrations/payu_in.rb
+++ b/lib/offsite_payments/integrations/payu_in.rb
@@ -42,7 +42,7 @@ module OffsitePayments #:nodoc:
:address1 => 'address1',
:address2 => 'address2',
:state => 'state',
- :zip => 'zip',
+ :zip => 'zipcode',
:country => 'country'
# Which tab you want to be open default on PayU | update payu_in.rb
corrected zip parameter to from zip to zipcode | activemerchant_offsite_payments | train | rb |
1cfdaf43f1106231285b6d284b707dcbd964743b | diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Command/RequireCommand.php
+++ b/src/Composer/Command/RequireCommand.php
@@ -206,6 +206,8 @@ EOT
);
} catch (\Exception $e) {
if ($this->newlyCreated) {
+ $this->revertComposerFile(false);
+
throw new \RuntimeException('No composer.json present in the current directory ('.$this->file.'), this may be the cause of the following exception.', 0, $e);
} | Fix new file being leftover if require in new dir fails to resolve requirements | composer_composer | train | php |
35bcb87e5120074ceeade69b56dddbecbe775a63 | diff --git a/app/helpers/enjoy/powered_helper.rb b/app/helpers/enjoy/powered_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/enjoy/powered_helper.rb
+++ b/app/helpers/enjoy/powered_helper.rb
@@ -1,5 +1,5 @@
module Enjoy::PoweredHelper
- def render_powered_block
+ def render_enjoy_powered_block
content_tag :div, class: 'powered' do
ret = []
ret << content_tag(:span, class: 'powered') do
diff --git a/template.rb b/template.rb
index <HASH>..<HASH> 100644
--- a/template.rb
+++ b/template.rb
@@ -325,8 +325,14 @@ inject_into_file 'app/models/user.rb', before: /^end/ do <<-TEXT
def self.generate_first_admin_user
if User.all.count == 0
- _email_pass = 'admin@#{app_name.downcase}.ru'
- User.create(roles: ["admin"], email: _email_pass, password: _email_pass, password_confirmation: _email_pass)
+ _email_pass = 'admin@#{app_name.dasherize.downcase}.ru'
+ if User.create(roles: ["admin"], email: _email_pass, password: _email_pass, password_confirmation: _email_pass)
+ puts "User with email and password '\#{_email_pass}' was created!"
+ else
+ puts 'error'
+ end
+ else
+ puts 'error'
end
end | fix for generate user; helper rename for enjoy compatibility | enjoycreative_enjoy_cms | train | rb,rb |
4ef677af0153cd160cd2b75ee9ca1e9f3a638c56 | diff --git a/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/WaitSet.java b/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/WaitSet.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/WaitSet.java
+++ b/hazelcast/src/main/java/com/hazelcast/spi/impl/operationparker/impl/WaitSet.java
@@ -63,7 +63,7 @@ public class WaitSet implements LiveOperationsTracker, Iterable<WaitSetEntry> {
@Override
public void populate(LiveOperations liveOperations) {
for (WaitSetEntry entry : queue) {
- // we need to read out the data from the BlockedOperation; not from the ParkerOperation-container.
+ // we need to read out the data from the BlockedOperation; not from the WaitSetEntry
Operation operation = entry.getOperation();
liveOperations.add(operation.getCallerAddress(), operation.getCallId());
} | Minor doc fix in WaitSet (#<I>)
was refering to and old structure name | hazelcast_hazelcast | train | java |
7b74b9cab50ecd12ca2af51116279fce97edadd8 | diff --git a/runtime_test.go b/runtime_test.go
index <HASH>..<HASH> 100644
--- a/runtime_test.go
+++ b/runtime_test.go
@@ -305,8 +305,7 @@ func TestRestore(t *testing.T) {
// Simulate a crash/manual quit of dockerd: process dies, states stays 'Running'
cStdin, _ := container2.StdinPipe()
cStdin.Close()
- container2.State.setStopped(-1)
- time.Sleep(time.Second)
+ container2.WaitTimeout(time.Second)
container2.State.Running = true
container2.ToDisk() | Integrated @creack's feedback on TestRestore | moby_moby | train | go |
ecd6b51c278bebea75be25f3deca86af5525987c | diff --git a/lib/machined/context.rb b/lib/machined/context.rb
index <HASH>..<HASH> 100755
--- a/lib/machined/context.rb
+++ b/lib/machined/context.rb
@@ -1,4 +1,5 @@
require "padrino-helpers"
+require "rack"
require "sprockets"
module Machined | Adding Rack for Context helpers, to make sure mail_to works | petebrowne_machined | train | rb |
e1d9b9640e4732a70e17ba9856f63c053b7c9547 | diff --git a/Bridges/HttpKernel.php b/Bridges/HttpKernel.php
index <HASH>..<HASH> 100644
--- a/Bridges/HttpKernel.php
+++ b/Bridges/HttpKernel.php
@@ -7,7 +7,6 @@ use PHPPM\Bootstraps\BootstrapInterface;
use PHPPM\Bootstraps\HooksInterface;
use PHPPM\Bootstraps\RequestClassProviderInterface;
use PHPPM\Utils;
-use React\EventLoop\LoopInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use RingCentral\Psr7;
@@ -44,9 +43,8 @@ class HttpKernel implements BridgeInterface
* @param string $appBootstrap The name of the class used to bootstrap the application
* @param string|null $appenv The environment your application will use to bootstrap (if any)
* @param boolean $debug If debug is enabled
- * @param LoopInterface $loop Event loop
*/
- public function bootstrap($appBootstrap, $appenv, $debug, LoopInterface $loop)
+ public function bootstrap($appBootstrap, $appenv, $debug)
{
$appBootstrap = $this->normalizeAppBootstrap($appBootstrap); | Remove AsyncInterface (#<I>) | php-pm_php-pm-httpkernel | train | php |
a0a803a01b04becfb3c681a8eab8ab06edaa3529 | diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php
index <HASH>..<HASH> 100644
--- a/tests/ResponseTest.php
+++ b/tests/ResponseTest.php
@@ -194,4 +194,11 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
]
], $response);
}
+
+ public function testResponseWithArrayContainsArray()
+ {
+ $response = $this->response ->withArray(['test' => 'array']);
+
+ $this->assertSame('array', $response['test']);
+ }
} | Added test to cover withArray function (#<I>) | ellipsesynergie_api-response | train | php |
af23aa0b9e7f91aac1eb8dac325e10dd799eb945 | diff --git a/vanilla/core.py b/vanilla/core.py
index <HASH>..<HASH> 100644
--- a/vanilla/core.py
+++ b/vanilla/core.py
@@ -84,6 +84,8 @@ class C(object):
self.q.control([event], 0)
def poll(self, timeout=None):
+ if timeout == -1:
+ timeout = None
events = self.q.control(None, 3, timeout)
return [(e.ident, self.to_C[e.filter]) for e in events] | kqueue expects None for no timeout | cablehead_vanilla | train | py |
4f53f381e103f1b04ba20d208318f82e0a8d81d2 | diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/assets_controller.rb
+++ b/app/controllers/assets_controller.rb
@@ -23,11 +23,8 @@ class AssetsController < ApplicationController
end
@assets = Asset.search(params[:q], load: {:include => %w(user tags)}, :page => page, :per => per_page)
- @assets.each_with_hit do |result, hit|
- result.taxon = hit['_source']['taxon']
- end
- set_pagination_results(Asset, @assets, @assets.count)
+ set_pagination_results(Asset, @assets, @assets.total_count)
render :index
end | Removed property-loading from ES until we can determine how to use paging with each_with_hit | cortex-cms_cortex | train | rb |
b5b26203a500866c71533b1cd392664ac8aa4139 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -52,16 +52,16 @@ if sys.platform == 'win32':
int(get_build_version() * 10) % 10
)
try:
- os.environ[vscomntools_env] = os.environ['VS120COMNTOOLS']
+ os.environ[vscomntools_env] = os.environ['VS140COMNTOOLS']
except KeyError:
- distutils.log.warn('You probably need Visual Studio 2013 (12.0) '
+ distutils.log.warn('You probably need Visual Studio 2015 (14.0) '
'or higher')
from distutils import msvccompiler, msvc9compiler
- if msvccompiler.get_build_version() < 12.0:
- msvccompiler.get_build_version = lambda: 12.0
- if get_build_version() < 12.0:
- msvc9compiler.get_build_version = lambda: 12.0
- msvc9compiler.VERSION = 12.0
+ if msvccompiler.get_build_version() < 14.0:
+ msvccompiler.get_build_version = lambda: 14.0
+ if get_build_version() < 14.0:
+ msvc9compiler.get_build_version = lambda: 14.0
+ msvc9compiler.VERSION = 14.0
# Workaround http://bugs.python.org/issue4431 under Python <= 2.6
if sys.version_info < (2, 7):
def spawn(self, cmd): | Require VS<I> | sass_libsass-python | train | py |
6e90331883018e9090d3fb2a01408fd06e225e37 | diff --git a/test_project/manage.py b/test_project/manage.py
index <HASH>..<HASH> 100644
--- a/test_project/manage.py
+++ b/test_project/manage.py
@@ -3,7 +3,6 @@ import os
import sys
grandparent_dir = os.path.abspath(os.path.join(os.path.abspath(os.path.splitext(__file__)[0]), '../..'))
-print grandparent_dir
sys.path.insert(0, grandparent_dir)
if __name__ == "__main__": | Make manage work relative to dublincore | mredar_django-dublincore | train | py |
7cddcbf921851d8cd567cdadbca88a56110130eb | diff --git a/h2o-core/src/main/java/water/parser/FVecParseWriter.java b/h2o-core/src/main/java/water/parser/FVecParseWriter.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/parser/FVecParseWriter.java
+++ b/h2o-core/src/main/java/water/parser/FVecParseWriter.java
@@ -152,7 +152,7 @@ public class FVecParseWriter extends Iced implements StreamParseWriter {
if (_ctypes[colIdx] == Vec.T_BAD && id > 1) _ctypes[colIdx] = Vec.T_ENUM;
_nvs[colIdx].addEnum(id);
} else { // maxed out enum map
- throw new H2OParseException("Exceeded enumeration limit. Consider reparsing this column as a string.");
+ throw new H2OParseException("Exceeded enumeration limit on column #"+(colIdx+1)+" (using 1-based indexing). Consider reparsing this column as a string.");
}
}
} | Gives the column number when the enumeration limit is exceeded. | h2oai_h2o-3 | train | java |
f418408c6c0485642ab186ab1ca1cdb4a6b1692c | diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js
index <HASH>..<HASH> 100644
--- a/src/language/CSSUtils.js
+++ b/src/language/CSSUtils.js
@@ -156,7 +156,7 @@ define(function (require, exports, module) {
if (!state || !state.context) {
return false;
}
- return (state.context.type === "at");
+ return (state.context.type === "atBlock_parens");
}
/** | In CSSUtils, detect when in an @ rule correctly | adobe_brackets | train | js |
2f88d9974bf254fe7d4614e26ef3a3064d75258c | diff --git a/example/src/examples/AsyncExample.js b/example/src/examples/AsyncExample.js
index <HASH>..<HASH> 100644
--- a/example/src/examples/AsyncExample.js
+++ b/example/src/examples/AsyncExample.js
@@ -35,6 +35,7 @@ const AsyncExample = () => {
return (
<AsyncTypeahead
+ filterBy={() => true}
id="async-example"
isLoading={isLoading}
labelKey="login" | Update AsyncExample.js
Do not filter results in async example | ericgio_react-bootstrap-typeahead | train | js |
1c494092aac5ef60ab527c1bd47bb1d189c50d07 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,9 +19,11 @@ setup(name = 'jplephem',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['jplephem'], | Add claims of Python <I> and <I> compatibility | brandon-rhodes_python-jplephem | train | py |
042c2f2733189118f8fe95a03b9701e43c81c98f | diff --git a/lib/WorseReflection/Core/Inference/NodeContextResolver.php b/lib/WorseReflection/Core/Inference/NodeContextResolver.php
index <HASH>..<HASH> 100644
--- a/lib/WorseReflection/Core/Inference/NodeContextResolver.php
+++ b/lib/WorseReflection/Core/Inference/NodeContextResolver.php
@@ -59,10 +59,15 @@ class NodeContextResolver
}
/**
- * @param Node|Token|MissingToken $node
+ * @param Node|Token|MissingToken|array<MissingToken> $node
*/
private function doResolveNodeWithCache(Frame $frame, $node): NodeContext
{
+ // somehow we can get an array of missing tokens here instead of an object...
+ if (!is_object($node)) {
+ return NodeContext::none();
+ }
+
$key = 'sc:'.spl_object_hash($node);
return $this->cache->getOrSet($key, function () use ($frame, $node) { | Avoid trying to generate spl object hash for array (#<I>) | phpactor_phpactor | train | php |
a3062e291a76067bc859d24ea941da79fb2fc2fb | diff --git a/intranet/apps/eighth/views/admin/general.py b/intranet/apps/eighth/views/admin/general.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/eighth/views/admin/general.py
+++ b/intranet/apps/eighth/views/admin/general.py
@@ -132,11 +132,6 @@ def cache_view(request):
@eighth_admin_required
-def not_implemented_view(request, *args, **kwargs):
- raise NotImplementedError("This view has not been implemented yet.")
-
-
-@eighth_admin_required
def history_view(request):
history_timeframe = datetime.now() - timedelta(minutes=15)
history = { | chore(eighth): remove unused view:
not_implemented_view | tjcsl_ion | train | py |
143ec3c082547d9a0d0cfe761cbfd2143ef45ca2 | diff --git a/test/complex.test.js b/test/complex.test.js
index <HASH>..<HASH> 100644
--- a/test/complex.test.js
+++ b/test/complex.test.js
@@ -1,6 +1,7 @@
var assert = require('assert');
var numbers = require('../index.js');
var Complex = numbers.complex;
+var basic = numbers.basic;
suite('numbers', function() {
@@ -59,7 +60,7 @@ suite('numbers', function() {
var A = new Complex(3, 4);
var res = A.phase();
- assert.equal(true, (res - numbers.EPSILON < 0.9272952180016122) && (0.9272952180016122 < res + numbers.EPSILON));
+ assert.equal(true, basic.numbersEqual(res, 0.9272952180016122, numbers.EPSILON));
done();
}); | clean up complex test to use new number equality method. | numbers_numbers.js | train | js |
b928ab69e3284295c7bf9a632c76bd3aa8ef8e54 | diff --git a/lib/dpl/provider/pages.rb b/lib/dpl/provider/pages.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/provider/pages.rb
+++ b/lib/dpl/provider/pages.rb
@@ -83,7 +83,12 @@ module DPL
def api # Borrowed from Releases provider
error 'gh-token must be provided for Pages provider to work.' unless @gh_token
- @api ||= Octokit::Client.new(:access_token => @gh_token)
+ return @api if @api
+
+ api_opts = { :access_token => @gh_token }
+ api_opts[:api_endpoint] = "https://#{gh_url}/api/v3/" unless @gh_url.empty?
+
+ @api = Octokit::Client.new(api_opts)
end
def user | Consider GHE endpoint for Pages deployment | travis-ci_dpl | train | rb |
f8b665224f2e643bf0d81583110e4e2c68ae7788 | diff --git a/mod/quiz/report/attemptsreport_table.php b/mod/quiz/report/attemptsreport_table.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/report/attemptsreport_table.php
+++ b/mod/quiz/report/attemptsreport_table.php
@@ -152,7 +152,11 @@ abstract class quiz_attempts_report_table extends table_sql {
* @return string HTML content to go inside the td.
*/
public function col_state($attempt) {
- return quiz_attempt::state_name($attempt->state);
+ if (!is_null($attempt->attempt)) {
+ return quiz_attempt::state_name($attempt->state);
+ } else {
+ return '-';
+ }
}
/** | MDL-<I> quiz reports: error when showing users without attempts.
We were not checking if attempt state was null before trying to convert it to a string. | moodle_moodle | train | php |
5541a96319c2878b88a24c017bcbf61c1c5c1476 | diff --git a/satpy/tests/reader_tests/test_eum_base.py b/satpy/tests/reader_tests/test_eum_base.py
index <HASH>..<HASH> 100644
--- a/satpy/tests/reader_tests/test_eum_base.py
+++ b/satpy/tests/reader_tests/test_eum_base.py
@@ -17,12 +17,10 @@
# satpy. If not, see <http://www.gnu.org/licenses/>.
"""EUMETSAT base reader tests package."""
+import numpy as np
import unittest
from datetime import datetime
-import numpy as np
-from satpy.readers.seviri_base import mpef_product_header
-
from satpy.readers.eum_base import (
get_service_mode,
recarray2dict,
@@ -31,6 +29,7 @@ from satpy.readers.eum_base import (
time_cds_short,
timecds2datetime,
)
+from satpy.readers.seviri_base import mpef_product_header
class TestMakeTimeCdsDictionary(unittest.TestCase): | Updated test script - to optimise imports | pytroll_satpy | train | py |
08952d5ca7d619b70c77e9f8592729f5959fd0b4 | diff --git a/src/unistorage/adapters/amazon.py b/src/unistorage/adapters/amazon.py
index <HASH>..<HASH> 100644
--- a/src/unistorage/adapters/amazon.py
+++ b/src/unistorage/adapters/amazon.py
@@ -101,5 +101,8 @@ class AmazonS3(Adapter):
key = self.bucket.get_key(name)
if not key:
raise FileNotFound(name)
- metadata = key.get_metadata()
- return metadata
+ return key.size
+
+ def list(self):
+ for key in self.bucket.list():
+ yield key.name | implemented size() and list() for amazon s3 adapter | jpvanhal_siilo | train | py |
f1490157a6b1efd9985f0bcd1b4e228f9d92713c | diff --git a/lib/cursor.js b/lib/cursor.js
index <HASH>..<HASH> 100644
--- a/lib/cursor.js
+++ b/lib/cursor.js
@@ -53,7 +53,7 @@ Cursor.prototype._next = function(callback) {
var self = this;
return new Promise(function(resolve, reject) {
if (self._closed === true) {
- reject(new Err.ReqlDriverError('You cannot call `next` on a closed '+this._type))
+ reject(new Err.ReqlDriverError('You cannot call `next` on a closed '+self._type).setOperational())
}
else if ((self._data.length === 0) && (self._canFetch === false)) {
reject(new Err.ReqlDriverError('No more rows in the '+self._type.toLowerCase()).setOperational()) | Fix an unhandled error because we are not setting an error operational | neumino_rethinkdbdash | train | js |
9a6ab4f6798a2c858ea92a5d33737a62bf425bdf | diff --git a/src/sap.f/test/sap/f/qunit/DynamicPageWithStickySubheader.qunit.js b/src/sap.f/test/sap/f/qunit/DynamicPageWithStickySubheader.qunit.js
index <HASH>..<HASH> 100644
--- a/src/sap.f/test/sap/f/qunit/DynamicPageWithStickySubheader.qunit.js
+++ b/src/sap.f/test/sap/f/qunit/DynamicPageWithStickySubheader.qunit.js
@@ -511,8 +511,8 @@ sap.ui.define([
setTimeout(function() {
// Assert
assert.strictEqual(this.oDynamicPage._getScrollBar().$("sbcnt").height(),
- this.oDynamicPage._getTitleHeight() + this.oDynamicPage._oStickySubheader.$().height() + this.oDynamicPage.$wrapper[0].scrollHeight,
- "Scrollbar content size includes title, scrollheight of wrapper and the sticky subheader");
+ Math.round(this.oDynamicPage._getTitleHeight() + this.oDynamicPage._oStickySubheader.$().height() + this.oDynamicPage.$wrapper[0].scrollHeight,
+ "Scrollbar content size includes title, scrollheight of wrapper and the sticky subheader"));
fnDone();
}.bind(this), 200);
}); | [FIX] sap.f.DynamicPage: Fix failing QUnit on Firefox
Problem: On Firefox a fraction value is returned for the height of
DynamicPageTitle.
Solution: The fraction value is rounded.
BCP: <I>
Change-Id: Ib<I>eb<I>c<I>df<I>d<I>fd6b6ce5cc | SAP_openui5 | train | js |
3492a3ed6e7e6fa5a3995b89d9344da7f98c961c | diff --git a/client/lib/importer/store.js b/client/lib/importer/store.js
index <HASH>..<HASH> 100644
--- a/client/lib/importer/store.js
+++ b/client/lib/importer/store.js
@@ -98,7 +98,7 @@ const ImporterStore = createReducerStore( function( state, payload ) {
break;
}
- newState = state
+ newState = newState
.setIn( [ 'importers', action.importerStatus.importerId ], Immutable.fromJS( action.importerStatus ) );
break; | Bug fix: don't ignore state updates on fetch from importer API | Automattic_wp-calypso | train | js |
8144babe3e5815e2903059e1a7616673d80a6a73 | diff --git a/flashpolicies/tests/policies.py b/flashpolicies/tests/policies.py
index <HASH>..<HASH> 100644
--- a/flashpolicies/tests/policies.py
+++ b/flashpolicies/tests/policies.py
@@ -124,7 +124,7 @@ class PolicyGeneratorTests(TestCase):
"""
policy = policies.Policy()
- self.assertRaises(TypeError, policy.site_control, 'not-valid')
+ self.assertRaises(TypeError, policy.metapolicy, 'not-valid')
def test_element_order(self):
""" | Fix a bug caught by coverage.py; thanks, Ned | ubernostrum_django-flashpolicies | train | py |
99daeef9df575e1b538c31b3765c0c27ccb6286c | diff --git a/src/main/python/yamlreader/__init__.py b/src/main/python/yamlreader/__init__.py
index <HASH>..<HASH> 100644
--- a/src/main/python/yamlreader/__init__.py
+++ b/src/main/python/yamlreader/__init__.py
@@ -2,6 +2,6 @@
from __future__ import print_function, absolute_import, unicode_literals, division
-from .yamlreader import data_merge, yaml_load, YamlReaderError
+from .yamlreader import data_merge, yaml_load, YamlReaderError, __main
-__all__ = ['data_merge', 'yaml_load', 'YamlReaderError']
+__all__ = ['data_merge', 'yaml_load', 'YamlReaderError', '__main'] | expose main launcher in package too
This unbreaks the setuptools entry point since it wants to call
`yamlreader.__main` and not `yamlreader.yamlreader.__main`
This resolves #9 | Scout24_yamlreader | train | py |
013b32e22bfb3256c07d0f479905cbe469782519 | diff --git a/src/compiler.js b/src/compiler.js
index <HASH>..<HASH> 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -241,6 +241,9 @@
address += size;
}
}
+ labels.palette = 0xE000; //#TODO stealing on test
+ labels.sprites = 0xE000 + 32; //#TODO stealing on test
+
for (var l in ast) {
leaf = ast[l];
if (leaf.type == 'S_DIRECTIVE'){
diff --git a/tests/movingsprite_test.js b/tests/movingsprite_test.js
index <HASH>..<HASH> 100644
--- a/tests/movingsprite_test.js
+++ b/tests/movingsprite_test.js
@@ -5,7 +5,7 @@ var sys = require('util');
var compiler = require('../src/compiler.js');
var lines = fs.readFileSync(__dirname + '/../fixtures/movingsprite/movingsprite.asm', 'utf8').split("\n");
-lines.length = 58;
+lines.length = 73;
var code = lines.join("\n");
var bin = fs.readFileSync(__dirname + '/../fixtures/movingsprite/movingsprite.nes', 'binary'); | stealing on movingsprite_test so i can walk slowly on the source | gutomaia_nodeNES | train | js,js |
e844fff272d87921fd3bc2c45cb9a66804bd5344 | diff --git a/openquake/commands/plot.py b/openquake/commands/plot.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/plot.py
+++ b/openquake/commands/plot.py
@@ -274,9 +274,9 @@ def make_figure_rupture_info(extractors, what):
info = ex.get(what)
fig, ax = plt.subplots()
ax.grid(True)
- sitecol = ex.get('sitecol')
- bmap = basemap('cyl', sitecol)
- bmap.plot(sitecol['lon'], sitecol['lat'], '+')
+ # sitecol = ex.get('sitecol')
+ # bmap = basemap('cyl', sitecol)
+ # bmap.plot(sitecol['lon'], sitecol['lat'], '+')
n = 0
tot = 0
for rec in info: | Removed basemap in plot rupture_info
Former-commit-id: <I>a3c4d2b<I>ffc8dc7bb4ad<I>f1ac<I>a<I>b | gem_oq-engine | train | py |
20ba447689235df59a2368b15c10f00d95fb81d3 | diff --git a/lib/helper.js b/lib/helper.js
index <HASH>..<HASH> 100644
--- a/lib/helper.js
+++ b/lib/helper.js
@@ -145,7 +145,7 @@ class Helper {
const method = Reflect.get(classType.prototype, 'emit');
Reflect.set(classType.prototype, 'emit', function(event, ...args) {
let argsText = [JSON.stringify(event)].concat(args.map(stringifyArgument)).join(', ');
- if (debug.enabled)
+ if (debug.enabled && this.listenerCount(event))
debug(`${className}.emit(${argsText})`);
if (apiCoverage && this.listenerCount(event))
apiCoverage.set(`${className}.emit(${JSON.stringify(event)})`, true); | [DEBUG] Trace only those events which have listeners. (#<I>)
The `DEBUG=*page npm run unit` is too verbose due to events spamming
the console.
This patch starts tracing emitted events only if there are any
listeners. | GoogleChrome_puppeteer | train | js |
b07663347a5b662fb468799cd8ad46aec1d4a802 | diff --git a/shoebot/core/__init__.py b/shoebot/core/__init__.py
index <HASH>..<HASH> 100644
--- a/shoebot/core/__init__.py
+++ b/shoebot/core/__init__.py
@@ -39,5 +39,4 @@ from cairo_canvas import CairoCanvas
from drawqueue import DrawQueue
from drawqueue_sink import DrawQueueSink
-from cairo_drawqueue import CairoDrawQueue
from cairo_sink import CairoImageSink | More removal of cairo draw queue. | shoebot_shoebot | train | py |
8bb82b3c3251e85e7ea5cb4fb1318a0003b0b2fe | diff --git a/bin/php-cs-fixer-config.php b/bin/php-cs-fixer-config.php
index <HASH>..<HASH> 100644
--- a/bin/php-cs-fixer-config.php
+++ b/bin/php-cs-fixer-config.php
@@ -31,7 +31,6 @@ return
->level(CS\FixerInterface::PSR1_LEVEL)
->fixers([
'align_double_arrow',
- 'align_equals',
'blankline_after_open_tag',
'concat_with_spaces',
'self_accessor', | Removed align_equals rule.
Fixes #2 | sabre-io_cs | train | php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.