content
stringlengths
5
1.05M
from chainer_chemistry.dataset.preprocessors.ggnn_preprocessor import GGNNPreprocessor, GGNNSparsePreprocessor # NOQA class RelGCNPreprocessor(GGNNPreprocessor): """RelGCN Preprocessor Args: max_atoms (int): Max number of atoms for each molecule, if the number of atoms is more than this ...
"""Main backend component of the map viewer. This module maintains the main map state representation, which is regularly pushed to the database. """ __version__ = '0.0.1a0'
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v3/proto/services/customer_client_link_service.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google....
import json import sys, os import sys # source_path = os.path.join(file_path, 'UI/source') # sys.path.insert(1, source_path) from pprint import pprint from flask import Flask, request, send_file from flask import render_template, send_from_directory from flask_cors import CORS from flask_socketio import SocketIO, se...
import os # from elasticsearch import Elasticsearch from flask import Flask from flask_sqlalchemy import SQLAlchemy # from flask_migrate import Migrate from flask_cors import CORS # from dotenv import load_dotenv # load_dotenv() # set up extensions db = SQLAlchemy() # migrate = Migrate() cors = CORS() app_setting...
""" Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets. Downloads, docs, tutorials: http://www.blynk.cc Sketch generator: http://examples.blyn...
from django import forms from .models import Create_Post class Create_PostForm(forms.ModelForm): class Meta: model = Create_Post exclude = ['view_count', 'like_set', 'author']
import sys import pygame as pg from settings import * from tool_button import ToolButton from axe_tool_button import AxeToolButton from net_tool_button import NetToolButton from shovel_tool_button import ShovelToolButton from megaphone_tool_button import MegaphoneToolButton from mouse_pointer import MousePointer from a...
# -*- coding: utf-8 -*- """ File: test_vectorization.py Author: Wen Li Email: wen.li@ucl.ac.uk Github: http://github.com/spacelis Description: Test vectorization """ from collections import defaultdict from itertools import cycle import numpy as np import pandas as pd import xarray as xr _A = 'This is not a test.' _...
from torch import nn import torch.nn.functional as F from .utils import * from fastai.vision.models.unet import _get_sz_change_idxs, hook_outputs from fastai.layers import init_default, ConvLayer from fastai.callback.hook import model_sizes def conv2d(ni:int, nf:int, ks:int=3, stride:int=1, padding:int=None, bias=Fals...
import logging # The OrchestrationStep class was moved to another file because of circular imports problems class OrchestrationStep: def __init__(self, orchestrator): # TODO: Figure a way to add typing here, or at least not use the orchestrator as context passing mechanism self.orchestrator = orch...
from pprint import pprint import overwatch.stats stats = overwatch.stats.query('pc', '현종환-3104') pprint(stats, indent=2) """ { 'competitive': { 'heroes': { 'bastion': { 'all_damage_done': 2070, 'all_damage_done_avg_per_10_min': 79.08, ...
import random from hangman_art import stages, logo from hangman_words import word_list from replit import clear print(logo) game_is_finished = False lives = len(stages) - 1 chosen_word = random.choice(word_list) word_length = len(chosen_word) #Create an empty List called display. #For each letter in the chosen_word,...
# Given some integer, find the maximal number you can obtain by deleting exactly one digit of the given number. # # Example # # For n = 152, the output should be # deleteDigit(n) = 52; # For n = 1001, the output should be # deleteDigit(n) = 101. def deleteDigit(n): num = 0 s = str(n) for i in range(len(s...
import requests from requests.exceptions import Timeout from bs4 import BeautifulSoup import os from slugify import slugify def _add_unique_postfix(fn): # __author__ = 'Denis Barmenkov <denis.barmenkov@gmail.com>' # __source__ = 'http://code.activestate.com/recipes/577200-make-unique-file-name/' if not os....
# https://en.wikipedia.org/wiki/Affine_cipher # https://id0-rsa.pub/problem/5/ dict = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', ',', '.'] def encrypt(x, a, b, dict): i = dict.index(x) ciph = (a*i + b) % len(dict) retur...
# /*************************************************************************** # # @package: franka_tools # @metapackage: franka_ros_interface # @author: Saif Sidhik <sxs1412@bham.ac.uk> # # **************************************************************************/ # /*********************************************...
""" 问题描述:汉诺塔问题比较经典,现在修改一下规则:现在限制不能从最左侧的塔直接移动到最右侧, 也不能从最右侧直接移动到最左侧,而必须经过中间,求当塔有N层的时候,打印最优移动过程和最优 移动总步数。比如N=2,则打印: move 1 from left to mid move 1 from mid to right move 2 from left to mid move 1 from right to mid move 1 from mid to left move 2 from mid to right move 1 from left to mid move 1 from mid to right it will mov...
import uuid import base64 import boto3 from flask import current_app as app from cryptography.fernet import Fernet from pymemcache.client import base from botocore import exceptions as botoexceptions class IncogCrypto(object): def __init__(self): self.kms_key_id = app.config['KMS_KEY_ID'] self.k...
# -*- coding: utf-8 -*- """ Print detailed information about the experiment and the software environment under which it was performed. This action is intended to aide in recreating and reproducing experiments. """ __author__ = "Brian Connelly <bdc@bconnelly.net>" __credits__ = "Brian Connelly" import datetime import...
import copy import numpy as np import pandas as pd from skimage.measure import label, moments, regionprops_table def major_minor_axis_ratio(prop, **kwargs): """Return the ratio of the major axis length to the minor axis length Args: prop (skimage.measure.regionprops): The property infor...
class Solution: def addDigits(self, num): """ :type num: int :rtype: int """ lis = list(str(num)) while(len(lis)!=1): summ = 0 for item in lis: summ += int(item) lis = list(str(summ)) return int(lis[0])
# Copyright (c) 2019 PaddlePaddle 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 app...
import sys def solve(x, z): nx, nz = len(x), len(z) # Size |X| x |Z|. Could be |X| x 2 dp = [[0 for j in range(nx)] for i in range(nz)] for j in range(nx): if x[j] == z[0]: dp[0][j] = 1 for i in range(1, nz): counter = 0 for j in range(i, nx): coun...
from kivy.lang import Builder from kivy.uix.image import Image class Entity(Image): Builder.load_file('views/tilemap/entity.kv') def __init__(self, coord, *args, **kwargs): super().__init__(*args, **kwargs) self.coord = coord
import stactools.core stactools.core.use_fsspec() def register_plugin(registry): """Register subcommands""" from stactools.nrcan_spot_ortho import commands registry.register_subcommand(commands.create_spot_command) __version__ = '0.1.0' """Library version"""
import shutil import os from pathlib import Path import backupFunctions as bckp import sys while True: function_call = input(">> ") if function_call == 'compare dirs': dirA = input("Dir A: ").replace('\"','') dirB = input("Dir B: ").replace('\"','') bckp_struct = bckp.backup_struct() ...
# encoding: utf-8 import fcm_fnn import pickle def loadDataSet(filepath): with open(filepath) as f: rawList = map(lambda line: float(line.strip()), f.readlines()) labelSet = [] testSet = [] for i in range(8, 8 + 500): labelSet.append((rawList[i:i+4], rawList[i+1:i+5])) ...
from django.conf.urls import url from . import views from updown.views import AddRatingFromModel app_name = 'forum' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^index/$', views.index, name='index'), url(r'^about/$', views.about, name='about'), url(r'^login/$',views.user_login,name='user...
""" Base class for asymmatric bath discretizations """ from mapping.star.discretized_bath.base.base import BaseDiscretizedBath class BaseDiscretizedAsymmetricBath(BaseDiscretizedBath): """ Generation of coefficients for logarithmic discretization of bosonic baths """ def __init__(self, discret...
def selection_14(): # Library import import numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # Library version matplotlib_version = matplotlib.__version__ numpy_version = numpy.__version__ # Histo binning xBinning = numpy.li...
from .base import ( create_mixture_spectra, create_prototypical_spectra, create_single_source_spectra, ) __all__ = [ "create_mixture_spectra", "create_prototypical_spectra", "create_single_source_spectra", ]
"""description: helpful util functions for tensor management """ import logging import numpy as np import tensorflow as tf from tronn.util.utils import DataKeys def build_stack(inputs, params, stack): """take a stack of layers (functional, not object oriented) and stack them """ outputs = dict(inpu...
from nose.tools import assert_true, assert_false, assert_raises try: from nose.tools import assert_is_instance, assert_dict_equal except ImportError: from landlab.testing.tools import assert_is_instance, assert_dict_equal from six import StringIO from landlab.core import load_params from landlab.testing.tools ...
from setuptools import setup import io from dash_flask_login import __version__ setup( name='dash_flask_login', version=__version__, # noqa: F821 author='Gideon Whitehead', author_email='gideon.whitehead@uphs.upenn.edu', packages=['dash_flask_login'], package_data={'': ['dash_flask_login/templ...
''' functional test to delete product ''' from django.urls import reverse from mixer.backend.django import mixer import pytest from .base import FunctionalTest pytestmark = pytest.mark.django_db class ProductDeleteTest(FunctionalTest): """ testcase product delete """ @pytest.mark.integration def test_d...
# Generated by Django 3.0.8 on 2020-08-02 21:49 import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0004_auto_20200803_0028'), ] operations = [ migrations.AlterField( model_name='blogpost', nam...
import os import pymel.core as pm import lct.src.core.lcColor as lcColor import lct.src.core.lcConfiguration as lcConfiguration import lct.src.core.lcGeometry as lcGeometry import lct.src.core.lcPath as lcPath import lct.src.core.lcPlugin as lcPlugin import lct.src.core.lcUI as lcUI import lct.src.core.lcUtility as l...
import subprocess import smtplib def send_mail(email, password, message): server = smtplib.SMTP("smtp.gmail.com", 587) server.starttls() server.login(email, password) server.sendmail(email, email, message) server.quit() email = input("[+] Enter Email on which you want to recieve WIFI passwords:...
from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db.models import Q from django.core.exceptions import MultipleObjectsReturned from django.forms.util import ErrorDict, ErrorList from cyder.cydhcp.vlan.models import Vlan from cyder.cydhcp.network.models import Network from cyder.cydhcp...
import pathlib import tarfile import io from PIL import Image from pathlib import Path import torch from src.utils.common import merge_list_2d, unpack_tar_archive_for_paths IDENTITY = lambda x : x class TarDataset(torch.utils.data.IterableDataset): def __init__(self, path: Path, transform=IDENTITY): sup...
import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import normal_init from mmdet.core import delta2bbox3D from mmdet.ops import nms from .anchor_head_3d import AnchorHead3D from ..registry import HEADS @HEADS.register_module class RPNHead3D(AnchorHead3D): def __init__(self, in_chan...
# pylint: disable=arguments-differ, method-hidden from typing import Any import json from datetime import datetime, date, timedelta class DateTimeEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, (datetime, date)): return obj.isoformat() return super(DateTimeEncode...
import numpy as np import torch import torch.nn as nn from torch import optim from zz.autoEncoder import Autoencoder class Train_Auto_encoder: def train_auto_encoder(self, data_loader_list, train_parameters, saved_model_name, device): model = self.__train(data_loader_list, train_parameters, saved_model_n...
# 1523. Count Odd Numbers in an Interval Range # User Accepted:4747 # User Tried:4888 # Total Accepted:4899 # Total Submissions:9570 # Difficulty:Easy # Given two non-negative integers low and high. # Return the count of odd numbers between low and high (inclusive). # Example 1: # Input: low = 3, high = 7 # Output: 3...
import pickle from keras.models import load_model from sklearn.preprocessing import MultiLabelBinarizer from gensim import models from nltk.tokenize import RegexpTokenizer from stop_words import get_stop_words import numpy as np import subprocess with open('data/processed/genre_id_to_name_dict.pkl','rb') as f: gen...
# -*- coding: utf8 -*- import json import time from aliyunsdkcore.acs_exception.exceptions import ClientException from aliyunsdkcore.acs_exception.exceptions import ServerException from aliyunsdkcore.client import AcsClient from aliyunsdkcore.request import CommonRequest def fileTrans(akId, akSecret, appKey, fileLink) ...
fonts = { 10 : { 33 : (2, 12, memoryview(b'\xff\xff\xff????\xff??\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xc0\xc0\xc0\xc0\x00\xc0\xc0\x00\x00')) , 34 : (4, 12, memoryview(b'\xff\xff\x0f\x0f\x0f\xff\xff\xff\xf...
from fractions import Fraction Rational = Fraction
import pytest from datetime import datetime, timedelta from habit.habit_model import Habit, HabitHistory, Base from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker @pytest.fixture(scope='function') def setup_databasee(): engine = create_engine('sqlite://') Base.metadata.create_all(eng...
from difflib import SequenceMatcher from operator import itemgetter from typing import List from model import TaggedSticker def string_similarity(first, second): """Returns the degree of similarity between two strings""" return SequenceMatcher(a=first, b=second).ratio() def average(seq): if len(seq) =...
# Leave-one-out-cross-validation (LOOCV) # As the method leaves one data point out each time the method works best for # smaller datasets with number of observations less than 1000 for example # Import the modules from sklearn.metrics import mean_absolute_error, make_scorer # Create scorer mae_scorer = make_scorer(me...
# from .authorize_upload import CreditAuthorizeUploadSerializer
import torch import torch.nn as nn import torch.nn.functional as F # from https://github.com/zhaoyuzhi/deepfillv2/blob/master/deepfillv2/network_module.py#L82 class GatedConv2d(nn.Module): def __init__(self, in_channels: int, out_channels: int, kernel_size: int, stride: int = 1, padding: int = 0, dilation: int = 1...
# https://unicode.org/emoji/charts/emoji-list.html def hi(): return '\U0001F40D'
from django.urls import path from .views import index, activity urlpatterns = [ path('', view=index, name="activities"), path('<int:pk>', view=activity, name="activity"), ]
# -*- coding: utf-8 -*- from .chromatic import * # noqa: F401, F403
# Copyright (c) 2019 Works Applications Co., 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 applicable law or a...
import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix from sklearn import tree import collections import seaborn as sns import numpy as np import pandas as pd from matplotlib.colors import LinearSegmentedColormap def set_plot_style(): sns.reset_or...
import os import sys from shutil import rmtree from setuptools import setup, Command # Package meta-data. NAME = "aioscrapy" DESCRIPTION = "Python asynchronous library for web scraping" URL = "https://github.com/eugen1j/aioscrapy" EMAIL = "eugenij.bondar@gmail.com" AUTHOR = "eugen1j" REQUIRES_PYTHON = ">=3.7.0" VERSI...
import re import sys import base64 import datetime import six from decimal import Decimal from .lazy import Promise class _UnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): self.obj = obj UnicodeDecodeError.__init__(self, *args) def __str__(self): original = UnicodeDecodeError.__str__(...
import sqlite3 conn = sqlite3.connect('rpg_db.sqlite3') c = conn.cursor() c.execute("SELECT name FROM sqlite_master WHERE type='table';") COUNT = ' COUNT(*) ' # count fragment to use in select TOTAL_CHARACTERS = 'select count(*) from charactercreator_character' distinctNames = 'select count(distinct(name)) from chara...
from setuptools import find_packages, setup setup(name='dsutils', version='0.1', description='Basic utilities for data science', url='https://github.com/brendanhasz/dsutils', author='Brendan Hasz', author_email='winsto99@gmail.com', license='MIT', packages=find_packages(where=...
import re ul = '\u00a1-\uffff' REGEX_EMAIL = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b' REGEX_GIT_PROJECT = r'((git@|http(s)?:\/\/)([\w\.@]+)(\/|:))([\w,\-,\_]+)\/([\w,\-,\_]+)(.git){0,1}((\/){0,1})' REGEX_VERSION_NUMBER = r'^(\d+)((\.{1}\d+)*)(\.{0})$' REGEX_SITE = ( r'\.' ...
import random import os import time from selenium import webdriver from net import ips def get12306Cookie(): proxy = random.choice(ips) chromeOptions = webdriver.ChromeOptions() chromeOptions.add_argument("'--proxy-server={}".format(proxy)) browser = webdriver.Chrome(chrome_options=chromeOptions, execu...
# -*- coding: utf-8 -*- class DitError(Exception): pass class ArgumentError(DitError): pass class NoTaskSpecifiedError(DitError): pass class SubprocessError(Exception): pass def maybe_raise_unrecognized_argument(argv): if len(argv) > 0: raise ArgumentError("Unrecognized argument: %...
import discord from discord.ext import commands from modules.bot_functions import * from modules.chat_effects import * class UserInfo(commands.Cog): """ Commands : - inventory - balance - points """ def __init__(self, bot): self.bot = bot @commands.command(aliases=["inv"]) ...
#!/usr/bin/env python3 # Copyright © 2019 Jordan Irwin (AntumDeluge) <antumdeluge@gmail.com> # # This software is distributed under the terms of the MIT/X11 license. # See: LICENSE.txt import wx from urllib import request from urllib.error import HTTPError, URLError from enemylist import EnemyList # message IDs ...
import numpy as np #coverage calculation: #assume the earth is a sphere (approximation) #AltitudeFromCentre is distance from object being tracked to centre of earth #unitary. Just add constants and stir for coverage satisfaction val=input('enter altitude in earth radii (note, earth radius here is normalised)') Altitud...
from setuptools import setup, find_packages setup( name = 'ClassifyGene', version = '1.0.0', # keywords = ('chinesename',), description = 'A python library for screening classified dignosed Gene', license = 'MIT License', install_requires = ['Pyomic'], packages = ['ClassifyGe...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import argparse import os import errno import pickle import numpy as np from pathlib import Path import lmdb import h5py from pathlib import Path from PIL import Image from lib.utils.util import ...
expected_output = { 'groups': { 'L2TPV3_V4_XC_GRP': { 'name': { 'L2TPV3_P2P_1': { 'status': 'UP', 'segment1': { 'GigabitEthernet0/2/0/1.2': { 'status': 'UP', ...
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from ..items import Article,Author,JianshuItemLoader from scrapy.loader import ItemLoader from scrapy import Request import re import json class JianshulaSpider(CrawlSpider): name = '...
import inspect from collections import deque import torch from torch import nn from torch.nn import functional as F from torch.utils import data as torch_data from torch_scatter import scatter_max, scatter_add from torchdrug import core, tasks, data, metrics, transforms from torchdrug.layers import functional from to...
import pandas as pd import numpy as np import sklearn import matplotlib.pyplot as plt import json import os import time import logging font={ 'family':'STSONG' } plt.rc("font",**font) # plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['axes.unicode_minus'] = False logging.basicConfig(level=logging.DEBU...
import microcosm_sagemaker.tests.bundles.compound # noqa: 401 import microcosm_sagemaker.tests.bundles.noop_compound # noqa: 401 import microcosm_sagemaker.tests.bundles.simple # noqa: 401 import microcosm_sagemaker.tests.bundles.simple_pickling # noqa: 401
from pipelines.schema import Schema sample_features_metadata = [ dict(name = 'feature1', dtype = int, type = 'input', range=(1, 10) ), dict(name = 'feature2', dtype = float, type = 'input', range = (0.0, 99.9) ), dict(name = 'feature3', dtype ...
print('Oops')
# a script to define a function # to output results of the model import matplotlib.pyplot as plt import itertools from sklearn.metrics import confusion_matrix from keras.models import Sequential import numpy as np from sklearn.metrics import classification_report # function to def plot_confusion_matrix(cm, classes, ...
''' * Could't I add depth coords to every data_var there with .map? * Things blew up when there are many multi-dimensional coords I think? eg depth, depth_center, N_KMAXOUT_RESTR, M_KMAXOUT_RESTR, N_KMAXOUT, M_KMAXOUT * Think holoviews gets confused about which coords to take when there are 6 different multi-dimension...
#!/usr/bin/python import getopt import sys import time import webbrowser import requests from bs4 import BeautifulSoup class URL: def __init__(self, url, ep_index, quality_index, alt_ep_index=None, alt_quality_index=None, condition=lambda x: False): self.url = url self.ep_index = ep_index ...
# © 2021 ushita37 # 失敗作 YAMANOTE = 2350 CHUOSOBU = 2315 lines = {'JB':CHUOSOBU, 'JY':YAMANOTE} #入力をチェック def checkInput(inputDep, inputArr, ekimeiList): #inputDepとinputArrに対して行う処理は同じだが、for文を減らすために同じ関数内で似たコードを2回かく if inputDep in ekimeiList: existDep = True else: existDep = False if inpu...
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class CreatePlanRequestBody: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The ...
from . import package_checker package_checker.main()
import sys from easycli import SubCommand, Argument class ConfigurationDumperSubSubCommand(SubCommand): __command__ = 'dump' __help__ = 'Dump the configuration' __arguments__ = [ Argument( 'path', help='The config path, for example: db', ), ] def __call__(...
import glob import os import subprocess import sys from codes.upbit.upbit_api import Upbit idx = os.getcwd().index("trade") PROJECT_HOME = os.getcwd()[:idx] + "trade" sys.path.append(PROJECT_HOME) from common.global_variables import REMOTE_SOURCE_HOST, REMOTE_SOURCE, CLIENT_ID_UPBIT, CLIENT_SECRET_UPBIT, fmt, \ ...
# Copyright (c) 2020 Branislav Holländer. All rights reserved. # See the file LICENSE for copying permission. import jax import jax.numpy as jnp import piper.functional as func import piper.distributions as dist def test_trace_normal_normal(): def model(key): keys = jax.random.split(key) n1 = fu...
import os from treevalue import classmethod_treelize, TreeValue, method_treelize class MyTreeValue(TreeValue): # return type will be automatically detected as `MyTreeValue` @method_treelize() def append(self, b): print("Append arguments:", self, b) return self + b # return type will ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 19 14:33:36 2018 @author: user """ import symenergy.core.model as model from symenergy.auxiliary.parallelization import parallelize_df from importlib import reload nthreads=7 solve=True reload(model) ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Author : 陈坤泽 # @Email : 877362867@qq.com # @Date : 2021/06/25 09:34 import pathlib from pyxllib.xl import * from fvcore.common.registry import Registry ____basic = """ 基础组件 """ class CommonPathBase: def __init__(self, prefix=None): if prefix is None:...
async def execute(self, ctx, parameters, *args): print(self.sp)
import os import json from pybythec import utils from pybythec.utils import f log = utils.Logger('pybythec') class BuildStatus: ''' member variables: name: name of target path: path to write status.json file to status: failed, built, up to date, or locked description: what happened ''' ...
""" Sources: - Viking Language 1 by Jessie L. Byock 2013 Unicode: 16A0–16FF Swedish runic inscriptions http://runes.verbix.com/index.html http://runes.verbix.com/vikingage/Uppland.html """ import json from runesanalyzer.runes import RunicAlphabetName, Rune, Transcriber __author__ = ["Clément Besnier <clemsciences@a...
from django import forms from django.conf import settings from django.core.exceptions import ValidationError from form_error_reporting import GAErrorReportingMixin, GARequestErrorReportingMixin class TestForm(forms.Form): required_number = forms.IntegerField(min_value=3) required_text = forms.CharField(max_l...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pprint import pformat from utils import blacklist from utils.exceptions import AutocertError from app import app from endpoint.base import EndpointBase class RevokeEndpoint(EndpointBase): def __init__(self, cfg, verbosity): super(RevokeEndpoint, self)....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Script for cleaning / building all examples, with the option to skip some of them # import os from pathlib import Path import platform import shutil import sys class CXX: def __init__(self): self.command = shutil.which("cxx") if not self.command...
from __future__ import annotations import datetime from typing import List, Tuple import attr from handler.model.base import Attrib, InitModel, ModelBase from handler.model.base.base_db import ListOptions from ..protos import san11_platform_pb2 as pb @InitModel( db_table='notifications', proto_class=pb.Not...
from django.conf import settings from Product.models import Product import os import xlrd def run(): data_dir = os.path.join(settings.BASE_DIR, 'data\STock.xls') book = xlrd.open_workbook(data_dir) sheet = book.sheet_by_index(0) data = [[sheet.cell_value(r,c) for c in range(sheet.ncols)] for r in range...
# --------------------------------------------------------------------- # inv.map application # --------------------------------------------------------------------- # Copyright (C) 2007-2021 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Python modu...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import re class FixedWidthVariables(object): """Represents a set of variables in a fixed width file.""" def __init__(self, variables, index_base=0): """Initializes. variables: DataFrame index_base: are the indices...