text stringlengths 8.04k 46.5k |
|---|
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from .pruning import init_for_pruning, get_named_params, get_pruned_dim, prune_with_predefined_sparsity
def count_models_n_total(n_sizes, smallest_net_densiti... |
#!/usr/bin/env python
"""
Classes for working with genomic regions
@author: <NAME>
@contact: mette.bentsen (at) mpi-bn.mpg.de
@license: MIT
"""
import numpy as np
import sys
import re
from copy import deepcopy
import pyBigWig
from collections import Counter
import logging
import traceback
from ... |
# python lib/models/cell_searchs/darts/cnn/train_search_higher.py --batch_size=32 --seed=999 --higher_method=sotl --higher_params=arch --higher_order=second
import os
import sys
import time
import glob
import numpy as np
import torch
import utils
import random
import logging
import argparse
import torch.nn as nn
impor... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import queue
import threading
import random
from PIL import Image
import time
import os
import warnings
__all__ = ['ImgQueue', 'FileQueue', 'ImgLoader', 'FileQueueNotStarted',
'Fi... |
from __future__ import division
import os
import collections
from time import sleep
from builtins import dict
from datetime import datetime, timedelta
import yaml
import requests
from retry import retry
from testrail.helper import TestRailError, TooManyRequestsError, ServiceUnavailableError
nested_dict = lambda: co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Description
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2019, HANDBOOK"
__credits__ = ["CONG-MINH NGUYEN"]
__license__ = "GPL"
__version__ = "1.0.1... |
import numpy as np
import copy
import os
from up.utils.general.registry_factory import AUGMENTATION_REGISTRY
from up.data.datasets.transforms import Augmentation
from up.extensions.python import iou3d_nms_utils
from up.tasks.det_3d.data.box_utils import boxes3d_kitti_fakelidar_to_lidar, enlarge_box3d, remove_points_in_... |
# -*- coding:utf8 -*-
# File : env.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 12/29/16
#
# This file is part of TensorArtist.
import enum
import threading
import contextlib
import tensorflow as tf
from .node import as_varnode
from .function import Function
from .tfqueue import InputQueueDesc, QueuedInputFun... |
"""Module containing several advanced plotting functions."""
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from statannot import add_stat_annotation
from biopsykit.utils.dataframe_handling import multi_... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import numpy as np
from struct import unpack
from functools import wraps
from collections import namedtuple
import logging
from rawdata.tfreader import RawDataHeader
from .rawlogging import AddLocationFilter
from .constants import eodmarker,eotmarker,magicmarker
from .base import BaseHeader, BaseParser, DumpParser
f... |
import json
import logging
import os
import pickle
from datetime import datetime
from typing import List, Union
import numpy as np
import tensorflow as tf
from gpbasics import global_parameters as global_param
from gpbasics.KernelBasics.PartitionOperator import PartitionOperator
from gpbasics.Metrics.CrossValidation ... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import weakref
import collections
import re
import uuid
from .entity import Entity
from .annotation import Annotation
import logging
log = logging.getLogger(__name__)
class EntitySet(collections.abc.MutableSet):
""" An entity container for a document, keeping entities and linking them to the surfact forms within... |
import random
import time
from time import sleep
fancy_line = "~" * 75
bold = "\033[1m"
reset_bold = "\033[0m"
text_length = 80
good_shape = True
players = ['young woman', 'middle-aged woman', 'old man', 'middle-aged man',\
'body builder', 'teenager', 'middle-aged man', 'old lady', 'intelligent man', 'young... |
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.modules.normalization as mm
import numpy
import torch
''' Mainly using convolutions throughout the network to reduce the number of
paramters.
'''
PRINT = True
class CNNOnly(nn.Module):
''' CNN all the way, no... |
"""Module contains base class for prompts.
BaseSimplePrompt ← InputPrompt,
↑ ↑
↑ SecretPrompt ...
↑
BaseComplexPrompt ← FuzzyPrompt
↑
BaseListPrompt ← ListPrompt, ExpandPrompt ...
"""
import os
import re
from abc import ABC, abstractmethod
from typing import Any,... |
"""MobileAlerts sensors."""
from typing import Any, List, Optional, Union
import datetime
import logging
import time
from enum import IntEnum, auto
_LOGGER = logging.getLogger(__name__)
class MeasurementType(IntEnum):
"""Types of measurments."""
TEMPERATURE = auto()
HUMIDITY = auto()
WETNESS = aut... |
import os
import shutil
import random
import math
import time
import argparse
import yaml
from collections import OrderedDict
import sys
# for import parent utils
sys.path.append('../')
import utils
import modules
import datasets
import models
import numpy as np
import torch
import torch.nn as nn
import torch.optim... |
""" drivers for conformer
"""
import numpy
from qcelemental import constants as qcc
import automol
import elstruct
import autofile
import moldr
from automol.convert import _pyx2z
WAVEN2KCAL = qcc.conversion_factor('wavenumber', 'kcal/mol')
EH2KCAL = qcc.conversion_factor('hartree', 'kcal/mol')
def conformer_sampling... |
import argparse
import time
import torch
from dataloader import get_loader, load_data, normlize_data
from model import GCNGenerator, Discriminator, CNNGenerator2, CNNGenerator1
from utils import *
from tensorboardX import SummaryWriter
import shutil
import pdb
from Loss_custom import Pearson_loss_regions, Pe... |
import sqlite3
import datetime
import shutil
import os
import ntpath
from os import path
from collections import Counter
test_data = {
"name": "State POS Computer",
"item": "Card Reader",
"purpose": "Handles credit card payments",
"cost": "299.99",
"serial": "12867-9992837-2323683264823",
"date... |
import sys
from Bio import pairwise2
from operator import itemgetter
def compress(all_a_words, all_a_ids, all_b_words, all_b_ids, window_size, recursive=True, verbose=False):
print("Compressing, #words in A: "+str(len(all_a_words))+", #words in B: "+str(len(all_b_words)), file=sys.stderr)
# Compress long triv... |
# coding=utf-8
import os, clr, re, sys, logging, time
os.chdir(os.path.dirname(__file__))
clr.AddReference('System.Drawing')
clr.AddReference('System.Windows.Forms')
from System import Drawing, Array, ComponentModel, Diagnostics, IO
from System.Windows import Forms
import System.Object as object
import System... |
'''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 <NAME>
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
---------------------------------------... |
import os
import itertools
import uuid
import functools
import operator
import collections
from typing import Any, List, Dict, Tuple
import string
import re
import logging
from dataclasses import dataclass
import numpy as np
from retrieve import utils
from retrieve.methods import (jaccard, containment, containment_m... |
import traceback
import time
import base36
import importlib
from modbot.log import botlog, loglevel
from modbot.utils import utcnow, timedata, BotThread, get_utcnow
from modbot.storage import dsdict, get_stored_dict
from modbot.input.rpc_server import create_server
logger = botlog("reddit_wrapper", console_level=logle... |
"""
Useful functions for feeding data to the shotgun VAE.
"""
__date__ = "August - November 2019"
from affinewarp import PiecewiseWarping
from affinewarp.piecewisewarp import densewarp
import h5py
import joblib
import numpy as np
import os
from scipy.interpolate import interp1d, interp2d
from scipy.io import wavfile... |
'''The blocks phase turns an AST into a set of CFGs. Nested expressions are
moved into temporary variables to make subsequent passes possible.
A new ``Module`` object is created to contain a mapping
from names to language-level things:
an object imported from another module,
a class,
a function,
a trait or a constant.... |
import models.drn as drn
from models.DRNSeg import DRNSeg
from models.FCN32s import FCN32s
import data_transforms as transforms
import json
import math
import os
from os.path import exists, join, split
import threading
import time, datetime
import numpy as np
import shutil
import sys
from PIL import Image
import to... |
from collections import namedtuple
from math import pi
from scipy.constants import g as gravity
PIDDUCK_KENT_CONSTANT = 1
BarrelResistance = namedtuple('BarrelResistance', 'br trav')
RecoilingPoint = namedtuple('RecoilingPoint', 'force time')
BurningRate = namedtuple('BurningRate', 'exponent coefficient pressure')
... |
from flask import current_app as app
from flask import render_template, flash, redirect, url_for, request, jsonify, json, session
from . import db, events
from .forms import LoginForm, RegistrationForm, ResetForm
from .models import User, Post, Share
from flask_login import current_user, login_user, logout_user, l... |
import os
import json
import uuid
import logging
import asyncio
from typing import Optional, Union
from datetime import datetime
from typing import List, Dict
from contextlib import asynccontextmanager
from django.conf import settings
from django.urls import reverse
from sirius_sdk.messaging import Message
from django.... |
#!/usr/bin/env python
##
## Copyright (C) 2017, <NAME>, all rights reserved.
##
## This file is part of Camera Network
## (see https://bitbucket.org/amitibo/cameranetwork_git).
##
## Redistribution and use in source and binary forms, with or without modification,
## are permitted provided that the following conditions ... |
## attack.py -- generate audio adversarial examples
##
## Copyright (C) 2017, <NAME> <<EMAIL>>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in the LICENCE file in this directory.
import numpy as np
import tensorflow as tf
import argparse
from shutil import copyfile
import s... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
from emojinator_files.utils import detector_utils as detector_utils
import cv2
from keras.models import load_model
import numpy as np
import os
from collections import deque
from flask import Flask,render_template,Response, redirect, url_for
import time
app=Flask(__name... |
# Copyright 2021 The ProLoaF Authors. All Rights Reserved.
#
# 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... |
#import libraries
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import firebase_admin
from firebase_admin import credentials, firestore
import pydeck as pdk
import json
#Setting up our homepage window of Streamlit app
def main():
pa... |
import pathlib as pl
import matplotlib as mpl
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
import yaml
import pandas as pd
import numpy as np
from nyisotoolkit.nyisodata.nyisodata import NYISOData, DATA... |
# blobstore.py - local and remote (speaking Git-LFS protocol) blob storages
#
# Copyright 2017 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import contextlib
import errno
i... |
import sys
import pytest
import numpy as np
from msl.io.dataset import Dataset
def test_instantiate():
dset = Dataset(name='/data', parent=None, is_read_only=True, shape=(10, 10))
assert dset.name == '/data'
assert len(dset) == 10
assert dset.size == 100
assert dset.dtype == float
assert dse... |
import numpy as np
from FUNCS import FNS, RK4
from PTSS import PtssJoint as ptssjnt
from PTSS import PtssSpatial as ptssspt
# variable class for Arms Module
class ArmVar:
def __init__(self, num_deg):
self.num_deg = num_deg
self.ppc = self.Parietal(num_deg)
self.mtc = self.Motor()
... |
"""Data store for ICUBAM."""
from absl import logging
from contextlib import contextmanager
import dataclasses
from datetime import datetime
import hashlib
import pandas as pd
from sqlalchemy import create_engine, desc, func
from sqlalchemy import Column, MetaData, Table
from sqlalchemy import ForeignKey, UniqueConstra... |
from .. import stats
from .. import image
import inspect
from .. import effects
from .. import animobs
import random
import math
from .. import container
# Enumerated constants for the item slots.
# Note that these are defined in the order in which they're applied to avatar.
NOSLOT, BACK, FEET, BODY, HANDS, HAND2, HAN... |
# -*- coding: utf-8 -*-
import os
import numpy as np
from PIL import Image, ImageGrab
import time
import matplotlib.pyplot as plt
import pytesseract
import win32api
import win32gui
import win32ui
import win32con
from ctypes import windll
import cv2
############################鼠标点击使用常数################################... |
"""Eagle2Bookshelf2012.
This program converts EAGLE board files (.brd) to bookshelf (DAC 2012 contest flavor) format files.
Specifically this program outputs nodes files (.nodes), netlist files (.nets), and net weight files (.wts).
These files are sutible for academic IC placement programs.
This program also ou... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
from torchvision.utils import save_image
from torch... |
import os
import socket
import re
import subprocess
import tempfile
import copy
import json
from unittest import SkipTest
import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
fr... |
##
# Copyright (c) 2012-2017 Apple 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#!/usr/bin/python
from __future__ import print_function, division
import argparse, os, sys, datetime, pytz, ConfigParser, shutil
import logging.handlers
log = logging.getLogger("merge_datasets")
DATE_FMT = '%d/%m/%Y %H:%M:%S %Z'
MIN_VOLTAGE = 200 # minimum acceptable voltage for mains voltage recorded using snd_card_p... |
import copy
import random
from dataclasses import dataclass, replace
from typing import Iterable, List, Optional, Tuple, TypeVar, Union
from bs4 import BeautifulSoup
from bs4.element import Tag
from leginorma import ArticleStatus, LegifranceArticle, LegifranceSection, LegifranceText
from envinorma.io.parse_html impor... |
'''
Created on Dec 29, 2013
@author: arnon
'''
import os.path
import xml.etree.ElementTree as etree
from collections import OrderedDict
from xml.dom import minidom
from namedlist import namedlist
import logging
from copy import copy, deepcopy
import ast
import inspect
import sys
import collections
envlogger=logging.... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 26 21:55:57 2020
@author: <NAME>
"""
import pytest
import numpy as np
import pandas as pd
from pathlib import Path
import pickle as pckl
import hgc
import os
from hgc import ner
from hgc import io
import tests
# from googletrans import Translator
def test_ner():
'... |
import math
from glob import glob
import logging
import datetime
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.multivariate_normal import MultivariateNormal
from GAN2Shape import utils
from GAN2Shape import networks
from GAN2Shape.renderer impor... |
import pandas as pd
import numpy as np
import time
import collections
def df_set(df_trr, df_weapondischarge, df_trrstatus, sub_weapon_refresh):
"""Set necessary df."""
# Set trr_trr_refresh
df_trr["trr_datetime"] = pd.to_datetime(df_trr["trr_datetime"])
df_trr["beat"] = df_trr["beat"].astype(int)
... |
from collections import Counter
import gzip
import json
import logging
import math
import random
import struct
import time
from typing import Optional, List, Tuple, Union, Dict
from zlib import crc32
from deepdeep.utils import softmax
import lib.smaz as smaz
import numpy as np
from redis.client import StrictRedis
from... |
# Alexa Pi script.
# 4/12/2021
import sounddevice as sd
from scipy.io.wavfile import write
import json
import logging
import os
import time
import requests
from ask_sdk_core.utils import is_intent_name, get_slot_value
import sched
import time
from flask import Flask
from flask_ask import Ask, request, session, questio... |
"""
*~ Eksempel på delspill av Pokus ~*
"""
#Start med å importere alle de nødvendige delfilene.
from klasser import *
from grafikk import *
from quests import *
from prosedyrer import *
"""
Litt generelt: xHp, xKp og xProgresjon betyr total mengde (max) av det man kan
ha av noe. For alle mulige argum... |
import discord
from discord.ext import commands
import asyncio
import aiohttp
from lxml import html
from datetime import datetime
import json
import re
# because fuck it why not.
timedict = {"0":"🕛","030":"🕧","1":"ðŸ•", "130":"🕜", "2":"🕑", "230":"ðŸ•",
"3":"🕒", "330":"🕞", "4":"ðŸ•... |
#! /usr/bin/env python2
import sys
import os
import subprocess
import signal
import atexit
from time import time
from getopt import getopt
from select import select
EMPTY = 0
WHITE = 1
BLACK = 2
noneORIENTATION = 0
HORIZONTAL = 1
VERTICAL = 2
class Wall(object):
x = 0 # wall's x coord... |
"""Command line interface."""
from argparse import ( Action, ArgumentParser, )
from datetime import datetime
from datetime import date
import pandas as pd
from pandas import DataFrame
from sys import stdout
from logging import INFO, basicConfig, getLogger
import shlex
import unicodedata
import os
import csv
from penn... |
# -*- coding: utf-8 -*-
'''knife mixin keys'''
from appspace.keys import AppspaceKey
class KCompare(AppspaceKey):
'''
comparing knife key
'''
def all(): # @NoSelf
'''
Discover if :meth:`worker` is :const:`True` for **every** incoming
thing.
:rtype: :const:`self` (:... |
'''
Created on 2016/2/19
:author: hubo
'''
from vlcp.config import defaultconfig
from vlcp.server.module import Module, api, depend, callAPI, ModuleNotification
from vlcp.event.runnable import RoutineContainer
from vlcp.service.connection import jsonrpcserver
from vlcp.protocol.jsonrpc import JsonRPCConnectionStateEv... |
#!/usr/bin/env python3
"""
Convert flat DICOM file set into an NDAR-compliant fileset
Usage
----
dcm2ndar.py -i <DICOM Directory> -o <NDAR Directory>
Example
----
% dcm2ndar.py -i sub-001 -o sub-001.ndar
Authors
----
<NAME>, Caltech Brain Imaging Center
Dates
----
2016-08-09 JMT Adapt from dcm2bids.py
MIT License
... |
from __future__ import print_function
import argparse
from math import log10, ceil
import random, shutil, json
from os.path import join, exists, isfile, realpath, dirname
from os import makedirs, remove, chdir, environ
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from ... |
#!/usr/bin/env python
from QUBEKit.decorators import for_all_methods, timer_logger
from QUBEKit.helpers import append_to_log
from tempfile import TemporaryDirectory
from shutil import copy
from os import getcwd, chdir, path
from subprocess import run as sub_run
from collections import OrderedDict
from copy import dee... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from os.path import join
from absl import flags, logging
import os
import pickle
import sys
import csv
import collections
import numpy as np
import time
import math
import json
import random
from copy import co... |
import asyncio
import logging
import time
from concurrent.futures.thread import ThreadPoolExecutor
import numba
import numpy as np
import math
import pandas as pd
import pyproj
import rasterio
from enum import Enum
from datetime import datetime
from fastapi import APIRouter
from geojson_pydantic import geometries as... |
#
# Project SketchCNN
#
# Author: <NAME> (<EMAIL>),
# Copyright (c) 2018. All Rights Reserved.
#
# ==============================================================================
"""Direction field regression network training.
"""
from __future__ import absolute_import
from __future__ import division
from __future_... |
# -*- coding: utf-8 -*-
'''
The MIT License (MIT)
Copyright (c) 2021-present Buster
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 t... |
# coding=utf-8
# !/usr/bin/python3.6 ## Please use python 3.6
"""
__synopsis__ : Class to generate neighborhood graph based on label similarity between samples.
__description__ : Class to generate neighborhood graph based on label similarity between samples.
__project__ : MNXC
__author__ : <NAME> <<EMAIL>>... |
# -*- coding: utf-8 -*-
import json
import re
import os
import time
import dicttoxml
from scalrctl import click, request, settings, utils, view, examples, defaults
__author__ = '<NAME>'
class MultipleClickException(click.ClickException):
def format_message(self):
return '\x1b[31m%s\x1b[39m' % self.mes... |
import base64
import calendar
import html
import re
import typing
import time
import urllib.parse
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlobals as HG
from hydrus.core import HydrusSerialisable
STRING_CONV... |
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn import init
from torch.autograd import Function
from math import sqrt
import torch.utils.data
import torch.utils.data.distributed
from torch.nn.utils import spectral_norm
F_conv = torch.nn.functional.conv2d
''' fix the last four layer... |
from common.functions import *
from common.layers import *
from common.np import *
# RNN cell 한 개
class RNN:
def __init__(self, Wx, Wh, b):
self.params = [Wx, Wh, b]
self.grads = [np.zeros_like(i) for i in self.params]
self.cache = None # 순전파 결과 저장
# 순전파: 잘 생각해보면 한 셀에 들어가는 요소들은 input... |
"""
EfficientLab neural network model definition adapted for few-shot meta-learning.
"""
from functools import partial
from typing import List, Tuple, Optional
import numpy as np
import tensorflow as tf
from models.efficientnet import efficientnet_builder
from models.efficientnet.constants import MEAN_RGB, STDDEV_RGB... |
from abc import ABC, abstractmethod, abstractproperty
from dataclasses import dataclass
from functools import singledispatch
from itertools import chain
import typing
from typing import (
Any,
Dict,
FrozenSet,
Iterable,
Iterator,
List,
Mapping,
Optional,
Tuple,
Callable,
)
from ... |
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
from Utils import load
from Models import apolo_resnet
import torchvision.transforms as transforms
import torchvision.datasets ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
import json
import logging
import argparse
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
# apps = ["PinLock", "Camera_To_USBDisk", "FatFs_RAMDisk", "... |
from PIL import Image
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtGui import QPixmap
from functools import partial
from pdf2image import convert_from_path, pdfinfo_from_path
from scripts.database_stuff import DB, sqlite
from scripts.tricks ... |
import math
import os
import unittest
import sys
import _ast
import tempfile
import types
from test import support
from test.support import script_helper
class TestSpecifics(unittest.TestCase):
def compile_single(self, source):
compile(source, '<single>', 'single')
def assertInvalidSingle(self, sour... |
#!/usr/bin/env python3
import base64
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import pandas as pd
import numpy as np
import plotly.graph_objs as go
import dash_bootstrap_components as dbc
import p... |
import itertools
import cmath
from pauxy.systems.hubbard import Hubbard
from pauxy.trial_wavefunction.free_electron import FreeElectron
from pauxy.trial_wavefunction.harmonic_oscillator import HarmonicOscillator
from pauxy.estimators.ci import simple_fci_bose_fermi, simple_fci
from pauxy.estimators.hubbard import local... |
# -*- coding: utf-8 -*-
# Cell 1
import tensorflow as tf, tensorflow_datasets as tfds, numpy as np
import matplotlib.pyplot as plt
import math
from datetime import datetime
import time, pickle
# Cell
class StandardDeviationInit(tf.keras.initializers.Initializer):
def __init__(self, minval=0, maxval=1):
s... |
import numpy as np
import os
from tqdm import trange, tqdm
from scipy.signal import butter, lfilter, freqz, filtfilt
import matplotlib.pyplot as plt
#
import parmap
import os
os.chdir('/home/cat/code/manifolds/')
#
import matplotlib.pyplot as plt
import scipy
import numpy as np
import pandas as pd
from matplotlib.pa... |
import numpy as _np
import pandas as _pd
import matplotlib.pyplot as _plt
from scipy import fftpack as _fftpack
from scipy.signal import welch as _welch
# from scipy.signal.spectral import _spectral_helper
# from johnspythonlibrary2 import Plot as _plot
# from johnspythonlibrary2.Plot import subTitle as _subTitle, fi... |
#!/usr/bin/env python
import os, sys, cv2, json
import math, PIL, cairo
import copy, random, re
from copy import deepcopy
import numpy as np
import os.path as osp
from time import time
from datetime import datetime
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from collections import Counte... |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 18 16:36:16 2018
@author: Miao
This scrip :
is the coorsponding PsychoPy version of 'virtual_ellipses_underPython'
"""
import numpy as np
import math
#from sympy import Ellipse, Point, Line, sqrt
from scipy.spatial import distance
import random
#import time
impo... |
import os, re
import glob
import sys
import copy
import json
import math
import gc
import threading
import concurrent.futures
from multiprocessing import Process
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
# Default evaluation dict format
# All values are 1D_LISTs
pr... |
#!/usr/bin/env conda-execute
"""
CLI to build a folder full of recipes.
Example usage:
build.py /folder/of/recipes --python 2.7 3.4 3.5 --numpy 1.10 1.11 --token <your anaconda token>
build.py --help
"""
# conda execute
# env:
# - conda-build
# - anaconda-client
# - networkx
# - slacker
# run_with: python
import i... |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import pickle
import os
import glob
########## Helper functions
############### Calibration / Undistortion
def compute_calib_from_chessboards(nx, ny, filename_pattern):
"""
This function calculates the objectpoi... |
#!/usr/bin/env python3
import base64
import getpass
import os
import pprint
import shutil
import sys
import time
from contextlib import suppress
from pathlib import Path
from time import sleep
from typing import Dict, List
import psutil
from broker import cfg
from broker._utils import _log
from broker._utils._log im... |
import fault
import aetherling.helpers.fault_helpers as fault_helpers
from aetherling.space_time import *
from aetherling.space_time.reshape_st import DefineReshape_ST
import magma as m
import json
@cache_definition
def Module_0() -> DefineCircuitKind:
class _Module_0(Circuit):
name = "Module_0"
... |
"""
Abstract conv interface
"""
import logging
import theano
from theano.tensor import as_tensor_variable, patternbroadcast
from theano.gof import Apply, Op
__docformat__ = "restructuredtext en"
_logger = logging.getLogger("theano.tensor.nnet.abstract_conv")
def get_conv_output_shape(image_shape, kernel_shape,
... |
import cv2
import numpy as np
import imutils
import pygame
from pygame.locals import *
import RPi.GPIO as GPIO
#from gpiozero import LED, Button
from time import sleep
import subprocess
import time
#gpio parameters
buttonPin = 37
leftLedPin = 7
centerLedPin = 5
rightLedPin = 3
#state variables
done = False
finished ... |
import numpy as np
import collections
import torch
import torch.nn as nn
import torch.nn.functional as F
from pointmvsnet.networks import *
from pointmvsnet.functions.functions import get_pixel_grids, get_propability_map
from pointmvsnet.utils.feature_fetcher import FeatureFetcher
from pointmvsnet.utils.torch_utils i... |
# -*- coding: utf-8 -*-
# imageio is distributed under the terms of the (new) BSD License.
""" Read SPE files.
Backend: internal
This plugin supports reading files saved in the Princeton Instruments
SPE file format.
Parameters for reading
----------------------
char_encoding : str
Character encoding used to dec... |
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.structure.io.pdbqt"
__author__ = "<NAME>, <NAME>"
__all__ = ["PDBQTFile"]
import warnings
import numpy as np
import networkx as nx
from ....fil... |
import tensorflow as tf
import os
import time
import sys
from matplotlib import pyplot as plt
from IPython import display
import datetime
from tkinter import *
from tkinter.colorchooser import askcolor
from PIL import ImageTk,Image ,ImageDraw
import PIL
import collections
BUFFER_SIZE = 50
BATCH_SIZE = 1
IMG_WIDTH =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.