text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
[Test] Fix unit test following merge of maintenance/1.2.0 changes. | /* ============================================================================
Copyright (C) 2006-2016 Talend Inc. - www.talend.com
This source code is available under agreement available at
https://github.com/Talend/data-prep/blob/master/LICENSE
You should have received a copy of the agreement
along with thi... | /* ============================================================================
Copyright (C) 2006-2016 Talend Inc. - www.talend.com
This source code is available under agreement available at
https://github.com/Talend/data-prep/blob/master/LICENSE
You should have received a copy of the agreement
along with thi... |
Make non-link ColumnLinks behave as links | import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
const ColumnLink = ({ icon, text, to, onClick, href, method, badge }) => {
const badgeElement = typeof badge !== 'undefined' ? <span className='column-link__badge'>{badge}</span> : null;
if (href) {
return ... | import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
const ColumnLink = ({ icon, text, to, onClick, href, method, badge }) => {
const badgeElement = typeof badge !== 'undefined' ? <span className='column-link__badge'>{badge}</span> : null;
if (href) {
return ... |
Add 'og' before last element in location list. | class Job extends React.Component {
constructor() {
super();
}
render() {
let data = this.props.jobData;
let locations = data.location.map((location) => location.name);
if (locations.length >= 2) {
locations = `${locations.slice(0, -1).join(', ')} and ${locations[locations.length - 1]}`;
... | class Job extends React.Component {
constructor() {
super();
}
render() {
let data = this.props.jobData;
return (
<article className="row">
<div className="col-xs-12 col-md-4">
<a href="/careeropportunity/4/">
<picture>
<source srcset={data.company.i... |
Set mEnabled using site property. | package alluxio.master.audit;
import alluxio.Configuration;
import alluxio.PropertyKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ArrayBlockingQueue;
import javax.annotation.concurrent.ThreadSafe;
@ThreadSafe
public final class AsyncUserAccessAuditLogWriter {
private sta... | package alluxio.master.audit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ArrayBlockingQueue;
import javax.annotation.concurrent.ThreadSafe;
@ThreadSafe
public final class AsyncUserAccessAuditLogWriter {
private static final int QUEUE_SIZE = 10000;
private static final Lo... |
Fix bug with Overleaf commits swapping name and email. | package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers;
import uk.ac.ic.wlgitbridge.util.Util;
/**
* Created by Winston on 06/11/14.
*/
public class SnapshotInfo implements Comparable<SnapshotInfo> {
private int versionId;
private String comment;
private WLUser user;
private String create... | package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers;
import uk.ac.ic.wlgitbridge.util.Util;
/**
* Created by Winston on 06/11/14.
*/
public class SnapshotInfo implements Comparable<SnapshotInfo> {
private int versionId;
private String comment;
private WLUser user;
private String create... |
Clean exit from the command line client
- 'bye' keyword exits the client | package net.bourgau.philippe.concurrency.kata;
import java.util.Scanner;
public class Client implements Broadcast {
private final ChatRoom chatRoom;
private final String name;
private final Output out;
public Client(String name, ChatRoom chatRoom, Output out) {
this.chatRoom = chatRoom;
... | package net.bourgau.philippe.concurrency.kata;
import java.util.Scanner;
public class Client implements Broadcast {
private final ChatRoom chatRoom;
private final String name;
private final Output out;
public Client(String name, ChatRoom chatRoom, Output out) {
this.chatRoom = chatRoom;
... |
Add support for weekend animations | from control_milight.models import LightAutomation
from control_milight.views import update_lightstate
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import now
from ledcontroller import LedController
import datetime
import redis
class Com... | from control_milight.models import LightAutomation
from control_milight.views import update_lightstate
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import now
from ledcontroller import LedController
import datetime
import redis
class Com... |
Add sensible defaults for ElasticSearch settings | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
ELASTICSEARCH_HOST = 'localhost'
ELASTICSEARCH_TIMEOUT = 2
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS ... | MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'pupa'
SCRAPELIB_RPM = 60
SCRAPELIB_TIMEOUT = 60
SCRAPELIB_RETRY_ATTEMPTS = 3
SCRAPELIB_RETRY_WAIT_SECONDS = 20
ENABLE_ELASTICSEARCH = False
BILL_FILTERS = {}
LEGISLATOR_FILTERS = {}
EVENT_FILTERS = {}
LOGGING_CONFIG = {
'version': 1,
'disable_exi... |
Test commit to see if a failing unit test breaks the build | 'use strict';
describe('loginController tests', function () {
var scope, ctrl, authServices, location;
function authServicesMock() {
var mock = {
succeed: true
};
mock.login = function() {
return {
then: function(r, e) {
if (... | 'use strict';
describe('loginController tests', function () {
var scope, ctrl, authServices, location;
function authServicesMock() {
var mock = {
succeed: true
};
mock.login = function() {
return {
then: function(r, e) {
if (... |
Fix charts() test (now there are only 174 charts) | # -*- coding: utf-8 -*-
import billboard
import unittest
from nose.tools import raises
from requests.exceptions import ConnectionError
import six
class MiscTest(unittest.TestCase):
@raises(ConnectionError)
def testTimeout(self):
"""Checks that using a very small timeout prevents connection."""
... | # -*- coding: utf-8 -*-
import billboard
import unittest
from nose.tools import raises
from requests.exceptions import ConnectionError
import six
class MiscTest(unittest.TestCase):
@raises(ConnectionError)
def testTimeout(self):
"""Checks that using a very small timeout prevents connection."""
... |
Add semi-compatibility with Java 9+ | package xyz.upperlevel.uppercore.util;
import java.io.File;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
public final class ExternalJarUtil {
private static ... | package xyz.upperlevel.uppercore.util;
import java.io.File;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
public final class ExternalJarUtil {
private static ... |
Add more data to the api | from rest_framework import serializers
from frigg.projects.models import Project
from .models import Build, BuildResult
class ProjectInlineSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields = (
'id',
'owner',
'name',
'priv... | from rest_framework import serializers
from frigg.projects.models import Project
from .models import Build, BuildResult
class ProjectInlineSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields = (
'id',
'owner',
'name',
'priv... |
Move Django out of `install_requires` to to `requires` block. | #!/usr/bin/env python
from setuptools import setup, find_packages
from os.path import dirname, join
import sys, os
# When creating the sdist, make sure the django.mo file also exists:
if 'sdist' in sys.argv:
try:
os.chdir('fluent_comments')
from django.core.management.commands.compilemessages impor... | #!/usr/bin/env python
from setuptools import setup, find_packages
from os.path import dirname, join
import sys, os
# When creating the sdist, make sure the django.mo file also exists:
if 'sdist' in sys.argv:
try:
os.chdir('fluent_comments')
from django.core.management.commands.compilemessages impor... |
Fix reload command for projects where each chrom is in a different vcf | from django.core.management.base import BaseCommand
from xbrowse_server import xbrowse_controls
from xbrowse_server.base.models import Project
from xbrowse_server.mall import get_datastore
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('args', nargs='*')
parser.... | from django.core.management.base import BaseCommand
from xbrowse_server import xbrowse_controls
from xbrowse_server.base.models import Project
from xbrowse_server.mall import get_datastore
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('args', nargs='*')
parser.... |
Use map to loop instead of mapping a list | from nltk.sentiment.util import mark_negation
from nltk.util import trigrams
import re
import validators
from .happy_tokenizer import Tokenizer
class SentimentTokenizer(object):
def __init__(self):
self.tknzr = Tokenizer()
@staticmethod
def reduce_lengthening(text):
"""
Replace re... | from nltk.sentiment.util import mark_negation
from nltk.util import trigrams
import re
import validators
from .happy_tokenizer import Tokenizer
class SentimentTokenizer(object):
def __init__(self):
self.tknzr = Tokenizer()
@staticmethod
def reduce_lengthening(text):
"""
Replace re... |
Test JSON mime type correctly | <?php
/**
* Get information about QGIS Server.
*
* @author 3liz
* @copyright 2012 3liz
*
* @see http://3liz.com
*
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/
class qgisServer
{
// QGIS Server version
public $qgisServerVersion;
// List of activated server plugins
... | <?php
/**
* Get information about QGIS Server.
*
* @author 3liz
* @copyright 2012 3liz
*
* @see http://3liz.com
*
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/
class qgisServer
{
// QGIS Server version
public $qgisServerVersion;
// List of activated server plugins
... |
Add feature vector size calculation method to mapper interface | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... | import math
import numpy
class FeatureMapper(object):
def __init__(self, features):
self.features = features
def map(self, fv):
raise NotImplementedError
def __call__(self, doc):
for chain in doc.chains:
for c in chain.candidates:
c.fv = self.map(nu... |
[feat]: Add placeholder text to resumer header | import React, {PropTypes} from 'react';
import Paper from 'material-ui/lib/paper';
export default class ResumeHeader extends React.Component {
static propTypes = {
body: PropTypes.string
}
static contextTypes = {
store: React.PropTypes.object
}
render() {
const userInput = this.context.store.ge... | import React, {PropTypes} from 'react';
import Paper from 'material-ui/lib/paper';
export default class ResumeHeader extends React.Component {
static propTypes = {
body: PropTypes.string
}
static contextTypes = {
store: React.PropTypes.object
}
render() {
const userInput = this.context.store.ge... |
Fix version list validation check.
[#152092418] | import subprocess
from command import Command
from list_versions_command import ListVersionsCommand
from ..git_tools import git_base_command
class UpdateSoftwareCommand(Command):
def __init__(self, flow, cmd_name, params):
Command.__init__(self, flow, cmd_name, params)
de... | import subprocess
from command import Command
from . import ListVersionsCommand
from ..git_tools import git_base_command
class UpdateSoftwareCommand(Command):
def __init__(self, flow, cmd_name, params):
Command.__init__(self, flow, cmd_name, params)
def exec_impl(self):
... |
Stop watching movies while editing code! | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import jsonify
from flask import current_app
from influxdb import InfluxDBClient
from app.base import ApiResource
class InfluxResource(ApiResource):
endpoint = 'influxdb'
url_prefix = '/influxdb'
url_rules = {
'index': {
'rule... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from flask import jsonify
from flask import current_app
from influxdb import InfluxDBClient
from app.base import ApiResource
class InfluxResource(ApiResource):
endpoint = 'influxdb'
url_prefix = '/influxdb'
url_rules = {
'index': {
'rule... |
Fix typo error.
Typo on copyright comment. | <?php
/**
* This file is part of the Bruery Platform.
*
* (c) Viktore Zara <viktore.zara@gmail.com>
* (c) Mell Zamora <mellzamora@outlook.com>
*
* Copyright (c) 2016. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
*/
namespace Bruery\Us... | <?php
/**
* This file is part of the Bruery Platform.
*
* (c) Viktore Zara <viktore.zara@gmail.com>
* (c) Mell Zamora <mellzamora@outlook.com>
*
* Copyright (c) 2016. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
*/
*/
namespace Bruer... |
Add fade in animation to underlabel validator. | package com.strohwitwer.awesomevalidation.validators;
import android.content.Context;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.TextView;
import com.strohwitwer.awesomevalidation.ValidationHolder;
import com.strohwitwer.awesomeva... | package com.strohwitwer.awesomevalidation.validators;
import android.content.Context;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import com.strohwitwer.awesomevalidation.ValidationHolder;
import com.strohwitwer.awesomevalidation.utility.ValidationCallback;
import j... |
Change topic keys to match new naming scheme | var Q = require('q'),
utils = require('./utils'),
EventEmitter = require('events').EventEmitter,
actions = require('../static/actions.json');
module.exports.create = function (id, client) {
var instance = new EventEmitter(),
logger = utils.logger(__filename);
instance.id = 'radio.' + id;
... | var Q = require('q'),
utils = require('./utils'),
EventEmitter = require('events').EventEmitter,
actions = require('../static/actions.json');
module.exports.create = function (id, client) {
var instance = new EventEmitter(),
logger = utils.logger(__filename);
instance.id = 'radio.' + id;
... |
Check for the response class | <?php
namespace Plinth\Response;
use Plinth\Dictionary;
class Parser
{
/**
* @param Response $self
* @param string $template
* @param array $templateData
* @param string $path
* @param string $tplExt
* @param Dictionary $dictionary
* @return string
*/
public st... | <?php
namespace Plinth\Response;
use Plinth\Dictionary;
class Parser
{
/**
* @param Response $self
* @param string $template
* @param array $templateData
* @param string $path
* @param string $tplExt
* @param Dictionary $dictionary
* @return string
*/
public st... |
Add type markers for ctx objects | import discord
from discord.ext import commands
class Misc:
@commands.command()
async def highfive(self, ctx: commands.Context):
"""
Give Yutu a high-five
"""
await ctx.send('{0.mention} :pray: {1.mention}'.format(ctx.me, ctx.author))
@commands.command()
async def cute(... | import discord
from discord.ext import commands
class Misc:
@commands.command()
async def highfive(self, ctx):
"""
Give Yutu a high-five
"""
await ctx.send('{0.mention} :pray: {1.mention}'.format(ctx.me, ctx.author))
@commands.command()
async def cute(self, ctx, user: d... |
Add missing max_length on temporary thumbnail_url migration
Fixes #7323 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailembeds", "0007_populate_hash"),
]
operations = [
migrations.AlterField(
model_name="embed",
name="hash",
field=models.CharField(db_index=True, max... | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailembeds", "0007_populate_hash"),
]
operations = [
migrations.AlterField(
model_name="embed",
name="hash",
field=models.CharField(db_index=True, max... |
Remove a check that is probably useless | var replaceAll = function( oldToken ) {
var configs = this;
return {
from: function( string ) {
return {
to: function( newToken ) {
var _token;
var index = -1;
if ( configs.ignoringCase ) {
_token = oldToken.toLowerCase();
while((
... | var replaceAll = function( oldToken ) {
var configs = this;
return {
from: function( string ) {
return {
to: function( newToken ) {
var _token;
var index = -1;
if ( configs.ignoringCase ) {
_token = oldToken.toLowerCase();
while((
... |
Use start of month/year dates instead of end. | def get_monthly_anomaly(ts, start, end):
"""
Get monthly anomaly.
Monthly anomalies calculated from the mean of the data between the specified start and end dates.
:param ts: Pandas timeseries, will be converted to monthly.
:type ts: pandas.TimeSeries
:param start: Start da... | def get_monthly_anomaly(ts, start, end):
"""
Get monthly anomaly.
Monthly anomalies calculated from the mean of the data between the specified start and end dates.
:param ts: Pandas timeseries, will be converted to monthly.
:type ts: pandas.TimeSeries
:param start: Start da... |
Update paramiko dependency for vulnerability | from setuptools import setup
setup(
name='cb-event-duplicator',
version='1.2.0',
packages=['cbopensource', 'cbopensource.tools', 'cbopensource.tools.eventduplicator'],
url='https://github.com/carbonblack/cb-event-duplicator',
license='MIT',
author='Bit9 + Carbon Black Developer Network',
au... | from setuptools import setup
setup(
name='cb-event-duplicator',
version='1.2.0',
packages=['cbopensource', 'cbopensource.tools', 'cbopensource.tools.eventduplicator'],
url='https://github.com/carbonblack/cb-event-duplicator',
license='MIT',
author='Bit9 + Carbon Black Developer Network',
au... |
Fix Logout Dialog Recreating Home
The logout dialog was launching a new instance of the home
activity every time it was dismissed by touching outside the
dialog instead of through the proper Cancel button. This
commit is just a quick fix to fix that. | package net.somethingdreadful.MAL;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.ContextThemeWrapper;
import com.actionbarsherlock.app.SherlockDialogFragment;
public class Logout... | package net.somethingdreadful.MAL;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.ContextThemeWrapper;
import com.actionbarsherlock.app.SherlockDialo... |
Add plugin count ip using mongo aggregation framework | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
sys.path.insert(0, "..")
from libs.manager import Plugin
from bson.code import Code
class CountIPNew(Plugin):
def __init__(self, **kwargs):
self.keywords = ['counter', 'ip']
self.result = {}
def process(self, **kwargs):
collect... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
sys.path.insert(0, "..")
from libs.manager import Plugin
class CountIPNew(Plugin):
def __init__(self, **kwargs):
self.keywords = ['counter', 'ip']
self.total_ip = 0
self.ip_dict = {}
def __process_doc(self, **kwargs):
i... |
Replace real typograph with mock | <?php
namespace Fsv\TypographyBundle\Tests\Form\Extension;
use Fsv\TypographyBundle\Form\Extension\TextareaTypeExtension;
use Symfony\Component\Form\PreloadedExtension;
use Symfony\Component\Form\Test\TypeTestCase;
class TextareaTypeExtensionTest extends TypeTestCase
{
public function testSubmitWithTypography()
... | <?php
namespace Fsv\TypographyBundle\Tests\Form\Extension;
use Fsv\TypographyBundle\Form\Extension\TextareaTypeExtension;
use Fsv\TypographyBundle\Typograph\MdashTypograph;
use Symfony\Component\Form\PreloadedExtension;
use Symfony\Component\Form\Test\TypeTestCase;
class TextareaTypeExtensionTest extends TypeTestCase... |
Fix mistake in Dynamo table name | 'use strict';
const Bluebird = require('bluebird');
const Dynasty = require('../model');
module.exports = {
findTrigger: function (currentIntent) {
if (!currentIntent) {
return Bluebird.reject(new Error('currentIntent is required'));
}
return Dynasty.table(`${process.env.NODE_ENV}-nicbot-triggers... | 'use strict';
const Bluebird = require('bluebird');
const Dynasty = require('../model');
module.exports = {
findTrigger: function (currentIntent) {
if (!currentIntent) {
return Bluebird.reject(new Error('currentIntent is required'));
}
return Dynasty.table(`${process.env.NODE_ENV}-nicbot-triggers... |
Move zoom height functionality to separate function. | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... | # Sample extension: zoom a window to maximum height
import re
import sys
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
windows_keydefs = {
'<<zoom-height>>': ['<Alt-F2>'],
}
unix_keydefs = {
'<<zoom-height>>': ... |
Fix ImportError when loading change_(prev|next) module on windows | import sublime_plugin
try:
from .view_collection import ViewCollection
except ImportError:
from view_collection import ViewCollection
class VcsGutterBaseChangeCommand(sublime_plugin.WindowCommand):
def lines_to_blocks(self, lines):
blocks = []
last_line = -2
for line in lines:
... | import sublime_plugin
try:
from VcsGutter.view_collection import ViewCollection
except ImportError:
from view_collection import ViewCollection
class VcsGutterBaseChangeCommand(sublime_plugin.WindowCommand):
def lines_to_blocks(self, lines):
blocks = []
last_line = -2
for line in lin... |
Revert "Improve wording and add comment for realm switching." | 'use strict';
const {remote} = require('electron');
document.getElementById('close-button').addEventListener('click', function (e) {
let window = remote.getCurrentWindow();
window.close();
});
// document.getElementById('pic').style.display ='block';
function addDomain() {
const request = require(... | 'use strict';
const {remote} = require('electron');
document.getElementById('close-button').addEventListener('click', function (e) {
let window = remote.getCurrentWindow();
window.close();
});
// document.getElementById('pic').style.display ='block';
function addDomain() {
const request = require(... |
Refactoring: Replace single quotes -> double quotes, var -> const | const loaders = require("./loaders");
const preloaders = require("./preloaders");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require("webpack");
module.exports = {
context: path.join(__dirname, ".."),
entry: ["./src/index.ts"],
output: {
filename: "build.js",
... | var loaders = require("./loaders");
var preloaders = require("./preloaders");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var webpack = require('webpack');
module.exports = {
entry: ['./src/index.ts'],
output: {
filename: 'build.js',
path: 'dist'
},
devtool: '',
resolve:... |
Use execute script to reload page rather than chrome.tabs.reload() as chrome.runtime.reload() causes the previous operation to abort. | const filesInDirectory = dir => new Promise (resolve =>
dir.createReader ().readEntries (entries =>
Promise.all (entries.filter (e => e.name[0] !== '.').map (e =>
e.isDirectory
? filesInDirectory (e)
: new Promise (resolve => e.file (resolve))
))
... | const filesInDirectory = dir => new Promise (resolve =>
dir.createReader ().readEntries (entries =>
Promise.all (entries.filter (e => e.name[0] !== '.').map (e =>
e.isDirectory
? filesInDirectory (e)
: new Promise (resolve => e.file (resolve))
))
... |
Sort projects on /docs page by name vs. id
Allows for a more natural, intuitive ordering.
See #367 | package sagan.docs.support;
import sagan.projects.Project;
import sagan.projects.support.ProjectMetadataService;
import sagan.support.nav.NavSection;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Control... | package sagan.docs.support;
import sagan.projects.Project;
import sagan.projects.support.ProjectMetadataService;
import sagan.support.nav.NavSection;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Control... |
Add bigautofield default in app conf | import importlib
from typing import List, Tuple, Union
from django.utils.translation import gettext_lazy as _
from django.apps import AppConfig
class MqueueConfig(AppConfig):
name = "mqueue"
default_auto_field = "django.db.models.BigAutoField"
verbose_name = _("Events queue")
def ready(self):
... | import importlib
from typing import List, Tuple, Union
from django.utils.translation import ugettext_lazy as _
from django.apps import AppConfig
class MqueueConfig(AppConfig):
name = "mqueue"
verbose_name = _(u"Events queue")
def ready(self):
# models registration from settings
from djang... |
Use request.data in DRF >= 3 | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
DRF_VERSION_INFO = StrictVersion(rest_framework.VERSION).version
DRF2 = DRF_VERSION_INFO[0] == 2
DRF3 = DRF_VERSION_INFO[0] == 3
if DRF2:
class Serializer(serializers.Serial... | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
if StrictVersion(rest_framework.VERSION) < StrictVersion('3.0.0'):
class Serializer(serializers.Serializer):
pass
class PasswordField(serializers.CharField):
... |
Enable pretty Forge checkbox fields. | <!DOCTYPE html>
<html lang="en" class="modernizr-label-click modernizr-checked">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rogue</title>
<link rel="icon" type="image/png" href="http://twooter.biz/Gifs/tonguecat.png"... | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rogue</title>
<link rel="icon" type="image/png" href="http://twooter.biz/Gifs/tonguecat.png">
<link rel="stylesheet" href="{{ elixir... |
Validate with sequential random state | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.random_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._d... | import sklearn.cross_validation
class Backend(object):
def __init__(self):
self.dataset_id = 0
self.dataset = None
self.model = None
def load(self, dataset):
self.model = None
self.dataset_id += 1
self.dataset = dataset
self._data = dataset['data']
... |
Add more test cases to verify transformer behavior | """Data transformation utilities test cases."""
import unittest
from datagrid_gtk3.utils.transformations import degree_decimal_str_transform
class DegreeDecimalStrTransformTest(unittest.TestCase):
"""Degree decimal string transformation test case."""
def test_no_basestring(self):
"""AssertionError... | """Data transformation utilities test cases."""
import unittest
from datagrid_gtk3.utils.transformations import degree_decimal_str_transform
class DegreeDecimalStrTransformTest(unittest.TestCase):
"""Degree decimal string transformation test case."""
def test_no_basestring(self):
"""AssertionError... |
Save output for every run | import os
import statistics
from cref.structure import rmsd
from cref.app.terminal import download_pdb, download_fasta, predict_fasta
pdbs = ['1zdd', '1gab']
runs = 5
fragment_sizes = range(5, 13, 2)
number_of_clusters = range(4, 20, 1)
for pdb in pdbs:
output_dir = 'predictions/evaluation/{}/'.format(pdb)
... | import os
import statistics
from cref.structure import rmsd
from cref.app.terminal import download_pdb, download_fasta, predict_fasta
pdbs = ['1zdd', '1gab']
runs = 100
fragment_sizes = range(5, 13, 2)
number_of_clusters = range(4, 20, 1)
for pdb in pdbs:
output_dir = 'predictions/evaluation/{}/'.format(pdb)
... |
Fix delete method on RateLimiter's cache storage | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\RateLimiter\Storage;
use Psr\Cache\CacheItemPoolInter... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\RateLimiter\Storage;
use Psr\Cache\CacheItemPoolInter... |
Fix error with invalid error message while sending e-mail | var util = require('util'),
_ = require('lodash'),
vow = require('vow'),
nm = require('nodemailer'),
transport = require('nodemailer-smtp-transport'),
errors = require('../errors').Mailer,
logger = require('./../logger'),
mailer;
module.exports = {
/**
* Initialize mailer module
... | var util = require('util'),
_ = require('lodash'),
vow = require('vow'),
nm = require('nodemailer'),
transport = require('nodemailer-smtp-transport'),
errors = require('../errors').Mailer,
logger = require('./../logger'),
mailer;
module.exports = {
/**
* Initialize mailer module
... |
Define abstract base method as abstract | <?php
/**
* abstract compiler pass for extref things
*/
namespace Graviton\DocumentBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* @author List of contributors <https://github.com/lib... | <?php
/**
* abstract compiler pass for extref things
*/
namespace Graviton\DocumentBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* @author List of contributors <https://github.com/lib... |
Make zip code input numeric | import React, { Component } from 'react';
import { Grid, Col, Form, Item, Label, Input, Card, CardItem } from 'native-base';
import CardHeader from '../../common/card-header/cardHeader';
// Temporary constants. These will be moved and implemented in another way in the future!
const ADDRESS_STRING = 'Adress';
const CI... | import React, { Component } from 'react';
import { Grid, Col, Form, Item, Label, Input, Card, CardItem } from 'native-base';
import CardHeader from '../../common/card-header/cardHeader';
// Temporary constants. These will be moved and implemented in another way in the future!
const ADDRESS_STRING = 'Adress';
const CI... |
Fix initialization of Smtp Mailer | <?php
namespace Remp\MailerModule\Mailer;
use Nette\Mail\IMailer;
use Nette\Mail\Message;
use Remp\MailerModule\Config\Config;
use Remp\MailerModule\Repository\ConfigsRepository;
class SmtpMailer extends Mailer implements IMailer
{
private $mailer;
protected $alias = 'remp-smtp';
protected $options = [... | <?php
namespace Remp\MailerModule\Mailer;
use Nette\Mail\IMailer;
use Nette\Mail\Message;
use Remp\MailerModule\Config\Config;
use Remp\MailerModule\Repository\ConfigsRepository;
class SmtpMailer extends Mailer implements IMailer
{
private $mailer;
protected $alias = 'remp-smtp';
protected $options = [... |
Use relocated Destiny 1 endpoints. | import request from 'request';
class BungiePlatformService {
get(endpoint) {
let options = {
url: `https://www.bungie.net/d1/Platform${endpoint}`,
headers: {
'X-API-Key': process.env.BUNGIE_API_KEY
}
};
return new Promise((resolve, reject)... | import request from 'request';
class BungiePlatformService {
get(endpoint) {
let options = {
url: `https://www.bungie.net/Platform${endpoint}`,
headers: {
'X-API-Key': process.env.BUNGIE_API_KEY
}
};
return new Promise((resolve, reject) =>... |
fix(webpack): Fix source map generation in dist | var webpack = require("webpack");
// Builds bundle usable <script>. Includes RGL and all deps, excluding React.
module.exports = {
context: __dirname,
entry: {
"react-grid-layout": "./index-dev.js"
},
output: {
path: __dirname + "/dist",
filename: "[name].min.js",
libraryTarget: "umd",
libr... | var webpack = require("webpack");
// Builds bundle usable <script>. Includes RGL and all deps, excluding React.
module.exports = {
context: __dirname,
entry: {
"react-grid-layout": "./index-dev.js"
},
output: {
path: __dirname + "/dist",
filename: "[name].min.js",
libraryTarget: "umd",
libr... |
Update zstd version in test
To reflect the recent upgrade to 1.1.0. | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 1, 0))
def test_constants(self):
self.assertEqual(z... | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 0, 0))
def test_constants(self):
self.assertEqual(z... |
Fix bug accessing wrong schema instance | var clone = require('clone'),
mongoose = require('mongoose'),
ObjectId = mongoose.Schema.Types.ObjectId;
module.exports = function(schema, options) {
options = options || {};
options.collection = options.collection || 'versions';
var versionedSchema = clone(schema);
// Fix for callQueue argum... | var clone = require('clone'),
mongoose = require('mongoose'),
ObjectId = mongoose.Schema.Types.ObjectId;
module.exports = function(schema, options) {
options = options || {};
options.collection = options.collection || 'versions';
var versionedSchema = clone(schema);
// Fix for callQueue argum... |
Add some more padding to login screen | var zk = {
toMonthCalendar: function() {
$.fn.fullpage.moveSlideRight();
$(window).scrollTop(0);
},
toMain: function() {
$.fn.fullpage.moveSlideLeft();
$(window).scrollTop(0);
},
fillMonthCalendar: function(month, data) {
$('#_MonthCalendar').html(... | var zk = {
toMonthCalendar: function() {
$.fn.fullpage.moveSlideRight();
$(window).scrollTop(0);
},
toMain: function() {
$.fn.fullpage.moveSlideLeft();
$(window).scrollTop(0);
},
fillMonthCalendar: function(month, data) {
$('#_MonthCalendar').html(... |
Allow null as defining class.
git-svn-id: fe6d842192ccfb78748eb71580d1ce65f168b559@1736 9830eeb5-ddf4-0310-9ef7-f4b9a3e3227e | /*
* Copyright (C) 2008, 2010 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 13. October 2008 by Joerg Schaible
*/
package com.... | /*
* Copyright (C) 2008 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 13. October 2008 by Joerg Schaible
*/
package com.though... |
Check if slaves are alive and fallback to other slaves and eventually to master. | # -*- coding:utf-8 -*-
import random
from django.db import connections
from django.db.utils import DEFAULT_DB_ALIAS
from django.conf import settings
def is_alive(db):
try:
if db.connection is not None and hasattr(db.connection, 'ping'):
db.connection.ping()
else:
db.cursor... | # -*- coding:utf-8 -*-
import random
from django.db.utils import DEFAULT_DB_ALIAS
from django.conf import settings
class ReplicationRouter(object):
def __init__(self):
self.state_stack = ['master']
self._state_change_enabled = True
def set_state_change(self, enabled):
self._state_cha... |
Change the markup in the Character component
It uses now the initial design for the character component, they seem
now more like cards | var React = require('react');
var Character = React.createClass({
getThumbnail: function() {
var image = 'http://placehold.it/250x250';
if(this.props.character.thumbnail) {
image = this.props.character.thumbnail.path+'.'+this.props.character.thumbnail.extension;
}
return (
<img classNam... | var React = require('react');
var Character = React.createClass({
getThumbnail: function() {
var image = 'http://placehold.it/250x250';
if(this.props.character.thumbnail) {
image = this.props.character.thumbnail.path+'.'+this.props.character.thumbnail.extension;
}
return (
<img classNa... |
Fix issue when debugger is used with DI
This fix allows the debug module to properly serialize action params even if they are complex. It realizes this by replacing the params with string descriptions. | <?php
namespace SamIT\Yii2\Traits;
use yii\base\InlineAction;
use yii\base\InvalidConfigException;
use yii\web\BadRequestHttpException;
/**
* Trait that implements dependency injection for controller actions.
* It should be bound only to subclasses of controller.
*/
trait ActionInjectionTrait
{
/**
* @se... | <?php
namespace SamIT\Yii2\Traits;
use yii\base\InlineAction;
use yii\base\InvalidConfigException;
use yii\web\BadRequestHttpException;
/**
* Trait that implements dependency injection for controller actions.
* It should be bound only to subclasses of controller.
*/
trait ActionInjectionTrait
{
/**
* @se... |
Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours. | """Fix Folder, EASFolderSyncStatus unique constraints
Revision ID: 2525c5245cc2
Revises: 479b3b84a73e
Create Date: 2014-07-28 18:57:24.476123
"""
# revision identifiers, used by Alembic.
revision = '2525c5245cc2'
down_revision = '479b3b84a73e'
from alembic import op
import sqlalchemy as sa
from inbox.ignition impo... | """Fix Folder, EASFolderSyncStatus unique constraints
Revision ID: 2525c5245cc2
Revises: 479b3b84a73e
Create Date: 2014-07-28 18:57:24.476123
"""
# revision identifiers, used by Alembic.
revision = '2525c5245cc2'
down_revision = '479b3b84a73e'
from alembic import op
import sqlalchemy as sa
from inbox.ignition impo... |
Join word tokens into space-delimited string in InfoRetriever | # LING 573 Question Answering System
# Code last updated 4/17/14 by Clara Gordon
# This code implements an InfoRetriever for the question answering system.
from pymur import *
from general_classes import *
class InfoRetriever:
# builds a QueryEnvironment associated with the indexed document collection
def... | # LING 573 Question Answering System
# Code last updated 4/17/14 by Clara Gordon
# This code implements an InfoRetriever for the question answering system.
from pymur import *
from general_classes import *
class InfoRetriever:
# builds a QueryEnvironment associated with the indexed document collection
def... |
Add source map and live reload | var grunt = require('grunt');
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
'6to5': {
options: {
sourceMap: true,
modules: 'ignore'
},
dist: {
files: [{
expand: true,
cwd: 'src',
src: ['**/*.js', '!intro.js', ... | var grunt = require('grunt');
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
'6to5': {
options: {
sourceMap: true,
modules: 'ignore'
},
dist: {
files: [{
expand: true,
cwd: 'src',
src: ['**/*.js', '!intro.js', ... |
[FlexLoader] Check for * missing paths in FlexPathsFatcory | <?php declare(strict_types=1);
namespace Symplify\FlexLoader\Flex;
use Nette\Utils\Strings;
use function Safe\glob;
final class FlexPathsFactory
{
/**
* @return string[]
*/
public function createServicePaths(string $projectDir, string $environment): array
{
$servicePaths = [
... | <?php declare(strict_types=1);
namespace Symplify\FlexLoader\Flex;
use function Safe\glob;
final class FlexPathsFactory
{
/**
* @return string[]
*/
public function createServicePaths(string $projectDir, string $environment): array
{
$servicePaths = [
$projectDir . '/config/p... |
Make get_date() return date object instead of datetime | import dateutil.parser
from datetime import datetime, date
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__ta... | import dateutil.parser
from datetime import datetime
from dateutil.tz import tz
class TimeWarriorInterval(object):
def __init__(self, start, end, tags):
self.__start = self.__get_local_datetime(start)
self.__end = self.__get_local_datetime(end) if end is not None else None
self.__tags = t... |
Change concatination of parsed data | from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
import inspect
import requests, json
class FedoraConnectionManager:
__oerUri = ''
__parserTemplates = set()
def __init__(self, uri, templates=[], auto_retrieved=True):
validator = URLValidator(... | from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
import inspect
import requests, json
class FedoraConnectionManager:
__oerUri = ''
__parserTemplates = set()
def __init__(self, uri, templates=[], auto_retrieved=True):
validator = URLValidator(ve... |
Move support for dataview-specific database from lava-server | from lava_server.extension import LavaServerExtension
class DashboardExtension(LavaServerExtension):
@property
def app_name(self):
return "dashboard_app"
@property
def name(self):
return "Dashboard"
@property
def main_view_name(self):
return "dashboard_app.views.bund... | from lava_server.extension import LavaServerExtension
class DashboardExtension(LavaServerExtension):
@property
def app_name(self):
return "dashboard_app"
@property
def name(self):
return "Dashboard"
@property
def main_view_name(self):
return "dashboard_app.views.bund... |
Use className instead of class in jsx element | import React from 'react';
const BorrowRequests = (props) => {
const { books } = props;
if (!books.length) {
return (
<div className="row center">
<p className="grey-text">You have no pending borrow requests </p>
</div>
);
}
return (
<div className="row">
... | import React from 'react';
const BorrowRequests = (props) => {
const { books } = props;
if (!books.length) {
return (
<div className="row center">
<p className="grey-text">You have no pending borrow requests </p>
</div>
);
}
return (
<div className="row">
... |
Fix typo in default staging config | <?php
if (file_exists($this->DocPath()."/config.php")){
$defaultConfig = include($this->DocPath()."/config.php");
}else {
$defaultConfig = array();
}
$stagingConfig = array(
'db' => array_merge($defaultConfig["db"],array(
'dbname' => $defaultConfig["custom"]["staging_database"]
)),
'custom... | <?php
if (file_exists($this->DocPath()."/config.php")){
$defaultConfig = include($this->DocPath()."/config.php");
}else {
$defaultConfig = array();
}
$stagingConfig = array(
'db' => array_merge($defaultConfig["db"],array(
'dbname' => $defaultConfig["custom"]["staging_cache_general"]
)),
'c... |
Increase default top margin to account for two line graph titles. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
def default_graph_layout_options():
"""Default layout options for all graphs.
"""
return {
'font': {
'color': 'rgba(0, 0, 0, 1)',
# Bootstrap 4 font family.
'family': '-apple-system, BlinkMacSystemF... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
def default_graph_layout_options():
"""Default layout options for all graphs.
"""
return {
'font': {
'color': 'rgba(0, 0, 0, 1)',
# Bootstrap 4 font family.
'family': '-apple-system, BlinkMacSystemF... |
Add function to post a message to the channel | 'use strict';
angular.module('chatApp', [])
.controller('ChatCtrl', function($scope, $http) {
$scope.chatChannel = "chatApp";
$scope.messageLimit = 50;
$scope.defaultUsername = "Guest";
$scope.currentConnectionStatus = 0;
$scope.errorMessage;
$scope.loggedIn = false;
PUBNUB.subscribe({
c... | 'use strict';
angular.module('chatApp', [])
.controller('ChatCtrl', function($scope, $http) {
$scope.chatChannel = "chatApp";
$scope.messageLimit = 50;
$scope.defaultUsername = "Guest";
$scope.currentConnectionStatus = 0;
$scope.errorMessage;
$scope.loggedIn = false;
PUBNUB.subscribe({
c... |
Set log settings to empty array by default | <?php namespace Tait\ModelLogging;
use Tait\ModelLogging\ModelLog;
use Auth;
trait LoggableTrait
{
/**
* Get all logs for this object
*
* @return collection
*/
public function getAllLogs()
{
return ModelLog::
with('user')
->where('content_id', '=', $this... | <?php namespace Tait\ModelLogging;
use Tait\ModelLogging\ModelLog;
use Auth;
trait LoggableTrait
{
/**
* Get all logs for this object
*
* @return collection
*/
public function getAllLogs()
{
return ModelLog::
with('user')
->where('content_id', '=', $this... |
Break potential cycle because we are storing the traceback | #
# This file is part of Evergreen. See the NOTICE for more information.
#
import pyuv
import sys
from evergreen.event import Event
from evergreen.futures import Future
__all__ = ('ThreadPool')
"""Internal thread pool which uses the pyuv work queuing capability. This module
is for internal use of Evergreen.
"""
c... | #
# This file is part of Evergreen. See the NOTICE for more information.
#
import pyuv
import sys
from evergreen.event import Event
from evergreen.futures import Future
__all__ = ('ThreadPool')
"""Internal thread pool which uses the pyuv work queuing capability. This module
is for internal use of Evergreen.
"""
c... |
Fix typo in follower restrictions | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... |
Add default value to _has_data | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
Use `removeClass` instead of `toggle` | $(document).ready(function()
{
$("#invite-form").on('submit', function()
{
var inviteeEmail = $("#email").val();
console.log(inviteeEmail)
if (!inviteeEmail || !inviteeEmail.length) {
alert('Please enter an email');
return false;
}
$.ajax({... | $(document).ready(function()
{
$("#invite-form").on('submit', function()
{
var inviteeEmail = $("#email").val();
console.log(inviteeEmail)
if (!inviteeEmail || !inviteeEmail.length) {
alert('Please enter an email');
return false;
}
$.ajax({... |
Move dev server to port 2112 because omg collisions | var dest = "./build";
var src = './src';
module.exports = {
browserSync: {
open: false,
https: true,
port: 2112,
server: {
// We're serving the src folder as well
// for sass sourcemap linking
baseDir: [dest, src]
},
files: [
dest + "/**",
// Exclude Map files
... | var dest = "./build";
var src = './src';
module.exports = {
browserSync: {
open: false,
https: true,
server: {
// We're serving the src folder as well
// for sass sourcemap linking
baseDir: [dest, src]
},
files: [
dest + "/**",
// Exclude Map files
"!" + dest +... |
Upgrade dependency requests to ==2.10.0 | import re
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
with open('abakus/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE
).group(1)
setup(
name="djan... | import re
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
with open('abakus/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(),
re.MULTILINE
).group(1)
setup(
name="djan... |
Update data for the High Line, NYC
Looks like it was turned into a multipolygon relation in [this changeset](http://www.openstreetmap.org/changeset/47542769). | from shapely.geometry import shape
# this is mid way along the High Line in NYC, which is a huge long
# "building". we should be clipping it to a buffer of 3x the tile
# dimensions.
# http://www.openstreetmap.org/relation/7141751
with features_in_tile_layer(16, 19295, 24631, 'buildings') as buildings:
# max width ... | from shapely.geometry import shape
# this is mid way along the High Line in NYC, which is a huge long
# "building". we should be clipping it to a buffer of 3x the tile
# dimensions.
# http://www.openstreetmap.org/way/37054313
with features_in_tile_layer(16, 19295, 24631, 'buildings') as buildings:
# max width and ... |
ADD title to example usage of refs | module.exports = {
stories: ['./stories/*.*'],
refs: {
ember: {
id: 'ember',
title: 'Ember',
url: 'https://5e32a5d4977061000ca89459--storybookjs.netlify.com/ember-cli',
},
cra: 'https://5e32a5d4977061000ca89459--storybookjs.netlify.com/cra-ts-kitchen-sink',
},
webpack: async config... | module.exports = {
stories: ['./stories/*.*'],
refs: {
ember: 'https://5e32a5d4977061000ca89459--storybookjs.netlify.com/ember-cli',
cra: 'https://5e32a5d4977061000ca89459--storybookjs.netlify.com/cra-ts-kitchen-sink',
},
webpack: async config => ({
...config,
module: {
...config.module,
... |
Remove _setImageText in image header | import View from '../View';
import HeaderAnalysesView from './HeaderAnalysesView';
import HeaderUserView from './HeaderUserView';
import HeaderImageView from './HeaderImageView';
import router from '../../router';
import headerTemplate from '../../templates/layout/header.pug';
import '../../stylesheets/layout/header.s... | import View from '../View';
import HeaderAnalysesView from './HeaderAnalysesView';
import HeaderUserView from './HeaderUserView';
import HeaderImageView from './HeaderImageView';
import router from '../../router';
import events from '../../events';
import headerTemplate from '../../templates/layout/header.pug';
import... |
Comment out dependency for now | 'use strict';
// var AutoprefixPlugin = require('less-plugin-autoprefix');
var CleanCSSPlugin = require('less-plugin-clean-css');
var extend = require('extend');
var path = require('path');
var rump = require('rump');
exports.rebuild = function() {
var plugins = [];
rump.configs.main.globs = extend(true, {
b... | 'use strict';
var AutoprefixPlugin = require('less-plugin-autoprefix');
var CleanCSSPlugin = require('less-plugin-clean-css');
var extend = require('extend');
var path = require('path');
var rump = require('rump');
exports.rebuild = function() {
var plugins = [];
rump.configs.main.globs = extend(true, {
buil... |
Fix issue with accent escaped in some xml response | package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.apache.commons.text.StringEscapeUtils;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEsc... | package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
... |
Fix API info reporting in "lxc info"
Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com> | package shared
type ServerStateEnvironment struct {
Addresses []string `json:"addresses"`
Architectures []string `json:"architectures"`
Certificate string `json:"certificate"`
CertificateFingerprint string `json:"certificate_fingerprint"`
Driver string `json:... | package shared
type ServerStateEnvironment struct {
Addresses []string `json:"addresses"`
Architectures []string `json:"architectures"`
Certificate string `json:"certificate"`
CertificateFingerprint string `json:"certificate_fingerprint"`
Driver string `json:... |
Add worflow validation to prevent user replacement assumptions | (function( $ ) {
$.fn.searchify = function() {
return this.each(function() {
$(this).autocomplete({
source: $(this).data("search-url"),
select: function (event, ui) {
if (select_url = $(this).data("select-url")) {
for (e... | (function( $ ) {
$.fn.searchify = function() {
return this.each(function() {
$(this).autocomplete({
source: $(this).data("search-url"),
select: function (event, ui) {
if (select_url = $(this).data("select-url")) {
for (e... |
Fix up regex for path matching | from __future__ import print_function, absolute_import, division
from numba.cuda.testing import unittest, SerialMixin, skip_on_cudasim
from numba import cuda, config
class MyError(Exception):
pass
regex_pattern = (
r'In function [\'"]test_exc[\'"], file [\.\/\\\-a-zA-Z_0-9]+, line \d+'
)
class TestUserEx... | from __future__ import print_function, absolute_import, division
from numba.cuda.testing import unittest, SerialMixin, skip_on_cudasim
from numba import cuda, config
class MyError(Exception):
pass
regex_pattern = (
r'In function [\'"]test_exc[\'"], file ([\.\/\\a-zA-Z_0-9]+), line \d+'
)
class TestUserEx... |
Remove Interstellar poster as placeholder. | package gouravexample.popularmoviesstage1;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import java.util.L... | package gouravexample.popularmoviesstage1;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import java.util.L... |
Fix users retrieval for daily meeting | from datetime import datetime
from tinydb import TinyDB, Query
from tinydb_serialization import Serializer, SerializationMiddleware
class DateTimeSerializer(Serializer):
OBJ_CLASS = datetime # The class this serializer handles
def encode(self, obj):
return obj.strftime('%Y-%m-%dT%H:%M:%S')
def d... | from datetime import datetime
from tinydb import TinyDB, Query
from tinydb_serialization import Serializer, SerializationMiddleware
class DateTimeSerializer(Serializer):
OBJ_CLASS = datetime # The class this serializer handles
def encode(self, obj):
return obj.strftime('%Y-%m-%dT%H:%M:%S')
def d... |
Update cmd to allow args
Change the cmd string so that the "args" argument can be used in linter settings. The way it was any args would be inserted between the '-file' and the filename which broke the '-file' argument.
For this config,
"cflint": {
"@disable": false,
"args": ['-configfile c:\cflintrc.xml... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by ckaznocha
# Copyright (c) 2014 ckaznocha
#
# License: MIT
#
"""This module exports the CFLint plugin class."""
from SublimeLinter.lint import Linter, util
class CFLint(Linter):
"""Provides an i... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by ckaznocha
# Copyright (c) 2014 ckaznocha
#
# License: MIT
#
"""This module exports the CFLint plugin class."""
from SublimeLinter.lint import Linter, util
class CFLint(Linter):
"""Provides an i... |
Replace lambda with higher-order function | import sys
from itertools import imap
from collections import Counter
class Room:
pass
def parse_room(s):
last_dash = s.rfind("-")
after_name = s[last_dash+1:]
bracket = after_name.find("[")
room = Room()
room.name = s[:last_dash]
room.sector = int(after_name[:bracket])
room.checksum ... | import sys
from itertools import imap
from collections import Counter
class Room:
pass
def parse_room(s):
last_dash = s.rfind("-")
after_name = s[last_dash+1:]
bracket = after_name.find("[")
room = Room()
room.name = s[:last_dash]
room.sector = int(after_name[:bracket])
room.checksum ... |
Fix init of local recognizer | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
rl = RecognizerL... | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
self.recognizer ... |
Use null if query strings are empty
Using `UrlUtils.buildFullRequestUrl()` if query string equals to `""` that will append `?` (but without any query string) at the end of the request.
fixes #44 | package com.kakawait.spring.security.cas.web.authentication;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.web.util.UrlUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.util.UriComponentsBuilder;
import javax.servlet.http.HttpServletReq... | package com.kakawait.spring.security.cas.web.authentication;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.web.util.UrlUtils;
import org.springframework.web.util.UriComponentsBuilder;
import javax.servlet.http.HttpServletRequest;
/**
* @author Thibaud Leprêtre
*/
cl... |
Allow for a ZMQ socket to handle receiving for RPC. | <?php
namespace Prooph\ServiceBus\Message\ZeroMQ;
use ZMQSocket;
class ZeroMQSocket
{
/** @var \ZMQSocket */
private $socket;
/** @var string */
private $dsn;
/** @var bool */
private $connected = false;
/**
* @param \ZMQSocket $socket
* @param string $dsn
*/
public ... | <?php
namespace Prooph\ServiceBus\Message\ZeroMQ;
use ZMQSocket;
class ZeroMQSocket
{
/** @var \ZMQSocket */
private $socket;
/** @var string */
private $dsn;
/** @var bool */
private $connected = false;
/**
* @param \ZMQSocket $socket
* @param string $dsn
*/
public ... |
Allow nullable on all fields. | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHospitalsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('hospitals', f... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHospitalsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('hospitals', f... |
Correct messages printed during tests | 'use strict';
module.exports = function (grunt) {
require('time-grunt')(grunt);
grunt.initConfig({
eslint: {
all: {
src: [
'*.js',
'bin/grunth',
'lib/*.js',
],
},
},
jsc... | 'use strict';
module.exports = function (grunt) {
require('time-grunt')(grunt);
grunt.initConfig({
eslint: {
all: {
src: [
'*.js',
'bin/grunth',
'lib/*.js',
],
},
},
jsc... |
[AllBundles] Fix incorrect namespaces in test classes | <?php
namespace Kunstmaan\UtilitiesBundle\Tests\Helper;
use Kunstmaan\UtilitiesBundle\Helper\Slugifier;
use PHPUnit\Framework\TestCase;
class SlugifierTest extends TestCase
{
/**
* @var Slugifier
*/
private $slugifier;
public function setUp(): void
{
$this->slugifier = new Slugifie... | <?php
namespace Kunstmaan\NodeBundle\Tests\Helper;
use Kunstmaan\UtilitiesBundle\Helper\Slugifier;
use PHPUnit\Framework\TestCase;
class SlugifierTest extends TestCase
{
/**
* @var Slugifier
*/
private $slugifier;
public function setUp(): void
{
$this->slugifier = new Slugifier();
... |
Revert "Revert "Revert "Reorder operator"""
This reverts commit 78a1b5e8391875e2b0e9e8272104e80ca10f3275. | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tw.edu.npu.mis;
/**
* The model class of the calculator application.
*/
public class Calculator {
/**
* The av... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tw.edu.npu.mis;
/**
* The model class of the calculator application.
*/
public class Calculator {
/**
* The av... |
Fix tests to allow use of random, but not change each time | import simplecoin
import unittest
import datetime
import random
import simplecoin.models as m
from decimal import Decimal
from simplecoin import db
class UnitTest(unittest.TestCase):
""" Represents a set of tests that only need the database iniailized, but
no fixture data """
def setUp(self, **kwargs):
... | import simplecoin
import unittest
import datetime
import simplecoin.models as m
from decimal import Decimal
from simplecoin import db
class UnitTest(unittest.TestCase):
""" Represents a set of tests that only need the database iniailized, but
no fixture data """
def setUp(self, **kwargs):
extra ... |
Make this test an expected fail on darwin until we can fix this bug.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@197087 91177308-0d34-0410-b5e6-96231b3b80d8 | """
Test example snippets from the lldb 'help expression' output.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil
class Radar9673644TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
TestBase.setUp(sel... | """
Test example snippets from the lldb 'help expression' output.
"""
import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil
class Radar9673644TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
TestBase.setUp(sel... |
Remove exclusion of node_modules as Uglify needs all code as ES5 | var path = require('path');
var webpack = require('webpack');
module.exports = {
regular: {
devtool: 'source-map',
output: {
filename: 'meyda.js'
},
module: {
rules: [
{
test: /\.js$/,
//exclude: /node_modules/, <-- include node_modules because of jsfft's ES6 pu... | var path = require('path');
var webpack = require('webpack');
module.exports = {
regular: {
output: {
filename: 'meyda.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: [[ ... |
[QT] Refactor platform branching in JS bridge call
This is to avoid conflicts in some recent versions of QtWebEngine, where
window.external does seems to be present by default. It's better to
check for Qt first; window.qt is not likely to be defined anywhere else,
so we won't hopefully run to conflicts. | window.pywebview = {
_createApi: function(funcList) {
for (var i = 0; i < funcList.length; i++) {
window.pywebview.api[funcList[i]] = (function (funcName) {
return function(params) {
var promise = new Promise(function(resolve, reject) {
... | window.pywebview = {
_createApi: function(funcList) {
for (var i = 0; i < funcList.length; i++) {
window.pywebview.api[funcList[i]] = (function (funcName) {
return function(params) {
var promise = new Promise(function(resolve, reject) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.