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
|
---|---|---|---|---|---|
02098c16d8599df020146e491833fcaa3a390691
|
diff --git a/lib/database_cleaner/data_mapper/truncation.rb b/lib/database_cleaner/data_mapper/truncation.rb
index <HASH>..<HASH> 100644
--- a/lib/database_cleaner/data_mapper/truncation.rb
+++ b/lib/database_cleaner/data_mapper/truncation.rb
@@ -101,7 +101,7 @@ module DataMapper
def storage_names(repository = :default)
sql = <<-SQL.compress_lines
SELECT table_name FROM "information_schema"."tables"
- WHERE table_schema = current_schema()
+ WHERE table_schema = current_schema() and table_type = 'BASE TABLE'
SQL
select(sql)
end
|
Don't attempt to truncate postgres views
This ensures that only proper tables are truncated, rather than
attempting to truncate views (which isn't possible).
|
DatabaseCleaner_database_cleaner
|
train
|
rb
|
d25b5dd31f3d836882734ff6f50f7d9944caac94
|
diff --git a/bittrex/bittrex.py b/bittrex/bittrex.py
index <HASH>..<HASH> 100644
--- a/bittrex/bittrex.py
+++ b/bittrex/bittrex.py
@@ -379,7 +379,7 @@ class Bittrex(object):
Endpoint:
1.1 /market/cancel
- 2.0 /key/market/cancel
+ 2.0 /key/market/tradecancel
:param uuid: uuid of buy or sell order
:type uuid: str
@@ -388,7 +388,7 @@ class Bittrex(object):
"""
return self._api_query(path_dict={
API_V1_1: '/market/cancel',
- API_V2_0: '/key/market/cancel'
+ API_V2_0: '/key/market/tradecancel'
}, options={'uuid': uuid, 'orderid': uuid}, protection=PROTECTION_PRV)
def get_open_orders(self, market=None):
|
Slazarov patch 1 (#<I>)
* Fixed cancel API<I> endpoint
Fixed the cancel API<I> endpoint from '/key/market/cancel' to '/key/market/tradecancel'.
* Update bittrex.py
|
ericsomdahl_python-bittrex
|
train
|
py
|
e58c2880ab045b6859d65c648a731e2445e2aeac
|
diff --git a/modules/custom/d_p/src/Helper/ParagraphModifiersHelper.php b/modules/custom/d_p/src/Helper/ParagraphModifiersHelper.php
index <HASH>..<HASH> 100644
--- a/modules/custom/d_p/src/Helper/ParagraphModifiersHelper.php
+++ b/modules/custom/d_p/src/Helper/ParagraphModifiersHelper.php
@@ -12,9 +12,10 @@ use Drupal\paragraphs\Entity\Paragraph;
*
* @deprecated in droopler:8.x-2.2 and is removed from droopler:8.x-2.3.
* As this is working on the particular field instance,
- * we have unified and moved all the methods to the field list class directly.
+ * we have unified and moved all the methods directly to the field list class:
+ * Drupal\d_p\Plugin\Field\ConfigurationStorageFieldItemListInterface
*
- * @see Drupal\d_p\Plugin\Field\FieldType\ConfigurationStorageInterface.
+ * @see https://www.drupal.org/project/droopler/issues/3180465
*/
class ParagraphModifiersHelper {
|
Issue #<I> by sayco: Update paragraph modifier annotation
|
droptica_droopler
|
train
|
php
|
dd734782fb93615f7d48398af545c0cc1a75acbe
|
diff --git a/src/bitExpert/Phing/SecurityChecker/SecurityCheckerTask.php b/src/bitExpert/Phing/SecurityChecker/SecurityCheckerTask.php
index <HASH>..<HASH> 100644
--- a/src/bitExpert/Phing/SecurityChecker/SecurityCheckerTask.php
+++ b/src/bitExpert/Phing/SecurityChecker/SecurityCheckerTask.php
@@ -62,7 +62,7 @@ class SecurityCheckerTask extends \Task
throw new \BuildException('Lockfile needs to be set!');
}
- if (!file_exists($this->lockFile) or !is_readable($this->lockFile)) {
+ if (!file_exists($this->lockFile) || !is_readable($this->lockFile)) {
throw new \BuildException('Given Lockfile does not exist or is not readable!');
}
|
SensioLabs Insight Fix: Logical operators should be avoided
|
bitExpert_phing-securitychecker
|
train
|
php
|
222767993ab13f80fab7eeda0c28c07c68c2fc29
|
diff --git a/cherrypy/lib/profiler.py b/cherrypy/lib/profiler.py
index <HASH>..<HASH> 100644
--- a/cherrypy/lib/profiler.py
+++ b/cherrypy/lib/profiler.py
@@ -38,13 +38,14 @@ def new_func_strip_path(func_name):
if filename.endswith("__init__.py"):
return os.path.basename(filename[:-12]) + filename[-12:], line, name
return os.path.basename(filename), line, name
-import pstats
-pstats.func_strip_path = new_func_strip_path
try:
import profile
+ import pstats
+ pstats.func_strip_path = new_func_strip_path
except ImportError:
profile = None
+ pstats = None
import warnings
msg = ("Your installation of Python doesn't have a profile module. "
"If you're on Debian, you can apt-get python2.4-profiler from "
|
Oops. Debian is missing the pstats module too.
|
cherrypy_cheroot
|
train
|
py
|
ef536f35f09038f92f24b9f2de4c8fe464ab36c2
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -72,9 +72,7 @@ function tryCatch (fn, opts, cb) {
cb = isAsyncFn
? utils.once(utils.dezalgo(cb))
: utils.once(cb)
- opts = opts && typeof opts === 'object'
- ? opts
- : {}
+ opts = utils.extend({}, opts)
opts.passCallback = typeof opts.passCallback === 'boolean'
? opts.passCallback
: isAsyncFn // if `fn` is async, pass callback automatically
diff --git a/utils.js b/utils.js
index <HASH>..<HASH> 100644
--- a/utils.js
+++ b/utils.js
@@ -11,9 +11,11 @@ var once = require('once')
var dezalgo = require('dezalgo')
var tryCatch = require('try-catch-callback')
var isAsyncFn = require('is-async-function')
+var extendShallow = require('extend-shallow')
var utils = {}
utils.once = once
+utils.extend = extendShallow
utils.dezalgo = dezalgo
utils.isAsync = isAsyncFn
utils.tryCatchCallback = tryCatch
|
fix(options): immutable options object
use extend-shallow to shallow clone passed options object, better defaults
fixes #7
|
hybridables_try-catch-core
|
train
|
js,js
|
016a650925369bf3819210d7fbcec6283f7e6e96
|
diff --git a/src/Graviton/FileBundle/Controller/FileController.php b/src/Graviton/FileBundle/Controller/FileController.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/FileBundle/Controller/FileController.php
+++ b/src/Graviton/FileBundle/Controller/FileController.php
@@ -52,9 +52,14 @@ class FileController extends RestController
// store id of new record so we dont need to reparse body later when needed
$request->attributes->set('id', $record->getId());
+ $data = $request->getContent();
+ if (is_resource($data)) {
+ throw new \LogigException('/file does not support storing resources');
+ }
+
// add file to storage
$file = new File($record->getId(), $this->gaufrette);
- $file->setContent($request->getContent());
+ $file->setContent($data);
// update record with file metadata
$meta = new FileMetadata;
|
Check that content isn't resource
|
libgraviton_graviton
|
train
|
php
|
a127dcd78f744800bac29a9f4f9a5b61dcea5e6c
|
diff --git a/src/main/java/wyc/commands/Compile.java b/src/main/java/wyc/commands/Compile.java
index <HASH>..<HASH> 100644
--- a/src/main/java/wyc/commands/Compile.java
+++ b/src/main/java/wyc/commands/Compile.java
@@ -79,6 +79,10 @@ public class Compile extends AbstractProjectCommand<Compile.Result> {
*/
protected boolean verificationConditions = false;
+ /**
+ * Signals the proof should be printed during verification.
+ */
+ protected boolean proof = false;
/**
* Identifies which whiley source files should be considered for
@@ -134,6 +138,7 @@ public class Compile extends AbstractProjectCommand<Compile.Result> {
"verbose",
"verify",
"vcg",
+ "proof",
"brief"
};
@@ -173,6 +178,9 @@ public class Compile extends AbstractProjectCommand<Compile.Result> {
case "vcg":
this.verificationConditions = true;
break;
+ case "proof":
+ this.proof = true;
+ break;
default:
super.set(option, value);
}
@@ -358,6 +366,9 @@ public class Compile extends AbstractProjectCommand<Compile.Result> {
if(verbose) {
wyalBuildTask.setLogger(logger);
}
+ if(proof) {
+ prover.setPrintProof(true);
+ }
wyalBuildTask.setVerify(verify);
//
project.add(new StdBuildRule(wyalBuildTask, wyaldir, wyalIncludes, wyalExcludes, wycsdir));
|
Add support for printing proofs
This adds support for a command-line option which causes proofs to be
printed.
|
Whiley_WhileyCompiler
|
train
|
java
|
73d276d0612599d4cded1431209560949256197a
|
diff --git a/astroid/inference.py b/astroid/inference.py
index <HASH>..<HASH> 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -960,6 +960,7 @@ def infer_functiondef(self, context=None):
parent=self.parent,
col_offset=self.col_offset,
)
+ prop_func.postinit(body=[], args=self.args)
yield prop_func
diff --git a/astroid/interpreter/objectmodel.py b/astroid/interpreter/objectmodel.py
index <HASH>..<HASH> 100644
--- a/astroid/interpreter/objectmodel.py
+++ b/astroid/interpreter/objectmodel.py
@@ -759,7 +759,9 @@ class PropertyModel(ObjectModel):
caller=caller, context=context
)
- return PropertyFuncAccessor(name="fget", parent=self._instance)
+ property = PropertyFuncAccessor(name="fget", parent=self._instance)
+ property.postinit(args=func.args, body=func.body)
+ return property
@property
def attr_setter(self):
|
Set arguments on inferred properties and property descriptors such as fget()
|
PyCQA_astroid
|
train
|
py,py
|
6eb94727732310a51d59535263575d711fd9cd54
|
diff --git a/src/cli/preprocess.test.js b/src/cli/preprocess.test.js
index <HASH>..<HASH> 100644
--- a/src/cli/preprocess.test.js
+++ b/src/cli/preprocess.test.js
@@ -45,6 +45,10 @@ describe('preprocess command-line interface', () => {
commandProcessor.parse(root, ['preprocess', '--help']);
commandProcessor.showHelp((helpText) => {
expect(helpText).to.include('Preprocess a Wiring file (ino) into a C++ file (cpp)');
+ expect(helpText).to.include('Options:');
+ expect(helpText).to.include(' --name Filename and path to include in the preprocessed file. Default to the input file name [string]');
+ expect(helpText).to.include(' --saveTo Filename for the preprocessed file [string]');
+ expect(helpText).to.include('Examples:');
expect(helpText).to.include('particle preprocess app.ino');
expect(helpText).to.include('particle preprocess - --name app.ino --saveTo -');
});
|
add test assertions around `preprocess` command options
|
particle-iot_particle-cli
|
train
|
js
|
835676148e32817599ed4d9f57cfb579c7268e6a
|
diff --git a/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java b/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java
index <HASH>..<HASH> 100644
--- a/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java
+++ b/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java
@@ -141,14 +141,20 @@ public class BreakpointStoreOnCache implements DownloadStore {
@Override
public boolean markFileDirty(int id) {
if (!fileDirtyList.contains(id)) {
- fileDirtyList.add(id);
- return true;
+ synchronized (fileDirtyList) {
+ if (!fileDirtyList.contains(id)) {
+ fileDirtyList.add(id);
+ return true;
+ }
+ }
}
return false;
}
@Override public boolean markFileClear(int id) {
- return fileDirtyList.remove(Integer.valueOf(id));
+ synchronized (fileDirtyList) {
+ return fileDirtyList.remove(Integer.valueOf(id));
+ }
}
@Override public synchronized void remove(int id) {
|
fix: fix raise IndexOutOfBoundsException issue because fileDirtyList exposed with non-thread-safe
|
lingochamp_okdownload
|
train
|
java
|
22079757b8b32f42790939168e1a1afe5f594147
|
diff --git a/structr-ui/src/main/resources/structr/js/elements.js b/structr-ui/src/main/resources/structr/js/elements.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/elements.js
+++ b/structr-ui/src/main/resources/structr/js/elements.js
@@ -117,7 +117,7 @@ var _Elements = {
},
{
elements: ['button'],
- attrs: ['name', 'type', 'checked', 'selected', 'value', 'size', 'multiple', 'disabled', 'autofocus', 'placeholder', 'onclick', 'style']
+ attrs: ['name', 'type', 'checked', 'selected', 'value', 'size', 'multiple', 'disabled', 'autofocus', 'placeholder', 'onclick', 'style', 'title']
},
{
elements: ['select', 'option'],
|
UI: Adds title attribute to default set of attributes that is shown for buttons
|
structr_structr
|
train
|
js
|
21ec9ff48c74c69f63ee0bcb04c001f01e3530ca
|
diff --git a/app/src/components/Resources/index.js b/app/src/components/Resources/index.js
index <HASH>..<HASH> 100644
--- a/app/src/components/Resources/index.js
+++ b/app/src/components/Resources/index.js
@@ -22,6 +22,13 @@ export default function Resources() {
url={'https://protocols.opentrons.com/'}
/>
</CardRow>
+ <CardRow>
+ <ResourceCard
+ title="Python Protocol API Documentation"
+ description="Browse documentation for the OT-2 Python Protocol API"
+ url={'https://docs.opentrons.com/'}
+ />
+ </CardRow>
</CardContainer>
)
}
|
feat(app): add link to docs in resources card (#<I>)
|
Opentrons_opentrons
|
train
|
js
|
b5b3800bc5442d87d24eb1ece0b4709cc5b7f089
|
diff --git a/src/draw.js b/src/draw.js
index <HASH>..<HASH> 100644
--- a/src/draw.js
+++ b/src/draw.js
@@ -153,7 +153,7 @@ function drawObjectList(gl, objectsToDraw) {
drawBufferInfo(gl, bufferInfo, type, object.count, object.offset, object.instanceCount);
});
- if (lastUsedBufferInfo.vertexArrayObject) {
+ if (lastUsedBufferInfo && lastUsedBufferInfo.vertexArrayObject) {
gl.bindVertexArray(null);
}
}
|
Fixes uncaught TypeError in certain conditions
|
greggman_twgl.js
|
train
|
js
|
b1637f42629ccae4cc1b8db920a27810112345c5
|
diff --git a/lib/fastr/application.rb b/lib/fastr/application.rb
index <HASH>..<HASH> 100644
--- a/lib/fastr/application.rb
+++ b/lib/fastr/application.rb
@@ -175,17 +175,18 @@ module Fastr
def setup_controller(controller, env, vars)
controller.env = env
- controller.params = vars
controller.headers = {}
+ queryStringParams = {}
CGI::parse(env['QUERY_STRING']).each do |k,v|
if v.length == 1
- controller.params[k] = v[0]
+ queryStringParams[k] = v[0]
else
- controller.params[k] = v
+ queryStringParams[k] = v
end
end
+ controller.params = queryStringParams.merge(vars)
controller.cookies = get_cookies(env)
|
Updated merging of query string params.
|
chrismoos_fastr
|
train
|
rb
|
8edd6dded5cdf2a6b418a2d7b6543202511487c8
|
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
@@ -4,12 +4,16 @@ module.exports = function(config){
files : [
'app/lib/angular/angular.js',
- 'app/lib/angular/angular-*.js',
+ 'app/lib/angular/angular-.js',
'test/lib/angular/angular-mocks.js',
'app/js/**/*.js',
'test/unit/**/*.js'
],
+ exclude : [
+ 'app/lib/angular/*.min.js'
+ ],
+
autoWatch : true,
frameworks: ['jasmine'],
@@ -20,7 +24,7 @@ module.exports = function(config){
'karma-junit-reporter',
'karma-chrome-launcher',
'karma-firefox-launcher',
- 'karma-jasmine'
+ 'karma-jasmine'
],
junitReporter : {
|
fix(karma): Excluded minified files from unit test
|
angular_angular-seed
|
train
|
js
|
4c18c41f51b2c8a950dba3afd74454eb5487af85
|
diff --git a/aa_composer.js b/aa_composer.js
index <HASH>..<HASH> 100644
--- a/aa_composer.js
+++ b/aa_composer.js
@@ -281,7 +281,7 @@ function readMcUnit(conn, mci, handleUnit) {
function readLastUnit(conn, handleUnit) {
conn.query("SELECT unit, main_chain_index FROM units ORDER BY main_chain_index DESC LIMIT 1", function (rows) {
- if (rows.length !== 1) {
+ if (rows.length !== 1 || !rows[0].main_chain_index) {
if (!conf.bLight)
throw Error("found " + rows.length + " last units");
var objMcUnit = {
@@ -294,8 +294,6 @@ function readLastUnit(conn, handleUnit) {
};
return handleUnit(objMcUnit);
}
- if (!rows[0].main_chain_index)
- throw Error("no mci on last unit?");
readUnit(conn, rows[0].unit, handleUnit);
});
}
|
handle null mci in light clients
|
byteball_ocore
|
train
|
js
|
525aa4e50ffcee7b19218f7914d3928735e3ad58
|
diff --git a/aliyun/log/util.py b/aliyun/log/util.py
index <HASH>..<HASH> 100755
--- a/aliyun/log/util.py
+++ b/aliyun/log/util.py
@@ -184,8 +184,8 @@ class Util(object):
def parse_timestamp(tm, fmt="%Y-%m-%d %H:%M:%S"):
- if isinstance(tm, (int, float) or
- (isinstance(tm, (six.text_type, six.binary_type)) and tm.isdigit())):
+ if isinstance(tm, (int, float)) or \
+ (isinstance(tm, (six.text_type, six.binary_type)) and tm.isdigit()):
return int(tm)
if six.PY2:
|
fix the bug in time parsing
|
aliyun_aliyun-log-python-sdk
|
train
|
py
|
9194af89a681822fb693a9010bd44361e4975588
|
diff --git a/src/properties/class-papi-property-user.php b/src/properties/class-papi-property-user.php
index <HASH>..<HASH> 100644
--- a/src/properties/class-papi-property-user.php
+++ b/src/properties/class-papi-property-user.php
@@ -29,7 +29,7 @@ class Papi_Property_User extends Papi_Property_Dropdown {
}
if ( is_numeric( $value ) ) {
- return new WP_User( $value );
+ return $value === 0 ? null : new WP_User( $value );
}
return $value;
|
User property should return null when user id is zero
|
wp-papi_papi
|
train
|
php
|
9095812a7cfbf4e287e4a16fa0eccd7e2ddaf075
|
diff --git a/nhlib/geo/geodetic.py b/nhlib/geo/geodetic.py
index <HASH>..<HASH> 100644
--- a/nhlib/geo/geodetic.py
+++ b/nhlib/geo/geodetic.py
@@ -100,7 +100,14 @@ def distance(lons1, lats1, depths1, lons2, lats2, depths2):
def min_geodetic_distance(mlons, mlats, slons, slats):
- # TODO: document, unittest
+ """
+ Same as :func:`min_distance`, but calculates only minimum geodetic distance
+ (doesn't accept depth values) and doesn't support ``indices=True`` mode.
+
+ This is an optimized version of :meth:`min_distance` that is suitable
+ for calculating the minimum distance between first mesh and each point
+ of the second mesh when both are defined on the earth surface.
+ """
assert mlons.shape == mlats.shape
slons, slats = numpy.array(slons), numpy.array(slats)
assert slons.shape == slats.shape
|
geo/geodetic [doc]: documented min_geodetic_distance()
|
gem_oq-engine
|
train
|
py
|
df5441e22154ebb603e5f5f9ac14b528e15b47e3
|
diff --git a/lib/puppet/provider/package/dnf.rb b/lib/puppet/provider/package/dnf.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider/package/dnf.rb
+++ b/lib/puppet/provider/package/dnf.rb
@@ -28,7 +28,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do
end
end
- defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => ['22', '23', '24']
+ defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => ['22', '23', '24', '25']
def self.update_command
# In DNF, update is deprecated for upgrade
|
(PUP-<I>) dnf provider does not support Fedora <I> (#<I>)
Update dnf provider to allow use with Fedora <I>.
|
puppetlabs_puppet
|
train
|
rb
|
5d67afe9c9b3106b5ff9e5d95e98451fa95701d5
|
diff --git a/lib/Gitlab/ResultPager.php b/lib/Gitlab/ResultPager.php
index <HASH>..<HASH> 100644
--- a/lib/Gitlab/ResultPager.php
+++ b/lib/Gitlab/ResultPager.php
@@ -109,7 +109,7 @@ class ResultPager implements ResultPagerInterface
*
* @return bool
*/
- protected function has($key)
+ protected function has(string $key)
{
$lastResponse = $this->client->getLastResponse();
if (null == $lastResponse) {
@@ -129,7 +129,7 @@ class ResultPager implements ResultPagerInterface
*
* @return array<string,mixed>
*/
- protected function get($key)
+ protected function get(string $key)
{
if (!$this->has($key)) {
return [];
|
Added proper typing to the result pager
|
m4tthumphrey_php-gitlab-api
|
train
|
php
|
5e9b31a33e9c82bc3229923d41e154272dd5683e
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,6 +10,7 @@ setup(
packages = find_packages(),
install_requires = [
'django-photologue==2.3',
+ 'django-tagging==0.3.1',
],
include_package_data=True,
)
|
added django tagging requirement
|
praekelt_panya
|
train
|
py
|
c6a7fc54dc2d06fe291f15a8415fedb1c3137348
|
diff --git a/lib/oauth2/error.rb b/lib/oauth2/error.rb
index <HASH>..<HASH> 100644
--- a/lib/oauth2/error.rb
+++ b/lib/oauth2/error.rb
@@ -8,7 +8,7 @@ module OAuth2
response.error = self
@response = response
if response.parsed.is_a?(Hash)
- @code = response.parsed['error'].to_sym
+ @code = response.parsed['error']
@description = response.parsed['error_description']
end
end
diff --git a/spec/oauth2/client_spec.rb b/spec/oauth2/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/oauth2/client_spec.rb
+++ b/spec/oauth2/client_spec.rb
@@ -146,7 +146,7 @@ describe OAuth2::Client do
begin
subject.request(:get, '/unauthorized')
rescue Exception => e
- e.code.should == error_value.to_sym
+ e.code.should == error_value
e.description.should == error_description_value
end
end
|
Don't coerce error value into symbol
|
oauth-xx_oauth2
|
train
|
rb,rb
|
0a75328db5e9f096b715799b55dc9bba0df5651d
|
diff --git a/.storybook/Badge.js b/.storybook/Badge.js
index <HASH>..<HASH> 100644
--- a/.storybook/Badge.js
+++ b/.storybook/Badge.js
@@ -1,10 +1,11 @@
+import React from 'react'
import { storiesOf } from '@storybook/react'
import { withInfo } from '@storybook/addon-info'
import { Badge } from '../src'
import { YelowBadge } from '../src'
storiesOf('Badge', module)
- .add('Typography component', withInfo({
+ .add('Badge component', withInfo({
inline: true,
text: 'Use the <Badge /> component to render a primitive badge.'
})(() => (
diff --git a/.storybook/Button.js b/.storybook/Button.js
index <HASH>..<HASH> 100644
--- a/.storybook/Button.js
+++ b/.storybook/Button.js
@@ -1,3 +1,4 @@
+import React from 'react'
import { storiesOf } from '@storybook/react'
import { Button } from '../src'
|
Adds React back to Button and Badge stories
|
jrs-innovation-center_design-system
|
train
|
js,js
|
db9033c86efc385f0bc06382567419e6d0f448b1
|
diff --git a/modules/directives/date/date.js b/modules/directives/date/date.js
index <HASH>..<HASH> 100644
--- a/modules/directives/date/date.js
+++ b/modules/directives/date/date.js
@@ -76,19 +76,31 @@ angular.module('ui.directives')
if ( attrs.uiDateFormat === '' ) {
// Default to ISO formatting
modelCtrl.$formatters.push(function(value) {
- return new Date(value);
+ if (value)
+ return new Date(value);
+ else
+ return value;
});
modelCtrl.$parsers.push(function(value){
- return value.toISOString();
+ if (value)
+ return value.toISOString();
+ else
+ return value;
});
} else {
var format = attrs.uiDateFormat;
// Use the datepicker with the attribute value as the format string to convert to and from a string
modelCtrl.$formatters.push(function(value) {
- return $.datepicker.parseDate(format, value);
+ if (value)
+ return $.datepicker.parseDate(format, value);
+ else
+ return value;
});
modelCtrl.$parsers.push(function(value){
- return $.datepicker.formatDate(format, value);
+ if (value)
+ return $.datepicker.formatDate(format, value);
+ else
+ return value;
});
}
}
|
Added graceful degredation to uiDateFormat when the values are falsy
|
angular-ui_ui-scrollpoint
|
train
|
js
|
5b6b8b3cc9b4c9c438c077b827c7a7cd6c45ca82
|
diff --git a/lib/jasmine_rails/jhw_adapter.rb b/lib/jasmine_rails/jhw_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/jasmine_rails/jhw_adapter.rb
+++ b/lib/jasmine_rails/jhw_adapter.rb
@@ -8,6 +8,7 @@ module JasmineRails
@options = Jasmine::Headless::Options.new
@runner = instantiate_runner
Jasmine::Headless::CacheableAction.enabled = @options[:enable_cache]
+ Jasmine::Headless::FilesList.reset!
end
def css_files
|
Reset FilesList to allow caching when run in browser.
|
searls_jasmine-rails
|
train
|
rb
|
aef7f0061e9a26cc602c5664a993ad1856d0cc0c
|
diff --git a/lib/closure_tree/acts_as_tree.rb b/lib/closure_tree/acts_as_tree.rb
index <HASH>..<HASH> 100644
--- a/lib/closure_tree/acts_as_tree.rb
+++ b/lib/closure_tree/acts_as_tree.rb
@@ -334,8 +334,8 @@ module ClosureTree
end
end
- def ct_quote(id)
- self.class.connection.quote(id)
+ def ct_quote(field)
+ self.class.connection.quote(field)
end
# TODO: _parent_id will be removed in the next major version
|
don't name-collide on "id"
|
ClosureTree_closure_tree
|
train
|
rb
|
0de9274671825451cfe193aad7976a3913c2ce54
|
diff --git a/lib/fastlane/actions/s3.rb b/lib/fastlane/actions/s3.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/s3.rb
+++ b/lib/fastlane/actions/s3.rb
@@ -38,8 +38,9 @@ module Fastlane
class S3Action
def self.run(params)
- unless params.first.is_a? Hash
- return
+ params[0] ||= {}
+ unless params.first.is_a?Hash
+ raise "Please pass the required information to the s3 action."
end
# Other things that we need
|
Added support for just `ipa` without a hash as parameter
|
fastlane_fastlane
|
train
|
rb
|
a5f23311bc23a8f455a4d834cbf9121db1b32a12
|
diff --git a/src/com/opera/core/systems/OperaDriver.java b/src/com/opera/core/systems/OperaDriver.java
index <HASH>..<HASH> 100644
--- a/src/com/opera/core/systems/OperaDriver.java
+++ b/src/com/opera/core/systems/OperaDriver.java
@@ -511,7 +511,7 @@ public class OperaDriver extends RemoteWebDriver implements TakesScreenshot {
} else if ("css selector".equals(by)) {
by = "css";
} else if ("id".equals(by)) {
- ;
+ // same
} else if ("link text".equals(by)) {
by = "linkText";
} else if ("partial link text".equals(by)) {
@@ -519,7 +519,7 @@ public class OperaDriver extends RemoteWebDriver implements TakesScreenshot {
} else if ("tag name".equals(by)) {
by = "tagName";
} else if ("xpath".equals(by)) {
- by = "xpath";
+ // same
} else {
throw new WebDriverException("Cannot find matching element locator to: " + by);
}
|
Not using empty expressions, removes warnings in IntelliJ
|
operasoftware_operaprestodriver
|
train
|
java
|
d4e29214a7cb3a048aa4b7fc731b276b98c6b761
|
diff --git a/dev/com.ibm.ws.concurrent_fat_rx/test-applications/concurrentrxfat/src/web/ConcurrentRxTestServlet.java b/dev/com.ibm.ws.concurrent_fat_rx/test-applications/concurrentrxfat/src/web/ConcurrentRxTestServlet.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.concurrent_fat_rx/test-applications/concurrentrxfat/src/web/ConcurrentRxTestServlet.java
+++ b/dev/com.ibm.ws.concurrent_fat_rx/test-applications/concurrentrxfat/src/web/ConcurrentRxTestServlet.java
@@ -1385,6 +1385,9 @@ public class ConcurrentRxTestServlet extends FATServlet {
ManagedCompletableFuture<Integer> cf = (ManagedCompletableFuture<Integer>) ManagedCompletableFuture.supplyAsync(() -> 0, max1strictExecutor);
+ // Ensure that the above task has been removed from the executor's queue so that it does not interfere with subsequent test logic
+ assertEquals(new Integer(0), cf.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));
+
CountDownLatch beginLatch = new CountDownLatch(1);
CountDownLatch continueLatch = new CountDownLatch(1);
CompletableFuture<Integer> cf0, cf1, cf2, cf3, cf4;
|
Issue #<I> ensure initial stage completes to avoid interfering with subsequent test logic
|
OpenLiberty_open-liberty
|
train
|
java
|
06cb3f85c7531c63f9bdaa32b9d5f2a8162f882d
|
diff --git a/robber/__init__.py b/robber/__init__.py
index <HASH>..<HASH> 100644
--- a/robber/__init__.py
+++ b/robber/__init__.py
@@ -1,7 +1,27 @@
-__all__ = [
- 'custom_explanation', 'expect', 'bad_expectations', 'matchers',
-]
+import sys
+
+# Do not change the importing order in the next 4 lines. Doing so may break everything.
from robber.custom_explanation import CustomExplanation # noqa F401
from robber.expect import expect # noqa F401
from robber.bad_expectation import BadExpectation # noqa F401
import robber.matchers # noqa F401
+
+__all__ = [
+ 'custom_explanation', 'expect', 'bad_expectations', 'matchers',
+]
+
+# This hides the traceback
+sys.tracebacklimit = 0
+
+# This checks if ipython is installed then hide the traceback from it
+try: # pragma: no cover
+ import traceback
+ from IPython.core.interactiveshell import InteractiveShell
+
+ def showtraceback(self):
+ traceback_lines = traceback.format_exception(*sys.exc_info())
+ sys.stderr.write(traceback_lines[-1])
+
+ InteractiveShell.showtraceback = showtraceback
+except ImportError: # pragma: no cover
+ pass
|
[r] Disable the lengthy tracebacks
|
vesln_robber.py
|
train
|
py
|
8a910353355bb98853d0a29d565e2b39a5052692
|
diff --git a/libraries/mako/String.php b/libraries/mako/String.php
index <HASH>..<HASH> 100644
--- a/libraries/mako/String.php
+++ b/libraries/mako/String.php
@@ -191,8 +191,27 @@ class String
}
/**
+ * Returns a closure that will alternate between the defined strings.
+ *
+ * @access public
+ * @param array Array of strings to alternate between
+ * @return Closure
+ */
+
+ public static function alternator(array $strings)
+ {
+ return function() use ($strings)
+ {
+ static $i = 0;
+
+ return $strings[($i++ % count($strings))];
+ };
+ }
+
+ /**
* Alternates between two or more strings.
*
+ * @deprecated
* @access public
* @param array Array of strings to alternate between
* @param boolean (optional) Reset alternator?
|
Added String::alternator method and deprecated the String::alternate method
|
mako-framework_framework
|
train
|
php
|
7dc706404c51d828085b9d975a44c993a9f80129
|
diff --git a/alot/db/__init__.py b/alot/db/__init__.py
index <HASH>..<HASH> 100644
--- a/alot/db/__init__.py
+++ b/alot/db/__init__.py
@@ -2,4 +2,6 @@
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
+from thread import Thread
+from message import Message
DB_ENC = 'UTF-8'
|
cleanup: make Thread and Message available in alot.db
|
pazz_alot
|
train
|
py
|
08230f1bb5b0799bd74fb43a7f1a2f76c514292f
|
diff --git a/rails_event_store/spec/example_invoicing_app.rb b/rails_event_store/spec/example_invoicing_app.rb
index <HASH>..<HASH> 100644
--- a/rails_event_store/spec/example_invoicing_app.rb
+++ b/rails_event_store/spec/example_invoicing_app.rb
@@ -10,7 +10,7 @@ end
class InvoiceReadModel
def initialize(events=[])
@items = []
- events.each { |event| handle_event(event) }
+ events.each { |event| call(event) }
end
def items
@@ -21,7 +21,7 @@ class InvoiceReadModel
@items.map(&:value).inject(0, :+).to_s
end
- def handle_event(event)
+ def call(event)
case event
when ProductAdded
add_new_invoice_item(event.data.product_name)
|
Replace removed (deprecated) `handle_event` method with `call` method
|
RailsEventStore_rails_event_store
|
train
|
rb
|
8d91f22a345631462b099cdbfb730ce058edec81
|
diff --git a/pyinfra/api/ssh.py b/pyinfra/api/ssh.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/ssh.py
+++ b/pyinfra/api/ssh.py
@@ -194,9 +194,7 @@ def run_shell_command(
connection = state.ssh_connections[hostname]
# Run it! Get stdout, stderr & the underlying channel
- _, stdout_buffer, stderr_buffer = connection.exec_command(
- command, timeout=state.config.TIMEOUT
- )
+ _, stdout_buffer, stderr_buffer = connection.exec_command(command)
channel = stdout_buffer.channel
# Iterate through outputs to get an exit status and generate desired list output,
|
Remove timeout on actual `exec_command` call (as it covers channel open + command).
|
Fizzadar_pyinfra
|
train
|
py
|
dcbbbfdb2af6df24dc0c55a95c42eef3868a4e0f
|
diff --git a/apps/editing-toolkit/editing-toolkit-plugin/starter-page-templates/page-template-modal/components/block-iframe-preview.js b/apps/editing-toolkit/editing-toolkit-plugin/starter-page-templates/page-template-modal/components/block-iframe-preview.js
index <HASH>..<HASH> 100644
--- a/apps/editing-toolkit/editing-toolkit-plugin/starter-page-templates/page-template-modal/components/block-iframe-preview.js
+++ b/apps/editing-toolkit/editing-toolkit-plugin/starter-page-templates/page-template-modal/components/block-iframe-preview.js
@@ -170,6 +170,13 @@ const BlockFramePreview = ( {
*/
iframeRef.current.contentDocument.head.innerHTML +=
'<style>.editor-post-title .editor-post-title__input { height: auto !important; }</style>';
+
+ // Prevent links and buttons from being clicked. This is applied within
+ // the iframe, because if we targeted the iframe itself it would prevent
+ // scrolling the iframe in Firefox.
+ iframeRef.current.contentDocument.head.innerHTML +=
+ '<style>a, button, .wp-block-button, .wp-block-button__link { pointer-events: none; cursor: default; }</style>';
+
rescale();
}, 0 );
}, [ setTimeout, bodyClassName, rescale ] );
|
Starter page templates: Prevent links and buttons from being clicked within the layout preview (#<I>)
|
Automattic_wp-calypso
|
train
|
js
|
09241f61e4fb13a9befa5abe27feb1273ec9b538
|
diff --git a/yabt/buildcontext.py b/yabt/buildcontext.py
index <HASH>..<HASH> 100644
--- a/yabt/buildcontext.py
+++ b/yabt/buildcontext.py
@@ -209,7 +209,7 @@ class BuildContext:
docker_run.extend(cmd)
logger.info('Running command in build env "{}" using command {}',
buildenv_target_name, docker_run)
- return run(docker_run, **kwargs)
+ return run(docker_run, check=True, **kwargs)
def build_target(self, target: Target):
"""Invoke the builder function for a target."""
|
Propagate errors in buildenv container commands
Needed to make `ybt` exit code reflect buildenv command exit codes (e.g. for CI)
|
resonai_ybt
|
train
|
py
|
03271dd1dc322c2db13bd506c3d1f7ce35d6f218
|
diff --git a/server/standalone.js b/server/standalone.js
index <HASH>..<HASH> 100644
--- a/server/standalone.js
+++ b/server/standalone.js
@@ -532,6 +532,7 @@ define(['logManager',
});
__app.post('/rest/blob/createFile/:filename', ensureAuthenticated, function(req, res) {
+ __logger.info('file creation request: user['+req.session.udmId+'], filename['+req.params.filename+']');
var filename = 'not_defined.txt';
if (req.params.filename !== null && req.params.filename !== '') {
@@ -540,6 +541,7 @@ define(['logManager',
// regular file
blobBackend.putFile(filename, req, function (err, hash) {
+ __logger.info('file creation request finished: user['+req.session.udmId+'], filename['+req.params.filename+'], error['+err+'], hash:['+hash+']');
if (err) {
// FIXME: make sure we set the status code correctly like 404 etc.
res.status(500);
|
file posting get more precise logs to track all file uploads
Former-commit-id: fcd<I>aa5ca<I>aa<I>d<I>bfe4a1b1d5e<I>
|
webgme_webgme-engine
|
train
|
js
|
c6cfec20f14ee48233b9461b250f390cce97bade
|
diff --git a/nxviz/api.py b/nxviz/api.py
index <HASH>..<HASH> 100644
--- a/nxviz/api.py
+++ b/nxviz/api.py
@@ -209,7 +209,6 @@ matrix = partial(
node_layout_func=nodes.matrix,
edge_line_func=edges.matrix,
cloned_node_layout_kwargs={"axis": "y"},
- edge_line_kwargs={"directed": False},
)
update_wrapper(matrix, base_cloned)
diff --git a/nxviz/utils.py b/nxviz/utils.py
index <HASH>..<HASH> 100644
--- a/nxviz/utils.py
+++ b/nxviz/utils.py
@@ -188,6 +188,9 @@ def node_table(G, group_by=None, sort_by=None):
return df
+import networkx as nx
+
+
def edge_table(G) -> pd.DataFrame:
"""Return the edge table of a graph.
@@ -205,6 +208,13 @@ def edge_table(G) -> pd.DataFrame:
row["source"] = u
row["target"] = v
data.append(row)
+ if not G.is_directed():
+ u, v = v, u
+ row = dict()
+ row.update(d)
+ row["source"] = u
+ row["target"] = v
+ data.append(row)
return pd.DataFrame(data)
|
Add bidirectional edges to edge table if graph is not directed
|
ericmjl_nxviz
|
train
|
py,py
|
8b64efa141970480673b2cd0e76d6551bc179b48
|
diff --git a/examples/searchLibrary.js b/examples/searchLibrary.js
index <HASH>..<HASH> 100644
--- a/examples/searchLibrary.js
+++ b/examples/searchLibrary.js
@@ -2,6 +2,6 @@ var Sonos = require('../').Sonos
var sonos = new Sonos(process.env.SONOS_HOST || '192.168.1.19', process.env.SONOS_PORT || 1400)
-sonos.searchMusicLibrary('tracks', 'orange crush', function (err, data) {
+sonos.searchMusicLibrary('tracks', 'orange crush', {}, function (err, data) {
console.log(err, data)
})
|
fix: missing options param in example (#<I>)
|
bencevans_node-sonos
|
train
|
js
|
d51d0022cee91d6588186455afbe6e54fae2cbf7
|
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index <HASH>..<HASH> 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -48,10 +48,10 @@ import (
const (
ClientIdentifier = "Geth"
- Version = "1.0.3"
+ Version = "1.1.0"
VersionMajor = 1
- VersionMinor = 0
- VersionPatch = 3
+ VersionMinor = 1
+ VersionPatch = 0
)
var (
|
cmd/geth: bumped version <I>
|
ethereum_go-ethereum
|
train
|
go
|
7fb362b37aa6e739163d2d118dfd9230c40d4fca
|
diff --git a/abot.go b/abot.go
index <HASH>..<HASH> 100644
--- a/abot.go
+++ b/abot.go
@@ -262,7 +262,7 @@ func installPlugins() error {
branch := string(outC)
// Sync to get dependencies
outC, err = exec.
- Command("/bin/sh", "-c", "glock sync github.com/itsabot/abot/plugins/"+name+ext).
+ Command("/bin/sh", "-c", "glock sync $(pwd | sed 's/^.*src\\///')").
CombinedOutput()
if err != nil {
l.Debug(string(outC))
|
Sync plugins based on their directory name
|
itsabot_itsabot
|
train
|
go
|
ac60c28baa55d94732110e36640e0c7aa44026a0
|
diff --git a/spring-cloud-netflix-hystrix/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixOnlyTests.java b/spring-cloud-netflix-hystrix/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixOnlyTests.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-netflix-hystrix/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixOnlyTests.java
+++ b/spring-cloud-netflix-hystrix/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixOnlyTests.java
@@ -85,8 +85,10 @@ public class HystrixOnlyTests {
@SuppressWarnings("unchecked")
public void testHystrixHealth() {
Map map = getHealth();
- assertThat(map).containsKeys("details");
- Map details = (Map) map.get("details");
+ // https://github.com/spring-projects/spring-boot/issues/17929
+ // if the default changes back, this will need to be reverted.
+ assertThat(map).containsKeys("components");
+ Map details = (Map) map.get("components");
assertThat(details).containsKeys("hystrix");
Map hystrix = (Map) details.get("hystrix");
assertThat(hystrix).containsEntry("status", "UP");
|
Updates to use "components" rather than "details"
See <URL>
|
spring-cloud_spring-cloud-netflix
|
train
|
java
|
9a5a9b3b4d0383b45432959a5a57f2f0433ad77b
|
diff --git a/lib/bandiera/client.rb b/lib/bandiera/client.rb
index <HASH>..<HASH> 100644
--- a/lib/bandiera/client.rb
+++ b/lib/bandiera/client.rb
@@ -108,7 +108,7 @@ module Bandiera
end
EXCEPTIONS_TO_HANDLE = (
- Errno.constants.map { |cla| Errno.const_get(cla) } + [RestClient::Exception, JSON::ParserError]
+ Errno.constants.map { |cla| Errno.const_get(cla) } + [RestClient::Exception, JSON::ParserError, SocketError]
).flatten
def get_and_handle_exceptions(path, params, http_opts, return_upon_error, error_msg_prefix, &block)
@@ -118,6 +118,11 @@ module Bandiera
res['response']
rescue *EXCEPTIONS_TO_HANDLE
return_upon_error
+ rescue => e
+ message = "UNHANDLED EXCEPTION #{e.inspect} - CLASS #{e.class.name}"
+ $stderr.puts message
+ logger.error(message)
+ raise
end
def get(path, params, passed_http_opts)
|
[cdsearch-<I>] ensure reasonable error handling if no contact with server
|
springernature_bandiera-client-ruby
|
train
|
rb
|
17b1aeed9abca50fcb343b1079a776b17798e388
|
diff --git a/src/neuron/web/dom/clean.js b/src/neuron/web/dom/clean.js
index <HASH>..<HASH> 100644
--- a/src/neuron/web/dom/clean.js
+++ b/src/neuron/web/dom/clean.js
@@ -2,25 +2,35 @@
* clean unexpected public members
* after this, they could only be fetched by Neuron Loader
*/
+
;(function(K){
-var DOM = K.DOM,
- SELECTOR = K.__SELECTOR;
+var DOM = K.DOM;
+
+// store selector on DOM for further improvement
+DOM.SELECTOR = K.__SELECTOR;
+
// remove public members
delete K.DOM;
delete K.__SELECTOR;
-
-
-DOM.SELECTOR = SELECTOR;
+delete DOM.methods;
+delete DOM.feature;
K.define.on();
-K.define('DOM', function(){
- return DOM;
-});
-
+// fake package module
+K.define('dom', function(){ return DOM; });
K.define.off();
-})(KM);
\ No newline at end of file
+})(KM);
+
+
+/**
+ change log:
+
+ 2011-09-08 Kael:
+ - renaming the module name as dom, making it a fake package module
+
+ */
\ No newline at end of file
|
dom/clean: renaming the module name as dom, making it a fake package module
|
kaelzhang_neuron.js
|
train
|
js
|
d7cea24b55e5659bb04e025be867fa99c73af22f
|
diff --git a/auth/radius/auth.php b/auth/radius/auth.php
index <HASH>..<HASH> 100644
--- a/auth/radius/auth.php
+++ b/auth/radius/auth.php
@@ -105,7 +105,7 @@ class auth_plugin_radius extends auth_plugin_base {
}
$result = $rauth->send();
- if (PEAR::isError($result)) {
+ if ($rauth->isError($result)) {
printf("Radius send failed: %s<br/>\n", $result->getMessage());
exit;
} else if ($result === true) {
|
MDL-<I> Auth - Additional strict warning fix for radius authentication
|
moodle_moodle
|
train
|
php
|
729b6d556b61a46e37bedd510b83ecc7063e0d01
|
diff --git a/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/oauth/OidcUserInfoController.java b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/oauth/OidcUserInfoController.java
index <HASH>..<HASH> 100644
--- a/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/oauth/OidcUserInfoController.java
+++ b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/oauth/OidcUserInfoController.java
@@ -68,7 +68,8 @@ public class OidcUserInfoController {
@Autowired private IdTokenFactory idTokenFactory;
- @Autowired private List<OAuthClient> clientList;
+ @Autowired(required = false)
+ private List<OAuthClient> clientList = Collections.emptyList();
private Map<String, OAuthClient> clientMap = Collections.emptyMap();
|
fix: correct an issue with the OidcUserInfoController when no beans of type OAuthClient are defined
|
Jasig_uPortal
|
train
|
java
|
56e6e031c92c8ccd9af45cf924f1ad533061ffd2
|
diff --git a/lib/nestful/helpers.rb b/lib/nestful/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/nestful/helpers.rb
+++ b/lib/nestful/helpers.rb
@@ -78,8 +78,12 @@ module Nestful
URI.encode_www_form_component(s.to_s)
end
+ ESCAPE_RE = /[^a-zA-Z0-9 .~_-]/
+
def uri_escape(s)
- URI.escape(s.to_s.scrub)
+ s.to_s.gsub(ESCAPE_RE) {|match|
+ '%' + match.unpack('H2' * match.bytesize).join('%').upcase
+ }.tr(' ', '+')
end
if defined?(::Encoding)
@@ -125,4 +129,4 @@ module Nestful
return params
end
end
-end
\ No newline at end of file
+end
|
Mirror Faradys URI encoding - ampersands were not being encoded properly
|
maccman_nestful
|
train
|
rb
|
cc8bf1ef6152cf51e1fd88e4e7c937ffbe3abb05
|
diff --git a/tests/test_backdoor.py b/tests/test_backdoor.py
index <HASH>..<HASH> 100644
--- a/tests/test_backdoor.py
+++ b/tests/test_backdoor.py
@@ -20,7 +20,7 @@ class BackdoorTests(StateClearingTestCase):
sock.recv(8192),
'\n'.join((backdoor.PREAMBLE, backdoor.PS1)))
- sock.sendall("print 'hello'\n")
+ sock.sendall("sys.stdout.write('hello\\n')\n")
self.assertEqual(sock.recv(8192), 'hello\n' + backdoor.PS1)
|
try and fix a backdoor test
|
teepark_greenhouse
|
train
|
py
|
3e3f05b4c11268aa470e23b2b39c451c8e3bad24
|
diff --git a/test/specs/component/ResponsiveContainerSpec.js b/test/specs/component/ResponsiveContainerSpec.js
index <HASH>..<HASH> 100644
--- a/test/specs/component/ResponsiveContainerSpec.js
+++ b/test/specs/component/ResponsiveContainerSpec.js
@@ -57,8 +57,8 @@ describe('<ResponsiveContainer />', () => {
</ResponsiveContainer>
);
- expect(wrapper.find('.inside')).to.have.attr('width').equal('0');
- expect(wrapper.find('.inside')).to.have.attr('height').equal('0');
+ expect(wrapper.find('.inside')).to.have.attr('width').equal('600');
+ expect(wrapper.find('.inside')).to.have.attr('height').equal('300');
});
// Note that we force height and width here which will trigger a warning.
|
feat: update test spec to accomodate new aspect + height feature
|
recharts_recharts
|
train
|
js
|
ac6c48bf0023890f0a4add5c4b103b6f0ac57861
|
diff --git a/spatialist/auxil.py b/spatialist/auxil.py
index <HASH>..<HASH> 100644
--- a/spatialist/auxil.py
+++ b/spatialist/auxil.py
@@ -42,7 +42,11 @@ def crsConvert(crsIn, crsOut):
>>> crsConvert('http://www.opengis.net/def/crs/EPSG/0/4326', 'epsg')
4326
-
+
+ convert an EPSG compound CRS (WGS84 horizontal + EGM96 vertical)
+
+ >>> crsConvert('EPSG:4326+5773', 'proj4')
+ '+proj=longlat +datum=WGS84 +geoidgrids=egm96_15.gtx +vunits=m +no_defs '
"""
if isinstance(crsIn, osr.SpatialReference):
srs = crsIn.Clone()
|
[auxil.crsConvert] added example for compound CRS
|
johntruckenbrodt_spatialist
|
train
|
py
|
ab7a08e3c7ac749e2f5108ac2dc66204abb1e8a3
|
diff --git a/Gemfile.lock b/Gemfile.lock
index <HASH>..<HASH> 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- churn (0.0.30)
+ churn (0.0.31)
chronic (>= 0.2.3)
hirb
json_pure
diff --git a/lib/churn/churn_calculator.rb b/lib/churn/churn_calculator.rb
index <HASH>..<HASH> 100644
--- a/lib/churn/churn_calculator.rb
+++ b/lib/churn/churn_calculator.rb
@@ -112,7 +112,7 @@ module Churn
# Pretty print the data as a string for the user
def to_s
- ChurnCalculator(to_h[:churn])
+ ChurnCalculator.to_s(to_h[:churn])
end
private
diff --git a/lib/churn/version.rb b/lib/churn/version.rb
index <HASH>..<HASH> 100644
--- a/lib/churn/version.rb
+++ b/lib/churn/version.rb
@@ -1,3 +1,3 @@
module Churn
- VERSION = "0.0.30"
+ VERSION = "0.0.31"
end
|
ability to output from a hash fix
|
danmayer_churn
|
train
|
lock,rb,rb
|
d6cb2ca796acf56a120ca644d6b9d596bbdcd4e4
|
diff --git a/ghost/members-api/index.js b/ghost/members-api/index.js
index <HASH>..<HASH> 100644
--- a/ghost/members-api/index.js
+++ b/ghost/members-api/index.js
@@ -14,7 +14,7 @@ module.exports = function MembersApi({
publicKey
},
auth: {
- allowSelfSignup,
+ allowSelfSignup = true,
getSigninURL
},
paymentConfig,
|
Defaulted allowSelfSignup to `true`
no-issue
This is to keep backwards compatibility
|
TryGhost_Ghost
|
train
|
js
|
991d81c204ac235e0838d54cf167fbe9d1200d96
|
diff --git a/salt/client/ssh/shell.py b/salt/client/ssh/shell.py
index <HASH>..<HASH> 100644
--- a/salt/client/ssh/shell.py
+++ b/salt/client/ssh/shell.py
@@ -130,7 +130,7 @@ class Shell(object):
'''
if self.passwd and salt.utils.which('sshpass'):
opts = self._passwd_opts()
- return 'sshpass -p {0} {1} {2} {3} {4} {5}'.format(
+ return 'sshpass -p "{0}" {1} {2} {3} {4} {5}'.format(
self.passwd,
ssh,
'' if ssh == 'scp' else self.host,
|
pass in the password to sshpass as a single string, fix #<I>
|
saltstack_salt
|
train
|
py
|
2e1ce1b234d6d7beb3dbd3fc9c680eab100c23e4
|
diff --git a/src/configure-webpack/loaders/javascript.js b/src/configure-webpack/loaders/javascript.js
index <HASH>..<HASH> 100644
--- a/src/configure-webpack/loaders/javascript.js
+++ b/src/configure-webpack/loaders/javascript.js
@@ -111,7 +111,7 @@ export default {
*/
function buildExcludeCheck (transpileDependencies = []) {
const dependencyChecks = transpileDependencies.map((dependency) => (
- new RegExp(`node_modules${path.sep}${dependency}`)
+ new RegExp(`node_modules.${dependency}`)
))
// see: https://webpack.js.org/configuration/module/#condition
|
Relax path check 💇♂️
I’ve been unable to make the previous RegExp work in Windows
|
saguijs_sagui
|
train
|
js
|
3d8a4ef1f1b3e11712b5b93d7b72904fcdef500b
|
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java
index <HASH>..<HASH> 100644
--- a/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java
+++ b/SingularityService/src/main/java/com/hubspot/singularity/scheduler/SingularityDeployChecker.java
@@ -640,6 +640,15 @@ public class SingularityDeployChecker {
return new SingularityDeployResult(DeployState.SUCCEEDED, "Request not deployable");
}
+ if (!deploy.isPresent()) {
+ // Check for abandoned pending deploy
+ Optional<SingularityDeployResult> result = deployManager.getDeployResult(request.getId(), pendingDeploy.getDeployMarker().getDeployId());
+ if (result.isPresent() && result.get().getDeployState().isDeployFinished()) {
+ LOG.info("Deploy was already finished, running cleanup of pending data for {}", pendingDeploy.getDeployMarker());
+ return result.get();
+ }
+ }
+
if (!pendingDeploy.getDeployProgress().isPresent()) {
return new SingularityDeployResult(DeployState.FAILED, "No deploy progress data present in Zookeeper. Please reattempt your deploy");
}
|
recheck for abandoned pending deploy states
|
HubSpot_Singularity
|
train
|
java
|
8d8b854abfcf543ad13a9bcfe3b1225af90e4e94
|
diff --git a/test/collection.js b/test/collection.js
index <HASH>..<HASH> 100644
--- a/test/collection.js
+++ b/test/collection.js
@@ -1736,12 +1736,12 @@
QUnit.test('#3039 #3951: adding at index fires with correct at', function(assert) {
assert.expect(4);
- var collection = new Backbone.Collection([{at: 0}, {at: 4}]);
+ var collection = new Backbone.Collection([{val: 0}, {val: 4}]);
collection.on('add', function(model, coll, options) {
- assert.equal(model.get('at'), options.index);
+ assert.equal(model.get('val'), options.index);
});
- collection.add([{at: 1}, {at: 2}, {at: 3}], {at: 1});
- collection.add({at: 5}, {at: 10});
+ collection.add([{val: 1}, {val: 2}, {val: 3}], {at: 1});
+ collection.add({val: 5}, {at: 10});
});
QUnit.test('#3039: index is not sent when at is not specified', function(assert) {
|
rename at => val in test to be clearer
|
jashkenas_backbone
|
train
|
js
|
3d757fbb6cc83e41eced30181409ba48653872ba
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,10 +24,10 @@ tests_require = [
'hypothesis-pytest==0.19.0',
'py==1.4.31',
'pydocstyle==1.1.1',
- 'pytest==3.0.5',
+ 'pytest==3.0.6',
'pytest-benchmark==3.1.0a1',
'pytest-cov==2.4.0',
- 'Sphinx==1.5.1',
+ 'Sphinx==1.5.2',
'sortedcollections==0.4.2',
'sortedcontainers==1.5.5',
]
@@ -64,6 +64,6 @@ setup(
tests_require=tests_require,
extras_require=dict(
test=tests_require,
- dev=tests_require + ['pre-commit==0.10.1', 'tox==2.3.2'],
+ dev=tests_require + ['pre-commit==0.11.0', 'tox==2.3.2'],
),
)
|
upgrade to latest pytest (<I>), sphinx (<I>), and pre-commit (<I>)
|
jab_bidict
|
train
|
py
|
fc7fbe0c1add38435e104688b4bbccd8df6c2ce2
|
diff --git a/code/controllers/EventRegisterController.php b/code/controllers/EventRegisterController.php
index <HASH>..<HASH> 100644
--- a/code/controllers/EventRegisterController.php
+++ b/code/controllers/EventRegisterController.php
@@ -122,12 +122,13 @@ class EventRegisterController extends Page_Controller {
return $this->redirect($this->Link());
}
$registration = $this->getCurrentRegistration();
- $registration = $registration->customise(array(
- 'EditLink' => $this->Link('attendee/edit'),
- 'DeleteLink' => $this->Link('attendee/delete'),
- 'Total' => $registration->obj('calculateTotal')
- ))->renderWith("AttendeesReviewTable");
-
+ $customisations = array(
+ 'EditLink' => $this->Link('attendee/edit'),
+ 'DeleteLink' => $this->Link('attendee/delete'),
+ 'Total' => $registration->obj('calculateTotal')
+ );
+ $this->extend("updateReviewTable", $registration, $customisations);
+ $registration = $registration->renderWith("AttendeesReviewTable", $customisations);
return array(
'Title' => 'Review',
'Content' => $registration,
|
Allow AttendeesReviewTable template content to be customised via extensions
|
registripe_registripe-core
|
train
|
php
|
78464c199eb9b06473f66f4ff8089567013fcd6f
|
diff --git a/lib/core/engine/command/measure.js b/lib/core/engine/command/measure.js
index <HASH>..<HASH> 100644
--- a/lib/core/engine/command/measure.js
+++ b/lib/core/engine/command/measure.js
@@ -236,10 +236,15 @@ class Measure {
*/
async stop() {
log.debug('Stop measuring');
+ const url = await this.browser.runScript('return document.URL', 'PAGE_URL');
+ if (this.recordVideo && !this.options.videoParams.debug) {
+ await this.video.stop(url);
+ this.videos.push(this.video);
+ }
const res = await this.engineDelegate.afterPageCompleteCheck(
this.browser,
this.index,
- await this.browser.runScript('return document.URL', 'PAGE_URL')
+ url
);
this.result[this.numberOfMeasuredPages] = merge(
this.result[this.numberOfMeasuredPages],
|
Stop the video when measuring (#<I>)
|
sitespeedio_browsertime
|
train
|
js
|
a64ab5267caf5284d30172e745978e0b74be00f3
|
diff --git a/flaskext/sijax.py b/flaskext/sijax.py
index <HASH>..<HASH> 100644
--- a/flaskext/sijax.py
+++ b/flaskext/sijax.py
@@ -6,9 +6,6 @@ from flask import g, request, Response
import sijax
-__version__ = '0.1.0'
-
-
class SijaxHelper(object):
def __init__(self, app):
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,11 +8,9 @@ to simplify Sijax (`PyPi <http://pypi.python.org/pypi/Sijax>`_, `GitHub <https:/
from setuptools import setup
-from flaskext.sijax import __version__
-
setup(
name = "Flask-Sijax",
- version = __version__,
+ version = '0.1.2',
description = "An extension for the Flask microframework that adds Sijax support.",
long_description = __doc__,
author = "Slavi Pantaleev",
|
Bad import caused package install to fail if a dependency was missing.
|
spantaleev_flask-sijax
|
train
|
py,py
|
1d4a8a65016828c35a943f57eb57d73efb2346f3
|
diff --git a/rpcq/_server.py b/rpcq/_server.py
index <HASH>..<HASH> 100644
--- a/rpcq/_server.py
+++ b/rpcq/_server.py
@@ -314,13 +314,12 @@ class Server:
# The directory must either be specified at class creation or on each method call
if directory is None:
- if not self._auth_config.client_keys_directory:
- raise Exception("Server Auth: Client keys directory required")
- else:
+ if self._auth_config.client_keys_directory:
directory = self._auth_config.client_keys_directory
- if not self.auth_configured:
+ if not directory or not self.auth_configured:
return False
- self._authenticator.configure_curve(domain='*', location=self._auth_config.client_keys_directory)
+ self._authenticator.configure_curve(domain='*', location=directory)
+ return True
def set_client_keys(self, client_keys: [bytes]):
"""
|
Allow server to be started without client_keys_directory
|
rigetti_rpcq
|
train
|
py
|
21021c6735908d05c0fdda96a1752d787af91603
|
diff --git a/extensions/featured-header.php b/extensions/featured-header.php
index <HASH>..<HASH> 100644
--- a/extensions/featured-header.php
+++ b/extensions/featured-header.php
@@ -125,6 +125,9 @@ class Featured_Header {
/* If both the width and height are greater than '0', add the custom image size. */
if ( 0 < $this->width && 0 < $this->height )
add_image_size( $this->size, $this->width, $this->height, $this->crop );
+
+ /* Add translatable featured header image name. */
+ add_filter( 'image_size_names_choose', array( &$this, 'image_size_names_choose' ) );
}
}
@@ -183,6 +186,22 @@ class Featured_Header {
return $data;
}
+
+ /**
+ * Adds an internationalized version of the Featured Header image size name to the image sizes list
+ * when inserting an image from the media gallery into a post.
+ *
+ * @since 0.1.1
+ * @access public
+ * @link https://foxnet-themes.fi/2013/07/03/translating-custom-image-sizes/
+ * @param array $sizes
+ * @return array
+ */
+ public function image_size_names_choose( $sizes ) {
+ $sizes[ $this->size ] = __( 'Featured Header', 'featured-header' );
+
+ return $sizes;
+ }
}
new Featured_Header();
|
Internationalize the featured header image size name. Props @samikeijonen
|
justintadlock_hybrid-core
|
train
|
php
|
9f0fd42b5b2a4935c91976fc0015579230ec66f8
|
diff --git a/src/Mapper/Dbal/DbalMapper.php b/src/Mapper/Dbal/DbalMapper.php
index <HASH>..<HASH> 100644
--- a/src/Mapper/Dbal/DbalMapper.php
+++ b/src/Mapper/Dbal/DbalMapper.php
@@ -264,9 +264,9 @@ class DbalMapper extends BaseMapper
$primary = [];
$id = (array) $entity->getPersistedId();
foreach ($entity->getMetadata()->getPrimaryKey() as $key) {
- $key = $this->storageReflection->convertEntityToStorageKey($key);
$primary[$key] = array_shift($id);
}
+ $primary = $this->getStorageReflection()->convertEntityToStorage($primary);
$this->processUpdate($entity, $data, $primary);
return $entity->getPersistedId();
|
mapper: process primary key by storage reflection for update queries
|
nextras_orm
|
train
|
php
|
964ad1a70f53a9a9c016cd1d22ed71c2c8bbf1b4
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -33,7 +33,7 @@ function wrap(nodule, name, wrapper) {
}
var original = nodule[name]
- , wrapped = wrapper(original)
+ , wrapped = wrapper(original, name)
;
wrapped.__original = original;
diff --git a/test/wrap.tap.js b/test/wrap.tap.js
index <HASH>..<HASH> 100644
--- a/test/wrap.tap.js
+++ b/test/wrap.tap.js
@@ -14,14 +14,15 @@ var generator = {
};
test("should wrap safely", function (t) {
- t.plan(8);
+ t.plan(9);
t.equal(counter, generator.inc, "method is mapped to function");
t.doesNotThrow(function () { generator.inc(); }, "original funciton works");
t.equal(1, outsider, "calls have side effects");
var count = 0;
- function wrapper(original) {
+ function wrapper(original, name) {
+ t.equal(name, 'inc')
return function () {
count++;
var returned = original.apply(this, arguments);
|
Expose the name of the wrapped function
This can be useful when using massWrap to wrap an array of function
names. In that case it can be important to know the name of the function
currently being wrapped.
|
othiym23_shimmer
|
train
|
js,js
|
4de7b471e1179bbd1a3d988f3c870d6a5344992f
|
diff --git a/cursor.js b/cursor.js
index <HASH>..<HASH> 100644
--- a/cursor.js
+++ b/cursor.js
@@ -239,13 +239,13 @@ Cursor.prototype._find = function(callback) {
}
// Return after processing command cursor
- return callback(null, null);
+ return callback(null, result);
}
if (Array.isArray(result.documents[0].result)) {
self.cursorState.documents = result.documents[0].result;
self.cursorState.cursorId = Long.ZERO;
- return callback(null, null);
+ return callback(null, result);
}
}
@@ -260,7 +260,7 @@ Cursor.prototype._find = function(callback) {
}
// Return callback
- callback(null, null);
+ callback(null, result);
};
// Options passed to the pool
|
fix(cursor): callback with server response on `_find`
This allows us to properly include the server reply in APM events
in the porcelain driver
|
mongodb_node-mongodb-native
|
train
|
js
|
2be7bc29d33214d2dfedb18d533ffc07d07702ad
|
diff --git a/ipyrad/load/load.py b/ipyrad/load/load.py
index <HASH>..<HASH> 100644
--- a/ipyrad/load/load.py
+++ b/ipyrad/load/load.py
@@ -65,7 +65,8 @@ def load_assembly(name, controller="Local", quiet=False, launch=False):
def test_assembly(data):
""" Check to see if the assembly you're trying to load is concordant
with the current assembly version. Basically it creates a new tmp
- assembly and tests whether the paramsdicts are the same. """
+ assembly and tests whether the paramsdicts are the same. It also
+ tests the _hackersonly dict."""
new_assembly = Assembly(data.name)
new_params = set(new_assembly.paramsdict.keys())
@@ -76,11 +77,17 @@ def test_assembly(data):
params_diff = new_params.difference(my_params)
result = False
- if params_diff:
- result = False
- else:
+ if not params_diff:
result = True
+ ## Test hackersonly dict as well.
+ my_hackerdict = set(data._hackersonly.keys())
+ new_hackerdict = set(new_assembly._hackersonly.keys())
+ hackerdict_diff = new_hackerdict.difference(my_hackerdict)
+
+ if not hackerdict_diff:
+ results = True
+
return result
|
Fixed test_assembly to test the hackersonly dict as well.
|
dereneaton_ipyrad
|
train
|
py
|
4a11b963189312c0f9585403f4012e42be66849f
|
diff --git a/pygsp/plotting.py b/pygsp/plotting.py
index <HASH>..<HASH> 100644
--- a/pygsp/plotting.py
+++ b/pygsp/plotting.py
@@ -244,7 +244,8 @@ def _plt_plot_graph(G, show_edges, vertex_size, ax):
color=G.plotting['edge_color'],
linestyle=G.plotting['edge_style'],
marker='o', markersize=vertex_size/10,
- markerfacecolor=G.plotting['vertex_color'])
+ markerfacecolor=G.plotting['vertex_color'],
+ markeredgecolor=G.plotting['vertex_color'])
if G.coords.shape[1] == 3:
# TODO: very dirty. Cannot we prepare a set of lines?
@@ -255,7 +256,8 @@ def _plt_plot_graph(G, show_edges, vertex_size, ax):
color=G.plotting['edge_color'],
linestyle=G.plotting['edge_style'],
marker='o', markersize=vertex_size/10,
- markerfacecolor=G.plotting['vertex_color'])
+ markerfacecolor=G.plotting['vertex_color'],
+ markeredgecolor=G.plotting['vertex_color'])
else:
|
plotting: no grey surrounding nodes when plotting graphs
|
epfl-lts2_pygsp
|
train
|
py
|
3381770d4266dbd22c4af5030e60d87f0aeb1bb0
|
diff --git a/venv_update.py b/venv_update.py
index <HASH>..<HASH> 100644
--- a/venv_update.py
+++ b/venv_update.py
@@ -463,8 +463,11 @@ def do_install(reqs):
pip(('uninstall', '--yes') + tuple(sorted(extraneous)))
# Cleanup: remove stale values from the cache and wheelhouse that have not been accessed in a week.
- run(['find', pip_download_cache, pip_wheels, '-not', '-atime', '-7', '-exec', 'rm', '-rf', '{}', '+'])
-
+ from subprocess import CalledProcessError
+ try:
+ run(['find', pip_download_cache, pip_wheels, '-not', '-atime', '-7', '-delete'])
+ except CalledProcessError: # Ignore errors due to concurrent file access race conditions.
+ pass
def wait_for_all_subprocesses():
from os import wait
|
Changed from using find -exec to -delete. Added a try/except block so we
do not fail on concurrent file access race conditions.
|
Yelp_venv-update
|
train
|
py
|
171474485e7a14829192693d4019ffcb1d2390d6
|
diff --git a/lib/sass/scss/parser.rb b/lib/sass/scss/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/sass/scss/parser.rb
+++ b/lib/sass/scss/parser.rb
@@ -63,15 +63,17 @@ module Sass
end
def mixin
- node = node(Sass::Tree::MixinDefNode.new(tok!(IDENT), []))
+ name = tok! IDENT
+ args = sass_script_parser.parse_mixin_definition_arglist
ss
- block(node)
+ block(node(Sass::Tree::MixinDefNode.new(name, args)))
end
def include
- node = node(Sass::Tree::MixinNode.new(tok!(IDENT), []))
+ name = tok! IDENT
+ args = sass_script_parser.parse_mixin_include_arglist
ss
- node
+ node(Sass::Tree::MixinNode.new(name, args))
end
def variable
|
[Sass] [SCSS] Add support for mixin args.
|
sass_ruby-sass
|
train
|
rb
|
c898420fd2f52328ff5a1b32fe7e41f30012737b
|
diff --git a/vendor/k8s.io/kubernetes/test/e2e/instrumentation/logging/generic_soak.go b/vendor/k8s.io/kubernetes/test/e2e/instrumentation/logging/generic_soak.go
index <HASH>..<HASH> 100644
--- a/vendor/k8s.io/kubernetes/test/e2e/instrumentation/logging/generic_soak.go
+++ b/vendor/k8s.io/kubernetes/test/e2e/instrumentation/logging/generic_soak.go
@@ -50,13 +50,11 @@ var _ = instrumentation.SIGDescribe("Logging soak [Performance] [Slow] [Disrupti
scale := framework.TestContext.LoggingSoak.Scale
if framework.TestContext.LoggingSoak.Scale == 0 {
scale = 1
- framework.Logf("Overriding default scale value of zero to %d", scale)
}
milliSecondsBetweenWaves := framework.TestContext.LoggingSoak.MilliSecondsBetweenWaves
if milliSecondsBetweenWaves == 0 {
milliSecondsBetweenWaves = 5000
- framework.Logf("Overriding default milliseconds value of zero to %d", milliSecondsBetweenWaves)
}
return scale, time.Duration(milliSecondsBetweenWaves) * time.Millisecond
|
UPSTREAM: <drop>: Filter out a log message from output that blocks dry-run
This is fixed in <I> so the commit can safely be dropped.
|
openshift_origin
|
train
|
go
|
88a559d4148789474c6dbd216725c69fa18200a9
|
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -15,7 +15,7 @@ module ActiveRecord
# Returns if the record is persisted, i.e. it's not a new record and it was
# not destroyed.
def persisted?
- !!@persisted && !destroyed?
+ @persisted && !destroyed?
end
# Saves the model.
|
Double negation of an already boolean value produces the same result
|
rails_rails
|
train
|
rb
|
03c23653beca5aacdaf41bb6859b957d1dacf820
|
diff --git a/lib/objects/modules/workspace_commands.rb b/lib/objects/modules/workspace_commands.rb
index <HASH>..<HASH> 100644
--- a/lib/objects/modules/workspace_commands.rb
+++ b/lib/objects/modules/workspace_commands.rb
@@ -164,9 +164,9 @@ module Bcome
respond_to?(method_sym) || method_is_available_on_node?(method_sym)
end
- def method_missing(method_sym, *arguments)
- super unless method_is_available_on_node?(method_sym)
-
+ def method_missing(method_sym, *arguments)
+ raise NameError, "undefined local variable or method '#{method_sym}' for #{self.class}" unless method_is_available_on_node?(method_sym)
+
if resource_identifiers.include?(method_sym.to_s)
method_sym.to_s
elsif instance_variable_defined?("@#{method_sym}")
|
Ruby's IRB internals causing hang catching name errors due to size of some contexts. Here we'll just raise instead
|
webzakimbo_bcome-kontrol
|
train
|
rb
|
e94d27bc412677f22f15b6b90a80cd095c663556
|
diff --git a/activejdbc/src/test/java/org/javalite/activejdbc/Defect381_UpdateModifiedOnlyTest.java b/activejdbc/src/test/java/org/javalite/activejdbc/Defect381_UpdateModifiedOnlyTest.java
index <HASH>..<HASH> 100644
--- a/activejdbc/src/test/java/org/javalite/activejdbc/Defect381_UpdateModifiedOnlyTest.java
+++ b/activejdbc/src/test/java/org/javalite/activejdbc/Defect381_UpdateModifiedOnlyTest.java
@@ -115,4 +115,19 @@ public class Defect381_UpdateModifiedOnlyTest extends ActiveJDBCTest {
the(prg).shouldNotBe("new");
the(prg).shouldNotBe("modified");
}
+
+ @Test
+ public void shouldBeModifiedAfterCopyTo() {
+ Programmer prg = Programmer.createIt("first_name", "John", "last_name", "Doe");
+ the(prg).shouldNotBe("new");
+ the(prg).shouldNotBe("modified");
+
+ Programmer prg2 = Programmer.createIt("first_name", "Jane", "last_name", "Doe");
+ the(prg).shouldNotBe("new");
+ the(prg).shouldNotBe("modified");
+
+ prg.copyTo(prg2);
+ the(prg).shouldNotBe("new");
+ the(prg2).shouldBe("modified");
+ }
}
|
#<I>: added test for isModified after copyTo()
|
javalite_activejdbc
|
train
|
java
|
2755b2dd6f23ba0737f0b6c187bc2777119d1434
|
diff --git a/src/interactorStyle.js b/src/interactorStyle.js
index <HASH>..<HASH> 100644
--- a/src/interactorStyle.js
+++ b/src/interactorStyle.js
@@ -146,6 +146,15 @@ vgl.interactorStyle = function() {
return true;
};
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Reset to default
+ */
+ ////////////////////////////////////////////////////////////////////////////
+ this.reset = function() {
+ return true;
+ };
+
return this;
};
|
Added reset api for the interactor style
|
OpenGeoscience_vgl
|
train
|
js
|
2b3415dfd88488bdbab21895f2b94d2ce69bb4c7
|
diff --git a/build/zip.py b/build/zip.py
index <HASH>..<HASH> 100644
--- a/build/zip.py
+++ b/build/zip.py
@@ -5,6 +5,7 @@ import sys
import zipfile
LINUX_BINARIES_TO_STRIP = [
+ 'chromedriver',
'electron',
'libffmpeg.so',
'libnode.so'
@@ -17,6 +18,8 @@ EXTENSIONS_TO_SKIP = [
PATHS_TO_SKIP = [
'angledata', #Skipping because it is an output of //ui/gl that we don't need
'swiftshader', #Skipping because it is an output of //ui/gl that we don't need
+ './libVkLayer_', #Skipping because these are outputs that we don't need
+ './VkLayerLayer_', #Skipping because these are outputs that we don't need
]
def skip_path(dep):
@@ -57,7 +60,8 @@ def main(argv):
with open(runtime_deps) as f:
for dep in f.readlines():
dep = dep.strip()
- dist_files += [dep]
+ if dep not in dist_files:
+ dist_files += [dep]
if sys.platform == 'darwin':
mac_zip_results = execute(['zip', '-r', '-y', dist_zip] + dist_files)
else:
|
chore: remove duplicate and un-needed files from dist zips (#<I>)
* chore: remove duplicate and un-needed files from dist zips
* Strip chromedriver binaries
Also, fix path for files to skip
* Don't strip mksnapshot for now
Mksnapshot needs special handling for arm/arm<I> because there is both an x<I> and arm/arm<I> binary in those cases.
|
electron_electron
|
train
|
py
|
bed9059abc77299b5b6a74fcd4a57dcdb04989c9
|
diff --git a/mungegithub/mungers/approval-handler.go b/mungegithub/mungers/approval-handler.go
index <HASH>..<HASH> 100644
--- a/mungegithub/mungers/approval-handler.go
+++ b/mungegithub/mungers/approval-handler.go
@@ -37,7 +37,7 @@ import (
const (
approvalNotificationName = "ApprovalNotifier"
- approveCommand = "approve"
+ approveCommand = "APPROVE"
cancel = "cancel"
ownersFileName = "OWNERS"
)
|
mungebot: Command.Name is always upper-cased
This breaks the detection of approval command as the matcher always
upper-cases the command name. Let's make sure we compare apples to
apples (all upper-case).
|
kubernetes_test-infra
|
train
|
go
|
662d0d9d31976d499b9590ba6ec73368f02dd4c3
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,9 @@
+ensurepip
+
+#try the following if ensurepip is not sufficient
+#ensurepip --upgrade
+#pip install --upgrade pip setuptools
+
try:
# Try using ez_setup to install setuptools if not already installed.
from ez_setup import use_setuptools
|
setup.py: use the routine modern method for installing setuptools
My suggestion for fixing the deprecated method for installing or updating setuptools using ez_setup.py
Also ensures that both pip and setuptools are 'bootstrapped' to the python environment, which does not always happen on a fresh install in Windows.
Fixes #<I>
This can be made more robust by detecting if pip or setuptools is installed with `pip --version`, etc...
|
adafruit_Adafruit_Python_GPIO
|
train
|
py
|
703905b6651feb250c527c7546acdfd6174a02b0
|
diff --git a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php
index <HASH>..<HASH> 100644
--- a/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php
+++ b/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php
@@ -69,13 +69,11 @@ class FileWriterGeneratorStrategy implements GeneratorStrategyInterface
try {
$this->writeFile("<?php\n\n" . $generatedCode, $fileName);
} catch (FileNotWritableException $fileNotWritable) {
- restore_error_handler();
-
throw $fileNotWritable;
+ } finally {
+ restore_error_handler();
}
- restore_error_handler();
-
return $generatedCode;
}
|
Can use `finally` in PHP <I>
|
Ocramius_ProxyManager
|
train
|
php
|
da855df942d1cd98cd3146067bca02089e3eaaf3
|
diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php
index <HASH>..<HASH> 100644
--- a/src/PhpImap/Mailbox.php
+++ b/src/PhpImap/Mailbox.php
@@ -1677,7 +1677,7 @@ class Mailbox
*/
protected function possiblyGetEmailAndNameFromRecipient(object $recipient)
{
- if (isset($recipient->mailbox) && !empty(trim($recipient->mailbox)) && isset($recipient->host) && !empty(trim($recipient->host))) {
+ if (isset($recipient->mailbox, $recipient->host) && '' !== trim($recipient->mailbox) && '' !== trim($recipient->host)) {
$recipientEmail = strtolower($recipient->mailbox.'@'.$recipient->host);
$recipientName = (isset($recipient->personal) and !empty(trim($recipient->personal))) ? $this->decodeMimeStr($recipient->personal, $this->getServerEncoding()) : null;
|
refactoring condition to merge isset statements, use explicit strict not-equals comparison for trimmed strings
|
barbushin_php-imap
|
train
|
php
|
71090092f529ac68d9da270fa7915d6b966300b1
|
diff --git a/tests/test_core.py b/tests/test_core.py
index <HASH>..<HASH> 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -64,6 +64,33 @@ def test_load():
pass
+def test_load_resample():
+
+ sr_target = 16000
+ offset = 10
+ duration = 5
+
+ def __test(res_type):
+ y_native, sr = librosa.load(librosa.util.example_audio_file(),
+ sr=None,
+ offset=offset,
+ duration=duration,
+ res_type=res_type)
+
+ y2 = librosa.resample(y_native, sr, sr_target, res_type=res_type)
+
+ y, _ = librosa.load(librosa.util.example_audio_file(),
+ sr=sr_target,
+ offset=offset,
+ duration=duration,
+ res_type=res_type)
+
+ assert np.allclose(y2, y)
+
+ for res_type in ['kaiser_fast', 'kaiser_best', 'scipy']:
+ yield __test, res_type
+
+
def test_segment_load():
sample_len = 2003
|
added res_type test to load-resample
|
librosa_librosa
|
train
|
py
|
76ec281aa32e1387624e9657c29da1dc193fb100
|
diff --git a/buildbot/status/builder.py b/buildbot/status/builder.py
index <HASH>..<HASH> 100644
--- a/buildbot/status/builder.py
+++ b/buildbot/status/builder.py
@@ -1021,6 +1021,9 @@ class BuildStatus(styles.Versioned):
self.properties = Properties()
self.requests = []
+ def __repr__(self):
+ return "<%s #%s>" % (self.__class__.__name__, self.number)
+
# IBuildStatus
def getBuilder(self):
|
add a nice repr for BuildStatus objects
|
buildbot_buildbot
|
train
|
py
|
ace4741e13095b28cbf292bab51ed3aa8650cd35
|
diff --git a/qtpylib/blotter.py b/qtpylib/blotter.py
index <HASH>..<HASH> 100644
--- a/qtpylib/blotter.py
+++ b/qtpylib/blotter.py
@@ -895,6 +895,9 @@ class Blotter():
data.index = pd.to_datetime(data.index, utc=True)
data['expiry'] = pd.to_datetime(data['expiry'], utc=True)
+ # remove _STK from symbol to match ezIBpy's formatting
+ data['symbol'] = data['symbol'].str.replace("_STK", "")
+
if continuous and "K" not in resolution and "S" not in resolution:
# construct continuous contracts for futures
all_dfs = [ data[data['asset_class']!='FUT'] ]
|
remove _STK from symbol to match ezIBpy's formatting
|
ranaroussi_qtpylib
|
train
|
py
|
f93e2c5c1e21c82df40e78488a2f22cc94ee4a43
|
diff --git a/question/behaviour/behaviourbase.php b/question/behaviour/behaviourbase.php
index <HASH>..<HASH> 100644
--- a/question/behaviour/behaviourbase.php
+++ b/question/behaviour/behaviourbase.php
@@ -392,11 +392,20 @@ abstract class question_behaviour {
$previouscomment = $this->qa->get_last_behaviour_var('comment');
$newcomment = $pendingstep->get_behaviour_var('comment');
- if (is_null($previouscomment) && !html_is_blank($newcomment) ||
- $previouscomment != $newcomment) {
+ if ($previouscomment != $newcomment) {
+ // The comment has changed.
return false;
}
+ if (!html_is_blank($newcomment)) {
+ // Check comment format.
+ $previouscommentformat = $this->qa->get_last_behaviour_var('commentformat');
+ $newcommentformat = $pendingstep->get_behaviour_var('commentformat');
+ if ($previouscommentformat != $newcommentformat) {
+ return false;
+ }
+ }
+
// So, now we know the comment is the same, so check the mark, if present.
$previousfraction = $this->qa->get_fraction();
$newmark = question_utils::clean_param_mark($pendingstep->get_behaviour_var('mark'));
|
MDL-<I> core_question: Comment is different if format has changed
|
moodle_moodle
|
train
|
php
|
30fbcbbf5ea1fbe052818f0bac0967f5941c8cc2
|
diff --git a/src/joint.dia.link.js b/src/joint.dia.link.js
index <HASH>..<HASH> 100644
--- a/src/joint.dia.link.js
+++ b/src/joint.dia.link.js
@@ -1356,7 +1356,8 @@ joint.dia.LinkView = joint.dia.CellView.extend({
// Backwards compatibility
var paperOptions = this.paper.options;
if (typeof paperOptions.linkConnectionPoint === 'function') {
- connectionPoint = paperOptions.linkConnectionPoint(this, view, magnet, line.start, endType);
+ var linkConnectionMagnet = (magnet === view.el) ? undefined : magnet;
+ connectionPoint = paperOptions.linkConnectionPoint(this, view, linkConnectionMagnet, line.start, endType);
if (connectionPoint) return connectionPoint;
}
|
dia.LinkView: fix broken backwards compatibility for linkConnectionPoint option (#<I>)
|
clientIO_joint
|
train
|
js
|
f683afec9a411999da5cb9b2e18a068ea70d57c1
|
diff --git a/lib/jsi/json/pointer.rb b/lib/jsi/json/pointer.rb
index <HASH>..<HASH> 100644
--- a/lib/jsi/json/pointer.rb
+++ b/lib/jsi/json/pointer.rb
@@ -168,6 +168,15 @@ module JSI
Pointer.new(reference_tokens[ancestor_ptr.reference_tokens.size..-1], type: @type)
end
+ # @param ptr [JSI::JSON::Pointer]
+ # @return [JSI::JSON::Pointer] a pointer with the reference tokens of this one plus the given ptr's.
+ def +(ptr)
+ unless ptr.is_a?(JSI::JSON::Pointer)
+ raise(TypeError, "ptr must be a JSI::JSON::Pointer; got: #{ptr.inspect}")
+ end
+ Pointer.new(reference_tokens + ptr.reference_tokens, type: @type)
+ end
+
# @param n [Integer]
# @return [JSI::JSON::Pointer] a Pointer consisting of the first n of our reference_tokens
# @raise [ArgumentError] if n is not between 0 and the size of our reference_tokens
|
dev JSI::JSON::Pointer#+ for putting pointers together
|
notEthan_jsi
|
train
|
rb
|
09edef40d70e17ebdefb0c3eb6bfeaa6b16ac7ac
|
diff --git a/BaseModel.php b/BaseModel.php
index <HASH>..<HASH> 100644
--- a/BaseModel.php
+++ b/BaseModel.php
@@ -455,11 +455,11 @@ class BaseModel extends Record implements JsonSerializable
return $this->$record;
}
- public function load($names)
+ public function includes($names)
{
foreach ((array) $names as $name) {
// load relations
- $record = $this->$name();
+ $record = $this->{'get' . ucfirst($name)}();
$baseName = lcfirst(end(explode('\\', get_class($record))));
|
load => includes, 确定关联方法为getXxx #<I>
|
miaoxing_plugin
|
train
|
php
|
e21d91f462ee983329afbe9db67e9f44506bc5f9
|
diff --git a/lib/smartware/drivers/modem/standard.rb b/lib/smartware/drivers/modem/standard.rb
index <HASH>..<HASH> 100644
--- a/lib/smartware/drivers/modem/standard.rb
+++ b/lib/smartware/drivers/modem/standard.rb
@@ -70,7 +70,7 @@ module Smartware
Smartware::Logging.logger.info "trying to open modem"
begin
- @mux = CMUX::MUX.new @config["device"]
+ @mux = CMUX::MUX.new @config["port"]
@state = :open
@status_channel = @mux.allocate(@config["status_channel"]).open
@chatter = CMUX::ModemChatter.new @status_channel
|
Modem should use port, not device.
|
smartkiosk_smartware
|
train
|
rb
|
d0e980c2fa6e9d92acae83fd80b6e43c594012ce
|
diff --git a/pkg/services/alerting/eval_context.go b/pkg/services/alerting/eval_context.go
index <HASH>..<HASH> 100644
--- a/pkg/services/alerting/eval_context.go
+++ b/pkg/services/alerting/eval_context.go
@@ -112,7 +112,7 @@ func (c *EvalContext) GetDashboardUID() (*models.DashboardRef, error) {
return c.dashboardRef, nil
}
-const urlFormat = "%s?tab=alert&editPanel=%d&orgId=%d"
+const urlFormat = "%s?tab=alert&viewPanel=%d&orgId=%d"
// GetRuleURL returns the url to the dashboard containing the alert.
func (c *EvalContext) GetRuleURL() (string, error) {
|
Alerting: Change Panel Edit link to Panel View link (#<I>)
Enables alerts to be sent to users who do not have edit permissions.
Addresses Issue: <URL>
|
grafana_grafana
|
train
|
go
|
442cc74b93f629f4f5db8cdee6b2a49c08ee703e
|
diff --git a/leonardo/module/web/widget/htmltext/models.py b/leonardo/module/web/widget/htmltext/models.py
index <HASH>..<HASH> 100644
--- a/leonardo/module/web/widget/htmltext/models.py
+++ b/leonardo/module/web/widget/htmltext/models.py
@@ -15,7 +15,7 @@ from leonardo.module.web.widgets.forms import WidgetUpdateForm
class HtmlTextWidgetAdminForm(WidgetUpdateForm):
- text = forms.CharField(
+ text = forms.TextField(
widget=forms.Textarea, required=False, label=_('text'))
class Meta:
|
change charfield to text for htmltext :D
|
django-leonardo_django-leonardo
|
train
|
py
|
470d0f1e5836a59842a48c55f0916ac03ad931ed
|
diff --git a/consul/pool.go b/consul/pool.go
index <HASH>..<HASH> 100644
--- a/consul/pool.go
+++ b/consul/pool.go
@@ -288,7 +288,7 @@ func (p *ConnPool) clearConn(conn *Conn) {
p.Unlock()
// Close down immediately if idle
- if refCount := atomic.LoadInt32(&conn.shouldClose); refCount == 0 {
+ if refCount := atomic.LoadInt32(&conn.refCount); refCount == 0 {
conn.Close()
}
}
|
Seems like we should actually check the reference count.
|
hashicorp_consul
|
train
|
go
|
0f1f24c7dc83bbbd15162e7a5ba0f09947e49bf3
|
diff --git a/src/main/java/net/ravendb/client/documents/changes/DatabaseChanges.java b/src/main/java/net/ravendb/client/documents/changes/DatabaseChanges.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/ravendb/client/documents/changes/DatabaseChanges.java
+++ b/src/main/java/net/ravendb/client/documents/changes/DatabaseChanges.java
@@ -537,7 +537,12 @@ public class DatabaseChanges implements IDatabaseChanges {
for (int i = 0; i < msgArray.size(); i++) {
ObjectNode msgNode = (ObjectNode) msgArray.get(i);
- String type = msgNode.get("Type").asText();
+ JsonNode typeAsJson = msgNode.get("Type");
+ if (typeAsJson == null) {
+ continue;
+ }
+
+ String type = typeAsJson.asText();
switch (type) {
case "Error":
String exceptionAsString = msgNode.get("Exception").asText();
|
RDBC-<I> [{"TopologyChange":true}] is poison pill for Java client
|
ravendb_ravendb-jvm-client
|
train
|
java
|
8c5dd7d7ebb64413ea99fcaf26b5d7ff5a685ebc
|
diff --git a/tests/src/test/java/com/orientechnologies/orient/test/domain/base/JavaCascadeDeleteTestClass.java b/tests/src/test/java/com/orientechnologies/orient/test/domain/base/JavaCascadeDeleteTestClass.java
index <HASH>..<HASH> 100644
--- a/tests/src/test/java/com/orientechnologies/orient/test/domain/base/JavaCascadeDeleteTestClass.java
+++ b/tests/src/test/java/com/orientechnologies/orient/test/domain/base/JavaCascadeDeleteTestClass.java
@@ -23,7 +23,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.persistence.CascadeType;
import javax.persistence.Id;
+import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Version;
@@ -46,7 +48,7 @@ public class JavaCascadeDeleteTestClass {
@OneToOne(orphanRemoval = true)
private ORecordBytes byteArray;
private String name;
- @OneToMany(orphanRemoval = true)
+ @ManyToMany(cascade = { CascadeType.REMOVE })
private Map<String, Child> children = new HashMap<String, Child>();
@OneToMany(orphanRemoval = true)
private List<Child> list = new ArrayList<Child>();
|
Change the cascade deletion test class to use @ManyToMany annotation
|
orientechnologies_orientdb
|
train
|
java
|
a2fe2444dd87d05035bd9a6533a6c655b7529568
|
diff --git a/textproto/header.go b/textproto/header.go
index <HASH>..<HASH> 100644
--- a/textproto/header.go
+++ b/textproto/header.go
@@ -8,8 +8,6 @@ import (
"net/textproto"
"regexp"
"strings"
-
- "log"
)
type headerField struct {
@@ -262,7 +260,6 @@ func (h *Header) FieldsByKey(k string) HeaderFields {
func readLineSlice(r *bufio.Reader, line []byte) ([]byte, error) {
for {
l, more, err := r.ReadLine()
- log.Println("LINE", string(l), more)
if err != nil {
return nil, err
}
@@ -329,7 +326,6 @@ func hasContinuationLine(r *bufio.Reader) bool {
func readContinuedLineSlice(r *bufio.Reader) ([]byte, error) {
// Read the first line.
line, err := readLineSlice(r, nil)
- log.Println("HEY", string(line), err)
if err != nil {
return nil, err
}
@@ -342,7 +338,6 @@ func readContinuedLineSlice(r *bufio.Reader) ([]byte, error) {
// Read continuation lines.
for hasContinuationLine(r) {
- log.Println("CONTINUATION")
line, err = readLineSlice(r, line)
if err != nil {
break // bufio will keep err until next read.
|
textproto: remove logs, added by mistake
|
emersion_go-message
|
train
|
go
|
d986824c32d654adfa3831878d73990522584dec
|
diff --git a/lib/faraday/request/retry.rb b/lib/faraday/request/retry.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday/request/retry.rb
+++ b/lib/faraday/request/retry.rb
@@ -116,7 +116,7 @@ module Faraday
# every retry. Request environment, middleware options, current number
# of retries and the exception is passed to the block as parameters.
# @option options [Array] :retry_statuses Array of Integer HTTP status
- # codes or a single Integer value that deterimines whether to raise
+ # codes or a single Integer value that determines whether to raise
# a Faraday::RetriableResponse exception based on the HTTP status code
# of an HTTP response.
def initialize(app, options = nil)
|
i've determined there's a spelling mistake here
|
lostisland_faraday
|
train
|
rb
|
af1127c1f698fb8ebaaa92215868bc399af90b68
|
diff --git a/DatabaseManager.php b/DatabaseManager.php
index <HASH>..<HASH> 100755
--- a/DatabaseManager.php
+++ b/DatabaseManager.php
@@ -77,6 +77,8 @@ class DatabaseManager implements ConnectionResolverInterface {
*/
public function reconnect($name = null)
{
+ $name = $name ?: $this->getDefaultConnection();
+
unset($this->connections[$name]);
return $this->connection($name);
|
Get default connection name on null reconnect.
|
illuminate_database
|
train
|
php
|
9065fc60fc71b110fe2b0fca54a0462aaf0e1727
|
diff --git a/src/conbo/core/Application.js b/src/conbo/core/Application.js
index <HASH>..<HASH> 100644
--- a/src/conbo/core/Application.js
+++ b/src/conbo/core/Application.js
@@ -23,6 +23,11 @@ conbo.Application = conbo.View.extend
var namespace = options.namespace || this.namespace;
+ if (conbo.isString(namespace))
+ {
+ namespace = conbo(namespace);
+ }
+
if (!namespace)
{
conbo.warn('Application namespace not specified');
|
Added support for string namespace in Application
|
mesmotronic_conbo
|
train
|
js
|
ce27e6066e7c7f51f7cdaed9a5bf6443245ec899
|
diff --git a/geomet/wkt.py b/geomet/wkt.py
index <HASH>..<HASH> 100644
--- a/geomet/wkt.py
+++ b/geomet/wkt.py
@@ -108,7 +108,7 @@ def __dump_linestring(obj, fmt):
"""
Dump a GeoJSON-like LineString object to WKT.
- Input parameters and return value are the the LINESTRING equivalent to
+ Input parameters and return value are the LINESTRING equivalent to
:func:`__dump_point`.
"""
coords = obj['coordinates']
|
wkt:
Corrected a typo in a docstring.
|
geomet_geomet
|
train
|
py
|
1962b80b940ea5bd1cdfa5b844f92c49dbf10753
|
diff --git a/core/src/main/java/com/orientechnologies/orient/core/id/ORecordId.java b/core/src/main/java/com/orientechnologies/orient/core/id/ORecordId.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/id/ORecordId.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/id/ORecordId.java
@@ -21,6 +21,7 @@ import java.io.OutputStream;
import java.util.List;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
+import com.orientechnologies.orient.core.db.record.ODatabaseRecord;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.exception.ODatabaseException;
import com.orientechnologies.orient.core.record.ORecord;
@@ -276,6 +277,11 @@ public class ORecordId implements ORID {
}
public ORecord<?> getRecord() {
- return ODatabaseRecordThreadLocal.INSTANCE.get().load(this);
+ final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
+ if (db == null)
+ throw new ODatabaseException(
+ "No database found in current thread local space. If you manually control database over threads assure to set the current database before to use it by calling: ODatabaseRecordThreadLocal.INSTANCE.set(db);");
+
+ return db.load(this);
}
}
|
Thrown ODatabaseException in case ORecordId.getRecord() has no database set in thread local
|
orientechnologies_orientdb
|
train
|
java
|
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.