text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Change default value for adapter | <?php
namespace Sellsy\ApiBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Class Configuration
*
* @package Sellsy\ApiBundle\DependencyInjection
*/
class Configuration implements ConfigurationInterface
{... | <?php
namespace Sellsy\ApiBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Class Configuration
*
* @package Sellsy\ApiBundle\DependencyInjection
*/
class Configuration implements ConfigurationInterface
{... |
Add template var for model generation | <?php namespace Way\Generators\Commands;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ModelGeneratorCommand extends GeneratorCommand {
/**
* The console command name.
*
* @var string
*/
protected $name = 'generate:model';
/... | <?php namespace Way\Generators\Commands;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ModelGeneratorCommand extends GeneratorCommand {
/**
* The console command name.
*
* @var string
*/
protected $name = 'generate:model';
/... |
Fix to the mapper related entities when null | <?php
namespace FS\SolrBundle\Doctrine\Mapper\Mapping;
use FS\SolrBundle\Doctrine\Annotation\Field;
use FS\SolrBundle\Doctrine\Mapper\MetaInformationInterface;
use Doctrine\Common\Collections\Collection;
/**
* command maps all fields of the entity
*
* uses parent method for mapping of document_name and id
*/
clas... | <?php
namespace FS\SolrBundle\Doctrine\Mapper\Mapping;
use FS\SolrBundle\Doctrine\Annotation\Field;
use FS\SolrBundle\Doctrine\Mapper\MetaInformationInterface;
use Doctrine\Common\Collections\Collection;
/**
* command maps all fields of the entity
*
* uses parent method for mapping of document_name and id
*/
clas... |
Lib: Add `ERROR` prefix to error messages | /**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var config = require('../plot_api/plot_config');
var loggers = module.exports = {};
/**
* -------------------... | /**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var config = require('../plot_api/plot_config');
var loggers = module.exports = {};
/**
* -------------------... |
Disable the creation of new scripts in certain environments (prod). | package whelk.gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class RunOrCreatePanel extends WizardCard implements ActionListener
{
private JRadioButton rCreate;
private JRadioButton rRun;
public RunOrCreatePanel(Wizard wizard)... | package whelk.gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class RunOrCreatePanel extends WizardCard implements ActionListener
{
private JRadioButton rCreate;
private JRadioButton rRun;
public RunOrCreatePanel(Wizard wizard)... |
Use newer Message Broker publish method. | <?php
namespace VotingApp\Services;
use MessageBroker as MessageBrokerConnection;
class MessageBroker
{
/**
* Serialize and send payload to the Message Broker using a
* given routing key.
*
* @param array $payload
* @param string $routingKey
*/
public function publishRaw($payloa... | <?php
namespace VotingApp\Services;
use MessageBroker as MessageBrokerConnection;
class MessageBroker
{
/**
* Serialize and send payload to the Message Broker using a
* given routing key.
*
* @param array $payload
* @param string $routingKey
*/
public function publishRaw($payloa... |
initial-push: Allow factories to call factories, allow document, allow window, allow empty selector | (function() {
const domQuery = (function () {
function $(selector) {
let collection = (!selector ? [] :
(typeof selector === 'string') ? document.querySelectorAll(selector) :
(selector instanceof DQ) ? selector :
(typeof selector === 'object' && (selector.nodeType === 1 ... | (function() {
const domQuery = (function () {
function $(selector) {
let collection = ((typeof selector === 'string') ? document.querySelectorAll(selector) :
(typeof selector === 'object' && (selector.nodeType === 1 || selector.nodeType === 9)) ? [selector] : [] ),
instance = new DQ(c... |
Update score lookup to not load dataset file | import json
""" Input: Loaded dataset, a list of song and line indices
Output: List of tuples of words with highest tf-idf scores
Given a list of song-line tuple (song_index, line_index),
returns a list of a word-score tuple, with the word with highest score
at the head of the list.
"""
def score_looku... | import json
""" Input: the path of the dataset file, a list of song and line indices
Output: List of tuples of words with highest tf-idf scores
Given a list of song-line tuple (song_index, line_index),
returns a list of a word-score tuple, with the word with highest score
at the head of the list.
"""
d... |
Fix ValueError in IMUParser with non-ints in input | from tsparser.parser import BaseParser
class IMUParser(BaseParser):
def __init__(self):
self.gyro = None
self.accel = None
self.magnet = None
self.pressure = None
def parse(self, line, data_id, *values):
if data_id == '$GYRO':
self.gyro = [int(x) for x in v... | from tsparser.parser import BaseParser
class IMUParser(BaseParser):
def __init__(self):
self.gyro = None
self.accel = None
self.magnet = None
self.pressure = None
def parse(self, line, data_id, *values):
values = [int(x) for x in values]
if data_id == '$GYRO':
... |
Add reference to memory to base role. | 'use strict';
let counts = require('counts');
class BaseRole {
constructor(creep) {
this.creep = creep;
this.spawn = Game.spawns[creep.memory.spawnName];
this.memory = creep.memory;
}
static wantsToBuild(level) {
let want = this.LEVEL_INFO[level || 0].count || 0,
... | 'use strict';
let counts = require('counts');
class BaseRole {
constructor(creep) {
this.creep = creep;
this.spawn = Game.spawns[creep.memory.spawnName];
}
static wantsToBuild(level) {
let want = this.LEVEL_INFO[level || 0].count || 0,
typeKey = this.key(),
... |
Fix syntax error in service_status | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... | import logging
from django.utils.translation import ugettext as _
from molly.utils.views import BaseView
from molly.utils.breadcrumbs import *
logger = logging.getLogger("molly.apps.service_status.views")
class IndexView(BaseView):
"""
View to display service status information
"""
# TODO Remove sp... |
Add util.keys as Object.keys shim | if (typeof buster == "undefined") {
var buster = {};
}
buster.util = (function () {
var toString = Object.prototype.toString;
var div = typeof document != "undefined" && document.createElement("div");
return {
isNode: function (obj) {
if (!div) {
return false;
... | if (typeof buster == "undefined") {
var buster = {};
}
buster.util = (function () {
var toString = Object.prototype.toString;
var div = typeof document != "undefined" && document.createElement("div");
return {
isNode: function (obj) {
if (!div) {
return false;
... |
Remove PHP 7.1 specific code | <?php
/*
* This file is part of the Active Collab Bootstrap project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/
namespace ActiveCollab\Bootstrap\Controller;
use ActiveCollab\Authentication\AuthenticatedUser\AuthenticatedUserInterface;
use ActiveCollab\Authentication\AuthenticationResult\Aut... | <?php
/*
* This file is part of the Active Collab Bootstrap project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/
namespace ActiveCollab\Bootstrap\Controller;
use ActiveCollab\Authentication\AuthenticatedUser\AuthenticatedUserInterface;
use ActiveCollab\Authentication\AuthenticationResult\Aut... |
:wrench: Improve logical on deserialize listener | <?php
namespace OAuthBundle\EventListener;
use ApiPlatform\Core\Exception\RuntimeException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use ApiPlatform\Core\EventListener\DeserializeListener as DecoratedListener;
use Symfony\Component\Serializer\Normalizer\De... | <?php
namespace OAuthBundle\EventListener;
use ApiPlatform\Core\Exception\RuntimeException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use ApiPlatform\Core\EventListener\DeserializeListener as DecoratedListener;
use Symfony\Component\Serializer\Normalizer\De... |
Revert "MacOSX - Suppress EDT exception in NoInputEventQueue.drain()"
This reverts commit 98807717fd5f0153ad1ce918236ea7ab8ad5be40. | /* Copyright (C) 2005-2011 Fabio Riccardi */
package com.lightcrafts.utils.awt;
import java.awt.EventQueue;
import java.util.EmptyStackException;
import java.lang.reflect.InvocationTargetException;
/**
* A <code>PoppableEventQueue</code> is-an {@link EventQueue} that merely
* makes the ordinarily <code>protected</... | /* Copyright (C) 2005-2011 Fabio Riccardi */
package com.lightcrafts.utils.awt;
import java.awt.EventQueue;
import java.util.EmptyStackException;
import java.lang.reflect.InvocationTargetException;
/**
* A <code>PoppableEventQueue</code> is-an {@link EventQueue} that merely
* makes the ordinarily <code>protected</... |
Add parameter to app as executable file | /**
* Project RSA Algorithm.
* Copyright Michał Szczygieł.
* Created at Feb 24, 2014.
*/
import java.io.IOException;
import java.io.OutputStream;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
/**
* This class is resposnible for testing and representation data for RSA
* encryption algorith... | /**
* Project RSA Algorithm.
* Copyright Michał Szczygieł.
* Created at Feb 24, 2014.
*/
import java.io.IOException;
import java.io.OutputStream;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
/**
* This class is resposnible for testing and representation data for RSA
* encryption algorith... |
Fix compilation issue on not latest JDKs | /*
* (c) 2015 CenturyLink. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | /*
* (c) 2015 CenturyLink. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
Use IoC bound model rather than hard coding | <?php
declare(strict_types=1);
namespace Cortex\Fort\Http\Controllers\Userarea;
use Illuminate\Http\Request;
use Cortex\Foundation\Http\Controllers\AuthenticatedController;
class AccountSessionsController extends AuthenticatedController
{
/**
* Show the account sessions.
*
* @return \Illuminate\H... | <?php
declare(strict_types=1);
namespace Cortex\Fort\Http\Controllers\Userarea;
use Illuminate\Http\Request;
use Rinvex\Fort\Models\Session;
use Cortex\Foundation\Http\Controllers\AuthenticatedController;
class AccountSessionsController extends AuthenticatedController
{
/**
* Show the account sessions.
... |
Delete require cache rather than create endless directories | 'use strict'
const fs = require('fs')
const path = require('path')
const mkdirp = require('mkdirp')
const assign = require('lodash.assign')
const makeTemplate = require('./make-template.js')
const defaultDirectives = require('./default-directives.js')
module.exports = function (directory, settings) {
settings = set... | 'use strict'
const fs = require('fs')
const path = require('path')
const mkdirp = require('mkdirp')
const assign = require('lodash.assign')
const makeTemplate = require('./make-template.js')
const defaultDirectives = require('./default-directives.js')
module.exports = function (directory, settings) {
settings = set... |
Update watchers before adding widget | 'use strict';
angular.module('Teem')
.factory('needWidget', [
'$compile', '$timeout',
function($compile, $timeout) {
var editor, scope;
function init (e, s) {
editor = e;
scope = s;
editor.registerWidget('need', {
onInit: function(parent, needId) {
var element = angu... | 'use strict';
angular.module('Teem')
.factory('needWidget', [
'$compile', '$timeout',
function($compile, $timeout) {
var editor, scope;
function init (e, s) {
editor = e;
scope = s;
editor.registerWidget('need', {
onInit: function(parent, needId) {
var element = angu... |
Change MENU to new loader format | define(['mac/roman'], function(macintoshRoman) {
'use strict';
return function(item) {
return item.getBytes().then(function(bytes) {
var dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
var dataObject = {
id: dv.getUint16(0, false),
definitionProcedureResource... | define(['mac/roman'], function(macintoshRoman) {
'use strict';
return function(resource) {
var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength);
resource.dataObject = {
id: dv.getUint16(0, false),
definitionProcedureResourceID: dv.getUint16(6, false... |
Make the GSample field protected for use by sub classes | package ganglia;
import ganglia.gmetric.GMetricSlope;
import ganglia.gmetric.GMetricType;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.manage... | package ganglia;
import ganglia.gmetric.GMetricSlope;
import ganglia.gmetric.GMetricType;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.manage... |
Add helper for home page content | var fs, path, markdown;
fs = require('fs');
path = require("path");
markdown = require( "markdown" ).markdown;
module.exports = {
publicClasses: function(context, options) {
'use strict';
var ret = "";
for(var i=0; i < context.length; i++) {
if(!context[i].itemtype && context[i... | fs = require('fs');
module.exports = {
publicClasses: function(context, options) {
'use strict';
var ret = "";
for(var i=0; i < context.length; i++) {
if(!context[i].itemtype && context[i].access === 'public') {
ret = ret + options.fn(context[i]);
} ... |
Clear proxy dir before generating new proxies | <?php
namespace Isolate\Symfony\IsolateBundle\Command;
use Isolate\LazyObjects\Proxy\Adapter\OcramiusProxyManager\Factory\LazyObjectsFactory;
use Isolate\LazyObjects\Proxy\Definition;
use Isolate\Symfony\IsolateBundle\LazyObject\DefinitionCollection;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
u... | <?php
namespace Isolate\Symfony\IsolateBundle\Command;
use Isolate\LazyObjects\Proxy\Adapter\OcramiusProxyManager\Factory\LazyObjectsFactory;
use Isolate\LazyObjects\Proxy\Definition;
use Isolate\Symfony\IsolateBundle\LazyObject\DefinitionCollection;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
u... |
Apply upper to the argument value | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from typing import Callable, Optional
from ._null_logger import NullLogger
MODULE_NAME = "subprocrunner"
DEFAULT_ERROR_LOG_LEVEL = "WARNING"
try:
from loguru import logger
LOGURU_INSTALLED = True
logger.disable(MODULE_NAME)
exce... | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from typing import Callable, Optional
from ._null_logger import NullLogger
MODULE_NAME = "subprocrunner"
DEFAULT_ERROR_LOG_LEVEL = "WARNING"
try:
from loguru import logger
LOGURU_INSTALLED = True
logger.disable(MODULE_NAME)
exce... |
Simplify webpack, unsuccessfull at fixing sourcemap output | const path = require('path');
const webpack = require('webpack');
const WebpackNotifierPlugin = require('webpack-notifier');
const styleLintPlugin = require('stylelint-webpack-plugin');
const env = process.env.NODE_ENV;
module.exports = {
devtool: env === 'production' ? 'source-map' : 'eval',
entry: './src',
... | const path = require('path');
const webpack = require('webpack');
const WebpackNotifierPlugin = require('webpack-notifier');
const styleLintPlugin = require('stylelint-webpack-plugin');
const autoprefixer = require('autoprefixer');
const env = process.env.NODE_ENV;
module.exports = {
devtool: env === 'production'... |
Fix path parsing when a bucket prefix is not specified
This allows the registry to be written to the root of a bucket and thus be accessible using S3's static website hosting feature | <?php
namespace Jalle19\VagrantRegistryGenerator\Configuration;
use Symfony\Component\Console\Input\InputInterface;
/**
* Class Parser
* @package Jalle19\VagrantRegistryGenerator\Configuration
*/
class Parser
{
/**
* @param InputInterface $input
*
* @return Configuration
*/
public sta... | <?php
namespace Jalle19\VagrantRegistryGenerator\Configuration;
use Symfony\Component\Console\Input\InputInterface;
/**
* Class Parser
* @package Jalle19\VagrantRegistryGenerator\Configuration
*/
class Parser
{
/**
* @param InputInterface $input
*
* @return Configuration
*/
public sta... |
Revert change for lower versions to still work. | <?php
namespace Ambta\DoctrineEncryptBundle\Encryptors;
use \ParagonIE\Halite\HiddenString;
use \ParagonIE\Halite\KeyFactory;
/**
* Class for encrypting and decrypting with the halite library
*
* @author Michael de Groot <specamps@gmail.com>
*/
class HaliteEncryptor implements EncryptorInterface
{
private $... | <?php
namespace Ambta\DoctrineEncryptBundle\Encryptors;
use \ParagonIE\HiddenString\HiddenString;
use \ParagonIE\Halite\KeyFactory;
/**
* Class for encrypting and decrypting with the halite library
*
* @author Michael de Groot <specamps@gmail.com>
*/
class HaliteEncryptor implements EncryptorInterface
{
pri... |
Fix requests-mock version requirement (>=1.2.0) | #!/usr/bin/env python
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
setup(
name='mock-services',
version=open(os.path.join(here, 'VERSION')).read().strip(),
description='Mock services.',
long_description=open(os.path.join(here, 'README.rst')).read(),
c... | #!/usr/bin/env python
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
setup(
name='mock-services',
version=open(os.path.join(here, 'VERSION')).read().strip(),
description='Mock services.',
long_description=open(os.path.join(here, 'README.rst')).read(),
c... |
Switch to normal pox instead of betta | from experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer, Interactive
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantChecker
from sts.simulation_state import SimulationConfig
# Use POX as our controlle... | from experiment_config_lib import ControllerConfig
from sts.topology import MeshTopology
from sts.control_flow import Fuzzer, Interactive
from sts.input_traces.input_logger import InputLogger
from sts.invariant_checker import InvariantChecker
from sts.simulation_state import SimulationConfig
# Use POX as our controlle... |
Adjust test for returned name | from common import *
class TestBasicCreate(TestCase):
def test_create_default_return(self):
sg = Shotgun()
type_ = 'Dummy' + mini_uuid().upper()
spec = dict(name=mini_uuid())
proj = sg.create(type_, spec)
print proj
self.assertIsNot(spec, proj)
self.ass... | from common import *
class TestBasicCreate(TestCase):
def test_create_default_return(self):
sg = Shotgun()
type_ = 'Dummy' + mini_uuid().upper()
spec = dict(name=mini_uuid())
proj = sg.create(type_, spec)
self.assertIsNot(spec, proj)
self.assertEqual(len(proj),... |
Fix bug in previous comit. |
/*
* Copyright (C) 2012 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package org.dellroad.stuff.pobj;
import java.util.Set;
import javax.validation.ConstraintViolation;
/**
* Runtime exception thrown during {@link PersistentObject} operations.
*/
@SuppressWarnings("serial")
public class PersistentObject... |
/*
* Copyright (C) 2012 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package org.dellroad.stuff.pobj;
import java.util.Set;
import javax.validation.ConstraintViolation;
/**
* Runtime exception thrown during {@link PersistentObject} operations.
*/
@SuppressWarnings("serial")
public class PersistentObject... |
Remove ending '.' in hostname. (for those fucking libs that knows nothing about RFC) | import dns.resolver
import dns.query
from dns.exception import DNSException
# Resolve service from mesos-dns SRV record
# return dict {"servicename": [{"name": "service.f.q.d.n.", "port": 9999}]}
def resolve(app, conf):
hosts = {}
services = app['services']
domain = conf['domain']
group = None
if... | import dns.resolver
import dns.query
from dns.exception import DNSException
# Resolve service from mesos-dns SRV record
# return dict {"servicename": [{"name": "service.f.q.d.n.", "port": 9999}]}
def resolve(app, conf):
hosts = {}
services = app['services']
domain = conf['domain']
group = None
if... |
Fix checking correct component class | <?php
class Kwc_Directories_TopChoose_Component extends Kwc_Directories_Top_Component
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['showDirectoryClass'] = 'Kwc_Directories_Item_Directory_Component'; // nur für form
$ret['ownModel'] = 'Kwc_Directories_TopCho... | <?php
class Kwc_Directories_TopChoose_Component extends Kwc_Directories_Top_Component
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['showDirectoryClass'] = 'Kwc_Directories_Item_Directory_Component'; // nur für form
$ret['ownModel'] = 'Kwc_Directories_TopCho... |
Remove unnecessary u on string | import argparse
import sys
from pipreq.command import Command
def create_parser():
parser = argparse.ArgumentParser(
description='Manage Python package requirements across multiple environments using '
'per-environment requirements files.')
parser.add_argument('-g', '--generate',... | import argparse
import sys
from pipreq.command import Command
def create_parser():
parser = argparse.ArgumentParser(
description='Manage Python package requirements across multiple environments using '
'per-environment requirements files.')
parser.add_argument('-g', '--generate',... |
Support accessing a long value after being closed for graceful shutdown | /*
* Copyright 2016-2020 Chronicle Software
*
* https://chronicle.software
*
* 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
*
* ... | /*
* Copyright 2016-2020 Chronicle Software
*
* https://chronicle.software
*
* 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
*
* ... |
Use INTL_IDNA_VARIANT_UTS46 instead of INTL_IDNA_VARIANT_2003 | <?php
/**
* @author AIZAWA Hina <hina@fetus.jp>
* @copyright 2015-2019 by AIZAWA Hina <hina@fetus.jp>
* @license https://github.com/fetus-hina/yii2-extra-validator/blob/master/LICENSE MIT
* @since 1.0.1
*/
namespace jp3cki\yii2\validators;
use yii\validators\FilterValidator;
use function idn_to_ascii;
use con... | <?php
/**
* @author AIZAWA Hina <hina@fetus.jp>
* @copyright 2015-2019 by AIZAWA Hina <hina@fetus.jp>
* @license https://github.com/fetus-hina/yii2-extra-validator/blob/master/LICENSE MIT
* @since 1.0.1
*/
namespace jp3cki\yii2\validators;
use yii\validators\FilterValidator;
/**
* The filter validator which c... |
Fix test for inline toolbar | import React, { Component } from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import Toolbar from '../index';
describe('Toolbar', () => {
it('allows children to override the content', (done) => {
const structure = [class Child extends Component {
componentDidMount() {
set... | import React, { Component } from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import Toolbar from '../index';
describe('Toolbar', () => {
it('allows children to override the content', (done) => {
const structure = [class Child extends Component {
componentDidMount() {
set... |
Fix share via email link
Former-commit-id: cef1ba1359496c484c06881a6593952d514cab96 | <?php
namespace Concrete\Core\Sharing\ShareThisPage;
use Concrete\Core\Sharing\SocialNetwork\Service as SocialNetworkService;
use Config;
class Service extends SocialNetworkService
{
public static function getByHandle($ssHandle)
{
$services = ServiceList::get();
foreach($services as $s) {
... | <?php
namespace Concrete\Core\Sharing\ShareThisPage;
use Concrete\Core\Sharing\SocialNetwork\Service as SocialNetworkService;
class Service extends SocialNetworkService
{
public static function getByHandle($ssHandle)
{
$services = ServiceList::get();
foreach($services as $s) {
if (... |
Add MPD_SERVER_PASSWORD to list of relevant frontend settings | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... | import logging
from mopidy.frontends.base import BaseFrontend
from mopidy.frontends.mpd.dispatcher import MpdDispatcher
from mopidy.frontends.mpd.thread import MpdThread
from mopidy.utils.process import unpickle_connection
logger = logging.getLogger('mopidy.frontends.mpd')
class MpdFrontend(BaseFrontend):
"""
... |
Add the last line to the info message | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... | from collections import defaultdict
from logging import getLogger
from pip._vendor.resolvelib.reporters import BaseReporter
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import DefaultDict
from .base import Candidate
logger = getLogger(__name__)
class PipRe... |
Improve ESLint options for Webpack | 'use strict';
const path = require('path');
const webpack = require('webpack');
module.exports = {
cache: true,
devtool: '#source-map',
entry: [
path.resolve(__dirname, 'src', 'index.js')
],
module: {
rules: [
{
enforce: 'pre',
include: [
path.resolve(__dirname, 's... | 'use strict';
const path = require('path');
const webpack = require('webpack');
module.exports = {
cache: true,
devtool: '#source-map',
entry: [
path.resolve(__dirname, 'src', 'index.js')
],
module: {
rules: [
{
enforce: 'pre',
include: [
path.resolve(__dirname, 's... |
Update balancers entry point to be coordinators. | from setuptools import setup, find_packages
from lighthouse import __version__
classifiers = []
with open("classifiers.txt") as fd:
classifiers = fd.readlines()
setup(
name="lighthouse",
version=__version__,
description="Service discovery tool focused on ease-of-use and resiliency",
author="Wil... | from setuptools import setup, find_packages
from lighthouse import __version__
classifiers = []
with open("classifiers.txt") as fd:
classifiers = fd.readlines()
setup(
name="lighthouse",
version=__version__,
description="Service discovery tool focused on ease-of-use and resiliency",
author="Wil... |
Add config check to memcache resource provider | <?php
/**
* Provides resource to access memcache server.
*
* Parameters:
* - [memcache.host]
* - [memcache.port]
* - [memcache.unix_socket]
* - [memcache.namespace]
*
* Services:
* - [memcache] instance of CacheCollection
**/
namespace Ob_Ivan\DropboxProxy\ResourceProvider;
use Ob_Ivan\Cache\Driver\Memc... | <?php
/**
* Provides resource to access memcache server.
*
* Parameters:
* - [memcache.host]
* - [memcache.port]
* - [memcache.unix_socket]
* - [memcache.namespace]
*
* Services:
* - [memcache] instance of CacheCollection
**/
namespace Ob_Ivan\DropboxProxy\ResourceProvider;
use Ob_Ivan\Cache\Driver\Memc... |
Add basic http authentication for all http requests on testserver | "use strict";
// Load the libraries and modules
var assets = require(__dirname + '/data/assets.json');
var config = {
npm: __dirname + '/node_modules/',
libraries: {
nodejs: {},
npm: {}
},
directory: __dirname + '/modules/',
modules: {
npm: {
'dragonnodejs-webse... | "use strict";
// Load the libraries and modules
var assets = require(__dirname + '/data/assets.json');
var config = {
npm: __dirname + '/node_modules/',
libraries: {
nodejs: {},
npm: {}
},
directory: __dirname + '/modules/',
modules: {
npm: {
'dragonnodejs-webse... |
Reset the request instance after the tests complete | <?php
require_once __DIR__ . "/ResolverTestCase.php";
class CanonicalUrlResolverTest extends ResolverTestCase
{
protected function setUp()
{
$this->urlResolver = new \Concrete\Core\Url\Resolver\CanonicalUrlResolver();
}
public function testConfig()
{
$canonical = "http://example.... | <?php
require_once __DIR__ . "/ResolverTestCase.php";
class CanonicalUrlResolverTest extends ResolverTestCase
{
protected function setUp()
{
$this->urlResolver = new \Concrete\Core\Url\Resolver\CanonicalUrlResolver();
}
public function testConfig()
{
$canonical = "http://example.... |
Replace nbsp in plain text
ref #33 | var plain_text_clone = null;
function toggle_plain_text() {
var lines = document.querySelectorAll("td.code_line"),
line_len = lines.length,
text = "",
plain_pre = document.querySelectorAll("pre.simple_code_page"),
orig_pre, pre, i, j, spans, span_len, span;
if (plain_pre.length ... | var plain_text_clone = null;
function toggle_plain_text() {
var lines = document.querySelectorAll("td.code_line"),
line_len = lines.length,
text = "",
plain_pre = document.querySelectorAll("pre.simple_code_page"),
orig_pre, pre, i, j, spans, span_len, span;
if (plain_pre.length ... |
Add the default options for the salt master | '''
All salt configuration loading and defaults should be in this module
'''
# Import python modules
import os
import sys
import socket
# Import third party libs
import yaml
def minion_config(path):
'''
Reads in the minion configuration file and sets up special options
'''
opts = {'master': 'mcp',
... | '''
All salt configuration loading and defaults should be in this module
'''
# Import python modules
import os
import sys
import socket
# Import third party libs
import yaml
def minion_config(path):
'''
Reads in the minion configuration file and sets up special options
'''
opts = {'master': 'mcp',
... |
Move status into initial check; fails when instance is stopped already | # License under the MIT License - see LICENSE
import boto.ec2
import os
import time
def launch(key_name=None, region='us-west-2', image_id='ami-5189a661',
instance_type='t2.micro', security_groups='launch-wizard-1',
user_data=None, initial_check=True):
'''
'''
if not isinstance(sec... | # License under the MIT License - see LICENSE
import boto.ec2
import os
import time
def launch(key_name=None, region='us-west-2', image_id='ami-5189a661',
instance_type='t2.micro', security_groups='launch-wizard-1',
user_data=None, initial_check=True):
'''
'''
if not isinstance(sec... |
Remove rebajado label if product is out of stock | <?php setup_postdata($post); ?>
<figure class="product-wrap thumbnail">
<?php if ( fik_product_stock_quantity() == 0) { ?>
<span class="label label-warning product-state">Out of stock</span>
<?php } ?>
<?php if ( get_fik_previous_price() && fik_product_stock_quantity() != ... | <?php setup_postdata($post); ?>
<figure class="product-wrap thumbnail">
<?php if ( fik_product_stock_quantity() == 0) { ?>
<span class="label label-warning product-state">Out of stock</span>
<?php } ?>
<?php if ( get_fik_previous_price() ) { ?>
<span class="lab... |
Support Symfony Process 2.3 "process timed-out" exception message | <?php
namespace Liip\RMT\Tests\Functional;
use Exception;
use Liip\RMT\Context;
use Liip\RMT\Prerequisite\TestsCheck;
class TestsCheckTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
$informationCollector = $this->getMock('Liip\RMT\Information\InformationCollector');
$i... | <?php
namespace Liip\RMT\Tests\Functional;
use Exception;
use Liip\RMT\Context;
use Liip\RMT\Prerequisite\TestsCheck;
class TestsCheckTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
$informationCollector = $this->getMock('Liip\RMT\Information\InformationCollector');
$i... |
Include java 11 to supported list | /*
* Copyright 2017 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | /*
* Copyright 2017 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
Hide basket table if no search assets. | import { Util } from "../../util.js";
export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
... | export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
<input id="assetsSearch" size... |
Add a maximum hue for link color | define([
'./module',
'jquery',
'text!./link.html'
], function(directives, $, linkTpl) {
'use strict';
directives.directive('zoriLink', ['$interval',
function($interval) {
function link(scope, element, attrs) {
var timeoutId;
var $link = $(element)... | define([
'./module',
'jquery',
'text!./link.html'
], function(directives, $, linkTpl) {
'use strict';
directives.directive('zoriLink', ['$interval',
function($interval) {
function link(scope, element, attrs) {
var timeoutId;
var $link = $(element)... |
Use LazyStrings instance in container.
The command uses the LazyStrings instance in the container for the deployment command. | <?php namespace Nobox\LazyStrings\Commands;
use Nobox\LazyStrings\LazyStrings;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class LazyDeployCommand extends Command {
/**
* The console command name.
*
* @var str... | <?php namespace Nobox\LazyStrings\Commands;
use Nobox\LazyStrings\LazyStrings;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class LazyDeployCommand extends Command {
/**
* The console command name.
*
* @var str... |
Add constant; fix var name | import { _SUCCESS, _ERROR } from 'constants'
const pending = {} // requestIDs to timeoutIDs
let nextRequestID = 0
export default function createSocketMiddleware (socket, prefix) {
return ({ dispatch }) => {
// dispatch incoming actions sent by the server
socket.on('action', dispatch)
return next => acti... | import { _ERROR } from 'constants'
const pendingIds = {} // requestIDs to timeoutIDs
let nextRequestID = 0
export default function createSocketMiddleware (socket, prefix) {
return ({ dispatch }) => {
// dispatch incoming actions sent by the server
socket.on('action', dispatch)
return next => action => {... |
Change karma browser for tests from Chrome to PhantomJS | var path = require('path');
module.exports = function(config) {
config.set({
browsers: ['PhantomJS'],
coverageReporter: {
reporters: [
{
type: 'html',
subdir: 'html'
}, {
type: 'lcovonly',
... | var path = require('path');
module.exports = function(config) {
config.set({
browsers: ['Chrome'],
coverageReporter: {
reporters: [
{
type: 'html',
subdir: 'html'
}, {
type: 'lcovonly',
... |
Make brand link a router link | var React = require('react');
var title = "Orion's Belt BattleGrounds";
var Router = require('react-router');
var Route = Router.Route, DefaultRoute = Router.DefaultRoute,
Link=Router.Link, RouteHandler = Router.RouteHandler;
var CurrentUserMenu = require('../users/CurrentUserMenu.react.js');
var Header =... | var React = require('react');
var title = "Orion's Belt BattleGrounds";
var Router = require('react-router');
var Route = Router.Route, DefaultRoute = Router.DefaultRoute,
Link=Router.Link, RouteHandler = Router.RouteHandler;
var CurrentUserMenu = require('../users/CurrentUserMenu.react.js');
var Header =... |
Fix in test result renderer. | 'use strict';
var Component = require('../ui/Component');
function ResultItem() {
ResultItem.super.apply(this, arguments);
}
ResultItem.Prototype = function() {
this.shouldRerender = function() {
return false;
};
this.render = function($$) {
var test = this.props.test;
var result = this.props.r... | 'use strict';
var Component = require('../ui/Component');
function ResultItem() {
ResultItem.super.apply(this, arguments);
}
ResultItem.Prototype = function() {
this.shouldRerender = function() {
return false;
};
this.render = function($$) {
var test = this.props.test;
var result = this.props.r... |
Upgrade ldap3 0.9.9.1 => 0.9.9.2 | import sys
from setuptools import find_packages, setup
VERSION = '2.0.dev0'
install_requires = [
'django-local-settings>=1.0a10',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils',
version=VERSION,
url='https://github.com/PSU... | import sys
from setuptools import find_packages, setup
VERSION = '2.0.dev0'
install_requires = [
'django-local-settings>=1.0a10',
'stashward',
]
if sys.version_info[:2] < (3, 4):
install_requires.append('enum34')
setup(
name='django-arcutils',
version=VERSION,
url='https://github.com/PSU... |
Allow other packages to use `out` (for example the intelliJ plugin) | package com.redhat.ceylon.compiler.typechecker.treegen;
public class Util {
public static java.io.PrintStream out = System.out;
public static String className(String nodeName) {
return toJavaIdentifier(nodeName, true);
}
public static String fieldName(String nodeName) {
re... | package com.redhat.ceylon.compiler.typechecker.treegen;
public class Util {
static java.io.PrintStream out = System.out;
public static String className(String nodeName) {
return toJavaIdentifier(nodeName, true);
}
public static String fieldName(String nodeName) {
return to... |
Handle case where function caller is null | (function(root, factory) {
'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
/* istanbul ignore next */
if (typeof define === 'function' && define.amd) {
define('stack-generator', ['stackframe'], factory);
} else if (typeof exports ===... | (function(root, factory) {
'use strict';
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
/* istanbul ignore next */
if (typeof define === 'function' && define.amd) {
define('stack-generator', ['stackframe'], factory);
} else if (typeof exports ===... |
Test that .info() and .warn() set the correct event type.
Former-commit-id: 14a833f5c8c252e2e09d8c7ea3e154c3978c403f [formerly 17449ebde702c82594b0d592047ae7c684f14fc9]
Former-commit-id: 3b45559df0c8bdc6d5fec59793a9981c71e62e33 | package org.gem.log;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.junit.Test;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.*;
import static org.hamcrest.CoreMatchers.*;
public class AMQPApp... | package org.gem.log;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.junit.Test;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.*;
import static org.hamcrest.CoreMatchers.*;
public class AMQPApp... |
Make link property optional on a slide | import React from 'react';
import styles from './Slide.css';
import {hashHistory} from 'react-router'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import NeufundLogo from '../../../images/NeuFund_icon_light.png';
class Slide extends React.Component {
constructor(props) {
super(props)... | import React from 'react';
import styles from './Slide.css';
import {hashHistory} from 'react-router'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import NeufundLogo from '../../../images/NeuFund_icon_light.png';
class Slide extends React.Component {
constructor(props) {
super(props)... |
Fix url to transaciton sound | 'use strict';
angular.module('insight.address').controller('AddressController',
function($scope, $rootScope, $routeParams, $location, Global, Address, getSocket) {
$scope.global = Global;
var socket = getSocket($scope);
var _startSocket = function () {
socket.on('bitcoind/addresstxid', function(... | 'use strict';
angular.module('insight.address').controller('AddressController',
function($scope, $rootScope, $routeParams, $location, Global, Address, getSocket) {
$scope.global = Global;
var socket = getSocket($scope);
var _startSocket = function () {
socket.on('bitcoind/addresstxid', function(... |
Add jQuery plugin on page load, not domready
The phileo plugin was added to jQuery in the domready event callback. As
this plugin could be loaded at the bottom of a page - AFTER phileo
widget scripts - it was possible for the phileo plugin to not be
loaded when the widgets were initialized in the domready event. As th... | !function($){
"use strict";
var PhileoLikes = function(form, options) {
this.options = $.extend({}, $.fn.phileo.defaults, options);
this.$form = $(form);
this.$count = $(this.options.count);
var self = this;
this.$form.submit(function(event) {
event.prevent... | jQuery(function($) {
var PhileoLikes = function(form, options) {
this.options = $.extend({}, $.fn.phileo.defaults, options);
this.$form = $(form);
this.$count = $(this.options.count);
var self = this;
this.$form.submit(function(event) {
event.preventDefault();
... |
Change option 'Processos Seletivos' to dropdown item | <?php
/**
*Class for processing framework with HTML standards.
*
*@package Html
*@author Vinicius Pinheiro <viny-pinheiro@hotmail.com>
*@license MIT License
*@link http://eletronjun.com.br/class/html/communityMenu.php
*/
namespace html{
include_once __DIR__ . "/../autoload.php";
use \utilities\Sess... | <?php
/**
*Class for processing framework with HTML standards.
*
*@package Html
*@author Vinicius Pinheiro <viny-pinheiro@hotmail.com>
*@license MIT License
*@link http://eletronjun.com.br/class/html/communityMenu.php
*/
namespace html{
include_once __DIR__ . "/../autoload.php";
use \utilities\Sess... |
fix: Add parser to ts overrides | module.exports = {
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
rules: {
// typescript will handle this so no need for it
'no-undef': 'off',
'no-unused-vars': 'off',
'no-use-before-define': ... | module.exports = {
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
// typescript will handle this so no need for it
'no-undef': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-unus... |
:bug: Fix the specific chars not shown on post data | (() => {
"use strict";
let settings = {
baseurl: "",
accessToken: "",
};
chrome.storage.sync.get(settings, function(storage) {
settings.baseurl = storage.baseurl;
settings.accessToken = storage.accessToken;
});
document.querySelector("#toot").addEventListener("click", toot);
document.a... | (() => {
"use strict";
let settings = {
baseurl: "",
accessToken: "",
};
chrome.storage.sync.get(settings, function(storage) {
settings.baseurl = storage.baseurl;
settings.accessToken = storage.accessToken;
});
document.querySelector("#toot").addEventListener("click", toot);
document.a... |
Add more files to ignore for production task | module.exports = {
folder: {
tasks: 'tasks',
src: 'src',
build: 'assets',
prod: 'production'
},
task: {
htmlHint: 'html-hint',
jsHint: 'js-hint',
buildCustomJs: 'build-custom-js',
buildJsVendors: 'build-js-vendors',
buildSass: 'build-sass',
buildSassProd: 'build-sass-produc... | module.exports = {
folder: {
tasks: 'tasks',
src: 'src',
build: 'assets',
prod: 'production'
},
task: {
htmlHint: 'html-hint',
jsHint: 'js-hint',
buildCustomJs: 'build-custom-js',
buildJsVendors: 'build-js-vendors',
buildSass: 'build-sass',
buildSassProd: 'build-sass-produc... |
Fix result loading for novel mutations | from models import Protein, Mutation
from database import get_or_create
class SearchResult:
def __init__(self, protein, mutation, is_mutation_novel, type, **kwargs):
self.protein = protein
self.mutation = mutation
self.is_mutation_novel = is_mutation_novel
self.type = type
... | from models import Protein, Mutation
class SearchResult:
def __init__(self, protein, mutation, is_mutation_novel, type, **kwargs):
self.protein = protein
self.mutation = mutation
self.is_mutation_novel = is_mutation_novel
self.type = type
self.meta_user = None
self... |
Add pytest-mock to the dependencies | from setuptools import setup
setup(
name='webcomix',
version=1.3,
description='Webcomic downloader',
long_description='webcomix is a webcomic downloader that can additionally create a .cbz file once downloaded.',
url='https://github.com/J-CPelletier/webcomix',
author='Jean-Christophe Pelletier'... | from setuptools import setup
setup(
name='webcomix',
version=1.3,
description='Webcomic downloader',
long_description='webcomix is a webcomic downloader that can additionally create a .cbz file once downloaded.',
url='https://github.com/J-CPelletier/webcomix',
author='Jean-Christophe Pelletier'... |
Fix test extraction in FileReaderDecorator. | # Copyright (c) 2017-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecor... | # Copyright (c) 2017 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
from . import CallableDecorator
class FileReaderDecorator(... |
Fix mock needing config_file variable | from __future__ import absolute_import, unicode_literals
import argparse
import unittest
from nose.tools import ok_
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from streamparse.cli.run import main, subparser_hook
class RunTestCase(unittest.TestCase):
def test_subpar... | from __future__ import absolute_import, unicode_literals
import argparse
import unittest
from nose.tools import ok_
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from streamparse.cli.run import main, subparser_hook
class RunTestCase(unittest.TestCase):
def test_subpar... |
Add aiAttack details to swarmer | import {
child, avenger, protector, persecutor,
scorpion,
} from 'emoji';
export default {
/* The Good Guys */
child: {
name: `Child`,
emoji: child,
type: true,
maxHealth: 40,
abilities: {
move: {
range: 3,
},
},
},
avenger: {
name: `Avenger`,
emoji: a... | import {
child, avenger, protector, persecutor,
scorpion,
} from 'emoji';
export default {
/* The Good Guys */
child: {
name: `Child`,
emoji: child,
type: true,
maxHealth: 40,
abilities: {
move: {
range: 3,
},
},
},
avenger: {
name: `Avenger`,
emoji: a... |
Rename BlankConfig to something that makes more sense | package ml.duncte123.skybot.config;
import com.google.gson.*;
import org.apache.commons.text.translate.UnicodeUnescaper;
import java.io.*;
public class ConfigLoader {
/**
* This will attempt to load the config and create it if it is not there
* @param file the file to load
* @return the loaded co... | package ml.duncte123.skybot.config;
import com.google.gson.*;
import org.apache.commons.text.translate.UnicodeUnescaper;
import java.io.*;
public class ConfigLoader {
/**
* This will attempt to load the config and create it if it is not there
* @param file the file to load
* @return the loaded co... |
Replace Base64 with low quality placeholder
That should also fix MMV | <?php
/**
* Lazyload class
*/
class Lazyload {
public static function LinkerMakeExternalImage(&$url, &$alt, &$img) {
global $wgRequest;
if (defined('MW_API') && $wgRequest->getVal('action') === 'parse') return true;
$url = preg_replace('/^(http|https):/', '', $url);
$img = '<span ... | <?php
/**
* Lazyload class
*/
class Lazyload {
public static function LinkerMakeExternalImage(&$url, &$alt, &$img) {
global $wgRequest;
if (defined('MW_API') && $wgRequest->getVal('action') === 'parse') return true;
$url = preg_replace('/^(http|https):/', '', $url);
$img = '<span ... |
Use class names in service provider. | <?php
namespace DvK\Laravel\Vat;
use Illuminate\Contracts\Container\Container;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator as RequestValidator;
class VatServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
publ... | <?php
namespace DvK\Laravel\Vat;
use Illuminate\Contracts\Container\Container;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator as RequestValidator;
class VatServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
publ... |
Add automatic regeneration for CLion | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
import sys
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.pa... | #!/usr/bin/env python3
"""This is a **proof-of-concept** CLion project generator."""
import functools
import json
import subprocess
subprocess.check_call(['cook', '--results'])
with open('results.json') as file:
content = json.load(file)
with open('CMakeLists.txt', 'w') as file:
w = functools.partial(print... |
Add tests for lines with both a count and percentage | #!/usr/bin/env python3
import pytest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_PacBio_log, parse_line
PARSABLE_LINES = [
'',
'ZMWs input... | #!/usr/bin/env python3
import pytest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_PacBio_log, parse_line
PARSABLE_LINES = [
'',
'ZMWs input... |
Convert directory output to the same as profile listing | @extends('components.content-area')
@section('content')
@include('components.page-title', ['title' => $page['title']])
<div class="content">
{!! $page['content']['main'] !!}
</div>
@forelse($profiles as $key => $profiles)
<h2>{{ $key }}</h2>
<div class="row flex flex-wrap -mx... | @extends('components.content-area')
@section('content')
@include('components.page-title', ['title' => $page['title']])
<div class="content">
{!! $page['content']['main'] !!}
</div>
@forelse($profiles as $key => $profiles)
<h2>{{ $key }}</h2>
<div class="row flex flex-wrap -mx... |
Remove commented out method call. | # -*- coding: utf-8 -*-
from .base_match import BaseMatchAdapter
from fuzzywuzzy import fuzz
class ClosestMatchAdapter(BaseMatchAdapter):
"""
The ClosestMatchAdapter creates a response by
using fuzzywuzzy's process class to extract the most similar
response to the input. This adapter selects a respons... | # -*- coding: utf-8 -*-
from .base_match import BaseMatchAdapter
from fuzzywuzzy import fuzz
class ClosestMatchAdapter(BaseMatchAdapter):
"""
The ClosestMatchAdapter creates a response by
using fuzzywuzzy's process class to extract the most similar
response to the input. This adapter selects a respons... |
Fix failing test for select | package seedu.address.logic.commands;
import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.core.Messages;
import seedu.address.commons.events.ui.JumpToListRequestEvent;
import seedu.address.model.activity.ReadOnlyActivity;
import seedu.address.commons.core.UnmodifiableObservableList;
/**
* Se... | package seedu.address.logic.commands;
import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.core.Messages;
import seedu.address.commons.events.ui.JumpToListRequestEvent;
import seedu.address.model.activity.ReadOnlyActivity;
import seedu.address.commons.core.UnmodifiableObservableList;
/**
* Se... |
Add version to update url | const app = require('electron').app
const autoUpdater = require('electron').autoUpdater
const Menu = require('electron').Menu
var state = 'checking'
exports.initialize = function () {
autoUpdater.on('checking-for-update', function () {
state = 'checking'
exports.updateMenu()
})
autoUpdater.on('update-a... | const autoUpdater = require('electron').autoUpdater
const Menu = require('electron').Menu
var state = 'checking'
exports.initialize = function () {
autoUpdater.on('checking-for-update', function () {
state = 'checking'
exports.updateMenu()
})
autoUpdater.on('update-available', function () {
state =... |
Fix from 'static::' to 'self::'. | <?php
namespace Imunew\Pipeline\Context;
/**
* Class Status
* @package Imunew\Pipeline
*/
class Status implements StatusInterface
{
/** @var string */
private static $INITIALIZED = 'initialized';
/** @var string */
private static $STARTED = 'started';
/** @var string */
private static $STO... | <?php
namespace Imunew\Pipeline\Context;
/**
* Class Status
* @package Imunew\Pipeline
*/
class Status implements StatusInterface
{
/** @var string */
private static $INITIALIZED = 'initialized';
/** @var string */
private static $STARTED = 'started';
/** @var string */
private static $STO... |
Add done result to replay | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... |
Set correct gen_description in rss importer. |
from datetime import datetime
from time import mktime
from django.core.management.base import BaseCommand
from django.utils.timezone import get_default_timezone, make_aware
from feedparser import parse
from ...models import Link
class Command(BaseCommand):
def handle(self, *urls, **options):
for url i... |
from datetime import datetime
from time import mktime
from django.core.management.base import BaseCommand
from django.utils.timezone import get_default_timezone, make_aware
from feedparser import parse
from ...models import Link
class Command(BaseCommand):
def handle(self, *urls, **options):
for url i... |
Optimize by using isdisjoint instead of finding intersection. | """
Derive a list of impossible differentials.
"""
import ast
import sys
def parse(line):
i, rounds, xss = ast.literal_eval(line)
yss = [set(xs) for xs in xss]
return (i, rounds, yss)
def main():
if len(sys.argv) != 3:
print("usage: ./find_ids.py [forward differentials file] [backward differe... | """
Derive a list of impossible differentials.
"""
import ast
import sys
def parse(line):
i, rounds, xss = ast.literal_eval(line)
yss = [set(xs) for xs in xss]
return (i, rounds, yss)
def main():
if len(sys.argv) != 3:
print("usage: ./find_ids.py [forward differentials file] [backward differe... |
chore(rollup): Mark strip-ansi as an external dependency | // @flow
import babel from 'rollup-plugin-babel';
// eslint-disable-next-line
export default function buildConfig(
// eslint-disable-next-line
entry /*: string*/,
// eslint-disable-next-line
dest /*: string*/
) /*: Object*/ {
return {
entry,
format: 'cjs',
plugins: [
... | // @flow
import babel from 'rollup-plugin-babel';
// eslint-disable-next-line
export default function buildConfig(
// eslint-disable-next-line
entry /*: string*/,
// eslint-disable-next-line
dest /*: string*/
) /*: Object*/ {
return {
entry,
format: 'cjs',
plugins: [
... |
Test the volume rather than series. | import os
from nose.tools import (assert_equal, assert_in, assert_true)
from ...helpers.logging import logger
from qipipe.interfaces import GroupDicom
from ... import ROOT
from ...helpers.logging import logger
# The test fixture.
FIXTURE = os.path.join(ROOT, 'fixtures', 'staging', 'breast', 'BreastChemo3',
... | import os
from nose.tools import (assert_equal, assert_in, assert_true)
from ...helpers.logging import logger
from qipipe.interfaces import GroupDicom
from ... import ROOT
from ...helpers.logging import logger
# The test fixture.
FIXTURE = os.path.join(ROOT, 'fixtures', 'staging', 'breast', 'BreastChemo3',
... |
Add version, utf-8 and some comments. | # -*- coding: utf-8 -*-
__version__ = '0.1'
from robot.api import logger
import os
import signal
import subprocess
ROBOT_LIBRARY_DOC_FORMAT = 'reST'
class DjangoLibrary:
"""A library for testing Django with Robot Framework.
"""
django_pid = None
selenium_pid = None
# TEST CASE => New instance... | from robot.api import logger
import os
import signal
import subprocess
ROBOT_LIBRARY_DOC_FORMAT = 'reST'
class DjangoLibrary:
"""A library for testing Django with Robot Framework.
"""
django_pid = None
selenium_pid = None
# TEST CASE => New instance is created for every test case.
# TEST S... |
Remove email from frontend config | <?php
return [
'title' => 'Веб студия «Палитра»',
'title_short' => 'Палитра',
'title_long' => 'Студия веб дизайна «Палитра»',
'phone' => '+3 8(099) 008 20 17',
'vk_link' => 'https://vk.com/id249896813',
'fb_link' => 'https://www.facebook.com/profile.php?id=100007822838492',
'tw_link' => 'htt... | <?php
return [
'adminEmail' => 'kalnyanton@gmail.com',
'title' => 'Веб студия «Палитра»',
'title_short' => 'Палитра',
'title_long' => 'Студия веб дизайна «Палитра»',
'phone' => '+3 8(099) 008 20 17',
'vk_link' => 'https://vk.com/id249896813',
'fb_link' => 'https://www.facebook.com/profile.ph... |
Build mat lib relative path | const path = require('path');
const webpack = require('webpack');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, './src'),
entry: {
'babylonjs-materials': path.resolve(__dirname, './src/legacy/legacy-grid.ts'),
},
... | const path = require('path');
const webpack = require('webpack');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, './src'),
entry: {
'babylonjs-materials': path.resolve(__dirname, './src/legacy/legacy.ts'),
},
o... |
Split mergeStream into its own function | 'use strict';
var fs = require('fs');
var split = require('split');
var argv = require('minimist')(process.argv.slice(2));
if (!argv.hasOwnProperty('file')) {
console.log('Usage: node index.js --file <path to line delimited GeoJSON FeatureCollections>');
} else {
mergeStream(argv.file, argv.output);
}
functi... | 'use strict';
var fs = require('fs');
var split = require('split');
var argv = require('minimist')(process.argv.slice(2));
module.exports = function () {
if (!argv.hasOwnProperty('file')) {
console.log('Usage: node index.js --file <path to line delimeted GeoJSON FeatureCollections>');
} else {
... |
Configure webpack to handle runway-compiler being outside this directory | var path = require('path');
var resolveLoader = {
root: [
path.resolve('node_modules'),
],
};
module.exports = [{
entry: "./web.js",
output: {
path: __dirname,
filename: "bundle.js"
},
devtool: 'eval-cheap-module-source-map',
module: {
loaders: [
{
test: /\.css$/,
l... | module.exports = [{
entry: "./web.js",
output: {
path: __dirname,
filename: "bundle.js"
},
devtool: 'eval-cheap-module-source-map',
module: {
loaders: [
{
test: /\.css$/,
loader: "style!css"
},
{
test: /\.model$/,
loader: "raw"
},
{
... |
Fix wrong pattern for minecraft names | package org.monospark.spongematchers.base;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import org.monospark.spongematchers.Matcher;
public final class NameMatcher implements Matcher<String> {
public static final Map<String, String> REPLACEMENTS... | package org.monospark.spongematchers.base;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import org.monospark.spongematchers.Matcher;
public final class NameMatcher implements Matcher<String> {
public static final Map<String, String> REPLACEMENTS... |
Fix: Remove reference to non-existent class | <?php
declare(strict_types=1);
/**
* Copyright (c) 2017 Andreas Möller.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @link https://github.com/localheinz/test-util
*/
namespace Localheinz\Test\Util\Test\Unit;
use Localheinz\... | <?php
declare(strict_types=1);
/**
* Copyright (c) 2017 Andreas Möller.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @link https://github.com/localheinz/test-util
*/
namespace Localheinz\Test\Util\Test\Unit;
use Localheinz\... |
Allow randomized size and position for enemies | /**
* enemy.js
*
* Manages creation and properties for our enemy object
*/
// Alias our enemy object
var enemy = game.objs.enemy;
/**
* Enemy object factory
*
* @returns {object}
*/
var createEnemy = function() {
var svg = document.getElementById('game-board');
var rect = document.createElementNS(SVG_... | /**
* enemy.js
*
* Manages creation and properties for our enemy object
*/
// Alias our enemy object
var enemy = game.objs.enemy;
/**
* Enemy object factory
*
* @returns {object}
*/
var createEnemy = function() {
var svg = document.getElementById('game-board');
var rect = document.createElementNS(SVG_... |
Add null check to format builder | package uk.co.drnaylor.minecraft.hammer.bukkit.text;
import org.bukkit.ChatColor;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerText;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextColours;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextFormats;
public final class HammerTextConverter ... | package uk.co.drnaylor.minecraft.hammer.bukkit.text;
import org.bukkit.ChatColor;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerText;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextColours;
import uk.co.drnaylor.minecraft.hammer.core.text.HammerTextFormats;
public final class HammerTextConverter ... |
Use hash location type for Github pages. | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'letnar-frontend',
environment: environment,
baseURL: '/',
locationType: 'auto',
adapterNamespace: 'api',
contentSecurityPolicy: {
'connect-src': "*",
'script-src': "'unsafe-eval' *",
},... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'letnar-frontend',
environment: environment,
baseURL: '/',
locationType: 'auto',
adapterNamespace: 'api',
contentSecurityPolicy: {
'connect-src': "*",
'script-src': "'unsafe-eval' *",
},... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.