text stringlengths 3 1.05M |
|---|
import styled from "styled-components";
import { RoundInput } from "../../UI/Input";
import { Button } from "../../UI/Button";
export const LogoContainer = styled.div`
display: flex;
justify-content: center;
height: 50vh;
padding: 15vh 0;
box-sizing: border-box;
`;
export const LoginFormContainer = styled.f... |
/*
* The src/utils documents the general design of the aggregator module
* All aggregator's implement the following three methods
*
* - load_from_source ( uri )
* This method is used as the entry point into aggregator.
* This can be an actual URL or an URI that points to a file.
* - transformToEventList ( Obje... |
import { writable } from "svelte/store";
import { onDestroy } from "svelte";
function defaultCalc(width) {
if (width > 1279) {
return "xl";
}
if (width > 1023) {
return "lg";
}
if (width > 767) {
return "md";
}
return "sm";
}
export default function breakpoint(calcBreakpoint = defaultCalc) {... |
from ast import literal_eval
from uuid import uuid4
from django.contrib import auth, messages
from django.contrib.auth.models import User
from django.http import (Http404, HttpResponseForbidden,
HttpResponsePermanentRedirect, HttpResponseRedirect)
from django.shortcuts import get_object_or_404... |
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
module.exports = {
// By default,... |
const path = require('path');
const { expect } = require('chai');
const createTestCafe = require('../../../../../lib');
const config = require('../../../config.js');
const { createReporter } = require('../../../utils/reporter');
function customReporter (name) {
return createRe... |
/* Copyright 2016 Google Inc. 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 applicable law or agreed to in ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-02-11 04:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20180211_0427'),
]
operations = [
migrations.AlterField(
... |
/* configure jshint globals */
/* globals numeral */
(function ($) {
'use strict';
// Set langauge for Numeral library.
numeral.language('es');
numeral.defaultFormat('0,0.00');
$('.pesetas:not(:has(*)), .pesetas-i:not(:has(*))').each(function () {
var $this = $(this);
if ($this.ht... |
module.exports = {
root: true,
env: {
es6: true,
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'eqeqeq': [2, 'always'], // 强制使用=== !==
'no-extra-semi': 'off', //禁止不必要的分号 关闭... |
import sys
import pytest
import sdl2
from sdl2 import SDL_Init, SDL_Quit, SDL_INIT_VIDEO
@pytest.mark.skip("not implemented")
def test_SDL_ComposeCustomBlendMode(self, with_sdl):
pass
|
import torch
import numpy as np
import random
from glob import glob
import argparse
import json
import os
import sys
sys.setrecursionlimit(100000)
sys.path.append(os.path.normpath(os.path.dirname(os.path.realpath(__file__))))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..... |
import pandas as pd
def check_nulls(df_nulls):
'''
Return number of nulls in a dataframe.
df_nulls -- the dataframe to be checked for null values
'''
return df_nulls.isnull().sum()
def split_date_columns(X, column_name):
'''
Return columns with year, month, and day.
C... |
/* anet.c -- Basic TCP socket stuff made a bit less boring
*
* Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* ... |
import React from 'react'
import PropTypes from 'prop-types'
import { Table, Modal, Progress, Tooltip, Card, Icon } from 'antd'
import DiskStateMapActions from './DiskStateMapActions'
import { ModalBlur, DropOption } from '../../components'
import style from './BackingImage.less'
const confirm = Modal.confirm
// As th... |
from output.models.ms_data.regex.re_r21_xsd.re_r21 import (
Regex,
Doc,
)
__all__ = [
"Regex",
"Doc",
]
|
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be use... |
# """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
#class NestedInteger:
# def isInteger(self) -> bool:
# """
# @return True if this NestedInteger holds a single integer, rather than a nested list.
# """... |
/*
Author: Jason Williams <jdw@cromulence.com>
Copyright (c) 2014 Cromulence LLC
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 rights
to u... |
import re
from layers.backbone.densenet import *
from layers.loss import *
class Identity(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x
## networks ######################################################################
class DensenetClass(nn.... |
import numpy
import pickle
from nutils import matrix, sparse, testing, warnings
@testing.parametrize
class backend(testing.TestCase):
n = 100
complex = False
def setUp(self):
super().setUp()
try:
self.enter_context(matrix.backend(self.backend))
except matrix.BackendNo... |
"""Just an empty init file."""
|
export default {
functionlist:[{
'n': 'SUMIF',
't': 0,
'd': '对范围中符合指定条件的值求和。',
'a': '对范围中符合指定条件的值求和。',
'm': [2, 3],
'p': [{
'name': '范围',
'detail': '要根据条件进行检测的范围。',
'example': 'A1:A10',
'require': 'm',
'repea... |
#!/usr/bin/env python3
from scapy.layers.inet import IP
from scapy.utils import import_hexcap
def yesno_second_packet(question):
prompt = f'{question} ? (y/n): '
answer = input(prompt).strip().lower()
if answer not in ['y', 'n']:
print(f'{answer} is invalid, please try again...')
return ye... |
// This example uses promises instead of events like "goal_reached" for a cleaner look
const mineflayer = require('mineflayer')
const pathfinder = require('mineflayer-pathfinder').pathfinder
const Movements = require('mineflayer-pathfinder').Movements
const { GoalNear } = require('mineflayer-pathfinder').goals
const b... |
import React, { useState, useEffect } from 'react';
import RenderGameVote from './RenderGameVote';
// Recoil imports
import { useSetRecoilState, useRecoilValue } from 'recoil';
import { headerTitle } from '../../../state/headerTitle';
import { currentUserState } from '../../../state/userState';
import { screenState } ... |
import os
import os.path
import time
import json
reference_file = "./expect.json"
output_file = "./clone_code.json"
extra_info = ""
def test():
cmd = "./clone_detect src/ -n 10 -bcj clone_code.json"
os.system(cmd)
output = read_json_file(output_file)
ref = read_json_file(reference_file)
if cmp... |
import {TextData} from './data';
// tslint:disable:max-line-length
const FAKE_TEXT = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tempor aliquet justo non varius. Curabitur eget convallis velit. Vivamus malesuada, tortor ut finibus posuere, libero lacus eleifend felis, sit amet tempus dolor ... |
#!/usr/bin/env python3
import unittest
import logging
import os
from unittest.mock import patch
from dipper.graph.RDFGraph import RDFGraph
from dipper.utils.rdf2dot import rdf2dot
from dipper.utils.TestUtils import TestUtils
from dipper.sources.ClinVar import parse as clinvar_parse
logging.basicConfig()
logging.getLog... |
# -*- coding: utf-8 -*-
# __author__ : py_lee
# __time__ : '18-12-17 上午10:31'
import time
from random import randint
from rest_framework import serializers
from trade.models import ShoppingCart, OrderInfo, OrderGoods
from goods.models import Goods
from goods.serializer import GoodsSerializer
from utils.aliypay impo... |
/*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:52:32 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/PrivateFrameworks/CarPlaySupport.framework/CarPlaySupport
* classdump-dyld is licensed under GPLv3, Copyright © 2013-20... |
module.exports = function solveSudoku(matrix) {
let number = 1,
add_matrix = matrix.slice(),
col_stack = [],
row_stack = [],
wrong_number = [],
prov_mass = [];
const checkRow = (row, col, number) => {
for (let b = 0; b < 9; b++) {
if (add_matrix[row][b] == number && b != col) {
... |
//index.js
//获取应用实例
var app = getApp()
Page({
data: {
coupons:[]
},
onLoad: function () {
},
onShow : function () {
this.getMyCoupons();
},
getMyCoupons: function () {
var that = this;
wx.request({
url: 'https://api.it120.cc/' + app.globalData.subDomain + '/discounts/my',
data:... |
# -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
# Import slogging to patch logging as soon as possible
from . import slogging # noqa
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+... |
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [
2,
"always",
[
"global",
"baklava",
"dinner",
"kibbeh",
"kousa",
"pilaf",
"shawarma",
"kebab",
],
],
},
};
|
import React from 'react';
import { shallow } from 'enzyme';
import SelectInput from '../SelectInput';
describe('SelectInput Component', () => {
const props = {
name: '',
label: '',
onChange: jest.fn(),
defaultOption: '',
value: '',
error: 'error',
options: [{ value: 'text', text: 'text' }]
};
const... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class EndUserTestCase(Integrati... |
class fracao(object):
def __init__(self, num, den):
self.num = num
self.den = den
def somar_fracao(self, b):
f = fracao(self.num*b.den + b.num*self.den, self.den*b.den)
#f.num =
#f.den =
fracao.simplificar_fracao(f)
return f
def su... |
from common.collection_exercise_utilities import execute_collection_exercise, poll_database_for_iac
from common.respondent_utilities import register_respondent
import csv, sys
survey_id = '02b9c366-7397-42f7-942a-76dc5876d86d'
period = '1806'
def main():
respondents = int(sys.argv[2])
print('Executing collect... |
from paradigm import catalog
from tests.utils import pack
from .utils import (identifiers,
modules,
to_homogeneous_tuples)
objects_paths = to_homogeneous_tuples(identifiers).map(pack(catalog.Path))
non_empty_objects_paths = (to_homogeneous_tuples(identifiers,
... |
# Copyright 2012-2014 eNovance <licensing@enovance.com>
#
# 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 l... |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Generates list of random users using the datagenerator library included in
this directory.
The random users are written to a gzipped JSON file which, when copied
into place, will be loaded by the Users microser... |
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
... |
import { h } from 'vue'
export default {
name: "Star",
vendor: "Mdi",
type: "",
tags: ["star"],
render() {
return h(
"svg",
{"xmlns":"http://www.w3.org/2000/svg","width":"24","height":"24","viewBox":"0 0 24 24","class":"v-icon","fill":"currentColor","data-name":"mdi-star","innerHTML":"<path d=... |
"""Numeric integration of data coming from a source sensor over time."""
from decimal import Decimal, DecimalException
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
ATTR_LAST_RESET,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUR... |
import asyncio
import logging
import json
from glob import glob
from pathlib import Path
from dataclasses import dataclass, field, asdict
from typing import Dict, List
import pandas as pd
from magda.pipeline.parallel import init
from ki67.pipelines.config import ConfigPipeline
from ki67.common import Request
loggin... |
# Generated by Django 2.2.14 on 2020-11-26 12:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0044_data_reparent_topics'),
]
operations = [
migrations.RemoveField(
model_name='curatedlistpage',
name='topics',
... |
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
author: `@gatsbyjs`,
},
plugins: [
{
resolve: `gatsby-... |
var class_a_k_u_i_player_controller =
[
[ "AKUIPlayerController", "class_a_k_u_i_player_controller.html#ada7dba40a9c59b4b00929ebd157e17ed", null ],
[ "EndPlay", "class_a_k_u_i_player_controller.html#a4c12bdd0725371266cf07f626a43e36c", null ],
[ "InputCharEvent", "class_a_k_u_i_player_controller.html#ac5dc8f... |
const util = require('util')
const StateManager = require('./stateManager.js')
const Account = require('ethereumjs-account')
const AsyncEventEmitter = require('async-eventemitter')
// require the percomiled contracts
const num01 = require('./precompiled/01-ecrecover.js')
const num02 = require('./precompiled/02-sha256.... |
"""
Information on Earth Engine collections stored here (e.g. bands, collection ids, etc.)
"""
import ee
import numpy as np
import pandas as pd
from keras.utils import np_utils
def ee_bands(collection):
"""
Earth Engine band names
"""
dic = {
'Sentinel2': ['B4','B3','B2','B8'],
'L... |
export { default } from 'ember-onsenui/components/ons-speed-dial-item'; |
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'finance/shop_balance/index' + location.search,
... |
import * as React from 'react';
import {
DataGridPro,
gridColumnVisibilityModelSelector,
GridEvents,
useGridApiRef,
} from '@mui/x-data-grid-pro';
import { useMovieData } from '@mui/x-data-grid-generator';
const INITIAL_GROUPING_COLUMN_MODEL = ['company', 'director'];
const useKeepGroupingColumnsHidden = (api... |
# -*- coding: utf-8 -*-
"""
Generate HTML docs
"""
import os
import shutil
import pdoc
from loglan_db import run_with_context
DEFAULT_OUTPUT_DIRECTORY = "docs"
DEFAULT_PACKAGE_DIRECTORY = "loglan_db"
def ignore_files(directory, files):
return [file for file in files if os.path.isfile(os.path.join(directory, f... |
module.exports = function(precompile, _options) {
var options = _options || {};
function htmlbarsInlineCompilerPlugin(babel) {
var t = babel.types;
var replaceNodeWithPrecompiledTemplate = function(node, template) {
var compiledTemplateString = "Ember.HTMLBars.template(" + precompile(template) + ")"... |
from __future__ import with_statement
import os
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret th... |
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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 app... |
export default {
buildModules: ['nuxt-gsap-module'],
gsap: {
registerEase: [
{
name: 'ease.1',
ease: progress => {
return progress // linear
}
}
]
}
}
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{rgsX:function(e,a,t){"use strict";var n=t("q1tI"),l=t.n(n);a.a=function(e){var a=e.title,t=e.date,n=e.children;return l.a.createElement("main",{className:"content"},l.a.createElement("article",{className:"page-article"},l.a.createElement("div",{className:"wrap-co... |
from collections import deque
INF = 1 << 60
MOD = 10**9 + 7
N, Q = map(int, input().split())
# 無向グラフ
to = [[] for i in range(N)]
for i in range(N - 1):
a, b = map(int, input().split())
a -= 1
b -= 1
to[a].append(b)
to[b].append(a)
# 全頂点の深さを格納する配列
dep_list = [0] * N
# 全頂点の深さを幅優先探索で求める
q = deque(... |
#define _XOPEN_SOURCE 500
#include <cairo/cairo.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include <wayland-client.h>
#include "pool-buffer.h"
static bool set_cloexec(int fd) {
long flags = fcntl(fd, F_GETFD);
if (flags == -1) {
retu... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Styling_1 = require("../../Styling");
exports.getStyles = function (props) {
var _a, _b, _c;
var theme = props.theme, className = props.className;
var palette = theme.palette;
return {
root: [
className,... |
/**
* Modify the contents of a document
*
*/
var config = require('../lib/config')
, db = require('../lib/db')
, serialization = require('../lib/serialization')
, helpers = require('../lib/helpers')
;
module.exports = function (req, res, next) {
var newDoc, collection;
if (!req.params.collection || !r... |
#!/usr/bin/env python3
import cv2
import rospy
import roslib
from geometry_msgs.msg import Twist
import numpy as np
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from std_msgs.msg import String
x1 = x2 = x3 = 0
arr = []
def callback1(msg):
global x1
x1 = msg.data
arr.appen... |
const router = require('express').Router();
const Vehicle = require('./vehicle-model');
const protectedRoute = require('../auth/gen-token.js').protectedRoute;
// ADD A vehicle
router.post('/', protectedRoute, (req, res) => {
// users id lives on the subject key from the token they provide
const { subject } = req.d... |
import copy
import datetime
import os
from typing import List
import jqdatasdk as jq
import numpy as np
from finrl_meta.data_processors._base import _Base
class Joinquant(_Base):
def __init__(self, data_source: str, start_date: str, end_date: str, time_interval: str, **kwargs):
super().__init__(data_sour... |
#pragma once
#include "il2cpp.h"
void Dpr_UI_SealTemplateWindow__OpOpen_d__25___ctor (Dpr_UI_SealTemplateWindow__OpOpen_d__25_o* __this, int32_t __1__state, const MethodInfo* method_info);
void Dpr_UI_SealTemplateWindow__OpOpen_d__25__System_IDisposable_Dispose (Dpr_UI_SealTemplateWindow__OpOpen_d__25_o* __this, cons... |
/*!
* vue-youtube v1.3.3
* (c) 2018 Antério Vieira
* Released under the MIT License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueYoutube=e.VueYoutube||{})}(this,function(e){"use strict";function t(e){e.prototyp... |
import os
import pathlib
from collections import defaultdict
import pandas as pd
import click
import dtoolcore
def fpath_to_name(fpath):
return os.path.splitext(fpath.name)[0]
def load_file_data(file_fpath):
df = pd.read_csv(file_fpath, names=['rid', 'file'])
file_lookup = pd.Series(df.file.values, in... |
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool acceptance of raw transactions."""
from io import BytesIO
from test_framework.test_framew... |
# Generated by Django 2.0.6 on 2020-04-15 20:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evaluations', '0007_auto_20200415_2001'),
]
operations = [
migrations.AlterField(
model_name='evaluation',
name='ima... |
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.ZSchema=a()}}(function(){var a;return function b(a,c,... |
const fs = require('fs');
const utils = require('@react-pakistan/util-functions');
utils.generateReactLogos(fs);
|
import * as Constants from '../../util/Constants';
import Geometry from '../Geometry';
test('check if two geometries equal', () => {
const g = Geometry(100, 200, 300, 400);
const g2 = Geometry(100, 200, 300, 400);
expect(g.equals(g2)).toStrictEqual(true);
});
|
import { TextField, Typography, Box, Container, Grid } from "@material-ui/core";
import React, { useState } from "react";
import { Button } from "@material-ui/core";
import { useDispatch, useSelector } from "react-redux";
import { changeStrengths } from "../../actions/formActions";
import StrengthList from "./StrengthL... |
self["webpackHotUpdate_N_E"]("webpack",{},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ "use strict";
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "ac18b7d2946793b28119"; }
/******/ }();
/******/
/******/... |
""" Implementation of Cosmic RIM estimator"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os, sys, argparse, time
from scipy.interpolate import InterpolatedUnivariateSpline as iuspline
import matplotlib
m... |
import unittest
from securityheaders.checkers.hsts import HSTSSubdomainsChecker
class HSTSSubdomainsCheckerTest(unittest.TestCase):
def setUp(self):
self.x = HSTSSubdomainsChecker()
def test_checkNoHSTS(self):
nox = dict()
nox['test'] = 'value'
self.assertEqual(self.x.check(nox), ... |
#! /usr/bin/env python
#! -*- encoding: utf-8 -*-
import codecs
import os
from setuptools import setup, find_packages
if __name__ == '__main__':
setup(
name = 'lexico',
version = '0.0.1',
description = 'Assistant to write your personalised glossary',
license = 'MIT',
url ... |
"""
设计并实现最不经常使用(LFU)缓存的数据结构。它应该支持以下操作:get 和 put。
get(key) - 如果键存在于缓存中,则获取键的值(总是正数),否则返回 -1。
put(key, value) - 如果键不存在,请设置或插入值。当缓存达到其容量时,它应该在插入新项目之前,使最不经常使用的项目无效。在此问题中,当存在平局(即两个或更多个键具有相同使用频率)时,最近最少使用的键将被去除。
进阶:
你是否可以在 O(1) 时间复杂度内执行两项操作?
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/lfu-cache
著作权归领扣网络所有。商业转载请联系官方... |
# -*- coding: utf-8 -*-
from irc3.plugins.command import command
import irc3
import json
__doc__ = '''
==============================================
:mod:`irc3.plugins.social` Social networking
==============================================
Add ``tweet`` and ``retweet`` commands.
Extend the bot with ``.get_social_co... |
import gym
import gym_simple
import tensorflow as tf
import numpy as np
import keras
from keras.models import Sequential, clone_model
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from tensorflow.keras.optimizers import Adam
from skimage.transform import resize
env = gy... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 19 11:29:18 2014
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
# this is similar to ContrastResults after t_test, partially copied and adjusted
class PredictionResults(object):
def __init__(self, predicted_mean, var_pred_mea... |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os, sys, subprocess
from django.conf import settings
from emma.interface.models import Metadata, Keyword
import logging
#--------------------------------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
sphinx.ext.imgmath
~~~~~~~~~~~~~~~~~~
Render math in HTML via dvipng or dvisvgm.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import codecs
import shutil
import tempfile
import posixpath
from os ... |
document.addEventListener('DOMContentLoaded', function() {
var fullSizedPhotoUrlArray;
document.onkeydown = function(e) {
if (e.keyCode === 13) {
searchPhotos();
}
}
searchButton.onclick = function() {
searchPhotos();
}
var searchPhotos = function() {
// clear the data from the previous sea... |
from iconservice import *
class SampleInterface(InterfaceScore):
@interface
def set_value(self, value: int) -> None: pass
@interface
def get_value(self) -> int: pass
class SampleLinkScoreCross(IconScoreBase):
_SCORE_ADDR = 'score_addr'
@eventlog(indexed=1)
def Changed(self, value: int)... |
/* gzlib.c -- zlib functions common to reading and writing gzip files
* Copyright (C) 2004, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK ... |
const router = require('express').Router();
const { createNewNote, findById, editNote, removeNote } = require('../lib/note');
const { v4: uuidv4 } = require('uuid');
const { notes } = require('../db/db.json');
router.get('/notes', (req, res) => {
res.json(notes);
});
router.post('/notes', (req, res) => {
if (... |
ENVIRONMENTS = ['test', 'development', 'production']
DATETIME_FORMATS = [
'%Y-%m-%d-%H:%M:%S:%f',
'%Y-%m-%d-%H:%M:%S',
'%Y-%m-%d-%H:%M',
'%Y-%m-%d'
] |
var DEFAULT_HEIGHT = '50%';
var DEFAULT_WIDTH = 20;
/**
* - Generates a style used to fade out an overflowing content by defining a style for an :after pseudo element.
* - Apply it to the :after selector for all combination of states the parent of content might have (normal, hover, selected, focus).
* - Requires the... |
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('DeckCards', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
deck_id: {
type: Sequelize.INTEGER,
all... |
/******************************************************************************
Copyright (c) 2001-2013, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistribu... |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - FootNote Macro
Collect and emit footnotes. Note that currently footnote
text cannot contain wiki markup.
@copyright: 2002 Juergen Hermann <jh@web.de>,
2007 MoinMoin:ReimarBauer,
2007 Johannes Berg
@license: GNU GPL, see CO... |
// {{ ansible_managed }}
pref("browser.tabs.warnOnClose", false, locked);
pref("browser.tabs.warnOnCloseOtherTabs", false, locked);
pref("layers.acceleration.force-enabled", true, locked);
pref("layers.offmainthreadcomposition.enabled", true, locked);
pref("layers.omtp.enabled", true, locked);
pref("gfx.canvas.azure.ac... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['pyyaml', ]
setup_req... |
// This source file is part of the Aument language
// Copyright (c) 2021 the aument contributors
//
// Licensed under Apache License v2.0 with Runtime Library Exception
// See LICENSE.txt for license information
#pragma once
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include "array.h"
#include "bc.h"... |
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnPrope... |