text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Increase decimal size to 5
Increase decimal size to 5 places | <?php
/**
* Adds automatic geocoding to a {@link Addressable} object. Uses the Google
* Maps API to save latitude and longitude on write.
*
* @package silverstripe-addressable
*/
class Geocodable extends DataExtension {
private static $db = array(
'Lat' => 'Decimal(9,5)',
'Lng' => 'Decimal(9,5)'
);
public... | <?php
/**
* Adds automatic geocoding to a {@link Addressable} object. Uses the Google
* Maps API to save latitude and longitude on write.
*
* @package silverstripe-addressable
*/
class Geocodable extends DataExtension {
private static $db = array(
'Lat' => 'Decimal',
'Lng' => 'Decimal'
);
public function ... |
Hide simple view by default
It is an example implementation, most actual applications would probably
use something with more features. | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple View"),
... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import SimpleView
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
def getMetaData():
return {
"plugin": {
"name": i18n_catalog.i18nc("@label", "Simple View"),
... |
Make settings test respect ES_INDEX_PREFIX. | from django.conf import settings
# The test system uses this to override settings in settings.py and
# settings_local.py with settings appropriate for testing.
# Make sure Celery is EAGER.
CELERY_ALWAYS_EAGER = True
# Make sure the doctypes (the keys) match the doctypes in ES_INDEXES
# in settings.py and settings_loc... | # The test system uses this to override settings in settings.py and
# settings_local.py with settings appropriate for testing.
# Make sure Celery is EAGER.
CELERY_ALWAYS_EAGER = True
# Make sure the doctypes (the keys) match the doctypes in ES_INDEXES
# in settings.py and settings_local.py.
ES_INDEXES = {'default': '... |
Use assert module for assertion | const assert = require('assert')
const path = require('path')
const Config = require('./models/config')
const util = require('./util')
function loadConfig (configPath) {
const options = {}
const base = options.base = path.dirname(configPath)
const config = loadConfigFile(configPath)
assert(config.taskFile, '"... | const assert = require('assert')
const path = require('path')
const Config = require('./models/config')
const util = require('./util')
function loadConfig (configPath) {
const options = {}
const base = options.base = path.dirname(configPath)
const config = loadConfigFile(configPath)
assert(config.taskFile, '"... |
Use UserPicture in contributors panel | import React from 'react';
import {creatorAttribute} from './util/ContributorsUtil';
import {contains} from './util/ContributorsUtil';
import UserPicture from '../../../common/UserPicture';
class ContributorItem extends React.Component {
render() {
return (
<div className="item">
<div c... | import React from 'react';
import {creatorAttribute} from './util/ContributorsUtil';
import {avatarPath} from './util/ContributorsUtil';
import {contains} from './util/ContributorsUtil';
class ContributorItem extends React.Component {
render() {
return (
<div className="item">
{/*<a clas... |
Increment the Java debugger minor version to 2.7
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138825830 | /**
* Copyright 2015 Google 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 appli... | /**
* Copyright 2015 Google 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 appli... |
Revert last commit, to avoid vulnerabilities | <?php
namespace App\Libs;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Libs\ViewResolver;
use Illuminate\Http\Request;
abstract class Control... | <?php
namespace App\Libs;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Libs\ViewResolver;
use Illuminate\Http\Request;
abstract class Control... |
Update regex and point to Jira | (() => {
const $title = document.querySelector('.js-issue-title');
if (!$title) {
return;
}
chrome.storage.local.get('inlineLinks', (options) => {
let title = $title.innerHTML.replace(/(<a[^>]+>|⬆︎|<\/a>)/g, '');
// TODO: Bring back multiple matches for the new format
// TODO: Format settings i... | (() => {
const $title = document.querySelector('.js-issue-title');
if (!$title) {
return;
}
chrome.storage.local.get('inlineLinks', (options) => {
let title = $title.innerHTML.replace(/(<a[^>]+>|⬆︎|<\/a>)/g, '');
title.match(/[a-zA-Z0-9-]+(?=[\],\s\d#]*\])/g).forEach((tag) => {
const url = `... |
Add the .query() method to the Nock noop | /**
* Copyright (c) 2015 IBM Cloudant, 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 ap... | /**
* Copyright (c) 2015 IBM Cloudant, 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 ap... |
TEST: Reduce waiting time before retrying to click yes/no option | 'use strict';
var util = require('util');
var common = require('../modules/common-functions');
exports.command = function(fields, value, callback) {
var client = this;
this.perform(function() {
var attemptedOnce = false;
function clickOption(field, value) {
var el = util.format('input[name="%s"][v... | 'use strict';
var util = require('util');
var common = require('../modules/common-functions');
exports.command = function(fields, value, callback) {
var client = this;
this.perform(function() {
var attemptedOnce = false;
function clickOption(field, value) {
var el = util.format('input[name="%s"][v... |
Update the classifier for all the tested versions of python | from distutils.core import setup
from setuptools import find_packages
with open('README.md') as fp:
long_description = fp.read()
setup(
name='sendwithus',
version='1.6.6',
author='sendwithus',
author_email='us@sendwithus.com',
packages=find_packages(),
scripts=[],
url='https://github.c... | from distutils.core import setup
from setuptools import find_packages
with open('README.md') as fp:
long_description = fp.read()
setup(
name='sendwithus',
version='1.6.6',
author='sendwithus',
author_email='us@sendwithus.com',
packages=find_packages(),
scripts=[],
url='https://github.c... |
Improve logic checking for `options.dest.root` | import { deepCollection } from './object'; // TODO NOPE
import { resourcePath } from './shared';
import path from 'path';
import { pathSatisfies, is } from 'ramda';
function getBaseUrl (resource, drizzleData) {
const options = drizzleData.options;
const destRoot = options.dest.root;
const destResource = options.... | import { deepCollection } from './object'; // TODO NOPE
import { resourcePath } from './shared';
import path from 'path';
function getBaseUrl (resource, drizzleData) {
const options = drizzleData.options;
const destRoot = options.dest.root;
const destResource = options.dest[
Object.keys(options.keys).find(
... |
Change deprecated method for changing moment's locale
Signed-off-by: Felipe Milani <6def120dcec8fcb28aed4723fac713cfff66d853@gmail.com> | // client entry point, imports all client code
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import { i18n } from 'meteor/universe:i18n';
import moment from 'moment';
// FIXME: importing this moment locale is causing a warning on browser's console
// without this import, setting moment's l... | // client entry point, imports all client code
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import { i18n } from 'meteor/universe:i18n';
import moment from 'moment';
// FIXME: importing this moment locale is causing a warning on browser's console
// without this import, setting moment's l... |
Reduce precision of floats in JSON
Due to a https://stackoverflow.com/questions/42981409/php7-1-json-encode-float-issue
Fixes #161 | <?php
ini_set( 'serialize_precision', -1 ); // https://stackoverflow.com/questions/42981409/php7-1-json-encode-float-issue
require_once ('mysql.php');
$benchID = $_GET["bench"];
$format = $_GET["format"];
$latitude = $_GET["latitude"];
$longitude = $_GET["longitude"];
$radius = $_GET["radius"];
if (null != $... | <?php
require_once ('mysql.php');
$benchID = $_GET["bench"];
$format = $_GET["format"];
$latitude = $_GET["latitude"];
$longitude = $_GET["longitude"];
$radius = $_GET["radius"];
if (null != $latitude && null != $longitude && null != $radius) {
$geojson = get_nearest_benches($latitude, $longitude, $radius);... |
Set moderated false after editing | <?php
namespace AppBundle\EventListener;
use AppBundle\Event\AddUserEditEvent;
use AppBundle\Model\UserManageableInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Doctrine\ORM\EntityManager;
use AppBundle\Entity\Item;
/**
* Class AddUserEditListener
*
* @packag... | <?php
namespace AppBundle\EventListener;
use AppBundle\Event\AddUserEditEvent;
use AppBundle\Model\UserManageableInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Doctrine\ORM\EntityManager;
use AppBundle\Entity\Item;
/**
* Class AddUserEditListener
*
* @packag... |
Support returning a promise from the transition handler so we can support delayed transitions | export const executeTransition = history => transitionData => {
if (transitionData) {
const method = transitionData.replace ? 'replace' : 'push';
history[method](transitionData);
}
};
export default (history, catchAllHandler) => next => (reducer, initialState) => {
const store = next(reducer, initialStat... | export default (history, catchAllHandler) => {
return next => (reducer, initialState) => {
const store = next(reducer, initialState);
return {
...store,
dispatch(action) {
const { type, meta } = action;
const transitionMetaFunc = meta ?
(meta.transition || catchAllHandle... |
Trim whitespace on extracted role ARNs | package saml2aws
import (
"fmt"
"strings"
)
// AWSRole aws role attributes
type AWSRole struct {
RoleARN string
PrincipalARN string
Name string
}
// ParseAWSRoles parses and splits the roles while also validating the contents
func ParseAWSRoles(roles []string) ([]*AWSRole, error) {
awsRoles := mak... | package saml2aws
import (
"fmt"
"strings"
)
// AWSRole aws role attributes
type AWSRole struct {
RoleARN string
PrincipalARN string
Name string
}
// ParseAWSRoles parses and splits the roles while also validating the contents
func ParseAWSRoles(roles []string) ([]*AWSRole, error) {
awsRoles := mak... |
Test average speed calculation by tracking sum and count separately | #!/usr/bin/python
import sys
import json
# Count average speeds for links
def main(locationdata_dictionary_file):
locationdata = {}
with open(locationdata_dictionary_file, "r") as dictionary_file:
locationdata = json.load(dictionary_file)
for input_line in sys.stdin:
data = json.loads(in... | #!/usr/bin/python
import sys
import json
# Count average speeds for links
def main(locationdata_dictionary_file):
locationdata = {}
with open(locationdata_dictionary_file, "r") as dictionary_file:
locationdata = json.load(dictionary_file)
for input_line in sys.stdin:
data = json.loads(in... |
Fix for LazyModel infinite recursion | class LazyModel(object):
"""
It's a helper class that is used in case you have model_class and object
primary key. You might need to use only object id.
If you try to access other fields of the model class then we will query the
database to get that object and provide you with any field and met... | class LazyModel(object):
"""
It's a helper class that is used in case you have model_class and object
primary key. You might need to use only object id.
If you try to access other fields of the model class then we will query the
database to get that object and provide you with any field and met... |
Update requirements for correct mysql-connector name | from setuptools import setup
datafiles = [('/etc', ['general_conf/bck.conf'])]
setup(
name='mysql-autoxtrabackup',
version='1.1',
packages=['general_conf', 'backup_prepare', 'partial_recovery', 'master_backup_script'],
py_modules = ['autoxtrabackup'],
url='https://github.com/ShahriyarR/MySQL-AutoX... | from setuptools import setup
datafiles = [('/etc', ['general_conf/bck.conf'])]
setup(
name='mysql-autoxtrabackup',
version='1.1',
packages=['general_conf', 'backup_prepare', 'partial_recovery', 'master_backup_script'],
py_modules = ['autoxtrabackup'],
url='https://github.com/ShahriyarR/MySQL-AutoX... |
Add script to reports views | <?php
class show extends Controller
{
function __construct()
{
if( ! $this->authorized())
{
redirect('auth/login');
}
}
function index()
{
$data = array();
$obj = new View();
$obj->view('dashboard/dashboard', $data);
}
function listing($which = '')
{
if($which)
{
$data['page'] = 'cl... | <?php
class show extends Controller
{
function __construct()
{
if( ! $this->authorized())
{
redirect('auth/login');
}
}
function index()
{
$data = array();
$obj = new View();
$obj->view('dashboard/dashboard', $data);
}
function listing($which = '')
{
if($which)
{
$data['page'] = 'cl... |
Add html plugin to production config | var webpack = require('webpack');
var loaders = require('./webpack.loaders');
var autoprefixer = require('autoprefixer');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var outpath = path.join(__dirname, "..", "app")
var node_modules = path.join(outpath, "node_modules")
module.exp... | var webpack = require('webpack');
var loaders = require('./webpack.loaders');
var autoprefixer = require('autoprefixer');
var path = require('path');
var outpath = path.join(__dirname, "..", "app")
var node_modules = path.join(outpath, "node_modules")
module.exports = {
target: "electron",
entry: {
app: `./... |
Fix whitespace issue in matrix assertion | import unittest
from matrix import Matrix
class MatrixTest(unittest.TestCase):
def test_extract_a_row(self):
matrix = Matrix("1 2\n10 20")
self.assertEqual([1, 2], matrix.rows[0])
def test_extract_same_row_again(self):
matrix = Matrix("9 7\n8 6")
self.assertEqual([9, 7], matr... | import unittest
from matrix import Matrix
class MatrixTest(unittest.TestCase):
def test_extract_a_row(self):
matrix = Matrix("1 2\n10 20")
self.assertEqual([1, 2], matrix.rows[0])
def test_extract_same_row_again(self):
matrix = Matrix("9 7\n8 6")
self.assertEqual([9, 7], matr... |
Set development status to stable. | #!/usr/bin/env python
from setuptools import setup
from setuputils import find_version, read
setup(
name='astor',
version=find_version('astor/__init__.py'),
description='Read/rewrite/write Python ASTs',
long_description=read('README.rst'),
author='Patrick Maupin',
author_email='pmaupin@gmail... | #!/usr/bin/env python
from setuptools import setup
from setuputils import find_version, read
setup(
name='astor',
version=find_version('astor/__init__.py'),
description='Read/rewrite/write Python ASTs',
long_description=read('README.rst'),
author='Patrick Maupin',
author_email='pmaupin@gmail... |
Stop getting videos every time script starts | import os
from death_extractor import youtube as yt
from death_extractor import set_interval
from death_extractor import extract_and_upload
def death_as_a_service(vid_path = 'vids', post_interval=3600*2, search_interval=3600*6, dl_interval=3600*3, max_downloads=4, to_imgur=True, to_tumblr=True):
"""Run periodic ... | from death_extractor import youtube as yt
from death_extractor import set_interval
from death_extractor import extract_and_upload
def death_as_a_service(vid_path = 'vids', post_interval=3600*2, search_interval=3600*12, dl_interval=3600*6, max_downloads=5, to_imgur=True, to_tumblr=True):
"""Run periodic search/do... |
Fix desktop version for crash in situation when no parameters are given. | package com.letscode.lcg;
import java.util.Random;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
... | package com.letscode.lcg;
import java.util.Random;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
... |
Update aiohttp version constraint to <3.5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
__name__ == '__main__' and setup(name='aiohttp-json-rpc',
version='0.11.1',
author='Florian Scherf',
url='https://github.com/pengutronix/aiohttp-json-rpc/',
author_email='f.scherf@pengutronix.de',
l... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
__name__ == '__main__' and setup(name='aiohttp-json-rpc',
version='0.11.1',
author='Florian Scherf',
url='https://github.com/pengutronix/aiohttp-json-rpc/',
author_email='f.scherf@pengutronix.de',
l... |
Refactor some duplicate code into a checkSyntax function which isn't as noisy | <?php
require_once('tests/php/base.php');
class SyntaxTests extends UnitTestCase {
public function checkSyntax($file) {
$output = exec("php -l $file", $array, $code);
$this->assertTrue($code == 0, $output);
}
public function testFrameworkSyntax() {
$test_files = glob("{framework/... | <?php
require_once('tests/php/base.php');
class SyntaxTests extends UnitTestCase {
public function testFrameworkSyntax() {
$test_files = glob("{framework/php/cashmusic.php,framework/php/*/*.php,framework/php/classes/*/*.php}", GLOB_BRACE);
foreach ($test_files as $file){
system("php -l... |
Fix bad dialect : mysql -> postgres | module.exports = {
development: {
username: "cyrilcanete",
password: null,
database: "cyrilcanete",
host: "localhost",
port: "5432",
dialect: "postgres",
},
test: {
username: "root",
password: null,
database: "database_test",
host: "127.0.0.1",
dialect: "postgres",
},... | module.exports = {
development: {
username: "cyrilcanete",
password: null,
database: "cyrilcanete",
host: "localhost",
port: "5432",
dialect: "postgres",
},
test: {
username: "root",
password: null,
database: "database_test",
host: "127.0.0.1",
dialect: "mysql",
},
... |
Add success message to clear-compiled command | <?php
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
class ClearCompiledCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'clear-compiled';
/**
* The console command description.
*
* @var string
... | <?php
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
class ClearCompiledCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'clear-compiled';
/**
* The console command description.
*
* @var string
... |
Document that the test:features Gulp task also supports tags. | // Use the gulp-help plugin which defines a default gulp task
// which lists what tasks are available.
var gulp = require('gulp-help')(require('gulp'));
// Sequential Gulp tasks
var runSequence = require('run-sequence').use(gulp);
var cucumber = require('gulp-cucumber');
// Parse any command line arguments ignoring
... | // Use the gulp-help plugin which defines a default gulp task
// which lists what tasks are available.
var gulp = require('gulp-help')(require('gulp'));
// Sequential Gulp tasks
var runSequence = require('run-sequence').use(gulp);
var cucumber = require('gulp-cucumber');
// Parse any command line arguments ignoring
... |
Fix emptying empty deploymentBucket bug | 'use strict';
const BbPromise = require('bluebird');
module.exports = {
emptyDeploymentBucket() {
return BbPromise.bind(this)
.then(this.getObjectsToRemove)
.then(this.removeObjects);
},
getObjectsToRemove() {
const params = {
bucket: this.serverless.service.provider.deploymentBucketN... | 'use strict';
const BbPromise = require('bluebird');
module.exports = {
emptyDeploymentBucket() {
return BbPromise.bind(this)
.then(this.getObjectsToRemove)
.then(this.removeObjects);
},
getObjectsToRemove() {
const params = {
bucket: this.serverless.service.provider.deploymentBucketN... |
Format and update the secure ping url | angular.module('sample.home', [
'auth0'
])
.controller('HomeCtrl', function HomeController($scope, auth, $http,
$location, store) {
$scope.auth = auth;
$scope.callApi = function() {
// Just call the API as you'd do using $http
$http({
url: '/secured/ping',
method: 'GET'... | angular.module( 'sample.home', [
'auth0'
])
.controller( 'HomeCtrl', function HomeController( $scope, auth, $http, $location, store ) {
$scope.auth = auth;
$scope.callApi = function() {
// Just call the API as you'd do using $http
$http({
url: 'http://localhost:3001/secured/ping',
method: 'GET... |
Remove unneeded shebang line that was triggering some linters. | # Copyright 2016 The Meson development team
# 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 ... | #!/usr/bin/env python3
# Copyright 2016 The Meson development team
# 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 appl... |
Add integration test for recording service form | (function() {
window.shared || (window.shared = {});
var Simulate = React.addons.TestUtils.Simulate;
/* Sugar for common test setup and interactions */
var SpecSugar = window.shared.SpecSugar = {
withTestEl: function(description, testsFn) {
return describe(description, function() {
beforeEa... | (function() {
window.shared || (window.shared = {});
var Simulate = React.addons.TestUtils.Simulate;
/* Sugar for common test setup and interactions */
var SpecSugar = window.shared.SpecSugar = {
withTestEl: function(description, testsFn) {
return describe(description, function() {
beforeEa... |
Set the fork-join pool globally to prevent DOS-vulnerability | package voot.oauth;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.Collectors;
import com.google.common.base.Preconditions;
import voot.oauth.valueobject.Group;
public class ExternalGroupsQuerier {... | package voot.oauth;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.Collectors;
import com.google.common.base.Preconditions;
import voot.oauth.valueobject.Group;
public class ExternalGroupsQuerier {... |
Add error listener to test | var patch = require("../lib/patch")
, net = require("net")
, https = require("https")
, fs = require("fs");
// This is probably THE most ugliest code I've ever written
var responseRegExp = /^([0-9a-z-]{36}) (.*)$/i;
var host = net.createServer(function(socket) {
var i = 0;
socket.setEncoding("utf8");
socke... | var patch = require("../lib/patch")
, net = require("net")
, https = require("https")
, fs = require("fs");
// This is probably THE most ugliest code I've ever written
var responseRegExp = /^([0-9a-z-]{36}) (.*)$/i;
var host = net.createServer(function(socket) {
var i = 0;
socket.setEncoding("utf8");
socke... |
Reduce the size of log_name so it fits within mysql's limit. |
from database import db
from conversions import datetime_from_str
class LogEntry(db.Model):
id = db.Column(db.Integer, primary_key=True)
timestamp = db.Column(db.DateTime, index=True)
server = db.Column(db.String(100), index=True)
log_name = db.Column(db.String(255), index=True)
message = db.Col... |
from database import db
from conversions import datetime_from_str
class LogEntry(db.Model):
id = db.Column(db.Integer, primary_key=True)
timestamp = db.Column(db.DateTime, index=True)
server = db.Column(db.String(100), index=True)
log_name = db.Column(db.String(760), index=True)
message = db.Col... |
Convert HashSet to LinkedHashSet to maintain FindCommand keyword sequence | package seedu.tache.logic.parser;
import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.tache.logic.parser.CliSyntax.KEYWORDS_ARGS_FORMAT;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.regex.Matcher;
import seedu.tache.lo... | package seedu.tache.logic.parser;
import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.tache.logic.parser.CliSyntax.KEYWORDS_ARGS_FORMAT;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import seedu.tache.logic.co... |
Bump requests from 2.5.1 to 2.20.0
Bumps [requests](https://github.com/requests/requests) from 2.5.1 to 2.20.0.
- [Release notes](https://github.com/requests/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/requests/requests/compare/v2.5.1...v2.20.... | #!/usr/bin/env python
from setuptools import setup
setup(
name='Scrapper',
version='0.9.5',
url='https://github.com/Alkemic/scrapper',
license='MIT',
author='Daniel Alkemic Czuba',
author_email='alkemic7@gmail.com',
description='Scrapper is small, Python web scraping library',
py_modul... | #!/usr/bin/env python
from setuptools import setup
setup(
name='Scrapper',
version='0.9.5',
url='https://github.com/Alkemic/scrapper',
license='MIT',
author='Daniel Alkemic Czuba',
author_email='alkemic7@gmail.com',
description='Scrapper is small, Python web scraping library',
py_modul... |
Test dependencies: On Python 2.5, require Jinja 2.6 | #! /usr/bin/python
import platform
import subprocess
import sys
def _execute(*args, **kwargs):
result = subprocess.call(*args, **kwargs)
if result != 0:
sys.exit(result)
if __name__ == '__main__':
python_version = platform.python_version()
deps = [
"execnet",
"nose",
"... | #! /usr/bin/python
import platform
import subprocess
import sys
def _execute(*args, **kwargs):
result = subprocess.call(*args, **kwargs)
if result != 0:
sys.exit(result)
if __name__ == '__main__':
python_version = platform.python_version()
deps = [
"execnet",
"Jinja2",
... |
Check ReportWriter makes parent directories. | package com.googlecode.jslint4java.maven;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import com.googlecode.jslint4java.formatter.JSLintResultFormatter;
import com.googlecode.j... | package com.googlecode.jslint4java.maven;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import com.googlecode.jslint4java.formatter.JSLintResultFormatter;
import com.googlecode.j... |
Fix name of AnimationController unit test. | /*global defineSuite*/
defineSuite([
'Core/AnimationController',
'Core/Clock'
], function(
AnimationController,
Clock) {
"use strict";
/*global it,expect*/
it('construct with default clock', function() {
var clock = new Clock();
... | /*global defineSuite*/
defineSuite([
'Core/Clock',
'Core/AnimationController'
], function(
Clock,
AnimationController) {
"use strict";
/*global it,expect*/
it('construct with default clock', function() {
var clock = new Clock();
... |
Add `ValueWasNil` test message function | package testhelpers
import "fmt"
const (
// ERROR MESSAGEs - Used as first argument in Error() call
EM_NEED_ERR = "Should have gotten an error, but didn't"
EM_UN_ERR = "Unexpected Error"
// ERROR STRINGS - embed in
// Could use a VAR block, fmt and %8s, but this is just as easy
ES_EXPECTED = "\nexpected:"
E... | package testhelpers
import "fmt"
const (
// ERROR MESSAGEs - Used as first argument in Error() call
EM_NEED_ERR = "Should have gotten an error, but didn't"
EM_UN_ERR = "Unexpected Error"
// ERROR STRINGS - embed in
// Could use a VAR block, fmt and %8s, but this is just as easy
ES_EXPECTED = "\nexpected:"
E... |
Set additional fields when mapping inputs and outputs
This will reduce the risk of unnecessary lazy fetching | from sevenbridges.models.file import File
def map_input_output(item, api):
"""
Maps item to appropriate sevebridges object.
:param item: Input/Output value.
:param api: Api instance.
:return: Mapped object.
"""
if isinstance(item, list):
return [map_input_output(it, api) for it in ... | from sevenbridges.models.file import File
def map_input_output(item, api):
"""
Maps item to appropriate sevebridges object.
:param item: Input/Output value.
:param api: Api instance.
:return: Mapped object.
"""
if isinstance(item, list):
return [map_input_output(it, api) for it in ... |
Remove "The Ranch" full title; Trakt search shows it first now | 'use strict';
/* This was necessary to priorize Star Wars: The Clone Wars (2008) over Star Wars: Clone Wars (2003).
I left this object because it could be useful for other movies/shows */
var fullTitles = {
'Star Wars: The Clone Wars': '"Star Wars: The Clone Wars"',
'The Office (U.S.)': 'The Office (US)',
'The... | 'use strict';
/* This was necessary to priorize Star Wars: The Clone Wars (2008) over Star Wars: Clone Wars (2003).
I left this object because it could be useful for other movies/shows */
var fullTitles = {
'Star Wars: The Clone Wars': '"Star Wars: The Clone Wars"',
'The Office (U.S.)': 'The Office (US)',
'The... |
Revert "Revert "Cleans up split_response""
This reverts commit c3c62feb9fbd8b7ff35d70eaaa5fecfb2093dbb0. | from motobot import command, Notice, split_response, IRCBot
from collections import defaultdict
def filter_plugins(plugins, userlevel):
return map(
lambda plugin: (plugin.arg.trigger, plugin.func), filter(
lambda plugin: plugin.type == IRCBot.command_plugin and
plugi... | from motobot import command, Notice, split_response, IRCBot
@command('commands')
def commands_command(bot, database, context, message, args):
userlevel = bot.get_userlevel(context.channel, context.nick)
valid_command = lambda plugin: plugin.type == IRCBot.command_plugin \
and plugin.level <= userleve... |
Add note to spendingHabits to check if date picker works | import React, { Component } from 'react';
import moment from 'moment';
import Input from './Input';
export default class SpendingHabits extends Component {
constructor() {
super();
this.state = {
date: '',
}
}
updateDate(value) {
this.setState({ date: value })
}
getCurrentExpenses(d... | import React, { Component } from 'react';
import moment from 'moment';
import Input from './Input';
export default class SpendingHabits extends Component {
constructor() {
super();
this.state = {
date: '',
}
}
updateDate(value) {
this.setState({ date: value })
}
getCurrentExpenses(d... |
Make karma pick up only PhantomJS when on Travis CI | module.exports = function(config) {
var browsers = process.env.TRAVIS
? [ 'PhantomJS' ]
: [ 'PhantomJS', 'Chrome', 'Firefox', 'Safari' ];
config.set({
frameworks: [ 'hydro' ],
singleRun: true,
browsers: browsers,
files: [
'test/*.js'
],
hydro: {
before: [
'build/... | module.exports = function(config) {
config.set({
frameworks: [ 'hydro' ],
singleRun: true,
browsers: [
'PhantomJS',
'Chrome',
'Firefox',
'Safari'
],
files: [
'test/*.js'
],
hydro: {
before: [
'build/build.js',
]
},
client: {
h... |
Remove template callback from template as it does not exist | /* Has access to the following protected methods
$config(NAME): Retrieves the template config named NAME
$forms(NAME): Retrieves the forms templates config named NAME (Shortcut for $config("forms")[NAME])
$views(NAME): Retrieves the views templates config named NAME (Shortcut for $config("views")[NAME])
... | /* Has access to the following protected methods
$config(NAME): Retrieves the template config named NAME
$forms(NAME): Retrieves the forms templates config named NAME (Shortcut for $config("forms")[NAME])
$views(NAME): Retrieves the views templates config named NAME (Shortcut for $config("views")[NAME])
... |
Use no protocol to fetch Lato font
When using https://example.com, the welcome page design looks off due to fetching the Lato font on http://.
Ref: https://github.com/laravel/framework/issues/7159
Better yet, instead of https:// or http://, // | <html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: c... | <html>
<head>
<link href='http://fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-ali... |
Add file source and subjectID to processing exceptions | import pandas
import typing
def process_files(file_iterator: typing.Iterator[typing.IO], processor: typing.Callable) -> pandas.DataFrame:
def get_frames():
for file in file_iterator:
source = getattr(file, 'name', None)
subject_id = getattr(file, 'cpgintegrate_subject_id', None)
... | import pandas
import traceback
import typing
def process_files(file_iterator: typing.Iterator[typing.IO], processor: typing.Callable) -> pandas.DataFrame:
def get_frames():
for file in file_iterator:
df = processor(file)
yield (df
.assign(Source=getattr(file, 'n... |
Fix the issue generation for taster css | 'use strict';
var argv = require('yargs').argv;
var path = require('path');
var mainBowerFiles = require('main-bower-files');
module.exports = function(gulp, plugins, config, options) {
return function() {
options = options || { dest: true };
if (options.dest === undefined) {
options.dest = true;
... | 'use strict';
var argv = require('yargs').argv;
var path = require('path');
var mainBowerFiles = require('main-bower-files');
module.exports = function(gulp, plugins, config, options) {
return function() {
options = options || { dest: true };
if (options.dest === undefined) {
options.dest = true;
... |
Add property status in Prepare |
class Prepare(object):
"""
Prepare the champions for the battle!
Usage:
hero = Prepare(name="Aragorn", base_attack=100, base_hp=100)
or like this:
aragorn = {"name": "Aragorn", "base_attack": 100, "base_hp": 100}
hero = Prepare(**aragorn)
"""
def __init__(self, name, b... |
class Prepare(object):
"""
Prepare the champions for the battle!
Usage:
hero = Prepare(name="Aragorn", base_attack=100, base_hp=100)
or like this:
aragorn = {"name": "Aragorn", "base_attack": 100, "base_hp": 100}
hero = Prepare(**aragorn)
"""
def __init__(self, name, b... |
:art: Add a new line after variable declaration | 'use strict';
const fs = require('fs');
class Storage {
/**
* Constructor
* @param {string} file
*/
constructor(file) {
this.data = null;
this.file = file;
}
/**
* Load the storage file
*/
load() {
if (this.data !== null) {
return;
}
if (!fs.existsSync(this.file)) {... | 'use strict';
const fs = require('fs');
class Storage {
/**
* Constructor
* @param {string} file
*/
constructor(file) {
this.data = null;
this.file = file;
}
/**
* Load the storage file
*/
load() {
if (this.data !== null) {
return;
}
if (!fs.existsSync(this.file)) {... |
Add option in snapshot generator to use renderer from options if passed | import renderer from 'react-test-renderer';
import shallow from 'react-test-renderer/shallow';
import 'jest-specific-snapshot';
import { getSnapshotFileName } from './utils';
function getRenderedTree(story, context, options) {
const currentRenderer = options.renderer || renderer.create;
const storyElement = story.... | import renderer from 'react-test-renderer';
import shallow from 'react-test-renderer/shallow';
import 'jest-specific-snapshot';
import { getSnapshotFileName } from './utils';
function getRenderedTree(story, context, options) {
const storyElement = story.render(context);
return renderer.create(storyElement, options... |
Update to match new format for param.txt. | import unittest
import cryptosite
import saliweb.test
import saliweb.backend
import os
class JobTests(saliweb.test.TestCase):
"""Check custom CryptoSite Job class"""
def test_run_first_stepok(self):
"""Test successful run method, first step"""
j = self.make_test_job(cryptosite.Job, 'RUNNING')
... | import unittest
import cryptosite
import saliweb.test
import saliweb.backend
import os
class JobTests(saliweb.test.TestCase):
"""Check custom CryptoSite Job class"""
def test_run_first_stepok(self):
"""Test successful run method, first step"""
j = self.make_test_job(cryptosite.Job, 'RUNNING')
... |
Use program_name instead of script file name in macOS menu | '''
Main runner entry point for Gooey.
'''
import wx
# wx.html and wx.xml imports required here to make packaging with
# pyinstaller on OSX possible without manually specifying `hidden_imports`
# in the build.spec
import wx.html
import wx.xml
import wx.richtext # Need to be imported before the wx.App object... | '''
Main runner entry point for Gooey.
'''
import wx
# wx.html and wx.xml imports required here to make packaging with
# pyinstaller on OSX possible without manually specifying `hidden_imports`
# in the build.spec
import wx.html
import wx.xml
import wx.richtext # Need to be imported before the wx.App object... |
Load file if params are not present | 'use strict'
var fs = require('fs')
var path = require('path')
var existFile = require('exists-file')
var minimistPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_modules', 'minimist')
var minimist = require(minimistPath)
var trimNewlinesPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_... | 'use strict'
var fs = require('fs')
var path = require('path')
var existFile = require('exists-file')
var minimistPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_modules', 'minimist')
var minimist = require(minimistPath)
var trimNewlinesPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_... |
Fix bug in job run get() method. | 'use strict';
import JobClient from '../client';
let apiClient;
class DrushIORun {
constructor(client, project, job, identifier, data = {}) {
apiClient = client;
this.project = project;
this.job = job || new JobClient(client, project, data.job.id);
this.identifier = identifier;
this.data = dat... | 'use strict';
import JobClient from '../client';
let apiClient;
class DrushIORun {
constructor(client, project, job, identifier, data = {}) {
apiClient = client;
this.project = project;
this.job = job || new JobClient(client, project, data.job.id);
this.identifier = identifier;
this.data = dat... |
Read long description from README.rst | # -*- encoding: UTF-8 -*
from setuptools import setup
with open('README.rst') as fp:
README = fp.read()
setup(
name='steeve',
version='0.1',
author='Sviatoslav Abakumov',
author_email='dust.harvesting@gmail.com',
description=u'Tiny GNU Stow–based package manager',
long_description=README,
... | # -*- encoding: UTF-8 -*
from setuptools import setup
with open('README.md') as fp:
README = fp.read()
setup(
name='steeve',
version='0.1',
author='Sviatoslav Abakumov',
author_email='dust.harvesting@gmail.com',
description=u'Tiny GNU Stow–based package manager',
long_description=README,
... |
Use py-bcrypt version 0.4 to fix a security issue with py-bcrypt | from setuptools import setup, find_packages
setup(
name="CoinboxMod-auth",
version="0.1",
packages=find_packages(),
zip_safe=True,
namespace_packages=['cbpos', 'cbpos.mod'],
include_package_data=True,
install_requires=['sqlalchemy>=0.7','PyDispatcher>=2.0.3','Pr... | from setuptools import setup, find_packages
setup(
name="CoinboxMod-auth",
version="0.1",
packages=find_packages(),
zip_safe=True,
namespace_packages=['cbpos', 'cbpos.mod'],
include_package_data=True,
install_requires=['sqlalchemy>=0.7','PyDispatcher>=2.0.3','Pr... |
Add the root dir variable | from setuptools import setup, find_packages
import codecs
import os
import re
root_dir = os.path.abspath(os.path.dirname(__file__))
PACKAGE = 'hackernews_scraper'
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
package_components = package_name.split('.')
i... | from setuptools import setup, find_packages
import codecs
import os
import re
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
package_components = package_name.split('.')
init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
with co... |
Fix for empty front matter | <?php
namespace Spatie\YamlFrontMatter;
use Illuminate\Support\Arr;
class Document
{
protected $matter;
protected $body;
public function __construct($matter = [], string $body)
{
$this->matter = is_array($matter) ? $matter : [];
$this->body = $body;
}
public function matter(... | <?php
namespace Spatie\YamlFrontMatter;
use Illuminate\Support\Arr;
class Document
{
protected $matter;
protected $body;
public function __construct(array $matter, string $body)
{
$this->matter = $matter;
$this->body = $body;
}
public function matter(string $key = null, $def... |
Reset err after call to GetDocument() | package hammock
import (
"fmt"
"github.com/mikebell-org/go-couchdb"
)
type CouchDB struct {
couchdb.CouchDB
}
func Database(host, database, username, password string) (*CouchDB, error) {
db, err := couchdb.Database(host, database, username, password)
return &CouchDB{*db}, err
}
func Sync(db *CouchDB, path s... | package hammock
import (
"fmt"
"github.com/mikebell-org/go-couchdb"
)
type CouchDB struct {
couchdb.CouchDB
}
func Database(host, database, username, password string) (*CouchDB, error) {
db, err := couchdb.Database(host, database, username, password)
return &CouchDB{*db}, err
}
func Sync(db *CouchDB, path s... |
Make camera interaction more sensitive
(refs #12095) | #pylint: disable=missing-docstring
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/... | #pylint: disable=missing-docstring
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/... |
Add --upgrade to pip install in Fabfile | from fabric import task
CODE_DIR = '~/django-projects/test-osale/foodbank-campaign/src'
# for FreeBSD compatibility
SHELL = '/bin/sh -c'
@task
def deploy(c):
c.shell = SHELL
with c.cd(CODE_DIR):
pull_changes(c)
with c.prefix('. ../venv/bin/activate'):
update_dependencies(c)
... | from fabric import task
CODE_DIR = '~/django-projects/test-osale/foodbank-campaign/src'
# for FreeBSD compatibility
SHELL = '/bin/sh -c'
@task
def deploy(c):
c.shell = SHELL
with c.cd(CODE_DIR):
pull_changes(c)
with c.prefix('. ../venv/bin/activate'):
update_dependencies(c)
... |
Fix portflofio child template view | <?php
global $post, $MODEL;
/** Polylang class */
$langIds = PLL()->model->post->get_translations(get_the_ID());
$ContentType = $MODEL->getSettings('post_type', ['page_id', $langIds['en']]);
$args = [ 'post_type' => $ContentType, 'orderby' => 'menu_order', 'posts_per_page' => -1];
$ContentQuery = new WP_Query( $args );... | <?php
global $post, $MODEL;
$ContentType = $MODEL->getSettings('post_type', ['page_id', $post->ID]);
$args = [ 'post_type' => $ContentType, 'orderby' => 'menu_order', 'posts_per_page' => -1];
$ContentQuery = new WP_Query( $args );
if ($ContentQuery->have_posts( )):
$index = 0;
while ( $ContentQuery->have_posts( ) )... |
Bring coverage back to 100%
All calls to reraise() are in branches where value is truthy, so we
can't reach that code. | from types import TracebackType
from typing import NoReturn, Optional, Type, Union
def to_bytes(
x: Union[str, bytes], encoding: Optional[str] = None, errors: Optional[str] = None
) -> bytes:
if isinstance(x, bytes):
return x
elif not isinstance(x, str):
raise TypeError(f"not expecting typ... | from types import TracebackType
from typing import NoReturn, Optional, Type, Union
def to_bytes(
x: Union[str, bytes], encoding: Optional[str] = None, errors: Optional[str] = None
) -> bytes:
if isinstance(x, bytes):
return x
elif not isinstance(x, str):
raise TypeError(f"not expecting typ... |
Remove add_view and add form for the hole admin | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = Maintenanc... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = MaintenanceService
search_fields = ("sche... |
Reduce weight of ugly Promise constructor | const compile = require("truffle-compile");
class DebugCompiler {
constructor(config) {
this.config = config;
}
async compile() {
//we need to set up a config object for the compiler.
//it's the same as the existing config, but we turn on quiet.
//unfortunately, we don't have Babel here, so clon... | const compile = require("truffle-compile");
class DebugCompiler {
constructor(config) {
this.config = config;
}
async compile() {
const { contracts, files } = await new Promise((accept, reject) => {
//we need to set up a config object for the compiler.
//it's the same as the existing config,... |
DeprecationWarning: Use of salt.utils.which detected. This function has been moved to salt.utils.path.which as of Salt 2018.3.0 | # -*- coding: utf-8 -*-
import salt.utils
import salt.modules.cmdmod
__salt__ = {'cmd.run': salt.modules.cmdmod._run_quiet}
def osquerygrain():
'''
Return osquery version in grain
'''
# Provides:
# osqueryversion
# osquerybinpath
grains = {}
option = '--version'
# Prefer our... | # -*- coding: utf-8 -*-
import salt.utils
import salt.modules.cmdmod
__salt__ = {'cmd.run': salt.modules.cmdmod._run_quiet}
def osquerygrain():
'''
Return osquery version in grain
'''
# Provides:
# osqueryversion
# osquerybinpath
grains = {}
option = '--version'
# Prefer our... |
Split copy part to a function | function copyToClipboard(str){
'use strict';
var textArea = document.createElement('textarea');
document.body.appendChild(textArea);
textArea.value = str;
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
}
window.addEventListener('load', function(){
'use strict';
... | window.addEventListener('load', function(){
'use strict';
// Get elements
var title = document.getElementById('page_title');
var url = document.getElementById('page_url');
var copyTitle = document.getElementById('copy_title');
var copyUrl = document.getElementById('copy_url');
// Get tab info
chrome.t... |
Check whether there is a format given (this must be checked for validity though). | # django imports
from django.utils.translation import ugettext_lazy as _
from django.db import models
# lfs imports
from lfs.plugins import OrderNumberGenerator as Base
class OrderNumberGenerator(Base):
"""Generates order numbers and saves the last one.
**Attributes:**
id
The primary key of the... | # django imports
from django.utils.translation import ugettext_lazy as _
from django.db import models
# lfs imports
from lfs.plugins import OrderNumberGenerator as Base
class OrderNumberGenerator(Base):
"""Generates order numbers and saves the last one.
**Attributes:**
id
The primary key of the... |
Fix command fix:participant not saving correctly | <?php
namespace App\Console\Commands;
use App\Notifications\TargetDrawn;
use URLParser;
class FixParticipant extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'fix:participant {url : The URL received by one of the participants... | <?php
namespace App\Console\Commands;
use App\Notifications\TargetDrawn;
use URLParser;
class FixParticipant extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'fix:participant {url : The URL received by one of the participants... |
Set version number to 0.1.51. | from setuptools import setup, find_packages
with open("README.rst", "rt") as f: readme = f.read()
setup(
name='gimei',
version="0.1.51",
description="generates the name and the address at random.",
long_description=__doc__,
author='Mao Nabeta',
author_email='mao.nabeta@gmail.com',
url='... | from setuptools import setup, find_packages
with open("README.rst", "rt") as f: readme = f.read()
setup(
name='gimei',
version="0.1.5",
description="generates the name and the address at random.",
long_description=__doc__,
author='Mao Nabeta',
author_email='mao.nabeta@gmail.com',
url='h... |
Add some core components to subliminal | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... |
Tweak log formating to append colon and space to stdout type. | var Logger = function (config) {
this.config = config;
this.backend = this.config.backend || 'stdout'
this.level = this.config.level || "LOG_INFO"
if (this.backend == 'stdout') {
this.util = require('util');
} else {
if (this.backend == 'syslog') {
this.util = require('node-syslog');
th... | var Logger = function (config) {
this.config = config;
this.backend = this.config.backend || 'stdout'
this.level = this.config.level || "LOG_INFO"
if (this.backend == 'stdout') {
this.util = require('util');
} else {
if (this.backend == 'syslog') {
this.util = require('node-syslog');
th... |
Use EmptyOTFCompiler for test compilation | from os import remove
from os.path import exists
from mojo.roboFont import version
from jkRFoTools.FontChooser import ProcessFonts
from fontCompiler.compiler import FontCompilerOptions
from fontCompiler.emptyCompiler import EmptyOTFCompiler
def test_compilation(font):
if font.path is None:
return "ERROR:... | from string import split
from os import remove
from mojo.roboFont import version
from jkRFoTools.FontChooser import ProcessFonts
def test_compilation(font):
temp_font = font.copy(showUI=False)
for g in temp_font:
g.clear()
if font.path is None:
return "ERROR: The font needs to be sav... |
Remove useless requirement on Python 3.2+ | # -*- coding: utf-8 -*-
import io
from setuptools import setup, find_packages
import sys
install_requires = []
if (sys.version_info[0], sys.version_info[1]) < (3, 2):
install_requires.append('futures>=2.1.3')
setup(
name='django-pipeline',
version='1.5.2',
description='Pipeline is an asset packaging ... | # -*- coding: utf-8 -*-
import io
from setuptools import setup, find_packages
setup(
name='django-pipeline',
version='1.5.2',
description='Pipeline is an asset packaging library for Django.',
long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' +
io.open('HISTORY.rst', enc... |
Make base directory configurable from command line | var readFileSync = require("fs").readFileSync;
var baseDir = env.opts.query.externalExBase;
exports.defineTags = function(dictionary) {
dictionary.defineTag("externalExample", {
mustHaveValue: true,
isNamespace: false,
canHaveType: true,
defaultValue: [],
onTagged: function(doclet, tag) {
var examples = ... | var readFileSync = require("fs").readFileSync;
exports.defineTags = function(dictionary) {
dictionary.defineTag("externalExample", {
mustHaveValue: true,
isNamespace: false,
canHaveType: true,
defaultValue: [],
onTagged: function(doclet, tag) {
var examples = doclet.externalExamples;
var example = {};... |
Set py2app.__version__ using pkg_resources, that ensures that the version
stays in sync with the value in setup.py | """
builds Mac OS X application bundles from Python scripts
New keywords for distutils' setup function specify what to build:
app
list of scripts to convert into gui app bundles
py2app options, to be specified in the options keyword to the setup function:
optimize - string or int (0, 1, or 2)
i... | """
builds Mac OS X application bundles from Python scripts
New keywords for distutils' setup function specify what to build:
app
list of scripts to convert into gui app bundles
py2app options, to be specified in the options keyword to the setup function:
optimize - string or int (0, 1, or 2)
i... |
Fix HTTP method value error | /*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* 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 applica... | /*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* 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 applica... |
Annotate default behaviour acc inheritance | package de.zib.gndms.model.common;
/*
* Copyright 2008-2011 Zuse Institute Berlin (ZIB)
*
* 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-... | package de.zib.gndms.model.common;
/*
* Copyright 2008-2011 Zuse Institute Berlin (ZIB)
*
* 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-... |
Add open up lastDownloadFailed to other error cases | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2021
*/
import { syncStrings } from '../localization';
export const selectTemperatureSyncMessage = ({ vaccine }) => {
const { isSyncingTemps = false, error } = vaccine;
if (isSyncingTemps) {
return syncStrings.downloading_temperature_logs;
}
if (er... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2021
*/
import { syncStrings } from '../localization';
export const selectTemperatureSyncMessage = ({ vaccine }) => {
const { isSyncingTemps = false, error } = vaccine;
if (isSyncingTemps) {
return syncStrings.downloading_temperature_logs;
}
if (er... |
Make pair generation extensible to multiple words | var generatePairs = function(string) {
superPairs = string.toUpperCase()
.replace(/[^A-Z ]+/g, '')
.split(/\s+/);
superPairs = superPairs
.map(function(word) {
breaks = [];
for (var i = 0; i < word.length - 1; i++) {
breaks.push(word.slice(i, i + 2));
}
return breaks;
... | var generatePairs = function(string) {
var pairs = [];
string = string.toLowerCase();
for (var i = 0; i < string.length - 1; i++) {
pair = string.substr(i, 2);
if (!/\s/.test(pair)) {
pairs.push(pair);
}
}
return pairs;
}
var whiteSimilarity = function(string1, string2) {
string1 = string... |
Add comments for functions that handle user account info submission | angular.module('shortly.shorten', [])
.controller('AccountsController', function ($scope, $window, $location, $http, Links) {
/**
* Handles Stripe 'Connect' button submit.
* Gets Connect account creation redirect url from server and manually sets href.
*/
$scope.authorize = function() {
var currentU... | angular.module('shortly.shorten', [])
.controller('AccountsController', function ($scope, $window, $location, $http, Links) {
// $scope.hasStripeConnectAccount = function() {
// var currentUser = sessionStorage.getItem('user');
// console.log('user',currentUser);
// };
$scope.authorize = function() {... |
Fix syntax error for PHP legacy versions. | <?php
namespace Omise\Payment\Model\Api;
class Error extends Object
{
/**
* @var string
*/
protected $code = 'unexpected_error';
protected $message = 'There is an unexpected error happened, please contact our support for further investigation.';
public function __construct($error = array... | <?php
namespace Omise\Payment\Model\Api;
class Error extends Object
{
/**
* @var string
*/
protected $code = 'unexpected_error';
protected $message = 'There is an unexpected error happened, please contact our support for further investigation.';
public function __construct($error = array... |
Make hangout rename itself after setchatname is called | """Allows the user to configure the bot to watch for hangout renames
and change the name back to a default name accordingly"""
def setchatname(bot, event, *args):
"""Set a chat name. If no parameters given, remove chat name"""
truncatelength = 32 # What should the maximum length of the chatroom be?
chatna... | """Allows the user to configure the bot to watch for hangout renames
and change the name back to a default name accordingly"""
def setchatname(bot, event, *args):
"""Set a chat name. If no parameters given, remove chat name"""
truncatelength = 32 # What should the maximum length of the chatroom be?
chatna... |
Return empty responses (not HTTP 404) in REST API for missing data | #!/usr/bin/env python
import socket
from flask import Flask, abort, make_response, request
from whip.db import Database
app = Flask(__name__)
app.config.from_envvar('WHIP_SETTINGS', silent=True)
db = None
@app.before_first_request
def _open_db():
global db
db = Database(app.config['DATABASE_DIR'])
@ap... | #!/usr/bin/env python
import socket
from flask import Flask, abort, make_response, request
from whip.db import Database
app = Flask(__name__)
app.config.from_envvar('WHIP_SETTINGS', silent=True)
db = None
@app.before_first_request
def _open_db():
global db
db = Database(app.config['DATABASE_DIR'])
@ap... |
Add engine to Jekyll example | 'use strict';
var path = require('path');
var loader = require('assemble-loader');
var matter = require('parser-front-matter');
var assemble = require('../..');
var app = assemble();
app.use(loader());
app.engine(['hbs', 'md'], require('engine-handlebars') );
app.create('layouts', {
viewType: 'layout',
renameKe... | 'use strict';
var path = require('path');
var loader = require('assemble-loader');
var matter = require('parser-front-matter');
var assemble = require('../..');
var app = assemble();
app.use(loader());
app.create('layouts', {
viewType: 'layout',
renameKey: function (key) {
return path.basename(key);
}
});
... |
Replace all . in for action.types | import S from 'sanctuary';
export const has =
S.meld([S.gets, S.isJust]);
const hasFunc = has(Function);
const hasString = has(String);
const payload = ['payload'];
const path = key => payload.concat(key);
export const stringPayload = hasString(payload);
export const hasSubscribe = hasFunc(path('subscribe'));
exp... | import S from 'sanctuary';
export const has =
S.meld([S.gets, S.isJust]);
const hasFunc = has(Function);
const hasString = has(String);
const payload = ['payload'];
const path = key => payload.concat(key);
export const stringPayload = hasString(payload);
export const hasSubscribe = hasFunc(path('subscribe'));
exp... |
Fix exception on task not found
Silly protected method.... | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... |
Protocol: Add String() method to JobId | package protocol
import (
"io"
"math"
"strconv"
. "github.com/Philipp15b/go-steam/protocol/steamlang"
)
type JobId uint64
func (j JobId) String() string {
if j == math.MaxUint64 {
return "(none)"
}
return strconv.FormatUint(uint64(j), 10)
}
type Serializer interface {
Serialize(w io.Writer) error
}
type... | package protocol
import (
. "github.com/Philipp15b/go-steam/protocol/steamlang"
"io"
)
type JobId uint64
type Serializer interface {
Serialize(w io.Writer) error
}
type Deserializer interface {
Deserialize(r io.Reader) error
}
type Serializable interface {
Serializer
Deserializer
}
type MessageBody interfac... |
Remove bank information from form. | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... | from django.forms import ModelForm
from django import forms
from django.utils.translation import ugettext_lazy as _
from autoentrepreneur.models import UserProfile, AUTOENTREPRENEUR_ACTIVITY, \
AUTOENTREPRENEUR_PAYMENT_OPTION
class UserProfileForm(ModelForm):
company_name = forms.CharField(required=False, max_... |
Fix ImportError when importing after system-wide installation | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
print('[replot] setuptools not found.')
raise
with open('replot/constants.py') as fh:
for line in fh:
line = line.strip()
if line.startswith('__VERSION__'):
version = line.split()[-1][1:-1]
... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
print('[replot] setuptools not found.')
raise
with open('replot/constants.py') as fh:
for line in fh:
line = line.strip()
if line.startswith('__VERSION__'):
version = line.split()[-1][1:-1]
... |
Test DynamicPrefixStrategy for each grid scan level (an internal threshold) to tease out possible bugs. | package org.apache.lucene.spatial.test.strategy;
import org.apache.lucene.spatial.base.context.SpatialContext;
import org.apache.lucene.spatial.base.prefix.GeohashSpatialPrefixGrid;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.prefix.DynamicPrefixStrategy;... | package org.apache.lucene.spatial.test.strategy;
import org.apache.lucene.spatial.base.context.SpatialContext;
import org.apache.lucene.spatial.base.prefix.GeohashSpatialPrefixGrid;
import org.apache.lucene.spatial.strategy.SimpleSpatialFieldInfo;
import org.apache.lucene.spatial.strategy.prefix.DynamicPrefixStrategy;... |
Print message when quitting on exception
This makes sure that an explanatory message is printed when quitting
the main loop due to an exception in a test suite but outside a test
(e.g. in a beforeEach function.)
[endlessm/eos-sdk#737] | const GLib = imports.gi.GLib;
const Mainloop = imports.mainloop;
const System = imports.system;
function quitMainLoopOnException(fn) {
try {
fn();
} catch (e) {
Mainloop.quit("jasmine");
printerr('Exception occurred outside of a test suite:', e);
printerr(e.stack);
Syste... | const GLib = imports.gi.GLib;
const Mainloop = imports.mainloop;
const System = imports.system;
function quitMainLoopOnException(fn) {
try {
fn();
} catch (e) {
Mainloop.quit("jasmine");
System.exit(1);
}
}
function _setTimeoutInternal(fn, time, continueTimeout) {
let id = GLib... |
Update package version for Pypi | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='sophiabus230',
version='0.5',
description='Module to get the timetable of the Sophia Antipolis bus line 230',
url='http://github.com/paraita/sophiabus230',
author='Paraita Wohler',
author_email='parait... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='sophiabus230',
version='0.4',
description='Module to get the timetable of the Sophia Antipolis bus line 230',
url='http://github.com/paraita/sophiabus230',
author='Paraita Wohler',
author_email='parait... |
Package metadata should have ASL2 as license | #! /usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you m... | #! /usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.