id stringlengths 1 3 | code_masked stringlengths 797 182k | target stringlengths 3 41 |
|---|---|---|
400 | import * as tmi from 'tmi.js'
import { twitch_username, twitch_token, twitch_channel } from './envs.json'
import * as fs from 'fs'
// Main
let queue: string[] = [];
let votes: { [key: string]: number } = {};
const timer = setInterval(() => {
if (!currentTurn()) {
queue = [];
votes = {};
writeQueue([]);... | address |
401 | import { ethers, Signer } from "ethers";
import { useContractCall, useContractFunction, useEthers, TransactionOptions } from "@usedapp/core";
// import { Contract } from "@ethersproject/contracts";
import simpleContractAbi from "../abi/SimpleContract.json";
import { simpleContractAddress } from "../contracts";
import {... | contractWithSigner |
402 | import { IDoublePinYinType } from "./interface";
import pinyin from "pinyin";
export function GenerateCharDPCode(character: string, method: IDoublePinYinType): Array<String> {
// 生成字符所使用的双拼编码
const pronounce = pinyin(character, { style: pinyin.STYLE_NORMAL })[0][0]
const initial = "bpmfdtnlghkjqxzcsryw"
... | encodedChar |
403 | import { MiddlewareConsumer, Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import { MongooseModule } from '@nestjs/mongoose';
import { AuthMiddleware } from './middleware';
import { GlobalModule } from './module/global/global.module';
import { He... | consumer |
404 | import { app, sequelize } from "../express";
import request from "supertest";
describe("E2E test for product", () => {
beforeEach(async () => {
await sequelize.sync({ force: true });
});
afterAll(async () => {
await sequelize.close();
});
it("should create a product", async () => ... | response2 |
405 | /*
Copyright 2023 <NAME>.
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
distributed... | completedElements |
406 | import { Component, OnInit, OnDestroy } from "@angular/core";
import { BehaviorSubject, Subscription } from "rxjs";
import { BlogPost } from "src/app/objects/Post";
import { PostsService } from "src/app/services/posts-service.service";
@Component({
selector: "app-index",
templateUrl: "index.component.html"
})
expo... | latestPosts |
407 | import { defineConfig, fontProviders } from 'astro/config'
import icon from 'astro-icon'
import sitemap from '@astrojs/sitemap'
import tailwindcss from '@tailwindcss/vite'
// https://astro.build/config
export default defineConfig({
site: 'https://blog.aozaki.cc',
output: 'static',
integrations: [
icon(),... | blocked |
408 | import * as vscode from "vscode";
import MarkdownIt from "markdown-it";
import Prism from "prismjs";
import components from "prismjs/components";
import "prismjs/components/prism-http";
import "prismjs/components/prism-json";
import "prismjs/components/prism-bash";
import "prismjs/components/prism-yaml";
import adobeM... | highlightedCode |
409 | import { glob } from "glob";
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import simpleGit from "simple-git";
import type { DocFile } from "./types";
// Clone the repo to a tmp file and read docs files.
export async function loadDocsFromGitHub(): Promise<DocFile[]> {... | MARKDOWN_GLOB_PATTERN |
410 | // NOTE: Use me to get the nonces for deterministic deployments. A wallet needs nonces on all chains equal to get the same deployment address on each
import { task } from "hardhat/config";
import { createAlchemyWeb3 } from "@alch/alchemy-web3"
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
task("wall... | resultArr |
411 | import { ValidationResult } from '../lib/result';
import { AsyncValidation, InferValidations, KeyOf, SyncValidation, Validation, ValidationMetadata, Validator } from '../lib/types';
export function expectResultValid(result: ValidationResult): void {
expect(result.isValid).toBe(true);
}
export function expectResultI... | expected |
412 | import { ethers, AbiCoder, BigNumberish } from 'ethers';
import 'dotenv/config';
import fs from "fs";
import path from "path"
import * as Interfaces from "./interface";
// 必要なパラメーター
const rpcUrl = "https://polygon-mumbai.gateway.tenderly.co"
const provider = new ethers.JsonRpcProvider(rpcUrl);
const ownerPrivateKey =... | recipientOrderDetailEncoded |
413 | import {Service, PlatformAccessory, CharacteristicValue} from 'homebridge';
import {RitualsGeniePlatform} from './platform';
export class FanAccessory {
private service: Service;
constructor(
private readonly platform: RitualsGeniePlatform,
private readonly accessory: PlatformAccessory,
... | isOn |
414 | // The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import { onirobuilderBuild, onirobuilderSign } from './utils/onirobuilder';
import { startEmulator, stopEmulator, attemptHdcConnection } from './... | installDisposable |
415 | // 这里定义了静态文件路径的位置
import { join } from 'path'
import config from '@config/index'
import { app } from 'electron'
const env = app.isPackaged ? 'production': 'development'
const filePath = {
winURL: {
development: `http://localhost:${process.env.PORT}`,
production: `file://${join(app.getAppPath(), "dist", "ele... | fileName |
416 | import { ImapFlow, ImapFlowOptions } from "imapflow";
import moment from "moment";
import cliProgress from 'cli-progress';
/** Contains environment variables for an IMAP account. */
interface Env {
IMAP_USERNAME: string;
IMAP_PASSWORD: string;
IMAP_HOST: string;
IMAP_PORT: string;
IMAP_SECURITY: st... | estimatedTotalEmails |
417 | //create a function shoppinglist
function ShoppingList(){
//this.groceries = ['pineapple'];
this.groceries = [];
}
//if we want to create a public list object,
//we create a prototype
ShoppingList.prototype.addItem = function (item){
//refrence th earray above
this.groceries = this.groceries.concat([item]);
... | grocery |
418 | import { BulkstatAnalyzer } from "./BulkstatAnalyzer";
import { BulkstatConfig } from "./BulkstatConfig";
import { BulkLineIdentifier } from "./BulkstatLine";
import { StatRecords } from "./BulkstatReader";
import { BulkstatSchema } from "./BulkstatSchema";
interface LinePointer {
line: string;
pos: number;
}
... | needMoreInfo |
419 | import {Aurelia} from 'aurelia-framework';
import * as environment from '../config/environment.json';
import {PLATFORM} from 'aurelia-pal';
import {I18N, TCustomAttribute} from 'aurelia-i18n';
import { HttpClient } from 'aurelia-fetch-client';
import Backend from 'i18next-xhr-backend';
import 'bootstrap/dist/css/bootst... | aliases |
420 | import {
HttpEvent,
HttpHandler,
HttpInterceptor,
HttpRequest,
} from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Auth } from 'aws-amplify';
import { from, Observable } from 'rxjs';
import { catchError, switchMap } from 'rxjs/operators';
import { environment } from '../../../env... | with_auth_request |
421 | import { Database, NewUser, UpdateUser, User } from '../schema';
import { db } from '../client';
export class UserRepository {
private static instance: UserRepository | null = null;
public static getInstance(): UserRepository {
if (!UserRepository.instance) {
UserRepository.instance = new ... | lastSync |
422 | import { CHAIN_INFO_REQUEST } from 'types/chain';
type RefineFunction = (str: string) => string;
const csvToArray = (csv: string = '', [MASK] : RefineFunction = (x) => x) => {
const arr = csv
.split(',')
.filter((x) => x)
.map( [MASK] );
return [...new Set(arr)];
};
export const ChainNames = csvToAr... | refine |
423 | import * as luxon from "luxon";
import { DateTimePickerComponent } from "../../DateTimePickerComponent";
import { BaseComponent } from "./../BaseComponent";
import { DayButton } from "./DayButton";
import { BeforeConfirmedEvent } from "../../Events/BeforeConfirmedEvent";
import { MonthButton } from "./MonthButton";
imp... | newDateTime |
424 | import { WebSocketConnection } from './communication/WebSocketConnection';
import { Connection } from './interfaces/Connection';
import { ErrorListener } from './interfaces/ErrorListener';
import { Logger } from './utils/Logger';
import { WebSocketBridgeCommunication } from './communication/WebSocketBridgeCommunication... | closeEvent |
425 | import { mineBlock, calculateBlockReward } from '../mining';
import { Block } from '../../types/block';
import { getLatestBlock } from '../chain';
import { isCoinbaseTransaction } from '../../transaction/coinbase';
// Mock wallet data for testing
const MOCK_MINER_ADDRESS = 'test-miner-address';
const MOCK_MINER_PUBLIC... | firstTx |
426 | /**
* @fileoverview Checks for cda tracking codes
*/
import { HintContext } from 'hint/dist/src/lib/hint-context';
// The list of types depends on the events you want to capture.
import { IHint, ElementFound } from 'hint/dist/src/lib/types';
import { debug as d } from 'hint/dist/src/lib/utils/debug';
import meta fr... | validateElement |
427 | import { abi, address } from "@/utils/contract/articles";
import { ethers } from "ethers";
import { defineStore } from 'pinia';
const KEY = 'LAST_ACTIVE_ACCOUNT';
const provider = new ethers.providers.Web3Provider(window.ethereum);
/**
* 模型平台页面
*/
const useWallet = defineStore({
id: 'wallet',
state: () => ({
... | arr |
428 | import packageInfo from '../package.json';
import { LitElement, TemplateResult, css, html } from 'lit';
import { property } from 'lit/decorators.js';
import { StyleInfo, styleMap } from 'lit/directives/style-map.js';
import { HomeAssistant } from 'custom-card-helpers';
import { renderTemplate } from 'ha-nunjucks';
im... | isColumn |
429 | import { bnToBn, calcSi, formatDecimal, isBoolean } from '@polkadot/util';
import { SiDef, ToBn } from '@polkadot/util/types';
import { SI, SI_MID } from '@polkadot/util/format/si';
import { BN } from '@polkadot/util/bn';
import React from 'react';
import { stripNonDigits } from '../../utils';
const defaultDecimals =... | units |
430 | import { ethers } from 'hardhat';
import * as deploy from '../src/deploy';
async function main() {
if ((await ethers.provider.getCode(deploy.CREATE2_FACTORY_ADDRESS)) === '0x') {
throw new Error(
`CREATE2 factory at ${deploy.CREATE2_FACTORY_ADDRESS} is not deployed. Please refer to https://github.com/Arac... | api3PartialAggregatorV2V3InterfaceAddress |
431 | import express, { Request, Response, NextFunction } from "express"
import bodyParser from "body-parser"
import knex from "knex"
import {
User,
Group,
Session,
requireLogin,
requireSession,
requireAnyGroup,
requireAllGroups,
requireCondition,
UserInvalidError,
UserAuthenticationError,
SessionInval... | adminGroup |
432 | import { Legislation, User, Politician } from '../Core';
import * as P from 'ts-prime';
import * as z from 'zod'
export namespace Score {
////////////////////////////////////////////////////////////////////
function calculateLegislationScore(
{ _iMaxMembers, iDecisionTreshold, iFor, iAgainst, iAbstaine... | votingInfo |
433 | import axios from 'axios'
import type { Method, AxiosRequestConfig } from 'axios'
import { useUserStore } from '@/store'
import globalConfig from '@/config'
import { ElMessage } from 'element-plus'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: globalConfig.requestURL,
/... | reqData |
434 | import NextAuth from "next-auth"
import Providers from "next-auth/providers"
import { NextApiRequest, NextApiResponse } from "next";
const scopes = [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/contacts.readonly'
];
const... | token |
435 | import { Injectable } from '@nestjs/common';
//import carbone from 'carbone'; does not work, returns undefined
import { Response } from 'express';
const carbone = require('carbone');
@Injectable()
export class AppService {
//constructor(private readonly carbone) {}
getHello(): string {
return 'Hello World!';... | err |
436 | /* eslint-disable @typescript-eslint/no-unused-expressions */
import { expect } from "@open-wc/testing";
import { Insert, Remove, Update } from "./editv1.js";
import { convertEdit } from "./convertEdit.js";
import { SetAttributes } from "./editv2.js";
const doc = new DOMParser().parseFromString(
'<SCL><Substation ... | editsV2 |
437 | import {AppInitOptionCacheKey} from "@/common/const"
/**
* uploadCos.
* 上传到七牛云
* @param {any} qiniuInfo 七牛云预生成的信息
* @param {String} filePath 文件的临时路径
* @returns {Promise<any>}
*/
export function uploadQiniu(qiniuInfo: utilsType.qiniuInfo, filePath: string) {
return new Promise(async (resolve, reject... | timeString |
438 | const components = [
{
type: 1,
components: [
{
type: 2,
custom_id: 'ac',
label: 'AC',
style: 4
},
{
type: 2,
custom_id: '(',
label: '(',
... | row |
439 | import { ApiService } from './services/api.service';
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import * as moment from 'moment';
import { stringify } from '@angular/compiler/src/util';
import { LandingRouteService } from './services/landingRoute/landing-r... | lang |
440 | /// --- Play@https://export-wbozohsohz.now.sh ---
/// --- Imports ---
//#region
import { loadPatches, RegrowSystem } from "./modules/sweetcorn";
import {
WindmillBladeData,
WindmillBladeRotateSystem
} from "./modules/windmill";
import {
balloonMagentaTargets,
balloonCyanTargets,
balloonOrangeTargets,
Ball... | point1 |
441 | import type {
PerformanceMetrics,
PerformanceEntryType,
Status,
PerformanceEntryHandler,
ResourceTiming,
PerformanceLongTaskTiming,
PerformanceEntry,
NavigationTiming,
LayoutShiftEntry,
FirstInputEntry,
PaintEntry,
LargestContentfulPaintEntry,
LongTaskEntry
} from '../types'
import { checkApi... | time |
442 | import { Request, Response, ErrorRequestHandler, NextFunction } from 'express';
import * as HttpStatus from 'http-status';
import * as jwt from 'jwt-simple';
import * as bcrypt from 'bcrypt';
const config = require('../../config/env/config')();
class Handlers {
authFail(req: Request, res: Response) {
res.... | isMatch |
443 | import { Injectable } from '@angular/core';
import { HttpHeaders, HttpClient } from '@angular/common/http';
import { CookieService } from 'ngx-cookie-service';
import { FilteredInfo } from '../Model/FilteredInfo';
import { languages } from '../Model/language';
@Injectable()
export class RestCallService {
defaultHead... | filteredInfo |
444 | // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
import {Construct} from 'constructs';
import * as route53 from 'aws-cdk-lib/aws-route53';
import * as ec2 from 'aws-cdk-lib/aws-ec2'
import * as iam from 'aws-cdk-lib/aws-iam'
import * as rds from 'aws-cdk-lib/aws-r... | dbImportedSecurityGroupAlbAuth |
445 | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | userModel |
446 |
// This is a Cloud Script function. "args" is set to the value of the "FunctionParameter"
// parameter of the ExecuteCloudScript API.
// (https://api.playfab.com/Documentation/Client/method/ExecuteCloudScript)
// "context" contains additional information when the Cloud Script function is called from a PlayStream acti... | curDate |
447 | /**
*
* Copyright 2023 Beijing Volcano Engine Technology Ltd.
* Copyright 2023 Guangzhou Laboratory
*
* 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/lice... | encodedKey |
448 | import axios from 'axios';
import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
import { ApiError } from 'types/Api';
import qs from 'qs';
import { AppConfig } from 'AppConfig';
axios.defaults.headers.common['Content-Type'] = 'application/json; charset=utf-8';
export class ApiBase {
public stati... | apiError |
449 | import { useWindowSize } from "@vueuse/core";
import { computed } from "vue";
type Breakpoint = "2xl" | "xl" | "lg" | "md" | "sm" | "xs";
const breakpointSizes: Record<Breakpoint, number> = {
"2xl": 1536,
xl: 1280,
lg: 1024,
md: 768,
sm: 640,
xs: 0,
};
export function useScreenSize() {
const { width } = useWin... | smaller |
450 | import './styles/pyscript_base.css';
import { loadConfigFromElement } from './pyconfig';
import type { AppConfig } from './pyconfig';
import type { Runtime } from './runtime';
import { PyScript, initHandlers, mountElements } from './components/pyscript';
import { PyLoader } from './components/pyloader';
import { Pyodi... | runtime_cfg |
451 | import { Injectable, NotFoundException } from '@nestjs/common';
import { Category } from 'src/entities/category.entity';
import { CreateCategoryDto, UpdateCategoryDto } from 'src/dto/category.dto';
@Injectable()
export class CategoriesService {
private counterId = 1;
private categories: Category[] = [
{
... | categoryIndex |
452 | import { Registry } from 'promjs/registry';
export enum GoldenMetrics {
AppLoaded = 'prom_react_app_loaded',
AppUnloaded = 'prom_react_app_unloaded',
PageNavigation = 'prom_react_navigation_duration_seconds',
PageTimeToComplete = 'prom_react_ttc_seconds',
PageTimeToUsable = 'prom_react_ttu_seconds',
Perfor... | customMetrics |
453 | import {MethodMetadata} from "@pristine-ts/metadata";
import {MetadataEnum} from "../enums/metadata.enum";
import {toolsRegistry} from "../decorators/tool.decorator";
import {JsonSchemaUtils} from "../utils/json-schema.utils";
import {ToolOptions} from "../options/tool.options";
export class PromptApiToolSchemaBuilder... | toolMetadata |
454 | // npm i @types/k6 --> k6 run src/script.ts
// sudo npm i -g pm2 --> pm2 start script.ts --interpreter ts-node -i max --> It Means we are running max number of cors of our machine
import http from 'k6/http';
import { sleep } from 'k6';
import { Rate } from 'k6/metrics';
export let errorRate = new Rate('error');
expor... | success |
455 | import cors from 'cors';
import express, { Application, Request, Response } from 'express';
import http from 'http';
import helmet from 'helmet';
import 'dotenv/config';
import swaggerUi from 'swagger-ui-express';
import database from './database';
import swaggerDocument from '../swagger.json';
import registerR... | corsOptions |
456 | import { Product } from "../domain/Product";
import { ProductRepository } from "../domain/Product.repository";
import { RemoteProduct, StoreApi } from "./api/StoreApi";
function buildProduct(remoteProduct: RemoteProduct): Product {
return Product.create({
id: remoteProduct.id,
title: remoteProduct.... | remoteProducts |
457 | import { useHighlightStore } from '@application/store/highlight';
import { ZIndexes } from '@presentation/styles/variables';
import { useCallback } from 'react';
export function useHighLight(): any {
const isHighlight = useHighlightStore((state) => state.highlight);
const setIsHighlight = useHighlightStore((state)... | rect2 |
458 | import * as Icon from '~/components/Icon'
export type Route = {
pathname?: string,
title: string,
sidebar: boolean,
id?: string,
display?: boolean,
desc?: string,
Icon?: JSX.Element | (() => JSX.Element),
}
export type Routes = {
title: string,
display?: boolean,
children: Route[],
}
export const... | acc |
459 | // Copyright (c) Myst<NAME>, Inc.
// SPDX-License-Identifier: Apache-2.0
import { fromB64 } from '@mysten/bcs';
import { Ed25519Keypair } from './ed25519-keypair';
import { PublicKey } from './publickey';
import { Secp256k1Keypair } from './secp256k1-keypair';
import { SignatureScheme } from './signature';
export con... | secretKey |
460 | import { Component, Input, OnInit } from '@angular/core';
import { FetchClient } from '@c8y/ngx-components/api';
import * as L from 'leaflet';
//require("./cluster.css");
@Component({
selector: 'clustered-map',
templateUrl: './cluster.html'/*,
styleUrls: ['./cluster.css']*/
})
export class ClusteredMap im... | size |
461 | import { Command } from 'discord-akairo';
import { MessageEmbed, Message } from 'discord.js';
import StryxClient from '../../src/client';
function Eightball() {
const [MASK] = [
'As I see it, yes.',
'Ask again later.',
'Better not tell you now.',
'Cannot predict now.',
'Concentrate and ask agai... | responses |
462 | import { defineNuxtModule, extendRouteRules } from "@nuxt/kit";
import { consola } from "consola";
import { HTTPStatusCode } from "./types";
interface Redirect {
origin: string;
destination: string;
statusCode: HTTPStatusCode;
}
// Module options TypeScript interface definition
export interface ModuleOptions {
... | moduleOptions |
463 | import { test } from "@playwright/test";
import { LoginPage } from "./page-objects/login.page";
import { DashboardPage } from "./page-objects/dashboard.page";
import { CartPage } from "./page-objects/cart.page";
import { OverviewPage,
YourInformationPage,
CompletePage } ... | testData |
464 | import axios, { AxiosInstance, AxiosResponse } from 'axios';
import AxiosHttpClient from './AxiosHttpClient';
jest.mock('axios');
describe('AxiosHttpClient', () => {
let axiosHttpClient: AxiosHttpClient;
let mockAxiosInstance: jest.Mocked<AxiosInstance>;
beforeEach(() => {
mockAxiosInstance = {
get: ... | mockResponse |
465 | import { Speckle, SpeckleBaseObject, SpeckleObject } from '@strategies/speckle';
import { Entity } from "../../stores/Entities";
export const APP_NAME = process.env.REACT_APP_SPECKLE_NAME
export const TOKEN = `${APP_NAME}.AuthToken`
export const REFRESH_TOKEN = `${APP_NAME}.RefreshToken`
export const CHALLENGE = `${AP... | commitId |
466 | import { MailingTemplate } from '@theroyalwhee0/mailtpl';
import mkdirp from 'mkdirp';
import fs from 'node:fs/promises';
import path from 'node:path';
import { ITemplateWriter } from '../writer';
const dotHtml = '.html';
const dotText = '.txt';
export type FileWriterOptions = {
folder: string,
html?: string,... | template |
467 | import * as extend from "extend";
import * as moment from "moment";
interface DataType {
db: string;
serialize(value: any): Promise<any>;
deserialize(value: any): Promise<any>;
}
interface Serializable {
serialize(): Promise<string>;
}
interface SerializableClass<T extends Serializable> {
new (): T;
dese... | isFloat |
468 | import type { FastifyInstance } from "fastify";
import { basename } from "path";
import Surreal from "surrealdb.js";
interface Body {
username: string;
result: {
player: number;
opponent: number;
};
board: {
width: number;
height: number;
};
}
interface Querystring {
username?: string;
}
interface Matc... | failedChecks |
469 | import { QueryResponse } from './types';
import { Observable, merge, of} from 'rxjs';
import { delay } from 'rxjs/operators';
import { NodeGraphDataFrameFieldNames } from '@grafana/ui';
import {
DataQueryRequest,
DataQueryResponse,
DataSourceApi,
DataSourceInstanceSettings,
FieldColorModeId,
FieldType,
Mu... | actualValues |
470 | import { Component } from '@angular/core';
import { RastMobileService } from '../../services/rast-mobile.service';
import { todoItem } from '../models/todoItem';
declare var $: any; // jQuery'yi kullanabilmek için deklarasyon ekleyin
@Component({
selector: 'app-table',
templateUrl: './table.component.html',
styl... | newItem |
471 | import { removeListMusics, updateListMusicPosition, updateListMusics } from '@/core/list'
import { playList, playNext } from '@/core/player/player'
import { addTempPlayList } from '@/core/player/tempPlayList'
import settingState from '@/store/setting/state'
import { similar, sortInsert, toOldMusicInfo } from '@/utils'
... | downloadDir |
472 | import { ApplicationRef, ElementRef, Inject, Injectable } from '@angular/core';
import { Palettes, PaletteValues, ThemingExtraOptions, ThemingOptions, DEFAULT_THEMING_OPTIONS } from './definitions';
import { PaletteValuesType } from './definitions';
import { deepCopy } from './utils';
import { ThemingUtil } from './uti... | defaultPalettes |
473 | // The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
let handle_selection = (editor: vscode.TextEditor, builder: vscode.TextEditorEdit, selection: vscode.Selection, content: string) => {
let st... | this_line |
474 | import { adviceService } from 'Services/advice.service';
import { Command } from 'Utils/command';
import { ClientUser, CommandInteraction, MessageEmbed } from 'discord.js';
import { Discord, Slash, SlashOption } from 'discordx';
@Discord()
export abstract class Advice extends Command {
constructor() {
super();
... | adviceString |
475 | import {
MiddlewareConsumer,
Module,
NestModule,
RequestMethod,
} from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { OpenaiModule } from './module/openai/openai.module';
import { MiningModule } from './module/mining/mining.module';
impor... | configService |
476 | // Experimental API below
/**
* get input values
*
* Extended by: <NAME> <<EMAIL>>
* Now gets values of inputs (including "checked" status radios, checkboxes), textareas and selects (including multiselects)
* Tries to identify the elements as exact as possible, falls back to numeric index when identification fail... | inputType |
477 | "use strict";
type Comparison = -1 | 0 | 1;
class BadBignum {
private static readonly assertions: boolean = true;
public static readonly zero: BadBignum = new BadBignum('0');
public static readonly one: BadBignum = new BadBignum('1');
private readonly number: string;
constructor(num: string) {
... | cond |
478 | export enum WindowSizes {
"xs",
"sm",
"md",
"lg",
"xl",
"2xl",
}
export type WindowSizeEnumKeys = keyof typeof WindowSizes;
export function getGridColCount(windowSize: WindowSizeEnumKeys) {
return {
xs: 2,
sm: 2,
md: 2,
lg: 3,
xl: 4,
"2xl": 5,
}[windowSize];
}
export const MAX_... | metricSize |
479 | import { useFetchMindMap, useFetchRelatedQuestions } from '@/hooks/chat-hooks';
import { useTestChunkRetrieval } from '@/hooks/knowledge-hooks';
import {
useGetPaginationWithRouter,
useSendMessageWithSse,
} from '@/hooks/logic-hooks';
import { IAnswer } from '@/interfaces/database/chat';
import api from '@/utils/ap... | documentIds |
480 | import * as Bluebird from 'bluebird';
import { spawn } from 'child_process';
import config from '../config';
import * as sdk from 'etcher-sdk';
import { forEach, isEmpty, isObject } from 'lodash';
import * as mdns from 'multicast-dns';
import { networkInterfaces } from 'os';
function cleanObject(object: Dictionary<any... | socks |
481 |
import {Request, Response} from 'express';
import {USERS} from "./db-data";
import {setTimeout} from "timers";
export function searchUsers(req: Request, res: Response) {
const [MASK] = req.query;
const filter = [MASK] .filter || '',
sortOrder = [MASK] .sortOrder,
pageNumber = par... | queryParams |
482 | /*
* Copyright 2015-present Acrolinx GmbH
*
* 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 ... | endDomPosition |
483 | import { defineStore, storeToRefs } from 'pinia';
import { api } from 'src/boot/axios';
import { Notify } from 'quasar';
import { Mutex } from 'async-mutex';
import { _ } from 'lodash';
import { parse as ansiParse } from 'ansicolor';
import { generateErrorNotification } from './common';
import { useSettingsStore } from... | status_new |
484 | // browser-storage.ts
// Define the type for localSettings
interface LocalSettings {
isSidebarPinned: boolean;
lastAccountId?: string;
}
// Map keys to their corresponding types
interface StorageSchema {
localSettings: LocalSettings;
}
// Type alias for the keys of the storage schema
type StorageKey = keyof Stora... | currentValue |
485 | import { Protocol, AnsonBody, PageInf, AnsonResp, AnsonMsg, Semantier, NV, relStree,
SessionClient, AnTreeNode, StreeTier, Tierec, OnLoadOk} from '@anclient/semantier';
import { Comprops, CrudComp, PhotoCollect, GalleryView, PhotoProps, PhotoRec, AlbumReq, AlbumPage, AlbumResp
} from '@anclient/anreact';
const debug ... | idx |
486 | import { TemplateFormat } from '../types';
import yaml from 'yaml';
import { generateStackTemplate } from '../stack/deploy';
import { getIacLocation, logger, setContext } from '../common';
import { parseYaml } from '../parser';
export const template = (
stackName: string,
options: { format: TemplateFormat; locatio... | iac |
487 | import { useDispatch, useSelector } from 'react-redux';
import type { RootState, AppDispatch } from './store';
import { useState, useEffect, Dispatch, SetStateAction } from 'react';
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch = useDispatch.withTypes<AppDispat... | root |
488 | import express from 'express';
import http from 'http';
import {Server} from "socket.io";
import cors from 'cors';
import webpush from 'web-push';
import dotenv from 'dotenv';
import {SocketMessage, Subscription} from "./types";
import {
enqueueMessage, MessageQueue,
updateDestination
} from "./messaging";
import {... | server |
489 | import ComponentPo from '@/cypress/e2e/po/components/component.po';
export default class LabeledSelectPo extends ComponentPo {
toggle() {
return this.self().click();
}
clickOption( [MASK] : number) {
return this.self().get(`.vs__dropdown-menu .vs__dropdown-option:nth-child(${ [MASK] })`).click();
}
... | optionIndex |
490 | type Vertex = string;
type Weight = number;
export class CourseGraph {
private adjacencyList: Map<Vertex, Map<Vertex, Weight>>;
constructor() {
this.adjacencyList = new Map();
}
addVertex(vertex: Vertex): void {
if (!this.adjacencyList.has(vertex)) {
this.adjacencyList.set... | weight |
491 | import { inject, TestBed } from '@angular/core/testing';
import { UserService } from './user.service';
import { MockBackend, MockConnection } from '@angular/http/testing';
// Make sure to include the Response object from '@angular/http'
import { BaseRequestOptions, Http, RequestMethod, Response, ResponseOptions } from... | backendInstance |
492 | import { Request as IttyRequest } from 'itty-router'
import { getActivationBlock } from '../../lib/citycoins'
import { createResponse } from '../../lib/common'
import { CityConfig, getCityConfig } from '../../types/cities'
import { SingleValue } from '../../types/common'
const GetActivationBlock = async (request: Itty... | activationBlock |
493 | import {Component, OnInit, signal} from '@angular/core';
import {AsyncPipe, DatePipe, NgForOf, NgIf} from '@angular/common';
import {GoogleAuthService} from '../google-auth-service';
import {gapi} from 'gapi-script';
import {ReportComponent} from '../report/report.component';
@Component({
selector: 'app-agenda',
s... | dateString |
494 | import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Router } from '@angular/router';
import { TokenApi } from '../interfaces/token-api';
import { Subject } from 'rxjs';
@Injectable({
providedI... | tokenApi |
495 | import { DocumentReference } from '@google-cloud/firestore';
import { readFileSync } from 'fs';
import { parse } from 'node-xlsx';
import { Channel, Ics217 } from './ics217.js';
export function getRegionAndDistrict(filename: string): {
region: string;
district: string;
} {
let region = null;
const regionMatch... | acc |
496 | import { AddressBook } from '../../domain/entities/AddressBook';
import { IAddressBookRepository } from '../../domain/interfaces/IAddressBookRepository';
export class AddressBookService {
constructor(private repository: IAddressBookRepository) {}
getAddresses(): AddressBook[] {
return this.repository.getAll()... | existingAddressBook |
497 | /// <reference path="../vendor/vendor.d.ts" />
/// Copyright 2014 Red Hat, 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
... | $location |
498 | const BYTE_UNITS: string[] = [
"B",
"kB",
"MB",
"GB",
"TB",
"PB",
"EB",
"ZB",
"YB",
];
const BI_BYTE_UNITS: string[] = [
"B",
"KiB",
"MiB",
"GiB",
"TiB",
"PiB",
"EiB",
"ZiB",
"YiB",
];
const BIT_UNITS: string[] = [
"b",
"kbit",
"Mbit",
"Gbit",
"Tbit",
"Pbit",
"Ebit",
"Zbit",
"Ybit",
];
con... | separator |
499 | import { Request, Response, NextFunction } from 'express';
// Handle image request
// POST : api/fetchimages
// PROTECTED
import "dotenv/config";
import { IFSBot, Midjourney, IFS } from "../src";
interface IncomingRequest {
rid: string,
}
function createIFSClient() {
// Configuration for the IFS client
const cl... | resolve |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.