text
stringlengths
3.07k
22.1k
""" creates and sends foia messages """ from __future__ import print_function from datetime import datetime # TODO: python2 mode import io import re from time import sleep from log import log from docx import Document # python 2 try: from email.MIMEMultipart import MIMEMultipart # python 3 except ModuleNotFoundErro...
"""MLP-Mixer models, reimplemented in Keras.""" import math from typing import Tuple, Union import tensorflow as tf from keras.applications import imagenet_utils from keras.utils import layer_utils from tensorflow.keras import backend from tensorflow.python.lib.io import file_io WEIGHTS_BASE_URL = ( "https://gith...
""" TensorMONK's :: NeuralLayers :: LossFunctions """ import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torch.autograd.function import Function # =========================================================================== # def compute_n_embedding(te...
import random import string from dataclasses import dataclass, field from typing import Callable, Tuple import numpy as np import pandas as pd from pandas.api.types import CategoricalDtype from tensorflow.keras.utils import to_categorical class str2vec: """Encode string to the vector of integers using an alphabe...
#! /usr/bin/python3 import os import os.path import sys import syslog import re from signal import signal, SIGINT, SIGHUP, SIGTERM from configparser import ConfigParser from subprocess import check_output from time import sleep, time, localtime, strftime from gpiozero import OutputDevice, Button from multiprocessing i...
from functools import lru_cache import pickle import pdb from time import sleep import typing from datetime import datetime from datetime import timedelta import os import binascii import cv2 import h5py import h5netcdf #from line_profiler import LineProfiler import matplotlib.pyplot as plt from matplotlib.patches imp...
import scipy.sparse as sp import numpy as np from torch.utils.data import Dataset class TestDataset(Dataset): def __init__(self, train_dataset, test_data_path): self.feature_size = train_dataset.feature_size self.metapath_list = train_dataset.metapath_list self.features = train_dataset.fea...
import math from dataclasses import dataclass, field from typing import Callable, Dict, Iterable, List, Optional, Generator from functools import cache, lru_cache from mathipy import numeric_operations as ops ##### Mathematical constants ############### math_constants: Dict[str, float] = { 'e' : 2.71828182...
from xlsxwriter.workbook import Workbook from xlsxwriter.exceptions import FileCreateError from collections import defaultdict import sys import xlrd import re import os import time import math from .os_functions import choose_file,choose_sheet_column,get_require_files import warnings warnings.filterwar...
from PIL import Image, ImageFilter import numpy as np from ...utils.colour_functions import sRGB_to_sRGB_linear def to_image(arr): img = [ Image.fromarray((255 * arr[:, :, i]).astype(np.uint8), "L") for i in range(0, 3) ] return Image.merge("RGB", img) def to_array(img): return ...
import datetime import csv import os import matplotlib.pyplot as plt import json import time import pandas as pd from sklearn.metrics import confusion_matrix import numpy as np from neural_networks.aliaser import plot_model from dataset_loader.dataset_helper import Dataset_Helper,get_root_folder class LogWriter: ...
import pytest from unittest.mock import MagicMock, patch, call from collections import namedtuple from pytest_splunk_addon.standard_lib.utilities.junit_parser import JunitParser, main testcase = namedtuple("TestCase", ["name", "result"]) prop = namedtuple("Property", ["name", "value"]) result_pass = MagicMock(_tag="pa...
""" Householder QR. Use the script run_householder.py to use the code. <NAME> <NAME> Copyright (c) 2012-2014 """ import struct import numpy import math import util import mrmc import sys import dumbo import dumbo.backends.common from dumbo import opt def parse_info(f): PICKED_SET = '(picked_set) ' ALPHA = '(a...
# 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 (t...
from typing import List, Tuple, Union, Callable from qiskit import QuantumRegister, QuantumCircuit from qiskit.circuit import Qubit from grover import StateInitializerType from utils import create_uniform_superposition from not_n_cirqs import get_superposition_without_state_circuit KONBINI_NAMES = ['A', 'B', 'C', 'D']...
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2006, <NAME> <<EMAIL>> from twisted.internet.defer import Deferred from twisted.internet.task import LoopingCall from twisted.python import failure from twisted.spread import pb from coherence.backend import Backend from co...
# Copyright (c) 2020, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root # or https://opensource.org/licenses/BSD-3-Clause try: # Try to use LibYAML, a fast open-sourced YAML parser and emitter written in C from yaml i...
import numpy as np import tensorflow as tf from math import * import tensorflow_probability as tfp import sys import GPy #from GP_prob.custom_kernel_matrix.custom_kernel_matrix import CustomMatrix from GP_prob.ntk_posterior import NTK_posterior # import load_dataset #from gpflow import settings # import tqdm #import m...
import tensorflow as tf from tensorflow import keras from tensorflow.keras.layers import LSTM, Dense, Input, Bidirectional, Conv2D, Flatten from tensorflow.keras.layers import BatchNormalization, MaxPooling2D, Dropout, Reshape from tensorflow.keras.models import Model import config as cfg import os from data import rea...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import glob import errno import inspect import sublime try: from . import Tools from .Dir import Dir exc...
#!/usr/bin/env python3 import argparse import json import os.path import sys from typing import Dict, List, TypedDict, Union class UpstreamDefinition(TypedDict, total=False): datacenter: str destination_name: str destination_namespace: str destination_type: str local_bind_port: int class ProxyC...
from fixtures import session from fixtures import base_url from fixtures import nr_projects import os from os import path import math import random import pathlib from itertools import islice basepath = path.dirname(__file__) #CURRENT_PATH = pathlib.Path().absolute() out_file_path = path.abspath(path.join(basepath, "...
#from leagueRules import Stats, Points #from logging import * from stats import Stats class Player(): """ This class is intended to be used as an abstract class for all player subclasses (e.g. Quarter- back). The primary purpose of this class is to organize common implementation details for payer sub c...
from enum import Enum, auto import typing as typ import os from pprint import pprint import pickle from datetime import datetime, timedelta import attr from libsvc.endpoint import Endpoint, UID from libsvc.daemon import ObservableMixin, Event from libsvc.utils import PathLike from diana.dicom import DLv from diana.dixe...
""" Module providing randomisation functions for ::class:`~GenomicRegion` objects. """ import os import random from collections import defaultdict from future.utils import string_types from pybedtools.helpers import chromsizes from .files import read_chromosome_sizes from .regions import GenomicRegion __all__ = ['...
import datetime import pandas as pd from dateutil.relativedelta import relativedelta from timeseries import slice_by_timestamp from yearly import replace_year def set_to_begin(values): """Set the dates and times in the list to the begin of the month :param values: :type values: :return: :rtype: ...
from functools import partial from abc import ABCMeta, abstractmethod import math import torch import torch.nn as nn import torch.nn.functional as F from typing import Dict, Any, List def _with_args(cls_or_self: Any, **kwargs: Dict[str, Any]) -> Any: r"""Wrapper that allows creation of class factories. This c...
import os import sys import time from common.stoppable_thread import StoppableThread import logging logger = logging.getLogger('recd') from mysql import * # Stat() # Reads disk statistics from /sys/block/<dev>/stat # The format of the statistics in that file are as follows: # Field 1 -- # of reads completed ...
# -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, 2017, 2018, 2019, <NAME> <<EMAIL>> 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 th...
#!/usr/bin/env python3 import warnings from typing import Dict, List, Optional import matplotlib.pyplot as plt import numpy as np from datafold._decorators import warn_experimental_function def plot_eigenvalues( eigenvalues: np.ndarray, *, plot_unit_circle: bool = False, semilogy: bool = False, ...
import re import threading from typing import Union import pytest from markupsafe import Markup from lektor.context import Context from lektor.markdown import controller_class from lektor.markdown import get_controller from lektor.markdown import make_markdown from lektor.markdown import Markdown from lektor.markdown...
#!/usr/bin/env python # # glvolume_funcs.py - OpenGL 2.1 functions used by the GLVolume class. # # Author: <NAME> <<EMAIL>> # """This module provides functions which are used by the :class:`.GLVolume` class to render :class:`.Image` overlays in an OpenGL 2.1 compatible manner. A :class:`.GLSLShader` is used to manage ...
import re import base64 import datetime import sys import pickle import gzip import json import time from bottle import route, run, static_file, request, BaseRequest, HTTPError from ai import * from tricks import * from decompositioner import * from rendering import * BaseRequest.MEMFILE_MAX = 10000 * 1000 def ge...
import pandas as pd # import ray.dataframe as pd import time import numpy as np from sklearn.cross_validation import train_test_split import lightgbm as lgb import gc def lgb_modelfit_nocv(params, dtrain, dvalid, predictors, target='target', objective='binary', metrics='auc', feval=None, early_stoppin...
import sys import os import pandas as pd import seaborn as sns from matplotlib import pyplot as plt import numpy as np from scipy import stats from sklearn import preprocessing from datetime import date def autolabel(ax, rects): """Attach a text label above each bar in *rects*, displaying its height.""" for r...
from silence_tensorflow import silence_tensorflow silence_tensorflow() import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input from moments_dnns.propagation_layers import ConvLayer, BatchNormLayer from moments_dnns.propagation_layers import ActivationLayer, AddLaye...
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2020 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.appliance.networking.firewall. #----------------------------------------------------...
# Officially made for Pikabot by ItzSjDude from Paperplane extended snippets """**Administration Commands**\n\n {i}setgpic <reply to image> **Usage**: Set replied Image as Group Profile pic\n {i}promote reply to UserMsg or @username <CustomAdmintag> **Usage**: Promote user with custom admin tag if given\n {i}demote <re...
from __future__ import annotations from ctypes import alignment import math import string from collections.abc import MutableMapping from enum import Enum from typing import Callable, Iterator, List, Optional, Tuple, Type, Union, Generator from spreadsheet.format import format_align, format_color_red T_cell_value ...
import bw2data as bd import bw2calc as bc import bw2io as bi from pypardiso import spsolve import numpy as np from pathlib import Path import json from consumption_model_ch.strategies.allocation import modify_exchanges dirpath = Path(__file__).parent.resolve() / "data" class exiobaseLCA: def __init__( ...
# this class is aimed at generating data for the redundant and noisy contexts import os import numpy as np import pandas as pd from os.path import join import random from runs.experiments import Experiment def generate_tr_vl_ts_splits(id, source_path, split_pa...
#!/usr/bin/env python3 # coding: utf-8 import math import numpy as np from tqdm import tqdm import gym from baselines.common.atari_wrappers import NoopResetEnv,EpisodicLifeEnv,MaxAndSkipEnv,WarpFrame from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv import keras from keras.layers import Input, Dense...
""" This is the deployments module and supports all the ReST actions for the solutions collection """ import logging from flask import abort, make_response from sqlalchemy import literal_column from sqlalchemy.exc import SQLAlchemyError from config.db_lib import db_session from models import Solution, Solu...
#!/bin/python #Copyright 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, distri...
from win32api import GetSystemMetrics print("Width =", GetSystemMetrics(0)) print("Height =", GetSystemMetrics(1)) # -*- coding: utf-8 -*- # # This file is part of PyGaze - the open-source toolbox for eye tracking # # PyGazeAnalyser is a Python module for easily analysing eye-tracking data # Copyright (C) 2014 <NAME...
from decimal import Decimal import pytest from brownie import Contract from brownie import accounts from brownie import web3 from hexbytes import HexBytes from web3 import contract from config.constants import ETH_IBMBTC_STRATEGY from config.constants import ETH_MBTC_HBTC_STRATEGY from config.constants import MSTABLE...
"""Cart and checkout related views.""" from django.http import JsonResponse from django.shortcuts import get_object_or_404, redirect, render from django.template.response import TemplateResponse from ...account.forms import LoginForm from ...core.utils import ( format_money, get_user_delivery_country, to_local_cur...
"""A GDS layer is a tuple of two integers. You can: - Define your layers in a dataclass - Load it from Klayout XML file (.lyp) LayerColors adapted from phidl.device_layout load_lyp, name_to_description, name_to_short_name adapted from phidl.utilities preview_layerset adapted from phidl.geometry """ import pathlib fr...
import csv import json import ijson from io import TextIOWrapper import logging from django import forms from django.contrib.auth.views import LoginView as BaseLoginView from django.urls import reverse from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import get_ob...
import numpy as np from math import exp, log10, floor, sqrt from scipy.integrate import simps import os import pickle from model.params import PARAMS # * Utility functions def object_dump(file_name, object_to_dump): # check if file path exists - if not create outdir = os.path.dirname(file_name) if not...
#!/usr/bin/python3 from tkinter import Tk, StringVar from tkinter.ttk import Frame, Button, Label, LabelFrame, OptionMenu from tkinter.constants import N, S, E, W, SUNKEN from PIL import ImageTk, Image from picamera import PiCamera import signal, sys, random import RPi.GPIO as GPIO from time import * from subprocess im...
import requests import os import datetime import pandas as pd import json from pickle import load from bs4 import BeautifulSoup from fastapi import APIRouter, HTTPException, Depends from pydantic import BaseModel, BaseSettings, SecretStr from app.ml import City, validate_city from app.data.files.state_abbr import us_st...
### clue-rps-game v0.2 ### CircuitPython rock paper scissors game over Bluetooth LE ### Tested with CLUE and Circuit Playground Bluefruit Alpha with TFT Gizmo ### and CircuitPython and 5.3.0 ### copy this file to CLUE/CPB board as code.py ### MIT License ### Copyright (c) 2020 <NAME> ### Permission is hereby grant...
import torch import torch.nn as nn import pdb import torch.autograd as autograd import torch.nn.functional as F from model.layer import VGG19FeatLayer from functools import reduce class WGANLoss(nn.Module): def __init__(self): super(WGANLoss, self).__init__() def __call__(self, input, target): ...
# -*- coding: utf-8 -*- # pylint: disable=line-too-long """ Created on Tue Mar 5 10:25:35 2019 @authors: <NAME>, Maxence, <NAME> """ import sys import logging import time import pandas as pd import numpy as np import rdmmp.scraping as scraping import rdmmp.db as db import rdmmp.cleaning as cleaning import rdmmp.pr...
# -*- coding: utf-8 -*- """builtin task module.""" import os import shutil import tempfile import zipfile from .util import PY3, name_match from .frame import TaskFrame, TaskFrameUnit if PY3: import configparser else: import ConfigParser as configparser class GroupTaskFrame(TaskFrameUnit): def __ini...
from django.db import models # Create your models here. # Definición de las tablas y representación de los datos en clases class Materia(models.Model): id_materia = models.AutoField(primary_key=True, blank=False, null=False) nombre = models.CharField(blank=True, null=True, max_length=50) creditos = models...
# -*- coding: utf-8 -*- """ Created on Tue Feb 11 08:44:36 2020 @author: minky """ #arr.reshape(-1,1) shapes array to column vector import numpy as np import struct as st from datetime import datetime class NeuralNetLayer(): def __init__(): pass def forProp(): pass ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding 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-...
import sys import time import cv2 from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from lanedetection import LaneDetection class Ui_MainWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.format = 0 ...
import numpy as np # from scipy.spatial import cKDTree # from pysurf import Interpolator from pysurf.spp import internal class NearestNeighborInterpolator(Interpolator): """Nearest Neighbor Interpolator""" _questions = """ trust_radius_general = 0.75 :: float trust_radius_ci = 0.25 :: float ...
""" BlenderVisual.blender_utility Tools and shorthands, Code fragments, IOs, etc. Created on Sat Sep 21 08:51:40 2019 @author: <NAME> """ import numpy as np import csv import bpy #%% data handling def importObj(obj_file, name): bpy.ops.import_scene.obj(filepath=obj_file) obj = bpy.context.selected_objects[...
import datetime import io import json import random import sys import uuid import aiohttp import discord from dispander import dispand import requests from discord.ext import tasks from PIL import Image, ImageDraw, ImageFont from func import diceroll client = discord.Client() channel = client.get_ch...
""" Test cases for the metadata reading/writing of pyslim. """ import os import numpy as np import pytest import msprime import tskit import pyslim import tests from .recipe_specs import recipe_eq class TestMetadataSchemas(tests.PyslimTestCase): def validate_table_metadata(self, table): ms = table.meta...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 2 19:32:42 2022 @author: diesel """ import matplotlib.pyplot as plt import matplotlib.ticker as mtick import matplotlib.patches as patches import numpy as np def set_plot_params(): """Set plotting parameters.""" plt.set_cmap('plasma') ...
""" Copyright (c) 2022 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.1 (the "License"). You may obtain a copy of the License at https://developer.cisco.com/docs/licenses All use of the material herein must be in accordance with the t...
#!/usr/bin/env python3 import subprocess import os import sys import hashlib dst_id = os.path.expanduser('~/.index/id') dst_tags = os.path.expanduser('~/.index') dst_nest = os.path.expanduser('~/.index/nest') dst_meta = os.path.expanduser('~/.index/meta') debug = False def usage(): info = f""" This util set...
#!/usr/bin/env python3 import socket import os import sys import fcntl import time import numpy as np import json class TcpClient(): SOCKET = None init = False def getConnectDict(self, path): ''' return Dict[WorkerID] = ["RemoteEnv-ip", "RemoteEnv-port"] ''' Dict = {} ...
from pathlib import Path from datetime import datetime from shutil import copyfile from math import isclose import csv from django.http import HttpResponse, Http404 from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.models import User from django.contrib.auth import authenticate,...
''' calc_allele_rpvg_expression.py Calculates allele expression from rpvg expression estimates. Note that the input variant (vcf) file need to annotated with transcript names (INFO:TRANSCIPTS tag). ''' import sys import os import subprocess import pickle import gzip from Bio.Seq import Seq from Bio import SeqI...
from __future__ import annotations from dataclasses import dataclass from sauronlab.core.core_imports import * from sauronlab.model.metrics import * from sauronlab.viz._internal_viz import * from sauronlab.viz.figures import FigureTools @dataclass(frozen=True) class MetricPlotter: """ Plots ROC and Precisio...
# MIT License # Copyright (c) 2018 <NAME>" Ozkal # 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,...
import requests import datetime from datetime import date, timedelta from errors import * from utils import * global academic_year global sem_index # AY:[start of sem 1, start of sem 2] # Note: info for 2026 onwards has not yet been updated on the official NUS website nus_academic_calendar = {'2021-2022': [date(202...
import string import os import logging import subprocess import shutil import tempfile from urllib.parse import urlparse from functools import partial import requests # this is the path to the local origin repository that nbgitpuller uses to mimic # a remote repo in GitPuller CACHED_ORIGIN_NON_GIT_REPO = ".nbgitpuller...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 3 11:50:36 2020 @author: mavroudo """ from pm4py.algo.filtering.log.attributes import attributes_filter as log_attributes_filter from pm4py.objects.log.importer.xes import factory as xes_factory from sklearn.preprocessing import StandardScaler fro...
import shutil import tarfile import tempfile from io import BytesIO from pathlib import Path from typing import Optional from unittest import TestCase from immutablecollections import ImmutableSet from vistautils.key_value import ( KeyValueLinearSource, KeyValueSink, KeyValueSource, byte_key_value_lin...
from __future__ import print_function import os import sys import logging import pandas as pd import numpy as np file_path = os.path.dirname(os.path.realpath(__file__)) lib_path2 = os.path.abspath(os.path.join(file_path, '..', '..', 'common')) sys.path.append(lib_path2) import candle logger = logging.getLogger(__n...
import re import subprocess import sys import argparse #----- regex search criteria ----- geometry_file_start=re.compile(r'-----\s*Begin\s*geometry\s*file\s*-----') geometry_file_end=re.compile(r'-----\s*End\s*geometry\s*file\s*-----') unit_cell_start=re.compile(r'-----\s*Begin\s*unit\s*cell -----') unit_cell_end=re.c...
# -*- coding: utf-8 -*- # vim:fileencoding=utf-8 ai ts=4 sts=4 et sw=4 # Copyright 2009, 2010, 2011 Praekelt Foundation <<EMAIL>> # BSD - see LICENSE for details """Python module for SSMI protocol to send/receive USSD and SMS.""" # Imports from types import StringTypes from twisted.protocols.basic import LineReceiv...
from __future__ import annotations from dataclasses import dataclass, field import tkinter from typing import Dict, Union from PIL import Image as pImage import lifxlan from ..utilities import utils @dataclass class BulbIconListSettings: """ Encapsulates all constants for the bulb icon list """ window_widt...
#!/usr/local/bin/python3 import sqlite3 from pymongo import MongoClient import datetime as dt from datetime import timedelta import time from math import exp import sys import os import simplejson sys.path.append(os.path.join(os.path.dirname(__file__), '..')) INDIVIDUAL_MAX_HEIGHT = 199999 SECONDS_IN_DAY = 86400 de...
"""Generate www tables.""" import io import ast from datetime import datetime from os.path import isdir,isfile,basename from os import mkdir,remove,write,rmdir import numpy as np from astropy.table import Table from astropy.utils import xml import mysql.connector import jinja2 import bokeh.resources from . import d...
#!/usr/bin/env python # # PyAuthenNTLM2: A mod-python module for Apache that carries out NTLM authentication # # ntlm_dc_proxy.py # # Copyright 2011 Legrandin <<EMAIL>> # # 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...
import numpy as np import pandas as pd import os import shutil import sys from tensorflow.keras.models import load_model from . import test_utils sys.path.append('//home/mrmn/letoumelinl/train/Metrics/') from Metrics import * """ Functions """ def get_path_by_type(index, prm): if prm['type_of_training'] == 'fo...
# -*- coding: utf-8 -*- from django.db import models import re import string import unicodedata from time import time import json from django.db.models import Sum from django.utils.functional import memoize _document_details_cache = {} _document_stats_cache = {} _speaker_details_cache = {} def slugify(str): re...
# -*- coding: utf-8 -*- import numpy as np import scipy.optimize as sciopt import scipy.signal as scisig import matplotlib.pyplot as plt from bag.util.search import FloatBinaryIterator from bag.data.lti import LTICircuit, get_stability_margins, get_w_crossings from verification_ec.mos.query import MOSDBDiscrete d...
""" PCDS detectors and overrides for ophyd detectors. All components at the detector level such as plugins or image processing functions needed by all instances of a detector are added here. """ import logging import warnings import subprocess from ophyd import Device from ophyd.areadetector import cam from ophyd.ar...
import subprocess import os import json import re class Video: def __init__(self, path, ffprobe_path='ffprobe'): self.path = path if not os.path.isfile(self.path): raise Exception('Custom Error: File was not found.') proc = subprocess.run([ffprobe_path, '-i', self.path, '-show_...
#!/usr/bin/env python #! -*- coding: utf-8 -*- """The command-line interface to the goo.gl client.""" import click import lnk.cli import lnk.config import lnk.errors import lnk.googl.link import lnk.googl.info import lnk.googl.stats import lnk.googl.history import lnk.googl.key lnk_config = lnk.config.Manager('lnk...
# coding = utf-8 # Create date: 2018-10-29 # Author :<NAME> from __future__ import print_function import os import random import string import subprocess import time from xml.etree.ElementTree import ElementTree import libvirt import pexpect import pytest BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__...
from __future__ import annotations import json import os import shutil from app_config import deployment_config from deployment import daos from metadata.hydrological_model_enum import HydrologicalModelEnum from metadata.project_metadata import ProjectMetadata from typing import List, TYPE_CHECKING if TYPE_CHECKING:...
''' This file defines all of the means and covariances needed for lambda dynamics. These functions are the numerical factors required for calculating the covariances. The naming convention is the function and then the powers of n and e. An underscore indicates the power is negative. For example, fn_e13 is the term in f...
import itertools import random import os from math import floor, ceil from functools import partial import cv2 import json import numpy as np from PIL import Image import torch.utils.data import torchvision.transforms.functional as xF from torchvision.transforms import ColorJitter from skin_lesion.default_paths impor...
## 对输入数据进行预处理,包括特征工程 # todo 所有实体词增加词频(默认为1就好)和词性 # todo 实体指示词增加词频,并将实体指示词保存为json文件,设计参数过滤低频指示词 # todo 指定文件存储地址 from utils.file_utils import get_column_from_file, write_json, read_json from utils.seg_utils import segment from utils.string_utils import strip_string import numpy as np def get_single_entities(char_list,...
import gc import numpy as np import pandas as pd import os from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import roc_auc_score from sklearn.model_selection import RepeatedKFold from sklearn.preprocessing import LabelEncoder from datetime import datetime from tqdm import tqdm import ...
import yfinance as yf import sqlite3 import datetime import pandas as pd import os import hashlib from pandas.tseries.offsets import BDay from sqlite3 import Error from src.db_default import DB_TABLES, DB_DIR, DB_DEFAULT_TICKERS, DB_FROZEN_VARIANTS class DBCursor: """ This class saves having to write code to ...
from django.core.exceptions import ValidationError from django.core.validators import ( RegexValidator, MinLengthValidator, MaxLengthValidator, MinValueValidator, MaxValueValidator, ) from django.db import models from django.utils.translation import ugettext_lazy as _ from .constants import ( US...
#! python3 # -*- encoding: utf-8 -*- ''' Current module: rman.app.httpcase.views.testapi Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-<NAME>(罗科峰) MAIL: <EMAIL> RCS: rman.app.httpcase.views.testa...
from django.test import TestCase from django.contrib.auth.models import User from sign.models import Event from sign.models import Guest # Create your tests here. class UserModelsTest(TestCase): """模型测试""" def setUp(self): User.objects.create_user("test01", "<EMAIL>", "test1232456") def test_use...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ pwstore ~~~~~~~ A commandline-based secure password storage system. :copyright: 2018 by Kharidiron :license: MIT """ __version__ = '1.0' import argparse import base64 import cmd import datetime import getpass import hashlib import logging import she...