text stringlengths 8.04k 46.5k |
|---|
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
#!/usr/bin/env python3
import io
import sys
import unittest
import contextlib
from bytecode import (Label, Compare, SetLineno, Instr,
Bytecode, BasicBlock, ControlFlowGraph)
from bytecode.tests import disassemble as _disassemble, TestCase, WORDCODE
def disassemble(source, *, filename="<string>",... |
from __future__ import division, print_function, absolute_import
from multiprocessing import Process, Pipe
import yaml
import cv2
# Konwn issue: - No module named 'scipy.spatial.transform', To resolve, try pip3 install scipy==1.2
from scipy.spatial.transform import Rotation as R
from real_robots.constants import *
fr... |
"""
Provides AWS4Auth class for handling Amazon Web Services version 4
authentication with the Requests module.
"""
# Licensed under the MIT License:
# http://opensource.org/licenses/MIT
from __future__ import unicode_literals
import hmac
import hashlib
import posixpath
import re
import shlex
import datetime
try:... |
import adsk.core
import adsk.fusion
import adsk.cam
import traceback
from .Fusion360Utilities.Fusion360Utilities import get_app_objects
from .Fusion360Utilities.Fusion360CommandBase import Fusion360CommandBase
from .SheetsService import sheets_get_ranges, get_sheets_service, sheets_update_values
from .SheeterUtilities... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import time
from collections import defaultdict, deque
from typing import Any, Dict, List, Optional
import tim... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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 or... |
from __future__ import print_function, division, absolute_import
import itertools
from numba import types, intrinsics
from numba.utils import PYVERSION, RANGE_ITER_OBJECTS
from numba.typing.templates import (AttributeTemplate, ConcreteTemplate,
AbstractTemplate, builtin_global, bui... |
# -*- coding:utf-8 -*-
"""Functions for converting between Julian dates and calendar dates.
A function for converting Gregorian calendar dates to Julian dates, and
another function for converting Julian calendar dates to Julian dates
are defined. Two functions for the reverse calculations are also
defined.
Different ... |
# -*- coding:utf-8 -*-
# Created Time: 2018/03/12 10:48:38
# Author: <NAME> <<EMAIL>>
from dataset import config, MultiCelebADataset
from nets import Encoder, Decoder, Discriminator
import os
import argparse
import torch
from torchvision import transforms
from PIL import Image
import numpy as np
from tensorboardX imp... |
import time as t
from collections import Counter
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from fink_fat.others.utils import load_data
from fink_fat.others.utils import get_mpc_database
import json
import os
from astropy.coordinates import SkyCoord
from astropy import ... |
import os
import build
import logging
from qtc import patools as pa
from qtc import iotools as io
from qtc import obtools as ob
log = logging.getLogger(__name__)
import shutil
def build_files(args, paths, ists=False,nodes = 1, restartts=False):
"""
Runs the build functions for reacn.dat, prodn.dat, theory.da... |
"""
Module containing routines used by 3D datacubes.
.. include common links, assuming primary doc root is up one directory
.. include:: ../include/links.rst
"""
import inspect
from astropy import wcs, units
from astropy.coordinates import AltAz, SkyCoord
from astropy.io import fits
import scipy.optimize as opt
from... |
'''
Basic unittest that will instantiate a fixed DocTopicCount
(assumed the same for all documents, for simplicity),
and then examine how inference of rho/omega procedes given this
fixed set of counts.
Conclusions
-----------
rho/omega objective seems to be convex in rho/omega,
and very flat with respect to omega (so ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from scipy import interpolate
# from utils.utils import bilinear_sampler, coords_grid
class FlowHead(nn.Module):
def __init__(self, input_dim=128, hidden_dim=256):
super(FlowHead, self).__init__()
self.conv1 = nn.... |
from __future__ import absolute_import, division, print_function
import cStringIO
import sys, os, re
from six.moves import zip
def check_bin_format(bin):
try :
d_max, d_min = float(bin[0]), float(bin[1])
except ValueError as e :
raise RuntimeError("%s\nOffending values: %s, %s"%(str(e),bin[0],bin[1]))
de... |
import torch
import torch.nn.functional as F
import queue
from itertools import count
import numpy as np
from ..models import RecurrentDESMILES
class AstarTree:
def __init__(self, fp, desmiles, max_length=30, max_branches=5000):
assert type(fp) is torch.Tensor
assert type(desmiles) is RecurrentDESM... |
import sys
from ply import yacc
from scanner import tokens
import ast
scope = []
t = ""
class Node:
def __init__(self, type, children=None, leaf=None, datatype=None):
self.type = type
if children:
if not isinstance(children, (list, tuple)):
children = [children]
... |
import heapq
import argparse
# -------
# utils
# -------
def memoize(fn, slot=None, maxsize=32):
"""Memoize fn: make it remember the computed value for any argument list.
If slot is specified, store result in that slot of first argument.
If slot is false, use lru_cache for caching the values."""
if slo... |
""" Tool for running online bilby PE using GraceDB events
The functionality of much of these utility assumes the user is running on the
CIT cluster, e.g. the ROQ and calibration directories are in there usual place
"""
import argparse
import json
import os
import shutil
import numpy as np
import bilby
from . import... |
import asyncio
import functools
import json
import logging
import math
import prometheus_client
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import aliased, defer, joinedload
import tempfile
from tornado.concurrent import Future
import tornado.log
from tornado.web import MissingArgumentError, HTTPError... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
We will not use multi-GPUs training for NER (no n_gpu arg anymore)
If we will add multi-GPUs training, using ditributed method (local_rank)
We will support cache and load cache data in future but not implemented here since clinical NER dataset is relatively small)
Though ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
# We disable pylint because we need python3 compatibility.
from tensorflow.contrib.rnn.python.ops import core_rnn
from tensorflow.contrib.rnn.python.ops import core_rnn_cell
from tensorflow.contri... |
# coding: utf8
from pathlib import Path
import argparse
import asyncio
import functools
import logging
import os
import requests
import sys
import urllib
from bs4 import BeautifulSoup
import urllib3
import time
import random
from urllib.parse import urlparse
header = {
"User-Agent": r'Mozilla/5.0 (Windows NT 10.0... |
import re
from pathlib import Path
from functools import partial
from multiprocessing import Pool
from itertools import zip_longest
from articlenizer import articlenizer, encode_string, corrections, sentenize, util
from articlenizer.util import chunk_list
def annotation_to_dict(annotation):
"""Read BRAT annotati... |
"""
This module implements contraction algorithms.
"""
from collections import namedtuple
import numpy as np
from tensorbackends.interface import ReducedSVD, ImplicitRandomizedSVD
from . import sites
class ContractOption:
def __str__(self):
return '{}({})'.format(
type(self).__name__,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
_logger = logging.getLogger(__name__)
"""
Prestapi is a library for Python to interact with the PrestaShop's Web Service API.
Questions, comments? http://webkul.com/ticket/index.php
"""
__author__ = "<NAME> <<EMAIL>>"
__version__ = "0.13.12"
... |
import os
from functools import wraps
import time
from datetime import datetime
from Bio.SeqFeature import FeatureLocation, CompoundLocation
from Bio import SeqIO
from Bio.SeqUtils import GC
from zci_bio.utils.entrez import Entrez
from zci_bio.utils.diff_sequences import diff_check_memory
from zci_bio.chloroplast.utils... |
# 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, software
# d... |
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
HERO Model
some classes are modified from HuggingFace
(https://github.com/huggingface/transformers)
copied/modified from HERO
(https://github.com/linjieli222/HERO)
"""
import json
import logging
from collections import defaultdict
from io impor... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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 or... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import json
import cv2
import numpy as np
from progress.bar import Bar
import torch
import math
from opts import opts
from logger import Logger
from datasets.dataset_factory impor... |
"""!
@brief SISNR very efficient computation in Torch. PArts have been used from
asteroid for values cross checking.
@author <NAME> {<EMAIL>}
@copyright University of illinois at Urbana Champaign
"""
import torch
import torch.nn as nn
import itertools
from torch.nn.modules.loss import _Loss
def _sdr( y, z, SI=False... |
"""
Couple of functions needed for training the model.
"""
import pandas as pd
import numpy as np
from catboost import CatBoostRegressor, Pool
from sklearn.model_selection import train_test_split, KFold
from sklearn.preprocessing import StandardScaler
from catboost import CatBoostClassifier
from tqdm import tqdm_noteb... |
# 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 applicable ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module defining NumPy array-based distribution classes.
Sparse means the length of outcomes and pmf need not equal the length of the
sample space. There are two important points to keep in mind.
1) A sparse distribution is not necessarily trim. Recall, a distribut... |
#!/usr/bin/env python
import sys
from collections import defaultdict
import texterrors_align
import numpy as np
import plac
from loguru import logger
from termcolor import colored
import shutil
from dataclasses import dataclass
def convert_to_int(lst_a, lst_b, dct):
def convert(lst, dct_syms):
intlst = []... |
from srd import tax
from srd import covid
import numpy as np
import pandas as pd
from numba import njit, prange
from itertools import product
from scipy.linalg import cholesky
from scipy.optimize import minimize
from functools import partial
class behavior:
def __init__(self,icouple=True, ihetero=True, icost=False... |
# Copyright 2020 Huawei Technologies Co., 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 or agreed to... |
import numpy as np
import nibabel as nib
import SimpleITK as sitk
from matplotlib import patches
import scipy.ndimage.filters as fi
from matplotlib import pyplot as plt
from dipy.align.reslice import reslice
plt.rcParams['image.cmap'] = 'gray'
# -------------------------
# Nifti Image Preprocessing
# ---------------... |
'''
LpdReadoutTest.py - Readout a system using the API
'''
from __future__ import print_function
from lpd.device import LpdDevice
from ethernet_utility import EthernetUtility
import argparse, sys, time
from datetime import datetime
# New imports
from xml.etree.ElementInclude import ElementTree
from xml.etree.... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
import os
import re
import sys
import glob
import codecs
import shutil
import signal
import zipfile
import tarfile
import itertools
import subproce... |
'''
Set of various image filters used for generating textures for models.
Uses numpy arrays with colors with colors encoded with values in range 0-1.
'''
# pylint: disable=invalid-name
from __future__ import annotations
from itertools import cycle, accumulate
from typing import Tuple, Iterable, NamedTuple, List, Optio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
# -*- coding: utf-8 -*-
"""
Implementation of the modified Gromov–Hausdorff (mGH) distance
between compact metric spaces induced by unweighted graphs. This
code complements the results from "Efficient estimation of a
Gromov–Hausdorff distance between unweighted graphs" by <NAME> et
al. (https://arxi... |
import argparse
import copy
import os
import time
from pathlib import Path
from pprint import pprint
import shutil
import joblib
import numpy as np
from sklearn import metrics
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, random_split
from torchvision import tr... |
# Copyright 2019-2020 The Bazel 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 applicab... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merg... |
"""
Contains the ModelDiagnostics class.
"""
# Imports
from cbrain.imports import *
from cbrain.utils import *
from cbrain.data_generator import DataGenerator
from cbrain.cam_constants import *
from cbrain.layers import *
from cbrain.losses import *
import pickle
import yaml
# tgb - 4/10/2019 - Adding a model_path i... |
"""JASMIN Cloud
JASMIN Cloud Provider Interface package - module for handling networking
functionality
"""
__author__ = "<NAME>"
__date__ = "24/03/14"
__copyright__ = "(C) 2014 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__revision__ = "$Id$"
from os import... |
# Copyright 2019-2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
"""MPC interface for circuit_sat and compressed_pivot modules.
Circuit_sat implementation of https://eprint.iacr.org/2020/152
``Compressed Sigma-Protocol Theory and Practical Application
to Plug & Play Secure Algorithmics''
"""
import mpyc.mpctools as mpctools
from mpyc.runtime import mpc, logging
from mpy... |
import pdb
import numpy as np
from PIL import Image, ImageOps
import torchvision.transforms as tvf
import random
from math import ceil
from . import transforms_tools as F
def create(cmd_line, to_tensor=False, **vars):
''' Create a sequence of transformations.
cmd_line: (str)
Comma-separated list of ... |
import os
import cv2
import glob
import shutil
import scipy.misc
import numpy as np
import pandas as pd
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import xml.etree.ElementTree as ET
from ray.util.multiprocessing import Pool
def f(index):
return index
def get_tra... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil; coding: utf-8 -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms... |
"""Functions for training and running group classification."""
import math
import os
import time
import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.utils.extmath import softmax
from scipy.special import expit
from sklearn.metrics import f1_score, fbeta_score, classif... |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: <EMAIL>
##
## This file is part of VisTrails.
##
## "Redistributio... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
#!/usr/local/bin/python3
import logging
logging.basicConfig(format='%(asctime)s %(funcName)s %(message)s', filename='/var/log/astor_square/astor_real_estate.log',level=logging.DEBUG)
from astor_square_utils import *
from astor_housing import *
from marshmallow import pprint
import sys
import os
import re
from sklearn.n... |
import torch
import os, sys, argparse
import pandas as pd
import json
# All the MaskedLM
from transformers import BertTokenizer, BertForMaskedLM
from transformers import RobertaTokenizer, RobertaForMaskedLM
from transformers import DistilBertTokenizer, DistilBertForMaskedLM
from transformers import SqueezeBertTokenize... |
# import libraries
import os
import io
import math
import time
import picamera
from fractions import Fraction
from collections import OrderedDict
import PIL.Image
import PIL.ImageTk
import PIL.ImageDraw
import PIL.ImageFile
import PIL.ImageFont
from tkinter import *
import tkinter as tk
from tkinter import filedialog
... |
import numpy as np
"""
This is a library to do pretty basic neural network computations automatically.
It should be kept clean and simple. Computations are made as nodes are added
to the graph and derivatives are propogated in the reverse order.
There are currently just a few operations, which should be enough for ... |
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
#from builtins import str
from builtins import range
from quantities.quantity import Quantity
from quantities import mV, nA
import sciunit
from sciunit import Test,Score
try:
... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... |
import sys
#sys.path.append('/Users/kb/bin/opencv-3.1.0/build/lib/')
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
import Tkinter as tk
import tkFileDialog
import tkMessageBox
import ttk
import os
import math
import json
import numpy as np
import cv2
from PIL import Image,... |
from random import randint
import asyncio
import random
import re
import aiohttp
import discord
from discord.ext import commands
from fuzzywuzzy import process
from utils import errors
from utils.orm import Pokemon, Trainer, FoundPokemon, xp_to_level, get_all_pokemon
from utils.menus import Menus, STAR, GLOWING_STAR,... |
'''
------------------------------------------------------------------------
Functions for generating demographic objects necessary for the OG-USA
model
This module defines the following function(s):
get_fert()
get_mort()
pop_rebin()
get_imm_resid()
immsolve()
get_pop_objs()
-------------------... |
# Copyright 2020 FiveAI Ltd.
# All rights reserved.
#
# This file is part of the PaRoT toolbox, and is released under the
# "MIT License Agreement". Please see the LICENSE file that should
# have been included as part of this package.
"""
Experimental setup used for the PaRoT DiffAI comparison
"""
import warnings
imp... |
#!/bin/python3
"""
Script to perform hyperparameter optimization on a reservoir computer with the specified options.
Run as:
python3 opt_then_test.py SYSTEM MAP_INITIAL PREDICTION_TYPE METHOD [Results directory] [options...]
### Script arguments ###
Choose SYSTEM from ["lorenz", "rossler", "thomas", "softrobot"]
C... |
"""Write events in Nexus format
"""
import sys
import os
from datetime import datetime
import roxar.events
import roxar_api_utils.events
import roxar_api_utils.ioutil
# ----------------------------------------------------------------
# Script parameters
# List of input event set in Events folder
inpu... |
import os
import sys
# Add all the python paths needed to execute when using Python 3.6
sys.path.append(os.path.join(os.path.dirname(__file__), "models"))
sys.path.append(os.path.join(os.path.dirname(__file__), "models/arc"))
sys.path.append(os.path.join(os.path.dirname(__file__), "skiprnn_pytorch"))
sys.path.append(o... |
# Lib functions in data processing and calculation.
# author: ynie
# date: Feb, 2020
import torch
import torch.nn as nn
import copy
import numpy as np
from torch.nn import functional as F
from copy import deepcopy
def to_dict_tensor(dicts, if_cuda):
'''
Store dict to torch tensor.
:param dicts:
:param... |
"""
This module deals with LAT analysis: calculus, statistics, and data visualization.
"""
from __future__ import unicode_literals
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.table import Table
import astropy.units as u
from scipy.signal import argre... |
import sys
import ecdsa
from ecdsa.curves import SECP256k1
import hashlib
import logging
import base64
from uwallet.constants import TYPE_SCRIPT, TYPE_PUBKEY, TYPE_UPDATE, TYPE_SUPPORT, TYPE_CLAIM
from uwallet.constants import TYPE_ADDRESS, NO_SIGNATURE
from uwallet.opcodes import opcodes, match_decoded, scri... |
#
# This file is part of FaceDancer.
#
""" Functionality for defining USB devices. """
import sys
import asyncio
import logging
import warnings
from typing import Dict, Iterable, Union
from dataclasses import dataclass, field
from prompt_toolkit import HTML, print_formatted_text
from .. impor... |
#!/usr/bin/env python3
import random
from popper.utils import Settings, Stats
from popper.aspsolver import Clingo
from popper.tester import Tester
from popper.constrain import Constrain, Outcome, Con
from popper.generate import generate_program
from popper.core import Clause, Literal, Grounding, Program
from datetime ... |
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, Generator
import time
import torch as th
import gym
from torch import nn
from gym import spaces
import numpy as np
from torch.nn import functional as F
from stable_baselines3 import PPO
from stable_baselines3.common.policies import ActorCrit... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Parsing of the Java Class file format as per:
https://docs.oracle.com/javase/specs/jvms/se14/html/jvms-4.html
"""
from typing import Union, Any, Dict, List, ByteString, Type, Optional, TypeVar, Generic
from enum import IntEnum
from refinery.lib.structures import (
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 16:00:00 2020
@author: <NAME>
"""
import pandas as pd
pd.options.mode.chained_assignment = None
from inspect import isfunction
import numpy as np
import math
from collections import defaultdict
from sklearn.cluster import KMeans
from scipy.stats import zscore
from sk... |
from __future__ import division
import jack
import numpy as np
import os, signal
import subprocess
import threading
from aiohttp import web
import socketio
from socketIO_client import SocketIO
import aiohttp_cors
import glob
import datetime
import atexit
import time
import json
import wave
import resampy
import o... |
"""Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
"""
from __future__ import absolute_import
from __future__ import print_function
import threading
import warnings
import cv2
import numpy as np
import sc... |
"""
.. module:: transformer
:synopsis: Data and image transformations
"""
from __future__ import print_function
import numpy as np
import os.path as path
import random as rnd
import nutsml.datautil as ut
import nutsml.imageutil as ni
from nutsflow import Nut, NutFunction, nut_processor
from nutsflow.common import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
pluto.py - tools for analyzing outputs from PLUTO
Last Modified: 2021.09.05
Copyright(C) 2021 <NAME> <https://xshaokun.com>
Licensed under the MIT License, see LICENSE file for details
'''
import os
import fire
import numpy as np
import pandas as pd
import pyPLUTO.pl... |
# This file is part of ZS
# Copyright (C) 2013-2014 <NAME> <<EMAIL>>
# See file LICENSE.txt for license information.
import json
import hashlib
import os
import os.path
import multiprocessing
import struct
import sys
import getpass
import socket
import traceback
from contextlib import contextmanager
from datetime impo... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Extinction models.
Classes are callables representing the corresponding extinction
function with a fixed R_V. When calling an extinction function multiple
times with the same R_V, it will be faster to create a class instance with
fixed R_V and use that... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Module filesearching - Contains miscellaneous file searching functions.
Some of the file searching functions are based on ideas suggested by the
Python Cookbook, 2nd edition, by <NAME>, <NAME>
and <NAME> (O'Reilly Media 2005) 0_596-00797-3.
The class hierarchy is::
... |
###
#
# Given, in the data/output/parents/results directory:
#
# * pshtt.csv - domain-scan, based on pshtt
# * sslyze.csv - domain-scan, based on sslyze.
#
# And, in the data/output/subdomains directory:
#
# * gather/results/gathered.csv - all gathered .gov hostnames
# * scan/results/pshtt.csv - pshtt scan for all host... |
# NOTE: It is the historian's job to make sure that keywords are not repetitive (they are
# otherwise double-counted into counts).
from collections import defaultdict
from collections import OrderedDict
import os
import pandas as pd
import re
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-ZTF/ampel/ztf/t3/skyportal/SkyPortalClient.py
# Author: <NAME> <<EMAIL>>
# Date: 16.09.2020
# Last Modified Date: 16.09.2020
# Last Modified By: <NAME> <<EMAIL>>
import asyncio, base64, gzip, io, json, math, time... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import torch
# torch.autograd.set_detect_anomaly(True)
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
from torch.nn.modules.rnn import RNNCellBase
from .TreeM... |
import argparse
import os
import scipy.io as sio
import numpy as np
import nibabel as nib
import time
import tensorflow as tf
from BrainStructureAwareNetwork_arch import BrainStructureAwareNetwork
from SpatialConnectionAwareNetwork_arch import SpatialConnectionAwareNetwork
from getimgtest import getimgtest
im... |
"""
The unit test module for AutoTVM dialect.
"""
# pylint:disable=missing-docstring, redefined-outer-name, invalid-name
# pylint:disable=unused-argument, unused-import, wrong-import-position, ungrouped-imports
import argparse
import glob
import os
import tempfile
from copy import deepcopy
import json
import mock
impo... |
"""ageo - active geolocation library: core.
"""
__all__ = ('Location', 'Map', 'Observation')
import bisect
import functools
import itertools
import numpy as np
import pyproj
from scipy import sparse
from shapely.geometry import Point, MultiPoint, Polygon, box as Box
from shapely.ops import transform as sh_transform
i... |
# -*- coding: utf-8 -*-
# Built-in
# Common
import numpy as np
import scipy.interpolate as scpinterp
# specific
from . import _generic_check
from . import _mesh_bsplines_operators_rect
# #############################################################################
# #############################################... |
import datetime
from datetime import datetime
import copy
import pandas as pd
import numpy as np
import math
import ciw
import imp
import re
import statistics
import matplotlib.pyplot as plt
transitions = imp.load_source('transitions', 'src/transitions.py')
custom_ciw = imp.load_source('custom_ciw', 'src/custom_ciw.py... |
import os
import random
import argparse
import numpy as np
import pandas as pd
import torch
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from torchtext.data import Field, LabelField, BucketIterator
class Data_Prepper:
def __init__(self, name, train_batch_size, n_pa... |
from django.apps import apps
from django.conf import settings
from django.core.mail import send_mail
from django.contrib import messages
from django.utils.translation import ugettext as _
from django.db.models import Q
from PIL import Image # ImageOps
import sys
import datetime
import re
import os
import subprocess
f... |
######################################################################
## TFL_Prepare_Review_Package.py
## Purpose: 1. Create polygon features for the areas of change
## 2. Create a TFL review map from template that highlights line and
## area changes
## 3. Request summary text and create... |
#!/usr/bin/env python3
"""
Duplicate OpenGL coordinate system...
See:
https://gamedev.stackexchange.com/questions/153078/what-can-i-do-with-the-4th-component-of-gl-position
"""
import sys
from math import sin, cos, pi, sqrt
import numpy
scalar = numpy.float64
EPSILON = 1e-6
class Mat(object):
def __init__(sel... |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.