text stringlengths 3 1.05M |
|---|
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Decomposed printf argument list.
Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2019 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU... |
const express = require('express')
const bodyparser = require('body-parser')
const app = express()
app.get('/', (req, res) => {
res.send({
status: 200,
message: 'success',
data: [
{
status: 'oke'
}
]
})
})
app.listen(3000, () => {
con... |
from codecs import open
from os import path
from setuptools import setup, find_packages
from subprocess import check_output
import sphinx_markdown_parser
here = path.abspath(path.dirname(__file__))
check_output(
'pandoc --from=markdown --to=rst --output=' +
path.join(here, 'README.rst') + ' ' + path.join(here... |
(function(){dust.register("accordion",body_0);function body_0(chk,ctx){return chk.write("<!-- { id: \"string\", sections: [ {id: \"string\", title: \"string\", content: \"string\"} ] }--> <div class=\"accordion\" id=\"").reference(ctx.get("id"),ctx,"h").write("\"> ").section(ctx.get("sections"),ctx,{... |
from irekua_database.models import DeviceBrand
from .utils import BaseFilter
search_fields = (
'name',
)
class Filter(BaseFilter):
class Meta:
model = DeviceBrand
fields = ('name', )
|
import axios from "axios";
export const getCurrencies = () => async dispatch => {
dispatch({ type: "GET_CURRENCIES_BEGIN" });
return axios
.get("/api/v1/currencies", {
headers: { Authorization: `Bearer ${localStorage.getItem("token")}` }
})
.then(res =>
dispatch({ type: "GET_CURRENCIES_SUCC... |
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const releaseNotesPath = path.resolve(__dirname, '../RELEASENOTES.md');
const releaseNotes = fs.readFileSync(releaseNotesPath, 'utf8');
const hasBreakingChanges = /## Breaking Changes/.test(releaseNotes);
const hasNoEnhanceme... |
from src.model.Mouvement import Mouvement
class ItemCase:
"""ItemCase : Un élément dans la grille"""
x: int
y: int
def __init__(self, x: int, y: int):
"""
:param x: position x
:param y: position y
:param grille: la grille de cette item
"""
# vérificat... |
/**
* Copyright 2020, Massachusetts Institute of Technology,
* Cambridge, MA 02139
* All Rights Reserved
* Authors: Jingnan Shi, et al. (see THANKS for the full author list)
* See LICENSE for the license information
*/
#pragma once
#include <memory>
#include <vector>
#include <tuple>
#include <Eigen/Core>
#inc... |
module.exports = {
displayName: 'shared-hooks',
preset: '../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json'
}
},
transform: {
'^.+\\.[tj]sx?$': 'ts-jest'
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
cover... |
const router = require('express').Router();
const { User, Post, Vote, Comment } = require('../../models');
const withAuth = require('../../utils/auth');
//GET /api/users
router.get('/', (req, res) => {
//Access our user model and run .findAll() method)
User.findAll({
attributes: { exclude: ['password'... |
const getters = {
sidebar: state => state.app.sidebar,
language: state => state.app.language,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
introd... |
/*
Copyright 2019 Adobe. All rights reserved.
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 applicable law or agre... |
# -*- coding: utf-8 -*-
from math import inf
from tools import printSolution
def RechercheExhaustive(k, V, S, display=True):
""" int x list[int] x int x bool -> int x list[int]
returns the optimum number of jars as a whole
as obtained by the exhaustive search algorithm
"""
# n: int
n = RechercheExhaustiveRec(k, ... |
from typing import Mapping, Text
import faust
class RequestTransfer(faust.Record):
src_account: str
dst_account: str
quantity: int
class BalanceUpdate(faust.Record):
account: str
quantity: int
timestamp_committed: str
def balances_str(balances: Mapping[Text, int]) -> Text:
return ', '... |
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... |
/*
* Copyright (c) 2016-2018, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* 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/... |
const express = require('express');
const ejs = require('ejs');
const path = require('path');
const app = express();
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const session = require('express-session');
const MongoStore = require('connect-mongo')(session);
const MongoDBURI = proc... |
/**
* @name exports
* @summary ExplanationOfBenefitBenefitBalanceFinancial Class
*/
module.exports = class ExplanationOfBenefitBenefitBalanceFinancial {
constructor(opts) {
// Create an object to store all props
Object.defineProperty(this, '__data', { value: {} });
// Define getters and setters as enumerable... |
// Import MySQL connection.
const connection = require("../config/connection.js");
// Helper function for SQL syntax.
// Let's say we want to pass 3 values into the mySQL query.
// In order to write the query, we need 3 question marks.
// The above helper function loops through and creates an array of question marks - ... |
from cspace.util.settings import LocalSettings, AppSettings
SETTINGS_VERSION = 3
_localSettings = None
def localSettings() :
global _localSettings
if _localSettings is None :
_localSettings = LocalSettings( 'CSpace' )
return _localSettings
_profileSettings = None
def profileSettings()... |
const cheerio = require('cheerio');
const request = require('request');
const fs = require('fs');
request('https://nordvpn.com/ovpn/', (err, res, html) => {
let $ = cheerio.load(html);
let servers = [];
$('body > div.Article > div > div > div > div > div > ul').find('span.mr-2').each((i, e) => {
if... |
import CloseButtonComponent from "./CloseButton";
export default CloseButtonComponent;
|
# coding=utf-8
import sys
from asdl.asdl_ast import RealizedField, AbstractSyntaxTree
# from https://stackoverflow.com/questions/15357422/python-determine-if-a-string-should-be-converted-into-int-or-float
def isfloat(x):
try:
a = float(x)
except ValueError:
return False
else:
ret... |
#!/usr/bin/env python3
# Copyright (c) 2019 The PIPO Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Covers the scenario of a valid PoS block with a valid coinstake transaction where the
coinstake input prevout... |
#------------------------------------------------------------
# SEGMENT, RECOGNIZE and COUNT fingers from a single frame
#------------------------------------------------------------
# organize imports
import cv2
import imutils
import numpy as np
from sklearn.metrics import pairwise
#---------------------------------... |
# -*- coding: utf-8 -*-
# Copyright 2014-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2015 Alexis de Lattre <https://github.com/alexis-via>
# Copyright 2016-2017 Stanislav Krotov <https://it-projects.info/team/ufaks>
# Copyright 2016 Florent Thomas <https://it-projects.info/team/flotho>
#... |
#!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtknumpytoimage.py,v $
## Language: Python
## Date: June 10, 2017
## Version: 1.4
## Copyright (c) Richard Izzo, Luca Antiga, David Steinman. All rights reserved.
## See LICENSE file for details.
## This software is distributed WITHOU... |
/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
mpz.h
Abstract:
<abstract>
Author:
Leonardo de Moura (leonardo) 2010-06-17.
Revision History:
--*/
#ifndef MPZ_H_
#define MPZ_H_
#include<string>
#include "util/util.h"
#include "util/small_object_allocator.h"
#include "util/trace.h"
#inclu... |
#!/usr/bin/env python3
# Advent of Code 2021
# Glenn G. Chappell
import sys # .stdin
import itertools # .product
import heapq # .heappop, .heappush
# ======================================================================
# HELPER FUNCTIONS
# ========================================================... |
import cherrypy
from datawake.util.exceptions import datawakeexception
from datawake.util.db import datawake_mysql
import tangelo
def is_in_session(callback):
def has_session(**kwargs):
if 'user' in cherrypy.session:
return callback(**kwargs)
tangelo.http_status(401)
tangelo.log... |
import React, { Component, PropTypes } from 'react';
class Project extends Component {
constructor(props) {
super(props);
}
render() {
const data = this.props.projectInfo;
return(
<div className="project">
<h3>PROJECTS</h3>
{data.map(... |
"""A Python module for interacting with Slack's RTM API."""
import inspect
import json
import logging
import time
from concurrent.futures.thread import ThreadPoolExecutor
from logging import Logger
from queue import Queue, Empty
from ssl import SSLContext
from threading import Lock, Event
from typing import Optional, C... |
#include "types.h"
#include "x86.h"
#include "defs.h"
#include "date.h"
#include "param.h"
#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
int
sys_fork(void)
{
return fork();
}
int
sys_exit(void)
{
exit();
return 0; // not reached
}
int
sys_wait(void)
{
return wait();
}
int
sys_kill(void)
{
int... |
const mongoose = require('mongoose')
const femaleNameSchema = new mongoose.Schema(
{
name: {
type: String
}
},
{
versionKey: false,
toJSON: {
transform: (doc, ret) => {
ret.id = doc._id
delete ret._id
delete ret.__v
return ret
}
}
}
)
cons... |
/*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:48:31 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/PrivateFrameworks/SearchUI.framework/SearchUI
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias ... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import random
import logging
from State import State
from Rules import set_shop_rules
from Location import DisableType
from ItemPool import IGNORE_LOCATION, remove_junk_items
from Item import ItemFactory, ItemInfo
from Search import Search
logger = logging.getLogger('')
class ShuffleError(RuntimeError):
pass
c... |
# Copyright 2020 Soda
# 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
#... |
/**
* Auto-generated action file for "Flat" API.
*
* Generated at: 2019-06-06T13:12:22.956Z
* Mass generator version: 1.1.0
*
* flowground :- Telekom iPaaS / flat-io-connector
* Copyright © 2019, Deutsche Telekom AG
* contact: flowground@telekom.de
*
* All files of this connector are licensed under the Apache... |
var obj = {
foo: 'bar'
}
Object.freeze(obj)
new Vue({
el: '#app',
data() {
return {
obj
}
}
})
new Vue({
data: {
a: 1
},
created: function () {
// `this` 指向 vm 实例
console.log('a is: ' + this.a)
}
}) |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'json_schema_compiler_tests',
'type': 'static_library',
'variables': {
'chromium_code': 1... |
import React from 'react';
import { FormattedMessage } from 'react-intl';
// import A from './A';
// import Img from './Img';
// import NavBar from './NavBar';
// import HeaderLink from './HeaderLink';
// import Banner from './banner.jpg';
// import messages from './messages';
import H1 from 'components/H1';
import s... |
const { browserStackErrorReporter } = requireHelper('browserstack-error-reporter');
const config = requireHelper('e2e-config');
const utils = requireHelper('e2e-utils');
requireHelper('rejection');
jasmine.getEnv().addReporter(browserStackErrorReporter);
describe('Stacked Bar Chart example-index tests', () => {
be... |
import React from 'react';
import { MdDesktopMac, MdVideoLibrary, MdColorLens } from 'react-icons/md';
import styled from 'styled-components';
import SectionTitle from './SectionTitle';
import ServicesSectionItem from './ServicesSectionItem';
const ServicesItemsStyles = styled.div`
padding: 10rem 0;
.services__all... |
#ifndef _T_defs_H_
#define _T_defs_H_
/* comment (and recompile everything) to not send time in events */
#define T_SEND_TIME
/* maximum number of arguments for the T macro */
#define T_MAX_ARGS 16
/* maximum size of a message - increase if needed */
#define T_BUFFER_MAX (1024*64)
/* size of the local cache for mes... |
// LICENSE : MIT
"use strict";
const assert = require("assert");
const path = require("path");
import { loadAvailableExtensions, getPluginConfig } from "../../src/config/plugin-loader";
import { TextLintModuleResolver } from "../../src/engine/textlint-module-resolver";
const moduleResolver = new TextLintModuleResolver... |
'''Exercício Python 43:
Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu
Índice de Massa Corporal (IMC) e mostre seu status, de acordo com a tabela abaixo:
– IMC abaixo de 18,5: Abaixo do Peso
– Entre 18,5 e 25: Peso Ideal
– 25 até 30: Sobrepeso
– 30 até 40: Obesidade
– Acima de 40: Obesi... |
/*************************************************************
*
* MathJax/localization/ru/MathML.js
*
* Copyright (c) 2009-2016 The MathJax Consortium
*
* 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 c... |
import ScrollMagic from 'scrollmagic';
import TweenMax from 'gsap';
import { Component, addPhotoParallax, forEach } from 'helpers-js';
import { Line } from 'components/line/line';
export class PrototypePage extends Component {
constructor(block) {
super(block, 'prototype-page', function() {
th... |
import operator
from functools import reduce
from django.http import JsonResponse
from django.shortcuts import render, redirect
from django.db.models import Q
from . import models
# Create your views here.
# 显示新闻列表
def show_news_list(request):
# TODO 对新闻列表进行筛选,根据用户输入的信息实现filter,比如查询 教务处 发布的所有新闻
... |
'use strict'
const Operator = require('../operator')
function OperatorT (orca, x, y, passive) {
Operator.call(this, orca, x, y, 't', passive)
this.name = 'track'
this.info = 'Reads an eastward operator with offset.'
this.ports.input.val = { x: 1, y: 0 }
this.ports.haste.len = { x: -1, y: 0 }
this.ports.... |
const { exec } = require('child_process');
dir = exec("npm audit", function (err, stdout, stderr) {
const criticalVulnerabilities = stdout.match(/\d+ critical/g)[0].match(/\d+/)[0];
const highVulnerabilities = stdout.match(/\d+ high/g)[0].match(/\d+/)[0];
const color = criticalVulnerabilities > 0 || highV... |
"""
Django settings for uas_navigator_28702 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
... |
# Generated by Django 4.0.3 on 2022-03-16 10:47
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
/*!
jQuery.Progress v0.1
(c) 2015 Steve David <http://www.steve-david.com>
MIT-style license.
*/
;(function($) {
$.fn.extend({
Progress: function(options) {
if (options && typeof(options) == 'object') {
options = $.extend({}, $.Progress.defaults, options);
}
... |
print("hello from pkg_b hello")
|
import React from "react";
import { withStyles } from "material-ui";
import PropTypes from "prop-types";
import classNames from "classnames";
import axios from "axios";
import * as moment from "moment";
const styled = Component => (style, options) => {
function StyledComponent(props) {
const { classes, className... |
import {FETCH_WEATHER} from '../actions/index';
export default function(state = [], action) {
switch (action.type) {
case FETCH_WEATHER:
//return state.concat([action.payload.data]);
return [ action.payload.data, ...state]; //ES6 syntax
}
return state;
} |
!function(){"use strict";function t(t,e){var i;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}function i(t){if(!this||this.find!==i.prototype.find)return new i(t);if(this.length=0,t)if("string"==typeof t&&(t=this.find(t)),t.nodeType||t===t.window)this.length=1,this[0]=t;else{var e=t.length;f... |
import torch
from mmcv.ops.nms import batched_nms
def multiclass_nms(multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None):
"""NMS for multi-class bboxes.
Args:
multi_bboxes (Tenso... |
import * as R from 'ramda'
import _ from 'lodash'
import { LB_LISTENEER_ACTION_POLICIES } from '@Network/constants/lb'
import { PROVIDER_MAP } from '@/constants'
import { getEnabledSwitchActions } from '@/utils/common/tableActions'
import i18n from '@/locales'
export default {
computed: {
singleActions () {
... |
from copy import copy
from itertools import product
import numpy as np
import pytest
from numpy import (
arange,
array,
common_type,
complex64,
complex128,
float32,
float64,
newaxis,
shape,
transpose,
zeros,
)
from numpy.testing import assert_array_almost_equal
import aesar... |
import Vue from 'vue'
import LandingPage from '@/components/LandingPage'
describe('LandingPage.vue', () => {
it('should render correct contents', () => {
const vm = new Vue({
el: document.createElement('div'),
render: h => h(LandingPage)
}).$mount()
expect(vm.$el.querySelector('.ti... |
# -*- coding: utf-8 -*-
import numpy
import pyximport
pyximport.install(setup_args=dict(include_dirs=numpy.get_include()))
import difference
print(difference.__file__)
difference.main()
|
//
// LYDownLoadListernMainController.h
// LYDownLoadListern
//
// Created by LiuY on 2017/11/23.
// Copyright © 2017年 DeveloperLY. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LYDownLoadListernMainController : UIViewController
@end
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Scott Anderson <scottanderson42@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: django_m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# See http://doc.qt.io/qt-5/qpushbutton.html#details
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
def on_clic():
print("Hello!")
app = QApplication(sys.argv)
# The default constructor has no parent.
# A widget with no parent is a w... |
import { stddev } from './stddev'
describe('stddev(values: number[]): number', () => {
it('should return the standard deviation of values', () => {
const values = [7, 4, 2, 1]
expect(stddev(values)).toBe(2.6457513110645907)
})
})
|
"""Run Lace to create the combined superTranscriptome"""
__author__ = "Sarah Hazell Pickering (sarah.pickering@anu.edu.au)"
__date__ = "2018-12-17"
#include: "cluster.py"
OUTPUT_DIR = "output_data/"
ST_OUTDIR = "superT"
DATASET = config["dataset"]
#configfile: "necklace.json"
rule run_lace:
version: "3.6"
... |
import logging
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
from thenewboston_node.business_logic.exceptions import ValidationError
from thenewboston_node.core.logging import validates
from thenewboston_node.core.utils.cryptography import hash_normalized_dict
from thenewb... |
import ATV from 'atvjs'
import template from './template.hbs'
import searchTpl from './search.hbs'
import noResultsTpl from './noresults.hbs'
import API from 'lib/rozhlas.js'
function buildResults(doc, searchText) {
// Create parser and new input element
var domImplementation = doc.implementation;
var lsParser = ... |
import { declare } from "@babel/helper-plugin-utils";
export default declare(api => {
api.assertVersion(7);
return {
visitor: {
NumericLiteral({ node }) {
// number octal like 0b10 or 0o70
if (node.extra && /^0[ob]/i.test(node.extra.raw)) {
node.extra = undefined;
}
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-08 21:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('migrate', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
import React, { Component } from 'react';
// import addons from '@storybook/addons';
import PropTypes from 'prop-types';
import { EVENTS } from '../constants';
import Event from './Event';
const styles = {
wrapper: {
fontFamily: `
-apple-system, ".SFNSText-Regular", "San Francisco", "Roboto",
"Sego... |
int computeArea(int A, int B, int C, int D, int E, int F, int G, int H)
{
int overup, overdown, overleft, overright;
int overarea;
overup = D < H ? D : H;
overdown = B > F ? B : F;
overleft = A > E ? A : E;
overright = C < G ? C : G;
if (overup <= overdown || overleft >= overright)
overarea = 0;
else
over... |
/**
* @module api/main
* @exports a sync function "ignore"
* @exports a sync function "configuration"
*
* @exports a sync function "after"
* @exports a sync function "before"
*
* @description
* Defines the publicly exposed API
* - ignore:
* Adds an ignore pattern (a string / RegEx) to the existing / defaul... |
#pragma once
#include <stddef.h>
#include <stdint.h>
uint32_t shoujo_init(void);
|
#include "red_black_tree.h"
#include <assert.h>
/***********************************************************************/
/* FUNCTION: RBTreeCreate */
/**/
/* INPUTS: All the inputs are names of functions. CompFunc takes two */
/* void pointers to keys and returns 1 if the first arguement is */
/* "greater than... |
from common import *
import matplotlib.cm
# draw -----------------------------------
def image_show(name, image, resize=1):
H,W = image.shape[0:2]
cv2.namedWindow(name, cv2.WINDOW_NORMAL)
cv2.imshow(name, image.astype(np.uint8))
cv2.resizeWindow(name, round(resize*W), round(resize*H))
def draw_shado... |
# pyOCD debugger
# Copyright (c) 2013-2020 Arm Limited
# Copyright (c) 2021 Chris Reed
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
const {
applicationContext,
} = require('../../../business/test/createTestApplicationContext');
const { deleteWorkItemFromSection } = require('./deleteWorkItemFromSection');
describe('deleteWorkItemFromSection', () => {
let deleteStub;
beforeEach(() => {
deleteStub = jest.fn().mockReturnValue({
promis... |
import { config } from '@vue/test-utils'
config.mocks.$t = () => {}
config.mocks.localePath = (path) => `/en/${path}`
|
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you m... |
import axios from 'axios';
jest.mock('axios');
const cats = [{"ownerGender":"Male","names":["Fido","Garfield","Jim","Max","Sam","Tom"]},{"ownerGender":"Female","names":["Garfield","Nemo","Simba","Tabby"]}];
const data = [
{
"name": "Bob",
"gender": "Male",
"age": 23,
"pets": [{"name": "Garfield",... |
const BTree = require('./BTree.js')
/**
* 在一个 m*n 的二维字符串数组中输出二叉树,并遵守以下规则:
*
* 行数 m 应当等于给定二叉树的高度。
* 列数 n 应当总是奇数。
* 根节点的值(以字符串格式给出)应当放在可放置的第一行正中间。根节点所在的行与列会将剩余空间划分为两部分(左下部分和右下部分)。你应该将左子树输出在左下部分,右子树输出在右下部分。左下和右下部分应当有相同的大小。即使一个子树为空而另一个非空,你不需要为空的子树输出任何东西,但仍需要为另一个子树留出足够的空间。然而,如果两个子树都为空则不需要为它们留出任何空间。
* 每个未使用的空间应包含一个空的... |
import sys
if sys.version_info < (3, 7):
from ._colorbar import ColorBar
from ._gradient import Gradient
from ._line import Line
from . import colorbar
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__,
[".colorb... |
import styled from 'styled-components';
export const Title = styled.h1`
color: ${({ theme }) => theme.primary};
margin: 0.5em;
`;
export const Suggestion = styled.h2`
color: ${({ theme }) => theme.primary};
font-weight: 100;
margin: 0.2em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis... |
from typing import List
from .repository import Repository
from resources.dbcontext import DbContext
from models.user import User
class UserRepository(Repository):
def __init__(self, dbcontext: DbContext):
super().__init__(dbcontext)
def get_all(self, page: int, page_size: int) -> List[User]:
... |
from fetchai.ledger.api import LedgerApi
from fetchai.ledger.contract import SmartContract
from fetchai.ledger.crypto import Entity, Address
import time
contract_owner = Entity.from_hex('c25ace8a7a485b396f30e4a0332d0d18fd2e462b3f1404f85a1b7bcac4b4b19d')
contract_owner_address = Address(contract_owner) # atsREugsanXS82... |
# Generated by Django 2.1.2 on 2018-11-17 10:49
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
('id', m... |
describe('Init', function () {
beforeEach(function () {
this.map = L.map('map', {
center: L.latLng(44.96777356135154, 6.06822967529297),
zoom: 13,
});
this.xhr = sinon.useFakeXMLHttpRequest();
this.requests = [];
this.xhr.onCreate = (req) => {
this.requests.push(req);
};
}... |
/* PipeWire
* Copyright (C) 2018 Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any la... |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
# 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 may not u... |
"""
The LIME experiment MAIN for GERMAN.
"""
import warnings
warnings.filterwarnings('ignore')
from adversarial_models import *
from utils import *
from get_data import *
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import numpy as np
import pandas as pd
im... |
import os.path as osp
import torch
from torch_geometric.nn import SchNet
from torch_geometric.loader import DataLoader
from torch_geometric.datasets import QM9
path = osp.join(osp.dirname(osp.realpath(__file__)), '..', 'data', 'QM9')
dataset = QM9(path)
device = torch.device('cuda' if torch.cuda.is_available() else... |
const pkcs11 = require("../index");
const assert = require("assert");
// const libPath = "C:\\Windows\\System32\\jcPKCS11.dll";
// const libPath = "C:\\tmp\\rtpkcs11ecp.dll";
// const libPath = "/usr/local/lib/softhsm/libsofthsm2.so";
// const libPath = "/usr/safenet/lunaclient/lib/libCryptoki2_64.so";
const li... |
import { Dimensions, StyleSheet } from "react-native";
import { isIos } from '../utilities'
const { width } = Dimensions.get("window");
export const COLOR = {
WHITE: "#FFF",
BLACK: "#000",
RED: "#D50000",
BLUE: "#2196f3",
LIGHT_GRAY: "#F1F1F1",
GRAY: "#9D9D9D",
APP: "#2d2d2d",
APP_DARK: "#1d1d1d",
}
... |