text stringlengths 8.04k 46.5k |
|---|
import operator
from peewee import *
from playhouse.shortcuts import *
from .base import BaseTestCase
from .base import DatabaseTestCase
from .base import ModelTestCase
from .base import TestModel
from .base import db_loader
from .base import get_in_memory_db
from .base import requires_models
from .base import requir... |
from math import log, isnan, log10
import numpy as np
import bokeh
import bokeh.io
from bokeh.models import *
from bokeh.plotting import figure
from itertools import cycle
from hail.expr import aggregators
from hail.expr.expressions import *
from hail.expr.expressions import Expression
from hail.typecheck import *
fr... |
"""
A Canvas owns a set of Items and acts as a container for both the
items and a constraint solver.
Connections
===========
Getting Connection Information
==============================
To get connected item to a handle::
c = canvas.get_connection(handle)
if c is not None:
print c.connected
... |
""" $lic$
Copyright (C) 2016-2017 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
If you use this program in your research, we request that you reference th... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
"""Module utilities and constants used throughout bamnostic
Copyright (c) 2018, <NAME>
This code is part of the bamnostic distribution and governed by its
license. Please see the LICENSE file that should have... |
#
# Copyright (c) European Synchrotron Radiation Facility (ESRF)
#
# 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,... |
# Lint as: python3
# Copyright 2020 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 ... |
#===============================================================================
# Copyright (c) 2015, <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 m... |
from mcppIns.MCPPinstance import MCPPInstance
from math import ceil,floor
from collections import namedtuple
from enum import Enum
import networkx as nx
import matplotlib.pyplot as plt
import sympy
from drawEnv import drawPic,drawSTCPic
class VirConnectError(Exception):
def __init__(self):
super(Vi... |
"""
Implements classes to store Expressions and evaluate them.
Relies entirely on the standard library.
"""
from typing import Union, List, Callable, Tuple, Dict, Optional, Any
import numpy as np
np.seterr(all="ignore")
MAX_REPITIONS = 1_000_000
def kth_root(k: float, x: Union[float, np.ndarray]) -> Union[float,... |
"""Provides an integration that can match the color of lights to the
'entity_picture' of any supported 'media_player' device."""
import io
import logging
import math
import urllib.request
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'color_fx'
CONF_HOST = 'host'
ATTR_URL = 'url'
ATTR_MEDIA_PLAYER = 'media_pla... |
#
# Copyright (C) 2013 <NAME>. See Copyright Notice in main.py
#
import ljd.bytecode.instructions as ins
from ljd.bytecode.helpers import get_jump_destination
from ljd.bytecode.constants import T_NIL, T_FALSE, T_TRUE
import ljd.ast.nodes as nodes
#
from ljd.util.utils import dump
class _State():
def __init__(self... |
import json
from tqdm import tqdm
import pdb
import pickle
import nltk
import numpy as np
from get_model_performances import _get_entities, _get_entity_embeddings
from bart_summarization import get_closest_terms
from analysis.map_condition_phrases import read_embeddings
from evaluation.create_kg import create_entity_a... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
"""
The Cryptopals Crypto Challenges
cryptopals.com
Set 2 Solutions by <NAME>
"""
import set1
import os
import random
"""
Challenge 9 - Implement PKCS#7 padding
--------------------------------------
A block cipher transforms a fixed-sized block (usually 8 or 16 bytes) of plaintext into ciphertext. But we almost neve... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for the coder file browser pane."""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 <NAME> (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import absolute_impor... |
"""Welcome to ortografix.
This is the entry point of the application.
"""
import os
import argparse
import random
import time
import itertools
import logging
import logging.config
import statistics as stats
import torch
from torch import optim
import textdistance as dist
import ortografix.utils.config as cutils
im... |
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# coding: utf-8
"""
"""
import torch
import torch.optim as optim
import torch.nn as nn
import os
import time
import copy
import numpy as np
import torch.nn.functional as F
from tensorboardX import SummaryWriter
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_auc_score, f1_score
from visua... |
from polymath.codegen.dnnweavergen.dnnweaver2.graph import Graph, get_default_graph
from polymath.codegen.dnnweavergen.dnnweaver2.tensorOps.cnn import conv2D, maxPool, flatten, matmul, addBias, batch_norm, reorg, concat, leakyReLU
from polymath.codegen.dnnweavergen.dnnweaver2 import get_tensor
import logging
from pol... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import simtk.openmm as mm
import simtk.openmm.app as app
import simtk.unit as u
import mdtraj as md
from mdtraj.reporters import HDF5Reporter
import numpy as np
###############################################################################
def applyHarmonicPositiona... |
# https://docs.python.org/3/library/typing.html
#from typing import Final # restriction on Python > 3.8
import sys, os, platform, psutil
import subprocess as sub
from datetime import datetime
import json
from bson.objectid import ObjectId
from pymongo import MongoClient
from flask import current_app as app
from flas... |
import os
import os.path as osp
import numpy as np
import torch as to
from init_args_serializer.serializable import Serializable
import pyrado
from matplotlib import pyplot as plt
from pyrado.environments.pysim.base import SimPyEnv
from pyrado.spaces.box import BoxSpace
from pyrado.spaces.polar import Polar2DPosVelSpa... |
from __future__ import print_function, division, absolute_import
'''
High-Level Interface to SQLite
'''
import os
import sqlite3 # command-line SQLite3 does NOT need to be installed to use
# this Python module
from time import time, sleep
import zlib
from six.moves import cPickle as pickle
import traceback
from pprin... |
# Copyright 2021 Open Source Robotics Foundation, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
'''Provides features to merge multiple sonar logs by position to give spatially organized data across multiple recordings'''
# @todo Dont just restrict merging data to primary channel
# @todo rename to not just be depth but later more things
# @todo Add list of contributors to the merged node maybe?
# If so do we ... |
# -*- coding: utf-8 -*-
# Copyright © 2018 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Python API for MPS neural network backend
"""
from __future__ import print_funct... |
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.regularizers import l2
from tensorflow.keras.layers import Conv1D, MaxPooling1D, Activation, Dense, BatchNormalization
from tensorflow.keras.layers import Dropout, Flatten, Input, concatenate
from tensorflow.keras.models import Model, lo... |
import sys
from pathlib import Path
import numpy as np
import pandas as pd
from diffpy.utils.parsers.loaddata import loadData
from scipy.constants import physical_constants
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from matplotlib.gridspec import GridSpec
try:
from bg_mpl_stylesh... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2017-03
import binascii
import hashlib
import logging
import threading
import unicodedata
import hid
from decimal import Decimal
from typing import Optional, Tuple, List, Generator, Iterator, Any
from PyQt5 import QtWidgets, QtCore
from... |
import os
import numpy as np
import numpy.ma as ma
import scipy.constants as constants
import time
import aipy
from taskinit import tb, casalog
from split_cli import split_cli as split
from suncasa.eovsa import impteovsa as ipe
from astropy.time import Time
from eovsapy import util
# idbdir = os.getenv('EOVSAIDB')
#
... |
# Rewritten into Model View Controller OOP approach 7/15 by <NAME>
# <EMAIL>
#_____________________________
# HEAVILY MODIFIED (maybe 90% re-write) BY <NAME> 08/14
# <EMAIL>
#
# New version includes: instruction screen, choice of who goes first (with enhanced button code),
# drag and drop interface, new board repre... |
import numpy as np
import math
from scipy.linalg import logm
import numpy.linalg as LA
from math import pi
from transforms3d.euler import euler2quat, mat2euler, quat2euler, euler2mat
from transforms3d.quaternions import axangle2quat, mat2quat, qinverse, qmult, quat2mat
from transforms3d.axangles import axangle2mat
fro... |
## twofish.py - pure Python implementation of the Twofish algorithm.
## <NAME> <<EMAIL>> 13 december 2007.
##
## Copyrights
## ==========
##
## This code is a derived from an implementation by Dr <NAME>
## (<EMAIL>) which is subject to the following license.
## This Python implementation is not subject to any other lic... |
"""@file Node.py
Node is a base class for all ui nodes. This is actually a QGraphicsItem with all common stuff for nodes.
Also, it implements [initializeFromFunction](@ref PyFlow.Core.Node.initializeFromFunction) method which constructs node from given annotated function.
@sa FunctionLibrary.py
"""
from Qt import Qt... |
import json
import os
import Rhino # type: ignore
import rhinoscriptsyntax as rs # type: ignore
from compas.geometry.primitives.frame import Frame
from compas.utilities import DataDecoder
from compas_fab.robots.configuration import Configuration
from compas_rhino.geometry import RhinoMesh
from compas_rhino.ui import... |
#exec(open('__init__.py').read())
from __future__ import division, print_function
from hscom import __common__
(print, print_, print_on, print_off,
rrr, profile) = __common__.init(__name__, '[extract]')
# Science
import cv2
import numpy as np
from numpy import sqrt
# Hotspotter
import draw_func2 as df2
def rrr():
... |
# 1:4, 1:2 frequency-ratio DDR2/DDR3 PHY for Xilinx's Series7
# DDR2: 400, 533, 667, 800 and 1066 MT/s
# DDR3: 800, 1066, 1333 and 1600 MT/s
import math
from collections import OrderedDict
from migen import *
from migen.genlib.misc import BitSlip
from litex.soc.interconnect.csr import *
from litedram.common import ... |
import argparse
import numpy as np
import tensorflow as tf
import math
from tensorflow.contrib import learn
import datetime
import os
import pickle
from model import DeepCoNN, DeepCoNNPlusPlus, NARRE, MLPTopic, MLP, J3R
import logging
# ==================================================
# Model Hyperparameters
tf.... |
# Copyright (c) 2019 <NAME>.
# Uranium is released under the terms of the LGPLv3 or higher.
import configparser
import io
import copy
import os
from typing import Any, cast, Dict, List, Optional, Set, Tuple
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
from PyQt5.QtQml import QQmlEngine #To take ownershi... |
import math
import time
from os import getppid, remove
from random import randint
from re import split, sub
from threading import Thread, current_thread, enumerate
from typing import NoReturn, Any, Dict, List, Tuple
import numpy as np
def worker(burstTime: float) -> NoReturn:
print(space, burstTime, space, "Thre... |
import thinqpbo as tq
import numpy as np
from skimage.filters import threshold_otsu
import skimage.restoration as sr
def unwrap_B0(B0,dPar):
"""
:param B0: in Hz
:param dPar:
:param mPar:
:return:
"""
B0map = np.reshape(B0,(dPar['nz'], dPar['ny'], dPar['nx']))
B0map = B0map.squeeze()... |
from datetime import datetime, timezone
from distutils.version import LooseVersion
from pathlib import Path
from typing import List
from git import cmd, exc, Repo
from github import Github, Repository
from humanize import naturaldelta
from stat import *
from yaml import YAMLError, load
try:
from yaml import CDump... |
import logging
import re
import time
from telegram import InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler
from telegram.ext.dispatcher import run_async
from telegram.utils.helpers import mention_html as mention
MY_AWESOM... |
from pathlib import Path
import decode as dc
import numpy as np
from scipy.interpolate import interp1d
from astropy.io import fits
from astropy import table
from astropy.modeling import models, fitting
from pandas import date_range
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
from scipy import sign... |
from copy import deepcopy
import datetime as pydatetime
from functools import lru_cache
from glob import iglob
import os
import pickle
import zipfile
import attr
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
import pandas as pd
from .__version__ import __version__
from .wue imp... |
import numpy as np
import numpy.ma as ma
import cPickle
import scipy.weave as weave
from scipy.weave import converters
import time
from sigvisa.models import TimeSeriesDist
from sigvisa.models.noise.noise_model import NoiseModel
class ARGradientException(Exception):
pass
fastar_support = """
void upd... |
####!/usr/bin/env python
#------------------------------
"""
:py:class:`NewRunFinderUtils` contains a set of utilities helping find new runs in xtc directory for data processing
====================================================================================================================
Content of files in the... |
#!/usr/bin/env python3
# coding=utf-8
#
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in... |
# -*- coding: utf-8 -*-
from .__version__ import __version__
__author__ = "<NAME>"
__email__ = '<EMAIL>'
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
import math
import seaborn.apionly as sns
import os
this_path = os.path.abspath(os.path.... |
import tensorflow as tf
import tensorflow_addons as tfa
import numpy as np
import logging
import random
from collections import defaultdict
from typing import (
List,
Text,
Dict,
Tuple,
Union,
Optional,
Any,
)
from rasa.utils.tensorflow.model_data import RasaModelData, FeatureSignature
from... |
# Copyright 2014 Midokura SARL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
"""
Created on 2020
@author: <NAME>
"""
###############################################################################
#
# 2020, Paris
#
# This file is based on the Python corner package (Copyright 2013-2016
# <NAME> & contributors, The Journal of Open Source Software):
# https://joss.theoj.org/papers/10.21105/joss.0... |
import time
import tkinter
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.co... |
#!/usr/bin/env python3
"""
A basic server that allows to control the PWM output pin through HTTP requests, also offering
a crude web interface to manually control the PWM.
The server can be switched to manual override mode, which requires every control request to
have a 'manual=1' argument.
<NAME> a.k.a. DrLex, ht... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 02:37:37 2019
@author: konykwj
Contains all the functions necessary to execute plot commands in the NMF_Analysis class
"""
import pickle
from os import listdir
from os.path import isfile, join
import os
import gensim
import numpy as np
import pa... |
"""
Definition of sieves and `resolve_coreference`, containing the main algorithm.
"""
import logging
import logging.config
import itertools as it
from . import constants as c
from .mentions import get_mentions
from .entities import Entities
from .sieve_runner import SieveRunner
from .filters import is_named_entity, i... |
import logging
import subprocess
import socket
import os
import time
import sqlite3
from twisted.enterprise import adbapi
from lbryschema.decode import smart_decode
from lbryschema import uri
from lbryschema.error import DecodeError, URIParseError
from lbryschema.claim import ClaimDict
from lbryschema.fee import Fee
... |
import hashlib
import os
import pickle
from urllib.request import urlretrieve
import numpy as np
from PIL import Image
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import resample
from tqdm import tqdm
from zipfile import ZipFile
import math
... |
import time
import os
import re
import json
import warnings
import sys, io
import argparse
from selenium import webdriver
from tqdm import tqdm
from bs4 import BeautifulSoup
class Jgi(object):
def __init__(self,chromedriver_path="",
homepage_url='https://img.jgi.doe.gov/cgi-bin/m/main.cgi'):
... |
import datetime
import re
import csv
import logging
import pytz
import StringIO
import cloudinary.uploader
from django.shortcuts import render, redirect
from django.utils.html import escape, strip_tags
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from django.contrib.sitema... |
#coding:utf-8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
#! /usr/bin/env python
import time
import glob
import os
import platform
import readline
import binascii
import serial
from copy import deepcopy
import matplotlib.pyplot as plt
from cmd import Cmd
from threading import Lock
import queue
from queue import Queue
from sklearn.model_selection import train_test_split
... |
from src.smiles_to_structure import convert_to_structure, MoleculeStructure, Fragment
from collections import Counter
from termcolor import cprint
from src.fragments_library import special_cases, biomolecules, peptide_amino_acids, heterocycles, \
common_aromatic_heterocycles, generalized_heterocycles, arenes, func... |
import numpy as np
import numpy.polynomial.polynomial
from sympy.abc import x, alpha
from sympy import GF, Poly, Pow, Add, Symbol
from sympy.polys.galoistools import gf_irreducible, gf_irreducible_p
from sympy import lcm, ZZ
import math
import logging
import flint
log = logging.getLogger("mathutils")
def irreducible... |
__all__ = ['summarize', 'unite', 'subtract_bg']
import numbers
import os
import sys
import traceback
import ipy_table
import matplotlib
import matplotlib.cm
import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.getipython import get_ipython
from IPython.display import display
f... |
# Copyright 2016 NOKIA
#
# 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... |
from __future__ import with_statement
from gui.toolbox import Monitor
import wx, sys
import math
import traceback
from wx import Bitmap, Rect, RectS, RectPS, GetMousePosition, \
MenuEvent, Point, VERTICAL, HORIZONTAL, Pen, Brush, \
Size
from gui.skin.skinobjects import SkinColor,Margins
from gui.windowfx imp... |
from cc3d.core.PySteppables import *
#import CompuCell
import sys
import numpy as np
# from Circle import CircleDraw
from CellGeom import *
#from PySteppablesExamples import MitosisSteppableBase
class ConstraintInitializerSteppable(SteppableBasePy):
def __init__(self, frequency=1):
... |
from functional import compose, partial
from functools import reduce
from scipy.ndimage import rotate as scipy_rotate
import copy
import glob
import heart_volume.constants as const
import nibabel as nib
import numpy as np
import os
import pickle
import pydicom
import scipy.interpolate as interp
import scipy.stats as st... |
#!/usr/bin/env python3
"""
Script to parse NCU metrics from CSV files (paths passed as args) and generate
roofline tables and plots to current working directory. See doc for
read_roof_csv for details on how to collect the data.
Assumes all computation is double precision, with no usage of Tensor Cores.
This version i... |
import enum
import io
import os
import random
import sys
import time
import pygame as pg
from abc import abstractmethod
from geometry import Direction, pdist, Point, Rotation
from fox import Fox
from map import MAP
from nut import Nut
from squirrel import Squirrel
from world import World
# Logical screen dimensions... |
import json
import os
import os.path as osp
import pickle
import random
import sys
import h5py
import numpy as np
from PIL import Image
from torchvision import transforms
from tqdm import trange
sys.path.insert(0, osp.abspath('..'))
import torch
import yaml
from torch.utils.data import Dataset
from natsort import nat... |
#-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: <NAME> <<EMAIL>>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2013 EOX IT Services GmbH
#
# Permission is hereby granted, free o... |
# BSD-3-Clause License
#
# Copyright 2017 Orange
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the followi... |
"""
Plot functions for nbinteract.
To test code without having to restart kernel, use:
```
import bqplot as bq
import nbinteract as nbi
import toolz.curried as tz
from importlib import reload
reload(nbi.plotting)
```
"""
import numpy as np
import bqplot as bq
import collections
import ipywidgets as widgets
import i... |
import sys
from pathlib import Path
import numpy as np
from diffpy.utils.parsers.loaddata import loadData
from skbeam.core.utils import q_to_twotheta
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
SCAN_SPLIT_CHAR = "_"
SCAN_SEQ_SPLIT_CHAR = "-"
DPI = 300
FIGSIZE = (12,4)
FONTSIZE_LABELS = 20
FONT... |
import sys, re
if __name__=='__main__':
sys.path.append(sys.path[0]+'\\..')
from body.bone import NetP
from body.soul import Karma
def printNList(list_pt):
string=''
n=0
print(list_pt)
for point in list_pt:
string=string+str(n)+'.'+point.info()+'\n'
n=n+1
print(st... |
import random
from collections import OrderedDict
from copy import deepcopy
import gym
from gym_minigrid.roomgrid import RoomGrid
from gym_minigrid.minigrid import LockedDoor
from .verifier import *
import numpy as np
import pickle
from gym_minigrid.minigrid import Key, Ball, Box
from gym_minigrid.minigrid import MiniG... |
import maya.cmds as cmds
import pymel.core as pm
from mgear.core import pyflow_widgets
from mgear.core import pyqt
from mgear.vendor.Qt import QtWidgets
from mgear.vendor.Qt import QtCore
from mgear.vendor.Qt import QtGui
import random
from functools import partial
from . import channel_master_utils as cmu
TABLE_STY... |
# Copied and adapted from Reedwolf project (project by <EMAIL> - <EMAIL>:trebor74hr/reedwolf.git)
from __future__ import annotations
from enum import Enum
from collections import namedtuple
from typing import List, Any, Dict, get_type_hints, Union, Set
from dataclasses import dataclass, is_dataclass, Field as DcField,... |
#!/usr/bin/env python3
import argparse
import math
import pandas as pd
import sys
from collections import namedtuple
from datetime import date
from enum import Enum
from pathlib import Path
from time import localtime, strftime
class Verbosity(Enum):
LOW=1
HIGH=2
Settings=namedtuple('Settings', ['datapath','... |
import sys, os
import time
import numpy as np
import torch
import torch.nn as nn
from torch.utils import data
from functools import partial
from data_loader import get_train_valid_set, loader_tbm, Dataset, tbm_collate_fn
from kinematics import xyz_to_c6d, c6d_to_bins2, xyz_to_t2d, xyz_to_bbtor
from TrunkModel import T... |
# python3.7
"""Contains the Inception V3 model, which is used for inference ONLY.
This file is mostly borrowed from `torchvision/models/inception.py`.
Inception model is widely used to compute FID or IS metric for evaluating
generative models. However, the pre-trained models from torchvision is slightly
different fro... |
import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
import time
from functools import partial
from multiprocessing.dummy import Pool as ThreadPool
from os.path import basename
import keras.backend as K
import numpy as np
import tensorflow as tf
from keras.utils import np_utils
from sklearn.decomposition import PCA
... |
import numpy as np
import pandas as pd
import pytest
from bach import DataFrame
from bach.partitioning import WindowFrameMode, WindowFrameBoundary
from tests.functional.bach.test_data_and_utils import assert_equals_data, get_bt_with_test_data, get_df_with_test_data
def test_windowing_frame_clause(pg_engine):
eng... |
import biorbd
import bioviz
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import equation_muscles
from scipy.integrate import solve_ivp
def muscle_tendon_equilibre(model, emg, Q, Qdot):
for i in range(5):
force = model.muscleForces(emg, Q, Qdot).to_array()[0]
strain = ... |
# Copyright (c) 2015, <NAME>
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
from __future__ import print_function, division, absolute_import
import math
import numpy as np
import quaternion
import scri
import spherical_functions as sf
def modes_constructor(constructor_statement,... |
"""Python SDK for "A Dataset of Multi-Illumination Images in the Wild"
The SDK provides access to image downloads, image resizing, pre-processed light probes,
material annotations, and scene meta data, such as room types.
Below are a example uses of the SDK
Load subset of scenes like this
I = query_images(['main_exp... |
import operator
import typing
from abc import ABC
from collections import Counter
from enum import Enum
from itertools import chain, product
from typing import Callable
import numpy as np
import SimpleITK as sitk
from napari.layers import Image
from napari.types import LayerDataTuple
from PartSegCore.algorithm_descri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# yampex:
# Yet Another Matplotlib Extension
#
# Copyright (C) 2017-2021 by <NAME>,
# http://edsuom.com/yampex
#
# See edsuom.com for API documentation as well as information about
# Ed's background and other projects, software and otherwise.
#
# Licensed under the Apach... |
import json
import sys
import random
import numpy as np
from math import ceil, exp, log, sqrt
from pybloom_live import BloomFilter
# sys.path.append('.')
import os.path
from datetime import datetime
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(CURRENT_PATH)
# PYBLT_PATH = '/home/pinar/IBLT... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013, <NAME>, NTT I3, Inc.
# 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.apa... |
###################################################################################
# Copyright 2021 National Technology & Engineering Solutions of Sandia, #
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the #
# U.S. Government retains certain rights in this software. ... |
# encoding: utf-8
# author: <NAME>, <EMAIL>
'''
Extract the contigs that match the reference database
'''
import re
import os
import sys
import glob
import time
import logging
import argparse
import subprocess
import numpy as np
import pandas as pd
#import pylab as plt
from secapr.helpers import is_dir, is_file, Full... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""
This module will be used propagate messages to other verification nodes or admin nodes.
Messages are gotten from
"""
from Orses_Validator_Core import AssignmentStatementValidator, TokenTransferValidator, \
TokenReservationRequestValidator, TokenReservationRevokeValidator, MiscMessagesValidator
from Orses_Dumm... |
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import urllib3
import traceback
from datetime import datetime
from typing import Any, Dict, List, Callable, Tuple, Optional
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
DEFAULT_FIRST_FETCH = '3 days'
D... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import codecs
import collections
import datetime
import errno
import hashlib
import os
import shutil
import tempfile
try:
from urllib.parse import quote as urlquote
except ImportError:
from urllib im... |
# fbs_allocation.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
"""
Functions to allocate data using additional data sources
"""
import numpy as np
import pandas as pd
import flowsa
from flowsa.common import fba_activity_fields, fbs_activity_fields, \
fba_mapped_wsec_default_grouping_fields, fba_wsec_default_g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.