text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Make cargs and gargs truly optional | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=None, cargs=None)... | import os
import subprocess
def load_variables_from_env(prefix="XII_INTEGRATION_"):
length = len(prefix)
vars = {}
for var in filter(lambda x: x.startswith(prefix), os.environ):
vars[var[length:]] = os.environ[var]
return vars
def run_xii(deffile, cmd, variables={}, gargs=None, cargs=None)... |
Change project root variable in clean plugin | const CleanWebpackPlugin = require("clean-webpack-plugin")
const path = require("path")
const webpack = require("webpack")
const dist = path.join(process.cwd(), "public")
const src = path.join(process.cwd(), "src")
//module.exports = { dist, src }
module.exports = {
entry: [path.join(src, "index.js")],
module: {
... | const CleanWebpackPlugin = require("clean-webpack-plugin")
const path = require("path")
const webpack = require("webpack")
const dist = path.join(process.cwd(), "public")
const src = path.join(process.cwd(), "src")
//module.exports = { dist, src }
module.exports = {
entry: [path.join(src, "index.js")],
module: {
... |
Update style guide highlight.js from 9.1.0 to 9.2.0 | /* global hljs */
Wee.fn.make('guide', {
/**
* Highlight code and bind click events
*
* @constructor
*/
_construct: function() {
var priv = this.$private;
// Setup syntax highlighting
priv.highlightCode();
// Bind code toggle and selection
$('ref:code').on('dblclick', function() {
priv.selectC... | /* global hljs */
Wee.fn.make('guide', {
/**
* Highlight code and bind click events
*
* @constructor
*/
_construct: function() {
var priv = this.$private;
// Setup syntax highlighting
priv.highlightCode();
// Bind code toggle and selection
$('ref:code').on('dblclick', function() {
priv.selectC... |
Revert "Removed Javascript from Markdown by adding display priority to def config."
This reverts commit 58e05f9625c60f8deba9ddf1c74dba73e8ea7dd1. | """Markdown Exporter class"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------------... | """Markdown Exporter class"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------------... |
Fix something, something else is broken. | <?php
$config = require_once(dirname(__FILE__) .'/main.default.php');
return array_merge($config,
array(
'components' => array(
'db' => array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host=localhost;dbname=ciims_test',
... | <?php return array_merge(require_once(dirname(__FILE__) .'/main.default.php'),
array(
'components' => array(
'db' => array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host=localhost;dbname=ciims_test',
'emulatePrepare'... |
Refresh a user from travis | <?php
declare(strict_types=1);
namespace WyriHaximus\Travis\Resource\Async;
use GuzzleHttp\Psr7\Request;
use React\Promise\PromiseInterface;
use WyriHaximus\Travis\Resource\User as BaseUser;
use function React\Promise\resolve;
class User extends BaseUser
{
public function refresh() : PromiseInterface
{
... | <?php
declare(strict_types=1);
namespace WyriHaximus\Travis\Resource\Async;
use GuzzleHttp\Psr7\Request;
use React\Promise\PromiseInterface;
use WyriHaximus\Travis\Resource\User as BaseUser;
class User extends BaseUser
{
public function refresh() : User
{
return $this->wait($this->callAsync('refresh'... |
Rename `isRole` to `hasRole` and return true if SuperAdmin | <?php namespace GeneaLabs\LaravelGovernor\Traits;
use GeneaLabs\LaravelGovernor\Permission;
use GeneaLabs\LaravelGovernor\Role;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Collection;
trait Governable
{
public function hasRole(string $name) : bool
{
$this->load('ro... | <?php namespace GeneaLabs\LaravelGovernor\Traits;
use GeneaLabs\LaravelGovernor\Permission;
use GeneaLabs\LaravelGovernor\Role;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Collection;
trait Governable
{
public function isRole(string $name) : bool
{
$this->load('rol... |
Set scrolling duration to 0 | import React, { Component } from 'react';
import ChatMessage from './ChatMessage';
import Scroll from 'react-scroll';
class ChatMessageList extends Component {
getMessages = () => {
return this.props.messages.map((message, index) => {
return <ChatMessage key={index} message={message} person={me... | import React, { Component } from 'react';
import ChatMessage from './ChatMessage';
import Scroll from 'react-scroll';
class ChatMessageList extends Component {
getMessages = () => {
return this.props.messages.map((message, index) => {
return <ChatMessage key={index} message={message} person={me... |
Fix document path with urlEngine | (function () {
var cogClass = function () {};
cogClass.prototype.exec = function (params, request, response) {
var oops = this.sys.apiError;
var sys = this.sys;
var documentID = params.documentid;
var sql = 'SELECT documentID,title '
+ 'FROM documents '
+... | (function () {
var cogClass = function () {};
cogClass.prototype.exec = function (params, request, response) {
var oops = this.sys.apiError;
var sys = this.sys;
var documentID = params.documentid;
var sql = 'SELECT documentID,title '
+ 'FROM documents '
+... |
Fix bug with Parameter Node not getting correct value | /*!
* @depends ../core/AudioletNode.js
*/
/**
* A type of AudioletNode designed to allow AudioletGroups to exactly replicate
* the behaviour of AudioletParameters. By linking one of the group's inputs
* to the ParameterNode's input, and calling `this.parameterName =
* parameterNode` in the group's constructor, ... | /*!
* @depends ../core/AudioletNode.js
*/
/**
* A type of AudioletNode designed to allow AudioletGroups to exactly replicate
* the behaviour of AudioletParameters. By linking one of the group's inputs
* to the ParameterNode's input, and calling `this.parameterName =
* parameterNode` in the group's constructor, ... |
Fix bug with user logout | <?php
namespace mrssoft\engine\controllers;
use mrssoft\engine\models\LoginForm;
use yii;
use yii\base\UserException;
use yii\web\MethodNotAllowedHttpException;
class AuthController extends \yii\web\Controller
{
public function actionLogin()
{
$model = new LoginForm();
if ($model->load(\Yii::... | <?php
namespace mrssoft\engine\controllers;
use mrssoft\engine\models\LoginForm;
use yii;
use yii\base\UserException;
use yii\web\MethodNotAllowedHttpException;
class AuthController extends \yii\web\Controller
{
public function actionLogin()
{
$model = new LoginForm();
if ($model->load(\Yii::... |
Remove python 3.6 only format strings | class SDP:
def __init__(self, local_addr, ptime):
self.local_addr = local_addr
self.ptime = ptime
local_addr_desc = 'IN IP4 {}'.format(self.local_addr[0])
self.payload = '\r\n'.join([
'v=0',
'o=user1 53655765 2353687637 {local_addr_desc}',
's=-',
... | class SDP:
def __init__(self, local_addr, ptime):
self.local_addr = local_addr
self.ptime = ptime
local_addr_desc = f'IN IP4 {self.local_addr[0]}'
self.payload = '\r\n'.join([
'v=0',
f'o=user1 53655765 2353687637 {local_addr_desc}',
's=-',
... |
Add both build id / git commit sha via @hone | 'use strict';
let cli = require('heroku-cli-util');
let columnify = require('columnify');
module.exports = {
topic: 'builds',
needsAuth: true,
needsApp: true,
description: 'list builds',
help: 'List builds for a Heroku app',
run: cli.command(function (context, heroku) {
return heroku.request({
... | 'use strict';
let cli = require('heroku-cli-util');
let columnify = require('columnify');
module.exports = {
topic: 'builds',
needsAuth: true,
needsApp: true,
description: 'list builds',
help: 'List builds for a Heroku app',
run: cli.command(function (context, heroku) {
return heroku.request({
... |
Remove the match param to fix RCE. | from re import split as resplit
from typing import Callable, Union
from dmoj.result import CheckerResult
from dmoj.utils.unicode import utf8bytes
verdict = u"\u2717\u2713"
def check(process_output: bytes, judge_output: bytes, point_value: float, feedback: bool = True,
**kwargs) -> Union[CheckerResult, boo... | from re import split as resplit
from typing import Callable, Union
from dmoj.result import CheckerResult
from dmoj.utils.unicode import utf8bytes
verdict = u"\u2717\u2713"
def check(process_output: bytes, judge_output: bytes, point_value: float, feedback: bool = True,
match: Callable[[bytes, bytes], bool]... |
fix: Add PyLintHandler to artifact manager | from __future__ import absolute_import, print_function
from .manager import Manager
from .checkstyle import CheckstyleHandler
from .coverage import CoverageHandler
from .pycodestyle import PyCodeStyleHandler
from .pylint import PyLintHandler
from .xunit import XunitHandler
manager = Manager()
manager.register(Checkst... | from __future__ import absolute_import, print_function
from .manager import Manager
from .checkstyle import CheckstyleHandler
from .coverage import CoverageHandler
from .pycodestyle import PyCodeStyleHandler
from .xunit import XunitHandler
manager = Manager()
manager.register(CheckstyleHandler, [
'ch... |
Patch for Event handler (second try) :)
Real patch for event handler... | "use babel";
import { Emitter } from 'atom'
export default class EventHandlerHelper
{
constructor()
{
this.emitter = new Emitter();
}
onClose(callback)
{
return this.emitter.on("maperwiki-wordcount-close",callback);
}
close()
{
this.emitter.emit("maperwiki-wordcount-close");
}
onViewW... | "use babel";
import { Emitter } from 'atom'
export default class EventHandlerHelper
{
constructor()
{
this.emitter = new Emitter();
}
onClose(callback)
{
this.emitter.on("maperwiki-wordcount-close",callback);
}
close()
{
this.emitter.emit("maperwiki-wordcount-close");
}
onViewWordcoun... |
Remove a ref to now-gone sample_project. | from setuptools import setup, find_packages
setup(
name='django-crumbs',
version=__import__('crumbs').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
include_package_data=True,
packages=find_packages(),
exclude_package_data={'': ['*.sql', '*.pyc']},
... | from setuptools import setup, find_packages
setup(
name='django-crumbs',
version=__import__('crumbs').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
include_package_data=True,
packages=find_packages(exclude=['sample_project']),
exclude_package_data=... |
Use mkdir instead of makedirs because we don't need parent directories made | from os import mkdir
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import urlopenmock
class BaseTest(object):
files = 'tests/files'
def setup(self):
# if `file` isn't there, make ... | from os import makedirs
from os.path import abspath, dirname, exists, join
from shutil import rmtree
from tvrenamr.config import Config
from tvrenamr.main import TvRenamr
from tvrenamr.tests import urlopenmock
class BaseTest(object):
files = 'tests/files'
def setup(self):
# if `file` isn't there, ma... |
Add items to prescription state | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { ROUTES } from '../navigation/constants';
import { UIDatabase } from '../database';
import { PRESCRIPTION_ACTIONS } from '../actions/PrescriptionActions';
const initialState = () => ({
currentTab: 0,
transaction: null,
items: UIDatabase.o... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { ROUTES } from '../navigation/constants';
import { PRESCRIPTION_ACTIONS } from '../actions/PrescriptionActions';
const initialState = () => ({
currentTab: 0,
transaction: null,
itemSearchTerm: '',
});
export const PrescriptionReducer = ... |
BB-6143: Add code property for attribute group
- fix translation key | <?php
namespace Oro\Bundle\EntityConfigBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
class AttributeFamilyGroups extends Constraint
{
/**
* @var string
*/
public $emptyGroupsMessage = 'oro.entity_config.validator.attribute_family.empty_groups';
/**
* @var strin... | <?php
namespace Oro\Bundle\EntityConfigBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
class AttributeFamilyGroups extends Constraint
{
/**
* @var string
*/
public $emptyGroupsMessage = 'oro.entity_config.validator.attribute_family.empty_groups';
/**
* @var strin... |
Connect to databases INVFEST-DB-dev & INVFEST-DB-PUBLIC-dev from the development branch | <?php
if ($_SESSION["autentificado"]=='SI') {
if ($_SESSION['MySQLuser']=="invfest") {
// Admin user
$user = "invfest";
$password = "pwdInvFEST";
$db = "INVFEST-DB-dev";
} elseif ($_SESSION['MySQLuser']=="invfestdb-lab") {
// Lab user
$user = "invfestdb-lab";
$password = "InvFESTLab";
$db = "I... | <?php
if ($_SESSION["autentificado"]=='SI') {
if ($_SESSION['MySQLuser']=="invfest") {
// Admin user
$user = "invfest";
$password = "pwdInvFEST";
$db = "INVFEST-DB";
} elseif ($_SESSION['MySQLuser']=="invfestdb-lab") {
// Lab user
$user = "invfestdb-lab";
$password = "InvFESTLab";
$db = "INVFE... |
Add comment about what it is | // # Map (map interval)
// Ease function can be a interpolation function as below
function map ( input, inputMin, inputMax, outputMin, outputMax, clamp, ease ) {
input = ( input - inputMin ) / ( inputMax - inputMin );
if ( ease ) {
input = ease(input);
}
var output = input * ( outputMax - outpu... | // Ease function can be a interpolation function as below
function map ( input, inputMin, inputMax, outputMin, outputMax, clamp, ease ) {
input = ( input - inputMin ) / ( inputMax - inputMin );
if ( ease ) {
input = ease(input);
}
var output = input * ( outputMax - outputMin ) + outputMin;
... |
Revert "Experiment with SequenceField that inherits from AutoField"
This reverts commit 726c1d31e353e6c1a079fd06c3008c0714f95b86. | from django.db.models import Field
class SequenceField(Field):
def __init__(self, *args, **kwargs):
kwargs['blank'] = True
super(SequenceField, self).__init__(*args, **kwargs)
def deconstruct(self):
name, path, args, kwargs = super(SequenceField, self).deconstruct()
# lacks 'k... | from django.db.models import AutoField
class SequenceField(AutoField):
"""Overrides the parts of AutoField that force it to be a PK"""
def __init__(self, *args, **kwargs):
super(SequenceField, self).__init__(*args, **kwargs)
def check(self, **kwargs):
"""Shut up '(fields.E100) AutoFields ... |
Enable Shutdown button for a suspended VM
Fixes: https://github.com/oVirt/ovirt-web-ui/issues/1227
Add missing 'suspended' in the array of VM statuses for shutdown button being enabled in VM details page.
Make the Shutdown action available for a suspended VM. | export function canStart (state) {
return ['down', 'paused', 'suspended'].includes(state)
}
export function canShutdown (state) {
return ['up', 'migrating', 'reboot_in_progress', 'paused', 'powering_up', 'powering_down', 'not_responding', 'suspended'].includes(state)
}
export function canRestart (state) {
retur... | export function canStart (state) {
return ['down', 'paused', 'suspended'].includes(state)
}
export function canShutdown (state) {
return ['up', 'migrating', 'reboot_in_progress', 'paused', 'powering_up', 'powering_down', 'not_responding'].includes(state)
}
export function canRestart (state) {
return ['up', 'mig... |
Correct CSS class name typo | import React from 'react/addons';
import Backbone from 'backbone';
import Router from 'react-router';
export default React.createClass({
displayName: "Name",
propTypes: {
provider: React.PropTypes.instanceOf(Backbone.Model).isRequired
},
render: function () {
let provider = this.props... | import React from 'react/addons';
import Backbone from 'backbone';
import Router from 'react-router';
export default React.createClass({
displayName: "Name",
propTypes: {
provider: React.PropTypes.instanceOf(Backbone.Model).isRequired
},
render: function () {
let provider = this.props... |
Add warning when no .env file found | /**
* Load environment variables from .env for local development.
* If no .env file is to be found at
*/
const path = require('path')
const chalk = require('chalk')
const env = require('dotenv').config()
if (env.error) {
console.warn(chalk.yellow(`No config file was found at ${env.error.path}`))
} else {
con... | /**
* Load environment variables from .env for local development.
* If no .env file is to be found at
*/
// const path = require('path')
// const chalk = require('chalk')
// const env = require('dotenv').config()
// if (env.error) {
// console.warn(chalk.yellow(`No config file was found at ${env.error.path}`))... |
Change name function generate on tick | // Cron.js - in api/services
"use strict";
const CronJob = require('cron').CronJob;
const _ = require('lodash');
const crons = [];
module.exports = {
start: () => {
sails.config.scientilla.crons.forEach(cron => {
crons.push(new CronJob(cron.time, generateOnTick(cron), null, false, 'Europe/Rom... | // Cron.js - in api/services
"use strict";
const CronJob = require('cron').CronJob;
const _ = require('lodash');
const crons = [];
module.exports = {
start: () => {
sails.config.scientilla.crons.forEach(cron => {
crons.push(new CronJob(cron.time, onTick(cron), null, false, 'Europe/Rome'))
... |
Add 'six' to the install requirements | from __future__ import absolute_import
import subprocess
from setuptools import setup
try:
pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'],
stdout=subprocess.PIPE)
readme = str(pandoc.communicate()[0])
except OSError:
with open('README.md') as f:
re... | from __future__ import absolute_import
import subprocess
from setuptools import setup
try:
pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'],
stdout=subprocess.PIPE)
readme = str(pandoc.communicate()[0])
except OSError:
with open('README.md') as f:
re... |
Send email notifications in asynchronous mode
Each mail notification is done on a thread in order to not block the main thread
of the web app. | # -*- coding: utf-8 -*-
from flask import render_template,g
from flask.ext.mail import Message
from app import mail, db
from .models import User
from config import MAIL_SENDER
from threading import Thread
from app import app
# Send mail into a dedicated thread in order to avoir the web app to wait
def send_async_emai... | # -*- coding: utf-8 -*-
from flask import render_template,g
from flask.ext.mail import Message
from app import mail, db
from .models import User
from config import MAIL_SENDER
# Wrapper function for sending mails using flask-mail plugin
def send_email(subject, sender, recipients, text_body):
msg = Message(subject... |
Fix error reporting on test. | package gorand
import (
"testing"
)
func TestID(t *testing.T) {
id, err := ID()
if err != nil {
t.Error(err.Error())
}
if len(id) != 128 {
t.Error("Length of UUID isn't 128")
}
}
func TestUUID(t *testing.T) {
uuid, err := UUID()
if err != nil {
t.Error(err.Error())
}
if len(uuid) != 36 {
t.Error(... | package gorand
import (
"testing"
)
func TestID(t *testing.T) {
id, err := ID()
if err != nil {
t.Error(err.Error())
}
if len(id) != 128 {
t.Error("Length of UUID isn't 128")
}
}
func TestUUID(t *testing.T) {
uuid, err := UUID()
if err != nil {
t.Error(err.Error())
}
if len(uuid) != 36 {
t.Error(... |
Add prop test to Foo | import React from "react";
import toJson from "enzyme-to-json";
import { shallow, mount, render } from "enzyme";
import Foo from "../Foo";
describe("A suite", function() {
it("should render without throwing an error", function() {
const info = "Bar";
expect(
shallow(<Foo loading info={info} />).contai... | import React from "react";
import toJson from "enzyme-to-json";
import { shallow, mount, render } from "enzyme";
import Foo from "../Foo";
describe("A suite", function() {
it("should render without throwing an error", function() {
const info = "Bar";
expect(
shallow(<Foo loading info={info} />).contai... |
Fix failing test - Photo ID Guide to Larvae at Hydrothermal Vents. | <?php
namespace php_active_record;
require_library('connectors/HydrothermalVentLarvaeAPI');
class test_connector_vent_larvae_api extends SimpletestUnitBase
{
function testVentLarvaeAPI()
{
$url = "http://www.whoi.edu/vent-larval-id/MiscSpecies.htm";
//$url = "http://pandanus.eol.org/... | <?php
namespace php_active_record;
require_library('connectors/HydrothermalVentLarvaeAPI');
class test_connector_vent_larvae_api extends SimpletestUnitBase
{
function testVentLarvaeAPI()
{
//$url = "http://www.whoi.edu/vent-larval-id/MiscSpecies.htm";
$url = "http://pandanus.eol.... |
Split Entry into Income and Expense schemes
Splitting the Entry schema into two seperate schemes allows
us to use different collections to store them, which in turn makes
our work easier later on. | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Income(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry... | from app import db
from app.mod_auth.model import User
class Category(db.Document):
# The name of the category.
name = db.StringField(required = True)
class Entry(db.Document):
# The amount of the entry.
amount = db.DecimalField(precision = 2, required = True)
# A short description for the entry.... |
Use plan name instead of description | from django.conf import settings
from django.core.management.base import BaseCommand
import stripe
class Command(BaseCommand):
help = "Make sure your Stripe account has the plans"
def handle(self, *args, **options):
stripe.api_key = settings.STRIPE_SECRET_KEY
for plan in settings.PA... | from django.conf import settings
from django.core.management.base import BaseCommand
import stripe
class Command(BaseCommand):
help = "Make sure your Stripe account has the plans"
def handle(self, *args, **options):
stripe.api_key = settings.STRIPE_SECRET_KEY
for plan in settings.PA... |
Use the full class name in the registry | <?php
namespace Integrated\Bundle\ContentBundle\Form\Registry;
use Integrated\Common\ContentType\Form\Custom\Type;
use Integrated\Common\ContentType\Form\Custom\Type\Registry;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
/**
* Simple factory ... | <?php
namespace Integrated\Bundle\ContentBundle\Form\Registry;
use Integrated\Common\ContentType\Form\Custom\Type;
use Integrated\Common\ContentType\Form\Custom\Type\Registry;
/**
* Simple factory for Registry
*
* @author Jeroen van Leeuwen <jeroen@e-active.nl>
*/
class RegistryFactory
{
/**
* @return R... |
Update myTBA on launch always | package com.thebluealliance.androidclient;
import android.app.Application;
import android.util.Log;
import com.google.android.gms.analytics.Tracker;
import com.thebluealliance.androidclient.accounts.AccountHelper;
import com.thebluealliance.androidclient.background.UpdateMyTBA;
/**
* File created by phil on 7/21/14... | package com.thebluealliance.androidclient;
import android.app.Application;
import android.util.Log;
import com.google.android.gms.analytics.Tracker;
import com.thebluealliance.androidclient.accounts.AccountHelper;
import com.thebluealliance.androidclient.background.UpdateMyTBA;
/**
* File created by phil on 7/21/14... |
Change new_bmi fixture scope to be function level. | import os
import pytest
from scripting.contexts import cd
from . import Bmi, INPUT_FILE
from .utils import all_grids, all_names, out_names, strictly_input_names
@pytest.fixture
def new_bmi(infile=None):
try:
with open('.ROOT_DIR', 'r') as fp:
root_dir = fp.read()
except IOError:
... | import os
import pytest
from scripting.contexts import cd
from . import Bmi, INPUT_FILE
from .utils import all_grids, all_names, out_names, strictly_input_names
@pytest.fixture(scope='module')
def new_bmi(infile=None):
try:
with open('.ROOT_DIR', 'r') as fp:
root_dir = fp.read()
except I... |
Remove "css" from input format | 'use strict';
var Cleaner = require('clean-css');
var defaultCleaner = new Cleaner();
var Promise = require('promise');
exports.name = 'clean-css';
exports.inputFormats = ['clean-css', 'cssmin'];
exports.outputFormat = 'css';
function getCleaner (options) {
if (!options ||
(typeof options === 'object' && Ob... | 'use strict';
var Cleaner = require('clean-css');
var defaultCleaner = new Cleaner();
var Promise = require('promise');
exports.name = 'clean-css';
exports.inputFormats = ['clean-css', 'css', 'cssmin'];
exports.outputFormat = 'css';
function getCleaner (options) {
if (!options ||
(typeof options === 'object... |
Fix bug where user could not be found
This problem only occured when a request tried to find the user right
after it had been created. | from google.appengine.api import users
from google.appengine.ext import db
from model import User
latest_signup = None
@db.transactional
def create_user(google_user):
global latest_signup
user = User(
google_user=google_user
)
user.put()
latest_signup = user
return user
def get_curre... | from google.appengine.api import users
from google.appengine.ext import db
from model import User
@db.transactional
def create_user(google_user):
user = User(
google_user=google_user
)
user.put()
return user
def get_current_user():
google_user = users.get_current_user()
user = get_use... |
Encrypt password before saving user | from index import db, brcypt
class UserModel(db.Model):
__tablename__ = 'User'
id = db.Column(db.Integer, primary_key=True, nullable=False)
name = db.Column(db.String(80), unique=True, nullable=False)
fullname = db.Column(db.String(80), unique=True, nullable=False)
initials = db.Column(db.String(1... | from index import db
class UserModel(db.Model):
__tablename__ = 'User'
id = db.Column(db.Integer, primary_key=True, nullable=False)
name = db.Column(db.String(80), unique=True, nullable=False)
fullname = db.Column(db.String(80), unique=True, nullable=False)
initials = db.Column(db.String(10), uniq... |
Exclude forms partial as well. | // Check SCSS for code quality
module.exports = function(grunt) {
grunt.config('scsslint', {
allFiles: [
'scss/**/*.scss',
],
options: {
bundleExec: false,
colorizeOutput: true,
config: '.scss-lint.yml',
exclude: [
'... | // Check SCSS for code quality
module.exports = function(grunt) {
grunt.config('scsslint', {
allFiles: [
'scss/**/*.scss',
],
options: {
bundleExec: false,
colorizeOutput: true,
config: '.scss-lint.yml',
exclude: [
'... |
Change StoreWatchMixin to watch in componentDidMount
See #88 | var _each = require("lodash-node/modern/collections/forEach");
var StoreWatchMixin = function() {
var storeNames = Array.prototype.slice.call(arguments);
return {
componentDidMount: function() {
var flux = this.props.flux || this.context.flux;
_each(storeNames, function(store) {
flux.store(... | var _each = require("lodash-node/modern/collections/forEach");
var StoreWatchMixin = function() {
var storeNames = Array.prototype.slice.call(arguments);
return {
componentWillMount: function() {
var flux = this.props.flux || this.context.flux;
_each(storeNames, function(store) {
flux.store... |
Update eBay script to handle https | // ==UserScript==
// @name eBay - Hilight Items With Bids
// @namespace http://mathemaniac.org
// @include http://*.ebay.*/*
// @include https://*.ebay.*/*
// @grant none
// @version 2.3.4
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @descrip... | // ==UserScript==
// @name eBay - Hilight Items With Bids
// @namespace http://mathemaniac.org
// @include http://*.ebay.*/*
// @grant none
// @version 2.3.3
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @description Hilights items that have bids ... |
Add echoPermission option in PopoverModel |
// ----------------------------------------------------------------
// Popover Class
class PopoverModel extends CommonModel {
constructor({
name = 'Popover',
selector = null,
help = 'popover',
trigger = 'hover'
} = {})
{
super({
name: name,
echoPermission: false
});
... |
// ----------------------------------------------------------------
// Popover Class
class PopoverModel extends CommonModel {
constructor({
name = 'Popover',
selector = null,
help = 'popover',
trigger = 'hover'
} = {})
{
super({
name: name
});
this.NAME = name;
this.SE... |
Update the long_description with README.rst | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@mad... | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.md"):
longDesc = open("README.md").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madma... |
Correct drop table referencing wrong table | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ConstrainComments extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
//
Schema::table('comments',function($table)
... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ConstrainComments extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
//
Schema::table('comments',function($table)
... |
[BlockStorage] Attach Volume
Add the type. | <?php
namespace wappr\digitalocean\Requests\BlockStorageActions;
use wappr\digitalocean\Helpers\RegionsHelper;
use wappr\digitalocean\RequestContract;
/**
* Class AttachVolumeRequest.
*
* Attach a volume to a Droplet.
*/
class AttachVolumeRequest extends RequestContract
{
public $type = 'attach';
public... | <?php
namespace wappr\digitalocean\Requests\BlockStorageActions;
use wappr\digitalocean\Helpers\RegionsHelper;
use wappr\digitalocean\RequestContract;
/**
* Class AttachVolumeRequest.
*
* Attach a volume to a Droplet.
*/
class AttachVolumeRequest extends RequestContract
{
public $volume_id;
public $drop... |
Fix WidgetWithScript to accept renderer kwarg | from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render_html(self, name, value, attrs):
"""Render the HTML (non-JS) portion of the field markup"""
return super().render(name, value, attrs)
def render(self, name, value, a... | from django.forms.widgets import Widget
from django.utils.safestring import mark_safe
class WidgetWithScript(Widget):
def render_html(self, name, value, attrs):
"""Render the HTML (non-JS) portion of the field markup"""
return super().render(name, value, attrs)
def render(self, name, value, a... |
Revert "Revert "refactor: add progress reporter back in for karma tests""
This reverts commit f4855a955decace888d1291eab1b09b076b51a2f. | module.exports = function (config) {
config.set({
basePath: './',
frameworks: ['jasmine'],
browsers: ['Chrome', 'Firefox', 'PhantomJS'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'dist/ng-restful-collection.js',
'tests/**... | module.exports = function (config) {
config.set({
basePath: './',
frameworks: ['jasmine'],
browsers: ['Chrome', 'Firefox', 'PhantomJS'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'dist/ng-restful-collection.js',
'tests/**... |
Add benchmark test for COWList_Get | package gorocksdb
import (
"fmt"
"sync"
"testing"
"github.com/facebookgo/ensure"
)
func TestCOWList(t *testing.T) {
cl := NewCOWList()
cl.Append("hello")
cl.Append("world")
cl.Append("!")
ensure.DeepEqual(t, cl.Get(0), "hello")
ensure.DeepEqual(t, cl.Get(1), "world")
ensure.DeepEqual(t, cl.Get(2), "!")
}
... | package gorocksdb
import (
"sync"
"testing"
"github.com/facebookgo/ensure"
)
func TestCOWList(t *testing.T) {
cl := NewCOWList()
cl.Append("hello")
cl.Append("world")
cl.Append("!")
ensure.DeepEqual(t, cl.Get(0), "hello")
ensure.DeepEqual(t, cl.Get(1), "world")
ensure.DeepEqual(t, cl.Get(2), "!")
}
func T... |
Add test for api error response | var fs = require('fs');
var config = require('../config');
var schemaText = fs.readFileSync(config.schemapath);
var schema = JSON.parse(schemaText.toString());
schema.host = 'localhost';
schema.port = '3000'
schema.version = undefined;
var Api = require('../lib/api').Api;
var api = new Api({
schema: schema,
forma... | var fs = require('fs');
var config = require('../config');
var schemaText = fs.readFileSync(config.schemapath);
var schema = JSON.parse(schemaText.toString());
schema.host = 'localhost';
schema.port = '3000'
schema.version = undefined;
var Api = require('../lib/api').Api;
var api = new Api({
schema: schema,
forma... |
Fix return type in sitemap object type interface | <?php
namespace wcf\system\sitemap\object;
use wcf\data\DatabaseObject;
use wcf\data\DatabaseObjectList;
/**
* Interface for sitemap objects.
*
* @author Joshua Ruesweg
* @copyright 2001-2017 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package W... | <?php
namespace wcf\system\sitemap\object;
use wcf\data\DatabaseObject;
/**
* Interface for sitemap objects.
*
* @author Joshua Ruesweg
* @copyright 2001-2017 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Sitemap\O... |
Add test for inc page num, good format | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img... |
Fix bug from last commit. | """
Common methods for getting data from the backend.
These methods are intended to be used by both views.py, which should define
only pages, and xhr_handlers.py, which are intended to respond to AJAX
requests.
"""
from main.model_views import CastVariantView
from main.model_views import MeltedVariantView
from varian... | """
Common methods for getting data from the backend.
These methods are intended to be used by both views.py, which should define
only pages, and xhr_handlers.py, which are intended to respond to AJAX
requests.
"""
from main.model_views import CastVariantView
from main.model_views import MeltedVariantView
from varian... |
Move data into owner gdb | #!/usr/bin/env python
# * coding: utf8 *
'''
BemsPallet.py
A module that contains a pallet to update the querable layers behind our UTM basemaps
'''
from forklift.models import Pallet
from os.path import join
class BemsPallet(Pallet):
def __init__(self):
super(BemsPallet, self).__init__()
self... | #!/usr/bin/env python
# * coding: utf8 *
'''
BemsPallet.py
A module that contains a pallet to update the querable layers behind our UTM basemaps
'''
from forklift.models import Pallet
from os.path import join
class BemsPallet(Pallet):
def __init__(self):
super(BemsPallet, self).__init__()
self... |
Fix indentation of the Java grammar | define(function() {
return function(Prism) {
Prism.languages.java = Prism.languages.extend('clike', {
'keyword': /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceo... | define(function() {
// Export
return function(Prism) {
Prism.languages.java = Prism.languages.extend('clike', {
'keyword': /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|e... |
Remove unused import. Facebook compliance support python3 | from json import dumps
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if 'application/json' in r.headers['content-type']:... | from json import dumps
from oauthlib.common import urldecode
from urlparse import parse_qsl
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if 'application/json' in r.headers['content-type']:
return r
... |
Fix XMLHttpRequest - 3.0.0 PR edition
As on tin. Same thing as #107. | //
// Browser requests, mirrors the syntax of the node requests
//
var when = require('when');
var form = require('./form');
exports.https = function(options, formData) {
options = options || {};
options.headers = options.headers || {};
var data = form.getData(formData);
options.headers['Content-Type'] = ... | //
// Browser requests, mirrors the syntax of the node requests
//
var when = require('when');
var form = require('./form');
exports.https = function(options, formData) {
options = options || {};
options.headers = options.headers || {};
var data = form.getData(formData);
options.headers['Content-Type'] = ... |
Add a link back to the client from the config page | @extends('master')
@section('title')
Micropub Config «
@stop
@section('content')
<p>The values for your micropub endpoint.</p>
<dl>
<dt>Me (your url)</dt><dd>{{ $data['me'] }}</dd>
<dt>Token</dt><dd>{{ $data['token'] }}</dd>
<dt>Syndication Targets</dt><dd>@if(is_array($data['syndication']))<ul>@foreach (... | @extends('master')
@section('title')
Micropub Config «
@stop
@section('content')
<p>The values for your micropub endpoint.</p>
<dl>
<dt>Me (your url)</dt><dd>{{ $data['me'] }}</dd>
<dt>Token</dt><dd>{{ $data['token'] }}</dd>
<dt>Syndication Targets</dt><dd>@if(is_array($data['syndication']))<ul>@foreach (... |
Add clubId property and change labels | import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
export const Coachs = new Mongo.Collection('coachs');
Coachs.deny({
insert() {
return true;
},
update() {
return true;
},
remove() {
return true;
}
});
export const coachSchema = new SimpleSchema({
gameId: ... | import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
export const Coachs = new Mongo.Collection('coachs');
Coachs.deny({
insert() {
return true;
},
update() {
return true;
},
remove() {
return true;
}
});
export const coachSchema = new SimpleSchema({
gameId: ... |
Use 'range' rather than 'xrange' for Python 3 compatibility. | #!/usr/bin/env python
# coding=utf-8
"""
Balanced ternary binary encoding
============
Tools for encoding balanced ternary data into binary formats and back again.
The encoded scheme used here uses 8-bit segments to represent 5-trit segments.
Each 5-trit segment is mapped to an 8-bit binary value which corresponds to... | #!/usr/bin/env python
# coding=utf-8
"""
Balanced ternary binary encoding
============
Tools for encoding balanced ternary data into binary formats and back again.
The encoded scheme used here uses 8-bit segments to represent 5-trit segments.
Each 5-trit segment is mapped to an 8-bit binary value which corresponds to... |
Change the config dictionary key validation | #!/usr/bin/python3
import subprocess
import os
from time import sleep
env = {}
HOME = os.environ.get("HOME", "/root")
scannerConf = open(HOME+"/scanner.conf", "rt")
while True:
in_line = scannerConf.readline()
if not in_line:
break
in_line = in_line[:-1]
key, value = in_line.split("=")
env... | #!/usr/bin/python3
import subprocess
import os
from time import sleep
env = {}
HOME = os.environ.get("HOME", "/root")
scannerConf = open(HOME+"/scanner.conf", "rt")
while True:
in_line = scannerConf.readline()
if not in_line:
break
in_line = in_line[:-1]
key, value = in_line.split("=")
env... |
Remove `implicitBundleDest` property from example app (now uses default). | var path = require("path");
var Interlock = require("..");
var ilk = new Interlock({
srcRoot: __dirname,
destRoot: path.join(__dirname, "dist"),
entry: {
"./app/entry-a.js": "entry-a.bundle.js",
"./app/entry-b.js": { dest: "entry-b.bundle.js" }
},
split: {
"./app/shared/lib-a.js": "[setHash].js... | var path = require("path");
var Interlock = require("..");
var ilk = new Interlock({
srcRoot: __dirname,
destRoot: path.join(__dirname, "dist"),
entry: {
"./app/entry-a.js": "entry-a.bundle.js",
"./app/entry-b.js": { dest: "entry-b.bundle.js" }
},
split: {
"./app/shared/lib-a.js": "[setHash].js... |
Change API key to unit test version | <?php
return array(
/*
|--------------------------------------------------------------------------
| Enable Tracking
|--------------------------------------------------------------------------
|
| Enable Google Analytics tracking.
|
*/
'enabled' => true,
/*
|-----------------------------------------------... | <?php
return array(
/*
|--------------------------------------------------------------------------
| Enable Tracking
|--------------------------------------------------------------------------
|
| Enable Google Analytics tracking.
|
*/
'enabled' => true,
/*
|-----------------------------------------------... |
Fix a bug in the cache manager
It is possible that the previous state is None | import pickle
import claripy
import logging
from ..simprocedures import receive
l = logging.getLogger("tracer.cachemanager.CacheManager")
class CacheManager(object):
def __init__(self):
self.tracer = None
def set_tracer(self, tracer):
self.tracer = tracer
def cacher(self, simstate):
... | import pickle
import claripy
import logging
from ..simprocedures import receive
l = logging.getLogger("tracer.cachemanager.CacheManager")
class CacheManager(object):
def __init__(self):
self.tracer = None
def set_tracer(self, tracer):
self.tracer = tracer
def cacher(self, simstate):
... |
Make faucet support anon access | import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router'
import { Provider } from 'react-redux'
import { syncHistoryWithStore } from 'react-router-redux'
import { UserIsAuthenticated, UserIsNotAuthenticated } from './util/wrappers.js'
// Mate... | import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router'
import { Provider } from 'react-redux'
import { syncHistoryWithStore } from 'react-router-redux'
import { UserIsAuthenticated, UserIsNotAuthenticated } from './util/wrappers.js'
// Mate... |
Remove functions that rely on the console object
Mainly because console.log isn't a standard JS feature
and is implemented differently across browsers, causing
problems when trying to alias it. | 'use strict';
var $ = require('jquery');
var forOwn = require('lodash/object/forOwn');
var isArray = require('lodash/lang/isArray');
var isPlainObject = require('lodash/lang/isPlainObject');
var extend = require('lodash/object/extend');
var transform = require('lodash/object/transform');
module.exports = {
Modules:... | 'use strict';
var $ = require('jquery');
var forOwn = require('lodash/object/forOwn');
var isArray = require('lodash/lang/isArray');
var isPlainObject = require('lodash/lang/isPlainObject');
var extend = require('lodash/object/extend');
var transform = require('lodash/object/transform');
module.exports = {
Modules:... |
Update tests to new SimpleProps | package dev.kkorolyov.sqlob;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import dev.kkorolyov.simpleprops.Properties;
@SuppressWarnings("javadoc")
public class TestAssets {
private static final String HOST = "HOST",
DATABASE = "DATABASE",
USER ... | package dev.kkorolyov.sqlob;
import java.io.IOException;
import java.io.UncheckedIOException;
import dev.kkorolyov.simpleprops.Properties;
@SuppressWarnings("javadoc")
public class TestAssets {
private static final String TEST_PROPERTIES_NAME = "TestSQLOb.ini";
private static final String HOST = "HOST",
... |
Fix public asset publish location | <?php namespace GeneaLabs\Bones\Keeper;
use Illuminate\Support\ServiceProvider;
class BonesKeeperServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the application events.
... | <?php namespace GeneaLabs\Bones\Keeper;
use Illuminate\Support\ServiceProvider;
class BonesKeeperServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the application events.
... |
Add unittest skip for CI | # -*- coding: utf-8 -*-
import os
import unittest
from dotenv import load_dotenv
from auth0plus.oauth import get_token
load_dotenv('.env')
class TestGetAToken(unittest.TestCase):
@unittest.skipIf(skip, 'SKIP_INTEGRATION_TESTS==1')
def setUp(self):
"""
Get a non-interactive client secret
... | # -*- coding: utf-8 -*-
import os
import unittest
from dotenv import load_dotenv
from auth0plus.oauth import get_token
load_dotenv('.env')
class TestGetAToken(unittest.TestCase):
def setUp(self):
"""
Get a non-interactive client secret
"""
self.domain = os.getenv('DOMAIN')
... |
Use set method on EnvFile object | <?php
namespace Sven\FlexEnv;
use Sven\FlexEnv\Contracts\Parser;
class EnvParser implements Parser
{
public function parse(string $env): EnvFile
{
$lines = $this->removeEmptyLines(
$this->splitIntoLines($env)
);
$parser = new LineParser();
return array_reduce($li... | <?php
namespace Sven\FlexEnv;
use Sven\FlexEnv\Contracts\Parser;
class EnvParser implements Parser
{
public function parse(string $env): EnvFile
{
$lines = $this->removeEmptyLines(
$this->splitIntoLines($env)
);
$parser = new LineParser();
return array_reduce($li... |
Rename photo endpoint to submission | """.. Ignore pydocstyle D400.
=============
Core API URLs
=============
The ``routList`` is ment to be included in ``urlpatterns`` with the
following code:
.. code-block:: python
from rest_framework import routers
from rolca.core.api import urls as core_api_urls
route_lists = [
core_api_urls.r... | """.. Ignore pydocstyle D400.
=============
Core API URLs
=============
The ``routList`` is ment to be included in ``urlpatterns`` with the
following code:
.. code-block:: python
from rest_framework import routers
from rolca.core.api import urls as core_api_urls
route_lists = [
core_api_urls.r... |
Tag Display in single Ticket | <?php
use yii\helpers\Html;
use yii\bootstrap\Carousel;
/* @var $this yii\web\View */
/* @var $ticket common\models\Ticket */
/* @var $showTagMax int/boolean maximum number of tags to display*/
//Ticket Decoration Bar displays the Ticket decorations
if ($taglist = $ticket->tagNames) {
echo Html::beginTag('div',... | <?php
use yii\helpers\Html;
use yii\bootstrap\Carousel;
/* @var $this yii\web\View */
/* @var $ticket common\models\Ticket */
/* @var $showTagMax int/boolean maximum number of tags to display*/
//Ticket Decoration Bar displays the Ticket decorations
if ($taglist = $ticket->tagNames) {
echo Html::beginTag('div',... |
Fix outdated link in sample plugin
Link in sample_plugin.py is outdated
and is changed
Change-Id: I2f3a7b59c6380e4584a8ce2a5313fe766a40a52a
Closes-Bug: #1491975 | # Copyright 2014 Mirantis Inc.
# 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 2014 Mirantis Inc.
# 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 semi-colon and use dot notation. | //Filter experiment or computation templates
Application.Filters.filter('byMediaType', function () {
return function (items, values) {
var matches = [];
if (items) {
items.forEach(function(item) {
if ('mediatype' in item) {
values.forEach(function(val... | //Filter experiment or computation templates
Application.Filters.filter('byMediaType', function () {
return function (items, values) {
var matches = [];
if (items) {
items.forEach(function(item) {
if ('mediatype' in item) {
values.forEach(function(val... |
Fix GoogleDrive OAuth callback URL in OAuth module. | # -*- encoding:utf8 -*-
import os
from oauth2client.client import OAuth2WebServerFlow
class OAuth:
def __init__(self):
pass
def get_flow(self):
scope = 'https://www.googleapis.com/auth/drive'
try:
client_id = os.environ['GOOGLE_CLIENT_ID']
client_secret = os... | # -*- encoding:utf8 -*-
import os
from oauth2client.client import OAuth2WebServerFlow
class OAuth:
def __init__(self):
pass
def get_flow(self):
scope = 'https://www.googleapis.com/auth/drive'
try:
client_id = os.environ['GOOGLE_CLIENT_ID']
client_secret = os... |
Add button title to the footer "Title" | import { h } from 'preact'
import InfoIcon from '../icons/InfoIcon'
import DescriptionIcon from '../icons/DescriptionIcon'
function Footer({
title,
date,
showTitle,
showInfo,
onTitleClick,
onToggleClick
}) {
const footerVisibility = showTitle ? 'show' : ''
let toggleButtonClasses = ['btn']
if (showI... | import { h } from 'preact'
import InfoIcon from '../icons/InfoIcon'
import DescriptionIcon from '../icons/DescriptionIcon'
function Footer({
title,
date,
showTitle,
showInfo,
onTitleClick,
onToggleClick
}) {
const footerVisibility = showTitle ? 'show' : ''
let toggleButtonClasses = ['btn']
if (showI... |
Add quickstarts to root module.
Fixes checkstyle errors in samples. | /*
Copyright 2016, Google, 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 applicable law or agreed to in writing... | /*
Copyright 2016, Google, 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 applicable law or agreed to in writing... |
Fix passing dashed module paths to generator | 'use strict';
var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var convert = {
moduleToFolder: moduleToFolder,
pathToModule: pathToModule
};
function pathToModule(dir, entered) {
var moduleName = _.camelCase(path.basename(dir));
var moduleFilename = path.basename(dir) + '.module.... | 'use strict';
var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var convert = {
moduleToFolder: moduleToFolder,
pathToModule: pathToModule
};
function pathToModule(dir, entered) {
var moduleName = _.camelCase(path.basename(dir));
var moduleFilename = moduleName + '.module.js';
v... |
Add match_distance flag to load_data_frame() | import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True, match_distance=False):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data... | import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data frame will be sorted ... |
Add PR merge hook handling. | <?php namespace App\Http\Controllers;
use App\Jobs\UpdateLiveCopy;
use App\Jobs\UpdateVersionHashes;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Inspiring;
use Illuminate\Http\Request;
class HooksController extends Controller
{
use DispatchesJobs;
public function specChange(Request $r... | <?php namespace App\Http\Controllers;
use App\Jobs\UpdateLiveCopy;
use App\Jobs\UpdateVersionHashes;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Inspiring;
use Illuminate\Http\Request;
class HooksController extends Controller
{
use DispatchesJobs;
public function specChange(Request $r... |
Comment just to prevent the errors | import Ember from 'ember';
import layout from '../templates/components/yebo-checkout';
/**
A single page checkout that reactively responds to changes in the
`yebo.checkouts` service.
**To Override:** You'll need to run the components generator:
```bash
ember g yebo-ember-storefront-components
```
This ... | import Ember from 'ember';
import layout from '../templates/components/yebo-checkout';
/**
A single page checkout that reactively responds to changes in the
`yebo.checkouts` service.
**To Override:** You'll need to run the components generator:
```bash
ember g yebo-ember-storefront-components
```
This ... |
Fix network service provider functional test
SDK refactor broken network service provider
functional test, tested this command works,
but there is a error in the funtional test,
so fix it.
Change-Id: I783c58cedd39a05b665e47709b2b5321871e558b
Closes-Bug: 1653138 | # Copyright (c) 2016, Intel Corporation.
# 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 (c) 2016, Intel Corporation.
# 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... |
Add trailing commas (to secretly nudge travis-ci) | /*
* grunt-contrib-watch
* http://gruntjs.com/
*
* Copyright (c) 2013 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/**/*.js',
'<%= nodeunit.test... | /*
* grunt-contrib-watch
* http://gruntjs.com/
*
* Copyright (c) 2013 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/**/*.js',
'<%= nodeunit.test... |
Make attributes -> attr calls easier to follow | import injectAttr from "./runtime/attr";
import injectForOwn from "./runtime/for-own";
import toFunctionCall from "./ast/to-function-call";
import iDOMMethod from "./idom-method";
// Transforms an attribute array into sequential attr calls.
export default function attrsToAttrCalls(t, file, attrs) {
const forOwn = in... | import injectAttr from "./runtime/attr";
import injectForOwn from "./runtime/for-own";
import toFunctionCall from "./ast/to-function-call";
import iDOMMethod from "./idom-method";
// Transforms an attribute array into sequential attr calls.
export default function attrsToAttrCalls(t, file, attrs) {
const forOwn = in... |
Fix accidental change of fromJSON() to create(). | // If we're in Node.js then require VTTRegion so we can extend it, otherwise assume
// VTTRegion is on the global.
if (typeof module !== "undefined" && module.exports) {
this.VTTRegion = require("./vttregion").VTTRegion;
}
// Extend VTTRegion with methods to convert to JSON, from JSON, and construct a
// VTTRegion f... | // If we're in Node.js then require VTTRegion so we can extend it, otherwise assume
// VTTRegion is on the global.
if (typeof module !== "undefined" && module.exports) {
this.VTTRegion = require("./vttregion").VTTRegion;
}
// Extend VTTRegion with methods to convert to JSON, from JSON, and construct a
// VTTRegion f... |
Fix Accept-Encoding match (split would result in ' gzip', which doesn't match.
Add minimum_size attribute. | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6, minimum_size=500):
self.app = app
self.compress_level = compress_level
self.minimum_size = minimum_size
self.app.after_request(self.after_request)
def after_requ... | import gzip
import StringIO
from flask import request
class Gzip(object):
def __init__(self, app, compress_level=6):
self.app = app
self.compress_level = compress_level
self.app.after_request(self.after_request)
def after_request(self, response):
accept_encoding = request.head... |
Fix unneeded float cast and add return type | <?php
namespace OpenDominion\Models;
class Race extends AbstractModel
{
public function dominions()
{
return $this->hasMany(Dominion::class);
}
public function perks()
{
return $this->hasMany(RacePerk::class);
}
public function units()
{
return $this->hasMany(... | <?php
namespace OpenDominion\Models;
class Race extends AbstractModel
{
public function dominions()
{
return $this->hasMany(Dominion::class);
}
public function perks()
{
return $this->hasMany(RacePerk::class);
}
public function units()
{
return $this->hasMany(... |
Add Emittery back into the event mangager | const { ReporterAggregator } = require("truffle-reporters");
const Emittery = require("emittery");
class EventManager {
constructor(eventManagerOptions) {
const { logger, muteReporters, globalConfig } = eventManagerOptions;
// Keep a reference to these so it can be cloned
// if necessary in truffle-conf... | const { ReporterAggregator } = require("truffle-reporters");
class EventManager {
constructor(eventManagerOptions) {
const { logger, muteReporters, globalConfig } = eventManagerOptions;
// Keep a reference to these so it can be cloned
// if necessary in truffle-config
this.initializationOptions = ev... |
Fix wrong install requirement name. | #!/usr/bin/env python
# coding=utf-8
__author__ = 'kulakov.ilya@gmail.com'
from setuptools import setup
setup(name="Power",
version="1.0",
description="Cross-platform system power status information.",
author="Ilya Kulakov",
author_email="kulakov.ilya@gmail.com",
url="https://github.com/Kentzo/Po... | #!/usr/bin/env python
# coding=utf-8
__author__ = 'kulakov.ilya@gmail.com'
from setuptools import setup
setup(name="Power",
version="1.0",
description="Cross-platform system power status information.",
author="Ilya Kulakov",
author_email="kulakov.ilya@gmail.com",
url="https://github.com/Kentzo/Po... |
Add Python 2 trove classifier | from setuptools import setup
try:
readme = open("README.rst")
long_description = str(readme.read())
finally:
readme.close()
setup(name='itolapi',
version='1.1.2',
description='API for interacting with itol.embl.de',
long_description=long_description,
url='http://github.com/albertyw... | from setuptools import setup
try:
readme = open("README.rst")
long_description = str(readme.read())
finally:
readme.close()
setup(name='itolapi',
version='1.1.2',
description='API for interacting with itol.embl.de',
long_description=long_description,
url='http://github.com/albertyw... |
Remove repositoryUrl as a parameter in comment | <?php
namespace Accompli\Chrono\Adapter;
/**
* AdapterInterface.
*
* @author Niels Nijens <nijens.niels@gmail.com>
*/
interface AdapterInterface
{
/**
* Returns true when the adapter supports the repository URL.
*
* @return bool
*/
public function supportsRepository();
/**
* ... | <?php
namespace Accompli\Chrono\Adapter;
/**
* AdapterInterface.
*
* @author Niels Nijens <nijens.niels@gmail.com>
*/
interface AdapterInterface
{
/**
* Returns true when the adapter supports the repository URL.
*
* @param string $repositoryUrl
*
* @return bool
*/
public func... |
Return appropriate error from getWidth() | package gohr
import (
"fmt"
"log"
"os"
"golang.org/x/crypto/ssh/terminal"
)
// getWidth gets number of width of terminal from crypto subdirectory ssh/terminal
func getWidth() (int, error) {
w, _, err := terminal.GetSize(int(os.Stdout.Fd()))
if err != nil {
return -1, err
}
return w, nil
}
// Draw fills a ... | package gohr
import (
"fmt"
"os"
"golang.org/x/crypto/ssh/terminal"
)
//get number of columns of terminal from crypto subdirectory ssh/terminal
func getCols() int {
c, _, err := terminal.GetSize(int(os.Stdout.Fd()))
if err != nil {
panic(err)
}
return c
}
// DrawHr fills a row with '#' by default (if no ar... |
Remove redundant class loader register call | <?php
/*
* This file is part of Evenement.
*
* Copyright (c) 2011 Igor Wiedler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the ... | <?php
/*
* This file is part of Evenement.
*
* Copyright (c) 2011 Igor Wiedler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the ... |
Bump flask from 0.10.1 to 1.0
Bumps [flask](https://github.com/pallets/flask) from 0.10.1 to 1.0.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/0.10.1...1.0)
---
updated-dependenci... | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="myapp",
version='0.0.1-dev',
description='My Awesome Application',
author='**INSERT_AUTHOR_NAME**',
author_email='**INSERT_AUTHOR_EMAIL**',
packages=[
'myapp',
'myapp.blueprints'
],
url='https://www.gith... | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="myapp",
version='0.0.1-dev',
description='My Awesome Application',
author='**INSERT_AUTHOR_NAME**',
author_email='**INSERT_AUTHOR_EMAIL**',
packages=[
'myapp',
'myapp.blueprints'
],
url='https://www.gith... |
Refactor and complement yeoman.test.createGenerator tests | /*global it, describe, before, beforeEach */
var util = require('util');
var assert = require('assert');
var yeoman = require('..');
var helpers = yeoman.test;
describe('yeoman.test', function () {
'use strict';
beforeEach(function () {
var self = this;
this.StubGenerator = function (args, options) {
... | /*global it, describe, before, beforeEach */
var util = require('util');
var assert = require('assert');
var generators = require('..');
var helpers = require('../').test;
describe('yeoman.generators.test', function () {
'use strict';
var Unicorn;
beforeEach(function () {
var self = this;
Unicorn = fun... |
Remove IE10 specific Spice file | //= require jquery
//= require spice-html5-bower
//= require_tree ../locale
//= require gettext/all
$(function() {
var host = window.location.hostname;
var encrypt = window.location.protocol === 'https:';
var port = encrypt ? 443 : 80;
if (window.location.port) {
port = window.location.port;
}
$('#ctr... | //= require jquery
//= require spice-html5-bower/spiceHTML5/spicearraybuffer
//= require spice-html5-bower
//= require_tree ../locale
//= require gettext/all
$(function() {
var host = window.location.hostname;
var encrypt = window.location.protocol === 'https:';
var port = encrypt ? 443 : 80;
if (window.locati... |
Allow dashes in proposal kind slugs
We can see from the setting PROPOSAL_FORMS that at least one proposal kind,
Sponsor Tutorial, has a slug with a dash in it: sponsor-tutorial. Yet the
URL pattern for submitting a proposal doesn't accept dashes in the slug.
Fix it. | from django.conf.urls import patterns, url
urlpatterns = patterns("symposion.proposals.views",
url(r"^submit/$", "proposal_submit", name="proposal_submit"),
url(r"^submit/([\w-]+)/$", "proposal_submit_kind", name="proposal_submit_kind"),
url(r"^(\d+)/$", "proposal_detail", name="proposal_detail"),
url... | from django.conf.urls.defaults import *
urlpatterns = patterns("symposion.proposals.views",
url(r"^submit/$", "proposal_submit", name="proposal_submit"),
url(r"^submit/(\w+)/$", "proposal_submit_kind", name="proposal_submit_kind"),
url(r"^(\d+)/$", "proposal_detail", name="proposal_detail"),
url(r"^(\... |
Fix handling of image tag sources | var performImage = function() {
var t=[];
function prepareString(withUrl) {
return '<a href="' + withUrl + '"><img title="'+ withUrl +'" src="' + withUrl + '"></a>';
}
// Image tags are the easiest to do. Loop thru the set, and pull up the images out
Array.prototype.slice.call(document.getE... | var performImage = function() {
var t=[];
function prepareString(withUrl) {
return '<a href="' + withUrl + '"><img title="'+ withUrl +'" src="' + withUrl + '"></a>';
}
// Image tags are the easiest to do. Loop thru the set, and pull up the images out
Array.prototype.slice.call(document.getE... |
Add another class to Quote block for consistency
Heading block has an analogous version of this, so added here too for consistency. | /*
Block Quote
*/
SirTrevor.Blocks.Quote = (function(){
var template = _.template([
'<blockquote class="st-required st-text-block st-text-block--quote" contenteditable="true"></blockquote>',
'<label class="st-input-label"> <%= i18n.t("blocks:quote:credit_field") %></label>',
'<input maxlength="140" na... | /*
Block Quote
*/
SirTrevor.Blocks.Quote = (function(){
var template = _.template([
'<blockquote class="st-required st-text-block" contenteditable="true"></blockquote>',
'<label class="st-input-label"> <%= i18n.t("blocks:quote:credit_field") %></label>',
'<input maxlength="140" name="cite" placeholder... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.