text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix for toggle all windows | import React, {Component} from 'react';
import Mousetrap from 'mousetrap';
class StatusBar extends Component {
constructor(props) {
super(props);
this.toggleSearchAllWindows = this.toggleSearchAllWindows.bind(this);
this.onChange = this.onChange.bind(this);
}
componentDidMount() {
Mousetrap.bind... | import React, {Component} from 'react';
import Mousetrap from 'mousetrap';
class StatusBar extends Component {
componentDidMount() {
Mousetrap.bind(['alt+a'], this.toggleSearchAllWindows);
}
render() {
return (
/* jshint ignore:start */
<label className='status'>
<input type='checkb... |
Print both custom and original error messages | package scipipe
import (
// "github.com/go-errors/errors"
//"os"
"os"
"os/exec"
re "regexp"
)
func ExecCmd(cmd string) string {
Info.Println("Executing command: ", cmd)
combOutput, err := exec.Command("bash", "-lc", cmd).CombinedOutput()
if err != nil {
Error.Println("Could not execute command `" + cmd + "`... | package scipipe
import (
// "github.com/go-errors/errors"
//"os"
"os"
"os/exec"
re "regexp"
)
func ExecCmd(cmd string) string {
Info.Println("Executing command: ", cmd)
combOutput, err := exec.Command("bash", "-lc", cmd).CombinedOutput()
if err != nil {
Error.Println("Could not execute command `" + cmd + "`... |
Use DRF's built-in search filter | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSerializer
class Reposito... | # -*- coding: utf-8 -*-
from django.shortcuts import render
# Create your views here.
import django_filters
from rest_framework import viewsets
from rest_framework import filters
from porchlightapi.models import Repository, ValueDataPoint
from porchlightapi.serializers import RepositorySerializer, ValueDataPointSer... |
Make profiles list null by default | package com.example;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Contact {
public Integer id;
public String email;
public String firstName;
public String lastName;
public String middleName;
public String dateOfBirth;
public Integer sex;
pub... | package com.example;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Contact {
public Integer id;
public String email;
public String firstName;
public String lastName;
public String middleName;
public String dateOfBirth;
public Integer sex;
public Contact() {
this.id... |
Add scipy as dependency for tomviz-pipeline | from setuptools import setup, find_packages
setup(
name='tomviz-external',
version='0.0.1',
description='Tomviz python external execution infrastructure.',
author='Kitware, Inc.',
author_email='kitware@kitware.com',
url='https://www.tomviz.org/',
license='BSD 3-Clause',
classifiers=[
... | from setuptools import setup, find_packages
setup(
name='tomviz-external',
version='0.0.1',
description='Tomviz python external execution infrastructure.',
author='Kitware, Inc.',
author_email='kitware@kitware.com',
url='https://www.tomviz.org/',
license='BSD 3-Clause',
classifiers=[
... |
Fix for python 3 relative import statement | """
Import the main names to top level.
"""
from . import models as models
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .g... | """
Import the main names to top level.
"""
from . import models as models
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .g... |
Return rejected promise and don't set cache if key or value is null. | const redis = require("redis")
const client = redis.createClient()
class Cache {
/**
* Retrieve an unexpired cache entry by key.
* @param {String} key of the cache entry
* @returns {Promise}
*/
get(key) {
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if... | const redis = require("redis")
const client = redis.createClient()
class Cache {
/**
* Retrieve an unexpired cache entry by key.
* @param {String} key of the cache entry
* @returns {Promise}
*/
get(key) {
return new Promise((resolve, reject) => {
client.get(key, (error, reply) => {
if... |
Mark strings in AuthTokenSerializer as translatable | from django.contrib.auth import authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class AuthTokenSerializer(serializers.Serializer):
username = serializers.CharField()
password = serializers.CharField()
def validate(self, attrs):
username... | from django.contrib.auth import authenticate
from rest_framework import serializers
class AuthTokenSerializer(serializers.Serializer):
username = serializers.CharField()
password = serializers.CharField()
def validate(self, attrs):
username = attrs.get('username')
password = attrs.get('pa... |
Fix bug in file redirection | const path = require('path');
const express = require('express');
const { name, version, directories } = require('../package.json');
const app = express();
const staticPath = path.join(__dirname, `${directories.build}/`);
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('A... | const path = require('path');
const express = require('express');
const { name, version, directories } = require('../package.json');
const app = express();
const staticPath = path.join(__dirname, `${directories.build}/`);
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('A... |
Add test that exercises block includes | import os
import unittest
from ansiblelint import Runner, RulesCollection
class TestTaskIncludes(unittest.TestCase):
def setUp(self):
rulesdir = os.path.join('lib', 'ansiblelint', 'rules')
self.rules = RulesCollection.create_from_directory(rulesdir)
def test_block_included_tasks(self):
... | import os
import unittest
from ansiblelint import Runner, RulesCollection
class TestTaskIncludes(unittest.TestCase):
def setUp(self):
rulesdir = os.path.join('lib', 'ansiblelint', 'rules')
self.rules = RulesCollection.create_from_directory(rulesdir)
def test_block_included_tasks(self):
... |
Fix typo from previous commit | import requests
from bs4 import BeautifulSoup
from source.models.rt_rating import RTRating
class RottenTomatoesService:
__URL = 'http://www.rottentomatoes.com/m/'
__SEPERATOR = '_'
def __init__(self, title):
self.title = title
def get_rt_rating(self):
search_url = self.__URL + self... | import requests
from bs4 import BeautifulSoup
from source.models.rt_rating import RTRating
class RottenTomatoesService:
__URL = 'http://www.rottentomatoes.com/m/'
__SEPERATOR = '_'
def __init__(self, title):
self.title = title
def get_rt_rating(self):
search_url = self.__URL + self... |
Undo add AuditReader diff method | <?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Model;
interface AuditReaderInterface
{
... | <?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Model;
interface AuditReaderInterface
{
... |
Fix issue with logger not having logQuery method | <?php
namespace FOS\ElasticaBundle;
use Elastica\Client as ElasticaClient;
use Elastica\Request;
use FOS\ElasticaBundle\Logger\ElasticaLogger;
/**
* @author Gordon Franke <info@nevalon.de>
*/
class Client extends ElasticaClient
{
public function request($path, $method = Request::GET, $data = array(), array $qu... | <?php
namespace FOS\ElasticaBundle;
use Elastica\Client as ElasticaClient;
use Elastica\Request;
/**
* @author Gordon Franke <info@nevalon.de>
*/
class Client extends ElasticaClient
{
public function request($path, $method = Request::GET, $data = array(), array $query = array())
{
$start = microtim... |
Remove redundant [browsertime] on each log line. | var winston = require('winston'),
path = require('path');
var DEFAULT_LOG = 'browsertime';
module.exports = {
getLog: function(name) {
name = name || DEFAULT_LOG;
return winston.loggers.get(name);
},
addLog: function(name, options) {
name = name || DEFAULT_LOG;
options = options || {};
... | var winston = require('winston'),
path = require('path');
var DEFAULT_LOG = 'browsertime';
module.exports = {
getLog: function(name) {
name = name || DEFAULT_LOG;
return winston.loggers.get(name);
},
addLog: function(name, options) {
name = name || DEFAULT_LOG;
options = options || {};
... |
Use byte array for proxy response | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import com.yahoo.container.jdisc.HttpResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Optional;
/**
* @a... | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import com.yahoo.container.jdisc.HttpResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardChars... |
Make printview work with jupyter | // convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab
define([
'base/js/namespace',
'jquery',
], function(IPython, $) {
"use strict";
if (IPython.version[0] < 3) {
console.log("This extension requires at least IPython 3.x")
return
}
... | // convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab
define([
'base/js/namespace',
'jquery',
], function(IPython, $) {
"use strict";
if (IPython.version[0] < 3) {
console.log("This extension requires IPython 3.x")
return
}
... |
Revert "Rename generic names to single letter"
This reverts commit d7d5eff52385fbe224d36666223948ada966db35. | <%#
Copyright 2013-2018 the original author or authors from the JHipster project.
This file is part of the JHipster project, see http://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | <%#
Copyright 2013-2018 the original author or authors from the JHipster project.
This file is part of the JHipster project, see http://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... |
Remove deprecated --dev composer arg | #!/usr/bin/env php
<?php
chdir(__DIR__);
$returnStatus = null;
passthru('composer install', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
passthru(
'./vendor/bin/phpcs --standard=PSR2 src tests *.php',
$returnStatus
);
if ($returnStatus !== 0) {
exit(1);
}
passthru('./vendor/bin/phpunit', $re... | #!/usr/bin/env php
<?php
chdir(__DIR__);
$returnStatus = null;
passthru('composer install --dev', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
passthru(
'./vendor/bin/phpcs --standard=PSR2 src tests *.php',
$returnStatus
);
if ($returnStatus !== 0) {
exit(1);
}
passthru('./vendor/bin/phpunit... |
message: Add Error and Warning functions | // -------------------------------------------------
// ------------- MessageHandler --------------------
// -------------------------------------------------
"use strict";
function Send(command, data) {
postMessage(
{
"command" : command,
"data" : data
}
);
}
function Debug(message) ... | // -------------------------------------------------
// ------------- MessageHandler --------------------
// -------------------------------------------------
"use strict";
function Send(command, data) {
postMessage(
{
"command" : command,
"data" : data
}
);
}
function Debug(message) ... |
Modify main loop code of FilterChain.parse() | const AstNode = require('./ast-node');
class FilterChain extends AstNode {
type() {
return 'filter_chain';
}
/**
* @param {ParseContext} context
* @return {boolean}
*/
read(context) {
return true;
}
/**
* @param {ParseContext} context
* @return {AstNodeParseResult}
*/
parse(co... | const AstNode = require('./ast-node');
class FilterChain extends AstNode {
type() {
return 'filter_chain';
}
/**
* @param {ParseContext} context
* @return {boolean}
*/
read(context) {
return true;
}
/**
* @param {ParseContext} context
* @return {AstNodeParseResult}
*/
parse(co... |
Store original URL before logging in so that user is properly redirected on login. | package controllers;
import java.util.ArrayList;
import com.feth.play.module.pa.PlayAuthenticate;
import com.feth.play.module.pa.user.AuthUser;
import models.User;
import play.Logger;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.Security;
public class Secured extends Security.Authenticator... | package controllers;
import java.util.ArrayList;
import com.feth.play.module.pa.PlayAuthenticate;
import com.feth.play.module.pa.user.AuthUser;
import models.User;
import play.Logger;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.Security;
public class Secured extends Security.Authenticator... |
Add metalsmith config to gulp config | module.exports = {
// Autoprefixer
autoprefixer: {
// https://github.com/postcss/autoprefixer#browsers
browsers: [
'Explorer >= 10',
'ExplorerMobile >= 10',
'Firefox >= 30',
'Chrome >= 34',
'Safari >= 7',
'Opera >= 23',
'iOS >= 7',
'Android >= 4.4',
'Bla... | module.exports = {
// Autoprefixer
autoprefixer: {
// https://github.com/postcss/autoprefixer#browsers
browsers: [
'Explorer >= 10',
'ExplorerMobile >= 10',
'Firefox >= 30',
'Chrome >= 34',
'Safari >= 7',
'Opera >= 23',
'iOS >= 7',
'Android >= 4.4',
'Bla... |
Return metadata which are in {"class": string, "value": string} format only | class MetaData {
constructor(data, extra_key) {
this.data = data;
this.extra_key = extra_key;
}
get(keys) {
return this.slice(keys).filter((k, i) => typeof k.value === 'string');
}
slice(keys) {
if (!this.data)
return [];
if (this.extra_key)
return this.slice_with_extra_key(... | class MetaData {
constructor(data, extra_key) {
this.data = data;
this.extra_key = extra_key;
}
get(keys) {
if (!this.data)
return [];
if (this.extra_key)
return this.slice_with_extra_key(keys);
else
return this.slice_without_extra_key(keys);
}
slice_with_extra_key(key... |
Move reportChange to after change occurs | import javax.annotation.Generated;
import javax.annotation.Nonnull;
import org.realityforge.arez.ArezContext;
import org.realityforge.arez.Observable;
@Generated( "org.realityforge.arez.processor.ArezProcessor" )
public final class Arez_TimeModel
extends TimeModel
{
private final ArezContext $arez$_context;
priv... | import javax.annotation.Generated;
import javax.annotation.Nonnull;
import org.realityforge.arez.ArezContext;
import org.realityforge.arez.Observable;
@Generated( "org.realityforge.arez.processor.ArezProcessor" )
public final class Arez_TimeModel
extends TimeModel
{
private final ArezContext $arez$_context;
priv... |
Integrate secure middleware for handling https connections | package webhook
import (
"os"
"strings"
"io/ioutil"
"encoding/json"
)
type Configuration struct {
WebServerPort uint16 `json:"webserver-port"`
EndpointName string `json:"endpoint-name"`
ExchangeName string `json:"exchange-name"`
QueueURI string `json:... | package webhook
import (
"os"
"strings"
"io/ioutil"
"encoding/json"
)
type Configuration struct {
WebServerPort uint16 `json:"webserver-port"`
EndpointName string `json:"endpoint-name"`
ExchangeName string `json:"exchange-name"`
QueueURI string `json:"queue-u... |
Add actual setting of new json | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import moment from 'moment';
import french from 'moment/locale/fr';
import english from 'moment/locale/en-nz';
import {
authStrings,
buttonStrings,
generalStrings,
modalStrings,
navStrings,
pageInfoStrings,
programStrings,
syncStrings,
... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import moment from 'moment';
import french from 'moment/locale/fr';
import english from 'moment/locale/en-nz';
import {
authStrings,
buttonStrings,
generalStrings,
modalStrings,
navStrings,
pageInfoStrings,
programStrings,
syncStrings,
... |
Add @Keep annotation to not over-optimize my enums! | package com.pr0gramm.app.services.config;
import android.support.annotation.Keep;
import org.immutables.gson.Gson;
import org.immutables.value.Value;
/**
*/
@Value.Immutable
@Gson.TypeAdapters
public abstract class Config {
@Value.Default
public boolean extraCategories() {
return true;
}
@V... | package com.pr0gramm.app.services.config;
import org.immutables.gson.Gson;
import org.immutables.value.Value;
/**
*/
@Value.Immutable
@Gson.TypeAdapters
public abstract class Config {
@Value.Default
public boolean extraCategories() {
return true;
}
@Value.Default
public long maxUploadSiz... |
Set valid parents on carousel item | /*
* Copyright (c) 2014 Darren Scott - All Rights Reserved
*
* This program is distributed under LGPL Version 2.1 in the hope that
* it will be useful, but WITHOUT ANY WARRANTY.
*/
package org.bootstrapjsp.tags.core.carousel;
import javax.servlet.jsp.tagext.JspTag;
import org.bootstrapjsp.facet.ActiveFacet;
imp... | /*
* Copyright (c) 2014 Darren Scott - All Rights Reserved
*
* This program is distributed under LGPL Version 2.1 in the hope that
* it will be useful, but WITHOUT ANY WARRANTY.
*/
package org.bootstrapjsp.tags.core.carousel;
import javax.servlet.jsp.tagext.JspTag;
import org.bootstrapjsp.facet.ActiveFacet;
imp... |
Add some missing return types to internal/final classes | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Core\Authorization\Voter;
use Symfony\Compon... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Core\Authorization\Voter;
use Symfony\Compon... |
TASK: Change typo3.org reference to neos.io
This change uses www.neos.io instead of typo3.org for testing the CurlEngine. | <?php
namespace TYPO3\Flow\Tests\Functional\Http\Client;
/*
* This file is part of the TYPO3.Flow package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with thi... | <?php
namespace TYPO3\Flow\Tests\Functional\Http\Client;
/*
* This file is part of the TYPO3.Flow package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with thi... |
Remove a double call to requestLayout in applyTransformation | package com.desmond.squarecamera;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;
/**
* Created by desmond on 4/8/15.
*/
public class ResizeAnimation extends Animation {
final int mStartLength;
final ... | package com.desmond.squarecamera;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Transformation;
/**
* Created by desmond on 4/8/15.
*/
public class ResizeAnimation extends Animation {
final int mStartLength;
final ... |
Switch to responsive bootstrap CSS and add needed nav items | <!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<title>Lifecycle Building Center</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scal... | <!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Lifecycle Building Center</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width" />
... |
Fix parsing exception on unknown decorator | const { DataParser } = require('./DataParser');
const { DataEntry } = require('../entity/DataEntry');
const { Syntax } = require('../Enum');
class ClassComponentDataParser extends DataParser {
parse (node) {
switch (node.type) {
case Syntax.ClassProperty:
this.parseData(node, node.key, node.value ... | const { DataParser } = require('./DataParser');
const { DataEntry } = require('../entity/DataEntry');
const { Syntax } = require('../Enum');
class ClassComponentDataParser extends DataParser {
parse (node) {
switch (node.type) {
case Syntax.ClassProperty:
this.parseData(node, node.key, node.value)... |
Update helptext for `service-level` command | <?php
namespace Pantheon\Terminus\Commands\ServiceLevel;
use Pantheon\Terminus\Commands\TerminusCommand;
use Pantheon\Terminus\Site\SiteAwareInterface;
use Pantheon\Terminus\Site\SiteAwareTrait;
/**
* Class SetCommand
* @package Pantheon\Terminus\Commands\ServiceLevel
*/
class SetCommand extends TerminusCommand i... | <?php
namespace Pantheon\Terminus\Commands\ServiceLevel;
use Pantheon\Terminus\Commands\TerminusCommand;
use Pantheon\Terminus\Site\SiteAwareInterface;
use Pantheon\Terminus\Site\SiteAwareTrait;
/**
* Class SetCommand
* @package Pantheon\Terminus\Commands\ServiceLevel
*/
class SetCommand extends TerminusCommand i... |
Test more stuff in python | import sys
from PyQt5 import QtWidgets, QtGui
from QHexEdit import QHexEdit, QHexEditData
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
# QHexEditData* hexeditdata = QHexEditData::fromFile("test.py");
hexeditdata = QHexEditData.fromFile('test.py')
# QHexEdit* hexedit = new QHexEdi... | import sys
from PyQt5 import QtWidgets
from QHexEdit import QHexEdit, QHexEditData
class HexEdit(QHexEdit):
def __init__(self, fileName=None):
super(HexEdit, self).__init__()
file = open(fileName)
data = file.read()
self.setData(data)
self.setReadOnly(False)
if __name__ ... |
Fix page's title in pdf header/footer | var juice = require('juice');
var WebsiteGenerator = require('../website');
var JSONUtils = require('../../json');
var Templating = require('../../templating');
var Promise = require('../../utils/promise');
/**
Generate PDF header/footer templates
@param {Output} output
@param {String} type
@return ... | var juice = require('juice');
var WebsiteGenerator = require('../website');
var JSONUtils = require('../../json');
var Templating = require('../../templating');
var Promise = require('../../utils/promise');
/**
Generate PDF header/footer templates
@param {Output} output
@param {String} type
@return ... |
compdb: Replace re by os.path utils
Instead of using regular expressions to drop file name ending use
os.path.splitext(). | import vim
import re
import json
from os import path
curr_file = vim.eval("expand('%:p')")
curr_file_noext = path.splitext(curr_file)[0]
ccd = vim.eval("l:ccd")
opts = []
with open(ccd) as database:
# Search for the right entry in the database matching file names
for d in json.load(database):
# This ... | import vim
import re
import json
from os import path
current = vim.eval("expand('%:p')")
ccd = vim.eval("l:ccd")
opts = []
with open(ccd) as database:
data = json.load(database)
for d in data:
# hax for headers
fmatch = re.search(r'(.*)\.(\w+)$', current)
dmatch = re.search(r'(.*)\.(\... |
Enable service-interface and vf-binding extensions by default in
contrail based provisioning.
Change-Id: I5916f41cdf12ad54e74c0f76de244ed60f57aea5
Partial-Bug: 1556336 | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#ca... |
Remove print method. No longer needed.
git-svn-id: 169764d5f12c41a1cff66b81d896619f3ce5473d@126 5e0a886f-7f45-49c5-bc19-40643649e37f | package kawa.standard;
import kawa.lang.*;
/**
* The Syntax transformer that re-writes the "define" Scheme primitive.
* Currently, only handles top-level definitions.
* @author Per Bothner
*/
public class define extends Syntax implements Printable
{
public Expression rewrite (Object obj, Interpreter interp)
... | package kawa.standard;
import kawa.lang.*;
/**
* The Syntax transformer that re-writes the "define" Scheme primitive.
* Currently, only handles top-level definitions.
* @author Per Bothner
*/
public class define extends Syntax implements Printable
{
public Expression rewrite (Object obj, Interpreter interp)
... |
Add -T option to list available targets | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... |
Use composed annotation for readability | package ee.tuleva.onboarding.auth.session;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.SessionScope;
@Component
@SessionScope
public cla... | package ee.tuleva.onboarding.auth.session;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereo... |
Update test to run on new code | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python3 -m unittest discover
import unittest
from ..network.networkhandler import NetworkHandler
from ..crypto.diffiehellman import DiffieHellman
class testNetworkHandler(unittest.TestCase):
@classmethod
def setUpClass(cls):
alice ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python3 -m unittest discover
import unittest
from ..network.networkhandler import NetworkHandler
from ..crypto.aes import AESCipher
from ..crypto.diffiehellman import DiffieHellman
class testNetworkHandler(unittest.TestCase):
@classmethod
... |
Move to sendMessage command for message sending. Also add 'notice' trigger, because why not | from CommandTemplate import CommandTemplate
class Command(CommandTemplate):
triggers = ['say', 'do', 'notice']
helptext = "Makes the bot say the provided text in the provided channel (format 'say [channel/user] text')"
adminOnly = True
showInCommandList = False
def execute(self, bot, user, target, triggerInMsg,... | from CommandTemplate import CommandTemplate
class Command(CommandTemplate):
triggers = ['say', 'do']
helptext = "Makes the bot say the provided text in the provided channel (format 'say [channel/user] text')"
adminOnly = True
showInCommandList = False
def execute(self, bot, user, target, triggerInMsg, msg, msgW... |
Unify errors and failures in API | from sentinels import NOTHING
class ErrorContainer(object):
def add_error(self, message, exception_type=NOTHING, traceback=NOTHING, timestamp=NOTHING):
return self.client.api.call_function('add_error', {self._get_id_key(): self.id,
'message': mes... | from sentinels import NOTHING
class ErrorContainer(object):
def add_error(self, exception, exception_type, traceback, timestamp=NOTHING):
return self.client.api.call_function('add_error', {self._get_id_key(): self.id,
'exception': exception,
... |
Comment out custom de-/serializeUser code for now | 'use strict';
// const p = require('path');
const _ = require('lodash');
const passport = require('passport');
// const User = require('../services/users/model');
// const config = require(p.join(process.cwd(), 'server/config/membership'));
let serializeUser;
let deserializeUser;
// if (typeof config.serializeUse... | 'use strict';
const p = require('path');
const _ = require('lodash');
const passport = require('passport');
// const User = require('../services/users/model');
const config = require(p.join(process.cwd(), 'server/config/membership'));
let serializeUser;
let deserializeUser;
if (typeof config.serializeUser === 'fu... |
Add TextView text, SpeechView text and SpeechView seconds elapsed fields to user schema | /* eslint new-cap: 0 */
const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');
const Q = require('q');
const SALT_WORK_FACTOR = 10;
const UserSchema = new mongoose.Schema({
username: {
type: String,
required: true,
unique: true,
},
password: {
type: String,
required: ... | /* eslint new-cap: 0 */
const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');
const Q = require('q');
const SALT_WORK_FACTOR = 10;
const UserSchema = new mongoose.Schema({
username: {
type: String,
required: true,
unique: true,
},
password: {
type: String,
required: ... |
Deploy to Kovan test network. | module.exports = {
migrations_directory: "./migrations",
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*"
},
live: {
host: "localhost",
port: 8546,
network_id: 1,
},
Ropsten: ... | module.exports = {
migrations_directory: "./migrations",
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*"
},
live: {
host: "localhost",
port: 8546,
network_id: 1,
},
Ropsten: ... |
Change focus on select example component name | import React, { Component } from 'react'
import Slider from '../src/slider'
export default class FocusOnSelect extends Component {
render() {
const settings = {
focusOnSelect: true,
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
speed: 500
};
return (
<div>
... | import React, { Component } from 'react'
import Slider from '../src/slider'
export default class CenterModeWithFocusOnSelect extends Component {
render() {
const settings = {
focusOnSelect: true,
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
speed: 500
};
return (
... |
Add leaflet extensions to build script. | var deps = {
LeafletExtensions: {
src: [
'ext/LineUtil.js',
'ext/Polyline.js',
'ext/Polygon.js'
],
desc: 'Extensions to Leaflet to add intersection detection.'
},
DrawHandler: {
src: ['draw/Handler.Draw.js'],
desc: 'The base class for drawing.',
deps: ['LeafletExtensions']
},
Polys: {
src:... | var deps = {
DrawHandler: {
src: ['Handler.Draw.js'],
desc: 'The base class for drawing.',
},
Polys: {
src: ['Polyline.Draw.js',
'Polygon.Draw.js'],
desc: 'Polyline and Polygon drawing handlers.',
deps: ['DrawHandler']
},
SimpleShapes: {
src: ['SimpleShape.Draw.js',
'Circle.Draw.js',... |
Fix pyflakes complaining of imported but unused module. | # Copyright 2014-2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | # Copyright 2014-2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
FIX : Header et Footer non déclaré | /**
*
* App
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*/
import React from 'react';
import Helmet from 'react-helmet';
import styled from 'styled-components';
import Header from 'components/Header';
import F... | /**
*
* App
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*/
import React from 'react';
import Helmet from 'react-helmet';
import styled from 'styled-components';
import HeaderBaseBoilerPlate from 'components/He... |
Add handlebars helper in order to show recipe image | (function () {
RecipeListView.prototype.template = Handlebars.compile($("#recipe-list-tpl").html());
RecipeView.prototype.template = Handlebars.compile($("#recipe-tpl").html());
Handlebars.registerHelper('recipe_image', function(image_id) {
return _.find(recipe_images, function(recipe){ return reci... | (function () {
RecipeListView.prototype.template = Handlebars.compile($("#recipe-list-tpl").html());
RecipeView.prototype.template = Handlebars.compile($("#recipe-tpl").html());
var service = new RecipeService();
service.initialize().done(function () {
router.addRoute('', function() {
... |
Change order of API call | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... |
Fix image width and height switching | # Copyright 2018 The Lucid Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2018 The Lucid Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
Fix passing json unmarshal non-pointer values | package ambition
import (
"encoding/json"
)
func PostOccurrenceByActionIdJson(ActionId int, occurrenceJson []byte) error {
var occurrence Occurrence
err := json.Unmarshal(occurrenceJson, &occurrence)
occurrence.ActionId = ActionId
database.InsertOccurrence(&occurrence)
return err
}
func PostActionBySetIdJson... | package ambition
import (
"encoding/json"
)
func PostOccurrenceByActionIdJson(ActionId int, occurrenceJson []byte) error {
var occurrence Occurrence
err := json.Unmarshal(occurrenceJson, occurrence)
occurrence.ActionId = ActionId
database.InsertOccurrence(&occurrence)
return err
}
func PostActionBySetIdJson(... |
Add link to edit test date information to Pending page
Fixes #177 | <h2><span class="label label-default">Pending surveys</span></h2>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Survey ID</th><th>Description</th><th>Date Scheduled</th><th>Accession</th><th>Survey Note</th><th></th>
</tr>
</thead>
<tbody>
@foreach ($pendingSurveys as $pending)
<tr>
<t... | <h2><span class="label label-default">Pending surveys</span></h2>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Survey ID</th><th>Description</th><th>Date Scheduled</th><th>Accession</th><th>Survey Note</th>
</tr>
</thead>
<tbody>
@foreach ($pendingSurveys as $pending)
<tr>
<td><a href... |
Fix issue in overview parser | 'use strict';
const D3 = require('D3');
exports.parser = function(rows) {
var overviewResponse = D3.values(rows[0]);
var overview = D3.nest()
.key(function(d) {
return d.region_code;
})
.rollup(function(v) {
return {
'region_code': v[0],
... | 'use strict';
const D3 = require('D3');
exports.parser = function(rows) {
var overviewResponse = D3.values(rows[0]);
var overview = D3.nest()
.key(function(d) {
return d.region_code;
})
.rollup(function(v) {
return {
'region_code': v[0].region_c... |
[PAXJDBC-124] Fix missing itest dependency for aries-pool | package org.ops4j.pax.jdbc.test.pool;
import javax.inject.Inject;
import org.junit.Test;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.util.Filter;
import org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory;
import org.ops4j.pax.jdbc.test.AbstractJdbcTest;
pu... | package org.ops4j.pax.jdbc.test.pool;
import javax.inject.Inject;
import org.junit.Test;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.util.Filter;
import org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory;
import org.ops4j.pax.jdbc.test.AbstractJdbcTest;
pu... |
Replace non-word charactor into space | <?php
namespace CodeGen\Frameworks\PHPUnit;
use CodeGen\UserClass;
use Doctrine\Common\Inflector\Inflector;
use CodeGen\ClassMethod;
class PHPUnitFrameworkTestCase extends UserClass
{
public function __construct($title)
{
$class = Inflector::classify(preg_replace('/\W+/',' ',$title));
parent::... | <?php
namespace CodeGen\Frameworks\PHPUnit;
use CodeGen\UserClass;
use Doctrine\Common\Inflector\Inflector;
use CodeGen\ClassMethod;
class PHPUnitFrameworkTestCase extends UserClass
{
public function __construct($title)
{
$class = Inflector::classify($title);
parent::__construct($class);
... |
Allow certificites to be conditional | 'use strict';
var memoize = require('memoizee/plain')
, validDb = require('dbjs/valid-dbjs')
, defineStringLine = require('dbjs-ext/string/string-line');
module.exports = memoize(function (db) {
var StringLine;
validDb(db);
StringLine = defineStringLine(db);
db.Object.extend('Registration',... | 'use strict';
var memoize = require('memoizee/plain')
, validDb = require('dbjs/valid-dbjs')
, defineStringLine = require('dbjs-ext/string/string-line')
, defineDocument = require('./document');
module.exports = memoize(function (db) {
var StringLine, Document;
validDb(db);
StringLine = d... |
Change code to make Sonar happy
See #5489 | package <%=packageName%>.web.rest.errors;
import java.util.HashMap;
import java.util.Map;
/**
* Custom, parameterized exception, which can be translated on the client side.
* For example:
*
* <pre>
* throw new CustomParameterizedException("myCustomError", "hello", "world");
* </pre... | package <%=packageName%>.web.rest.errors;
import java.util.HashMap;
import java.util.Map;
/**
* Custom, parameterized exception, which can be translated on the client side.
* For example:
*
* <pre>
* throw new CustomParameterizedException("myCustomError", "hello", "world");
* </pre... |
Add a name for the recipe section | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
:new: Add a placeholder updateMeta method | 'use babel'
import {CompositeDisposable, Emitter} from 'atom'
import {aggressiveDebounce} from './helpers'
export default class Editor {
constructor(textEditor, connection) {
this.subscriptions = new CompositeDisposable()
this.connection = connection
this.emitter = new Emitter()
this.subscriptions.... | 'use babel'
import {CompositeDisposable, Emitter} from 'atom'
import {aggressiveDebounce} from './helpers'
export default class Editor {
constructor(textEditor, connection) {
this.subscriptions = new CompositeDisposable()
this.connection = connection
this.emitter = new Emitter()
this.subscriptions.... |
fix: Fix error when msg is undefined. | import Vue from 'vue'
import Message from './Message.vue'
import Modal from './Modal.vue'
const MessageConstructor = Vue.extend(Message)
const Msg = function (option) {
let instance
option = option || {}
if (typeof option === 'string') {
option = {
message: option
}
}
instance = new MessageC... | import Vue from 'vue'
import Message from './Message.vue'
import Modal from './Modal.vue'
const MessageConstructor = Vue.extend(Message)
const Msg = function (option) {
let instance
option = option || {}
if (typeof option === 'string') {
option = {
message: option
}
}
instance = new MessageC... |
Return status code 200 when Device instance already exists | from django.db import IntegrityError
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .serializers import DeviceSerializer
class DeviceTokenSetter(APIView):
"""
Set a push token... | from django.db import IntegrityError
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .serializers import DeviceSerializer
class DeviceTokenSetter(APIView):
"""
Set a push token... |
Disable testing equals on samples | package org.pdxfinder.graph.dao;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
public class SampleTest {
/*
@Test public void equals_givenIdenticalObjects_symmetricallyEqual() {
Sample x = new Sample("id");
Sample y = new Sample("id");
... | package org.pdxfinder.graph.dao;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
public class SampleTest {
@Test public void equals_givenIdenticalObjects_symmetricallyEqual() {
Sample x = new Sample("id");
Sample y = new Sample("id");
... |
Add override annotations to make error prone happy | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may ... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may ... |
Use null as indicator for unconditional action.
Signed-off-by: Etienne M. Gagnon <bf06ec0eb40152cd863534753d026b021022c851@j-meg.com> | /* This file is part of SableCC ( http://sablecc.org ).
*
* See the NOTICE file distributed with this work for copyright information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | /* This file is part of SableCC ( http://sablecc.org ).
*
* See the NOTICE file distributed with this work for copyright information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... |
Make py starterpackage more like java/c++ one | import math
import sys
# A helper class for working with points.
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
class Edge:
def __init__(self, p1, p2):
self.p1 = p1
self.p2 = p2
# Gets a problem from a file as an list of points.
def getProblem(filename):
pts = []
with open(filename, 'r') as ... | import math
import sys
# A helper class for working with points.
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
class Edge:
def __init__(self, p1, p2):
self.p1 = p1
self.p2 = p2
def getProblem(filename):
pts = []
with open(filename, 'r') as input:
for line in input:
l = line.split(' ')
... |
Allow everyone to bam and warm, hide commands | import discord
import random
from discord.ext import commands
class Meme:
"""
Meme commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
@commands.command(pass_context=True, hidden=True, name="bam")
async def bam_memb... | import discord
import random
from discord.ext import commands
class Meme:
"""
Meme commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
@commands.has_permissions(kick_members=True)
@commands.command(pass_context=True... |
Create a test specifically for naming inconsistencies beween DOM and HTML. | /*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function(el) {
test("creating an element with attributes", fu... | /*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function(el) {
test("creating an element with attributes", fu... |
Add the generated Client interfaces to the telepathy.server namespace | """
telepathy-python - Base classes defining the interfaces of the Telepathy framework
Copyright (C) 2005, 2006 Collabora Limited
Copyright (C) 2005, 2006 Nokia Corporation
Copyright (C) 2006 INdT
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
... | """
telepathy-python - Base classes defining the interfaces of the Telepathy framework
Copyright (C) 2005, 2006 Collabora Limited
Copyright (C) 2005, 2006 Nokia Corporation
Copyright (C) 2006 INdT
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
... |
Add update and delete methods. | /*
* Copyright 2016, Frederik Boster
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /*
* Copyright 2016, Frederik Boster
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Add linkPrefix to links when activated | import React from 'react'
import Link from 'react-router/lib/Link'
let linkPrefix = ``
if (__PREFIX_LINKS__) {
linkPrefix = __LINK_PREFIX__
}
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ... | import React from 'react'
import Link from 'react-router/lib/Link'
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ideal but we need componentDidMount.
const GatsbyLink = React.createClass({
... |
Make sure scatter chart's circle are animating when hovered | 'use strict';
var expect = require('chai').expect;
describe('ScatterChart', function() {
it('renders scatterchart', function() {
var React = require('react/addons');
var ScatterChart = require('../src/scatterchart').ScatterChart;
var generate = require('../utils/datagen').generateArrayOfPoints;
var ... | 'use strict';
var expect = require('chai').expect;
describe('ScatterChart', function() {
it('renders scatterchart', function() {
var React = require('react/addons');
var ScatterChart = require('../src/scatterchart').ScatterChart;
var generate = require('../utils/datagen').generateArrayOfPoints;
var ... |
Define listItems() with new MVC model
OPEN - task 41: Design "ListItemPane" as per new MVC model
http://github.com/DevOpsDistilled/OpERP/issues/issue/41 | package devopsdistilled.operp.client.items;
import javax.inject.Inject;
import org.springframework.context.ApplicationContext;
import devopsdistilled.operp.client.items.controllers.CreateItemPaneController;
import devopsdistilled.operp.client.items.controllers.ListItemPaneController;
import devopsdistilled.operp.ser... | package devopsdistilled.operp.client.items;
import javax.inject.Inject;
import org.springframework.context.ApplicationContext;
import devopsdistilled.operp.client.items.controllers.CreateItemPaneController;
import devopsdistilled.operp.server.data.entity.items.Item;
import devopsdistilled.operp.server.data.service.i... |
PUBDEV-455: Fix DRFParametersV2, remove unused do_grpsplit argument. | package hex.schemas;
import hex.tree.drf.DRF;
import hex.tree.drf.DRFModel.DRFParameters;
import water.api.API;
import water.api.SupervisedModelParametersSchema;
import hex.schemas.SharedTreeV2; // Yes, this is needed. Compiler bug.
import hex.schemas.SharedTreeV2.SharedTreeParametersV2; // Yes... | package hex.schemas;
import hex.tree.drf.DRF;
import hex.tree.drf.DRFModel.DRFParameters;
import water.api.API;
import water.api.SupervisedModelParametersSchema;
import hex.schemas.SharedTreeV2; // Yes, this is needed. Compiler bug.
import hex.schemas.SharedTreeV2.SharedTreeParametersV2; // Yes... |
Increase payload limit to 1.5MB
When editing a model, this allow the user to upload a 1MB file, rather
than something like a 925.3kB file, along with about 500kB of
description text. | import express from 'express';
import path from 'path';
import bodyParser from 'body-parser';
import api from './api';
let server = null;
function start(port) {
return new Promise((resolve, reject) => {
if (server !== null) {
reject(new Error('The server is already running.'));
}
... | import express from 'express';
import path from 'path';
import bodyParser from 'body-parser';
import api from './api';
let server = null;
function start(port) {
return new Promise((resolve, reject) => {
if (server !== null) {
reject(new Error('The server is already running.'));
}
... |
Improve existing methods, add new ones for packing longs | package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
int n = bs[ off] << 24;
n |= (bs[++off] & 0xff) << 16;
n |= (bs[++off] & 0xff) << 8;
n |= (bs[++off] & 0xff);
return n;
}
public static voi... | package org.bouncycastle.crypto.util;
public abstract class Pack
{
public static int bigEndianToInt(byte[] bs, int off)
{
int n = bs[off++] << 24;
n |= (bs[off++] & 0xff) << 16;
n |= (bs[off++] & 0xff) << 8;
n |= (bs[off++] & 0xff);
return n;
}
public static voi... |
Increment version to 0.0.5 for release | <?php
define("BEYONIC_CLIENT_VERSION", "0.0.5");
if (!function_exists('curl_init')) {
throw new Exception('Beyonic requires the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Beyonic requires the JSON PHP extension.');
}
// Beyonic Primary Interface
require_once(dirname(__FIL... | <?php
define("BEYONIC_CLIENT_VERSION", "0.0.4");
if (!function_exists('curl_init')) {
throw new Exception('Beyonic requires the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Beyonic requires the JSON PHP extension.');
}
// Beyonic Primary Interface
require_once(dirname(__FIL... |
Fix order in v2 dragon endpoint |
const limit = require('../../lib/query-builder/v2/limit');
const project = require('../../lib/query-builder/v2/project');
module.exports = {
/**
* Returns all Dragon data
*/
all: async (ctx) => {
const data = await global.db
.collection('dragon')
.find({})
.project(project(ctx.request... |
const limit = require('../../lib/query-builder/v2/limit');
const project = require('../../lib/query-builder/v2/project');
module.exports = {
/**
* Returns all Dragon data
*/
all: async (ctx) => {
const data = await global.db
.collection('dragon')
.find({})
.project(project(ctx.request... |
Fix assertion error documentation URL
Prefix version number with 'v' to obtain correct URL.
This fixes #8556. | /**
* @module ol/AssertionError
*/
import {VERSION} from './util.js';
/**
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
* extended with a `code` property.
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error.
*/
class AssertionError extends Err... | /**
* @module ol/AssertionError
*/
import {VERSION} from './util.js';
/**
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
* extended with a `code` property.
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error.
*/
class AssertionError extends Err... |
Bump to version with package data fix | from setuptools import setup, find_packages
setup(name='rnaseq-lib',
version='1.0a11',
description='',
url='http://github.com/jvivian/rnaseq-lib',
author='John Vivian',
author_email='jtvivian@gmail.com',
license='MIT',
package_dir={'': 'src'},
packages=find_packages('src... | from setuptools import setup, find_packages
setup(name='rnaseq-lib',
version='1.0a10',
description='',
url='http://github.com/jvivian/rnaseq-lib',
author='John Vivian',
author_email='jtvivian@gmail.com',
license='MIT',
package_dir={'': 'src'},
packages=find_packages('src... |
Change fields to the schema agreed | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
email = user.get('email', None)
if email:
... | from eduid_am.exceptions import UserDoesNotExist
def attribute_fetcher(db, user_id):
attributes = {}
user = db.registered.find_one({'_id': user_id})
if user is None:
raise UserDoesNotExist("No user matching _id='%s'" % user_id)
else:
# white list of valid attributes for security reas... |
Add a test for `notes` attribute | # coding: utf-8
import unittest
from lastpass.account import Account
class AccountTestCase(unittest.TestCase):
def setUp(self):
self.id = 'id'
self.name = 'name'
self.username = 'username'
self.password = 'password'
self.url = 'url'
self.group = 'group'
self... | # coding: utf-8
import unittest
from lastpass.account import Account
class AccountTestCase(unittest.TestCase):
def setUp(self):
self.id = 'id'
self.name = 'name'
self.username = 'username'
self.password = 'password'
self.url = 'url'
self.group = 'group'
self... |
Add new function to DramaModel | (function(){
'use strict';
angular
.module('secondLead.common')
.factory('DramaModel',['Restangular', function (Restangular){
var baseDramas = Restangular.all('dramas');
function extract (result){
return result.data;
};
return {
getAll: baseDramas.getList().$object,
get... | (function(){
'use strict';
angular
.module('secondLead.common')
.factory('DramaModel',['Restangular', function (Restangular){
var baseDramas = Restangular.all('dramas');
return {
getAll: baseDramas.getList().$object,
getOne: function (dramaID){
return Restangular.one('dramas', dra... |
Make careerop only display active ops | #-*- coding: utf-8 -*-
from datetime import datetime
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
def index(request):
opportunities = CareerOpportunity.objects.f... | #-*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from apps.careeropportunity.models import CareerOpportunity
import datetime
def index(request):
opportunities = CareerOpportunity.objects.all()
... |
Install default dotfiles with package | from distutils.core import setup
setup(name='Pyranha',
description='Elegant IRC client',
version='0.1',
author='John Reese',
author_email='john@noswap.com',
url='https://github.com/jreese/pyranha',
classifiers=['License :: OSI Approved :: MIT License',
'Topic :: C... | from distutils.core import setup
setup(name='Pyranha',
description='Elegant IRC client',
version='0.1',
author='John Reese',
author_email='john@noswap.com',
url='https://github.com/jreese/pyranha',
classifiers=['License :: OSI Approved :: MIT License',
'Topic :: C... |
Rename source to data for | 'use strict';
var RSVP = require('rsvp');
var fork = require('child_process').fork;
module.exports = function (language, source) {
return new RSVP.Promise(function (resolve) {
var child = fork(__dirname);
var output = '';
var timeout = setTimeout(function () {
console.error(language + ' processor... | 'use strict';
var RSVP = require('rsvp');
var fork = require('child_process').fork;
module.exports = function (language, source) {
return new RSVP.Promise(function (resolve) {
var child = fork(__dirname);
var output = '';
var timeout = setTimeout(function () {
console.error(language + ' processor... |
Use proper setting for static files in development | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from django.contrib.gis import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from huts.urls import hut_patterns, api_patterns
admin.autodiscover()
# main site
ur... | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from django.contrib.gis import admin
from huts.urls import hut_patterns, api_patterns
admin.autodiscover()
# main site
urlpatterns = patterns('',
url(r'', include((hut_patterns, 'huts', 'h... |
[Security] Change the phrasing of the deauthenticated event | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Event;
use Symfony\Component\Security\C... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Event;
use Symfony\Component\Security\C... |
Remove todo comment, no settings support | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2013 Jon Surrell
#
# License: MIT
#
"""This module exports the Ghc plugin class."""
from SublimeLinter.lint import Linter, util
class Ghc(Linter):
"""Provides an interface to ghc."... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2013 Jon Surrell
#
# License: MIT
#
"""This module exports the Ghc plugin class."""
from SublimeLinter.lint import Linter, util
class Ghc(Linter):
"""Provides an interface to ghc."... |
Use named tuple for return value | # from subprocess import CalledProcessError
from collections import namedtuple
import subprocess
CommandResult = namedtuple("Result", ['rc', 'out', 'err'])
def run_through_shell(command, enable_shell=False):
"""
Retrieves output of command
Returns tuple success (boolean)/ stdout(string) / stderr (string)... | # from subprocess import CalledProcessError
import subprocess
def run_through_shell(command, enable_shell=False):
"""
Retrieves output of command
Returns tuple success (boolean)/ stdout(string) / stderr (string)
Don't use this function with programs that outputs lots of data since the output is saved... |
Fix typos in "No ~/.humbugrc found" error message
(imported from commit b0c8aab4668751d9b1d12792d249645498a95932) | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.models import get_user_profile_by_email
import os
from ConfigParser import SafeConfigParser
class Command(BaseCommand):
help = """Reset all colors for a person to the default grey"""
def handle(self, *args,... | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zephyr.models import get_user_profile_by_email
import os
from ConfigParser import SafeConfigParser
class Command(BaseCommand):
help = """Reset all colors for a person to the default grey"""
def handle(self, *args,... |
Correct data type for sms domain definition | /*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2013 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, eith... | /*
* This program is part of the OpenLMIS logistics management information system platform software.
* Copyright © 2013 VillageReach
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, eith... |
Change form submit url to match change in folder heirarchy | <html>
<body>
<?php if (array_key_exists('submit', $_POST)): ?>
Data From Sensor #<?php echo $_POST["uid"]; ?><br>
Level: <?php echo $_POST["level"]; ?><br>
Max Level: <?php echo $_POST["levelmax"]; ?> <br>
Fill Percentage: <?php echo 100*(intval($_POST["level"])/intval($_POST["levelmax"])) ?><br>
Battery Level: <?ph... | <html>
<body>
<?php if (array_key_exists('submit', $_POST)): ?>
Data From Sensor #<?php echo $_POST["uid"]; ?><br>
Level: <?php echo $_POST["level"]; ?><br>
Max Level: <?php echo $_POST["levelmax"]; ?> <br>
Fill Percentage: <?php echo 100*(intval($_POST["level"])/intval($_POST["levelmax"])) ?><br>
Battery Level: <?ph... |
Switch to hashicorp version of msgpack | package raftmdb
import (
"bytes"
"encoding/binary"
"github.com/hashicorp/go-msgpack/codec"
)
// Decode reverses the encode operation on a byte slice input
func decodeMsgPack(buf []byte, out interface{}) error {
r := bytes.NewBuffer(buf)
hd := codec.MsgpackHandle{}
dec := codec.NewDecoder(r, &hd)
return dec.Dec... | package raftmdb
import (
"bytes"
"encoding/binary"
"github.com/ugorji/go/codec"
)
// Decode reverses the encode operation on a byte slice input
func decodeMsgPack(buf []byte, out interface{}) error {
r := bytes.NewBuffer(buf)
hd := codec.MsgpackHandle{}
dec := codec.NewDecoder(r, &hd)
return dec.Decode(out)
}
... |
Fix pytype issue in signal handling code.
PiperOrigin-RevId: 408605103
Change-Id: If724504629a50d5cb7a099cf0263ba642e95345d | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
Add policy description for image size
This commit adds policy doc for image size policies.
Partial implement blueprint policy-docs
Change-Id: I0de4aaa47e21c4e156569eebcb495412ab364417 | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
Fix invalid path when publishing vendor config. | <?php
namespace Kurt\Repoist;
use Illuminate\Support\ServiceProvider;
use Kurt\Repoist\Commands\MakeCriterionCommand;
use Kurt\Repoist\Commands\MakeRepositoryCommand;
class RepoistServiceProvider extends ServiceProvider
{
/**
* Commands to be registered.
* @var array
*/
private $repoistCommand... | <?php
namespace Kurt\Repoist;
use Illuminate\Support\ServiceProvider;
use Kurt\Repoist\Commands\MakeCriterionCommand;
use Kurt\Repoist\Commands\MakeRepositoryCommand;
class RepoistServiceProvider extends ServiceProvider
{
/**
* Commands to be registered.
* @var array
*/
private $repoistCommand... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.