text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Add ability to delete entries
This also sorts entries as they are added. These two additions will allow us to move entries via a GUI | class Interpolator {
constructor() {
this.data = [];
}
addIndexValue(index, value) {
this.data.push({index: index, value: value});
// make sure items are in ascdending order by index
this.data.sort((a, b) => a.index - b.index);
}
removeIndex(index) {
for (v... | class Interpolator {
constructor() {
this.data = [];
}
addIndexValue(index, value) {
this.data.push({index: index, value: value});
// make sure items are in ascdending order by index
//this.data.sort((a, b) => a.index - b.index);
}
valueAtIndex(target_index) {
... |
Work on includes, left debug messages inside (for later) | package in.twizmwaz.cardinal.util;
import org.bukkit.Bukkit;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
public class DomUtils {
public static Document par... | package in.twizmwaz.cardinal.util;
import org.bukkit.Bukkit;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Path;
public class DomUtils ... |
Update default queryset for formsets | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP, Campaign
def create_edit_prospectus(request):
if request.... | from django.core.urlresolvers import reverse
from django.shortcuts import redirect, render_to_response
from django.template import RequestContext
from campaign.forms import CampaignFormSet, ProspectusForm
from campaign.models import PROSPECTUS_FIELD_HELP
def create_edit_prospectus(request):
if request.method == ... |
Add ConcurrentSkipListSet set with naturel order of elements | package com.spring.example.concurrency.collections;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
public class SetCollection {
/**
* ConcurrentSkipListSet store elements like natural order collection
*
* @param args command line arguments
*/
public static void m... | package com.spring.example.concurrency.collections;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
public class SetCollection {
/**
* ConcurrentSkipListSet store elements like natural order collection
*
* @param args command line arguments
*/
public static void m... |
Fix the fspath interface and div docstring. | from zope.interface import Interface
from filesystems import _PY3
class Path(Interface):
def __str__():
"""
Render the path as a string.
"""
if _PY3:
def __fspath__():
"""
Render the path as a string.
"""
def __truediv__(other):
... | from zope.interface import Interface
from filesystems import _PY3
class Path(Interface):
def __str__():
"""
Render the path as a string.
"""
if _PY3:
def __truediv__(other):
"""
Traverse to a child of this path.
"""
def __fspath__(... |
Fix bug when no DI for methods is used | (function (ng) {
'use strict';
/**
* Angular.js utility for cleaner dependency injection.
*/
var $inject = function (cls, self, args) {
var i;
var key;
var str;
var func;
var depNames = [];
var deps = [];
var l = cls.$inject.length;
// Inject all dependencies into the self ... | (function (ng) {
'use strict';
/**
* Angular.js utility for cleaner dependency injection.
*/
var $inject = function (cls, self, args) {
var i;
var key;
var str;
var func;
var depNames = [];
var deps = [];
var l = cls.$inject.length;
// Inject all dependencies into the self ... |
TST: Remove deleted subpackage. Add better args to pytest | #!/usr/bin/env python
# tests require pytest-cov and pytest-xdist
import os
import signal
import sys
import pytest
try:
from pcaspy import Driver, SimpleServer
from multiprocessing import Process
def to_subproc():
prefix = 'BSTEST:'
pvdb = {
'VAL': {
'prec': 3... | #!/usr/bin/env python
# tests require pytest-cov and pytest-xdist
import os
import signal
import sys
from bluesky.testing.noseclasses import KnownFailure
import pytest
try:
from pcaspy import Driver, SimpleServer
from multiprocessing import Process
def to_subproc():
prefix = 'BSTEST:'
pv... |
:wrench: Improve minification of browser bundle. | "use strict";
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const env = process.env.NODE_ENV;
const config = {
context: `${__dirname}/src`,
resolve: {
extensions: ['','.ts','.js']
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin()
... | "use strict";
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
const env = process.env.NODE_ENV;
const config = {
context: `${__dirname}/src`,
resolve: {
extensions: ['','.ts','.js']
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin()
... |
Make event search actually useful | from __future__ import absolute_import
from sentry.api.base import DocSection
from sentry.api.bases import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.api.paginator import DateTimePaginator
from sentry.models import Event, Group
from sentry.utils.apidocs import scenario, attach_scenarios
@... | from __future__ import absolute_import
from sentry.api.base import DocSection
from sentry.api.bases import GroupEndpoint
from sentry.api.serializers import serialize
from sentry.api.paginator import DateTimePaginator
from sentry.models import Event, Group
from sentry.utils.apidocs import scenario, attach_scenarios
@... |
Use updated registry in Ember 2.1 | import Ember from 'ember';
export function initialize(instance) {
var config;
if (instance.resolveRegistration) {
// Ember 2.1+
// http://emberjs.com/blog/2015/08/16/ember-2-1-beta-released.html#toc_registry-and-container-reform
config = instance.resolveRegistration('config:environment');
} else {
... | import Ember from 'ember';
export function initialize(instance) {
const config = instance.container.lookupFactory('config:environment');
// Default to true when not set
let _includeRouteName = true;
if (config['ember-body-class'] && config['ember-body-class'].includeRouteName === false) {
_includeRouteNam... |
Revert "only calls unhighlight on mouseout when necessary"
This reverts commit 0172733d1299ed3b86a3bb91345d4611f72e166b. | $(document).ready(function() {
$(".btn.year").click(function(e){
var target = $(e.target);
target.toggleClass("primary");
renderSelection();
});
$(".btn.story").click(function(e){
var target = $(e.target);
target.toggleClass("primary");
... | $(document).ready(function() {
$(".btn.year").click(function(e){
var target = $(e.target);
target.toggleClass("primary");
renderSelection();
});
$(".btn.story").click(function(e){
var target = $(e.target);
target.toggleClass("primary");
... |
Fix page size text when 'All' is selected | import React, { Component, PropTypes } from 'react';
const propTypes = {
pageSize: PropTypes.number.isRequired,
totalSize: PropTypes.number.isRequired,
onChange: PropTypes.func.isRequired,
className: PropTypes.string,
};
class PageSize extends Component {
render() {
const {
pageSize,
totalSi... | import React, { Component, PropTypes } from 'react';
const propTypes = {
pageSize: PropTypes.number.isRequired,
totalSize: PropTypes.number.isRequired,
onChange: PropTypes.func.isRequired,
className: PropTypes.string,
};
class PageSize extends Component {
render() {
const {
pageSize,
totalSi... |
Fix exception call in loop() | <?php
declare(strict_types=1);
namespace Funktions;
use Exception;
/**
* Return a value based on a test
*
* @param boolean $test
* @param callable $truthy
* @param callable $falsy
* @return mixed
*/
function condition(bool $test, callable $truthy, callable $falsy)
{
if ($test) {
return call_user_... | <?php
declare(strict_types=1);
namespace Funktions;
/**
* Return a value based on a test
*
* @param boolean $test
* @param callable $truthy
* @param callable $falsy
* @return mixed
*/
function condition(bool $test, callable $truthy, callable $falsy)
{
if ($test) {
return call_user_func($truthy);
... |
Change way to load cordova.js | /*globals Polymer */
'use strict';
Polymer(
{
is: 'cordova-core',
properties: {
/**
* Return if cordova deviceready event has been fired.
*/
ready: {
notify: true,
readOnly: true,
type: Boolean,
value: false
},
/**
* Return if cor... | /*globals Polymer */
'use strict';
Polymer(
{
is: 'cordova-core',
properties: {
/**
* Return if cordova deviceready event has been fired.
*/
ready: {
notify: true,
readOnly: true,
type: Boolean,
value: false
},
/**
* Return if cor... |
Trim initial slash on names | <?php
namespace StrictPhp\TypeFinder;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Tag\VarTag;
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\ContextFactory;
use ReflectionProperty;
final class PropertyTypeFinder
{
/**
* @param ReflectionPropert... | <?php
namespace StrictPhp\TypeFinder;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Tag\VarTag;
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\ContextFactory;
use ReflectionProperty;
final class PropertyTypeFinder
{
/**
* @param ReflectionPropert... |
Change URL for deleting competition
Still doesn't work, see issue #48 | angular.module("AdminHome", []).controller("AdminHomeController", function ($scope, $http) {
$scope.competitionId = competitionId
updateCompetitionList()
$scope.addCompetition = function () {
var competition = {name: $scope.competitionName}
$http.post("/api/competitions", competition).then(function (re... | angular.module("AdminHome", []).controller("AdminHomeController", function ($scope, $http) {
$scope.competitionId = competitionId
updateCompetitionList()
$scope.addCompetition = function () {
var competition = {name: $scope.competitionName}
$http.post("/api/competitions", competition).then(function (re... |
Print key on click (try 5 - button) | function displayKeys() {
// Retrieve all keyPairs
var sql = "select K.name from key K";
dbRetrieve(sql, [], function(res) {
// Populate key list
var html = '<hr>';
for (var i = 0; i < 1; ++i) {
var keyName = res.rows.item(i).name;
html += '<button onclick=... | function displayKeys() {
// Retrieve all keyPairs
var sql = "select K.name from key K";
dbRetrieve(sql, [], function(res) {
// Populate key list
var html = '<hr>';
for (var i = 0; i < res.rows.length; ++i) {
var keyName = res.rows.item(i).name;
html += '<s... |
Revert "Unsetting non-existant key does not throw notice/error, so unset without checking"
This reverts commit 532b3e771755fda3909fc46a02211dfc3317730d. | <?php
namespace Puphpet\Domain\PuppetModule;
class Server extends PuppetModuleAbstract implements PuppetModuleInterface
{
protected $server;
public function __construct($server)
{
$this->server = is_array($server) ? $server : array();
}
/**
* Return ready to use server array
*
... | <?php
namespace Puphpet\Domain\PuppetModule;
class Server extends PuppetModuleAbstract implements PuppetModuleInterface
{
protected $disallowedPackages = ['python-software-properties'];
protected $server;
public function __construct($server)
{
$this->server = is_array($server) ? $server : arr... |
Fix build on python 2.6 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import socket
from sphinx.application import Sphinx
from six import StringIO
from .base import unittest
from .tmpdir import temp_dir
ROOT_DIR = os.path.dirname(__file__)
DOCS_DIR = os.path.abspath(os.path.join(ROOT_DIR, u'..', u'..', u'docs'))
... | # -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import socket
from sphinx.application import Sphinx
from six import StringIO
from .base import unittest
from .tmpdir import temp_dir
from unittest import skipIf
ROOT_DIR = os.path.dirname(__file__)
DOCS_DIR = os.path.abspath(os.path.join(ROOT_DI... |
Add support for Monolog 1.2.0 | <?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\Bridge\Monolog\Handler;
use Monolog\Logger;
use Monolog\Handler... | <?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\Bridge\Monolog\Handler;
use Monolog\Logger;
use Monolog\Handler... |
Fix double quotes in analyzer testcase | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint='http://di.uoa.gr/',
prefix='test',
alpha... | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint="http://di.uoa.gr/",
prefix="test",
alpha... |
Use mounted instead of compiled
Because compiled is removed.
Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com> | 'use strict';
$(document).ready(()=> {
new Vue({
el: "#fluent-log",
paramAttributes: ["logUrl", "initialAutoReload"],
data: {
"autoFetch": false,
"logs": [],
"limit": 30,
"processing": false
},
mounted: function(){
this.fetchLogs();
var self = this;
var ... | 'use strict';
$(document).ready(()=> {
new Vue({
el: "#fluent-log",
paramAttributes: ["logUrl", "initialAutoReload"],
data: {
"autoFetch": false,
"logs": [],
"limit": 30,
"processing": false
},
compiled: function(){
this.fetchLogs();
var self = this;
var... |
Add a new option allowing client code to turn off parallelism | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... | import featureflow as ff
from random_samples import ShuffledSamples
from random_samples import InfiniteSampler
from preprocess import PreprocessingPipeline
def learning_pipeline():
class LearningPipeline(ff.BaseModel):
samples = ff.PickleFeature(ff.IteratorNode)
shuffled = ff.PickleFeature(
... |
Remove from Spaces till implement toggle switch | <?php
namespace humhub\modules\twitter;
return [
'id' => 'twitter',
'class' => 'humhub\modules\twitter\Module',
'namespace' => 'humhub\modules\twitter',
'events' => [
[
'class' => \humhub\modules\dashboard\widgets\Sidebar::className(),
'event' => \humhub\modules\dashboa... | <?php
namespace humhub\modules\twitter;
return [
'id' => 'twitter',
'class' => 'humhub\modules\twitter\Module',
'namespace' => 'humhub\modules\twitter',
'events' => [
[
'class' => \humhub\modules\dashboard\widgets\Sidebar::className(),
'event' => \humhub\modules\dashboa... |
Fix some print statments for Python3 compatibility. | import csv
def read_axf(axf_string):
blocks = {}
state = 'new_block'
for line in axf_string.split('\n'):
if line == '[$]' or line == '':
pass
elif line.startswith('['):
block_key = line.replace('[',"").replace(']',"")
else:
if block_key not in ... | import csv
def read_axf(axf_string):
blocks = {}
state = 'new_block'
for line in axf_string.split('\n'):
if line == '[$]' or line == '':
pass
elif line.startswith('['):
block_key = line.replace('[',"").replace(']',"")
print block_key
else:
... |
Fix template var exports for directors | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... |
Fix crashes from misc. events | from __future__ import print_function
import time
from slackclient import SlackClient
import mh_python as mh
import argparse
import random
def main():
parser = argparse.ArgumentParser(
description="Slack chatbot using MegaHAL")
parser.add_argument(
"-t", "--token", type=str, help="Slack token"... | from __future__ import print_function
import time
from slackclient import SlackClient
import mh_python as mh
import argparse
import random
def main():
parser = argparse.ArgumentParser(
description="Slack chatbot using MegaHAL")
parser.add_argument(
"-t", "--token", type=str, help="Slack token"... |
Add HtmlWebpackPlugin for generating dev html files | var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/index'
... | var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/index'
],
output: {
path: path.join(__dirname, 'dis... |
Add get in progress content mehtod | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... | import http from '../http';
export default class collections {
static get(collectionID) {
return http.get(`/zebedee/collectionDetails/${collectionID}`)
.then(response => {
return response;
})
}
static getAll() {
return http.get(`/zebedee/collect... |
Add signal handler deregistration example | package com.github.hypfvieh.dbus.examples.signal;
import java.io.IOException;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder;
import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.handlers.AbstractPropertiesCh... | package com.github.hypfvieh.dbus.examples.signal;
import java.io.IOException;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder;
import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.handlers.AbstractPropertiesCh... |
Clean up how UI is used | 'use strict';
var Q = require('q'),
scorer = require('./scorer'),
ui = require('./ui');
module.exports = {
play: function(board, player_x, player_o) {
var self = this;
return Q.promise(function(resolve) {
self
.get_play(board, player_x, player_o)
... | 'use strict';
var Q = require('q'),
scorer = require('./scorer'),
print = require('./board/print');
module.exports = {
play: function(board, player_x, player_o) {
var self = this;
return Q.promise(function(resolve) {
self
.get_play(board, player_x, player_o)
... |
Fix issue with multiple files upload
Correctly handle onChange event using fileOrGroup primise | 'use strict';
/**
* @ngdoc directive
* @name angular-uploadcare.directive:Uploadcare
* @description Provides a directive for the Uploadcare widget.
* # Uploadcare
*/
angular.module('ng-uploadcare', [])
.directive('uploadcareWidget', function () {
return {
restrict: 'A',
require: 'ngModel',
... | 'use strict';
/**
* @ngdoc directive
* @name angular-uploadcare.directive:Uploadcare
* @description Provides a directive for the Uploadcare widget.
* # Uploadcare
*/
angular.module('ng-uploadcare', [])
.directive('uploadcareWidget', function () {
return {
restrict: 'A',
require: 'ngModel',
... |
Add bumpversion as a dev requirement. |
from setuptools import setup, find_packages
setup(
name='jawa',
packages=find_packages(),
version='2.1.1',
python_requires='>=3.6',
description='Doing fun stuff with JVM ClassFiles.',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
author=... |
from setuptools import setup, find_packages
setup(
name='jawa',
packages=find_packages(),
version='2.1.1',
python_requires='>=3.6',
description='Doing fun stuff with JVM ClassFiles.',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
author=... |
Fix index names in migrations
This can be reverted when we upgrade to Laravel 5.7. | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\... | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'... |
Add bluepring to table definition | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAnimalTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('animal', functio... | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAnimalTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('animal', functio... |
Reduce reprocessing factor from 90% to 86%. | <?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use App\TaxRate;
use App\ReprocessedMaterial;
use Illuminate\Support\Facades\Log;
class Updat... | <?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use App\TaxRate;
use App\ReprocessedMaterial;
use Illuminate\Support\Facades\Log;
class Updat... |
Correct remove element callback to onClick from onChange | import React, { Component, PropTypes } from 'react';
class CheckList extends Component {
checkInputKeyPress(evt) {
if (evt.key === 'Enter') {
this.props.taskCallbacks.add(this.props.cardId, evt.target.value);
evt.target.value = '';
}
}
render() {
let tasks = this.props.tasks.map((task, t... | import React, { Component, PropTypes } from 'react';
class CheckList extends Component {
checkInputKeyPress(evt) {
if (evt.key === 'Enter') {
this.props.taskCallbacks.add(this.props.cardId, evt.target.value);
evt.target.value = '';
}
}
render() {
let tasks = this.props.tasks.map((task, t... |
Add wrapping modulators for js and rename amd. | compiler.mode.compile = def(
[
compiler.bootstrap.generator,
compiler.compile.compiler,
compiler.compile.configurator
],
function (generator, compiler, configurator) {
var run = function (config, outdir /*, mains */) {
var mains = Array.prototype.slice.call(arguments, 2);
var modulat... | compiler.mode.compile = def(
[
compiler.bootstrap.generator,
compiler.compile.compiler,
compiler.compile.configurator
],
function (generator, compiler, configurator) {
var run = function (config, outdir /*, mains */) {
var mains = Array.prototype.slice.call(arguments, 2);
var modulat... |
Make the python script silent | #! /usr/bin/env python
import sys
import re
import yaml
FILE = sys.argv[1]
YAML = sys.argv[2]
TYPE = sys.argv[3]
header = open(YAML, "r")
text = open(FILE, "r")
copy = open(FILE+"_NEW", "wt")
docs = yaml.load_all(header)
for doc in docs:
if not doc == None:
if 'figure' in doc.keys():
for li... | #! /usr/bin/env python
import sys
import re
import yaml
FILE = sys.argv[1]
YAML = sys.argv[2]
TYPE = sys.argv[3]
header = open(YAML, "r")
text = open(FILE, "r")
copy = open(FILE+"_NEW", "wt")
docs = yaml.load_all(header)
for doc in docs:
if not doc == None:
if 'figure' in doc.keys():
for li... |
Add GUI support for Travis | module.exports = function(config) {
var configuration = {
client: {
captureConsole: false
},
plugins: [
'karma-chai',
'karma-sinon',
'karma-mocha',
'karma-chrome-launcher'
],
frameworks: ['mocha', 'sinon', 'chai']... | module.exports = function(config) {
config.set({
client: {
captureConsole: false
},
plugins: [
'karma-chai',
'karma-sinon',
'karma-mocha',
'karma-chrome-launcher'
],
frameworks: ['mocha', 'sinon', 'chai'],
... |
Use id_sequence_to_embedding and only forward document | import tensorflow as tf
from ..embedding import id_sequence_to_embedding, embeddings
from ..linear import linear
from ..dropout import dropout
def char2doc(document,
*,
char_space_size,
char_embedding_size,
document_embedding_size,
dropout_prob,
... | import tensorflow as tf
from ..embedding import embeddings_to_embedding, ids_to_embeddings, embeddings
from ..linear import linear
from ..dropout import dropout
def char2doc(forward_document,
backward_document,
*,
char_space_size,
char_embedding_size,
... |
Clean POST data after validation | <?php
/**
* FormSafe
*
* PHP version 5
*
* @category Library
* @package PyritePHP
* @author Stéphane Lavergne <lis@imars.com>
* @copyright 2016 Stéphane Lavergne
* @license https://opensource.org/licenses/MIT MIT
* @link https://github.com/vphantom/pyrite-php
*/
namespace FormSafe;
/**
* Pr... | <?php
/**
* FormSafe
*
* PHP version 5
*
* @category Library
* @package PyritePHP
* @author Stéphane Lavergne <lis@imars.com>
* @copyright 2016 Stéphane Lavergne
* @license https://opensource.org/licenses/MIT MIT
* @link https://github.com/vphantom/pyrite-php
*/
namespace FormSafe;
/**
* Pr... |
Make it work with new tg Jinja quickstart | from setuptools import setup, find_packages
import os
version = '0.5.1'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read()
except IOError:
README = CHANGES = ''
setup(name='tgext.admin'... | from setuptools import setup, find_packages
import os
version = '0.5.1'
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.txt')).read()
CHANGES = open(os.path.join(here, 'docs/HISTORY.txt')).read()
except IOError:
README = CHANGES = ''
setup(name='tgext.admin'... |
Add use strict to brunch config | 'use strict'
exports.config = {
files: {
javascripts: {
joinTo: {
'vendor.js': /^vendor/
},
entryPoints: {
'app/index.js': 'app.js'
}
},
stylesheets: {
joinTo: 'app.css'
}
},
plugins: {
postcss: {
processors: [
require('postcss-impo... | exports.config = {
files: {
javascripts: {
joinTo: {
'vendor.js': /^vendor/
},
entryPoints: {
'app/index.js': 'app.js'
}
},
stylesheets: {
joinTo: 'app.css'
}
},
plugins: {
postcss: {
processors: [
require('postcss-import')(),
... |
fix(Bundle): Update new package name including @plone scope. | process.traceDeprecation = true;
const package_json = require("./package.json");
const path = require("path");
const patternslib_config = require("@patternslib/patternslib/webpack/webpack.config");
const mf_config = require("@patternslib/patternslib/webpack/webpack.mf");
module.exports = (env, argv) => {
let confi... | process.traceDeprecation = true;
const package_json = require("./package.json");
const path = require("path");
const patternslib_config = require("@patternslib/patternslib/webpack/webpack.config");
const mf_config = require("@patternslib/patternslib/webpack/webpack.mf");
module.exports = (env, argv) => {
let confi... |
fix: Use timezone.now() instead of datetime.now() | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.utils import timezone
from nopassword.models import LoginCode
class NoPasswordBackend(ModelBackend):
def authe... | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from nopassword.models import LoginCode
class NoPasswordBackend(ModelBackend):
def authenticate(self, request, u... |
Fix the README file opening | from setuptools import setup
NAME = "sphinxcontrib-runcode"
VERSION = "0.0.1"
DESCRIPTION = "Post included code in an executable pastebin like codepad / ideone."
LONG_DESCRIPTION = open('README.md').read()
AUTHOR = "Senthil Kumaran (Uthcode)"
AUTHOR_EMAIL = "senthil@uthcode.com"
LICENSE = "BSD"
URL = "http://github.c... | from setuptools import setup
NAME = "sphinxcontrib-runcode"
VERSION = "0.0.1"
DESCRIPTION = "Post included code in an executable pastebin like codepad / ideone."
LONG_DESCRIPTION = open('README').read()
AUTHOR = "Senthil Kumaran (Uthcode)"
AUTHOR_EMAIL = "senthil@uthcode.com"
LICENSE = "BSD"
URL = "http://github.com/... |
Use self for php 5.3 | <?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
return new self(new \ReflectionClass($name));
}
public function getName()
... | <?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
return new static(new \ReflectionClass($name));
}
public function getName()
... |
Increase the timeout value for the VOMS Admin start-up from 60s to 120s.
Primarily, this is driven by occasional timeouts in the VMU tests, which
can run slowly on a heavily loaded host.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@18485 4e558342-562e-0410-864c-e07659590f8c | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... |
Create var for temp and pass into HTML document |
//Geolocation Function is listed below.
function geoLocation() {
var output = document.getElementById("out");
/*$.getJSON('https://ipinfo.io/geo', function(response) {
var loc = response.loc.split(',');
var coords = {
latitude: loc[0],
longitude: loc[1]
};
... |
//Geolocation Function is listed below.
function geoLocation() {
var output = document.getElementById("out");
/*$.getJSON('https://ipinfo.io/geo', function(response) {
var loc = response.loc.split(',');
var coords = {
latitude: loc[0],
longitude: loc[1]
};
... |
Replace slug field with get_slug function | from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import pgettext as _
from django_prices.models import PriceField
from mptt.models import MPTTModel
from satchless.item import ItemRange
from satchless.util.models import Subtyped
from unidecode import unidecode
impo... | from django.db import models
from django.utils.translation import pgettext as _
from django_prices.models import PriceField
from satchless.util.models import Subtyped
from satchless.item import ItemRange
from mptt.models import MPTTModel
class Category(MPTTModel):
name = models.CharField(_('Category field', 'nam... |
Use the same app as deployed by the setup script
Former-commit-id: 8fa2a956df16ece64642433626314625326d275c | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class TemplateTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-demo/templates.... | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class TemplateTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-test/templates.... |
Fix problem with clearing purpose in search
Closes #480 | import React, { Component, PropTypes } from 'react';
import FormControl from 'react-bootstrap/lib/FormControl';
import Panel from 'react-bootstrap/lib/Panel';
import Select from 'react-select';
class AdvancedSearch extends Component {
render() {
const {
isFetchingPurposes,
onFiltersChange,
filt... | import React, { Component, PropTypes } from 'react';
import FormControl from 'react-bootstrap/lib/FormControl';
import Panel from 'react-bootstrap/lib/Panel';
import Select from 'react-select';
class AdvancedSearch extends Component {
render() {
const {
isFetchingPurposes,
onFiltersChange,
filt... |
Implement HTTPS support for Docker | require('dotenv').config({
silent: true,
})
let makeHostConfig = (env, prefix) => {
let host = env[prefix + '_HOST'] || '127.0.0.1'
let port = parseInt(env[prefix + '_PORT'], 10) || 3030
let https = env[prefix + '_HTTPS'] === 'true' || env[prefix + '_HTTPS'] === true
let default_port, protocol
... | require('dotenv').config({
silent: true,
})
let makeHostConfig = (env, prefix) => {
let host = env[prefix + '_HOST'] || '127.0.0.1'
let port = parseInt(env[prefix + '_PORT'], 10) || 3030
let https = env[prefix + '_HTTPS'] === 'true' || env[prefix + '_HTTPS'] === true
let default_port, protocol
... |
Add error for invalid harness type | const { applyFieldDescriptor, createFieldDescriptor } = require("./fields.js");
class EntryFacade {
constructor(entry) {
this._entry = entry;
}
get entry() {
return entry;
}
get fields() {
return [
createFieldDescriptor(
this.entry,
... | const { applyFieldDescriptor, createFieldDescriptor } = require("./fields.js");
class EntryFacade {
constructor(entry) {
this._entry = entry;
}
get entry() {
return entry;
}
get fields() {
return [
createFieldDescriptor(
this.entry,
... |
Add a postbuild task to grunt to remove unnecessary build artifacts | module.exports = function(grunt) {
// load grunt tasks from package.json
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
clean: {
dist: [
'dist',
'robert/**/*.pyc',
],
postbuild: [
'dist/static/sass',
],
},
compass:... | module.exports = function(grunt) {
// load grunt tasks from package.json
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
clean: {
dist: [
'dist',
'robert/**/*.pyc',
]
},
compass: {
dist: {
options: {
sassDir: 'r... |
Set link failedCount to zero on success | <?php
class Denkmal_Maintenance_Cli extends CM_Maintenance_Cli {
/**
* @synchronized
*/
protected function _registerCallbacks() {
parent::_registerCallbacks();
$this->_registerClockworkCallbacks(new DateInterval('PT12H'), array(
'Scraper' => function () {
... | <?php
class Denkmal_Maintenance_Cli extends CM_Maintenance_Cli {
/**
* @synchronized
*/
protected function _registerCallbacks() {
parent::_registerCallbacks();
$this->_registerClockworkCallbacks(new DateInterval('PT12H'), array(
'Scraper' => function () {
... |
Refactor to use 'in' instead of 'has_key' | import re
from django.http import QueryDict
class HttpMethodOverrideMiddleware:
"""
Facilitate for overriding the HTTP method with the X-HTTP-Method-Override
header or a '_method' HTTP POST parameter.
"""
def process_request(self, request):
if 'HTTP_X_HTTP_METHOD_OVERRIDE' in request.META... | import re
from django.http import QueryDict
class HttpMethodOverrideMiddleware:
"""
Facilitate for overriding the HTTP method with the X-HTTP-Method-Override
header or a '_method' HTTP POST parameter.
"""
def process_request(self, request):
if request.META.has_key('HTTP_X_HTTP_METHOD_OVER... |
Document how output generators work |
from abc import ABCMeta, abstractmethod
from sslyze.cli import CompletedServerScan
from sslyze.cli import FailedServerScan
from sslyze.server_connectivity import ServerConnectivityInfo
class OutputGenerator(object):
"""The abstract class output generator classes should inherit from.
Each method must be imp... |
from abc import ABCMeta, abstractmethod
from sslyze.cli import CompletedServerScan
from sslyze.cli import FailedServerScan
from sslyze.server_connectivity import ServerConnectivityInfo
class OutputGenerator(object):
"""The abstract class output generator classes should inherit from.
Each method must be imp... |
Switch bookkeeping to record line offsets instead of line lengths.
This should be simpler and more efficient. | type SourceLocation = {
line: number,
column: number
};
export default class LinesAndColumns {
constructor(string: string) {
this.string = string;
const offsets = [];
let offset = 0;
while (true) {
offsets.push(offset);
let next = string.indexOf('\n', offset);
if (next < 0) {
... | type SourceLocation = {
line: number,
column: number
};
export default class LinesAndColumns {
constructor(string: string) {
this.string = string;
const lineLengths = [];
let start = 0;
while (true) {
let end = string.indexOf('\n', start);
if (end < 0) {
end = string.length;
... |
Add gateway token header for health check | const config = require('../config.js');
const {getCollection} = require('./dataAccess/dbMethods');
const logger = require('../../log.js');
const url = require('url');
const superagent = require('superagent');
const generateApiGatewayToken = require('../authentication/apiGateway');
module.exports = {
nomisApiChec... | const config = require('../config.js');
const {getCollection} = require('./dataAccess/dbMethods');
const logger = require('../../log.js');
const url = require('url');
const superagent = require('superagent');
module.exports = {
nomisApiCheck,
dbCheck
};
function dbCheck() {
return new Promise((resolve, r... |
Reset email form value on success
closes #3663
- Set value of email input as nil string | /* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';
var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: '',
submitting: false,
// ValidationEngine settings
validationType: 'forgotten',
a... | /* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';
var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: '',
submitting: false,
// ValidationEngine settings
validationType: 'forgotten',
a... |
Fix error when trying to edit a category with empty slug | /**
Application route for Discourse
@class ApplicationRoute
@extends Ember.Route
@namespace Discourse
@module Discourse
**/
Discourse.ApplicationRoute = Em.Route.extend({
events: {
showLogin: function() {
Discourse.Route.showModal(this, 'login');
},
showCreateAccount: function() {
... | /**
Application route for Discourse
@class ApplicationRoute
@extends Ember.Route
@namespace Discourse
@module Discourse
**/
Discourse.ApplicationRoute = Em.Route.extend({
events: {
showLogin: function() {
Discourse.Route.showModal(this, 'login');
},
showCreateAccount: function() {
... |
Remove stale bytecode when running tests. | import os
from setuptools import setup, find_packages
long_description = (
open('README.rst').read()
+ '\n' +
open('CHANGES.txt').read())
setup(name='morepath',
version='0.10.dev0',
description="A micro web-framework with superpowers",
long_description=long_description,
author="Mar... | import os
from setuptools import setup, find_packages
long_description = (
open('README.rst').read()
+ '\n' +
open('CHANGES.txt').read())
setup(name='morepath',
version='0.10.dev0',
description="A micro web-framework with superpowers",
long_description=long_description,
author="Mar... |
Update jest config to let ts-jest process JS modules
- no longer uses babel-jest, although the aim is to let ts-jest pass it to that afterwards | const { jsWithTs: tsjPreset } = require('ts-jest/presets')
const externalTsModules = require('./build/external').externalTsModules
const externalTsModuleMappings = {}
for (const externalTsModule of externalTsModules) {
Object.assign(externalTsModuleMappings, {
[`^${externalTsModule}$`]: `<rootDir>/external... | const externalTsModules = require('./build//external').externalTsModules
const externalTsModuleMappings = {}
for (const externalTsModule of externalTsModules) {
Object.assign(externalTsModuleMappings, {
[`^${externalTsModule}$`]: `<rootDir>/external/${externalTsModule}/ts`,
[`^${externalTsModule}/l... |
Fix this issue with arrow function | 'use strict';
const PluginError = require('plugin-error');
const rocambole = require('rocambole');
const through = require('through2');
module.exports = () => {
let out = '';
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
return cb(null, file);
}
if (f... | 'use strict';
const PluginError = require('plugin-error');
const rocambole = require('rocambole');
const through = require('through2');
module.exports = () => {
let out = '';
return through.obj((file, enc, cb) => {
if (file.isNull()) {
return cb(null, file);
}
if (file.is... |
Fix memory leak, added a missing release() after using ByteBuf | package com.notnoop.apns.internal.netty.encoding;
import java.io.IOException;
import com.notnoop.apns.DeliveryError;
import com.notnoop.apns.DeliveryResult;
import com.notnoop.apns.internal.Utilities;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.FixedLe... | package com.notnoop.apns.internal.netty.encoding;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.FixedLengthFrameDecoder;
import java.io.IOException;
import com.notnoop.apns.DeliveryError;
import com.notnoop.apns.DeliveryResult;
import com.notnoop.apns.in... |
Improve behaviour of sortable lists
Use the position of the pointer instead of the position of the dragged
item to determine where the item will be dropped. Depending on where
an item is grabbed, it was previously impossible (or very hard) to drop
it at the start/end of a list. | (function(global) {
'use strict';
global.setupSortableList = function setupSortableList($wrapper) {
/* Works with the sortable_lists and sortable_list macros defined in
* web/templates/_sortable_list.html
*/
// Render the lists sortable
if ($wrapper.data('disable-drag... | (function(global) {
'use strict';
global.setupSortableList = function setupSortableList($wrapper) {
/* Works with the sortable_lists and sortable_list macros defined in
* web/templates/_sortable_list.html
*/
// Render the lists sortable
if ($wrapper.data('disable-drag... |
Fix for truncated whitespace on DB level | from django.db import models
class Scroll(models.Model):
# Constants
SCROLL_TOP = """```
╞╤═════════════════════════════════════════════╤╡
│ Scroll ### │
╞═════════════════════════════════════════════╡
│ • • • • • • • • •│"""
SCROLL_BOTTOM = ... | from django.db import models
class Scroll(models.Model):
# Constants
SCROLL_TOP = """```
╞╤═════════════════════════════════════════════╤╡
│ Scroll ### │
╞═════════════════════════════════════════════╡
│ • • • • • • • • •│"""
SCROLL_BOTTOM = ... |
Fix events to work on mysql
Closes https://bugs.launchpad.net/graphite/+bug/993625 | import time
import os
from django.db import models
from django.contrib import admin
from tagging.managers import ModelTaggedItemManager
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
whe... | import time
import os
from django.db import models
from django.contrib import admin
if os.environ.get('READTHEDOCS'):
TagField = lambda *args, **kwargs: None
else:
from tagging.fields import TagField
class Event(models.Model):
class Admin: pass
when = models.DateTimeField()
what = models.CharFie... |
Add title to Graph object constructor | from datetime import datetime
from app import db, bcrypt
class User(db.Model):
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True)
email = db.Column(db.String(120), unique=True)
name = db.Column(db.String())
pw_hash = db.Co... | from datetime import datetime
from app import db, bcrypt
class User(db.Model):
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True)
email = db.Column(db.String(120), unique=True)
name = db.Column(db.String())
pw_hash = db.Co... |
[Method: Change identifier from String to IndentifierExpression] Add the methods to manage the changes. | package ast;
import symbols.value.Value;
public class Member extends Lvalue {
private Lvalue _lvalue;
private final IdentifierExpression _identifier;
private Call _call;
private Expression _expression;
private boolean _isLValue;
public Member(Lvalue lvalue, IdentifierExpression identifier, ... | package ast;
import symbols.value.Value;
public class Member extends Lvalue {
private Lvalue _lvalue;
private String _identifier;
private Call _call;
private Expression _expression;
private boolean _isLValue;
public Member(Lvalue lvalue, String identifier, Call call, Expression expression) ... |
Use separate cache and log directory per environment | <?php
namespace App;
use Matthias\SymfonyConsoleForm\Bundle\SymfonyConsoleFormBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\H... | <?php
namespace App;
use Matthias\SymfonyConsoleForm\Bundle\SymfonyConsoleFormBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\H... |
Throw exception when access login action and module is not enabled. | <?php
namespace thinkerg\IshtarGate\controllers;
use Yii;
use thinkerg\IshtarGate\models\LoginForm;
use yii\web\HttpException;
/**
*
* @author Thinker_g
*
* @property $module \thinkerg\IshtarGate\Module;
*
*/
class GateController extends \yii\web\Controller
{
public function actionIndex()
{
r... | <?php
namespace thinkerg\IshtarGate\controllers;
use Yii;
use thinkerg\IshtarGate\models\LoginForm;
/**
*
* @author Thinker_g
*
* @property $module \thinkerg\IshtarGate\Module;
*
*/
class GateController extends \yii\web\Controller
{
public function actionIndex()
{
return $this->render('index'... |
Enable versioning during unit tests | import sys
import os
sys.path.insert(0, os.curdir)
import unittest
import clusto
import ConfigParser
DB='sqlite:///:memory:'
ECHO=False
class ClustoTestResult(unittest.TestResult):
def addError(self, test, err):
"""Called when an error has occurred. 'err' is a tuple of values as
returned by s... | import sys
import os
sys.path.insert(0, os.curdir)
import unittest
import clusto
import ConfigParser
DB='sqlite:///:memory:'
ECHO=False
class ClustoTestResult(unittest.TestResult):
def addError(self, test, err):
"""Called when an error has occurred. 'err' is a tuple of values as
returned by s... |
Return Pubmed title and abstract | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
#import xml.dom.minidom as minidom
#import urllib
import time, sys
import xml.etree.ElementTree as ET
def get_pubmed_abs(pmid):
conn = httplib.HTTPConnection("eutils.ncbi.nlm.nih.gov")
conn.request("GET", '/entrez/eutils/efetch.fcgi?db=pubm... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
#import xml.dom.minidom as minidom
#import urllib
import time, sys
import xml.etree.ElementTree as ET
def get_pubmed_abs(pmid):
conn = httplib.HTTPConnection("eutils.ncbi.nlm.nih.gov")
conn.request("GET", '/entrez/eutils/efetch.fcgi?db=pubm... |
Remove JavaDoc reference to test class.
The test class is no available by JavaDoc. | package org.junit.experimental.runners;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import org.junit.runners.Suite;
import org.junit.runners.model.RunnerBuilder;
/**
* If you put tests in inner classes, Ant, for example, won't find them. By running the outer class
* with E... | package org.junit.experimental.runners;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import org.junit.runners.Suite;
import org.junit.runners.model.RunnerBuilder;
/**
* If you put tests in inner classes, Ant, for example, won't find them. By running the outer class
* with E... |
Add handling for building scikit-umfpack on the Mac, which doesn't have the librt file added to the umfpack dependencies. | #!/usr/bin/env python
# 05.12.2005, c
from __future__ import division, print_function, absolute_import
import sys
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, dict_append
config = Configuration('um... | #!/usr/bin/env python
# 05.12.2005, c
from __future__ import division, print_function, absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, dict_append
config = Configuration('umfpack', par... |
Remove IOException from execute() and query() | package io.sigpipe.sing.query;
import java.util.List;
import java.util.Set;
import io.sigpipe.sing.dataset.feature.FeatureType;
import io.sigpipe.sing.graph.DataContainer;
import io.sigpipe.sing.graph.Vertex;
public class MetaQuery extends Query {
private DataContainer aggregateData = new DataContainer();
... | package io.sigpipe.sing.query;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import io.sigpipe.sing.dataset.feature.FeatureType;
import io.sigpipe.sing.graph.DataContainer;
import io.sigpipe.sing.graph.Vertex;
public class MetaQuery extends Query {
private DataContainer aggregateData ... |
Disable station administrator role for demo account. | <?php
namespace App\Entity\Fixture;
use App\Acl;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use App\Entity;
class RolePermission extends AbstractFixture implements DependentFixtureInterface
{
public f... | <?php
namespace App\Entity\Fixture;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use App\Entity;
class RolePermission extends AbstractFixture implements DependentFixtureInterface
{
public function load(... |
Update each series results to be embedded in the reduce | import when from 'when';
let
openFiles = ['a.js', 'b.js', 'c.js'],
saveFile = (file) => {
console.log('saveFile', file);
return new Promise((resolve, reject) => {
setTimeout(
() => {
console.log('timeout', file);
resolve(file);... | import when from 'when';
let
openFiles = ['a.js', 'b.js', 'c.js'],
saveFile = (file) => {
console.log('saveFile', file);
return new Promise((resolve, reject) => {
setTimeout(
() => {
console.log('timeout', file);
resolve(file);... |
Fix regression
Use the proxy path | package fr.synchrotron.soleil.ica.ci.service.legacymavenproxy;
import org.vertx.java.core.Vertx;
import org.vertx.java.core.http.HttpClient;
import org.vertx.java.core.http.HttpServerRequest;
/**
* @author Gregory Boissinot
*/
public class HttpArtifactCaller {
private final Vertx vertx;
private final Strin... | package fr.synchrotron.soleil.ica.ci.service.legacymavenproxy;
import org.vertx.java.core.Vertx;
import org.vertx.java.core.http.HttpClient;
import org.vertx.java.core.http.HttpServerRequest;
/**
* @author Gregory Boissinot
*/
public class HttpArtifactCaller {
private final Vertx vertx;
private final Strin... |
Fix location of line length check | # coding: utf-8
"""
pyalysis.analysers.raw
~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2014 by Daniel Neuhäuser and Contributors
:license: BSD, see LICENSE.rst for details
"""
import codecs
from blinker import Signal
from pyalysis.utils import detect_encoding, Location
from pyalysis.warnings import LineTooLon... | # coding: utf-8
"""
pyalysis.analysers.raw
~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2014 by Daniel Neuhäuser and Contributors
:license: BSD, see LICENSE.rst for details
"""
import codecs
from blinker import Signal
from pyalysis.utils import detect_encoding, Location
from pyalysis.warnings import LineTooLon... |
Add ability to customize handler | <?php
namespace Salesforce;
use Salesforce\Version;
use Salesforce\Authentication\AuthenticationInterface;
use GuzzleHttp\Client as HttpClient;
class Connection {
/**
* Array of Salesforce instance configuration options
* which are set after logging into the
* @see Salesforce\Authentication\Authe... | <?php
namespace Salesforce;
use Salesforce\Version;
use Salesforce\Authentication\AuthenticationInterface;
use GuzzleHttp\Client as HttpClient;
class Connection {
/**
* Array of Salesforce instance configuration options
* which are set after logging into the
* @see Salesforce\Authentication\Authe... |
Fix even more legacy mongo compatability | /* global db, ObjectId */
var addedActions = [];
db.cooperatives.find({}).forEach(function (cooperative) {
var actions = [];
if (cooperative.actions) {
cooperative.actions.forEach(function (action) {
if (action instanceof ObjectId) {
addedActions.push(action);
actions.push(action);
... | /* global db, ObjectId */
var addedActions = [];
db.cooperatives.find({}).forEach(function (cooperative) {
var actions = [];
if (cooperative.actions) {
cooperative.actions.forEach(function (action) {
if (action instanceof ObjectId) {
addedActions.push(action);
actions.push(action);
... |
Make numba fake import robust | from contextlib import contextmanager
from poliastro import jit
@contextmanager
def _fake_numba_import():
# Black magic, beware
# https://stackoverflow.com/a/2484402/554319
import sys
class FakeImportFailure:
def __init__(self, modules):
self.modules = modules
def find_m... | from poliastro import jit
def _fake_numba_import():
# Black magic, beware
# https://stackoverflow.com/a/2484402/554319
import sys
class FakeImportFailure:
def __init__(self, modules):
self.modules = modules
def find_module(self, fullname, *args, **kwargs):
if ... |
Store the notification id when fetching notifications | import { takeLatest, put, call } from 'redux-saga/effects';
import {
REQUEST_FEED_NOTIFICATIONS_SUCCESS,
REQUEST_FEED_NOTIFICATIONS,
REQUEST_FEED_NOTIFICATIONS_FAILURE,
} from 'actions/feedActions';
import moreNotificationsCall from 'api/feedApiCall';
export function* getFeedNotificationsFlow(action) {
const ... | import { takeLatest, put, call } from 'redux-saga/effects';
import {
REQUEST_FEED_NOTIFICATIONS_SUCCESS,
REQUEST_FEED_NOTIFICATIONS,
REQUEST_FEED_NOTIFICATIONS_FAILURE,
} from 'actions/feedActions';
import moreNotificationsCall from 'api/feedApiCall';
export function* getFeedNotificationsFlow(action) {
const ... |
Change icon for non-target tool and remove length tool | Template.viewerMain.helpers({
'toolbarOptions': function() {
var toolbarOptions = {};
var buttonData = [];
buttonData.push({
id: 'resetViewport',
title: 'Reset Viewport',
classes: 'imageViewerCommand',
iconClasses: 'fa fa-undo'
});
... | Template.viewerMain.helpers({
'toolbarOptions': function() {
var toolbarOptions = {};
var buttonData = [];
buttonData.push({
id: 'resetViewport',
title: 'Reset Viewport',
classes: 'imageViewerCommand',
iconClasses: 'fa fa-undo'
});
... |
Drop empty field keys in migration | from django.core.management.base import BaseCommand
from corehq.apps.custom_data_fields.models import CustomDataFieldsDefinition, CustomDataField
from corehq.apps.users.models import CommCareUser
from corehq.apps.domain.models import Domain
from dimagi.utils.couch.database import iter_docs
class Command(BaseCommand):... | from django.core.management.base import BaseCommand
from corehq.apps.custom_data_fields.models import CustomDataFieldsDefinition, CustomDataField
from corehq.apps.users.models import CommCareUser
from corehq.apps.domain.models import Domain
from dimagi.utils.couch.database import iter_docs
class Command(BaseCommand):... |
Make Tweets model list generic
Also fix sorting | YUI.add("model-list-tweets", function(Y) {
"use strict";
var tristis = Y.namespace("Tristis"),
models = Y.namespace("Tristis.Models"),
Tweets;
Tweets = Y.Base.create("tweets", Y.LazyModelList, [
Y.namespace("Extensions").ModelListMore
], {
sync : funct... | YUI.add("model-list-tweets", function(Y) {
"use strict";
var tristis = Y.namespace("Tristis"),
models = Y.namespace("Tristis.Models"),
Tweets;
Tweets = Y.Base.create("tweets", Y.LazyModelList, [
Y.namespace("Extensions").ModelListMore
], {
sync : funct... |
Mark initial migration so django knows to skip it. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', mod... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', models.AutoField(verbo... |
Remove lint from minified version | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// contrib-watch
watch: {
all: {
files: ['src/**/*.js', 'lib/**/*.js', 'test/**/*.js', 'Gruntfile.js'],
tasks: ['test', 'build']
}
}... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// contrib-watch
watch: {
all: {
files: ['src/**/*.js', 'lib/**/*.js', 'test/**/*.js', 'Gruntfile.js'],
tasks: ['test', 'build']
}
}... |
Add handling for non-unicode return values from datetime.strftime
Hopefully fixes #3. | import locale
from functools import partial
from format_date import FormatDate
import sublime
import sublime_plugin
class InsertDateCommand(sublime_plugin.TextCommand, FormatDate):
"""Prints Date according to given format string"""
def run(self, edit, format=None, prompt=False, tz_in=None, tz_out=None):
... | import sublime
import sublime_plugin
from functools import partial
from format_date import FormatDate
class InsertDateCommand(sublime_plugin.TextCommand, FormatDate):
"""Prints Date according to given format string"""
def run(self, edit, format=None, prompt=False, tz_in=None, tz_out=None):
if prompt:... |
Clean the recent files list before displaying it in the startup dialog. | #!/usr/bin/env python
#coding=utf8
from whacked4 import config
from whacked4.ui import windows
class StartDialog(windows.StartDialogBase):
"""
This dialog is meant to be displayed on startup of the application. It allows the user to quickly
access some common functions without having to dig down into a m... | #!/usr/bin/env python
#coding=utf8
from whacked4 import config
from whacked4.ui import windows
class StartDialog(windows.StartDialogBase):
"""
This dialog is meant to be displayed on startup of the application. It allows the user to quickly
access some common functions without having to dig down into a m... |
[KFE-203] Remove references to deleted field | package com.kushkipagos.android.example;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.kushkipagos.android.Card;
public class MainActivity extends AppCompatA... | package com.kushkipagos.android.example;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.kushkipagos.android.Card;
public class MainActivity extends AppCompatA... |
Fix links in decktree on deck edit without new revision | import UserProfileStore from '../stores/UserProfileStore';
import {navigateAction} from 'fluxible-router';
import striptags from 'striptags';
export default function saveDeckEdit(context, payload, done) {
//enrich with user id
let userid = context.getStore(UserProfileStore).userid;
if (userid == null || u... | import UserProfileStore from '../stores/UserProfileStore';
import {navigateAction} from 'fluxible-router';
import striptags from 'striptags';
export default function saveDeckEdit(context, payload, done) {
//enrich with user id
let userid = context.getStore(UserProfileStore).userid;
if (userid == null || u... |
Sort entryproducts api by latest entrys, limit to 20 | 'use strict';
const hooks = require('./hooks');
const Promise = require('bluebird');
module.exports = function(){
const app = this;
app.use('/entryproducts', {
find() {
const sequelize = app.get('sequelize');
var products = [], idsResult = [];
return sequelize.models['Entry'].findAll({
... | 'use strict';
const hooks = require('./hooks');
const Promise = require('bluebird');
module.exports = function(){
const app = this;
app.use('/entryproducts', {
find() {
const sequelize = app.get('sequelize');
var products = [], idsResult = [];
return sequelize.models['Entry'].findAll({
... |
Improve infected human approach AI.
The approach AI now only kicks in when the player is within 400 pixels
of the enemy.
The direction it chooses to look in is a bit more sane now. It will
figure out whether the distance is greater in the X or Y location, and
pick a direction based on that. Now they actually appear t... | from pygame.locals import *
from thecure import get_engine
from thecure.sprites.base import Direction, WalkingSprite
class Enemy(WalkingSprite):
DEFAULT_HEALTH = 10
class InfectedHuman(Enemy):
MOVE_SPEED = 2
APPROACH_DISTANCE = 400
def tick(self):
super(InfectedHuman, self).tick()
... | from pygame.locals import *
from thecure import get_engine
from thecure.sprites.base import WalkingSprite
class Enemy(WalkingSprite):
DEFAULT_HEALTH = 10
class InfectedHuman(Enemy):
MOVE_SPEED = 2
def tick(self):
super(InfectedHuman, self).tick()
if self.started:
# Figure ... |
Fix the routing match issue | <?php
namespace Vitaminate\Routing;
use Vitaminate\Http\Request;
use Vitaminate\Routing\Route;
use Vitaminate\Routing\Contracts\RouteCollectionInterface;
/**
* Class Matcher
*
* @author Mystro Ken <mystroken@gmail.com>
* @package Vitaminate\Routing
*/
class RouteMatcher
{
/**
* Get the matched route f... | <?php
namespace Vitaminate\Routing;
use Vitaminate\Http\Request;
use Vitaminate\Routing\Route;
use Vitaminate\Routing\Contracts\RouteCollectionInterface;
/**
* Class Matcher
*
* @author Mystro Ken <mystroken@gmail.com>
* @package Vitaminate\Routing
*/
class RouteMatcher
{
/**
* Get the matched route f... |
Fix Symfony 3 incompatible form type | <?php
namespace Mapbender\DigitizerBundle\Element\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class DigitizerAdminType extends AbstractType
{
pu... | <?php
namespace Mapbender\DigitizerBundle\Element\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class DigitizerAdminType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.