text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Enable drf_yasg in test settings | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
'drf_yasg',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_... | #
# Django Tests
# ..........................
TEST = True
CELERY_ALWAYS_EAGER = True
TEST_EXCLUDE = ('django',)
INSTALLED_APPS += (
'geotrek.diving',
'geotrek.sensitivity',
'geotrek.outdoor',
)
LOGGING['handlers']['console']['level'] = 'CRITICAL'
LANGUAGE_CODE = 'en'
MODELTRANSLATION_DEFAULT_LANGUAGE... |
Add hardware interface in sockets constructor | /**
* Main application file
*/
'use strict';
var path = require('path');
// Set default node environment to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var express = require('express');
var mongoose = require('mongoose');
var config = require('./config/environment');
var hardware = r... | /**
* Main application file
*/
'use strict';
var path = require('path');
// Set default node environment to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var express = require('express');
var mongoose = require('mongoose');
var config = require('./config/environment');
var hardware = r... |
Change to get test to pass. | """Tests the menu features."""
##==============================================================#
## SECTION: Imports #
##==============================================================#
from testlib import *
from qprompt import enum_menu
##=================================... | """Tests the menu features."""
##==============================================================#
## SECTION: Imports #
##==============================================================#
from testlib import *
from qprompt import enum_menu
##=================================... |
Fix arguments order of reqon.deprecated.build_terms(). | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... | import rethinkdb as r
from . import coerce, geo, operators, terms
from .coerce import COERSIONS
from .operators import BOOLEAN, EXPRESSIONS, MODIFIERS
from .terms import TERMS
from .exceptions import ReqonError, InvalidTypeError, InvalidFilterError
def query(query):
try:
reql = r.db(query['$db']).table(q... |
[BUG] Fix duplicate method from merge | package org.openkilda.messaging.ctrl;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@JsonSerialize
@JsonInclude(JsonInclude.Include.NON_NULL... | package org.openkilda.messaging.ctrl;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@JsonSerialize
@JsonInclude(JsonInclude.Include.NON_NULL... |
Update TestGenerateApexDocs regex to fix windows test
This commit updates the test regex to match either windows or unix file
separators.
The command generated on Windows:
java -jar c:\users\ieuser\appdata\local\temp\tmp9splyd\apexdoc.jar -s \Users\IEUser\Documents\GitHub\CumulusCI-Test\src\classes -t \Users\IEUs... | import mock
import re
import unittest
from cumulusci.core.config import BaseGlobalConfig
from cumulusci.core.config import BaseProjectConfig
from cumulusci.core.config import TaskConfig
from cumulusci.core.config import OrgConfig
from cumulusci.tasks.apexdoc import GenerateApexDocs
class TestGenerateApexDocs(unittes... | import mock
import re
import unittest
from cumulusci.core.config import BaseGlobalConfig
from cumulusci.core.config import BaseProjectConfig
from cumulusci.core.config import TaskConfig
from cumulusci.core.config import OrgConfig
from cumulusci.tasks.apexdoc import GenerateApexDocs
class TestGenerateApexDocs(unittes... |
Add new predefined generic message for announcement query failure | /*
* Copyright 2015 Ryan Gilera.
*
* 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 2015 Ryan Gilera.
*
* 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... |
Change in the typ output. |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... |
Add hold_reason to the Order Entity | <?php
/*
* This file is part of the PayBreak/basket package.
*
* (c) PayBreak <dev@paybreak.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PayBreak\Sdk\Entities\Application;
use WNowicki\Generic\AbstractEntity;
/... | <?php
/*
* This file is part of the PayBreak/basket package.
*
* (c) PayBreak <dev@paybreak.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PayBreak\Sdk\Entities\Application;
use WNowicki\Generic\AbstractEntity;
/... |
Make `async-to-gen` work on Now | #!/usr/bin/env node
// Native
const path = require('path')
// Packages
const asyncToGen = require('async-to-gen/register')
const updateNotifier = require('update-notifier')
const {red} = require('chalk')
const nodeVersion = require('node-version')
const isAsyncSupported = require('is-async-supported')
// Ours
const ... | #!/usr/bin/env node
// Packages
const asyncToGen = require('async-to-gen/register')
const updateNotifier = require('update-notifier')
const {red} = require('chalk')
const nodeVersion = require('node-version')
const isAsyncSupported = require('is-async-supported')
// Ours
const pkg = require('../package')
// Support ... |
Update AddStateServerMachine testing helper for completeness | // Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package testing
import (
gc "launchpad.net/gocheck"
"launchpad.net/juju-core/instance"
"launchpad.net/juju-core/state"
)
// AddStateServerMachine adds a "state server" machine to the state so
// that State.Addresse... | // Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package testing
import (
gc "launchpad.net/gocheck"
"launchpad.net/juju-core/instance"
"launchpad.net/juju-core/state"
)
// AddStateServerMachine adds a "state server" machine to the state so
// that State.Addresse... |
Change user's port value style | /*
* Copyright (C) 2016 Lynn
*
* 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) 2016 Lynn
*
* 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... |
Fix strictness error when using node 4 | // report.js -- Report of the results of a batch and its sub-batches
//
// Copyright 2017 fuzzy.ai <evan@fuzzy.ai>
//
// 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.apa... | // report.js -- Report of the results of a batch and its sub-batches
//
// Copyright 2017 fuzzy.ai <evan@fuzzy.ai>
//
// 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.apa... |
Use all 8 decimal places currency details | <?php
namespace Emailme\Currency;
use Exception;
use Emailme\Debug\Debug;
/*
* CurrencyUtil
*/
class CurrencyUtil
{
const SATOSHI = 100000000;
////////////////////////////////////////////////////////////////////////
public static function numberToSatoshis($number) {
return intval(round($numbe... | <?php
namespace Emailme\Currency;
use Exception;
use Emailme\Debug\Debug;
/*
* CurrencyUtil
*/
class CurrencyUtil
{
const SATOSHI = 100000000;
////////////////////////////////////////////////////////////////////////
public static function numberToSatoshis($number) {
return intval(round($numbe... |
Copy static dirs as well | import os.path
from shutil import copyfile
from shutil import copytree
from shutil import rmtree
try:
from jinja2 import Template
except:
print "Could not import Jinja2, run 'easy_install Jinja2'"
exit()
output_dir = os.path.join('./', 'chrome_webstore')
if os.path.exists(output_dir):
rmtree(output_di... | import os.path
from shutil import copyfile
try:
from jinja2 import Template
except:
print "Could not import Jinja2, run 'easy_install Jinja2'"
exit()
output_dir = os.path.join('./', 'chrome_webstore')
if not os.path.exists(output_dir):
os.makedirs(output_dir)
def add_background_script():
copyfile... |
Add target blank for anchors in paragraph block. | export const sizing = (textSize, align) => ({
a: {
props: {
target: '_blank',
},
},
p: {
props: {
size: textSize,
margin: 'small',
align,
style: {
marginTop: 0,
},
},
},
h1: {
props: {
margin: 'small',
align,
style: {
ma... | export const sizing = (textSize, align) => ({
p: {
props: {
size: textSize,
margin: 'small',
align,
style: {
marginTop: 0,
},
},
},
h1: {
props: {
margin: 'small',
align,
style: {
marginTop: 0,
},
},
},
h2: {
props: {
... |
Make bgl the default OpenGL implementation snice it is currently faster than PyOpenGL. | # This file handles differences between BGL and PyOpenGL, and provides various
# utility functions for OpenGL
try:
from bgl import *
USING_BGL = True
except ImportError:
from OpenGL.GL import *
from OpenGL.GLU import *
from bgl import Buffer
if USING_BGL:
_glGenTextures = glGenTextures
def glGenTextures(n, tex... | # This file handles differences between BGL and PyOpenGL, and provides various
# utility functions for OpenGL
try:
from OpenGL.GL import *
from OpenGL.GLU import *
from bgl import Buffer
USING_BGL = False
except ImportError:
from bgl import *
USING_BGL = True
if USING_BGL:
_glGenTextures = glGenTextures
def g... |
feat: Change background of spinner to match login | import React from 'react';
import '../../aframeComponents/scene-load';
import '../../aframeComponents/aframe-minecraft';
import AssetLoader from './AssetLoader';
import InitialLoading from './InitialLoading';
export default function App (props) {
console.log('props ', props);
return (
// AssetLoader is a state... | import React from 'react';
import '../../aframeComponents/scene-load';
import '../../aframeComponents/aframe-minecraft';
import AssetLoader from './AssetLoader';
import InitialLoading from './InitialLoading';
export default function App (props) {
console.log('props ', props);
return (
// AssetLoader is a state... |
Fix database infra save method | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from .. import models
log = logging.getLogger(__name__)
class DatabaseInfraForm(forms.ModelForm):
class Meta:
model = models.DatabaseInfra
def __init__(self, *args, **kwargs):
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from .. import models
log = logging.getLogger(__name__)
class DatabaseInfraForm(forms.ModelForm):
class Meta:
model = models.DatabaseInfra
def __init__(self, *args, **kwargs):
... |
Add defaults for cache control start and end times. | package uk.ac.ebi.quickgo.ontology;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.time.Duration;
import java.time.LocalTime;
/**
* Holds values related to the operation of the Ontology REST service.
* <p>
* Created by Tony ... | package uk.ac.ebi.quickgo.ontology;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.time.Duration;
import java.time.LocalTime;
/**
* Holds values related to the operation of the Ontology REST service.
* <p>
* Created by Tony ... |
Add correct documentation for variantForOptions from product helpers | /**
* @namespace ProductHelpers
*/
export default {
/**
* Returns the variant of a product corresponding to the options given.
*
* @example
* const selectedVariant = client.product.helpers.variantForOptions(product, {
* size: "Small",
* color: "Red"
* });
*
* @memberof ProductHelpers... | /**
* @namespace ProductHelpers
*/
export default {
/**
* Returns the variant of a product corresponding to the options given.
*
* @example
* const selectedVariant = client.product.variantForOptions(product, {
* size: "Small",
* color: "Red"
* });
*
* @memberof ProductHelpers
* @m... |
Fix thread color parameter as optional | "use strict";
var utils = require("../utils");
var log = require("npmlog");
module.exports = function(defaultFuncs, api, ctx) {
return function changeThreadColor(color, threadID, callback) {
if(!callback) {
callback = function() {};
}
var form = {
'color_choice' : color,
'thread_or_oth... | "use strict";
var utils = require("../utils");
var log = require("npmlog");
module.exports = function(defaultFuncs, api, ctx) {
return function changeThreadColor(color, threadID, callback) {
var form = {
'color_choice' : color,
'thread_or_other_fbid' : threadID
};
defaultFuncs
.post("... |
Fix event type in handler manager | import React from 'react';
import PropTypes from 'prop-types';
import { withModules } from '../Modules';
import { stripesShape } from '../../Stripes';
import { getHandlerComponents } from '../../handlerService';
class HandlerManager extends React.Component {
static propTypes = {
stripes: stripesShape.isRequired... | import React from 'react';
import PropTypes from 'prop-types';
import { withModules } from '../Modules';
import { stripesShape } from '../../Stripes';
import { getHandlerComponents } from '../../handlerService';
class HandlerManager extends React.Component {
static propTypes = {
stripes: stripesShape.isRequired... |
Fix a couple trivial bugs. | class UnitId:
def __init__(self, playerId, unitSubId):
self.playerId = playerId
self.subId = unitSubId
def __eq__(self, other):
return self.playerId == other.playerId and self.subId == other.subId
def __ne__(self, other):
return not (self == other)
def __hash__(self... | class UnitId:
def __init__(self, playerId, unitSubId):
self.playerId = playerId
self.subId = unitSubId
def __eq__(self, rhs):
return self.playerId == rhs.playerId and self.subId == other.subId
def __ne__(self, rhs):
return not (self == rhs)
def __hash__(self):
... |
Change default terminal size arguments - Add server debug log message | # -*- coding: iso-8859-15 -*-
"""Main HTTP routes request handlers."""
import tornado.web
import tornado.escape
from os import getcwd
class MainHandler(tornado.web.RequestHandler):
"""Handles creation of new terminals."""
@tornado.gen.coroutine
def post(self):
"""POST verb: Create a new termina... | # -*- coding: iso-8859-15 -*-
"""Main HTTP routes request handlers."""
import tornado.web
import tornado.escape
from os import getcwd
class MainHandler(tornado.web.RequestHandler):
"""Handles creation of new terminals."""
@tornado.gen.coroutine
def post(self):
"""POST verb: Create a new termina... |
Add todo for signed phars | <?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Downloader;
use Composer\Packag... | <?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Downloader;
use Composer\Packag... |
Add gnu99 build flag for linuxy builds | #!/usr/bin/env python
"""
setup.py file for helium-client-python
"""
from distutils.core import setup, Extension
sourcefiles = ['src/helium_client.c',
'src/helium-serial.c',
'src/helium-client/helium-client.c',
'src/helium-client/cauterize/atom_api.c',
'src... | #!/usr/bin/env python
"""
setup.py file for helium-client-python
"""
from distutils.core import setup, Extension
sourcefiles = ['src/helium_client.c',
'src/helium-serial.c',
'src/helium-client/helium-client.c',
'src/helium-client/cauterize/atom_api.c',
'src... |
Remove page title from frontpage
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php
/*
|--------------------------------------------------------------------------
| HTML::title() macro
|--------------------------------------------------------------------------
|
| Page title macro helper.
|
*/
HTML::macro('title', function ($page_title)
{
$memory = Orchestra::memory();
$site_title = $mem... | <?php
/*
|--------------------------------------------------------------------------
| HTML::title() macro
|--------------------------------------------------------------------------
|
| Page title macro helper.
|
*/
HTML::macro('title', function ($page_title)
{
$memory = Orchestra::memory();
$site_title = $mem... |
Remove trailing comma not compatible with Python 3.5 | from enum import Enum
from .base import Item
class KeepDirectories(Enum):
NONE = 'none'
SUFFIX = 'suffix'
FULL = 'full'
@classmethod
def cast(cls, value):
if not value:
return KeepDirectories.NONE
if value is True:
return KeepDirectories.FULL
retur... | from enum import Enum
from .base import Item
class KeepDirectories(Enum):
NONE = 'none'
SUFFIX = 'suffix'
FULL = 'full'
@classmethod
def cast(cls, value):
if not value:
return KeepDirectories.NONE
if value is True:
return KeepDirectories.FULL
retur... |
Terminate gracefully on nearing memory limit
If the process is approaching the configured memory limit then terminate gracefully instead of allowing the process to hit the limit and crash losing data. | 'use strict';
const v8 = require('v8');
const Promise = require('bluebird');
const times = require('./times');
const page = require('./page');
const zip = require('./zip');
function runner (opts) {
const iterator = (url) => page(Object.assign({}, opts, { url: url }));
const concurrency = opts.parallel ? opts.url.l... | 'use strict';
const Promise = require('bluebird');
const times = require('./times');
const page = require('./page');
const zip = require('./zip');
function runner (opts) {
const iterator = (url) => page(Object.assign({}, opts, { url: url }));
const concurrency = opts.parallel ? opts.url.length : 1;
let interru... |
Allow passing more params to trackPageView | import Ember from 'ember';
export default Ember.Mixin.create({
init: function() {
this._super();
if(!this.hasAnalytics()) {
Ember.Logger.warn('Segment.io is not loaded yet (window.analytics)');
}
},
hasAnalytics: function() {
return !!(window.analytics && typeof window.analytics === "object... | import Ember from 'ember';
export default Ember.Mixin.create({
init: function() {
this._super();
if(!this.hasAnalytics()) {
Ember.Logger.warn('Segment.io is not loaded yet (window.analytics)');
}
},
hasAnalytics: function() {
return !!(window.analytics && typeof window.analytics === "object... |
Reduce string duplication in autodisovery code | /**
* Utility methods used when querying a site in order to discover its available
* API endpoints
*
* @module autodiscovery
*/
'use strict';
const parseLinkHeader = require( 'parse-link-header' );
/**
* Attempt to locate a `rel="https://api.w.org"` link relation header
*
* @method locateAPIRootHeader
* @par... | /**
* Utility methods used when querying a site in order to discover its available
* API endpoints
*
* @module autodiscovery
*/
'use strict';
const parseLinkHeader = require( 'parse-link-header' );
/**
* Attempt to locate a `rel="https://api.w.org"` link relation header
*
* @method locateAPIRootHeader
* @par... |
Move import that depends on devserver | import os
from django.core import checks
from djangae.environment import get_application_root
def check_deferred_builtin(app_configs=None, **kwargs):
"""
Check that the deferred builtin is switched off, as it'll override Djangae's deferred handler
"""
from google.appengine.tools.devappserver2.applic... | import os
from django.core import checks
from google.appengine.tools.devappserver2.application_configuration import ModuleConfiguration
from djangae.environment import get_application_root
def check_deferred_builtin(app_configs=None, **kwargs):
"""
Check that the deferred builtin is switched off, as it'll o... |
Fix in defining keys for x,y | var util = require('util');
GeometryBounds = function(bounds) {
this.xKey = "x";
this.yKey = "y";
this.bounds = [];
if(!bounds || !bounds[0] || !bounds[0][0]) return;
this.xKey = Object.keys(bounds[0][0])[0];
this.yKey = Object.keys(bounds[0][0])[1];
for(var b1 in bounds) {
var constructedBound = ... | var util = require('util');
GeometryBounds = function(bounds) {
this.xKey = "x";
this.yKey = "y";
this.bounds = [];
if(!bounds || !bounds[0]) return;
this.xKey = Object.keys(bounds[0])[0];
this.yKey = Object.keys(bounds[0])[1];
for(var b1 in bounds) {
var constructedBound = [];
var bound = bou... |
[native] Fix bug where Lifecycle listener subscription wasn't being torn down properly | // @flow
import * as React from 'react';
import { useDispatch } from 'react-redux';
import {
backgroundActionType,
foregroundActionType,
} from 'lib/reducers/foreground-reducer';
import { appBecameInactive } from '../redux/redux-setup';
import { addLifecycleListener } from './lifecycle';
const LifecycleHandler ... | // @flow
import * as React from 'react';
import { useDispatch } from 'react-redux';
import {
backgroundActionType,
foregroundActionType,
} from 'lib/reducers/foreground-reducer';
import { appBecameInactive } from '../redux/redux-setup';
import { addLifecycleListener } from './lifecycle';
const LifecycleHandler ... |
Add new-action button to toggle default_block for messages | $(document).on('page:load', init_default_data_block);
$(document).ready(init_default_data_block);
function init_default_data_block() {
$('.default_data_block .title').click(function () {
toggle_default_data_bloc(this, 400);
});
$('.new-action').click(function () {
var messages_block = $(th... | $(document).on('page:load', init_default_data_block);
$(document).ready(init_default_data_block);
function init_default_data_block() {
$('.default_data_block .title').click(function () {
toggle_default_data_bloc(this, 400);
});
$('.default_data_block.default_visible').each(function() {
tog... |
Remove TID= from string representation of thread | // Package thread is designed for manage OS thread parameters. Usually you
// need to call runtime.LockOSThread before use it.
//
// Only String methods allocates memory (mainly because using of fmt package)
// so don't use them when GC is disabled.
package thread
import (
"fmt"
"github.com/ziutek/sched"
"syscall"
... | // Package thread is designed for manage OS thread parameters. Usually you
// need to call runtime.LockOSThread before use it.
//
// Only String methods allocates memory (mainly because using of fmt package)
// so don't use them when GC is disabled.
package thread
import (
"fmt"
"github.com/ziutek/sched"
"syscall"
... |
Throw error if app isn't authenticated | //= require ./core
//= require ./static_config
//= require_self
(function () {
if (!Drop.config.JSON_CONFIG_URL) {
throw Error("json_config_url is required!");
}
Drop.fetchConfig = function () {
new Marbles.HTTP({
method: 'GET',
url: Drop.config.JSON_CONFIG_URL,
middleware: [
Marbles.HTTP.Middlew... | //= require ./core
//= require ./static_config
//= require_self
(function () {
if (!Drop.config.JSON_CONFIG_URL) {
throw Error("json_config_url is required!");
}
Drop.fetchConfig = function () {
new Marbles.HTTP({
method: 'GET',
url: Drop.config.JSON_CONFIG_URL,
middleware: [
Marbles.HTTP.Middlew... |
Revert "Updating version now that docs are up-to-date"
This reverts commit 3f2ed8f7bfbed7162f4047cea534d83e52e714af. | from setuptools import setup
config = {
'include_package_data': True,
'description': 'Simulated datasets of DNA',
'download_url': 'https://github.com/kundajelab/simdna',
'version': '0.4.3.2',
'packages': ['simdna', 'simdna.resources', 'simdna.synthetic'],
'package_data': {'simdna.resources': ['... | from setuptools import setup
config = {
'include_package_data': True,
'description': 'Simulated datasets of DNA',
'download_url': 'https://github.com/kundajelab/simdna',
'version': '0.4.3.3',
'packages': ['simdna', 'simdna.resources', 'simdna.synthetic'],
'package_data': {'simdna.resources': ['... |
:bug: Fix empty file at boot of backend | package commons
import (
"encoding/json"
"log"
"os"
)
type Manager interface {
Commit() error
GetSaveFilePath() (fullPath string, dirPath string, fileName string)
GetConfig() interface{}
}
func LoadFromDB(manager Manager) {
f, err := OpenSaveFile(manager, os.O_RDONLY)
defer f.Close()
Check(err)
err = json.... | package commons
import (
"encoding/json"
"log"
"os"
)
type Manager interface {
Commit() error
GetSaveFilePath() (fullPath string, dirPath string, fileName string)
GetConfig() interface{}
}
func LoadFromDB(manager Manager) {
f, err := OpenSaveFile(manager, os.O_RDONLY)
defer f.Close()
Check(err)
err = json.... |
Return CAS for get operation
Change-Id: I50d3851dd1954e96c3046e69e507caa6622b6412
Reviewed-on: http://review.couchbase.org/11954
Tested-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com> | /*
* Copyright 2011 Couchbase, Inc..
*
* 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 o... | /*
* Copyright 2011 Couchbase, Inc..
*
* 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 o... |
Add super call to db Base class
Without this call, multiple inheritance involving the db Base
class does not work correctly.
Change-Id: Iac6b99d34f00babb8b66fede4977bf75f0ed61d4 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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 ... | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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 ... |
Fix target entity not found | <?php
namespace Tienvx\Bundle\MbtBundle\Entity\Petrinet;
use Doctrine\ORM\Mapping as ORM;
use Tienvx\Bundle\MbtBundle\Model\Petrinet\PlaceMarking as BasePlaceMarking;
/**
* @ORM\Entity
* @ORM\Table(name="place_marking")
*/
class PlaceMarking extends BasePlaceMarking
{
/**
* @ORM\Id
* @ORM\GeneratedV... | <?php
namespace Tienvx\Bundle\MbtBundle\Entity\Petrinet;
use Doctrine\ORM\Mapping as ORM;
use Tienvx\Bundle\MbtBundle\Model\Petrinet\PlaceMarking as BasePlaceMarking;
/**
* @ORM\Entity
* @ORM\Table(name="place_marking")
*/
class PlaceMarking extends BasePlaceMarking
{
/**
* @ORM\Id
* @ORM\GeneratedV... |
Add recv_keys and add_repo to apt | import os
from subprocess import call
from functools import partial
#TODO: stop using sudo or ensure it exists
#TODOE: specify user to run as
#TODO: utilize functools partial to handle some of the above functionality
class Config:
APT_GET = ['sudo', '-E', 'apt-get']
ENV = os.environ.copy()
ENV['DEBIAN_FRO... | import os
from subprocess import call
from functools import partial
#TODO: stop using sudo or ensure it exists
#TODOE: specify user to run as
#TODO: utilize functools partial to handle some of the above functionality
class Config:
APT_GET = ['sudo', '-E', 'apt-get']
ENV = os.environ.copy()
ENV['DEBIAN_FRO... |
Handle an error where data chunks from camera could be undefined | var os = require('os');
var io = require('socket.io-client');
// The Castle address is loaded dynamically and passed to this script as an argument
var socket = io.connect('http://'+process.argv[2]+':8888');
if(!process.stdin.isTTY) {
var image = Buffer.alloc(0);
// Data is read in chunks of up to 64K (65356 ... | var os = require('os');
var io = require('socket.io-client');
// The Castle address is loaded dynamically and passed to this script as an argument
var socket = io.connect('http://'+process.argv[2]+':8888');
if(!process.stdin.isTTY) {
var image = Buffer.alloc(0);
// Data is read in chunks of up to 64K (65356 ... |
packer: Test to make sure DispatchHook implements Hook | package packer
import (
"cgl.tideland.biz/asserts"
"testing"
)
type TestHook struct {
runCalled bool
runData interface{}
runName string
runUi Ui
}
func (t *TestHook) Run(name string, data interface{}, ui Ui) {
t.runCalled = true
t.runData = data
t.runName = name
t.runUi = ui
}
func TestDispatchHook_Implem... | package packer
import (
"cgl.tideland.biz/asserts"
"testing"
)
type TestHook struct {
runCalled bool
runData interface{}
runName string
runUi Ui
}
func (t *TestHook) Run(name string, data interface{}, ui Ui) {
t.runCalled = true
t.runData = data
t.runName = name
t.runUi = ui
}
func TestDispatchHook_Run_No... |
Add missing semicolons in js
Change-Id: I1cb8d044766924e554411ce45c3c056139f19078 | angular.module('horizonApp').directive('hrNumberPicker', function() {
return {
restrict: 'A',
replace: true,
scope: { initial_value: '=value' },
templateUrl: '../../static/infrastructure/angular_templates/numberpicker.html',
link: function(scope, element, attrs) {
input = element.find('input... | angular.module('horizonApp').directive('hrNumberPicker', function() {
return {
restrict: 'A',
replace: true,
scope: { initial_value: '=value' },
templateUrl: '../../static/infrastructure/angular_templates/numberpicker.html',
link: function(scope, element, attrs) {
input = element.find('input... |
Throw exception when url could not be created from result set. | /*
* 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
* distributed u... | /*
* 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
* distributed u... |
Add some docs to PMT time slewing | # -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Time slewing corrects the hit time due to different rise times of the
PMT signals depending on the number of photo electrons.
The reference point is at 26.4ns and hits with a d... | # -*- coding: utf-8 -*-
"""
==================
PMT Time Slewing
==================
Show different variants of PMT time slewing calculations.
Variant 3 is currently (as of 2020-10-16) what's also used in Jpp.
"""
# Author: Tamas Gal <tgal@km3net.de>
# License: BSD-3
import km3pipe as kp
import numpy as np
import m... |
feature: Add dangling underscore exceptions for elasticsearch results | module.exports = {
extends: 'airbnb-base',
plugins: [
'mocha',
],
env: {
node: true,
mocha: true,
},
rules: {
strict: [0, 'global'],
indent: [1, 'tab', { SwitchCase: 1, VariableDeclarator: 1 }],
'no-tabs': 0,
'no-plusplus': 0,
'arrow-body-style': [2, 'as-needed', { requireReturnForObjectLiteral: t... | module.exports = {
extends: 'airbnb-base',
plugins: [
'mocha',
],
env: {
node: true,
mocha: true,
},
rules: {
strict: [0, 'global'],
indent: [1, 'tab', { SwitchCase: 1, VariableDeclarator: 1 }],
'no-tabs': 0,
'no-plusplus': 0,
'arrow-body-style': [2, 'as-needed', { requireReturnForObjectLiteral: t... |
Add new case insensitive string contains | package tools
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"strings"
"unicode"
"unicode/utf8"
)
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
func C... | package tools
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"strings"
"unicode"
"unicode/utf8"
)
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
func C... |
Add a Logging Event to demonstrate the Forensics\Console use | <?php
/**
* Events - all standard Events are defined here.
*
* @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com
* @version 3.0
*/
use Support\Facades\Event;
use Core\View;
use Helpers\Hooks;
use Forensics\Console;
/** Define Events. */
// Add a Listener Class to the Event 'test'.
Event::listen('test... | <?php
/**
* Events - all standard Events are defined here.
*
* @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com
* @version 3.0
*/
use Support\Facades\Event;
use Core\View;
use Helpers\Hooks;
/** Define Events. */
// Add a Listener Class to the Event 'test'.
Event::listen('test', 'App\Events\Test@han... |
Fix incorrect argument to notify function | #!/usr/bin/env node
'use strict';
var program = require('commander')
, gulp = require('gulp')
, chalk = require('chalk')
, exec = require('exec')
, pjson = require('./package.json')
var strings = {
create: 'Creating new project',
install: 'Installing dependencies',
complete: 'Done!'
}
var pa... | #!/usr/bin/env node
'use strict';
var program = require('commander')
, gulp = require('gulp')
, chalk = require('chalk')
, exec = require('exec')
, pjson = require('./package.json')
var strings = {
create: 'Creating new project',
install: 'Installing dependencies',
complete: 'Done!'
}
var pa... |
Add missing test listener method | <?php
namespace Pinq\Tests;
use Exception;
use PHPUnit_Framework_Test;
class Timer implements \PHPUnit_Framework_TestListener
{
private static $log = [];
public static function getLongRunningTests($amount)
{
arsort(Timer::$log);
return array_slice(Timer::$log, 0, $amount);
}
pu... | <?php
namespace Pinq\Tests;
use Exception;
use PHPUnit_Framework_Test;
class Timer implements \PHPUnit_Framework_TestListener
{
private static $log = [];
public static function getLongRunningTests($amount)
{
arsort(Timer::$log);
return array_slice(Timer::$log, 0, $amount);
}
pu... |
Expire mobile guide cookie after 24 hours
See https://github.com/vector-im/riot-web/issues/9360
This is to prevent it from always working. Cookies without an expiration are supposed to expire at the end of the session, however the nature of mobile browsers means that the session is unlikely to ever end. | import {getVectorConfig} from '../getconfig';
function onBackToRiotClick() {
// Cookie should expire in 24 hours
document.cookie = 'mobile_redirect_to_guide=false;path=/;max-age=86400';
window.location.href = '../';
}
async function initPage() {
document.getElementById('back_to_riot_button').onclick =... | import {getVectorConfig} from '../getconfig';
function onBackToRiotClick() {
document.cookie = 'mobile_redirect_to_guide=false;path=/';
window.location.href = '../';
}
async function initPage() {
document.getElementById('back_to_riot_button').onclick = onBackToRiotClick;
const config = await getVecto... |
Fix deprecated call to constructor
Fixes #56 | <?php
/**
* This file is part of the Cron package.
*
* (c) Dries De Peuter <dries@nousefreak.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cron\Job;
use Symfony\Component\Process\Process;
/**
* ShellJob is a jo... | <?php
/**
* This file is part of the Cron package.
*
* (c) Dries De Peuter <dries@nousefreak.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cron\Job;
use Symfony\Component\Process\Process;
/**
* ShellJob is a jo... |
Use parent 'post' function to actually send message | from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
... | from __future__ import absolute_import
import logging
from .telegram import TelegramBot
logger = logging.getLogger(__name__)
class TelegramBotSplit(TelegramBot):
def __init__(self, chat_id=None, split_on="\n"):
self.split_on = split_on
super(TelegramBotSplit, self).__init__(chat_id=chat_id)
... |
Update property-types test case with more realistic types. | public class Widget {
private boolean primitive;
private Widget recursiveType;
private Final finalType;
private Pair<? extends Widget, ? super Widget> generics;
private int[][] multiDimensionalArray;
public Widget() {
}
public boolean isPrimitive() {
return primitive;
}
... | public class Widget {
private boolean primitive;
private Widget simpleObject;
private Pair<? extends Pair<? extends Widget, ? super Widget>, ?> nestedGenerics;
private Pair<Widget, ?>[] arrayOfGeneric;
private int[][] multiDimensionalArray;
public Widget() {
}
public boolean isPrimitiv... |
Remove unused dom node generator. | // Example of running gg in node
var d3 = require('d3');
var _ = require('underscore');
var gg = require('./gg.js');
var linechart = gg.gg({
layers: [
{ geometry: 'line', mapping: { x: 'd', y: 'r', group: 'subject', color: 'subject'} },
{ geometry: 'text', mapping: { x: 'd', y: 'r', text: '{d}, {r... | // Example of running gg in node
var d3 = require('d3');
var _ = require('underscore');
var gg = require('./gg.js');
var linechart = gg.gg({
layers: [
{ geometry: 'line', mapping: { x: 'd', y: 'r', group: 'subject', color: 'subject'} },
{ geometry: 'text', mapping: { x: 'd', y: 'r', text: '{d}, {r... |
Exclude folio/react-big-calendar from being transpiled during a platform build | const path = require('path');
// These modules are already transpiled and should be excluded
const folioScopeBlacklist = [
'react-githubish-mentions',
'react-big-calendar',
].map(segment => path.join('@folio', segment));
// We want to transpile files inside node_modules/@folio or outside
// any node_modules direc... | const path = require('path');
// These modules are already transpiled and should be excluded
const folioScopeBlacklist = [
'react-githubish-mentions',
].map(segment => path.join('@folio', segment));
// We want to transpile files inside node_modules/@folio or outside
// any node_modules directory. And definitely not... |
Use the existing util.cli module | """Displays currently active gpu by optimus-manager
Requires the following packages:
* optimus-manager
"""
import core.module
import core.widget
import util.cli
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
... | """Displays currently active gpu by optimus-manager
Requires the following packages:
* optimus-manager
"""
import subprocess
import core.module
import core.widget
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
... |
Fix naming to folliwng naming conventions for mclab | #!/usr/bin/env python
""" Set of helper function and variables for plotting.
This module provides a set of functions and variables that will be useful for
plotting.
"""
class ColorMarker:
def __init__(self):
# A list of colors
self._colors = ['k', 'b', 'g', 'c', 'm', 'y']
# A list of mar... | #!/usr/bin/env python
""" Set of helper function and variables for plotting.
This module provides a set of functions and variables that will be useful for
plotting.
"""
class ColorMarker:
def __init__(self):
# A list of colors
self._colors = ['k', 'b', 'g', 'c', 'm', 'y']
# A list of mar... |
Change variable name & int comparison. | from flask import jsonify, current_app
from . import status
from . import utils
from ..main.helpers.service import ServiceLoader
from ..main import main
@status.route('/_status')
def status():
# ServiceLoader is the only thing that actually connects to the API
service_loader = ServiceLoader(
main.co... | from flask import jsonify, current_app
from . import status
from . import utils
from ..main.helpers.service import ServiceLoader
from ..main import main
@status.route('/_status')
def status():
# ServiceLoader is the only thing that actually connects to the API
service_loader = ServiceLoader(
main.co... |
Update osm way used due to data change | # http://www.openstreetmap.org/way/444491374
assert_has_feature(
16, 10475, 25332, 'roads',
{ 'id': 444491374, 'kind': 'path', 'crossing': 'traffic_signals' })
# Way: The Embarcadero (397140734)
# http://www.openstreetmap.org/way/397140734
assert_has_feature(
16, 10486, 25326, 'roads',
{ 'id': 39714073... | # http://www.openstreetmap.org/way/367477828
assert_has_feature(
16, 10471, 25331, 'roads',
{ 'id': 367477828, 'kind': 'path', 'crossing': 'zebra' })
# Way: The Embarcadero (397140734)
# http://www.openstreetmap.org/way/397140734
assert_has_feature(
16, 10486, 25326, 'roads',
{ 'id': 397140734, 'kind':... |
Upgrade SQLAlchemy 0.9.7 => 1.1.6 | from setuptools import setup
setup(
name='tangled.website',
version='0.1.dev0',
description='tangledframework.org',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.website/tags',
author='Wyatt Baldwin',
... | from setuptools import setup
setup(
name='tangled.website',
version='0.1.dev0',
description='tangledframework.org',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.website/tags',
author='Wyatt Baldwin',
... |
Hide `createdAt` and `updatedAt` for verified users | 'use strict';
const _ = require('lodash');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
email: {
type: String,
lowercase: true,
minlength: [3, 'Text less than 3 char'],
required: [true, '{PATH} is required'],
trim: true,
unique: true
... | 'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
email: {
type: String,
lowercase: true,
minlength: [3, 'Text less than 3 char'],
required: [true, '{PATH} is required'],
trim: true,
unique: true
},
firebaseToken: {
t... |
Revert "Properly handle non-hex characters in MAC"
This reverts commit 2734a3f0212c722fb9fe3698dfea0dbd8a14faa7. | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... |
Remove beautifulsoup4 and lxml as dependencies. | from setuptools import setup
setup(
name='gethazel',
version='0.1.0',
description='A balanced life is a good life.',
author='Reilly Tucker Siemens',
author_email='reilly.siemens@gmail.com',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Appr... | from setuptools import setup
setup(
name='gethazel',
version='0.1.0',
description='A balanced life is a good life.',
author='Reilly Tucker Siemens',
author_email='reilly.siemens@gmail.com',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Appr... |
Fix FileSystemFinder's find return value if not all | import os
from .exceptions import ImproperlyConfigured
from .utils import safe_join
class BaseFinder(object):
def find(self, path, all=False):
raise NotImplementedError()
class FileSystemFinder(BaseFinder):
def __init__(self, directories):
self.locations = []
if not isinstance(dire... | import os
from .exceptions import ImproperlyConfigured
from .utils import safe_join
class BaseFinder(object):
def find(self, path, all=False):
raise NotImplementedError()
class FileSystemFinder(BaseFinder):
def __init__(self, directories):
self.locations = []
if not isinstance(dire... |
Remove unused item deferred register in block deferred register | package info.u_team.u_team_core.util.registry;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IUBlockRegistryType;
import net.minecraft.block.Block;
import net.minecraft.item.*;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.eventbus.api.IEventBus;
import net.mi... | package info.u_team.u_team_core.util.registry;
import java.util.function.Supplier;
import info.u_team.u_team_core.api.registry.IUBlockRegistryType;
import net.minecraft.block.Block;
import net.minecraft.item.*;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.eventbus.api.IEventBus;
import net.mi... |
Change iteritems() to items() for future compatibility | # pylint: disable=wildcard-import,unused-wildcard-import,missing-docstring
from __future__ import absolute_import
from unittest import TestCase
from nose.tools import *
from mock import *
from dear_astrid.rtm.importer import Importer as rtmimp
class TestRTMImport(TestCase):
def setUp(self):
self.patches = di... | # pylint: disable=wildcard-import,unused-wildcard-import,missing-docstring
from __future__ import absolute_import
from unittest import TestCase
from nose.tools import *
from mock import *
from dear_astrid.rtm.importer import Importer as rtmimp
class TestRTMImport(TestCase):
def setUp(self):
self.patches = di... |
Move location of OncallMember to be consistent | package somaproto
type Oncall struct {
Id string `json:"id, omitempty"`
Name string `json:"name, omitempty"`
Number string `json:"number, omitempty"`
Members *[]OncallMember `json:"members, omitempty"`
Details *OncallDetails `json:"details, omitempty"`
}
type OncallDetails st... | package somaproto
type Oncall struct {
Id string `json:"id, omitempty"`
Name string `json:"name, omitempty"`
Number string `json:"number, omitempty"`
Details *OncallDetails `json:"details, omitempty"`
}
type OncallDetails struct {
DetailsCreation
Members *[]OncallMember `json:"m... |
Add missing ocs resource for user workflows
Signed-off-by: Julius Härtl <bf353fa4999f2f148afcc6d8ee6cb1ee74cc07c3@bitgrid.net> | <?php
/**
* @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
*
* @license GNU AGPL version 3 or any later version
*
* This program 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, e... | <?php
/**
* @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
*
* @license GNU AGPL version 3 or any later version
*
* This program 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, e... |
Revert "Revert "list: print message with there's no task with description""
This reverts commit e065dcb81659e5b3c38255ece1702d6c408ffebe.
Reintroducing this. Reverted unintentionally. | package task
import (
"fmt"
"sort"
"text/tabwriter"
)
// PrintTasksHelp prints help os tasks that have a description
func (e *Executor) PrintTasksHelp() {
tasks := e.tasksWithDesc()
if len(tasks) == 0 {
e.outf("task: No tasks with description available")
return
}
e.outf("task: Available tasks for this proj... | package task
import (
"fmt"
"sort"
"text/tabwriter"
)
// PrintTasksHelp prints help os tasks that have a description
func (e *Executor) PrintTasksHelp() {
tasks := e.tasksWithDesc()
if len(tasks) == 0 {
return
}
e.outf("Available tasks for this project:")
// Format in tab-separated columns with a tab stop ... |
Remove from inventory on select | var play = require('../engine/play');
var Player = function(game, name) {
this.name = name;
this.inventory = null;
this.chosen = false;
}
Player.prototype.populateInventory = function (constructSprite) {
this.inventory = _.map(play.chooseIngredients(4), function(name) {
return {
name : name,
sp... | var play = require('../engine/play');
var Player = function(game, name) {
this.name = name;
this.inventory = null;
this.chosen = false;
}
Player.prototype.populateInventory = function (constructSprite) {
this.inventory = _.map(play.chooseIngredients(4), function(name) {
return {
name : name,
sp... |
Update formatting to Salt guidelines | # -*- coding: utf-8 -*-
'''
SCSI administration module
'''
import os.path
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List SCSI devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()... | # -*- coding: utf-8 -*-
"""
SCSI administration module
"""
import logging
log = logging.getLogger(__name__)
def lsscsi():
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.lsscsi
'''
cmd = 'lsscsi'
return __salt__['cmd.run'](cmd).splitlines()
def rescan_all(host):... |
Add some missing return types to internal/final classes | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Authentication;
use Symfony\Component\S... | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Authentication;
use Symfony\Component\S... |
Use enum for the type | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWatches extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('watches', function (... | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWatches extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('watches', function (... |
Update to use <span> instead of <input> for non-modifiable text. |
<!-- Sleep so users see the activity indicator -->
<?php sleep(2); ?>
<ul id="stats" title="Stats">
<li><a href="#usage">Usage</a></li>
<li><a href="#battery">Battery</a></li>
</ul>
<div id="usage" title="Usage" class="panel">
<h2>Play Time</h2>
<fieldset>
<div class="row">
<l... |
<!-- Sleep so users see the activity indicator -->
<?php sleep(2); ?>
<ul id="stats" title="Stats">
<li><a href="#usage">Usage</a></li>
<li><a href="#battery">Battery</a></li>
</ul>
<div id="usage" title="Usage" class="panel">
<h2>Play Time</h2>
<fieldset>
<div class="row">
<l... |
Add logging message to sessionless op processor. | package com.tinkerpop.gremlin.server.op.standard;
import com.tinkerpop.gremlin.driver.Tokens;
import com.tinkerpop.gremlin.driver.message.RequestMessage;
import com.tinkerpop.gremlin.server.Context;
import com.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor;
import com.tinkerpop.gremlin.server.op.OpProcessorExcept... | package com.tinkerpop.gremlin.server.op.standard;
import com.tinkerpop.gremlin.driver.Tokens;
import com.tinkerpop.gremlin.driver.message.RequestMessage;
import com.tinkerpop.gremlin.server.Context;
import com.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor;
import com.tinkerpop.gremlin.server.op.OpProcessorExcept... |
Make all end-points accepting post | import bottle
from bottle import response, request
import json
import jedi
import logging
app = bottle.Bottle( __name__ )
logger = logging.getLogger( __name__ )
@app.post( '/healthy' )
def healthy():
return _Json({})
@app.post( '/ready' )
def ready():
return _Json({})
@app.post( '/completions' )
def complet... | import bottle
from bottle import response, request
import json
import jedi
import logging
app = bottle.Bottle( __name__ )
logger = logging.getLogger( __name__ )
@app.get( '/healthy' )
def healthy():
return _Json({})
@app.get( '/ready' )
def ready():
return _Json({})
@app.post( '/completions' )
def completio... |
Use partially synchronized map in Event hasAnnotation cache.
Signed-off-by: Ross Allan <ca2c77e14df1e7ee673215c1ef658354e220f471@gmail.com> | package nallar.patched.forge;
import nallar.collections.PartiallySynchronizedMap;
import net.minecraftforge.event.Cancelable;
import net.minecraftforge.event.Event;
public abstract class PatchEvent extends Event {
private static final PartiallySynchronizedMap<Class, Boolean> annotationMap = new PartiallySynch... | package nallar.patched.forge;
import java.util.concurrent.ConcurrentHashMap;
import net.minecraftforge.event.Cancelable;
import net.minecraftforge.event.Event;
public abstract class PatchEvent extends Event {
private static final ConcurrentHashMap<Class, Boolean> annotationMap = new ConcurrentHashMap<Class,... |
Make code follow the Python style guidelines
+ Use a doc string for the whole file.
+ Lower case function names.
+ Consistently use single-quotes for quoted strings.
+ align wrapped elements with opening delimiter.
+ use a main() function
Review URL: https://chromiumcodereview.appspot.com//10837127
git-svn-id: c9... | #!/usr/bin/env python
# Copyright (c) 2012 The Dart Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Invoke gyp to generate build files for building the Dart VM.
"""
import os
import subprocess
import sys
def execute(args):
pro... | #!/usr/bin/env python
# Copyright (c) 2012 The Dart Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script is wrapper for Dart that adds some support for how GYP
# is invoked by Dart beyond what can be done in the gclient hooks... |
Add methods to change the beat and volume of tone | from flask import Flask, url_for , request
app = Flask(__name__)
@app.route('/')
def api_root():
return 'Welcome'
# Deprecated
# @app.route('/toggle')
# def api_toggle():
# # Toggle the state of the player
# return 'state changed'
# @app.route('/volume/<volume_value>')
# def api_volume(volume_value):
# ... | from flask import Flask, url_for
app = Flask(__name__)
@app.route('/')
def api_root():
return 'Welcome'
# Deprecated
# @app.route('/toggle')
# def api_toggle():
# # Toggle the state of the player
# return 'state changed'
# @app.route('/volume/<volume_value>')
# def api_volume(volume_value):
# # Adjusts ... |
Add deleteAll() as its own method | 'use strict';
/**
* DRY out REST requests to the data API
*/
module.exports = function(app) {
app.factory('httpService', function($http, $location) {
// Generic helper function
var http = function(method, params) {
params.id = params.id || '';
var promise = $http[method]('/api/0_0_1/data/' + params.id... | 'use strict';
module.exports = function(app) {
app.factory('httpService', function($http, $location) {
// Generic helper function
var http = function(method, params) {
params.id = params.id || '';
var promise = $http[method]('/api/0_0_1/data/' + params.id, params.data)
.error(function(error, status) {... |
Check more data about riemann | from pytest import fixture
from oshino.config import Config, RiemannConfig
@fixture
def base_config():
return Config({"riemann": {"host": "localhost",
"port": 5555
},
"interval": 5
})
@fixture
def incomplete_con... | from pytest import fixture
from oshino.config import Config, RiemannConfig
@fixture
def base_config():
return Config({"riemann": {"host": "localhost",
"port": 5555
},
"interval": 5
})
@fixture
def incomplete_con... |
Add methods for convert responses | <?php
namespace Artesaos\Zenvia\Contracts;
use Artesaos\Zenvia\Exceptions\ZenviaResponseException;
use Psr\Http\Message\ResponseInterface;
interface ResponseHandlerInterface
{
/**
* Convert a PSR-7 response to a data type you want to work with.
*
* @param ResponseInterface $response
* @param... | <?php
namespace Artesaos\Zenvia\Contracts;
use Artesaos\Zenvia\Exceptions\ZenviaResponseException;
use Psr\Http\Message\ResponseInterface;
interface ResponseHandlerInterface
{
/**
* Convert a PSR-7 response to a data type you want to work with.
*
* @param ResponseInterface $response
* @param... |
WIP: Move to JS and Refactoring | (function() {
"use strict";
var _;
var host = process.argv[2];
var port = process.argv[3];
if (!host || !port) {
logger.log("Usage: app.js host port");
process.exit();
}
var server = require('fora-app-server');
var config = {
baseConfiguration: require('../co... | (function() {
"use strict";
var _;
var host = process.argv[2];
var port = process.argv[3];
if (!host || !port) {
logger.log("Usage: app.js host port");
process.exit();
}
var server = require('fora-app-server');
var config = {
baseConfiguration: require('../co... |
Add matplotlib as dev dependency | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.2.1dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='windpowerlib',
version='0.2.1dev',
description='Creating time series of wind power plants.',
url='http://github.com/wind-python/windpowerlib',
author='oe... |
Fix dash in author email | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as v_file:
version = v_file.read().strip()
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
setup(
name='canvas_python_sdk',
version=ver... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as v_file:
version = v_file.read().strip()
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
setup(
name='canvas_python_sdk',
version=ver... |
Make a utf-8 string in getLine for Node | var i$putStr = (function() {
var fs = require('fs');
return function(s) {
fs.write(1,s);
};
})();
var i$getLine = (function() {
var fs = require( "fs" )
return function() {
var ret = "";
var b = new Buffer(1024);
var i = 0;
while(true) {
fs.readSync(0, b, i, 1 )
if (b[i] == 1... | var i$putStr = (function() {
var fs = require('fs');
return function(s) {
fs.write(1,s);
};
})();
var i$getLine = (function() {
var fs = require( "fs" )
return function() {
var ret = "";
while(true) {
var b = new Buffer(1);
fs.readSync(0, b, 0, 1 )
if (b[0] == 10)
brea... |
Remove unload objects as this leads to errors | (function() {
var app;
var getApplication = function() {
return app;
};
var shutDown = function() {
lowland.ObjectManager.dispose();
};
var startUp = function() {
var Application = core.Class.getByName(core.Env.getValue("application") + ".Application");
var init = new Application()... | (function() {
var app;
var getApplication = function() {
return app;
};
var shutDown = function() {
lowland.ObjectManager.dispose();
};
var startUp = function() {
var Application = core.Class.getByName(core.Env.getValue("application") + ".Application");
var init = new Application()... |
Make missing assets 404 correctly | /**
* Module dependencies.
*/
var Promise = require('bluebird');
var path = require('path');
var _ = require('lodash');
var highlighter = require('../../../highlighter');
var utils = require('../../../utils');
/*
* Export the pages route handlers.
*/
var handlers =... | /**
* Module dependencies.
*/
var Promise = require('bluebird');
var path = require('path');
var _ = require('lodash');
var utils = require('../../../utils');
/*
* Export the pages route handlers.
*/
var handlers = exports = module.exports = {};
handlers.params = {};
... |
Revert "Update usage of less-middleware"
This reverts commit d6bbc054f68fc7382ab1b14cb8afaff521548019. | var express = require('express');
var less = require('less-middleware');
var path = require('path');
exports.register = function(application, params) {
params = params || {};
var prefix = params.prefix || '';
prefix = prefix.replace(/\/$/, '');
var topDirectory = path.join(__dirname, '..', '..', '..');
app... | var express = require('express');
var less = require('less-middleware');
var path = require('path');
exports.register = function(application, params) {
params = params || {};
var prefix = params.prefix || '';
prefix = prefix.replace(/\/$/, '');
var topDirectory = path.join(__dirname, '..', '..', '..');
app... |
Fix process params to only accept StateMachine
It must accept all class that implement StateMachineInterface | <?php
namespace Finite\Transition;
use Finite\StateMachine\StateMachineInterface;
/**
* The base Transition interface
*
* @author Yohan Giarelli <yohan@frequence-web.fr>
*/
interface TransitionInterface
{
/**
* Returns the array of states that supports this transition
*
* @return array
*... | <?php
namespace Finite\Transition;
use Finite\StateMachine\StateMachine;
/**
* The base Transition interface
*
* @author Yohan Giarelli <yohan@frequence-web.fr>
*/
interface TransitionInterface
{
/**
* Returns the array of states that supports this transition
*
* @return array
*/
pub... |
Fix 'Datacash' to 'Sagepay' in Dashboard
Copy-paste did it again | from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from oscar.core.application import Application
from . import views
try:
from oscar.apps.dashboard.nav import register, Node
except ImportError:
pass
else:
# Old way of registering Dashboard n... | from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from oscar.core.application import Application
from . import views
try:
from oscar.apps.dashboard.nav import register, Node
except ImportError:
pass
else:
# Old way of registering Dashboard n... |
Update docblocks for begin & end methods | <?php
namespace Benrowe\Laravel\Widgets\Traits;
/**
* Provides the begin & end functionality for the Widget factory
*
* @package Benrowe\Laravel\Widgets
*/
trait BeginEndFactory
{
private $stack = [];
/**
* Being the widget
*
* @return Expression
*/
public function begin()
{
... | <?php
namespace Benrowe\Laravel\Widgets\Traits;
/**
* Provides the begin & end functionality for the Widget factory
*
* @package Benrowe\Laravel\Widgets
*/
trait BeginEndFactory
{
private $stack = [];
/**
* [begin description]
* @return [type] [description]
*/
public function begin()
... |
Fix timeout error in UserContainer test. | var _ = require('underscore');
var UserContainer = require('../lib/authentication/user-container');
var assert = require('chai').assert;
describe('tests of garbage collecting of outdated cookies', function() {
var responseMock = {
cookies: {
set: function() {
}
}
};
it('', function(done) {
... | var _ = require('underscore');
var UserContainer = require('../lib/authentication/user-container');
var assert = require('chai').assert;
describe('tests of garbage collecting of outdated cookies', function() {
var responseMock = {
cookies: {
set: function() {
}
}
};
it('', function(done) {
... |
Fix a typo in blorg test | package blorg
import (
"fmt"
"io/ioutil"
"os/exec"
"strings"
"testing"
)
func TestBlorg(t *testing.T) {
config, err := ReadConfig("testdata/blorg.org")
if err != nil {
t.Errorf("Could not read config: %s", err)
return
}
committedHashBs, err := ioutil.ReadFile("testdata/public.md5")
if err != nil {
t.E... | package blorg
import (
"fmt"
"io/ioutil"
"os/exec"
"strings"
"testing"
)
func TestBlorg(t *testing.T) {
config, err := ReadConfig("testdata/blorg.org")
if err != nil {
t.Errorf("Could not read config: %s", err)
return
}
commitedHashBs, err := ioutil.ReadFile("testdata/public.md5")
if err != nil {
t.Er... |
Add provider client method to get provider version history |
from app.notify_client import _attach_current_user, NotifyAdminAPIClient
class ProviderClient(NotifyAdminAPIClient):
def __init__(self):
super().__init__("a", "b", "c")
def init_app(self, app):
self.base_url = app.config['API_HOST_NAME']
self.service_id = app.config['ADMIN_CLIENT_USE... |
from app.notify_client import _attach_current_user, NotifyAdminAPIClient
class ProviderClient(NotifyAdminAPIClient):
def __init__(self):
super().__init__("a", "b", "c")
def init_app(self, app):
self.base_url = app.config['API_HOST_NAME']
self.service_id = app.config['ADMIN_CLIENT_USE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.