text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Use of a more specific constructor, to avoid too easy conversions
//-----------------------------------------------------------------------// // // // P i x e l P o i n t // // // // Copyright (C...
//-----------------------------------------------------------------------// // // // P i x e l P o i n t // // // // Copyright (C...
Apply PHP CS Fixer changes
<?php namespace Telegram\Bot\Tests\Traits; use Illuminate\Support\Collection; use Telegram\Bot\Commands\Command; trait CommandGenerator { /** * @param int $numberRequired * * @return Collection */ private function commandGenerator($numberRequired) { $range = range(1, $numberRe...
<?php namespace Telegram\Bot\Tests\Traits; use Illuminate\Support\Collection; use Telegram\Bot\Commands\Command; trait CommandGenerator { /** * @param int $numberRequired * * @return Collection */ private function commandGenerator($numberRequired) { $range = range(1, $numberRe...
Add test domain that has a CNAME
<?php namespace Amp\Dns\Test; use Amp\Dns; use Amp\Dns\Record; use Amp\Loop; use Amp\PHPUnit\TestCase; class IntegrationTest extends TestCase { /** * @param string $hostname * @group internet * @dataProvider provideHostnames */ public function testResolve($hostname) { Loop::run(fu...
<?php namespace Amp\Dns\Test; use Amp\Dns; use Amp\Dns\Record; use Amp\Loop; use Amp\PHPUnit\TestCase; class IntegrationTest extends TestCase { /** * @param string $hostname * @group internet * @dataProvider provideHostnames */ public function testResolve($hostname) { Loop::run(fu...
Add --version CLI opt and __version__ module attr Change-Id: I8c39a797e79429dd21c5caf093b076a4b1757de0
import os import sys import setuptools from keystoneclient.openstack.common import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() requires = setup.parse_requirements() depend_links = setup.parse_dependency_links() tests_require = setup.parse_requirements(['tools/test-r...
import os import sys import setuptools from keystoneclient.openstack.common import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() requires = setup.parse_requirements() depend_links = setup.parse_dependency_links() tests_require = setup.parse_requirements(['tools/test-r...
Add default kwarg to default probs_hat in Task
from functools import partial from typing import Callable, List import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader class Task(object): """A task for use in an MMTL MetalModel Args: name: The name of the task TODO: replace this with a more fully-feat...
from typing import Callable, List import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader class Task(object): """A task for use in an MMTL MetalModel Args: name: The name of the task TODO: replace this with a more fully-featured path through the network ...
Fix method name in wait() test
<?php declare(strict_types = 1); namespace Amp\Test; use Amp; use Amp\{ Deferred, Failure, Pause, Success }; use Interop\Async\Loop; class WaitTest extends \PHPUnit_Framework_TestCase { public function testWaitOnSuccessfulPromise() { $value = 1; $promise = new Success($value); $resu...
<?php declare(strict_types = 1); namespace Amp\Test; use Amp; use Amp\{ Deferred, Failure, Pause, Success }; use Interop\Async\Loop; class WaitTest extends \PHPUnit_Framework_TestCase { public function testWaitOnSuccessfulPromise() { $value = 1; $promise = new Success($value); $resu...
Remove unused imports in game tests
package com.bjorn; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; public class GameTest { UI mockUI; Board mockBoard; Game newGame; @Before ...
package com.bjorn; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import javax.xml.bind.annotation.XmlAttribute; import java.util.HashMap; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.times; import static o...
Use credentials from environment so we can do unit tests.
<?php namespace Slim\Middleware; /** * HTTP Basic Authentication * * Provides HTTP Basic Authentication on given routes * * @package Slim * @author Mika Tuupola <tuupola@appelsiini.net> */ class HttpBasicAuth extends \Slim\Middleware { public $options; public function __construct($options = nu...
<?php namespace Slim\Middleware; /** * HTTP Basic Authentication * * Provides HTTP Basic Authentication on given routes * * @package Slim * @author Mika Tuupola <tuupola@appelsiini.net> */ class HttpBasicAuth extends \Slim\Middleware { public $options; public function __construct($options = nu...
Update this command for Django 1.8
""" Command to load course overviews. """ import logging from optparse import make_option from django.core.management.base import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from openedx.core.djangoapps...
""" Command to load course overviews. """ import logging from optparse import make_option from django.core.management.base import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from openedx.core.djangoapps...
Use Kernel::getEnvironment() to keep consistency
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Sec...
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\Sec...
Check function and branch coverage
module.exports = function(grunt) { grunt.loadNpmTasks("grunt-mocha-test"); grunt.loadNpmTasks("grunt-mocha-istanbul"); var testOutputLocation = process.env.CIRCLE_TEST_REPORTS || "test_output"; var artifactsLocation = process.env.CIRCLE_ARTIFACTS || "build_artifacts"; grunt.initConfig({ moc...
module.exports = function(grunt) { grunt.loadNpmTasks("grunt-mocha-test"); grunt.loadNpmTasks("grunt-mocha-istanbul"); var testOutputLocation = process.env.CIRCLE_TEST_REPORTS || "test_output"; var artifactsLocation = process.env.CIRCLE_ARTIFACTS || "build_artifacts"; grunt.initConfig({ moc...
Fix target selector for imported projects
/* * Copyright 2014 BlackBerry Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
/* * Copyright 2014 BlackBerry Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Convert map objects to lists
from __future__ import absolute_import, print_function, unicode_literals import regex as re import unicodecsv as csv import os.path import pkg_resources class XSampa(object): def __init__(self, delimiter=' '): self.delimiter = delimiter self.xs_regex, self.xs2ipa = self.read_xsampa_table() d...
from __future__ import absolute_import, print_function, unicode_literals import regex as re import unicodecsv as csv import os.path import pkg_resources class XSampa(object): def __init__(self, delimiter=' '): self.delimiter = delimiter self.xs_regex, self.xs2ipa = self.read_xsampa_table() d...
Fix topRounded method to draw the correct shape
//@author A0116538A package bakatxt.gui; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Path2D; import bakatxt.core.Task; /** * This class dictates the color and shape of the box which the task will be put in. * This box is specifically for a top most box. * */...
//@author A0116538A package bakatxt.gui; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Path2D; import bakatxt.core.Task; /** * This class dictates the color and shape of the box which the task will be put in. * This box is specifically for a top most box. * */...
Fix issue found by Scrutinizer.
<?php declare(strict_types=1); use Webmozart\PathUtil\Path; /** * Helper class for text resources. */ class TextResourceHelper implements ResourceHelper, WebPackerInterface { //-------------------------------------------------------------------------------------------------------------------- use WebPackerTrait...
<?php declare(strict_types=1); use Webmozart\PathUtil\Path; /** * Helper class for text resources. */ class TextResourceHelper implements ResourceHelper, WebPackerInterface { //-------------------------------------------------------------------------------------------------------------------- use WebPackerTrait...
Remove the blind addition of prefech_related() to all Correlation querysets.
# -*- coding: utf-8 -*- from datetime import date from django.contrib.contenttypes.models import ContentType from django.db import models class CorrelationManager(models.Manager): def update_or_create(self, instance, timestamp, attribute): # Membership is a special case. Since most groups are static ...
# -*- coding: utf-8 -*- from datetime import date from django.contrib.contenttypes.models import ContentType from django.db import models class CorrelationManager(models.Manager): def update_or_create(self, instance, timestamp, attribute): # Membership is a special case. Since most groups are static ...
Add school age group template helper.
Template.registrantDetails.helpers({ 'registrationTypeOptions': function () { // registration types used on the registration form return [ {label: "Commuter", value: "commuter"}, {label: "Daily", value: "daily"}, {label: "Full Week", value: "weekly"} ]; ...
Template.registrantDetails.helpers({ 'registrationTypeOptions': function () { // registration types used on the registration form return [ {label: "Commuter", value: "commuter"}, {label: "Daily", value: "daily"}, {label: "Full Week", value: "weekly"} ]; ...
Make sure encoding does not get lost
/** * @module readcache */ var fs = require('fs'); var cache = {}; /** * Reads a text file and stores it in the cache. * * @param {string} path - Path to the file you want to read. * @param {object} [options] - Optional options object, passed to fs.readFile. * @param {string} [options.encoding=utf8] - The exp...
/** * @module readcache */ var fs = require('fs'); var cache = {}; /** * Reads a text file and stores it in the cache. * * @param {string} path - Path to the file you want to read. * @param {object} [options] - Optional options object, passed to fs.readFile. * @param {string} [options.encoding=utf8] - The exp...
Fix import for new Flask-SQlAlchemy (no longer in flaskext)
""" # # #### ##### # # ##### # # # # # # # # # ## ## # # # ## # # ### #### #### # # # # # # # # ##### # # # # # # # # ## # # # # # # ##### # # # # # # # # Kremlin Mag...
""" # # #### ##### # # ##### # # # # # # # # # ## ## # # # ## # # ### #### #### # # # # # # # # ##### # # # # # # # # ## # # # # # # ##### # # # # # # # # Kremlin Mag...
Fix package data so that VERSION file actually gets installed
from setuptools import setup, find_packages import sys, os desc_lines = open('README', 'r').readlines() PACKAGE = 'mtconvert' VERSION = open(os.path.join(os.path.dirname(os.path.realpath(__file__)),'oldowan', PACKAGE, 'VERSION')).read().strip() setup(name='oldowan.%s' % PACKAGE, version=VERSION, descrip...
from setuptools import setup, find_packages import sys, os desc_lines = open('README', 'r').readlines() PACKAGE = 'mtconvert' VERSION = open(os.path.join(os.path.dirname(os.path.realpath(__file__)),'oldowan', PACKAGE, 'VERSION')).read().strip() setup(name='oldowan.%s' % PACKAGE, version=VERSION, descrip...
Set for zero or one slash
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
from django.conf import settings from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from contact.views import ChipyContactView admin.autodiscover() urlpatterns = patter...
Check empty image + missing alt attribute.
<li class="event-list-item"> <a class="event-list-item-link" href="{{ $event->uri() }}"> <div class="event-list-item-image-wrapper"> @empty (!$event->image) <img class="event-list-item-image" src="{{ $event->present()->image(540, 400) }}" width="{{ $event->image->width }}" height="{{...
<li class="event-list-item"> <a class="event-list-item-link" href="{{ $event->uri() }}"> <div class="event-list-item-image-wrapper"> <img class="event-list-item-image" src="{{ $event->present()->image(540, 400) }}" width="{{ $event->image->width }}" height="{{ $event->image->height }}" alt=""> ...
Fix "Unused method, property, variable or parameter "
<?php namespace Wanjee\Shuwee\AdminBundle\Menu; use Knp\Menu\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Wanjee\Shuwee\AdminBundle\Event\ConfigureMenuEvent; /** * Class Builder * @package Wanjee\Shuwee\AdminBundle\Menu */ class Builder { /** * @var \Knp\Menu\Fac...
<?php namespace Wanjee\Shuwee\AdminBundle\Menu; use Knp\Menu\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Wanjee\Shuwee\AdminBundle\Event\ConfigureMenuEvent; /** * Class Builder * @package Wanjee\Shuwee\AdminBundle\Menu */ class Builder { /** * @var \Knp\Menu\Fac...
Fix window global bug in explode
import Bacon from 'baconjs'; function _snakeToCamel(s){ // From https://coderwall.com/p/iprsng/convert-snake-case-to-camelcase return s.replace(/(\_\w)/g, function(m){return m[1].toUpperCase();}); } export function explode(action$){ let exploded = {}; // Values in action$ look like { type: TOGGLE_A...
import Bacon from 'baconjs'; function _snakeToCamel(s){ // From https://coderwall.com/p/iprsng/convert-snake-case-to-camelcase return s.replace(/(\_\w)/g, function(m){return m[1].toUpperCase();}); } export function explode(actions$){ let exploded = {}; // Values in action$ look like { type: TOGGLE_...
Replace app() helper with the instance
<?php namespace Neves\Events; use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; class EventServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $this...
<?php namespace Neves\Events; use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; class EventServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $this...
Add lint reporter rules and enums
var gulp = require('gulp'); var todo = require('gulp-todo'); var lint = require('gulp-eslint'); var paths = { src: './', spec: './spec/*.js', js: [ './*.js', './src/*.js', './src/**/*.js', './scripts/**/*.js', './scripts/**/**/*.js', './commands/*.js' ], }; const report = { ignore: 0...
var gulp = require('gulp'); var todo = require('gulp-todo'); var lint = require('gulp-eslint'); var paths = { src: './', spec: './spec/*.js', js: [ './*.js', './src/*.js', './src/**/*.js', './scripts/**/*.js', './scripts/**/**/*.js', './commands/*.js' ], }; var options = { todo: { ...
Add error output to testreport.
var assert = require('assert'); var request = require('supertest'); var exec = require('child_process').exec; var application = require(__dirname + '/server.js'); describe('server', function () { before(function () { application.listen(); }); after(function () { application.close(); }...
var assert = require('assert'); var request = require('supertest'); var exec = require('child_process').exec; var application = require(__dirname + '/server.js'); describe('server', function () { before(function () { application.listen(); }); after(function () { application.close(); }...
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...
Allow reply_to to not be set in messages to the MPD frontend
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): """ ...
Disable the placeholder if the label is hidden
<?php namespace fieldwork\components; class TextField extends Field { const ON_ENTER_NEXT = 'next'; const ON_ENTER_SUBMIT = 'submit'; private $onEnter = '', $mask = null; public function getAttributes () { $att = array(); if (!empty($this->onEnter)) $att['d...
<?php namespace fieldwork\components; class TextField extends Field { const ON_ENTER_NEXT = 'next'; const ON_ENTER_SUBMIT = 'submit'; private $onEnter = '', $mask = null; public function getAttributes () { $att = array(); if (!empty($this->onEnter)) $att['d...
Adjust disable button create task.
/** * Created by eurides on 25/04/16. */ (function ($) { $.fn.serverStatus = function () { $.ajax({ type: 'GET', dataType: 'json', url: 'serviceStatus', success: function (data) { if ((!data) || (!data.statusServidor)) { ...
/** * Created by eurides on 25/04/16. */ (function ($) { $.fn.serverStatus = function () { $.ajax({ type: 'GET', dataType: 'json', url: 'serviceStatus', success: function (data) { if ((!data) || (!data.statusServidor)) { ...
Add number input to mui
/** * Created by steve on 15/09/15. */ import React from 'react'; var utils = require('../utils'); var classNames = require('classnames'); import ValidationMixin from '../ValidationMixin'; const TextField = require('material-ui/lib/text-field'); /** * There is no default number picker as part of Material-UI. * Ins...
/** * Created by steve on 15/09/15. */ import React from 'react'; var utils = require('../utils'); var classNames = require('classnames'); import ValidationMixin from '../ValidationMixin'; class MuiNumber extends React.Component { render() { let formClasses = classNames('form-group', { 'has-error' : thi...
Fix button color for confirm dialogue.
$(function() { $('#btnAddPermission').click(function() { $(this).parent().append(JST["assets/templates/rights/permissioninput.html"]); }); $('#deleteGroup').click(function() { var self = this; swal({ title: 'Are you sure?', text: 'If you continue, you will no...
$(function() { $('#btnAddPermission').click(function() { $(this).parent().append(JST["assets/templates/rights/permissioninput.html"]); }); $('#deleteGroup').click(function() { var self = this; swal({ title: 'Are you sure?', text: 'If you continue, you will no...
Allow using non-Premium keys for Google Maps client
#!/usr/local/bin/python # -*- coding: utf-8 -*- import googlemaps import base64 from exceptions import InvalidGoogleCredentials class GoogleMapsClientFactory(): clients = {} @classmethod def get(cls, client_id, client_secret, channel=None): cache_key = "{}:{}:{}".format(client_id, client_secret,...
#!/usr/local/bin/python # -*- coding: utf-8 -*- import googlemaps import base64 from exceptions import InvalidGoogleCredentials class GoogleMapsClientFactory(): clients = {} @classmethod def get(cls, client_id, client_secret, channel=None): cache_key = "{}:{}:{}".format(client_id, client_secret, ...
Disable fluxible logs in production
import polyfill from 'babel-polyfill'; // eslint-disable-line no-unused-vars import d from 'debug'; import React from 'react'; import ReactDOM from 'react-dom'; import { Router, browserHistory } from 'react-router'; import routes from 'components/Routes'; import app from './app'; import fetchRouteData from 'utils/fetc...
import polyfill from 'babel-polyfill'; // eslint-disable-line no-unused-vars import d from 'debug'; import React from 'react'; import ReactDOM from 'react-dom'; import { Router, browserHistory } from 'react-router'; import routes from 'components/Routes'; import app from './app'; import fetchRouteData from 'utils/fetc...
Clean up controlled vocab tests
import unittest from cybox.common.vocabs import VocabString import cybox.test from cybox.utils import normalize_to_xml class TestVocabString(unittest.TestCase): def test_plain(self): a = VocabString("test_value") self.assertTrue(a.is_plain()) def test_round_trip(self): vocab_dict = ...
import unittest from cybox.common.vocabs import VocabString import cybox.test from cybox.utils import normalize_to_xml class TestVocabString(unittest.TestCase): def test_plain(self): a = VocabString("test_value") self.assertTrue(a.is_plain()) def test_round_trip(self): attr_dict = {...
Fix : response datas list should not be unicoded
import msgpack import logging class MessageFormatError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class Request(object): """Handler objects for frontend->backend objects messages""" def __init__(self, raw_message, compressed=...
import msgpack import logging class MessageFormatError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class Request(object): """Handler objects for frontend->backend objects messages""" def __init__(self, raw_message, compressed=...
Add another test file location
'use babel'; import { CompositeDisposable, File } from 'atom'; export default { subscriptions: null, activate() { // Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable this.subscriptions = new CompositeDisposable(); this.subscriptions.add(atom.commands.add('ato...
'use babel'; import { CompositeDisposable, File } from 'atom'; export default { subscriptions: null, activate() { // Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable this.subscriptions = new CompositeDisposable(); this.subscriptions.add(atom.commands.add('ato...
Increment version for new max_dBFS property
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.11.0', author='James Robert', author_email='jiaaro@gmail.com', description='Manipulate ...
__doc__ = """ Manipulate audio with an simple and easy high level interface. See the README file for details, usage info, and a list of gotchas. """ from setuptools import setup setup( name='pydub', version='0.10.0', author='James Robert', author_email='jiaaro@gmail.com', description='Manipulate ...
Simplify the buttons beneath the login form
@title('Login') @extends('layouts.small') @section('small-content') {!! Form::open(['route' => 'login.post']) !!} @formGroup('username') {!! Form::label('username') !!} {!! Form::text('username', null, ['class' => 'form-control', 'required']) !!} @error('username') ...
@title('Login') @extends('layouts.small') @section('small-content') {!! Form::open(['route' => 'login.post']) !!} @formGroup('username') {!! Form::label('username') !!} {!! Form::text('username', null, ['class' => 'form-control', 'required']) !!} @error('username') ...
Make data_files paths absolute again
# -*- coding: utf-8 -*- import sys import os.path from setuptools import Command, find_packages, setup HERE = os.path.abspath(os.path.dirname(__file__)) README_PATH = os.path.join(HERE, 'README.rst') try: README = open(README_PATH).read() except IOError: README = '' setup( name='rollbar-udp-agent', v...
# -*- coding: utf-8 -*- import sys import os.path from setuptools import Command, find_packages, setup HERE = os.path.abspath(os.path.dirname(__file__)) README_PATH = os.path.join(HERE, 'README.rst') try: README = open(README_PATH).read() except IOError: README = '' setup( name='rollbar-udp-agent', v...
Make acquire_context always return some Context
"""Placeholder model for Zinnia""" import inspect from django.template.context import Context, RequestContext from cms.models.fields import PlaceholderField from cms.plugin_rendering import render_placeholder from zinnia.models.entry import EntryAbstractClass class EntryPlaceholder(EntryAbstractClass): """Entry...
"""Placeholder model for Zinnia""" import inspect from cms.models.fields import PlaceholderField from cms.plugin_rendering import render_placeholder from zinnia.models.entry import EntryAbstractClass class EntryPlaceholder(EntryAbstractClass): """Entry with a Placeholder to edit content""" content_placehol...
Append hostname to messages file. This supports a use-case where portions of the processing could happen on various hosts.
# logger module from datetime import datetime import os import socket # gethostname() logfile = None logbuf = [] def init(analysis_path): global logfile if not os.path.isdir(analysis_path): log("logger: analysis_path missing:", analysis_path) logfile = os.path.join(analysis_path...
# logger module from datetime import datetime import os logfile = None logbuf = [] def init(analysis_path): global logfile if not os.path.isdir(analysis_path): log("logger: analysis_path missing:", analysis_path) use_log_dir = False if use_log_dir: logdir = os.path.join(analysis_path,...
Remove .user to appease Leon
module.exports = { name: "Member Nickname Changed MOD", isEvent: true, fields: ["Temp Variable Name (stores new nickname):", "Temp Variable Name (stores member object):"], mod: function(DBM) { DBM.Mindlesscargo = DBM.Mindlesscargo || {}; DBM.Mindlesscargo.nicknameChanged...
module.exports = { name: "Member Nickname Changed MOD", isEvent: true, fields: ["Temp Variable Name (stores new nickname):", "Temp Variable Name (stores member object):"], mod: function(DBM) { DBM.Mindlesscargo = DBM.Mindlesscargo || {}; DBM.Mindlesscargo.nicknameChanged...
Correct test criteria for time format for scheduled skill. Now matches current behaviour, previous behaviour is not a good idea since it depended on Locale.
from datetime import datetime, timedelta import unittest from mycroft.skills.scheduled_skills import ScheduledSkill from mycroft.util.log import getLogger __author__ = 'eward' logger = getLogger(__name__) class ScheduledSkillTest(unittest.TestCase): skill = ScheduledSkill(name='ScheduledSkillTest') def te...
from datetime import datetime, timedelta import unittest from mycroft.skills.scheduled_skills import ScheduledSkill from mycroft.util.log import getLogger __author__ = 'eward' logger = getLogger(__name__) class ScheduledSkillTest(unittest.TestCase): skill = ScheduledSkill(name='ScheduledSkillTest') def te...
Delete unused value extractor attribute.
from webapp_health_monitor import errors class Verificator(object): verificator_name = None def __init__(self, **kwargs): pass def run(self): raise NotImplementedError() def __str__(self): if self.verificator_name: return self.verificator_name else: ...
from webapp_health_monitor import errors class Verificator(object): verificator_name = None def __init__(self, **kwargs): pass def run(self): raise NotImplementedError() def __str__(self): if self.verificator_name: return self.verificator_name else: ...
Remove now-unused sections from submission flow SVN-Revision: 3230
package gov.nih.nci.cabig.caaers.domain.expeditedfields; import gov.nih.nci.cabig.ctms.domain.CodedEnum; public enum ExpeditedReportSection implements CodedEnum<Integer>{ BASICS_SECTION("Basic AE information"), ADVERSE_EVENT_SECTION("Adverse events"), REPORTER_INFO_SECTION("Reporter Information"), ...
package gov.nih.nci.cabig.caaers.domain.expeditedfields; import gov.nih.nci.cabig.ctms.domain.CodedEnum; public enum ExpeditedReportSection implements CodedEnum<Integer>{ BASICS_SECTION("Basic AE information"), ADVERSE_EVENT_SECTION("Adverse events"), REPORTER_INFO_SECTION("Reporter Information"), ...
Make HF test take much less time!
import theanets import util class TestTrainer(util.MNIST): def setUp(self): super(TestTrainer, self).setUp() self.exp = theanets.Experiment( theanets.Autoencoder, layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE)) def assert_progress(self, algo, **kwargs): trainer...
import theanets import util class TestTrainer(util.MNIST): def setUp(self): super(TestTrainer, self).setUp() self.exp = theanets.Experiment( theanets.Autoencoder, layers=(self.DIGIT_SIZE, 10, self.DIGIT_SIZE)) def assert_progress(self, algo, **kwargs): trainer...
Change JiraDataService to JiraDataSource in @dl-tools/import-people-from-jira
define([ '@shared/people' ], function() { function createPersonDataFromJiraUser(jiraUser) { return { full_name: jiraUser.displayName, email: jiraUser.email, username: jiraUser.name, avatar: jiraUser.avatarUrls ? jiraUser.avatarUrls['48x48'] : null ...
define([ '@shared/people' ], function() { function createPersonDataFromJiraUser(jiraUser) { return { full_name: jiraUser.displayName, email: jiraUser.email, username: jiraUser.name, avatar: jiraUser.avatarUrls ? jiraUser.avatarUrls['48x48'] : null ...
BAP-1626: Customize multi-step setup forms - abstract step provides console command run interface
<?php namespace Oro\Bundle\InstallerBundle\Process\Step; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\StreamOutput; use Sylius\Bundle\FlowBundle\Process\Step\ControllerStep; abstract class AbstractStep extends Controller...
<?php namespace Oro\Bundle\InstallerBundle\Process\Step; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\StreamOutput; use Sylius\Bundle\FlowBundle\Process\Step\ControllerStep; abstract class AbstractStep extends Controller...
build(Build): Exclude giant, static JS files from transpilation.
'use strict'; (() => { module.exports = (gulp, plugins, config) => { return () => { return gulp.src([ `${config.patternsPath}/**/*.js`, `!${config.patternsPath}/**/*.min.js`, `!${config.patternsPath}/base/slipsum/**/*` ]) .pipe(plugins.changed(config.buildPath)) ...
'use strict'; (() => { module.exports = (gulp, plugins, config) => { return () => { return gulp.src([`${config.patternsPath}/**/*.js`, `!${config.patternsPath}/**/*.min.js`]) .pipe(plugins.changed(config.buildPath)) .pipe(plugins.plumber({ errorHandler: plugins.notify.onError('Erro...
Move ValidationError messages to a dictionary that can be accessed from PinForm.clean
from django import forms from .models import Pin class PinForm(forms.ModelForm): url = forms.CharField(required=False) image = forms.ImageField(label='or Upload', required=False) _errors = { 'not_image': 'Requested URL is not an image file. Only images are currently supported.', 'pinned'...
from django import forms from .models import Pin class PinForm(forms.ModelForm): url = forms.CharField(required=False) image = forms.ImageField(label='or Upload', required=False) class Meta: model = Pin fields = ['url', 'image', 'description', 'tags'] def clean(self): cleane...
Add examples to code style validation
'use strict'; module.exports = function (gulp, $) { gulp.task('scripts:setup', function () { return gulp.src('source') .pipe($.symlink('examples/source', { force: true })); }); gulp.task('jscs', function () { return gulp.src([ 'source/**/*.js', 'examples/js/*.js' ]) .pipe($....
'use strict'; module.exports = function (gulp, $) { gulp.task('scripts:setup', function () { return gulp.src('source') .pipe($.symlink('examples/source', { force: true })); }); gulp.task('jscs', function () { return gulp.src('source/**/*.js') .pipe($.jscs()); }); gulp.task('jshint', fu...
Allow switching template and display for field
/** * Created by dmorina on 27/06/15. */ /** * mdTemplateCompilerDirective * @namespace crowdsource.template.directives */ (function () { 'use strict'; angular .module('crowdsource.template.directives') .directive('mdTemplateCompiler', mdTemplateCompilerDirective); function mdTemplate...
/** * Created by dmorina on 27/06/15. */ /** * mdTemplateCompilerDirective * @namespace crowdsource.template.directives */ (function () { 'use strict'; angular .module('crowdsource.template.directives') .directive('mdTemplateCompiler', mdTemplateCompilerDirective); function mdTemplate...
Fix: Use st2common log and not logging
from datetime import timedelta import eventlet import sys from threading import Thread import time from st2common import log as logging # Constants SUCCESS_EXIT_CODE = 0 eventlet.monkey_patch( os=True, select=True, socket=True, thread=False if '--use-debugger' in sys.argv else True, time=True ) ...
from datetime import timedelta import eventlet import logging import sys from threading import Thread import time # Constants SUCCESS_EXIT_CODE = 0 eventlet.monkey_patch( os=True, select=True, socket=True, thread=False if '--use-debugger' in sys.argv else True, time=True ) LOG = logging.getLogger...
Fix typo an suppored -> supported
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
# -*- coding: utf-8 -*- ''' Manage PagerDuty users. Example: .. code-block:: yaml ensure bruce test user 1: pagerduty.user_present: - name: 'Bruce TestUser1' - email: bruce+test1@lyft.com - requester_id: P1GV5NT ''' def __virtual__(): ''' Only load if th...
Use latest cub widget js
<?php namespace Cub\CubLaravel; use Config; class CubWidget { /** * Get Cub Widget header script * * @return string */ public function headerScript() { $script = '<script>' . '(function(){' . 'if (document.getElementById("cub-widget-script")) {re...
<?php namespace Cub\CubLaravel; use Config; class CubWidget { /** * Get Cub Widget header script * * @return string */ public function headerScript() { $script = '<script>' . '(function(){' . 'if (document.getElementById("cub-widget-script")) {re...
Create /login, /create routes for API
import sys from flask import Flask, render_template, jsonify, request import subprocess from digitalocean import SSHKey, Manager app = Flask(__name__) @app.route('/login') def login(): # Get from Chrome extension token = request.args.get('token') manager = Manager(token=token) # Instantiate ``api``...
import sys from flask import Flask, render_template, jsonify, request from digitalocean import SSHKey, Manager app = Flask(__name__) manager = Manager(token="24611cca29682d3d54f8208b67a47dbe8b6ea01b2c8103ba61150ece4b6259b6") my_droplets = manager.get_all_droplets() # Check for success print(my_droplets) # Get from ...
Fix flag delimiter support from 30ec188.
#!/usr/bin/env python #coding=utf8 """ This module contains functions used by a Dehacked table entry to filter certain values when reading or writing them. """ import math import re def filter_thing_flags_read(value, table): """ Filters a thing's flags value. Extended patches can use mnemonics for ...
#!/usr/bin/env python #coding=utf8 """ This module contains functions used by a Dehacked table entry to filter certain values when reading or writing them. """ import math import re def filter_thing_flags_read(value, table): """ Filters a thing's flags value. Extended patches can use mnemonics for ...
Switch to using MySQL Prepared Statements
<?php require('DB_Config.php'); require('Encrypt.class.php'); class Authenticate { private $mysqli; //Get the table structure from DB_Config private $usertable = TABLE_OF_USERS; private $usercol = COLUMN_OF_USERS; private $passwordcol = COLUMN_OF_PASSWORDS; function __construct() { $mys...
<?php require('DB_Config.php'); require('Encrypt.class.php'); class Authenticate { private $mysqli; //Get the table structure from DB_Config private $usertable = TABLE_OF_USERS; private $usercol = COLUMN_OF_USERS; private $passwordcol = COLUMN_OF_PASSWORDS; function __construct() { $mys...
Increase max accepted size of recommendation field
<?php namespace RadDB\Http\Requests; use Illuminate\Http\Request; use Illuminate\Foundation\Http\FormRequest; class StoreRecommendationRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { ...
<?php namespace RadDB\Http\Requests; use Illuminate\Http\Request; use Illuminate\Foundation\Http\FormRequest; class StoreRecommendationRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { ...
Support for python3.5 has been added for configparser
# Copyright 2017 <thenakliman@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# Copyright 2017 <thenakliman@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Implement cacheKeyFn and fix lint
import DataLoader from 'dataloader'; import client from 'util/client'; export default () => new DataLoader( async categoryQueries => { const body = []; categoryQueries.forEach(({ id, first, before, after }) => { // TODO error independently? if (before && after) { throw new ...
import DataLoader from 'dataloader'; import client from 'util/client'; export default () => new DataLoader(async categoryQueries => { const body = []; categoryQueries.forEach(({ id, first, before, after }) => { // TODO error independently? if (before && after) { throw new Error('Use of b...
Create backtrace log file instead of dumping backtrace
<?php /** * Part of Cli for CodeIgniter * * @author Kenji Suzuki <https://github.com/kenjis> * @license MIT License * @copyright 2015 Kenji Suzuki * @link https://github.com/kenjis/codeigniter-cli */ namespace Kenjis\CodeIgniter_Cli\Command; use Aura\Cli\Stdio; use Aura\Cli\Context; use CI_Contro...
<?php /** * Part of Cli for CodeIgniter * * @author Kenji Suzuki <https://github.com/kenjis> * @license MIT License * @copyright 2015 Kenji Suzuki * @link https://github.com/kenjis/codeigniter-cli */ namespace Kenjis\CodeIgniter_Cli\Command; use Aura\Cli\Stdio; use Aura\Cli\Context; use CI_Contro...
Print the stack with the latest atom at the top
package net.jloop.rejoice; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; public class Stack implements Iterable<Atom> { private final ArrayList<Atom> atoms; public Stack() { this.atoms = new ArrayList<>(); } public Stack(ArrayList<Atom> atoms) { ...
package net.jloop.rejoice; import java.util.ArrayList; import java.util.Iterator; public class Stack implements Iterable<Atom> { private final ArrayList<Atom> atoms; public Stack() { this.atoms = new ArrayList<>(); } public Stack(ArrayList<Atom> atoms) { this.atoms = atoms; } ...
Fix (Dashboard Account): add newline end of file
<?php namespace AppBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; class AccountType extends AbstractType { public function buildForm(Form...
<?php namespace AppBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; class AccountType extends AbstractType { public function buildForm(Form...
Fix search Directories for LinkTag-News
<?php class Kwc_Basic_LinkTag_News_DirectoriesController extends Kwf_Controller_Action_Auto_Grid { protected function _initColumns() { $this->_columns->add(new Kwf_Grid_Column('id')); $this->_columns->add(new Kwf_Grid_Column('name')); if ($this->_getParam('id')) { $subRootCo...
<?php class Kwc_Basic_LinkTag_News_DirectoriesController extends Kwf_Controller_Action_Auto_Grid { protected function _initColumns() { $this->_columns->add(new Kwf_Grid_Column('id')); $this->_columns->add(new Kwf_Grid_Column('name')); if ($this->_getParam('id')) { $subRootCo...
Check if string before decoding
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import json import six import websocket from polyaxon_client.logger import logger class SocketTransportMixin(object): """Socket operations transport.""" def socket(self, url, message_handler, headers=None): web...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import json import websocket from polyaxon_client.logger import logger class SocketTransportMixin(object): """Socket operations transport.""" def socket(self, url, message_handler, headers=None): webs = websock...
Clean DO sidebar METS data on failure
(function () { 'use strict'; angular.module('drmc.directives').directive('arDigitalObjectViewerSidebar', function (SETTINGS, InformationObjectService, ModalDigitalObjectViewerService) { return { restrict: 'E', templateUrl: SETTINGS.viewsPath + '/partials/digital-object-viewer-sidebar.html', ...
(function () { 'use strict'; angular.module('drmc.directives').directive('arDigitalObjectViewerSidebar', function (SETTINGS, InformationObjectService, ModalDigitalObjectViewerService) { return { restrict: 'E', templateUrl: SETTINGS.viewsPath + '/partials/digital-object-viewer-sidebar.html', ...
Swap out Q for Promise and remove superfluous StatsD.
// Copyright 2014-2015, Renasar Technologies Inc. /* jshint node: true */ "use strict"; var di = require('di'); module.exports = Runner; di.annotate(Runner, new di.Provide('Http')); di.annotate(Runner, new di.Inject( 'Http.Server', 'Services.Core', 'Services.Configuration', 'Profiles...
// Copyright 2014-2015, Renasar Technologies Inc. /* jshint node: true */ "use strict"; var di = require('di'); module.exports = Runner; di.annotate(Runner, new di.Provide('Http')); di.annotate(Runner, new di.Inject( 'Http.Server', 'Services.Core', 'Services.Configuration', 'Profiles...
comment_parser: Add __repr__ to Comment class.
#!/usr/bin/python """This module provides constructs common to all comment parsers.""" class Error(Exception): """Base Error class for all comment parsers.""" pass class FileError(Error): """Raised if there is an issue reading a given file.""" pass class UnterminatedCommentError(Error): """Rai...
#!/usr/bin/python """This module provides constructs common to all comment parsers.""" class Error(Exception): """Base Error class for all comment parsers.""" pass class FileError(Error): """Raised if there is an issue reading a given file.""" pass class UnterminatedCommentError(Error): """Rai...
Use abspath for COPY command
import os import glob from django.apps import apps from django.db import connection from django.core.management.base import BaseCommand class Command(BaseCommand): """ Turn off auto system check for all apps We will maunally run system checks only for the 'addressbase' and 'pollingstations' apps ...
import os import glob from django.apps import apps from django.db import connection from django.core.management.base import BaseCommand class Command(BaseCommand): """ Turn off auto system check for all apps We will maunally run system checks only for the 'addressbase' and 'pollingstations' apps ...
Fix true test, add false test
class TestEnumberable(object): def test_inject(self, ec): w_res = ec.space.execute(ec, """ return (5..10).inject(1) do |prod, n| prod * n end """) assert ec.space.int_w(w_res) == 15120 w_res = ec.space.execute(ec, """ return (1..10).inject 0 do |s...
class TestEnumberable(object): def test_inject(self, ec): w_res = ec.space.execute(ec, """ return (5..10).inject(1) do |prod, n| prod * n end """) assert ec.space.int_w(w_res) == 15120 w_res = ec.space.execute(ec, """ return (1..10).inject 0 do |s...
Add a method for line by line asset parsing
class Asset: """ This is an ooni-probe asset. It is a python iterator object, allowing it to be efficiently looped. To create your own custom asset your should subclass this and override the next_asset method and the len method for computing the length of the asset. """ def __init__(self...
class Asset: """ This is an ooni-probe asset. It is a python iterator object, allowing it to be efficiently looped. To create your own custom asset your should subclass this and override the next_asset method and the len method for computing the length of the asset. """ def __init__(self...
Add tests for `getFullString` in Selectors
const Selector = require('selector_manager/model/Selector'); const Selectors = require('selector_manager/model/Selectors'); module.exports = { run() { describe('Selector', () => { var obj; beforeEach(() => { obj = new Selector(); }); afterEach(() => { obj ...
const Selector = require('selector_manager/model/Selector'); const Selectors = require('selector_manager/model/Selectors'); module.exports = { run() { describe('Selector', () => { var obj; beforeEach(() => { obj = new Selector(); }); afterEach(() => { obj ...
Fix bugs in new class
def compare_vectors(x, y): for x_i, y_i in zip(x, y): comparison = _compare(x_i, y_i) if comparison == 0: continue else: return comparison return 0 def _compare(x, y): if x is not None and y is not None: return int(x > y) - int(x < y) elif x is n...
def compare_vectors(x, y): for x_i, y_i in zip(x, y): comparison = _compare(x_i, y_i) if comparison == 0: continue else: return comparison return 0 def _compare(x, y): if x is not None and y is not None: return int(x > y) - int(x < y) elif x is n...
Remove public declaration from test class.
package main; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertArrayEquals; class MatrixTransformationTest { @Test void rotateTo90Degrees() throws Exception { int[][] matrix = new int[][] { {0, 0, 0, 0}, {1, 1, 1, 1}, ...
package main; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertArrayEquals; public class MatrixTransformationTest { @Test void rotateTo90Degrees() throws Exception { int[][] matrix = new int[][] { {0, 0, 0, 0}, {1, 1, 1, 1}, ...
Add 'grunt check' for quick checking
module.exports = function(grunt) { grunt.loadNpmTasks('grunt-blanket'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-coveralls'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-screeps'); grunt.initConfig({ blanket: { coverage: { ...
module.exports = function(grunt) { grunt.loadNpmTasks('grunt-blanket'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-coveralls'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-screeps'); grunt.initConfig({ blanket: { coverage: { ...
Decrease cookie length in User model from 255 to 100 chars
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models class User(models.Model): MALE = -1 UNDEFINED = 0 FEMALE = 1 GENDER_CHOICES = ( (MALE, 'Male'), (UNDEFINED, 'Undefined'), (FEMALE, 'Female') ) school = models.ForeignKey('unich...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models class User(models.Model): MALE = -1 UNDEFINED = 0 FEMALE = 1 GENDER_CHOICES = ( (MALE, 'Male'), (UNDEFINED, 'Undefined'), (FEMALE, 'Female') ) school = models.ForeignKey('unich...
Remove redundant property definitions from gRenderer
gRenderer = { frame: 0, render: function() { this.context.fillStyle = '#000'; this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height); switch (gScene.scene) { case 'title': gScene.renderTitle(); break; case 'hangar': case 'game': ...
gRenderer = { frame: 0, canvas: document.getElementById('canvas'), context: this.canvas.getContext('2d'), render: function() { this.context.fillStyle = '#000'; this.context.fillRect(0, 0, canvas.width, canvas.height); switch (gScene.scene) { case 'title': gScene.renderTitle(...
Make the X Y and Z checkboxes automatically selected on program start
package graphics; import javax.swing.*; import java.awt.*; public class EvolutionSelector extends JPanel { private static JFrame frame; //Used to allow JLabel to word-wrap private static final String HTML_Formatting = "<html><body style='width: 100px'>"; public static JCheckBox xEquation = new JChec...
package graphics; import javax.swing.*; import java.awt.*; public class EvolutionSelector extends JPanel { private static JFrame frame; //Used to allow JLabel to word-wrap private static final String HTML_Formatting = "<html><body style='width: 100px'>"; public static JCheckBox xEquation = new JChec...
Change abao test to use the local installation instead of the global.
var assert = require('assert'); var request = require('supertest'); var exec = require('child_process').exec; var application = require(__dirname + '/server.js'); describe('server', function () { before(function () { application.listen(); }); after(function () { application.close(); }...
var assert = require('assert'); var request = require('supertest'); var exec = require('child_process').exec; var application = require(__dirname + '/server.js'); describe('server', function () { before(function () { application.listen(); }); after(function () { application.close(); }...
Revert changes that broke everything
vars = require('./vars'); dash_button = require('node-dash-button'); nest = require('unofficial-nest-api'); util = require('util'); var device; var structure; var dash = dash_button(vars.AMAZON_DASH_BUTTON_MAC); console.log("Nest API Connecting..."); nest.login(vars.NEST_USER_NAME, vars.NEST_PASSWORD, function (err, ...
vars = require('./vars'); dash_button = require('node-dash-button'); nest = require('unofficial-nest-api'); var dash = dash_button(vars.AMAZON_DASH_BUTTON_MAC); console.log("Nest API Connecting..."); nest.login(vars.NEST_USER_NAME, vars.NEST_PASSWORD, function (err, data) { if (err) { console.log(err.mess...
Fix json to sql converter.
import os import os.path from json import loads import click from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB class JSONToSQL(object): def __init__(self, json, user, password, database): data = loads(json.read()) db = VendCrawlerDB(user, password, database) table = '...
import os import os.path from json import loads import click from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB class JSONToSQL(object): def __init__(self, json, user, password, database): self.data = loads(json.read()) self.db = VendCrawlerDB(user, password, database) ...
Adjust setting responsiveRefreshRate to trigger resize before elementWidthChange
<?php class Kwf_Owlcarousel_Kwc_Carousel_Component extends Kwc_Abstract_List_Component { public static function getSettings() { $ret = parent::getSettings(); $ret['componentName'] = trlKwfStatic('List Carousel'); $ret['generators']['child']['component'] = 'Kwf_Owlcarousel_Kwc_Carousel_Im...
<?php class Kwf_Owlcarousel_Kwc_Carousel_Component extends Kwc_Abstract_List_Component { public static function getSettings() { $ret = parent::getSettings(); $ret['componentName'] = trlKwfStatic('List Carousel'); $ret['generators']['child']['component'] = 'Kwf_Owlcarousel_Kwc_Carousel_Im...
Revert "Revert "drop old requirements"" This reverts commit f444e853936eb95bbe61c2bbf26098e417cc5fef.
#!/usr/bin/env python from setuptools import setup, find_packages from pupa import __version__ long_description = '' setup(name='pupa', version=__version__, packages=find_packages(), author='James Turk', author_email='jturk@sunlightfoundation.com', license='BSD', url='http://github...
#!/usr/bin/env python from setuptools import setup, find_packages from pupa import __version__ long_description = '' setup(name='pupa', version=__version__, packages=find_packages(), author='James Turk', author_email='jturk@sunlightfoundation.com', license='BSD', url='http://github...
Use getter woko use Java...
package woko.ext.usermanagement.facets.registration; import net.sourceforge.jfacets.IFacetDescriptorManager; import net.sourceforge.jfacets.annotations.FacetKey; import woko.ext.usermanagement.core.DatabaseUserManager; import woko.ext.usermanagement.core.User; import woko.facets.BaseFragmentFacet; import woko.persiste...
package woko.ext.usermanagement.facets.registration; import net.sourceforge.jfacets.IFacetDescriptorManager; import net.sourceforge.jfacets.annotations.FacetKey; import woko.ext.usermanagement.core.DatabaseUserManager; import woko.ext.usermanagement.core.User; import woko.facets.BaseFragmentFacet; import woko.persiste...
Change visibility of scope methods from default to public
package fc.lang; import java.util.HashMap; import java.util.Map; /** * Implementation of flat static scope */ public class Scope { private final Map<String, Expression> bindings = new HashMap<String, Expression>(); /** * Bind a variable with the given name to an expression. If the variable * alre...
package fc.lang; import java.util.HashMap; import java.util.Map; /** * Implementation of flat static scope */ public class Scope { private final Map<String, Expression> bindings = new HashMap<String, Expression>(); /** * Bind a variable with the given name to an expression. If the variable * alre...
Allow to set lang of foreignKeys through attribute
'use strict'; angular.module('arethusa.core').directive('foreignKeys',[ 'keyCapture', 'languageSettings', function (keyCapture, languageSettings) { return { restrict: 'A', scope: { ngChange: '&', ngModel: '@', foreignKeys: '=' }, link: function (scope, element, ...
'use strict'; angular.module('arethusa.core').directive('foreignKeys',[ 'keyCapture', 'languageSettings', function (keyCapture, languageSettings) { return { restrict: 'A', scope: { ngChange: '&', ngModel: '@' }, link: function (scope, element, attrs) { var paren...
Rename from to to name
const request = require('supertest'); const app = require('../app'); describe('transforms the name of the object in a coordinate', function () { it('Input place name-string,base coordinate, return coordinate and full name point', function (done) { request(app) .post('/searchCoordinate') ...
const request = require('supertest'); const app = require('../app'); describe('transforms the name of the object in a coordinate', function () { it('Input place name-string,base coordinate, return coordinate and full name point', function (done) { request(app) .post('/searchCoordinate') ...
Add require field on fields
<h1>Novi scripti</h1> <form id="novi_scripti" action="../api.php?s=scriptum" method="post"> <div class="row"> <div class="col-md-6 form-group"> <label for="content">Content</label> <textarea name="content" id="content" rows="20" cols="50" class="form-control vert" required></textar...
<h1>Novi scripti</h1> <form id="novi_scripti" action="../api.php?s=scriptum" method="post"> <div class="row"> <div class="col-md-6 form-group"> <label for="content">Content</label> <textarea name="content" id="content" rows="20" cols="50" class="form-control vert"></textarea> ...
Fix decoding of admin authorities from access tokens
package com.digirati.elucidate.infrastructure.security.impl; import com.digirati.elucidate.infrastructure.security.UserSecurityDetails; import com.digirati.elucidate.infrastructure.security.UserSecurityDetailsLoader; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map...
package com.digirati.elucidate.infrastructure.security.impl; import com.digirati.elucidate.infrastructure.security.UserSecurityDetails; import com.digirati.elucidate.infrastructure.security.UserSecurityDetailsLoader; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.spr...
Add default meta for empty tiles
(() => { const tools = []; DTile.Tool = class DTileTool { static register() { tools.push(new this()); } static get allTools() { return tools; } static get store() { return DTile.store; } static get state() { return DTileTool.store.getState(); } get...
(() => { const tools = []; DTile.Tool = class DTileTool { static register() { tools.push(new this()); } static get allTools() { return tools; } static get store() { return DTile.store; } static get state() { return DTileTool.store.getState(); } get...
Improve removal of qualifiers when fetching suggestions.
import uniqueId from 'lodash/uniqueId'; import npmsRequest from '../../util/npmsRequest'; const maxResults = 10; // TODO: Use a LRU to cache results function normalizeQuery(query) { return query .replace(/(\S+:'(?:[^'\\]|\\.)*')|(\S+:"(?:[^"\\]|\\.)*")|\S+:\S+/g, '') // Remove qualifiers .replace(/\s\s*...
import uniqueId from 'lodash/uniqueId'; import npmsRequest from '../../util/npmsRequest'; const maxResults = 10; // TODO: Use a LRU to cache results function normalizeQuery(query) { return query .replace(/[a-z0-9]+:([a-z0-9:]+)*/ig, '') // Remove qualifiers .replace(/\s\s*/g, ' ') // ...
Add shim config for jquery expander plugin so we don't have intermittent JS errors about jQuery not being defined
// Common configuration for RequireJS var require = { baseUrl: "/scripts", paths: { "jquery": "bower_components/jquery/dist/jquery.min", "knockout": "bower_components/knockout/dist/knockout", "bootstrap": "bower_components/bootstrap/dist/js/bootstrap.min", "text": "bower_compone...
// Common configuration for RequireJS var require = { baseUrl: "/scripts", paths: { "jquery": "bower_components/jquery/dist/jquery.min", "knockout": "bower_components/knockout/dist/knockout", "bootstrap": "bower_components/bootstrap/dist/js/bootstrap.min", "text": "bower_compone...
Ch23: Remove password from UserAdmin fieldsets.
from django.contrib import admin from .models import User @admin.register(User) class UserAdmin(admin.ModelAdmin): # list view list_display = ( 'get_name', 'email', 'get_date_joined', 'is_staff', 'is_superuser') list_display_links = ('get_name', 'email') list_f...
from django.contrib import admin from .models import User @admin.register(User) class UserAdmin(admin.ModelAdmin): # list view list_display = ( 'get_name', 'email', 'get_date_joined', 'is_staff', 'is_superuser') list_display_links = ('get_name', 'email') list_f...
[default-layout] Add prop type for versions
import React from 'react' import PropTypes from 'prop-types' import Button from 'part:@sanity/components/buttons/default' import Dialog from 'part:@sanity/components/dialogs/default' import styles from './styles/UpdateNotifierDialog.css' function CurrentVersionsDialog(props) { const {onClose, versions} = props re...
import React from 'react' import PropTypes from 'prop-types' import Button from 'part:@sanity/components/buttons/default' import Dialog from 'part:@sanity/components/dialogs/default' import styles from './styles/UpdateNotifierDialog.css' function CurrentVersionsDialog(props) { const {onClose, versions} = props ret...
Change location of Open Data Folder action to @user.home/Documents/Archi
/** * This program and the accompanying materials * are made available under the terms of the License * which accompanies this distribution in the file LICENSE.txt */ package com.archimatetool.editor.actions; import java.awt.Desktop; import java.awt.Desktop.Action; import java.io.File; import java.io.IOE...
/** * This program and the accompanying materials * are made available under the terms of the License * which accompanies this distribution in the file LICENSE.txt */ package com.archimatetool.editor.actions; import java.awt.Desktop; import java.awt.Desktop.Action; import java.io.File; import java.io.IOE...
Fix bug in web UI
if (document.body.className.indexOf("no-contains-view")>-1) { console.log("No view detected"); } else { var cvbtn = document.querySelector(".view-buttons .cards"); var lvbtn = document.querySelector(".view-buttons .list"); var vlst = document.querySelector(".view"); var listView = function () { ...
if (document.body.className.indexOf("no-contains-view")>-1) { console.log("No view detected"); } else { var cvbtn = document.querySelector(".view-buttons .cards"); var lvbtn = document.querySelector(".view-buttons .list"); var vlst = document.querySelector(".view"); var listView = function () { ...
[AC-5625] Address CodeClimate cognitive complexity concern
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from django.db.models import Q from impact.v1.helpers.criterion_helper import CriterionHelper class MatchingCriterionHelper(CriterionHelper): def __init__(self, subject): super().__init__(subject) self._app_ids_to_targets = {} self._t...
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from django.db.models import Q from impact.v1.helpers.criterion_helper import CriterionHelper class MatchingCriterionHelper(CriterionHelper): def __init__(self, subject): super().__init__(subject) self._app_ids_to_targets = {} self._t...