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
|
---|---|---|---|---|---|
ce43038054b99611d9ce065c23ad68fd55304119 | diff --git a/sidebar-templates/sidebar-herocanvas.php b/sidebar-templates/sidebar-herocanvas.php
index <HASH>..<HASH> 100644
--- a/sidebar-templates/sidebar-herocanvas.php
+++ b/sidebar-templates/sidebar-herocanvas.php
@@ -16,4 +16,4 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php dynamic_sidebar( 'herocanvas' ); ?>
-<?php endif; ?>
\ No newline at end of file
+<?php endif; ?> | Fix missing new line at end of file | understrap_understrap | train | php |
0c69792731599e3bcdeb285dc951b007227ff423 | diff --git a/TYPO3.Fluid/Classes/ViewHelpers/Form/UploadViewHelper.php b/TYPO3.Fluid/Classes/ViewHelpers/Form/UploadViewHelper.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Fluid/Classes/ViewHelpers/Form/UploadViewHelper.php
+++ b/TYPO3.Fluid/Classes/ViewHelpers/Form/UploadViewHelper.php
@@ -16,21 +16,22 @@ namespace F3\Fluid\ViewHelpers\Form;
* */
/**
- * @package
- * @subpackage
+ * @package
+ * @subpackage
* @version $Id:$
*/
/**
* Enter description here...
* @scope prototype
*/
-class UploadViewHelper extends \F3\Fluid\Core\AbstractViewHelper {
-
+class UploadViewHelper extends \F3\Fluid\ViewHelpers\Form\AbstractFormViewHelper {
+
public function initializeArguments() {
- $this->registerArgument('name', 'string', 'Name of the upload form', TRUE);
+ parent::initializeArguments();
+ $this->registerUniversalTagAttributes();
}
public function render() {
- return '<input type="file" name="' . $this->arguments['name'] . '" />';
+ return '<input type="file" name="' . $this->getName() . '" ' . $this->renderTagAttributes() . ' />';
}
} | Small addition to the upload view helper
Original-Commit-Hash: <I>b<I>fd<I>b3f4f<I>a<I>bc | neos_flow-development-collection | train | php |
91f5b8c4c56c8a0122be2c258c9fcb9366251737 | diff --git a/lib/table.js b/lib/table.js
index <HASH>..<HASH> 100644
--- a/lib/table.js
+++ b/lib/table.js
@@ -44,7 +44,8 @@ Table.prototype.getName = function() {
}
Table.prototype.star = function() {
- return new TextNode('"'+this._name+'".*');
+ var name = this.alias || this._name;
+ return new TextNode('"'+name+'".*');
}
Table.prototype.select = function() {
diff --git a/test/postgres/namespace-tests.js b/test/postgres/namespace-tests.js
index <HASH>..<HASH> 100644
--- a/test/postgres/namespace-tests.js
+++ b/test/postgres/namespace-tests.js
@@ -9,6 +9,11 @@ Harness.test({
pg :'SELECT u."name" FROM "user" AS u'
});
+Harness.test({
+ query : u.select(u.star()).from(u),
+ pg : 'SELECT "u".* FROM "user" AS u'
+});
+
var p = post.as('p');
Harness.test({
query : u.select(u.name).from(u.join(p).on(u.id.equals(p.userId).and(p.id.equals(3)))), | table alias were not applying to star queries | brianc_node-sql | train | js,js |
3dced34535636ea2676dd4d6f48b8f05a92dc00d | diff --git a/src/Http/StringHttpAdapter.php b/src/Http/StringHttpAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Http/StringHttpAdapter.php
+++ b/src/Http/StringHttpAdapter.php
@@ -7,7 +7,6 @@ use Aidantwoods\SecureHeaders\HeaderBag;
class StringHttpAdapter implements HttpAdapter
{
private $headers = [];
- private $initialHeaders;
/**
* Create a HttpAdapter for output as a string, with initial headers
@@ -20,7 +19,7 @@ class StringHttpAdapter implements HttpAdapter
*/
public function __construct(array $initialHeaders = [])
{
- $this->initialHeaders = $initialHeaders;
+ $this->headers = $initialHeaders;
}
/**
@@ -45,11 +44,13 @@ class StringHttpAdapter implements HttpAdapter
*/
public function getHeaders()
{
- return HeaderBag::fromHeaderLines($this->initialHeaders);
+ return HeaderBag::fromHeaderLines($this->headers);
}
/**
* @api
+ *
+ * @return string
*/
public function getSentHeaders()
{ | bugfix: ensure only one list of headers in StringAdapter | aidantwoods_SecureHeaders | train | php |
5a50b2bc31b2af3ac5f72b022cdbe05f8073b6f5 | diff --git a/classes/Gems/Util/DatabasePatcher.php b/classes/Gems/Util/DatabasePatcher.php
index <HASH>..<HASH> 100644
--- a/classes/Gems/Util/DatabasePatcher.php
+++ b/classes/Gems/Util/DatabasePatcher.php
@@ -64,7 +64,17 @@ class Gems_Util_DatabasePatcher
$this->patch_files[] = $file;
} elseif ($paths) {
- foreach ($paths as $location => $path) {
+ foreach ($paths as $path => $pathData) {
+ if (is_array($pathData)) {
+ $location = $pathData['name'];
+
+ } elseif ($pathData instanceof Zend_Db_Adapter_Abstract) {
+ $config = $pathData->getConfig();
+ $location = $config['dbname'];
+
+ } else {
+ $location = $pathData;
+ }
if (file_exists($path . '/' . $file)) {
$this->patch_files[] = $path . '/' . $file; | Adapted patcher to new database path strings | GemsTracker_gemstracker-library | train | php |
19d2a5393b6de4f817a648ad2176c14dbcce0fc3 | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -27,4 +27,5 @@ CREATE SCHEMA "Bar";
CREATE TABLE "Bar"."Foo"("Id" int);
INSERT INTO "Bar"."Foo"
SELECT * FROM generate_series(1, 100000);
+ANALYZE "Bar"."Foo";
SQL | Analyze before tests [skip ci] | ankane_dexter | train | rb |
108a659ca45111f9c4481cbf8d464cfc659ac9c4 | diff --git a/gns3server/handlers/api/controller/server_handler.py b/gns3server/handlers/api/controller/server_handler.py
index <HASH>..<HASH> 100644
--- a/gns3server/handlers/api/controller/server_handler.py
+++ b/gns3server/handlers/api/controller/server_handler.py
@@ -169,7 +169,7 @@ class ServerHandler:
data = r.body.decode("utf-8")
except Exception as e:
data = str(e)
- with open(os.path.join(debug_dir, "compute_{}.txt".format(compute.name)), "w+") as f:
+ with open(os.path.join(debug_dir, "compute_{}.txt".format(compute.id)), "w+") as f:
f.write("Compute ID: {}\n".format(compute.id))
f.write(data) | Fix bug when exporting debug information with multiple remote servers
Fix #<I> | GNS3_gns3-server | train | py |
bd4474fa62f1d514dc973bb3377d3a25e39716cc | diff --git a/salt/master.py b/salt/master.py
index <HASH>..<HASH> 100644
--- a/salt/master.py
+++ b/salt/master.py
@@ -1805,9 +1805,9 @@ class ClearFuncs(object):
'user': token['name']}
try:
self.event.fire_event(data, tagify([jid, 'new'], 'wheel'))
- ret = self.wheel_.call_func(fun, **clear_load)
- data['return'] = ret
- data['success'] = True
+ ret = self.wheel_.call_func(fun, full_return=True, **clear_load)
+ data['return'] = ret['return']
+ data['success'] = ret['success']
self.event.fire_event(data, tagify([jid, 'ret'], 'wheel'))
return {'tag': tag,
'data': data} | Fix 'success' value for wheel commands
The ClearFuncs was assuming a 'success' of True <I>% of the time for
wheel functions. This causes wheel funcs executed via salt-api (and
probably elsewhere) to incorrectly report the 'success' field when the
wheel function triggers a traceback (such as when required positional
arguments are not passed).
Resolves #<I> | saltstack_salt | train | py |
5287dae10b04bcb96a83a23494a70cd40c494f30 | diff --git a/Documentation/conf.py b/Documentation/conf.py
index <HASH>..<HASH> 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -130,6 +130,7 @@ extlinks = {
'jenkins-branch': (jenkins_branch + "/%s", ''),
'github-project': (project_link + '%s', ''),
'github-backport': (backport_format, ''),
+ 'gh-issue': (github_repo + 'issues/%s', 'GitHub issue '),
}
# The language for content autogenerated by Sphinx. Refer to documentation | docs: conf.py: add :gh-issue: role to reference GitHub issues
Use the extlink Sphinx extension to add a role for referencing GitHub
issues in a uniform fashion. Writing :gh-issue:`<I>` will automatically
convert into "GitHub issue <I>", with a link to the relevant issue. | cilium_cilium | train | py |
60f90f66c7b19f6ac054323fbd9fca6e07362883 | diff --git a/provision/kubernetes/helpers.go b/provision/kubernetes/helpers.go
index <HASH>..<HASH> 100644
--- a/provision/kubernetes/helpers.go
+++ b/provision/kubernetes/helpers.go
@@ -1084,6 +1084,7 @@ func runPod(ctx context.Context, args runSinglePodArgs) error {
if err != nil {
return err
}
+ enableServiceLinks := false
pod := &apiv1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: args.name,
@@ -1091,6 +1092,7 @@ func runPod(ctx context.Context, args runSinglePodArgs) error {
Labels: args.labels.ToLabels(),
},
Spec: apiv1.PodSpec{
+ EnableServiceLinks: &enableServiceLinks,
ImagePullSecrets: pullSecrets,
ServiceAccountName: serviceAccountNameForApp(args.app),
NodeSelector: nodeSelector, | Disable serviceLinks for isolated run | tsuru_tsuru | train | go |
17dcc33268eadda9c66e2cce32bdd285da92c2b8 | diff --git a/src/CleanFormatter.php b/src/CleanFormatter.php
index <HASH>..<HASH> 100644
--- a/src/CleanFormatter.php
+++ b/src/CleanFormatter.php
@@ -104,7 +104,7 @@ final class CleanFormatter implements Formatter
$types = implode('|', $types);
- [$oldTypes, $nameAndDescription] = explode(' ', (string) $tag);
+ [$oldTypes, $nameAndDescription] = explode(' ', (string) $tag, 2);
return trim($types . ' ' . $nameAndDescription);
} | fix CleanFormatter removing description | DeprecatedPackages_BetterReflectionDocBlock | train | php |
cf6793a5b46b90b84f69a34a83b89cecb224f7f6 | diff --git a/test/fragmentation-test-server.js b/test/fragmentation-test-server.js
index <HASH>..<HASH> 100755
--- a/test/fragmentation-test-server.js
+++ b/test/fragmentation-test-server.js
@@ -130,7 +130,7 @@ router.mount('*', 'fragmentation-test', function(request) {
}
});
- connection.on('close', function(connection) {
+ connection.on('close', function(reasonCode, description) {
console.log((new Date()) + " peer " + connection.remoteAddress + " disconnected.");
}); | Fixing fragmentation-test-server to accept the correct parameters for the 'close' event. | theturtle32_WebSocket-Node | train | js |
9f236309606ecdb439b811b25f0b985f5b0d2581 | diff --git a/packages/neos-ui/src/Containers/LeftSideBar/PageTree/Node/index.js b/packages/neos-ui/src/Containers/LeftSideBar/PageTree/Node/index.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui/src/Containers/LeftSideBar/PageTree/Node/index.js
+++ b/packages/neos-ui/src/Containers/LeftSideBar/PageTree/Node/index.js
@@ -30,7 +30,7 @@ export default class Node extends PureComponent {
uri: PropTypes.string.isRequired,
children: PropTypes.arrayOf(
PropTypes.string
- ),
+ )
}),
getTreeNode: PropTypes.func,
onNodeToggle: PropTypes.func, | BUGFIX: Remove trailing comma to satisfy linter | neos_neos-ui | train | js |
fdf110147fc77bf7a550ab232aa9b50c018dcec3 | diff --git a/src/watoki/curir/composition/PostProcessor.php b/src/watoki/curir/composition/PostProcessor.php
index <HASH>..<HASH> 100644
--- a/src/watoki/curir/composition/PostProcessor.php
+++ b/src/watoki/curir/composition/PostProcessor.php
@@ -37,8 +37,6 @@ class PostProcessor {
'button' => 'name'
);
- const HEADER_HTML_HEAD = 'x-html-head';
-
/**
* @var Map
*/
@@ -94,14 +92,7 @@ class PostProcessor {
*/
private function postProcessHtml(Response $response, $html) {
$printer = new Printer();
-
$response->setBody($printer->printNodes($this->extractBody($html)->getChildren()));
-
- $elements = array();
- foreach ($this->headElements as $element) {
- $elements[] = $printer->printNode($element);
- }
- $response->getHeaders()->set(self::HEADER_HTML_HEAD, implode("", $elements));
}
/** | Removed html head from http header | watoki_curir | train | php |
31482378e129c7efcf136eeb395bc4048ff13a57 | diff --git a/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php b/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php
index <HASH>..<HASH> 100644
--- a/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php
+++ b/Tests/Acceptance/Support/Extension/BackendStyleguideEnvironment.php
@@ -34,7 +34,6 @@ class BackendStyleguideEnvironment extends BackendEnvironment
'extbase',
'fluid',
'backend',
- 'about',
'install',
'frontend',
'recordlist', | [BUGFIX] AC tests don't reference ext:about anymore | TYPO3_styleguide | train | php |
218ff35f1ecd75b66fd8f979eb16901295c3c8fd | diff --git a/test/campaign.test.js b/test/campaign.test.js
index <HASH>..<HASH> 100644
--- a/test/campaign.test.js
+++ b/test/campaign.test.js
@@ -249,10 +249,10 @@ describe('@campaign-contactlists', function() {
}
Rhizome.Contactlist
.create({
- campaign: _campaign.id,
+ campaignId: _campaign.id,
name: 'test list',
- companies: _campaign.companies,
- user: _user.id
+ companyIds: _campaign.companies,
+ userId: _user.id
})
.then(function(contactList) {
contactList.name.should.equal('test list'); | - CHANGED: harmonise the naming conventions | coders-for-labour_rhizome-api-js | train | js |
d84142048a18c24635a44ce23b4516926662412c | diff --git a/openquake/engine/calculators/hazard/scenario/core.py b/openquake/engine/calculators/hazard/scenario/core.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/calculators/hazard/scenario/core.py
+++ b/openquake/engine/calculators/hazard/scenario/core.py
@@ -173,7 +173,7 @@ class ScenarioHazardCalculator(haz_general.BaseHazardCalculator):
models.OqJob.objects.get(pk=self.job.id))
gsim = valid.gsim(oqparam.gsim)
self.computer = GmfComputer(
- self.rupture, self.site_collection, self.imts, gsim,
+ self.rupture, self.site_collection, self.imts, [gsim],
trunc_level, correlation_model)
@EnginePerformanceMonitor.monitor | Fixed the scenario calculator
Former-commit-id: e2c0ca1af<I>d<I>fe<I>b2cf<I>fb<I>c | gem_oq-engine | train | py |
e1f364e5d1eafa7775b2ccd1d4bdf2af8becf2fd | diff --git a/text/atlas.go b/text/atlas.go
index <HASH>..<HASH> 100644
--- a/text/atlas.go
+++ b/text/atlas.go
@@ -30,6 +30,8 @@ type Atlas struct {
// NewAtlas creates a new Atlas containing glyphs of the given set of runes from the given font
// face.
+//
+// Do not destroy or close the font.Face after creating the Atlas.
func NewAtlas(face font.Face, runes []rune) *Atlas {
fixedMapping, fixedBounds := makeSquareMapping(face, runes, fixed.I(2)) | add note about not destroying face.Face to Atlas doc | faiface_pixel | train | go |
5b548a00b522e5e869f7690be3ca5b5589f57aea | diff --git a/meme.py b/meme.py
index <HASH>..<HASH> 100755
--- a/meme.py
+++ b/meme.py
@@ -13,6 +13,8 @@ GENERATORS = {
'BUTTHURT_DWELLER' : ('AdviceDogSpinoff' , 1438 , 'Butthurt-Dweller' , ) ,
'B_FROG' : ('AdviceDogSpinoff' , 1211 , 'Foul-Bachelorette-Frog' , ) ,
'B_FROG2' : ('AdviceDogSpinoff' , 1045 , 'Foul-Bachelor-Frog' , ) ,
+ 'BILL_PROVES_GOD' : ('AdviceDogSpinoff' , 435227 , 'Bill-Oreilly-Proves-God' , ) ,
+ 'BILL_PROVES_GOD_2' : ('AdviceDogSpinoff' , 445648 , 'Bill-Oreilly-Proves-God' , ) ,
'BUSICAT' : ('AdviceDogSpinoff' , 330000 , 'BusinessCat' , ) ,
'COOL_STORY_HOUSE' : ('AdviceDogSpinoff' , 16948 , 'cool-story-bro-house' , ) ,
'CREEPER' : ('AdviceDogSpinoff' , 173501 , 'Minecraft-Creeper' , ) , | added bill oreilly, you can't explain that | katylava_memepy | train | py |
76bd786d3f78c2c160d37be6ffeec5eb1ec3e580 | diff --git a/admin/langimport.php b/admin/langimport.php
index <HASH>..<HASH> 100755
--- a/admin/langimport.php
+++ b/admin/langimport.php
@@ -331,7 +331,7 @@
/**
* Returns a list of available language packs from a
* local copy shipped with standard moodle distro
- * this is for site that can't perform fopen
+ * this is for site that can't download components.
* @return array
*/
function get_local_list_of_languages() { | MDL-<I>, MDL-<I> - fixed inline docs; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
7442c001dd7a634c30caf659e92bff8e507d1ff9 | diff --git a/gitreceived.go b/gitreceived.go
index <HASH>..<HASH> 100644
--- a/gitreceived.go
+++ b/gitreceived.go
@@ -40,7 +40,7 @@ var privateKey string
func init() {
flag.Usage = func() {
- fmt.Fprintf(os.Stderr, "Usage: %v [options] <authchecker> <receiver>\n\n", os.Args[0])
+ fmt.Fprintf(os.Stderr, "Usage: %v [options] <privatekey> <authchecker> <receiver>\n\n", os.Args[0])
flag.PrintDefaults()
}
} | gitreceived: Fix usage
Closes #<I> | flynn_flynn | train | go |
1a94049497e1b14058034bf6d9008301c30f803b | diff --git a/tests/test_settings.py b/tests/test_settings.py
index <HASH>..<HASH> 100644
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -42,12 +42,6 @@ class TestProject(TestCase):
def test_update(self):
self.settings.update(settings_dict)
- assert self.settings.get_env_settings('definitions') == settings_dict['definitions_dir'][0]
assert self.settings.get_env_settings('iar') == settings_dict['tools']['iar']['path'][0]
assert self.settings.get_env_settings('uvision') == settings_dict['tools']['uvision']['path'][0]
assert self.settings.export_location_format == settings_dict['export_dir'][0]
-
- def test_definition(self):
- self.settings.update(settings_dict)
- self.settings.update_definitions_dir('new_path')
- assert self.settings.get_env_settings('definitions') == 'new_path' | Tests - path definitions removal | project-generator_project_generator | train | py |
3685056d43724fa83efa1cfcdef42401cbd720f0 | diff --git a/lib/tomlrb/scanner.rb b/lib/tomlrb/scanner.rb
index <HASH>..<HASH> 100644
--- a/lib/tomlrb/scanner.rb
+++ b/lib/tomlrb/scanner.rb
@@ -29,7 +29,7 @@ module Tomlrb
@eos = false
end
- def next_token
+ def next_token # rubocop:disable Metrics/MethodLength
case
when @ss.eos? then process_eos
when @ss.scan(SPACE) then next_token | Allow many lines to Scanner#next_token | fbernier_tomlrb | train | rb |
0f9e43f8265ea71f03a2fb6d5e41217d9bf06226 | diff --git a/src/medpy/itkvtk/application/gradient.py b/src/medpy/itkvtk/application/gradient.py
index <HASH>..<HASH> 100755
--- a/src/medpy/itkvtk/application/gradient.py
+++ b/src/medpy/itkvtk/application/gradient.py
@@ -14,11 +14,13 @@ import logging
from medpy.io import load, save, header
from medpy.core import Logger
from medpy.itkvtk import filter
+import os
+from medpy.core.exceptions import ArgumentError
# information
__author__ = "Oskar Maier"
-__version__ = "r0.4.0, 2011-12-12"
+__version__ = "r0.4.1, 2011-12-12"
__email__ = "[email protected]"
__status__ = "Release"
__description__ = """
@@ -39,6 +41,11 @@ def main():
if args.debug: logger.setLevel(logging.DEBUG)
elif args.verbose: logger.setLevel(logging.INFO)
+ # check if output image exists (will also be performed before saving, but as the gradient might be time intensity, a initial check can save frustration)
+ if not args.force:
+ if os.path.exists(args.output):
+ raise ArgumentError('The output image {} already exists.'.format(args.output))
+
# loading image
data_input, header_input = load(args.input) | Minor change: A possible existance of the output file is now checked beforehand to save frustration. | loli_medpy | train | py |
181aeca7a6a0d879ef20763ed8513436883ff2e1 | diff --git a/dipper/sources/FlyBase.py b/dipper/sources/FlyBase.py
index <HASH>..<HASH> 100644
--- a/dipper/sources/FlyBase.py
+++ b/dipper/sources/FlyBase.py
@@ -64,7 +64,7 @@ class FlyBase(PostgreSQLSource):
# itself (watch out for is_not)
]
- #columns = { WIP
+ # columns = { WIP
#'genotype': (
#feature_genotype_id, feature_id, genotype_id, chromosome_id, rank,
#cgroup, cvterm_id),
@@ -124,6 +124,8 @@ class FlyBase(PostgreSQLSource):
# the indexes and mature relational engine to the the
# work on someone elses machine.
# we can call it "in the cloud"
+ # from Lilly: http://gmod.org/wiki/FlyBase_Field_Mapping_Tables
+
'feature_dbxref_WIP': """ -- 17M rows in ~2 minutes
SELECT
feature.name feature_name, feature.uniquename feature_id, | fly bits cimments and prep | monarch-initiative_dipper | train | py |
b6c30d9c7d53f4377a65034a88f6a71b78126402 | diff --git a/src/ui/InputPopover.js b/src/ui/InputPopover.js
index <HASH>..<HASH> 100644
--- a/src/ui/InputPopover.js
+++ b/src/ui/InputPopover.js
@@ -48,7 +48,7 @@ export default class InputPopover extends Component {
}
componentDidMount() {
- document.addEventListener('click', this._onDocumentClick);
+ document.addEventListener('click', this._onDocumentClick, true);
document.addEventListener('keydown', this._onDocumentKeydown);
if (this._inputRef) {
this._inputRef.focus();
@@ -56,7 +56,7 @@ export default class InputPopover extends Component {
}
componentWillUnmount() {
- document.removeEventListener('click', this._onDocumentClick);
+ document.removeEventListener('click', this._onDocumentClick, true);
document.removeEventListener('keydown', this._onDocumentKeydown);
} | Fix Link and Image popover button not working in React <I> (#<I>) | sstur_react-rte | train | js |
712500693cf1a8cfb1187e460687f9b7bd920215 | diff --git a/www/src/pages/components/overlays.js b/www/src/pages/components/overlays.js
index <HASH>..<HASH> 100644
--- a/www/src/pages/components/overlays.js
+++ b/www/src/pages/components/overlays.js
@@ -74,7 +74,7 @@ export default withLayout(function TooltipSection({ data }) {
Overlay
</LinkedHeading>
<p>
- <code>Overlay</code> is the fundemental component for positioning and
+ <code>Overlay</code> is the fundamental component for positioning and
controlling tooltip visibility. It's a wrapper around react-popper, that
adds support for transitions, and visibility toggling.
</p> | Fixed spelling in documentation (#<I>) | react-bootstrap_react-bootstrap | train | js |
99246b400f3dd9bac7fdf4cf5c123ae8d0f5e0a0 | diff --git a/src/main/java/com/relayrides/pushy/apns/util/ApnsPayloadBuilder.java b/src/main/java/com/relayrides/pushy/apns/util/ApnsPayloadBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/relayrides/pushy/apns/util/ApnsPayloadBuilder.java
+++ b/src/main/java/com/relayrides/pushy/apns/util/ApnsPayloadBuilder.java
@@ -46,12 +46,14 @@ public class ApnsPayloadBuilder {
private String localizedActionButtonKey = null;
private Integer badgeNumber = null;
private String soundFileName = null;
-
+ private boolean contentAvailable = false;
+
private static final String APS_KEY = "aps";
private static final String ALERT_KEY = "alert";
private static final String BADGE_KEY = "badge";
private static final String SOUND_KEY = "sound";
-
+ private static final String CONTENT_AVAILABLE_KEY = "content-available";
+
private static final String ALERT_BODY_KEY = "body";
private static final String ACTION_LOC_KEY = "action-loc-key";
private static final String ALERT_LOC_KEY = "loc-key"; | Patch fail. Added a couple lines that were accidentally dropped from <I>cab<I>. | relayrides_pushy | train | java |
b8582112546ce250d9517ae454cc8fb248f98001 | diff --git a/pyaxiom/netcdf/sensors/timeseries.py b/pyaxiom/netcdf/sensors/timeseries.py
index <HASH>..<HASH> 100644
--- a/pyaxiom/netcdf/sensors/timeseries.py
+++ b/pyaxiom/netcdf/sensors/timeseries.py
@@ -520,7 +520,6 @@ class TimeSeries(object):
@property
def ncd(self):
- warnings.warn('This property is deprecated in favor of `dataset`', DeprecationWarning)
return self._nc
def __del__(self): | Don't warn about using the .ncd method (#3) | axiom-data-science_pyaxiom | train | py |
22ead14494b45047d3a5e05391bd150e5feedcd7 | diff --git a/naima/radiative.py b/naima/radiative.py
index <HASH>..<HASH> 100644
--- a/naima/radiative.py
+++ b/naima/radiative.py
@@ -93,6 +93,8 @@ class BaseRadiative(object):
else:
out_unit = 'erg/s'
+ photon_energy = _validate_ene(photon_energy)
+
sed = (self.flux(photon_energy,distance) * photon_energy ** 2.).to(out_unit)
return sed | fix radiative sed when calling with dict or table | zblz_naima | train | py |
ab0f040f894e0fa2c3783045e111a93e795002f4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -84,7 +84,7 @@ setup_kwargs = dict(
)
setup_kwargs['install_requires'] = [
- 'tornado', 'trollius', 'lxml', 'chardet', 'sqlalchemy',
+ 'tornado', 'trollius', 'chardet', 'sqlalchemy',
'namedlist', 'html5lib',
] | setup.py: Drop lxml as hard requirement | ArchiveTeam_wpull | train | py |
4f6a57d173892f921553d6a09c95f868c482d462 | diff --git a/mod/hotpot/db/update_to_v2.php b/mod/hotpot/db/update_to_v2.php
index <HASH>..<HASH> 100644
--- a/mod/hotpot/db/update_to_v2.php
+++ b/mod/hotpot/db/update_to_v2.php
@@ -7,7 +7,7 @@ function hotpot_update_to_v2_1_16() {
$length = 20;
$field = 'name';
$table = 'hotpot_questions';
- $index = '{$table}_{$name}_idx';
+ $index = "{$table}_{$name}_idx";
// remove the index
hotpot_db_delete_index("{$CFG->prefix}$table", $index); | change single quotes to double quotes. Probable fix for bug <I> | moodle_moodle | train | php |
99dc8a6078fcbbd6c0f14e4c88af41f05d2842ec | diff --git a/tests/integration/mixins/track-relationships-test.js b/tests/integration/mixins/track-relationships-test.js
index <HASH>..<HASH> 100644
--- a/tests/integration/mixins/track-relationships-test.js
+++ b/tests/integration/mixins/track-relationships-test.js
@@ -1,4 +1,5 @@
import Model, { hasMany, belongsTo, attr } from '@ember-data/model';
+import JSONAPISerializer from '@ember-data/serializer/json-api';
import { run } from '@ember/runloop';
import { resolve, all } from 'rsvp';
import { module, test } from 'qunit';
@@ -12,6 +13,7 @@ module('Integration | Mixin | track relationships', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
+ this.owner.register('serializer:application', JSONAPISerializer);
this.owner.register('model:post', Model.extend(TrackRelationships, {
title: attr('string'),
comments: hasMany(), | Add default serializer with deprecation and removal of fallback serializer | ef4_ember-data-relationship-tracker | train | js |
18ace0e0607b0b0f15bf9dc28c6355f57bb66fde | diff --git a/lxd/instance/operationlock/operationlock.go b/lxd/instance/operationlock/operationlock.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/operationlock/operationlock.go
+++ b/lxd/instance/operationlock/operationlock.go
@@ -57,6 +57,8 @@ func Create(instanceID int, action string, reusable bool, reuse bool) (*Instance
go func(op *InstanceOperation) {
for {
select {
+ case <-op.chanDone:
+ return
case <-op.chanReset:
continue
case <-time.After(time.Second * 30): | lxd/instance/operationlock: Exit go routine started in Create when the operation is done
Otherwise I have observed that go routines can hang around for up to <I>s after operation is completed. | lxc_lxd | train | go |
9cce36aa4ee741ab2179f28282e76f188a7987b8 | diff --git a/src/sentry_plugins/splunk/plugin.py b/src/sentry_plugins/splunk/plugin.py
index <HASH>..<HASH> 100644
--- a/src/sentry_plugins/splunk/plugin.py
+++ b/src/sentry_plugins/splunk/plugin.py
@@ -180,6 +180,7 @@ class SplunkPlugin(CorePluginMixin, Plugin):
headers={
'Authorization': 'Splunk {}'.format(token)
},
+ timeout=5,
).raise_for_status()
except Exception:
metrics.incr('integrations.splunk.forward-event.error', tags={ | ref(splunk): Lower timeout to 5s | getsentry_sentry-plugins | train | py |
b6ef13e72154e60398d4f8609863b9820da028db | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -182,7 +182,8 @@ class mochaPlugin {
// Verify that the service runtime matches with the current runtime
let { runtime } = inited.provider;
// Fix the real version for node10
- runtime = runtime.replace('.x', '');
+ if (runtime)
+ runtime = runtime.replace('.x', '');
let nodeVersion;
if (typeof process.versions === 'object') { | Check runtime var
To avoid "Cannot read property 'replace' of undefined" error if provider dont have Node version. | nordcloud_serverless-mocha-plugin | train | js |
d6617ef2090acf8ff49e9f3e19fa511bceddd991 | diff --git a/tests/test_basic.py b/tests/test_basic.py
index <HASH>..<HASH> 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -108,6 +108,13 @@ class TestBasic(unittest.TestCase):
class NoMoreDocOrder(WithDocOrder):
_doc_order = None
+ assert properties.Property('').equal(5, 5)
+ assert not properties.Property('').equal(5, 'hi')
+ assert properties.Property('').equal(np.array([1., 2.]),
+ np.array([1., 2.]))
+ assert not properties.Property('').equal(np.array([1., 2.]),
+ np.array([3., 4.]))
+
def test_bool(self):
class BoolOpts(properties.HasProperties): | Add properties.Property.equal tests which fail | seequent_properties | train | py |
d1ba6675d45d7bafd308f55ef3aaf88d1b2beb96 | diff --git a/lib/runners/to-result.js b/lib/runners/to-result.js
index <HASH>..<HASH> 100644
--- a/lib/runners/to-result.js
+++ b/lib/runners/to-result.js
@@ -2,9 +2,10 @@
var log = require('npmlog');
-module.exports = function toResult(launcherId, err, code, runnerProcess, config, testContext = {}) {
+module.exports = function toResult(launcherId, err, code, runnerProcess, config, testContext) {
var logs = [];
var message = '';
+ testContext = testContext ? testContext : {};
if (err) {
logs.push({ | Make toResult compatiable with node4 | testem_testem | train | js |
b3cef58916dfc5fe56196140999c912d8241fe49 | diff --git a/src/pt-BR/validation.php b/src/pt-BR/validation.php
index <HASH>..<HASH> 100644
--- a/src/pt-BR/validation.php
+++ b/src/pt-BR/validation.php
@@ -121,7 +121,7 @@ return [
'city' => 'cidade',
'country' => 'país',
'date' => 'data',
- 'day' => 'día',
+ 'day' => 'dia',
'description' => 'descrição',
'excerpt' => 'resumo',
'first_name' => 'primeiro nome', | Update pt-br validation.php
Minor type in the translation of the "day" word. | caouecs_Laravel-lang | train | php |
390aeebf6169a9e0b03a48858b6066f66b4a120b | diff --git a/js/feature/featureFileReader.js b/js/feature/featureFileReader.js
index <HASH>..<HASH> 100644
--- a/js/feature/featureFileReader.js
+++ b/js/feature/featureFileReader.js
@@ -156,17 +156,15 @@ var igv = (function (igv) {
};
igv.FeatureFileReader.prototype.isIndexable = function () {
+ var hasIndexURL,
+ isValidType,
+ isIndexed;
- var hasIndexURL = (undefined !== this.config.indexURL),
- isValidType = (this.format !== 'wig' && this.format !== 'seg');
+ hasIndexURL = (undefined !== this.config.indexURL);
+ isValidType = (this.format !== 'wig' && this.format !== 'seg');
+ isIndexed = (false !== this.config.indexed);
- // Local files are currently not indexable
- if (this.config.isLocalFile) {
- return false;
- }
- else {
- return this.config.indexed != false && (hasIndexURL || isValidType);
- }
+ return isIndexed && (hasIndexURL || isValidType);
};
/** | track - config.localFile param removed. | igvteam_igv.js | train | js |
e87e9c4e7fa56d8fb4738e5eec97af2abd9a8fcb | diff --git a/test/cluster/cluster-registry-clusterSpec.js b/test/cluster/cluster-registry-clusterSpec.js
index <HASH>..<HASH> 100644
--- a/test/cluster/cluster-registry-clusterSpec.js
+++ b/test/cluster/cluster-registry-clusterSpec.js
@@ -9,7 +9,7 @@ const connectionEndpointMock = {
getConnectionCount() { return 8 }
}
-describe('distributed-state-registry adds and removes names', () => {
+xdescribe('distributed-state-registry adds and removes names', () => {
const createClusterRegistry = function (serverName, externalUrl) {
const options = {
serverName,
diff --git a/test/cluster/cluster-registrySpec.js b/test/cluster/cluster-registrySpec.js
index <HASH>..<HASH> 100644
--- a/test/cluster/cluster-registrySpec.js
+++ b/test/cluster/cluster-registrySpec.js
@@ -12,7 +12,7 @@ const EventEmitter = require('events').EventEmitter
let realProcess
let emitter
-describe('cluster registry adds and removes names', () => {
+xdescribe('cluster registry adds and removes names', () => {
let clusterRegistry
const addSpy = jasmine.createSpy('add') | test: disabling cluster registry tests | deepstreamIO_deepstream.io | train | js,js |
6304656af189083d9e9aa6ff82a7e356ff2f920d | diff --git a/src/main/java/org/minimalj/application/Configuration.java b/src/main/java/org/minimalj/application/Configuration.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/minimalj/application/Configuration.java
+++ b/src/main/java/org/minimalj/application/Configuration.java
@@ -70,12 +70,19 @@ public class Configuration {
if (parameters == null) {
return configuredClass.newInstance();
} else {
- Class<?>[] parameterTypes = new Class[parameters.length];
- for (int i = 0; i<parameters.length; i++) {
- parameterTypes[i] = parameters[i].getClass();
+ CONSTRUCTOR: for (Constructor<?> constructor : configuredClass.getConstructors()) {
+ if (constructor.getParameterCount() != parameters.length) {
+ continue;
+ }
+ int i = 0;
+ for (i = 0; i<constructor.getParameterCount(); i++) {
+ if (!constructor.getParameterTypes()[i].isAssignableFrom(parameters[i].getClass())) {
+ continue CONSTRUCTOR;
+ }
+ }
+ return (T) constructor.newInstance(parameters);
}
- Constructor<? extends T> constructor = configuredClass.getConstructor(parameterTypes);
- return constructor.newInstance(parameters);
+ throw new NoSuchMethodException();
}
} catch (ClassNotFoundException e) {
throw new LoggingRuntimeException(e, logger, className + " not found / " + key + " configuration failed"); | Configuration: java doesn't provide getContructor with specific classes | BrunoEberhard_minimal-j | train | java |
e1872108bafa004c76f73f91bde4d47097e2c977 | diff --git a/app/models/user.rb b/app/models/user.rb
index <HASH>..<HASH> 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -2,7 +2,9 @@ class User < ActiveRecord::Base
has_secure_password
+ # associations connected to tkh_content gem. Any page or comment model will do
has_many :pages
+ has_many :comments, :dependent => :destroy
# not allowed are :admin:boolean, :auth_token:string, password_reset_token:string, password_reset_sent_at:datetime
attr_accessible :email, :password, :password_confirmation, :first_name, :last_name | Added has_many comments association. | allesklar_tkh_authentication | train | rb |
c0af5d1d0bb2f222fa65809c8233c029dc9b32b5 | diff --git a/tests/Models/EntryTest.php b/tests/Models/EntryTest.php
index <HASH>..<HASH> 100644
--- a/tests/Models/EntryTest.php
+++ b/tests/Models/EntryTest.php
@@ -457,4 +457,22 @@ class EntryTest extends TestCase
$this->assertEquals(['New Common Name'], $model->getAttributes()['cn']);
$this->assertEquals(['John Doe'], $model->getOriginal()['cn']);
}
+
+ public function test_set_first_attribute()
+ {
+ $model = $this->newEntryModel([], $this->newBuilder());
+
+ $model->setFirstAttribute('cn', 'John Doe');
+
+ $this->assertEquals(['cn' => ['John Doe']], $model->getAttributes());
+ }
+
+ public function test_get_first_attribute()
+ {
+ $model = $this->newEntryModel([
+ 'cn' => 'John Doe',
+ ], $this->newBuilder());
+
+ $this->assertEquals('John Doe', $model->getFirstAttribute('cn'));
+ }
} | Added tests for setFirstAttribute and getFirstAttribute | Adldap2_Adldap2 | train | php |
2d1deef3480b70a7fa5761c36b76051cc8666059 | diff --git a/src/ui/legend.js b/src/ui/legend.js
index <HASH>..<HASH> 100644
--- a/src/ui/legend.js
+++ b/src/ui/legend.js
@@ -28,8 +28,8 @@ d3plus.ui.legend = function(vars) {
var color_groups = {},
placed = [],
data = vars.nodes.restricted ? vars.nodes.restricted :
- vars.nodes.value ? vars.nodes.value : vars.data.pool
-
+ vars.nodes.value ? vars.nodes.value : vars.data.app
+
data.forEach(function(d){
if (placed.indexOf(d[vars.id.key]) < 0) { | legend colors should be determined from app data, not pooled data | alexandersimoes_d3plus | train | js |
6cb6c1a968cdfebdb3035e1d193ca91eb86da598 | diff --git a/spec/integration/memory_spec.rb b/spec/integration/memory_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/memory_spec.rb
+++ b/spec/integration/memory_spec.rb
@@ -18,7 +18,7 @@ describe "Memory Leak" do
load_defaults!
GC.start
- count_instances_of(klass).should == count
+ count_instances_of(klass).should <= count
end
end | memory_spec: objects become less is acceptable | activeadmin_activeadmin | train | rb |
ed381a6e2015bfe2aea29161de0996dc6e88d18d | diff --git a/lib/comma/version.rb b/lib/comma/version.rb
index <HASH>..<HASH> 100644
--- a/lib/comma/version.rb
+++ b/lib/comma/version.rb
@@ -1,3 +1,3 @@
module Comma
- VERSION = "3.0.3"
+ VERSION = "3.0.4"
end | Bump gem patch version for customisable file extensions | comma-csv_comma | train | rb |
99ce52b81dd90113a4c59757e4ca43b1e0102537 | diff --git a/releaf-core/spec/lib/template_field_type_mapper_spec.rb b/releaf-core/spec/lib/template_field_type_mapper_spec.rb
index <HASH>..<HASH> 100644
--- a/releaf-core/spec/lib/template_field_type_mapper_spec.rb
+++ b/releaf-core/spec/lib/template_field_type_mapper_spec.rb
@@ -272,6 +272,15 @@ describe Releaf::TemplateFieldTypeMapper do
end
end
end # describe ".field_type_name_for_boolean" do
+ describe ".field_type_name_for_float" do
+ %w[no matter what].each do |field_name|
+ context "when attribute name is '#{field_name}'" do
+ it "returns 'float'" do
+ expect( subject.send(:field_type_name_for_float, field_name, nil) ).to eq 'float'
+ end
+ end
+ end
+ end # describe ".field_type_name_for_float" do
describe ".field_type_name_for_integer" do
before do | Added field_type_name_for_float test | cubesystems_releaf | train | rb |
5a531b4f078d409be758c8b26fcbadea79cc4e0f | diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index <HASH>..<HASH> 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -4157,6 +4157,31 @@ func (c *containerLXC) Restore(sourceContainer container, stateful bool) error {
if c.IsRunning() {
wasRunning = true
+ ephemeral := c.IsEphemeral()
+ if ephemeral {
+ // Unset ephemeral flag
+ args := db.ContainerArgs{
+ Architecture: c.Architecture(),
+ Config: c.LocalConfig(),
+ Description: c.Description(),
+ Devices: c.LocalDevices(),
+ Ephemeral: false,
+ Profiles: c.Profiles(),
+ Project: c.Project(),
+ }
+
+ err := c.Update(args, false)
+ if err != nil {
+ return err
+ }
+
+ // On function return, set the flag back on
+ defer func() {
+ args.Ephemeral = ephemeral
+ c.Update(args, true)
+ }()
+ }
+
// This will unmount the container storage.
err := c.Stop(false)
if err != nil { | lxd/containers: Fix snapshot restore on ephemeral
Closes #<I> | lxc_lxd | train | go |
f95f88c34e7724e35e6501da97f8851e1eb33e51 | diff --git a/Swat/SwatCellRenderer.php b/Swat/SwatCellRenderer.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatCellRenderer.php
+++ b/Swat/SwatCellRenderer.php
@@ -130,9 +130,8 @@ abstract class SwatCellRenderer extends SwatUIObject
$css_class_name = substr($css_class_name, 1);
$css_class_names[] = $css_class_name;
-
- $php_class_name = get_parent_class($php_class_name);
}
+ $php_class_name = get_parent_class($php_class_name);
}
return array_reverse($css_class_names); | fix an infinite loop bug. crisis averted
svn commit r<I> | silverorange_swat | train | php |
591ecfeebbe8226c515b940f1f401b5d1cf13510 | diff --git a/logger.go b/logger.go
index <HASH>..<HASH> 100644
--- a/logger.go
+++ b/logger.go
@@ -10,8 +10,7 @@ import (
"time"
)
-// LoggerEntry is the structure
-// passed to the template.
+// LoggerEntry is the structure passed to the template.
type LoggerEntry struct {
StartTime string
Status int
@@ -22,13 +21,10 @@ type LoggerEntry struct {
Request *http.Request
}
-// LoggerDefaultFormat is the format
-// logged used by the default Logger instance.
-var LoggerDefaultFormat = "{{.StartTime}} | {{.Status}} | \t {{.Duration}} | {{.Hostname}} | {{.Method}} {{.Path}} \n"
+// LoggerDefaultFormat is the format logged used by the default Logger instance.
+var LoggerDefaultFormat = "{{.StartTime}} | {{.Status}} | \t {{.Duration}} | {{.Hostname}} | {{.Method}} {{.Path}}"
-// LoggerDefaultDateFormat is the
-// format used for date by the
-// default Logger instance.
+// LoggerDefaultDateFormat is the format used for date by the default Logger instance.
var LoggerDefaultDateFormat = time.RFC3339
// ALogger interface | Remove newline character from default logging template + Clean up comments | urfave_negroni | train | go |
5897a357e9550b14ce9a654de18143e8a2801716 | diff --git a/test/unit/test_composites.py b/test/unit/test_composites.py
index <HASH>..<HASH> 100644
--- a/test/unit/test_composites.py
+++ b/test/unit/test_composites.py
@@ -276,7 +276,7 @@ def get_url_tester_mock(identifier):
return source
-class UrlTesterChainTest(
+class URLTesterChainTest(
UrlTesterTestBaseMixin,
TestFunctionDoesNotHandleMixin,
unittest.TestCase | Rename UrlTesterChainTest to URLTesterChainTest | piotr-rusin_spam-lists | train | py |
2fc49029f81a103ce1a799993eb8d4cd9afe4bf5 | diff --git a/green/runner.py b/green/runner.py
index <HASH>..<HASH> 100644
--- a/green/runner.py
+++ b/green/runner.py
@@ -83,6 +83,8 @@ class GreenTestRunner():
# This blocks until the worker who is processing this
# particular test actually finishes
result.addProtoTestResult(async_response.get())
+ pool.terminate()
+ pool.join()
result.stopTestRun()
diff --git a/green/test/test_runner.py b/green/test/test_runner.py
index <HASH>..<HASH> 100644
--- a/green/test/test_runner.py
+++ b/green/test/test_runner.py
@@ -120,12 +120,7 @@ class TestSubprocesses(unittest.TestCase):
os.chdir(self.startdir)
# On windows, the subprocesses block access to the files while
# they take a bit to clean themselves up.
- for i in range(20):
- try:
- shutil.rmtree(self.tmpdir)
- break
- except PermissionError:
- time.sleep(.01)
+ shutil.rmtree(self.tmpdir)
del(self.stream) | Explicitly terminating and joining pools after we have finished, which makes it much easier to clean up after unit tests that exercise subprocesses on Windows. | CleanCut_green | train | py,py |
957bb7fd7674f930600f96a2d51bb7d4033de56d | diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js
index <HASH>..<HASH> 100644
--- a/src/bootstrap-table.js
+++ b/src/bootstrap-table.js
@@ -200,7 +200,7 @@
columns.push(column);
});
- this.options.columns = $.extend(columns, this.options.columns);
+ this.options.columns = $.extend(true, columns, this.options.columns);
$.each(this.options.columns, function(i, column) {
that.options.columns[i] = $.extend({}, BootstrapTable.COLUMN_DEFAULTS, column);
}); | Fix for headers where data is split to html and js
Tables with headers defined in markup (<th>Label<th>) and extra data (like visiblity) in JS would get existing Labels overwritten unless deep-extend is performed. | wenzhixin_bootstrap-table | train | js |
17392aa54ece62c51dbbc5542403bafc3cca83ee | diff --git a/src/commands/open.js b/src/commands/open.js
index <HASH>..<HASH> 100644
--- a/src/commands/open.js
+++ b/src/commands/open.js
@@ -8,9 +8,9 @@ const Logger = require('../logger.js');
async function open (params) {
const { alias } = params.options;
- const { org_id, app_id: appId } = await AppConfig.getAppData(alias).toPromise();
+ const { ownerId, appId } = await AppConfig.getAppDetails({ alias });
- const vhost = await Domain.getBest(appId, org_id);
+ const vhost = await Domain.getBest(appId, ownerId);
const url = 'https://' + vhost.fqdn;
Logger.println('Opening the application in your browser'); | Use `getAppDetails()` in `clever open` | CleverCloud_clever-tools | train | js |
7dae0c809567aeb05027a08e5439e0c74f7fdd4a | diff --git a/djstripe/models.py b/djstripe/models.py
index <HASH>..<HASH> 100644
--- a/djstripe/models.py
+++ b/djstripe/models.py
@@ -193,7 +193,7 @@ Use ``Customer.sources`` and ``Customer.subscriptions`` to access them.
try:
self._api_delete()
except InvalidRequestError as exc:
- if str(exc).startswith("No such customer:"):
+ if "No such customer:" in str(exc):
# The exception was thrown because the stripe customer was already
# deleted on the stripe side, ignore the exception
pass | API Change breaks customer deleted on stripe sync (#<I>)
When deleting a customer, check the entire error message string for "No such customer", as in newer versions of the API it is not at the beginning of the string. | dj-stripe_dj-stripe | train | py |
c67de46d6cee08f10d65984746fe5a153f02bd27 | diff --git a/client/src/views/channel.js b/client/src/views/channel.js
index <HASH>..<HASH> 100644
--- a/client/src/views/channel.js
+++ b/client/src/views/channel.js
@@ -88,6 +88,10 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({
var nice = url,
extra_html = '';
+ if (url.match(/^javascript:/)) {
+ return url;
+ }
+
// Add the http if no protoocol was found
if (url.match(/^www\./)) {
url = 'http://' + url; | Patching XSS vulnerability
The following message produces a clickable link that triggers JavaScript when clicked (pre-patch):
javascript://www.google.com/?%0Aalert(0);
Patch was designed to prevent this while maintaining support for arbitrary link protocols. | prawnsalad_KiwiIRC | train | js |
e99de20dfd346724921d6a95ff3debd8c02365ae | diff --git a/userns.go b/userns.go
index <HASH>..<HASH> 100644
--- a/userns.go
+++ b/userns.go
@@ -113,7 +113,7 @@ func parseMountedFiles(containerMount, passwdFile, groupFile string) uint32 {
size = u.Uid
}
if u.Gid > size {
- size = u.Uid
+ size = u.Gid
}
}
} | Coverity found an issue with copy and pasted code | containers_storage | train | go |
18496701a226ed476644e0fa739e3e47d43d0696 | diff --git a/agario-client.js b/agario-client.js
index <HASH>..<HASH> 100644
--- a/agario-client.js
+++ b/agario-client.js
@@ -137,7 +137,28 @@ Client.prototype = {
this.log('dump: ' + packet.toString());
this.emit('message', packet);
- processor(this, packet);
+
+ try {
+ processor(this, packet);
+ }catch(err){
+ this.onPacketError(packet, err);
+ }
+ },
+
+ // Had to do this because sometimes somehow packets get moving by 1 byte
+ // https://github.com/pulviscriptor/agario-client/issues/46#issuecomment-169764771
+ onPacketError: function(packet, err) {
+ var crash = true;
+
+ this.emit('packetError', packet, err, function() {
+ crash = false;
+ });
+
+ if(crash) {
+ if(this.debug >= 1)
+ this.log('Packet error detected! Check packetError event in README.md');
+ throw err;
+ }
},
send: function(buf) { | Event client.on.packetError added | pulviscriptor_agario-client | train | js |
d3a2e3ea9f48a7f6b7b2b080af5894f30e27ced9 | diff --git a/will/plugins/storage.py b/will/plugins/storage.py
index <HASH>..<HASH> 100644
--- a/will/plugins/storage.py
+++ b/will/plugins/storage.py
@@ -4,6 +4,11 @@ from will.decorators import respond_to, periodic, hear, randomly, route, rendere
class StoragePlugin(WillPlugin):
+ @respond_to("^How big is the db?")
+ def db_size(self, message):
+ self.bootstrap_storage()
+ self.say("It's %s." % self.storage.info()["used_memory_human"], message=message)
+
@respond_to("^SERIOUSLY. Clear (?P<key>.*)", case_sensitive=True)
def clear_storage(self, message, key=None):
if not key: | Adds "how big is the db?" | skoczen_will | train | py |
34e3afe9268002b994012a745f17b4d015b9019f | diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/internal/ResourceServiceProviderDescriptor.java b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/internal/ResourceServiceProviderDescriptor.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/internal/ResourceServiceProviderDescriptor.java
+++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/internal/ResourceServiceProviderDescriptor.java
@@ -39,6 +39,8 @@ public class ResourceServiceProviderDescriptor implements IResourceServiceProvid
this.extension = element.createExecutableExtension(attClass);
} catch (CoreException e) {
log.error(e.getMessage(), e);
+ } catch (NoClassDefFoundError e) {
+ log.error(e.getMessage(), e);
}
}
if (this.extension instanceof IResourceServiceProvider.Provider) { | [general] Improved handling of broken plugin.xml
Catch NoClassDefFoundError and provide a meaningful
log output.
Change-Id: I<I>f<I>a<I>b6ca<I>c6b<I>bcb1b<I>b6a7cd | eclipse_xtext-core | train | java |
b964cab5e59d501560b47ee5e2fbc8619c0db5e9 | diff --git a/marklogic-sesame/src/test/java/com/marklogic/semantics/sesame/MarkLogicGraphPermsTest.java b/marklogic-sesame/src/test/java/com/marklogic/semantics/sesame/MarkLogicGraphPermsTest.java
index <HASH>..<HASH> 100644
--- a/marklogic-sesame/src/test/java/com/marklogic/semantics/sesame/MarkLogicGraphPermsTest.java
+++ b/marklogic-sesame/src/test/java/com/marklogic/semantics/sesame/MarkLogicGraphPermsTest.java
@@ -104,7 +104,7 @@ public class MarkLogicGraphPermsTest extends SesameTestBase {
String defGraphQuery = "INSERT DATA { GRAPH <http://marklogic.com/test/graph/permstest> { <http://marklogic.com/test> <pp1> <oo1> } }";
String checkQuery = "ASK WHERE { GRAPH <http://marklogic.com/test/graph/permstest> {<http://marklogic.com/test> <pp1> <oo1> }}";
MarkLogicUpdateQuery updateQuery = conn.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);
- updateQuery.setGraphPerms(gmgr.permission("test-role", Capability.READ));
+ updateQuery.setGraphPerms(gmgr.permission("admin", Capability.READ));
updateQuery.execute();
BooleanQuery booleanQuery = conn.prepareBooleanQuery(QueryLanguage.SPARQL, checkQuery); | change test to use pre-existing role | marklogic_marklogic-sesame | train | java |
61e3bce794e12b3d5a394a324c3af59e4892992e | diff --git a/registry/storage/driver/swift/swift.go b/registry/storage/driver/swift/swift.go
index <HASH>..<HASH> 100644
--- a/registry/storage/driver/swift/swift.go
+++ b/registry/storage/driver/swift/swift.go
@@ -39,6 +39,7 @@ import (
storagedriver "github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/base"
"github.com/docker/distribution/registry/storage/driver/factory"
+ "github.com/docker/distribution/version"
)
const driverName = "swift"
@@ -151,7 +152,7 @@ func New(params Parameters) (*Driver, error) {
ApiKey: params.Password,
AuthUrl: params.AuthURL,
Region: params.Region,
- UserAgent: "distribution",
+ UserAgent: "distribution/" + version.Version,
Tenant: params.Tenant,
TenantId: params.TenantID,
Domain: params.Domain, | Show distribution version in User-Agent | docker_distribution | train | go |
4bb24ac8f00059202cc55156bf9086173b3ba301 | diff --git a/ui/app/helpers/lazy-click.js b/ui/app/helpers/lazy-click.js
index <HASH>..<HASH> 100644
--- a/ui/app/helpers/lazy-click.js
+++ b/ui/app/helpers/lazy-click.js
@@ -1,5 +1,4 @@
import Helper from '@ember/component/helper';
-import $ from 'jquery';
/**
* Lazy Click Event
@@ -10,7 +9,7 @@ import $ from 'jquery';
* that should be handled instead.
*/
export function lazyClick([onClick, event]) {
- if (!$(event.target).is('a')) {
+ if (event.target.tagName.toLowerCase() !== 'a') {
onClick(event);
}
} | Remove jquery from the lazy-click helper | hashicorp_nomad | train | js |
2c249ea2d377068d63386a43049d534b0d97346f | diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php
index <HASH>..<HASH> 100644
--- a/features/bootstrap/FeatureContext.php
+++ b/features/bootstrap/FeatureContext.php
@@ -7,8 +7,6 @@ use Behat\Behat\Context\ClosuredContextInterface,
use \WP_CLI\Utils;
-require_once 'PHPUnit/Framework/Assert/Functions.php';
-
require_once __DIR__ . '/../../php/utils.php';
/**
diff --git a/features/bootstrap/support.php b/features/bootstrap/support.php
index <HASH>..<HASH> 100644
--- a/features/bootstrap/support.php
+++ b/features/bootstrap/support.php
@@ -2,6 +2,12 @@
// Utility functions used by Behat steps
+function assertEquals( $expected, $actual ) {
+ if ( $expected != $actual ) {
+ throw new Exception( "Actual value: " . var_export( $actual ) );
+ }
+}
+
function checkString( $output, $expected, $action ) {
switch ( $action ) { | replace PHPUnit assertEquals() with homegrown variant | wp-cli_export-command | train | php,php |
99f7b62c83dcf19f02970fcc52c638c06d5a297e | diff --git a/lib/vagrant/action/vm/import.rb b/lib/vagrant/action/vm/import.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/action/vm/import.rb
+++ b/lib/vagrant/action/vm/import.rb
@@ -22,10 +22,12 @@ module Vagrant
end
# Import completed successfully. Continue the chain
- @app.call(env) if !env.error?
-
+ @app.call(env)
+ end
+
+ def rescue(env)
# Interrupted, destroy the VM
- env["actions"].run(:destroy) if env.interrupted?
+ env["actions"].run(:destroy)
end
end
end | first middleware, import, moved to rescue for cleanup | hashicorp_vagrant | train | rb |
85379754e127ba5f576e82af3c2996195078f069 | diff --git a/sdk/go/src/sawtooth_sdk/processor/worker.go b/sdk/go/src/sawtooth_sdk/processor/worker.go
index <HASH>..<HASH> 100644
--- a/sdk/go/src/sawtooth_sdk/processor/worker.go
+++ b/sdk/go/src/sawtooth_sdk/processor/worker.go
@@ -28,7 +28,7 @@ import (
)
// The main worker thread finds an appropriate handler and processes the request
-func worker(context *zmq.Context, uri string, queue chan *validator_pb2.Message, handlers []TransactionHandler) {
+func worker(context *zmq.Context, uri string, queue <-chan *validator_pb2.Message, handlers []TransactionHandler) {
// Connect to the main send/receive thread
connection, err := messaging.NewConnection(context, zmq.DEALER, uri)
if err != nil { | Make worker() queue a receive-only channel
Making this a receive-only channel clarifies the intent and prevents
sending on the channel. | hyperledger_sawtooth-core | train | go |
412d88e7684c91d77e0a6c2418bb6236401652c1 | diff --git a/builtin/providers/aws/resource_aws_rds_cluster_instance_test.go b/builtin/providers/aws/resource_aws_rds_cluster_instance_test.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_rds_cluster_instance_test.go
+++ b/builtin/providers/aws/resource_aws_rds_cluster_instance_test.go
@@ -177,10 +177,25 @@ resource "aws_rds_cluster" "default" {
}
resource "aws_rds_cluster_instance" "cluster_instances" {
- identifier = "tf-cluster-instance-%d"
- cluster_identifier = "${aws_rds_cluster.default.id}"
- instance_class = "db.r3.large"
+ identifier = "tf-cluster-instance-%d"
+ cluster_identifier = "${aws_rds_cluster.default.id}"
+ instance_class = "db.r3.large"
+ db_parameter_group_name = "${aws_db_parameter_group.bar.name}"
}
+resource "aws_db_parameter_group" "bar" {
+ name = "tfcluster-test-group"
+ family = "aurora5.6"
+
+ parameter {
+ name = "back_log"
+ value = "32767"
+ apply_method = "pending-reboot"
+ }
+
+ tags {
+ foo = "bar"
+ }
+}
`, n, n)
} | provider/aws: Add db_param group to RDS Cluster Instance test | hashicorp_terraform | train | go |
a325700594e2c721670bb791d0e05a9f92683d9b | diff --git a/pyethereum/packeter.py b/pyethereum/packeter.py
index <HASH>..<HASH> 100644
--- a/pyethereum/packeter.py
+++ b/pyethereum/packeter.py
@@ -64,11 +64,11 @@ class Packeter(object):
dict((v, k) for k, v in disconnect_reasons_map.items())
SYNCHRONIZATION_TOKEN = 0x22400891
- PROTOCOL_VERSION = 0x0c
+ PROTOCOL_VERSION = 0x0f
+
# is the node s Unique Identifier and is the 512-bit hash that serves to
# identify the node.
NETWORK_ID = 0
- # as sent by Ethereum(++)/v0.3.11/brew/Darwin/unknown
CLIENT_ID = 'Ethereum(py)/0.5.1/%s/Protocol:%d' % (sys.platform,
PROTOCOL_VERSION)
CAPABILITIES = 0x01 + 0x02 + 0x04 # node discovery + transaction relaying | increase protocol version to 0x0f | ethereum_pyethereum | train | py |
9f4620e9ea53a557a45a86ba0feb71638e2d9d3d | diff --git a/lib/dentaku/calculator.rb b/lib/dentaku/calculator.rb
index <HASH>..<HASH> 100644
--- a/lib/dentaku/calculator.rb
+++ b/lib/dentaku/calculator.rb
@@ -71,9 +71,14 @@ module Dentaku
end
if block_given?
- result = yield
- @memory = restore
- return result
+ begin
+ result = yield
+ @memory = restore
+ return result
+ rescue => e
+ @memory = restore
+ raise e
+ end
end
self
diff --git a/spec/calculator_spec.rb b/spec/calculator_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/calculator_spec.rb
+++ b/spec/calculator_spec.rb
@@ -130,6 +130,17 @@ describe Dentaku::Calculator do
expect(calculator.solve(expressions) { :foo })
.to eq(more_apples: :foo)
end
+
+ it "solves remainder of expressions with unbound variable" do
+ calculator.store(peaches: 1, oranges: 1)
+ expressions = { more_apples: "apples + 1", more_peaches: "peaches + 1" }
+ result = calculator.solve(expressions)
+ expect(calculator.memory).to eq("peaches" => 1, "oranges" => 1)
+ expect(result).to eq(
+ more_apples: :undefined,
+ more_peaches: 2
+ )
+ end
end
it 'evaluates a statement with no variables' do | prevent errors from corrupting calculator memory
Closes #<I> | rubysolo_dentaku | train | rb,rb |
52120ff53850cf532e9d8a731603acdb60ac127d | diff --git a/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentBuilder.java b/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentBuilder.java
index <HASH>..<HASH> 100644
--- a/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentBuilder.java
+++ b/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentBuilder.java
@@ -18,7 +18,7 @@ import java.util.zip.ZipInputStream;
/**
* Builder for creating new deployments.
*
- * A builder instance can be obtained through {@link org.activiti.engine.RuntimeService#createDeployment()}.
+ * A builder instance can be obtained through {@link org.activiti.engine.RepositoryService#createDeployment()}.
*
* Multiple resources can be added to one deployment before calling the {@link #deploy()}
* operation. | Javadoc fix for DeploymentBuilder | camunda_camunda-bpm-platform | train | java |
315bf5de2292321bf093f72903db2fd7acc21854 | diff --git a/lib/Psc/Code/Test/Base.php b/lib/Psc/Code/Test/Base.php
index <HASH>..<HASH> 100644
--- a/lib/Psc/Code/Test/Base.php
+++ b/lib/Psc/Code/Test/Base.php
@@ -40,7 +40,8 @@ class Base extends AssertionsBase {
public function getProject() {
if (!isset($this->project)) {
- $this->project = $GLOBALS['env']['container']->getProject();
+ $this->project = PSC::getProject();
+ //$this->project = $GLOBALS['env']['container']->getProject();
}
return $this->project;
} | oh lord, who will rewrite this stuff, once .. | webforge-labs_psc-cms | train | php |
c981ead40e818f3bbb0512e825bba6c12b277582 | diff --git a/py/__init__.py b/py/__init__.py
index <HASH>..<HASH> 100644
--- a/py/__init__.py
+++ b/py/__init__.py
@@ -20,7 +20,9 @@ For questions please check out http://pylib.org/contact.html
from initpkg import initpkg
trunk = None
-version = trunk or "1.0.2"
+version = trunk or "1.0.x"
+
+del trunk
initpkg(__name__,
description = "py.test and pylib: advanced testing tool and networking lib",
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ def main():
name='py',
description='py.test and pylib: advanced testing tool and networking lib',
long_description = long_description,
- version= trunk or '1.0.2',
+ version= trunk or '1.0.x',
url='http://pylib.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], | switching release branch back to <I>.x versioning
--HG--
branch : <I>.x | vmalloc_dessert | train | py,py |
bfed603ba0bd1af7b5e8c600e6ffd60c7454ba84 | diff --git a/lib/spinning_cursor/cursor.rb b/lib/spinning_cursor/cursor.rb
index <HASH>..<HASH> 100644
--- a/lib/spinning_cursor/cursor.rb
+++ b/lib/spinning_cursor/cursor.rb
@@ -13,6 +13,10 @@ module SpinningCursor
CLR = "\e[0K"
end
+ ESC_CURS_INVIS = "\e[?25l"
+ ESC_CURS_VIS = "\e[?25h"
+ ESC_R_AND_CLR = "\r#{CLR}"
+
#
# Manages line reset in the console
# | Add some 'escape sequences' as Constants | prydonius_spinning_cursor | train | rb |
5db829d118dfb92ad18301f59b0c2cf172d9070d | diff --git a/lib/adapters/http.js b/lib/adapters/http.js
index <HASH>..<HASH> 100755
--- a/lib/adapters/http.js
+++ b/lib/adapters/http.js
@@ -25,6 +25,14 @@ var supportedProtocols = platform.protocols.map(function(protocol) {
return protocol + ':';
});
+/**
+ * If the proxy or config beforeRedirects functions are defined, call them with the options
+ * object.
+ *
+ * @param {Object<string, any>} options - The options object that was passed to the request.
+ *
+ * @returns {Object<string, any>}
+ */
function dispatchBeforeRedirect(options) {
if (options.beforeRedirects.proxy) {
options.beforeRedirects.proxy(options);
@@ -35,10 +43,13 @@ function dispatchBeforeRedirect(options) {
}
/**
+ * If the proxy or config afterRedirects functions are defined, call them with the options
*
* @param {http.ClientRequestArgs} options
* @param {AxiosProxyConfig} configProxy
* @param {string} location
+ *
+ * @returns {http.ClientRequestArgs}
*/
function setProxy(options, configProxy, location) {
var proxy = configProxy; | docs(adapters/http) | axios_axios | train | js |
13226e44f563eb0748ab067842841f9cc9afdd6c | diff --git a/test/fixtures.rb b/test/fixtures.rb
index <HASH>..<HASH> 100644
--- a/test/fixtures.rb
+++ b/test/fixtures.rb
@@ -1,3 +1,4 @@
+require 'hanami/validations'
require 'hanami/model'
require 'hanami/mailer' | Explicitely require hanami/validations on top of test_helper.rb | hanami_hanami | train | rb |
e8c59746e26e274a0884674d7470f180f5d1e1bd | diff --git a/lib/redfish/tasks/log_levels.rb b/lib/redfish/tasks/log_levels.rb
index <HASH>..<HASH> 100644
--- a/lib/redfish/tasks/log_levels.rb
+++ b/lib/redfish/tasks/log_levels.rb
@@ -22,7 +22,7 @@ module Redfish
def validate_levels(levels)
levels.each_pair do |key, value|
- unless %w(SEVERE WARNING INFO CONFIG FINE FINER FINSEST ALL).include?(value)
+ unless %w(SEVERE WARNING INFO CONFIG FINE FINER FINEST ALL OFF).include?(value)
raise "Log level '#{key}' has an unknown level #{value}"
end
end | Fix spelling of FINEST log level and add OFF log level | realityforge_redfish | train | rb |
75629e6237562bcc18353d2da77faa0b15f5600a | diff --git a/lib/cassandra/mapper/convert.rb b/lib/cassandra/mapper/convert.rb
index <HASH>..<HASH> 100644
--- a/lib/cassandra/mapper/convert.rb
+++ b/lib/cassandra/mapper/convert.rb
@@ -62,7 +62,7 @@ module Cassandra::Mapper::Convert
def to_time(value)
value = Time.parse value if value.is_a? String
value = value.to_time if value.is_a? Date
- [(value.to_f * 1000).to_i].pack('L!>')
+ [(value.to_f * 1000).to_i].pack('Q>')
end
def from_time(value) | Use more cross-platform way to pack time | brainopia_cassandra-mapper | train | rb |
e661ac4f94814bb810ae778fb0ea1e8cc5922b34 | diff --git a/apps/actor-android/src/main/java/im/actor/messenger/app/fragment/chat/ChatActivity.java b/apps/actor-android/src/main/java/im/actor/messenger/app/fragment/chat/ChatActivity.java
index <HASH>..<HASH> 100644
--- a/apps/actor-android/src/main/java/im/actor/messenger/app/fragment/chat/ChatActivity.java
+++ b/apps/actor-android/src/main/java/im/actor/messenger/app/fragment/chat/ChatActivity.java
@@ -707,9 +707,11 @@ public class ChatActivity extends BaseActivity{
spannedMention.append(' ');
spaceAppended = true;
}
+ boolean isAutocomplite = mentionsAdapter.getCount()==1;
+ int searchStringCount = mentionSearchString.length();
text.replace(mentionStart, mentionStart + mentionSearchString.length() + 1, spannedMention);
- messageBody.setSelection(mentionStart + (mentionsAdapter.getCount()==1?mentionSearchString.length():0) + 2, mentionStart + spannedMention.length() - (spaceAppended?2:1) );
+ messageBody.setSelection(mentionStart + (isAutocomplite?searchStringCount:0) + 2, mentionStart + spannedMention.length() - (spaceAppended?2:1) );
}
hideMentions();
} | feat(android) mention autocomplete select added only | actorapp_actor-platform | train | java |
0260e4d4947b33ba11881fa8594ca08bb5f69c55 | 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='msm',
- version='0.5.5',
+ version='0.5.6',
packages=['msm'],
install_requires=['GitPython', 'typing'],
url='https://github.com/MycroftAI/mycroft-skills-manager', | Increment version to <I> | MycroftAI_mycroft-skills-manager | train | py |
b6a515f8703b3fc863500333d918262a432e1e05 | diff --git a/lib/mongo/query.rb b/lib/mongo/query.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/query.rb
+++ b/lib/mongo/query.rb
@@ -42,11 +42,16 @@ module XGen
# number_to_return :: Max number of records to return. (Called :limit
# in calls to Collection#find.)
#
- # order_by :: If not +nil+, specifies record return order. Either hash
- # of field names as keys and 1/-1 as values; 1 ==
- # ascending, -1 == descending, or array of field names
- # (all assumed to be sorted in ascending order). (Called
- # :sort in calls to Collection#find.)
+ # order_by :: If not +nil+, specifies record sort order. May be either
+ # a hash or an array. If an array, it should be an array
+ # of field names which will all be sorted in ascending
+ # order. If a hash, it may be either a regular Hash or an
+ # OrderedHash. The keys should be field names, and the
+ # values should be 1 (ascending) or -1 (descending). Note
+ # that if it is a regular Hash then sorting by more than
+ # one field probably will not be what you intend because
+ # key order is not preserved. (order_by is called :sort in
+ # calls to Collection#find.)
def initialize(sel={}, return_fields=nil, number_to_skip=0, number_to_return=0, order_by=nil)
@number_to_skip, @number_to_return, @order_by = number_to_skip, number_to_return, order_by
self.selector = sel | Add docs about order_by Hash/OrderedHash | mongodb_mongo-ruby-driver | train | rb |
cc777e175e9042716ab4ad878b0876cbd0a95da7 | diff --git a/pkg/cmd/grafana-server/commands/cli.go b/pkg/cmd/grafana-server/commands/cli.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/grafana-server/commands/cli.go
+++ b/pkg/cmd/grafana-server/commands/cli.go
@@ -127,6 +127,20 @@ func executeServer(configFile, homePath, pidFile, packaging string, traceDiagnos
}
}()
+ defer func() {
+ // If we've managed to initialize them, this is the last place
+ // where we're able to log anything that'll end up in Grafana's
+ // log files.
+ // Since operators are not always looking at stderr, we'll try
+ // to log any and all panics that are about to crash Grafana to
+ // our regular log locations before exiting.
+ if r := recover(); r != nil {
+ reason := fmt.Sprintf("%v", r)
+ clilog.Error("Critical error", "reason", reason, "stackTrace", string(debug.Stack()))
+ panic(r)
+ }
+ }()
+
if traceDiagnostics.enabled {
fmt.Println("diagnostics: tracing enabled", "file", traceDiagnostics.file)
f, err := os.Create(traceDiagnostics.file) | Chore: Panic! in the Logs (#<I>) | grafana_grafana | train | go |
9ef24d54568ac01c9a14aa085fbd1fbc7c97536a | diff --git a/code/extensions/AdvancedWorkflowExtension.php b/code/extensions/AdvancedWorkflowExtension.php
index <HASH>..<HASH> 100644
--- a/code/extensions/AdvancedWorkflowExtension.php
+++ b/code/extensions/AdvancedWorkflowExtension.php
@@ -2,6 +2,7 @@
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Permission;
+use SilverStripe\Core\Extension;
/**
* Handles interactions triggered by users in the backend of the CMS. Replicate this
@@ -11,7 +12,7 @@ use SilverStripe\Security\Permission;
* @license BSD License (http://silverstripe.org/bsd-license/)
* @package advancedworkflow
*/
-class AdvancedWorkflowExtension extends LeftAndMainExtension {
+class AdvancedWorkflowExtension extends Extension {
private static $allowed_actions = array(
'updateworkflow', | FIX, replacing an extension that no longer exists. | symbiote_silverstripe-advancedworkflow | train | php |
9dc6b75f76062315c58196c51ffe9d1319988520 | diff --git a/sos/plugins/apt.py b/sos/plugins/apt.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/apt.py
+++ b/sos/plugins/apt.py
@@ -23,6 +23,8 @@ class Apt(Plugin, DebianPlugin, UbuntuPlugin):
"/etc/apt", "/var/log/apt"
])
+ self.add_forbidden_path("/etc/apt/auth.conf")
+
self.add_cmd_output([
"apt-get check",
"apt-config dump", | [apt] add /etc/apt/auth.conf to forbidden path
Resolves: #<I> | sosreport_sos | train | py |
ac313e44f14828f92d62b9924ccb98be3d564860 | diff --git a/src/widgets/textarea/sender/sender.js b/src/widgets/textarea/sender/sender.js
index <HASH>..<HASH> 100644
--- a/src/widgets/textarea/sender/sender.js
+++ b/src/widgets/textarea/sender/sender.js
@@ -41,12 +41,18 @@
}
+ /* KEYDOWN */
+
+ ___keydown ( $target ) {
+
+ this._on ( this.$textarea, 'keydown', this.__keydown );
+
+ }
+
/* SEND */
send () {
- if ( !$.isFocused ( this.textarea ) ) return;
-
this.form.submit ();
} | TextareaSender: listening only to keystrokes happening inside the textarea | svelto_svelto | train | js |
ce6f4011b0dec8f905ace9c49ddf2dfd64645ac8 | diff --git a/ratcave/coordinates.py b/ratcave/coordinates.py
index <HASH>..<HASH> 100644
--- a/ratcave/coordinates.py
+++ b/ratcave/coordinates.py
@@ -51,6 +51,30 @@ class Coordinates(IterObservable):
self[-1] = value
@property
+ def xy(self):
+ return self[-3:-1]
+
+ @xy.setter
+ def xy(self, value):
+ self[-3:-1] = value
+
+ @property
+ def yz(self):
+ return self[-2:]
+
+ @yz.setter
+ def yz(self, value):
+ self[-2:] = value
+
+ @property
+ def xz(self):
+ return self[-3], self[-1]
+
+ @xz.setter
+ def xz(self, value):
+ self[-3], self[-1] = value[0], value[1]
+
+ @property
def xyz(self):
return self[-3:] | added two-component properties (and setters) to the Coordinates class | ratcave_ratcave | train | py |
685f78df7b0af508685b439ef9fb1edc3445d7c1 | diff --git a/tensorbase/base.py b/tensorbase/base.py
index <HASH>..<HASH> 100644
--- a/tensorbase/base.py
+++ b/tensorbase/base.py
@@ -49,6 +49,9 @@ class Layers:
# Conv function
input_channels = self.input.get_shape()[3]
+ if filter_size == 0: # outputs a 1x1 feature map; used for FCN
+ filter_size = self.input.get_shape()[2]
+ padding = 'VALID'
output_shape = [filter_size, filter_size, input_channels, output_channels]
w = self.weight_variable(name='weights', shape=output_shape)
self.input = tf.nn.conv2d(self.input, w, strides=[1, stride, stride, 1], padding=padding)
@@ -459,7 +462,7 @@ class Data:
return (x * (1 / max_val) - 0.5) * 2 # returns scaled input ranging from [-1, 1]
@classmethod
- def batch_inputs(cls, read_and_decode_fn, tf_file, batch_size, mode="train", num_readers=4, num_threads=4, min_examples=5000):
+ def batch_inputs(cls, read_and_decode_fn, tf_file, batch_size, mode="train", num_readers=4, num_threads=4, min_examples=1000):
with tf.name_scope('batch_processing'):
if mode == "train":
epochs = None | Added fully convolutional option to network | dancsalo_TensorBase | train | py |
caa784ab7b70701a643dab2ca1f4abbcf2a85194 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,10 +31,16 @@ requirements = [
'requests>=2.13.0',
'scipy>=0.18.1',
'six>=1.10.0',
- 'tensorflow>=1.0.0',
'Werkzeug>=0.11.15',
]
+# only add tensorflow as a requirement if it is not already provided.
+# E.g. tensorflow-gpu
+try:
+ import tensorflow
+except ImportError:
+ requirements.append('tensorflow>=1.0.0')
+
test_requirements = [
'pytest',
'pytest-flask', | only add tensorflow as a requirement if it is not already provided (#<I>) | merantix_picasso | train | py |
ea5725a1b21dfbe49ff542a6608802b892610a03 | diff --git a/lib/rails_admin_tag_list.rb b/lib/rails_admin_tag_list.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_admin_tag_list.rb
+++ b/lib/rails_admin_tag_list.rb
@@ -39,8 +39,8 @@ RailsAdmin::Config::Fields.register_factory do |parent, properties, fields|
if defined?(::ActsAsTaggableOn) && model.taggable?
tag_types = model.tag_types
- if tag_types.include?(properties[:name])
- name = "#{properties[:name].to_s.singularize}_list".to_sym
+ if tag_types.include?(properties.name)
+ name = "#{properties.name.to_s.singularize}_list".to_sym
fields << RailsAdmin::Config::Fields::Types::TagList.new(parent, name, properties)
end | Fixed issue with change in property field access in latest rails_admin
Issue: undefined method `[]' for #<RailsAdmin::Adapters::ActiveRecord::Property:...>
Reason: <URL> | kryzhovnik_rails_admin_tag_list | train | rb |
3a980eac1adccbfe317ea34c16fc16bc5f440329 | diff --git a/format-config-v1.go b/format-config-v1.go
index <HASH>..<HASH> 100644
--- a/format-config-v1.go
+++ b/format-config-v1.go
@@ -240,7 +240,8 @@ func initFormatXL(storageDisks []StorageAPI) (err error) {
}
return err
}
- u, err := uuid.New()
+ var u *uuid.UUID
+ u, err = uuid.New()
if err != nil {
saveFormatErrCnt++
// Check for write quorum. | Fix shadowing of err variable (#<I>) | minio_minio | train | go |
7a2572dbaba69bf0fc14b169b753d5e8b2112ed4 | diff --git a/core/src/main/java/com/graphhopper/GraphHopper.java b/core/src/main/java/com/graphhopper/GraphHopper.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/graphhopper/GraphHopper.java
+++ b/core/src/main/java/com/graphhopper/GraphHopper.java
@@ -176,18 +176,18 @@ public class GraphHopper implements GraphHopperAPI
}
/**
- * Configures the underlying storage to be used on a well equipped server.
+ * Configures the underlying storage and response to be used on a well equipped server. Result
+ * also optimized for usage in the web module i.e. try reduce network IO.
*/
public GraphHopper forServer()
{
- // simplify to reduce network IO
setSimplifyResponse(true);
return setInMemory();
}
/**
- * Configures the underlying storage to be used on a Desktop computer with enough RAM but no
- * network latency.
+ * Configures the underlying storage to be used on a Desktop computer or within another Java
+ * application with enough RAM but no network latency.
*/
public GraphHopper forDesktop()
{
@@ -196,8 +196,8 @@ public class GraphHopper implements GraphHopperAPI
}
/**
- * Configures the underlying storage to be used on a less powerful machine like Android and
- * Raspberry Pi with only few RAM.
+ * Configures the underlying storage to be used on a less powerful machine like Android or
+ * Raspberry Pi with only few MB of RAM.
*/
public GraphHopper forMobile()
{ | improved docs for GraphHopper.forXY | graphhopper_graphhopper | train | java |
9b0612ce1e737afeaf874c39f0a270004f61e1e2 | diff --git a/lib/arjdbc/abstract/database_statements.rb b/lib/arjdbc/abstract/database_statements.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/abstract/database_statements.rb
+++ b/lib/arjdbc/abstract/database_statements.rb
@@ -13,7 +13,9 @@ module ArJdbc
# if prepared statements are enabled
def exec_query(sql, name = nil, binds = NO_BINDS, prepare: false)
if without_prepared_statement?(binds)
- execute(sql, name)
+ # Calling #execute here instead of this blows up a bunch of
+ # AR tests because they stub out #execute
+ log(sql, name) { @connection.execute(sql) }
else
log(sql, name, binds) do
# It seems that #supports_statement_cache? is defined but isn't checked before setting "prepare" (AR 5.0) | Avoid calling #execute from #exec_query because AR assumes they aren't related | jruby_activerecord-jdbc-adapter | train | rb |
f824c01dc8ec6cdcd183bd79b14a6d8652fb5ce1 | diff --git a/src/main/java/graphql/execution/FetchedValue.java b/src/main/java/graphql/execution/FetchedValue.java
index <HASH>..<HASH> 100644
--- a/src/main/java/graphql/execution/FetchedValue.java
+++ b/src/main/java/graphql/execution/FetchedValue.java
@@ -2,12 +2,17 @@ package graphql.execution;
import com.google.common.collect.ImmutableList;
import graphql.GraphQLError;
-import graphql.Internal;
+import graphql.PublicApi;
+import graphql.execution.instrumentation.parameters.InstrumentationFieldCompleteParameters;
import java.util.List;
import java.util.function.Consumer;
-@Internal
+/**
+ * Note: This is returned by {@link InstrumentationFieldCompleteParameters#getFetchedValue()}
+ * and therefore part of the public despite never used in a method signature.
+ */
+@PublicApi
public class FetchedValue {
private final Object fetchedValue;
private final Object rawFetchedValue; | make FetchedValue part of the public API (#<I>) | graphql-java_graphql-java | train | java |
70363bc240a3844334b35b9e70c1862d8e869b1c | diff --git a/src/pythonfinder/environment.py b/src/pythonfinder/environment.py
index <HASH>..<HASH> 100644
--- a/src/pythonfinder/environment.py
+++ b/src/pythonfinder/environment.py
@@ -7,7 +7,7 @@ import sys
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or bool(
os.environ.get("PYENV_ROOT")
)
-ASDF_INSTALLED = bool(os.environ.get("ASDF_DATA_DIR"))
+ASDF_INSTALLED = bool(os.environ.get("ASDF_DIR"))
PYENV_ROOT = os.path.expanduser(
os.path.expandvars(os.environ.get("PYENV_ROOT", "~/.pyenv"))
) | use ASDF_DIR env var to test if ASDF is installed
ASDF_DIR can test if ASDF is installed. ASDF_DATA_DIR is (optionally) set by the user so it cannot be used to test if ASDF is installed. | sarugaku_pythonfinder | train | py |
7a5c29786f46c6bb093ed36619938bc8fbfbe16f | diff --git a/lib/ohai/plugins/openstack.rb b/lib/ohai/plugins/openstack.rb
index <HASH>..<HASH> 100644
--- a/lib/ohai/plugins/openstack.rb
+++ b/lib/ohai/plugins/openstack.rb
@@ -47,6 +47,9 @@ Ohai.plugin(:Openstack) do
# dreamhost systems have the dhc-user on them
def openstack_provider
+ # dream host doesn't support windows so bail early if we're on windows
+ return "openstack" if RUBY_PLATFORM =~ /mswin|mingw32|windows/
+
if Etc.getpwnam("dhc-user")
"dreamhost"
end | Avoid failures on windows with dreamhost detection
We're on openstack for sure if we're on windows | chef_ohai | train | rb |
e479d0d81353f36b39bc12d5647cdf06e5cffa5c | diff --git a/lib/sshkit.rb b/lib/sshkit.rb
index <HASH>..<HASH> 100644
--- a/lib/sshkit.rb
+++ b/lib/sshkit.rb
@@ -1,4 +1,3 @@
-require 'thread'
require_relative 'sshkit/all'
module SSHKit
diff --git a/lib/sshkit/runners/parallel.rb b/lib/sshkit/runners/parallel.rb
index <HASH>..<HASH> 100644
--- a/lib/sshkit/runners/parallel.rb
+++ b/lib/sshkit/runners/parallel.rb
@@ -1,3 +1,5 @@
+require 'thread'
+
module SSHKit
module Runner | Require 'Thread' where we use it, in the Parallel runner | capistrano_sshkit | train | rb,rb |
d4266326b4b78fc2219936a967252fdbd2a0df7e | diff --git a/lxd/container_snapshot.go b/lxd/container_snapshot.go
index <HASH>..<HASH> 100644
--- a/lxd/container_snapshot.go
+++ b/lxd/container_snapshot.go
@@ -49,8 +49,13 @@ func containerSnapshotsGet(d *Daemon, r *http.Request) Response {
for _, snap := range snaps {
_, snapName, _ := containerGetParentAndSnapshotName(snap.Name())
if !recursion {
- url := fmt.Sprintf("/%s/containers/%s/snapshots/%s", version.APIVersion, cname, snapName)
- resultString = append(resultString, url)
+ if snap.Project() == "default" {
+ url := fmt.Sprintf("/%s/containers/%s/snapshots/%s", version.APIVersion, cname, snapName)
+ resultString = append(resultString, url)
+ } else {
+ url := fmt.Sprintf("/%s/containers/%s/snapshots/%s?project=%s", version.APIVersion, cname, snapName, snap.Project())
+ resultString = append(resultString, url)
+ }
} else {
render, _, err := snap.Render()
if err != nil { | lxd/containers: Fix snapshot URLs in projects | lxc_lxd | train | go |
98ee74cf0efa00b76a48b88b8ea8c9302a21a7cd | diff --git a/kbfsfuse/folderlist.go b/kbfsfuse/folderlist.go
index <HASH>..<HASH> 100644
--- a/kbfsfuse/folderlist.go
+++ b/kbfsfuse/folderlist.go
@@ -147,11 +147,11 @@ func (fl *FolderList) ReadDirAll(ctx context.Context) (res []fuse.Dirent, err er
work := make(chan libkbfs.TlfID)
results := make(chan fuse.Dirent)
errCh := make(chan error, 1)
- const workers = 10
+ const maxWorkers = 10
var wg sync.WaitGroup
ctx, cancel := context.WithCancel(ctx)
defer cancel()
- for i := 0; i < workers; i++ {
+ for i := 0; i < maxWorkers && i < len(favs); i++ {
wg.Add(1)
go func() {
defer wg.Done() | FUSE: Limit folder lookup workers to number of favorites | keybase_client | train | go |
76c8b29b3c8cf22df9a6efb91207113dd13b232f | diff --git a/src/Bootloader/TokenizerBootloader.php b/src/Bootloader/TokenizerBootloader.php
index <HASH>..<HASH> 100644
--- a/src/Bootloader/TokenizerBootloader.php
+++ b/src/Bootloader/TokenizerBootloader.php
@@ -55,7 +55,8 @@ final class TokenizerBootloader extends Bootloader implements SingletonInterface
'exclude' => [
$dirs->get('resources'),
$dirs->get('config'),
- 'tests'
+ 'tests',
+ 'migrations'
]
]);
} | do not report issues while performing static analysis on migrations | spiral_security | train | php |
c173cc7a8bd057b9ebbbbd39cb4321bfce1a5fe4 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -3,6 +3,7 @@ var should = require('should');
var nock = require('nock');
var up = require('../index')(config);
+nock.disableNetConnect();
var baseApi = nock('https://jawbone.com:443');
describe('up', function(){
@@ -17,8 +18,7 @@ describe('up', function(){
(err === null).should.be.true;
body.should.equal('OK!');
- api.isDone().should.be.true;
- api.pendingMocks().should.be.empty;
+ api.done();
done();
});
@@ -35,12 +35,11 @@ describe('up', function(){
(err === null).should.be.true;
body.should.equal('OK!');
- api.isDone().should.be.true;
- api.pendingMocks().should.be.empty;
+ api.done();
done();
});
});
});
});
-});
\ No newline at end of file
+}); | Fix usage of Nock in unit tests - much cleaner now | ryanseys_node-jawbone-up | train | js |
Subsets and Splits