text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Fix import and tokenizer exceptions | # coding: utf-8
from __future__ import unicode_literals
from ...language import Language
from ...attrs import LANG
from ...fr.stop_words import STOP_WORDS
from ...fr.tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from ...language_data.punctuation import TOKENIZER_INFIXES, ALPHA
from ...util import update_exc
import... | # coding: utf-8
from __future__ import unicode_literals
from ...language import Language
from ...attrs import LANG
from ...fr.language_data import get_tokenizer_exceptions, STOP_WORDS
from ...language_data.punctuation import TOKENIZER_INFIXES, ALPHA
import pytest
@pytest.fixture
def fr_tokenizer_w_infix():
SPLI... |
Improve error logging for ct | const logger = require('logger');
const ErrorSerializer = require('serializers/errorSerializer');
function init() {
}
function middleware(app, plugin) {
app.use(async(ctx, next) => {
try {
await next();
} catch (error) {
logger.error(error);
ctx.status = error.... | const logger = require('logger');
const ErrorSerializer = require('serializers/errorSerializer');
function init() {
}
function middleware(app, plugin) {
app.use(async(ctx, next) => {
try {
await next();
} catch (error) {
ctx.status = error.status || 500;
if (pr... |
Add header comment for class and change isMutating to true | package seedu.address.logic.commands;
import javafx.collections.ObservableList;
import seedu.address.commons.exceptions.InvalidUndoCommandException;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.undo.UndoManager;
import seedu.address.model.datastructure.UndoPair;
import se... | package seedu.address.logic.commands;
import javafx.collections.ObservableList;
import seedu.address.commons.exceptions.InvalidUndoCommandException;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.undo.UndoManager;
import seedu.address.model.datastructure.UndoPair;
import se... |
build(webpack): Remove babel-polyfill from vendor bundle | /* eslint-disable global-require */
const path = require('path');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const babelConfig = require(... | /* eslint-disable global-require */
const path = require('path');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const babelConfig = require(... |
Check that request id can be null | package com.github.arteam.simplejsonrpc.core.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.NullNode;
import com.fasterxml.jackson.databind.node.ValueNode;
import org.jetbrains.annotations.NotNull;
import org.jetb... | package com.github.arteam.simplejsonrpc.core.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ValueNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Date: 07.06.14
... |
Remove method that maintain’s scroll parity
Since we don’t anticipate placeholder textboxes ever scrolling in the future,
this can be removed. | (function(Modules) {
"use strict";
if (
!('oninput' in document.createElement('input'))
) return;
const tagPattern = /\(\([^\)\(]+\)\)/g;
Modules.HighlightTags = function() {
this.start = function(textarea) {
this.$textbox = $(textarea)
.wrap(`
<div class='textbox-highligh... | (function(Modules) {
"use strict";
if (
!('oninput' in document.createElement('input'))
) return;
const tagPattern = /\(\([^\)\(]+\)\)/g;
Modules.HighlightTags = function() {
this.start = function(textarea) {
this.$textbox = $(textarea)
.wrap(`
<div class='textbox-highligh... |
Fix context given to mailutils | from django.shortcuts import render, redirect
from django.conf import settings
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.mailutils import mailApplicantSubmission
class BaseView(View):
context = {'DEBUG': ... | from django.shortcuts import render, redirect
from django.conf import settings
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.mailutils import mailApplicantSubmission
class BaseView(View):
context = {'DEBUG': ... |
Enable service search filter tests | describe('Service Search Filters', function () {
context('Filters services table', function () {
beforeEach(function () {
cy.configureCluster({
mesos: '1-for-each-health',
nodeHealth: true
});
cy.visitUrl({url: '/services'});
});
it('filters correctly on search string', ... | xdescribe('Service Search Filters', function () {
context('Filters services table', function () {
beforeEach(function () {
cy.configureCluster({
mesos: '1-for-each-health',
nodeHealth: true
});
cy.visitUrl({url: '/services'});
});
it('filters correctly on search string',... |
UI: Convert users page to LightComponent |
import React from "react";
import { AppMenu } from "ui-components/app_menu";
import LightComponent from "ui-lib/light_component";
class Page extends LightComponent {
render() {
this.log("render", this.props, this.state);
const pathname = this.getPathname();
const items = this.props.route... |
import React from "react";
import { AppMenu } from "ui-components/app_menu";
import Component from "ui-lib/component";
class Page extends Component {
constructor(props) {
super(props, true);
}
render() {
this.log("render", this.props, this.state);
const pathname = this.getPathnam... |
Remove card on home page | /*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a necessity for you then you can refactor it and remove
* the l... | /*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a necessity for you then you can refactor it and remove
* the l... |
Fix logic for determining if a header decorator is empty | package ca.antonious.viewcelladapter.decorators;
import ca.antonious.viewcelladapter.AbstractSection;
import ca.antonious.viewcelladapter.AbstractViewCell;
import ca.antonious.viewcelladapter.decorators.SectionDecorator;
/**
* Created by George on 2016-12-17.
*/
public class HeaderSectionDecorator extends SectionD... | package ca.antonious.viewcelladapter.decorators;
import ca.antonious.viewcelladapter.AbstractSection;
import ca.antonious.viewcelladapter.AbstractViewCell;
import ca.antonious.viewcelladapter.decorators.SectionDecorator;
/**
* Created by George on 2016-12-17.
*/
public class HeaderSectionDecorator extends SectionD... |
Use base64 strings instead of byte arrays | package com.reactlibrary;
import android.util.Base64;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import org.tensorflow.Graph;
public class RNTensorflowGra... | package com.reactlibrary;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import org.tensorflow.Graph;
public class RNTensorflowGraphModule extends ReactContex... |
Move filter and set fixed precision | var ds18b20 = require('../services/ds18b20.js');
var logger = require('../services/logger.js');
var _ = require('lodash');
var sensors;
var config;
var init = function (cfg) {
config = cfg || {};
logger.init(config);
};
var run = function () {
if (!config) {
console.log('MONITOR', 'No configurat... | var ds18b20 = require('../services/ds18b20.js');
var logger = require('../services/logger.js');
var _ = require('lodash');
var sensors;
var config;
var init = function (cfg) {
config = cfg || {};
sensors = _.filter(config.sensors, function (sensor) {
return sensor.isActive;
});
logger.init(c... |
Remove unused lodash.find reference in duplicateProperty | '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 properties = [];
var errors = [];
// Bail if the linter isn't wanted
if (config.duplicateProperty && !confi... | 'use strict';
var find = require('lodash.find');
var path = require('path');
module.exports = function (options) {
var filename = path.basename(options.path);
var config = options.config;
var node = options.node;
var properties = [];
var errors = [];
// Bail if the linter isn't wanted
if ... |
Make sure Catalysis benchmark sets up between each iteration
Probably why it was so erratic. | package etomica.simulation;
import etomica.modules.catalysis.Catalysis;
import etomica.space3d.Space3D;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.profile.StackProfiler;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;... | package etomica.simulation;
import etomica.modules.catalysis.Catalysis;
import etomica.space3d.Space3D;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.profile.StackProfiler;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;... |
Remove unused moa exception class. | '''
* when dispatching events, returning True stops it.
'''
__all__ = ('MoaBase', )
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaBase(EventDispatcher):
named_moas = {}
''' A weakref.ref to ... | '''
* when dispatching events, returning True stops it.
'''
from weakref import ref
from kivy.event import EventDispatcher
from kivy.properties import StringProperty, OptionProperty, ObjectProperty
import logging
class MoaException(Exception):
pass
class MoaBase(EventDispatcher):
named_moas = {}
''' ... |
Fix order cancellation in FIX gateway
All orders do not have an OrigClOrdID(41).
Thanks to Pekka Enberg for reporting the failure. | package com.paritytrading.parity.fix;
import java.util.ArrayList;
import java.util.List;
class Orders {
private List<Order> orders;
public Orders() {
orders = new ArrayList<>();
}
public void add(Order order) {
orders.add(order);
}
public Order findByClOrdID(String clOrdId)... | package com.paritytrading.parity.fix;
import java.util.ArrayList;
import java.util.List;
class Orders {
private List<Order> orders;
public Orders() {
orders = new ArrayList<>();
}
public void add(Order order) {
orders.add(order);
}
public Order findByClOrdID(String clOrdId)... |
Add .dev to version name in about dialog | package fr.masciulli.drinks.fragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import ... | package fr.masciulli.drinks.fragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import ... |
Add space at end of error message | package com.jstanier;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.googlecode.jcsv.CSVStrategy;
import com.googlecode.jcsv.read... | package com.jstanier;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.googlecode.jcsv.CSVStrategy;
import com.googlecode.jcsv.read... |
Add null check on help generation | import Plugin from "./Plugin";
export default class MasterPlugin extends Plugin {
static get plugin() {
return {
name: "MasterPlugin",
description: "",
help: "This plugin has access to PluginManager and will perform all the 'meta'/'super' actions.",
type: P... | import Plugin from "./Plugin";
export default class MasterPlugin extends Plugin {
static get plugin() {
return {
name: "MasterPlugin",
description: "",
help: "This plugin has access to PluginManager and will perform all the 'meta'/'super' actions.",
type: P... |
Add monitoring logo in form | # -*- coding: utf-8 -*-
from atom.ext.crispy_forms.forms import FormHorizontalMixin, SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from dal import autocomplete
from django import forms
from tinymce.widgets import TinyMCE
from django.utils.translation import ugettext_lazy as _
from ..institutions.m... | # -*- coding: utf-8 -*-
from atom.ext.crispy_forms.forms import FormHorizontalMixin, SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from dal import autocomplete
from django import forms
from tinymce.widgets import TinyMCE
from django.utils.translation import ugettext_lazy as _
from ..institutions.m... |
Add disk and memory stats to dashboard | <?php
namespace Emergence\SiteAdmin;
use Site;
use Person;
use User;
use Emergence\Util\ByteSize;
class DashboardRequestHandler extends \RequestHandler
{
public static function handleRequest()
{
$GLOBALS['Session']->requireAccountLevel('Administrator');
// get available memory
$avai... | <?php
namespace Emergence\SiteAdmin;
use Person;
use User;
class DashboardRequestHandler extends \RequestHandler
{
public static function handleRequest()
{
$GLOBALS['Session']->requireAccountLevel('Administrator');
return static::respond('dashboard', [
'metrics' => [
... |
Fix typo in constructor and remove set_integrator method | import hoomd.integrate
class Operations:
def __init__(self, simulation=None):
self.simulation = simulation
self._auto_schedule = False
self._compute = list()
def add(self, op):
if isinstance(op, hoomd.integrate._integrator):
self._integrator = op
else:
... | import hoomd._integrator
class Operations:
def __init__(self, simulation=None):
self.simulation = None
self._auto_schedule = False
self._compute = list()
def add(self, op):
if isinstance(op, hoomd.integrate._integrator):
self._set_integrator(op)
else:
... |
Add output file path to final log | 'use strict';
var fs = require('fs');
var split = require('split');
var argv = require('minimist')(process.argv.slice(2));
if (!argv.hasOwnProperty('input')) {
console.log('Usage: node index.js --input <path to line delimited GeoJSON FeatureCollections>');
} else {
mergeStream(argv.input, argv.output);
}
fun... | 'use strict';
var fs = require('fs');
var split = require('split');
var argv = require('minimist')(process.argv.slice(2));
if (!argv.hasOwnProperty('input')) {
console.log('Usage: node index.js --input <path to line delimited GeoJSON FeatureCollections>');
} else {
mergeStream(argv.input, argv.output);
}
fun... |
Remove Button, only in Download Menu | // toggle display of all code cells' inputs
define([
'jquery',
'base/js/namespace',
'base/js/events'
], function(
$,
Jupyter,
events
) {
"use strict";
function initialize () {
}
var load_ipython_extension = function() {
/* Add an entry in the download menu */
... | // toggle display of all code cells' inputs
define([
'jquery',
'base/js/namespace',
'base/js/events'
], function(
$,
Jupyter,
events
) {
"use strict";
function initialize () {
console.log("Embedded HTML Exporter loaded!");
}
var load_ipython_extension = function() {
... |
Fix string == null error | package nuclibook.routes;
import nuclibook.constants.P;
import nuclibook.entity_utils.ExportUtils;
import nuclibook.entity_utils.PatientUtils;
import nuclibook.entity_utils.SecurityUtils;
import nuclibook.models.Patient;
import nuclibook.server.HtmlRenderer;
import spark.Request;
import spark.Response;
import java.ut... | package nuclibook.routes;
import nuclibook.constants.P;
import nuclibook.entity_utils.ExportUtils;
import nuclibook.entity_utils.PatientUtils;
import nuclibook.entity_utils.SecurityUtils;
import nuclibook.models.Patient;
import nuclibook.server.HtmlRenderer;
import spark.Request;
import spark.Response;
import java.ut... |
Fix displaying legend for fieldset | <?php
namespace Jasny\FormBuilder;
/**
* Representation of an HTML <fieldset>.
*
* @option legend <legend> of the fieldset
*/
class Fieldset extends Group
{
/**
* @var string
*/
protected $tagname = 'fieldset';
/**
* Class constructor.
*
* @param array $options Eleme... | <?php
namespace Jasny\FormBuilder;
/**
* Representation of an HTML <fieldset>.
*
* @option legend <legend> of the fieldset
*/
class Fieldset extends Group
{
/**
* @var string
*/
protected $tagname = 'fieldset';
/**
* Class constructor.
*
* @param array $options Eleme... |
Set min boxCount to be 0
Don’t allow negative. | // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component } from 'react';
import Tiles from 'grommet/components/Tiles';
import Box from 'grommet/components/Box';
import Button from 'grommet/components/Button';
import Animate from 'grommet/components/Animate';
import Example from '.... | // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
import React, { Component } from 'react';
import Tiles from 'grommet/components/Tiles';
import Box from 'grommet/components/Box';
import Button from 'grommet/components/Button';
import Animate from 'grommet/components/Animate';
import Example from '.... |
Fix Guzzle client in DisponsableCheck Test | <?php
/*
* This file is part of EmailChecker.
*
* (c) Corrado Ronci <sorciulus@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace sorciulus\EmailChecker\Tests;
use PHPUnit\Framework\TestCase;
use GuzzleHttp\Cl... | <?php
/*
* This file is part of EmailChecker.
*
* (c) Corrado Ronci <sorciulus@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace sorciulus\EmailChecker\Tests;
use PHPUnit\Framework\TestCase;
use GuzzleHttp\Cl... |
Remove @xstate/vue from the whitelisted automatically publishable packages | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.... | const { exec } = require('@actions/exec');
const getWorkspaces = require('get-workspaces').default;
async function execWithOutput(command, args, options) {
let myOutput = '';
let myError = '';
return {
code: await exec(command, args, {
listeners: {
stdout: data => {
myOutput += data.... |
test(Effects): Fix fade test with RAF
Because of wrong mock implementation | import * as effects from 'src/effects'
/**
* @jest-environment jsdom
*/
jest.useFakeTimers()
describe('Effects', () => {
let element
beforeEach(() => {
element = document.createElement('div')
document.body.appendChild(element)
})
afterEach(() => {
document.body.innerHTML = ''
})
test('Fade in... | import * as effects from 'src/effects'
/**
* @jest-environment jsdom
*/
jest.useFakeTimers()
describe('Effects', () => {
let element
beforeEach(() => {
element = document.createElement('div')
document.body.appendChild(element)
})
afterEach(() => {
document.body.innerHTML = ''
})
test('Fade in... |
Fix package tag in docblock | <?php
namespace DB\Driver;
/**
* Database driver for MYSQL using MYSQLI rather than default and deprecated
* MYSQL which is recommended by most PHP developer.
*
* @package DB\Driver
*/
class MYSQLI implements IDriver
{
private $mysqli;
public function connect($... | <?php
namespace DB\Driver;
/**
* Database driver for MYSQL using MYSQLI rather than default and deprecated
* MYSQL which is recommended by most PHP developer.
*
* @package Core
*/
class MYSQLI implements IDriver
{
private $mysqli;
public function connect($host,... |
Increase gRenderer frame max to 240 | gRenderer = {
frame: 0,
render: function() {
this.context.fillStyle = '#000';
this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);
switch (gScene.scene) {
case 'title':
gScene.renderTitle();
break;
case 'hangar':
case 'game':
... | gRenderer = {
frame: 0,
render: function() {
this.context.fillStyle = '#000';
this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);
switch (gScene.scene) {
case 'title':
gScene.renderTitle();
break;
case 'hangar':
case 'game':
... |
Upgrade orderedmultidict dependency to v0.7.2. | import os
import re
import sys
from sys import version_info
from os.path import dirname, join as pjoin
from setuptools import setup, find_packages
with open(pjoin(dirname(__file__), 'furl', '__init__.py')) as fd:
VERSION = re.compile(
r".*__version__ = '(.*?)'", re.S).match(fd.read()).group(1)
if sys.argv... | import os
import re
import sys
from os.path import dirname, join as pjoin
from sys import version_info
from setuptools import setup, find_packages
with open(pjoin(dirname(__file__), 'furl', '__init__.py')) as fd:
VERSION = re.compile(
r".*__version__ = '(.*?)'", re.S).match(fd.read()).group(1)
if sys.argv... |
Fix url for otalk.im websocket endpoint | var parts = window.location.hash.slice(1).split('&');
parts.forEach(function (value) {
if (value.substr(0, 12) === "access_token") {
var token = value.substr(13);
$.ajax({
type: 'get',
url: 'https://api.andbang.com/me',
dataType: 'json',
headers: {
... | var parts = window.location.hash.slice(1).split('&');
parts.forEach(function (value) {
if (value.substr(0, 12) === "access_token") {
var token = value.substr(13);
$.ajax({
type: 'get',
url: 'https://api.andbang.com/me',
dataType: 'json',
headers: {
... |
Add 'config' option for PhpSpec | <?php
namespace RMiller\BehatSpec;
use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use RMiller\ErrorExtension\ErrorExtension;
use RMiller\PhpSpecExtension\PhpSpecExtension as BehatPhpSpecExtension;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition... | <?php
namespace RMiller\BehatSpec;
use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use RMiller\ErrorExtension\ErrorExtension;
use RMiller\PhpSpecExtension\PhpSpecExtension as BehatPhpSpecExtension;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition... |
[BUGFIX] Check for existance of $releasesList[0] before using | <?php
namespace Deployer;
task('buffer:stop', function () {
$releasesList = get('releases_list');
// Remove lock files also from previous release because it can be still read by apache/nginx after switching.
// get('releases_list') is cached by deployer on first call in other task so it does not have the ... | <?php
namespace Deployer;
task('buffer:stop', function () {
$releasesList = get('releases_list');
// Remove lock files also from previous release because it can be still read by apache/nginx after switching.
// get('releases_list') is cached by deployer on first call in other task so it does not have the ... |
Exclude all except staging and production | const Client = require('../binary/base/client').Client;
const getLanguage = require('../binary/base/language').getLanguage;
const url_for_static = require('../binary/base/url').url_for_static;
const Pushwoosh = require('web-push-notifications').Pushwoosh;
const BinaryPushwoosh = (() => {
const pw =... | const Client = require('../binary/base/client').Client;
const getLanguage = require('../binary/base/language').getLanguage;
const url_for_static = require('../binary/base/url').url_for_static;
const Pushwoosh = require('web-push-notifications').Pushwoosh;
const BinaryPushwoosh = (() => {
const pw =... |
Send back the socket id with the pong message |
var ds = require('./discovery')
var rb = require('./rubygems')
var sc = require('./scrape')
var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({host: 'localhost', port: 3001})
var clients = {}
wss.on('connection', (ws) => {
ws.on('message', (data) => {
var req = JSON.parse(data)
if... |
var ds = require('./discovery')
var rb = require('./rubygems')
var sc = require('./scrape')
var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({host: 'localhost', port: 3001})
var clients = {}
wss.on('connection', (ws) => {
ws.on('message', (data) => {
var req = JSON.parse(data)
if... |
Add node-style-guide to list of rules | 'use babel';
import path from 'path'
export default {
jscsPath: {
title: 'Path to JSCS binary',
type: 'string',
default: path.join(__dirname, '..', 'node_modules', 'jscs', 'bin', 'jscs')
},
jscsConfigPath: {
title: 'Path to custom .jscsrc file',
type: 'string',
default: path.join(__dirna... | 'use babel';
import path from 'path'
export default {
jscsPath: {
title: 'Path to JSCS binary',
type: 'string',
default: path.join(__dirname, '..', 'node_modules', 'jscs', 'bin', 'jscs')
},
jscsConfigPath: {
title: 'Path to custom .jscsrc file',
type: 'string',
default: path.join(__dirna... |
Remove HTML from output() return documentation | <?php
/**
* RocketPHP (http://rocketphp.io)
*
* @package RocketPHP
* @link https://github.com/rocketphp/html
* @license http://opensource.org/licenses/MIT MIT
*/
namespace RocketPHP\HTML;
/**
* Declaration
*
* Creates a declaration node.
*/
class Declaration
extends Node_Abstract
{
/**
*... | <?php
/**
* RocketPHP (http://rocketphp.io)
*
* @package RocketPHP
* @link https://github.com/rocketphp/html
* @license http://opensource.org/licenses/MIT MIT
*/
namespace RocketPHP\HTML;
/**
* Declaration
*
* Creates a declaration node.
*/
class Declaration
extends Node_Abstract
{
/**
*... |
Add unicode to image helpers | <?php
namespace HeyUpdate\EmojiBundle\Twig\Extension;
use HeyUpdate\Emoji\Emoji;
class EmojiExtension extends \Twig_Extension
{
protected $emoji;
public function __construct(Emoji $emoji)
{
$this->emoji = $emoji;
}
/**
* {@inheritdoc}
*/
public function getFunctions()
... | <?php
namespace HeyUpdate\EmojiBundle\Twig\Extension;
use HeyUpdate\Emoji\Emoji;
class EmojiExtension extends \Twig_Extension
{
protected $emoji;
public function __construct(Emoji $emoji)
{
$this->emoji = $emoji;
}
/**
* {@inheritdoc}
*/
public function getFunctions()
... |
Comment out military advisor for now | <div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-group"></i> Consult advisor</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-xs-6 col-sm-3">
<a href="{{ route('dominion.advisors.production') }}" cla... | <div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-group"></i> Consult advisor</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-xs-6 col-sm-3">
<a href="{{ route('dominion.advisors.production') }}" cla... |
Add another configuration array to the orginal | <?php
namespace Vela\Core;
/**
* Config class
*
* Simple class to store or get elements from configuration registry
*/
class Config
{
/** @var array $data Data configuration array */
private $data = [];
/**
* Class constructor
* @param array $data List of values to add to the configuratio... | <?php
namespace Vela\Core;
/**
* Config class
*
* Simple class to store or get elements from configuration registry
*/
class Config
{
/** @var array $data Data configuration array */
private $data = [];
/**
* Class constructor
* @param array $data List of values to add to the configuratio... |
Stop ulmo caching for suds-jurko compliance
Previously we were using ulmo with suds-jurko 0.6, which is
the current latest release, but it is 4 years old. Most recent
work on suds-jurko has been done on the development branch,
including optimizations to memory use (which we need).
Unfortunately, the development branch... | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from datetime import date, timedelta
from rest_framework.exceptions import ValidationError
DATE_FORMAT = '%m/%d/%Y'
def details(wsdl, site):
if not wsdl:
raise Validatio... | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from datetime import date, timedelta
from rest_framework.exceptions import ValidationError
DATE_FORMAT = '%m/%d/%Y'
def details(wsdl, site):
if not wsdl:
raise Validatio... |
Resolve reactive props animation issue.
A small consequence of replacing the entire dataset in the mixins files is that it causes certain charts to completely re-render even if only the 'data' attribute of a dataset is changing. In my case, I set up a reactive doughnut chart with two data points but whenever the data ... | module.exports = {
props: {
chartData: {
required: true
}
},
watch: {
'chartData': {
handler (newData, oldData) {
if (oldData) {
let chart = this._chart
// Get new and old DataSet Labels
let newDatasetLabels = newData.datasets.map((dataset) => {
... | module.exports = {
props: {
chartData: {
required: true
}
},
watch: {
'chartData': {
handler (newData, oldData) {
if (oldData) {
let chart = this._chart
// Get new and old DataSet Labels
let newDatasetLabels = newData.datasets.map((dataset) => {
... |
Fix for ServiceManager's Di Integration's before/after usage
Addition of nested configuration of controllers in ControllerLoader | <?php
namespace Zend\ServiceManager\Di;
use Zend\ServiceManager\AbstractFactoryInterface,
Zend\ServiceManager\ServiceLocatorInterface,
Zend\Di\Di;
class DiAbstractServiceFactory extends DiServiceFactory implements AbstractFactoryInterface
{
/**
* @param \Zend\Di\Di $di
* @param null|string|\Ze... | <?php
namespace Zend\ServiceManager\Di;
use Zend\ServiceManager\AbstractFactoryInterface,
Zend\ServiceManager\ServiceLocatorInterface,
Zend\Di\Di;
class DiAbstractServiceFactory extends DiServiceFactory implements AbstractFactoryInterface
{
/**
* @param \Zend\Di\Di $di
* @param null|string|\Ze... |
fix(app): Fix coverage folder for mocha | 'use strict';
var gulp = require('gulp');
var runSequence = require('run-sequence');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var gutil = require('gulp-util');
var constants = require('../common/constants')();
gulp.task('mocha', 'Runs the mocha tests.', function() {
return gulp.... | 'use strict';
var gulp = require('gulp');
var runSequence = require('run-sequence');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var gutil = require('gulp-util');
var constants = require('../common/constants')();
gulp.task('mocha', 'Runs the mocha tests.', function() {
return gulp.... |
Add system support to export talkgroups | import sys
import datetime
import csv
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import timezone
from radio.models import *
class Command(BaseCommand):
help = 'Import talkgroup info'
def add_arguments(self, parser):
parser.add_... | import sys
import datetime
import csv
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import timezone
from radio.models import *
class Command(BaseCommand):
help = 'Import talkgroup info'
def add_arguments(self, parser):
parser.add_... |
Refresh angular controllers after login | /// <reference path="../Services/AccountService.js" />
(function () {
'use strict';
angular
.module('GVA.Common')
.controller('AccountLoginController', AccountLoginController);
AccountLoginController.$inject = ['$scope', '$rootScope', '$route', 'AccountService'];
function AccountLogi... | /// <reference path="../Services/AccountService.js" />
(function () {
'use strict';
angular
.module('GVA.Common')
.controller('AccountLoginController', AccountLoginController);
AccountLoginController.$inject = ['$scope', '$rootScope', 'AccountService'];
function AccountLoginControlle... |
Update test to use the type of date string we see on Prod | <?php
use Northstar\Models\User;
class StandardizeBirthdatesTest extends TestCase
{
/** @test */
public function it_should_fix_birthdates()
{
// We are creating some bad data on purpose, so don't try to send it to Customer.io
Bus::fake();
// Create some regular and borked birthday... | <?php
use Northstar\Models\User;
class StandardizeBirthdatesTest extends TestCase
{
/** @test */
public function it_should_fix_birthdates()
{
// We are creating some bad data on purpose, so don't try to send it to Customer.io
Bus::fake();
// Create some regular and borked birthday... |
Fix Unit Test according to update on controller.parseMethodName():
* now controller.parseMethodName() receives the method name instead
of the function object. | 'use strict'
const controller = require('./../lib/connectController')
module.exports.testParseMethodNameWithoutParameters = function(test) {
testParseMethodName(
function get_members() {}, // actual
'/members', // expected
test)
}
module.exports.testParseMethodN... | 'use strict'
const controller = require('./../lib/connectController')
module.exports.testParseMethodNameWithoutParameters = function(test) {
testParseMethodName(
function get_members() {}, // actual
'/members', // expected
test)
}
module.exports.testParseMethodN... |
Make location optional in action core | import _ from 'lodash';
const {knex} = require('../util/database').connect();
function createAction(action) {
const dbRow = {
'team_id': knex.raw('(SELECT team_id from users WHERE uuid = ?)', [action.user]),
'action_type_id': knex.raw('(SELECT id from action_types WHERE code = ?)', [action.type]),
'user_... | import _ from 'lodash';
const {knex} = require('../util/database').connect();
function createAction(action) {
const dbRow = {
'team_id': knex.raw('(SELECT team_id from users WHERE uuid = ?)', [action.user]),
'action_type_id': knex.raw('(SELECT id from action_types WHERE code = ?)', [action.type]),
'user_... |
Rename to follow constant naming conventions | import re
class Phage:
SUPPORTED_DATABASES = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | import re
class Phage:
supported_databases = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... |
Change split file lines by line | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Rodrigo Ramírez Norambuena <a@rodrigoramirez.com>
#
# Parse queue_log Asterisk file and add records into database.
#
from libs.qpanel import model
import click
import sys
@click.command()
@click.option('--file', default='/var/log/asterisk/queue_log',
... |
Remove duplicated DNA Sample Change from admin | <?php
return array(
'import' => array(
'application.modules.Genetics.models.*',
'application.modules.Genetics.components.*',
),
'params' => array(
'menu_bar_items' => array(
'pedigrees' => array(
'title' => 'Genetics',
'uri' => 'Genetics/d... | <?php
return array(
'import' => array(
'application.modules.Genetics.models.*',
'application.modules.Genetics.components.*',
),
'params' => array(
'menu_bar_items' => array(
'pedigrees' => array(
'title' => 'Genetics',
'uri' => 'Genetics/d... |
Add access phpDocumentor tag to _output | <?php
/**
* RocketPHP (http://rocketphp.io)
*
* @package RocketPHP
* @link https://github.com/rocketphp/html
* @license http://opensource.org/licenses/MIT MIT
*/
namespace RocketPHP\HTML;
/**
* Declaration
*
* Creates a declaration node.
*/
class Declaration
extends Node_Abstract
{
/**
*... | <?php
/**
* RocketPHP (http://rocketphp.io)
*
* @package RocketPHP
* @link https://github.com/rocketphp/html
* @license http://opensource.org/licenses/MIT MIT
*/
namespace RocketPHP\HTML;
/**
* Declaration
*
* Creates a declaration node.
*/
class Declaration
extends Node_Abstract
{
/**
*... |
Clean up some of our dashboard container imports | from tg import config
from tw.api import Widget
from moksha.lib.helpers import eval_app_config, ConfigWrapper
class AppListWidget(Widget):
template = 'mako:moksha.api.widgets.containers.templates.layout_applist'
properties = ['category']
def update_params(self, d):
super(AppListWidget, self).upda... | from moksha.api.widgets.layout.layout import layout_js, layout_css, ui_core_js, ui_draggable_js, ui_droppable_js, ui_sortable_js
from tw.api import Widget
from tw.jquery import jquery_js
from moksha.lib.helpers import eval_app_config, ConfigWrapper
from tg import config
class AppListWidget(Widget):
template = 'ma... |
Drop unnecessary reference to popped elements to allow finalization through GC (XSTR-264). | package com.thoughtworks.xstream.core.util;
public final class FastStack {
private Object[] stack;
private int pointer;
public FastStack(int initialCapacity) {
stack = new Object[initialCapacity];
}
public Object push(Object value) {
if (pointer + 1 >= stack.length) {
... | package com.thoughtworks.xstream.core.util;
public final class FastStack {
private Object[] stack;
private int pointer;
public FastStack(int initialCapacity) {
stack = new Object[initialCapacity];
}
public Object push(Object value) {
if (pointer + 1 >= stack.length) {
... |
Update to where link is clickable in javadocs | package com.github.aurae.retrofit2;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import static com.bluelinelabs.logansquare.ConverterUtils.isSupported;
/**
* A {@linkplain Conv... | package com.github.aurae.retrofit2;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import static com.bluelinelabs.logansquare.ConverterUtils.isSupported;
/**
* A {@linkplain Conv... |
Make incorrect signup error more helpful | angular.module('bolt.auth', [])
.controller('AuthController', function ($scope, $window, $location, Auth) {
$scope.user = {};
$scope.signin = function () {
Auth.signin($scope.user)
.then(function (session) {
$window.localStorage.setItem('com.bolt', session.token);
$window.localStorage.se... | angular.module('bolt.auth', [])
.controller('AuthController', function ($scope, $window, $location, Auth) {
$scope.user = {};
$scope.signin = function () {
Auth.signin($scope.user)
.then(function (session) {
$window.localStorage.setItem('com.bolt', session.token);
$window.localStorage.se... |
Make the ScopeExtractorProcessor usable for the Primary Identifier
This patch adds support to use the ScopeExtractorProcessor on the Primary
Identifiert which is, in contrast to the other values, a string.
Closes #348 | from ..attribute_processor import AttributeProcessorError, AttributeProcessorWarning
from .base_processor import BaseProcessor
CONFIG_KEY_MAPPEDATTRIBUTE = 'mapped_attribute'
CONFIG_DEFAULT_MAPPEDATTRIBUTE = ''
class ScopeExtractorProcessor(BaseProcessor):
"""
Extracts the scope from a scoped attribute and ... | from ..attribute_processor import AttributeProcessorError, AttributeProcessorWarning
from .base_processor import BaseProcessor
CONFIG_KEY_MAPPEDATTRIBUTE = 'mapped_attribute'
CONFIG_DEFAULT_MAPPEDATTRIBUTE = ''
class ScopeExtractorProcessor(BaseProcessor):
"""
Extracts the scope from a scoped attribute and ... |
Update error message with error warning | import os.path
import os
import shutil
from dbt.task.base import ProjectOnlyTask
from dbt.logger import GLOBAL_LOGGER as logger
class CleanTask(ProjectOnlyTask):
def __is_project_path(self, path):
proj_path = os.path.abspath('.')
return not os.path.commonprefix(
[proj_path, os.path.a... | import os.path
import os
import shutil
from dbt.task.base import ProjectOnlyTask
from dbt.logger import GLOBAL_LOGGER as logger
class CleanTask(ProjectOnlyTask):
def __is_project_path(self, path):
proj_path = os.path.abspath('.')
return not os.path.commonprefix(
[proj_path, os.path.a... |
Fix strange wording in version check docstring. | from __future__ import absolute_import
import warnings
from collections import namedtuple
from sentry.exceptions import InvalidConfiguration
class Version(namedtuple('Version', 'major minor patch')):
def __str__(self):
return '.'.join(map(str, self))
def make_upgrade_message(service, modality, version... | from __future__ import absolute_import
import warnings
from collections import namedtuple
from sentry.exceptions import InvalidConfiguration
class Version(namedtuple('Version', 'major minor patch')):
def __str__(self):
return '.'.join(map(str, self))
def make_upgrade_message(service, modality, version... |
Use assert.ok() instead of assert.equals() | var assert = require('assert');
describe('linter', function () {
var linter = require('../../lib/linter');
describe('lint', function () {
it('should return array of errors', function () {
var source = '.foo{ color:red; }';
var path = 'test.less';
var actual;
... | var assert = require('assert');
describe('linter', function () {
var linter = require('../../lib/linter');
describe('lint', function () {
it('should return array of errors', function () {
var source = '.foo{ color:red; }';
var path = 'test.less';
var actual;
... |
Return results as a generator, not in a file. | """Get secondary structure with DSSP."""
from __future__ import print_function, absolute_import
import optparse
import subprocess
def check_output(args, stderr=None, retcode=0, input=None, *other):
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr,
stdin=subprocess.PIPE if ... | """Get secondary structure with DSSP."""
from __future__ import print_function, absolute_import
import optparse
import subprocess
def check_output(args, stderr=None, retcode=0, input=None, *other):
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr,
stdin=subprocess.PIPE if ... |
Add bottom margin to header in account > general | /**
*
*
* @copyright 2017 Government of Canada
* @license MIT
* @author igboyes
*
*/
import React from "react";
import { capitalize } from "lodash";
import { connect } from "react-redux";
import { Label } from "react-bootstrap";
import { Flex, FlexItem } from "../../base";
import ChangePassword from "./Password... | /**
*
*
* @copyright 2017 Government of Canada
* @license MIT
* @author igboyes
*
*/
import React from "react";
import { capitalize } from "lodash";
import { connect } from "react-redux";
import { Label } from "react-bootstrap";
import { Flex, FlexItem } from "../../base";
import ChangePassword from "./Password... |
Fix some command line options parsing | <?php
namespace CodeTool\ArtifactDownloader\UnitConfig;
use CodeTool\ArtifactDownloader\EtcdClient\EtcdClient;
class UnitConfig implements UnitConfigInterface
{
private function getOptOrEnvOrDefault($optName, $env, $default)
{
$opt = getopt('', [$optName . '::']);
if (false !== $opt && array_... | <?php
namespace CodeTool\ArtifactDownloader\UnitConfig;
use CodeTool\ArtifactDownloader\EtcdClient\EtcdClient;
class UnitConfig implements UnitConfigInterface
{
private function getOptOrEnvOrDefault($optName, $env, $default)
{
$opt = getopt('', [$optName . '::']);
if (false !== $opt && array_... |
Fix logic in path search. | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
glo... | import os
import sys
import glob
import email
import itertools
import contextlib
class Distribution:
def __init__(self, path):
"""
Construct a distribution from a path to the metadata dir
"""
self.path = path
@classmethod
def for_name(cls, name, path=sys.path):
for... |
Remove button on mobile to show static image
Static images are replaced with chart
Commented out as temp measure | $(function() {
// if on mobile inject overlay and button elements
/*
if ($("body").hasClass("viewport-xs")) {
var markdownChart = $('.markdown-chart');
// remove button on mobile to show static image
if (markdownChart.length) {
$('<div class="markdown-chart-overlay">... | $(function() {
// if on mobile inject overlay and button elements
if ($("body").hasClass("viewport-xs")) {
var markdownChart = $('.markdown-chart');
if (markdownChart.length) {
$('<div class="markdown-chart-overlay"></div>').insertAfter($('.markdown-chart'));
$('<but... |
Fix value/name ambiguity in ThingDefinition | from thinglang.lexer.symbols import LexicalGroupEnd
from thinglang.lexer.symbols.base import LexicalIdentifier
from thinglang.lexer.symbols.functions import LexicalDeclarationConstructor
from thinglang.parser.tokens import DefinitionPairToken, BaseToken
from thinglang.parser.tokens.functions import ArgumentList
class... | from thinglang.lexer.symbols import LexicalGroupEnd
from thinglang.lexer.symbols.base import LexicalIdentifier
from thinglang.lexer.symbols.functions import LexicalDeclarationConstructor
from thinglang.parser.tokens import DefinitionPairToken, BaseToken
from thinglang.parser.tokens.functions import ArgumentList
class... |
Revert "Make service provider deferred"
This reverts commit 3918b0c987b4545c414eba988b66dba1d1de5e57.
Service providers with a boot method cannot be deferred! It's a mystery
to me that this worked in Laravel 5.1.
This fixes #50 but intentionally regresses #18. I don't think there's
any way to make this service defer... | <?php namespace Felixkiss\UniqueWithValidator;
use Illuminate\Support\ServiceProvider;
class UniqueWithValidatorServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the applica... | <?php namespace Felixkiss\UniqueWithValidator;
use Illuminate\Support\ServiceProvider;
class UniqueWithValidatorServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Bootstrap the applicat... |
Fix minor spelling error in cubeupload test | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
import hashlib
import unittest
from harvester import harvester
class CubeuploadTest(unittest.TestCase):
def setUp(self):
self.nick = "test"
self.chan = '#brotherBot'
self.mask = "brotherBox!~brotherBo@unaffiliated/brotherbox"
self.h ... | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
import hashlib
import unittest
from harvester import harvester
class CupeuploadTest(unittest.TestCase):
def setUp(self):
self.nick = "test"
self.chan = '#brotherBot'
self.mask = "brotherBox!~brotherBo@unaffiliated/brotherbox"
self.h ... |
Change method argument type (entity -> interface) | <?php
namespace Wizin\Bundle\SimpleCmsBundle\Repository;
use Doctrine\ORM\EntityRepository;
use Wizin\Bundle\SimpleCmsBundle\Entity\ContentInterface;
/**
* ContentRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ContentRepository extends Entit... | <?php
namespace Wizin\Bundle\SimpleCmsBundle\Repository;
use Doctrine\ORM\EntityRepository;
use Wizin\Bundle\SimpleCmsBundle\Entity\Content;
/**
* ContentRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ContentRepository extends EntityReposito... |
Change admin middleware to reflect 5.3 changes
Generated resource route for groupController now calls the variable group, not groupId | <?php namespace JamylBot\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use JamylBot\Group;
class MustBeAdmin {
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
*/
... | <?php namespace JamylBot\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use JamylBot\Group;
class MustBeAdmin {
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
*/
... |
Add support of node >=6 grunt tasks | 'use strict';
var helper = require('../helper');
/**
* Defines all linting task.
*
* @function
* @memberof! GruntLint
* @private
* @param {Object} grunt - The grunt instance
* @returns {Object} Grunt config object
*/
module.exports = function (grunt) {
grunt.registerTask('lint', 'Linting tasks.', [
... | 'use strict';
var helper = require('../helper');
/**
* Defines all linting task.
*
* @function
* @memberof! GruntLint
* @private
* @param {Object} grunt - The grunt instance
* @returns {Object} Grunt config object
*/
module.exports = function (grunt) {
grunt.registerTask('lint', 'Linting tasks.', [
... |
Exit /search if no area of interest
Previously we would query APIs with the bounding box of the
entire map in view. Now as we prepare to switch to searching
for the area of interest only, we disable being able to come
to this page without an area of interest drawn already. | "use strict";
var App = require('../app'),
router = require('../router').router,
coreUtils = require('../core/utils'),
models = require('./models'),
views = require('./views');
var DataCatalogController = {
dataCatalogPrepare: function() {
if (!App.map.get('areaOfInterest')) {
... | "use strict";
var App = require('../app'),
coreUtils = require('../core/utils'),
models = require('./models'),
views = require('./views');
var DataCatalogController = {
dataCatalog: function() {
App.map.setDataCatalogSize();
App.state.set({
'active_page': coreUtils.dataCat... |
Set codemirror size when opening modal. | "use strict";
jsns.run([
"htmlrest.domquery",
"htmlrest.storage",
"htmlrest.rest",
"htmlrest.controller",
"htmlrest.widgets.navmenu",
"edity.pageSourceSync"
],
function (exports, module, domQuery, storage, rest, controller, navmenu, sourceSync) {
function EditSourceController(bindings) {
... | "use strict";
jsns.run([
"htmlrest.domquery",
"htmlrest.storage",
"htmlrest.rest",
"htmlrest.controller",
"htmlrest.widgets.navmenu",
"edity.pageSourceSync"
],
function (exports, module, domQuery, storage, rest, controller, navmenu, sourceSync) {
function EditSourceController(bindings) {
... |
Mark apple receipt expiration time as read only. | import hashlib
import logging
from django.utils.translation import ugettext
from rest_framework import serializers
from know_me import models, subscriptions
logger = logging.getLogger(__name__)
class AppleSubscriptionSerializer(serializers.ModelSerializer):
"""
Serializer for an Apple subscription.
""... | import hashlib
import logging
from django.utils.translation import ugettext
from rest_framework import serializers
from know_me import models, subscriptions
logger = logging.getLogger(__name__)
class AppleSubscriptionSerializer(serializers.ModelSerializer):
"""
Serializer for an Apple subscription.
""... |
Remove check for Java version. | package ch.ethz.scu.obit.at;
import javax.swing.JOptionPane;
import ch.ethz.scu.obit.at.gui.AnnotationToolWindow;
import ch.ethz.scu.obit.common.settings.GlobalSettingsManager;
/**
* AnnotationTool is an application to drive the import of data from the
* acquisition stations into openBIS.
* @author Aaron Ponti
... | package ch.ethz.scu.obit.at;
import java.lang.management.ManagementFactory;
import javax.swing.JOptionPane;
import ch.ethz.scu.obit.at.gui.AnnotationToolWindow;
import ch.ethz.scu.obit.common.settings.GlobalSettingsManager;
/**
* AnnotationTool is an application to drive the import of data from the
* acquisition... |
Return promise instead of full deferred | <?php
namespace React\Whois;
use Promise\Deferred as Deferred;
use React\Curry\Util as Curry;
use React\Dns\Resolver\Resolver;
class Client
{
private $dns;
private $connFactory;
public function __construct(Resolver $dns, $connFactory)
{
$this->dns = $dns;
$this->connFactory = $connFa... | <?php
namespace React\Whois;
use Promise\Deferred as Deferred;
use React\Curry\Util as Curry;
use React\Dns\Resolver\Resolver;
class Client
{
private $dns;
private $connFactory;
public function __construct(Resolver $dns, $connFactory)
{
$this->dns = $dns;
$this->connFactory = $connFa... |
Use correct db settings in populate job postings | var config = require('../../app/config')
, models = require('../../app/models')
, logger = require('../../app/logger');
var mongoose = require('mongoose'),
fs = require('fs');
/**
* Setup database
*/
var dbSettings = config.dbSettings;
var db = mongoose.createConnection(dbSettings.host
... | var config = require('../../app/config')
, models = require('../../app/models')
, logger = require('../../app/logger');
var mongoose = require('mongoose'),
fs = require('fs');
/**
* Setup database
*/
var dbSettings = config.dbSettings;
var dbTestSettings = config.dbTestSettings;
var db = mongoose.creat... |
Fix to a problem with a rule detected implementing the tests | /**
* Tries to detect RegExp's created from non-literal strings.
* @author Jon Lamendola
*/
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
... | /**
* Tries to detect RegExp's created from non-literal strings.
* @author Jon Lamendola
*/
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
... |
Remove redundant property in web pack config | var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'cheap-eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./example/index... | var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'cheap-eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./example/index... |
Use with handler to safely close the server socket and connection | import threading
import socket
NODE_RED_SERVER_PORT = 4445
NODE_RED_CLIENT_PORT = 4444
class NodeRedDoorbellServerThread(threading.Thread):
"""
Get doorbell triggers from NodeRed.
"""
def __init__(self, intercom):
super(NodeRedDoorbellServerThread, self).__init__()
self.intercom = inte... | import threading
import socket
NODE_RED_SERVER_PORT = 4445
NODE_RED_CLIENT_PORT = 4444
class NodeRedDoorbellServerThread(threading.Thread):
"""
Get doorbell triggers from NodeRed.
"""
def __init__(self, intercom):
super(NodeRedDoorbellServerThread, self).__init__()
self.intercom = inte... |
Allow back None as identifier | from tornadowebapi.traitlets import HasTraits
class Resource(HasTraits):
"""A model representing a resource in our system.
Must be reimplemented for the specific resource in our domain,
as well as specifying its properties with traitlets.
The following metadata in the specified traitlets are accepted... | from tornadowebapi.traitlets import HasTraits
class Resource(HasTraits):
"""A model representing a resource in our system.
Must be reimplemented for the specific resource in our domain,
as well as specifying its properties with traitlets.
The following metadata in the specified traitlets are accepted... |
Use ProfileResponse instead of Response | <?php namespace Omnipay\Beanstream\Message;
abstract class AbstractProfileRequest extends AbstractRequest
{
protected $endpoint = 'https://www.beanstream.com/api/v1/profiles';
public function getProfileId()
{
return $this->getParameter('profile_id');
}
public function setProfileId($value)... | <?php namespace Omnipay\Beanstream\Message;
abstract class AbstractProfileRequest extends AbstractRequest
{
protected $endpoint = 'https://www.beanstream.com/api/v1/profiles';
public function getProfileId()
{
return $this->getParameter('profile_id');
}
public function setProfileId($value)... |
Add processcalaccessdata to update routine | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Update to the latest CAL-ACCESS snapshot and bake static website pages.
"""
import logging
from django.core.management import call_command
from calaccess_raw.management.commands.updatecalaccessrawdata import Command as updatecommand
logger = logging.getLogger(__name__)
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Update to the latest CAL-ACCESS snapshot and bake static website pages.
"""
import logging
from django.core.management import call_command
from calaccess_raw.management.commands.updatecalaccessrawdata import Command as updatecommand
logger = logging.getLogger(__name__)
... |
Add a "valid shipping address check" to account for VAT discrepancies
If we get a phone number and a city/country combination that yield
incompatible VAT results, we need to flag this to the user. The best
place to do this is, ironically, the shipping address check. | from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from oscar.apps.checkout import session, exceptions
from oscar_vat_moss import vat
class CheckoutSessionMixin(session.CheckoutSessionMixin):
def build_submission(self, **kwargs):
submission = super(Checko... | from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from oscar.apps.checkout import session, exceptions
from oscar_vat_moss import vat
class CheckoutSessionMixin(session.CheckoutSessionMixin):
def build_submission(self, **kwargs):
submission = super(Checko... |
Add request invalidation, receivedAt to board reducer | import initialState from './initialState';
import {
BOARD_REQUESTED,
BOARD_LOADED,
BOARD_DESTROYED,
BOARD_SCROLLED_BOTTOM,
BOARD_FILTER,
BOARD_INVALIDATED
} from '../constants'
export default function (state = initialState.board, action) {
switch (action.type) {
case BOARD_REQU... | import initialState from './initialState';
import {
BOARD_REQUESTED,
BOARD_LOADED,
BOARD_DESTROYED,
BOARD_SCROLLED_BOTTOM,
BOARD_FILTER
} from '../constants'
export default function (state = initialState.board, action) {
switch (action.type) {
case BOARD_REQUESTED:
retu... |
Fix failure with Symfony 2.8 | <?php
declare(strict_types=1);
namespace Paraunit\Process;
use Paraunit\Configuration\EnvVariables;
use Paraunit\Configuration\PHPUnitConfig;
use Paraunit\Configuration\TempFilenameFactory;
use Symfony\Component\Process\Process;
/**
* Class ProcessFactory
* @package Paraunit\Process
*/
class ProcessFactory
{
... | <?php
declare(strict_types=1);
namespace Paraunit\Process;
use Paraunit\Configuration\EnvVariables;
use Paraunit\Configuration\PHPUnitConfig;
use Paraunit\Configuration\TempFilenameFactory;
use Symfony\Component\Process\Process;
/**
* Class ProcessFactory
* @package Paraunit\Process
*/
class ProcessFactory
{
... |
Add vimeo as className in FeedTypeAdmin.php | <?php
namespace Protalk\AdminBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
class FeedtypeAdmin extends Admin
{
/**
* Default Datagrid values
*
* @var array
*... | <?php
namespace Protalk\AdminBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
class FeedtypeAdmin extends Admin
{
/**
* Default Datagrid values
*
* @var array
*... |
Fix the expected argument check in scoring tests | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... | #!@PYTHON_EXECUTABLE@
#ckwg +5
# Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
# KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
# Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
def test_import():
try:
import vistk.pipeline_util.bake
except... |
Use the readline module to allow arrow key movement in the REPL | #!/usr/bin/env python3
import sys
import readline
import lexer as l
import parser as p
import evaluator as e
import context as c
import object as o
def main():
if len(sys.argv) == 1:
ctx = c.Context()
while True:
try:
string = input("⧫... | #!/usr/bin/env python3
import sys
import lexer as l
import parser as p
import evaluator as e
import context as c
import object as o
def main():
if len(sys.argv) == 1:
ctx = c.Context()
while True:
try:
string = input("⧫ ") + ";"
... |
Make the endpoint return geojson as opposed to wkt geometry | import requests
from shapely.wkt import loads
from shapely.geometry import mapping
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET',... | import requests
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET', (), self.geocode)
self.route('GET', ('autocomplete',), sel... |
Allow empty values for select box | <?php
namespace asdfstudio\admin\forms\widgets;
use asdfstudio\admin\components\AdminFormatter;
use Yii;
use yii\base\InvalidConfigException;
use yii\db\ActiveQuery;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use asdfstudio\admin\helpers\AdminHelper;
/**
* Class Select
* @package asdfstudio\admin\widgets
... | <?php
namespace asdfstudio\admin\forms\widgets;
use Yii;
use yii\base\InvalidConfigException;
use yii\db\ActiveQuery;
use yii\helpers\Html;
use asdfstudio\admin\helpers\AdminHelper;
/**
* Class Select
* @package asdfstudio\admin\widgets
*
* Renders active select widget with related models
*/
class Select extend... |
Replace URL instead of pushing the new one. | define([
'underscore',
'views/proto/paged-collection',
'views/event/box',
'text!templates/event-collection.html'
], function (_, PagedCollection, EventBox, html) {
return PagedCollection.extend({
template: _.template(html),
tag: 'div',
listSelector: '.events-list',
... | define([
'underscore',
'views/proto/paged-collection',
'views/event/box',
'text!templates/event-collection.html'
], function (_, PagedCollection, EventBox, html) {
return PagedCollection.extend({
template: _.template(html),
tag: 'div',
listSelector: '.events-list',
... |
Update requirements to include networkx | from setuptools import setup
def readme():
with open('README.rst') as readme_file:
return readme_file.read()
configuration = {
'name' : 'hypergraph',
'version' : '0.1',
'description' : 'Hypergraph tools and algorithms',
'long_description' : readme(),
'classifiers' : [
'Developm... | from setuptools import setup
def readme():
with open('README.rst') as readme_file:
return readme_file.read()
configuration = {
'name' : 'hypergraph',
'version' : '0.1',
'description' : 'Hypergraph tools and algorithms',
'long_description' : readme(),
'classifiers' : [
'Developm... |
Revert "No support for update in pre"
This reverts commit 20eb9908eff6fa7f2eb254d225a3e4f4bdc0c8a4. | var Schema = require('mongoose').Schema;
module.exports = function (schema, options) {
schema.add({ deleted: Boolean });
if (options && options.deletedAt === true) {
schema.add({ deletedAt: { type: Date} });
}
if (options && options.deletedBy === true) {
schema.add({ deletedBy: Schema... | var Schema = require('mongoose').Schema;
module.exports = function (schema, options) {
schema.add({ deleted: Boolean });
if (options && options.deletedAt === true) {
schema.add({ deletedAt: { type: Date} });
}
if (options && options.deletedBy === true) {
schema.add({ deletedBy: Schema... |
Add python_requires to help pip | from setuptools import setup
import sys
import piexif
sys.path.append('./piexif')
sys.path.append('./tests')
with open("README.rst", "r") as f:
description = f.read()
setup(
name = "piexif",
version = piexif.VERSION,
author = "hMatoba",
author_email = "hiroaki.mtb@outlook.com",
description ... | from setuptools import setup
import sys
import piexif
sys.path.append('./piexif')
sys.path.append('./tests')
with open("README.rst", "r") as f:
description = f.read()
setup(
name = "piexif",
version = piexif.VERSION,
author = "hMatoba",
author_email = "hiroaki.mtb@outlook.com",
description ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.