text
stringlengths
3
1.05M
from datetime import datetime from flask import Flask, render_template, flash, redirect, url_for, abort, request from flask_sqlalchemy import SQLAlchemy from forms import NewsForm from tfidf import calculate_tfidf as Searching # app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:@loca...
// // NSObject+YYModel.h // YYModel <https://github.com/ibireme/YYModel> // // Created by ibireme on 15/5/10. // Copyright (c) 2015 ibireme. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> ...
import cv2 import numpy as np from PIL import Image import os import pickle from pyquaternion import Quaternion from nuscenes.utils.geometry_utils import view_points def map_lidar_to_imgidx(pts, info): # Param: pts=(N, 3) # Return: pts_img=(N, 2); (col, row) pts = pts.copy() pts = Quaternion(info['lid...
define(["npm:aurelia-templating-resources@1.0.0-beta.1.1.0/aurelia-templating-resources"], function(main) { return main; });
'use strict'; angular.module("app") .directive("headerDir", function ($rootScope, $timeout) { return { link: function (scope, element, attrs) { var timeline_logo = anime.timeline({ autoplay: false }); timeline_logo.add({ targets: '#bar', height: '+=50%', delay: 500, du...
""" ``xrview.timeseries.base`` """ from concurrent.futures import ThreadPoolExecutor from functools import partial from bokeh.document import without_document_lock from bokeh.events import Reset from tornado import gen from xrview.core import BaseViewer from xrview.elements import ResamplingElement from xrview.handle...
(function () { 'use strict'; /** * Register the list controller as ProductListController */ angular .module('vendorAppApp.product.list') .controller('ProductListController', ProductListController); // add ProductListController dependencies to inject ProductListController.$inject = ['$scope', '...
import os.path import shlex import sys import time from unittest import mock import pytest import pre_commit.constants as C from pre_commit import color from pre_commit.commands.install_uninstall import install from pre_commit.commands.run import _compute_cols from pre_commit.commands.run import _full_msg from pre_co...
import requests from bs4 import BeautifulSoup import pandas import re def get_href(s): regex = r"/teams/(\w+)" match = re.search(regex,s) return match.group(1) def get_weeks_games(week): new_games = [] teams = pandas.read_csv("2016_audl_teams.csv") response = requests.get("http://theaudl.com/s...
// // This Ajax is an interactive popup display for Test Plan script repo scanning. // function displayRepoEdit(cmd,path) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft....
# _____ ______ _____ # / ____/ /\ | ____ | __ \ # | | / \ | |__ | |__) | Caer - Modern Computer Vision # | | / /\ \ | __| | _ / Languages: Python, C, C++ # | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer # \_____\/_/ \_ \______ |_| \_\ # Li...
function destinationsToAmount(destinations){ // Gets amount from destinations line // input: "20.000000000000: 9tLGyK277MnYrDc7Vzi6TB1pJvstFoviziFwsqQNFbwA9rvg5RxYVYjEezFKDjvDHgAzTELJhJHVx6JAaWZKeVqSUZkXeKk" // returns: 20.000000000000 return destinations.split(" ")[0].split(":")[0]; } function destina...
export { default as SignIn } from './SignIn';
(function () { var ctx = document.getElementsByTagName('canvas')[0].getContext('2d'); function drawOval(x, y, r, scaleX, scaleY, fillStyle, strokeStyle) { ctx.fillStyle = fillStyle; ctx.strokeStyle = strokeStyle; ctx.save(); ctx.beginPath(); ctx.scale(scaleX, scaleY); ...
def strategy(history, memory): offsetAverage = 0.01 cooperateDetection = 1.1 numberOfRound = history.shape[1] # print() # print("round number: " + str(numberOfRound)) x = 0 averageOfOpponent = 0 dOfOpponent = 0 cOfOpponent = 0 while x < numberOfRound: #create statistics of opponent ...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-12-14 11:48 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('todolist_rest', '0002_auto_20171214_1939...
module.exports = require('./lib/HtmlPreview')
/* * load plugins */ const pkg = require('./package.json') const banner = [ '/**', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>', ' * @link <%= pkg.homepage %>', ' * @license <%= pkg.license %>', ' */', '' ].join('\n') // gulp const gulp = require('gulp') // load a...
# Copyright 2019 Open Source Robotics Foundation, 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 applicable law...
from flask import render_template from app import app #Views @app.route("/") def index(): """s View root page function that returns the index Keyword arguments: argument -- description Return: return_description """
""" Reads vehicle status from BMW connected drive portal. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.bmw_connected_drive/ """ import asyncio import logging from homeassistant.components.bmw_connected_drive import DOMAIN as BMW_DOMAIN from hom...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_isalnum.c :+: :+: :+: ...
import { withRouter } from 'next/router' import Link from 'next/link'; const ActiveLink = ({ children, router, href, as }) => { const activeClass = router.pathname === href ? 'active' : ''; const handleClick = (e) => { e.preventDefault(); router.push(href); } return ( <Link href={href} as={as}> ...
"""Format strings used with strftime/strptime methods.""" DATE_ONLY = "%Y-%m-%d" DATE_ONLY_2 = "%m/%d/%Y" DATE_ONLY_TABLE_ID = "%Y%m%d" DT_NAIVE_LESS = "%m/%d/%Y %I:%M %p" DT_NAIVE = "%m/%d/%Y %I:%M:%S %p" DT_AWARE = "%m/%d/%Y %I:%M:%S %p %z" DT_STR_FORMAT = "%m/%d/%Y %I:%M %p %Z%z" DT_STR_FORMAT_ALL = "%Y-%m-%d %H:%M...
"""Some simple API functions and command-line tools for interaction with JIRA.""" from __future__ import print_function from argparse import ( ArgumentParser, ArgumentDefaultsHelpFormatter, RawDescriptionHelpFormatter, ) from .utils import load_config, DEFAULT_LINK_TYPE from .helpers import list_from_conf...
# XXX: does not represent None as null, rather as '...\n' def yaml_load(s): from ruamel import yaml if s.startswith('...'): return None try: l = yaml.load(s, Loader=yaml.RoundTripLoader) except: l = yaml.load(s, Loader=yaml.UnsafeLoader) return remove_unicode(l) def yaml_...
/* +----------------------------------------------------------------------+ | (C) Copyright IBM Corporation 2006. | +----------------------------------------------------------------------+ | | | Licensed unde...
//>>built define({root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},bs:!0,mk:!0,sr:!0,zh:!0,"zh-tw":!0,vi:!0,uk:!0,tr:!0,th:!0,sv:!0,sl:!0,sk:!0,ru:!0,ro:!0,pt:!0,"pt-pt":!0,pl:!0,nl:!0,nb:!0,lv:!0,lt:!0,ko:!0,kk:!0,ja:!0,it:!0,id:!0,hu:!0,hr:!0,hi:!0,he:!0,fr:!0,fi:!0,eu:!0,et:!0,es:!0,el:!0,de:!0...
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const friendRequestSchema = new Schema({ senderUsername:{ type: String, ref: 'User', required: true }, sender: { type: Schema.Types.ObjectId, ref: 'User', required: true }, receiver: { type: Schema.Types.Object...
import argparse import flickrapi import flickrapi.shorturl if __name__ == '__main__' : api_key = None api_secret = None parser = argparse.ArgumentParser () parser.add_argument('userid', help='The user ID of the flickr user to use') parser.add_argument('-s', '--size', default='h', ) args = pa...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSWindowTemplate.h" @interface NSWindowTemplate (IBCocoaAutolayoutEngineAdditions) - (id)ibTopLevelWindowTemplateForLayoutEngine:(id)arg1; - (id)ibWindowWithCopiedViewHier...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import sys import collections os.environ['PYPINYIN_NO_DICT_COPY'] = '1' import pypinyin import terra_pinyin pypinyin.load_single_dict(terra_pinyin.pinyin_dict) pypinyin.load_phrases_dict(terra_pinyin.phrases_dict) RE_UCJK = re.compile( '([\u340...
"use strict"; var _babelHelpers = require("./utils/babelHelpers.js"); exports.__esModule = true; var _react = _babelHelpers.interopRequireDefault(require("react")); var _Icon = require("./Icon"); var _fragments = require("./fragments"); var SharpPhone = /*#__PURE__*/ function SharpPhone(props) { return _react.d...
//schema model for user table const mongoose = require('mongoose'); const userSchema = mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, username: { type: String }, email: { type: String, unique: true, match: /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(...
module.exports = { fetchTransactionsWithManualCat: jest .fn() .mockResolvedValue([ { amount: 3001.71, label: 'AAAA BBBB', manualCategoryId: '200110' }, { amount: 3001.71, label: 'AAAA BBBB', manualCategoryId: '200110' } ]) }
// import our actions import { UPDATE_BLABS, UPDATE_USERS, // ADD_BLAB } from '../utils/actions'; import { reducer } from '../utils/reducers'; // create a sample of what our global state will look like const initialState = { blabs: [ //{ // "_id": "1", // "blabTe...
import numpy import six from chainer import cuda from chainer import function from chainer.utils import conv from chainer.utils import conv_nd from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn class _PoolingND(function.Function): """Base class of poo...
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commerc...
const firebase = require('firebase'); const conf = { apiKey: 'AIzaSyAC26X8bWaMmZJ-v5yr6NsJaLdXkOBDGIs', authDomain: 'was-today-better-dev.firebaseapp.com', databaseURL: 'https://was-today-better-dev.firebaseio.com', projectId: 'was-today-better-dev', storageBucket: 'was-today-better-dev.appspot.com', mes...
/** * @license * Copyright 2017 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 requir...
import pandas as pd from datetime import datetime import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy import stats from sklearn.metrics import mean_squared_error import numpy as np import torch import torch.nn as nn from copy import deepcopy import torch.nn.functional as F from numpy import ...
train_data_path = "../data/no_cycle/train.data" dev_data_path = "../data/no_cycle/dev.data" test_data_path = "../data/no_cycle/test.data" word_idx_file_path = "../data/word.idx" word_embedding_dim = 100 train_batch_size = 32 dev_batch_size = 500 test_batch_size = 500 l2_lambda = 0.000001 learning_rate = 0.001 epoch...
class DataGridViewButtonColumn(DataGridViewColumn, ICloneable, IDisposable, IComponent): """ Hosts a collection of System.Windows.Forms.DataGridViewButtonCell objects. DataGridViewButtonColumn() """ def Clone(self): """ Clone(self: DataGridViewButtonColumn) -> object Cre...
from __future__ import annotations import functools import os import traceback from enum import Enum from typing import Callable from typing import TypeVar from CCAgT_utils.constants import FILENAME_SEP from CCAgT_utils.constants import STRUCTURE R = TypeVar('R') def basename(filename: str, with_extension: bool = ...
""" Not Found Web Controller """ # Standard Library import os # Third Party Library from django.shortcuts import render from django.utils.translation import gettext as _ # Local Library from app.modules.core.context import Context from app.modules.util.helpers import Helpers def handler404(request, exception=None,...
from setuptools import setup, find_packages classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Education', 'Operating System :: Microsoft :: Windows :: Windows 10 ', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3' ] setup( n...
import random import time from .util import d __all__ = ['Battle'] class Sts: def update(self, sts_data): self.burning = sts_data['burning'] self.freezing = sts_data['freezing'] self.stun = sts_data['stun'] self.silenced = sts_data['silenced'] class Cds: def update(self, cd...
# Lint as: python3 # Copyright 2017 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 ...
module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*", // Match any network id // testrpc // port: 7545, // network_id: "5777", //ganache gas: 5000000 } } };
#!/usr/bin/env python # Copyright (c) 2012-2016 The Harzcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_v...
/* * QEMU ATAPI Emulation * * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2006 Openedhand Ltd. * * 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 ...
# automatically generated by the FlatBuffers compiler, do not modify # namespace: monster import flatbuffers class Weapon(object): __slots__ = ['_tab'] @classmethod def GetRootAsWeapon(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = Weapon() ...
import ai2thor import gym from plugins.ithor_arm_plugin.ithor_arm_constants import ENV_ARGS from plugins.ithor_arm_plugin.ithor_arm_sensors import RelativeAgentArmToObjectSensor, RelativeObjectToGoalSensor, PickedUpObjSensor, DepthSensorThor, NoVisionSensorThor from plugins.ithor_arm_plugin.ithor_arm_task_samplers imp...
// Copyright 2009 the Sputnik authors. All rights reserved. /** * The Date property "parse" has { DontEnum } attributes * * @path ch15/15.9/15.9.4/15.9.4.2/S15.9.4.2_A1_T3.js * @description Checking DontEnum attribute */ if (Date.propertyIsEnumerable('parse')) { $ERROR('#1: The Date.parse property has the attr...
# Copyright 2017 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...
import os def getDesktopPath(): try: path = os.popen("xdg-user-dir DESKTOP").read() except: path = os.path.expanduser("~/Desktop") stringList = list(path) while stringList[-1] == "\n": del stringList[-1] path = "" for i in stringList: path += i if os.path.ex...
import React from 'react'; // import { connect } from 'react-redux'; import './App.css'; import HomePage from './HomePage/HomePage' import SignUpModal from './UI/Modals/SignUpModal' import LogInModal from './UI/Modals/LoginModal' import CurrentMedications from './CurrentMedications/CurrentMedications' import UsersMed...
const Right = x => ({ chain: f => f(x), ap: other => other.map(x), traverse: (of, f) => f(x).map(Right), map: f => Right(f(x)), fold: (f, g) => g(x), inspect: () => `Right(${x})` }) const Left = x => ({ chain: f => Left(x), ap: other => Left(x), traverse: (of, f) => of(Left(x)), map: f => Left(x),...
# 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 use ...
exports._check = (x, y) => { // DRY up the codebase with this function // First, move the duplicate error checking code here // Then, invoke this function inside each of the others // HINT: you can invoke this function with exports._check(); if (typeof x !== 'number') { throw new TypeError(`${x} is not a ...
class ReloadLatestOptions(object,IDisposable): """ Options to control behavior of pure reload latest (not part of synchronize with central). ReloadLatestOptions() """ def Dispose(self): """ Dispose(self: ReloadLatestOptions) """ pass def ReleaseUnmanagedResources(self,*args): """ ReleaseUnma...
const { Mongo } = require('../app/class/mongo'); const { ObjectId } = require('mongodb'); const schema = require('../src/collections/schemas/documentCategory.json'); const SchemaValidator = require('../lib/utils/schema-validator'); const collections = require('../utils/collections'); const serviceUtils = require('../ut...
""" Copyright (c) 2017, Battelle Memorial Institute 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. Redistributions of source code must retain the above copyright notice, this list of conditions a...
# 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 under the...
""" WSGI config for drfstudying project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_S...
#!/usr/bin/env python3 """Advent of Code 2021 Day 3 - Binary Diagnostic""" def convert_to_columns(binary_values): """Takes list of strings and returns one with rows and columns swapped.""" column_conversion = [] for row_num in range(len(binary_values[0])): column_conversion.append('') for...
# coding: utf-8 """ MailSlurp API MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://ww...
// TODO: attach containers to dataset instead of module export default function printSummary(dataset, by) { const module = dataset.module; module.containers = { card: this.containers.cards.filter(d => d.spec === module.spec), header: this.containers.headers.filter(d => d.spec === module.spec), ...
/* ANSI-C code produced by gperf version 3.0.4 */ /* Command-line: gperf -m 10 lib/aliases_syssolaris.gperf */ /* Computed positions: -k'1,3-11,$' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42...
/*! * echarts-extension-amap * @version 1.9.3 * @author plainheart * * MIT License * * Copyright (c) 2019-2021 Zhongxiang.Wang * * 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Project: Azimuthal integration # https://github.com/silx-kit/pyFAI # # Copyright (C) 2013-2018 European Synchrotron Radiation Facility, Grenoble, France # # Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu) # # Permission is hereby gr...
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof windo...
#!/usr/bin/env python # coding: utf-8 # ___ # # <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> # ___ # # Matplotlib Exercises - Solutions # # Welcome to the exercises for reviewing matplotlib! Take your time with these, Matplotlib can be tricky to understand at first. These are rela...
/* * @flow * Copyright (C) 2018 MetaBrainz Foundation * * This file is part of MusicBrainz, the open internet music database, * and is licensed under the GPL version 2, or (at your option) any * later version: http://www.gnu.org/licenses/gpl-2.0.txt */ import mutate from 'mutate-cow'; import * as React from 're...
""" This module lets you practice the ACCUMULATOR pattern in its simplest classic forms: SUMMING: total = total + number Authors: David Mutchler, Dave Fisher, Vibha Alangar, Mark Hays, Amanda Stouder, their colleagues and Landon Bundy. """ # TODOne: 1. PUT YOUR NAME IN THE ABOVE LINE. import math ...
(function(doc, win) { ///////////页面自适应尺寸控制,基于rem,根据屏幕不同的宽度对html的font-size大小进行换算设置 var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function() { var clientWidth = docEl.clientWidth; if(!clientWidth) return; /////////考虑chrome对font-size大小的限...
#ifndef TEAM_DIANA_LIB_LOGGING_LOGGING #define TEAM_DIANA_LIB_LOGGING_LOGGING #include <string> namespace Td { void ros_info(const std::string& msg); void ros_warn(const std::string& msg); void ros_error(const std::string& msg); void ros_fatal(const std::string& msg); } #endif
"use strict"; module.exports = LongBits; var util = require("../util/minimal"); /** * Constructs new long bits. * @classdesc Helper class for working with the low and high bits of a 64 bit value. * @memberof util * @constructor * @param {number} lo Low 32 bits, unsigned * @param {number} hi High 32 bits, unsign...
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M12 23c1.1 0 1.99-.89 1.99-1.99h-3.98c0 1.1.89 1.99 1.99 1.99zm8.29-4.71L19 17v-6c0-3.35-2.36-6.15-5.5-6.83V3c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v1.17C7.3...
# Modified spotify/util.py - added cache_file param # shows a user's playlists (need to be authenticated via oauth) from __future__ import print_function import os from spotipy import oauth2 import spotipy import webbrowser def obtain_user_token(username, scope=None, client_id = None, client_secret = None, re...
import json import numpy as np from bs4 import BeautifulSoup import requests from collections import defaultdict MAX_RANK = 10 SKIP_DATE = 7 j = json.loads(open('static/people.json').read()) years = range(2007, 2015) poster_dict = {} def poster_url(code): b = BeautifulSoup(requests.get('http://movie.naver.com/...
import { asyncIterableCurry } from '../../internal/async-iterable.js'; import { isPositiveInteger } from '../../internal/number.js'; import { delay } from '../../internal/delay.js'; export async function* __asyncThrottle(source, intervalMs) { let waitSince = 0; for await (const value of source) { const duratio...
import typing def solve( n: int, k: int, ) -> typing.NoReturn: v = (pow(2, n) - 1) * 2 k = min(k, pow(2, n - 1)) print(v * k) def main() -> typing.NoReturn: t = int(input()) for _ in range(t): n, k = map( int, input().split(), ) solve(n, k) main()
/*! * pio-preview - easy Print.io product previews * http://github.com/fromkeith/pio-preview * (c) 2015 MIT License */ !function(p,e){"undefined"!=typeof module&&module.exports?module.exports=e(require("angular")):"function"==typeof define&&define.amd?define(["angular"],e):e(p.angular)}(this,function(p){"use strict...
#coding=utf-8 from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField,TextAreaField,HiddenField from wtforms.validators import DataRequired, Length, Email, Regexp, EqualTo from wtforms import ValidationError from ..models import User from flask_wtf.file import FileFiel...
# pylint: disable=too-many-locals,too-many-arguments,too-many-function-args """ Usage ----- >>> import qtidenticon >>> qtidenticon.render_identicon(code, size) Return a PIL Image class instance which have generated identicon image. ``size`` specifies `patch size`. Generated image size is 3 * ``size``. """ from PyQt4...
from trex.astf.api import * # per template rx-tx buffer size # # class Prof1(): def __init__(self): pass def get_profile(self, **kwargs): # ip generator ip_gen_c = ASTFIPGenDist(ip_range=["16.0.0.0", "16.0.0.255"], distribution="seq") ip_gen_s = ASTFIPGenDist(ip_range=["48....
/** * @license * Copyright 2019 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.CLASS({ package: 'foam.nanos.u2.navigation', name: 'UserInfoNavigationView', extends: 'foam.u2.View', documentation: 'Displays user and agent label if present. Clicking view opens sett...
import React from "react"; import axios from "axios"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { withRouter } from "react-router"; import { NavLink } from "react-router-dom"; const NavigationComponent = props => { const dynamicLink = (route, linkText) => { return ( <div clas...
import Ext_field_trigger_Clear from './Ext/field/trigger/Clear.js'; import HTMLParsedElement from './HTMLParsedElement.js'; export default class ExtCleartrigger extends Ext_field_trigger_Clear { constructor() { super ([],[]) this.xtype = 'cleartrigger'; } } window.customElements.define('ext-cle...
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2018 The DigiByte Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ imp...
#ifndef QUOTABLOCKDEVICE_H_ #define QUOTABLOCKDEVICE_H_ #include <common/Common.h> #include <common/storage/Path.h> #include <common/storage/StorageDefinitions.h> #include <common/storage/quota/Quota.h> class QuotaBlockDevice; //forward declaration typedef std::map<uint16_t, QuotaBlockDevice> QuotaBlock...
import React, { Component } from 'react'; import { Button, Modal, ModalHeader, ModalBody, Form, FormGroup, Label, Input } from 'reactstrap'; import { connect } from 'react-redux'; import { addItem } from '../actions/ItemActions'; class ItemModal extends Component { state = { modal: false, nam...
from infrastructure.cqrs.decorators.requestclass import requestclass @requestclass class GetDataOperationJobExecutionRequest: Id: int = None
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import tensorflow as tf from aix360.algorithms.sif.SIF import SIFExplainer from aix360.datasets.SIF_dataset import DataSet class AllAR(SIFExplainer): def _...
#pragma once #ifndef frm_Framebuffer_h #define frm_Framebuffer_h #include <frm/core/def.h> #include <frm/core/gl.h> namespace frm { class GlContext; class Texture; //////////////////////////////////////////////////////////////////////////////// // Framebuffer // Framebuffer to which textures may be attached for ren...
/* * Copyright (c) 2008-2020, Hazelcast, 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 ...
# -*- coding: utf-8 -*- """CCXT: CryptoCurrency eXchange Trading Library""" # MIT License # Copyright (c) 2017 Igor Kroitor # 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 restricti...
#!/usr/bin/env python """ http://googleresearch.blogspot.com/2012/05/from-words-to-concepts-and-back.html This script loads data from the inv.dict file into mongo: http://www-nlp.stanford.edu/pubs/crosswikis-data.tar.bz2/inv.dict.bz2 Here's an example inv.dict line: Maine 0.461444 Maine W:22581/41237 Wx:13813/46...