text stringlengths 6.04k 39.5k |
|---|
# sae-j1979da-reformatter/j1979_reformatter/reformatter.py
"""
Reformat Excel OBD Interface Standard SAE-J1979 to Word
"""
from sys import stdout, stderr
from argparse import ArgumentParser
from typing import Tuple
from re import sub as resub
from pprint import PrettyPrinter
from openpyxl import load_workbook
from docx... |
from OpenVaxxDB import business as ovb
from OpenVaxxDB import distributor as ovd
from OpenVaxxDB import recipient as ovr
import PySimpleGUI as sg
user_var = None
# -- Colors --
bgColor1 = '#ffffff'
bgColor2 = '#0e1778'
textColor1 = '#ffffff'
textColor2 = '#0e1778'
buttonBgColor = "#030947"
notVaxxColor = '#e3210b'
w... |
#!/bin/env python2.7
# encoding: utf-8
# from __future__ import print_function
from __future__ import division
import os
import sys
from collections import defaultdict
from collections import Iterable
from collections import namedtuple
import logging
log = logging.getLogger(os.path.basename(__file__))
# log.disabled =... |
import math
import numpy as np
import cv2
import os
import sys
sys.path.append('..')
sys.path.append('./IDA')
from scipy import stats
import pickle
import datetime
from lib.processing_utils import get_file_list, FaceDection
face_detector = FaceDection(model_name='cv2')
def remove_spec(img, display=False):
img =... |
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements transformations to deseasonalize a timeseries."""
__author__ = ["mloning", "eyalshafran", "aiwalter"]
__all__ = ["Deseasonalizer", "ConditionalDeseasonalizer", "STLTransformer"]
impo... |
#!/usr/bin/env python3
#
# Requirements: keras tensorflow sklearn "numpy<1.17" (to avoid warnings fron tensorflow)
# pip3 install --prefer-binary -r Requirements.txt
#
# Or:
#
# python3 -m venv tsne
# source tsne/bin/activat
# pip install --upgrade pip
# pip install --prefer-binary -r Requirements.txt
#
# TODO:
# - A... |
#!/usr/bin/python3
import odgi
import rdflib
import io
from rdflib.namespace import RDF, RDFS, NamespaceManager, Namespace
from rdflib.store import Store
from rdflib.term import Literal, URIRef, Identifier, Node, BNode
from rdflib import Graph
from rdflib import plugin
from itertools import chain
from spodgi.term impor... |
# Hexa game engine
# Modules are imported that will be used in Hexa game engine.
from colorama import Fore, Back, Style
from colorama import init
import platform
import random
import time
import math
import sys
import os
# This import blocks pygame from printing it's startup text.
from os import environ
e... |
import os
import sys
import json
import time
import torch
from torch import nn
from torch.distributions import Normal
from torch.optim.lr_scheduler import ExponentialLR
from torch import optim
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
from torch.cuda.amp import GradScaler
p = os.pa... |
from __future__ import annotations
import unittest
from bitstring import Bits, pack
from .datatype import TypedValue, IntType, FloatType, BoolType, StrType
from .actors import Actor, Action, Query
from .str_ import String, StringPool
from .dic_ import Dictionary
from .array import BlockArray, BlockPtrArray, Uint16Ar... |
"""Experimental Kusto expression API for generating queries."""
from copy import copy
from datetime import datetime, timedelta
from decimal import Decimal
from typing import Any
class attrdict:
"""A dict whose members are accessible with the . operator."""
def __init__(self, **kwargs):
self._dict = ... |
""" test type conversions
"""
import os
import pandas
import numpy
import automol
PATH = os.path.dirname(os.path.realpath(__file__))
def load_pandas_csv_string_file(path_lst, file_name, path=PATH):
""" Read a file with numpy
"""
file_path = os.path.join(path, *path_lst, file_name)
file_df = pandas.r... |
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
# @Author : lusheng
import configparser
import os
from tkinter import *
from tkinter import messagebox
import sqlite3
from datetime import datetime, date, timedelta
import time
import requests
import re
import json
from email.utils import parseaddr, formataddr
import smtpli... |
import struct
from util import printf
class Struct:
def __init__(self, client, addr):
self.client = client
data = client.read(addr, self.SIZE)
self._raw = data
for name, field in self._fields.items():
fmt, offs = field
if type(fmt) is str:
r =... |
# -*- coding: utf-8 -*-
"""
A driver to control the Keysight VNA P9374A using pyVISA and qcodes
@author: Hatlab: <NAME>; UIUC: <NAME>
"""
import logging
from typing import Any, Union, Dict, List, Tuple
import numpy as np
from qcodes import (VisaInstrument, Parameter, ParameterWithSetpoints, InstrumentChannel, valid... |
# File: transcrypt/modules/warnings/__init__.py
# Author: <NAME>
# Date: 20NOV2016
#
# Description:
# This file contains the implementation of a module to
# provide features that can be used by developer to flag
# runtime issues that would not be caught by the static
# type checking system. These warnings are for con... |
from threading import Lock
import threading
import requests
import random
import re
import time
from Util.config import config, req_headers
from rule import keywords, rules, bili_mtr_list
import json
from concurrent.futures import ThreadPoolExecutor
import traceback
from Util.db import api_db, error_db
from bson import... |
#!/usr/bin/env python3
# encoding: utf-8
"""
A module for SSHing into servers.
Used for giving commands, uploading, and downloading files.
Todo:
* delete scratch files of a failed job: ssh nodeXX; rm scratch/dhdhdhd/job_number
"""
import datetime
import logging
import os
import re
import time
import paramiko
f... |
# -*- coding: utf-8 -*-
"""
Digital Signal Processing
"""
import logging
from typing import Callable, Optional, Tuple
import numba
import numpy as np
from numpy.fft import fft, ifft, irfft, rfft
from scipy import signal, stats
from signalworks.tracking import TimeValue, Wave
logger = logging.getLogger(__name__)
# TO... |
from typing import Tuple, Optional, List
from quarkchain.cluster.rpc import TransactionDetail
from quarkchain.core import (
RootBlock,
MinorBlock,
MinorBlockHeader,
CrossShardTransactionList,
Branch,
Address,
CrossShardTransactionDeposit,
TypedTransaction,
Serializable,
Prepende... |
# Copyright (c) 2017 <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,... |
#*********************
#data:2016-08-04
#author:luolongqiang
#*********************
import numpy as np
from numpy import array
from math import sqrt
from PIL import Image,ImageDraw,ImageFont
from pandas import DataFrame
import time, sys, os
def GetFileList(FindPath,FlagStr=[]):
FileList=[]
FileNames=o... |
import numpy as np
import tensorflow as tf
import nibabel as nib
from tensorflow.keras.utils import Sequence
import threading
from .load_images import LoadedImg
from .dispatch import PatchMaker
LABEL_IS_IMAGE_TYPES = ["img", "nifti", "vol"]
LABEL_IS_FILE_LIST_TYPES = ["txt", "tsv", "file"]
##
## This is a base class... |
import logging
import networkx
import claripy
import ailment
from ...block import Block, BlockNode
from .. import Analysis, register_analysis
from .region_identifier import RegionIdentifier, MultiNode, GraphRegion
l = logging.getLogger(name=__name__)
INDENT_DELTA = 2
class SequenceNode:
def __init__(self, n... |
#!/usr/bin/env python
# coding=utf-8
"""
PSD, intra- and inter-brain measures functions
| Option | Description |
| ------ | ----------- |
| title | analyses.py |
| authors | <NAME>, <NAME>, <NAME> |
| date | 2020-03-18 |
"""
import copy
from collections import namedtuple
from typing impo... |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 14 23:48:12 2019
@author: ion
"""
import numpy as np
import scipy.sparse as sps
import timeit
#import tensorflow as tf
import numba
#from tt_extra import mat_to_tt
import matplotlib.pyplot as plt
import tt
def nz_prod(l, i):
tmp = 1.0
for... |
#-- coding: utf-8 --
#@Time : 2021/3/16 23:46
#@Author : <NAME>
#@Email : <EMAIL>
#@File : SHADE_CO.py
#@Software: PyCharm
import numpy as np
from SHADE_Constraints_Optimization.constrained_problem_set import Problem
from SHADE_Constraints_Optimization.epsilon_method import EpsilonMethod
NP = 100 # Number of popu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 22 15:27:37 2021
Proyecto de Integracion: Virtual Piano Keyboard
Fuentes:
OpenCV
https://opencv.org/
<NAME>
https://www.youtube.com/watch?v=sW4CVI51jDY
<NAME> (The Coding Lib)
https://github.com/niconielsen32/ComputerVisio... |
#! /usr/bin/env python3.3
#-*- coding: utf-8 -*-
# Auteur : Phyks (<EMAIL>)
# Site web : http://phyks.me
# Licence : BEERWARE
# Description :
# =============
# Récupérer et afficher la météo et le nombre de vélibs aux stations
# prédéfinies sur un écran LCD nokia 3310 (connecté via les pins GPIO)
# Plus d'information... |
"""
@file __init__.py
@author <NAME>
@author <NAME>
@author <NAME>
@author <NAME>
@author <NAME>
@author <NAME>
@date 2008-03-27
@version $Id$
This file contains a content handler for parsing sumo network xml files.
It uses other classes from this module to represent the road network.
SUMO, Simulation of ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Common filesystem operations """
from __future__ import absolute_import
from __future__ import unicode_literals
from __... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 26 17:46:37 2018
@author: ikechan
"""
import pygame
import sys
import random
from pygame.math import Vector2
x = 0
y = 1
"""
-------------------------------------------------------------------------------
0. Functions Definition
----------------... |
"""
inspiration from R Package - PerformanceAnalytics
"""
from collections import OrderedDict
import pandas as pd
import numpy as np
from tia.analysis.util import per_series
PER_YEAR_MAP = {
'BA': 1.,
'BAS': 1.,
'A': 1.,
'AS': 1.,
'BQ': 4.,
'BQS': 4.,
'Q': 4.,
'QS': 4.,
'D': 365.... |
'''
Object that encapsulates a USB-attached GRBL-based CNC controller.
Notes:
* Cycle Start, Feed Hold, and Reset realtime commands have corresponding HW buttons
* types of packets that can be sent by the controller:
- 'ok': command ack at end of execution
- 'error:<code>': error of type <code> occurred
... |
# -*- coding:utf-8 -*-
'''
handler
'''
import datetime
import tornado
import domains
import utils
from sqlalchemy import func
from domains import Post, Option, Tag, Comment, post_tag
from domains import load_info
from utils import dbhook, route
class BaseHandler(tornado.web.RequestHandler):
'''BaseHandler'''
... |
# vim: set filetype=python fileencoding=utf-8:
# -*- coding: utf-8 -*-
#============================================================================#
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may ... |
# Copyright Contributors to the Rez project
#
# 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 datetime
import math
import random
import string
import db_default
from sqlalchemy import not_, or_
from flask_login import UserMixin
from .common import cache
from .model import (
Buildings,
Items,
Records,
Revisions,
Statuses,
Unfinisheds,
Users,
Offices,
db,
sequenceTab... |
import argparse
import os
import sys
import shutil
import time
import random
import warnings
import datetime
import sys
import json
import copy
import numpy as np
import pickle
from time import time
from tqdm import tqdm
import math
np.set_printoptions(threshold=sys.maxsize)
import sklearn
from sklearn import random_... |
import argparse
import configparser
from edward2.tracers import condition, tape
from edward2.tensorflow.generated_random_variables import (
Dirichlet, HiddenMarkovModel, Normal)
import tensorflow.compat.v2 as tf
from tensorflow_probability import distributions as tfpd
import matplotlib.pyplot as plt
import nump... |
# This code is licensed under the MIT License (see LICENSE file for details)
import pathlib
import datetime
import json
import numpy
from scipy import spatial
from PyQt5 import Qt
from zplib import datafile
from zplib import fit_affine
import freeimage
from ris_widget.overlay import roi
from ris_widget import layer
... |
#Copyright 2009 <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 to in writi... |
# Copyright (c) 2019 <NAME> and <NAME>
#
# This file is part of the LipidFinder software tool and governed by the
# 'MIT License'. Please see the LICENSE file that should have been
# included as part of this software.
"""Set of methods aimed to merge all features of each feature cluster
into one:
> process_features... |
#!/usr/bin/python
from __future__ import print_function
from snappy import *
from cypari import *
from ManifoldIterators import *
import Queue
import code
import errno
import fcntl
import itertools
import os
import pdb
import re
import signal
import subprocess
import sys
import threading
import time
import traceback
... |
"""
Pytorch version of PPRNetPlus.
Author: <NAME>
"""
import os
import sys
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(FILE_DIR)
import torch
import torch.nn as nn
import numpy as np
import backbone
from object_type import ObjectType
from pose_loss import PoseLossCalculator
... |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for ``flocker.node.agents.ebs`` using an EC2 cluster.
"""
import time
from uuid import uuid4
from bitmath import Byte
from boto.ec2.volume import (
Volume as EbsVolume, AttachmentSet
)
from boto.exception import EC2ResponseError
... |
import logging
import traceback
import os
import re
import requests
import boto3
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.files.storage import get_storage_class
logger = logging.getLogger(__name__)
s3 = boto3.resource('s3', endpoint_url=settings.AWS_S3_ENDPOINT_UR... |
# -*- coding:utf8 -*-
# @TIME : 2021/3/18 10:27
# @Author : SuHao
# @File : model.py
import torch.nn as nn
from utils.parse_config import *
from utils.utils import *
from itertools import chain
def creat_modules(module_defs):
"""
Constructs module list of layer blocks from module configuration in m... |
import ast
import numpy as np
import os
from os import path
import pickle
import typing
import json
from autoarray.structures.arrays import values
# from autoarray.structures.arrays.one_d import array_1d
from autoarray.structures.grids.two_d import grid_2d
from autoarray.structures.grids.two_d import grid... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team. 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/LI... |
# ===============================================================================
#
# Copyright (c) 2013-2017 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# ===============================================================================
'''
Create... |
import datetime
import logging
import math
import os
import threading
import warnings
from typing import Tuple, Optional, Dict, Any, NamedTuple
import numpy as np
from astropy.io import fits
import astropy.units as u
from pyobs.comm import TimeoutException, InvocationException
from pyobs.utils.enums import ImageType, ... |
import json
import os
import re
import shutil
from pathlib import Path
import requests
import tempfile
import gzip
from ampal import AmpalContainer, Assembly, Polypeptide
from ampal.pdb_parser import convert_pdb_to_ampal
from external_programs.dssp import run_dssp
from settings import global_settings
_mmols_numbers_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 23 10:01:27 2018
@author: shawn
"""
import tensorflow as tf
import tensorlayer as tl
import numpy as np
import BatchDatasetReader as BDR
import read_Data_list as RDL
import sys
import time
from sklearn.metrics import roc_auc_score
from sklearn.metr... |
from __future__ import absolute_import, unicode_literals
import errno
import signal
import sys
import pytest
from case import Mock, call, patch, skip
from celery.apps.multi import (Cluster, MultiParser, NamespacedOptionParser,
Node, format_opt)
class test_functions:
def test_par... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import os
import cv2
import torch
import numpy as np
from glob import glob
from tqdm import tqdm
from multiprocessing import Pool
from siamban.core.co... |
import torch
import torch.nn as nn
from collections import OrderedDict
import random
import time
from pathlib import Path
import predicting_performance.metrics as metrics
from predicting_performance.stats_collector import StatsCollector
from predicting_performance.trainer import Trainer
from automl.utils.utils_dat... |
# -*- coding: utf-8 -*-
' a demo for comparing classification-based decoding and RSA '
# Users can learn how to use Neurora to decode information by RSA.
__author__ = '<NAME>'
import os
import sys
import zipfile
import numpy as np
import scipy.io as sio
import h5py
from sklearn.svm import SVC
from neurora.stuff impo... |
import discord
from discord.ext import commands
from discord import Embed as AkagiEmbed
import datetime
import asyncio
import itertools
import sys
import traceback
from async_timeout import timeout
from functools import partial
from youtube_dl import YoutubeDL
ytdlopts = {
'format': 'bestaudio/best',
'outtmpl... |
from Instrucciones.Instruccion import Instruccion
from Instrucciones.AtrColumna import AtributosColumna
from storageManager import jsonMode as DBMS
from Entorno.Entorno import Entorno
from Entorno.Simbolo import Simbolo
from Entorno.TipoSimbolo import TipoSimbolo
from Expresion.variablesestaticas import variables
from ... |
# Built-in modules #
import os, stat, tempfile, re, subprocess, shutil, codecs, gzip
# Internal modules #
from plumbing.common import append_to_file, prepend_to_file
from plumbing.cache import property_cached
# Third party modules #
import sh
##########################################################################... |
import engine_revised
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtMultimedia import *
import sys
from client import Client
from threading import Thread
import protobuffer_pb2 as game
from time import sleep
selectedColor ... |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / <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 lim... |
import asyncio
import copy
import inspect
import logging
from contextlib import AbstractAsyncContextManager, AbstractContextManager
from types import TracebackType
from typing import TYPE_CHECKING, Any, Callable, Coroutine, Dict, List, Mapping, Optional, Tuple, Type, Union
from pydantic import BaseConfig, BaseModel
fr... |
"""
A module containing classes and functions for generating and analyzing linear feedback shift registers and their sequences.
"""
import numba
from numba import int64
import numpy as np
from ._fields import FieldClass, FieldArray
from ._overrides import set_module
from ._polys import Poly
from ._poly_conversion impo... |
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, Gio, GLib, Gtk
import re
class DBusInterface:
def __init__(self, name, path, application):
"""Etablish a D-Bus session connection
:param str name: interface name
:param str path: object path
:par... |
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import pandas as pd
import numpy as np
import sys, logging
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import re
import os
import bisect
import io
import logging
import re
import requests
from ast import literal_eval
from datetime import datetime, timedelta
from html.parser import HTMLPars... |
#@+leo-ver=5-thin
#@+node:ekr.20150326145530.1: * @file ../modes/forth.py
# Hand-written Leo colorizer control file for forth mode.
# This file is in the public domain.
#@@killbeautify
from leo.core import leoGlobals as g
#@+<< define mode rules >>
#@+node:ekr.20150326145530.2: ** << define mode rules >> (forth.py)
# R... |
import logging
import numpy as np
from pathlib import Path
from time import time
import astropy.units as u
from astropy.table import QTable
from astropy.coordinates import SkyCoord
from echo import delay_callback
from jdaviz.core.helpers import ConfigHelper
from jdaviz.core.events import SnackbarMessage, TableClickM... |
from collections import OrderedDict
from datetime import date, datetime
import json
from backdrop.core.query import Query
from backdrop.core.timeseries import DAY, WEEK
TABLE_NAME = 'mongo'
CREATE_TABLE_SQL = """
CREATE TABLE IF NOT EXISTS mongo (
id VARCHAR PRIMARY KEY,
collection VARCH... |
from src.AIVision import AIVision
import src.Helper as helper
from src.Logger import logger
import cv2
import numpy as np
DisplayIndex = 0
ScreenStepsBox = np.array([20, 20, 200, 200])
LowHSV = np.array([0, 0, 0])
HighHSV = np.array([179, 255, 255])
LowBGR = np.array([0, 0, 0])
HighBGR = np.array([255, 255, 255])
C... |
# Python modules
# 3rd party modules
import numpy as np
# Our modules
import vespa.analysis.constants as constants
import vespa.analysis.svd_output as svd_output_module
import vespa.analysis.functors.funct_ecc as funct_ecc
import vespa.analysis.functors.funct_water_filter as funct_water
from vespa.common.util.math_ i... |
#!/usr/bin/python3
# cloudburst framework - <NAME> 2021 <EMAIL>
# multithreading
import concurrent.futures
import json
import jsonschema
import os
import os.path
import shutil
# from multiprocessing import Pool
import subprocess
from pathlib import Path
import s3lib
import ziplib
# this variable determines the defau... |
# Code obtained from https://muratsensoy.github.io/gen.html
import tensorflow as tf
import numpy as np
import pandas as pd
import sys
import torch
from skimage import io
from tensorflow_probability import distributions as tfd
from os.path import dirname, realpath
# Add root directory to path
file_path = realpath(__fil... |
#!/usr/bin/env python
import sys
import json
import os
import getopt
import MySQLdb
import requests
from read_config import asntryst_read_config
verbose = 0
def collect_geo(conn, af_list):
ip_geo = {}
for af in af_list:
if af == 6:
inet_ntoa = 'INET6_NTOA'
else:
inet_ntoa = 'INET_NTOA'
## IP1
cur ... |
from __future__ import print_function
import os
import numpy as np
from keras.models import Model
from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose, Dropout, BatchNormalization
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint,ReduceLROnPlateau,EarlyStopping... |
import base64
import json
import posixpath
import nbformat
import numpy
import tiledb
import tiledb.cloud
import tornado.web
import traitlets
from notebook.services.contents import checkpoints
from notebook.services.contents import filecheckpoints
from notebook.services.contents import filemanager
from notebook.servic... |
# -*- coding: utf-8 -*-
import numpy as np
import os
from matplotlib import pyplot as plt
from matplotlib2tikz import save as tikz_save
# Since the package is not working properly, here I have hand fixes
import helpToTikz as fix
### Plotting options:
# If you want to get the plots on a specific experiment-folder or ... |
# -*- coding: utf-8 -*-
# @Time : 2019-12-04 16:21
# @Author : binger
__all__ = ["FontDraw", "FontAttr", "FontDrawResult"]
from PIL import Image, ImageDraw, ImageFont
from operator import itemgetter
from collections import namedtuple
import math
# import attr
class FontAttr(object):
def __init__(self, ... |
#!/usr/bin/env python3
import sys
import os
import re
import json
import xml.etree.ElementTree
# Version check
f"Python 3.6+ is required"
class UserException(Exception):
pass
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def find(f, array):
for a in array:
if f(a):
return f
d... |
# 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 os
import os.path
import logging
import json
from pathlib import Path
from yattag import Doc
from typing import Tuple, List, Dict, Any, NewType
from json2html import *
TPslPoint = NewType('TPslPoint', Dict[str, Any])
test_dir = Path(__file__).parent.parent.absolute()
build_dir = test_dir.absolute() / "build"
f... |
import os
import sys
import glog as log
import torch
import torch.utils.data as data
import torch.nn.functional as F
import numpy as np
p = os.path.dirname(os.path.dirname((os.path.abspath(__file__))))
if p not in sys.path:
sys.path.append(p)
from utils import get_melody_onehot_target, target_to_3dtarget
hold_pit... |
import pickle
from bs4 import BeautifulSoup
import re
import json
import threading
import time
from datetime import datetime
import numpy as np
from urllib.parse import unquote
import sys
from utils import Config, safe_pickle_dump, requests_get
sys.setrecursionlimit(10000)
failed = []
skipped = []
def wrap_color(te... |
"""Module for evaluating policies."""
from typing import Dict, List, Optional, Callable, cast
import uuid
import time
from pydantic import AnyHttpUrl
from fidesctl.cli.utils import handle_cli_response, pretty_echo
from fidesctl.core import api
from fidesctl.core.api_helpers import get_server_resources, get_server_res... |
#!/usr/bin/env python
import argparse
import ast
import json
import os
import re
import sys
import jsonpatch
import yaml
# Python code generator to create new troposphere classes from the
# AWS resource specification.
#
# This gnerator works by reading in an AWS resource specification json file.
# The resources and... |
import requests
from bs4 import BeautifulSoup
import unidecode
import math
import re
import nltk
import pandas as pd
import sys
import PIL.Image as Image
import io
from urllib.request import urlopen
import os
import datetime
import time
import pickle
import argparse
import numpy as np
import cv2
from itertools impor... |
import unittest
from textwrap import dedent
import astroid.nodes
import astroid.rebuilder
import astroid.builder
import pytest
from pydocspec import astroidutils
from .test_astbuilder import mod_from_text
class InferTypeAnnotationTests(unittest.TestCase):
def test_literal_infer(self):
values = [
... |
#!/usr/bin/env python2
"""Helper function for train, eval and infer with the tagger model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import numpy as np
import tensorflow as tf
from sklearn.metrics import accuracy_sc... |
import os
try:
import skmultilearn
except:
os.system('pip3 install scikit-multilearn')
import logging
# import sys
# sys.path.append("./AutoDL_sample_code_submission/tabular")
# print(os.getcwd())
from model_manger import LabelPowersetLGB, SklearnLGB, SVM, BinaryRelevances
from model_manger import ClassifierCh... |
# This program will clean your data set
# IMPORTING MODULES
import pandas as pd
# Defining function to check for correct input for choosing columns
def user_drop_entry(data_cols, user_input_values):
user_input_lower = [value.lower() for value in user_input_values]
# This statement will trigger only if the use... |
from ortools.sat.python import cp_model
import matplotlib.pyplot as plt
import numpy as np
import uuid
import json
import yaml
from copy import deepcopy
import os
from mixsol import Solution as Solution_mixsol
from frgpascal.hardware import liquidhandler
from frgpascal.workers import (
Worker_GantryGripper,
Wo... |
#!/usr/bin/env python3
import os
import sys
import shlex
import shutil
import argparse
import subprocess
import distutils.util
from hashlib import sha256
from pathlib import Path
from pprint import pprint
__version__ = "0.6"
nspawn_cmd_base = ['systemd-nspawn', '--quiet']
class DockerfileParser():
def __init__... |
# -*- coding:utf8 -*-
'''
This file is part of the repo: https://github.com/tencent-ailab/hifi3dface
If you find the code useful, please cite our paper:
"High-Fidelity 3D Digital Human Head Creation from RGB-D Selfies."
ACM Transactions on Graphics 2021
Code: https://github.com/tencent-ailab/hifi3dface
Copyright (c... |
'''NDG Security Policy Enforcement Point Module
__author__ = "<NAME>"
__date__ = "11/07/10"
__copyright__ = "(C) 2010 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "<EMAIL>"
__revision__ = '$Id$'
'''
import logging
log = logging.getLogger(__name_... |
# coding=utf-8
from ..items import CalendarItem, Contact, Message, Task, DistributionList, MeetingRequest, MeetingResponse, \
MeetingCancellation, ITEM_CLASSES
from ..version import EXCHANGE_2010_SP1, EXCHANGE_2013, EXCHANGE_2013_SP1
from .base import Folder
from .collections import FolderCollection
class Calenda... |
"""
Name: Tetris/main.py
Description: Tetris in Python using Tkinter
Author: Nathan "Nathcat" Baines
"""
import random
from tkinter import *
from tkinter import messagebox
"""
Shape class objects
"""
# Class for L shape
class L:
# __init__
def __init__(self, game_box):
self.game_box = game_box
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 7/6/2018 17:26 AM
# @Author : jaykky
# @File : zjai_6_comparison.py
# @Software: ZJ_AI
#此程序是用于比对模型的识别成果和真实情况,并得到精确率和召回率的模型指标。
#主要方法是对比模型识别出来的object和xml文件的信息
#属于测试fasterrcnn的模型性能
#输入:模型文件路径,测试图像路径,
#输出:精确率和召回率
# =====================================================... |
import pandas
import scipy.interpolate
import numpy as np
from ..j_utils.string import str2time, time2str
from ..j_utils.path import format_filepath
from collections import OrderedDict
class History:
"""
Store dataseries by iteration and epoch.
Data are index through timestamp: the number of iteration sin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.