text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Update UnknownCFTypeError to print the type name | package plist
// #include <CoreFoundation/CoreFoundation.h>
import "C"
import "reflect"
import "strconv"
// An UnsupportedTypeError is returned by Marshal when attempting to encode an
// unsupported value type.
type UnsupportedTypeError struct {
Type reflect.Type
}
func (e *UnsupportedTypeError) Error() string {
r... | package plist
// #include <CoreFoundation/CoreFoundation.h>
import "C"
import "reflect"
import "strconv"
// An UnsupportedTypeError is returned by Marshal when attempting to encode an
// unsupported value type.
type UnsupportedTypeError struct {
Type reflect.Type
}
func (e *UnsupportedTypeError) Error() string {
r... |
Fix require path typo error. | var Browser = require('zombie'),
browser = new Browser(),
assert = require('assert'),
server = require('../server/server'),
router = require('../server/router'),
requestHandler = require('../server/requestHandler');
before(function() {
var handle = {};
handle["/"] = requestHandler.start;
hand... | var Browser = require('zombie'),
browser = new Browser(),
assert = require('assert'),
server = require('../server/server'),
router = require('../server/router'),
requestHandler = require('./server/requestHandler');
before(function() {
var handle = {};
handle["/"] = requestHandler.start;
handl... |
Support for wrapString in newer knex versions | const Formatter = require('knex/lib/formatter');
class FormatterSOQL extends Formatter {
wrap(value) {
if (typeof value === 'function') {
return this.outputQuery(this.compileCallback(value), true);
}
const raw = this.unwrapRaw(value);
if (raw) return raw;
if (typeof value === 'number') re... | const Formatter = require('knex/lib/formatter');
class FormatterSOQL extends Formatter {
wrap(value) {
if (typeof value === 'function') {
return this.outputQuery(this.compileCallback(value), true);
}
const raw = this.unwrapRaw(value);
if (raw) return raw;
if (typeof value === 'number') re... |
Remove equivalentProfileItemExists method from interface. PL-11206. | package com.amee.domain;
import com.amee.base.domain.ResultsWrapper;
import com.amee.domain.data.DataCategory;
import com.amee.domain.item.BaseItemValue;
import com.amee.domain.item.profile.ProfileItem;
import com.amee.domain.item.profile.ProfileItemNumberValue;
import com.amee.domain.profile.Profile;
import com.amee.... | package com.amee.domain;
import com.amee.base.domain.ResultsWrapper;
import com.amee.domain.data.DataCategory;
import com.amee.domain.item.BaseItemValue;
import com.amee.domain.item.profile.ProfileItem;
import com.amee.domain.item.profile.ProfileItemNumberValue;
import com.amee.domain.profile.Profile;
import com.amee.... |
Remove column from error output for now | 'use strict';
var configLoader = require('./config-loader');
var LessHint = require('./lesshint');
var meow = require('meow');
var Vow = require('vow');
module.exports = function () {
var lesshint = new LessHint();
var promises = [];
var config;
var args = meow({
pkg: '../package.json'
})... | 'use strict';
var configLoader = require('./config-loader');
var LessHint = require('./lesshint');
var meow = require('meow');
var Vow = require('vow');
module.exports = function () {
var lesshint = new LessHint();
var promises = [];
var config;
var args = meow({
pkg: '../package.json'
})... |
Remove Terser specifics from the shared configuration
It must only applies to TEST | const { environment } = require('@rails/webpacker')
// config
const alias = require('./config/alias')
const splitChunks = require("./config/splitChunks");
const output = require('./config/output')
environment.config.merge(alias)
environment.config.merge(splitChunks)
environment.config.merge(output)
// loaders
const ... | const { environment } = require('@rails/webpacker')
// config
const alias = require('./config/alias')
const terser = require("./config/terser");
const splitChunks = require("./config/splitChunks");
const output = require('./config/output')
environment.config.merge(alias)
environment.config.merge(terser)
environment.c... |
Test case rename from checkstyle to jslint | 'use strict';
var should = require('should'),
fs = require('fs'),
xmlEmitter = require('../../lib/jslint_xml_emitter');
describe('jslint_xml', function () {
var mockXMLResults;
var xmlText;
before(function (done) {
fs.readFile('./test/jslint_xml/fixtures/mock.xml', function (err, data) {
... | 'use strict';
var should = require('should'),
fs = require('fs'),
xmlEmitter = require('../../lib/jslint_xml_emitter');
describe('jslint_xml', function () {
var mockXMLResults;
var xmlText;
before(function (done) {
fs.readFile('./test/jslint_xml/fixtures/mock.xml', function (err, data) {
... |
Write a \n at the end of the doc html files. |
/**
* Compiles a single file's dox output using the template.jade file.
*/
var fs = require('fs')
, basename = require('path').basename
, jade = require('jade')
, highlight = require('highlight').Highlight
, package = JSON.parse(fs.readFileSync(__dirname + '/../package.json'))
/**
* The output filename.
... |
/**
* Compiles a single file's dox output using the template.jade file.
*/
var fs = require('fs')
, basename = require('path').basename
, jade = require('jade')
, highlight = require('highlight').Highlight
, package = JSON.parse(fs.readFileSync(__dirname + '/../package.json'))
/**
* The output filename.
... |
Add one swing player to rule them all | package es.ucm.fdi.tp.control;
import java.util.List;
import es.ucm.fdi.tp.basecode.bgame.control.Player;
import es.ucm.fdi.tp.basecode.bgame.model.Board;
import es.ucm.fdi.tp.basecode.bgame.model.GameMove;
import es.ucm.fdi.tp.basecode.bgame.model.GameRules;
import es.ucm.fdi.tp.basecode.bgame.model.Piece;
... | package es.ucm.fdi.tp.control;
import java.util.List;
import es.ucm.fdi.tp.basecode.bgame.control.Player;
import es.ucm.fdi.tp.basecode.bgame.model.Board;
import es.ucm.fdi.tp.basecode.bgame.model.GameMove;
import es.ucm.fdi.tp.basecode.bgame.model.GameRules;
import es.ucm.fdi.tp.basecode.bgame.model.Piece;
... |
Fix default config usage ejs | 'use strict';
/**
* Module dependencies
*/
// Native
const path = require('path');
// Externals
const co = require('co');
const render = require('koa-ejs');
/**
* EJS hook
*/
module.exports = function(strapi) {
const hook = {
/**
* Default options
*/
defaults: {
root: path.join(strap... | 'use strict';
/**
* Module dependencies
*/
// Native
const path = require('path');
// Externals
const co = require('co');
const render = require('koa-ejs');
/**
* EJS hook
*/
module.exports = function(strapi) {
const hook = {
/**
* Default options
*/
defaults: {
root: path.join(strap... |
Change option from extraKeys to addKeyMaps | import React from 'react'
import SimpleMDE from 'react-simplemde-editor'
const PoemEditor = (props) => {
const extraKeys = {
// 'Ctrl-Enter': () => { props.handleEditorSubmit() },
'Cmd-Enter': () => { props.handleEditorSubmit() },
}
return (
<div>
<SimpleMDE
onChange={props.handleEdito... | import React from 'react'
import SimpleMDE from 'react-simplemde-editor'
const PoemEditor = (props) => {
const extraKeys = {
// 'Ctrl-Enter': () => { props.handleEditorSubmit() },
'Cmd-Enter': () => { props.handleEditorSubmit() },
}
return (
<div>
<SimpleMDE
onChange={props.handleEdito... |
Add 'gym' prefix to URL in email app
The email app is supposed to be used in other parts of the application,
not only in the gym. | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... |
Clean rc from unit tests
Magnum have removed the k8s rc apis, but have not removed it from
policy.json. The patch (https://review.openstack.org/#/c/384064/)
remove rc from etc/magnum/policy.json.
And we should remove rc from tests/fake_policy.py.
Change-Id: Ia98e1637f2e3a5919be3784322a55005970d4da8 | # Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | # Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
Add support for additional source options | <?php
namespace Bridge\HttpApi\Adapter;
use GuzzleHttp\Client;
use Transfer\Adapter\SourceAdapterInterface;
use Transfer\Adapter\Transaction\Request;
use Transfer\Adapter\Transaction\Response;
class HttpApiAdapter implements SourceAdapterInterface
{
/**
* {@inheritdoc}
*/
public function receive(Re... | <?php
namespace Bridge\HttpApi\Adapter;
use GuzzleHttp\Client;
use Transfer\Adapter\SourceAdapterInterface;
use Transfer\Adapter\Transaction\Request;
use Transfer\Adapter\Transaction\Response;
class HttpApiAdapter implements SourceAdapterInterface
{
/**
* {@inheritdoc}
*/
public function receive(Re... |
Add small change for retina | 'use strict';
import PIXI from 'pixi.js';
import RendererStore from '../stores/RendererStore.js';
export default class Renderer extends PIXI.WebGLRenderer {
constructor(...args) {
this.resolution = window.devicePixelRatio;
if(!args.length) {
args = this.getDefaults();
}
super(...args);
... | 'use strict';
import PIXI from 'pixi.js';
import RendererStore from '../stores/RendererStore.js';
export default class Renderer extends PIXI.WebGLRenderer {
constructor(...args) {
this.resolution = window.devicePixelRatio;
if(!args.length) {
args = this.getDefaults();
}
super(...args);
... |
Use external_url when TLS enabled or IP address otherwise
- Allow self-signed certificates only when in development mode
[#119388165]
Signed-off-by: Jacob Frank <e2b78b2ae98d5304f4676b7cd3c5892a0e3e7c9f@pivotal.io> | package web
import (
"crypto/tls"
"net/http"
"github.com/concourse/go-concourse/concourse"
)
type ClientFactory interface {
Build(request *http.Request) concourse.Client
}
type clientFactory struct {
apiEndpoint string
allowSelfSignedCertificates bool
}
func NewClientFactory(apiEndpoint strin... | package web
import (
"net/http"
"github.com/concourse/go-concourse/concourse"
)
type ClientFactory interface {
Build(request *http.Request) concourse.Client
}
type clientFactory struct {
apiEndpoint string
}
func NewClientFactory(apiEndpoint string) ClientFactory {
return &clientFactory{
apiEndpoint: apiEnd... |
Allow for multiple service file formats | <?php
namespace ContainerTools\Configuration;
use ContainerTools\Configuration;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Dependen... | <?php
namespace ContainerTools\Configuration;
use ContainerTools\Configuration;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class ... |
Use Object.assign for better performance | var path = require('path');
var DtsCreator = require('typed-css-modules');
var loaderUtils = require('loader-utils');
module.exports = function(source, map) {
this.cacheable && this.cacheable();
this.addDependency(this.resourcePath);
var callback = this.async();
// Pass on query parameters as an options objec... | var path = require('path');
var DtsCreator = require('typed-css-modules');
var loaderUtils = require('loader-utils');
module.exports = function(source, map) {
this.cacheable && this.cacheable();
this.addDependency(this.resourcePath);
var callback = this.async();
// Pass on query parameters as an options objec... |
Use a shorter timeout when using a range slider | var dimTimer;
angular.module('onmote')
.controller('DeviceListCtrl', function ($scope, $timeout, socket) {
socket.on('telldus:*',function(event, data) {
console.log(event, data);
});
socket.on('telldus:devices', function(data) {
$scope.devices = data;
});
$scope.toggle = function($event, ... | var dimTimer;
angular.module('onmote')
.controller('DeviceListCtrl', function ($scope, $timeout, socket) {
socket.on('telldus:*',function(event, data) {
console.log(event, data);
});
socket.on('telldus:devices', function(data) {
$scope.devices = data;
});
$scope.toggle = function($event, ... |
Make sure entity exist before trying to use it | var index = function(req, res) {
res.writeHead(200);
return res.end();
};
var app = require('http').createServer(index);
var io = require('socket.io')(app);
var _ = require('lodash');
app.listen(3001);
var entities = {};
io.on('connection', function(socket) {
socket.emit('id', { id: socket.id });
_... | var index = function(req, res) {
res.writeHead(200);
return res.end();
};
var app = require('http').createServer(index);
var io = require('socket.io')(app);
var _ = require('lodash');
app.listen(3001);
var entities = {};
io.on('connection', function(socket) {
socket.emit('id', { id: socket.id });
_... |
Remove replacement of commas by points | import color
def parse(mat_node):
materials = []
for node in mat_node:
materials.append(Material(node))
class Material:
''' it’s a material
'''
def __init__(self, node):
for c in node:
if c.tag == 'ambient':
self.ambient_color = color.parse(c[0])
... | import color
def parse(mat_node):
materials = []
for node in mat_node:
materials.append(Material(node))
class Material:
''' it’s a material
'''
def __init__(self, node):
for c in node:
if c.tag == 'ambient':
self.ambient_color = color.parse(c[0])
... |
Create loadMap function to load map images | function ImageFile(_game) {
this.game = _game;
this.name = new Array();
this.data = new Array();
this.counter = 0;
return this;
};
ImageFile.prototype.load = function(_imageSrc, _width, _height) {
if(!this.getImageDataByName(_imageSrc)) {
var self = this;
var _image = new Image();
_image.sr... | function ImageFile(_game) {
this.game = _game;
this.name = new Array();
this.data = new Array();
this.counter = 0;
return this;
};
ImageFile.prototype.load = function(_imageSrc, _width, _height) {
if(!this.getImageDataByName(_imageSrc)) {
var self = this;
var _image = new Image();
_image.sr... |
Fix External and Faces contexts scopes | package org.gluu.jsf2.service;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.application.ViewHandler;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
/**
* @author Yu... | package org.gluu.jsf2.service;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.faces.application.ViewHandler;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
/**
* @author Yur... |
Drop TODO for getVmVersion method
Review URL: https://codereview.chromium.org/12324002 | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.sdk;
import java.io.IOException;
import org.chromium.sdk.util.MethodIsBlockingException;
/**
* Abstraction of a remote JavaSc... | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.sdk;
import java.io.IOException;
import org.chromium.sdk.util.MethodIsBlockingException;
/**
* Abstraction of a remote JavaSc... |
Set card to 'disabled' if player isn't 'active' | export default class CardController {
constructor($rootScope, $scope, $log, _, playerModel, cardsApi) {
'ngInject';
this.$rootScope = $rootScope;
this.$scope = $scope;
this.$log = $log;
this._ = _;
this.cardsApi = cardsApi;
this.playerModel = playerModel.model;
this.$log.info('constructor()', this);... | export default class CardController {
constructor($rootScope, $scope, $log, _, playerModel, cardsApi) {
'ngInject';
this.$rootScope = $rootScope;
this.$scope = $scope;
this.$log = $log;
this._ = _;
this.cardsApi = cardsApi;
this.playerModel = playerModel.model;
this.$log.info('constructor()', this);... |
Correct clearing of fanart cache | import os,mc
import xbmc, xbmcgui
def fanart_function():
if mc.ShowDialogConfirm("Clear fanart cache", "Are you sure you want to clear the fanart cache?", "Cancel", "OK"):
pass
def thumbnail_function():
if mc.ShowDialogConfirm("Clear thumbnail cache", "Are you sure you want to clear the thumbnail cach... | import os,mc
import xbmc, xbmcgui
def fanart_function():
if mc.ShowDialogConfirm("Clear fanart cache", "Are you sure you want to clear the fanart cache?", "Cancel", "OK"):
pass
def thumbnail_function():
if mc.ShowDialogConfirm("Clear thumbnail cache", "Are you sure you want to clear the thumbnail cach... |
Add core-js polyfill for Promise.finally() | // ECMAScript polyfills
import 'core-js/fn/array/fill';
import 'core-js/fn/array/find';
import 'core-js/fn/array/find-index';
import 'core-js/fn/array/from';
import 'core-js/fn/array/includes';
import 'core-js/fn/object/assign';
import 'core-js/fn/object/values';
import 'core-js/fn/promise';
import 'core-js/fn/promise/... | // ECMAScript polyfills
import 'core-js/fn/array/fill';
import 'core-js/fn/array/find';
import 'core-js/fn/array/find-index';
import 'core-js/fn/array/from';
import 'core-js/fn/array/includes';
import 'core-js/fn/object/assign';
import 'core-js/fn/object/values';
import 'core-js/fn/promise';
import 'core-js/fn/string/c... |
Add 'type' support and use Promise with convert method. | "use strict"
var Converter = module.exports = (function() {
var keyMap = {
createdAt: 'parseCreateAt'
, updatedAt: 'parseUpdateAt'
, objectId: 'parseObjectId'
};
function Converter(ncmb, type) {
this.__proto__.ncmb = ncmb;
this._type = type;
}
Converter.prototype.convert = function(obj) {
... | "use strict"
var Converter = module.exports = (function() {
function Converter(ncmb, type) {
this.__proto__.ncmb = ncmb;
this._type = type;
}
Converter.prototype.convert = function(obj) {
let map = {
appName: 'applicationName'
, createdAt: 'parseCreateAt'
, updatedAt: 'parseUpdateAt'
... |
Change main route to get session user | 'use strict';
var path = process.cwd();
var Graphriend = require(path + '/app/controllers/Graphriend.server.js');
var sess;
module.exports = function (app) {
function isLoggedIn (req, res, next) {
sess = req.session;
if (sess.user || req.url === '/') {
return next();
} else {
res.redirect('/');
}
}
... | 'use strict';
var path = process.cwd();
var Graphriend = require(path + '/app/controllers/Graphriend.server.js');
var sess;
module.exports = function (app) {
function isLoggedIn (req, res, next) {
sess = req.session;
if (sess.user) {
return next();
} else {
res.redirect('/');
}
}
var graPhriend = n... |
Fix path, use rsa-sha256 algorithm to actually use the rsa-base verification | import os
from email.utils import formatdate
from datetime import datetime
from time import mktime
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'keybar.settings')
import django
django.setup()
from django.conf import settings
from httpsig.requests_auth import HTTPSignatureAuth
import requests
from keybar.models.u... | import os
from email.utils import formatdate
from datetime import datetime
from time import mktime
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'keybar.settings')
import django
django.setup()
from django.conf import settings
from httpsig.requests_auth import HTTPSignatureAuth
import requests
from keybar.models.u... |
Set backend to production backend | import 'es6-symbol/implement';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import AppViewContainer from './src/modules/AppViewContainer';
import React from 'react';
import {setConfiguration} from './src/utils/configuration';
import {AppRegistry, BackAndroid} from 'react-native';
import ... | import 'es6-symbol/implement';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import AppViewContainer from './src/modules/AppViewContainer';
import React from 'react';
import {setConfiguration} from './src/utils/configuration';
import {AppRegistry, BackAndroid} from 'react-native';
import ... |
Fix headless unit test running
Now "npm install && npm test" works locally again. | /*
Copyright 2014 Spotify 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 law or agreed to in writing, software
dist... | /*
Copyright 2014 Spotify 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 law or agreed to in writing, software
dist... |
Write name and version to output file. | from __future__ import unicode_literals
import pyaavso
class VisualFormatWriter(object):
"""
A class responsible for writing observation data in AAVSO
`Visual File Format`_.
The API here mimics the ``csv`` module in Python standard library.
.. _`Visual File Format`: http://www.aavso.org/aavso-v... | from __future__ import unicode_literals
class VisualFormatWriter(object):
"""
A class responsible for writing observation data in AAVSO
`Visual File Format`_.
The API here mimics the ``csv`` module in Python standard library.
.. _`Visual File Format`: http://www.aavso.org/aavso-visual-file-forma... |
Generalize service module plugin loader, in preparation for same loading mechanism for language specification Module plugins. | package org.metaborg.core.plugin;
import java.util.Collection;
import java.util.ServiceLoader;
import org.metaborg.core.MetaborgException;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.inject.Module;
/**
* Module plugin loader using Java's {@link ServiceLoade... | package org.metaborg.core.plugin;
import java.util.Collection;
import java.util.ServiceLoader;
import org.metaborg.core.MetaborgException;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.inject.Module;
/**
* Module plugin loader using Java's {@link ServiceLoade... |
Use reify instead of properties for the task backend connections. | from celery import Celery, Task
from classtools import reify
from redis import StrictRedis
from charat2.model import sm
from charat2.model.connections import redis_pool
celery = Celery("newparp", include=[
"charat2.tasks.background",
"charat2.tasks.matchmaker",
"charat2.tasks.reaper",
"charat2.tasks.r... | from celery import Celery, Task
from redis import StrictRedis
from charat2.model import sm
from charat2.model.connections import redis_pool
celery = Celery("newparp", include=[
"charat2.tasks.background",
"charat2.tasks.matchmaker",
"charat2.tasks.reaper",
"charat2.tasks.roulette_matchmaker",
])
cele... |
Add a method to get savedata from the world quit easy | package info.u_team.u_team_core.util.world;
import java.util.function.Function;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.storage.WorldSavedData;
public class Worl... | package info.u_team.u_team_core.util.world;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.*;
public class WorldUtil {
public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range) {
return rayTraceServerSide(player, range, RayTraceFluidMode.NEVER, false, tru... |
Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this. | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.6",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
... | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.6",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
... |
Fix: Scale XYZ matrix generator didn't use 1.0 as the default
component value, as it obviously should. | E2.p = E2.plugins["scale_xyz_matrix"] = function(core, node)
{
this.desc = 'Create a matrix that scales the X, Y and Z axis.';
this.input_slots = [
{ name: 'x', dt: core.datatypes.FLOAT, desc: 'Amount to scale the X-axis.', def: 1.0 },
{ name: 'y', dt: core.datatypes.FLOAT, desc: 'Amount to scale the Y-axis.',... | E2.p = E2.plugins["scale_xyz_matrix"] = function(core, node)
{
this.desc = 'Create a matrix that scales the X, Y and Z axis.';
this.input_slots = [
{ name: 'x', dt: core.datatypes.FLOAT, desc: 'Amount to scale the X-axis.', def: 1 },
{ name: 'y', dt: core.datatypes.FLOAT, desc: 'Amount to scale the Y-axis.', d... |
Change to use short flag for 2.4 | #!/usr/bin/env python
import os
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
def test_for_version(filename):
stdin, stdout = os.popen4('%s -V' % filename, 'r')
response = stdout.read()
return '.'.join(response.strip().split(' ')[1].split('.')[:-1])
versions = ['python',... | #!/usr/bin/env python
import os
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
def test_for_version(filename):
stdin, stdout = os.popen4('%s --version' % filename, 'r')
response = stdout.read()
return '.'.join(response.strip().split(' ')[1].split('.')[:-1])
versions = ['p... |
Use argparse for 4D to 3D | #!/usr/bin/env python
''' Tiny script to write 4D files in any format that we read (nifti,
analyze, MINC, at the moment, as nifti 3D files '''
import os
import nipy.externals.argparse as argparse
import nipy.io.imageformats as nii
def main():
# create the parser
parser = argparse.ArgumentParser()
# add ... | #!/usr/bin/env python
''' Tiny script to write 4D files in any format that we read (nifti,
analyze, MINC, at the moment, as nifti 3D files '''
import os
import sys
import nipy.io.imageformats as nii
if __name__ == '__main__':
try:
fname = sys.argv[1]
except IndexError:
raise OSError('Expecti... |
Use SIO:is_data _item in rather than void:inDataset | package ws.biotea.ld2rdf.rdf.model;
import ws.biotea.ld2rdf.util.OntologyPrefix;
import java.io.Serializable;
/**
* OpenAnnotation: This class represents a general annotation on a Document.
* @author leylajael
*/
public class BaseAnnotation implements Serializable {
private static final long serialVersionUID = 1L... | package ws.biotea.ld2rdf.rdf.model;
import ws.biotea.ld2rdf.util.OntologyPrefix;
import java.io.Serializable;
/**
* OpenAnnotation: This class represents a general annotation on a Document.
* @author leylajael
*/
public class BaseAnnotation implements Serializable {
private static final long serialVersionUID = 1L... |
Fix bug with JSONPointer if part passed via __truediv__ is integer | """
Extended JSONPointer from python-json-pointer_
==============================================
.. _python-json-pointer: https://github.com/stefankoegl/python-json-pointer
"""
import typing
from jsonpointer import JsonPointer as BaseJsonPointer
class JSONPointer(BaseJsonPointer):
def __init__(self, pointer):... | """
Extended JSONPointer from python-json-pointer_
==============================================
.. _python-json-pointer: https://github.com/stefankoegl/python-json-pointer
"""
import typing
from jsonpointer import JsonPointer as BaseJsonPointer
class JSONPointer(BaseJsonPointer):
def __init__(self, pointer):... |
Define charset at start as well | <?php
/**
* This file is part of the Krystal Framework
*
* Copyright (c) No Global State Lab
*
* For the full copyright and license information, please view
* the license file that was distributed with this source code.
*/
namespace Krystal\Db\Sql\Connector;
use PDO;
final class MySQL implements ConnectorI... | <?php
/**
* This file is part of the Krystal Framework
*
* Copyright (c) No Global State Lab
*
* For the full copyright and license information, please view
* the license file that was distributed with this source code.
*/
namespace Krystal\Db\Sql\Connector;
use PDO;
final class MySQL implements ConnectorI... |
test: Update test after adding cleaning of dist | from unittest import TestCase
from semantic_release.pypi import upload_to_pypi
from . import mock
class PypiTests(TestCase):
@mock.patch('semantic_release.pypi.run')
def test_upload_without_arguments(self, mock_run):
upload_to_pypi(username='username', password='password')
self.assertEqual(
... | from unittest import TestCase
from semantic_release.pypi import upload_to_pypi
from . import mock
class PypiTests(TestCase):
@mock.patch('semantic_release.pypi.run')
def test_upload_without_arguments(self, mock_run):
upload_to_pypi(username='username', password='password')
self.assertEqual(
... |
Improve javadoc of temporary allowed application status | package org.synyx.urlaubsverwaltung.application.domain;
/**
* Enum describing which states an {@link Application} may have.
*/
public enum ApplicationStatus {
/**
* After applying for the leave, the saved application for leave gets this status.
*/
WAITING,
/**
* After the department head... | package org.synyx.urlaubsverwaltung.application.domain;
/**
* Enum describing which states an {@link Application} may have.
*/
public enum ApplicationStatus {
/**
* After applying for the leave, the saved application for leave gets this status.
*/
WAITING,
/**
* After the HeadOf has allo... |
Use hostname instead of ip | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import pydoop.hdfs as pyhdfs
def register(logdir):
... | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import socket
import subprocess
import os
import pydoop.hdfs as pyhdfs
def register(logdir):
... |
TASK: Use reference instead of index | <?php
namespace EditorconfigChecker\Fix;
class TrailingWhitespaceFix
{
/**
* Insert a final newline at the end of the file
*
* @param string $filename
* @return boolean
*/
public static function trim($filename)
{
if (is_file($filename)) {
$lines = file($filenam... | <?php
namespace EditorconfigChecker\Fix;
class TrailingWhitespaceFix
{
/**
* Insert a final newline at the end of the file
*
* @param string $filename
* @return boolean
*/
public static function trim($filename)
{
if (is_file($filename)) {
$lines = file($filenam... |
Remove stop propagation from toggle text module | var locastyle = locastyle || {};
locastyle.toggleText = (function() {
'use strict';
var config = {
trigger: '[data-ls-module=toggleText]',
triggerChange: 'toggleText:change'
};
function eventHandler(el, target, text) {
el.trigger(config.triggerChange, [target, text]);
}
function bindToggle(e... | var locastyle = locastyle || {};
locastyle.toggleText = (function() {
'use strict';
var config = {
trigger: '[data-ls-module=toggleText]',
triggerChange: 'toggleText:change'
};
function eventHandler(el, target, text) {
el.trigger(config.triggerChange, [target, text]);
}
function bindToggle(e... |
Add new unit tests to collection |
#
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2015-2016 Esteban Tovagliari, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtainin... |
#
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2015-2016 Esteban Tovagliari, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtainin... |
Write access to new output file | import os
import sys
import re
import subprocess
def lemmatize( text ):
text = text.encode('utf8')
text = re.sub( '[\.,?!:;]' , '' , text )
out = subprocess.check_output( 'module load finnish-process; echo "' + text + '" | finnish-process', shell = True)
lemma = ''
for line in out.split('\n'):
... | import os
import sys
import re
import subprocess
def lemmatize( text ):
text = text.encode('utf8')
text = re.sub( '[\.,?!:;]' , '' , text )
out = subprocess.check_output( 'module load finnish-process; echo "' + text + '" | finnish-process', shell = True)
lemma = ''
for line in out.split('\n'):
... |
Add importing absolute_import & division from Prague | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def hash_str(a_str, table_size):
"""Hash a string by the folding method.
- Get ordinal number for each char.
- Sum all of the ordinal numbers.
- Return the remainder of the sum with table_size. ... | from __future__ import print_function
def hash_str(a_str, table_size):
"""Hash a string by the folding method.
- Get ordinal number for each char.
- Sum all of the ordinal numbers.
- Return the remainder of the sum with table_size.
"""
sum = 0
for c in a_str:
sum += ord(c)
return sum % table_siz... |
Change 2nd hidden layer size | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 64 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... | import tensorflow as tf
class ANN:
def __init__(self):
self.inputNodes = 7
self.hiddenNodes = 64
self.hiddenNodes2 = 32 # weight3
self.outputNodes = 1
self.x = tf.placeholder("float", shape=[None, self.inputNodes], name="sensor-input")
self.W1 = tf.placeholder("fl... |
Add dotcloud version requirement (I had 0.4.2 and that didn't work). | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
import skypipe
setup(
name='skypipe',
version=skypipe.VERSION,
author='Jeff Lindsay',
author_email='progrium@gmail.com',
description='Magic pipe in the sky',
long_description=open(os.path.join(os.path.dirname(__file__)... | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
import skypipe
setup(
name='skypipe',
version=skypipe.VERSION,
author='Jeff Lindsay',
author_email='progrium@gmail.com',
description='Magic pipe in the sky',
long_description=open(os.path.join(os.path.dirname(__file__)... |
Disable IppetPowerMonitorTest.testFindOrInstallIppet which is failing on new trybots.
BUG=424027
TBR=dtu@chromium.org
Review URL: https://codereview.chromium.org/643763005
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#299833} | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import unittest
from telemetry import decorators
from telemetry.core.platform import win_platform_backend
from telemetry.core.platform.power_... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import unittest
from telemetry import decorators
from telemetry.core.platform import win_platform_backend
from telemetry.core.platform.power_... |
Update Border Colour for ClassicButtonToggle | import { css } from 'styled-components';
import { THEMES } from '../../style/themes';
export default ({ theme }) => theme.name === THEMES.classic && css`
height: 47px;
font-weight: 900;
border: 1px solid #ccd6db;
input:checked ~ & {
color: ${theme.colors.white};
background-color: #1573e6;
}
input... | import { css } from 'styled-components';
import { THEMES } from '../../style/themes';
export default ({ theme }) => theme.name === THEMES.classic && css`
height: 47px;
font-weight: 900;
input:checked ~ & {
color: ${theme.colors.white};
background-color: #1573e6;
}
input:focus ~ & {
outline: 0;
... |
Add version number to menu screen | package com.chaquo.python.demo;
import android.content.pm.*;
import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;
public class MainActivity extends AppCompatActivity {
@Override
protect... | package com.chaquo.python.demo;
import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle saved... |
Fix missing import in contrib script added in [2630].
git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@2631 af82e41b-90c4-0310-8c96-b1721e28e2e2 | #!/usr/bin/env python
#
# This script completely migrates a <= 0.8.x Trac environment to use the new
# default ticket model introduced in Trac 0.9.
#
# In particular, this means that the severity field is removed (or rather
# disabled by removing all possible values), and the priority values are
# changed to the more... | #!/usr/bin/env python
#
# This script completely migrates a <= 0.8.x Trac environment to use the new
# default ticket model introduced in Trac 0.9.
#
# In particular, this means that the severity field is removed (or rather
# disabled by removing all possible values), and the priority values are
# changed to the more... |
Move module name filtering into own function | <?php
declare(strict_types = 1);
namespace Raml2Apigility\Generator;
use Raml\ApiDefinition;
use Zend\ModuleManager\ModuleManager;
use ZF\Apigility\Admin\Model\ModuleModel;
use ZF\Apigility\Admin\Model\ModulePathSpec;
use Zend\I18n\Filter\Alpha as AlphaFilter;
use ZF\Configuration\ModuleUtils;
final class ModuleGene... | <?php
declare(strict_types = 1);
namespace Raml2Apigility\Generator;
use Raml\ApiDefinition;
use Zend\ModuleManager\ModuleManager;
use ZF\Apigility\Admin\Model\ModuleModel;
use ZF\Apigility\Admin\Model\ModulePathSpec;
use Zend\I18n\Filter\Alpha as AlphaFilter;
use ZF\Configuration\ModuleUtils;
final class ModuleGene... |
Solve a problem with Webpack 4 | var path = require('path')
var pkg = require('./package.json')
var UglifyjsPlugin = require('uglifyjs-webpack-plugin')
var BannerPlugin = require('webpack').BannerPlugin
module.exports = {
entry: {
'extenso': './index.js',
'extenso.min': './index.js'
},
output: {
filename: '[name].js',
path: path... | var path = require('path')
var pkg = require('./package.json')
var UglifyjsPlugin = require('uglifyjs-webpack-plugin')
var BannerPlugin = require('webpack').BannerPlugin
module.exports = {
entry: {
'extenso': './index.js',
'extenso.min': './index.js'
},
output: {
filename: '[name].js',
path: path... |
Add z-index to the Header | import styled from 'styled-components';
import { navbarHeight } from '../../common-styles/layout';
export const Wrapper = styled.nav`
align-items: center;
background-color: #fff;
color: #666;
display: flex;
flex-direction: row;
font-family: Raleway, 'Open Sans', Helvetica, sans-serif;
font-size: 14px;
... | import styled from 'styled-components';
import { navbarHeight } from '../../common-styles/layout';
export const Wrapper = styled.nav`
align-items: center;
background-color: #fff;
color: #666;
display: flex;
flex-direction: row;
font-family: Raleway, 'Open Sans', Helvetica, sans-serif;
font-size: 14px;
... |
Remove css to apply each time. | $('#dripbot-title').css({
"display": "inline-block",
"margin-right": "20px"
});
$('#dripbot').css({
"text-align": "left"
});
$('#dripbot-toggle.stop').css({
"background-color": "#e9656d",
"color": "white",
"margin-top": "-10px"
});
$('#dripbot ul li p').css({
"margin-bottom":"5px",
"margin-right": "... | $('#dripbot-title').css({
"display": "inline-block",
"margin-right": "20px"
});
$('#dripbot').css({
"text-align": "left"
});
$('#dripbot-toggle.stop').css({
"background-color": "#e9656d",
"color": "white",
"margin-top": "-10px"
});
$('#dripbot ul li p').css({
"margin-bottom":"5px",
"margin-right": "... |
Add some spacing to search results | // @flow
import React, { Component } from 'react';
import { Link } from 'react-router';
import ALL_DATA from '../fixtures/alldata.js';
class SearchResultItem extends Component {
render() {
const { id, title, previewText, authors, year, currentSearch} = this.props;
const boldTerms = function(text, term){
... | // @flow
import React, { Component } from 'react';
import { Link } from 'react-router';
import ALL_DATA from '../fixtures/alldata.js';
class SearchResultItem extends Component {
render() {
const { id, title, previewText, authors, year, currentSearch} = this.props;
const boldTerms = function(text, term){
... |
Break dependency on profiler to the json package
This lays more of the groundwork for the core package to
no longer be split (required for Java 9 modules) without
us having to do a lot of additional work or move classes
around. | // Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you m... | // Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you m... |
Write initial response using bytes.Buffer | package eventsource
import (
"bytes"
"fmt"
"net/http"
)
const header string = `HTTP/1.1 200 OK
Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-alive
Access-Control-Allow-Credentials: true`
const body string = "\n\nretry: 2000\n"
func Handler (res http.ResponseWriter, req *http.Request... | package eventsource
import (
"fmt"
"net/http"
)
var header string = `HTTP/1.1 200 OK
Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-alive
Access-Control-Allow-Origin: %s
Access-Control-Allow-Credentials: true
retry: 2000
`
func Handler (res http.ResponseWriter, req *http.Request) {
h... |
Fix copy page when permission is disabled | # -*- coding: utf-8 -*-
from django.utils.html import conditional_escape
from django.core.serializers.json import DjangoJSONEncoder
class SafeJSONEncoder(DjangoJSONEncoder):
def _recursive_escape(self, o, esc=conditional_escape):
if isinstance(o, dict):
return type(o)((esc(k), self._recursive_... | # -*- coding: utf-8 -*-
from django.utils.html import conditional_escape
from django.core.serializers.json import DjangoJSONEncoder
class SafeJSONEncoder(DjangoJSONEncoder):
def _recursive_escape(self, o, esc=conditional_escape):
if isinstance(o, dict):
return type(o)((esc(k), self._recursive_... |
Revert "format to 'n/a' if no value is passed to the formatter"
This reverts commit 17bcf50a6d27b0221ae56c6a060ea2e6f1d2f240. | /* @flow */
/**
* @jsx React.DOM
*/
'use strict';
var React = require('react');
var CheckboxEditor = React.createClass({
PropTypes : {
value : React.PropTypes.bool.isRequired,
rowIdx : React.PropTypes.number.isRequired,
column: React.PropTypes.shape({
key: React.PropTypes.stri... | /* @flow */
/**
* @jsx React.DOM
*/
'use strict';
var React = require('react');
var CheckboxEditor = React.createClass({
PropTypes : {
value : React.PropTypes.bool.isRequired,
rowIdx : React.PropTypes.number.isRequired,
column: React.PropTypes.shape({
key: React.PropTypes.stri... |
ENH: Use emailadministrator in createpublicdashboard test | <?php
// kwtest library
require_once('kwtest/kw_web_tester.php');
require_once('kwtest/kw_db.php');
class CreatePublicDashboardTestCase extends KWWebTestCase
{
var $url = null;
var $db = null;
function __construct()
{
parent::__construct();
require('config.test.php');
$this->url = $configure['urlwe... | <?php
// kwtest library
require_once('kwtest/kw_web_tester.php');
require_once('kwtest/kw_db.php');
class CreatePublicDashboardTestCase extends KWWebTestCase
{
var $url = null;
var $db = null;
function __construct()
{
parent::__construct();
require('config.test.php');
$this->url = $configure['urlwe... |
Use parameter instead of hardcoded "manual" | package camelinaction;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Processor to stop a route by its name
*/
public class StopRouteProcessor implements Processor {
private final static Logger LOG = LoggerFactory.getLogger(St... | package camelinaction;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Processor to stop a route by its name
*/
public class StopRouteProcessor implements Processor {
private final static Logger LOG = LoggerFactory.getLogger(St... |
Add css to grunt watch. | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';',
},
dist: {
src: ['js/actions.js', 'js/main.js', 'js/vendor/fuse.min.js'],
dest: 'js/dist/built.js',
},
},
watch: {
... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';',
},
dist: {
src: ['js/actions.js', 'js/main.js', 'js/vendor/fuse.min.js'],
dest: 'js/dist/built.js',
},
},
watch: {
... |
Remove an unneeded method from Feed class | import equal from 'deep-equal';
export default class Feed {
constructor(api, path, params) {
this.api = api;
this.path = path;
this.params = params;
this.nextURL = undefined;
this.items = [];
}
fetchAll() {
return new Promise((resolve, reject) => {
const next = () => {
if... | import equal from 'deep-equal';
export default class Feed {
constructor(api, path, params) {
this.api = api;
this.path = path;
this.params = params;
this.nextURL = undefined;
this.items = [];
}
sameAs(other) {
return this.path == other.path && equal(this.params, other.params);
}
f... |
Fix a missing property bug | <?php
namespace Transmission\Model;
use Transmission\Client;
/**
* Base class for Transmission models
*
* @author Ramon Kleiss <ramon@cubilon.nl>
*/
abstract class AbstractModel implements ModelInterface
{
/**
* @var Transmission\Client
*/
protected $client;
/**
* Constructor
*
... | <?php
namespace Transmission\Model;
use Transmission\Client;
/**
* Base class for Transmission models
*
* @author Ramon Kleiss <ramon@cubilon.nl>
*/
abstract class AbstractModel implements ModelInterface
{
/**
* Constructor
*
* @param Transmission\Client $client
*/
public function __co... |
Change namespace name to Coolblue | "use strict";
var Hapi = require("hapi");
var halacious = require("halacious");
var fs = require("fs");
var MongoDbConnection = require("./lib/services/mongoDb");
const config = require("./etc/conf.json");
var server = new Hapi.Server();
server.connection(config.connection);
server.register(halacious, function reg... | "use strict";
var Hapi = require("hapi");
var halacious = require("halacious");
var fs = require("fs");
var MongoDbConnection = require("./lib/services/mongoDb");
const config = require("./etc/conf.json");
var server = new Hapi.Server();
server.connection(config.connection);
server.register(halacious, function reg... |
Use abs time in <= 1.5.2 | package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_4_5_6_7_8_9r1_9r2_10_11_12r1_12r2;
import protocolsupport.api.ProtocolVersion;
import protocolsupport.protocol.packet.ClientBoundPacket;
import protocolsupport.protocol.packet.middle.clientbound.play.MiddleTimeUpdate;
import protocolsupport.protocol... | package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_4_5_6_7_8_9r1_9r2_10_11_12r1_12r2;
import protocolsupport.api.ProtocolVersion;
import protocolsupport.protocol.packet.ClientBoundPacket;
import protocolsupport.protocol.packet.middle.clientbound.play.MiddleTimeUpdate;
import protocolsupport.protocol... |
Remove runtime dep on python-pbr, python-d2to1
Requires RPM spec to fill in REDHATCINDERVERSION. | # Copyright 2011 OpenStack Foundation
#
# 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 l... | # Copyright 2011 OpenStack Foundation
#
# 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 l... |
Remove SA from the blueprints | /*
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* 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 ap... | /*
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* 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 ap... |
Enforce parens around all ES6 arrow functions | module.exports = {
"extends": "chiton/configurations/default",
"env": {
"es6": true
},
"ecmaFeatures": {
"modules": true
},
"rules": {
"arrow-body-style": [2, "as-needed"],
"arrow-parens": [2, "always"],
"arrow-spacing": [2, {"after": true, "before": true}],
"no-arrow-condition": 2,
... | module.exports = {
"extends": "chiton/configurations/default",
"env": {
"es6": true
},
"ecmaFeatures": {
"modules": true
},
"rules": {
"arrow-body-style": [2, "as-needed"],
"arrow-parens": [2, "as-needed"],
"arrow-spacing": [2, {"after": true, "before": true}],
"no-arrow-condition": ... |
Use option instead of argument | <?php
/**
* @copyright Frederic G. Østby
* @license http://www.makoframework.com/license
*/
namespace mako\application\commands\migrations;
use mako\application\commands\migrations\Command;
use mako\application\commands\migrations\RollbackTrait;
/**
* Command that rolls back the last batch of migrations.
*... | <?php
/**
* @copyright Frederic G. Østby
* @license http://www.makoframework.com/license
*/
namespace mako\application\commands\migrations;
use mako\application\commands\migrations\Command;
use mako\application\commands\migrations\RollbackTrait;
/**
* Command that rolls back the last batch of migrations.
*... |
Fix inverted coordinate bug in Compass .PLT Parser example script | #!/usr/bin/env python
import sys
import networkx as nx
from matplotlib import pyplot
from davies.compass.plt import CompassPltParser
def pltparser(pltfilename):
parser = CompassPltParser(pltfilename)
plt = parser.parse()
g = nx.Graph()
pos = {}
ele = {}
for segment in plt:
prev = ... | #!/usr/bin/env python
import sys
import networkx as nx
from matplotlib import pyplot
from davies.compass.plt import CompassPltParser
def pltparser(pltfilename):
parser = CompassPltParser(pltfilename)
plt = parser.parse()
g = nx.Graph()
pos = {}
ele = {}
for segment in plt:
prev =... |
Clarify AfterEach execution flow (naming) | package com.greghaskins.spectrum;
import com.greghaskins.spectrum.Spectrum.Block;
import java.util.ArrayList;
import java.util.List;
class AfterEachBlock implements Block {
private final List<Block> blocks;
public AfterEachBlock() {
this.blocks = new ArrayList<>();
}
@Override
public void run() thro... | package com.greghaskins.spectrum;
import com.greghaskins.spectrum.Spectrum.Block;
import java.util.ArrayList;
import java.util.List;
class AfterEachBlock implements Block {
private final List<Block> blocks;
public AfterEachBlock() {
this.blocks = new ArrayList<>();
}
@Override
public void run() thro... |
Fix typo in form (Submit button, label -> value) | <?php
namespace CdliTwoStageSignup\Form;
use Zend\Form\Form,
Zend\Form\Element\Csrf,
ZfcUser\Mapper\UserInterface as UserMapper,
ZfcBase\Form\ProvidesEventsForm;
class EmailVerification extends ProvidesEventsForm
{
public function __construct()
{
parent::__construct();
$this->add... | <?php
namespace CdliTwoStageSignup\Form;
use Zend\Form\Form,
Zend\Form\Element\Csrf,
ZfcUser\Mapper\UserInterface as UserMapper,
ZfcBase\Form\ProvidesEventsForm;
class EmailVerification extends ProvidesEventsForm
{
public function __construct()
{
parent::__construct();
$this->add... |
Fix duplicated classnames being applied to list items | import React, {PropTypes} from 'react';
import Util from '../Util/Util';
const CSSTransitionGroup = React.addons.CSSTransitionGroup;
export default class ListItem extends React.Component {
render() {
let Tag = this.props.tag;
// Uses all passed properties as attributes, excluding propTypes
let attribu... | import classNames from 'classnames';
import React, {PropTypes} from 'react';
import Util from '../Util/Util';
const CSSTransitionGroup = React.addons.CSSTransitionGroup;
export default class ListItem extends React.Component {
render() {
let defaultClass = ListItem.defaultProps.className;
let classes = clas... |
Make the paths not relative, so tests can be run from anywhere. | # -*- coding: utf-8 -*-
import os, os.path
import sys
import unittest
from macrotest import JSONSpecMacroTestCaseFactory
def JSONTestCaseLoader(tests_path, recursive=False):
"""
Load JSON specifications for Jinja2 macro test cases from the given
path and returns the resulting test classes.
This fun... | # -*- coding: utf-8 -*-
import os, os.path
import sys
import unittest
from macrotest import JSONSpecMacroTestCaseFactory
def JSONTestCaseLoader(tests_path, recursive=False):
"""
Load JSON specifications for Jinja2 macro test cases from the given
path and returns the resulting test classes.
This fun... |
Fix an import error. pylons.config doesn't exist anymore, use pylons.configuration | """Base objects to be exported for use in Controllers"""
from paste.registry import StackedObjectProxy
from pylons.configuration import config
__all__ = ['app_globals', 'c', 'cache', 'config', 'g', 'request', 'response',
'session', 'tmpl_context', 'url']
def __figure_version():
try:
from pkg_r... | """Base objects to be exported for use in Controllers"""
from paste.registry import StackedObjectProxy
from pylons.config import config
__all__ = ['app_globals', 'c', 'cache', 'config', 'g', 'request', 'response',
'session', 'tmpl_context', 'url']
def __figure_version():
try:
from pkg_resource... |
Add error handler for express | import express from 'express';
import handleRoutes from './handle-routes';
import config from './commons/config';
import connectDb from './commons/db';
const app = express();
handleRoutes(app);
app.use((err, req, res, next) => {
console.error(err.stack);
res.status(500).json({ error: 'Something failed!' });
ne... | import express from 'express';
import handleRoutes from './handle-routes';
import config from './commons/config';
import connectDb from './commons/db';
const app = express();
handleRoutes(app);
// app.start = () => {
// return connectDb()
// .then(() => {
// app.listen(config.app.port, config.app.host, (... |
Allow TestAgent pass a CA to request |
/**
* Module dependencies.
*/
var Agent = require('superagent').agent
, methods = require('methods')
, http = require('http')
, Test = require('./test');
/**
* Expose `Agent`.
*/
module.exports = TestAgent;
/**
* Initialize a new `TestAgent`.
*
* @param {Function|Server} app
* @param {Object} options... |
/**
* Module dependencies.
*/
var Agent = require('superagent').agent
, methods = require('methods')
, http = require('http')
, Test = require('./test');
/**
* Expose `Agent`.
*/
module.exports = TestAgent;
/**
* Initialize a new `TestAgent`.
*
* @param {Function|Server} app
* @api public
*/
functi... |
Solve 1000 digit fib number | '''
Problem 025
The Fibonacci sequence is defined by the recurrence relation:
Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
Hence the first 12 terms will be:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 144
The 12th term, F12, is the first term to contain three digits.
What... | '''
Problem 025
The Fibonacci sequence is defined by the recurrence relation:
Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
Hence the first 12 terms will be:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 144
The 12th term, F12, is the first term to contain three digits.
What... |
Add example for werkzeug middleware installation. | from sling import Application
from sling.core.logger import logger
from sling.ext import hello
import localmodule
app = Application([
hello,
])
# Other way of installing a module
app.add_module(localmodule)
# Install a Falcon middleware
class HelloMiddleware(object):
def process_request(self, req, res):
... | from sling import Application
from sling.core.logger import logger
from sling.ext import hello
import localmodule
app = Application([
hello,
])
# Other way of installing a module
app.add_module(localmodule)
# Install a Falcon middleware
class HelloMiddleware(object):
def process_request(self, req, res):
... |
Make canUndo true because @jaredlll08 told me to. | package joshie.harvest.plugins.crafttweaker;
import minetweaker.IUndoableAction;
import minetweaker.api.item.IIngredient;
import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
public abstract class BaseUndoable implements IUndoableAction {
private boolean applied;
@Override
p... | package joshie.harvest.plugins.crafttweaker;
import minetweaker.IUndoableAction;
import minetweaker.api.item.IIngredient;
import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
public abstract class BaseUndoable implements IUndoableAction {
private boolean applied;
@Override
p... |
Split system import and project import | import time
from chainer.training import extension
def observe_value(key, target_func):
"""Returns a trainer extension to continuously record a value.
Args:
key (str): Key of observation to record.
target_func (function): Function that returns the value to record.
It must take on... | from chainer.training import extension
import time
def observe_value(key, target_func):
"""Returns a trainer extension to continuously record a value.
Args:
key (str): Key of observation to record.
target_func (function): Function that returns the value to record.
It must take one... |
Fix tests for Python 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
import types
from rakuten_ws.webservice import RakutenWebService
from rakuten_ws.base import RakutenAPIResponse
@pytest.mark.online
def test_response(credentials):
ws = RakutenWebService(**credentials)
response = ws.ichiba.item.sea... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
import types
from rakuten_ws.webservice import RakutenWebService
from rakuten_ws.base import RakutenAPIResponse
@pytest.mark.online
def test_response(credentials):
ws = RakutenWebService(**credentials)
response = ws.ichiba.item.sea... |
Fix name for extra arguments | #!/usr/bin/env python
from setuptools import setup
version = '0.6.0.dev'
required = open('requirements.txt').read().split('\n')
extra = {'all': ['mist', 'rime']}
setup(
name='thunder-python',
version=version,
description='large-scale image and time series analysis',
author='freeman-lab',
author_... | #!/usr/bin/env python
from setuptools import setup
version = '0.6.0.dev'
required = open('requirements.txt').read().split('\n')
extra = {'all': ['mist', 'rime']}
setup(
name='thunder-python',
version=version,
description='large-scale image and time series analysis',
author='freeman-lab',
author_... |
Change camelCasing strategy for `target_age` and `target_group` | from hvad.contrib.restframework import TranslatableModelSerializer
from rest_framework import serializers
from rest_framework.reverse import reverse
from .models import Category, TargetGroup, TargetAge, Event
from pagoeta.apps.core.functions import get_absolute_uri
from pagoeta.apps.places.serializers import PlaceList... | from hvad.contrib.restframework import TranslatableModelSerializer
from rest_framework import serializers
from rest_framework.reverse import reverse
from .models import Category, TargetGroup, TargetAge, Event
from pagoeta.apps.core.functions import get_absolute_uri
from pagoeta.apps.places.serializers import PlaceList... |
[IMPROVED] Debug logging for purgeArchive calls | #!/usr/bin/php
<?php
/*
Copyright:: 2013, Sebastian Grewe
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | #!/usr/bin/php
<?php
/*
Copyright:: 2013, Sebastian Grewe
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... |
Allow Herald rules to apply "only the first time" to Calendar events
Summary: Fixes T12821. (Some events only happen once, so the default behavior doesn't let you pick this rule, and objects must opt into it by saying "yeah, I support multiple edits".)
Test Plan:
Note "only the first time" selected:
{F4999093}
Revi... | <?php
final class PhabricatorCalendarEventHeraldAdapter extends HeraldAdapter {
private $object;
public function getAdapterApplicationClass() {
return 'PhabricatorCalendarApplication';
}
public function getAdapterContentDescription() {
return pht('React to events being created or updated.');
}
... | <?php
final class PhabricatorCalendarEventHeraldAdapter extends HeraldAdapter {
private $object;
public function getAdapterApplicationClass() {
return 'PhabricatorCalendarApplication';
}
public function getAdapterContentDescription() {
return pht('React to events being created or updated.');
}
... |
Make print_filelist sort the list before printing | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in sorted(filelist):
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_... | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in filelist:
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_files, m... |
Tag updated and download link added | import os
from setuptools import setup
from setuptools import find_packages
setup(
name='MobOff',
version='0.2',
py_modules=['moboff'],
packages=find_packages(),
description = 'Download youtube music and send to devices',
author = 'Parth Verma',
author_email = '... | import os
from setuptools import setup
from setuptools import find_packages
setup(
name='MobOff',
version='0.1',
py_modules=['moboff'],
packages=find_packages(),
description = 'Download youtube music and send to devices',
author = 'Parth Verma',
author_email = '... |
Indent Gist file name with '»' character | package com.github.mobile.android.gist;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.github.mobile.android.R.layout;
import org.eclipse.egit.github.core.GistFile;
/**
* Adapter for viewing the fi... | package com.github.mobile.android.gist;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.github.mobile.android.R;
import org.eclipse.egit.github.core.GistFile;
/**
* Adapter for viewing the files in ... |
Remove leftover line in solution for 01_keras | model = Sequential()
model.add(Dense(hidden_dim, input_dim=input_dim,
activation="tanh"))
model.add(Dense(output_dim, activation="softmax"))
optimizer = optimizers.SGD(lr=0.1, momentum=0.9, nesterov=True)
model.compile(optimizer=optimizer, loss='categorical_crossentropy',
metrics=['accura... | model = Sequential()
model.add(Dense(hidden_dim, input_dim=input_dim,
activation="tanh"))
model.add(Dense(output_dim, activation="softmax"))
model.add(Activation("softmax"))
optimizer = optimizers.SGD(lr=0.1, momentum=0.9, nesterov=True)
model.compile(optimizer=optimizer, loss='categorical_crossentropy... |
Move KMS key retrieval to its own function. | 'use strict';
const AWS = require('aws-sdk');
const Err = require('./error');
const upload = require('multer')();
const rp = require('request-promise');
// Hit the Vault health check endpoint to see if we're actually working with a Vault server
/**
* Checks whether there is an actual Vault server running at the Va... | 'use strict';
const AWS = require('aws-sdk');
const Err = require('./error');
const upload = require('multer')();
const rp = require('request-promise');
// Hit the Vault health check endpoint to see if we're actually working with a Vault server
/**
* Checks whether there is an actual Vault server running at the Va... |
Add replace double quotation mark from configuration file parameters. | import configparser
from blo.BloArticle import BloArticle
from blo.DBControl import DBControl
class Blo:
def __init__(self, config_file_path):
config = configparser.ConfigParser()
config.read(config_file_path)
self._db_file_path = config['DB']['DB_PATH'].replace('"', '')
self._temp... | import configparser
from blo.BloArticle import BloArticle
from blo.DBControl import DBControl
class Blo:
def __init__(self, config_file_path):
config = configparser.ConfigParser()
config.read(config_file_path)
self._db_file_path = config['DB']['DB_PATH']
self._template_dir = config... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.