text
stringlengths
3.07k
22.1k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import re import socket import ipaddress import getopt import threading import subprocess import shlex import time import select blackhole = ( 'fdf8:f53e:61e4::18', 'fdf8:f53e:61e4::18', 'fc00:e968:6179::de52:7100', '200:2:807:c62d::'...
from optparse import OptionParser # from matplotlib import pyplot as plt import numpy as np from scipy import constants from random import random import os.path import sys __doc__ = "Rewritten version of the original ReadIGUN from 2010. This is now compatible with the latest " \ "version of IGUN (2016)." __a...
""" Pipetypes make up the core functionality of our system. Once we understand how each one works, we’ll have a better basis for understanding how they’re invoked and sequenced together in the interpreter. """ from functools import partial from functools import wraps class GenerativeBase(object): def _generate(s...
""" Run this script to launch training EXAMPLE: >>> TPU_NAME=gsoc-project python3 main.py >>> # for running dummy training on TPUs >>> DUMMY_DATA_PATH=gs://gsoc-librispeech-us/dev-clean/dev-clean-0.tfrecord TPU_NAME=gsoc-project python3 main.py """ import os from dataclasses import asdict, dataclass, fie...
""" Created on Tue Dec 29 19:42:32 2020 @author: jessm This file formats and plots the .h5 and fields files from the MEDIS simulation. There is still unresloved ringing in the fields plot. """ import os import matplotlib.pyplot as plt import numpy as np import tables as pt from matplotlib.colors...
# Copyright 2018 <NAME>, <NAME>. # # Copyright (c) 2020 Intel Corporation # # 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 ...
# # # Generalization of the <NAME>'s code to visualize the Global # Warming problem. # This code uses the structure of the visualization in order to be used # to visualize any data with the next structure: # * Categories # * Elements which belongs to one category # * One value for each element # * Some...
# Python import json from copy import copy # Django from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User # noqa # AWX from awx.main.models.base import prevent_search from awx.main.models.rbac import ( Role, RoleAncestorEntry, get_roles...
import pygame import constants import random import utils # ------------------------------------------------------------ # class TextDialog # ------------------------------------------------------------ class TextDialog: def __init__(self, text, line_width=50): self.BG_COLOR = constants...
import pytest import json from datetime import datetime import scrapy from scrapy.http.response.html import HtmlResponse from scrapy.spidermiddlewares.httperror import HttpError from twisted.internet.error import DNSLookupError import textwrap from freezegun import freeze_time from urlobject import URLObject from pa11y...
VTK_DATA_TYPES = [ "void", # define VTK_VOID 0 "bit", # define VTK_BIT 1 "int8", # define VTK_CHAR 2 "unit8", # define VTK_UNSIGNED_CHAR 3 "int16", # define VTK_SHORT 4 "uint16", # define VTK_UNSIGNED_SHORT 5 "int32", # define VTK_INT 6 "uint32", # define VTK_UNSIGNED_INT 7 "...
"""Generate www material for results from a single target.""" import io import os import glob from datetime import datetime import numpy as np import jinja2 from bokeh.resources import CDN,INLINE from . import plotting from . import db from . import utils from . import config as cfg def www_all(results, write_pa...
#-*- coding: utf-8 -*- """ what : MLP, CNN data : .. """ import tensorflow as tf import os import time import argparse import datetime import random from model import * from model_cnn import * from process_data import * from evaluation import * from params import * # for training def train_step(sess,...
import torch import argparse from torch.utils.data import DataLoader from torch import nn, optim from torchvision.transforms import transforms from unet import Unet from dataset import FundusDataset import cv2 import time import copy from torch.optim import lr_scheduler import numpy as np from PIL import Image import m...
from .SortingExtractor import SortingExtractor import numpy as np # A Sorting Extractor that allows for manual curation of a sorting result (Represents curation as a tree of units) class CuratedSortingExtractor(SortingExtractor): def __init__(self, parent_sorting): SortingExtractor.__init__(self) ...
""" console.py ========== Adaptation of Python's console found in code.py so that it can be used to show some "friendly" tracebacks. """ import builtins import copy import os import platform import traceback from code import InteractiveConsole import codeop # need to import to exclude from tracebacks import friendly...
# coding: utf-8 from datetime import datetime, timedelta import xarray as xr import dask from os.path import basename, isfile, join, dirname import pandas as pd import os import warnings from multiprocessing import cpu_count, Pool, freeze_support import numpy as np import calendar warnings.filterwarnings("ignore") n...
"""decoder.py module.""" from os.path import sep as os_path_sep from typing import Tuple, Union class CDSRDecoderException(Exception): """CDSRDecoderException.""" def _get_reception_time_from_scene_dir_second(scene_dir_second: str) -> Union[str, None]: """If there is time datum inside `scene_dir_second` st...
from functools import partial from keras import backend as K from keras.layers import Layer from operator import truediv class layer(Layer): def __init__(self, label=None, name=None, sparse=False, **kwargs): super(layer, self).__init__(name=name, **kwargs) self.stateful = True self.epsilo...
# -*- coding: utf-8 -*- """ api.py Provides the API for papermill """ from __future__ import unicode_literals import os import IPython from IPython.display import display as ip_display, Markdown import pandas as pd from six import string_types from .exceptions import PapermillException from .iorw import load_notebo...
import numpy as np from functools import reduce from bisect import bisect def getZero(size=32): return np.zeros((size,size),dtype="uint8") def getI(size=32): return np.identity(size,dtype="uint8") def getShift(n,size=32): return np.eye(size,k=n,dtype="uint8") def getTrans(): t11,t12,t13,t14 = getZer...
import numpy as np import torch.nn.init as init from torch import nn as nn def weights_init(m): classname = m.__class__.__name__ if isinstance(m, nn.Linear): init.xavier_normal_(m.weight, gain=np.sqrt(2.0)) elif classname.find('Conv') != -1: init.xavier_normal_(m.weight, gain=np.sqrt(2.0))...
# Copyright (c) <NAME>, <NAME> # # All rights reserved. # # This code is licensed under the MIT License. # # 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 withou...
import os import time import gentle import multiprocessing import shutil import subprocess import sys import re import pronouncing as pro from pydub import AudioSegment from pydub.playback import play import PySimpleGUI as gui def setUpProject(name): createDirectory("mixes/" + name) createDirectory("mixes/" + name +...
# Copyright © 2020 Province of British Columbia # # 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 agr...
""" @Time: 2020/7/20 10:17 @Author: Zhirui(<NAME> @E-mail: <EMAIL> @Program: """ import pandas as pd import numpy as np import lightgbm as lgb from sklearn import preprocessing from utils.logger import logger from utils.funcs import save_to_pkl, mae, mape from data_process import get_apptointment_info, get_treat_in...
# pylint: disable=anomalous-backslash-in-string """ A ``Text2SqlTableContext`` represents the SQL context in which an utterance appears for the any of the text2sql datasets, with the grammar and the valid actions. """ from typing import List, Dict from sqlite3 import Cursor from allennlp.data.dataset_readers.dataset_...
#! /usr/bin/env python3 """ This program provides an CLI interface to check and generate Evergreen configuration. """ import os import sys import re import subprocess try: import docopt except Exception as e: modules = "docopt" print("ERROR [%s]: %s" % (sys.argv[0], e)) print("Use pip to install the ...
import asyncio import discord from discord.ext import commands from discord.ext.commands import check, Context import variables as var import database as db from functions import get_prefix def user_or_admin(myid): async def predicate(ctx: Context): return ctx.author.id == myid or ctx.author.guild_permiss...
""" `dasdeployer.rgb` ==================================================== Helper class for the ring of RGB LED's that surround the big button which are part of the same addressable matrix with the 8 RGB LED ring inside the button. * Author(s): <NAME> **Hardware:** "* `112mm 32 WS2812B 5050 RGB LED Ring...
import math import numpy as np import numpy.typing as npt from pyquaternion import Quaternion from scipy.spatial import ConvexHull def quaternion_yaw(q: Quaternion) -> float: """ Calculates the yaw angle from a quaternion. Follow convention: R = Rz(yaw)Ry(pitch)Px(roll) Source: https://en.wikipedia.o...
# -*- coding: utf-8 -*- """ Created on Sat Jul 29 13:35:12 2017 @author: yu """ import os import numpy as np import scipy.linalg as linalg import cv2 import operator import matplotlib.pyplot as plt def ComputeNorm(x): # function r=ComputeNorm(x) # computes vector norms of x # x: d x m matr...
import os import re from itertools import repeat from sanic.blueprints import Blueprint from sanic.response import json, redirect from sanic.views import CompositionView from .doc import RouteSpec, definitions from .doc import route as doc_route from .doc import route_specs, serialize_schema from .spec import Spec s...
# -*- coding: utf-8 -*- """ Created on Wed Apr 29 12:09:32 2020 @author: <NAME> """ import os,time,math def main(): global f global clusterLenght global numClustersD global numClustersU global entradaDirectorioLen nombreSistema=input("Ingresa el nombre del archivo .img , si...
print("Running!") import math import copy from PIL import Image img = Image.new("RGBA", (640, 640)) px = img.load() for x in range(0, img.width): for y in range(0, img.height): px[x, y] = (0, 0, 0, 255) class Vec: def __init__(self, x = 0, y = 0, z = 0, w = 1): self.x ...
# Author: <NAME> <<EMAIL>> # License: BSD (3-clause) import numpy as np import mne from mne.io import set_bipolar_reference from mne.io.bti.bti import ( _convert_coil_trans, _coil_trans_to_loc, _get_bti_dev_t, _loc_to_coil_trans) from mne.transforms import Transform from mne.utils import logger from .io impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : generate_ps.py # Author: Alvin(<NAME> <<EMAIL>> # Date : 06.02.2021 import glob import json import logging import os import hydra import joblib import matplotlib.pyplot as plt import numpy as np import pytorch_lightning as pl from mrc_insar_common.data import ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, clean_html, determine_ext, int_or_none, js_to_json, parse_duration, ) class ViewLiftBaseIE(InfoExtractor): _DOMAINS_REGEX = r'(?:snagfilms|snagxtreme|funnyforfree|kid...
from hypothesis import given import hypothesis.strategies as st from hypothesis import settings from hypothesis.extra.numpy import arrays import numpy as np from spatialpandas.spatialindex import HilbertRtree import pickle # ### hypothesis settings ### hyp_settings = settings(deadline=None) # ### Custom strategies #...
"""Configuration.""" from __future__ import annotations import os import re from functools import partial, singledispatch, wraps from pathlib import Path from typing import Callable, Dict, TypeVar from urllib.parse import urlsplit, urlunsplit import attrs from tomlkit import document, dumps, loads, string, table from...
"""Convolutional neural net on MNIST, modeled on 'LeNet-5', http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf""" from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np import autograd.numpy.random as npr import autograd.scipy.signal from autograd import grad from auto...
# Copyright 2019 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 applica...
import sys from games.tablut.players.remote import Remote from games.tablut.players.minmax import MinMax, cutoff_depth from games.tablut.game import Game from games.tablut.players.console import Console # from games.tablut.board import Board as KivyBoard # from games.tablut.players.kivy import Kivy from games.player im...
# -*- coding: utf-8 -*- # @Time : 5/27/2020 5:45 PM # @Author : <NAME> # @Email : <EMAIL> # @File : logger.py # from pathlib import Path # import pandas as pd # import yaml from abc import ABCMeta, abstractmethod # from collections import defaultdict from typing import Any, Optional, Union, Sequence import wan...
# Copyright 2021 The Kubric 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 in w...
from pathlib import Path from math import ceil import torch import torch.nn.functional as F import logging import numpy as np from einops import rearrange import faiss from autofaiss import build_index from retro_pytorch.utils import memmap, reset_folder_ # constants SOS_ID = 101 EOS_ID = 102 BERT_MODEL_DIM = 768 ...
""" Helpers for sphinx documentation. Can be used by armi docs or docs of anything else that can import armi. """ import sys import inspect from io import StringIO import datetime import os import subprocess import shutil from docutils.parsers.rst import Directive, directives from docutils import nodes, statemachine ...
from aiohttp import web import asyncio import json import logging from . import gameplay as gm async def register(ws, name, game: gm.Gameplay): # response to a new user entering if game.players.game_full(): raise Exception("The game is full") tmp = game.players.register(ws, name) if tmp == -1: ...
# -*- coding: utf-8 -*- # Copyright (c) 2018 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, ...
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from collections import namedtuple, defaultdict from operator import itemgetter from nltk.corpus import stopwords from unidecode import unidecode import numpy as np import matplotlib.pyplot as plt import datetime import heapq import string import tim...
import os import functools import imageio import shutil from seq2seq import hlog import numpy as np import torch from absl import app, flags from tqdm import tqdm from torch import optim from torch.utils.data import DataLoader from torch.utils.data.distributed import DistributedSampler import options from src import...
#!/usr/bin/env python3 # Copyright 2022 Silicon Laboratories Inc. www.silabs.com # # SPDX-License-Identifier: Zlib # # The licensor of this software is Silicon Laboratories Inc. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for an...
# Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute,...
# 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 u...
import rospy import actionlib from math import radians import numpy as np from std_srvs.srv import Empty import dynamic_reconfigure.client from gazebo_msgs.msg import ModelState from geometry_msgs.msg import Quaternion, Pose, PoseWithCovarianceStamped from move_base_msgs.msg import MoveBaseGoal, MoveBaseAction from ro...
# -*- coding: utf-8 -*- """ Written by <NAME> and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. """ import qt.QtCore as qc import qt.QtGui as qg import sympy import sympy.utilities import numpy import numpy.linalg import popupcad from dev_tools.enum import enum from popupcad.constrain...
import numpy as np import torch def obs2img_vec(inputs, joints_nn): img_size = 256 joints = inputs[:joints_nn*2] finger_tip_target = inputs[joints_nn*2:joints_nn*2+3] img_front = torch.from_numpy(inputs[joints_nn*2+3:-3*img_size*img_size]).view(-1, 3, img_size, img_size).float().cuda() img_top = ...
from __future__ import division from __future__ import print_function import os from os.path import join import sys import time import random import numpy as np from six.moves import xrange import tensorflow as tf NUM_LABELS = 4 VALIDATION_SIZE = 1000 SEED = 201607 BATCH_SIZE = 64 NUM_EPOCHS = 1000 EVAL_BATCH_SIZE =...
#coding=utf8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import codecs import six.moves.cPickle as cPickle import hashlib import json import os import rdflib import re import tempfile def ensure_unicode(s): r...
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function from pyrbt import pyRBT,pyRBMap import random def _test_rbt_auto(nums): tree = pyRBT() vals = [] # sorted values in the tree # insert values into the tree for v in nums: tree.insert(v,True) vals.append(v) vals.sort() tre...
#!/usr/bin/env python # # Serial firmware uploader for the SiK bootloader # import sys, argparse, binascii, serial, glob class firmware(object): '''Loads a firmware file''' # parse a single IntelHex line and obtain the byte array and address def __parseline(self, line): # ignore lines not beginning with : if ...
# Python script to upgrade a VM Scale Set one update domain at a time # usage: vmssupgrade -r rgname -v vmssname -n newversion -u updatedomain [-y][--verbose][--nowait] # test values for ubuntu 14.04 platform image: # oldversion = "14.04.201506100" # newversion = "14.04.201507060" import argparse import json import...
#!/usr/bin/env python3 import math import pygame from pygame.locals import * from pygame.color import * import pymunk import pymunk.pygame_util from pymunk.vec2d import Vec2d from pybrain.structure import FeedForwardNetwork from pybrain.structure import LinearLayer, SigmoidLayer, FullConnection import seria...
""" @author <NAME> @date November 2019 @details A U-Net AE implementation with the encoder and decoder separated. You can plug it into UNIT in lieu of the encoder and decoder with the intent to better adapt MRI. """ from torch import nn from torch.autograd import Variable import torch import torch.nn.functional as F ...
import random import math import os import numpy as np import cv2 from ..registry import PIPELINES from edit.utils import imresize, imwrite from skimage.segmentation import slic, mark_boundaries @PIPELINES.register_module() class MinimumBoundingBox_ByOpticalFlow(object): def __init__(self, blocksizes = [9, 8], n_...
#!/usr/bin/env python """ MetaWIBELE: interproscan_protein_family module Summary the results of annotation from InterProScan Copyright (c) 2019 Harvard School of Public Health Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwa...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# 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 # d...
import errno import select import socket import threading from tkinter import * root = Tk() root.title("Chatroom") root.geometry("800x450+0+0") root.minsize(200, 55) history = "" baseIP = socket.gethostbyname_ex(socket.gethostname())[-1] port = 7000 headerLength = 10 main = Frame(root, bg = "black") main.pack(fill ...
#-*- coding:utf-8 -*- # # This file is part of CoTeTo - a code generation tool # 201500225 <NAME> <EMAIL> # import sys import os import os.path import tempfile import argparse import logging import configparser import traceback import CoTeTo from CoTeTo.Controller import Controller from PyQt5 import QtCore, QtWidgets,...
from __future__ import division import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import numpy as np import cv2 from util import predict_transform def get_test_input(cuda=True): img = cv2.imread('data/dog.jpg') img = cv2.resize(img, (320, 320)) img_ = i...
import pytest from pysim5g.path_loss import ( path_loss_calculator, etsi_tr_138_901, uma_nlos_optional, check_3gpp_applicability, ) #prepare for testing etsi_tr_138_901 @pytest.mark.parametrize("frequency, distance, ant_height, ant_type, \ building_height, street_width, settlement_type, type_o...
from datetime import datetime, date from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel, Field, validator from shared.db.converters import Converters class DataType(BaseModel): """ A class for representing a SQL data type as an object. Data types can have length, precision, ...
"""Functions for combining arrays. Combine functions combine two or more NumPy arrays using a custom function. The emphasis here is done upon stacking the results into one NumPy array - since vectorbt is all about brute-forcing large spaces of hyperparameters, concatenating the results of each hyperparameter combinati...
from bzt.jmx.base import JMX class AbstractThreadGroup(object): XPATH = None RAMP_UP_SEL = None CONCURRENCY_SEL = None def __init__(self, element, logger): self.element = element self.gtype = self.__class__.__name__ self.log = logger.getChild(self.gtype) def get_testname(...
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2012-2013 <NAME> <<EMAIL>> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EUPL (the "Licence"); # You may not us...
#!/usr/bin/env python """ This script will pull all the events (for the specified time period) for all the log groups and their respective log streams from cloudwatch logs and upload them to an s3 bucket. """ import boto3, json, time, logging, os, gzip from datetime import date, datetime, timedelta from botocore.excep...
import inspect from django.contrib.gis.geos import Point from django.contrib.gis.measure import D from django.db.models.query_utils import Q from haystack.query import SearchQuerySet from allegation.utils.query import OfficerQuery from common.constants import FOIA_START_DATE, DISCIPLINE_CODES, NO_DISCIPLINE_CODES fro...
import os import csv from pathlib import Path import numpy as np from dask import array as da from tempfile import TemporaryDirectory from napari.utils import io import pytest try: import zarr zarr_available = True except ImportError: zarr_available = False # the following fixtures are defined in napar...
import os import filetype import logging types_map = { # http://www.iana.org/assignments/media-types # Type mapping for automated metadata extraction (video, audio, image, document, binary, model) '.a': ('application/octet-stream', 'binary'), '.ai': ('application/postscript', 'image'), '.aif': ('au...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
# -*- coding: utf-8 -*- from typing import List import numpy as np import scipy.interpolate as interp import scipy.integrate as integ import matplotlib.pyplot as plt # noinspection PyUnresolvedReferences from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib import ticker from bag.core im...
#!/usr/bin/python3 # # Copyright 2012 <NAME> # # 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...
import enum import numpy as np import random import os import json import string from collections import deque from tensorflow import keras from tensorflow.keras.models import Sequential,Model from tensorflow.keras.layers import LSTM, Dense, Activation, Flatten, Concatenate, Input from tensorflow.keras.optimizers imp...
import astropy.io.misc.hdf5 as hf import numpy as np from ...config import NssConfig from ...utils import decorators from ..eas_optical.detector_geometry import distance_to_detector __all__ = ["EASRadio", "RadioEFieldParams", "IonosphereParams"] try: from importlib.resources import files except ImportError: ...
import os import sys from abc import ABC, abstractmethod from typing import ( Dict, Any, NamedTuple, Optional, Callable, TypedDict, Generic, TypeVar as t_TypeVar, Iterable, Sequence, Tuple, Union, ) import operator as op from collections import namedtuple from functools i...
#internal imports import sys print(sys.path) from pytorch_lightning.loggers import CometLogger from transforms import SimCLRFinetuneTrainDataTransform from encoders import load_encoder from pytorch_lightning.core.lightning import LightningModule from pytorch_lightning import Trainer import pytorch_lightning as pl imp...
# -*- coding: utf-8 -*- """ Copyright (C) 2021 <NAME> (script.appcast) An interface to provide a communication between Kodi and a DIAL app SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ import json import threading from copy import deepcopy import xbmc import resources.lib...
from django.contrib import messages from django.http import HttpResponseRedirect from django.urls import reverse from django.utils import timezone from django.shortcuts import get_object_or_404 from .query import get_query_string URL_NAMES = { "account": ("account_view", "account_edit", "account_index"), "clie...
import os import sys import json import asyncio import logging from queue import Queue from contextlib import contextmanager from inflection import tableize parent_dir = os.path.abspath(os.path.dirname(__file__)) vendor_dir = os.path.join(parent_dir, 'vendor') sys.path.append(vendor_dir) from rethinkdb import r fro...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @File : main.py @Description: 垃圾分类识别案例 @Author : 杭漂 @version : 1.0 ''' from aliyunIoT import Device import display # 显示库 import network # 网络库 import ucamera # 摄像头库 import utime # 延时函数在utime库中 import sntp # 网络时间同...
from pathlib import Path import dataclasses import platform import ctypes import sys from .codes import errors from .codes import config from .codes.errors import get_description from .structs.info import BASS_INFO, BASS_DEVICEINFO BASSVERSION = 0x204 BASSVERSIONTEXT = '2.4' HERE = Path(__file__).parent BASS_DLL = H...
# Copyright (c) <NAME> & <NAME>. Licensed under the Apache License 2.0. All Rights Reserved """""" from typing import List, Tuple from .text import STOP_WORDS, nlp class PreprocessError(Exception): pass def span_intersect_span(span1: Tuple[int, int], span2: Tuple[int, int]): """Returns True if the given s...
#! /bin/python import os import sys import json from concurrent import futures import numpy as np import luigi import nifty.tools as nt from elf.io.label_multiset_wrapper import LabelMultisetWrapper import cluster_tools.utils.volume_utils as vu import cluster_tools.utils.function_utils as fu from cluster_tools.clust...
from contextlib import contextmanager import io import tokenize from typing import Generator, Iterator, List, Set, Tuple from black.nodes import STARS, syms, is_simple_decorator_expression from black.lines import Line, EmptyLineTracker from black.linegen import transform_line, LineGenerator, LN from black.comments im...
import urllib from typing import List from django.conf import settings from django.core.cache import cache from django.core.exceptions import ImproperlyConfigured from django.utils import timezone from onelogin.saml2.auth import OneLogin_Saml2_Auth from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMeta...
import logging import re import shutil from pathlib import Path import pdfplumber import requests from bs4 import BeautifulSoup from openpyxl import load_workbook from .. import utils from ..cache import Cache __authors__ = ["zstumgoren", "Dilcia19", "ydoc5212"] __tags__ = ["html", "pdf", "excel"] logger = logging....
import numpy as np np.random.seed(123) import matplotlib matplotlib.rcParams.update({'font.sans-serif' : 'Helvetica', 'axes.labelsize': 10, 'xtick.labelsize' : 6, 'ytick.labelsize' : 6, 'axes.titlesize' : 10...
import requests import json import prettytable as pt from app.utils.loadini import read_config_cf,read_config ''' https://api.cloudflare.com/# ''' allconfig = read_config() ifproxy = allconfig['ifproxy'] proxy = allconfig['proxy'] email,globalkey = read_config_cf() proxies = {'http': 'http://%s'%proxy, 'https': 'htt...
# -*- coding: utf-8 -*- import json import logging from abc import ABCMeta, abstractmethod from pathlib import Path from random import shuffle import numpy as np from scipy.spatial.distance import cdist from asap3 import FullNeighborList from ase.io import read logger = logging.getLogger(__name__) class MissingDa...