text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Improve test script, report namespaces for stuff missing docstrings | import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def getdocstr(mc, docstrings, namespace=None):
name = getattr(mc, '__name__', None)
... | import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def getdocstr(mc, docstrings):
if type(mc) in (ModuleType, ClassType):
name = g... |
Split up url() logic to separate fxns | <?php
namespace allejo\stakx\Twig;
use Twig_Environment;
class BaseUrlFunction
{
public function __invoke (Twig_Environment $env, $assetPath)
{
$globals = $env->getGlobals();
$assetPath = $this->guessAssetPath($assetPath);
// @TODO 1.0.0 Remove support for 'base' as it's been depreca... | <?php
namespace allejo\stakx\Twig;
use Twig_Environment;
class BaseUrlFunction
{
public function __invoke (Twig_Environment $env, $assetPath)
{
$globals = $env->getGlobals();
if (is_array($assetPath) || ($assetPath instanceof \ArrayAccess))
{
$assetPath = (isset($assetPat... |
Use HashSet for reserved user names lookup | package com.cardshifter.core.username;
import java.util.*;
/**
* Instances of this class are guaranteed to be valid user names
*/
public class UserName {
private static final int MIN_LENGTH = 1;
private static final int MAX_LENGTH = 20;
private static final Collection<String> reservedNames = new HashSe... | package com.cardshifter.core.username;
import java.util.*;
/**
* Instances of this class are guaranteed to be valid user names
*/
public class UserName {
private static final int MIN_LENGTH = 1;
private static final int MAX_LENGTH = 20;
private static final Collection<String> reservedNames = Arrays.asL... |
Upgrade project to production ready | """setup.py
..codeauthor:: John Lane <jlane@fanthreesixty.com>
"""
from setuptools import setup, find_packages
from sda import __author__, __email__, __license__, __version__
setup(
name='sda',
version=__version__,
packages=find_packages(),
scripts=[],
description='A wrapper for Selenium. This ... | """setup.py
..codeauthor:: John Lane <jlane@fanthreesixty.com>
"""
from setuptools import setup, find_packages
from sda import __author__, __email__, __license__, __version__
setup(
name='sda',
version=__version__,
packages=find_packages(),
scripts=[],
description='A wrapper for Selenium. This ... |
Make this one-char variable name a two-char. | from setuptools import find_packages
import os.path as op
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
here = op.abspath(op.dirname(__file__))
# Get metadata from the AFQ/version.py file:
ver_file = op.join(here, 'AFQ', 'version.py')
with open(ver_file) as f:
ex... | from setuptools import find_packages
import os.path as op
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
here = op.abspath(op.dirname(__file__))
# Get metadata from the AFQ/version.py file:
ver_file = op.join(here, 'AFQ', 'version.py')
with open(ver_file) as f:
ex... |
Update regex for new error format
Closes #34 | import Prism from "prismjs";
export function configureRustErrors(gotoPosition) {
Prism.languages.rust_errors = { // eslint-disable-line camelcase
'warning':/warning:.*\n/,
'error': {
pattern: /error(\[E\d+\])?:.*\n/,
inside: {
'error-explanation': /\[E\d+\]/,
},
},
'error-lo... | import Prism from "prismjs";
export function configureRustErrors(gotoPosition) {
Prism.languages.rust_errors = { // eslint-disable-line camelcase
'warning':/warning:.*\n/,
'error': {
pattern: /error:.*\n/,
inside: {
'error-explanation': /\[--explain E\d+\]/,
},
},
'error-loc... |
Refactor realm:load to load by realmId vs filename | <?php
namespace Realm\Command;
use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Cons... | <?php
namespace Realm\Command;
use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Cons... |
Use window dimensions rather than document dimensions so the sizing is more stable | angular.module('WatchTimer')
.directive('resizeTextToFill', function($window, $timeout) {
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(fo... | angular.module('WatchTimer')
.directive('resizeTextToFill', function($document, $timeout) {
return {
link: function(scope, element, attrs, controller, transcludeFn) {
var initial_font_size = 10;
var font_size_increment = 20;
var safety_counter_max = 100;
function set_size(... |
Set columns to reactivate component | window.c.AdminUserDetail = (function(m, _, c){
return {
controller: function(){
return {
actions: {
reset: {
property: 'user_password',
updateKey: 'password',
callToAction: 'Redefinir',
... | window.c.AdminUserDetail = (function(m, _, c){
return {
controller: function(){
return {
actions: {
reset: {
property: 'user_password',
updateKey: 'password',
callToAction: 'Redefinir',
... |
Fix typo in requests helper | from __future__ import absolute_import
from __future__ import unicode_literals
import json
import requests
from django.conf import settings
from mesoshttp.acs import DCOSServiceAuth
DCOS_AUTH = None
DCOS_VERIFY = True
if settings.SERVICE_SECRET:
# We are in Enterprise mode and using service account
DCOS_AUT... | from __future__ import absolute_import
from __future__ import unicode_literals
import json
import requests
from django.conf import settings
from mesoshttp.acs import DCOSServiceAuth
DCOS_AUTH = None
DCOS_VERIFY = True
if settings.SERVICE_SECRET:
# We are in Enterprise mode and using service account
DCOS_AUT... |
Move GlossaryManager to tabpanels package (leftover) | /*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package net.localizethat.actions;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
impor... | /*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package net.localizethat.actions;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
impor... |
Remove status enable filter on multiselect source | <?php
/**
* Studioforty9 Gallery
*
* @category Studioforty9
* @package Studioforty9_Gallery
* @author StudioForty9 <info@studioforty9.com>
* @copyright 2015 StudioForty9 (http://www.studioforty9.com)
* @license https://github.com/studioforty9/gallery/blob/master/LICENCE BSD
* @version 1.0.0
* @link ... | <?php
/**
* Studioforty9 Gallery
*
* @category Studioforty9
* @package Studioforty9_Gallery
* @author StudioForty9 <info@studioforty9.com>
* @copyright 2015 StudioForty9 (http://www.studioforty9.com)
* @license https://github.com/studioforty9/gallery/blob/master/LICENCE BSD
* @version 1.0.0
* @link ... |
Fix auth, using Europe/Prague timezone to get right hour for auth | <?php
namespace Lubos\Wedos\Shell;
use Cake\Console\Shell;
use Cake\Core\Configure;
use Cake\Network\Http\Client;
use DateTime;
use DateTimeZone;
class WedosShell extends Shell
{
/**
* Initial settings on startup
*
* @return void
*/
public function startup()
{
$data = Configur... | <?php
namespace Lubos\Wedos\Shell;
use Cake\Console\Shell;
use Cake\Core\Configure;
use Cake\Network\Http\Client;
class WedosShell extends Shell
{
/**
* Initial settings on startup
*
* @return void
*/
public function startup()
{
$data = Configure::read('Wedos');
if (!i... |
Increase timeout for test_long_running_job test | # -*- coding: utf-8 -*-
'''
Tests for various minion timeouts
'''
# Import Python libs
from __future__ import absolute_import
import os
import sys
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ShellCase
class MinionTimeoutTestCase(ShellCase):
'''
Test minion timing fu... | # -*- coding: utf-8 -*-
'''
Tests for various minion timeouts
'''
# Import Python libs
from __future__ import absolute_import
import os
import sys
import salt.utils.platform
# Import Salt Testing libs
from tests.support.case import ShellCase
class MinionTimeoutTestCase(ShellCase):
'''
Test minion timing fu... |
Make 'read' the default 'file' action | const actionTypes = require('../actions/actionTypes');
const actions = require('../actions');
const { identity, omit } = require('lodash/fp');
const fs = require('fs');
const request = require('request');
const runTypes = {
file: (data, store, action) => {
const fileAction = data.fileAction;
const ... | const actionTypes = require('../actions/actionTypes');
const actions = require('../actions');
const { identity, omit } = require('lodash/fp');
const fs = require('fs');
const request = require('request');
const runTypes = {
file: (data, store, action) => {
const fileAction = data.fileAction;
const ... |
Add skip support to shim | // Temporary Shim File for use while migrating from QUnit to Mocha
/*global chai */
function qunitShim() {
var _currentTest,
_describe = describe;
function emitQUnit() {
if (_currentTest) {
_describe(_currentTest.name, function() {
var config = _currentTest.config;
if (config && con... | // Temporary Shim File for use while migrating from QUnit to Mocha
/*global chai */
function qunitShim() {
var _currentTest,
_describe = describe;
function emitQUnit() {
if (_currentTest) {
_describe(_currentTest.name, function() {
var config = _currentTest.config;
if (config && con... |
Add base trove classifier for Django.
Implying "currently supported versions". | from setuptools import find_packages, setup
from channels import __version__
setup(
name='channels',
version=__version__,
url='http://github.com/django/channels',
author='Django Software Foundation',
author_email='foundation@djangoproject.com',
description="Brings async, event-driven capabiliti... | from setuptools import find_packages, setup
from channels import __version__
setup(
name='channels',
version=__version__,
url='http://github.com/django/channels',
author='Django Software Foundation',
author_email='foundation@djangoproject.com',
description="Brings async, event-driven capabiliti... |
Resolve todo (set correct class) | <?php
class Kwc_Favourites_Box_Component extends Kwc_Abstract
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['assets']['files'][] = 'kwf/Kwc/Favourites/Box/Component.js';
$ret['favouritesPageComponentClass'] = 'Kwc_Favourites_Page_Component';
$ret['vi... | <?php
class Kwc_Favourites_Box_Component extends Kwc_Abstract
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['assets']['files'][] = 'kwf/Kwc/Favourites/Box/Component.js';
$ret['favouritesPageComponentClass'] = null; //TODO set to kwc-favourites-page
$... |
Reorder logic to make the intention clearer | define([
'extensions/views/view'
],
function (View) {
var SingleStatView = View.extend({
changeOnSelected: false,
valueTag: 'strong',
initialize: function () {
View.prototype.initialize.apply(this, arguments);
var events = 'reset';
if (this.changeOnSelected) {
events += ' ch... | define([
'extensions/views/view'
],
function (View) {
var SingleStatView = View.extend({
changeOnSelected: false,
valueTag: 'strong',
initialize: function () {
View.prototype.initialize.apply(this, arguments);
var events = 'reset';
if (this.changeOnSelected) {
events += ' ch... |
Add comment why we are manually saving the session | <?php
namespace Auth0\Login;
use Session;
use Auth0\SDK\Store\StoreInterface;
class LaravelSessionStore implements StoreInterface
{
const BASE_NAME = 'auth0_';
/**
* Persists $value on $_SESSION, identified by $key.
*
* @see Auth0SDK\BaseAuth0
*
* @param string $key
* @param mi... | <?php
namespace Auth0\Login;
use Session;
use Auth0\SDK\Store\StoreInterface;
class LaravelSessionStore implements StoreInterface
{
const BASE_NAME = 'auth0_';
/**
* Persists $value on $_SESSION, identified by $key.
*
* @see Auth0SDK\BaseAuth0
*
* @param string $key
* @param mi... |
Revert "change to field for testing" | from django.shortcuts import redirect
from django.http import JsonResponse
from django.core.mail import EmailMessage
from django.middleware import csrf
from rest_framework.decorators import api_view
@api_view(['POST', 'GET'])
def send_contact_message(request):
if request.method == 'POST':
to_address = re... | from django.shortcuts import redirect
from django.http import JsonResponse
from django.core.mail import EmailMessage
from django.middleware import csrf
from rest_framework.decorators import api_view
@api_view(['POST', 'GET'])
def send_contact_message(request):
if request.method == 'POST':
to_address = re... |
REFACTOR : Removed unnecessary code. | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... | from hitchstory import utils, exceptions
from ruamel.yaml.comments import CommentedMap, CommentedSeq
class Arguments(object):
"""A null-argument, single argument or group of arguments of a hitchstory step."""
def __init__(self, yaml_args):
"""Create arguments from dict (from yaml)."""
if yaml... |
Add reconstruct corpus as a test | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import collections
import random
import sys
def reconstruct(f_in, f_out):
sentence_starts = []
contexts = {}
for line in f_in:
parts = line.split()
words = parts[:-1]
count = int(parts[-1])
i... | #!/usr/bin/env python3
import argparse
import collections
import random
import sys
def reconstruct(f_in, f_out):
sentence_starts = []
contexts = {}
for line in f_in:
parts = line.split()
words = parts[:-1]
count = int(parts[-1])
if words[0] == "<s>" and words[-1] == "<... |
Use Ramsey/Uuid instead of Rhumsaa | <?php
namespace Madewithlove\LaravelCqrsEs\Identifier;
use Ramsey\Uuid\Uuid;
class UuidIdentifier implements Identifier
{
/**
* @var Uuid
*/
protected $value;
/**
* @param Uuid $value
*/
public function __construct(Uuid $value)
{
$this->value = $value;
}
/**
... | <?php
namespace Madewithlove\LaravelCqrsEs\Identifier;
use Rhumsaa\Uuid\Uuid;
class UuidIdentifier implements Identifier
{
/**
* @var Uuid
*/
protected $value;
/**
* @param Uuid $value
*/
public function __construct(Uuid $value)
{
$this->value = $value;
}
/**... |
Fix for chrome developer tools console | if (typeof define === 'undefined' && typeof importScripts !== 'undefined')
importScripts('lib/require.js');
var string_split = /(\w+)(\s\w+){0,1}$/
window = self;
require(
['worker_console', 'x_protocol', 'endianbuffer']
, function (console, x_protocol, EndianBuffer) {
self.console = console;
var... | if (typeof define === 'undefined' && typeof importScripts !== 'undefined')
importScripts('lib/require.js');
var string_split = /(\w+)(\s\w+){0,1}$/
require(
['worker_console', 'x_protocol', 'endianbuffer']
, function (console, x_protocol, EndianBuffer) {
var buffer = null
, clients = {}
... |
Fix enum (how did this work?) | "use strict";
module.exports = function(sequelize, DataTypes) {
var Task = sequelize.define("Task", {
taskID: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true },
name: { type: DataTypes.STRING, allowNull: false },
taskType: { type: DataTypes.ENUM('todo', 'exercise', 'mea... | "use strict";
module.exports = function(sequelize, DataTypes) {
var Task = sequelize.define("Task", {
taskID: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true },
name: { type: DataTypes.STRING, allowNull: false },
taskType: { type: DataTypes.ENUM('todo', 'exercise', 'mea... |
Move serial device path to settings | from control_milight.utils import process_automatic_trigger
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236713": "kitchen"... | from django.core.management.base import BaseCommand, CommandError
from control_milight.utils import process_automatic_trigger
import serial
import time
class Command(BaseCommand):
args = ''
help = 'Listen for 433MHz radio messages'
ITEM_MAP = {
"5236713": "kitchen",
"7697747": "hall",
... |
Add comment to clarify constructor access | package model.transform.tasks;
import model.transform.base.ImageTransformTask;
public class StoreOptions extends ImageTransformTask {
// Constructor left public because this task can be used with default options
public StoreOptions() {
super("store");
}
public static class Builder {
... | package model.transform.tasks;
import model.transform.base.ImageTransformTask;
public class StoreOptions extends ImageTransformTask {
public StoreOptions() {
super("store");
}
public static class Builder {
private StoreOptions storeOptions;
public Builder() {
... |
Add dutch translation for aggregation | (function () {
angular.module('ui.grid').config(['$provide', function($provide) {
$provide.decorator('i18nService', ['$delegate', function($delegate) {
$delegate.add('nl', {
aggregate: {
label: 'items'
},
groupPanel: {
description: 'Sleep hier een kolomnaam heen o... | (function () {
angular.module('ui.grid').config(['$provide', function($provide) {
$provide.decorator('i18nService', ['$delegate', function($delegate) {
$delegate.add('nl', {
aggregate: {
label: 'items'
},
groupPanel: {
description: 'Sleep hier een kolomnaam heen o... |
Add values reordering to survey component. | export default [
{
key: 'multiple',
ignore: true
},
{
type: 'datagrid',
input: true,
label: 'Questions',
key: 'questions',
tooltip: 'The questions you would like to ask in this survey question.',
weight: 0,
reorder: true,
defaultValue: [{ label: '', value: '' }],
compon... | export default [
{
key: 'multiple',
ignore: true
},
{
type: 'datagrid',
input: true,
label: 'Questions',
key: 'questions',
tooltip: 'The questions you would like to ask in this survey question.',
weight: 0,
defaultValue: [{ label: '', value: '' }],
components: [
{
... |
Comment out the failing Plan test | # -*- coding: utf-8 -*-
# vim: ft=python:sw=4:ts=4:sts=4:et:
import json
from silver.models import Plan
from django.test.client import Client
from django.test import TestCase
class PlansSpecificationTestCase(TestCase):
def setUp(self):
self.client = Client()
def test_create_plan(self):
asse... | # -*- coding: utf-8 -*-
# vim: ft=python:sw=4:ts=4:sts=4:et:
import json
from silver.models import Plan
from django.test.client import Client
from django.test import TestCase
class PlansSpecificationTestCase(TestCase):
def setUp(self):
self.client = Client()
def test_create_plan(self):
resp... |
Create method to send curl commands. | <?php
/**
* MIT License
* Copyright (c) 2017 Electronic Student Services @ Appalachian State University
*
* See LICENSE file in root directory for copyright and distribution permissions.
*
* @author Matthew McNaney <mcnaneym@appstate.edu>
* @license https://opensource.org/licenses/MIT
*/
namespace stories\F... | <?php
/**
* MIT License
* Copyright (c) 2017 Electronic Student Services @ Appalachian State University
*
* See LICENSE file in root directory for copyright and distribution permissions.
*
* @author Matthew McNaney <mcnaneym@appstate.edu>
* @license https://opensource.org/licenses/MIT
*/
namespace stories\F... |
Fix missing group in configuration publishing | <?php
namespace BotMan\BotMan;
use BotMan\BotMan\Cache\LaravelCache;
use BotMan\BotMan\Container\LaravelContainer;
use BotMan\BotMan\Storages\Drivers\FileStorage;
use Illuminate\Support\ServiceProvider;
class BotManServiceProvider extends ServiceProvider
{
/**
* Bootstrap any package services.
*
*... | <?php
namespace BotMan\BotMan;
use BotMan\BotMan\Cache\LaravelCache;
use BotMan\BotMan\Container\LaravelContainer;
use BotMan\BotMan\Storages\Drivers\FileStorage;
use Illuminate\Support\ServiceProvider;
class BotManServiceProvider extends ServiceProvider
{
/**
* Bootstrap any package services.
*
*... |
ENH: Improve the version information string | import os
import subprocess
from distutils.core import setup
try:
if os.path.exists(".git"):
s = subprocess.Popen(["git", "rev-parse", "HEAD"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = s.communicate()[0]
GIT_REVISION = out.strip()
else:
GIT_REVISIO... | import os
import subprocess
from distutils.core import setup
try:
if os.path.exists(".git"):
s = subprocess.Popen(["git", "rev-parse", "HEAD"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = s.communicate()[0]
GIT_REVISION = out.strip()
else:
GIT_REVISIO... |
Upgrade medialibrary db to v9 | <?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMediaTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create(config('cortex.foun... | <?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMediaTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create(config('cortex.foun... |
Fix ld a,[hram] -> ldh a,[offset] optimizations | // Dependencies ---------------------------------------------------------------
// ----------------------------------------------------------------------------
var Token = require('./parser/Lexer').Token;
// Assembly Instruction Optimizer ---------------------------------------------
// ------------------------------... | // Dependencies ---------------------------------------------------------------
// ----------------------------------------------------------------------------
var Token = require('./parser/Lexer').Token;
// Assembly Instruction Optimizer ---------------------------------------------
// ------------------------------... |
Add try/catch to improve error handling | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com>
# See LICENSE for details.
import bluetooth
import os
import logging
import time
from daemon import runner
class RxCmdDaemon():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdou... |
Add example to function docstring | # -*- coding: utf-8 -*-
'''
Salt proxy state
.. versionadded:: 2015.8.2
State to deploy and run salt-proxy processes
on a minion.
Set up pillar data for your proxies per the documentation.
Run the state as below
..code-block:: yaml
salt-proxy-configure:
salt_proxy.c... | # -*- coding: utf-8 -*-
'''
Salt proxy state
.. versionadded:: 2015.8.2
State to deploy and run salt-proxy processes
on a minion.
Set up pillar data for your proxies per the documentation.
Run the state as below
..code-block:: yaml
salt-proxy-configure:
salt_proxy.c... |
Remove default value for properties. | <?php
namespace Retrinko\CottonTail\Message\Messages;
use Retrinko\CottonTail\Exceptions\MessageException;
use Retrinko\CottonTail\Message\MessageInterface;
use Retrinko\CottonTail\Message\Payloads\RpcResponsePayload;
class RpcResponseMessage extends BasicMessage
{
/**
* @var array
*/
protected $... | <?php
namespace Retrinko\CottonTail\Message\Messages;
use Retrinko\CottonTail\Exceptions\MessageException;
use Retrinko\CottonTail\Message\MessageInterface;
use Retrinko\CottonTail\Message\Payloads\RpcResponsePayload;
class RpcResponseMessage extends BasicMessage
{
/**
* @var array
*/
protected $... |
Fix TimeStampType to use convert method | from __future__ import absolute_import
import datetime
from time import mktime
try:
from dateutil.tz import tzutc, tzlocal
except ImportError:
raise ImportError(
'Using the datetime fields requires the dateutil library. '
'You can obtain dateutil from http://labix.org/python-dateutil'
)
f... | from __future__ import absolute_import
import datetime
from time import mktime
try:
from dateutil.tz import tzutc, tzlocal
except ImportError:
raise ImportError(
'Using the datetime fields requires the dateutil library. '
'You can obtain dateutil from http://labix.org/python-dateutil'
)
f... |
Declare that our SQL functions just read data | <?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class InitialFunctions extends AbstractMigration
{
public function up() {
$query= <<<EOF
CREATE FUNCTION
ROUND_TO_EVEN(val DECIMAL(32,16), places INT)
RETURNS DECIMAL(32,16) DETERMINISTIC
READS SQL DATA
BEGIN
RETURN IF(ABS(val... | <?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class InitialFunctions extends AbstractMigration
{
public function up() {
$query= <<<EOF
CREATE FUNCTION
ROUND_TO_EVEN(val DECIMAL(32,16), places INT)
RETURNS DECIMAL(32,16) DETERMINISTIC
BEGIN
RETURN IF(ABS(val - TRUNCATE(val... |
Return exception details when failing to load link | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.head(link, headers=headers, allow_redirects=Tru... | #!/usr/bin/env python
from __future__ import division
import requests
import json
import sys
from requests.exceptions import SSLError, InvalidSchema, ConnectionError
def get_link_status_code(link):
headers = {'User-agent':'Mozilla/5.0'}
try:
r = requests.head(link, headers=headers, allow_redirects=Tru... |
Fix not being able to disable TokenManager integration | package com.elmakers.mine.bukkit.integration;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.Plugin;
import com.elmakers.mine.bukkit.api.magic.MageController;
import com.elmakers.mine.bukkit.utility.ConfigurationUtils;
import me.realized.tokenmanager.api.TokenManager;
public class To... | package com.elmakers.mine.bukkit.integration;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.Plugin;
import com.elmakers.mine.bukkit.api.magic.MageController;
import com.elmakers.mine.bukkit.utility.ConfigurationUtils;
import me.realized.tokenmanager.api.TokenManager;
public class To... |
Add documentation
Clean duplicate code
remove unused code | import os
import unittest
from gateway.utils.resourcelocator import ResourceLocator
from unittest import TestLoader
TEST_PATH = "tests"
verbosity = 1
test_loader = unittest.defaultTestLoader
def find_test_modules(test_modules=None):
test_locator = ResourceLocator.get_locator(TEST_PATH)
test_suite = test_load... | import os
import unittest
from gateway.utils.resourcelocator import ResourceLocator
from unittest import TestLoader
TEST_PATH = "tests"
verbosity = 1
test_loader = unittest.defaultTestLoader
def find_test_modules(test_modules=None):
test_locator = ResourceLocator.get_locator(TEST_PATH)
test_suite = test_lo... |
Revert "Do not display the start time of an event on the RSVP confirmation view"
This reverts commit 79f86048c086e8a3928decfc27e7ac5af95e4f28.
Fixes #1386. | <!DOCTYPE html>
<html lang="en">
<head>
<title>Event RSVP | MyRoboJackets</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{ mix('/css/app.css') }}" rel="stylesheet">
<style type="text/css">
b {
font-weight: bold; !important
}
</st... | <!DOCTYPE html>
<html lang="en">
<head>
<title>Event RSVP | MyRoboJackets</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{ mix('/css/app.css') }}" rel="stylesheet">
<style type="text/css">
b {
font-weight: bold; !important
}
</st... |
Add unmigratedDocumentQuery to test migration | import { Comments } from '../../lib/collections/comments'
import { registerMigration, migrateDocuments } from './migrationUtils';
registerMigration({
name: "testCommentMigration",
idempotent: true,
action: async () => {
await migrateDocuments({
description: "Checking how long migrating a lot of commen... | import { Comments } from '../../lib/collections/comments'
import { registerMigration, migrateDocuments } from './migrationUtils';
registerMigration({
name: "testCommentMigration",
idempotent: true,
action: async () => {
await migrateDocuments({
description: "Checking how long migrating a lot of commen... |
Remove hard dependency on typeguard | import os
from setuptools import find_packages, setup
rootpath = os.path.abspath(os.path.dirname(__file__))
# Extract version
def extract_version(module='kyokai'):
version = None
fname = os.path.join(rootpath, module, 'util.py')
with open(fname) as f:
for line in f:
if line.startswit... | import os
from setuptools import find_packages, setup
rootpath = os.path.abspath(os.path.dirname(__file__))
# Extract version
def extract_version(module='kyokai'):
version = None
fname = os.path.join(rootpath, module, 'util.py')
with open(fname) as f:
for line in f:
if line.startswit... |
Remove slice constraint on fetch | const TANDEM_MONGO_HOST = process.env.TANDEM_MONGO_HOST;
const mongo = require('mongodb');
const bluebird = require('bluebird');
const mongoBluebird = require('mongodb-bluebird');
const async = require('async');
const mongoCollection = 'newnews';
module.exports = function(sentimen... | const TANDEM_MONGO_HOST = process.env.TANDEM_MONGO_HOST;
const mongo = require('mongodb');
const bluebird = require('bluebird');
const mongoBluebird = require('mongodb-bluebird');
const async = require('async');
const mongoCollection = 'newnews';
module.exports = function(sentimen... |
Fix a bug where the post submit autoform hook wasn't called | AutoForm.hooks({
submitPostForm: {
before: {
method: function(doc) {
this.template.$('button[type=submit]').addClass('loading');
var post = doc;
// ------------------------------ Checks ------------------------------ //
if (!Meteor.user()) {
Messages.flash(i18n... | AutoForm.hooks({
submitPostForm: {
before: {
submitPost: function(doc) {
this.template.$('button[type=submit]').addClass('loading');
var post = doc;
// ------------------------------ Checks ------------------------------ //
if (!Meteor.user()) {
Messages.flash(... |
Fix that makes the media uploads work correctly. | from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# Webserver urls
url(r'^', include('webserver.home.urls')),
url(r'^', include('webserver.profiles.urls')),
url(r'^', inc... | from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# Webserver urls
url(r'^', include('webserver.home.urls')),
url(r'^', include('webserver.profiles.urls')),
url(r'^', inc... |
Add Payment and Image providers by default
Also, reordered default providers for easier maintenance | <?php
namespace Faker;
class Factory
{
const DEFAULT_LOCALE = 'en_US';
protected static $defaultProviders = array('Address', 'Color', 'Company', 'DateTime', 'File', 'Image', 'Internet', 'Lorem', 'Miscellaneous', 'Payment', 'Person', 'PhoneNumber', 'UserAgent', 'Uuid');
public static function create($loc... | <?php
namespace Faker;
class Factory
{
const DEFAULT_LOCALE = 'en_US';
protected static $defaultProviders = array('Person', 'Address', 'PhoneNumber', 'Company', 'Lorem', 'Internet', 'DateTime', 'Miscellaneous', 'UserAgent', 'Uuid', 'File', 'Color');
public static function create($locale = self::DEFAULT_... |
Add translatable behavior by stof | <?php
namespace Application\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
/**
* @Route("/article")
*/
class Art... | <?php
namespace Application\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
/**
* @Route("/article")
*/
class Art... |
Fix initial textarea row count | var cell_types = cell_types || {};
(function(){
cell_types["mathjs"] = {
button_html: "+",
on_create: function(element, content){
var extension_content = subqsa(
element,
".extension-content"
)[0];
element.classList.ad... | var cell_types = cell_types || {};
(function(){
cell_types["mathjs"] = {
button_html: "+",
on_create: function(element, content){
var extension_content = subqsa(
element,
".extension-content"
)[0];
element.classList.ad... |
Set Default for Flash Theme in Storybook | import React from 'react';
import { storiesOf } from '@storybook/react';
import {
text,
number,
select
} from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { State, Store } from '@sambego/storybook-state';
import OptionsHelper from '../../utils/helpers/options-helper';
import... | import React from 'react';
import { storiesOf } from '@storybook/react';
import {
text,
number,
select
} from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { State, Store } from '@sambego/storybook-state';
import OptionsHelper from '../../utils/helpers/options-helper';
import... |
Remove HTMLEditorField schema component definition, done in core now | <?php
namespace DNADesign\Elemental\Models;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\FieldType\DBField;
class ElementContent extends BaseElement
{
private static $icon = 'font-icon-block-content';
private static $db = [
'HTML' => 'HTMLText'
];
private static $table_name = 'Ele... | <?php
namespace DNADesign\Elemental\Models;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\FieldType\DBField;
class ElementContent extends BaseElement
{
private static $icon = 'font-icon-block-content';
private static $db = [
'HTML' => 'HTMLText'
];
private static $table_name = 'Ele... |
Remove pagination, its overkill here | <?php
/**
* Allows editing of site banner data "globally".
*/
class SiteBannerSiteConfigExtension extends DataExtension
{
public function updateCMSFields(FieldList $fields)
{
$fields->findOrMakeTab(
'Root.SiteBanner',
_t('SiteBanner.TabTitle', 'Site Banners')
);
... | <?php
/**
* Allows editing of site banner data "globally".
*/
class SiteBannerSiteConfigExtension extends DataExtension
{
public function updateCMSFields(FieldList $fields)
{
$fields->findOrMakeTab(
'Root.SiteBanner',
_t('SiteBanner.TabTitle', 'Site Banners')
);
... |
Add roles argument for createUser command. | # -*- coding: utf-8 *-*
import logging
import unittest
from mongolog import MongoHandler
try:
from pymongo import MongoClient as Connection
except ImportError:
from pymongo import Connection
class TestAuth(unittest.TestCase):
def setUp(self):
""" Create an empty database that could be used for ... | # -*- coding: utf-8 *-*
import logging
import unittest
from mongolog import MongoHandler
try:
from pymongo import MongoClient as Connection
except ImportError:
from pymongo import Connection
class TestAuth(unittest.TestCase):
def setUp(self):
""" Create an empty database that could be used for ... |
Add unidecode as a dependency | import re
from setuptools import setup
init_py = open('wikipediabase/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
metadata['doc'] = re.findall('"""(.+)"""', init_py)[0]
setup(
name='wikipediabase',
version=metadata['version'],
description=metadata['doc'],
autho... | import re
from setuptools import setup
init_py = open('wikipediabase/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
metadata['doc'] = re.findall('"""(.+)"""', init_py)[0]
setup(
name='wikipediabase',
version=metadata['version'],
description=metadata['doc'],
autho... |
Add minify stage when not dev | var webpack = require('webpack');
module.exports = {
entry: {
main:'./src/frontend/components/App.jsx',
admin: './src/frontend/components/admin/AdminDashboard.jsx',
networkAdmin: './src/frontend/components/admin/NetworkAdminDashboard.jsx',
},
output: {
path: './public/javasc... | require('webpack');
module.exports = {
entry: {
main:'./src/frontend/components/App.jsx',
admin: './src/frontend/components/admin/AdminDashboard.jsx',
networkAdmin: './src/frontend/components/admin/NetworkAdminDashboard.jsx',
},
output: {
path: './public/javascript',
... |
Add lxml to list of install_requires
This is literally the exact same thing as #19, but for some reason, that fix isn't included | from distutils.core import setup
from setuptools import setup
setup(
name = 'spice_api',
packages = ['spice_api'], # this must be the same as the name above
version = '1.0.4',
description = 'spice is a pure Python API that wraps around MALs Official API and makes it much better.',
long_description ... | from distutils.core import setup
from setuptools import setup
setup(
name = 'spice_api',
packages = ['spice_api'], # this must be the same as the name above
version = '1.0.4',
description = 'spice is a pure Python API that wraps around MALs Official API and makes it much better.',
long_description ... |
Stop validation error notification stack
closes #3383
- Calls closePassive() if a new validation error is thrown to display
only the latest validation error | /* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';
var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: '',
submitting: false,
// ValidationEngine settings
validationType: 'forgotten',
a... | /* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';
var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: '',
submitting: false,
// ValidationEngine settings
validationType: 'forgotten',
a... |
Disable failing asserts due to parser generator bug | package org.spoofax.jsglr2.actions;
import org.spoofax.jsglr2.characters.ICharacters;
import org.spoofax.jsglr2.parsetable.IProduction;
import org.spoofax.jsglr2.parsetable.ProductionType;
public class Reduce extends Action implements IReduce {
private final IProduction production;
private final ProductionTy... | package org.spoofax.jsglr2.actions;
import org.spoofax.jsglr2.characters.ICharacters;
import org.spoofax.jsglr2.parsetable.IProduction;
import org.spoofax.jsglr2.parsetable.ProductionType;
public class Reduce extends Action implements IReduce {
private final IProduction production;
private final ProductionTy... |
Clarify comment about Pyhton versions | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... |
Add types to ImageProvider and RequiresData | import inspect
import json
from os.path import exists, join
from pathlib import Path
from typing import Any, Union
from ..services import Services
PathOrStr = Union[str,Path]
def not_implemented():
frame_info = inspect.currentframe().f_back
msg = ''
if 'self' in frame_info.f_locals:
self = fram... | import json
import inspect
from os.path import join, exists
def not_implemented():
frame_info = inspect.currentframe().f_back
msg = ''
if 'self' in frame_info.f_locals:
self = frame_info.f_locals['self']
try:
msg += self.__name__ + '#' # for static/class methods
excep... |
Fix indents for minimized JSON | # coding: utf-8
import abc
from typing import Any
from aiohttp import web
from il2fb.ds.airbridge import json
class RESTResponse(web.Response, abc.ABC):
detail = None
@property
@abc.abstractmethod
def status(self) -> int:
"""
Status must be explicilty defined by subclasses.
... | # coding: utf-8
import abc
from typing import Any
from aiohttp import web
from il2fb.ds.airbridge import json
class RESTResponse(web.Response, abc.ABC):
detail = None
@property
@abc.abstractmethod
def status(self) -> int:
"""
Status must be explicilty defined by subclasses.
... |
Refactor: Adjust the production build parameter inorder to access all available routes | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'fireplace-app',
environment: environment,
baseURL: '/fireplace-app',
locationType: 'auto',
contentSecurityPolicy: {'img-src': "'self' " +
"m.fmi.fi "},
EmberENV: ... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'fireplace-app',
environment: environment,
baseURL: '/fireplace-app',
locationType: 'auto',
contentSecurityPolicy: {'img-src': "'self' " +
"m.fmi.fi "},
EmberENV: ... |
Fix problem where Provider DoesNotExist.
* Occurs on provider and providerlist endpoints.
* Came to attention as a side effect of fixing ATMO-176.
* Similar changes need to be made all over atmosphere. I'll
create a ticket.
modified: api/provider.py | """
atmosphere service provider rest api.
"""
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from authentication.decorators import api_auth_token_required
from core.models.group import Group
from core.models.provider import Provider as CoreProv... | """
atmosphere service provider rest api.
"""
from rest_framework.views import APIView
from rest_framework.response import Response
from authentication.decorators import api_auth_token_required
from core.models.group import Group
from api.serializers import ProviderSerializer
class ProviderList(APIView):
"""... |
Include more information in file replicator exception. | <?php
namespace Orbt\ResourceMirror\Resource;
use Orbt\ResourceMirror\Exception\ReplicatorException;
/**
* Basic replicator implementation using file operations to replicate.
*/
class FileReplicator implements Replicator
{
/**
* Base URL.
* @var string
*/
protected $baseUrl;
/**
* T... | <?php
namespace Orbt\ResourceMirror\Resource;
use Orbt\ResourceMirror\Exception\ReplicatorException;
/**
* Basic replicator implementation using file operations to replicate.
*/
class FileReplicator implements Replicator
{
/**
* Base URL.
* @var string
*/
protected $baseUrl;
/**
* T... |
Add Square to presentation map | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Payment extends Model
{
use SoftDeletes;
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['method_presentation'];
... | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Payment extends Model
{
use SoftDeletes;
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['method_presentation'];
... |
Make sure content of po files is read in utf8 |
var through = require('through2'),
gutil = require('gulp-util'),
po = require('node-po'),
PluginError = gutil.PluginError;
module.exports = function () {
function write (f, enc, cb){
if (f.isNull()) {
this.push(file);
return cb();
}
if (f.isStream()) ... |
var through = require('through2'),
gutil = require('gulp-util'),
po = require('node-po'),
PluginError = gutil.PluginError;
module.exports = function () {
function write (f, enc, cb){
if (f.isNull()) {
this.push(file);
return cb();
}
if (f.isStream()) ... |
Fix bug in data collection | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... |
Update the path and the url | <?php
/*
* This file is part of the AlphaLemonThemeEngineBundle and it is distributed
* under the MIT License. To use this bundle you must leave
* intact this copyright notice.
*
* Copyright (c) AlphaLemon <webmaster@alphalemon.com>
*
* For the full copyright and license information, please view the LICENSE
* f... | <?php
/*
* This file is part of the AlphaLemonThemeEngineBundle and it is distributed
* under the MIT License. To use this bundle you must leave
* intact this copyright notice.
*
* Copyright (c) AlphaLemon <webmaster@alphalemon.com>
*
* For the full copyright and license information, please view the LICENSE
* f... |
Fix wrong input/output drata types. | package es.tid.cosmos.mobility.aggregatedmatrix.simple;
import java.io.IOException;
import com.twitter.elephantbird.mapreduce.io.ProtobufWritable;
import org.apache.hadoop.mapreduce.Mapper;
import es.tid.cosmos.mobility.data.TwoIntUtil;
import es.tid.cosmos.mobility.data.generated.MobProtocol.ItinRange;
import es.ti... | package es.tid.cosmos.mobility.aggregatedmatrix.simple;
import java.io.IOException;
import com.twitter.elephantbird.mapreduce.io.ProtobufWritable;
import org.apache.hadoop.mapreduce.Mapper;
import es.tid.cosmos.mobility.data.TwoIntUtil;
import es.tid.cosmos.mobility.data.generated.MobProtocol.ItinRange;
import es.ti... |
Put profile stuff in storage | <?php
return array(
/*
|--------------------------------------------------------------------------
| File extension
|--------------------------------------------------------------------------
| Comma seperated list of file extension to be registered with the xslt view.
*/
'extension' => 'xsl',
/*
|-... | <?php
return array(
/*
|--------------------------------------------------------------------------
| File extension
|--------------------------------------------------------------------------
| Comma seperated list of file extension to be registered with the xslt view.
*/
'extension' => 'xsl',
/*
|-... |
Change to allow the date picker to move past the current date. | (function () {
"use strict";
angular.module('orange')
.directive('datefield', datefield);
datefield.$inject = ['$cordovaDatePicker'];
function datefield($cordovaDatePicker) {
return {
scope: {
//allow dates in the future as per request
// 'maxDateNow': '='
... | (function () {
"use strict";
angular.module('orange')
.directive('datefield', datefield);
datefield.$inject = ['$cordovaDatePicker'];
function datefield($cordovaDatePicker) {
return {
scope: {
'maxDateNow': '='
},
require: 'ngModel'... |
Implement the strict filter to use UserId to match the Limit permissions for push | (function (global) {
'use strict';
var app = global.app = global.app || {};
app.PushFactory = (function () {
var create = function (sender, recipients) {
var filter;
if (Array.isArray(recipients) && recipients.length > 0) {
// filter on the userId field in ... | (function (global) {
'use strict';
var app = global.app = global.app || {};
app.PushFactory = (function () {
var create = function (sender, recipients) {
var filter;
if (Array.isArray(recipients) && recipients.length > 0) {
// filter on the userId field in ... |
Replace all occurances of $graph->getNumberOfVertices()
replaced with count($graph->getVertices()) | <?php
use Fhaculty\Graph\Algorithm\Complete;
use Fhaculty\Graph\Algorithm\Directed;
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Loader\CompleteGraph;
class CompleteGraphTest extends TestCase
{
public function testOne()
{
$loader = new CompleteGraph(1);
$graph = $loader->createGraph();
... | <?php
use Fhaculty\Graph\Algorithm\Complete;
use Fhaculty\Graph\Algorithm\Directed;
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Loader\CompleteGraph;
class CompleteGraphTest extends TestCase
{
public function testOne()
{
$loader = new CompleteGraph(1);
$graph = $loader->createGraph();
... |
Fix one more issue thanks to Scrutinizer | <?php
namespace Baddum\Factory418;
trait FactoryTrait
{
/* ATTRIBUTES
*************************************************************************/
private static $indexList = [];
/* PUBLIC METHODS
*************************************************************************/
public function reg... | <?php
namespace Baddum\Factory418;
trait FactoryTrait
{
/* ATTRIBUTES
*************************************************************************/
private static $indexList = [];
/* PUBLIC METHODS
*************************************************************************/
public function reg... |
Tweak wording of password prompt
iCloud is branded with a lower case 'i' like most other Apple products. | import getpass
import keyring
from .exceptions import NoStoredPasswordAvailable
KEYRING_SYSTEM = 'pyicloud://icloud-password'
def get_password(username, interactive=True):
try:
return get_password_from_keyring(username)
except NoStoredPasswordAvailable:
if not interactive:
raise... | import getpass
import keyring
from .exceptions import NoStoredPasswordAvailable
KEYRING_SYSTEM = 'pyicloud://icloud-password'
def get_password(username, interactive=True):
try:
return get_password_from_keyring(username)
except NoStoredPasswordAvailable:
if not interactive:
raise... |
Allow non-anchor links to click through normally | var RawnetAdmin = window.RawnetAdmin || {};
RawnetAdmin.menu = function(){
function toggleNav(link) {
var active = $('#mainNav a.active'),
target = $(link.attr('href')),
activeMenu = $('#subNav nav.active');
active.removeClass('active');
activeMenu.removeClass('active');
link.addClass('ac... | var RawnetAdmin = window.RawnetAdmin || {};
RawnetAdmin.menu = function(){
function toggleNav(link) {
var active = $('#mainNav a.active'),
target = $(link.attr('href')),
activeMenu = $('#subNav nav.active');
active.removeClass('active');
activeMenu.removeClass('active');
link.addClass('ac... |
Convert dashed itemKeys to camel cased | import dashesToCamelCase from '../../helpers/string/dashes-to-camel-case';
export default class ComponentExtensionItemSelectorToMembers {
itemSelectorToMembers() {
let selector = this.options.itemSelector || '[data-js-item]';
let domItemsInSubModules = Array.from(this.el.querySelectorAll(
... | export default class ComponentExtensionItemSelectorToMembers {
itemSelectorToMembers() {
let selector = this.options.itemSelector || '[data-js-item]';
let domItemsInSubModules = Array.from(this.el.querySelectorAll(
`${this.moduleSelector}`)
);
let domItems = Array.from(t... |
Add default values for homepage | import React, {Component} from 'react';
import {Link} from 'react-router-dom';
import Header from './components/header/Header';
class Home extends Component {
render() {
return (
<div id="home">
<Header noWishlist={true} />
<div className="grid-y align-center align-middle">
<h1>E... | import React, {Component} from 'react';
import {Link} from 'react-router-dom';
import Header from './components/header/Header';
class Home extends Component {
render() {
return (
<div id="home">
<Header noWishlist={true} />
<div className="grid-y align-center align-middle">
<h1>E... |
Set default UsernameGenerator username format to %s to work with the current routing requirements. Both will need updating when the format is agreed. | <?php
namespace Ice\UsernameGeneratorBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http... | <?php
namespace Ice\UsernameGeneratorBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http... |
Remove no longer needed references for keeping pep8 happy | from twisted.trial.unittest import TestCase
from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend
class TestFixtures(TestCase):
def test_add(self):
fixtures = Fixtures()
fixtures.add(foo='bar', result={'baz': 'quux'})
self.assertEqual(fixtures.items, [{
'fo... | from twisted.trial.unittest import TestCase
from go_metrics.metrics.dummy import Fixtures, DummyMetrics, DummyBackend
DummyBackend, DummyMetrics
class TestFixtures(TestCase):
def test_add(self):
fixtures = Fixtures()
fixtures.add(foo='bar', result={'baz': 'quux'})
self.assertEqual(fixture... |
Make sure we use Python 3 here | #!/usr/bin/env python
# -*- encoding: utf-8
"""
Usage: run_travis_lambdas.py (test|publish)
"""
import os
import subprocess
import sys
if __name__ == '__main__':
try:
verb = sys.argv[1]
assert verb in ('test', 'publish')
except (AssertionError, IndexError):
sys.exit(__doc__.strip())
... | #!/usr/bin/env python
# -*- encoding: utf-8
"""
Usage: run_travis_lambdas.py (test|publish)
"""
import os
import subprocess
import sys
if __name__ == '__main__':
try:
verb = sys.argv[1]
assert verb in ('test', 'publish')
except (AssertionError, IndexError):
sys.exit(__doc__.strip())
... |
Move the @Transactional(readOnly = true) annotation to class level | package com.vladmihalcea.book.hpjp.hibernate.transaction.spring.routing;
import com.vladmihalcea.book.hpjp.hibernate.transaction.forum.Post;
import com.vladmihalcea.book.hpjp.hibernate.transaction.forum.Tag;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;... | package com.vladmihalcea.book.hpjp.hibernate.transaction.spring.routing;
import com.vladmihalcea.book.hpjp.hibernate.transaction.forum.Post;
import com.vladmihalcea.book.hpjp.hibernate.transaction.forum.Tag;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;... |
Fix javascript dependencies for a couple other plugins that aren't AMD modules | // Common configuration for RequireJS
var require = {
baseUrl: "/scripts",
paths: {
"jquery": "bower_components/jquery/dist/jquery.min",
"knockout": "bower_components/knockout/dist/knockout",
"bootstrap": "bower_components/bootstrap/dist/js/bootstrap.min",
"text": "bower_compone... | // Common configuration for RequireJS
var require = {
baseUrl: "/scripts",
paths: {
"jquery": "bower_components/jquery/dist/jquery.min",
"knockout": "bower_components/knockout/dist/knockout",
"bootstrap": "bower_components/bootstrap/dist/js/bootstrap.min",
"text": "bower_compone... |
Update Census statistics method to get groups, sections and teams | import connection from '../../config/database';
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
const groups = await connection
.table('employees')
.filter(doc => doc('grp').ne(''))('grp')
.distinct()
.count();
const divisi... | import connection from '../../config/database';
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
const divisions = await connection
.table('employees')
.filter(doc => doc('div').ne(''))('div')
.distinct()
.count();
const dir... |
Simplify Settings code a little bit
- Fixes error 500 on homepage with clean database | from django.utils import timezone
from settings.models import Setting
from utils.dates import string_to_datetime
class Settings:
def __init__(self, values=None):
if values is None:
return
settings = Setting.objects.filter(name__in=values)
self.__dict__['settings'] = dict((o.na... | from django.utils import timezone
from settings.models import Setting
from utils.dates import string_to_datetime
class Settings:
def __init__(self, values=None):
if values is None:
return
settings = Setting.objects.filter(name__in=values)
self.__dict__['settings'] = dict((o.na... |
Fix main camera zTranslation responsive issue | import Geometric from './geometric/geometric.js'
export default class Background
{
static draw(p)
{
Background.changeColor(p)
Background.translateCamera(p)
Background.translateCameraByMouse(p)
Geometric.draw(p)
}
static changeColor(p)
{
const hexColorMax = 255
const radianX... | import Geometric from './geometric/geometric.js'
export default class Background
{
static draw(p)
{
Background.changeColor(p)
Background.translateCamera(p)
Background.translateCameraByMouse(p)
Geometric.draw(p)
}
static changeColor(p)
{
const hexColorMax = 255
const radianX... |
Add type hints for mocked dependencies | <?php
declare(strict_types=1);
namespace Mihaeu\TestGenerator;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\NameResolver;
use PhpParser\Parser;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject as Mock;
/**
* @covers Mihaeu\TestGenerator\TestGenerator
*/
class TestGeneratorTest... | <?php
declare(strict_types=1);
namespace Mihaeu\TestGenerator;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\NameResolver;
use PhpParser\Parser;
use PHPUnit\Framework\TestCase;
/**
* @covers Mihaeu\TestGenerator\TestGenerator
*/
class TestGeneratorTest extends TestCase
{
/** @var TestGenerator */
... |
Add appId asap, however we should figure out a better flow | /*jshint esversion:6, node:true*/
'use strict';
const extend = require('gextend');
var DEFAULTS = {
middleware: require('./middleware')
};
module.exports = function(options) {
return {
init: function(context, config) {
config = extend({}, options, config);
const express = re... | /*jshint esversion:6, node:true*/
'use strict';
const extend = require('gextend');
var DEFAULTS = {
middleware: require('./middleware')
};
module.exports = function(options){
return {
init: function(context, config){
config = extend({}, options, config);
const express = requ... |
Refactor dramas controller for authorization | (function(){
'use strict';
angular
.module('secondLead')
.controller('DramasCtrl', [
'DramaModel',
'Gridster',
'ListModel',
'Restangular',
'UserModel',
function (DramaModel, Gridster, ListModel, Restangular, UserModel){
var ctrl = this;
ctrl.items = DramaModel.getAll;
ctrl.use... | (function(){
'use strict';
angular
.module('secondLead')
.controller('DramasCtrl', [
'DramaModel',
'Gridster',
'ListModel',
'Restangular',
'UserModel',
function(DramaModel, Gridster, ListModel, Restangular, UserModel) {
var ctrl = this;
ctrl.items = DramaModel.getAll;
ctrl.use... |
Add warning log level for auth checks | from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import request as flask_request
from flask import abort
import logging
import os
def gen_auth_token(id,expiration=10000):
"""Generate auth token"""
try:
s = Serializer(os.environ['API_KEY'],expires_in=expiration)
exc... | from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import request as flask_request
from flask import abort
import logging
import os
def gen_auth_token(id,expiration=10000):
"""Generate auth token"""
try:
s = Serializer(os.environ['API_KEY'],expires_in=expiration)
exc... |
Add example cases for block:link | ({
block : 'page',
title : 'bem-components: link',
mods : { theme : 'normal' },
head : [
{ elem : 'css', url : '_simple.css' },
{ elem : 'js', url : '_simple.js' }
],
content : ['default', 'simple', 'normal'].map(function(theme, i) {
var content = [
{ bloc... | ({
block : 'page',
title : 'bem-components: link',
mods : { theme : 'normal' },
head : [
{ elem : 'css', url : '_simple.css' },
{ elem : 'js', url : '_simple.js' }
],
content : [
{
block : 'link',
content : 'Empty link 1'
},
{
... |
Make a urlgenerator creates links protocol insensitive | <?php
class UrlGenerator {
public static function generate_thumb_url($filename, $type = '', $size = '_thumb') {
if (empty($filename)) {
return ''; // Fallback error image
}
if (ENVIRONMENT === 'production') {
$host = '//img.pickartyou.com/';
} else {
... | <?php
class UrlGenerator {
public static function generate_thumb_url($filename, $type = '', $size = '_thumb') {
if (empty($filename)) {
return ''; // Fallback error image
}
if (ENVIRONMENT === 'production') {
$host = 'http://img.pickartyou.com/';
} else {
... |
Remove "html" from the inputFormats list
All HTML is not reshape. | 'use strict'
const reshape = require('reshape')
exports.name = 'reshape'
exports.outputFormat = 'html'
exports.renderAsync = function (str, options, locals) {
return new Promise((resolve, reject) => {
const plugins = []
options = options || {}
options.plugins = options.plugins || {}
if (Array.isAr... | 'use strict'
const reshape = require('reshape')
exports.name = 'reshape'
exports.inputFormats = ['reshape', 'html']
exports.outputFormat = 'html'
exports.renderAsync = function (str, options, locals) {
return new Promise((resolve, reject) => {
const plugins = []
options = options || {}
options.plugins ... |
Fix ES index setup in XFormManagementTest | from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest, QueryDict
from django.test import TestCase, Client
from corehq.apps.data_interfaces.views import XFormManagementView
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.users.models import WebUser
... | from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest, QueryDict
from django.test import TestCase, Client
from corehq.apps.data_interfaces.views import XFormManagementView
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.users.models import WebUser
... |
Fix path for collection entrypoint
Signed-off-by: Julius Härtl <bf353fa4999f2f148afcc6d8ee6cb1ee74cc07c3@bitgrid.net> | const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: {
deck: path.join(__dirname, 'src', 'main.js'),
collections: path.join(__dirname, 'src', 'init-collections.js'),
},
output: {
filename: '[name].js',
path: __dirname + '/js',
publicPath: '/js/',
jso... | const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: {
deck: path.join(__dirname, 'src', 'main.js'),
collections: ['./src/init-collections.js']
},
output: {
filename: '[name].js',
path: __dirname + '/js',
publicPath: '/js/',
jsonpFunction: 'webpackJs... |
Use filesystem for all file access. | <?php
namespace Studio\Creator;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use Studio\Parts\PartInterface;
use Studio\Package;
use Studio\Shell\TaskRunner;
class SkeletonCreator implements CreatorInterface
{
/**
* @var string
*/
protected $path;
/**
* @var Files... | <?php
namespace Studio\Creator;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use Studio\Parts\PartInterface;
use Studio\Package;
use Studio\Shell\TaskRunner;
class SkeletonCreator implements CreatorInterface
{
/**
* @var string
*/
protected $path;
/**
* @var Files... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.