text stringlengths 3 1.05M |
|---|
import { fromJS, Map, List } from 'immutable';
import { isEqual } from 'lodash/lang';
import { CRUD } from './actions';
function recent(fetchedAt) {
if (fetchedAt === null) return false;
const interval = 10 * 60 * 1000; // 10 minutes
return ((Date.now() - interval) < fetchedAt);
}
export function selectCollect... |
#!/usr/bin/python
################################################################################
# 23add0b0-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... |
const router = require('express').Router();
const sequelize = require('../config/connection');
const { Dog, Image , User } = require('../models');
const withAuth = require('../utils/auth');
router.get('/', (req, res) => {
User.findAll({
where: {
// use the ID from the session
id: req.session.... |
r"""
The modular group `{\rm SL}_2(\ZZ)`
AUTHORS:
- Niles Johnson (2010-08): :trac:`3893`: ``random_element()`` should pass on ``*args`` and ``**kwds``.
"""
################################################################################
#
# Copyright (C) 2009, The Sage Group -- http://www.sagemath.org/
#
# ... |
"""
:mod:`~matplotlib.gridspec` is a module which specifies the location
of the subplot in the figure.
``GridSpec``
specifies the geometry of the grid that a subplot will be
placed. The number of rows and number of columns of the grid
need to be set. Optionally, the subplot layout parameter... |
// helpers/utilities.js is a list of helper functions to validate data
module.exports = {
isEmail: function (email) {
const testEmail = email.toLowerCase()
const emailFormat = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9]... |
/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-iepp-cssclasses-hasevent-domprefixes-load
*/
... |
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom"], factory);
else if(typeof exports === 'obje... |
import fixtures from 'testutils/fixtures'
import createSlateEditor from 'testutils/createSlateEditor'
import Plugin from 'lib/index'
const formatMatrix = matrix => {
return matrix.map(row => row.map(cell => [cell.virtual, cell.ref.key]))
}
fixtures(__dirname, './fixtures', ({ module }) => {
const { props, value } =... |
const chalk = require('chalk')
const isDev = require('./isDev')
const logger = (isDev) ? { log(x) { return x } } : console
module.exports = {
l(x) { return logger.log(x) },
log(x) { return this.l(x) },
blank() { return this.l('') },
warning(x) {
return this.l(`${chalk.bold.red('🛑 ')} ${x}`)
},
succe... |
/*
* @Author: angula
* @Date: 2020-09-02 18:22:46
* @LastEditTime: 2020-09-02 22:50:35
* @FilePath: \JS\深拷贝\02深拷贝.js
*/
/*
*深拷贝
*/
// 1. 一个简单的深拷贝
/**
let obj1 = {
a: {
b: 1
},
c: 1
};
let obj2 = {};
obj2.a = {};
obj2.c = obj1.c;
obj2.a.b = obj1.a.b;
console.log("原obj1:", obj1); //原obj1: { a: { ... |
///////////////////////////////////////////////////////////////////////////////////////////////////
// INTERACTIONS WITH MAP ///////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/*-----------------... |
/*!
* CanJS - 2.3.23
* http://canjs.com/
* Copyright (c) 2016 Bitovi
* Fri, 08 Apr 2016 17:58:15 GMT
* Licensed MIT
*/
/*can@2.3.23#route/route*/
steal('can/util', 'can/map', 'can/list', 'can/util/string/deparam', function (can) {
var matcher = /\:([\w\.]+)/g, paramsMatcher = /^(?:&[^=]+=[^&]*)+/, makeProps ... |
"""Plugin that provides support for dataclasses."""
from typing import Dict, List, Set, Tuple, Optional
from typing_extensions import Final
from mypy.nodes import (
ARG_OPT, ARG_POS, MDEF, Argument, AssignmentStmt, CallExpr,
Context, Expression, JsonDict, NameExpr, RefExpr,
SymbolTableNode, TempNode, Type... |
import request from '@/utils/request'
export function login(data) {
return request({
url: '/api/auth/login',
method: 'post',
data
})
}
export function getInfo() {
return request({
url: '/api/consumer/user/info',
method: 'get'
})
}
export function logout() {
return request({
url: '/a... |
import { clearAlertsAction } from '../actions/clearAlertsAction';
import { computeFormDateAction } from '../actions/FileDocument/computeFormDateAction';
import { computeSecondaryFormDateAction } from '../actions/FileDocument/computeSecondaryFormDateAction';
import { setValidationErrorsAction } from '../actions/setValid... |
import math
# Input in radians
case = """ end else if input >= {infrom} and input < {into} then begin
assume result > {outfrom}
assume result <= {outto}"""
step = 0.1571
infrom = 0
into = step
while infrom < 6.28:
into = round(into + step, 4)
outfrom = round(math.sin(infrom), ... |
/**
* @license
* Visual Blocks Editor
*
* Copyright 2012 Google Inc.
* https://developers.google.com/blockly/
*
* 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.apach... |
const express = require("express");
const User = express.Router();
const getDetails = require("./getDetails");
User.use("", getDetails);
module.exports = User;
|
/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.1.1
build: 47
*/
YUI.add("lang/datatype-date-format_es-AR",function(A){A.Intl.add("datatype-date-format","es-AR",{"a":["dom","lun","mar","mié","jue","vie","sáb"],"A":["domi... |
const sendMail = require('../server/integrations/mailer');
const express = require('express');
const router = express.Router();
router.post('/sendMail', (req, res) => {
console.log(req.body);
sendMail(req.body)
.then(r => {
res.send(r);
})
.catch(err => {
res.send(err);
});
});
module.... |
"""
elevate.middleware
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2017-present by Justin Mayer.
:copyright: (c) 2014-2016 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from elevate.settings import (
COOKIE_DOMAIN, COOKIE_HTTPONLY, COOKIE_NAME,
COOKIE_PATH, COOKIE_SECURE, COOKIE_SALT,
)
from elevat... |
/** @format */
import React from 'react';
import { AppRegistry } from 'react-native';
import ImageWall from './src/components/ImageWall';
// Create a component
const App = () => (
<ImageWall style={{ flex: 1 }} />
);
/*
Render(an application called 'albums') it to the device.
In any react native application we c... |
/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dojox.NodeList.delegate"]){dojo._hasResource["dojox.NodeList.delegate"]=true;dojo.provide("dojox.Nod... |
import os
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from loguru import logger
from src.api.jupyter import router as planet_ns
from src.api.revolve import router as planet_spawn_ns
from src.config import SystemConfig
from src.storage.cache import Cache
app = FastAPI(
title="Ganim... |
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
/**
* Next, we will create a fresh Vue a... |
from authentication import Authentication
from time import time
from pymongo import MongoClient
import os
from dotenv import load_dotenv
import hashlib
from datetime import datetime
class Balances:
currencies_ids = {"0": "EUR", "1": "ARS", "2": "USD"}
def __init__(self) -> None:
load_dotenv()
... |
export const CHANGE_CURRENT_MODULE_TYPE = 'CHANGE_CURRENT_MODULE_TYPE'
export const SET_CURRENT_BOOK_TAGS = 'SET_CURRENT_BOOK_TAGS'
export const SET_TAG_BOOKS = 'SET_TAG_BOOKS'
export const SET_CURRENT_TAG_BOOKS = 'SET_CURRENT_TAG_BOOKS'
export const SET_TYPE_BOOKS = 'SET_TYPE_BOOKS'
export const SET_CURRENT_TYPE_BOOKS... |
setCssToHead(["body { background: #fff; color: #333; }\n.",[1],"container { padding: ",[0,40]," ",[0,30]," ",[0,110]," ",[0,30],"; -webkit-box-sizing: border-box; box-sizing: border-box; }\n.",[1],"tui-news-title { font-size: ",[0,48],"; font-weight: 500; text-align: justify; }\n.",[1],"tui-sub-info { padding-top: ",[0... |
/*global window, document, FB */
(function () {
'use strict';
/*
* @author Pat Nolan - Modifed fro the original Author Ally Ogilvie
* @copyright Wizcorp Inc. [ Incorporated Wizards ] 2014
* @file - facebookConnectPlugin.js
* @about - JavaScript interface for PhoneGap bridge to Facebook Connect SDK
*
*
*/
... |
module.exports={D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.003365,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.003365,"19":0,"20":0,"21":0,"22":0.00673,"23":0,"24":0,"25":0,"26":0.003365,"27":0,"28":0,"29":0.02692,"30":0,"31":0.00673,"32":0,"33":0.003365,"34":0.010095,"35":0.003365,"36":0.003365,"37":0.00... |
const express = require('express');
const cors = require('cors');
const helmet = require('helmet');
const authMiddleware = require('../auth/authMiddleware');
const authRouter = require('../auth/authRouter.js');
const conversationsRouter = require('../conversations/conversationsRouter.js');
const messagesRouter = requi... |
/* *************************************************************************************************
* *
* Plese read the following tutorial before implementing tasks: *
* https://develope... |
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const WebSiteManagementClient = require("@azure-rest/arm-appservice").default,
{ paginate } = require("@azure-rest/arm-appservice");
const { DefaultAzureCredent... |
import test from 'tape';
import subscribable from '../src/subscribable'
test('subscribable', assert => {
const addedDeps = []
const sub = subscribable('sub')
sub.onAddDep = d => addedDeps.push(d)
assert.equal(sub.id, 1, 'must have an auto id')
assert.equal(sub.name, 'sub', 'must have name')
assert.equal... |
# -*- coding: utf-8 -*-
"""
Tests for auth manager WMS/WFS using QGIS Server through PKI
enabled qgis_wrapped_server.py.
This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider
and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth
configuration to access an HTTP Basic pro... |
const selectData = [{
value: 'Beijing',
label: '北京'
}, {
value: 'Shanghai',
label: '上海'
}, {
value: 'Nanjing',
label: '南京'
}, {
value: 'Chengdu',
label: '成都'
}, {
value: 'Shenzhen',
label: '深圳'
}, {
value: 'Guangzhou',
label: '广州'
}]
const cascaderData = [{
value: 'zhinan... |
import React from "react";
import styles from "./statistic.module.css";
// import stats from "../../data/statistical-data.json";
const { titles, a, item, wrapper, statistics, list } = styles;
export const SectionInsert = ({ children }) => (<section className={statistics}>{children}</section>);
export const Title = ({... |
const {app,BrowserWindow,Menu} = require("electron");
const URL = "http://localhost/seven-circles/sq-editor.html";
let mainWindow = null;
function createWindow() {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
backgroundColor: "black",
backgroundThrottling: false,
... |
/*
* Copyright (c) 2014-2017 Markus Moenig <markusm@visualgraphics.tv> and Contributors
*
* 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 limita... |
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.... |
'use strict';
var
fs = require("fs"),
gulp = require('gulp'),
connect = require('gulp-connect'),
browserify = require("browserify"),
babelify = require("babelify"),
sass = require('gulp-ruby-sass'),
prefix = require('gul... |
var GG_DBEditViewController = GG_DBEditViewControllerBase.extend({}); |
"use strict";
exports.__esModule = true;
exports.Atributo = void 0;
var Atributo = /** @class */ (function () {
function Atributo(id, valor, linea, columna) {
this.identificador = id;
this.valor = valor;
this.linea = linea;
this.columna = columna;
}
return Atributo;
}());
exp... |
# Copyright (C) 2017-2019 Intel Corporation
#
# SPDX-License-Identifier: MIT
import argparse
from bench import parse_args, time_mean_min, print_header, print_row, size_str
from daal4py import kmeans
import numpy as np
parser = argparse.ArgumentParser(description='daal4py K-Means clustering '
... |
# Copyright 2018 DeepMind Technologies Limited. 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 a... |
import express from "express";
import config from "./configs/app";
import { mongodb, mysqldb } from "./configs/db";
import socketIo from "socket.io";
import http from "http";
import bodyParser from "body-parser";
import cors from "cors";
import socketEvents from "./helpers/socket";
import router from "./routes/api";
... |
import os
import numpy as np
from tqdm import tqdm
import torch
from fairseq.models.bart import BARTModel
import shutil
import threading
def seperate_file(file_path, save_dir, n=5):
"""
Seperate file equally
"""
with open(file_path, "r") as f :
texts = f.readlines()
length = len(texts)
... |
import sinon from 'sinon';
import {expect} from '../util/reconfiguredChai';
import * as utils from '@cdo/apps/utils';
import AuthoredHints from '@cdo/apps/authoredHints';
import authoredHintsReducer from '@cdo/apps/redux/authoredHints';
import {TestResults} from '@cdo/apps/constants';
import {registerReducers, stubRed... |
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import json from '@rollup/plugin-json';
import replace from '@rollup/plugin-replace';
import cleanup from 'rollup-plugin-cleanup';
import copy from 'rollup-plugin-copy';... |
# Generated by Django 3.2.5 on 2021-07-11 16:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('base', '0006_rename_user_full_name_usersubscription_user_details'),
]
operations =... |
const CACHE_NAME = "codepolitan-reader-lite-v1";
var urlsToCache = [
"/maouchan-shop/index.php",
];
self.addEventListener("install", function (event) {
console.log("ServiceWorker: Menginstall..");
event.waitUntil(
caches.open(CACHE_NAME).then(function (cache) {
console.log("ServiceWo... |
import { sha256 } from 'noble-hashes/lib/sha256.js';
// function sha256(data: Uint8Array): Uint8Array;
const hash1 = sha256('abc');
const hash2 = sha256.init().update(Uint8Array.from([1, 2, 3])).digest();
import { sha512 } from 'noble-hashes/lib/sha512.js';
// function sha512(data: Uint8Array): Uint8Array;
const hash3 ... |
const path = require('path');
const chai = require('chai');
const assert = chai.assert;
const expect = chai.expect;
const spawn = require("child_process").spawn;
const ainUtil = require('@ainblockchain/ain-util');
const syncRequest = require('sync-request');
const rimraf = require("rimraf")
const _ = require('lodash');... |
import Vue from 'vue';
import iView from 'iview';
import VueRouter from 'vue-router';
import {routers, otherRouter, appRouter} from './router';
import Vuex from 'vuex';
import Util from './libs/util';
import App from './app.vue';
import Cookies from 'js-cookie';
import 'iview/dist/styles/iview.css';
import VueI18n fro... |
var data = {nav: {
defaults: [
{
link: '/',
text: 'Главная'
},
{
link: 'portfolio.html',
text: 'Портфолио'
},
{
link: 'about.html',
text: 'Обо мне',
mod: '_block'
},
{
... |
from flask import Flask, jsonify, send_from_directory, render_template
from webargs import Arg
from webargs.flaskparser import use_args
from showdownai import Showdown
from showdownai import PessimisticMinimaxAgent
from showdownai import load_data
from argparse import ArgumentParser
from path import Path
from threading... |
# =============================================================================
# Author: Xianyuan Liu, xianyuan.liu@outlook.com
# Haiping Lu, h.lu@sheffield.ac.uk or hplu@ieee.org
# =============================================================================
"""
Action video dataset loading for EPIC-Kitchen,... |
$(function() {
"use strict";
// ==============================================================
// Gender Js
// ==============================================================
Morris.Donut({
element: 'gender_donut',
data: [
{ value: 60, label: 'Female' },
... |
/*
Copyright (c) 2003-01, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang("uicolor","es",{title:"Recolector de Color de Interfaz de Usuario",options:"Color Options",highlight:"Highlight",selected:"Selected... |
"""Posts URLs."""
from django.urls import path
from posts import views
urlpatterns = [
path(
route='',
view= views.PostsFeedView.as_view(),
name='feed'),
path(
route='new/',
view=views.CreatePostView.as_view(),
name='create_post'
),
path(
rout... |
/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong... |
const ELEMENTS = {
map: `x_________________xvxx___________xxxxxxvxx___________xxxxxxvxxx_xxxxxxxxxxxxxxxvxxx_xxxxxxxxxxxxxxxvxxx1xxxxxxxxxxxxxxxvxxx2xxxxxxxxxxxxxxxv_v___3xxxxxxxxxxxxxx_v___4xxxxxxxxxxxxxx_`,
la: [null,'*','**','*','**'],
names: [
null,
'H','He','Li','Be','B','C','N','O','F'... |
(function () {
angular
.module('plan')
.controller('loginCtrl', loginCtrl);
loginCtrl.$inject = ['$location', '$scope', 'authentication'];
function loginCtrl($location, $scope, authentication) {
$scope.credentials = {
username : "",
password : ""
};... |
const { assert } = require('chai');
const sinon = require('sinon');
const ScheduledTask = require('../src/scheduled-task');
describe('ScheduledTask', () => {
beforeEach(() => {
this.clock = sinon.useFakeTimers(new Date(2018, 0, 1, 0, 0, 0, 0));
});
afterEach(() => {
this.clock.restore();
... |
const puppeteer = require('puppeteer-extra');
const fs = require("fs");
const pluginStealth = require('puppeteer-extra-plugin-stealth')
const scrapeTimelog = require("./clockify");
const scrapeAdSense = require("./adSense");
const scrapeAnalytics = require("./analytics");
const config = require("./config/config.json");... |
"""Used to get information about VPCx regions"""
import logging
import json
import boto3
# Initialize Logger
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.INFO)
# Define constant param path
PARAM_PATH = '/vpcx/aws/regions/'
# Define constant param path
PARAM_PATH = '/vpcx/aws/regions/'
def get_ssm_region_p... |
import socket
import sys
import lib.ProtocolUtils as protocolUtils
import threading as thread
def message_handler(conn, addr):
data = protocolUtils.MessageHandler(conn.recv(1024)).message_loads()
print("New operation in queue ", data[0], " ", data[2])
try:
result = str(float(data[0]) - float(data... |
# ! Colors
white = (255, 255, 255)
aqua= (0, 200, 200)
red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
black = (0, 0, 0)
silver = (192,192,192)
light_green = (152, 251, 152)
# ! Screen
screen_size = (800, 800)
screen_color = black
screen_delay = 10
# ! Constants related to the blocks
block_count = 5
block_si... |
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from locations.models import Location
from .serializers import LocationSerializer
class LocationViewSet(viewsets.ModelViewSet):
queryset = Location.o... |
from test.conftest import MockUQCSBot
from test.helpers import (generate_event_object, MESSAGE_TYPE_EMOJI_CHANGED,
MESSAGE_TYPE_CHANNEL_CREATED)
from unittest.mock import patch
def test_emoji_log(uqcsbot: MockUQCSBot):
"""
Test !emoji_log for a member adding or removing emoji... |
function _classCallCheck(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(n,e){for(var t=0;t<e.length;t++){var o=e[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}function _createClass(n,e,t){r... |
'use strict'
import getContent from './get-content'
export default function getConfigFactory (listConfigs) {
return async function getConfig (httpRequest) {
try {
httpRequest.log(getConfig.name)
const configs = await listConfigs(httpRequest.query)
const { contentType, content } = getContent(ht... |
'use strict';
const path = require('path');
const Base = require(path.join(__dirname, '_base'));
function TstampModel() {
Base.apply(this, arguments);
const date = new Date();
this.createdAt = date;
this.updatedAt = date;
}
Base.extend(TstampModel);
TstampModel.prototype.$beforeInsert = function beforeInse... |
import Vue from 'vue'
import Router from 'vue-router'
import '@/assets/css/common.css'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
... |
import merge from 'lodash/merge';
import { ActionTypes as SettingsActionTypes } from '../actions/settings';
import { ActionTypes as UiActionTypes } from '../actions/ui';
import { ActionTypes as TransfersActionTypes } from '../actions/transfers';
import { ActionTypes as WalletActionTypes } from '../actions/wallet';
impo... |
import "@polymer/paper-input/paper-input";
import { html } from "@polymer/polymer/lib/utils/html-tag";
/* eslint-plugin-disable lit */
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../../components/buttons/ha-progress-button";
import "../../../../components/ha-card";
import "../../../... |
import React from "react"
import styled from "styled-components"
const Logo = ({ size = 10, inverted = false, color = "accent1", ...props }) => {
return (
<>
<Svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 160 160"
size={size}
{...props}
style={{ width: size + "... |
const dotenv = require("dotenv");
const express = require("express");
const cors = require("cors");
const morgan = require("morgan");
dotenv.config({ path: __dirname + "/../.env" });
const { contact, auth, user } = require("./routers/");
const { setupMongoDb } = require("./database/");
const { upload } = require("./se... |
'use strict'
const snapshot = require('snap-shot')
const { resolve } = require('path')
const { readFile } = require('fs').promises
const metascraper = require('../../..')([
require('metascraper-author')(),
require('metascraper-date')(),
require('metascraper-description')(),
require('metascraper-video')(),
r... |
const express = require("express");
const sendEmail = require("../../../helpers/emailSender");
const router = express.Router();
router.post("/askQuestion", async (req, res) => {
const { message, email } = req.body;
let info = sendEmail().catch(console.error);
res.send(info);
});
module.exports = router;
|
/* eslint-disable no-console */
const path = require('path');
const { set } = require('lodash');
const render = require('koa-ejs');
const helmet = require('koa-helmet');
const Provider = require('../lib'); // require('oidc-provider');
const Account = require('./support/account');
const { provider: providerConfigura... |
export default function myUtil() {
return true;
}
|
var chef = require("./CyberChef/build/node/CyberChef.js");
// Converts input from hex to UTF-8
var reverse = chef.bake(process.argv[2], [{"op":"From Hex", "args":["Space"]}]).then(result => console.log(result.result)); |
let socket = null;
const hub ={
setSocket: (io)=>{
socket = io;
},
dataChanged: ()=>{
console.log('broadcasting data changed')
socket.emit('datachanged', { time: Date.now() });
}
}
export default hub; |
(function(){
function setHeader(bar){
return bar.xtag.header || (bar.xtag.header = xtag.queryChildren(bar, 'h1,h2,h3,h4,h5,h6')[0])
}
xtag.register('x-appbar', {
lifecycle: {
created: function(){
setHeader(this);
}
},
accessors: {
heading: {
attribute: {},
... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
class OsuMicroBenchmarks(AutotoolsPackage):
"""The Ohio MicroBenchmark suite is a co... |
// pull in our models. This will automatically load the index.js from that folder
const models = require('../models');
const dogControl = require('./dogControl.js');
// get the Cat model
const Cat = models.Cat.CatModel;
// default fake data so that we have something to work with until we make a real Cat
const defaul... |
import PersonalNumber from "./pn";
import EGN from "./egn";
import Bulstat from "./bulstat";
import IBAN from "./iban";
class BGCN {
static personalNumber = (value) => {
return new PersonalNumber(value);
};
static pn = (value) => {
return this.personalNumber(value);
};
static egn = (value) => {
... |
import React from "react"
import aboutContentStyles from "./about.module.scss"
import SubHeading from "../home/subHeading"
import SubscribeSection from "./subscribeSection"
const AboutContent = () => {
return (
<section className={aboutContentStyles.about}>
<div
className={`${aboutContentStyles.con... |
import errno
import logging
import os
import sys
import warnings
from importlib import reload
import theano
from theano import config
from theano.gof import cmodule
from theano.gof.compilelock import get_lock, release_lock
_logger = logging.getLogger("theano.gof.lazylinker_c")
force_compile = False
version = 0.211 ... |
module.exports = function(grunt) {
//grunt-contrib-watch
grunt.config('watch', {
options: {
livereload: 35729
},
grunt: {
files: ['Gruntfile.js']
},
script: {
files: '<%= config.script.dir %>/**/*.js',
tasks: ['buildjs']
... |
import pandas as pd
def _prev(x):
prev_x = x.shift(1)
prev_x[:1] = x.values[0]
return prev_x
_samephase_nb = 10
def offensive_value(actions,scores,concedes):
sameteam = _prev(actions.team_id) == actions.team_id
prev_scores = _prev(scores) * sameteam + _prev(concedes) * (~sameteam)
# if the... |
var answers = [];
var validate = () => {
$("#afev-answer-1").animate(
{ backgroundColor: "green"}
);
var good = true;
if (answers.indexOf(1) === -1) {
good = false;
}
if (answers.indexOf(2) !== -1) {
$("#afev-answer-2").animate(
{ backgroundColor: "red"}
... |
# -*- codeing = utf-8 -*-
# @Author : linyaxuan
# @File : __init__.py.py
# @Software : PyCharm
import flask_whooshalchemyplus
from common.cache import cache
from common.models import db
from common.utils.middlewares import jwt_authentication
from project.resoureces.commen import comment_bp
from project.resoureces.lear... |
import datetime
import pytest
from coincurve import PrivateKey, PublicKey
from nekoyume.exc import InvalidMoveError
from nekoyume.models import (Block,
CreateNovice,
HackAndSlash,
LevelUp,
Move,
... |
from srim.srim import TRIM, SR
from srim.core.target import Target
from srim.core.layer import Layer
from srim.core.ion import Ion
TESTDATA_DIRECTORY = 'test_files'
def test_simple_trim_init():
ion = Ion('Ni', 1.0e6)
layer = Layer.from_formula('Ni', 8.9, 1000.0)
target = Target([layer])
trim = TRIM(... |
import torch as th
import os
import math
import numpy as np
import pandas as pd
from video_loader import VideoLoader
from torch.utils.data import DataLoader
import argparse
from model import get_model
from preprocessing import Preprocessing
from random_sequence_shuffler import RandomSequenceSampler
import torch.nn.func... |
/* Appliquer la couleur à la résistance */
function colorband(band,value){
var file = "img/";
if(band === document.getElementById('band1')||band === document.getElementById('band6') ){
file +="b_";
}else{
file +="s_";
}
if(band === document.getElementById('band1')||band === document... |
if __name__ == "__main__":
_checker = ChessMat(vec3(.75, .75, .75), 0.48)
_orange = DiffuseMat(vec3(1, .572, .184))
_scene = [
# Sphere(vec3(.75, Wy+0.1, 1), .6, mat=PhongMat(rgb(1, .421, .184))),
Sphere(WO + vec3(1,0.5,0), 0.5, mat=PhongMat(vec3(0.23, .572, .1))),
# Sphere... |