text stringlengths 6.04k 39.5k |
|---|
import pytest
from RP1210 import J1939
from RP1210.J1939 import DTC, DiagnosticMessage, J1939Message, toJ1939Message
from RP1210 import sanitize_msg_param
def toDTC(spn : int, fmi : int, oc : int) -> bytes:
"""
Generates diagnostic trouble code (DTC) for diagnostic messages (DM1, DM2, or DM12).
To use, ge... |
from lib import BitStreamReader, BitStreamWriter, encode_bin, decode_bin
from core import *
from adapters import *
#===============================================================================
# fields
#===============================================================================
def Field(name, length):
"""... |
# -*- coding: utf-8 -*-
import datetime
import json
import colander
import deform
import jinja2
from pyramid import httpexceptions
from pyramid.exceptions import BadCSRFToken
from pyramid.view import view_config, view_defaults
from pyramid.security import forget, remember
from pyramid_mailer import get_mailer
from py... |
from vizer.draw import draw_boxes
from PIL import Image
import numpy as np
import collections
import argparse
import torch
import glob
import time
import cv2
import os
from ssd.config import cfg
from ssd.data.datasets import COCODataset, VOCDataset, MyDataset
from ssd.data.transforms import build_transforms
from ssd.m... |
r"""
分布式 Trainer
使用步骤
1. 在代码中调用 DistTrainer,类似 Trainer,传入模型和数据等等参数
2. 在命令行中,将 python your_script.py 替换为 python -m torch.distributed.launch --nproc_per_node=N your_script.py
"""
import logging
import os
import time
from datetime import datetime
import contextlib
import torch
import torch.cuda
import torch.distributed a... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 13 18:41:38 2021
@author: divyoj
"""
## importing libraries:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.animation import FuncAnimation
import os
# # note that this must be executed before 'import numba'
# o... |
import os
import sys
import zipfile
import requests
import shutil
from shapely.geometry.polygon import Polygon
from shapely.ops import transform
import pyproj
from osgeo import gdal
from pandas import DataFrame
import pandas as pd
import numpy as np
from osgeo import gdal
import pickle
from tqdm import tqdm
import clic... |
import sensor, image, time, utime, pyb, ustruct, os, math
def toggle_flash():
# \/ This is the code to define a Pin, make it an output and set it high/low \/
irflash = pyb.Pin("P3", pyb.Pin.OUT_PP, pyb.Pin.PULL_NONE)
print ("Pin 3 value = ",irflash.value()) #print the current value
if irflash.value() ... |
# Copyright (C) 2015 Catalyst IT Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""
*azcam.utils* contains general purpose support commands used throughout azcam.
"""
import os
import shlex
import sys
import tkinter
import tkinter.filedialog
# keyboard checking is optional
try:
import msvcrt
except Exception:
pass
import azcam
def curdir(folder: str = "") -> str:
"""
Gets and ... |
'''
Module : Main
Description : The main entry point for the program.
Copyright : (c) <NAME>, 22 Jul 2020
License : BSD
Maintainer : <NAME>
Portability : POSIX
The program reads one or more input FASTA files and convets them to emoji.
'''
from argparse import ArgumentParser
from math import floor
import... |
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the various utilities to build Chrome with AFDO.
For a description of AFDO see gcc.gnu.org/wiki/AutoFDO.
"""
import datetime
import... |
import time
from .__init__ import print_msg_box
def isUnique(input_string,hint=False):
mapp = []
for i in input_string:
if i not in mapp:
mapp.append(i)
if(hint is True):
isUnique_hint()
return len(mapp) == len(input_string)
def isUnique_hint():
message ="""
Uniq... |
# coding: utf-8
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2021-2021 European Synchrotron Radiation Facility, Grenoble, France
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation ... |
# File : main.py (Android Watch)
# Version : 1.1.1
# Description : Mobile/Desktop app that implements character recognition via touchscreen
# Date: : Jan 20, 2022
# Author : <NAME> (<EMAIL>)
# License : MIT
import os
from kivy.app import App
from kivy.uix.button import ... |
from datetime import datetime
from urllib.parse import quote_plus
import io
import pkg_resources
import pandas as pd
import sqlite3
from collections import namedtuple
from operator import itemgetter
from whotracksme.data.db import load_tracker_db, create_tracker_map, WhoTracksMeDB, DATA_COLUMNS
def asset_exists(name... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ##
# @brief [py demo] muliti robot sync test
# @author <NAME> (<EMAIL>)
import rospy
import os
import threading, time
import sys
sys.dont_write_bytecode = True
sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__),"../../../../common/imp")) ) #... |
import cv2
import torch
import numpy as np
color_list = np.array([[.7, .7, .6],[.7, .5, .5],[.5, .5, .7], [.5, .55, .3],[.3, .5, .55], \
[1,0.855,0.725],[0.588,0.804,0.804],[1,0.757,0.757], [0.933,0.474,0.258],[0.847,191/255,0.847], [0.941,1,1]])
focal_length = 443.4
def get_rotate_x_mat(angle):
angle = ... |
""" Testing DKI microstructure """
from __future__ import division, print_function, absolute_import
import numpy as np
import random
import dipy.reconst.dki_micro as dki_micro
from numpy.testing import (assert_array_almost_equal, assert_almost_equal,
assert_, assert_raises)
from dipy.sims.v... |
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, Inc.
#
# 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
#
# ... |
from collections import defaultdict, namedtuple
from datetime import datetime
import re
from sqlalchemy.exc import IntegrityError
from grouper.audit import assert_controllers_are_auditors
from grouper.constants import ARGUMENT_VALIDATION, PERMISSION_ADMIN, PERMISSION_GRANT
from grouper.email_util import send_email
fr... |
#!/usr/bin/python3
import sys
import json
import gzip
from lxml import etree
HEADER = """
/* Automatically generated from JMdict */
/* http://www.edrdg.org/jmdict/edict_doc.html */
/* ... |
import pkgutil
import traceback
import re
import sys
from os import path
import types
import threading
__running = {}
REPOS = ['https://github.com/martinpihrt/OSPy-plugins/archive/master.zip'] # repository with plugins
################################################################################
# Plugin Options ... |
#!/usr/bin/python
from builtins import str
from builtins import object
from ansible import errors
import json
import glob
import os
import sys
import re
import traceback
import sys
CLI_GROUP = "__cli_contrail_group__"
try:
PLAYBOOK_BASE = 'opt/contrail/fabric_ansible_playbooks'
sys.path.append(PLAYBOOK_BASE +... |
"""Controllers for the organizer."""
import functools
import os
from typing import List, Optional, Set
from flask import (Blueprint, abort, current_app, flash, jsonify,
redirect, render_template, request, session, url_for)
import jinja2
from flask_babel import _ # type: ignore
from flask_babel imp... |
"""
Note: this code will actually run as a plugin in the RobotFramework Language
Server, or in the Robocorp Code environment, so, we need to be careful on the
imports so that it works on both cases.
Also, the required version must be checked in the client (in case imports or APIs
change in `robocorp_ls_core` we need ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 EMBL - European Bioinformatics Institute
#
# 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/LICEN... |
#!/usr/bin/python
"""
make_release.py: Update files in this modflow6 repository according to relase information.
This script is used to update several files in the modflow6 repository, including:
../version.txt
../doc/version.tex
../README.md
../DISCLAIMER.md
../code.json
../src/Utiliteis/version.f90
Co... |
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Set, Tuple
import os
import sys
import getopt
from json import load as json_load
import hashlib
import shutil
import logging
from angularhostpagetemplate.engine import TagMapper, replace_tags
_log = logging.getLogger(__name__)
def ... |
#import Tkinter as tk
import os,sys
try:#if python2
from Tkinter import *
#import Tkinter
import tkMessageBox
print('current python version is 2')
py_ver = 2
except ImportError:#else python3
from tkinter import *
#import tkinter
from tkinter import messagebox
print(... |
"""
================================================
My own Gaussion Mixture Model for SV genotyping.
Learn form scikit-learn
================================================
Author : <NAME>
Date : 2014-01-06 14:33:45
"""
import sys
import numpy as np
from scipy import linalg
from sklearn import cluster
from sklear... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# jona-sassenhagen <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: Simplified BSD
import numpy as np
from .colormap import _calculate_lut
from .view import views_dict
from .surface import Surfac... |
""" domain.py part of pymfree/core
This module implements a central PyMfree entity, which is a domain. This domain
is defined by a number of n-dim support nodes and a norm on that domain.
"""
import torch
import faiss
import numpy as np
from pymfree.core.function import Norm
from pymfree.core.function import L1Norm
fr... |
from ast import literal_eval
from luna.mol.entry import REGEX_RESNUM_ICODE
from luna.util.config import Config
from luna.util.exceptions import IllegalArgumentError
AROMATIC_STACKINGS = ["pi-stacking", "face-to-face pi-stacking", "face-to-edge pi-stacking", "face-to-slope pi-stacking",
"edge-to... |
"""
Module: Pathfinder_GIS_steps
===============================================
A module that contains the GIS functions for Pathfinder_processing_steps
It creates the target files (from un-electrified), creates the weights for road and grid, and identify an origin as close as possible to the center of the cell
-----... |
import multiprocessing as mp
import random
import time
import warnings
from os.path import join as join_path
from typing import Optional
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.lines import Line2D
from scipy import linalg
from scipy.integrate import simps
from atmospheres import BaseAt... |
# -*- coding: utf-8 -*-
"""Parser for MacOS Keychain files."""
from __future__ import unicode_literals
# INFO: Only supports internet and application passwords,
# because it is the only data that contains timestamp events.
# Keychain can also store "secret notes". These notes are stored
# in the sam... |
import os
import sqlite3
import datetime
import webbrowser
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkcalendar import *
# The main window
main = Tk()
main.title('Sala | الصلاة') # title
main.iconbitmap("img/am6-logo.ico") # icon
main.geometry('300x320') # area
#... |
from psana import dgram
from psana.event import Event
from psana.psexp import PacketFooter, TransitionId, PrometheusManager
import numpy as np
import os
import time
import logging
logger = logging.getLogger(__name__)
s_bd_just_read = PrometheusManager.get_metric('psana_bd_just_read')
s_bd_gen_smd_batch = Promet... |
# Copyright 2016 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 app... |
#!/usr/bin/env python
"""Converts a payment-details CSV (Comma Separated Value) file
exported from the OpenSky Dashboard -> Accounts -> Payments to a QIF
(Quicken Interchange Format) file.
Each row in the CSV file corresponds to a line item in an order.
Lines with the same "Order ID" are combined into a single order.... |
'''
CmndHelperPQ is a helper class for dealing with commands
sent to a PyQt piped viewer.
This package was developed by the Thermal Modeling and Analysis
Project (TMAP) of the National Oceanographic and Atmospheric
Administration's (NOAA) Pacific Marine Environmental Lab (PMEL).
'''
import sys
try:
import sip
ex... |
import numpy as np
import matplotlib.pyplot as plt
from ....utils import box_utils, calibration_kitti, common_utils, object3d_kitti
from skimage import io
try:
from spconv.utils import VoxelGeneratorV2 as VoxelGenerator
except:
from spconv.utils import VoxelGenerator
def load_from_bin(root_split_path, idx):... |
import os
import tempfile
import pandas as pd
import csv
from nidm.experiment.Query import GetProjectsUUID
import click
from nidm.experiment.tools.click_base import cli
from nidm.experiment.tools.rest import RestParser
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import silhouette_score
from ... |
#!/usr/bin/env python
#
# BLIS
# An object-based framework for developing high-performance BLAS-like
# libraries.
#
# Copyright (C) 2014, The University of Texas at Austin
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... |
from keras.utils import to_categorical, Sequence
from rdkit import Chem
from rdkit.Chem import rdmolops, AllChem
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import math
from sklearn import preprocessing
from model.utils_ import read_csv, read_csv2, read_griddata, normalized_laplacia... |
#!/usr/bin/env python3
#
# Copyright (c) 2020 <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... |
# noqa: ignore=F811
import idaapi
import os
from bap.utils import trace
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5.QtCore import (
Qt,
QFile,
QIODevice,
QCryptographicHash as QCrypto,
QRegExp,
QTimer,
QAbstractItemModel,
QModelIndex,
QVariant,
pyqtSignal,... |
""" Strategy.
"""
import random
import math
from itertools import combinations
from result import WhiteResult, BlackResult
from player import Player
def _index_to_alphabet(index):
""" Convert the index to the alphabet.
"""
return chr(ord("A") + index)
def get_strategy_map():
""" Return the defined... |
###################################################################
# Melissa #
#-----------------------------------------------------------------#
# COPYRIGHT (C) 2017 by INRIA and EDF. ALL RIGHTS RESERVED. #
# ... |
#_*_coding:utf-8 _*_
from .face_struct import *
import cv2
import numpy as np
import base64
import sys,os
import platform
API_DIR = os.path.dirname(os.path.abspath(__file__))
platform_name = platform.platform().lower()
LIB_PATH=None
dll=None
if "windows" in platform_name:
LIB_PATH = os.path.join(API_DIR,"lib","w... |
from jax import numpy as jnp
import numpy
import matplotlib.pyplot as plt
from scipy.fft import rfft,fft,fftshift
from scipy.signal import gaussian
from constants import *
import helper as h
#%% some windows for experimentation
def sinc_window(ntap=NTAP,lblock=LBLOCK):
"""Sinc window function
Parameter... |
import unittest
import os
import sys
import pdb
from corpustools.corpus.classes import (Word, Corpus, FeatureMatrix, Segment,
Environment, EnvironmentFilter, Transcription,
WordToken, Discourse)
class CorpusTest(unittest.TestCase):
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>, <NAME>
# *****************************************************************************/
import re, os, sys, array, ctypes, time, glob, getopt, math
from optparse... |
#!/usr/bin/env python3.7
"""
This module containe classes that provide accesse to information about workers.
.add_new_worker() - add new worker to company.
.edit_worker() - edit all worker information.
.upd_comp_structure() - update company structure scheme, for instance if you
whant to add new division or sub-divis... |
"""Implements evaluation of trained models"""
import time
import warnings
from pathlib import Path
import pickle
import numpy as np
import torch
from torchvision import transforms
from PIL import ImageFile
from cirtorch.datasets.genericdataset import ImagesFromList
from asmk import asmk_method, kernel as kern_pkg
fr... |
import copy
from ctapipe.instrument.camera.geometry import UnknownPixelShapeWarning
import numpy as np
import astropy.units as u
from astropy.coordinates import Angle
from itertools import zip_longest
import pytest
from astropy.time import Time
from pathlib import Path
from traitlets.config import Config
from ctapip... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.cm as cm
from matplotlib.ticker import AutoMinorLocator
from matplotlib.colors import Normalize
from .composition import _element_composition
from scipy import stats
plt.rcParams.u... |
from ast import Num
from config import *
# Classe pai para funcionário e cidadão
class Pessoa(db.Model):
Id = db.Column(db.Integer, primary_key=True)
NomeCompleto = db.Column(db.String(200))
DtNascimento = db.Column(db.String(100))
Genero = db.Column(db.String(1))
Cpf = db.Column(db.String(100))
... |
#!/usr/bin/env python
# coding: utf-8
from datetime import datetime
from copy import deepcopy
from parser.htmlParser import getCSStext, getValueOfClass, getSoup, getClassName, hasAttX, getLongestWS, getBaseValue, printPages
from tool.tool import numItemInInterval
import math
import subprocess
import os
from extractText... |
#!/usr/bin/env python
#############################################################################################
## PhiSpy is a computer program written in C++, Python and R to
## identify prophages in a complete bacterial genome sequences.
##
## Initial versions of PhiSpy were written by
## <NAME> (<EMAIL>) PhD St... |
# Copyright 2013-2014 by <NAME>.
# License: BSD, see LICENSE for more details.
"""
This defines the :class:`Site` class.
See :doc:`/settings`.
"""
#~ from __future__ import unicode_literals
import os
from djangosite import Site, DJANGO_DEFAULT_LANGUAGE, assert_django_code
from utils import to_locale, LanguageInfo... |
# -*- coding: utf-8 -*-
# Copyright (C) 1999-2015 Mag. <NAME>. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. <EMAIL>
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.c-tanzer.at/license/b... |
import numpy as np
from copy import deepcopy
def sigmoid(x):
return 1/(1 + np.exp(-x))
def backward_tanh(x):
return 1 - x*x
def tanh(x):
return np.tanh(x)
def backward_sigmoid(x):
return x*(1 - x)
def cross_entropy_loss(probs, target_index):
'''
Computes cross-entropy loss
Argume... |
#!/usr/bin/env python
#
# A simple terminal application with wxPython.
#
# (C) 2001-2020 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
from serial.tools.miniterm import unichr
import serial
import threading
import wx
import wx.lib.newevent
import wxSerialConfigDialog
import time
from date... |
"""hxlm.core.schema.vocab prepare internal vocabularies to be used by schema
PROTIP: is possible to test this file directly with
python3 -m doctest -v hxlm/core/schema/vocab.py
pytest -vv hxlm/ --doctest-modules --pyargs
This file is meant to accept 3 categories of internal vocabularies:
- ontologia/core.vkg... |
import numpy as np
import os
def parse_automesh(file):
if os.path.exists(file):
lines = open(file, 'r').readlines()
return lines
def parse_sfo(filename, verbose=False):
"""
Master parser for the SFO file.
Returns the output dict.
"""
groups = parse_sfo_into_groups(filename)
... |
import DR20API
import numpy as np
import matplotlib.pyplot as plt
import math
from math import sin, cos, pi
import time
# You can tune the hyper-parameter, and define your utility function or class in this block if necessary.
obstacles_x = {0: [[0, 5]], 0.5: [], 1: [[2, 2.5]],
1.5: [[2, 2.... |
# PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - <NAME> and <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
... |
#!/usr/bin/env python3
"""
Copyright 2017-2018 Deutsche Telekom AG, Technische Universität Berlin, Technische
Universität Ilmenau, LM Ericsson
Permission is hereby granted, free of charge, to use the software for research
purposes.
Any other use of the software, including commercial use, merging, publishing,
distribu... |
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple, Dict, Iterator
import torch
import torchaudio
@dataclass
class StreamReaderSourceStream:
"""StreamReaderSourceStream()
The metadata of a source stream. This class is used when representing streams of
... |
import datetime
import json
import os
import re
import sys
import tempfile
import numpy as np
import pandas as pd
import tables as tb
from src.tools import utils
from src.tools.PairsIndex import PairsIndex
tempfile.tempdir = "data/tmp/"
if not os.path.exists(tempfile.tempdir):
os.makedirs(tempfile.tempdir, exis... |
from __future__ import annotations
import asyncio
import functools
import colorama
import random
import signal
from typing import Any, Dict, List, Optional
import backoff
import devtools
import httpx
import pydantic
import typer
import servo
import servo.api
import servo.configuration
import servo.utilities.key_path... |
####### Done by KiroTheBlueFox #########
# #
# This is free to use #
# You can redistribute it with proper #
# credits (keep the credits) #
# Do not claim it as your program ! #
# Credits to me (in your mod) are #
# very welcomed ! ... |
"""Assortment of handy functions."""
import inspect
import numpy as np
from six.moves import map, range, zip
from functools import partial
from itertools import tee
from inspect import isgenerator
class Bunch(dict):
"""
Container object for datasets.
Dictionary-like object that exposes its keys as attr... |
from nalaf.features.relations import EdgeFeatureGenerator
from nalaf import print_debug
from nltk.stem import PorterStemmer
from loctext.util import PRO_ID, LOC_ID, REL_PRO_LOC_ID
from nalaf.structures.data import Part
def get_tokens_within(sentence, token_1, token_2):
assert token_1.start < token_2.start, \
... |
import unittest
import numpy as np
import tinygfx.g3d as cg
from tinygfx.g3d import primitives
class TestCountedObject(unittest.TestCase):
def setUp(self):
self.obj = cg.CountedObject()
def test_count_incrementing(self):
obj_id = self.obj.get_id()
for _ in range(20):
next_... |
# coding: utf-8
# # Chicago Crime Statistics
#
# ## Data
#
# ### Chicago Crime [Source: https://www.kaggle.com/currie32/crimes-in-chicago/data]
# Crimes in Chicago from 2001 to 2017 (1.85GB)
#
# This data is broken up into 4 files:<br>
# Chicago_Crimes_2001_to_2004.csv<br>
# Chicago_Crimes_2005_to_2007.csv<br>
# C... |
import os
import re
from pyltp import Segmentor
from pyltp import Postagger
from pyltp import Parser
import json
import sys
from src.utils.config import BASE_DIR
LTP_DATA_DIR = os.path.join(BASE_DIR,'models\\topic_prase\\ltp_data_v3.4.0')
segmentor_DIR = os.path.join(LTP_DATA_DIR,'cws.model')
segmentor = Segmentor()
se... |
import os
import inspect
import csv
import itertools
import numpy as np
import matplotlib.pyplot as plt
"""
This file contains functions for reading and processing physiological data on retinal ganglion cells
(RGCs; the output neurons of the retina). The main functions return curve fits for RGC density
and receptive ... |
"""
Soft Actor-Critic
Based on SAC implementation from https://github.com/denisyarats/pytorch_sac
License:
MIT License
Copyright (c) 2019 <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 ... |
from bisect import bisect_left
from datetime import datetime, timedelta
import os
import netCDF4
import numpy as np
from scipy.interpolate import interp1d
import crps
import train
import data
import models
import msssim
import noise
import plots
import rainfarm
path = os.path.dirname(os.path.abspath(__file__))
de... |
from ..rman_render import RmanRender
from ..icons.icons import load_icons
from .rman_ui_base import _RManPanelHeader
import bpy
class PRMAN_PT_Renderman_UI_Panel(bpy.types.Panel, _RManPanelHeader):
'''Adds a RenderMan panel to the RenderMan VIEW_3D side tab
'''
bl_label = "RenderMan"
bl_space_type = "... |
import asyncio
import base64
import logging
import socket
import time
from contextlib import suppress
from dataclasses import astuple, dataclass
from typing import Any, Awaitable, Callable, List, Optional
from google.protobuf import message
from noise.connection import NoiseConnection # type: ignore
import aioatomap... |
from functools import reduce
from copy import copy
from time import time
import numpy as np
import numpy.random as npr
import numpy.linalg as la
import scipy.linalg as sla
from scipy.linalg import solve_discrete_lyapunov, solve_discrete_are
from utility.matrixmath import vec, mat, mdot, matmul_lr, specrad, dlyap, dar... |
import re
from fastNLP.api.processor import Processor
from fastNLP.core.dataset import DataSet
from fastNLP.core.vocabulary import Vocabulary
from reproduction.Chinese_word_segmentation.process.span_converter import SpanConverter
_SPECIAL_TAG_PATTERN = '<[a-zA-Z]+>'
class SpeicalSpanProcessor(Processor):
"""
... |
# pylint: disable=unused-wildcard-import, wildcard-import
from typing import Union, List
import flatbuffers
import numpy as np
from .schema.Dictionary import *
from .schema.BinaryValue import *
from .schema.BoolValue import *
from .schema.DoubleValue import *
from .schema.Entry import *
from .schema.FloatValue import ... |
# -*-coding:UTF-8 -*
import time
from tkinter import Button, messagebox
from .getroot import root_operation
def operation_produit(mat1, mat2, nb1, nb2, nb3, nb4):
if nb2 != nb3:
messagebox.showerror("Erreur", "Produit Impossible")
return -1
else:
(root_produit, canvas) = root_operat... |
"""
This module contains a set of functions that parse the training data set and
compute the centers for the data clusters.
Here you will also find dictionaries contatining Sentinel2 and Landsat7/8
bands, as well as distionaries containing the mean values for each class.
"""
import numpy as np
import pandas as pd
impo... |
import re
from random import randint as r
FACE_MOVES = ["U", "D", "F", "B", "L", "R"]
SLICE_MOVES = ["M", "E", "S"]
WEDGE_MOVES = ["u", "d", "f", "b", "l", "r", "Uw", "Dw", "Fw", "Bw", "Lw", "Rw"]
ROTATIONS = ["x", "y", "z"]
move_dict = {"U": 0, "L": 1, "F": 2, "R": 3, "B": 4, "D": 5, "E": 0, "M": 1, "S": 2, "x": 0, "... |
#!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
'''
RESTful Python API to D-ZONE DNS Firewall
Schema documentation:
https://firewall-api.d-zone.ca/assets/lib/swagger-ui/index.html?url=%2Fswagger.json#/
ToDo:
look at request_oauth
'''
import json
import os
import requests
imp... |
# -*- coding: utf-8 -*-
""" Module for making calls to EPO-OPS REST-API.
This module contain classes and functions to get data from
[EPO-OPS API](http://www.epo.org/searching-for-patents/technical/espacenet/ops.html)
"""
import logging
import re
import time
from base64 import b64encode
from collections import namedtup... |
import xmltodict
import json, math
import collections
from biothings.utils.dataload import dict_sweep, unlist, value_convert_to_number
from biothings.utils.dataload import boolean_convert
def load_data(xml_file):
drug_list = []
def handle(path,item): #streaming mode of xmltodict
item = restructure_dic... |
# datetime2 base class interface test
# Copyright (c) 2011-2022 <NAME>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notic... |
import traceback
from tkinter import *
from tkinter import filedialog
from Parser.Ascendente.gramatica import parse as AnaParse
from Parser.Ascendente.gramatica import parse_1 as AnaParse_1
from Parser.Reportes.gramatica1 import parse as ReportParse
from Interprete.Tabla_de_simbolos import Tabla_de_simbolos
from Interp... |
import torch
import torchfields
import kornia
import scipy.constants
import itertools
import estimators
import kpn
import stn
class FM(torch.nn.Module):
DEFAULT_MIN_TIME = 0
DEFAULT_DELAY = 0
DEFAULT_PIXEL_SIZE = 10e-6
DEFAULT_QUANTUM_EFFICIENCY = 0.5
DEFAULT_WAVELENGTH = 520e-9
DEFAULT_DARK_... |
#!/usr/bin/env python3
"""
.. automodule:: phile.launcher.cmd
.. automodule:: phile.launcher.defaults
----------------------------------
For starting and stopping services
----------------------------------
"""
# Standard libraries.
import asyncio
import collections
import collections.abc
import contextlib
import dat... |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import os
import math
def grayscale(img):
"""Applies the Grayscale transform
This will return an image with only one color channel
but NOTE: to see the returned image as grayscale
(assuming your grayscaled... |
import argparse, time, logging, os, math, random
os.environ["MXNET_USE_OPERATOR_TUNING"] = "0"
import numpy as np
from scipy import stats
import mxnet as mx
from mxnet import gluon, nd
from mxnet import autograd
from mxnet.gluon import nn
from mxnet.gluon.data.vision import transforms
import gluonnlp as nlp
from o... |
"""The user interface for our app"""
import os
import sys
import models
import config
import ui
# Import Qt modules
from PyQt4 import QtCore, QtGui, uic, QtWebKit
from book_editor import BookEditor
from about_book import AboutBook
from pluginmgr import manager, isPluginEnabled
from pluginconf import PluginSettings
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.