text stringlengths 3 1.05M |
|---|
from ..config import Config, CONFIG_FOLDER
__all__ = [
'logging_config'
]
logging_config = Config(
CONFIG_FOLDER / 'console_logging_config.json',
log_privmsg=True,
log_whisper=True,
log_command_usage=True,
log_whisper_sent=True,
log_privmsg_sent=True,
)
|
from django.views.generic import TemplateView
class BaseView(TemplateView):
template_name = 'react-template.html'
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the Lic... |
/*
* SPDX-License-Identifier: Apache-2.0
*/
#include "fp_vectors/Floats.h"
#include "fp_vectors/static_vectors.h"
#include <sandstone.h>
Float32 random_float32(int pct_fixed){
return (random32() % 100 < pct_fixed) ? pick_randomized_float32_vector() : new_random_float32();
}
Float64 random_float64(int pct_fixe... |
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("lang/calendar_zh-HANT-TW",function(e){e.Intl.add("calendar","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u... |
import requests
def do_query(data):
url = 'http://skywalking-trace-monitor.dev.local.wangjiahuan.com/graphql'
headers = {'content-type': 'application/json'}
r = requests.post(url, data=data, headers=headers)
return r.json()
def query_by_trace_id(trace_id):
query = """
{"query":"query queryTr... |
"""
util.py
Brian Wang
Utilities for loading in lidar and image data.
"""
import numpy as np
from skimage.io import imread
CLASS_NAMES = ['BG', 'person', 'bicycle', 'car', 'motorcycle', 'airplane',
'bus', 'train', 'truck', 'boat', 'traffic light',
'fire hydrant', 'stop sign', 'parking m... |
# Generated by Django 3.1.7 on 2021-04-03 06:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ghostpost', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='post',
name='downvotes',
... |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.0
*/
goog.provide('ng.material.components.toast');
goog.require('ng.material.components.button');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.toast
* @description
* Toast
*/
ang... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var styled_icon_1 = require("@styled-icons/styled-icon");
exports.PhotoAlbum = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "curr... |
class ConstraintSuggestion:
def __init__(self, constraint, column, current_value, description, rule, code):
self.constraint = constraint
self.column = column
self.current_value = current_value
self.description = description
self.rule = rule
self.code = code
def ... |
import os
import sys
import string
import stat
import enstore_plots
import enstore_html
import enstore_files
import generic_client
import enstore_make_plot_page
TMP = ".tmp"
class QueuePlotPage(enstore_html.EnPlotPage):
def __init__(self, title, gif, description, url):
self.url = url
enstore_htm... |
import datetime
import os
import json
import uuid
import requests
from flask import Flask, request
from flask_cors import CORS
from google.cloud import datastore, storage
from marshmallow.exceptions import ValidationError
from logger import init_stackdriver
from backend import parse_piece_to_piece_model
from backend... |
(function() {
'use strict';
var MilesToKilometers = function() {};
MilesToKilometers.prototype.get = function(x) {
if(typeof x !== "number") {
return 'invalid input';
} else {
return x * 1.60934;
}
};
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && mo... |
const isDevelopment = process.env.NODE_ENV !== "production";
const isProduction = !isDevelopment;
module.exports = {
styledComponents: {
ssr: true,
pure: true,
displayName: isDevelopment,
minify: isProduction,
namespace: isDevelopment ? "🐟" : null
}
}
|
Object.defineProperty(exports, "__esModule", { value: true });
var network;
function getNetwork() {
return network;
}
exports.getNetwork = getNetwork;
function setNetwork(newNetwork) {
network = newNetwork;
}
exports.setNetwork = setNetwork;
var NetworkAgent;
(function (NetworkAgent) {
function responseRece... |
/*
* Generic barcode drawing functions
*
* DEPRECATION NOTICE:
* This class is being _DEPRECATED_ and will be removed in the future. Please do
* not rely on it, rather please use the Barcode2D drawer instead.
*/
var gm = require('gm');
const MODE_BINARY = 0;
const MODE_BARWIDTH = 1;
// constructor
// with defa... |
import { rebind } from '../utils';
import { pointAndFigure } from '../calculator';
import baseIndicator from './baseIndicator';
const ALGORITHM_TYPE = 'PointAndFigure';
export default function() {
const base = baseIndicator().type(ALGORITHM_TYPE);
const underlyingAlgorithm = pointAndFigure();
const indicator... |
import { markdown } from 'markdown';
export default function init(ngModule) {
ngModule.filter('markdown', ($sce, clientConfig) => function parseMarkdown(text) {
if (!text) {
return '';
}
let html = markdown.toHTML(String(text));
if (clientConfig.allowScriptsInUserInput) {
html = $sce.tru... |
import torch
from torchtext import functional
from .common.torchtext_test_case import TorchtextTestCase
class TestFunctional(TorchtextTestCase):
def test_to_tensor(self):
input = [[1, 2], [1, 2, 3]]
padding_value = 0
actual = functional.to_tensor(input, padding_value=padding_value)
... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{w2l6:function(e,t,o){"use strict";o.r(t);var n=o("q1tI"),a=o.n(n),r=o("7oih");var i=function(e){var t,o;function n(){return e.apply(this,arguments)||this}return o=e,(t=n).prototype=Object.create(o.prototype),t.prototype.constructor=t,t.__proto__=o,n.prototype.ren... |
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { store, history } from './store';
import { Route, Switch } from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
import './index.css';
import App from './App';
import registerServiceWork... |
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof wind... |
"""
This file offers the methods to automatically retrieve the graph Mycobacterium bohemicum.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protei... |
import Component from '@ember/component';
import layout from './template';
import { computed } from '@ember/object';
import { get } from '@ember/object';
import { tempI18n } from '../../helpers/temp-i18n';
export default Component.extend({
layout,
classNames: ['ui-verification'],
attributeBindings: ['renderId']... |
/**
* Created by Jean on 2019-10-09.
*/
const MapBase = {
minZoom: 2,
maxZoom: 7,
map: null,
overlays: [],
fastTravelData: [],
// see building interiors in overlays; might not be rotated right
// (you also have to load overlays_beta.json instead of overlays.json in loader.js)
interiors: false,
impo... |
Body Count is an American heavy metal band formed in Los Angeles,
California, in 1990. The group is fronted by Ice-T, who co-founded the group
with lead guitarist Ernie C out of their interest in heavy metal music.
Ice-T took on the role of vocalist and writing the lyrics for most of
the group’s songs. Lead guitarist E... |
from random import randint
import util
def run_healthcmd_setup(stack, cmd, interval='',
retries='', start='', timeout=''):
name = "tsrv" + str(randint(1000, 5000))
fullName = (f"{stack}/{name}")
options = (f'{interval}{retries}{start}{timeout}')
rcmd = (f'rio run -n {fullName... |
def main():
num1 = input("What's the first string you want to add?")
num2 = input("What's the second number you want to add?")
print(int(num1) + int(num2))
if __name__ == "__main__":
main() |
// THIS FILE IS AUTO GENERATED
import { GenIcon } from '../lib';
export function BiPurchaseTagAlt (props) {
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M11.707,2.293C11.52,2.105,11.265,2,11,2H6C5.735,2,5.48,2.105,5.293,2.293l-3,3C2.105,5.48,2,5.734,2,6v5 c0,0.266,0.1... |
from __future__ import division, print_function, absolute_import
import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import numpy as np
def _valarray(shape, value=np.nan, typecode=None):
"""Return an array of all value.
... |
import pytest
from ..models import A
@pytest.mark.django_db
def test_obj_update():
a = A.objects.get(x=2)
a.text = 'testtesttest'
a.save()
assert A.objects.get(x=2).text == 'testtesttest'
@pytest.mark.django_db
def test_manager_update_pk():
A.objects.filter(primary_key=(1, 'a')).update(text='t... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... |
import strawberry
import strawberry_django
import pytest
from strawberry_django import auto, field
from typing import List
from . import models, utils
@pytest.fixture
def user_group(users, groups):
users[0].group = groups[0]
users[0].save()
@strawberry_django.type(models.User)
class User:
id: auto
nam... |
var data = {
"body": "<path d=\"M14 5c0-1.1-.9-2-2-2h-1V2c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v1H4c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2h8V5h-8zm-2 13h-2v-2h2v2zm0-9h-2V7h2v2zm4 9h-2v-2h2v2zm0-9h-2V7h2v2zm4 9h-2v-2h2v2zm0-9h-2V7h2v2z\" fill=\"currentColor\"/>",
"width": 24,
"height": 24
};
exports.__esModu... |
import logging
from typing import Any, Dict, List, Optional
from dipdup.config import HTTPConfig
from dipdup.datasources.datasource import Datasource
TOKENS_REQUEST_LIMIT = 10
class BcdDatasource(Datasource):
_default_http_config = HTTPConfig(
cache=True,
retry_sleep=1,
retry_multiplier=... |
"key": "clicmanager", "type": "ads", "name": "Clicmanager", "uri": "http://www.clicmanager.fr/infos_legales.php", "needConsent": true, "cookies": [], "js": function () { "use strict"; var uniqIds = [], i, uri; tarteaucitron.fallback(['clicmanager-canvas'], fu... |
/*
* 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... |
export default async function*() {}
|
import AuthConfig from "./auth-config.js"
export default class AuthGmail extends AuthConfig {
static get name() {
return "gmail"
}
}
AuthGmail.load()
|
import React from 'react';
class Tester extends React.Component {
constructor(props) {
super(props);
this.state = {
listItems: [
'List item 1',
'List item 2',
'List item 3',
],
};
// this.displayStateData = this.displayStateData.bind(this);
}
displayStateData... |
from django.apps import AppConfig
class CareConfig(AppConfig):
name = 'Laelia.apps.care'
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
/* variables */
var canvas,
currColor = '#002FFF',
backColor = '#ffffff',
gCanvas = document.getElementById('gCanvas'),
isRedoing = false,
h = [],
model = undefined,
imgData_model = new Image;
imgData_model.src = './img/demo.jpg';
/* color pallette click events */
$(document).on("click", ... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... |
import hashlib
def calculate_hash(payload):
sha = hashlib.sha1()
sha.update(payload)
return sha.hexdigest()
def normalize_url(url, schema='http'):
if not url.startswith('http'):
return '{}://{}'.format(schema, url)
else:
return url
|
/*
* jdhuff.h
*
* Copyright (C) 1991-1995, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains declarations for Huffman entropy decoding routines
* that are shared between the seq... |
#!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2010. All Rights Reserved.
#
#
# THIS IMPORT MUST COME FIRST
# import mainUtils FIRST to get python version check
#
from gppylib.mainUtils import *
import os, sys
import pickle, base64
import re
from optparse import Option, OptionGroup, OptionParser, OptionValueE... |
import React from 'react';
import { SortableContainer, SortableElement } from 'react-sortable-hoc';
import { ContentConsumer } from '../../contexts/ContentContext';
import DragHandle from '../DragHandle/index';
import Section from '../Section/index';
const SortableSections = () => {
const shouldMemo = (prev, next) =... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import {fetchDataIfNeeded, invalidateData} from '../actions/apiActions'
import Header from '../components/Header'
import FiltersContainer from './FiltersContainer'
import PlayerListContainer from './PlayerL... |
/* G L O B . C
* BRL-CAD
*
* Copyright (c) 2008-2021 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as pub... |
export default class {
/* @ngInject */
constructor ($element, $timeout) {
this.$element = $element;
this.$timeout = $timeout;
}
$postLink () {
this.$timeout(() =>
this.$element
.addClass("oui-navbar-dropdown")
.addClass("oui-navbar-lis... |
const test = require('tape')
const wms = require('./wms')
const xml = require('../test/xml')
test('wms', t => {
console.log(wms(xml.toporama.wms))
t.end()
})
|
#!/usr/bin/env python2
import sys
from os import path, pardir
from xml.dom.minidom import parse
root = path.abspath(path.join(path.dirname(path.abspath(__file__)), pardir))
pretty_print = lambda d: '\n'.join([line for line in d.toprettyxml(indent=' ' * 2).split('\n') if line.strip()])
if __name__ == '__main__':
... |
// Win32++ Version 8.6
// Release Date: 2nd November 2018
//
// David Nash
// email: dnash@bigpond.net.au
// url: https://sourceforge.net/projects/win32-framework
//
//
// Copyright (c) 2005-2018 David Nash
//
// Permission is hereby granted, free of charge, to
// any person obtaining a copy of this s... |
//===- StmtOpenMP.h - Classes for OpenMP directives ------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
/*=========================================================================================
File Name: stacked-area.js
Description: d3 stacked area chart
----------------------------------------------------------------------------------------
Item Name: Modern Admin - Clean Bootstrap 4 Dashboard HTML Te... |
/**
* Created by: Andrey Polyakov (andrey@polyakov.im)
*/
import {arrayFilterEmpty} from '../utils/helpers';
import {
cssLoader,
cssLoaderItems,
cssModulesSupportLoaderItems,
lessLoader,
miniCssExtractLoader,
postCssLoader,
resolveUrlLoader,
sassLoaderItems,
} from './useLoaderRuleItem... |
$(document).ready(function (){
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.LoadingOverlaySetup({
background : "rgba(0, 0, 0, 0)"
});
$('.select2').select2({theme:'classic'});
$(document).ajaxStart(f... |
#ifndef CCTBX_XRAY_GRADIENT_FLAGS_H
#define CCTBX_XRAY_GRADIENT_FLAGS_H
namespace cctbx { namespace xray {
struct gradient_flags
{
gradient_flags(
bool site_,
bool u_iso_,
bool u_aniso_,
bool occupancy_,
bool fp_,
bool fdp_,
bool sqrt_u_iso_,
double tan_b_iso_ma... |
const config = require('../config');
const rp = require('request-promise');
const request = {
/** Run get request with provided data
* @param {String} endpoint - Endpoint to send request to
* @param {Object|String} queryData - Query string data
* @param {Boolean} includeHeaders - Whether or not to include a... |
import altair as alt
import pandas as pd
from sys import argv
df = pd.read_csv(argv[1], keep_default_na=False)
titleid = argv[2]
def shorten(x): return (x[:30] + '..') if len(x) > 32 else x
def funcsign(x): return 'positive' if x > 0.0 else (
'negative' if x < 0.0 else 'null')
def correctphen(x):
x = x.re... |
#pragma once
#include <string>
#include <sstream>
#include <ctime>
#include <chrono>
#include "Square/Core/Core.h"
namespace Square {
enum Severity {
DEBUG = 0,
INFO = 1,
WARNING = 2,
ERROR = 3,
FATAL = 4,
NUM_SEVERITIES
};
class SQUARE_API LogMessage : public std::ostringstream
{
public:
LogM... |
/*
* Viry3D
* Copyright 2014-2019 by Stack - stackos@qq.com
*
* 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 applicabl... |
import find from 'lodash/find';
import get from 'lodash/get';
import includes from 'lodash/includes';
import indexOf from 'lodash/indexOf';
import isEmpty from 'lodash/isEmpty';
import isString from 'lodash/isString';
import kebabCase from 'lodash/kebabCase';
import map from 'lodash/map';
import merge from 'lodash/merg... |
import itertools
import logging
from base64 import b64decode
from typing import Any, Iterator, Optional, Tuple, cast
import boto3
from aws_orbit.utils import boto3_client
_logger: logging.Logger = logging.getLogger(__name__)
def _chunks(iterable: Iterator[Any], size: int) -> Iterator[Any]:
iterator = iter(iter... |
const express = require('express');
const bodyParser = require('body-parser');
// Create Express App
const app = express();
// parse requests of content-type - application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: true }));
// parse requests of content-type - application/json
app.use(bodyParser... |
import Vue from 'vue'
import { parseFilters } from 'compiler/parser/filter-parser'
describe('Filters', () => {
it('basic usage', () => {
const vm = new Vue({
template: '<div>{{ msg | upper }}</div>',
data: {
msg: 'hi'
},
filters: {
upper: v => v.toUpperCase()
}
}... |
import tensorflow as tf
import numpy as np
import gym
from ou_noise import OUNoise
LAYER_1 = 400
LAYER_2 = 300
LAYER_3 = 300
keep_rate = 0.8
LAMBDA = 0.00001 # regularization term
GAMMA = 0.99
class IDDPG(object):
def __init__(self, sess, state_dim, action_dim, max_action, min_action, actor_learning_rate, critic... |
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('@angular/core'),require('@angular/material/core'),require('@angular/common'),exports, require('@angular/core'), require('@angular/cdk/coercion'), require('@angular/common'), require('@angular/material/core'... |
import { StackNavigator, TabNavigator, TabBarBottom } from 'react-navigation';
import { START_SCREEN } from './constants'
import Splash from './routes/splash/';
import LoginSelection from './routes/login-selection/';
import EmailLogin from './routes/email-login/';
import GenderSelection from './routes/gender-selectio... |
from __future__ import absolute_import, unicode_literals
from celery import Celery
from commons.logs import setup_logger
app = Celery('executor', include=['executor.tasks'])
app.config_from_object('executor.config')
if __name__ == '__main__':
setup_logger()
app.start()
|
import Anchor from "./composites/Anchor";
import Handle from "./composites/Handle";
import Point from "./composites/Point";
import InvalidSVGPathException from "./exceptions/InvalidSVGPathException";
import { Bezier } from "bezier-js"; // consider switching entire Ease class to bezier-js
export default class Ease {
... |
#include <stdio.h>
#include <stdlib.h>
#include "FunctionsBib.h"
|
import json
from utils.output_methods import notify_print
from configs.meta_params import config_file_path
from configs.config_labels import l_shell_line_length, all_config_labels
def env_exec(arg_reset, arg_set):
if not (arg_reset or arg_set):
notify_print('error', 'There should be either --reset [env ar... |
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purp... |
import unittest
from . import commons
class PalindromeTest(unittest.TestCase):
def test_is_palindrome(self):
self.assertEqual(commons.is_palindrome('tacocat'), True)
self.assertEqual(commons.is_palindrome('taco-cat'), True)
def test_is_palindrome_phrase(self):
self.assertEqual(commons... |
from abc import ABC
from .content import ContentPropertyMixin
from .delitem import DelItemMixin
from .embed import EmbedMixin
from .empty import EmptyMixin
from .evaluation import EvaluationMixin
from .getattr import GetAttributeMixin
from .getitem import GetItemMixin
from .group import GroupMixin
from .io.binary impo... |
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
# from decouple import config
from unipath import Path
import dj_database_url
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)... |
"""
Copyright 2020 Nvidia Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Re... |
#pragma once
#include <QWidget>
#include "controls/TWidget.h"
class QPainter;
namespace ui{
class DefaultWidget : public ui::TWidget
{
Q_OBJECT
public:
explicit DefaultWidget(QWidget *parent = 0);
~DefaultWidget();
protected:
//void paintEvent(QPaintEvent *event);
};
}
|
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import sys
import subprocess
import pkg_resources
import misc
from _exception_classes import PrerequisiteError
def check_prereq(prereq, manual_execs = {}, gslab_vers = None):
'''
Check if the prerequisites for prereq are satisfied.
If prereq is a program, check that its executable is in the path.
If ... |
#!./venv/bin python3
|
# -*- coding: utf-8 -*-
from flask import url_for
from flask_wtf import FlaskForm
from wtforms import ValidationError
from wtforms.fields import BooleanField, PasswordField, StringField, SubmitField, TextAreaField, SelectField, SelectMultipleField
from wtforms.fields.html5 import EmailField
from wtforms.validat... |
import { FETCH_COURSES } from '../actions/types';
export default function(state = [], action) {
switch(action.type) {
case FETCH_COURSES:
console.log(action.payload);
return [ ...state, ...action.payload]
default: return state
}
} |
"""
Unit test of Check
"""
import unittest
import pandas as pd
import numpy as np
import category_encoders as ce
from shapash.utils.check import check_preprocessing, check_model, check_label_dict,\
check_mask_params, check_ypred, check_contribution_object,\
... |
"""
Code for interacting with the Teensy. The main use of this file is to provide a central way to access the Teensy and
avoid possible race conditions.
"""
import logging
import serial
import glob
from tenacity import retry, stop_after_attempt
class Teensy:
def __init__(self):
ports = glob.glob('/dev/t... |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2014 California Institute of Technology. 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 copy of th... |
"""
The purpose of this test file is to check how ctypes really work,
down to what aliases what and what exact types operations return.
"""
import pytest
from ctypes import *
def test_primitive_pointer():
x = c_int(5)
assert x.value == 5
x.value = 6
assert x.value == 6
p = pointer(x) ... |
from InstagramAPI import InstagramAPI
import sys
sys.path.insert(0, '/home/pi/develop/instabot.py/instabot_py/models')
from followers_model import FollowersModel
import constantRaspbian
def getTotalFollowers(api, user_id):
followers = []
next_max_id = True
while next_max_id:
# first iteration hack
... |
import datetime
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
inp = np.loadtxt('data/VSDFREQESP01.txt')
print(inp)
z = []
xchart = []
ychart = []
for i in range(288):
ychart.append("Minute: " + str(i*5))
print(len(inp))
for i in range(int(len(inp)/288 + 1)):
x... |
/********************************************************************************
* The MIT License (MIT) *
* *
* Copyright (C) 2016 Alex Nolasco ... |
// console.log('I work!');
// $(function() {
// var ul = $(".slider ul");
// var slide_count = ul.children
// })
$(document).ready(function () {
$.getJSON(url, function)
$('.prev').click(function () {
var activeImage = $('.active')
var nextImage - activeImage.prev()
activeImage.removeClass('.acti... |
import Icon from '../components/Icon.vue'
Icon.register({"subway":{"width":448,"height":512,"paths":[{"d":"M448 96v256c0 51.815-61.624 96-130.022 96l62.98 49.721C386.905 502.417 383.562 512 376 512H72c-7.578 0-10.892-9.594-4.957-14.279L130.022 448C61.82 448 0 403.954 0 352V96C0 42.981 64 0 128 0h192c65 0 128 42.981 12... |
import logging
import time
from platypush.backend import Backend
from platypush.context import get_plugin
from platypush.message import Message
from platypush.message.event.kafka import KafkaMessageEvent
class KafkaBackend(Backend):
"""
Backend to interact with an Apache Kafka (https://kafka.apache.org/)
... |
// DOM-IGNORE-BEGIN
/*******************************************************************************
* Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
... |
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
const catalogue = {
totalCredits: 260,
maxCreditsSem: 38,
semesters: {
'sem-1': {
id: '1',
subjects: ['BE180', 'BT181', 'BC182', 'BG180', 'BZ183', 'EL212', 'F_107', 'QG107']
},
'sem-2': {
id: '2',
subjects: ['BB281', 'BC282', 'EL683', 'BH282', 'BG282', 'BZ280', 'ELET02', 'BA281', 'BT281']
},
's... |