text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Allow HTTP client PRESERVE_AUTHORIZATION_KEY to be unset
package io.airlift.http.client.jetty; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpClientTransport; import org.eclipse.jetty.client.HttpRequest; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.util.ssl.SslContextFactory; ...
package io.airlift.http.client.jetty; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpClientTransport; import org.eclipse.jetty.client.HttpRequest; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.util.ssl.SslContextFactory; ...
Fix broken billing statement command tests
from datetime import datetime from optparse import make_option from go.billing.models import Account from go.billing.tasks import month_range, generate_monthly_statement from go.base.command_utils import BaseGoCommand, get_user_by_email class Command(BaseGoCommand): help = "Generate monthly billing statements fo...
from datetime import datetime from optparse import make_option from go.billing.models import Account from go.billing.tasks import month_range, generate_monthly_statement from go.base.command_utils import BaseGoCommand, get_user_by_email class Command(BaseGoCommand): help = "Generate monthly billing statements fo...
Add a 'try' block for current versions of Node.js to try and '.close' the server.
'use strict'; var NET = require('net'); var PORTS = {}; function CreateServer( port, callback ){ if( (typeof port === 'number') ){ port = parseFloat(port); if( (PORTS[port.toString()]) ){ process.nextTick(CreateServer,port,callback); ...
'use strict'; var NET = require('net'); var PORTS = {}; function CreateServer( port, callback ){ if( (typeof port === 'number') ){ port = parseFloat(port); if( (PORTS[port.toString()]) ){ process.nextTick(CreateServer,port,callback); ...
Split array data sent to actions into GET and SET.
<?php namespace Air\Routing\Dispatcher; use Air\Routing\ResolvedRequest\ResolvedRequestInterface; use Interop\Container\ContainerInterface; class Dispatcher implements DispatcherInterface { /** * @var ContainerInterface $container The DI container. */ private $container; /** * @param Con...
<?php namespace Air\Routing\Dispatcher; use Air\Routing\ResolvedRequest\ResolvedRequestInterface; use Interop\Container\ContainerInterface; class Dispatcher implements DispatcherInterface { /** * @var ContainerInterface $container The DI container. */ private $container; /** * @param Con...
Set organization code to fhirdemo
var moment = require('moment'); var System = { create: function(activityInstance, user, language, nation) { var now = moment(); return { "User": { "HealthCareRole": user.startsWith("Patient") ? "Citizen" : "Physician", "HealthCareOrganization": { ...
var moment = require('moment'); var System = { create: function(activityInstance, user, language, nation) { var now = moment(); return { "User": { "HealthCareRole": user.startsWith("Patient") ? "Citizen" : "Physician", "HealthCareOrganization": { ...
Return payload even if request arg is not passed in.
""" Django-aware exception handler for integration with Errordite. Adds django user and request information to the exception as appropriate. """ from errordite import ErrorditeHandler class DjangoErrorditeHandler(ErrorditeHandler): """ Django-aware Errordite handler than enriches logs with request info. ...
""" Django-aware exception handler for integration with Errordite. Adds django user and request information to the exception as appropriate. """ from errordite import ErrorditeHandler class DjangoErrorditeHandler(ErrorditeHandler): """ Django-aware Errordite handler than enriches logs with request info. ...
Allow for null user agents in sessions.
<?php namespace Entity; use \Doctrine\Common\Collections\ArrayCollection; /** * @Table(name="sessions", indexes={ * @index(name="cleanup_idx", columns={"expires"}) * }) * @Entity */ class Session extends \DF\Doctrine\Entity { public function __construct() { $this->last_modified = time(); ...
<?php namespace Entity; use \Doctrine\Common\Collections\ArrayCollection; /** * @Table(name="sessions", indexes={ * @index(name="cleanup_idx", columns={"expires"}) * }) * @Entity */ class Session extends \DF\Doctrine\Entity { public function __construct() { $this->last_modified = time(); ...
Hide navigation if not authenticated
<!DOCTYPE html> <html> <head> <title>Budget</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:300,300i" /> <link rel="stylesheet" href="/style.css" /> </head> <body> ...
<!DOCTYPE html> <html> <head> <title>Budget</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:300,300i" /> <link rel="stylesheet" href="/style.css" /> </head> <body> ...
Change back to close when player closes inventyory
package xyz.upperlevel.uppercore.gui; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryC...
package xyz.upperlevel.uppercore.gui; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryC...
Change Array check using Array.isArray
var camelCase = require('camel-case'); var snakeCase = require('snake-case'); var paramCase = require('param-case'); var changeKeys = function changeKeys(transformer, obj) { if (Array.isArray(obj)) { var r = []; for (var i = 0; i < obj.length; i++) { console.log(obj[i]); r....
var camelCase = require('camel-case'); var snakeCase = require('snake-case'); var paramCase = require('param-case'); var changeKeys = function changeKeys(transformer, obj) { if (Object.prototype.toString.call(obj) === '[object Array]') { var r = []; for (var i = 0; i < obj.length; i++) { ...
Add metadata/query/result cache flush to "cache:clear" CLI command.
<?php use \DF\Phalcon\Cli\Task; use \PVL\SyncManager; class CacheTask extends Task { public function clearAction() { // Flush Doctrine cache. $em = $this->di->get('em'); $cacheDriver = $em->getConfiguration()->getMetadataCacheImpl(); $cacheDriver->deleteAll(); $queryCa...
<?php use \DF\Phalcon\Cli\Task; use \PVL\SyncManager; class CacheTask extends Task { public function clearAction() { // Flush local cache. \DF\Cache::clean(); $this->printLn('Local cache flushed.'); // Flush CloudFlare cache. if (DF_APPLICATION_ENV == 'production') { ...
Use connectIf to ensure web connection
"use strict"; module.exports = function (grunt) { grunt.registerTask("fixInstrument", function () { // Because code generation uses templates that are instrumented, the __cov_XXX variables must be global var fs = require("fs"); configuration.files.src.forEach(function (fileName) { ...
"use strict"; module.exports = function (grunt) { grunt.registerTask("fixInstrument", function () { // Because code generation uses templates that are instrumented, the __cov_XXX variables must be global var fs = require("fs"); configuration.files.src.forEach(function (fileName) { ...
Change ambigous variable name to be more clear what it is
# -*- coding: utf-8 -*- """ pykwalify """ # python stdlib import logging import logging.config import os __author__ = 'Grokzen <Grokzen@gmail.com>' __version_info__ = (1, 6, 0) __version__ = '.'.join(map(str, __version_info__)) log_level_to_string_map = { 5: "DEBUG", 4: "INFO", 3: "WARNING", 2: "ER...
# -*- coding: utf-8 -*- """ pykwalify """ # python stdlib import logging import logging.config import os __author__ = 'Grokzen <Grokzen@gmail.com>' __version_info__ = (1, 6, 0) __version__ = '.'.join(map(str, __version_info__)) log_level_to_string_map = { 5: "DEBUG", 4: "INFO", 3: "WARNING", 2: "ER...
Add a throbber for "sending sub request" in UserCard
import * as ActionTypes from '../action-types'; import * as ActionHelpers from '../action-helpers'; const {request, response, fail} = ActionHelpers; export default function userViews(state = {}, action) { switch (action.type) { case request(ActionTypes.SUBSCRIBE): case request(ActionTypes.SEND_SUBSCRIPTION_...
import * as ActionTypes from '../action-types'; import * as ActionHelpers from '../action-helpers'; const {request, response, fail} = ActionHelpers; export default function userViews(state = {}, action) { switch (action.type) { case request(ActionTypes.SUBSCRIBE): case request(ActionTypes.UNSUBSCRIBE): { ...
Change search from Contains to Starts With.
/// <reference path="../../../../../argos-sdk/libraries/ext/ext-core-debug.js"/> /// <reference path="../../../../../argos-sdk/libraries/sdata/sdata-client-debug"/> /// <reference path="../../../../../argos-sdk/libraries/Simplate.js"/> /// <reference path="../../../../../argos-sdk/src/View.js"/> /// <reference path=".....
/// <reference path="../../../../../argos-sdk/libraries/ext/ext-core-debug.js"/> /// <reference path="../../../../../argos-sdk/libraries/sdata/sdata-client-debug"/> /// <reference path="../../../../../argos-sdk/libraries/Simplate.js"/> /// <reference path="../../../../../argos-sdk/src/View.js"/> /// <reference path=".....
Update ApplicationSearchProvider to reflect conf.settings.Application changes.
import logging from molly.apps.search.providers import BaseSearchProvider from molly.conf import applications logger = logging.getLogger('molly.providers.apps.search.application_search') class ApplicationSearchProvider(BaseSearchProvider): def __init__(self, local_names=None): self.local_names = local_n...
import logging from molly.apps.search.providers import BaseSearchProvider from molly.conf import applications logger = logging.getLogger('molly.providers.apps.search.application_search') class ApplicationSearchProvider(BaseSearchProvider): def __init__(self, application_names=None): self.application_nam...
Make toString include the description, which may be helpful.
package net.happygiraffe.jslint; /** * @author dom * @version $Id$ */ public enum Option { ADSAFE ("if use of some browser features should be restricted"), BITWISE ("if bitwise operators should not be allowed"), BROWSER ("if the standard browser globals should be predefined"), CAP ("if uppe...
package net.happygiraffe.jslint; /** * @author dom * @version $Id$ */ public enum Option { ADSAFE ("if use of some browser features should be restricted"), BITWISE ("if bitwise operators should not be allowed"), BROWSER ("if the standard browser globals should be predefined"), CAP ("if uppe...
Fix the Print widget french language translations fixes #818
define ({ title: 'Titre', format: 'Format', layout: 'Disposition', settings: 'Paramètres', mapScaleExtent: 'Échelle/étendue de la carte', preserve: 'Préserver', mapScale: 'échelle de la carte', mapExtent: 'étendue de la carte', fullLayoutOptions: 'Options complètes de mise en page', ...
define ({ title: 'Titre', format: 'Format', layout: 'Disposition', settings: 'Paramètres', mapScaleExtent: 'Échelle/étendue de la carte', preserve: 'Préserver', mapScale: 'échelle de la carte', mapExtent: 'étendue de la carte', fullLayoutOptions: 'Options complètes de mise en page', ...
Set streams too since it's the same
<?php namespace Anomaly\PreferencesModule\Http\Middleware\Command; use Anomaly\PreferencesModule\Preference\Contract\PreferenceRepositoryInterface; use Illuminate\Config\Repository; use Illuminate\Contracts\Bus\SelfHandling; /** * Class SetDatetime * * @link http://anomaly.is/streams-platform * @author ...
<?php namespace Anomaly\PreferencesModule\Http\Middleware\Command; use Anomaly\PreferencesModule\Preference\Contract\PreferenceRepositoryInterface; use Illuminate\Config\Repository; use Illuminate\Contracts\Bus\SelfHandling; /** * Class SetDatetime * * @link http://anomaly.is/streams-platform * @author ...
Change log level to info
var path = require('path'); var devConfig = { context: path.join(__dirname, '/app'), entry: [ './app.js' ], output: { path: path.join(__dirname, '/build/'), publicPath: '/public/assets/js/', filename: 'app.js', }, devtool: 'eval-source-map', devServer: { ...
var path = require('path'); var devConfig = { context: path.join(__dirname, '/app'), entry: [ './app.js' ], output: { path: path.join(__dirname, '/build/'), publicPath: '/public/assets/js/', filename: 'app.js', }, devtool: 'eval-source-map', devServer: { ...
Add team eligibility to API
from rest_framework import serializers from greta.models import Repository from competition.models import Team from .models import TeamClient, TeamSubmission class TeamSerializer(serializers.ModelSerializer): class Meta: model = Team fields = ('id', 'name', 'slug', 'eligible_to_win') class Rep...
from rest_framework import serializers from greta.models import Repository from competition.models import Team from .models import TeamClient, TeamSubmission class TeamSerializer(serializers.ModelSerializer): class Meta: model = Team fields = ('id', 'name', 'slug') class RepoSerializer(seriali...
Add max-width to emoji completions.
import React from 'react'; import AutocompleteProvider from './AutocompleteProvider'; import Q from 'q'; import {emojioneList, shortnameToImage, shortnameToUnicode} from 'emojione'; import Fuse from 'fuse.js'; const EMOJI_REGEX = /:\w*:?/g; const EMOJI_SHORTNAMES = Object.keys(emojioneList); let instance = null; exp...
import React from 'react'; import AutocompleteProvider from './AutocompleteProvider'; import Q from 'q'; import {emojioneList, shortnameToImage, shortnameToUnicode} from 'emojione'; import Fuse from 'fuse.js'; const EMOJI_REGEX = /:\w*:?/g; const EMOJI_SHORTNAMES = Object.keys(emojioneList); let instance = null; exp...
Swap the speeds of the two-mode drivetrain
package edu.stuy.commands; import static edu.stuy.RobotMap.*; import edu.stuy.Robot; import edu.wpi.first.wpilibj.command.Command; /** * */ public class DrivetrainTankDriveCommand extends Command { public DrivetrainTankDriveCommand() { // Use requires() here to declare subsystem dependencies ...
package edu.stuy.commands; import static edu.stuy.RobotMap.*; import edu.stuy.Robot; import edu.wpi.first.wpilibj.command.Command; /** * */ public class DrivetrainTankDriveCommand extends Command { public DrivetrainTankDriveCommand() { // Use requires() here to declare subsystem dependencies ...
Fix up some windows menu items
module.exports = function menu (mainWindow) { var otherMenu = [ { label: '&File', submenu: [ { label: '&Open', accelerator: 'Ctrl+O' }, { label: '&Quit', accelerator: 'Ctrl+Q', click: function () { mainWindow.close() } }...
module.exports = function menu (mainWindow) { var otherMenu = [ { label: '&File', submenu: [ { label: '&Open', accelerator: 'Ctrl+O' }, { label: '&Close', accelerator: 'Ctrl+W', click: function () { mainWindow.close() } ...
Change the order when loading xml data
# -*- coding: utf-8 -*- ############################################################################## # ############################################################################## { "name": "Account Streamline", "version": "0.1", "author": "XCG Consulting", "category": 'Accounting', "description...
# -*- coding: utf-8 -*- ############################################################################## # ############################################################################## { "name": "Account Streamline", "version": "0.1", "author": "XCG Consulting", "category": 'Accounting', "description...
Load RSF should bypass consistency filter This commit updates the `ConsistencyFilter` to allow a call to `load-rsf` to bypass it. This is necessary if we need to update the metadata for a register to make it consistent with the environment, as otherwise we are blocked by all requests to an inconsistent register throwi...
package uk.gov.register.filters; import uk.gov.register.core.RegisterContext; import uk.gov.register.core.RegisterName; import uk.gov.register.exceptions.InconsistencyException; import javax.inject.Inject; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerRequestFilter; impor...
package uk.gov.register.filters; import uk.gov.register.core.RegisterContext; import uk.gov.register.core.RegisterName; import uk.gov.register.exceptions.InconsistencyException; import javax.inject.Inject; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerRequestFilter; impor...
Use proper async handling so that multiple tests are called sequentially and a callback is fired when completed
module.exports = function( grunt ) { // Create a new multi task. grunt.registerMultiTask( 'casperjs', 'This triggers casperjs.', function() { // Tell grunt this task is asynchronous. var done = this.async(), files = grunt.file.expandFiles(this.file.src), filepaths = [];...
module.exports = function( grunt ) { // Create a new multi task. grunt.registerMultiTask( 'casperjs', 'This triggers casperjs.', function() { // Tell grunt this task is asynchronous. var done = this.async(), files = grunt.file.expandFiles(this.file.src); grunt.file.expandF...
Fix mobilization block title edit
import React, { PropTypes } from 'react' import classnames from 'classnames' import { DropDownMenu, NavbarEditionWrapper } from '../../../../scripts/components' const MenuItems = ({ blocks, mobile, ...menuProps }) => { const items = blocks.map(block => ( <div key={block.id} className={classnames({ 'menu-item inl...
import React, { PropTypes } from 'react' import classnames from 'classnames' import { DropDownMenu, NavbarEditionWrapper } from '../../../../scripts/components' const MenuItems = ({ blocks, mobile, menuProps }) => { const items = blocks.map(block => ( <div key={block.id} className={classnames({ 'menu-item inline...
Enable DebugBar service when using local env
<?php namespace Strimoid\Providers; use GuzzleHttp\Client; use Illuminate\Support\ServiceProvider; use Pdp\Parser; use Pdp\PublicSuffixListManager; use Strimoid\Helpers\OEmbed; use Strimoid\Models\UserSettings; class AppServiceProvider extends ServiceProvider { /** * Register bindings in the container. ...
<?php namespace Strimoid\Providers; use GuzzleHttp\Client; use Illuminate\Support\ServiceProvider; use Pdp\Parser; use Pdp\PublicSuffixListManager; use Strimoid\Helpers\OEmbed; use Strimoid\Models\UserSettings; class AppServiceProvider extends ServiceProvider { /** * Register bindings in the container. ...
Check if migration exists before publishing
<?php namespace Kyranb\Footprints; use Kyranb\Footprints\Facades\FootprintsFacade; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; class FootprintsServiceProvider extends ServiceProvider { /** * Perform post-registration booting of services. */ public function boot() ...
<?php namespace Kyranb\Footprints; use Kyranb\Footprints\Facades\FootprintsFacade; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; class FootprintsServiceProvider extends ServiceProvider { /** * Perform post-registration booting of services. */ public function boot() ...
Fix bug in setting attributes
package nl.surfnet.mockoleth.controllers; import java.io.UnsupportedEncodingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; i...
package nl.surfnet.mockoleth.controllers; import java.io.UnsupportedEncodingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; i...
Make threadMessages function easier to import
function threadIdFor(message) { const recipienList = message.recipients || []; return recipienList.concat(message.sender). filter(character => character). map(character => character.id). sort(). join("-"); } export function threadMessages(messageList) { const threads = {}; ...
function threadIdFor(message) { const recipienList = message.recipients || []; return recipienList.concat(message.sender). filter(character => character). map(character => character.id). sort(). join("-"); } function threadMessages(messageList) { const threads = {}; me...
Fix errors in mysql rpc demo
<?php require('json-rpc.php'); if (function_exists('xdebug_disable')) { xdebug_disable(); } class MysqlDemo { public function query($query) { $link = new mysqli('localhost', 'user', 'password', 'db_name'); if (mysqli_connect_errno()) { throw new Exception("MySQL Connection: " . mysqli_connect...
<?php require('json-rpc.php'); if (function_exists('xdebug_disable')) { xdebug_disable(); } $link = new mysqli('localhost', 'user', 'password', 'db_name'); class MysqlDemo { public function query($query) { global $link; if (preg_match("/create|drop/", $query)) { throw new Exception("Sorry you ar...
Print error in case of no results
import asyncio import json import urllib.parse import aiohttp import waterbug class Commands: @waterbug.expose class prisjakt: @waterbug.expose @asyncio.coroutine def search(responder, *line): qstring = urllib.parse.urlencode({ "class": "Search_Supersear...
import asyncio import json import urllib.parse import aiohttp import waterbug class Commands: @waterbug.expose class prisjakt: @waterbug.expose @asyncio.coroutine def search(responder, *line): qstring = urllib.parse.urlencode({ "class": "Search_Supersear...
Fix bootstrap js ref at guest layout
<!doctype html> <html> <head> @include('includes.head') </head> <body> <div id="wrapper"> @include('includes.header') @include('includes.sidebar') <!-- Page Content --> <div id="page-wrapper"> <div class="container-fluid"> <div class="row"> <div clas...
<!doctype html> <html> <head> @include('includes.head') </head> <body> <div id="wrapper"> @include('includes.header') @include('includes.sidebar') <!-- Page Content --> <div id="page-wrapper"> <div class="container-fluid"> <div class="row"> <div clas...
Bring error message to the top, when clicked.
$(function(){ $('.holoform .field_error').live('click', function(e){ $('.field.recently-focused') .removeClass('recently-focused'); $(this) .closest('.field') .addClass('recently-focused'); }); $('ul.radio-optiongroups').each(function(){ var...
$(function(){ $('ul.radio-optiongroups').each(function(){ var $list = $(this), $select = $('<select />', {'class': 'hg'}); $list .children('li.field').children('label').find('input[type="radio"]') .each(function(){ var $radio = $(this), ...
Raise ImproperlyConfigured if resource has no scopes defined
from django.core.exceptions import ImproperlyConfigured from rest_framework.permissions import BasePermission SAFE_METHODS = ['GET', 'HEAD', 'OPTIONS'] class OAuth2ScopePermission(BasePermission): """ Make sure request is authenticated and token has right scope set. """ def has_permission(self, req...
from rest_framework.permissions import BasePermission SAFE_METHODS = ['GET', 'HEAD', 'OPTIONS'] class OAuth2ScopePermission(BasePermission): """ Make sure request is authenticated and token has right scope set. """ def has_permission(self, request, view): token = request.auth read_on...
Support className & id attrs and stream of arrays.
import Bacon from "baconjs" import React from "react" export default React.createClass({ getInitialState() { return {} }, tryDispose() { const {dispose} = this.state if (dispose) { dispose() this.replaceState({}) } }, trySubscribe(props) { this.tryDispose() const {children...
import Bacon from "baconjs" import React from "react" export default React.createClass({ getInitialState() { return {} }, tryDispose() { const {dispose} = this.state if (dispose) { dispose() this.replaceState({}) } }, trySubscribe(tDOM) { this.tryDispose() if (tDOM) ...
Add server as a task, allowing webserver and watch to run simutanously
module.exports = function(grunt) { grunt.initConfig({ connect: { server: { options: { port: 1337, base: 'dist', } } }, rubyHaml: { dist: { files: grunt.file.expandMapping(['views/*.haml'], 'dist/', { rename: function(base, path) { ...
module.exports = function(grunt) { grunt.initConfig({ connect: { server: { options: { port: 1337, base: 'dist', keepalive: true } } }, rubyHaml: { dist: { files: grunt.file.expandMapping(['views/*.haml'], 'dist/', { rename...
Put Project "Manage" item back Summary: Ref T12174. This isn't really a "newManageItem()" since Projects have a separate manage screen. That is, I incorrectly changed the "Manage [This Project]" item into a "Edit Menu" item, so some options (like "Archive Project") incorrectly became inaccessible. Test Plan: Viewed ...
<?php final class PhabricatorProjectProfileMenuEngine extends PhabricatorProfileMenuEngine { protected function isMenuEngineConfigurable() { return true; } protected function isMenuEnginePersonalizable() { return false; } public function getItemURI($path) { $project = $this->getProfileObject...
<?php final class PhabricatorProjectProfileMenuEngine extends PhabricatorProfileMenuEngine { protected function isMenuEngineConfigurable() { return true; } protected function isMenuEnginePersonalizable() { return false; } public function getItemURI($path) { $project = $this->getProfileObject...
Update group finder to new schemas
from .contentbase import LOCATION_ROOT CHERRY_LAB_UUID = 'cfb789b8-46f3-4d59-a2b3-adc39e7df93a' def groupfinder(login, request): if ':' not in login: return None namespace, localname = login.split(':', 1) user = None # We may get called before the context is found and the root set root = r...
from .contentbase import LOCATION_ROOT CHERRY_LAB_UUID = 'cfb789b8-46f3-4d59-a2b3-adc39e7df93a' def groupfinder(login, request): if ':' not in login: return None namespace, localname = login.split(':', 1) user = None # We may get called before the context is found and the root set root = r...
Fix payload sent to RabbitMQ.
'use strict'; const amqplib = require('amqplib'); const amqpUri = require('amqp-uri'); /** * Nortstar client service. */ module.exports = { /** * Configure RabbitMQ client. */ getClient() { if (!this.client) { this.client = amqplib.connect(amqpUri(sails.config.amqp.connection)); } retur...
'use strict'; const amqplib = require('amqplib'); const amqpUri = require('amqp-uri'); /** * Nortstar client service. */ module.exports = { /** * Configure RabbitMQ client. */ getClient() { if (!this.client) { this.client = amqplib.connect(amqpUri(sails.config.amqp.connection)); } retur...
Use the correct module name for 'msgpack' Python module
#!/usr/bin/env python import os import sys from serfclient import __version__ try: from setuptools import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args ...
#!/usr/bin/env python import os import sys from serfclient import __version__ try: from setuptools import setup from setuptools.command.test import test as TestCommand class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args ...
Set log level to info Set log level to info for presentation
package game; import com.badlogic.gdx.Game; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import game.MenuScreens.MainMenu; /** * Created by eriks on 26/10/2016. */ /** * Games entry point. */ public class BlueSky extends Game { // Game world size in arbitrary scale, thes...
package game; import com.badlogic.gdx.Game; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import game.MenuScreens.MainMenu; /** * Created by eriks on 26/10/2016. */ /** * Games entry point. */ public class BlueSky extends Game { // Game world size in arbitrary scale, thes...
Fix issue where multiple directories and files weren't linted
'use strict'; var fs = require('vow-fs'); var linter = require('./linter'); var Vow = require('Vow'); var LessHint = function () { }; LessHint.prototype.checkDirectory = function (path) { return fs.listDir(path).then(function (files) { return Vow.all(files.map(function(file) { var fullPath =...
'use strict'; var fs = require('vow-fs'); var linter = require('./linter'); var LessHint = function () { }; LessHint.prototype.checkDirectory = function (path) { return fs.listDir(path).then(function (files) { return files.forEach(function (file) { var fullPath = path + '/' + file; ...
Update idSelector to match latest gonzales AST
'use strict'; var path = require('path'); module.exports = function (options) { var filename = path.basename(options.path); var config = options.config; var node = options.node; var excludes; var message; var start; // Bail if the linter isn't wanted if (!config.idSelector || (config....
'use strict'; var path = require('path'); module.exports = function (options) { var filename = path.basename(options.path); var config = options.config; var node = options.node; var excludes; var message; var start; // Bail if the linter isn't wanted if (!config.idSelector || (config....
Clear the client before every test
<?php namespace LaVestima\HannaAgency\InfrastructureBundle\Tests; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class BaseWebTestCase extends WebTestCase { protected $client; public function __construct($name = null, array $data = [], $dataName = '') { $this->createNewClient(); p...
<?php namespace LaVestima\HannaAgency\InfrastructureBundle\Tests; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class BaseWebTestCase extends WebTestCase { protected $client; public function __construct($name = null, array $data = [], $dataName = '') { $this->client = static::createClient...
Replace double quote by simple quote, no need interpolation
#! /usr/bin/env python2.7 from collections import Counter from pprint import pprint from re import search from sys import argv def count_extension(filename): with open(filename, 'r') as file: # New empty counter. ext_dict = Counter() for line in file: # Remove newlines / carria...
#! /usr/bin/env python2.7 from collections import Counter from pprint import pprint from re import search from sys import argv def count_extension(filename): with open(filename, 'r') as file: # New empty counter. ext_dict = Counter() for line in file: # Remove newlines / carria...
Fix mconsole options for php 7.2
<?php namespace Milax\Mconsole\Models; use Illuminate\Database\Eloquent\Model; class MconsoleOption extends Model { use \Cacheable; protected $fillable = ['group', 'label', 'key', 'value', 'type', 'options', 'enabled', 'rules']; protected $casts = [ 'options' => 'array', 'rules'...
<?php namespace Milax\Mconsole\Models; use Illuminate\Database\Eloquent\Model; class MconsoleOption extends Model { use \Cacheable; protected $fillable = ['group', 'label', 'key', 'value', 'type', 'options', 'enabled', 'rules']; protected $casts = [ 'options' => 'array', 'rules'...
Define precedence and associativity for operators
# '2+3' -> {type:num, value: 2}, {type:op, value:'+'}, {type:num, value: 3} operators = { '+': {'prec': 10, 'assoc': 'left'}, '*': {'prec': 20, 'assoc': 'left'} } class TokenStream: def __init__(self, input_stream): self.input_stream = input_stream def is_whitespace(self, char): return...
# '2+3' -> {type:num, value: 2}, {type:op, value:'+'}, {type:num, value: 3} class TokenStream: def __init__(self, input_stream): self.input_stream = input_stream def is_whitespace(self, char): return char in ' \t' def is_digit(self, char): return char.isdigit() def is_operator...
Fix another unicode literal for Python 3.2
import sys import unittest import pexpect from pexpect import replwrap class REPLWrapTestCase(unittest.TestCase): def test_python(self): py = replwrap.python(sys.executable) res = py.run_command("5+6") self.assertEqual(res.strip(), "11") def test_multiline(self): py = replwrap...
import sys import unittest import pexpect from pexpect import replwrap class REPLWrapTestCase(unittest.TestCase): def test_python(self): py = replwrap.python(sys.executable) res = py.run_command("5+6") self.assertEqual(res.strip(), "11") def test_multiline(self): py = replwrap...
Fix "Path must be a string" issue with jslint
module.exports = function (grunt) { var DEV = "production" !== process.env.NODE_ENV; var PUBLIC_DEST = "../public"; require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); grunt.registerTask('default', ['build', 'watch']); grunt.registerTask('build', ['jshint', 'browserify', 'uglify', 'stylu...
module.exports = function (grunt) { var DEV = "production" !== process.env.NODE_ENV; var PUBLIC_DEST = "../public"; require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); grunt.registerTask('default', ['build', 'watch']); grunt.registerTask('build', ['jshint', 'browserify', 'uglify', 'stylu...
Add method to get handler in sound rewriter
package us.myles.ViaVersion.api.rewriters; import us.myles.ViaVersion.api.protocol.ClientboundPacketType; import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.remapper.PacketHandler; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.type.Type; public cl...
package us.myles.ViaVersion.api.rewriters; import us.myles.ViaVersion.api.protocol.ClientboundPacketType; import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.type.Type; public class SoundRewriter { protected final Protocol protoc...
Add all the paths so includes/extends work
from collections import defaultdict from django.template.base import TemplateDoesNotExist, TemplateSyntaxError # NOQA from django.template.backends.base import BaseEngine from django.template.backends.utils import csrf_input_lazy, csrf_token_lazy from . import compiler from . import loader class KnightsTemplater(B...
from collections import defaultdict from django.template.base import TemplateDoesNotExist, TemplateSyntaxError # NOQA from django.template.backends.base import BaseEngine from django.template.backends.utils import csrf_input_lazy, csrf_token_lazy from . import compiler from . import loader class KnightsTemplater(B...
Remove reference to deprecated TicketDB class
<?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once('class.TicketAdminPage.php'); require_once('class.FlipsideTicketDB.php'); $page = new TicketAdminPage('Burning Flipside - Tickets'); $page->add_js(JS_DATATABLE); $page->add_css(CSS_DATATABLE); $page->add_js_from_src('js/sold_tickets.js'); $page-...
<?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once('class.TicketAdminPage.php'); require_once('class.FlipsideTicketDB.php'); $page = new TicketAdminPage('Burning Flipside - Tickets'); $page->add_js(JS_DATATABLE); $page->add_css(CSS_DATATABLE); $page->add_js_from_src('js/sold_tickets.js'); $db = ...
Load modules and set readtables only once Don't re-setup modules and readtables for each file to prevent the module cache from breaking the plugin when processing multiple files.
var sweet = require('sweet.js'); var gutil = require('gulp-util'); var applySourceMap = require('vinyl-sourcemaps-apply'); var es = require('event-stream'); var merge = require('merge'); module.exports = function(opts) { if(opts.modules){ opts.modules = opts.modules.map(function(mod) { return sweet.loadNo...
var sweet = require('sweet.js'); var gutil = require('gulp-util'); var applySourceMap = require('vinyl-sourcemaps-apply'); var es = require('event-stream'); var merge = require('merge'); module.exports = function(opts) { var moduleCache = {}; return es.through(function(file) { if(file.isNull()) { return...
Rename multiple target test so it is unique. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@289222 91177308-0d34-0410-b5e6-96231b3b80d8
"""Test the lldb public C++ api when creating multiple targets simultaneously.""" from __future__ import print_function import os import re import subprocess import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestMultipleTargets(Test...
"""Test the lldb public C++ api when creating multiple targets simultaneously.""" from __future__ import print_function import os import re import subprocess import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestMultipleSimultaneous...
Change to 3 spaces in front of toctree elements
import shutil import os import re work = os.getcwd() found = [] regex = re.compile(r'pydarkstar\.(.*)\.rst') for root, dirs, files in os.walk(work): for f in files: m = regex.match(f) if m: found.append((root, f)) for root, f in found: path = os.path.join(root, f) with open(pat...
import shutil import os import re work = os.getcwd() found = [] regex = re.compile(r'pydarkstar\.(.*)\.rst') for root, dirs, files in os.walk(work): for f in files: m = regex.match(f) if m: found.append((root, f)) for root, f in found: path = os.path.join(root, f) with open(pat...
Add dot notation to search record belongs to
<?php namespace ilateral\SilverStripe\Searchable\Extensions; use ilateral\SilverStripe\Searchable\Model\SearchTable; use ilateral\SilverStripe\Searchable\Searchable; use SilverStripe\Core\Config\Config; use SilverStripe\ORM\DataExtension; class SearchableObjectExtension extends DataExtension { private static $be...
<?php namespace ilateral\SilverStripe\Searchable\Extensions; use ilateral\SilverStripe\Searchable\Model\SearchTable; use ilateral\SilverStripe\Searchable\Searchable; use SilverStripe\Core\Config\Config; use SilverStripe\ORM\DataExtension; class SearchableObjectExtension extends DataExtension { private static $be...
Fix the service name for the LineCounter
#!/usr/bin/env python from flask import Flask from flask_restplus import Resource, Api, reqparse from werkzeug.datastructures import FileStorage from time import sleep from random import randint import socket app = Flask(__name__) api = Api(app, version='1.0', title='LineCounter', description='This REST service expos...
#!/usr/bin/env python from flask import Flask from flask_restplus import Resource, Api, reqparse from werkzeug.datastructures import FileStorage from time import sleep from random import randint import socket app = Flask(__name__) api = Api(app, version='1.0', title='LineCounter', description='This REST service expos...
Add `filename` option to configuration tree
<?php namespace Farmatholin\SegmentIoBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http...
<?php namespace Farmatholin\SegmentIoBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http...
Rename master -> masters and slave -> slaves in server status
'use strict'; const has = require('has'); function collectPoolStatus(stats, { type, host, pool }) { const poolStats = [ ['_allConnections', 'open'], ['_freeConnections', 'sleeping'], ['_acquiringConnections', 'waiting'] ] .filter(([mysqljsProp]) => has(pool, mysqljsProp) && Arr...
'use strict'; const has = require('has'); function collectPoolStatus(stats, { type, host, pool }) { const poolStats = [ ['_allConnections', 'open'], ['_freeConnections', 'sleeping'], ['_acquiringConnections', 'waiting'] ] .filter(([mysqljsProp]) => has(pool, mysqljsProp) && Arr...
Fix delete command in pod initializer
class InitCommands(object): COPY = 'copy' CREATE = 'create' DELETE = 'delete' @classmethod def is_copy(cls, command): return command == cls.COPY @classmethod def is_create(cls, command): return command == cls.CREATE @classmethod def is_delete(cls, command): ...
class InitCommands(object): COPY = 'copy' CREATE = 'create' DELETE = 'delete' @classmethod def is_copy(cls, command): return command == cls.COPY @classmethod def is_create(cls, command): return command == cls.CREATE @classmethod def is_delete(cls, command): ...
Make sure that have intervals of the form [start, end).
class IntervalStorage(object): def __init__(self, interval_map=None): if interval_map == None: self.interval_map = {} else: if not isinstance(interval_map, dict): raise ValueError("Interval map must be a dictionary containing entries as keys and interval tuple...
class IntervalStorage(object): def __init__(self, interval_map=None): if interval_map == None: self.interval_map = {} else: if not isinstance(interval_map, dict): raise ValueError("Interval map must be a dictionary containing entries as keys and interval tuple...
Handle import error on older python versions
try: import queue except ImportError: import Queue import threading class Producer(object): def __init__(self, period_in_seconds, queue, function): self._period_in_seconds = period_in_seconds self._queue = queue self._function = function self._event = threading.Event() ...
import queue import threading class Producer(object): def __init__(self, period_in_seconds, queue, function): self._period_in_seconds = period_in_seconds self._queue = queue self._function = function self._event = threading.Event() self._thread = threading.Thread(target=se...
:bug: Change config property to app from name
'use strict'; var CloudFoundry = require('cf-nodejs-client'), Promise = require('bluebird'), util = require('util'), Spinner = require('cli-spinner').Spinner, spinner = new Spinner('%s'), cf = new CloudFoundry.CloudFoundry(), routes = new CloudFoundry.Routes(), manifest = require('./lib/man...
'use strict'; var CloudFoundry = require('cf-nodejs-client'), Promise = require('bluebird'), util = require('util'), Spinner = require('cli-spinner').Spinner, spinner = new Spinner('%s'), cf = new CloudFoundry.CloudFoundry(), routes = new CloudFoundry.Routes(), manifest = require('./lib/man...
example: Add example of removing physics body
FamousFramework.scene('famous-tests:physics:basic:particle', { behaviors: { '.particle': { 'size': [200, 200], 'align': [0.5, 0.5], 'mount-point': [0.5, 0.5], 'style': { 'background': 'whitesmoke', 'border-radius': '50%' ...
FamousFramework.scene('famous-tests:physics:basic:particle', { behaviors: { '.particle': { 'size': [200, 200], 'align': [0.5, 0.5], 'mount-point': [0.5, 0.5], 'style': { 'background': 'whitesmoke', 'border-radius': '50%' ...
Reset the num threads to the env variable, not the default
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...
Fix formatting of sizes between 1000 and 1024
jQuery.fn.log = function (msg){ console.log("%s: %o", msg, this); return this; }; $(document).ready(function(){ $.ajaxSetup({cache: false}); $.getJSON("/disco/version", function (data){ $("#version").text(data); }); }); function format_size(num){ units = ['KB', 'MB', 'GB', 'TB']; f...
jQuery.fn.log = function (msg){ console.log("%s: %o", msg, this); return this; }; $(document).ready(function(){ $.ajaxSetup({cache: false}); $.getJSON("/disco/version", function (data){ $("#version").text(data); }); }); function format_size(num){ units = ['KB', 'MB', 'GB', 'TB']; f...
Add 'background' attribute for 'table' tag to the whitelist
package com.fsck.k9.message.html; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.safety.Cleaner; import org.jsoup.safety.Whitelist; public class HtmlSanitizer { private final HeadCleaner headCleaner; private final Cleaner cleaner; HtmlSanitizer() { Whitelist whitelist...
package com.fsck.k9.message.html; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.safety.Cleaner; import org.jsoup.safety.Whitelist; public class HtmlSanitizer { private final HeadCleaner headCleaner; private final Cleaner cleaner; HtmlSanitizer() { Whitelist whitelist...
Add call_script output to workflow_dict traceback
# -*- coding: utf-8 -*- import logging from util import full_stack from util import call_script from django.conf import settings from drivers import factory_for from system.models import Configuration from notification.util import get_clone_args from ...base import BaseStep from ....exceptions.error_codes import DBAAS_...
# -*- coding: utf-8 -*- import logging from util import full_stack from util import call_script from django.conf import settings from drivers import factory_for from system.models import Configuration from notification.util import get_clone_args from ...base import BaseStep from ....exceptions.error_codes import DBAAS_...
Change deprecated config for USM
import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import angular from 'rollup-plugin-angular'; import typescript from 'rollup-plugin-typescript'; var sass = require('node-sass'); import {nameLibrary,PATH_SRC,PATH_DIST} from './config-library.js'; export default { input: ...
import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import angular from 'rollup-plugin-angular'; import typescript from 'rollup-plugin-typescript'; var sass = require('node-sass'); import {nameLibrary,PATH_SRC,PATH_DIST} from './config-library.js'; export default { entry: ...
Fix issue preventing inventory groups from loading A conditional was in place to check if a URL included the base path, if so, it was supposed to use the URL as-is, otherwise it should get the URL by referencing a property in an object containing default URLs. The conditional checked only for 'api/v1'. Since we're at...
/************************************************* * Copyright (c) 2015 Ansible, Inc. * * All Rights Reserved *************************************************/ export default angular.module('rbacUiControl', []) .service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBase...
/************************************************* * Copyright (c) 2015 Ansible, Inc. * * All Rights Reserved *************************************************/ export default angular.module('rbacUiControl', []) .service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBase...
Change the browse page layout temporarily
import React from 'react'; import { connect } from 'react-redux'; import { fetchRecipes, setSearchTerm } from '../actions/'; import Header from '../components/Header'; import SearchHeader from '../components/SearchHeader'; import Card from '../components/Card'; class Browse extends React.Component { constructor(prop...
import React from 'react'; import { connect } from 'react-redux'; import { fetchRecipes, setSearchTerm } from '../actions/'; import Header from '../components/Header'; import SearchHeader from '../components/SearchHeader'; import Card from '../components/Card'; class Browse extends React.Component { constructor(prop...
Define constant for the max epic count
const localStorageKey = 'recent-epics'; const maxEpicCount = 10; const hasLocalStorage = () => { return typeof(Storage) !== "undefined" }; const getRecentEpics = () => { if (!hasLocalStorage) { return } const rawRecentEpics = localStorage.getItem(localStorageKey); if (rawRecentEpics) { ...
const localStorageKey = 'recent-epics'; const hasLocalStorage = () => { return typeof(Storage) !== "undefined" }; const getRecentEpics = () => { if (!hasLocalStorage) { return } const rawRecentEpics = localStorage.getItem(localStorageKey); if (rawRecentEpics) { var parsed = []; ...
conan: Copy find modules to root of module path
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class CPPCheckTargetCMakeConan(ConanFile): name = "cppcheck-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspilla...
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class CPPCheckTargetCMakeConan(ConanFile): name = "cppcheck-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspilla...
Change main method by generate.
package foundation.stack.datamill.security; import org.jose4j.jwk.*; import org.jose4j.keys.HmacKey; import org.jose4j.lang.ByteUtil; /** * @author Ravi Chodavarapu (rchodava@gmail.com) */ public interface KeyGenerators { class Symmetric { private Symmetric() { } public static void gene...
package foundation.stack.datamill.security; import org.jose4j.jwk.*; import org.jose4j.keys.HmacKey; import org.jose4j.lang.ByteUtil; /** * @author Ravi Chodavarapu (rchodava@gmail.com) */ public interface KeyGenerators { class Symmetric { private Symmetric() { } public static void main...
fix(data): Fix weighted/chance tables not serializing
package valandur.webapi.serialize.view.misc; import com.fasterxml.jackson.annotation.JsonValue; import org.spongepowered.api.util.weighted.NestedTableEntry; import org.spongepowered.api.util.weighted.RandomObjectTable; import org.spongepowered.api.util.weighted.TableEntry; import org.spongepowered.api.util.weigh...
package valandur.webapi.serialize.view.misc; import com.fasterxml.jackson.annotation.JsonValue; import org.spongepowered.api.util.weighted.NestedTableEntry; import org.spongepowered.api.util.weighted.RandomObjectTable; import org.spongepowered.api.util.weighted.TableEntry; import org.spongepowered.api.util.weigh...
Make separator line match width of board
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
import sys, random, time boardSize = (10,10) while True: foo, bar, baz, globals()['board'] = None if globals().get('board') is None else [ ( [sys.stdout.write('X' if cell else ' ') for cell in row], sys.stdout.write('\n') ) for row in board ], time.sleep(1), sys.stdout.writ...
Allow data property to not be use
from astropy.io import fits import numpy as np from ..io import input_data class BaseStatisticMixIn(object): """ Common properties to all statistics """ # Disable this flag when a statistic does not need a header need_header_flag = True # Disable this when the data property will not be use...
from astropy.io import fits import numpy as np from ..io import input_data class BaseStatisticMixIn(object): """ Common properties to all statistics """ # Disable this flag when a statistic does not need a header need_header_flag = True @property def header(self): return self._...
Make email and name order fit to the default django settings file
from django import forms from django.conf import settings from django.template import loader from django.core.mail import send_mail class BaseEmailFormMixin(object): from_email = settings.DEFAULT_FROM_EMAIL recipient_list = [email for _, email in settings.MANAGERS] subject_template_name = 'contact_form/e...
from django import forms from django.conf import settings from django.template import loader from django.core.mail import send_mail class BaseEmailFormMixin(object): from_email = settings.DEFAULT_FROM_EMAIL recipient_list = [email for email, _ in settings.MANAGERS] subject_template_name = 'contact_form/e...
Add related_name to initial migration so it doesn't try to later
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
Write task output to skype window
package pl.mkrystek.mkbot.task; import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import pl.mkrystek.mkbot.window.SkypeWindow; public class TaskExecutionEngine { private static final Logger ...
package pl.mkrystek.mkbot.task; import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import pl.mkrystek.mkbot.window.SkypeWindow; public class TaskExecutionEngine { private static final Logger ...
Fix Editor Save Button not allowing unpublish Closes #2918
/* global console */ var EditorControllerMixin = Ember.Mixin.create({ //## Computed post properties isPublished: Ember.computed.equal('status', 'published'), isDraft: Ember.computed.equal('status', 'draft'), /** * By default, a post will not change its publish state. * Only with a user-set va...
/* global console */ var EditorControllerMixin = Ember.Mixin.create({ //## Computed post properties isPublished: Ember.computed.equal('status', 'published'), isDraft: Ember.computed.equal('status', 'draft'), /** * By default, a post will not change its publish state. * Only with a user-set va...
Rebuild wordcount on thread indexing
<?php class SV_WordCountSearch_XenForo_Search_DataHandler_Thread extends XFCP_SV_WordCountSearch_XenForo_Search_DataHandler_Thread { protected function _insertIntoIndex(XenForo_Search_Indexer $indexer, array $data, array $parentData = null) { $wordcount = 0; if (!empty($data['threadmark_count'...
<?php class SV_WordCountSearch_XenForo_Search_DataHandler_Thread extends XFCP_SV_WordCountSearch_XenForo_Search_DataHandler_Thread { protected function _insertIntoIndex(XenForo_Search_Indexer $indexer, array $data, array $parentData = null) { $wordcount = 0; if (!empty($data['word_count'])) ...
Add git pull back in
<?php require 'core.php'; // No unauthenticated deploys! protectPage(); // Run relevant deploy. $hash = $_GET['project']; $targets = getDeployTargets(); foreach ($targets as $target) { if ($target->getIdentifier() == $hash) { $result = 'Trying to execute deploy as: ' . shell_exec('whoami'); $...
<?php require 'core.php'; // No unauthenticated deploys! protectPage(); // Run relevant deploy. $hash = $_GET['project']; $targets = getDeployTargets(); foreach ($targets as $target) { if ($target->getIdentifier() == $hash) { //$result = shell_exec('/usr/bin/git pull 2>&1'); // Execute script. ...
Allow users to enlarge project images
@extends('layout.base') @section('body') <div id="viewport"> @include('layout.header') <div id="main"> <div id="crumbtrail"> <ul> <li class="fa fa-home"> <li>Project <li>{{ $project->title }} </ul> </div> <section class="project"> <div class="subsecti...
@extends('layout.base') @section('body') <div id="viewport"> @include('layout.header') <div id="main"> <div id="crumbtrail"> <ul> <li class="fa fa-home"> <li>Project <li>{{ $project->title }} </ul> </div> <section class="project"> <div class="subsecti...
Use Throwable and fixed throws annotation
<?php namespace League\Tactician\Doctrine\ORM; use Doctrine\ORM\EntityManagerInterface; use League\Tactician\Command; use Exception; use League\Tactician\Middleware; use Throwable; /** * Wraps command execution inside a Doctrine ORM transaction */ class TransactionMiddleware implements Middleware { /** * @...
<?php namespace League\Tactician\Doctrine\ORM; use Doctrine\ORM\EntityManagerInterface; use League\Tactician\Command; use Error; use Exception; use League\Tactician\Middleware; /** * Wraps command execution inside a Doctrine ORM transaction */ class TransactionMiddleware implements Middleware { /** * @var ...
CA-40618: Change path to the supplemental pack Signed-off-by: Javier Alvarez-Valle <cf4c8668a0b4c5e013f594a6940d05b3d4d9ddcf@citrix.com>
import subprocess, sys, os.path class DRAC_NO_SUPP_PACK(Exception): """Base Exception class for all transfer plugin errors.""" def __init__(self, *args): Exception.__init__(self, *args) class DRAC_POWERON_FAILED(Exception): """Base Exception class for all transfer plugin errors.""" def...
import subprocess, sys, os.path class DRAC_NO_SUPP_PACK(Exception): """Base Exception class for all transfer plugin errors.""" def __init__(self, *args): Exception.__init__(self, *args) class DRAC_POWERON_FAILED(Exception): """Base Exception class for all transfer plugin errors.""" def...
Rework the versions form widget
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.admin import GenericStackedInline from .forms import object_version_choices from .models import PublishAction class ActionInline(GenericStackedInline): model = PublishAction fields = ('scheduled_time', 'publish...
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.admin import GenericStackedInline from .forms import object_version_choices from .models import PublishAction class ActionInline(GenericStackedInline): model = PublishAction fields = ('scheduled_time', 'publish...
Add ignore_404 setting to config
<?php /* * This file is part of the Raygunbundle package. * * (c) nietonfir <nietonfir@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Nietonfir\RaygunBundle\DependencyInjection; use Symfony\Component\Config...
<?php /* * This file is part of the Raygunbundle package. * * (c) nietonfir <nietonfir@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Nietonfir\RaygunBundle\DependencyInjection; use Symfony\Component\Config...
Put prefix to enum values. Removed old hack.
from scripts import utils class CUBAEnumGenerator(object): """Generator class for cuba.py enumeration. """ def generate(self, cuba_dict, simphony_metadata_dict, output): """Generates the cuba file from the yaml-extracted dictionary of cuba and simphony_metadata files. Writes the generated...
from scripts.old_single_meta_class_generator import CUBA_DATA_CONTAINER_EXCLUDE class CUBAEnumGenerator(object): """Generator class for cuba.py enumeration. """ def generate(self, cuba_dict, simphony_metadata_dict, output): """Generates the cuba file from the yaml-extracted dictionary of ...
Allow OAR file rule to use non-OSGI jars Change-Id: If2a82bdb5b217270ca02760f1c6cfc6f8f0dc7da
#!/usr/bin/env python #FIXME Add license from zipfile import ZipFile def generateOar(output, files=[]): # Note this is not a compressed zip with ZipFile(output, 'w') as zip: for file, mvnCoords in files: filename = file.split('/')[-1] if mvnCoords == 'NONE': des...
#!/usr/bin/env python #FIXME Add license from zipfile import ZipFile def generateOar(output, files=[]): # Note this is not a compressed zip with ZipFile(output, 'w') as zip: for file, mvnCoords in files: filename = file.split('/')[-1] if mvnCoords == 'NONE': des...
Bump version and set license to MIT
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).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='django-munigeo', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).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='django-munigeo', ...
Handle Errors by default by checking error handlers
<?php namespace Flubber; define('FLIB', dirname(__FILE__).'/'); define('FLVERSION', 2.0); // Load the core functions require_once 'Functions.php'; use Flubber\FLException as FLException, Flubber\Datastore as Datastore, Flubber\Request as Request, Flubber\Locale as Locale, Flubber\Session as Session; ...
<?php namespace Flubber; define('FLIB', dirname(__FILE__).'/'); define('FLVERSION', 2.0); // Load the core functions require_once 'Functions.php'; use Flubber\Datastore as Datastore, Flubber\Request as Request, Flubber\FLException as FLException, Flubber\Locale as Locale, Flubber\Session as Session; ...
Add a properly string for outputing
from . import output import json import sys import urllib.parse import http.client def getRequest(id, conf): db = conf['db'] headers = conf['headers'] test = db[id] method = test['method'].upper() fullpath = conf['path'] + test['path'] desc = test['desc'] params = '' server = conf['dom...
from . import output import json import sys import urllib.parse import http.client def getRequest(id, conf): db = conf['db'] headers = conf['headers'] test = db[id] method = test['method'].upper() fullpath = conf['path'] + test['path'] desc = test['desc'] params = '' server = conf['dom...
Add nose tests to validate Exception raising.
import unittest from polycircles import polycircles from nose.tools import raises class TestExceptions(unittest.TestCase): @raises(ValueError) def test_less_than_3_vertices_no_1(self): polycircle = polycircles.Polycircle(latitude=30, longitude=30, ...
import unittest from polycircles import polycircles from nose.tools import raises class TestExceptions(unittest.TestCase): @raises(ValueError) def test_less_than_3_vertices_no_1(self): polycircle = polycircles.Polycircle(latitude=30, longitude=30, ...
Add Accept header to use version 1.1
from libcloud.utils.py3 import httplib from libcloud.common.types import InvalidCredsError from libcloud.common.base import JsonResponse from libcloud.common.base import ConnectionKey class MaxihostResponse(JsonResponse): valid_response_codes = [httplib.OK, httplib.ACCEPTED, httplib.CREATED, ...
from libcloud.utils.py3 import httplib from libcloud.common.types import InvalidCredsError from libcloud.common.base import JsonResponse from libcloud.common.base import ConnectionKey class MaxihostResponse(JsonResponse): valid_response_codes = [httplib.OK, httplib.ACCEPTED, httplib.CREATED, ...
Enable loading of SQL scripts with arbitrary name
""" http://djangosnippets.org/snippets/2311/ Ensure South will update our custom SQL during a call to `migrate`. """ import logging import traceback from south.signals import post_migrate logger = logging.getLogger(__name__) def run_initial_sql(sender, **kwargs): import os import re from django....
""" http://djangosnippets.org/snippets/2311/ Ensure South will update our custom SQL during a call to `migrate`. """ import logging import traceback from south.signals import post_migrate logger = logging.getLogger(__name__) def run_initial_sql(sender, **kwargs): app_label = kwargs.get('app') import...
Fix link to home in header
import React from "react"; import { Link } from "react-router"; import { Header, Footer } from "formidable-landers"; // Variables and Stylesheet import LOGO from "../../static/logo.svg"; import "../styles/styles.css"; class App extends React.Component { render() { const SpectacleLogoLink = ( <h1 className...
import React from "react"; import { Link } from "react-router"; import { Header, Footer } from "formidable-landers"; // Variables and Stylesheet import LOGO from "../../static/logo.svg"; import "../styles/styles.css"; class App extends React.Component { render() { const SpectacleLogoLink = ( <h1 className...