text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/env python
"""DPA ON KECCAK n-BIT CHI ROW & 1-BIT K
Save the figures for a simulation which display the outcome of a test
according to the SNR, in order to recover kappa bits.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = "3.1"
import numpy as np
import itertools
from deci... |
import random
import PIL
from PIL.Image import Image
from PIL.ImageDraw import ImageDraw
from PIL import ImageTk
from tkinter import *
from tkinter import filedialog, messagebox
import os
import pkg_resources.py2_warn
global main_file
global col
global crop_rotate_root
"""-------------------------------... |
# stdlib
import os
import logging
import sys
from core.blockchain.projectpai.paicoin import paicoin_cli
from django.conf import settings
# third party
from rest_framework import generics
from rest_framework import status
from rest_framework.pagination import PageNumberPagination
from rest_framework.permissions import ... |
import hashlib
import json
import os.path
import platform
import shlex
import shutil
import stat
import subprocess
import sys
import urllib.request
from dataclasses import dataclass
from logging import getLogger
from typing import Dict, List, Optional, Set, Tuple
from urllib.request import urlopen
import filelock
from... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 3 02:25:12 2020
@author: Itallo
"""
import math
import random
import numpy as np
#import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
import csv
from pgmpy.readwrite import BIFReader
import time
from rpy2.robjects.packages import im... |
def Rb_tswaxs(t=0.5, waxs_arc = [13],energies=[15150,15160,15170,15180,15190,15191,15192,15193,15194,15195,15196,15197,15198,15199,15200,15201,15202,15203,15204,15205,15210,15215,15220,15230,15240,15250]):
#holder 1
#sample_list = ['F_D230','F_D230_epoxy','F_D400','F_D230_OG','F_D2000','M6B1','M6B2','M6B... |
#
# WORK IN PROGRESS
#
# lcd.py - contains ILI controllers TFT LCD driving classes
# Data transfer using 4-line Serial protocol (Series II)
# 16-bit RGB Color (R:5-bit; G:6-bit; B:5-bit)
# About 30Hz monocolor screen refresh
#
# Default is portrait mode:
# lcd = LCD( [ portrait = True ] )
# width is 240px
# he... |
#
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
... |
# When we make a new one, we should inherit the Finetune class.
import logging
import os
import random
import PIL
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from randaugment.randaugment import RandAugment
from torch.utils.data import DataLoader
from torch.utils.tensorboard import Summary... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
from combined_thresh import combined_thresh
from perspective_transform import perspective_transform
def line_fit(binary_warped, T):
"""
Find and fit lane lines
"""
# Assuming you have created a... |
#!/usr/bin/env python
"""
shgyield.py is a python module for exploring the SHG optical response of
materials. It is well suited for 2D-materials, surfaces, bulks, and
metamaterials. For a complete overview of the theory, see PRB 94, 115314 (2016).
todo:
* SHG: SOME Nv=1 INSTANCES ARE HARDCODED, NEED TO GO BACK AND CHA... |
import torch.utils.data as torchdata
import torchvision as tv
from torch import nn
from torch.nn import functional as F
from dataclasses import dataclass
from torch.nn.utils import weight_norm
from enum import Enum
from typing import Optional, Tuple
from torchvision import transforms
from pathlib import Path
@datacl... |
from common import *
import weakref
import mapfile
TILE_SIZE = (24,24)
MAP_SIZE_IN_TILES = (512,512)
MAP_SIZE = (MAP_SIZE_IN_TILES[0] * TILE_SIZE[0], MAP_SIZE_IN_TILES[1] * TILE_SIZE[1])
@mapfile.dumpable('layer')
class KPLayer(object):
__dump_attribs__ = ('name', '_visible')
def __repr__(self):
return "<KPLayer... |
"""Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... """
from sympy.polys.algebratools import (
ZZ, QQ, RR, PolynomialRing, FractionField, EX
)
from sympy.polys.polyerrors import (
UnificationFailed,
GeneratorsNeeded,
DomainError,
)
from sympy import S, sqrt, sin, oo, ra... |
# taken from https://github.com/ikostrikov/pytorch-flows/blob/master/flows.py
import math
import types
import numpy as np
import scipy as sp
import scipy.linalg
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from models.mog_maf_model import create_masks
de... |
#!/usr/bin/env python3
#------------------------------------------------------------------------------
# log4sh-detect.py
#
# Tests the Specified Host for the log4shell Vulnerability.
#
# NOTE(s):
#
# * Morty and Morty's Creations ASSUMES ZERO LIABILITY relating to the
# results obtained by this script.
#
# * T... |
import common
import paintwdg
from PyQt5 import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import taskconf_menu
import tablewidget
import paintool
import items.arrow
from items.arrow import ArrowItem
from items.circmoment import CircMomentItem
from items.squaremoment import ... |
"""
plugins.modules
===============
"""
import os
import shutil
import sys
import tempfile
from pathlib import Path
from typing import Any, Dict, List, Optional
from object_colors import Color
import pyaud
DOCS = Path("docs")
README = Path("README.rst")
colors = Color()
colors.populate_colors()
class LineSwitch:
... |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import hashlib
import hmac
import sys
from . import backend
from ._asn1 import (
Certificate,
DSASignature,
ECDomainParameters,
ECPointBitString,
ECPrivateKey,
int_from_bytes,
PrivateKeyAlgor... |
import os
import pandas as pd
import ffbrank.utils as utils
from datetime import datetime
_pos_scoring_dict = {
'QB': ['STD'],
'RB': ['STD', 'HALF', 'PPR'],
'WR': ['STD', 'HALF', 'PPR'],
'TE': ['STD', 'HALF', 'PPR'],
'FLEX': ['STD', 'HALF', 'PPR'],
... |
# %% [markdown]
# # Overview
# The notebook shows how to extract the segmentation map for the ships, augment the images and train a simple DNN model to detect them. A few additional tweaks like balancing the ship-count out a little better have been done.
# %% [markdown]
# ## Model Parameters
# We might want to adjust ... |
#
# Copyright (C) 2018 Codethink Limited
# Copyright (C) 2018-2019 Bloomberg Finance LP
#
# 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.... |
"""
TUI for lluv
author: <NAME> CSH:(jpotter)
"""
import npyscreen
import lluv.lluv as lluv
import multiprocessing
import sys
# WIDGET SUBCLASSES
class FilePicker(npyscreen.FilenameCombo):
def __init__(self, *args, **keywords):
super(FilePicker, self).__init__(*args, **keywords)
self.must_exist=Fa... |
from __future__ import division
from itertools import combinations
import numpy as np
import time
import os
import datetime
import logging
from scipy.spatial.distance import cdist
import scipy.io as sio
from sklearn.model_selection import KFold, GridSearchCV
from regressor import VectorRegressor
class Timer(object):... |
import enum
import logging
import pathlib
import random
from abc import abstractmethod
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import cloudpickle
import numpy as np
import torch
import torch.nn as nn
import determined as det
from determined import horovod, ipc, util, workload
from determined.... |
import numpy as np
import xarray as xr
from datetime import date
import scipy.ndimage as ndimage
def mhwdetect(t, pctile=90, windowHalfWidth=5, smoothPercentile=True, smoothPercentileWidth=31, minDuration=5, joinAcrossGaps=True, maxGap=2, maxPadLength=False, coldSpells=False, alternateClimatology=False, Ly=False):
... |
import numpy as np
import CCDutils
#This module contains the functions necessary for doing CCSD in the spin-orbital basis
##Spin-orbital-based utilities
def CCSDdoubles(F,Eri,T2,T1,nocc,nbas,variant):
#Get the right hand side of the spinorbital CCSD singles equations. p. 307-308 of Bartlett and Shavitt
niter = 1
#... |
"""
This File contains Pythons Program related to List, Questiona take from Geeks of Geeks.
Some Libraries are imported before all the Programs Please check them before trying any program
"""
#Creating some inputs for testing
L1 = [12, 35, 9, 56, 24]
L2 = [1, 2, 3]
L3 = [10,20,30,40,50]
L4 = [2,3,7,13,17,23]
L5 = [-1,1... |
# freda (todo) :
import torch.nn as nn
import torch
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
from torchvision.utils import save_image
#from correlation_package.modules.corr import Correlation1d # from PWC-Net
#from layers_package.channelnorm_package.channelnorm ... |
import os
import json
import torch
import numpy as np
from torch.utils.data import Dataset
import pandas as pd
import argparse
import copy
from collections import Counter
from nltk.tokenize import TweetTokenizer
# import gensim
class _YELP_RESTAURANT(Dataset):
def __init__(self, args, vocab_obj, df, item_boa_dict... |
"""
Provides routines for calculating ENSO indices.
"""
# License: MIT
from __future__ import absolute_import, division
import os
import geopandas as gp
import numpy as np
import regionmask as rm
import xarray as xr
import reanalysis_dbns.utils as rdu
MEI_SEASONS = ['DJ', 'JF', 'FM', 'MA', 'AM', 'MJ',
... |
import numpy as np
from pyyeti import ytools, nastran, locate
from pyyeti.nastran import op4, op2
from scipy.io import matlab
from nose.tools import *
def runcomp(nas, m):
matnas = m["nas"]
for name in matnas.dtype.names:
if isinstance(nas[name], dict):
for k in nas[name]:
... |
bl_info = {
"name": "keContextOps",
"author": "<NAME>",
"category": "Modeling",
"version": (1, 4, 0),
"blender": (2, 80, 0),
}
import bpy
import bmesh
from mathutils import Vector
from math import sqrt
from bpy.types import Operator
from .ke_utils import get_loops, mouse_raycast, get_selected, average_vector, get... |
"""
NutriPy: A Personalized Nutrition Calculator
By <NAME>, <NAME>, <NAME>, and <NAME>
4/11/2021
"""
import csv
import tkinter as tk
from tkinter import *
import math
import pandas as pd
import numpy as np
def round_half_up(n, decimals=0):
multiplier = 10 ** decimals
return math.floor(n*multi... |
r"""Submodule NLTSA.py includes the following functions: <br>
- **fluctuation_intensity():** run fluctuation intensity on a time series to detect non linear change <br>
- **distribution_uniformity():** run distribution uniformity on a time series to detect non linear change <br>
- **complexity_resonance():** the produc... |
#! python
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 25 13:30:52 2017
@author: <NAME>, UNIVERSITY COLLEGE LONDON.
Tools for calculating the Stark effect in Rydberg helium
using the Numerov method.
Based on:
Stark structure of the Rydberg states of alkali-metal atoms
<NAME> et al. Phys. Rev. A, 20 22... |
#!/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import numpy.ma as ma
#from mpl_toolkits.basemap import Basemap
#from matplotlib.ticker import MaxNLocator
from netCDF4 import Dataset as open_ncfile
from matplotlib.ticker import AutoMinorLocator, MultipleLocator
from scipy.interpolate import interp1d, Int... |
# This file is part of Charlton
# Copyright (C) 2011 <NAME> <<EMAIL>>
# See file COPYING for license information.
# This file defines the model specification class, ModelSpec. Unlike a
# ModelDesc (which describes a model in general terms), a ModelSpec specifies
# all the details about it --- it knows how many columns... |
# coding=utf-8
import json
import requests_mock
import logging
from enum import Enum
from schematics.models import Model
from schematics.types import BaseType, StringType, IntType, DictType, BooleanType
from schematics.exceptions import DataError
from requests import Session, Request
from requests.auth import HTTPBasi... |
#python/project7 artemia feed
#artemia return 0 problems alarm
import tkinter as tkr
from tkinter import *
from tkinter.ttk import *
import tkinter.messagebox
import time
import sys
import os
#========================================================================
#Plots
import matplotlib.pyplot as plt
import n... |
"""Model for concept detection, and its training and evaluation handle."""
# Copyright (c) 2020 Continental Automotive GmbH
import hashlib
import logging
from typing import Optional, Tuple, Dict, Any, Sequence, Callable
import numpy as np
import torch
import torch.nn
from .base_handles import EarlyStoppingHandle, R... |
# Collection of base classes for FastEMRIWaveforms Packages
# Copyright (C) 2020 <NAME>, <NAME>, <NAME>, <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License... |
# The MIT License (MIT)
# Copyright (c) 2022 by the xcube development team and contributors
#
# 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 limit... |
import ast
import types
import difflib
import io
import os
import re
import sys
from html.parser import HTMLParser
from io import StringIO
from urllib.parse import quote_plus
from contextlib import closing
import urllib.request as request
from shutil import copyfileobj
from gzip import open as gzip_open
from types imp... |
'''
Edits made to the .obj files which contain compiled game KC code.
These are generally based on reading the dissassembled assembly code,
selecting constants of interest (eg. max seta multiplier), determining
their location in the original obj file, and defining a patch to apply.
This will not use the File_Patcher, ... |
"""Module contains code for the Tutorial class, dealing with the creation of a training tutorial."""
import collections
import json
import os
import re
import shutil
from pprint import pprint
import oyaml as yaml
import requests
import six
from planemo import templates
from planemo.bioblend import galaxy
from planem... |
from __future__ import print_function, absolute_import, unicode_literals
import os, sys
import re
import logging
from ._compat import pickle, import_, string_types, text_type, iteritems, u, PY2, callable
import inspect
import types
log = logging
class _Default(object): pass
def safe_import(path):
module = path.sp... |
# Copyright (c) Facebook, Inc. and its affiliates.
import os
import pickle
import re
from collections import OrderedDict
from copy import deepcopy
from dataclasses import dataclass
from enum import Enum
from typing import Any
import torch
import torchvision
from mmf.common.registry import registry
from mmf.models.frcn... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import logging
import os
import signal
import time
import traceback
from... |
from __future__ import print_function
from six.moves import xrange
import theano
from theano.tensor import basic as T
import numpy as N
#from util import strutil
from theano.tensor.blas_headers import blas_header_text, blas_header_version
from theano.tensor.blas import ldflags
from theano.misc import strutil
from thean... |
###
# Copyright (c) 2002-2004, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, ... |
from __future__ import print_function
from math import pi
from PDSim.scroll import scroll_geo
import PDSim.scroll.core as core
from PDSim.core.motor import Motor
from PDSim.flow.flow import FlowPath
from PDSim.flow.flow_models import IsentropicNozzleWrapper
from PDSim.core.containers import Tube,ControlVolume
from Coo... |
# Copyright 2018 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 applica... |
"""
Parser for botocore shape files.
"""
from collections.abc import Iterable, Mapping, Sequence
from typing import Any
from boto3.resources.model import Collection
from boto3.session import Session
from botocore import xform_name
from botocore.exceptions import UnknownServiceError
from botocore.model import (
Lis... |
# original code from package: gameobjects
# Home-page: http://code.google.com/p/gameobjects/
# Author: <NAME>
# Download-URL: http://code.google.com/p/gameobjects/downloads/list
# Copyright (c) 2010-2021 <NAME>
# License: MIT License
from typing import Sequence, Iterable, List, Tuple, TYPE_CHECKING
import math
from mat... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
__all__ = [
"from_3d_numpy_to_2d_array",
"from_3d_numpy_to_nested",
"from_nested_to_2d_array",
"from_2d_array_to_nested",
"from_nested_to_3d_numpy",
"from_nested_to_long",
"from_long_to_nested",
"from_multi_index_to_3d_nump... |
import bpy
from bpy.props import *
import os
import shutil
import arm.props_ui as props_ui
import arm.assets as assets
import arm.log as log
import arm.utils
import arm.make
import arm.props_renderpath as props_renderpath
import arm.proxy
import arm.nodes_logic
# Armory version
arm_version = '2020.3'
arm_commit = '$Id... |
import argparse
import numpy as np
from numpy import sqrt,pi,exp
import scipy as sp
from astropy.cosmology import FlatLambdaCDM,WMAP5,WMAP7,WMAP9,Planck13,Planck15
from astropy import units as u
from astropy.units import cds
import matplotlib.pyplot as plt
import astropy.constants as cc
from scipy.special import zeta
f... |
import mmcv
import numpy as np
from collections import OrderedDict
from nuscenes.utils.geometry_utils import view_points
from pathlib import Path
from mmdet3d.core.bbox import box_np_ops
from .kitti_data_utils import get_kitti_image_info, get_waymo_image_info
from .nuscenes_converter import post_process_coords
kitti_... |
import re
from pseudo.pseudo_tree import Node, to_node, call, method_call, local, typename, assignment
from pseudo import generate
SNAKE_CASE_REGEX = re.compile(r'(_\[a-z])')
def standard_method_call(receiver, message, args, pseudo_type):
return Node('standard_method_call',
receiver=receiver,
mes... |
# list of input issues
#
# general
# auxiliary should be AUXNAMES auxnames(naux)
# differentiate somehow a block that has repeating records from other block types?
# should mark time series variables in some way special. Maybe an *?
# should we begin all character string variables with a 'c'?
#
# mfsim.nam
# ... |
import time
from collections import deque, OrderedDict
from typing import Optional, Any
import sys
import functools
from common.serializers.serialization import state_roots_serializer
from crypto.bls.bls_bft_replica import BlsBftReplica
from orderedset import OrderedSet
from plenum.common.config_util import getConf... |
import os
import re
import itertools
import time
from pycparser import CParser, c_ast
from srcgen.python import PythonModule
from collections import OrderedDict
include_pattern = re.compile(r'^\s*#\s*include\s*[<"](.+?)[">]\s*$', re.IGNORECASE)
define_pattern = re.compile(r'^\s*#\s*define\s+(\w+)(?:\((.*?)\))?\s*(.*)... |
#!/usr/bin/env python
"""The in memory database methods for flow handling."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import logging
import sys
import threading
import time
from future.utils import iteritems
from future.utils i... |
###############################################################################
# Imports
import argparse # Argument parser
import logging # DEBUG, INFO, WARNING, ERROR, CRITICAL
import Utility
import YawlToMetagraph
import TriplesToMetagraph
import PolicyAnalysisHelper
from mgtoolkit.library import *
from ortools... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may n... |
#!/usr/bin/env pypy
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from itertools import count
from collections import Counter, OrderedDict, namedtuple
# The table size is the maximum number of elements in the transposition table.
TABLE_SIZE = 1e6
# This constant controls how much time we s... |
import scipy.sparse as sp
import scipy.sparse.linalg as slinalg
from numpy import linalg
import scipy.misc
from sklearn.preprocessing import normalize
from gcn.utils import Test21, absorption_probability, smooth, load_data, taubin_smoothing
import gcn.utils
from config import configuration
import matplotlib.pyplot as p... |
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
"""
This is an implementation of a state-emitting MarkovModel. I am using
terminology similar to Manning and Schutze.
Functions:
train_bw T... |
import numpy as np
import tensorflow as tf
import gym
import os
import sys
import time
from spinup.utils.logx import EpochLogger
from spinup.utils.mpi_tf import MpiAdamOptimizer, sync_all_params
from spinup.utils.mpi_tools import mpi_fork, mpi_avg, proc_id, mpi_statistics_scalar, num_procs
from spinup.utils.logx import... |
import asyncio
import collections
import logging
import aiokafka.errors as Errors
from aiokafka.client import ConnectionGroup, CoordinationType
from aiokafka.errors import (
KafkaError, UnknownTopicOrPartitionError,
CoordinatorNotAvailableError, NotCoordinatorError,
CoordinatorLoadInProgressError, InvalidP... |
# -*- coding: utf-8 -*-
# pylint: disable=W1401
'''
This module renders highstate configuration into a more human readable format.
How it works:
`highstate or lowstate` data is parsed with a `proccesser` this defaults to `highstate_doc.proccesser_markdown`.
The proccessed data is passed to a `jinja` template that bu... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
import pickle
import sys, os
import types
import copy
import re
import pdb
import pickle
import tqdm
from collections import defaultdict, OrderedDict
import argparse
import pprint
import shutil
SIMPLE = ['Gene_expression', 'Transcription', 'Protein_catabolism', 'Localization', 'Phosphorylation']
REG = ['Negative_regul... |
# ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# File Author: <NAME> (c) #
# Date: 5/17/2020 #
# MIT Licence #
# #############################... |
import datetime
import json
from RequestsLibrary import RequestsLibrary, utils
from dateutil.parser import parse
from urllib3.exceptions import InsecureRequestWarning
from requests.packages import urllib3
from robot.libraries.BuiltIn import BuiltIn
from robot.utils.dotdict import DotDict
zoomba = BuiltIn()
requests_l... |
# -*- coding: utf-8 -*-
### System ###
import os
import re
import sys
import pickle
import shutil
import logging
import platform
from zipfile import ZipFile
from stat import S_IRUSR, S_IXUSR
from contextlib import contextmanager
from subprocess import run, PIPE, STDOUT, Popen
### Logging ###
from rich import print
fro... |
#
# Copyright 2016 Quantopian, 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 agreed to in wr... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import re
import datetime as dt
import time
import shutil
import select
from random import randint
import cPickle
import glob
import subprocess
from multiprocessing import Process, Pipe
from common_utils import *
from getchar import GetC... |
"""
The MIT License (MIT)
Copyright (c) 2015 <NAME> <<EMAIL>>
Copyright (c) 2020 James
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... |
import torch
def diatom_overlap_matrix(ni,nj, xij, rij, zeta_a, zeta_b, qn_int):
"""
compute the overlap matrix for each pair
"""
dtype = xij.dtype
device = xij.device
# xij unit vector points from i to j: xij = (xj-xi)/|xi-xj|, shape (npairs, 3)
#rij : distance between atom i and j in ato... |
import json
import string
import re
from uuid import UUID
from six import string_types, text_type
from functools import wraps
from datetime import datetime
import itertools
import logging
try:
from UserDict import UserDict
from collections import UserList
except ImportError:
from collections import UserDic... |
# Copyright 2017 Tufin Technologies Security Suite. 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... |
# -*- coding: utf-8 -*-
"""Tools for loading/running NeuroChem input files."""
import pkg_resources
import torch
import os
import bz2
import lark
import struct
import itertools
import ignite
import math
import timeit
from collections.abc import Mapping
from ..nn import ANIModel, Ensemble, Gaussian
from ..utils import ... |
#!/usr/bin/env python
import sys
import os
import socket
import argparse
import subprocess
import signal
import fcntl
import stat
criu_bin = '../../criu/criu'
sk_type_s = {
socket.SOCK_STREAM: "S",
socket.SOCK_DGRAM: "D",
}
# Actions that can be done by test. Actions are not only syscall
# names to call, bu... |
""" Module to generate individual FRB files """
from pkg_resources import resource_filename
import numpy as np
from astropy import units
from astropy.coordinates import SkyCoord
from frb import frb
def frb_121102():
"""
FRB 121102
All of the data currently comes from Tendulkar et al. 2017
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" AVL Wrapper core classes
"""
import os
import re
import shutil
import subprocess
import sys
from directories import DIRS
try:
import tkinter as tk # Python 3
except ImportError:
import Tkinter as tk # Python 2
try:
from configparser import ConfigParser... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
"""ACIL_GetImage is a module developed for the internal use of the Applied Chest Imaging Laboratory to download
cases stored in MAD server via ssh.
It works both in Unix/Mac/Windows, and it uses an internal SSH key created specifically for this purpose, so it
doesn't need that the user has an authorized SSH key install... |
# -*- coding: utf-8 -*-
"""Functions of bff library.
This module contains various useful fancy functions.
"""
from collections import abc, Counter
from datetime import datetime, timedelta
import logging
import math
import multiprocessing
import sys
from functools import partial, wraps
from typing import Any, Callable,... |
import argparse
import gc
import math
import os
from argparse import Namespace
from datetime import timedelta
from multiprocessing import cpu_count
from typing import List
import joblib
import numpy as np
import pandas as pd
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torch.nn.functional a... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset
import numpy as np
import matplotlib.pyplot as plt
import random as rn
import os
import time
from torchvision import datasets, transforms
import argparse
from torchsummary import summary
from pyntcloud import PyntClo... |
"""
Defines:
- write_gif(gif_filename, png_filenames, time=2.0, fps=30,
onesided=True, nrepeat=0,
delete_images=False, make_gif=True)
"""
import os
import numpy as np
try:
import imageio
IS_IMAGEIO = True
except ImportError:
IS_IMAGEIO = False
from pyNastran.utils.numpy_utils i... |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corp.
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: entities.py
#
# Copyright 2021 <NAME>, Jenda Brands, Theodoor Scholte
#
# 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 restric... |
from astropy.io import fits
from astropy.wcs import WCS
import numpy as np
import os
import tracemalloc
import pandas as pd
import matplotlib as mpl
import io
from skimage.transform import resize
import cv2
from astronomaly.base.base_dataset import Dataset
from astronomaly.base import logging_tools
mpl.use('Agg')
from ... |
import pytest
from diofant import Matrix, eye, sqrt, symbols
from diofant.tensor.tensor import (TensorIndexType, TensorType, tensor_indices,
tensorhead, tensorsymmetry)
__all__ = ()
numpy = pytest.importorskip('numpy')
def _get_valued_base_test_variables():
minkowski = Matri... |
import datetime
import fastavro
import json
import pandas
import six
from .client import Client
from .company import Company
from .data_group import DataGroup, DataGroupColumn
from .datasource import Datasource
from .errors import DataMonsterError
__all__ = ["DataMonster", "DimensionSet"]
class DataMonster(object):... |
import argparse
import collections
import functools
import itertools
import json
import multiprocessing as mp
import os
import pathlib
import re
import subprocess
import warnings
os.environ['NO_AT_BRIDGE'] = '1' # Hide X org false warning.
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.