content
stringlengths
5
1.05M
# Generated by Django 3.0.3 on 2020-10-19 10:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('modelzoo', '0025_auto_20201015_1628'), ] operations = [ migrations.AddField( model_name='model', name='slug', ...
import pytest import mugen.video.sizing as v_sizing from mugen.video.sizing import Dimensions @pytest.fixture def dimensions_4_3(): return Dimensions(720, 540) @pytest.fixture def dimensions_16_9(): return Dimensions(1920, 1080) @pytest.fixture def dimensions_21_9(): return Dimensions(1920, 822) @p...
# coding: utf-8 """ autoscaling OpenAPI spec version: 2018-06-21T02:22:22Z Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from ncloud_autoscaling.model.common_code import CommonCode # noqa: F401,E501 class ActivityLog(objec...
from unittest import TestCase from flaskphiid.annotation import Annotation, AnnotationFactory, MergedAnnotation from flaskphiid.annotation import unionize_annotations from flaskphiid.annotation import IncompatibleTypeException class AnnotationTest(TestCase): def setUp(self): # sample text self.s...
'''Wrapper for rowio.h Generated with: ./ctypesgen.py --cpp gcc -E -I/Applications/GRASS-7.8.app/Contents/Resources/include -D_Nullable= -I/Users/cmbarton/grass_source/grass-7.8.3/dist.x86_64-apple-darwin18.7.0/include -I/Users/cmbarton/grass_source/grass-7.8.3/dist.x86_64-apple-darwin18.7.0/include -D__GLIBC_HAV...
"""Run inference a DeepLab v3 model using tf.estimator API.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys import tensorflow as tf import numpy as np import deeplab_model from utils import preprocessing from utils ...
from django.contrib import admin # Register your models here. from e_secretary.models import Course, Didaskalia, Orologio, Announcement, Drastiriotita, Professor, Student, Dilosi, Certificate, Thesis, SimmetoxiDrastiriotita, Event, Secr_Announcement, Profile @admin.register(Course) class CourseAdmin(admin.ModelAdmi...
import torch import math from torch.autograd import Variable import torch.nn.functional as F import table import table.IO import table.ModelConstructor import table.Models import table.modules from table.Utils import add_pad, argmax from table.ParseResult import ParseResult from table.Models import encode_unsorted_bat...
pupils = int(input('Введите число школьников: ')) apples = int(input('Введите число яблок: ')) celoe, ostatok = divmod(apples, pupils) print('Каждому: ', celoe) print('В корзине: ', ostatok)
import discord_logging log = discord_logging.get_logger(init=True) import comments import utils import static from praw_wrapper import reddit_test from praw_wrapper.reddit_test import RedditObject from classes.submission import Submission from classes.subscription import Subscription from classes.subreddit import Sub...
# Copyright 2019 The TensorTrade Authors. # # 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...
from django.conf.urls import url from . import views app_name = "newsletter" urlpatterns = [ url(r'^subscribe/(?P<user_pk>\d+)/$', views.subscribtion, name='subscribe'), url(r'^unsubscribe/(?P<user_pk>\d+)/$', views.subscribtion, name='unsubscribe'), ]
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for # full license information. import gc import inspect import os import weakref import time import logging import importlib logger = logging.getLogger(__name__) logger.setLevel(level=logging.INFO) ...
#!/usr/bin/env python import subprocess from glob import glob from random import shuffle import argparse parser = argparse.ArgumentParser() parser.add_argument('--basic', action='store_true') parser.add_argument('--api', action='store_true') parser.add_argument('--single', action='store_true') parser.add_argument('-...
import json import boto3 import uuid import time dynamodb = boto3.client('dynamodb') def lambda_handler(push_notification_json, context): """Store a push notification in a database. :param push_notification_json: dict representing the JSON of a push notification :param context: not used :return: '', ...
""" from https://github.com/keithito/tacotron """ ''' Defines the set of symbols used in text input to the model. The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details. ''' # from t...
"""Helpers for Diviner data.""" from pathlib import Path import numpy as np import xarray as xr import rasterio as rio import roughness.helpers as rh import roughness.config as cfg DIVINER_WLS = [ 7.8, # C3 8.25, 8.55, (13 + 23) / 2, (25 + 41) / 2, (50 + 100) / 2, (100 + 400) / 2, # C9 ] ...
import string import unittest from email import _header_value_parser as parser from email import errors from email import policy from test.test_email import TestEmailBase, parameterize class TestTokens(TestEmailBase): # EWWhiteSpaceTerminal def test_EWWhiteSpaceTerminal(self): x = parser....
import results from pathlib import Path DO_MATCH_BASIC = Path("queries/do_match4.sql").read_text() # threshold 400 - for fast matching #DO_MATCH_SLOW = Path("queries/do_match_slower.sql").read_text() # threshold 10000 - for slower but more accurate DO_MATCH_TRIGRAM = Path("queries/do_trigram_match2.sql").read_text() ...
#!/usr/bin/python # -*- coding: UTF-8 import os import sys import json import re import codecs import shutil import platform import importlib Py_version = sys.version_info Py_v_info = str(Py_version.major) + '.' + str(Py_version.minor) + '.' + str(Py_version.micro) if Py_version >= (3,5,0) and Py_vers...
# -*- coding: utf-8 -*- """ @contact: lishulong.never@gmail.com @time: 2018/4/8 下午2:55 """
import pytz import datetime from django.http import JsonResponse class TimeCheckMiddleware(object): tz = pytz.timezone('Asia/Seoul') service_time = [ datetime.time(21, 0, 0, tzinfo=tz), datetime.time(6, 0, 0, tzinfo=tz) ] def __init__(self, response): self.get_response = resp...
from django.apps import AppConfig class BlogConfig(AppConfig): name = 'blog' verbose_name = '博客' def ready(self): from .cache import (on_article_init, on_article_save, on_article_delete)
""" helper functions for pybullet """ import pybullet as p def add_goal(bullet_client, position, radius=0.05, color=[0.0, 1.0, 0.0, 1]): collision = -1 visual = bullet_client.createVisualShape(p.GEOM_SPHERE, radius=radius, rgbaColor=color) goal = bullet_client....
from mcpi.minecraft import Minecraft # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 # Author (©): Alvaro del Castillo from minecraftstuff import MinecraftDrawing class Server: """ A Server manages the connection with the Minecraft server. Every World must have a Server in which...
from .db import get_connection, get_data_dict from flask import render_template, url_for, make_response, session import requests import traceback from datetime import datetime from time import sleep, process_time from .config import load_config, is_debug from .etsy import send_etsy_post_request from .sources.etsy impor...
from . import TypeChecker from . import Tools #from . import MouseControl from . import Filters from .D2Point import * from .pyon import *
import os import re import subprocess import winreg import yaku.task from yaku.tools.mscommon.common \ import \ read_values, read_value, get_output def _exec_command_factory(saved): def msvc_exec_command(self, cmd, cwd, env=None): new_cmd = [] carry = "" for c in cmd: ...
default_app_config = 'language_acts.twitterhut.apps.TwitterhutConfig'
from .schema.app import saveApplication from .schema.code_mod import (makeUniqueCodeSnippet, makeUniqueModule, saveModule, saveModuleFile, savePackage, savePackageFile) from .schema.drv_inst import setInstrument, uploadDriver from .schema.record import newReco...
from models.game.bots.Bot import Bot from models.game.Game import Game from models.data.GameDataModel import GameDataModel from models.data import DatabaseConnection as DB class Experiment(object): def __init__(self, player1, player2, iterations, record=True): """ An Experiment is a sequence of several ga...
from .raw import RawFIFF
import typing as T from screeninfo.common import Monitor # https://developer.apple.com/documentation/appkit/nsscreen/1388371-main # first entry in array is always the primary screen def check_primary(screens: T.Any, screen: T.Any) -> bool: return screen == screens[0] def enumerate_monitors() -> T.Iterable[Moni...
from guild import Guild from player import Player player = Player("George", 50, 100) print(player.add_skill("Shield Break", 20)) print(player.player_info()) guild = Guild("UGT") print(guild.assign_player(player)) print(guild.guild_info())
from rest_framework_simplejwt.authentication import JWTTokenUserAuthentication class CookieAccessTokenAuthentication(JWTTokenUserAuthentication): def authenticate(self, request): raw_token = request.COOKIES.get('access_token', None) if raw_token is None: return None validated...
def printTuple(): li=list() for i in range(1,21): li.append(i**2) print(tuple(li)) printTuple()
from prereise.cli.data_sources import get_data_sources_list from prereise.cli.data_sources.solar_data import ( SolarDataGriddedAtmospheric, SolarDataNationalSolarRadiationDatabase, ) from prereise.cli.data_sources.wind_data import WindDataRapidRefresh def test_get_data_sources_list(): data_sources_list = ...
from unittest import TestCase import chff class Testchff(TestCase): def test_is_string(self): s = chff.hello() self.assertTrue(isinstance(s, str))
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright 2019 Surface Concept GmbH 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 ...
import os import json from populus import ASSETS_DIR from .versions import ( V1, V2, V3, V4, V5, V6, V7, LATEST_VERSION ) DEFAULT_V1_CONFIG_FILENAME = "defaults.v1.config.json" DEFAULT_V2_CONFIG_FILENAME = "defaults.v2.config.json" DEFAULT_V3_CONFIG_FILENAME = "defaults.v3.config.jso...
from . import base from . import bootstrap_filter, diagonal_extended_kalman_filter, extended_kalman_filter, unscented_kalman_filter
from typing import ClassVar, List from ...constants import ApiKey from ..base import RequestData class ForgottenTopicsData: topic: str partitions: List[int] def __init__(self, topic: str, partitions: List[int]): """ :param topic: Name of topic :type topic: str :param par...
""" UTILIZAÇÃO DE APRENDIZADO PROFUNDO (DEEP LEARNING) PARA VERIFICAÇÃO DA ORIENTAÇÃO DE UMA IMAGEM E ROTAÇÃO ADEQUADA DA MESMA. AO SER ENVIADA UMA IMAGEM (EM QUALQUER FORMATO), RETORNA-SE O NÚMERO DE ROTAÇÕES NECESÁRIAS E A IMAGEM ROTACIONADA CORRETAMENTE. OS PASSOS REALIZADOS SÃO: 1) LEITURA DA ...
#!/usr/bin/python import time import subprocess import telepot import os import urllib.request import re import json import requests from bs4 import BeautifulSoup from urllib.request import urlopen import youtube_dl def handle(msg): chat_id = msg['chat']['id'] command = msg['text'] print ("Com...
#!/user/bin/env python # -*-coding:utf-8 -*- # @CreateTime : 2021/10/24 8:48 # @Author : xujiahui # @Project : robust_python # @File : validate.py # @Version : V0.0.1 # @Desc : 一个简单的使用元类组合验证的例子 class BetterPolygon: sides = None # Must be specified by subclass def __init_...
from .distributed_module import DistributedModule
import os # To access tokens # Copyright (c) 2015-2016 Slack Technologies, Inc from slack import WebClient # Copyright (c) 2015 by Armin Ronacher and contributors. See AUTHORS for more details. from flask import Flask from flask import request, make_response, Response from flask import redirect from flask_sqlalchem...
# Generated by Django 2.2.8 on 2020-03-19 15:19 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('fyle_expense', '0001_initial'), ] operations = [ migrations.CreateModel( na...
from collections import deque from typing import Any, Optional import shelve import threading class MessageQueue: def __init__(self, max_size: int = 1000, persistence_path: Optional[str] = None): self._lock = threading.Lock() if persistence_path: self._shelve = shelve.open(persistence_...
import datetime import json import logging import operator import os from collections import defaultdict from datetime import date import vk_api import vk_api.exceptions from vk_api import execute #from .TimeActivityAnalysis import VKOnlineGraph from .VKFilesUtils import check_and_create_path, DIR_PREFIX class VKAc...
""" Evaluation of treatment effect estimation """ import numpy as np def transformed_outcome_loss(tau_pred, y_true, g, prob_treatment): """ Calculate a biased estimate of the mean squared error of individualized treatment effects tau_pred : array The predicted individualized treatment effects. ...
""" Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number. Example create_phone_number([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # => returns "(123) 456-7890" """ def create_phone_number(n): return "({}{}{}) {}{}{}-{}{}{}{}".format(*n)
import salt.modules.baredoc as baredoc from tests.support.mixins import LoaderModuleMockMixin from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase class BaredocTest(TestCase, LoaderModuleMockMixin): """ Validate baredoc module """ def setup_loader_modules(self): ...
from django.shortcuts import redirect def index(request): return redirect('/app/') def stats(request): return redirect('/app/stats')
""" Module for accessing the sqlite monster hunter db from """ import os import sqlite3 import json from mhapi import model def field_model(key): """ Model to replace each row with the value of single field in the row, with the specified key. """ def model_fn(row): return row[key] re...
"""Sample app.""" from aws_cdk import aws_sns as sns from aws_cdk import core class MyStack1(core.Stack): # pylint: disable=too-few-public-methods """My stack.""" def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: """Instantiate class.""" super().__init__(scope, id, **kwar...
from torch.utils.data import DataLoader from torchvision import transforms as tr import pytorch_lightning as pl from intphys.data import * MAX_IMAGE_SIZE = 640 class DataModule(pl.LightningDataModule): def __init__(self, config): super().__init__() image_dim = config.get("image_size", 112) ...
import pytest from yt.data_objects.static_output import Dataset from yt.geometry.grid_geometry_handler import GridIndex from yt.loaders import load, load_simulation from yt.utilities.exceptions import ( YTAmbiguousDataType, YTSimulationNotIdentified, YTUnidentifiedDataType, ) from yt.utilities.object_regis...
import csv import collections import os.path import re import operator import sys import datetime import shutil import EsoLuaFile import EsoLuaTokenizer from EsoLuaTokenizer import CLuaTokenizer from EsoLuaTokenizer import CLuaTokenIterator from EsoLuaTokenizer import Token from EsoLuaFile import CEsoLuaFi...
import sys import os import tensorflow.compat.v1 as tf from utils import remove_missing from constants import LOG_DIR import tensorflow.contrib.slim as slim class BaseTrainer(): def __init__(self, model, data_generator, pre_processor, num_epochs, optimizer='momentum', momentum=0.9, lr_policy='con...
class Invoice: """This class contains basic information about an invoice :param title: Product name :type title: str :param description: Product description :type description: str :param start_parameter: Unique bot deep.linking parameter that can be used to generate this invoice :type start...
from keras.callbacks import TensorBoard import tensorflow as tf from keras.callbacks import ModelCheckpoint, EarlyStopping import numpy as np from sklearn.metrics import classification_report from frame_quality_recognizer.data_creator import FrameQualityRecognizerCreator from frame_quality_recognizer.model import Fram...
import pytest import numpy as np import torch import pyro.distributions as dist from example_systems.three_states import three_state_hmm from perm_hmm.models.hmms import PermutedDiscreteHMM from perm_hmm.util import all_strings, id_and_transpositions, ZERO from tests.min_ent import MinEntropyPolicy from perm_hmm.polici...
# https://leetcode.com/discuss/interview-question/313719/Amazon-or-Online-Assessment-2019-or-Movies-on-Flight class Solution: def moviesOnFlight(self, movieDuration, d): # we need d-30 maximum. d = d-30 # keep all indexes in hashmap # key: movie duration, value: index hm = d...
import pandas as pd import numpy as np from src import datasets import os from PIL import Image import torch class FishSeg: def __init__(self, split, transform=None, datadir="", n_samples=None, habitat=None): self.split = split self.n_classes = 2 self.datadir = datadir self.t...
""" This script is designed to align NP-bracketed PTB dependency trees to tokens with base NPs derived from the constinuency trees. The bulk of this code exists to handle edge cases introduced by re-attaching heads when collapsing tokens within BNPs. Some edge cases are under-specified in previous work. Our work is ...
# coding=utf-8 # # 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 # di...
HELP_TEXT = """__**Я устроился на работу диджеем в этот чат и вот че я могу:**__ **/skip** __Пропустить играющую ща музыку__ **/play** __Сыграть вашу музыку по заявке ('/play Название песни' или '/play' ответом на файл)__ **/dj_vlados_join** __Пригласить меня, DJ Vlados, за диджейский пульт__ **/dj_vlados_leave** __За...
# Generated by Django 3.2.7 on 2021-10-06 08:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_movie'), ] operations = [ migrations.AlterField( model_name='movie', name='genres', fie...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.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 ANSIBLE_METADATA = {'metadata_ve...
#!/usr/bin/env python """Module with repackers implementations for various platforms."""
import pandas as pd from joblib import load, dump from matplotlib import pyplot as plt from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score from sklearn.metrics import plot_confusion_matrix # train the model with inbuilt classifier def train(): """Data set reading""" ...
from .Regression import Regression from .exceptions import BrokenModel import statsmodels.formula.api as smf class LogisticRegression(Regression): def __init__( self, data, formula, significance_level=0.05, model_builder=None, family=None, groups=None, parent=None ): super().__init__( data=data, formula=fo...
"""Serializers for the use with rest-pandas""" from rest_framework import serializers from .models import MQTTMessage import re import copy class MessageSerializer(serializers.ModelSerializer): class Meta: model = MQTTMessage fields = ['id', 'time_recorded', 'topic', 'payload'] pandas_in...
import json as j import requests from snake_tail import SNAKE_URL def samples(file_type=None, limit=None, filter=None, operator=None, order=None, sort=None, json=False, verify=True, from_=None): # pylint: disable=redefined-builtin url = SNAKE_URL + "/store" args = [] if file_type: args += ['fil...
from spanet.dataset.jet_reconstruction_dataset import JetReconstructionDataset from spanet.dataset.event_info import EventInfo
# Apache Thrift Binary Protocol Struct 2.0 Writer in Python from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from thrift import Thrift class Trade: def __init__(self): symbol="" price=0.0 size=0 timestamp=0.0 trans = TTransport.TFileObjectTra...
# Escolha 1 (motorista) print(f'''De segunda a sábado {nick} roda seu táxi, muito trabalhador', pois tinha dois filhos pequenos para sustentar, 'tinha saido de casa para trabalhar as 14:00 hrs,já cansado do dia corrido, as 20:00 hrs ele já estava voltando pra casa,quando então, uma passageira o chamou acenando para...
from ....core import * from .base import * from .voc import * from .coco import * import logging logger = logging.getLogger(__name__) def get_dataset(root='~/.mxnet/datasets/voc', index_file_name='trainval', name=None, \ classes=None, format='voc', Train=True, **kwargs): """ Parameters ---...
from PIL import Image, ImageStat import os import shutil ''' This program opens images in pillow and stores a calculated mean value It then iterates through the directory comparing mean values Any images with matching mean values are stored in dupes list It then moves duplicates into a duplicate folder. ''' ...
from bs4 import BeautifulSoup def parse_profile(profile_id, html_page): """This function parses the html page, looking for profile data and returns a dict """ soup = BeautifulSoup(html_page, "html.parser") data_structure = { 'age': ['span', {'class': 'profile-basics-asl-age'}], 'location': ...
#!/usr/bin/env python3 # # MIT License # # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP # # 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 w...
from __future__ import print_function import Pyro4 import bench obj=bench.bench() daemon=Pyro4.Daemon() uri = daemon.register(obj,"example.benchmark") print("Server running, uri = %s" % uri) daemon.requestLoop()
""" Compose and send recommendation emails to arxiv-sanity-lite users! I run this script in a cron job to send out emails to the users with their recommendations. There's a bit of copy paste code here but I expect that the recommendations may become more complex in the future, so this is ok for now. You'll notice tha...
# Angold4 20200509 C1.1.20 from random import randint def shuffle(*data): repeat = [] shuffle = [] length = len(data) while True: number = randint(0, length-1) if number in repeat: if len(repeat) == length: return shuffle else: repeat.app...
#!/usr/bin/env python from distutils.core import setup setup(name='pyERA', version='0.1', url='https://github.com/mpatacchiola/pyERA', description='Implementation of the Epigenetic Robotic Architecture (ERA). It includes standalone classes for Self-Organizing Maps (SOM) and Hebbian Learning', author='Massimil...
import numpy from copy import deepcopy from handwriting_features.data.utils.math import derivation from handwriting_features.data.utils.dsp import LowPassFilter, GaussianFilter from handwriting_features.features.implementation.conventional.spatial import stroke_length from handwriting_features.features.implementation.c...
try: from .svbcomp import load2 except ImportError: from ._compress import load2 class Postings(): """ The postings for a single term, which is a sorted list of, by index format: * existence: 1-tuple of (docId) * frequency: 2-tuple of (docId, frequency) * positions: 3-tuple of (...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # created by kamoshiren import telebot from telebot.types import Message token = "" # Inser your Telegram bot token here bot = telebot.TeleBot(token) keyboard1 = telebot.types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True) keyboard1.row('О нас', 'Наш и...
# Generated by Django 3.1 on 2020-09-27 20:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('community', '0007_auto_20200927_2107'), ] operations = [ migrations.AlterField( model_name='community', name='key', ...
import pandas as pd import pickle import os from settings import DATA_DIR fields = ['hour', 'C1', 'C14', 'C15', 'C16', 'C17', 'C18', 'C19', 'C20', 'C21', 'banner_pos', 'site_id','site_domain', 'site_category','app_id','app_domain', 'app_category', 'device_model', 'device_type', 'device_c...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2019-09-24 15:45:34 # @Author : Kaiyan Zhang (kyzhang@ir.hit.edu.cn) # @Link : https://github.com/iseesaw # @Version : $Id$ import json import argparse import numpy as np import matplotlib.pyplot as plt from visual import load_result, get_pair...
#!/usr/bin/env python import pathlib from setuptools import setup setup( name="ipytest", version="0.12.0", description="Unit tests in IPython notebooks.", long_description=pathlib.Path("Readme.md").read_text(), long_description_content_type="text/markdown", author="Christopher Prohm", url=...
''' Принадлежит ли точка квадрату - 2 ''' def IsPointInSquare(x, y): if (abs(y) <= -abs(x) + 1): print('YES') else: print('NO') x = float(input()) y = float(input()) IsPointInSquare(x, y)
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ # Create your models here. @python_2_unicode_compatible class Applicator(models.Model): name = models.CharField(max_length=2...
import os, os.path import subprocess from distutils.core import setup from py2exe.build_exe import py2exe PROGRAM_NAME = 'icom_app' PROGRAM_DESC = 'simple icom app' NSIS_SCRIPT_TEMPLATE = r""" !define py2exeOutputDirectory '{output_dir}\' !define exe '{program_name}.exe' ; Uses solid LZMA compression. Ca...
#!/usr/bin/python import libvirt import sys import time class getKVMInfo(object): def __init__(self,dom_name): self.conn = libvirt.open("qemu:///system") self.dom = self.conn.lookupByName(dom_name) def __del__(self): self.conn.close() def cpuTime(self,type): start = self.dom.getCPUStats(1,0)[0...
# The MIT License (MIT) # # Copyright (c) 2017 Michael McWethy for Adafruit Inc # # 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import argparse import sys import matplotlib matplotlib.use('Agg') matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['svg.fonttype'] = 'none' from deeptools import cm # noqa: F401 import matplotlib.pyplot as plt from scipy import interpolate ...
def sheet1(): res = '' return res def workbook(): """ 报表自定义获取函数,返回报表列表打包至单个文件中 """ res = [] st1 = sheet1() res.append(st1) return res