text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Rebase off develop, add missing parenthesis | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class ListProductTestCase(TestCase):
fixtures = ['test_fixtures']
def test_url_endpoint(self):
url = reverse('entry-list-products')
... | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class ListProductTestCase(TestCase):
fixtures = ['test_fixtures']
def test_url_endpoint(self):
url = reverse('entry-list-products')
... |
Disable gray for foreground on BW devices | module.exports = [
{
"type": "heading",
"defaultValue": "Preferences" ,
"size": 3
},
{
"type": "section",
"items": [
{
"type": "heading",
"defaultValue": "Colors"
},
{
"type": "tex... | module.exports = [
{
"type": "heading",
"defaultValue": "Preferences" ,
"size": 3
},
{
"type": "section",
"items": [
{
"type": "heading",
"defaultValue": "Colors"
},
{
"type": "tex... |
Update links to external resources on homepage | @extends('layouts.app')
@section('fonts')
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
@endsection
@section('content')
@if (Auth::check())
<div class="row text-center">
<div class=" col-xs-12 col-sm-3 repository-margin-bottom-1... | @extends('layouts.app')
@section('fonts')
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
@endsection
@section('content')
@if (Auth::check())
<div class="row text-center">
<div class=" col-xs-12 col-sm-3 repository-margin-bottom-1... |
BAP-10985: Update the rules displaying autocomplete result for business unit owner field | <?php
namespace Oro\Bundle\OrganizationBundle\Autocomplete;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Oro\Bundle\FormBundle\Autocomplete\SearchHandler;
use Oro\Bundle\OrganizationBundle\Entity\BusinessUnit;
class BusinessUnitOwnerSearchHandler extends SearchHandler
{
/** @var Registry */
protected $... | <?php
namespace Oro\Bundle\OrganizationBundle\Autocomplete;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Oro\Bundle\FormBundle\Autocomplete\SearchHandler;
use Oro\Bundle\OrganizationBundle\Entity\BusinessUnit;
class BusinessUnitOwnerSearchHandler extends SearchHandler
{
/** @var Registry */
protected $... |
Fix exiftool error on incorrect images | <?php
namespace YF\Provider;
class Exiftool
{
public function __construct()
{
$bin = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$bin = dirname(__FILE__).'/';
}
$this->exe = $bin.'exiftool';
}
/**
* Retreive the metadata of the file
* @r... | <?php
namespace YF\Provider;
class Exiftool
{
public function __construct()
{
$bin = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$bin = dirname(__FILE__).'/';
}
$this->exe = $bin.'exiftool';
}
/**
* Retreive the metadata of the file
* @r... |
Change time and distance getter return types to be nullable | <?php
class ViewData
{
/**
* @var int $time
*/
private $time;
/**
* @var float $distance
*/
private $distance;
const SPEED_PRECISION = 2;
public function __construct()
{
$this->time = $_POST['time'];
$this->distance = $_POST['distance'];
}
/**... | <?php
class ViewData
{
/**
* @var int $time
*/
private $time;
/**
* @var float $distance
*/
private $distance;
const SPEED_PRECISION = 2;
public function __construct()
{
$this->time = $_POST['time'];
$this->distance = $_POST['distance'];
}
/**... |
Use BrowserRouter rather than HashRouter | import React, { Component, PropTypes } from 'react';
import { combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { Grid, Row, Col } from 'react-bootstrap';
import Router from 'react-router/BrowserRouter';
import Match from 'react-router/Match';
import { Front } from './Front';
import { Menu... | import React, { Component, PropTypes } from 'react';
import { combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { Grid, Row, Col } from 'react-bootstrap';
import Router from 'react-router/HashRouter';
import Match from 'react-router/Match';
import { Front } from './Front';
import { Menu } ... |
Fix uptime and uptime timing | import discord
from modules.botModule import BotModule
from modules.help import *
import time
import datetime
class Status(BotModule):
name = 'status'
description = 'Allow for the assignment and removal of roles.'
help_text = 'Usage: `!status` shows information about this instance of scubot.'... | import discord
from modules.botModule import BotModule
from modules.help import *
import time
import datetime
class Status(BotModule):
name = 'status'
description = 'Allow for the assignment and removal of roles.'
help_text = 'Usage: `!status` shows information about this instance of scubot.'... |
Fix BuzzAPI response format for bad GTID | <?php
declare(strict_types=1);
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
// phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter
namespace App\Http\Controllers;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class BuzzApiMockController extends Controller
{
public f... | <?php
declare(strict_types=1);
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
// phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter
namespace App\Http\Controllers;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class BuzzApiMockController extends Controller
{
public f... |
Order keys consistently for enhanced readability | import Ember from 'ember';
const { Controller, inject, computed, getOwner } = Ember;
export default Controller.extend({
token: inject.service(),
secret: computed.reads('token.secret'),
tokenIsValid: false,
tokenIsInvalid: false,
tokenRecord: null,
actions: {
clearTokenProperties() {
this.get(... | import Ember from 'ember';
const { Controller, inject, computed, getOwner } = Ember;
export default Controller.extend({
token: inject.service(),
tokenRecord: null,
secret: computed.reads('token.secret'),
tokenIsValid: false,
tokenIsInvalid: false,
actions: {
clearTokenProperties() {
this.get(... |
Increase font size on scoreboard point labels
Makes it much easier to read from further away
Signed-off-by: Tyler Butters <51880522bf24185c8b28348ae172827853c5d662@gmail.com> | $(function () {
var hc_scoreboard_series = {
name: 'Points',
id: ':scores',
data: [],
dataLabels: {
enabled: true,
color: '#FFFFFF',
align: 'center',
y: 25, // 25 pixels down from the top
style: {
fontSize: ... | $(function () {
var hc_scoreboard_series = {
name: 'Points',
id: ':scores',
data: [],
dataLabels: {
enabled: true,
color: '#FFFFFF',
align: 'center',
y: 10, // 10 pixels down from the top
}
};
// Get initial chart data... |
Extend middleware to accept array. | module.exports = function actionListenerMiddleware (listeners) {
listeners = Array.isArray(listeners)
? listeners
: Array.prototype.slice.call(arguments);
var actionListeners = listeners.reduce((result, listener) => {
Object.keys(listener).forEach(type => {
var typeListeners = Array.isArray(list... | module.exports = function actionListenerMiddleware () {
var listeners = Array.prototype.slice.call(arguments);
var actionListeners = listeners.reduce((result, listener) => {
Object.keys(listener).forEach(type => {
var typeListeners = Array.isArray(listener[type])
? listener[type]
: [list... |
Adjust init verbose and enabled mode handling
Reduce complexity and leave the enabled mode to be used
with the toggleable decorator that disables functionality
when AXES_ENABLED is set to False for testing etc.
This conforms with the previous behaviour and logic flow. | from logging import getLogger
from pkg_resources import get_distribution
from django import apps
log = getLogger(__name__)
class AppConfig(apps.AppConfig):
name = "axes"
initialized = False
@classmethod
def initialize(cls):
"""
Initialize Axes logging and show version information.
... | from logging import getLogger
from pkg_resources import get_distribution
from django import apps
log = getLogger(__name__)
class AppConfig(apps.AppConfig):
name = "axes"
initialized = False
@classmethod
def initialize(cls):
"""
Initialize Axes logging and show version information.
... |
Update to new v1 endpoint
We're moving to a versioned API endpoint. Thanks! | include("shared/request.js");
include("shared/notify.js");
include("shared/cache.js");
var API_URL = "https://api.domainr.com/v1/search";
function runWithString(string) {
try {
if (LaunchBar.options.commandKey) {
LaunchBar.openURL(
"https://domainr.com/"+encodeURIComponent(stri... | include("shared/request.js");
include("shared/notify.js");
include("shared/cache.js");
var API_URL = "https://domainr.com/api/json/search";
function runWithString(string) {
try {
if (LaunchBar.options.commandKey) {
LaunchBar.openURL(
"https://domainr.com/"+encodeURIComponent(st... |
Fix input submit, now clear itself after submit | (function (angular){
'use strict';
angular.module('app')
.controller('counterController', counterController)
.controller('todoController', todoController)
counterController.$inject = []
todoController.$inject = []
function counterController(){
this.counter = 0;
this.add = functi... | (function (angular){
'use strict';
angular.module('app')
.controller('counterController', counterController)
.controller('todoController', todoController)
counterController.$inject = []
todoController.$inject = []
function counterController(){
this.counter = 0;
this.add = functi... |
Use os.remove instead of os.unlink
It's easier to understand | from nazs.core import module
from nazs.core.commands import run
from nazs.core.sudo import root
from django.utils.translation import ugettext as _
import os
import logging
logger = logging.getLogger(__name__)
class Samba(module.Module):
"""
Samba 4 module, it deploys samba AD and file server
"""
E... | from nazs.core import module
from nazs.core.commands import run
from nazs.core.sudo import root
from django.utils.translation import ugettext as _
import os
import logging
logger = logging.getLogger(__name__)
class Samba(module.Module):
"""
Samba 4 module, it deploys samba AD and file server
"""
E... |
Make q variables local to function scope
In execute and nestedExecute functions, changed q variable to "var q" so that it's not in the global scope | angular.module('ngCordova.plugins.sqlite', [])
.factory('$cordovaSQLite', ['$q', function ($q) {
return {
openDB: function (dbName) {
return window.sqlitePlugin.openDatabase({name: dbName});
},
openDBBackground: function (dbName) {
return window.sqlitePlugin.openDatabase({n... | angular.module('ngCordova.plugins.sqlite', [])
.factory('$cordovaSQLite', ['$q', function ($q) {
return {
openDB: function (dbName) {
return window.sqlitePlugin.openDatabase({name: dbName});
},
openDBBackground: function (dbName) {
return window.sqlitePlugin.openDatabase({n... |
Rename Debug.init JS function to Debug.ready for consistency with other modules | var Debug = {
ready: function() {
$( '.enable-profiling' ).click( function() {
return toggleProfiling.bind( this )( true );
} );
$( '.disable-profiling' ).click( function() {
return toggleProfiling.bind( this )( false );
} );
function toggleProfiling(... | var Debug = {
init: function() {
$( '.enable-profiling' ).click( function() {
return toggleProfiling.bind( this )( true );
} );
$( '.disable-profiling' ).click( function() {
return toggleProfiling.bind( this )( false );
} );
function toggleProfiling( ... |
Make 'errors' top property in response array | <?php
namespace GraphQL\Executor;
use GraphQL\Error\Error;
class ExecutionResult implements \JsonSerializable
{
/**
* @var array
*/
public $data;
/**
* @var Error[]
*/
public $errors;
/**
* @var array[]
*/
public $extensions;
/**
* @var callable
... | <?php
namespace GraphQL\Executor;
use GraphQL\Error\Error;
class ExecutionResult implements \JsonSerializable
{
/**
* @var array
*/
public $data;
/**
* @var Error[]
*/
public $errors;
/**
* @var array[]
*/
public $extensions;
/**
* @var callable
... |
Update examples to return env from output defined on parent workflow | 'use strict';
// workflows/createDeployment
var Joi = require('joi');
module.exports = {
schema: Joi.object({
deployerId: Joi.string().required(),
name: Joi.string().min(1).required(),
}).required().unknown(true),
version: '1.0',
decider: function(args) {
return {
createDeploymentDo... | 'use strict';
// workflows/createDeployment
var Joi = require('joi');
module.exports = {
schema: Joi.object({
deployerId: Joi.string().required(),
name: Joi.string().min(1).required(),
}).required().unknown(true),
version: '1.0',
decider: function(args) {
return {
createDeploymentDo... |
Remove button to clone a topic when creating a dashboard | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
// constants
import { TEMPLATES } from './constants';
class TemplateSelector extends PureComponent {
static propTypes = { onChange: PropTypes.func.isRequired }
state = { template: TEMPLATES[0].value }
onChangeTemplate = (templat... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import HeaderTopics from './import-selector';
// constants
import { TEMPLATES } from './constants';
class TemplateSelector extends PureComponent {
static propTypes = { onChange: PropTypes.func.isRequired }
state = { template: TEM... |
Modify findByName() to call employeeListTpl | // We use an "Immediate Function" to initialize the application to avoid leaving anything behind in the global scope
(function () {
/* ---------------------------------- Local Variables ---------------------------------- */
var service = new EmployeeService();
var homeTpl = Handlebars.compile($("#home.tpl... | // We use an "Immediate Function" to initialize the application to avoid leaving anything behind in the global scope
(function () {
/* ---------------------------------- Local Variables ---------------------------------- */
var service = new EmployeeService();
var homeTpl = Handlebars.compile($("#home.tpl... |
check_invariant(): Use the same child->parent "formula" used by heapq.py. | """Unittests for heapq."""
from test.test_support import verify, vereq, verbose, TestFailed
from heapq import heappush, heappop
import random
def check_invariant(heap):
# Check the heap invariant.
for pos, item in enumerate(heap):
if pos: # pos 0 has no parent
parentpos = (pos-1) >> 1
... | """Unittests for heapq."""
from test.test_support import verify, vereq, verbose, TestFailed
from heapq import heappush, heappop
import random
def check_invariant(heap):
# Check the heap invariant.
for pos, item in enumerate(heap):
parentpos = ((pos+1) >> 1) - 1
if parentpos >= 0:
... |
io: Move plugin tests to io/tests. | #!/usr/bin/env python
from scikits.image._build import cython
import os.path
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('io', parent_package, t... | #!/usr/bin/env python
from scikits.image._build import cython
import os.path
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('io', parent_package, t... |
Fix how we set 'build_dir' and 'install_dir' options from 'install' options --
irrelevant because this file is about to go away, but oh well. | """install_ext
Implement the Distutils "install_ext" command to install extension modules."""
# created 1999/09/12, Greg Ward
__revision__ = "$Id$"
from distutils.core import Command
from distutils.util import copy_tree
class install_ext (Command):
description = "install C/C++ extension modules"
user... | """install_ext
Implement the Distutils "install_ext" command to install extension modules."""
# created 1999/09/12, Greg Ward
__revision__ = "$Id$"
from distutils.core import Command
from distutils.util import copy_tree
class install_ext (Command):
description = "install C/C++ extension modules"
user... |
Fix typo in option validation. | import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExten... | import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExten... |
Reformat code to PEP-8 standards | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | #
# Copyright 2014-2015 Boundary, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
Restructure KDS options to be more like Keystone's options
Restructure the KDS options to be more closely aligned with the way
Keystone options work and allowing movement towards not registering
the options on import. This will also prevent KDS options from
appearing in the Keystone auto-generated sample config.
Chan... | # 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 in writing, software
# distributed under t... | # 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 in writing, software
# distributed under t... |
Fix broken Yaml fixture dependences parsing | <?php
namespace MageTest\Manager\Attributes\Provider\Loader;
use Symfony\Component\Yaml\Yaml;
/**
* Class YmlLoader
*
* @package MageTest\Manager\Attributes\Provider\Loader
*/
class YmlLoader implements Loader, ParseFields
{
/**
* @var \Symfony\Component\Yaml\Yaml
*/
private $yaml;
/**
... | <?php
namespace MageTest\Manager\Attributes\Provider\Loader;
use Symfony\Component\Yaml\Yaml;
/**
* Class YmlLoader
*
* @package MageTest\Manager\Attributes\Provider\Loader
*/
class YmlLoader implements Loader, ParseFields
{
/**
* @var \Symfony\Component\Yaml\Yaml
*/
private $yaml;
/**
... |
Add conditional before wait statement in synchronize block. | package com.novoda.downloadmanager;
import android.support.annotation.Nullable;
import com.novoda.notils.logger.simple.Log;
final class WaitForDownloadServiceThenPerform {
interface Action<T> {
T performAction();
}
private WaitForDownloadServiceThenPerform() {
// Uses static factory met... | package com.novoda.downloadmanager;
import android.support.annotation.Nullable;
import com.novoda.notils.logger.simple.Log;
final class WaitForDownloadServiceThenPerform {
interface Action<T> {
T performAction();
}
private WaitForDownloadServiceThenPerform() {
// Uses static factory met... |
Add tests for boundary conditions in HttpClient timeouts | <?php
use MessageBird\Client;
use MessageBird\Common\HttpClient;
class HttpClientTest extends PHPUnit_Framework_TestCase
{
public function testHttpClient()
{
$client = new HttpClient(Client::ENDPOINT);
$url = $client->getRequestUrl('a', null);
$this->assertSame(Client::ENDPOINT.'/a', $... | <?php
use MessageBird\Client;
use MessageBird\Common\HttpClient;
class HttpClientTest extends PHPUnit_Framework_TestCase
{
public function testHttpClient()
{
$client = new HttpClient(Client::ENDPOINT);
$url = $client->getRequestUrl('a', null);
$this->assertSame(Client::ENDPOINT.'/a', $... |
Update feature: Cleanup admin layout | <div class="container-fluid">
<div class="content row">
<?php if ($sidebar_left || $sidebar_right): ?>
<!-- ########## Sidebar start ########## -->
<div class="col-sm-3 col-md-2 sidebar">
<?php echo $sidebar_left; ?>
<?php echo $sidebar_right; ?>
</div>
<!-- ########## Sidebar end ########## -->
... | <div class="container-fluid">
<div class="content row">
<?php if ($sidebar_left || $sidebar_right): ?>
<!-- ########## Sidebar start ########## -->
<div class="col-sm-3 col-md-2 sidebar">
<?php echo $sidebar_left; ?>
<?php echo $sidebar_right; ?>
</div>
<!-- ########## Sidebar end ########## -->
... |
[login] Add apps on list that will be used on the test databases
Added apps sites and contenttypes to the list.
These apps were causing troubles on the test databases.
Signed off by: Heitor Reis <marcheing@gmail.com>
Signed off by: Filipe Vaz <vazfilipe92@gmail.com> | # List of apps that will use the users database
USERS_DATABASE_APPS = ['auth', 'login', 'sessions', 'contenttypes', 'sites']
class UserRouter(object):
"""
A router to control all database operations on models in the
login application.
"""
def db_for_read(self, model, **hints):
"""
A... | # List of apps that will use the users database
USERS_DATABASE_APPS = ['auth','login','sessions']
class UserRouter(object):
"""
A router to control all database operations on models in the
login application.
"""
def db_for_read(self, model, **hints):
"""
Attempts to read login model... |
Apply touchactive for mouse and touch | (function ($) {
$.event.special.touchclick = {
setup: function () {
if (typeof window.ontouchstart !== "undefined") {
$(this).on("touchstart", $.event.special.touchclick.touchstart);
$(this).on("touchmove", $.event.special.touchclick.touchmove);
$(... | (function ($) {
$.event.special.touchclick = {
setup: function () {
if (typeof window.ontouchstart !== "undefined") {
$(this).on('touchstart', $.event.special.touchclick.touchstart);
$(this).on('touchmove', $.event.special.touchclick.touchmove);
$(... |
Ch26: Optimize addition of Tag data in migration. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
TAGS = (
# ( tag name, tag slug ),
("augmented reality", "augmented-reality"),
("big data", "big-data"),
("django", "django"),
("education", "education"),
("ipython", "ipython"),
("java... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
TAGS = (
# ( tag name, tag slug ),
("augmented reality", "augmented-reality"),
("big data", "big-data"),
("django", "django"),
("education", "education"),
("ipython", "ipython"),
("java... |
Reset current visualizer to dfa | import options from './options'
import { getCurrentManipulation } from './manipulation'
const nodes = new vis.DataSet([])
const edges = new vis.DataSet([])
const select = $('select')
const resetBtn = $('#reset-btn')
const testStr = $('input[name="testStr"]')
const alphabetPromptText = 'Please enter alphabet strin... | import options from './options'
import { getCurrentManipulation } from './manipulation'
const nodes = new vis.DataSet([])
const edges = new vis.DataSet([])
const select = $('select')
const resetBtn = $('#reset-btn')
const testStr = $('input[name="testStr"]')
const alphabetPromptText = 'Please enter alphabet strin... |
Fix some amount, returned one log | const Octokat = require('octokat')
const open = require('open')
const Promise = require('bluebird')
var octo, organization, repository
module.exports = function openNotifications (input, opts, token) {
octo = new Octokat({
token: token || process.env.GITHUB_OGN_TOKEN
})
var amount = opts.amount || 30
if (... | const Octokat = require('octokat')
const open = require('open')
const Promise = require('bluebird')
var octo, organization, repository
module.exports = function openNotifications (input, opts, token) {
octo = new Octokat({
token: token || process.env.GITHUB_OGN_TOKEN
})
var amount = opts.amount || 30
if (... |
Add activityId to each activity object | Template.activityTable.helpers({
'activities': function () {
// Get reference to template instance
const instance = Template.instance();
// Get resident activities
const activities = instance.data.activities;
const activitiesArray = [];
activities.forEach(function (activity) {
// Crea... | Template.activityTable.helpers({
'activities': function () {
// Get reference to template instance
const instance = Template.instance();
// Get resident activities
const activities = instance.data.activities;
const activitiesArray = [];
activities.forEach(function (activity) {
// Crea... |
Reduce the amount of cars since collision detections does not work properly with this many cars for some reason. | TRAFFICSIM_APP.game = TRAFFICSIM_APP.game || {};
TRAFFICSIM_APP.game.VehicleController = function (worldController) {
var self = this;
var worldController = worldController;
var vehicles = [];
this.getWorldController = function () {
return this._worldController;
};
function initializ... | TRAFFICSIM_APP.game = TRAFFICSIM_APP.game || {};
TRAFFICSIM_APP.game.VehicleController = function (worldController) {
var self = this;
var worldController = worldController;
var vehicles = [];
this.getWorldController = function () {
return this._worldController;
};
function initializ... |
Change argument type of regexp binding to ObservableValue<String> | package eu.lestard.advanced_bindings.api;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.value.ObservableValue;
/**
* This class contains custom binding implementations for Strings.
*/
public class StringBindings {
/**
* Creates a boolean binding tha... | package eu.lestard.advanced_bindings.api;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.value.ObservableStringValue;
/**
* This class contains custom binding implementations for Strings.
*/
public class StringBindings {
/**
* Creates a boolean bindi... |
Add missing assertions on authorizeTransfer test | <?php
namespace Omnipay\Skrill\Message;
use Omnipay\Tests\TestCase;
class AuthorizeTransferRequestTest extends TestCase
{
/**
* @var AuthorizeTransferRequest
*/
private $request;
public function setUp()
{
parent::setUp();
$this->request = new AuthorizeTransferRequest($this-... | <?php
namespace Omnipay\Skrill\Message;
use Omnipay\Tests\TestCase;
class AuthorizeTransferRequestTest extends TestCase
{
/**
* @var AuthorizeTransferRequest
*/
private $request;
public function setUp()
{
parent::setUp();
$this->request = new AuthorizeTransferRequest($this-... |
Add only_http_implementation and only_websocket_implementation methods | from devicehive import Handler
from devicehive import DeviceHive
import pytest
class TestHandler(Handler):
"""Test handler class."""
def handle_connect(self):
if not self.options['handle_connect'](self):
self.api.disconnect()
def handle_event(self, event):
pass
class Test(o... | from devicehive import Handler
from devicehive import DeviceHive
class TestHandler(Handler):
"""Test handler class."""
def handle_connect(self):
if not self.options['handle_connect'](self):
self.api.disconnect()
def handle_event(self, event):
pass
class Test(object):
""... |
Allow to pass lazy objects definitions into wrapper as traversable collection | <?php
namespace Isolate\LazyObjects;
use Isolate\LazyObjects\Exception\InvalidArgumentException;
use Isolate\LazyObjects\Proxy\Definition;
use Isolate\LazyObjects\Proxy\Factory;
use Isolate\LazyObjects\Exception\RuntimeException;
class Wrapper
{
/**
* @var array|Definition[]
*/
private $definitions... | <?php
namespace Isolate\LazyObjects;
use Isolate\LazyObjects\Proxy\Definition;
use Isolate\LazyObjects\Proxy\Factory;
use Isolate\LazyObjects\Exception\RuntimeException;
class Wrapper
{
/**
* @var array|Definition[]
*/
private $definitions;
/**
* @var Factory
*/
private $factory;... |
Remove empty route and controller | /*
Copyright, 2013, by Tomas Korcak. <korczis@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | /*
Copyright, 2013, by Tomas Korcak. <korczis@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... |
Update `istanbul` to report on `untested` code | 'use strict';
/*global jasmine:true */
var
clean = require('./lib/clean'),
middle = require('@whitneyit/middle'),
gulp = require('gulp'),
eslint = require('gulp-eslint'),
istanbul = require('gulp-istanbul'),
jasmine = require('gulp-jasmine'),
jscs = require('gulp-jscs'),
... | 'use strict';
/*global jasmine:true */
var
clean = require('./lib/clean'),
middle = require('@whitneyit/middle'),
gulp = require('gulp'),
eslint = require('gulp-eslint'),
istanbul = require('gulp-istanbul'),
jasmine = require('gulp-jasmine'),
jscs = require('gulp-jscs'),
... |
Add test for failing to find credentials | import os
import requests
import requests_mock
import unittest
from .. import Client
from ..exceptions import AcquiaCloudException
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
... | import os
import requests
import requests_mock
import unittest
from .. import Client
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
Set up the tests with the mock requests ... |
Allow JDK 15 in prep for 20.9.0 | /*
* Copyright 2020 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | /*
* Copyright 2020 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
Change Finding Aids homepage to show more collections than two. | <?php $collections = get_records('Collection'); ?>
<h1><?php echo __('Welcome'); ?></h1>
<div class="row">
<?php foreach($collections as $collection): ?>
<div class="col-sm-6">
<h3>
<?php
$title = metadata($collection, array('Dublin Core', 'Title'));
... | <h1><?php echo __('Welcome'); ?></h1>
<div class="row">
<?php foreach(get_recent_collections(2) as $collection): ?>
<div class="col-sm-6">
<h3>
<?php
$title = metadata($collection, array('Dublin Core', 'Title'));
$queryParams = array(
... |
Load namespaced Celery configuration in healthcheck
In bed52d9c60b00be751a6a9a6fc78b333fc5bccf6, I had to change the
configuration to be compatible with Django. I completely missed this
part.
Unfortunately, the test for this module starts with mocking the
`get_stats()` function, where this code exists, so I am at los... | from django.conf import settings
from moj_irat.healthchecks import HealthcheckResponse, UrlHealthcheck, registry
def get_stats():
from celery import Celery
app = Celery("laalaa")
app.config_from_object("django.conf:settings", namespace="CELERY")
return app.control.inspect().stats()
class CeleryWork... | from django.conf import settings
from moj_irat.healthchecks import HealthcheckResponse, UrlHealthcheck, registry
def get_stats():
from celery import Celery
app = Celery("laalaa")
app.config_from_object("django.conf:settings")
return app.control.inspect().stats()
class CeleryWorkersHealthcheck(objec... |
Set cov-core dependency to 1.10 | import setuptools
setuptools.setup(name='pytest-cov',
version='1.6',
description='py.test plugin for coverage reporting with '
'support for both centralised and distributed testing, '
'including subprocesses and multiprocessing',
long... | import setuptools
setuptools.setup(name='pytest-cov',
version='1.6',
description='py.test plugin for coverage reporting with '
'support for both centralised and distributed testing, '
'including subprocesses and multiprocessing',
long... |
Remove redundant item from test config | "use strict";
module.exports = function( grunt ) {
grunt.initConfig({
jscs: {
fail: {
files: {
src: "../fixtures/fixture.js"
},
options: {
config: "../configs/fail.json"
}
},
... | "use strict";
module.exports = function( grunt ) {
grunt.initConfig({
jscs: {
fail: {
files: {
src: "../fixtures/fixture.js"
},
options: {
config: "../configs/fail.json"
}
},
... |
Fix error on Firefox 6 where pages are not open if this preference is True (default). | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from splinter.driver.webdriver import BaseWebDriver, WebDriverElement as BaseWebDriverElement
from splinter.driver.webdriver.cookie_manager import... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from splinter.driver.webdriver import BaseWebDriver, WebDriverElement as BaseWebDriverElement
from splinter.driver.webdriver.cookie_manager import... |
Update fenced block parsing for spec change
See commonmark/commonmark.js@59980020 | <?php
/*
* This file is part of the league/commonmark package.
*
* (c) Colin O'Dell <colinodell@gmail.com>
*
* Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
* - (c) John MacFarlane
*
* For the full copyright and license information, please view the LICENSE
* file... | <?php
/*
* This file is part of the league/commonmark package.
*
* (c) Colin O'Dell <colinodell@gmail.com>
*
* Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
* - (c) John MacFarlane
*
* For the full copyright and license information, please view the LICENSE
* file... |
Make <PromptBuffer> a special case of <Prompt> | // @flow
import * as React from "react";
/**
* Generate what text goes inside the prompt based on the props to the prompt
*/
export function promptText(props: PromptProps): string {
if (props.running) {
return "[*]";
}
if (props.queued) {
return "[…]";
}
if (typeof props.counter === "number") {
... | // @flow
import * as React from "react";
import css from "styled-jsx/css";
const promptStyle = css`
.prompt {
font-family: monospace;
font-size: 12px;
line-height: 22px;
width: var(--prompt-width, 50px);
padding: 9px 0;
text-align: center;
color: var(--theme-cell-prompt-fg, black);
... |
Put a tool tip on the first player token. | "use strict";
define(["create-react-class", "prop-types", "react-dom-factories"],
function(createReactClass, PropTypes, DOM)
{
var AgentLabel = createReactClass(
{
render: function()
{
var firstAgentToken = DOM.div(
{
className: (this.props.isF... | "use strict";
define(["create-react-class", "prop-types", "react-dom-factories"],
function(createReactClass, PropTypes, DOM)
{
var AgentLabel = createReactClass(
{
render: function()
{
var firstAgentToken = DOM.div(
{
className: (this.props.isF... |
webhooks/dialogflow: Remove default value for email parameter.
The webhook view used a default value for the email, which gave
non-informative errors when the webhook is incorrectly configured without
the email parameter. | # Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_private_message
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response impor... | # Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_private_message
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response impor... |
Fix undefined reported as error on fetch configuration | import { connect } from './wsActions'
import {
setDashboards,
play,
} from './dashboardsActions'
import {
notifySuccess,
notifyError,
} from './notificationsActions'
export const FETCH_CONFIGURATION = 'FETCH_CONFIGURATION'
export const FETCH_CONFIGURATION_SUCCESS = 'FETCH_CONFIGURATION_SUCCESS'... | import { connect } from './wsActions'
import {
setDashboards,
play,
} from './dashboardsActions'
import {
notifySuccess,
notifyError,
} from './notificationsActions'
export const FETCH_CONFIGURATION = 'FETCH_CONFIGURATION'
export const FETCH_CONFIGURATION_SUCCESS = 'FETCH_CONFIGURATION_SUCCESS'... |
Format date when tooltip template is used. | define(['moment', 'nvd3', 'underscore', 'views/chart-view'],
function(moment, nvd3, _, ChartView) {
'use strict';
/**
* TrendsView renders several threads of timeline data over a period of
* time on the x axis.
*/
var TrendsView = ChartView.extend({
d... | define(['moment', 'nvd3', 'underscore', 'views/chart-view'],
function(moment, nvd3, _, ChartView) {
'use strict';
/**
* TrendsView renders several threads of timeline data over a period of
* time on the x axis.
*/
var TrendsView = ChartView.extend({
d... |
Add backbone.hal to js module config. | requirejs.config({
baseUrl: '/static',
paths: {
antibodies: 'modules/antibodies',
app: 'modules/app',
assert: 'modules/assert',
base: 'modules/base',
home: 'modules/home',
navbar: 'modules/navbar',
// Plugins
text: 'libs/text',
// Librar... | requirejs.config({
baseUrl: '/static',
paths: {
antibodies: 'modules/antibodies',
app: 'modules/app',
assert: 'modules/assert',
base: 'modules/base',
home: 'modules/home',
navbar: 'modules/navbar',
// Plugins
text: 'libs/text',
// Librar... |
Use getRecord to get a record in unit test | <?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\TestCase;
class ZendMoni... | <?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\TestCase;
class ZendMoni... |
Fix path to setup file on windows | /*
* mocaccino.js
*
* Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>
*
* @license MIT
*/
'use strict';
var through = require('through');
var resolve = require('resolve');
var path = require('path');
var fs = require('fs');
module.exports = function (b, opts) {
if (!opts) {
opts = {};
... | /*
* mocaccino.js
*
* Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>
*
* @license MIT
*/
'use strict';
var through = require('through');
var resolve = require('resolve');
var path = require('path');
var fs = require('fs');
module.exports = function (b, opts) {
if (!opts) {
opts = {};
... |
Add custom JSON serialize for Python datetime
This adds a custom JSON serializer class which stringifies Python
datetime objects in to ISO 8601. JSON does not specify a date/time
format, and many parsers break trying to parse a Date() javascript
object. 8601 seems a resonable compromise. | from functools import partial
from pyws.errors import BadRequest
from pyws.functions.args.types.complex import List
from pyws.response import Response
from pyws.utils import json
class encoder( json.JSONEncoder ):
# JSON Serializer with datetime support
def default(self,obj):
if isinstance(obj, dateti... | from functools import partial
from pyws.errors import BadRequest
from pyws.functions.args.types.complex import List
from pyws.response import Response
from pyws.utils import json
from pyws.protocols.base import Protocol
__all__ = ('RestProtocol', 'JsonProtocol', )
create_response = partial(Response, content_type='a... |
Add placeable to javascript context | import json
import rexviewer as r
import naali
import urllib2
from componenthandler import DynamiccomponentHandler
class JavascriptHandler(DynamiccomponentHandler):
GUINAME = "Javascript Handler"
def __init__(self):
DynamiccomponentHandler.__init__(self)
self.jsloaded = False
def onChang... | import json
import rexviewer as r
import naali
import urllib2
from componenthandler import DynamiccomponentHandler
class JavascriptHandler(DynamiccomponentHandler):
GUINAME = "Javascript Handler"
def __init__(self):
DynamiccomponentHandler.__init__(self)
self.jsloaded = False
def onChang... |
Support updating rather than recreate for domains | import React from 'react'
import shallowEqual from 'shallowequal'
export const withDomain = ({
domainClass,
mapPropsToArg,
mapPropsToArgsArray = props => mapPropsToArg ? [mapPropsToArg(props)] : [],
createDomain = props => new domainClass(...mapPropsToArgsArray(props)), // eslint-disable-line new-cap
propN... | import React from 'react'
import shallowEqual from 'shallowequal'
export const withDomain = ({
domainClass,
mapPropsToArg,
mapPropsToArgsArray = props => mapPropsToArg ? [mapPropsToArg(props)] : [],
createDomain = props => new domainClass(...mapPropsToArgsArray(props)), // eslint-disable-line new-cap
propN... |
Fix merging objects with prototypes | function clone(obj) {
return Object.setPrototypeOf(Object.assign({}, obj), Object.getPrototypeOf(obj));
}
function merge(...args) {
let output = null,
items = [...args];
while (items.length > 0) {
const nextItem = items.shift();
if (!output) {
output = clone(nextItem);
... | function merge(...args) {
let output = null,
items = [...args];
while (items.length > 0) {
const nextItem = items.shift();
if (!output) {
output = Object.assign({}, nextItem);
} else {
output = mergeObjects(output, nextItem);
}
}
return out... |
Add slugify with / _ support | <?php
namespace Metrique\Building\Contracts;
interface PageRepositoryInterface
{
/**
* Get all pages.
* @return Illuminate\Support\Collection
*/
public function all();
/**
* Find a page.
* @return mixed
*/
public function find($id);
/**
* Create a page from an ... | <?php
namespace Metrique\Building\Contracts;
interface PageRepositoryInterface
{
/**
* Get all pages.
* @return Illuminate\Support\Collection
*/
public function all();
/**
* Find a page.
* @return mixed
*/
public function find($id);
/**
* Create a page from an ... |
fix(Loaders): Make css loader rule work on *all* css files. | module.exports = [
{
test: /\.svg$/,
loader: 'svg-sprite',
exclude: /fonts/,
},{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=60000&mimetype=application/font-woff',
},{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loa... | module.exports = [
{
test: /\.svg$/,
loader: 'svg-sprite',
exclude: /fonts/,
},{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=60000&mimetype=application/font-woff',
},{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loa... |
Fix bug in VectorName, caused by new Command arguments | # -*- coding: utf-8 -*-
"""
pylatex.numpy
~~~~~~~~~~~~~
This module implements the classes that deals with numpy objects.
:copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
import numpy as np
from pylatex.base_classes import BaseLaTeXClass
from pylatex.package... | # -*- coding: utf-8 -*-
"""
pylatex.numpy
~~~~~~~~~~~~~
This module implements the classes that deals with numpy objects.
:copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
import numpy as np
from pylatex.base_classes import BaseLaTeXClass
from pylatex.package... |
Fix template helper errors for accounts with no payments or donations arrays in their profiles | import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import './receipts.html';
Meteor.subscribe('donations');
Meteor.subscribe('purchases');
Template.receiptsList.helpers({
donations: () => {
if (Meteor.user() && Meteor.user().payments instanceof Array) {
return Meteor.us... | import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import './receipts.html';
Meteor.subscribe('donations');
Meteor.subscribe('purchases');
Template.receiptsList.helpers({
donations: () => {
if (Meteor.user()) {
return Meteor.user().payments.map((donation) => {
/... |
Enable CORS ignore orgin header | const Hapi = require('@hapi/hapi');
const routes = require('./routes');
const auth = require('./auth');
module.exports = async (elastic, config, cb) => {
const server = new Hapi.Server({ port: config.port, routes: { cors: { origin: 'ignore' }, log: { collect: true } } });
server.route(routes(elastic, config));
... | const Hapi = require('@hapi/hapi');
const routes = require('./routes');
const auth = require('./auth');
module.exports = async (elastic, config, cb) => {
const server = new Hapi.Server({ port: config.port, routes: { cors: { origin: "ignore" }, log: { collect: true } } });
server.route(routes(elastic, config));
... |
Sort room table by room name by default | from web.blueprints.helpers.table import BootstrapTable, Column
class SiteTable(BootstrapTable):
def __init__(self, *a, **kw):
super().__init__(*a, columns=[
Column('site', 'Site', formatter='table.linkFormatter'),
Column('buildings', 'Buildings', formatter='table.multiBtnFormatter... | from web.blueprints.helpers.table import BootstrapTable, Column
class SiteTable(BootstrapTable):
def __init__(self, *a, **kw):
super().__init__(*a, columns=[
Column('site', 'Site', formatter='table.linkFormatter'),
Column('buildings', 'Buildings', formatter='table.multiBtnFormatter... |
Use route attribute tenant resolver | <?php namespace Tenantable\UserHasTenant\Providers;
use Illuminate\Support\ServiceProvider;
use Tenantable\UserHasTenant\TenantResolver\EloquentTenantResolver;
use Tenantable\UserHasTenant\TenantResolver\RequestAttributeTenantResolver;
use Tenantable\UserHasTenant\UserHasTenant;
use Tenantable\UserHasTenant\UserResol... | <?php namespace Tenantable\UserHasTenant\Providers;
use Illuminate\Support\ServiceProvider;
use Tenantable\UserHasTenant\TenantResolver\EloquentTenantResolver;
use Tenantable\UserHasTenantTenantable;
use Tenantable\UserHasTenant\UserResolver\EloquentUserResolver;
class UserHasTenantServiceProvider extends ServicePro... |
Update rxjs in GTN to latest version | System.config({
map : {
'app': 'app',
'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.12',
'@angular/common': 'https://unpkg.com/@angular/common@2.0.0',
'@angular/compiler': 'https://unpkg.com/@angular/compiler@2.0.0',
'@angular/core': 'https://unpkg.com/@angular/core@2.0.0',
... | System.config({
map : {
'app': 'app',
'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.6',
'@angular/common': 'https://unpkg.com/@angular/common@2.0.0',
'@angular/compiler': 'https://unpkg.com/@angular/compiler@2.0.0',
'@angular/core': 'https://unpkg.com/@angular/core@2.0.0',
... |
Fix logger for php 5.3 | <?php
/*
* Copyright (c) Ouzo contributors, http://ouzoframework.org
* This file is made available under the MIT License (view the LICENSE file for more information).
*/
namespace Ouzo\Logger;
use Ouzo\Config;
use Ouzo\Utilities\Arrays;
/**
* Logger class is used to obtain reference to current logger
* based on... | <?php
/*
* Copyright (c) Ouzo contributors, http://ouzoframework.org
* This file is made available under the MIT License (view the LICENSE file for more information).
*/
namespace Ouzo\Logger;
use Ouzo\Config;
use Ouzo\Utilities\Arrays;
/**
* Logger class is used to obtain reference to current logger
* based on... |
Remove unnecessary login during build model frontend test | casper.test.begin('build model', function suite(test) {
casper.start('http://localhost:5000', function() {
this.page.viewportSize = { width: 1920, height: 1080 };
// Build model
casper.then(function(){
this.evaluate(function() {
document.querySelector('#buildmod... | casper.test.begin('build model', function suite(test) {
casper.start('http://localhost:5000', function() {
this.page.viewportSize = { width: 1920, height: 1080 };
if(this.exists('form.login-form')){
this.fill('form.login-form', {
'login': 'testhandle@test.com',
... |
Upgrade taskcluster client for nice slugids
This fixes e.g. this failure:
* https://tools.taskcluster.net/task-inspector/#2AAxnGTzSeGLTX_Hwp_PVg/
due to the TaskGroupId starting with a '-', by upgrading taskcluster
client. From version 0.0.26 of python taskcluster client onwards, 'nice'
slugs are returned that start... | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... | from setuptools import setup
setup(
name="funsize",
version="0.42",
description="Funsize Scheduler",
author="Mozilla Release Engineering",
packages=["funsize"],
include_package_data=True,
# Not zip safe because we have data files in the package
zip_safe=False,
entry_points={
... |
Use isoformat in datetime logs, rather than asctime
Change-Id: Ic11a70e28288517b6f174d7066f71a12efd5f4f1 | import os
import datetime
import pwd
from .utils import effective_user
class Tool(object):
USER_NAME_PATTERN = 'tools.%s'
class InvalidToolException(Exception):
pass
def __init__(self, name, username, uid, gid, home):
self.name = name
self.uid = uid
self.gid = gid
... | import os
import time
import pwd
from .utils import effective_user
class Tool(object):
USER_NAME_PATTERN = 'tools.%s'
class InvalidToolException(Exception):
pass
def __init__(self, name, username, uid, gid, home):
self.name = name
self.uid = uid
self.gid = gid
se... |
Test that we can go to the edit page of a tag from the index | <?php
namespace Backend\Modules\Blog\Tests\Action;
use Backend\Modules\Tags\DataFixtures\LoadTagsModulesTags;
use Backend\Modules\Tags\DataFixtures\LoadTagsTags;
use Common\WebTestCase;
class EditTest extends WebTestCase
{
public function setUp(): void
{
parent::setUp();
if (!defined('APPLIC... | <?php
namespace Backend\Modules\Blog\Tests\Action;
use Backend\Modules\Tags\DataFixtures\LoadTagsModulesTags;
use Backend\Modules\Tags\DataFixtures\LoadTagsTags;
use Common\WebTestCase;
class EditTest extends WebTestCase
{
public function setUp(): void
{
parent::setUp();
if (!defined('APPLIC... |
Determine menu base path from request base path and backend mount prefix instead of generating url.
Fixes #6139 The base url generated could have query params or fragment which breaks urls that are concatenated to it. | <?php
namespace Bolt\Provider;
use Bolt\Menu\AdminMenuBuilder;
use Bolt\Menu\MenuBuilder;
use Bolt\Menu\MenuEntry;
use Silex\Application;
use Silex\ServiceProviderInterface;
class MenuServiceProvider implements ServiceProviderInterface
{
/**
* {@inheritdoc}
*/
public function register(Application $... | <?php
namespace Bolt\Provider;
use Bolt\Menu\AdminMenuBuilder;
use Bolt\Menu\MenuBuilder;
use Bolt\Menu\MenuEntry;
use Silex\Application;
use Silex\ServiceProviderInterface;
class MenuServiceProvider implements ServiceProviderInterface
{
/**
* {@inheritdoc}
*/
public function register(Application $... |
Remove use as it's not used. | <?php
namespace Avh\Network;
final class Visitor
{
/**
* Get the user's IP
*
* @return string
*/
public static function getUserIp()
{
$ip = array();
foreach (array('HTTP_CF_CONNECTING_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLI... | <?php
namespace Avh\Network;
use Avh\Utility\Common;
final class Visitor
{
/**
* Get the user's IP
*
* @return string
*/
public static function getUserIp()
{
$ip = array();
foreach (array('HTTP_CF_CONNECTING_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWAR... |
Set a title to the default page | <?php
/**
* @author Manuel Thalmann <m@nuth.ch>
* @license Apache-2.0
*/
namespace MyCompany\MyWebsite\Pages;
use System\Web;
use System\Web\Forms\Rendering\PaintEventArgs;
use System\Web\Forms\MenuItem;
use ManuTh\TemPHPlate\Templates\BootstrapTemplate;
{
/**
... | <?php
/**
* @author Manuel Thalmann <m@nuth.ch>
* @license Apache-2.0
*/
namespace MyCompany\MyWebsite\Pages;
use System\Web;
use System\Web\Forms\Rendering\PaintEventArgs;
use System\Web\Forms\MenuItem;
use ManuTh\TemPHPlate\Templates\BootstrapTemplate;
{
/**
... |
Use logger to record exception instead of printStackTrace. | package uk.ac.ebi.quickgo.common.loader;
import java.io.*;
import java.util.zip.GZIPOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* To test the GZIPFiles class, create a gzip'd file with known test in a temporary location.
* The client is expected to clean up the file after it's finishe... | package uk.ac.ebi.quickgo.common.loader;
import java.io.*;
import java.util.zip.GZIPOutputStream;
/**
* To test the GZIPFiles class, create a gzip'd file with known test in a temporary location.
* The client is expected to clean up the file after it's finished with it.
*
* @author Tony Wardell
* Date: 17/05/2016... |
Remove the useless import of redisx | package db_manager
import (
"fmt"
"log"
"github.com/garyburd/redigo/redis"
"encoding/json"
"../entities"
)
var connection redis.Conn
const (
HOSTNAME = "localhost"
PORT = 6379
NETWORK = "tcp"
)
func init() {
var err error
log.Print("Initializing database connection... ")
... | package db_manager
import (
"fmt"
"log"
"github.com/garyburd/redigo/redis"
"encoding/json"
"../entities"
// "github.com/garyburd/redigo/redisx"
)
var connection redis.Conn
const (
HOSTNAME = "localhost"
PORT = 6379
NETWORK = "tcp"
)
func init() {
var err error
log.Print(... |
Remove old pycharm icon support. | package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.... | package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.... |
Update the search container when terms change.
[Fixes #126799709](https://www.pivotaltracker.com/story/show/126799709) | import React, { PropTypes } from 'react'
import Promotion from '../assets/Promotion'
import SearchControl from '../forms/SearchControl'
import StreamContainer from '../../containers/StreamContainer'
import { TabListButtons } from '../tabs/TabList'
import { MainView } from '../views/MainView'
export const Search = ({
... | import React, { PropTypes } from 'react'
import Promotion from '../assets/Promotion'
import SearchControl from '../forms/SearchControl'
import StreamContainer from '../../containers/StreamContainer'
import { TabListButtons } from '../tabs/TabList'
import { MainView } from '../views/MainView'
export const Search = ({
... |
WebRTC: Switch remaining chromium.webrtc builders to chromium recipe.
Linux was switched in https://codereview.chromium.org/1508933002/
This switches the rest over to the chromium recipe.
BUG=538259
TBR=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/1510853002 .
git-svn-id: 239fca9b83025a0b6f82... | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from buildbot.changes.filter import ChangeFilter
from buildbot.schedulers.basic import SingleBranchScheduler
from master.factory import annotator_factor... | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from buildbot.changes.filter import ChangeFilter
from buildbot.schedulers.basic import SingleBranchScheduler
from master.factory import annotator_factor... |
Update invalid URI to correctly throw exception | /*
* $Id: AltRepTest.java [23-Apr-2004]
*
* Copyright (c) 2004, Ben Fortuna All rights reserved.
*/
package net.fortuna.ical4j.model.parameter;
import java.net.URI;
import java.net.URISyntaxException;
import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterFactoryImpl;
import junit.fr... | /*
* $Id: AltRepTest.java [23-Apr-2004]
*
* Copyright (c) 2004, Ben Fortuna All rights reserved.
*/
package net.fortuna.ical4j.model.parameter;
import java.net.URI;
import java.net.URISyntaxException;
import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterFactoryImpl;
import junit.fr... |
Fix to audit record map | (function(window)
{
var Gitana = window.Gitana;
Gitana.AuditRecordMap = Gitana.AbstractMap.extend(
/** @lends Gitana.AuditRecordMap.prototype */
{
/**
* @constructs
* @augments Gitana.AbstractMap
*
* @class Map of audit record objects
*
... | (function(window)
{
var Gitana = window.Gitana;
Gitana.AuditRecordMap = Gitana.AbstractMap.extend(
/** @lends Gitana.AuditRecordMap.prototype */
{
/**
* @constructs
* @augments Gitana.AbstractMap
*
* @class Map of audit record objects
*
... |
Fix use command argument validation | <?php
namespace PhpBrew\Command;
use CLIFramework\Command;
use PhpBrew\Config;
use Exception;
class UseCommand extends Command
{
public function arguments($args) {
$args->add('php version')
->validValues(function() {
return array_merge(\PhpBrew\Config::getInstalledPhpVersions()... | <?php
namespace PhpBrew\Command;
use CLIFramework\Command;
use PhpBrew\Config;
use Exception;
class UseCommand extends Command
{
public function arguments($args) {
$args->add('php version')
->validValues(function() { return \PhpBrew\Config::getInstalledPhpVersions(); })
;
}
... |
Add help_text to interface 'expire' field | from django.db import models
from django.utils.safestring import mark_safe
from cyder.base.utils import classproperty
class BaseModel(models.Model):
"""
Base class for models to abstract some common features.
* Adds automatic created and modified fields to the model.
"""
created = models.DateTim... | from django.db import models
from django.utils.safestring import mark_safe
from cyder.base.utils import classproperty
class BaseModel(models.Model):
"""
Base class for models to abstract some common features.
* Adds automatic created and modified fields to the model.
"""
created = models.DateTim... |
Fix fixture loading with API keys. | <?php
namespace App\Entity\Fixture;
use App\Entity;
use App\Security\SplitToken;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
class ApiKey extends AbstractFixture implements DependentFixtureInterface
{
public... | <?php
namespace App\Entity\Fixture;
use App\Entity;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
class ApiKey extends AbstractFixture implements DependentFixtureInterface
{
public function load(ObjectManager ... |
Revert "Do not re-evalute sasl every time connection is built"
This reverts commit 3f073c556c007fc1adcc4b4cee6608a1128c8231. | const Connection = require('../network/connection')
const { KafkaJSConnectionError } = require('../errors')
const validateBrokers = brokers => {
if (!brokers || brokers.length === 0) {
throw new KafkaJSConnectionError(`Failed to connect: expected brokers array and got nothing`)
}
}
module.exports = ({
socke... | const Connection = require('../network/connection')
const { KafkaJSConnectionError } = require('../errors')
const validateBrokers = brokers => {
if (!brokers || brokers.length === 0) {
throw new KafkaJSConnectionError(`Failed to connect: expected brokers array and got nothing`)
}
}
module.exports = ({
socke... |
Add package_dir which uses project.repo_url. | #!/usr/bin/env python
import os
import sys
import {{ project.repo_name }}
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst', 'rt').read()
history = open... | #!/usr/bin/env python
import os
import sys
import {{ project.repo_name }}
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst', 'rt').read()
history = open... |
Tests: Make valid-jsdoc an error (instead of warning)
Now that the documentation is updated, this makes it an error. | module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier'],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
},
env: {
browser: true,
},
rules: {
'prettier/prettier': ['error', {
singleQuote: true,
trailingComma: 'es5',
pr... | module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier'],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
},
env: {
browser: true,
},
rules: {
'prettier/prettier': ['error', {
singleQuote: true,
trailingComma: 'es5',
pr... |
Upgrade HAProxy to version 2.0.3 | from foreman import define_parameter
from templates import pods
(define_parameter('image-version')
.with_doc('HAProxy image version.')
.with_default('2.0.3'))
@pods.app_specifier
def haproxy_app(_):
return pods.App(
name='haproxy',
exec=[
'/usr/local/sbin/haproxy',
'-f... | from foreman import define_parameter
from templates import pods
(define_parameter('image-version')
.with_doc('HAProxy image version.')
.with_default('1.8.9'))
@pods.app_specifier
def haproxy_app(_):
return pods.App(
name='haproxy',
exec=[
'/usr/local/sbin/haproxy',
'-f... |
Disable tests until new repo is stable
Change-Id: Ic6932c1028c72b5600d03ab59102d1c1cff1b36c | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... |
Change postcode from Integer to String. | package au.com.auspost.api.postcode.search.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
/**
* A single post code locality
*/
@XmlAccessorType(XmlAccessType.FIELD)
public class Locality {
@XmlElement
pri... | package au.com.auspost.api.postcode.search.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
/**
* A single post code locality
*/
@XmlAccessorType(XmlAccessType.FIELD)
public class Locality {
@XmlElement
pri... |
Make active tab rules stricter | (function(){
"use strict";
xtag.register("sam-tabbar", {
lifecycle: {
created: function() {
if (!this.role) {
this.role = "tablist";
}
},
inserted: function() {
this.activeTabId = this.querySelector("[role='tab'][data-start-active]").id;
},
remov... | (function(){
"use strict";
xtag.register("sam-tabbar", {
lifecycle: {
created: function() {
if (!this.role) {
this.role = "tablist";
}
},
inserted: function() {
this.activeTabId = this.querySelector("[data-start-active]").id;
},
removed: function... |
Make it easier to clean up tests by closing db sessions
Also added a convenience test base class | import gc
import sys
import unittest
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
from .._util import closing
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
sel... | import gc
import sys
PYPY = hasattr(sys, 'pypy_version_info')
from .. import pg_connection
class DBSetup(object):
maxDiff = None
@property
def dsn(self):
return 'postgresql://localhost/' + self.dbname
def setUp(self, call_super=True):
self.dbname = self.__class__.__name__.lower() + ... |
Add methods to delete a connection | <?php
namespace Forestry\Orm;
class Storage {
/**
* @var array
*/
private static $instances = ['default' => []];
/**
* Set a new connection with the given name.
*
* @param string $name
* @param array $config
* @return mixed
* @throws \LogicException
* @throws \PDOExcepti... | <?php
namespace Forestry\Orm;
class Storage {
/**
* @var array
*/
private static $instances = ['default' => []];
/**
* Set a new connection with the given name.
*
* @param string $name
* @param array $config
* @return mixed
* @throws \LogicException
* @throws \PDOExcepti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.