text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Increase the frequency of the sensing checks (important for the color sensor/simple line following.
import threading import time class SensorThread(object): def __init__(self, notify, delay=0): self.notify = notify self.delay = delay self.interval = 0.1 self.color = -1 def start(self, control, robot): self.control = control self.robot = robot thread =...
import threading import time class SensorThread(object): def __init__(self, notify, delay=0): self.notify = notify self.delay = delay self.interval = 0.2 self.color = -1 def start(self, control, robot): self.control = control self.robot = robot thread =...
Remove sorting by hashCode() - All right that was not a good idea - it breaks those from Migrators which don't set dependency yet...
package org.jboss.loom.actions; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * Sorts a list of actions so that dependencies go first, and depending actions go after. * * @Jira MIGR-104 * @author Ondrej Zizka, ozizka at redhat.com */ public cl...
package org.jboss.loom.actions; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * Sorts a list of actions so that dependencies go first, and depending actions go after. * * @Jira MIGR-104 * @author Ondrej Zizka, ozizka at redhat.com */ public cl...
Improve the stack returned from PdfkiwiError
class PdfkiwiError extends Error { constructor(message, code, status) { super(message); const hasValidCode = code !== null && code !== undefined; Object.defineProperty(this, 'message', { configurable : true, enumerable : false, value : hasValidCo...
class PdfkiwiError extends Error { constructor(message, code, status) { super(message); const hasValidCode = code !== null && code !== undefined; Object.defineProperty(this, 'message', { configurable : true, enumerable : false, value : hasValidCo...
Test with default value fails on new query serializer
<?php namespace GuzzleHttp\Tests\Command\Guzzle; use GuzzleHttp\Command\Command; use GuzzleHttp\Command\Guzzle\Description; use GuzzleHttp\Command\Guzzle\Serializer; use GuzzleHttp\Psr7\Request; /** * @covers \GuzzleHttp\Command\Guzzle\Serializer */ class SerializerTest extends \PHPUnit_Framework_TestCase { pub...
<?php namespace GuzzleHttp\Tests\Command\Guzzle; use GuzzleHttp\Command\Command; use GuzzleHttp\Command\Guzzle\Description; use GuzzleHttp\Command\Guzzle\Serializer; use GuzzleHttp\Psr7\Request; /** * @covers \GuzzleHttp\Command\Guzzle\Serializer */ class SerializerTest extends \PHPUnit_Framework_TestCase { pub...
Check version for latest cask behaviour changed
#! /usr/bin/env python # -*- coding: utf8 -*- import argparse import shutil from subprocess import check_output, run parser = argparse.ArgumentParser(description='Update every entries found in cask folder.') parser.add_argument('--pretend', dest='pretend', action='store_true', help='Pretend to ta...
#! /usr/bin/env python # -*- coding: utf8 -*- import argparse import shutil from subprocess import check_output, run parser = argparse.ArgumentParser(description='Update every entries found in cask folder.') parser.add_argument('--pretend', dest='pretend', action='store_true', help='Pretend to ta...
Replace \n with %n so that tests work on Windows.
package cucumber.runtime.java.test; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertEquals; public class SubstitutionStepdefs { private static final Map<String, String> ROL...
package cucumber.runtime.java.test; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertEquals; public class SubstitutionStepdefs { private static final Map<String, String> ROL...
Add 404 head for not found routes
<?hh // decl class Route { public static function dispatch(string $path, string $method): void { // Get the auto-generated URI Map $routes = require('build/URIMap.php'); // Match the path foreach($routes as $route_path => $controller_name) { $uri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_P...
<?hh // decl class Route { public static function dispatch(string $path, string $method): void { // Get the auto-generated URI Map $routes = require('build/URIMap.php'); // Match the path foreach($routes as $route_path => $controller_name) { $uri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_P...
Make video a little bit smaller
import PropTypes from 'prop-types' import React, { Component } from 'react' import YouTube from 'react-youtube' import config from '../../../config' import { StaticPage } from '../components' import { translate } from '../services/i18n' import { withAuthState } from '../containers' const videoOptions = { playerVars...
import PropTypes from 'prop-types' import React, { Component } from 'react' import YouTube from 'react-youtube' import config from '../../../config' import { StaticPage } from '../components' import { translate } from '../services/i18n' import { withAuthState } from '../containers' const videoOptions = { playerVars...
Support arrays and array-like objects
;(function(root) { 'use strict'; var handler = function(e) { var href, usedModifier, child; href = e.target.getAttribute('href'); if (!href) return; usedModifier = (e.ctrlKey || e.shiftKey || e.metaKey); if (!usedModifier && e.target.getAttribute('target') !== '_blank') { return; } ...
;(function(root) { 'use strict'; var blankshield = function(ele) { addEvent(ele, 'click', function(e) { var href, usedModifier, child; href = e.target.getAttribute('href'); if (!href) return; usedModifier = (e.ctrlKey || e.shiftKey || e.metaKey); if (!usedModifier && e.target.ge...
Check config and show what required options not exists
/* * grunt-browser-extension * https://github.com/addmitriev/grunt-browser-extension * * Copyright (c) 2015 Aleksey Dmitriev * Licensed under the MIT license. */ 'use strict'; var util = require('util'); var path = require('path'); var fs = require('fs-extra'); module.exports = function (grunt) { var Brows...
/* * grunt-browser-extension * https://github.com/addmitriev/grunt-browser-extension * * Copyright (c) 2015 Aleksey Dmitriev * Licensed under the MIT license. */ 'use strict'; var util = require('util'); var path = require('path'); var fs = require('fs-extra'); module.exports = function (grunt) { var Brows...
Update to work with new Geostore API
define([ 'Class', 'uri', 'bluebird', 'map/services/DataService' ], function(Class, UriTemplate, Promise, ds) { 'use strict'; var GET_REQUEST_ID = 'GeostoreService:get', SAVE_REQUEST_ID = 'GeostoreService:save'; var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}'; var GeostoreService = Clas...
define([ 'Class', 'uri', 'bluebird', 'map/services/DataService' ], function(Class, UriTemplate, Promise, ds) { 'use strict'; var GET_REQUEST_ID = 'GeostoreService:get', SAVE_REQUEST_ID = 'GeostoreService:save'; var URL = window.gfw.config.GFW_API_HOST + '/geostore/{id}'; var GeostoreService = Clas...
Fix init of local recognizer
import unittest import os from speech_recognition import WavFile from mycroft.client.speech.listener import RecognizerLoop __author__ = 'seanfitz' DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data") class LocalRecognizerTest(unittest.TestCase): def setUp(self): rl = RecognizerL...
import unittest import os from speech_recognition import WavFile from mycroft.client.speech.listener import RecognizerLoop __author__ = 'seanfitz' DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data") class LocalRecognizerTest(unittest.TestCase): def setUp(self): self.recognizer ...
Fix bug: must specify the port number.
from os.path import dirname from restclients.dao_implementation.mock import get_mockdata_url from restclients.dao_implementation.live import get_con_pool, get_live_url import logging from myuw_mobile.logger.logback import log_info class File(object): """ This implementation returns mock/static content. U...
from os.path import dirname from restclients.dao_implementation.mock import get_mockdata_url from restclients.dao_implementation.live import get_con_pool, get_live_url class File(object): """ This implementation returns mock/static content. Use this DAO with this configuration: RESTCLIENTS_HFS_DAO_C...
Fix: Fix bug in register aftter login
from copy import deepcopy from django.conf import settings from django.contrib.auth import login from rest_framework import serializers from rest_framework.exceptions import ValidationError from users.models import User class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Us...
from django.conf import settings from rest_framework import serializers from rest_framework.exceptions import ValidationError from users.models import User class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ( 'username', 'email'...
Update view dengan template header faq
<?php get_header('faq'); ?> <!-- start:main content --> <div class="container landing-content-faq"> <section id="content"> <!-- start:content --> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> ...
<?php get_header('private'); ?> <!-- start:main content --> <div class="container landing-content-faq"> <section id="content"> <!-- start:content --> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> ...
Fix the parallel env variable test to reset the env correctly
from numba.np.ufunc.parallel import get_thread_count from os import environ as env from numba.core import config import unittest class TestParallelEnvVariable(unittest.TestCase): """ Tests environment variables related to the underlying "parallel" functions for npyufuncs. """ _numba_parallel_test...
from numba.np.ufunc.parallel import get_thread_count from os import environ as env from numba.core import config import unittest class TestParallelEnvVariable(unittest.TestCase): """ Tests environment variables related to the underlying "parallel" functions for npyufuncs. """ _numba_parallel_test...
Add GitHub icon. Remove articles link
import React from 'react' import { Link } from 'gatsby' import MeImg from '../images/me.jpg' import { MenuIcon } from './icons/Menu' import { GitHubIcon } from './icons/GitHub' const Nav = ({ onClick }) => { return ( <div className="flex items-center border-b justify-between py-8 text-gray-800"> <Link to=...
import React from 'react' import { Link } from 'gatsby' import MeImg from '../images/me.jpg' import { MenuIcon } from './icons/Menu' const Nav = ({ onClick }) => { return ( <div className="flex items-center justify-between py-8 text-gray-800"> <Link to="/" aria-label="link to home page"> <div clas...
Revert ":bug: fixes datastore class name in example import" This reverts commit 1cf3a99a267679a7d422e2fb53c625e1e7f0a81f.
const { App, Util } = require('jovo-framework'); const { GoogleAssistant } = require('jovo-platform-googleassistant'); const { Alexa } = require('jovo-platform-alexa'); const { JovoDebugger } = require('jovo-plugin-debugger'); const { FileDb } = require('jovo-db-filedb'); const { DynamoDb } = require('jovo-db-dynamodb...
const { App, Util } = require('jovo-framework'); const { GoogleAssistant } = require('jovo-platform-googleassistant'); const { Alexa } = require('jovo-platform-alexa'); const { JovoDebugger } = require('jovo-plugin-debugger'); const { FileDb } = require('jovo-db-filedb'); const { DynamoDb } = require('jovo-db-dynamodb...
Allow https in body url
/*global describe:true it:true */ 'use strict'; var app = require('../app').app var request = require('supertest') describe('The router', function() { describe('index page', function() { it('should return HTTP 200 OK', function(done) { request(app) .get('/') .set('Accept', 'text/html') ...
/*global describe:true it:true */ 'use strict'; var app = require('../app').app var request = require('supertest') describe('The router', function() { describe('index page', function() { it('should return HTTP 200 OK', function(done) { request(app) .get('/') .set('Accept', 'text/html') ...
Enable bignumber support by default Configure mathjs so it uses bignums by default (with a somewhat excessive precision).
'use strict'; var math = require('mathjs'), async = require('async'); var errors; exports.name = 'Math'; exports.version = '0.1.2'; exports.description = 'Do mathematics!'; exports.configuration = { enabled: false }; exports.commands = { calc: { handler: calc, defaults: {}, params:...
'use strict'; var math = require('mathjs'), async = require('async'); var errors; exports.name = 'Math'; exports.version = '0.1.2'; exports.description = 'Do mathematics!'; exports.configuration = { enabled: false }; exports.commands = { calc: { handler: calc, defaults: {}, params:...
Fix bug global leaks, `;` to `,`
(function (tree) { tree.Extend = function Extend(elements, index) { this.selector = new(tree.Selector)(elements); this.index = index; }; tree.Extend.prototype.eval = function Extend_eval(env) { var selfSelectors = findSelfSelectors(env.selectors), targetValue = this.selector.elements[0].value; ...
(function (tree) { tree.Extend = function Extend(elements, index) { this.selector = new(tree.Selector)(elements); this.index = index; }; tree.Extend.prototype.eval = function Extend_eval(env) { var selfSelectors = findSelfSelectors(env.selectors); targetValue = this.selector.elements[0].value; ...
docs: Fix example of services for IAM Policies See also: PSOBAT-1482
"""Construct an IAM Policy from templates. Examples: pipeline.json: { "services": { "dynamodb": [ "another_app" ], "lambda": true, "s3": true } } """ import json import logging from ..utils...
"""Construct an IAM Policy from templates. Examples: pipeline.json: { "services": { "dynamodb": [ "another_app" ] "lambda": true, "s3": true } } """ import json import logging from ..utils ...
Make find_versions return a namedtuple as documented
import collections import git import version_info.exceptions __all__ = ( 'get_git_version', 'find_versions', ) VersionSpec = collections.namedtuple('VersionSpec', ('name', 'tag', 'commit')) def get_git_version(path): repo = git.Repo(path) head_commit = repo.head.ref.commit for tag in repo.ta...
import git import version_info.exceptions __all__ = ( 'get_git_version', 'find_versions', ) def get_git_version(path): repo = git.Repo(path) head_commit = repo.head.ref.commit for tag in repo.tags: if tag.commit == head_commit: return tag.name, head_commit.hexsha return ...
Fix bug in ipay config sample
<?php return array( //------------------------------- // Timezone for insert dates in database // If you want IPay not set timezone, just leave it empty //-------------------------------- 'timezone' => 'Asia/Tehran', //-------------------------------- // Database configuration //-----...
<?php return array( //------------------------------- // Timezone for insert dates in database // If you want IPay not set timezone, just leave it empty //-------------------------------- 'timezone' => 'Asia/Tehran', //-------------------------------- // Database configuration //-----...
Remove IF EXISTS from fix_fee_product_index
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-10-31 16:33 from __future__ import unicode_literals from django.db import migrations, OperationalError, ProgrammingError def fix_fee_product_index(apps, schema_editor): table_name = 'cfpb.ratechecker_fee' index_name = 'idx_16977_product_id' try...
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-10-31 16:33 from __future__ import unicode_literals from django.db import migrations, OperationalError, ProgrammingError def fix_fee_product_index(apps, schema_editor): try: schema_editor.execute( 'DROP INDEX IF EXISTS idx_16977_pro...
SPRO-37: Fix M2 Admin store selection refresh loop Make sure adding a card in Stored Payment Methods works as well
define( ['underscore'], function(_) { 'use strict'; var code = 'subscribe_pro'; return { getCode: function () { return code; }, getVaultCode: function () { return this.getConfig().vaultCode; }, ...
define( ['underscore'], function(_) { 'use strict'; var code = 'subscribe_pro'; return { getCode: function () { return code; }, getVaultCode: function () { return this.getConfig().vaultCode; }, ...
Add date to response body
var os = require( "os" ); var throng = require( "throng" ); var connections = require( "./shared/connections" ); var utils = require( "./shared/utils" ); var logger = connections.logger( [ "Pi-System-RPC-Service" ] ); var run = function () { logger.log( "Starting Pi-System-RPC-Service" ); var broker = conn...
var os = require( "os" ); var throng = require( "throng" ); var connections = require( "./shared/connections" ); var utils = require( "./shared/utils" ); var logger = connections.logger( [ "Pi-System-RPC-Service" ] ); var run = function () { logger.log( "Starting Pi-System-RPC-Service" ); var broker = conn...
Enable native async/await in Node 8.
"use strict"; module.exports = function (babel) { const t = babel.types; return { visitor: { Function: { exit: function (path) { const node = path.node; if (! node.async) { return; } // The original function becomes a non-async function that ...
module.exports = function (babel) { var t = babel.types; return { visitor: { Function: function (path) { var node = path.node; if (! node.async) { return; } node.async = false; node.body = t.blockStatement([ t.expressionStatement(t.stringLiter...
Remove bare except in unnecessary try block From a comment by @gasman on #1684: > It appears the try/catch in ImageEmbedHandler was added here: 74b9f43 > > Since the rest of the commit doesn't deal with images at all, and the > commit makes it clear that the corresponding change to > MediaEmbedHandler was intended to...
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...
Use tracer in debug IR interpretation mode
# -*- coding: utf-8 -*- """ IR interpreter. Run a series of translation phases on a numba function, and interpreter the IR with the arguments. """ from __future__ import print_function, division, absolute_import from numba2 import typeof, jit from numba2.compiler.frontend import translate, interpret from numba2.pipe...
# -*- coding: utf-8 -*- """ IR interpreter. Run a series of translation phases on a numba function, and interpreter the IR with the arguments. """ from __future__ import print_function, division, absolute_import from numba2 import typeof, jit from numba2.compiler.frontend import translate, interpret from numba2.pipe...
Update doc: changing command isn't a thing
// Description: // Returns a randomly selected url to something in an s3 bucket. // // Dependencies: // aws-sdk // random.js // sprintf // // Configuration: // AWS_ACCESS_KEY_ID // AWS_ACCESS_SECRET // WOO_BUCKET // // Commands: // hubot woo - Returns a randomly selected url to something in an s3 bucket...
// Description: // Returns a randomly selected url to something in an s3 bucket. // // Dependencies: // aws-sdk // random.js // sprintf // // Configuration: // AWS_ACCESS_KEY_ID // AWS_ACCESS_SECRET // WOO_BUCKET // WOO_COMMAND (defaults to woo) // // Commands: // hubot woo - Returns a randomly select...
Fix for de-serialization. Using vanilla django-money, when one did the following: ./manage.py dumpdata the values were saved properly, i.e: { 'amount': '12', 'amount_currency': 'USD', } however, after the de-serialization: ./manage.py loaddata [fixtures] the currencies were omitted. i have no idea (yet) how ...
# coding=utf-8 import json from decimal import Decimal from django.core.serializers.python import Deserializer as PythonDeserializer from django.core.serializers.json import Serializer as JSONSerializer from django.core.serializers.python import _get_model from django.utils import six from djmoney.models.fields impo...
# coding=utf-8 import json from decimal import Decimal from django.core.serializers.python import Deserializer as PythonDeserializer from django.core.serializers.json import Serializer as JSONSerializer from django.core.serializers.python import _get_model from django.utils import six from djmoney.models.fields impo...
Add wheel as a requirement
#!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.50.1' with open("README.md", "r") as fh: long_description = fh.read() setup(name='lcapy', version=__version__, author='Michael Hayes', author_email='michael.hayes@canterbury.ac.nz', description='Symbolic li...
#!/usr/bin/env python from setuptools import setup, find_packages __version__ = '0.50.1' with open("README.md", "r") as fh: long_description = fh.read() setup(name='lcapy', version=__version__, author='Michael Hayes', author_email='michael.hayes@canterbury.ac.nz', description='Symbolic li...
Check for array before forEach
var config = require('../settings.json'), log4js = require('log4js').getLogger(), fs = require('fs'); module.exports = { logger: { debug: (log) => { log4js.debug(log); }, error: (log) => { log4js.error(log); } }, // steps -> how many times to ...
var config = require('../settings.json'), log4js = require('log4js').getLogger(), fs = require('fs'); module.exports = { logger: { debug: (log) => { log4js.debug(log); }, error: (log) => { log4js.error(log); } }, // steps -> how many times to ...
Use long display name on profile
from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.http import Http404, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from judge.forms import ProfileForm from judge.models import Pr...
from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.http import Http404, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from judge.forms import ProfileForm from judge.models import Pr...
Use appropriate package for mxchip_az3166
# Copyright 2014-present PlatformIO <contact@platformio.org> # # 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 applicabl...
# Copyright 2014-present PlatformIO <contact@platformio.org> # # 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 applicabl...
Build may or may not exist
<?php /** * Copyright 2015-2018 ppy Pty. Ltd. * * This file is part of osu!web. osu!web is distributed with the hope of * attracting more community contributions to the core ecosystem of osu!. * * osu!web is free software: you can redistribute it and/or modify * it under the terms of the Affero G...
<?php /** * Copyright 2015-2018 ppy Pty. Ltd. * * This file is part of osu!web. osu!web is distributed with the hope of * attracting more community contributions to the core ecosystem of osu!. * * osu!web is free software: you can redistribute it and/or modify * it under the terms of the Affero G...
Fix slug on many method calls
<?php namespace Rudolf\Component\Helpers\Navigation; class MenuItem { private $data; public function __construct(array $data) { $this->data = $data; } public function setId($id) { $this->data['id'] = $id; } public function getId() { return isset($this->da...
<?php namespace Rudolf\Component\Helpers\Navigation; class MenuItem { private $data; public function __construct(array $data) { $this->data = $data; } public function setId($id) { $this->data['id'] = $id; } public function getId() { return isset($this->da...
Fix redirect bug for new users
var server = require('./server'), models = require('./models'); /* * GET home page. */ exports.index = function(req, res) { if (req.isAuthenticated()) { res.redirect('/lobby'); return; } res.render('index', { title: 'SwiftCODE', error: req.flash('error') }); }; ...
var server = require('./server'), models = require('./models'); /* * GET home page. */ exports.index = function(req, res) { res.render('index', { title: 'SwiftCODE', error: req.flash('error') }); }; /* * GET lobby page. */ exports.lobby = function(req, res) { res.render('lobby', ...
Fix canvas not restored properly
package it.sephiroth.android.library.tooltip; import android.content.Context; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; import android.view.View; import java.util.List; public class Too...
package it.sephiroth.android.library.tooltip; import android.content.Context; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; import android.view.View; import java.util.List; public class Too...
Change cancel_invited_user client to not return anything.
from notifications_python_client.base import BaseAPIClient from app.notify_client.models import User class InviteApiClient(BaseAPIClient): def __init__(self, base_url=None, client_id=None, secret=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', ...
from notifications_python_client.base import BaseAPIClient from app.notify_client.models import User class InviteApiClient(BaseAPIClient): def __init__(self, base_url=None, client_id=None, secret=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', ...
Update isActive when destroying the promiseMonitor
(function () { angular.module('eyecatch.promise-monitor', []).provider('promiseMonitor', function () { this.$get = ['$q', function ($q) { // ReSharper disable once InconsistentNaming function PromiseMonitor(options) { var monitored = []; var self = thi...
(function () { angular.module('eyecatch.promise-monitor', []).provider('promiseMonitor', function () { this.$get = ['$q', function ($q) { // ReSharper disable once InconsistentNaming function PromiseMonitor(options) { var monitored = []; var self = thi...
Create tabular q-function with kwarg random_state
from ..learner import Learner from ..policies import RandomPolicy from ..value_functions import TabularQ from ...utils import check_random_state class Sarsa(Learner): def __init__(self, env, policy=None, learning_rate=0.1, discount_factor=0.99, n_episodes=1000, verbose=True, random_state=None): ...
from ..learner import Learner from ..policies import RandomPolicy from ..value_functions import TabularQ from ...utils import check_random_state class Sarsa(Learner): def __init__(self, env, policy=None, learning_rate=0.1, discount_factor=0.99, n_episodes=1000, verbose=True, random_state=None): ...
Clock: Improve behavior on rack load
export default class EventScheduler { constructor(audioContext) { this.audioContext = audioContext; this.running = false; this.timeoutID = null; } start(callback) { const TIMEOUT_DELAY = 0.05; // in seconds const BUFFER_DEPTH = 0.3; // in seconds const _this = this; let startTime = ...
export default class EventScheduler { constructor(audioContext) { this.audioContext = audioContext; this.running = false; this.timeoutID = null; } start(callback) { const TIMEOUT_DELAY = 0.05; // in seconds const BUFFER_DEPTH = 0.10; // in seconds const _this = this; let startTime =...
Print h2 connection info when using -DkeepAlive
package au.gov.ga.geodesy; import java.security.Permission; import org.testng.IExecutionListener; public class TestSuiteListener implements IExecutionListener { @SuppressWarnings("serial") public class ExitInterceptedException extends SecurityException { public ExitInterceptedException() { ...
package au.gov.ga.geodesy; import java.security.Permission; import org.testng.IExecutionListener; public class TestSuiteListener implements IExecutionListener { @SuppressWarnings("serial") public class ExitInterceptedException extends SecurityException { public ExitInterceptedException() { ...
feat(shop): Update Interface to Category Index page Update Interface to Category Index page see #298
@extends('layouts.admin') @section('content') <div class="container"> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> List of Categories <div class="pull-right"><a href="{{ route('adm...
@extends('layouts.admin') @section('content') <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">List of Categories</div> <div class="panel-body"> <tabl...
Fix for unescapedHtml.cmp losing rendering after empty value.
/* * Copyright (C) 2013 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
/* * Copyright (C) 2013 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
Check for beeing a function
var excludeMethods = [ /^constructor$/, /^render$/, /^component[A-Za-z]+$/ ]; var displayNameReg = /^function\s+([a-zA-Z]+)/; function isExcluded(methodName) { return excludeMethods.some(function (reg) { return reg.test(methodName) === false; }); } function bindToClass(scope, methods) { var compone...
var excludeMethods = [ /^constructor$/, /^render$/, /^component[A-Za-z]+$/ ]; var displayNameReg = /^function\s+([a-zA-Z]+)/; function isExcluded(methodName) { return excludeMethods.some(function (reg) { return reg.test(methodName) === false; }); } function bindToClass(scope, methods) { var compone...
Fix "Uncaught exception: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed"
'use strict'; var bunyan = require('bunyan'); var Source = require('../node/nodes/source'); function AnalysisLogger(stream, user) { this.logger = bunyan.createLogger({ name: 'camshaft', streams: [{ level: 'info', stream: stream || process.stdout }] }); this....
'use strict'; var bunyan = require('bunyan'); var Source = require('../node/nodes/source'); function AnalysisLogger(stream, user) { this.logger = bunyan.createLogger({ name: 'camshaft', streams: [{ level: 'info', stream: stream || process.stdout }] }); this...
Make the py2.6 dependency conditional
import sys from setuptools import setup from setuptools.command.test import test as TestCommand import pipin install_requires = [] if sys.version_info[:2] < (2, 6): install_requires.append('argparse') class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) s...
import sys from setuptools import setup from setuptools.command.test import test as TestCommand import pipin class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest...
Remove duplicate import. (Thanks to MechanisM)
# -*- coding: utf-8 -*- from django.views.generic import View from django.views.decorators.csrf import csrf_exempt try: from django.http import StreamingHttpResponse as HttpResponse except ImportError: from django.http import HttpResponse from django.utils.decorators import method_decorator from sse import S...
# -*- coding: utf-8 -*- from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse try: from django.http import StreamingHttpResponse as HttpResponse except ImportError: from django.http import HttpResponse from django.utils.decorators impo...
Refactor the app initialization code into its own class.
( function( mdash, $ ) { var Dashboard = mdash.Dashboard = function() {}, proto = Dashboard.prototype; Dashboard.VERSION = '0.5.1'; proto.init = function() { this.$fontSizes = $( '#fontctrl > a' ); this.$helpCtrl = $( '#helpctrl' ); this.$getStarted...
( function( mdash, $ ) { $( document ).ready( function() { var manager = new mdash.Manager(), fontCtrl = new mdash.FontCtrl( $( '#fontctrl > a' ) ), helpCtrl = new mdash.HelpCtrl( $( '#helpctrl' ), $( '#getstarted' ), $( '#bookmarks' ) ); manager.init( fun...
Add some extra output for create and destroy. Signed-off-by: mulhern <7b51bcf507bcd7afb72bf8663752c0ddbeb517f6@redhat.com>
""" Miscellaneous pool-level actions. """ from __future__ import print_function from .._errors import StratisCliValueUnimplementedError def create_pool(dbus_thing, namespace): """ Create a stratis pool. """ if namespace.force: raise StratisCliValueUnimplementedError( namespace.forc...
""" Miscellaneous pool-level actions. """ from __future__ import print_function from .._errors import StratisCliValueUnimplementedError def create_pool(dbus_thing, namespace): """ Create a stratis pool. """ if namespace.force: raise StratisCliValueUnimplementedError( namespace.forc...
Use LOG_PATH for log path and make failures more descriptive
<?php class ObserverTest extends Ibuildings_Mage_Test_PHPUnit_ControllerTestCase { public function testDispatchTask() { $ps = explode(PHP_EOL, `ps ax | grep test_worker`); $found = false; foreach ($ps as $line) { if (preg_match('/test_worker\.php/', $line)) { ...
<?php class ObserverTest extends Ibuildings_Mage_Test_PHPUnit_ControllerTestCase { public function testDispatchTask() { $ps = explode(PHP_EOL, `ps ax | grep test_worker`); $found = false; foreach ($ps as $line) { if (preg_match('/php test_worker\.php/', $line)) { ...
Prepare to retrive info for submit to server
/** * Created by mark on 7/1/16. */ /* Counter */ counter = function () { var value = $('#textArea').val(); if (value.length == 0) { $('#wordCount').html(0); $('#caretPos').html(0); $('#scrollTop').html(0); return; } var regex = /\s+/gi; var wordCount = value.tri...
/** * Created by mark on 7/1/16. */ /* Counter */ counter = function () { var value = $('#textArea').val(); if (value.length == 0) { $('#wordCount').html(0); $('#caretPos').html(0); $('#scrollTop').html(0); return; } var regex = /\s+/gi; var wordCount = value.tri...
Allow uploading directly to a file
import os import asyncio from tornado.web import HTTPError class CreateMixin: def validate_put(self): self.kind = self.get_query_argument('kind', default='file') if self.kind not in ('file', 'folder'): raise HTTPError(400) if self.path.endswith('/'): name = self...
import os import asyncio from tornado.web import HTTPError class CreateMixin: def validate_put(self): self.name = self.get_query_argument('name') # TODO What does this do? self.kind = self.get_query_argument('kind', default='file') if self.kind not in ('file', 'folder'): ra...
Replace 'substring' with 'trimStart' from the OpenAPI utils
package de.espend.idea.laravel.config; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ConfigFileUtil { ...
package de.espend.idea.laravel.config; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ConfigFileUtil { private static final Pattern configFilePattern =...
Check recursion in str() and repr()
from unittest import TestCase import lazydict class TestLazyDictionary(TestCase): def test_circular_reference_error(self): d = lazydict.LazyDictionary() d['foo'] = lambda s: s['foo'] self.assertRaises(lazydict.CircularReferenceError, d.__getitem__, 'foo') def test_constant_redefinitio...
from unittest import TestCase import lazydict class TestLazyDictionary(TestCase): def test_circular_reference_error(self): d = lazydict.LazyDictionary() d['foo'] = lambda s: s['foo'] self.assertRaises(lazydict.CircularReferenceError, d.__getitem__, 'foo') def test_constant_redefinitio...
Make use of the events provided by chosen. Make it work when using the search field.
/* * Chosen jQuery plugin to add an image to the dropdown items. */ (function($) { $.fn.chosenImage = function(options) { return this.each(function() { var $select = $(this); var imgMap = {}; // 1. Retrieve img-src from data attribute and build object of image sources...
/* * Chosen jQuery plugin to add an image to the dropdown items. */ (function($) { $.fn.chosenImage = function(options) { return this.each(function() { var $select = $(this); var imgMap = {}; // 1. Retrieve img-src from data attribute and build object of image sources...
Include custom templatetags in package build.
import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='pybbm-private-messages',...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='pybbm-private-messages', version='0...
Remove date formatting from archive list urls
<?php $years = $this->em($this->ck->module->name('article'))->publishYears(); ?> <ul> <?php foreach ($years as $year) { ?> <li> <a href="<?= $this->ck->url->route([ 'year' => $year['year'], ], $this->ck->module->name('main_archive'), true) ?>"> <?= $ye...
<?php $years = $this->em($this->ck->module->name('article'))->publishYears(); ?> <ul> <?php foreach ($years as $year) { ?> <li> <a href="<?= $this->ck->url->route([ 'year' => $year['date']->format('Y'), ], $this->ck->module->name('main_archive'), true) ?>"> ...
Adjust coverage values to current coverage level
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'], options: { jshintrc: '.jshintrc', } }, ...
Add is_staff to user serializer
#from phonenumber_field.serializerfields import PhoneNumberField from rest_framework import serializers from drf_extra_fields.geo_fields import PointField from .models import User class UserSerializer(serializers.ModelSerializer): """ Usage: from rest_framework.renderers import JSONRenderer from ...
#from phonenumber_field.serializerfields import PhoneNumberField from rest_framework import serializers from drf_extra_fields.geo_fields import PointField from .models import User class UserSerializer(serializers.ModelSerializer): """ Usage: from rest_framework.renderers import JSONRenderer from ...
Refactor method definitions on prototype to be more DRY
"use strict"; var _ = require("lodash"); var HTTP_STATUS_CODES = require("http").STATUS_CODES; var request = require("request"); var url = require("url"); function LamernewsAPI(root) { this.root = root; return this; } LamernewsAPI.prototype = { getNews: function getNews(options, callback) { var d...
"use strict"; var _ = require("lodash"); var HTTP_STATUS_CODES = require("http").STATUS_CODES; var request = require("request"); var url = require("url"); function LamernewsAPI(root) { this.root = root; return this; } LamernewsAPI.prototype.getNews = function getNews(options, callback) { var defaults = {...
Rename client to httpClient for more clarity
package fr.insee.pogues.transforms; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.springframew...
package fr.insee.pogues.transforms; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.springframew...
Make sure the subscribe form is available before running the script
/* * Mailchimp AJAX form submit VanillaJS * Vanilla JS * Author: Michiel Vandewalle * Github author: https://github.com/michiel-vandewalle * Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS */ (function () { if (document.getElementsByTagName('form').length > 0) { ...
/* * Mailchimp AJAX form submit VanillaJS * Vanilla JS * Author: Michiel Vandewalle * Github author: https://github.com/michiel-vandewalle * Github project: https://github.com/michiel-vandewalle/Mailchimp-AJAX-form-submit-vanillaJS */ (function () { document.getElementsByTagName('form')[0].addEventListener('...
Revert "Added comment and used more generic code in xpath validator"
from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager i...
from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager i...
Make sure to end upstart script with .conf
import os from kokki import * def setup(name, **kwargs): env = Environment.get_instance() config = env.config.mongodb.copy() config.update(kwargs) config['configpath'] = "/etc/mongodb/%s.conf" % name if 'dbpath' not in kwargs: config['dbpath'] = os.path.join(config.dbpath, name) if 'l...
import os from kokki import * def setup(name, **kwargs): env = Environment.get_instance() config = env.config.mongodb.copy() config.update(kwargs) config['configpath'] = "/etc/mongodb/%s.conf" % name if 'dbpath' not in kwargs: config['dbpath'] = os.path.join(config.dbpath, name) if 'l...
Allow calls to 'weigh' to run forever when 'max_attempts' is set to 'inf'.
# -*- coding: utf-8 -*- import openerp from ..helpers.usbscale.scale import Scale from ..helpers.usbscale.scale_manager import ScaleManager from ..helpers.usbscale.tests import mocks class ScaleController(openerp.addons.web.http.Controller): _cp_path = '/scale_proxy' def __init__(self, *args, **kwargs): ...
# -*- coding: utf-8 -*- import openerp from ..helpers.usbscale.scale import Scale from ..helpers.usbscale.scale_manager import ScaleManager from ..helpers.usbscale.tests import mocks class ScaleController(openerp.addons.web.http.Controller): _cp_path = '/scale_proxy' def __init__(self, *args, **kwargs): ...
Convert explain to yield function
const _ = require('lodash'); const {gen: tcg} = require('testcheck'); const {invalidString} = require('./conform'); const explainData = require('./explainData'); const {gen} = require('./gen'); const describe = require('./util/describe'); function or(...predicates) { const pairs = _.chunk(predicates, 2); r...
const _ = require('lodash'); const {gen: tcg} = require('testcheck'); const {invalidString} = require('./conform'); const explainData = require('./explainData'); const {gen} = require('./gen'); const describe = require('./util/describe'); function or(...predicates) { const pairs = _.chunk(predicates, 2); r...
Fix injection in show dialog button directive
function dialogClose() { return { restrict: 'EA', require: '^dialog', scope: { returnValue: '=?return' }, link(scope, element, attrs, dialog) { element.on('click', function() { scope.$apply(() => { dialog.close(scope...
function dialogClose() { return { restrict: 'EA', require: '^dialog', scope: { returnValue: '=?return' }, link(scope, element, attrs, dialog) { element.on('click', function() { scope.$apply(() => { dialog.close(scope...
[TASK] Add documentation for entry point
<?php namespace TYPO3\SingleSignOn\Client\Security\EntryPoint; /* * * This script belongs to the TYPO3 Flow package "TYPO3.SingleSignOn.Client".* * * * ...
<?php namespace TYPO3\SingleSignOn\Client\Security\EntryPoint; /* * * This script belongs to the TYPO3 Flow package "TYPO3.SingleSignOn.Client".* * * * ...
Set Meta class model default on ContainerAdminForm
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from django.conf import settings from opps.db.models.fields.jsonf import JSONFormField from opps.fields.widgets import JSONField from opps.fields.models import Field, FieldOption from .models import Container class ContainerAdminForm(forms.Model...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from django.conf import settings from opps.db.models.fields.jsonf import JSONFormField from opps.fields.widgets import JSONField from opps.fields.models import Field, FieldOption class ContainerAdminForm(forms.ModelForm): def __init__(self, *...
Create argument to select month to import
import numpy def import_climate_data(): ncols = 720 nrows = 360 digits = 5 monthnr = 3 with open('./data/cloud/ccld6190.dat', 'r') as filein: lines = filein.readlines() line_n = 0 grid_size = 0.50 xmin = 0.25 xmax = 360.25 ymin = -89.75 yma...
import numpy def import_climate_data(): ncols = 720 nrows = 360 digits = 5 with open('./data/cloud/ccld6190.dat') as filein: lines = filein.readlines() line_n = 0 grid_size = 0.50 xmin = 0.25 xmax = 360.25 ymin = -89.75 ymax = 90.25 lon...
Add market tree built from active symbols
import { Map } from 'immutable'; import { FILTER_MARKETS, UPDATE_MARKETS, SERVER_DATA_ACTIVE_SYMBOLS } from '../_constants/ActionTypes'; const initialState = new Map({ active: [], tree: {}, query: '', shownMarkets: [], }); const generateTree = (symbols) => { const tree = {}; symbols.forEach((s...
import { Map } from 'immutable'; import { FILTER_MARKETS, UPDATE_MARKETS, SERVER_DATA_ACTIVE_SYMBOLS } from '../_constants/ActionTypes'; const initialState = new Map({ active: [], query: '', shownMarkets: [], }); export default (state = initialState, action) => { const doFilter = (markets = state.allM...
Fix - missing comma :/
'use strict'; module.exports = function (sequelize, DataTypes) { var Event = sequelize.define('event', { id: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true }, date: { type: DataTypes.DATEONLY }, day: { ...
'use strict'; module.exports = function (sequelize, DataTypes) { var Event = sequelize.define('event', { id: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true }, date: { type: DataTypes.DATEONLY }, day: { ...
Add support for apcu cache
<?php namespace OpenClassrooms\Bundle\DoctrineCacheExtensionBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** * @author Romain Kuzniak <ro...
<?php namespace OpenClassrooms\Bundle\DoctrineCacheExtensionBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** * @author Romain Kuzniak <ro...
Add information message for 'widget list remove'
(function () { 'use strict'; var program = require('./../src/customcommander'); var registrycontroller = require('./../src/registrycontroller'); var rmdir = require('rmdir'); var widgetName, widgetsList; var removeRegistryRecord = function (name) { console.log('WARNING: widget...
(function () { 'use strict'; var program = require('./../src/customcommander'); var registrycontroller = require('./../src/registrycontroller'); var rmdir = require('rmdir'); var widgetName, widgetsList; var removeRegistryRecord = function (name) { widgetsList[name] = undefined; ...
Fix payment processor test failures
package appstore; import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; public class TestThisWillFailAbunch { @Test public void aFailingTest() { assertTrue("I expected this to pass!", true); } @Ignore @Test public void aFailingTest2() { assertTru...
package appstore; import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.Test; public class TestThisWillFailAbunch { @Test public void aFailingTest() { assertTrue("I expected this to pass!", true); } @Ignore @Test public void aFailingTest2() { assertTru...
Fix issues with schema service provider.
<?php namespace DevelMe; use Illuminate\Support\ServiceProvider; class SchemaServiceProvider extends ServiceProvider { /** * Schema Wireframe Commands * * @type Array */ private $commands = [ 'ControllerMake', 'ModelMake', 'SchemaAppMake', 'ViewMake' ];...
<?php namespace DevelMe; use Illuminate\Support\ServiceProvider; class SchemaServiceProvider extends ServiceProvider { /** * Schema Wireframe Commands * * @type Array */ private $commands = [ 'ControllerMake', 'ModelMake', 'SchemaAppMake', 'ViewMake' ];...
Add the missing halt() call in trigger method to clear previous styles.
package com.strohwitwer.awesomevalidation.validators; import android.graphics.Color; import android.widget.EditText; import com.strohwitwer.awesomevalidation.ValidationHolder; import com.strohwitwer.awesomevalidation.helper.RangeHelper; import com.strohwitwer.awesomevalidation.helper.SpanHelper; import com.strohwitwe...
package com.strohwitwer.awesomevalidation.validators; import android.graphics.Color; import android.widget.EditText; import com.strohwitwer.awesomevalidation.ValidationHolder; import com.strohwitwer.awesomevalidation.helper.RangeHelper; import com.strohwitwer.awesomevalidation.helper.SpanHelper; import com.strohwitwe...
Remove version from minified js name
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { // define the files to lint files: ['gruntfile.js', 'src/**/*.js', 'test/**/*.js'], // configure JSHint (documented at http://w...
module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { // define the files to lint files: ['gruntfile.js', 'src/**/*.js', 'test/**/*.js'], // configure JSHint (documented at http://w...
Add src in path for dev javascript
module.exports = { all: { files: [ { expand: true, src: ['config.json'], dest: 'dist' }, { expand: true, src: ['javascript.json'], dest: 'dist' }, { expand: true, cwd: 'src/config/locales/', src: ['**'], dest: 'dist/config/locales/' }, { expand: true, cwd: 'sr...
module.exports = { all: { files: [ { expand: true, src: ['config.json'], dest: 'dist' }, { expand: true, src: ['javascript.json'], dest: 'dist' }, { expand: true, cwd: 'src/config/locales/', src: ['**'], dest: 'dist/config/locales/' }, { expand: true, cwd: 'sr...
Use SystemRandom instead of insecure RNG
""" In here we shall keep track of all variables and objects that should be instantiated only once and be common to pieces of GLBackend code. """ __version__ = '1.0.0' __all__ = ['Storage', 'randomStr'] import string from random import SystemRandom random = SystemRandom() class Storage(dict): """ A Storage...
""" In here we shall keep track of all variables and objects that should be instantiated only once and be common to pieces of GLBackend code. """ __version__ = '1.0.0' __all__ = ['Storage', 'randomStr'] import string import random class Storage(dict): """ A Storage object is like a dictionary except `obj.f...
Add test for unimplemented get_response_statements function
from unittest import TestCase from chatterbot.storage import StorageAdapter class StorageAdapterTestCase(TestCase): """ This test case is for the StorageAdapter base class. Although this class is not intended for direct use, this test case ensures that exceptions requiring basic functionality are ...
from unittest import TestCase from chatterbot.storage import StorageAdapter class StorageAdapterTestCase(TestCase): """ This test case is for the StorageAdapter base class. Although this class is not intended for direct use, this test case ensures that exceptions requiring basic functionality are ...
Clean up the lab10 code a bit.
/** * Created by curtis on 3/28/16. */ angular.module('clusterApp', []) .controller('MainCtrl', [ '$scope', '$http', function($scope, $http) { var completed = 0, timesToQuery = 100; $scope.cluster = []; $scope.busy = false; $...
/** * Created by curtis on 3/28/16. */ angular.module('clusterApp', []) .controller('MainCtrl', [ '$scope', '$http', function($scope, $http) { var completed = 0, timesToQuery = 100, pids = []; $scope.cluster = []; $scope.b...
Add explicit version check for Django 1.7 or above
from django.db import models from south.db import DEFAULT_DB_ALIAS # If we detect Django 1.7 or higher, then exit # Placed here so it's guaranteed to be imported on Django start import django if django.VERSION[0] > 1 or (django.VERSION[0] == 1 and django.VERSION[1] > 6): raise RuntimeError("South does not support ...
from django.db import models from south.db import DEFAULT_DB_ALIAS class MigrationHistory(models.Model): app_name = models.CharField(max_length=255) migration = models.CharField(max_length=255) applied = models.DateTimeField(blank=True) @classmethod def for_migration(cls, migration, database): ...
Revert "Re-search for listPanelCell in addAndRemoveLabelTest" This reverts commit f1e2b41afb4623ff35771d028fbd79810e80dece.
package guitests; import javafx.scene.input.KeyCode; import org.junit.Test; import ui.listpanel.ListPanelCell; import static org.junit.Assert.assertEquals; import static org.loadui.testfx.Assertions.assertNodeExists; import static org.loadui.testfx.controls.Commons.hasText; public class LabelPickerTests extends UITe...
package guitests; import javafx.scene.input.KeyCode; import org.junit.Test; import ui.listpanel.ListPanelCell; import static org.junit.Assert.assertEquals; import static org.loadui.testfx.Assertions.assertNodeExists; import static org.loadui.testfx.controls.Commons.hasText; public class LabelPickerTests extends UITe...
Comment out a console log
angular .module('app') .directive('modal', ['$compile', '$templateCache', 'pageService', function($compile, $templateCache, pageAPI) { return { scope: true, compile: function(element, cAtts) { return function(scope, element, lAtts) { var $element, templa...
angular .module('app') .directive('modal', ['$compile', '$templateCache', 'pageService', function($compile, $templateCache, pageAPI) { return { scope: true, compile: function(element, cAtts) { return function(scope, element, lAtts) { console.log(scope); v...
Test against SimpleAdminConfig on Django>=1.7. In test cases, use the same admin setup we recommend to users.
# python setup.py test # or # python runtests.py import sys from django import VERSION as django_version from django.conf import settings APP = 'djrill' ADMIN = 'django.contrib.admin' if django_version >= (1, 7): ADMIN = 'django.contrib.admin.apps.SimpleAdminConfig' settings.configure( DEBUG=True, DATA...
# python setup.py test # or # python runtests.py import sys from django.conf import settings APP = 'djrill' settings.configure( DEBUG=True, DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ROOT_URLCONF=APP+'.urls', INSTALLED_APPS=( 'djang...
Fix shop invoice index notice
<?php /* * This file is part of the fnacApi. * (c) 2011 Fnac * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FnacApiClient\Service\Response; use Symfony\Component\Serializer\SerializerInterface; use FnacApiClient\Entity...
<?php /* * This file is part of the fnacApi. * (c) 2011 Fnac * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FnacApiClient\Service\Response; use Symfony\Component\Serializer\SerializerInterface; use FnacApiClient\Entity...
Change multi line string to be regular comment.
from ed2d.physics import rectangle from ed2d.physics import quadtree class PhysEngine(object): def __init__(self): # I would love to have width and height as global constants self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT')) self.quadTree...
from ed2d.physics import rectangle from ed2d.physics import quadtree class PhysEngine(object): def __init__(self): # I would love to have width and height as global constants self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT')) self.quadTree...
Fix incompatibility between FrontendBridge/jsonAction with the inclusion of the RequestHandlerComponent. Make sure the "json" View subfolder is not used in this case.
<?php namespace FrontendBridge\Lib; trait FrontendBridgeTrait { /** * jsonActionResponse * * @param \Cake\Network\Response $response the response * @return \FrontendBridge\Lib\ServiceResponse */ protected function jsonActionResponse(\Cake\Network\Response $response) { // g...
<?php namespace FrontendBridge\Lib; trait FrontendBridgeTrait { /** * jsonActionResponse * * @param \Cake\Network\Response $response the response * @return \FrontendBridge\Lib\ServiceResponse */ protected function jsonActionResponse(\Cake\Network\Response $response) { // get the frontendData set by t...
Fix react outside of guilds, add checks for custom emojis.
const { Command } = require('discord-akairo'); function exec(message, args){ let emojiSet; if (!message.guild || !message.guild.emojis.size){ emojiSet = this.client.user.premium ? this.client.emojis : this.client.emojis.filter(e => e.managed); } else { emojiSet = message.guild.emojis; ...
const { Command } = require('discord-akairo'); function exec(message, args){ let emojiSet; if (!message.guild || !message.guild.emojis.size){ emojiSet = this.client.emojis; } else { emojiSet = message.guild.emojis; } let emojis = emojiSet.array(); let currentIndex = emojis.le...
Update email address and home page.
# # This file is part of ArgProc. ArgProc is free software that is made # available under the MIT license. Consult the file "LICENSE" that is # distributed together with this file for the exact licensing terms. # # ArgProc is copyright (c) 2010 by the ArgProc authors. See the file # "AUTHORS" for a complete overview. ...
# # This file is part of ArgProc. ArgProc is free software that is made # available under the MIT license. Consult the file "LICENSE" that is # distributed together with this file for the exact licensing terms. # # ArgProc is copyright (c) 2010 by the ArgProc authors. See the file # "AUTHORS" for a complete overview. ...
Move event source to Github site feeds, rather than full (rate-limited) API
define(["lib/reqwest", "lib/lodash", "lib/knockout", "githubEvent"], function (reqwest, _, ko, GithubEvent) { var githubApi = {}; var rootUrl = "https://api.github.com"; function getOrganisationMembers(orgName) { return reqwest({ url: 'https://api.github.com/orgs/' + orgName + '/memb...
define(["lib/reqwest", "lib/lodash", "lib/knockout", "githubEvent"], function (reqwest, _, ko, GithubEvent) { var githubApi = {}; var rootUrl = "https://api.github.com"; function getOrganisationMembers(orgName) { return reqwest({ url: rootUrl + '/orgs/' + orgName + '/members', ...
Check for input types in methods
Categories = new Mongo.Collection('categories'); Schema.categories = new SimpleSchema({ name: { type: String }, slug: { type: String, index: true, unique: true }, description: { type: String }, position: { type: Number }, topicCount: { type: Number, defaultValue: 0 }...
Categories = new Mongo.Collection('categories'); Schema.categories = new SimpleSchema({ name: { type: String }, slug: { type: String, index: true, unique: true }, description: { type: String }, position: { type: Number }, topicCount: { type: Number, defaultValue: 0 }...
Add flake8 static code testing
from __future__ import print_function from setuptools import setup, find_packages import sys v = sys.version_info if v[:2] < (3, 5): error = "ERROR: jupyterhub-kubespawner requires Python version 3.5 or above." print(error, file=sys.stderr) sys.exit(1) setup( name='jupyterhub-kubespawner', version...
from __future__ import print_function from setuptools import setup, find_packages import sys v = sys.version_info if v[:2] < (3, 5): error = "ERROR: jupyterhub-kubespawner requires Python version 3.5 or above." print(error, file=sys.stderr) sys.exit(1) setup( name='jupyterhub-kubespawner', version...
Use commonprefix to break dep on 3.5
import http.server from threading import Thread import os.path class HTTPHandler: def __init__(self, config): self.config = config handler = HTTPHandler.make_http_handler(self.config['media_dir']) self.httpd = http.server.HTTPServer(('', self.config['media']['port']), handler) se...
import http.server from threading import Thread import os.path class HTTPHandler: def __init__(self, config): self.config = config handler = HTTPHandler.make_http_handler(self.config['media_dir']) self.httpd = http.server.HTTPServer(('', self.config['media']['port']), handler) se...
Test for version strings in abilities.
var assert = require('assert'); require('./support/start')(function(command) { exports['test abilities endpoint'] = function() { assert.response(command.servers['Core'], { url: '/assets/tilemill/js/abilities.js' }, { status: 200 }, function(res) { var bod...
var assert = require('assert'); require('./support/start')(function(command) { exports['test abilities endpoint'] = function() { assert.response(command.servers['Core'], { url: '/assets/tilemill/js/abilities.js' }, { status: 200 }, function(res) { var bod...