text stringlengths 3 1.05M |
|---|
/*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:49:26 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/PrivateFrameworks/FuseUI.framework/FuseUI
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limn... |
import { Injectable } from '@angular/core';
import { Fields } from './fields';
import * as i0 from "@angular/core";
import * as i1 from "./fields";
export class Config {
constructor(fields) {
this.fields = fields;
this.fieldsBuilded = [];
this.fieldsClass = fields;
this.config = {
... |
import Fonts from './Fonts';
import Metrics from './Metrics';
import Colors from './Colors';
const base = {
navbar: {
navBarContainer: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
height: 50,
alignSelf: 'stretch',
fle... |
# 计算n x n整数数组的二维有限radon变换(FRT)。 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# viewer documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 4 15:35:54 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... |
import React from "react"
import 'bootstrap/dist/css/bootstrap.min.css'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import {
faTwitterSquare,
faLinkedin,
faGitlab,
faGithub,
} from '@fortawesome/free-brands-svg-icons'
import {
faAddressCard
} from '@fortawesome/free-solid-svg-icons'
export de... |
# -*- coding: utf-8 -*-
from ...context import init_test_context
init_test_context()
from zvt.recorders.eastmoney.meta.china_stock_meta_recorder import ChinaStockMetaRecorder
from zvt.settings import SAMPLE_STOCK_CODES
def test_meta_recorder():
recorder = ChinaStockMetaRecorder(codes=SAMPLE_STOCK_CODES)
tr... |
#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED
#include "warper.h"
//#defines
#define WARPER_MAX_LEVEL 50
#define WARPER_MAX_STAT_LEVEL 100
//enum definitions
enum warperClass
{
classNone,
classAttacker,
classShooter, //maybe rename this one
classTechnomancer
};
enum warperStatus
{
statusN... |
const moment = require('moment');
const SetCurrency = require('./set_currency');
const BinaryPjax = require('../../base/binary_pjax');
const Client = require('../../base/client');
const BinarySocket = require('../../base/socket');
const showPopup = requi... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = openNotifications;
/**
*
* Open the notifications pane on the device.
*
* <example>
:openNotificationsSync.js
browser.openNotifications();
* </example>
*
* @type mobile
* @for android
*
*/
function ope... |
load(
"@rules_cc//cc:cc_toolchain_config_lib.bzl",
"FeatureInfo",
"feature",
"flag_group",
"flag_set",
_feature = "feature",
)
load(
"@rules_cc//cc:action_names.bzl",
"ACTION_NAMES",
"ACTION_NAME_GROUPS",
"ALL_CC_COMPILE_ACTION_NAMES",
"ALL_CPP_COMPILE_ACTION_NAMES",
"CC_... |
export default {
serviceUrl: "http://my.service/endpoint",
timeout: 1000
};
|
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# -*- coding: utf-8 -*-
desc = "Rotated labels"
phash = "a91fa2a3713dcc0b"
def plot():
from matplotlib import pyplot as plt
x = [1, 2, 3, 4]
y = [1, 4, 9, 6]
fig = plt.figure()
plt.subplot(611)
plt.plot(x, y, "ro")
plt.xticks(x, rotation="horizontal")
plt.subplot(612)
plt.plot... |
$(document).ready(function() {
$("#document_form").validate({
rules : {
status_re_tel_date:{
date:true,
}
}, tooltip_options: {
}
});
$("#edit_document").click(function(){
if(!$('#document_form').valid() || !$('#document_form').data("va... |
import webbrowser
import os
import re
# Styles and scripting for the page
main_page_head = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Moe's Tomatoes!</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/cs... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rupesh Tare <rupesht@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
import copy
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_RE... |
import React from 'react';
export default function MapMarkerMinus(props) {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width={24} height={24} {...props}>
<path d="M14,9.45H10a1,1,0,0,0,0,2h4a1,1,0,0,0,0-2Zm6.46.18A8.5,8.5,0,1,0,6,16.46l5.3,5.31a1,1,0,0,0,1.42,0L18,16.46A8.46,8.46,0... |
/*
* Copyright (c) 2017 Linaro Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT arm_versatile_i2c
/**
* @file
* @brief Driver for ARM's SBCon 2-wire serial bus interface
*
* SBCon is a simple device which allows directly setting and getting the
* hardware state of two-bit serial interfac... |
import ubelt as ub
import netharn as nh
class Failpoint(Exception):
pass
class MyHarn(nh.FitHarn):
def _run_epoch(harn, loader, tag, learn=False):
if harn.epoch == harn.failpoint:
raise Failpoint
# Overload run_epoch to do nothing
epoch_metrics = {'loss': 3}
retur... |
import React, {PureComponent} from 'react';
import {createPortal} from 'react-dom';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import closeIcon from '@jetbrains/icons/close';
import {AdaptiveIsland} from '../island/island';
import getUID from '../global/get-uid';
import dataTests from '..... |
'''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math
import pickle
import numpy as np
import torch.nn as ... |
from __future__ import division
from itertools import izip
from functools import partial
import numpy as np
from scipy.stats import hypergeom
import pandas as pd
import seaborn as sns
mm9GOFile = "/nas3/lovci/projects/GO/mm9.ENSG_to_GO.txt.gz"
hg19GOFile = "/nas3/lovci/projects/GO/hg19.ENSG_to_GO.txt.gz"
ce10GOFile ... |
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is grante... |
# Copyright (c) 2008,2015,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `basic` module."""
import numpy as np
import pytest
from metpy.calc import (add_height_to_pressure, add_pressure_to_height,
altimeter_... |
(function() {
var Graph, Labyrinth, labyrinth;
sign = function(x) {
return x == 0 ? 0 : (x > 0 ? 1 : -1);
}
enumerate = function(l) {
var t = Object.prototype.toString.call(l);
if (t !== "[object Array]" && t !== "[object String]")
return Object.keys(l);
return l;
}
inOp = function(x, l) {
v... |
"""
Provides pgtree version information.
"""
# This file is auto-generated! Do not edit!
# Use `python -m incremental.update pgtree` to change this file.
from incremental import Version
__version__ = Version("pgtree", 1, 0, 14)
__all__ = ["__version__"]
|
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; withou... |
var Buffer = require('safe-buffer').Buffer
var base58check = require('bs58check')
var bcrypto = require('./crypto')
var createHmac = require('create-hmac')
var typeforce = require('typeforce')
var types = require('./types')
var NETWORKS = require('./networks')
var BigInteger = require('bigi')
var ECPair = require('./e... |
module.exports = {
trailingComma: 'all',
singleQuote: true,
bracketSpacing: true,
jsxBracketSameLine: true,
};
|
"use strict";
exports.__esModule = true;
exports.c_dual_list_selector__list_item_row_m_selected__text_Color = {
"name": "--pf-c-dual-list-selector__list-item-row--m-selected__text--Color",
"value": "#06c",
"var": "var(--pf-c-dual-list-selector__list-item-row--m-selected__text--Color)"
};
exports["default"] = expo... |
from typing import Any, Tuple, Union
def incr(a: int, b: int = 1) -> int:
return a + b
def decr(a, b = 1):
# type: (int, int) -> int
return a - b
class Math:
def __init__(self, s: str, o: Any = None) -> None:
pass
def incr(self, a: int, b: int = 1) -> int:
return a + b
de... |
from telethon import functions
from telethon.errors import ChatSendInlineForbiddenError as noin
from telethon.errors.rpcerrorlist import BotInlineDisabledError as noinline
from telethon.errors.rpcerrorlist import BotMethodInvalidError as dedbot
from telethon.errors.rpcerrorlist import YouBlockedUserError
from FIREX.ut... |
# load the data into the dataset
from __future__ import print_function
import numpy as np
import torch
from torch.utils.data import Dataset
from scipy import sparse
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
class GraphDataSet(Dataset):
def __init__(self, num_d... |
"""firstapp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
/*
* Copyright (C) 2013-2016 Universita` di Pisa
* All rights reserved.
*
* 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... |
// FreqF38x.c: Measure the frequency of a signal on pin T0 (normally P0.0).
//
// By: Jesus Calvino-Fraga
#include <C8051f38x.h>
#include <stdio.h>
#include "global.h"
unsigned char overflow_count;
void waitms (unsigned int ms);
void TIMER0_Init(void)
{
TMOD&=0b_1111_0000; // Set the bits of Timer/Counter 0 to zer... |
import sympy
import re
from IPython.display import display, Latex
def pretty_print(latex, var):
"""function to output results in latex inside of a jupyter notebook"""
result = "$${} = {}$$".format(latex, sympy.latex(var))
display(Latex(result))
def texify_expr(expr, *args):
"""expr should be a string ... |
import ExampleRoute from './example';
export default class DisplayDataChangedActionRoute extends ExampleRoute {}
|
#
# PySNMP MIB module VMWARE-RESOURCES-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/VMWARE-RESOURCES-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:27:55 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
import '../sass/main.scss'
import '@romua1d/star-rating-js/build/index.css'
import StarRating from '@romua1d/star-rating-js';
const AjaxSendRequest = function () {
this.ajax_response = '';
this.ajaxVars = {
ajaxurl: "/wp-admin/admin-ajax.php",
nonce: document.querySelector("meta[name='_wpr_nonce']").getA... |
/*
Copyright (c) 2015, Plume Design Inc. All rights reserved.
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... |
"""Class definitions for TriphoneTrainer"""
from __future__ import annotations
import os
import subprocess
import time
from typing import TYPE_CHECKING, Optional
from ..exceptions import KaldiProcessingError
from ..multiprocessing import compile_train_graphs, convert_alignments, tree_stats
from ..utils import log_kal... |
import React from 'react';
import { Nav, NavList, NavItem, NavVariants } from '@patternfly/react-core';
class NavSimpleList extends React.Component {
state = {
activeItem: 0
};
onSelect = result => {
this.setState({
activeItem: result.itemId
});
};
render() {
const { activeItem } = th... |
from datetime import datetime
import os
import shutil
import tempfile
import time
from studip_sync.config import CONFIG
from studip_sync.logins import LoginError
from studip_sync.plugins.plugins import PLUGINS
from studip_sync.session import Session, DownloadError, MissingFeatureError, \
MissingPermissionFolderEr... |
"""Plot calibration data for DX"""
import sys
import os
import numpy as np
import pandas as pd
import math
import matplotlib.colors
import statistics as st
from datetime import datetime, timedelta
import seaborn as sns
from matplotlib.offsetbox import AnchoredText
from matplotlib.backends.backend_pdf import PdfPages
im... |
/**
* Base Serializer class and factory
*
* @module serializer
*/
import Json from './_json';
import { Signer } from './signer';
import { BadPayload } from './error';
/**
* Serializer Options
* @typedef {object} SerializerOptions
* @property {string} [salt="itsdanger.Serializer"] - Value to salt signature
* @p... |
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
/* eslint-disable */
// transpiled typescript->javascript from
// https://github.com/aurelia/pal-nodejs/blob/master/src/polyfills/mutation-observer.ts
/*
* Based on Shim for MutationObserver interface
* Author: Graeme Yeates (github.... |
import enum
class MeasurementType(str, enum.Enum):
"""Measurement types used during absolutes."""
# declination
FIRST_MARK_UP = "FirstMarkUp"
FIRST_MARK_DOWN = "FirstMarkDown"
WEST_DOWN = "WestDown"
EAST_DOWN = "EastDown"
WEST_UP = "WestUp"
EAST_UP = "EastUp"
SECOND_MARK_UP = "Sec... |
import Ember from 'ember';
import FormatObject from 'frontend/helpers/format-object';
import Capitalize from 'frontend/helpers/capitalize';
function isGroupByDateType(obj) {
let dataType = obj.get('selected.data_type');
if ((dataType == 'date') || (dataType == 'datetime') || (dataType == 'timestamp without ti... |
from .rotationmap import rotationmap
from .linecube import linecube
from .annulus import annulus
__all__ = ["rotationmap", "linecube", "annulus"]
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
... |
const vscode = require('vscode')
const path = require('path')
exports.activate = () => {
console.log(`Enigilo has been activated...`)
vscode.commands.registerCommand(
'enigilo.insertLink',
require(path.join(__dirname, 'cmds', 'InsertLink'))
)
vscode.commands.registerCommand(
'enigilo.insertImage',... |
"use strict";
/*!
* Copyright 2018 Google Inc. 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 the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
"""
========================
Plotting model stability
========================
Next we'll show off another demonstration of model fitting with retino_HCP.
We'll generate a bunch of data with varying levels of signal to noise, and then
show the stability of the model coefficients for each set of data.
"""
import numpy... |
#!/usr/bin/python
from multiprocessing import Pool
import sys
import time
DATA_LENGTH = 10000000
def count_binary_ones(n):
result = 0
while n:
result += n % 2
n = n / 2
return result
def count_ones(l):
return sum([count_binary_ones(n) for n in l])
def main():
thread_count = int(... |
import tensorflow as tf
import classification_models.tfkeras as ctk
# Without this, I am facing out of memory issue
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config... |
var PUB_KEY = $("#pub_key").val();
var SUB_KEY = $("#sub_key").val();
var SECRET_KEY = $("#secret_key").val();
var UUID = $("#uuid").val();
function presenceInit() {
presenceEnable = $("#presenceEnable").prop('checked');
presence = presenceEnable;
}
presenceInit();
$("#presenceEnable").bind("change", function... |
#!/usr/bin/env python2
# -----------------------------------------------------------------------------
# @brief:
# The snake environments.
# @author:
# Tingwu (Wilson) Wang, Aug. 30nd, 2017
# -----------------------------------------------------------------------------
import numpy as np
from gym impor... |
// Copyright 2019 Google 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 or agreed to in ... |
#! /usr/bin/python
'''
use the classes in sisxmlparser2_2 to generate an ExtStationXML file from regular stationxml.
'''
import checkNRL as checkNRL
import sisxmlparser3_0 as sisxmlparser
import uniqResponses as uniqResponses
import cleanUnitNames as cleanUnitNames
from xerces_validate import xerces_validate, SCHEMA_FI... |
/*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:50:02 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/PrivateFrameworks/SlideshowKit.framework/Frameworks/OpusKit.framework/OpusKit
* classdump-dyld is licensed under GPLv3,... |
'use strict'
//carga modulos
var mongoose = require('mongoose');
var app = require('./app');
var port = 3700;
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost:27017/portafolio')
.then(() => {
console.log("Conexión a la base de datos establecida con éxito...");
... |
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be use... |
'use strict';
module.exports.handler = (event, context, callback) =>
callback(null, {
statusCode: 200,
body: JSON.stringify({}),
});
|
# PyEl - simple expression language for Python
# coding=utf-8
#
# eval_el( 'foo.var' , { foo: { bar: 'Hello' } })
# ==> 'Hello'
#
# eval_el('bar.0', {bar: [1,2])
# ==> 1
#
# eval_el('0', [1,2])
# ==> 1
#
# build_el( { foo: { bar: 'Hello' }, list: [0, 1] })
# ==> [('foo.bar','Hello'), ('list.0', 0), ('list.1', 1)]
#
d... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="ip_basic", # Replace with your own username
version="0.0.1",
description="Depth completion algorithm from Jason Ku, Ali Harakeh, and Steven Waslander",
long_description=long_description,
l... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.minusCircle = void 0;
var minusCircle = {
"viewBox": "0 0 24 24",
"children": [{
"name": "circle",
"attribs": {
"cx": "12",
"cy": "12",
"r": "10"
},
"children": []
}, {
"name": "line",
... |
import {bidirectional, targetCR, targetUN, targetNE} from '../tools';
export const targets = {
id: 'targets',
name: 'Targets',
childTools: [bidirectional, targetCR, targetUN, targetNE],
options: {
caseProgress: {
include: true,
evaluate: true
}
}
};
|
const matrixService = {
data: {
loginMatrix: (user, password) => {
return {
user: user || "",
password: password || ""
}
},
createChatRoom: (roomName) => {
return {
roomName: roomName || ""
}
... |
const path = require('path');
module.exports = (SafeHandler) => {
const getMessages = function getMessages() {
const count = document.querySelectorAll('.p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)').length;
SafeHandler.setBadgeCount(count);
};
SafeHandler.setLoop(getMessage... |
import{r as s,h as t,H as a}from"./p-fe42e5c8.js";const l=class{constructor(t){s(this,t),this.icon=""}render(){return t(a,{class:"bal-card-button"},t("bal-button",{expanded:!0,light:!0,"bottem-rounded":!0},this.icon?t("bal-icon",{class:"icon",name:this.icon}):"",t("span",{class:"label"},t("slot",null))))}};export{l as ... |
"""Acolyte spell importer"""
import yaml
from acolyte.models import Spell, School
from acolyte.database import db
def import_spells(app, spell_path):
"""Import spells from a YAML file
Arguments:
app {obj} -- Acolyte application
spell_path {str} -- Path to spells YAML file
"""
ap... |
'use strict';
const assert = require('assert');
const parallel = require('mocha.parallel');
const Aigle = require('../../');
const { DELAY } = require('../config');
parallel('rejectSeries', () => {
it('should execute in series', () => {
const order = [];
const collection = [1, 4, 2];
const iterator =... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... |
const BlazorEditors = [];
window.monacoJsFunctions = {
BlazorEditors: BlazorEditors,
EditorInitialize: function (id, script, language) {
console.debug(`Registering new editor ${id}...`);
//throw `EditorInitialize - editorModel.Id: '${id}'`;
let thisEditor = monaco.editor.create(docum... |
"""
In blender script for importing the X3D scene description and simple rendering it.
@author Piotr Jessa
"""
import bpy
from bpy import context
from bpy import ops
from io_scene_x3d import import_x3d
print ("ALFIRT: start of rendering")
#Parameters of the image
# TODO: this image parameters must from ... |
(function() {
'use strict';
angular
.module('entblogApp')
.directive('jhSort', jhSort);
function jhSort () {
var directive = {
restrict: 'A',
scope: {
predicate: '=jhSort',
ascending: '=',
callback: '&'
... |
# function for adding coverage values to variant file (VCF)
#--------------------------------------------------------------------------------------------------------------------------
def Write_VCF_with_CoverageValues(coveragevalues, VCFpath):
"""
coveragevalues is the list of coverage values for each mutation
... |
// version: 0.17.0
// date: Mon Jun 24 2019 16:00:45 GMT+0100 (GMT+01:00)
// licence:
/**
* Copyright 2016 PT Inovação e Sistemas SA
* Copyright 2016 INESC-ID
* Copyright 2016 QUOBIS NETWORKS SL
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
* Copyright 2016 ORANGE SA
* Copyright... |
import React from 'react';
// import axios from 'axios';
import './App.css';
import {
faHome,
faArrowUp,
faArrowDown,
} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import axios from 'axios';
import Post from './Post';
export class HomeNav extends Re... |
import hashlib
import math
import numpy as np
from . import base
class NUnique(base.Univariate):
"""Approximate number of unique values counter.
This is basically an implementation of the HyperLogLog algorithm. Adapted from
[`hypy`](https://github.com/clarkduvall/hypy). The code is a bit too terse but ... |
#pragma once
/**
* @file dSFMT.h
*
* @brief double precision SIMD oriented Fast Mersenne Twister(dSFMT)
* pseudorandom number generator based on IEEE 754 format.
*
* @author Mutsuo Saito (Hiroshima University)
* @author Makoto Matsumoto (Hiroshima University)
*
* Copyright (C) 2007, 2008 Mutsuo Saito, Makoto M... |
import React from "react"
import { graphql } from "gatsby"
import { documentToReactComponents } from "@contentful/rich-text-react-renderer"
import Layout from "../components/layout"
import Head from "../components/head"
export const query = graphql`
query (
$slug: String!
) {
contentfulBlogPost (
slug: {
... |
/** importing dependencies */
import gStrategy from 'passport-google-oauth2'
const GoogleStrategy = gStrategy.Strategy
import dotenv from 'dotenv'
dotenv.config()
const googleCredentials = {
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: process.env.GOO... |
/**
* Append a pre element to the body containing the given message
* as its text node. Used to display the results of the API call.
*
* @param {string} message Text to be placed in pre element.
*/
function appendPre(message) {
var pre = document.getElementById('content');
var textContent = document.createTex... |
/**
* This class creates/wraps a default html select field as backbone class.
*/
define(['utils/utils', 'mvc/ui/ui-buttons'], function(Utils, Buttons) {
var View = Backbone.View.extend({
// options
optionsDefault: {
id : Utils.uid(),
cls : 'ui-select',
error_text : '... |
#!/usr/bin/python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import logging
import os
import random
import numpy as np
import torch
from torch.utils.data import DataLoader
from model import KGEModel
from dataloader impor... |
import _plotly_utils.basevalidators
class ModeValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name='mode', parent_name='scattergeo', **kwargs):
super(ModeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... |
import tensorflow as tf
import os
from model import CycleGAN
import utils
import numpy as np
import nibabel as nib
import SimpleITK as sitk
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_string('model', 'pretrained/cbct2sct.pb', 'model path (.pb)')
tf.flags.DEFINE_integer('height', '288', 'height, default: 288')
tf.flags.DEFI... |
import os
import logging
import importlib
from decimal import Decimal
from os.path import dirname
from common import exceptions
logger = logging.getLogger(__name__)
default_app_config = "provider.apps.ProviderConfig"
class BaseProvider(object):
field = None
name = None
def get_openid(self, auth_code)... |
import RPi.GPIO as GPIO
from time import sleep
dac = [26, 19, 13, 6, 5, 11, 9, 10]
bits = len(dac)
comp = 4
troyka = 17
levels = 2 ** bits
scale = 3.3 / levels
GPIO.setmode(GPIO.BCM)
GPIO.setup(dac, GPIO.OUT)
GPIO.setup(troyka, GPIO.OUT)
GPIO.setup(comp, GPIO.IN)
GPIO.output(troyka, GPIO.HIGH)
def num2dac(value):... |
from test_helper import run_common_tests, failed, passed, get_answer_placeholders, check_answers
def test_answer_placeholders():
placeholders = get_answer_placeholders()
answers = [
["root"],
["root"],
["handler1"]
]
check_answers(placeholders, answers)
if __name__ == '__main... |
var UIConfirmations = function () {
var handleSample = function () {
$('#bs_confirmation_demo_1').on('confirmed.bs.confirmation', function () {
alert('You confirmed action #1');
});
$('#bs_confirmation_demo_1').on('canceled.bs.confirmation', function () {
a... |
#!/usr/local/anaconda3/envs/py36 python
# -*- coding: utf-8 -*-
# Imports
import numpy as np
from astroquery.irsa_dust import IrsaDust
import astropy.coordinates as coord
import astropy.units as u
from dust_extinction.parameter_averages import F04
import glob
def get_ebv(ra, dec):
"""Query IRSA dust map for E(B-... |
//import shop from '../api/shop'
//import * as types from './mutation-types'
//
//export const addToCart = ({ commit }, product) => {
//if (product.inventory > 0) {
// commit(types.ADD_TO_CART, {
// id: product.id
// })
//}
//}
//
//export const checkout = ({ commit, state }, products) => {
//const sav... |
# 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,... |
from django import forms
from .models import Comment, Post
class PostForm(forms.ModelForm):
""" Form for handling addition of posts """
class Meta:
model = Post
fields = ('picture', 'text')
class CommentForm(forms.Form):
""" Form for adding comments"""
text = forms.CharField(label="Comment", widget=forms... |
//
// Tests.h
// JSON
//
// Created by Stig Brautaset on 11/09/2007.
// Copyright 2007 Stig Brautaset. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@interface Examples : SenTestCase
@end
|
export const saveState = (state) => {
try {
const serializedState = JSON.stringify(state);
localStorage.setItem('state', serializedState);
} catch {
// ignore write errors
}
}; |