text stringlengths 3.08k 15.5k |
|---|
import { planEffects, redisServices, messageServices } from '.';
import { IEnvServices } from '../env-services';
import { IAgent } from '../models';
import { generateExistingAgent, randomIntInRange, randomItem, randomPlaceNearby } from '../utils';
/**
* Picks the equipment and
* Gives the receivers damage, based on ... |
import moment, { Moment } from 'moment';
import clone from 'clone';
import { get } from './nodecg';
import { Configschema } from '../../types/schemas/configschema';
import { GraphQLClient } from 'graphql-request'
import { RunData, Timer } from '../../../../nodecg-speedcontrol/src/types';
const nodecg = get();
const co... |
import { Injectable } from '@angular/core';
import { credit, indcredit } from '../pages/order/order.page';
import { Observable, of, Subject, BehaviorSubject } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { HttpHeaders, HttpClient } from '@angular/common/http';
const endpointAddress = 'http://... |
import * as React from 'react';
import {
Typography,
Grid,
IconButton,
Divider,
MenuItem,
Menu,
Tooltip,
Box,
} from '@mui/material';
import { Copy, MoreVertical } from 'react-feather';
import { clipboard, ipcRenderer } from 'electron';
import { Link } from 'react-router-dom';
import { useSnackbar } fro... |
import { Data, ItemType } from 'csl-json';
/**
* Maps LaTeX dicratical commands to unicode dicraticals
*/
export const DICRATICS: ReadonlyMap<string, string> = new Map([
['`', '\u0300'],
[`'`, '\u0301'],
['^', '\u0302'],
['~', '\u0303'],
['=', '\u0304'],
['"', '\u0308'],
['c', '\u0327'],
... |
import {VueClass, VueRequireFilter, VueVar} from "../lib/numbersLab/VueAnnotate";
import {DependencyInjectorInstance} from "../lib/numbersLab/DependencyInjector";
import {Wallet} from "../model/Wallet";
import {DestructableView} from "../lib/numbersLab/DestructableView";
import {Constants} from "../model/Constants";
im... |
<filename>projects/s-js-utils/src/lib/time/time-utils.ts
import { last } from 'micro-dash';
import { mapAsKeys } from '../objects/map-as-keys';
import { roundToMultipleOf } from '../round-to-multiple-of';
/**
* Defines the canonical string representation for each time unit. Many aliases
* can also be used with the f... |
<filename>src/utils/skillPackageHelper.ts
import * as vscode from 'vscode';
import * as fs from 'fs-extra';
import * as path from 'path';
import { Options } from 'async-retry';
import { HttpClient } from 'typed-rest-client/HttpClient';
import {
SmapiResource, SmapiClientFactory, Utils
} from '../runtime';
import *... |
import { undo as OriginUndo } from 'prosemirror-history';
import { Fragment, Node, ResolvedPos } from 'prosemirror-model';
import { EditorState, NodeSelection, Selection, TextSelection, Transaction } from 'prosemirror-state';
import { canSplit, liftTarget } from 'prosemirror-transform';
import { EditorView } from 'pros... |
import {
Artifact,
CollectionName,
Device,
Job,
JobRequest,
JobTask,
LogsModel,
TestModel,
TestReport,
TestResult,
TestStatus
} from 'pandalab-commons';
import {FirebaseRepository} from "./repositories/firebase.repository";
import '@firebase/auth';
import '@firebase/firestore... |
/*
* Copyright 2016-2017 the original author or 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
*
* Author - <NAME>, <NAM... |
<reponame>jaredjn/matrix-react-sdk<gh_stars>1-10
/*
Copyright 2019 - 2021 The Matrix.org Foundation C.I.C.
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... |
import type { Dispatch, ReactNode, SetStateAction } from 'react'
import { useCallback, useEffect, useState, useRef } from 'react'
import classNames from 'classnames'
import { debounce } from 'debounce'
import ResizeObserver from 'resize-observer-polyfill'
import { Arrows } from './arrows'
import { Gradients } from '... |
interface WordTreeNode {
val: string | null;
back: WordTreeNode | null;
parent: WordTreeNode | null;
accept: boolean;
next: WordTreeNode | null;
}
/**
* 敏感词扫描
*/
export class FastScanner {
public root: WordTreeNode;
constructor(words: string[]) {
this.BuildTree(words);
}
/**
* 构建词汇树
* @... |
<reponame>Leon-OnlineLearning/Leon-Serverside<filename>services/Routes/training/index.ts
import FileLogicImpl from "@controller/BusinessLogic/TextClassification/file-logic-impl";
import TextClassificationFilesLogic from "@controller/BusinessLogic/TextClassification/files-logic";
import {
ModelsFacade,
ModelsFac... |
<reponame>jamjarlabs/JamJarWeb
/*
Copyright 2020 JamJar 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 applicable law or ... |
<gh_stars>0
import arrowCircleDownIcon from "./icons/arrow-circle-down";
import arrowCircleLeftIcon from "./icons/arrow-circle-left";
import arrowCircleRightIcon from "./icons/arrow-circle-right";
import bellIcon from "./icons/bell";
import binIcon from "./icons/bin";
import bookIcon from "./icons/book";
import calenda... |
/*
University of Illinois/NCSA Open Source License
Copyright (c) 2018 Terrain Data, Inc. and the authors. All rights reserved.
Developed by: Terrain Data, Inc. and
the individuals who committed the code in this file.
https://github.com/terraindata/terrain
Permission is ... |
import { Component } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NavController, NavParams, ToastController, LoadingController, Platform, AlertController } from 'ionic-angular';
import { TranslateService } from '@ngx-translate/core';
import { AuthService, UserProf... |
<reponame>telestoworld/builder<gh_stars>0
import BN from "bn.js"
import { Address } from "web3x-es/address"
import { EventLog, TransactionReceipt } from "web3x-es/formatters"
import { Contract, ContractOptions, TxCall, TxSend, EventSubscriptionFactory } from "web3x-es/contract"
import { Eth } from "web3x-es/eth"
import... |
/*
* Copyright (c) 2019 - present Nimbella Corp.
*
* This file is licensed to you 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 captialize from 'lodash/capitalize'
import * as React from 'react'
import * as Kb from '../../../../../common-adapters'
import * as Types from '../../../../../constants/types/chat2'
import * as CryptoTypes from '../../../../../constants/types/crypto'
import * as Constants from '../../../../../constants/chat2'
im... |
import { Range } from 'vscode-languageserver/node';
import { TextDocument } from 'vscode-languageserver-textdocument';
import { OmtAvailableObjects, OmtImport, OmtLocalObject } from './types';
import { parse } from 'yaml';
import { getUriMatch } from './importMatch';
/**
* A function that can be used to retrieve all ... |
import ts from 'typescript';
import { IterableIteratorSlots } from '../../constants';
import { ScriptBuilder } from '../../sb';
import { VisitOptions } from '../../types';
import { Helper } from '../Helper';
export interface CreateIterableIteratorBaseHelperOptions {
readonly handleNext: (options: VisitOptions) => vo... |
<filename>packages/plugin-constraints/sources/Constraints.ts
import {Ident, Locator, Project, Workspace} from '@berry/core';
import {miscUtils, structUtils} from '@berry/core';
import {xfs} from '@berry/fslib';
import {posix} from 'path';
import pl... |
import { promises as fs } from "fs";
import configureMockStore from "redux-mock-store";
import thunk from "redux-thunk";
import { of } from "rxjs";
import { DispatchExts } from "../../reducers/archifiltre-types";
import { initialState as filesAndFoldersInitialState } from "../../reducers/files-and-folders/files-and-fol... |
import * as PropTypes from 'prop-types';
import React from 'react';
import * as ReactDom from 'react-dom';
import warning from 'warning';
import { Nullable } from '../typings/Types';
import { isBrowser } from './utils';
import { smoothScrollIntoView } from './smoothScrollIntoView';
import { IValidationContext } from ... |
import React from "react";
import { isString } from "lodash";
import BaseControl, { ControlProps } from "./BaseControl";
import { StyledDynamicInput } from "./StyledControls";
import CodeEditor, {
CodeEditorExpected,
} from "components/editorComponents/CodeEditor";
import {
EditorModes,
EditorSize,
EditorTheme... |
<reponame>Njima1572/spatialchatclone
import { UserInfo, defaultUserInfo } from "../contexts/UserInfoContext";
import { AudioVisualizer, gainToMultiplier } from "./AudioVisualizer";
import { Socket } from "socket.io-client";
import { DCLabel, Pack } from "./Network";
export interface DataPackage {
position: [number, ... |
import type {PlaceholderType} from '../types.js';
import {escapeRegExp} from '../util.js';
const OP = {
placeholder: Symbol('placeholder'),
relaxed: Symbol('relaxed'),
slash: Symbol('slash'),
text: Symbol('text'),
wildcard: Symbol('wildcard')
};
interface MatchOptions {
isEndpoint: boolean;
}
interface Pl... |
import { createConnection, Connection } from 'typeorm'
import * as Daf from 'daf-core'
import { SecretBox, KeyManagementSystem } from 'daf-libsodium'
import { DafResolver } from 'daf-resolver'
import { JwtMessageHandler } from 'daf-did-jwt'
import { W3cMessageHandler, W3cActionHandler, ActionSignW3cVc } from 'daf-w3c'
... |
///<reference path=".d.ts"/>
"use strict";
import util = require("util");
import path = require("path");
import url = require("url");
import options = require("./options");
import querystring = require("querystring");
import Future = require("fibers/future");
import helpers = require("./helpers");
export class UserD... |
import Mock from 'mockjs'
export const queryParams = function (data: any, way: any) {
let _result: any;
if (way == 0) {
let res: Array<string> = []
for (let key in data) {
let value: string = data[key]
// 去掉为空的参数
if (['', undefined, null].includes(value)) {
... |
<filename>libs/game/controllerbutton.ts
enum ControllerButtonEvent {
//% block="pressed"
Pressed = KEY_DOWN,
//% block="released"
Released = KEY_UP,
//% block="repeat"
Repeated = KEY_REPEAT
}
enum ControllerButton {
//% block="{id:controller}A"
A = 5,
//% block="{id:controller}B"
... |
// Other techniques for learning
import Matrix from './matrix';
type ActFnc = (x: number) => number;
class ActivationFunction {
public func: ActFnc;
public dfunc: ActFnc;
constructor(func: ActFnc, dfunc: ActFnc) {
this.func = func;
this.dfunc = dfunc;
}
}
let sigmoid = new ActivationFunction(
x => 1 / (1 +... |
import { readFileSync, writeFile } from 'fs';
import {
PrefetchAotGraph,
PrefetchAotNeighbor,
PrefetchAotPluginConfig,
FileChunkMap
} from './declarations';
import { join } from 'path';
import { table } from 'table';
import chalk from 'chalk';
import {
buildMap,
defaultPrefetchConfig,
getCompilationMappi... |
<gh_stars>1-10
// tslint:disable:no-empty-interface
import { ReadonlyDate } from "readonly-date";
import { ChainId, PostableBytes, PublicKeyBundle, SignatureBundle, TxId } from "@iov/tendermint-types";
import { IpPortString } from "./encodings";
export type Response =
| AbciInfoResponse
| AbciQueryResponse
| B... |
<reponame>Jsn2win/MyCrypto
import { DeterministicWallet } from '@mycrypto/wallets';
import { expectSaga, mockAppState } from 'test-utils';
import { fAccount, fAssets, fNetwork, fNetworks } from '@fixtures';
import { DWAccountDisplay, ExtendedDPath, getWallet } from '@services/WalletService';
import { AppState } from '... |
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH 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 limitation the r... |
<filename>app/src/common/waseda/calendar.ts
import { InternalError, InvalidResponseError } from '../error';
import { MessengerServer } from '../util/messenger';
import { assertCurrentContextType, postJson } from '../util/util';
import { fetchSessionKey } from './session-key';
import * as idb from 'idb-keyval';
import A... |
/* eslint-disable import/no-unresolved */
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import Countdown from 'react-countdown';
import { Swiper, SwiperSlide } from 'swiper/react';
import { Autoplay, Navigation } from 'swiper';
import 'swiper/scss';
import 'swiper/scss/na... |
<reponame>BarushevEA/light-observable-ts
import {
ICallback,
IListener,
IObserver,
IOnceMarker,
ISetup,
ISubscribe,
ISubscribeObject,
ISubscriptionLike
} from "./Types";
import {deleteFromArray} from "./FunctionLibs";
export class SubscribeObject<T> implements ISubscribeObject<T> {
... |
import { GetStaticPaths, GetStaticProps } from "next";
import Head from "next/head";
import Image from "next/image";
import React from "react";
import Link from 'next/link';
import { format, parseISO } from "date-fns";
import ptBR from "date-fns/locale/pt-BR";
import { Box, Flex } from "@chakra-ui/layout";
import { Bu... |
import { privateKeyToAddress } from '@celo/utils/lib/address'
import { provider, Tx } from 'web3-core'
import { Callback, JsonRpcPayload, JsonRpcResponse } from 'web3-core-helpers'
import { CeloProvider } from '../providers/celo-provider'
// Random private keys
const PRIVATE_KEY1 = '<KEY>'
const ACCOUNT_ADDRESS1 = pri... |
<filename>frontend/src/app/services/dmarc.service.ts
import { HttpClient } from '@angular/common/http';
import { EventEmitter, Injectable, Pipe, PipeTransform } from '@angular/core';
import { Observable, of, Subject } from 'rxjs';
import { environment } from '../../environments/environment';
import { MatTableDataSource... |
<filename>src/vs/workbench/contrib/terminal/browser/links/terminalLinkHelpers.ts
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for licen... |
<gh_stars>0
import { assert } from "@ndn/util";
import type { Decoder } from "./decoder";
import { printTT } from "./string";
interface Rule<T> extends EvDecoder.RuleOptions {
cb: EvDecoder.ElementDecoder<T>;
}
const AUTO_ORDER_SKIP = 100;
function nest<T>(evd: EvDecoder<T>): EvDecoder.ElementDecoder<T> {
retur... |
<gh_stars>1-10
import { GeneratorFactory } from "../generators/GeneratorFactory";
import { GeneratorFalsy } from "../generators/GeneratorFalsy";
import { GeneratorType } from "../generators/GeneratorType";
import { IGenerator } from "../generators/IGenerator";
import { Globals } from "./globals";
import { ModuleMethod,... |
/** Copyright (c) 2021 Uber Technologies, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import * as react_router from 'react-router';
export {
RouteComponentProps as ContextRouterType,
match as MatchType,
} from 'react-r... |
import {Component, Input, OnChanges, SimpleChange, Optional, OnInit} from '@angular/core';
import {DataTable, PageEvent, SortEvent} from './data-table.directive';
import * as _ from 'lodash';
@Component({
selector: 'hi-data-pagination',
template: `
<hi-data-paginator #p [table]="table">
<ul class="pagina... |
<reponame>HelloFeture/sproto-ts
/**
* copy from nodejs Buffer
*/
// copy from nodejs Buffer
export function utf8ToBytes(str: string, units?: number): Array<number> {
units = units || Infinity
let codePoint: number;
let length = str.length
let leadSurrogate = null
let bytes: number[] = [];
f... |
import { WalletCheckModal, StateAndHelpers, Connect } from '../../interfaces'
import { usbIcon } from './icons'
interface DerivationPaths {
[key: string]: Array<{ path?: string; label: string }>
}
const derivationPaths: DerivationPaths = {
Ledger: [
{ path: `m/44'/60'/0'`, label: 'Ethereum' },
{ path: `m/... |
<filename>src/components/value-handler/value-handler.ts
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { Subject } from 'rxjs/Subject';
/**
* This component transitions from a span to an input on click events, allowing the user to adjust it's va... |
import { Reducer, Store, createStore } from "redux";
import {
Action,
ActionTypes,
InitializeAction,
SetNameAction,
JoinGameAsPlayerOAction,
JoinGameAsPlayerXAction,
WatchGameAsObserverAction,
TakeTurnAction,
StartNewGameAction,
actionCreators
} from "./actions";
import { GameBoard, Player, newGame... |
<filename>packages/amplify-cli/src/execution-manager.ts
import fs from 'fs-extra';
import path from 'path';
import Context from './domain/context';
import Constant from './domain/constants';
import { scan, getPluginsWithNameAndCommand, getPluginsWithEventHandler } from './plugin-manager';
import PluginInfo from './doma... |
<gh_stars>0
import * as express from "express";
import * as compression from "compression"; // compresses requests
// import * as session from "express-session";
import * as bodyParser from "body-parser";
import * as morgan from "morgan";
// import * as lusca from "lusca";
// import * as dotenv from "dotenv";
import *... |
import { flattenStyles } from "@native-mobile-resources/util-widgets";
import { Component, createElement, Fragment } from "react";
import {
ActivityIndicator,
Image,
ImageURISource,
Switch,
Text,
TextInput,
TouchableOpacity,
View
} from "react-native";
import Dialog from "react-native-di... |
<gh_stars>0
import msgpack from "msgpack-lite";
import nanoid from "nanoid";
import * as nano from "nanomsg";
type InternalDistributedEvent = { topic: string; data: any; sender: string; fromLeader: boolean }
export type DistributedEvent = { topic: string; data: any; }
export type EventListener = (msg: DistributedEven... |
import type { FC } from "react";
import useSWR from "swr";
import moment from "moment";
import { DownloadIcon } from "./DownloadIcon";
import { LockIcon } from "./LockIcon";
import { EyeIcon } from "./EyeIcon";
const ImageCard: FC<{ image: Image }> = ({
image: { id, previewURL, name, alt, uploaded, isPrivate, downlo... |
<filename>packages/opencensus-core/src/stats/types.ts<gh_stars>0
/**
* Copyright 2018, OpenCensus 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... |
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers, upgrades, network } from 'hardhat';
import { Timelock__factory, PancakeswapV2Worker, PancakeswapV2Worker__factory, PancakeswapV2WorkerMigrate, PancakeswapV2WorkerMigrate__factory, WaultSwap... |
import React, { useEffect, useRef, useState } from 'react';
import { DisplayUnit } from '@instruments/common/displayUnit';
import { FlightPlanProvider } from '@instruments/common/flightplan';
import { useSimVar } from '@instruments/common/simVars';
import { useArinc429Var } from '@instruments/common/arinc429';
import {... |
/// <reference path="./node_modules/@types/node/index.d.ts" />
/**
* To learn more about how to use Easy Webpack
* Take a look at the README here: https://github.com/easy-webpack/core
**/
import { generateConfig, get, stripMetadata, EasyWebpackConfig } from '@easy-webpack/core';
import * as path from 'path';
import... |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React, { useEffect, useState } from 'react';
import {
EuiPageContent... |
import * as React from "react"
import makeStyles from "@material-ui/core/styles/makeStyles"
import Table from "@material-ui/core/Table"
import TableBody from "@material-ui/core/TableBody"
import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@mate... |
<gh_stars>0
import regl from 'regl'
import {Rect, Vec2, AffineTransform} from './math'
import {Color} from './color'
export class RectangleBatch {
private rectCapacity = 1000
private rectCount = 0
private configSpaceOffsets = new Float32Array(this.rectCapacity * 2)
private configSpaceSizes = new Float32Array(... |
<filename>src/excel-markdown-helpers.ts
import { TableCellAlignment, TableSizeMetadata } from './interfaces'
import { ALIGNED_LEFT_SYNTAX, ALIGNED_CENTER_SYNTAX, ALIGNED_RIGHT_SYNTAX } from './table-alignment-syntax'
const ALIGNED_LEFT = "l";
const ALIGNED_RIGHT = "r";
const ALIGNED_CENTER = "c";
const EXCEL_COL... |
<reponame>kawarimidoll/finicky
import { validate } from "./fastidious/index";
/**
* Finicky Configuration Reference.
*/
/**
* This represents the full `.finicky.js` `module.exports` object.
*
* Example:
*
* ```js
* module.exports = {
* defaultBrowser: "Google Chrome",
* options: {
* hideIcon: f... |
import { Component, OnInit, ChangeDetectorRef } from "@angular/core";
import { AngularFireFunctions } from "@angular/fire/functions";
import { AngularFireDatabase } from "@angular/fire/database";
import { AuthService, ConnectionStatus } from "../auth.service";
import { take, timeout } from "rxjs/operators";
import { co... |
import {
Alert,
AlertIcon,
Box,
Flex,
AlertDescription,
useDisclosure
} from '@chakra-ui/react'
import {dequal} from 'dequal/lite'
import {useCallback, useMemo, useState} from 'react'
import {useModification} from 'lib/hooks/use-model'
import useRouteTo from 'lib/hooks/use-route-to'
import useToast from 'l... |
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { map, switchMap } from 'rxjs/operators';
import { Apollo } from 'apollo-angular';
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
import { NgxSpinnerService } from 'ngx-spinner';
impo... |
<reponame>xxyy/vscode-json-languageservice
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------... |
import { BIG, ECP, ECP2 } from "amcl-js";
import { ElGamal1, Rng } from "ecc";
import { B2, ThetaOnly } from "groth-sahai";
import { constants } from "./constants";
import { Message } from "./Message";
import { PublicElection } from "./PublicElection";
import {
serializeVerificationKey,
UserKeypair,
UserSigningK... |
<reponame>medisysinnovation/medisys
import immutable from 'immutable';
import getRequest from './baseRequest';
import { RequestConfig, RequestMethod } from './baseRequest';
// console.log(immutable);
const { Map, List } = immutable;
export interface ModalStaticFunctions {
updateState: (newState: StateProps) => void;
... |
<reponame>dutterbutter/dkg-substrate
/*
* Copyright 2022 Webb Technologies 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
*
* Unl... |
import COLORS from "theme/colors";
export type ColorType = { [property in keyof typeof COLORS]: string } | string;
export type MainAxisFlexDefaultValue =
| "flex-start"
| "flex-end"
| "center"
| "stretch"
| "space-between"
| "space-around";
export type CrossAxisFlexDefaultValue =
| "flex-start"
| "fl... |
import React, { useState, useEffect, useRef } from 'react';
import Link from 'next-translate/Link';
import Router from 'next-translate/Router';
import AutoSuggest from 'react-autosuggest';
import useTranslation from 'next-translate/useTranslation';
import api from '../services/api';
import { useAuth } from '../hooks/a... |
<filename>src/app/components/fuzzy.component.ts
import { Component, ChangeDetectorRef, OnInit } from '@angular/core';
import { IElement } from '../model/IElement';
import { generateTestElements, centersElaboration, calculateEuclideanDistance, getInitialCenters, initiateBelongingDegrees, defaultElements, defaultCenters,... |
import EventEmitterPromisified, {Message} from './index';
enum EXIT {
SUCESS,
FAIL
}
const log = console.log;
const wait = (ms: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms));
const sum = (a: number, b:number): number => a + b;
const assert = (result: boolean, ...title: any[]) => {
... |
<gh_stars>10-100
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Provides configuration for CSS styles of visualization.
*/
export interface StyleConfig {
/** Line stroke style. */
lineStroke?: string;
/** Line width. */
lineWidth?: number;
/** Text colour. */
... |
/*
* Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC.
*/
// from https://github.com/livnev/cdp-balance/blob/master/balance.py
// tslint:disable:max-line-length
import { BigNumber } from 'bignumber.js';
import { sum } from 'lodash';
import * as mathjs from 'mathjs';
import { zero } from '../../utils/zero';
e... |
<reponame>swimos/swim
// Copyright 2015-2021 Swim.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 applica... |
import * as React from 'react';
import { Omit, Redirect, RedirectProps, RouteComponentProps, withRouter } from 'react-router';
import {
AnyMappingAction,
ContainerComponent, ContainerPostReducer,
getMappingActionCreator,
State,
StateObject
} from 'manifold-dx';
/**
* To use this component in an application,... |
/* eslint-disable @typescript-eslint/no-var-requires */
import { ExecOptions, spawn, SpawnOptions as ChildProcessSpawnOptions } from 'child_process';
import { CancellationToken } from 'coc.nvim';
import * as iconv from 'iconv-lite';
import { homedir } from 'os';
import { Observable } from 'rxjs/Observable';
import { cr... |
import { Avatar, Flex, Input, Text } from "@components/style-guide";
import Action from "@BrainlyAction";
import Build from "@root/helpers/Build";
import { FlexElementType } from "@style-guide/Flex";
import debounce from "debounce";
import RemoveJunkNotifications from "../../RemoveJunkNotifications";
import Components ... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import './data-table.scss';
import cx from 'classnames';
import React from 'react';
import { IColumn, SelectionMode } from '@fluentui/react/lib/DetailsList';
import { Facepile } from '@fluentui/react/lib/Facepile';
import { FontIcon } from '@... |
<gh_stars>0
/**
* Sigma.js WebGL Renderer Arrow Program
* ======================================
*
* Program rendering direction arrows as a simple triangle.
*/
import Program from "./program";
import { floatColor } from "../utils";
import vertexShaderSource from "../shaders/arrow.vert.glsl";
import fragmentShader... |
import { createState } from '@speigg/hookstate'
import React, { useEffect, useRef, useState } from 'react'
import { useLocationInstanceConnectionState } from '@xrengine/client-core/src/common/services/LocationInstanceConnectionService'
import { ChatService, useChatState } from '@xrengine/client-core/src/social/service... |
import React from 'react';
import {
cxBackgroundGray,
cxBackgroundGrayStrokeNeutralFill,
} from './LoadingSkeletonsSvgUtil';
import LoadingSkeleton, {
ILoadingSkeletonProps,
IStandardSkeleton,
} from './LoadingSkeleton';
export const LineChartSkeleton = (
props: IStandardSkeleton
): React.ReactElement<IStandardS... |
/**
* 事件名
*/
export enum EventName {
/** 调节节点大小 */
RESIZE,
/** 删除参数 */
PARAM_DELETE,
/** 参数名更改 */
PARAM_NAME_CHANGED,
/** 选中ParamItem */
PARAM_SELECT,
/** 设置状态机视图的显示 */
SET_CUR_STATE_MACHINE,
/** 状态名更改 */
STATE_NAME_CHANGED,
/** AnyState改变坐... |
// package: vega.commands.v1
// file: commands/v1/validator_commands.proto
import * as jspb from "google-protobuf";
import * as chain_events_pb from "../../chain_events_pb";
import * as github_com_mwitkow_go_proto_validators_validator_pb from "../../github.com/mwitkow/go-proto-validators/validator_pb";
export class N... |
/**
* Copyright 2017-2021, Voxel51, Inc.
*/
import { Overlay } from "./overlays/base";
export type RGB = [number, number, number];
export type RGBA = [number, number, number, number];
export interface Coloring {
byLabel: boolean;
pool: string[];
scale: RGB[];
seed: number;
defaultMaskTargets?: MaskTarget... |
import React, { useEffect, useState } from "react";
import { Container, Row, Col } from "react-bootstrap";
import {RoleData, ROLE_FLAGS} from "../../../../../../backend/database/models/Role";
import { Btn, Input, MiniHeader, TextArea } from "../../../../styles";
import {Controlled as CodeMirror} from 'react-codemirror2... |
const getStdin = require('get-stdin');
const readFile = require('fs').readFile;
const promisify = require('util').promisify;
import * as jmdict from './jmdict';
import * as namedict from './enamdict';
import * as unidic from './mecabUnidic';
import * as dbutils from './db';
function cumsum(arr: number[]) { return arr.... |
<reponame>holodata/luna-translations-bot
/**
* @file This file manages addition and removals from WatchFeatureSettings
* via Discord command.
**/
import {
createEmbed, createEmbedMessage, emoji, reply
} from '../../../helpers/discord'
import { match } from '../../../helpers/language'
import { getSettings, updateSe... |
<reponame>mrdulin/graphql-yoga-lab<filename>src/services/adwords/CampaignService/index.ts
import _ from 'lodash';
import { SoapService } from '../../core';
import { ISelector, IPaging, Operator } from '../../../types/adwords';
import { AdwordsOperartionService } from '../../core/AdwordsOperationService';
import { ICam... |
<filename>www/src/blanket-algorithm/GaussianPositionMap.ts
import {
FloatType,
MeshDepthMaterial,
Object3D,
PerspectiveCamera,
Raycaster,
Scene,
Vector2,
Vector3,
WebGLRenderer,
WebGLRenderTarget,
} from "three";
import { FullScreenQuad } from "three/examples/jsm/postprocessing/Pass";
import { Gauss... |
import React, { ComponentType, ReactNode, ReactElement } from 'react';
import styled from 'styled-components';
type FloatingLabelProps = {
text: string;
children: ReactElement<HTMLInputElement>;
style?: object;
placeholderStyle?: object;
container?: ComponentType|string;
label?: ComponentType|s... |
<filename>src/loadable.ts<gh_stars>1-10
import {assingLoadableMark} from './marks';
import {isBackend} from './detectBackend';
import {DefaultImport, Loadable, Mark, MarkMeta, Promised} from './types';
import {settings} from "./config";
import {getPreloaders} from "./preloaders";
type AnyFunction = (x: any) => any;
i... |
<reponame>mattapet/fp4ts
// Copyright (c) 2021-2022 <NAME>
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
import {
$,
$type,
compose,
Fix,
id,
Kind,
Lazy,
lazyVal,
TyK,
TyVar,
α,
λ,
} from '@fp4ts/core';
import { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.