text stringlengths 3 1.05M |
|---|
/**
* WaveFile: https://github.com/rochars/wavefile
* Copyright (c) 2017-2018 Rafael da Silva Rocha. MIT License.
*
* Test writing 16-bit files.
*
*/
const assert = require('assert');
const fs = require("fs");
const WaveFile = require("../../../test/loader.js");
const path = "./test/files/";
describe('read 16b... |
export { default } from 'shared/components/star-rating/component'; |
import Promise from 'promise-polyfill';
import './polyfills/startsWith';
import './polyfills/endsWith';
import './polyfills/findIndex';
import './polyfills/find';
import './polyfills/includes';
import { loadFontGroup } from './utils/load-font';
const canela = [
{ family: 'Canela Web', weight: 300 },
{ family: 'Canel... |
// Startup
require('./dist/server').start(); |
#!/usr/bin/env python
# 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... |
import urllib.parse
from django.test import Client, TestCase
from django.urls import reverse
from circuits.models import Circuit, CircuitType, Provider
from utilities.testing import create_test_user
class ProviderTestCase(TestCase):
def setUp(self):
user = create_test_user(
permissions=[
... |
// © 2018 BTL GROUP LTD - This package is licensed under the MIT license https://opensource.org/licenses/MIT
const Immutable = require('seamless-immutable')
const { takeEvery, call, put } = require('redux-saga').effects
const {
cAuthConsumerCovenant,
mergeCovenants
} = require('interbit-covenant-tools')
const { ... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Link } from 'gatsby'
import './account.module.scss'
class AccountMenu extends Component {
static propTypes = {
routes: PropTypes.arrayOf(PropTypes.objectOf(PropTypes.string))
}
render() {
const { routes } = this.props
... |
const imageDownloader = require('image-downloader')
const google = require('googleapis').google
const customSearch = google.customsearch('v1')
const state = require('./state.js')
const googleSearchCredentials = require('../credentials/google-search.json')
async function robot() {
console.log('> [image-robot] Star... |
import ast
import collections
import logging
import cosmic_ray.util
LOG = logging.getLogger()
# TODO: Can this be removed?
MutationRecord = collections.namedtuple('MutationRecord',
['module_name',
'module_file',
... |
const { SymboleReader, SymboleToken, Rule, ASTStep, LLAnalyser } = require('../../commonjs/LLAnalyser')
let lla = new LLAnalyser()
lla.addSymboleReader(
new SymboleReader(/[+]/),
new SymboleReader(/[-]/),
new SymboleReader(/[*]/),
new SymboleReader(/[/]/),
new SymboleReader(/[(]/),
new Symbole... |
import React from "react";
import {Route,Redirect} from "react-router-dom";
export default ({component: C, props: cProps, ...rest}) =>
<Route
{...rest}
render={props =>
cProps.isAuthenticated
? <C {...props} {...cProps} />
: <Redirect
to={`/login?redirect=${props.location.pathname}$props.location.... |
exports.update_stream_name = function (stream_id, new_name) {
_.each([home_msg_list, message_list.narrowed, message_list.all], function (list) {
if (list === undefined) {
return;
}
list.update_stream_name(stream_id, new_name);
});
};
exports.update_user_full_name = function ... |
import {createStore, combineReducers, applyMiddleware, compose} from 'redux';
import {reducer as todoReducer} from './todos';
import {reducer as fitlerReducer} from './filter';
import { FilterTypes } from './constants';
const reducer = combineReducers({
todos: todoReducer,
filter: fitlerReducer
})
const ini... |
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... |
import SimpleSchema from 'simpl-schema';
const Events = new Mongo.Collection('events');
Events.schema = new SimpleSchema({
createdAt: {
type: Date
},
name: {
type: String
},
description: {
type: String,
optional: true
},
unique: {
type: Boolean,
optional: true
},
important: {... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
from perses.samplers.multistate import HybridRepexSampler
from openmmtools.multistate import MultiStateReporter
reporter = MultiStateReporter(storage='out-solvent.nc')
simulation = HybridRepexSampler.from_storage(reporter)
total_steps = 10000
run_so_far = simulation.iteration
left_to_do = total_steps - run_so_far
si... |
'''@file aurora4.py
contains the global phoneset target normalizer'''
import unicodedata
def normalize(transcription, alphabet):
'''normalize for the Global Phoneset database
Args:
transcription: the transcription to be normalized as a string
Returns:
the normalized transcription as a st... |
const downloads = {
"Paper-1.13": {
"title": "Paper 1.13.1",
"jenkins": "Paper-1.13",
"github": "PaperMC/Paper",
"desc": "Active development for the current Minecraft version.",
},
"Paper-1.12": {
"title": "Paper 1.12.2",
"jenkins": "Paper",
"github": ... |
// pull in our models. This will automatically load the index.js from that folder
const models = require('../models');
// get the Cat model
const Cat = models.Cat.CatModel;
const Dog = models.Dog.DogModel;
// default fake data so that we have something to work with until we make a real Cat
const defaultData = {
na... |
const bases = [customElements.whenDefined('hui-masonry-view'), customElements.whenDefined('hc-lovelace')];
Promise.race(bases).then(() => {
const LitElement = customElements.get('hui-masonry-view')
? Object.getPrototypeOf(customElements.get('hui-masonry-view'))
: Object.getPrototypeOf(customElements.get... |
// for CORS and compression
const defaultHeaders = {
'Access-Control-Allow-Origin': "*",
'Content-Type': 'application/json',
'Content-Encoding': 'gzip'
}
const pageHTML = `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title... |
from atlassian import Confluence
""" How to reindex the Confluence instance """
confluence = Confluence(
url='http://localhost:8090',
username='admin',
password='admin')
if confluence.get_reindex_status().get('finished'):
print("Start reindex")
confluence.reindex()
|
//import liraries
import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableHighlight } from 'react-native';
import Image from "react-native-image-progress";
import ProgressBar from "react-native-progress/Bar";
// create a component
class MovieCard extends Component {
render() {
const i... |
import createBoard from '../reducers/createBoard';
describe('createBoard reducer Test', () => {
it('should return the property of the box with given object', () => {
const currentCountProps = {
gameState: {
squares: [{"color": "red",
"_color": "orange",
... |
const getProducts = require('./getProducts.js')
const getProductsByCategorie = async function (categorieLevel, categorieName) {
const products = await getProducts({})
const filteredProducts = products.filter(product => {
return product.categories[categorieLevel] === categorieName
})
return filteredProduc... |
'use strict';
app.factory('authInterceptor', ['$q', '$window', function($q, $window){
return{
request:function(config){
config.headers=config.headers || {};
if($window.localStorage.token){
config.headers.Authorization= 'Bearer ' + $window.localStorage.token;
}
return config;
}... |
const {agentProvider, mockManager, fixtureManager, matchers} = require('../../utils/e2e-framework');
const {anyEtag, anyObjectId, anyUuid, anyDate, anyShortDate, anyString, anyArray, anyLocationFor, anyErrorId} = matchers;
const assert = require('assert');
const nock = require('nock');
const should = require('should')... |
# Copyright 2019 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 agreed to in writing, s... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import grpc
import time
from concurrent import futures
import sys
from train import cvt
from train import train
from deploy import image_saved_model
from train.utils import mysql_util
import multiprocessing
import logging as _logging
import image_train_service_pb2
import i... |
const calculateAmount = (data,transactionType) => {
return data.filter(transaction => transaction.transactionType === transactionType)
.reduce((total, transactionAmount) => total + transactionAmount.total, 0);
}
const calculateRecurring = (data) => {
if(data){
return data.reduce((total, transactio... |
/*=========================================================================================
File Name: radar-multi-level-control.js
Description: echarts radar multilevel control chart
----------------------------------------------------------------------------------------
Item Name: Stack - Responsive A... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="histogram.selected.textfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_n... |
if (true) {
const LOCKER = {};
const props = ["WebSocket", "RTCPeerConnection"];
props.map(prop => {
LOCKER[prop] = window[prop].bind({});
Object.defineProperty(window, prop, {
get: () => {
const err = new Error();
if(window.confirm(`${err.stack} would like to access ${prop}. Continu... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.runPluginHooks = runPluginHooks;
exports.runAsyncPluginHooks = runAsyncPluginHooks;
exports._clearHook = _clearHook;
exports.HOOKS = void 0;
/**
* stores the hooks that where added by the plugins
*/
/**
* hook-functions that ca... |
#!/usr/bin/python3
"""Starts Flask web app
Routes:
/ - display "Hello HBNB!"
/hbnb - display "HBNB"
/c/<text> - display "C <text>"
/python/<text> - display "Python is cool"
/number/<n> - display n if integer
/number_template/<n> - display a HTML page if n is int
"""
from flask import Flask, rend... |
import numpy as np
import numba
from despasito.equations_of_state import constants
def calc_Xika(indices, rho, xi, molecular_composition, nk, Fklab, Kklab, gr_assoc):
r"""
A wrapper to calculate the fraction of molecules of component i that are not bonded at a site of type a on group k. Switched between fun... |
/**
* @func 获取查询字符串对象
* @params url;string
* @return obj
* @author lc
* @date 2021/7/9
*/
function getQueryStringObj(url){
let qsObj = {};
if(!isValidUrl){
return qsObj;
}
let qs = url.substring(url.indexOf('?')+1);
let arrKey = qs.split('&');
arrKey.forEach... |
export default "M12 22H6A2 2 0 0 1 8 20V8H2V5H16V8H10V20A2 2 0 0 1 12 22M22 2V22H20V15H15V22H13V14A2 2 0 0 1 15 12H20V2Z" |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AntMerchantExpandActivitySignupQueryResponse(AlipayResponse):
def __init__(self):
super(AntMerchantExpandActivitySignupQueryResponse, self).__init__()
self._desc = No... |
import React, { Component } from 'react';
import classNames from 'classnames';
class ShopHeader extends Component {
render() {
const { title, caption, full, imageUrl } = this.props;
const headerClass = classNames('shop-header', { 'shop-header-full': full });
return (
<div className={headerClass} ... |
'use strict'
const { DOMParser } = require('../lib/dom-parser')
describe('DOMParser', () => {
describe('constructor', () => {
test('should store passed options.locator', () => {
const options = { locator: {} }
const it = new DOMParser(options)
// TODO: is there a simpler way to test this that doesn't inv... |
"use strict";
// Class definition
var KTDatatableRemoteAjaxDemo = function() {
// Private functions
// basic demo
var demo = function() {
var datatable = $('.kt-datatable').KTDatatable({
// datasource definition
data: {
type: 'remote',
source: {
read: {
url: 'https://keenthemes.com/metr... |
/*
* ---------------------------------------------------------
* Copyright(C) Microsoft Corporation. All rights reserved.
* ---------------------------------------------------------
*
* ---------------------------------------------------------
* Generated file, DO NOT EDIT
* --------------------------------------------... |
const express = require('express')
const app = express()
let bodyParser = require('body-parser')
let validator = require('./validator');
let datestore = require('./datastore');
let hubAPIService = require('./services/HubAPIService.js');
let sensorService = require('./services/SensorService.js');
let requestInService = ... |
/**
* Generated bundle index. Do not edit.
*/
export * from './gtm';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhcnRpY3MyLWd0bS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FuZ3VsYXJ0aWNzMi9ndG0vIiwic291cmNlcyI6WyJhbmd1bGFydGljczItZ3RtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0F... |
import React from 'react';
import Image4 from '../../assets/PetIdeal2.jpeg';
const PetIdeal = props => {
return (
<div className="container-fluid">
<div className="row">
<div className="col-6">
<img className="img-fluid" alt="Responsive" src={Image4}... |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 agree... |
/** @typedef {import('ts-jest')} */
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
projects: ['packages/*'],
preset: 'ts-jest/presets/default',
testMatch: ['**/*.test.ts'],
reporters: ["default"],
testEnvironment: 'node'
};
|
const Database = require("../db/config");
module.exports = {
async get() {
const db = await Database();
const jobs = await db.all(`SELECT * FROM jobs`);
await db.close();
return jobs.map((job) => ({
id: job.id,
name: job.name,
"daily-hours": jo... |
/*!
* DevExtreme (dx.messages.zh.js)
* Version: 19.1.6
* Build date: Wed Sep 11 2019
*
* Copyright (c) 2012 - 2019 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
"use strict";
! function(root, factory) {
if ("function" === typeof define &&... |
import React from 'react'
import styled from '@emotion/styled'
import { Link } from 'gatsby'
import Octicon from 'react-component-octicons'
import { EntypoTwitter } from 'react-entypo'
import Stat from './stat'
import DeployButton from './deploybutton'
import DataPoint from './datapoint'
const TwitterIcon = styled(Ent... |
'use strict';
var Message = require('../message');
var inherits = require('util').inherits;
var fcash = require('fcash-lib');
var BufferUtil = fcash.util.buffer;
var $ = fcash.util.preconditions;
var _ = fcash.deps._;
/**
* Contains information about a MerkleBlock
* @see https://en.bitcoin.it/wiki/Protocol_document... |
import React from "react";
import { graphql } from "gatsby";
import Layout from "../components/layout";
import Seo from "../components/seo";
export default function Template({
data, // this prop will be injected by the GraphQL query below.
}) {
const { markdownRemark } = data; // data.markdownRemark holds your po... |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n... |
(function() {
function fillProblemsTable() {
var deferred = $('#show-admin-problems').prop('checked')
? omegaup.API.Problem.adminList()
: omegaup.API.Problem.myList();
deferred
.then(function(result) {
$('#problem-list .added').remove();
for (var i = 0; i < result.problems.le... |
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"
}), 'KeyboardReturn'); |
import React from "react";
import { Button, InputGroup, Tooltip } from "@blueprintjs/core";
import { useStateLink } from "@hookstate/core";
import { Intent } from "@blueprintjs/core/lib/esnext/common/intent";
export default function PasswordInput(props) {
const showPassword = useStateLink(false);
const lockButto... |
/*!
/* eslint-env browser */
(function() {
'use strict';
// Check to make sure service workers are supported in the current browser,
var isLocalhost = Boolean(window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1... |
/*=========================================================================================
File Name: app-email.js
Description: app-email Javascripts
----------------------------------------------------------------------------------------
Item Name: Frest HTML Admin Template
Version: 1.0
Author:... |
(function(d){d['ug']=Object.assign(d['ug']||{},{a:"چىقىرىشقا بولمايدىغان ھۆججەت :",b:"توم",c:"يانتۇ",d:"قىسمەن قوللىنىش",e:"تېما تاللاش",f:"تېما",g:"Insert image or file",h:"رەسىمنىڭ تېمىسىنى كىرگۈزۈڭ",i:"رەسىمچىك",j:"ئەسلى چوڭلۇقتىكى رەسىم",k:"يان رەسىم",l:"سولغا توغۇرلانغان رەسىم",m:"ئوتتۇردىكى رەسىم",n:"ئوڭغا توغۇرل... |
export { default } from '../../common/api'; |
QUnit.test('Testing moveSlideRight css3:true', function(assert) {
var id = '#fullpage-moveSlideRight';
var FP = initFullpageNew(id, slidesCallbacks);
assert.equal($(id).find(SECTION_ACTIVE_SEL).find(SLIDE_ACTIVE_SEL).index(), 0, 'We expect slide 2.1 to be active');
var transforms = getTransform(FP.tes... |
module.exports={A:{A:{"2":"I D F E A B nB"},B:{"1":"Z MB M N S T U V W","2":"C O H P J K L"},C:{"2":"0 1 2 3 4 5 6 7 8 9 mB cB G a I D F E A B C O H P J K L b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB SB IB JB KB LB R uB xB","132":"Y XB TB UB VB WB RB Z MB M lB N S T U V","1090":"NB","1412":"... |
/**
* Proyecto elaborado para el curso de Gestión, proyecto SPA
* Todos los componentes y scripts son registrados e importados de forma
* general - Team SirwiQuy
*/
window.Vue = require('vue');
/**
* Importaciones de Vue JS
*/
import router from './router'
import VueToast from 'vue-toast-notification'
import '... |
define(["dojo/_base/declare", "./Default", "./commonStacked"],
function(declare, Default, commonStacked){
return declare(Default, {
// summary:
// Like the default plot, Stacked sets up lines, areas and markers
// in a stacked fashion (values on the y axis added to each other)
// as opposed to a direct o... |
var webpack = require("webpack");
var path = require("path");
module.exports = {
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)",
"../components/**/*/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@s... |
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class RecursiveSpiderItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
|
const getters = {
sidebar: state => state.app.sidebar,
language: state => state.app.language,
size: state => state.app.size,
device: state => state.app.device,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token,
avatar:... |
/*jslint adsafe: false, bitwise: true, browser: true, cap: false, css: false,
debug: false, devel: true, eqeqeq: true, es5: false, evil: false,
forin: false, fragment: false, immed: true, laxbreak: false, newcap: true,
nomen: false, on: false, onevar: true, passfail: false, plusplus: true,
regexp: false, rhino:... |
const a = <div>{testA ? <p>Aa</p> : testAb ? <p>Ab</p> : <p>Ac</p>}</div>;
const b = (
<div
style={{
display: testB ? undefined : "none"
}}>
B
</div>
);
const c = list.map(item => <div>{item}</div>);
class D {
render() {
return (
<input
value={this.state.testD}
onCha... |
import { shallowMount } from '@vue/test-utils'
import SvgIcon from '@/components/SvgIcon/register.vue'
describe('SvgIcon.vue', () => {
it('iconClass', () => {
const wrapper = shallowMount(SvgIcon, {
propsData: {
iconClass: 'test'
}
})
expect(wrapper.find('use').attributes().href).toBe(... |
import React from 'react';
import AppStore from '../../stores/app.store';
import AppCartItem from './app.cart-item';
import StoreWatchMixin from '../../mixins/StoreWatchMixin';
import { Link } from 'react-router';
const cartItems = () => {
return { items: AppStore.getCart() }
}
const Cart = (props) => {
var total... |
// Generated from Rollup.g4 by ANTLR 4.5
// jshint ignore: start
var antlr4 = require('antlr4/index');
var RollupListener = require('./RollupListener').RollupListener;
var grammarFileName = "Rollup.g4";
var serializedATN = ["\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd",
"\3\fJ\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\... |
module.exports={A:{A:{"1":"E A B","2":"H D G nB"},B:{"1":"C K f L N I J q"},C:{"1":"0 1 2 3 4 5 6 8 AB g h i j k l m n o p M r s t u v w x y z EB NB DB BB FB HB IB JB KB LB MB","2":"kB OB F O H D G E A B C K f L N I J P Q eB dB","4":"R S T U V W X Y Z a b c d e"},D:{"1":"0 1 2 3 4 5 6 8 F O H D G E A B C K f L N I J P ... |
import {Key} from "../Key";
export class SpaceKey extends Key {
constructor() {
super(" ");
}
}
|
# Copyright (c) 2017-2018 {Flair Inc.} WESLEY PENG
#
# 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 agre... |
import unittest
from client import getDataPoint
class ClientTest(unittest.TestCase):
def test_getDataPoint_calculatePrice(self):
quotes = [
{'top_ask': {'price': 121.2, 'size': 36}, 'timestamp': '2019-02-11 22:06:30.572453', 'top_bid': {'price': 120.48, 'size': 109}, 'id': '0.109974697771', 'stock': ... |
# Converted to Python from micropython/source/microbit/microbitmusictunes.c
# from https://github.com/bbcmicrobit/micropython
#
# The music encoded herein is either in the public domain, composed by
# Nicholas H.Tollervey or the composer is untraceable and covered by fair
# (educational) use.
#
# The MIT License (MIT)
... |
//>>built
define("dojorama/layers/nls/release_pt-br",{"dojorama/ui/release/mixin/nls/_ReleaseActionsMixin":{indexLabel:"Overview",createLabel:"Create New Release"},"dojorama/ui/release/mixin/nls/_ReleaseBreadcrumbsMixin":{homeLabel:"Home",releaseIndexLabel:"Releases",releaseCreateLabel:"Create New Release"},"dojorama/u... |
import styled from "styled-components";
export const Icon = styled.span`
svg {
width: ${(props) => props.width || "100%"};
height: ${(props) => props.height || "100%"};
opacity: ${(props) => props.opacity || "1"};
path {
fill: ${(props) => props.fill};
}
}
`;
export const Loader = styled.... |
import * as actionTypes from '../../src/actions/actionTypes';
import menuReducer from '../../src/reducers/menuReducer';
describe('Unit test for the menu reducer ', () => {
it('should return the initial state of the store ', () => {
const initialState = { menu: [], noMenu: '' };
expect(menuReducer(undefined, ... |
//// [genericDerivedTypeWithSpecializedBase2.ts]
class A<T extends { length: number }> {
x: T;
}
class B<U> extends A<string> {
y: U;
}
var x: A<{ length: number; foo: number }>;
var y: B<number>;
x = y; // error
//// [genericDerivedTypeWithSpecializedBase2.js]
var __extends = (this && this.__extends) ... |
/**
* Created by aleckim on 2016. 4. 2..
*/
var mongoose = require("mongoose");
var ksiSchema = new mongoose.Schema({
stnId: String,
stnName: String, //unique
addr: String,
isCityWeather: Boolean,
altitude: Number,
geo: {
type: [Number], // [<longitude(dmY)>, <latitude(dmX)>]
... |
(function(d){d['ko']=Object.assign(d['ko']||{},{a:"Cannot upload file:",b:"굵게",c:"기울임꼴",d:"밑줄",e:"Strikethrough",f:"Subscript",g:"소스",h:"Superscript",i:"인용 단락",j:"Insert image or file",k:"제목 선택",l:"제목",m:"링크",n:"번호매기기",o:"글머리기호",p:"이미지 위젯",q:"이미지 설명을 입력하세요",r:"문서 너비",s:"내부 우측 정렬",t:"왼쪽 정렬",u:"가운데 정렬",v:"오른쪽 정렬",w:"Inse... |
+function(t){"use strict";function e(t,e,s){for(var i=n.getCss;t=t.offsetParent;)if(i(t,e)===s)return!0;return!1}function s(t,e){n.createCanvas(this,s,t,e)}function i(t){var e=this,s=e.set;s.num>0&&s.range>0&&(t="pause"===t?"off":"on",o[t](s.eventElem,"mousemove",e.moveHandler),o[t](s.eventElem,"touchmove",e.moveHandle... |
import gifFrames from 'gif-frames';
import axios from 'axios';
import gifInfo from 'gif-info';
import FrameServer from './FrameServer';
class GifFrameServer extends FrameServer {
constructor(url) {
super();
this.url = url;
this.type = 'gif';
}
async getInfos() {
const response = await axios({
... |
"use strict";
const BaseParameters = require('./base-parameters');
const { getProp, extendClass } = require('./../../commons/utils');
function GaussianBlurParameters (name, values, callback) {
this.constructor.super.call(this, name, callback);
this.values = {
kernelSize: getProp(values, 'kernelSize', 63),
... |
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import { matchPath } from 'react-router-dom'
const {
ENVIRONMENT_TYPE_NOTIFICATION,
ENVIRONMENT_TYPE_POPUP,
} = require('../../../../app/scripts/lib/enums')
const { DEFAULT_ROUTE, INITIALIZE_ROUTE, C... |
import { Layer } from "../Layer";
import icon from "el/editor/icon/icon";
import { ComponentManager } from "el/editor/manager/ComponentManager";
const DEFAULT_TEMPLATE = `
<svg>
<rect width="100%" height="100%" fill="black" />
</svg>
`
export class TemplateLayer extends Layer {
getIcon () {
return icon... |
#!/usr/bin/env node
const path = require('path');
const program = require('commander');
const pkg = require('../package.json');
const serveStatic = require('../src/serveStatic');
program
.version(pkg.version)
.arguments('<registryPath>')
.option('-p, --port <port>', 'server port', 8888)
.action((registryPath... |
const config = {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": ".",
"testRegex": ".*\\.(spec|test|e2e-test)\\.ts$",
"testTimeout": 1200000,
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"src/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"... |
function pattern(str) {
let string = str.replace(/([+{($^|.\\])/g, '\\$1');
string = string.replace(/(^|[^\\])([*?])/g, '$1.$2');
string = `^${string}$`;
const p = new RegExp(string);
return p.test.bind(p);
}
function getCountAndMatch(args) {
if (args.length > 4) {
throw new Error('Too many arguments'... |
Object.defineProperty(exports, '__esModule', { value: true });
const { Decimal } = require('./runtime/index-browser');
const Prisma = {};
exports.Prisma = Prisma;
/**
* Prisma Client JS version: 3.9.1
* Query Engine version: bcc2ff906db47790ee902e7bbc76d7ffb1893009
*/
Prisma.prismaVersion = {
client: '3.9.1',
... |
import Vue from 'vue';
import VueLazyLoad from 'vue-lazyload';
Vue.use(VueLazyLoad, {
error: 'http://cdn.helloyzy.cn/404.png',
loading: 'http://cdn.helloyzy.cn/404.png',
attempt: 1,
});
|
const { throws } = require('assert');
const fs = require('fs');
let commentData = require('../data/commentData.js');
class Comment {
constructor(id, journalId, content, reactions, giphy) {
this.id = id;
this.journalId= journalId;
this.content = content;
this.reactions = reactions;... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
import torch.nn as nn
from mmcv.cnn import ConvModule, normal_init, bias_init_with_prob
from mmcv.ops import DeformConv2d, CornerPool, batched_nms
from logging import warning
from math import ceil, log
import torch
import torch.nn.functional as F
from ..utils import gaussian_radius, gen_gaussian_target
from .base_dense... |
from common import get_file_contents
def split_items(data, separator=",", as_int=False):
converter = int if as_int else lambda x: x
result = []
for item in data.split(separator):
result.append(converter(item))
return result
def get_fuel_usage_old(crab_list, target):
fuel = 0
for crab in crab_list:
fuel +=... |