content
stringlengths
5
1.05M
#!/usr/bin/python ############################################################################## # # # twampy.py # # ...
from .bill import QRBill # NOQA
import logging import async_timeout logger = logging.getLogger(__name__) async def http_get(http_session, url, timeout_seconds=60): with async_timeout.timeout(timeout_seconds): async with http_session.get(url) as response: return await response.json()
import unittest from Bio import AlignIO from mitos.MSA import coverage, columngappercentage, gapstrip class TestMSA(unittest.TestCase): def setUp(self): self.msa = AlignIO.read('tests/samples/protein.sto', 'stockholm') def test_coverage(self): covers_expected = [1.0, 0.718, 0.674, 0.722, 0.7...
from collections import defaultdict from enum import Enum from uuid import uuid4 import pytest from protean import BaseView from protean.container import Options from protean.exceptions import InvalidOperationError, ValidationError from protean.fields import Auto, Identifier, Integer, String from protean.reflection i...
# Import Libraries that will be needed import pandas as pd import datetime # Import data from .csv and reformat time print("If using Windows, please make sure there are no spaces in filename.") file_name = input("Enter filename (including .csv): ") print("Excel file will be saved in the same folder with original .csv...
from flask_sqlalchemy import SQLAlchemy from datetime import datetime db = SQLAlchemy() def configure(app): db.init_app(app) app.db = db class Weather(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) dt = db.Column(db.DateTime, default=datetime.utcnow) city = db.Column(...
# python3 # Copyright 2021 InstaDeep Ltd. 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 applic...
"""Sync tests.""" from collections import namedtuple import pytest from mock import patch from pgsync.exc import RDSError, SchemaError from pgsync.settings import LOGICAL_SLOT_CHUNK_SIZE from pgsync.sync import Sync ROW = namedtuple("Row", ["data", "xid"]) @pytest.mark.usefixtures("table_creator") class TestSync(o...
from art_calculator import logo def multiplication(number1,number2): multiplication_result = number1 * number2 return multiplication_result division = lambda first_number,second_number: first_number/ second_number def addition(number1, number2): addition_result = number1 + number2 return additi...
''' information.py ''' __all__ = ['entropy', 'symbols_to_prob', 'mi', 'cond_entropy'] import numpy as np def entropy(data=None, prob=None, method='nearest-neighbors', bins=None, errorVal=1e-5, units='bits'): ''' given a probability distribution (prob) or an interable of symbols (data) compute and return i...
from extensions import reqparse get_track_parser = reqparse.RequestParser() get_track_parser.add_argument(name='lyrics', type=str, required=True, default='') get_track_parser.add_argument(name='stress', type=str, required=True, default='') get_track_parser.add_argument(name='energy', type=str, required=True, default='...
import sys import PIL import io, os def _get_pptx_path(pptx_name): """ Return the path to the built-in default .pptx package. """ return os.path.join(os.path.split(__file__)[0], pptx_name) def pdf2jpeg(pdf_path): from pdf2image import convert_from_path, convert_from_bytes images = convert_f...
import logging import socket import sys import os import version from client import Client from cmdparse import Command from util import startLogger from xmlrpclib import ServerProxy class ClientCommand(Command): log = logging.getLogger("Wildcatting") def __init__(self): Command.__init__(self, "pin...
# -*- coding: utf-8 -*- import re with open('FoodTier.java', 'r') as file, open ('declare', 'w') as output1, open('hunger_values', 'w') as output2, open('init', 'w') as output3: content = file.readlines() key = 'public static final Food' replace = 'public static ForgeConfigSpec.IntValue' for line in content: ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import subprocess def download(remote, local): # pcs download -f apps/bypy/test/test.flv test.flv cmd = 'pcs download -f {remote_path} {local_path}'.format( remote_path = remote, local_path = local, ) return subprocess.run(cmd, shell = True)
# Made by Kerberos v1.0 on 2009/21/02 # this script is part of the Official L2J Datapack Project. # Visit http://www.l2jdp.com/forum for more details. import sys from com.l2jserver.gameserver.instancemanager import QuestManager from com.l2jserver.gameserver.model.quest import State from...
import numpy as np import sys #sys: command line def expo(x): ##function return np.exp(x) #return value def show_expo(n): #n: argument for i in range(n): print(expo(float(i))) #main function def main(): n=10 if(len(sys.argv)>1): n = int(sys.argv[1]) show_expo(n) if __name__ == "__...
N = str(input('')) length = len(N) if length <= 80: print('YES') else: print('NO')
from bangtal import * from mod1 import * class Scene_m(Scene): def __init__(self, name, file, bgm="None", Loop=False): super().__init__(name, file) if bgm != "None": self.bgm = Sound(bgm) else: self.bgm = "None" self.image = file self.loop = Loop ...
'''A very simple program, showing how short a Python program can be! Authors: ___, ___ ''' print('Hello world!') #This is a stupid comment after the # mark
import param from quest.util import setattr_on_dataframe, unit_list, unit_registry from .ts_base import TsBase periods = { 'daily': 'D', 'weekly': 'W', 'monthly': 'M', 'annual': 'A', } class TsRemoveOutliers(TsBase): _name = 'ts-remove-outliers' sigma = param.Number(default=1, doc="values g...
from cv2 import cv2 as cv import numpy as np from Pincel import Pincel from Cor import Cor desenhando = False cor = Cor(0, 0, 0) pincel = Pincel(0, 0, cor, 0) def nada(x): pass def desenho(event, x, y, flags, param): global pincel,cor,desenhando pincel.x = x pincel.y = y if event == cv.EVENT_LBU...
import unittest from bmaclient.client import MonitoringAPI from bmaclient.bind import APIClientError, MonitoringAPIMethod class BindMethodTest(unittest.TestCase): def setUp(self): self.api = MonitoringAPI() def test_bind(self): method = self.api.fetch_doas(_return_as_instance=True) s...
''' generate_curves A wrapper function to generate transit curves from atmospheric info ''' from ._transit_curve_generator import TransitCurveGenerator from ._spectrum_generator import SpectrumGenerator import numpy as np def generate_transit_curves(Rs, Ms, Ts, Rp, Mp, Tp, logZ=0, CO_ratio=0.53, ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- from distutils.core import setup, Extension import numpy as np ext_modules = [ Extension('matlabtb', sources = ['mtbmodule.cpp']) ] setup( name = 'python MATLAB toolbox', version = '1.0', include_dirs = [np.get_include()], #Add Include path of num...
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
import urllib.request; urls = []; urls.append('http://student.mit.edu/catalog/m1a.html'); urls.append('http://student.mit.edu/catalog/m1b.html'); urls.append('http://student.mit.edu/catalog/m1c.html'); urls.append('http://student.mit.edu/catalog/m2a.html'); urls.append('http://student.mit.edu/catalog/m2b.html'); urls....
import os import sys from api_client.application_api import create_app, retire_app, add_assignments, edit_app_assignment from api_client.application_extensive_search import search_application from api_client.blob_api import chunk_upload from config import config import helper.helper_methods as helper from Logs.log_con...
import io import matplotlib.pyplot as plt import numpy as np import seaborn as sns import torch import torch.nn.functional as F from PIL import Image from tensorboardX import SummaryWriter from torch import nn from tqdm import tqdm import pickle from datetime import date import dill from beam import BeamHelper import...
from metatools.deprecate import module_renamed module_renamed('sgactions.browsers')
# # Copyright 2021 Ocean Protocol Foundation # SPDX-License-Identifier: Apache-2.0 # import time from eth_utils import remove_0x_prefix from ocean_lib.enforce_typing_shim import enforce_types_shim from ocean_lib.web3_internal.contract_base import ContractBase from ocean_lib.web3_internal.wallet import Wallet @enforc...
colors_types = { 0: "Low", 1: "Medium", 2: "High" }
# Generated by Django 3.1.7 on 2021-05-01 00:05 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('envdaq', '0017_auto_20210430_2355'), ] operations = [ migrations.AlterField( model_name='daqcon...
#!/usr/bin/env python3 import tanrest, json, time, sys, base64 from pprint import pprint as pp from time import sleep import getpass import getopt from datetime import datetime, timedelta, timezone from dateutil import parser def usage(): print(""" Usage: actionfailures.py [options] Descriptio...
"""Constants for SIA.""" COUNTER_EVENTS = "events" COUNTER_VALID = "valid_events" COUNTER_FORMAT = "format" COUNTER_CRC = "crc" COUNTER_CODE = "code" COUNTER_TIMESTAMP = "timestamp" COUNTER_ACCOUNT = "account" COUNTER_USER_CODE = "user_code" IV = bytes.fromhex("00000000000000000000000000000000") EMPTY_BYTES = b"" RSP...
from datetime import datetime as dt def datetime_format(arg) -> str: """Formating datetime :param: Get datetime from db :type arg:? :return: Formated datetime :rtype: str """ if not arg: return None return dt.strftime(arg, "%Y-%m-%d %H:%M:%S")
# 실패율 def solution(N, stages): # 스테이지별 도달한 유저 수, 실패율 딕셔너리 선언 clear = dict() err_rate = dict() # stages에 없는 스테이지의 딕셔너리도 초기화 for i in range(N+1): clear[i+1] = 0 err_rate[i+1] = 0 # 스테이지별 도달한 유저 수 계산 for stage in stages: clear[stage] += 1 # N+1번째부터 도달한 유저가 없는 스테이지 탐...
#! /usr/bin/env python """API to use and import library for object recognition""" import numpy as np import tensorflow as tf import os from core import utils from PIL import Image __author__ = "Sayan Paul" __email__ = "sayanpau@usc.edu" IMAGE_H, IMAGE_W = 416, 416 OID_CLASS_NAMES_FILE = os.path.join(os.path.dirname...
"""A module containing facilities for loading data and QuasarNP models. Methods are provided for separately loading a QuasarNP model from a weights file as well as loading DESI data, both by exposure number and by directory. A method is also provided to load a DESI coadd file. Two legacy methods are provided to intero...
from .DynastyReader import DynastyReader from .TruyenTranhTuan import TruyenTranhTuan
import math from SignalChoice import * import logging class BeatDetector: def __init__(self, update_time_seconds, signal_chosen): """ Initialize the BeatDetector by setting a class instance variable so the detector knows how much time passes between updates so can correctly calculate bpm. ...
from .d_creator import GraphToArray, GraphBatchToGraph from .dataloader import Dataloader
# on charge la table avec toutes les donnees de SNe data_sn=np.loadtxt('CSP_photo/Data_all_SNe_CSP.dat',usecols=[1,2,3,4,5,6,7,8,9,10,11]).transpose() name_SN_CSP=np.array(np.genfromtxt('CSP_photo/Data_all_SNe_CSP.dat',usecols=[0],dtype='str')) ind_SN=np.where(np.array(name_SN_CSP)==SN_name)[0][0] c_light=299792.458...
import numpy as np def _rect_inter_inner(x1, x2): n1 = x1.shape[0]-1 n2 = x2.shape[0]-1 X1 = np.c_[x1[:-1], x1[1:]] X2 = np.c_[x2[:-1], x2[1:]] S1 = np.tile(X1.min(axis=1), (n2, 1)).T S2 = np.tile(X2.max(axis=1), (n1, 1)) S3 = np.tile(X1.max(axis=1), (n2, 1)).T S4 = np.tile(X2.min(axis=...
# -*- coding: utf-8 -*- """ Created on Fri May 01 02:10:31 2015 @author: Sarunya """ import sys import numpy as np from matplotlib import pyplot as plt #from cv2 import HOGDescriptor from skimage.feature import hog sys.setrecursionlimit(10000) clmax = 11 #clmax is amount of class def normHOG(images_file): img...
import json from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from rest_framework.authtoken.models import Token from rest_framework.test import APITestCase, APIClient from rest_framework import status from notes.apps.writer.models import Note, Notebook class NotebookTests(A...
from modules.statistics.api.views.mission_stats import MissionStatsView from modules.statistics.api.views.global_stats import GlobalStatsView from modules.statistics.api.views.user_stats import UserStatsView from modules.statistics.api.views.user_mission_stats import UserMissionStatsView
""" Log functions for writing csv and log files @author: Björn Hempel <bjoern@hempel.li> @version: 1.0 (2019-01-04) """ import datetime import os import random import time import torch from __args import * """ """ def getFormatedPath( path=None, settings={}, epoch=0, time=None, learning_rate=0....
#!/usr/bin/env python3 """ Tests models trained using voxel-level data from Biobank Scanner1 with reduced dimensionality through Principal Component Analysis (PCA), on previously unseen data from Biobank Scanner2 to predict brain age. The script loops over the 100 models created in comparison_pca_data_train_svm.py and...
"""An environment configuration.""" import logging # General app config LOG_LEVEL: int = logging.DEBUG DEBUG: bool = True # SQLAlchemy SQLALCHEMY_DATABASE_URI: str = ( 'postgresql+pygresql://<user>:<password>@localhost:5432/<database>' )
from __future__ import annotations import re import colour import itertools as it from typing import Iterable, Union, Sequence from abc import ABC, abstractmethod from manimlib.constants import BLACK, WHITE from manimlib.mobject.svg.svg_mobject import SVGMobject from manimlib.mobject.types.vectorized_mobject import V...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='evtools', version='1.0.0', description='', url='https://github.com/the-mace/evtools', py_modules=['tl_tweets', 'tl_weather', 'tl_stock', 'solarcity', 'tesla', 'tl_email'], license='MIT...
import typing # 遅延セグ木 class LazySegmentTree: def __init__( self, lis: list, op: typing.Callable[[typing.Any, typing.Any], typing.Any], ele: typing.Any, mapp: typing.Callable[[typing.Any, typing.Any], typing.Any], comp: typing.Callable[[typi...
"""Adds config flow for Mail and Packages.""" import logging from collections import OrderedDict import voluptuous as vol import os from homeassistant.components.lock import DOMAIN as LOCK_DOMAIN from homeassistant.components.binary_sensor import DOMAIN as BINARY_DOMAIN from homeassistant.components.sensor import DO...
# Vinayak Gajjewar 7/16/19 from __future__ import absolute_import, division, print_function, unicode_literals # Import TensorFlow and Keras import tensorflow as tf from tensorflow import keras # Import helper libraries import numpy as np import matplotlib.pyplot as plt # Print TensorFlow's version number to affirm ...
# -*- coding: utf-8 -*- """ Created on Sat Dec 19 15:08:54 2020 @author: Mateo """ # %% Preamble import numpy as np from HARK.interpolation import LinearInterp from HARK.datasets.cpi.us.CPITools import cpi_deflator from HARK import _log __all__ = [ "parse_time_params", "Sabelhaus_Song_cohort_trend", "S...
# -*- coding: utf-8 -*- from django.contrib import admin from models import * class ImageAdmin(admin.ModelAdmin): list_filter = ['album'] admin.site.register(PageApp_GalleryImages) admin.site.register(Album) admin.site.register(Image, ImageAdmin)
class Serializable(object): """Serializable from and to JSON with same mechanism as Keras Layer.""" def get_config(self): """Returns the current config of this object. # Returns Dictionary. """ raise NotImplementedError @classmethod def from_config(cls, con...
import argparse import os import json import xml.etree.ElementTree as ET def dir_path(string): if os.path.isdir(string): return string else: raise NotADirectoryError(string) parser = argparse.ArgumentParser(prog="compare-strings.py", description="Compares strings from a main resource file to o...
#!/usr/bin/env python """ MIT License Copyright (c) 2019 Piotr Styk <polfilm@gmail.com> 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 right...
from fastapi import APIRouter from app.api import endpoints api_router = APIRouter() api_router.include_router(endpoints.router, prefix="/authors", tags=["authors"])
from captcha.fields import ReCaptchaField from captcha.widgets import ReCaptchaV2Invisible, ReCaptchaV2Checkbox from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from django import forms class ContactForm(forms.Form): from_email = forms.EmailField(required=True) subject = form...
from Server import create_app from config.dev import DevConfig if __name__ == '__main__': app = create_app(DevConfig) app.run(**DevConfig.RUN_SETTING)
from django.urls import re_path from . import views urlpatterns = [ re_path(r'areas$', views.AreasView.as_view()), re_path(r'houses/index$', views.HousesIndexView.as_view()), re_path(r'houses/(?P<house_id>\d+)/images$', views.HousesImageView.as_view()), re_path(r'houses/(?P<pk>\d+)$', views.HousesInfoV...
"""Resampling estimator.""" import numpy as np from frites.estimator.est_mi_base import BaseMIEstimator from frites.utils import nonsorted_unique class ResamplingEstimator(BaseMIEstimator): """Trial-resampling estimator. In case of unbalanced contrast (i.e. when the number of trials per condition is ve...
from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * import sys sys.path.append('data') import resources import random sys.path.append('data') import resources WIDTH = 640 HEIGHT = 480 XCENTER = WIDTH//2 YCENTER = HEIGHT//2 EMOTEIDS = { 1 : ":/emotes/angry", 2 : ":/emotes/cringe"...
import os import sys import datetime import logging import requests import ee import re import time import json # name of image collection in GEE where we will upload the final data EE_COLLECTION = 'projects/resource-watch-gee/for_003_nrt_rw1_glad_deforestation_alerts' # name of the image collection in GEE where the ...
import os import shutil from pathlib import Path from neutro.src.util import loggerutil def save_block(height: int, block_json_string: str, block_hash: str): """saves a block and updates the list of height:hash for resolution of height from hash""" block_path = str(Path(__file__).parent.parent.parent) + \ ...
from __future__ import print_function import cgt import numpy as np from cgt import nn from sklearn import datasets from sklearn.cross_validation import train_test_split boston = datasets.load_boston() data = boston.data targets = boston.target nfeats = data.shape[1] # scale data # scaler = StandardScaler().fit(data...
""" Author: Josiah Buxton Description: Helper function to convert a private key denoted as hex to a format which can be inserted into a C program openssl ec -in <private-key.pem> -noout -text """ import argparse parser = argparse.ArgumentParser() parser.add_argument('-i', '--input', type=str, required=True, ...
#!/usr/bin/env python import tifffile from scipy import ndimage as ndi from imctools import library as lib import argparse import os import warnings from scipy import ndimage as ndi import numpy as np def crop_random_section(fn_stack, outfolder, basename, size, random_seed=None): """ :param fn_stack: :pa...
# -- IMPORTING LIBRARIES -- import pandas as pd from selenium import webdriver from bs4 import BeautifulSoup import time # -- STARTING CHROME WITH WEBDRIVER -- browser = webdriver.Chrome() # -- OPENING URL IN BROWSER -- url = 'https://www.zomato.com/indore/dine-out' browser.get(url) # -- ITERATING THROUGH THE PAG...
# Generated by Django 3.2.12 on 2022-02-12 04:49 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('back', '0015_community_phone'), ] operations = [ migrations.RemoveField( model_name='node', name='email', ), ]
"""Decord data specific functions"""
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
# FIle to creat ground truth npy file out of a single long exposure image. Use only for DRV import numpy as np import os import argparse import glob import cv2 parser = argparse.ArgumentParser() parser.add_argument('--gt_folder',help='path to the gt folder',default='/mnt/dataset_HDD/smitd/long',type=str) parser.add...
__version__ = '2.0.5' def get_version(): return __version__
from twitterscraper import query_tweets import datetime as dt import pandas as pd def tweet_scrape(tag, save, lang='en', limit=10, begindt=dt.date(2019, 1, 1), enddt=dt.date.today()): list_of_tweets = query_tweets(tag, lang=lang, limit=limit, begindate=begindt, enddate=enddt) for tweet in list_of_tweet...
import os ASYNC_FLAG = 'BAMBOO_ASYNC_OFF' def is_async(): return not os.getenv(ASYNC_FLAG) def set_async(on): if on: if not is_async(): del os.environ[ASYNC_FLAG] else: os.environ[ASYNC_FLAG] = 'True' def call_async(function, *args, **kwargs): """Potentially asynchrono...
# -*- coding: utf-8 -*- from . import companies from . import documents from . import fe_enums from . import utils_mh
#!/usr/bin/env python import praw import OAuth2Util import time r = praw.Reddit("OAuth2Util Demo by /u/SmBe19") o = OAuth2Util.OAuth2Util(r, print_log=True) sub = r.get_subreddit("askreddit") while True: o.refresh() sub.refresh() print("---") for post in sub.get_comments(limit=10): print(po...
""" Автор: Моисеенко Павел, группа № 1, подгруппа № 2. Задание: разработайте программу, которая выводит на экран с помощью ASCII-графики таблицу истинности на основе переданных ей на вход аргументов (логическое выражение, аргументы, результат вычисления выражения). """ values = ((0, 0), (0, 1), (...
""" The program REQUIRES the USER to enter the WIDGETS NUMBER and the GIZMOS NUMBER. Afterward, it displays the PARTIAL and TOTAL WEIGHTS of objects, considering that: - Weight WIDGET = 75 grams - Weight GIZMO = 112 grams """ # Declaration of VARIABLES / CONSTANTS WEIGHT_WIDGET = 75 # Weight WIDGET = 75 grams WEI...
#!/usr/bin/python3 #coding:utf-8 import rospy from vision.srv import VisionDetectService,VisionDetectServiceResponse,VisionDetectServiceRequest import json class VisionNode: def __init__(self): rospy.wait_for_service('/vision_service') rospy.init_node('test_vision_node', anonymous = True) ...
from common_utils.misc import find_registered registered_commands, registered_steps = find_registered(__file__, 'zci_bio.ncbi')
from jinja2 import Template from praw.models import Comment, Message import bot_logger import crypto import lang import models import utils def register_user(msg): user = models.User(msg.author.name) if not user.is_registered(): user.get_new_address() if user.address: content_repl...
from builtins import object # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import logging import os import sys try: from ..external.cloghandler import ConcurrentRotatingFileHandler as \ RFHandler except ImportError: # Next 2 lines are o...
"""Unit test configuration file.""" import os import platform import log import pytest ENV = 'TEST_INTEGRATION' # environment variable to enable integration tests REASON = "'{0}' variable not set".format(ENV) ROOT = os.path.dirname(__file__) FILES = os.path.join(ROOT, 'files') def pytest_configure(config): ...
''' Created on Jan 24, 2011 @author: Mark V Systems Limited (c) Copyright 2011 Mark V Systems Limited, All rights reserved. ''' from arelle import ViewFile, ModelDtsObject, XbrlConst, XmlUtil from arelle.XbrlConst import conceptNameLabelRole, standardLabel, terseLabel, documentationLabel from arelle.ViewFile import C...
""" COPYRIGHT INFORMATION --------------------- Some code in this file is licensed under the apache License, Version 2.0. http://aws.amazon.com/apache2.0/ This bot was created with Carberra's Tutorial: https://www.youtube.com/watch?v=lrE8YbyOePk&list=PLYeOw6sTSy6ZFDkfO9Kl8d37H_3wLyNxO&index=1 Any help a...
# terrascript/data/someara/tls.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:28:55 UTC) import terrascript class tls_certificate(terrascript.Data): pass class tls_public_key(terrascript.Data): pass __all__ = [ "tls_certificate", "tls_public_key", ]
#!/usr/bin/env python3 # coding:utf-8 import os import shutil from libs.utils import mkdir, cleandir, save_json, get_json from libs.logger import get_traceback from libs.layout_cad import LayoutCad class Cad(object): def __init__(self, project_id, project_path): self.project_id = project_id self...
import heapq def heapSearch( bigArray, k ): heap = [] # Note: below is for illustration. It can be replaced by # heapq.nlargest( bigArray, k ) word_dict = {} for item in bigArray: if item not in word_dict: word_dict[item] = 1 prev = 1 else: prev = word_dict[item] word_dict[item] += 1 if len(he...
# coding: utf-8 """ Lattice paths Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.  How many such routes are there through a 20×20 grid? """ from math import factorial import time def oneliner(): pass de...
from setuptools import setup setup( name='certifico', version='1.0.1', packages=['certifico'], include_package_data=True, install_requires=[ 'flask', 'Flask-PyMongo', 'Flask-WTF', 'sendgrid', 'rq', 'gunicorn' ], entry_points={ 'console...
import requests import json import encodings import numpy as np import matplotlib.pyplot as plt import encodings import math import io import time import struct address_list=['0'] btc_list=[0] throughput=[0] totaltx=0 lastblock=0 blocksdb=[] lastblockdb=0 blocksperfile=100 #for DB lastblockdbfile=open("lastblockdb...
from flask import Flask, request, render_template, copy_current_request_context from flask_socketio import SocketIO, emit from prospector.run import Prospector, ProspectorConfig from git import Repo from collections import defaultdict from watchdog.observers import Observer from watchdog.events import PatternMatchingEv...
__author__ = 'DWI'
heartbeat_requests = [ { "heartbeatRequest": [ { "cbsdId": "foo", "grantId": "foo1", "operationState": "foo2" } ] }, { "heartbeatRequest": [ { "cbsdId": "bar", "grantId...