text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Add a note regarding event items filtration [WAL-1077]
import template from './dashboard-feed.html'; export const projectEventsFeed = { template, bindings: { project: '<' }, controller: class ProjectEventsFeedController { constructor(DashboardFeedService, EventDialogsService, $uibModal) { this.DashboardFeedService = DashboardFeedService; this.$...
import template from './dashboard-feed.html'; export const projectEventsFeed = { template, bindings: { project: '<' }, controller: class ProjectEventsFeedController { constructor(DashboardFeedService, EventDialogsService, $uibModal) { this.DashboardFeedService = DashboardFeedService; this.$...
Create a dummy index with the same name
<?php use PragmaRX\Tracker\Support\Migration; class FixAgentName extends Migration { /** * Table related to this migration. * * @var string */ private $table = 'tracker_agents'; /** * Run the migrations. * * @return void */ public function migrateUp() { ...
<?php use PragmaRX\Tracker\Support\Migration; class FixAgentName extends Migration { /** * Table related to this migration. * * @var string */ private $table = 'tracker_agents'; /** * Run the migrations. * * @return void */ public function migrateUp() { ...
Add reducer cases for add/removing board filters
import initialState from './initialState'; import { BOARD_REQUESTED, BOARD_LOADED, BOARD_DESTROYED, BOARD_SCROLLED_BOTTOM, BOARD_INVALIDATED, SEARCH_BOARD, ADD_FILTER, REMOVE_FILTER, } from '../constants' export default function (state = initialState.board, action) { switch (act...
import initialState from './initialState'; import { BOARD_REQUESTED, BOARD_LOADED, BOARD_DESTROYED, BOARD_SCROLLED_BOTTOM, BOARD_FILTER, BOARD_INVALIDATED } from '../constants' export default function (state = initialState.board, action) { switch (action.type) { case BOARD_REQU...
Fix issue caused by isMasterRequest not being available in earlier Symfony versions
<?php namespace Rj\FrontendBundle\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\KernelEvents; class InjectLiveReloadListener implements E...
<?php namespace Rj\FrontendBundle\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; class InjectLiveReloadListener implements EventSubscriberInterface { private $url; publi...
Add hints about ntp and updates
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; class ServerType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public ...
<?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; class ServerType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public ...
Fix test case with client
from django.core.urlresolvers import reverse from django.test import Client from django.test import TestCase from presentation.models import Presentation from warp.users.models import User class PresentationListTest(TestCase): def setUp(self): self.client = Client() self.test_user = self.create_t...
from django.contrib.auth.models import AnonymousUser from django.core.urlresolvers import reverse from django.test import TestCase from django.test import RequestFactory from presentation.models import Presentation from presentation.views import PresentationList from warp.users.models import User class PresentationL...
Break back into three parts. svn path=/trunk/; revision=569
#!/usr/bin/env seed Seed.import_namespace("Gtk"); Gtk.init(null, null); BrowserToolbar = new GType({ parent: Gtk.HBox.type, name: "BrowserToolbar", instance_init: function (klass) { // Private var url_bar = new Gtk.Entry(); var back_button = new Gtk.ToolButton({stock_id:"gtk-g...
#!/usr/bin/env seed Seed.import_namespace("Gtk"); Gtk.init(null, null); BrowserToolbar = new GType({ parent: Gtk.HBox.type, name: "BrowserToolbar", instance_init: function(klass) { var url_bar = new Gtk.Entry(); var back_button = new Gtk.ToolButton({stock_id:"gtk-go-back"}); v...
Allow access to root leaves.
import core.provider.authentication as authentication import core.notify.dispatcher as notify import core.notify.plugins.available.changes as changes import core.provider.storage as storage import core.resource.base as resource import conf.vhosts.available.default as default class VHost(default.VHost): host = ['lo...
import core.provider.authentication as authentication import core.notify.dispatcher as notify import core.notify.plugins.available.changes as changes import core.provider.storage as storage import core.resource.base as resource import conf.vhosts.available.default as default class VHost(default.VHost): host = ['lo...
Update to handle Laravel 5.4 (Should still work with 5.1+)
<?php namespace EricMakesStuff\ServerMonitor\Monitors; use EricMakesStuff\ServerMonitor\Exceptions\InvalidConfiguration; class ServerMonitorFactory { /** * @param array $monitorConfiguration * @param array $filter * @return mixed */ public static function createForMonitorConfig(array $mon...
<?php namespace EricMakesStuff\ServerMonitor\Monitors; use EricMakesStuff\ServerMonitor\Exceptions\InvalidConfiguration; class ServerMonitorFactory { /** * @param array $monitorConfiguration * @param array $filter * @return mixed */ public static function createForMonitorConfig(array $mon...
Rename Gulp task for improved clarity
'use strict'; var gulp = require('gulp'); var eslint = require('gulp-eslint'); var excludeGitignore = require('gulp-exclude-gitignore'); var jsonlint = require("gulp-jsonlint"); var mocha = require('gulp-mocha'); var istanbul = require('gulp-istanbul'); var plumber = require('gulp-plumber'); gulp.task('set-test-env',...
'use strict'; var gulp = require('gulp'); var eslint = require('gulp-eslint'); var excludeGitignore = require('gulp-exclude-gitignore'); var jsonlint = require("gulp-jsonlint"); var mocha = require('gulp-mocha'); var istanbul = require('gulp-istanbul'); var plumber = require('gulp-plumber'); gulp.task('set-test-env',...
Allow passing attributes in construct
<?php /** * * Created by mtils on 22.08.18 at 13:31. **/ namespace Ems\Core; use Ems\Contracts\Core\Input as InputContract; use Ems\Contracts\Core\None; use Ems\Core\Exceptions\KeyNotFoundException; use Ems\Core\Support\FastArrayDataTrait; use Ems\Core\Support\InputTrait; use Ems\Core\Support\RoutableTrait; use fu...
<?php /** * * Created by mtils on 22.08.18 at 13:31. **/ namespace Ems\Core; use Ems\Contracts\Core\Input as InputContract; use Ems\Contracts\Core\None; use Ems\Core\Exceptions\KeyNotFoundException; use Ems\Core\Support\FastArrayDataTrait; use Ems\Core\Support\InputTrait; use Ems\Core\Support\RoutableTrait; use fu...
Add DataDog monitoring to cron job runs
#!/usr/bin/env python import os from optparse import OptionParser TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read() def main(): parser = OptionParser() parser.add_option("-z", "--zamboni", help="Location of zamboni (required)") parser.add_option("-u", "...
#!/usr/bin/env python import os from optparse import OptionParser TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read() def main(): parser = OptionParser() parser.add_option("-z", "--zamboni", help="Location of zamboni (required)") parser.add_option("-u", "...
Add tests for parser tokens
"""parse_token test case""" import unittest from lighty.templates.tag import parse_token class ParseTokenTestCase(unittest.TestCase): ''' Test form fields ''' def setUp(self): # Test Field class pass def testCleanBrackets(self): parsed = parse_token('"test.html"') needed...
"""parse_token test case""" import unittest from lighty.templates.tag import parse_token class FormFieldsTestCase(unittest.TestCase): ''' Test form fields ''' def setUp(self): # Test Field class pass def testCleanBrackets(self): parsed = parse_token('"test.html"') needed...
Add facade loader and example to readme
<?php namespace Darkin1\Intercom; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Config; use Intercom\IntercomClient; use Darkin1\Intercom\Facades\Intercom; class IntercomServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @v...
<?php namespace Darkin1\Intercom; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Config; use Intercom\IntercomClient; class IntercomServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = ...
Fix widgets path when using pages that have an ID (e.g. //host/p/Page)
const webpack = require("webpack"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const ZipPlugin = require("zip-webpack-plugin"); const path = require("path"); const package = require("./package"); const widgetName = package.name; const widge...
const webpack = require("webpack"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); const ZipPlugin = require("zip-webpack-plugin"); const path = require("path"); const package = require("./package"); const widgetName = package.name; const widge...
Add a repr for twelve.Environment
import os import extensions class Environment(object): def __init__(self, adapter=None, environ=None, names=None, *args, **kwargs): super(Environment, self).__init__(*args, **kwargs) if names is None: names = {} self.adapter = adapter self.environ = environ ...
import os import extensions class Environment(object): def __init__(self, adapter=None, environ=None, names=None, *args, **kwargs): super(Environment, self).__init__(*args, **kwargs) if names is None: names = {} self.adapter = adapter self.environ = environ ...
Remove UI asking user to claim it
var handle = function(e) { // Find the relevant link var targetLink = e.currentTarget.href; // Find what we said about it var relevantItem = example_items.filter(function(item) { return item['url'] == targetLink}); console.log(relevantItem); var desc = relevantItem[0]['description'], st...
var handle = function(e) { // Find the relevant link var targetLink = e.currentTarget.href; // Find what we said about it var relevantItem = example_items.filter(function(item) { return item['url'] == targetLink}); console.log(relevantItem); var desc = relevantItem[0]['description'], st...
Add a default value to sessionGet
<?php namespace PragmaRX\Google2FALaravel\Support; trait Session { /** * Make a session var name for. * * @param null $name * * @return mixed */ protected function makeSessionVarName($name = null) { return $this->config('session_var').(is_null($name) || empty($name) ?...
<?php namespace PragmaRX\Google2FALaravel\Support; trait Session { /** * Make a session var name for. * * @param null $name * * @return mixed */ protected function makeSessionVarName($name = null) { return $this->config('session_var').(is_null($name) || empty($name) ?...
Fix to find entire package hierarchy
from setuptools import setup, find_packages __version__ = '0.1' setup( name='wanikani', description='WaniKani Tools for Python', long_description=open('README.md').read(), author='Paul Traylor', url='http://github.com/kfdm/wanikani/', version=__version__, packages=find_packages(), inst...
from setuptools import setup __version__ = '0.1' setup( name='wanikani', description='WaniKani Tools for Python', long_description=open('README.md').read(), author='Paul Traylor', url='http://github.com/kfdm/wanikani/', version=__version__, packages=['wanikani'], install_requires=['req...
Use dialogue terminology in menu
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('D', 'Dialogue'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign woul...
from django import forms class CampaignGeneralForm(forms.Form): TYPE_CHOICES = ( ('', 'Select campaign type'), ('B', 'Bulk Message'), ('C', 'Conversation'), ) name = forms.CharField(label="Campaign name", max_length=100) type = forms.ChoiceField(label="Which kind of campaign ...
Create base test case class for rupture
from django.test import TestCase from breach.models import SampleSet, Victim, Target, Round from breach.analyzer import decide_next_world_state class RuptureTestCase(TestCase): def setUp(self): target = Target.objects.create( endpoint='http://di.uoa.gr/', prefix='test', ...
from django.test import TestCase from breach.models import SampleSet, Victim, Target, Round from breach.analyzer import decide_next_world_state class AnalyzerTestCase(TestCase): def setUp(self): target = Target.objects.create( endpoint='http://di.uoa.gr/', prefix='test', ...
Make the buffer test stream write async As suggested by @pchelolo, asynchronously finish the stream.
'use strict'; var stream = require('stream'); function hello(restbase, req) { var body = new stream.PassThrough(); body.end('hello'); return { status: 200, headers: { 'content-type': 'text/html', }, body: body }; } function buffer(restbase, req) { var b...
'use strict'; var stream = require('stream'); function hello(restbase, req) { var body = new stream.PassThrough(); body.end('hello'); return { status: 200, headers: { 'content-type': 'text/html', }, body: body }; } function buffer(restbase, req) { var b...
Clean up dir after move
#!/usr/bin/env python # -*- coding: utf-8 -*- """Parse source tree, get old files and move files info a new folder tree""" import KmdCmd import KmdFiles import os import re import logging class KmdFilesMove(KmdCmd.KmdCommand): regexp = None def extendParser(self): super(KmdFilesMove, self).extendParse...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Parse source tree, get old files and move files info a new folder tree""" import KmdCmd import KmdFiles import os import re import logging class KmdFilesMove(KmdCmd.KmdCommand): regexp = None def extendParser(self): super(KmdFilesMove, self).extendParse...
Implement the sql query using querybuilder
<?php namespace AppBundle\Repository; use Doctrine\ORM\EntityRepository; /** * OrganismRepository * * This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom * repository methods below. */ class OrganismRepository extends EntityRepository { public function getNumber(): int { ...
<?php namespace AppBundle\Repository; use Doctrine\ORM\EntityRepository; /** * OrganismRepository * * This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom * repository methods below. */ class OrganismRepository extends EntityRepository { public function getNumber(): int { ...
Fix people autosuggest with winthrop_only flag
from django.http import JsonResponse from dal import autocomplete from .models import Person from winthrop.books.models import PersonBook from django.db.models import BooleanField, Case, When, Value from .viaf import ViafAPI class ViafAutoSuggest(autocomplete.Select2ListView): """ View to provide VIAF suggestions...
from django.http import JsonResponse from dal import autocomplete from .models import Person from winthrop.books.models import PersonBook from django.db.models import BooleanField, Case, When, Value from .viaf import ViafAPI class ViafAutoSuggest(autocomplete.Select2ListView): """ View to provide VIAF suggestions...
Fix references of nxp to imx6ul Bug: 32830902 Change-Id: Ib24db99577b2b11de3500c1e63840563c2321c05
package com.google.samples.button; import android.os.Build; @SuppressWarnings("WeakerAccess") public class BoardDefaults { private static final String DEVICE_EDISON = "edison"; private static final String DEVICE_RPI3 = "rpi3"; private static final String DEVICE_NXP = "imx6ul"; /** * Return the G...
package com.google.samples.button; import android.os.Build; @SuppressWarnings("WeakerAccess") public class BoardDefaults { private static final String DEVICE_EDISON = "edison"; private static final String DEVICE_RPI3 = "rpi3"; private static final String DEVICE_NXP = "nxp"; /** * Return the GPIO...
Fix mod log optional channel
import json import logging import typing from datetime import datetime import discord from cogbot.types import ServerId, ChannelId log = logging.getLogger(__name__) class CogBotServerState: def __init__(self, bot, server: discord.Server, log_channel: ChannelId = None): self.bot = bot self.serv...
import json import logging import typing from datetime import datetime import discord from cogbot.types import ServerId, ChannelId log = logging.getLogger(__name__) class CogBotServerState: def __init__(self, bot, server: discord.Server, log_channel: ChannelId = None): self.bot = bot self.serv...
Add 404 request method and url when using withoutExceptionHandling Whenever a NotFoundHTTPException is thrown, it is helpful to see the request method and url. Helps to debug what route to look at instead of having to first look it up in the test file. I've been using this in my own tests and I love it. Final resul...
<?php namespace Illuminate\Foundation\Testing\Concerns; use Exception; use Illuminate\Contracts\Debug\ExceptionHandler; use Symfony\Component\Console\Application as ConsoleApplication; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; trait InteractsWithExceptionHandling { /** * The previous...
<?php namespace Illuminate\Foundation\Testing\Concerns; use Exception; use Illuminate\Contracts\Debug\ExceptionHandler; use Symfony\Component\Console\Application as ConsoleApplication; trait InteractsWithExceptionHandling { /** * The previous exception handler. * * @var ExceptionHandler|null ...
Change the name back to pyhumod With the change of name from pyhumod to humod this would be a separate pypi package and we don't want that.
# -*- coding: utf-8 -*- import os from distutils.core import setup from humod import __version__ CONFIG_FILES = [('/etc/ppp/peers', ['conf/humod'])] try: os.stat('/etc/ppp/options') except OSError: CONFIG_FILES = [('/etc/ppp/peers', ['conf/humod']), ('/etc/ppp/options', ['conf/options'])] ...
# -*- coding: utf-8 -*- import os from distutils.core import setup from humod import __version__ CONFIG_FILES = [('/etc/ppp/peers', ['conf/humod'])] try: os.stat('/etc/ppp/options') except OSError: CONFIG_FILES = [('/etc/ppp/peers', ['conf/humod']), ('/etc/ppp/options', ['conf/options'])] ...
Update function name and return value
import requests from time import time class Client: def __init__(self, host, requests, do_requests_counter): self.host = host self.requests = requests self.counter = do_requests_counter class Request: GET = 'get' POST = 'post' def __init__(self, url, type=GET, data=None): ...
import requests from time import time class Client: def __init__(self, host, requests, do_requests_counter): self.host = host self.requests = requests self.counter = do_requests_counter class Request: GET = 'get' POST = 'post' def __init__(self, url, type=GET, data=None): ...
Revert "bump to 0.8.1 to fix packaging issue" This reverts commit c3ea277ea65d11f7b9c6fb9d54bd0f0f3713a98d.
#!/usr/bin/env python from setuptools import setup, find_packages setup(name="opencivicdata-django", version='0.8.0', author="James Turk", author_email='james.p.turk@gmail.com', license="BSD", description="python opencivicdata library", long_description="", url="", py_mo...
#!/usr/bin/env python from setuptools import setup, find_packages setup(name="opencivicdata-django", version='0.8.1', author="James Turk", author_email='james.p.turk@gmail.com', license="BSD", description="python opencivicdata library", long_description="", url="", py_mo...
Fix incorrect id assign in Timelane
// @flow import _ from 'lodash' import ProxySet from './_proxy-set' import type Project from './project' import type Composition from './composition' import Layer from './layer' export default class TimeLane { static deserialize(timelaneJson: Object, comp: Composition) { const timelane = new TimeLane ...
// @flow import _ from 'lodash' import ProxySet from './_proxy-set' import type Project from './project' import type Composition from './composition' import Layer from './layer' export default class TimeLane { static deserialize(timelaneJson: Object, comp: Composition) { const timelane = new TimeLane ...
Add type hint for run_in_threadpool return type
import asyncio import functools import typing from typing import Any, AsyncGenerator, Iterator try: import contextvars # Python 3.7+ only. except ImportError: # pragma: no cover contextvars = None # type: ignore T = typing.TypeVar("T") async def run_in_threadpool( func: typing.Callable[..., T], *args...
import asyncio import functools import typing from typing import Any, AsyncGenerator, Iterator try: import contextvars # Python 3.7+ only. except ImportError: # pragma: no cover contextvars = None # type: ignore async def run_in_threadpool( func: typing.Callable, *args: typing.Any, **kwargs: typing.An...
Modify Hero :: Life + 2
#-*- coding: utf-8 -*- from lib.base_entity import BaseEntity from lib.base_animation import BaseAnimation from pygame.locals import K_UP as UP class HeroAnimation(BaseAnimation): """Custom class Animation : HeroAnimation """ WIDTH_SPRITE = 31 HEIGHT_SPRITE = 31 def get_sprite(self, move_d...
#-*- coding: utf-8 -*- from lib.base_entity import BaseEntity from lib.base_animation import BaseAnimation from pygame.locals import K_UP as UP class HeroAnimation(BaseAnimation): """Custom class Animation : HeroAnimation """ WIDTH_SPRITE = 31 HEIGHT_SPRITE = 31 def get_sprite(self, move_d...
Add pdbpp to dev dependencies
"""Mailmerge build and install configuration.""" import os try: from setuptools import setup except ImportError: from distutils.core import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme_file: README = readme_file.read() setup( name="mailmerge", description="A sim...
"""Mailmerge build and install configuration.""" import os try: from setuptools import setup except ImportError: from distutils.core import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme_file: README = readme_file.read() setup( name="mailmerge", description="A sim...
[Backoffice] Add meta for easy development.
<?php /** * This file is part of the Clastic package. * * (c) Dries De Peuter <dries@nousefreak.be> * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Clastic\BlogBundle\Form\Module; use Clastic\NodeBundle\Form\Extension\Abst...
<?php /** * This file is part of the Clastic package. * * (c) Dries De Peuter <dries@nousefreak.be> * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Clastic\BlogBundle\Form\Module; use Clastic\NodeBundle\Form\Extension\Abst...
Call super __init__ in GameMDP
from .mdp import MDP from .game_mdp import GameMDP from ..utils import utility class FixedGameMDP(GameMDP): def __init__(self, game, opp_player, opp_idx): ''' opp_player: the opponent player opp_idx: the idx of the opponent player in the game ''' super(FixedGameMDP, self)....
from .mdp import MDP from .game_mdp import GameMDP from ..utils import utility class FixedGameMDP(GameMDP): def __init__(self, game, opp_player, opp_idx): ''' opp_player: the opponent player opp_idx: the idx of the opponent player in the game ''' self._game = game ...
Use cached property decorator connection pool.
# -*- coding: utf-8 -*- from __future__ import absolute_import import urllib3 try: import simplejson as json except ImportError: import json # pyflakes.ignore from .decorators import cached_property from .errors import NSQHttpError class HTTPClient(object): @cached_property def http(self): ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import urllib3 try: import simplejson as json except ImportError: import json # pyflakes.ignore from .errors import NSQHttpError class HTTPClient(object): base_url = None __http = None @property def http(self): if self...
Improve accuracy of keyword counts.
/** Keyword analysis for HackMyResume. @license MIT. See LICENSE.md for details. @module keyword-inspector.js */ (function() { var _ = require('underscore'); var FluentDate = require('../core/fluent-date'); /** Analyze the resume's use of keywords. @class keywordInspector */ var keywordInspector ...
/** Keyword analysis for HackMyResume. @license MIT. See LICENSE.md for details. @module keyword-inspector.js */ (function() { var _ = require('underscore'); var FluentDate = require('../core/fluent-date'); /** Analyze the resume's use of keywords. @class keywordInspector */ var keywordInspector ...
Set base interval to 40 (to simulate a 25 fps video)
/*! * @license MIT * @author Marek Kalnik * @copyright (c) Maisons du Monde */ ;(function ($, document) { "use strict"; $.MDMAnimationHeartbeat = function (steps, speed) { var max = steps, current = 0, delay, interval, beat; // set defaul...
/*! * @license MIT * @author Marek Kalnik * @copyright (c) Maisons du Monde */ ;(function ($, document) { "use strict"; $.MDMAnimationHeartbeat = function (steps, speed) { var max = steps, current = 0, delay, interval, beat; // set defaul...
Add configuration options for randomness
# encoding: UTF-8 import random from . import config def sampler(source): def reshuffle(): copy = list(source) random.shuffle(copy) return copy stack = reshuffle() lastitem = '' while True: try: item = stack.pop() if item == lastitem: ...
# encoding: UTF-8 import random from . import config def sampler(source): def reshuffle(): copy = list(source) random.shuffle(copy) return copy stack = reshuffle() lastitem = '' while True: try: item = stack.pop() if item == lastitem: ...
Add non-nullable modifier to return type of functions never returning null
/** * @description * var app = angular.module('App', ['flow.provider'], function(flowFactoryProvider){ * flowFactoryProvider.defaults = {target: '/'}; * }); * @name flowFactoryProvider */ angular.module('flow.provider', []) .provider('flowFactory', function() { 'use strict'; /** * Define the default pro...
/** * @description * var app = angular.module('App', ['flow.provider'], function(flowFactoryProvider){ * flowFactoryProvider.defaults = {target: '/'}; * }); * @name flowFactoryProvider */ angular.module('flow.provider', []) .provider('flowFactory', function() { 'use strict'; /** * Define the default pro...
Revert "Rename lock to _lock to imply that it's private." tilequeue/queue/file.py -On second thought, the convention of prefixing private instance variables with an underscore isn't consistently adhered to elsewhere in the codebase, so don't bother using it, or we'll end up with a mix of classes that do and don't ...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self.lock = threading.RLock() def enqueue(self, coord): with self.lock: payload = serialize_coord(coord) ...
from tilequeue.tile import serialize_coord, deserialize_coord, CoordMessage import threading class OutputFileQueue(object): def __init__(self, fp): self.fp = fp self._lock = threading.RLock() def enqueue(self, coord): with self._lock: payload = serialize_coord(coord) ...
[core] Check if @sanity/cli has dataset edit capabilities before using it
export default { name: 'visibility', group: 'dataset', signature: 'get/set [dataset] [mode]', description: 'Set visibility of a dataset', // eslint-disable-next-line complexity action: async (args, context) => { const {apiClient, output} = context const [action, ds, aclMode] = args.argsWithoutOption...
export default { name: 'visibility', group: 'dataset', signature: 'get/set [dataset] [mode]', description: 'Set visibility of a dataset', // eslint-disable-next-line complexity action: async (args, context) => { const {apiClient, output} = context const [action, ds, aclMode] = args.argsWithoutOption...
Update API base url in static JS
var API_URL = 'https://api.buildnumber.io' $().ready( function(){ var $emailField = $('#email-field') var $signupButton = $('#signup-button') var $form = $('#signup-form') var $errorContainer = $('#signup-result .result-error') var $successContainer = $('#signup-result .result-success') $sign...
var API_URL = 'http://127.0.0.1:8000' $().ready( function(){ var $emailField = $('#email-field') var $signupButton = $('#signup-button') var $form = $('#signup-form') var $errorContainer = $('#signup-result .result-error') var $successContainer = $('#signup-result .result-success') $signupBut...
Test returning a json response.
<?php namespace TrueApex\ExpenseBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; class ApiController extends Controller { public function indexAction() { $response_data = array( 'data' => array( arr...
<?php namespace TrueApex\ExpenseBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; class ApiController extends Controller { public function indexAction() { $data = array( array( 'category' => 'Food & ...
Add PUT method to retrofit server
package org.commcare.core.network; import java.util.List; import java.util.Map; import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.HeaderMap; import retrofit2.http.Multipart; import...
package org.commcare.core.network; import java.util.List; import java.util.Map; import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.HeaderMap; import retrofit2.http.Multipart; import...
Add use statement for SpecificationIterator
<?php /* * This file is part of the Behat. * (c) Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Behat\Testwork\Ordering\Orderer; use Behat\Testwork\Specification\Specification...
<?php /* * This file is part of the Behat. * (c) Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Behat\Testwork\Ordering\Orderer; use Behat\Testwork\Specification\Specification...
Comment line with protocol to avoid this error javax.ws.rs.WebApplicationException: HTTP 422 Service 'gerrit-http-service' is invalid: spec.ports[0].protocol: unsupported value 'HTTP'
package io.fabric8.app.gerrit; import io.fabric8.kubernetes.generator.annotation.KubernetesModelProcessor; import io.fabric8.openshift.api.model.template.TemplateBuilder; @KubernetesModelProcessor public class GerritModelProcessor { public void onList(TemplateBuilder builder) { builder.addNewServiceObjec...
package io.fabric8.app.gerrit; import io.fabric8.kubernetes.generator.annotation.KubernetesModelProcessor; import io.fabric8.openshift.api.model.template.TemplateBuilder; @KubernetesModelProcessor public class GerritModelProcessor { public void onList(TemplateBuilder builder) { builder.addNewServiceObjec...
Make sure we only write chars to stdout
import sys import os from datamodel.base import node class ConsolePrinter(node.Node): """ This node prints on stdout its context and then returns it as output. """ def input(self, context): self._context = context def output(self): try: sys.stdout.write(str(self._cont...
import sys from datamodel.base import node class ConsolePrinter(node.Node): """ This node prints on stdout its context and then returns it as output. """ def input(self, context): self._context = context def output(self): sys.stdout.write(self._context) return self._conte...
Fix get user info link in search list
/** * * InputSearchLi * */ import React from 'react'; import PropTypes from 'prop-types'; import styles from './styles.scss'; function InputSearchLi({ onClick, isAdding, item }) { const icon = isAdding ? 'fa-plus' : 'fa-minus-circle'; const liStyle = isAdding ? { cursor: 'pointer' } : {}; const handleClick = is...
/** * * InputSearchLi * */ import React from 'react'; import PropTypes from 'prop-types'; import styles from './styles.scss'; function InputSearchLi({ onClick, isAdding, item }) { const icon = isAdding ? 'fa-plus' : 'fa-minus-circle'; const liStyle = isAdding ? { cursor: 'pointer' } : {}; const handleClick = is...
Allow any logger implementing `LoggerInterface` to be passed
<?php /* * This file is apart of the DiscordPHP project. * * Copyright (c) 2016-2020 David Cole <david.cole1340@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the LICENSE.md file. */ namespace Discord\Wrapper; use Psr\Log\LoggerInterface; /** * Provi...
<?php /* * This file is apart of the DiscordPHP project. * * Copyright (c) 2016-2020 David Cole <david.cole1340@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the LICENSE.md file. */ namespace Discord\Wrapper; use Monolog\Logger as Monolog; /** * Pro...
Define a model for 'Analyses' in Analysis Request inherit from records_field_artemplate.
from openerp import fields, models, api from base_olims_model import BaseOLiMSModel schema = (fields.Many2one(string='Services', comodel_name='olims.analysis_service', domain="[('category', '=', Category)]", relation='recordfield_service'), fields.Bool...
from openerp import fields, models, api from base_olims_model import BaseOLiMSModel schema = (fields.Many2one(string='Services', comodel_name='olims.analysis_service', domain="[('category', '=', Category)]", relation='recordfield_service'), fields.Bool...
Clear the contact form after it has been successfully posted.
from django.shortcuts import render from django.http import Http404 from django.contrib.messages import success from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from .models import HomePage, StaticPage from category.models import Category from .forms import ContactFo...
from django.shortcuts import render from django.http import Http404 from django.contrib.messages import success from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from .models import HomePage, StaticPage from category.models import Category from .forms import ContactFo...
Increase timeout for integration test which might help Travis
var fs = require("fs"); var getDataUriForBase64PNG = function (pngBase64) { return "data:image/png;base64," + pngBase64; }; var renderPage = function (url, successCallback) { var page = require("webpage").create(); page.viewportSize = { width: 210, height: 110 }; page.open(url, function () { ...
var fs = require("fs"); var getDataUriForBase64PNG = function (pngBase64) { return "data:image/png;base64," + pngBase64; }; var renderPage = function (url, successCallback) { var page = require("webpage").create(); page.viewportSize = { width: 210, height: 110 }; page.open(url, function () { ...
Remove testing and debug stuff.
<?php require_once("../libs/sendgrid-php/sendgrid-php.php"); // Simple class to send email notifications. class Mailer { public static function sendMail($clientAddress, $body) { $request_body = json_decode('{ "personalizations": [ { "to": [ { ...
<?php require_once("../libs/sendgrid-php/sendgrid-php.php"); // Simple class to send email notifications. class Mailer { public static function sendMail($clientAddress, $body) { $request_body = json_decode('{ "personalizations": [ { "to": [ { ...
Remove used full path attribute
package com.choudhury.logger; import org.apache.log4j.BasicConfigurator; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.logging....
package com.choudhury.logger; import org.apache.log4j.BasicConfigurator; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.logging....
Halo: Remove support for windows till fully tested
"""Utilities for Halo library. """ import platform import six import codecs from colorama import init, Fore from termcolor import colored init(autoreset=True) def is_supported(): """Check whether operating system supports main symbols or not. Returns ------- boolean Whether operating sys...
"""Utilities for Halo library. """ import platform import six import codecs from colorama import init, Fore from termcolor import colored init(autoreset=True) def is_supported(): """Check whether operating system supports main symbols or not. Returns ------- boolean Whether operating sys...
Enable On the rocks plugin
# -*- coding: utf-8 -*- # Execute this file to see what plugins will be loaded. # Implementation leans to Lex Toumbourou's example: # https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/ import os import pkgutil import sys def load_venue_plugins(): """ Read plugin directo...
# -*- coding: utf-8 -*- # Execute this file to see what plugins will be loaded. # Implementation leans to Lex Toumbourou's example: # https://lextoumbourou.com/blog/posts/dynamically-loading-modules-and-classes-in-python/ import os import pkgutil import sys def load_venue_plugins(): """ Read plugin directo...
Add docopt - not finished
"""Usage: logview [options] Options: -h, --help show this help message -v, --verbose print status messages --ignore=loglevels ignore logs of the specified levels """ import threading import socket import logging import os import colorama import docopt from termcolor import colored from collections import deque ...
import threading import socket import logging import os import colorama from termcolor import colored from collections import deque markerStack = deque(['']) def colorMessage(message): if 'Info' in message : print(colored(message, 'green')) elif 'Error' in message : print(colored(message, 're...
Set the default color to teal
import React, { PureComponent } from 'react'; import Box from '../box'; import PropTypes from 'prop-types'; import cx from 'classnames'; import omit from 'lodash.omit'; import theme from './theme.css'; const factory = (baseType, type, defaultElement) => { class Text extends PureComponent { isSoft(color) { ...
import React, { PureComponent } from 'react'; import Box from '../box'; import PropTypes from 'prop-types'; import cx from 'classnames'; import omit from 'lodash.omit'; import theme from './theme.css'; const factory = (baseType, type, defaultElement) => { class Text extends PureComponent { isSoft(color) { ...
Fix BEM preset; ignoreComments --> false
var _ = require('lodash'); /** * Sets options * @param {Object} [options] * @param {String[]} [options.ignoreAttributes] * @param {String[]} [options.compareAttributesAsJSON] * @param {Boolean} [options.ignoreWhitespaces=true] * @param {Boolean} [options.ignoreComments=true] * @param {Boolean} [options.ignoreCl...
var _ = require('lodash'); /** * Sets options * @param {Object} [options] * @param {String[]} [options.ignoreAttributes] * @param {String[]} [options.compareAttributesAsJSON] * @param {Boolean} [options.ignoreWhitespaces=true] * @param {Boolean} [options.ignoreComments=true] * @param {Boolean} [options.ignoreCl...
Add test to show login form is broken
from django.core import management from django.utils import unittest from django.contrib.contenttypes.models import ContentType from django.test.client import Client from post.models import Post from foundry.models import Member, Listing class TestCase(unittest.TestCase): def setUp(self): self.client =...
from django.core import management from django.test import TestCase from django.contrib.contenttypes.models import ContentType from post.models import Post from foundry.models import Member, Listing class TestCase(TestCase): def setUp(self): # Post-syncdb steps management.call_command('migrate'...
jsonpickle.handler: Remove usage of built-in 'type' name 'type' is a built-in function so use 'cls' instead of 'type'. Signed-off-by: David Aguilar <9de348c050f7cd1ca590883733c4e531ce610bf4@gmail.com>
class BaseHandler(object): """ Abstract base class for handlers. """ def __init__(self, base): """ Initialize a new handler to handle `type`. :Parameters: - `base`: reference to pickler/unpickler """ self._base = base def flatten(self, obj, data):...
class BaseHandler(object): """ Abstract base class for handlers. """ def __init__(self, base): """ Initialize a new handler to handle `type`. :Parameters: - `base`: reference to pickler/unpickler """ self._base = base def flatten(self, obj, data):...
Save token to session storage
/** * Created by dell on 2015/6/9. */ (function(){ "use strict"; var adminServices = angular.module('app.admin.services',["app.services"]); adminServices.factory("adminInfo",["ApiServer",function(ApiServer){ return ApiServer.createResource('admin/login',{},{ "login":{meth...
/** * Created by dell on 2015/6/9. */ (function(){ "use strict"; var adminServices = angular.module('app.admin.services',["app.services"]); adminServices.factory("adminInfo",["ApiServer",function(ApiServer){ return ApiServer.createResource('admin/login',{},{ "login":{meth...
Rename Template to CfnTemplate to avoid name collision
import boto3 import sys from colors import green, red from botocore.exceptions import ClientError s3_client = boto3.client('s3') class InvalidTemplateError(BaseException): def __init__(self, m): self.m = m def __str__(self): return self.m class CfnTemplate(): def __init__(self, file): ...
import boto3 import sys from colors import green, red from botocore.exceptions import ClientError s3_client = boto3.client('s3') class InvalidTemplateError(BaseException): def __init__(self, m): self.m = m def __str__(self): return self.m class Template(): def __init__(self, file): ...
Use "npm ci" instead of "npm i"
var vow = require('vow'), vowNode = require('vow-node'), childProcess = require('child_process'), fs = require('fs'), exec = vowNode.promisify(childProcess.exec), readFile = vowNode.promisify(fs.readFile), writeFile = vowNode.promisify(fs.writeFile); version = process.argv.slice(2)[0] || 'pa...
var vow = require('vow'), vowNode = require('vow-node'), childProcess = require('child_process'), fs = require('fs'), exec = vowNode.promisify(childProcess.exec), readFile = vowNode.promisify(fs.readFile), writeFile = vowNode.promisify(fs.writeFile); version = process.argv.slice(2)[0] || 'pa...
Add 127.0.0.1 default if Public IP not specified.
'use strict'; // to allow mongodb host and port injection thanks // to the EZMASTER_MONGODB_HOST_PORT environment parameter // (docker uses it) var mongoHostPort = process.env.EZMASTER_MONGODB_HOST_PORT ? process.env.EZMASTER_MONGODB_HOST_PORT : 'localhost:27017'; var publicDoma...
'use strict'; // to allow mongodb host and port injection thanks // to the EZMASTER_MONGODB_HOST_PORT environment parameter // (docker uses it) var mongoHostPort = process.env.EZMASTER_MONGODB_HOST_PORT ? process.env.EZMASTER_MONGODB_HOST_PORT : 'localhost:27017'; var publicDoma...
Fix scrollspy bug occured by layout changes
(function () { var $body = $('body'); if (!isMobile) { $('.section-tabs a').click(function () { var href = $(this).attr('href'); gotoTab(href); return false; }); $body.scrollspy({ 'data-spy': 'scroll', 'data-target': '.section-tabs', 'offset': 1...
(function () { var $specContainer = $('#spec-container'); if (!isMobile) { $('.section-tabs a').click(function () { var href = $(this).attr('href'); gotoTab(href); return false; }); $specContainer.scrollspy({ 'data-spy': 'scroll', 'data-target': '.section-t...
Change output for algorithm list to service name instead of class name
<?php /* * This file is part of the PcdxParameterEncryptionBundle package. * * (c) picodexter <https://picodexter.io/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Picodexter\ParameterEncryptionBundle\Console\Process...
<?php /* * This file is part of the PcdxParameterEncryptionBundle package. * * (c) picodexter <https://picodexter.io/> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Picodexter\ParameterEncryptionBundle\Console\Process...
Sort the list of files processed before running the test on each.
#! /usr/bin/env python # (Force the script to use the latest build.) # # test_parser.py import parser, traceback _numFailed = 0 def testChunk(t, fileName): global _numFailed print '----', fileName, try: ast = parser.suite(t) tup = parser.ast2tuple(ast) # this discards the first ...
#! /usr/bin/env python # (Force the script to use the latest build.) # # test_parser.py import parser, traceback _numFailed = 0 def testChunk(t, fileName): global _numFailed print '----', fileName, try: ast = parser.suite(t) tup = parser.ast2tuple(ast) # this discards the first ...
Define __DEV__ for frontend tests
import webpack from 'webpack' import nodeExternals from 'webpack-node-externals'; var path = require('path') export default { target: 'node', externals: [nodeExternals()], module: { rules: [ //{ test: /\.jsx$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ }, { te...
import nodeExternals from 'webpack-node-externals'; var path = require('path') export default { target: 'node', externals: [nodeExternals()], module: { rules: [ //{ test: /\.jsx$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/ }, { test: /\.js$/, exclu...
Fix incorrect action reference in doc block
<?php declare (strict_types = 1); namespace GrottoPress\Jentil\Setups\Scripts; use GrottoPress\Jentil\AbstractTheme; final class Script extends AbstractScript { public function __construct(AbstractTheme $jentil) { parent::__construct($jentil); $this->id = 'jentil'; } public function...
<?php declare (strict_types = 1); namespace GrottoPress\Jentil\Setups\Scripts; use GrottoPress\Jentil\AbstractTheme; final class Script extends AbstractScript { public function __construct(AbstractTheme $jentil) { parent::__construct($jentil); $this->id = 'jentil'; } public function...
Add interpolation support to the Line series component
(function(d3, fc) { 'use strict'; fc.series.line = function() { // convenience functions that return the x & y screen coords for a given point var x = function(d) { return line.xScale.value(line.xValue.value(d)); }; var y = function(d) { return line.yScale.value(line.yValue.value(d)); ...
(function(d3, fc) { 'use strict'; fc.series.line = function() { // convenience functions that return the x & y screen coords for a given point var x = function(d) { return line.xScale.value(line.xValue.value(d)); }; var y = function(d) { return line.yScale.value(line.yValue.value(d)); ...
Throw exception when call close() on fragment
package com.popalay.cardme.ui.base; import android.app.Activity; import android.support.annotation.NonNull; import com.arellomobile.mvp.MvpAppCompatFragment; public abstract class BaseFragment extends MvpAppCompatFragment implements BaseView { @NonNull public BaseActivity getBaseActivity() { final A...
package com.popalay.cardme.ui.base; import android.app.Activity; import android.support.annotation.NonNull; import com.arellomobile.mvp.MvpAppCompatFragment; public abstract class BaseFragment extends MvpAppCompatFragment implements BaseView { @NonNull public BaseActivity getBaseActivity() { final A...
FIx wrong key name and simplify the assignment
"""ArgumentParser with Italian translation.""" import argparse import sys def _callable(obj): return hasattr(obj, '__call__') or hasattr(obj, '__bases__') class ArgParser(argparse.ArgumentParser): def __init__(self, **kwargs): kwargs.setdefault('parents', []) super().__init__(**kwargs) ...
"""ArgumentParser with Italian translation.""" import argparse import sys def _callable(obj): return hasattr(obj, '__call__') or hasattr(obj, '__bases__') class ArgParser(argparse.ArgumentParser): def __init__(self, **kwargs): if kwargs.get('parent', None) is None: kwargs['parents'] = [...
Change form field to URLField. see #31
"""Radicale extension forms.""" from django import forms from django.utils.translation import ugettext_lazy from modoboa.lib import form_utils from modoboa.parameters import forms as param_forms class ParametersForm(param_forms.AdminParametersForm): """Global parameters.""" app = "modoboa_radicale" se...
"""Radicale extension forms.""" from django import forms from django.utils.translation import ugettext_lazy from modoboa.lib import form_utils from modoboa.parameters import forms as param_forms class ParametersForm(param_forms.AdminParametersForm): """Global parameters.""" app = "modoboa_radicale" se...
Enhance air pollution service formatting
import { apiConstants, apiProvidersConst, httpService, newsModelFactory } from '../../common/common.js'; export default class AirPollution { static getSummary() { let options = httpService.clone(apiConstants.airPollution); options.path = options.path.replace('{0}', options.token); return ht...
import { apiConstants, apiProvidersConst, httpService, newsModelFactory } from '../../common/common.js'; export default class AirPollution { static getSummary() { let options = httpService.clone(apiConstants.airPollution); options.path = options.path.replace('{0}', options.token); return ht...
Fix unlink, >1 filter and lines too long
# -*- coding: utf-8 -*- # © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, models class PurchaseOrderLine(models.Model): _inherit = 'account.analytic.account' @api.multi def _recurring_create_invoice(self, automat...
# -*- coding: utf-8 -*- # © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, models class PurchaseOrderLine(models.Model): _inherit = 'account.analytic.account' @api.multi def _recurring_create_invoice(self, automat...
Remove casting from scope getter. We don’t need this, and it seemed to be causing weird issues where the Mongo arrays were being turned into strings when experimenting with the Artisan REPL.
<?php namespace Northstar\Models; use Jenssegers\Mongodb\Model; class ApiKey extends Model { /** * The database collection used by the model. * * @var string */ protected $collection = 'api_keys'; /** * The model's default attributes. * * @var array */ protect...
<?php namespace Northstar\Models; use Jenssegers\Mongodb\Model; class ApiKey extends Model { /** * The database collection used by the model. * * @var string */ protected $collection = 'api_keys'; /** * The model's default attributes. * * @var array */ protect...
Enable links in list group
var React = require('react'); var classNames = require('classnames'); var ListItem = React.createClass({ propTypes: { active: React.PropTypes.bool, href: React.PropTypes.string, className: React.PropTypes.string, onClick: React.PropTypes.func }, getDefaultProps: f...
var React = require('react'); var classNames = require('classnames'); var ListItem = React.createClass({ propTypes: { active: React.PropTypes.bool, href: React.PropTypes.string, className: React.PropTypes.string, onClick: React.PropTypes.func }, getDefaultProps: f...
Exclude filter and xrange fixers.
from setuptools import setup, find_packages version = '3.7' setup(name='jarn.mkrelease', version=version, description='Python egg releaser', long_description=open('README.txt').read() + '\n' + open('CHANGES.txt').read(), classifiers=[ 'Development Status :: 5 -...
from setuptools import setup, find_packages version = '3.7' setup(name='jarn.mkrelease', version=version, description='Python egg releaser', long_description=open('README.txt').read() + '\n' + open('CHANGES.txt').read(), classifiers=[ 'Development Status :: 5 -...
Add param to return summarized data
/*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/ Ext.define('SlateAdmin.model.person.ProgressReport', { extend: 'Ext.data.Model', fields: [ 'AuthorUsername', 'Subject', { name: 'ID', type: 'integer', useNull: tru...
/*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext,Slate*/ Ext.define('SlateAdmin.model.person.ProgressReport', { extend: 'Ext.data.Model', fields: [ 'AuthorUsername', 'Subject', { name: 'ID', type: 'integer', useNull: tru...
Refactor private variable declaration to constructor
'use strict'; const Animation = require('./animation'), eventBus = require('./event-bus'); const pacmanNormalColor = 0xffff00, pacmanFrighteningColor = 0xffffff, ghostFrightenedColor = 0x5555ff; class CharacterAnimations { constructor(gfx) { this._gfx = gfx; th...
'use strict'; const Animation = require('./animation'), eventBus = require('./event-bus'); const pacmanNormalColor = 0xffff00, pacmanFrighteningColor = 0xffffff, ghostFrightenedColor = 0x5555ff; class CharacterAnimations { constructor(gfx) { this._gfx = gfx; th...
Add missing Owner to User Seeder
<?php use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; class UsersTableSeeder extends Seeder { /** * Run the database seeds. * * Create one user for every role * * @return void */ public function run() { $roles = \App\Role::getAllSystemRoles(); ...
<?php use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; class UsersTableSeeder extends Seeder { /** * Run the database seeds. * * Create one user for every role * * @return void */ public function run() { $roles = \App\Role::getAllRoles(); ...
Fix for EventManager BC breaks
<?php namespace ZfcBase\EventManager; use Traversable; use Zend\EventManager\EventManagerAwareInterface; use Zend\EventManager\EventManagerInterface; use Zend\EventManager\EventManager; abstract class EventProvider implements EventManagerAwareInterface { /** * @var EventManagerInterface */ protecte...
<?php namespace ZfcBase\EventManager; use Traversable; use Zend\EventManager\EventManagerAwareInterface; use Zend\EventManager\EventManagerInterface; use Zend\EventManager\EventManager; abstract class EventProvider implements EventManagerAwareInterface { /** * @var EventManagerInterface */ protecte...
Move to function only tests & fix test for generator based build_file_list build_file_list is a generator now so we need to make sure it returns an iterable but not a string.
import collections import os import sys from tvrenamr.cli import helpers from .utils import random_files def test_passing_current_dir_makes_file_list_a_list(files): file_list = helpers.build_file_list([files]) assert isinstance(file_list, collections.Iterable) PY3 = sys.version_info[0] == 3 string...
import os from tvrenamr.cli import helpers from .base import BaseTest class TestFrontEnd(BaseTest): def setup(self): super(TestFrontEnd, self).setup() self.config = helpers.get_config() def test_passing_current_dir_makes_file_list_a_list(self): assert isinstance(helpers.build_file_l...
Fix license trove classifier, bump to 1.0.1
# -*- coding: utf-8 -*- """setup.py -- setup file for antimarkdown """ import os from setuptools import setup README = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.rst') setup( name = "antimarkdown", packages = ['antimarkdown'], install_requires = [ 'lxml', ], package...
# -*- coding: utf-8 -*- """setup.py -- setup file for antimarkdown """ import os from setuptools import setup README = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.rst') setup( name = "antimarkdown", packages = ['antimarkdown'], install_requires = [ 'lxml', ], package...
BUILD: Tag 0.2 for correct org.
from setuptools import setup, find_packages from sys import version_info def install_requires(): requires = [ 'traitlets>=4.1', 'six>=1.9.0', 'pyyaml>=3.11', ] if (version_info.major, version_info.minor) < (3, 4): requires.append('singledispatch>=3.4.0') return requires...
from setuptools import setup, find_packages from sys import version_info def install_requires(): requires = [ 'traitlets>=4.1', 'six>=1.9.0', 'pyyaml>=3.11', ] if (version_info.major, version_info.minor) < (3, 4): requires.append('singledispatch>=3.4.0') return requires...
Support enums in proxying request objects
package io.github.ibuildthecloud.gdapi.util; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Map; import org.apache.commons.lang3.StringUtils; public class ProxyUtils { @SuppressWarnings("unchecked") public static <T> T proxy(fina...
package io.github.ibuildthecloud.gdapi.util; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Map; import org.apache.commons.lang3.StringUtils; public class ProxyUtils { @SuppressWarnings("unchecked") public static <T> T proxy(fina...
Make it work in PY3.5 *properly*
import mock import threading import unittest import requests from dmoj.control import JudgeControlRequestHandler try: from http.server import HTTPServer except ImportError: from BaseHTTPServer import HTTPServer class ControlServerTest(unittest.TestCase): @classmethod def setUpClass(cls): cla...
import threading import unittest import requests from dmoj.control import JudgeControlRequestHandler try: from unittest import mock except ImportError: import mock try: from http.server import HTTPServer except ImportError: from BaseHTTPServer import HTTPServer class ControlServerTest(unittest.Tes...
Improve explanation and naming of variable Per @DavidRans' request.
define(['underscore'], function(_) { /** * @param spec - The spec for this column's indicators * @param prefilter - An (optional) parent IndicatorFilter which will be run * on elements before this one is. */ var constructor = function constructor(spec, prefilter) { /** * Creates indic...
define(['underscore'], function(_) { /** * @param spec - The spec for this column's indicators * @param prefilter - An (optional) parent IndicatorFilter which will be run * on elements before this one is. */ var constructor = function constructor(spec, prefilter) { /** * Creates indic...
Allow to set umask in DropPrivileges
from pwd import getpwnam from grp import getgrnam from traceback import format_exc from os import getuid, setgroups, setgid, setuid, umask from circuits.core import handler, BaseComponent class DropPrivileges(BaseComponent): def init(self, user="nobody", group="nobody", umask=0o077, **kwargs): self.use...
from pwd import getpwnam from grp import getgrnam from traceback import format_exc from os import getuid, setgroups, setgid, setuid, umask from circuits.core import handler, BaseComponent class DropPrivileges(BaseComponent): def init(self, user="nobody", group="nobody", **kwargs): self.user = user ...
Fix ActionHandler tests (support of Factory)
var gRex = require('../../index.js'); var Transaction = require("../../src/transaction/transaction"); var ActionHandlerFactory = require("../../src/transaction/actionhandlers/actionhandlerfactory"); var VertexActionHandler = require("../../src/transaction/actionhandlers/vertexactionhandler"); var EdgeActionHandler = r...
var gRex = require('../../index.js'), Transaction = require("../../src/transaction/transaction"), handlers = require("../../src/transaction/actionhandler"), Element = require("../../src/element"); var vertexHandler, edgeHandler; var edge, vertex, transaction; describe('Element ActionHandlers', function() ...
Add comment on mail connection
from contextlib import closing from django.core import mail from django.template.loader import render_to_string from django.conf import settings from django.contrib.auth.models import User from pyconde.sponsorship.models import JobOffer from pyconde.accounts.models import Profile from pyconde.celery import app @ap...
from contextlib import closing from django.core import mail from django.template.loader import render_to_string from django.conf import settings from django.contrib.auth.models import User from pyconde.sponsorship.models import JobOffer from pyconde.accounts.models import Profile from pyconde.celery import app @ap...
Use expect.subjectOutput instead of this.subjectOutput (support removed in Unexpected 11.0.0)
/*global Uint8Array*/ var exifParser = require('exif-parser'); var fs = require('fs'); module.exports = { name: 'unexpected-exif', version: require('../package.json').version, installInto: function(expect) { expect.installPlugin(require('magicpen-media')); expect.addAssertion( '<string|Buffer> to...
/*global Uint8Array*/ var exifParser = require('exif-parser'); var fs = require('fs'); module.exports = { name: 'unexpected-exif', version: require('../package.json').version, installInto: function(expect) { expect.installPlugin(require('magicpen-media')); expect.addAssertion( '<string|Buffer> to...
Update layout of homepage buttons
@extends('layouts.app') @section('fonts') <link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css"> @endsection @section('content') @if (Auth::check()) <div class="col-xs-12 col-sm-4 repository-margin-bottom-1rem"> <a class="btn btn...
@extends('layouts.app') @section('fonts') <link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css"> @endsection @section('content') @if (Auth::check()) <div class="col-xs-12 col-sm-4 repository-margin-bottom-1rem"> <a class="btn btn...
Fix issue with react external name
'use strict'; var path = require('path'); var webpack = require('webpack'); var prod = process.env.NODE_ENV === 'production'; var config = { devtool: prod ? null : 'eval', entry: [ path.join(__dirname, 'demo', 'src', 'demo.js') ], output: { path: path.join(__dirname, 'demo', 'dist', ...
'use strict'; var path = require('path'); var webpack = require('webpack'); var prod = process.env.NODE_ENV === 'production'; var config = { devtool: prod ? null : 'eval', entry: [ path.join(__dirname, 'demo', 'src', 'demo.js') ], output: { path: path.join(__dirname, 'demo', 'dist', ...
Update admin area queries to use new `filter` parameter refs #6005 - updates use of the query params removed in #6005 to use new `filter` param
import Ember from 'ember'; export default Ember.Controller.extend({ notifications: Ember.inject.service(), userPostCount: Ember.computed('model.id', function () { var promise, query = { filter: `author:${this.get('model.slug')}`, status: 'all' };...
import Ember from 'ember'; export default Ember.Controller.extend({ notifications: Ember.inject.service(), userPostCount: Ember.computed('model.id', function () { var promise, query = { author: this.get('model.slug'), status: 'all' }; pr...
Add support for app passwords
const alfy = require('alfy'); const bitbucket = require('./bitbucket/core').bitbucket; const {clientId, secret, appPassword, username} = process.env; const ACCESS_TOKEN = 'access_token'; const GRANT_TYPE = 'client_credentials'; const ALIVE_TIME = 216000; const URL = 'https://bitbucket.org/site/oauth2/access_token'; ...
const alfy = require('alfy'); const bitbucket = require('./bitbucket/core').bitbucket; const { clientId, secret } = process.env; const ACCESS_TOKEN = 'access_token'; const GRANT_TYPE = 'client_credentials'; const ALIVE_TIME = 216000; const URL = 'https://bitbucket.org/site/oauth2/access_token'; const OPTIONS = { ...