text stringlengths 3 1.05M |
|---|
import { insertPost } from './settings.js'
function event_submit() {
document.getElementById('img_user').addEventListener('submit', (e) => {
e.preventDefault()
document.getElementById('img_user').submit()
})
}
function cropped_image() {
const cropButton = document.getElementById('button_... |
//https://github.com/electron-userland/electron-installer-windows/blob/master/example/src/main/squirrel.js
'use strict'
const fs = require('fs-plus')
const path = require('path')
const child = require('child_process')
const pkg = require('../package.json')
const appFolder = path.resolve(process.execPath, '..')
const... |
#%%
import matplotlib.pyplot as plt
import numpy as np
import gdal
gdal.UseExceptions()
#%%
# Surface Reflectance
filename = 'Midwest/sr01_047_2019-01-04'
sr_img = np.array(gdal.Open(filename).ReadAsArray(), dtype='uint16')
print(sr_img.shape)
plt.imshow(sr_img[0])
#%%
# Temperature
filename = 'Cali Temper... |
require('@babel/register');
({
ignore: /node_modules/
});
require('@babel/polyfill');
const HDWalletProvider = require('@truffle/hdwallet-provider');
let mnemonic = 'grid glove flower smooth name rebel night modify idea arm army gate';
let testAccounts = [
"0x1ed8365093ca468812e6edacc765eeafce723b5d40b2b08f10a02... |
function elmBodyHtml(elmModuleName, classes) {
return elmHeaderHtml(elmModuleName, classes) +
elmBody({ type: "Html.Attribute msg", fn: "A.class " }, classes);
}
function elmBodyString(elmModuleName, classes) {
return elmHeaderString(elmModuleName, classes) +
elmBody({ type: "String", fn: "" }, classes);
}... |
export default {
header: 'Нижняя навигация',
headerText: ' `V-bottom-nav` является альтернативой боковой панели. Он в основном используется на мобильных устройствах и поставляется в двух вариантах: значки и текст, а также сдвиг.',
components: ['v-bottom-nav'],
examples: [{
iconsAndText: {
header: 'Ико... |
'use strict';
const User = require('../models/users-model.js');
module.exports = async (req, res, next) => {
if(!req.headers.authorization) next('No Token Available');
const token = req.headers.authorization.split(' ').pop();
try {
req.user = await User.authenticateToken(token);
next();
} catch ... |
import './style.css'
import inkPopup from '../common/popup'
import { slideTopTransition } from '../common/transition'
import { isObject } from '../common/util'
export default {
name: 'ink-action-sheet',
mixins: [inkPopup],
render: function(h) {
return h(
'div',
{
staticClass: 'ink-action-... |
'use strict';
var nock = require('../.')
, test = require('tap').test
, http = require('http')
, https = require('https')
, _ = require('lodash')
, debug = require('debug')('nock.test_recorder')
, mikealRequest = require('request')
, superagent = require('superagent')
, rest = requir... |
'use strict';
/* ------------------------------------------------------------------------------------------------
CHALLENGE 1 - Review
Write a function named raisedToTheThird that takes in an array of numbers and returns a new array of each of those numbers raised to the 3rd power (hint: look up Math.pow()). Use for... |
/* eslint-disable */
module.exports = (text) => {
'use strict';
let t;
const b = [
"(c^_^o)",
"(゚Θ゚)",
"((o^_^o) - (゚Θ゚))",
"(o^_^o)",
"(゚ー゚)",
"((゚ー゚) + (゚Θ゚))",
"((o^_^o) +(o^_^o))",
"((゚ー゚) + (o^_^o))",
"((゚ー゚) + (゚ー゚))",
"((゚ー゚) + (゚ー゚) + (゚Θ゚))",
"(゚Д゚) .゚ω゚ノ",
... |
/*
* theme.js
* Copyright 2017 Lucas Neves <lcneves@gmail.com>
*
* Imports and preprocesses the theme as a module.
* Part of the w3d project.
*/
'use strict';
const THREE = require('three');
const fontLoader = new THREE.FontLoader();
const xhr = require('./utils/xhr.js');
const lights = document.getElementsByT... |
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... |
import React, { useState, useEffect } from "react";
import { Link } from "react-router-dom";
import api from "../../services/api";
import LogoHeader from "../../assets/logoHeader.svg";
import NOLOGO from "../../assets/NOLOGO.png";
import { FiLogOut } from "react-icons/fi";
export default function Header() {
const ... |
# Copyright (c) Facebook, Inc. and its affiliates.
# Autogen with
# with open("lvis_v1_train.json", "r") as f:
# a = json.load(f)
# c = a["categories"]
# LVIS_CATEGORIES = repr(c) + " # noqa"
# with open("/tmp/lvis_categories.py", "wt") as f:
# f.write(f"LVIS_CATEGORIES = {LVIS_CATEGORIES}")
# Then paste the c... |
import sampleData from "../sample_output2.json";
import { getData } from "../source";
import { getOption } from "../settings/values";
import { toggleLoader } from "../utils";
import * as history from "./history";
import { Toast } from "toaster-js";
let SIZE_CRITERIA = "frequency",
FOLDING_CRITERIA = "frequency",
... |
#!/usr/bin/env python
# coding:utf-8
import platform
import urlparse
import json
import os
import re
import subprocess
import cgi
import sys
import datetime
import locale
import time
import hashlib
import OpenSSL
import httplib
import yaml
import simple_http_server
import env_info
import utils
import front_base.ope... |
var searchData=
[
['empty_92',['empty',['../classDatabase.html#af9d0fd2ff2c3b4648c43b352bcacb697',1,'Database']]],
['enroll_5fin_93',['enroll_in',['../classStudent.html#aa7cc46f68cb2f68a3af60e5488d86a36',1,'Student']]]
];
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Multi line comment can contain LINE SEPARATOR (U+2029)
es5id: 7.3_A5.4
description: Insert PARAGRAPH SEPARATOR (U+2029) into multi line comment
---*/
// CHECK#1
eval("/*\u202... |
# filewriter.py
"""Write a dicom media file."""
from __future__ import absolute_import
# Copyright (c) 2008-2012 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at https://github.com/darcymason/pydicom
... |
// Copyright 2015 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 required by applicable... |
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import path from 'path';
import HardSourceWebpackPlugin from 'hard-source-webpack-plugin';
export default {
resolve: {
extensions: ['*', '.js', '.jsx', '.json'],
// To support react-hot-loader
alias: {
'react-dom': ... |
import parsePage from 'uni-platform/runtime/wrapper/page-parser'
export function createPage (vuePageOptions) {
if (__PLATFORM__ === 'mp-alipay') {
return Page(parsePage(vuePageOptions))
} else {
return Component(parsePage(vuePageOptions))
}
}
|
import React from "react";
import Head from "next/head";
import styles from "../styles/Home.module.css";
import tinycolor from "tinycolor2";
import { ChromePicker, CirclePicker } from "react-color";
import { motion, AnimatePresence } from "framer-motion";
import { shadeColor } from "../lib/shadeColor";
import useWindow... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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 appl... |
"""
docs/conf
~~~~~~~~~
Configuration for Sphinx documentation.
"""
import datetime
import os
import sys
import sphinx_rtd_theme
from sphinx.ext.autodoc import ModuleLevelDocumenter, DataDocumenter
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))
# Add any Sphinx exte... |
export default {
topBar: {
tagName: "请输入标签名称",
},
contentTag: {
form_title: "Enter the tags infor",
name: "Name",
comments: "Note"
},
//LangEnd
} |
import React, { Component } from 'react'
import { Field, reduxForm } from 'redux-form'
import { Link } from 'react-router-dom'
import { connect } from 'react-redux'
import { createPost } from '../actions/index'
class PostsNew extends Component {
renderField(field) {
const { meta: {touched, error} } = field
c... |
/*! UIkit 2.7.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
var component;
if (jQuery && jQuery.UIkit) {
component = addon(jQuery, jQuery.UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-form-select", ["uikit"], function()... |
#!/usr/bin/env python
import sys
import versioneer
from distutils.text_file import TextFile
from skbuild import setup
with open('README.rst', 'r') as fp:
readme = fp.read()
with open('HISTORY.rst', 'r') as fp:
history = fp.read().replace('.. :changelog:', '')
def parse_requirements(filename):
with op... |
import styled from 'styled-components';
import { compose, layout, space, typography } from 'styled-system';
const getDerivedStyles = spanProps => {
const styles = {};
if (!spanProps) return styles;
if (spanProps.iconMarginLeft) {
styles.marginLeft = spanProps.theme.iconMarginLeft;
}
if (spanProps.iconMar... |
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symb... |
"""
Provides an APIView class that is the base of all views in REST framework.
"""
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import connections, models
from django.http import Http404
from django.http.response import HttpResponseBase
from django.utils.cache impo... |
const { ObjectID } = require('mongodb')
const Client = require('./client')
const _query = (terms) => {
if (terms instanceof ObjectID || typeof terms === 'string') {
return {
_id: terms
}
}
return Object.assign({}, terms)
}
class Bucket {
constructor(params) {
this.$client = new Client(params... |
#!/usr/bin/env libtbx.python
#
# iotbx.xds.xparm.py
#
# Copyright (C) 2013 Diamond Light Source, James Parkhurst & Richard Gildea
#
# Class to read all the data from a (G)XPARM.XDS file
#
from __future__ import absolute_import, division, print_function
import io
import sys
from libtbx import adopt_init_args
from ... |
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... |
var util = require('util'),
_ = require('underscore'),
moment = require('moment');
var SessionForm = require('./form'),
CostModel = require('../models/costs');
var ConfirmForm = function (options) {
SessionForm.call(this, options);
};
util.inherits(ConfirmForm, SessionForm);
function join(obj, keys,... |
var passport = require('passport')
var LocalStrategy = require('passport-local').Strategy
var Student = require('./models').Student
passport.use(new LocalStrategy({
usernameField: 'name'
},
(username, password, done) => {
Student.findOne({ name: username }, (err, student) => {
... |
/**
* @package WordPress
* @subpackage Denta
* @version 1.0.0
*/
/*!
* Isotope PACKAGED v3.0.4
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* http://isotope.metafizzy.co
* Copyright 2017 Metafizzy
*/
!function(t,e){"function"==typeof define&&define.amd?def... |
const CONSTRUCTOR_FN_NAME = 'constructor';
export default function mixin(target, source) {
target = target.prototype;
// Fallback to just `source` to allow mixing in a plain object (pojo)
source = source.prototype || source;
Object.getOwnPropertyNames(source).forEach((name) => {
if (name !== CONSTRUCTOR_F... |
import pyactlike
import numpy as np
### Some important variables ###
use_tt = False
use_te = False
use_ee = True
tt_lmax = 5000
bmin = 0
like = pyactlike.ACTPowerSpectrumData(
use_tt=use_tt,
use_te=use_te,
use_ee=use_ee,
tt_lmax=tt_lmax,
bmin=bmin,
)
### ACTPol lite DR4 likelihood
def get_loglike(... |
const LATEST_MAC = 'macOS 10.15';
const LATEST_WINDOWS = 'Windows 10';
const supportedBrowsers = {
microsoft: {
ie11: {
browserName: 'internet explorer',
platformName: LATEST_WINDOWS,
browserVersion: 'latest',
'sauce:options': {
name: 'IE11_DECREE_NISI',
screenResolution: ... |
import axios from "axios";
export default {
getRandomPeople: function () {
return axios.get("https://randomuser.me/api/?results=20")
}
} |
#!/usr/bin/env python
import click
import genomepy
from collections import deque
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(genomepy.__about__.__version__)
def cli():
""" Genomes for Python (and others)!
Version: {}""".... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
import memoize from 'memoizerific';
import Fuse from 'fuse.js';
const FUZZY_SEARCH_THRESHOLD = 0.4;
export const prevent = e => e.preventDefault();
const toList = memoize(1)(dataset => Object.values(dataset));
export const keyEventToAction = ({ keyCode, ctrlKey, shiftKey, altKey, metaKey }) => {
if (shiftKey || m... |
export const ic_speaker_notes_outline = {"viewBox":"0 0 24 24","children":[{"name":"path","attribs":{"d":"M0 0h24v24H0V0z","fill":"none"},"children":[]},{"name":"path","attribs":{"d":"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zM6 12h2v2H6zm0-3h2v2H6zm0-3h2... |
const grpc = require('@grpc/grpc-js');
const { loadAccountServiceDefn } = require('./grpcShared'); // TODO use generated static code
const { rpcHandlers } = require('./service');
const ip = '127.0.0.1';
const port = 9003;
const addr = `${ip}:${port}`;
const grpcCredentials = grpc.ServerCredentials.createInsecure();... |
//var app = angular.module('mnoUiElements', []);
describe('Component: loadingEllipsis', function() {
// 1. Load the module
beforeEach(module('mnoUiElements'));
//
// // 2. Inject $rootScope and $compile
// var scope, element;
// beforeEach(inject(function($rootScope, $compile) {
// scope = $rootScope.... |
define(['pubsub',
'site/pubSubTable'], function(PubSub, pubSubTable) {
'use strict';
var ThemeManager = function() {
this.initialise = function() {
var me = this;
// subscribe to theme change:
PubSub.subscribe(pubSubTable.updateDomTheme, function(msg, themeUr... |
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("cronstrue", [], factory);
else if(typeof exports === 'object')
exports["cronstrue"] = factory();
els... |
const { Executor } = require("clio-rpc/executor");
const { channel } = require("clio-rpc/channel");
const { getImport } = require("clio-lang-internals");
const asyncHooks = require("async_hooks");
class Distributed {
constructor(isWorker, connection) {
this.map = new Map();
this.isWorker = isWorker;
this... |
(function ($) {
"use strict";
var defaultOptions = {
tagClass: function(item) {
return 'label label-info';
},
itemValue: function(item) {
return item ? item.toString() : item;
},
itemText: function(item) {
return this.itemValue(item);
},
itemTitle: function(item) {
... |
import request from '@/api/request'
function orderList(data) {
return request({
url: '/api/leju/admin/orderBack/list', // 相对路径
method: 'get',
data
})
}
function orderDetail(data) {
return request({
url: '/api/leju/admin/orderBack/detail', // 相对路径
method: 'get',
data
})
}
... |
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. 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 requi... |
/**
* This class has been made to hold a slice of a volume data
* @class
* @author Valentin Demeusy / https://github.com/stity
* @param {THREE.Volume} volume The associated volume
* @param {number} [index=0] The index of the slice
* @param {string} [axis='z'] For now only 'x', 'y' or 'z'... |
/*record the operation of admin on users*/
const Sequelize = require('sequelize');
module.exports = (db) =>{
return db.define('adminlog',{
date:{
type: Sequelize.DATE, allowNull: false
}
content:{
type: Sequelize.STRING, allowNull: false
}
adminName:{... |
$(document).ready(function() {
$("#add-detail").click(function() {
$("#new-details").append('<div class="new-detail">' +
'<div class="form-group">' +
'<label for="new-time">Time of year</label>' +
'<input type="... |
# For the Dev VM environment, we use the same settings as the
# sample prod_settings.py file, with a few exceptions.
from .prod_settings_template import *
import os
from typing import Set
LOCAL_UPLOADS_DIR = 'var/uploads'
# Default to subdomains disabled in development until we can update
# the development documentat... |
"""*****************************************************************************************
MIT License
Copyright (c) 2020 Ibrahim Jubran, Murad Tukan, Alaa Maalouf, Dan Feldman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... |
// Data back Explorer
// import Freezeframe from 'freezeframe';
// prepare docs
var DA_doc = "./assets/dist/js/DA_collection.json";
var card_doc = "./assets/dist/js/AIE_card_collection.json";
var DP_doc = "./assets/dist/js/DP_collection.json";
$(document).ready(function() {
loadData(DA_doc, DP_doc, card_doc);
... |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import type {Fiber} from './ReactInternalTypes';
import type {Lanes, Lane} from './ReactFiberLane.new';
import type {
... |
export { sendHitRequest };
// specification of this module is in: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
const ANALYTICS_ACCOUNT = "UA-153659474-1";
const GA_URL = "https://www.google-analytics.com/collect";
/**
* send hit data to google analytics API
* "hit type" includ... |
// pages/hole/index.js
const app = getApp()
const api = app.api
const wxutil = app.wxutil
const pageSize = 16 // 每页显示条数
Page({
data: {
holes: [],
page: 1,
loading: false,
isEnd: false // 是否到底
},
onLoad() {
this.getHoles()
},
/**
* 获取树洞
*/
getHoles(page = 1, size = pageSize) {
... |
module.exports={A:{A:{"1":"E D A B","8":"I F hB"},B:{"1":"C N R O H J K U UB L HB"},C:{"1":"0 1 2 3 4 5 6 7 8 9 g h i j k l m n o p q r s t u v w P y z WB BB GB DB EB CB AB T S M IB JB KB LB MB NB FB PB QB RB U","33":"aB OB G V I F E D A B C N R O H J K W X Y Z a b c d e f gB oB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 A B C N R ... |
# -*- coding: utf-8 -*-
"""
Class definition of YOLO_v3 style detection model on image and video
"""
import colorsys
import os
from timeit import default_timer as timer
import numpy as np
from keras import backend as K
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
from keras... |
storefront.polyfill(function() {
var app = new storefront({
customerId: '<%= customerId %>',
area: '<%= area %>',
collection: '<%= collection %>',
structure: {
id: '<%= id %>',
title: '<%= title %>',
price: '<%= price %>',
image: '<%= imageurl %>'
// define your data s... |
from numpy import dot
from numpy.linalg import solve
from .controller import Controller
from ..dynamics import AffineQuadCLF
class LQRController(Controller):
"""Class for Linear Quadratic Regulator (LQR) policies.
Policy is u = -1 / 2 * R^-1 P * B' * x for dynamics x_dot = A * x + B * u
Policy optimizes... |
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
import pytest
import vectorbt as vbt
from vectorbt.utils.config import merge_dicts
seed = 42
# ############# base.py ############# #
class MyData(vbt.Data):
@classmethod
def download_symbol(cls, symbol, shape=(5, 3), start_dat... |
import Vue from 'vue';
import VueRouter from 'vue-router';
import Roster from '@/views/Roster';
import Player from '@/views/Player';
import Home from '@/views/Home';
import Field from '@/views/Field';
Vue.use(VueRouter);
let win = null;
const routes = [
{
path: '/',
name: 'home',
componen... |
from importlib import import_module
from ddtrace.vendor.wrapt import wrap_function_wrapper as _w
from .quantize import quantize
from ...compat import urlencode
from ...constants import ANALYTICS_SAMPLE_RATE_KEY, SPAN_MEASURED_KEY
from ...ext import SpanTypes, elasticsearch as metadata, http
from ...pin import Pin
fr... |
class ClockSection {
constructor(timePos, datePos) {
this.isEnabled = true;
this.time = new TimeSection(timePos);
this.date = new DateSection(datePos);
}
draw() {
if (this.isEnabled) {
this.time.draw();
this.date.draw();
}
}
init(f) {
f.add(this, 'isEnabled').name('Enable');
this.time.init(f.... |
require('./settings')
// Truncate a string
String.prototype.trunc =
function(n,useWordBoundary){
var toLong = this.length>n,
s_ = toLong ? this.substr(0,n-3) : this;
s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
return toLong ? s_ + '...' : s_;
};
// Check n... |
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/platform'), require('@angular/core'), require('@ant-design/icons-angular'), require('ng-zorro-antd/core/util'), require('@angular/common'), require('@angular/common/http'), require('@a... |
import Ember from 'ember';
const { Component } = Ember;
export default Component.extend({
classNames: ['js-only-component'],
onDidInsertElement() {
this.element.innerHTML = 'js-only-component';
}
});
|
/*!
Material Components for the Web
Copyright (c) 2019 Google Inc.
License: MIT
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else... |
#!/usr/bin/env python3
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the README f... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
function sentensify(str) {
return str.split(/\W/).join(" ");
}
sentensify("May-the-force-be-with-you");
|
# Copyright 2020 The Bazel Authors. 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 required by applicable la... |
__author__ = "Alexander Wallar <aw204@st-andrews.ac.uk>"
__all__ = [
"coordinator", "agent", "nameserver",
"get_ns_host", "get_ns_port", "get_robot_name"
]
import coordinator
import agent
import nameserver
import os
NS_HOST_ID = "ZMQROS_NS_HOST"
NS_PORT_ID = "ZMQROS_NS_PORT"
ROBOT_ID = "ZMQROS_ROBOT_ID"
... |
#!/usr/bin/env python
# coding=utf-8
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
import socket
import time
import traceback
import random
import sys
timeout_time = 5
def test(x):
if not x:
print("Error")
traceback.print_stack()
sys.exit(1)
def make_sock():
s=socket.socket(s... |
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _classCallCheck(instance, Constructor) { if (!(insta... |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*------------------------------------------------------------... |
import allBrands from './allBrands'
export default (route) => {
return allBrands.find((brandName) => {
return brandName === route
})
}
|
const hasJsxRuntime = (() => {
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
return false;
}
try {
require.resolve('react/jsx-runtime');
return true;
} catch (e) {
return false;
}
})();
module.exports = (api) => {
api.cache.using(() => process.env.NODE_ENV);
return {
prese... |
import React, { useState, useContext } from "react"
import Helmet from "react-helmet"
import { connect } from "react-redux"
import PropTypes from "prop-types"
import { StaticQuery, graphql } from "gatsby"
import "./layout.css"
import "./seti.css"
import SideBar from "./sidebar"
import Header from "./header"
import Side... |
import React, { useEffect } from 'react';
import { loadStripe } from '@stripe/stripe-js';
import { useLazyQuery } from '@apollo/client';
import { QUERY_CHECKOUT } from '../../utils/queries';
import { idbPromise } from '../../utils/helpers';
import CartItem from '../CartItem';
import Auth from '../../utils/auth';
// imp... |
/*******************************************IMAGE GALLERY*******************************************/
/*******Filtering*******/
// init Isotope
var $grid = $('.img-grid').isotope({
itemSelector: '.img-container',
//layoutMode: 'fitRows',
});
// filter functions
var filterFns = {
// show if number... |
# -*- coding: utf-8 -*-
"""
lantz.messagebased
~~~~~~~~~~~~~~~~~~
Implementes base class for message based drivers using PyVISA under the hood.
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from collections import ChainMap
import... |
window.onload = function() {
var simplemdeJQuery = null;
if (typeof jQuery !== 'undefined') {
simplemdeJQuery = jQuery;
} else if (typeof django !== 'undefined') {
simplemdeJQuery = django.jQuery
} else {
console.error('Cant find jQuery, please make sure your have jQuery imported for markdown edito... |
/*-
* <<
* Davinci
* ==
* Copyright (C) 2016 - 2017 EDP
* ==
* 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 require... |
import React, { useState, useMemo } from 'react'
import imageExtensions from 'image-extensions'
import isUrl from 'is-url'
import { Transforms, createEditor } from 'slate'
import {
Slate,
Editable,
useEditor,
useSelected,
useFocused,
withReact,
} from 'slate-react'
import { withHistory } from 'slate-history... |
module.exports = (sequelize, DataTypes) => {
const IoT = sequelize.define('IoT', {
name: DataTypes.STRING,
mac: {
type: DataTypes.STRING,
unique: true,
allowNull: false
},
type: DataTypes.STRING,
category: DataTypes.STRING,
version:... |
import json
import os
from typing import Callable
from localstack.config import dirs
from localstack.utils import common
from localstack.utils.common import select_attributes, short_uid
# URL to "cfn-response" module which is required in some CF Lambdas. The purpose of cfn-response is to make it easier
# to write "in... |
// Copyright 2021 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 ... |
import React, {useContext} from "react";
import {message, Modal} from "antd";
import * as PropTypes from "prop-types";
import {useMutation} from "graphql-hooks";
import {DataStoreContext} from "../../contexts/DataStoreContextProvider.js";
import {DELETE_PROJECT} from "../../utils/GraphQLConstants";
const DeleteWarning... |
module.exports = {
compiledByCoffeeScript: function(arg1, arg2) {
var foo = arg1 + " " + arg2;
return foo;
},
withALeadingIndent: function(arg1, arg2) {
var foo = arg1 + " " + arg2;
return foo;
},
withExcessiveNewlines: function(arg1, arg2)
{
var foo = arg1 + " " + arg2;
... |
#!/usr/bin/env python
# Copyright (c) 2011-2018, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
import sys
import unittest
import numpy as np
import matplotlib.pyplot as pl
pl.interactive(True) # noqa
from .. import verify
from .. import georef
class PolarNeighboursTest(unit... |
'use strict'
import naturalSort from 'javascript-natural-sort'
import { createAbsoluteAnchor } from './createAbsoluteAnchor'
import { ContextMenu } from './ContextMenu'
import { appendNodeFactory } from './appendNodeFactory'
import { showMoreNodeFactory } from './showMoreNodeFactory'
import { showSortModal } from './s... |