text stringlengths 8.04k 46.5k |
|---|
# Copyright (C) 2021 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
from .context import *
from .datatypes import *
from .tree import Tree, Interpreter
from . import builder
class MethodReturn(Exception):
""" A pseudo exception to return from a method"""
def __init__(self)... |
# Copyright (c) 2021 <NAME>. All rights reserved.
# This code is licensed under Apache 2.0 with Commons Clause license (see LICENSE.md for details)
"""Signal generators built with `vectorbt.signals.factory.SignalFactory`."""
import numpy as np
import plotly.graph_objects as go
from vectorbt import _typing as tp
from... |
import argparse
import logging
import time
import math
import os
import random
from tqdm import tqdm
import numpy as np
import torch
from torch import nn, optim, cuda
from torch.cuda import amp, manual_seed_all
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader, RandomSampler, Sequen... |
# CODE AUTHOR
# <NAME> (NET ID: SXG19040)
# <NAME> (NET ID: PXV180021)
# Entities Relationship Extraction Project
import re, sys, nltk
import _pickle as pickle
import pickle
import os
import nltk
from nltk.parse import stanford
# import warnings
java_path = "C:/Program Files/Java/jdk-13.0.2/bin/java.exe"
os.environ[... |
import scipy as SP
import scipy.stats as ST
import numpy as NP
from numpy import dot
from scipy.linalg import cholesky,solve_triangular
from fastlmmhpc.external.util.math import check_definite_positiveness,check_symmetry,ddot,dotd,trace2
from fastlmmhpc.external.util.math import stl, stu
from sklearn.base import BaseEs... |
"""This file handles the parsing of feature specifications from files,
ending up with a configuration matrix"""
from collections import OrderedDict
from itertools import product
import os
from os.path import abspath, expanduser, expandvars
from pkg_resources import parse_version
import re
import sys
import six
import... |
# -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
# Standard Imports
import os
import re
import json
import tempfile
import contextlib
import shutil
import requests
import platform
from operator import itemgetter
# Logging
... |
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... |
# encoding: utf-8
"""
@author: <NAME>
@contact: <EMAIL>
@time: 2021/3/1 15:53
@desc: Heterogeneous Graph Transformer(https://arxiv.org/abs/2003.01332)
"""
import math
from typing import Dict, List, Tuple, Optional
import dgl
import dgl.function as fn
import torch
import torch.nn as nn
import torch.nn.functional as F
f... |
"""
If statements
-------------
.. pyscript_example::
if val > 7:
result = 42
elif val > 1:
result = 1
else:
result = 0
# One-line if
result = 42 if truth else 0
Looping
-------
There is support for while loops and for-loops in several forms.
Both support ... |
import numpy as np
import pytest
import yaml
from ophyd.sim import make_fake_device
from ..sim import FastMotor
from ..targets import (XYGridStage, convert_to_physical, get_unit_meshgrid,
mesh_interpolation, snake_grid_list)
@pytest.fixture(scope='function')
def sample_file(tmp_path):
path... |
'''
Created on Dec 22, 2013
@author: root
'''
from Angle import Angle
from Dihedral import Dihedral
from Exclusions import Exclusions
import multiprocessing
import numpy as np
import math
import random
import copy
from Utils import unit_vector
from Utils import vectorFromAtoms, print_pypoly_warning
def assert_si... |
from functools import partial
from collections import defaultdict
import torch
from torch import nn
from torch.nn import functional as F
import torch.utils.model_zoo as model_zoo
__all__ = ['nonlocalresnet3d50']
model_urls = {
'kinetics-400': defaultdict(lambda: None, {
'resnet3d18': 'http://pretorched-x... |
from factor_analyzer import FactorAnalyzer, Rotator, calculate_bartlett_sphericity, calculate_kmo
from sklearn.utils import check_array
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
def score(database, semester, year, season, answer_key, savedname):
'''
Modified so that it uses nu... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import sys
import smbus
import RPi.GPIO as GPIO
# code for MMA8451 accelerometer contained below
# Various addresses
MMA8451_i2caddr = 0x1D
class MMA845xConfig(object):
"""digital ac... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
"""
Nomenclature:
Host machine
Machine on which this pexpect script is run.
Target
Environment on which we deploy (docker container, ssh, or bash shell)
Container
Docker container created to run the modules on.
target_child - pexpect-spawned child created to build on target
host_child - pexpect spawned ... |
from tkinter import *
from HashMode import*
from ListaBaseDatos import*
class Databases_Window:
def __init__(self, window, settings_frame, database):
self.window = window
self.database= database
self.settings_frame = settings_frame
if database == "":
self.settings_f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Compute allele frequencies for sex & population combinations given an SV VCF
"""
import sys
import argparse
import pysam
from svtk import utils as svu
from collections import Counter
import pybedtools as pbt
def create_pop_dict(popfile):
"""
Makes diction... |
# coding=utf-8
# Copyright 2020 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016, 2017, 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
# 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... |
#!/usr/bin/python
"""Python module for parsing GATAN DM3 files"""
################################################################################
## Python script for parsing GATAN DM3 (DigitalMicrograph) files
## --
## warning: *tested on single-image files only*
## --
## based on the DM3_Reader plug-in (v 1.3.4) fo... |
# This new verion (6/11/10) hasn't been tested yet.
# Can't run unit tests on my MacPro w/o Nio.
#---------------------------------------------------
# <NAME>
# Sept 2014 (new version to use netCDF4)
# May, June 2010
# Nov 2019 (MINT netCDF compliance)
import os
import sys
import time
import datetime
import numpy ... |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
from moviepy.editor import VideoFileClip
import glob
# Define a class to receive the characteristics of each line detection
class Line():
def __init__(self):
# was the line detected in the last iteration?
... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from functools import partial
import collections
import re
eps = 1e-5
# -------------
# Single Layer
# -------------
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
... |
# -*- coding: utf-8 -*-
"""
Created on January 21, 2018
@author: neerbek
"""
import os
os.chdir("../../taboo-core")
from numpy.random import RandomState # type: ignore
from sklearn.cluster import KMeans # type: ignore
from typing import Tuple
import numpy
import ai_util
import server_rnn
import confusion_matrix
i... |
# revised cloneSeqReal to output more information in summary files
# REMEMBER THAT THE READ COUNTS LOG FILE IS 0-INDEXED AND THE MUTATION STRINGS IN THE SUMMARY FILES ARE 1-INDEXED
import os
from os import error, path
import re
from typing import DefaultDict
import numpy as np
import scipy
from scipy.stats import bino... |
'''
EffectWidget
============
.. versionadded:: 1.9.0
This code is still experimental, and its API is subject to change in a
future version.
The :class:`EffectWidget` is able to apply a variety of fancy
graphical effects to
its children. It works by rendering to a series of
:class:`~kivy.graphics.Fbo` instan... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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 o... |
"""Tests the primary interface of pgmock.
Examples of using the main pgmock interface should be able
to be derived from this test file as well. These tests contain both
unit-style tests and integration tests that hit a database.
Any pure unit tests for modules goes in the respective test_{module}
file
"""
import date... |
import numpy as np
import netCDF4 as nc
import pylab as plt
import argparse
import subprocess
import os
# command line:
# python reduce_pycles_netcdf.py input output
def main():
parser = argparse.ArgumentParser(prog='PyCLES')
parser.add_argument("fullfilename")
parser.add_argument("fname")
args = pars... |
import os
import torch
import copy
import math
import numpy as np
import itertools
from tensorboardX import SummaryWriter
from joblib import Parallel, delayed
from tqdm import tqdm
import torch.nn.functional as F
from src.asr import Seq2Seq
from src.rnnlm import RNN_LM
from src.clm import CLM_wrapper
from src.dataset i... |
import json
import logging
import os.path
from .app_secrets import AppSecretMapping
from .common import (InvalidAppDefinition, AdditionalFlagNeeded, pod_spec_update, main_container, try_oneline_dump)
from .mapping_utils import (ListExtension, finalize_unmerged_list_extensions, MappingKey, Translated, apply_mapping)
f... |
import math, struct;
from mWindowsSDK import *;
from .fbLastErrorIs import fbLastErrorIs;
from .fohOpenForProcessIdAndDesiredAccess import fohOpenForProcessIdAndDesiredAccess;
from .fsGetISAForProcessHandle import fsGetISAForProcessHandle;
from .fsGetPythonISA import fsGetPythonISA;
from .fThrowLastError import fThrow... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import dataclasses
import functools
import itertools
import logging
from collections import defaultdict
from dataclasses import dataclass
from textwrap ... |
import unittest
from test.support import cpython_only
try:
import _testcapi
except ImportError:
_testcapi = None
import struct
import collections
import itertools
import gc
import contextlib
class FunctionCalls(unittest.TestCase):
def test_kwargs_order(self):
# bpo-34320: **kwargs should preserv... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... |
#
# Copyright (c) 2018 <NAME>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
import logging
import traceback
import struct # noqa
from binascii import unhexlify, hexlify # noqa
from .const import DATA_TYPE
LOGGER = logging.getLogger('... |
import os
import sys
import torch
import torch.nn as nn
import numpy as np
import time
import logging
import argparse
import autogluon as ag
import dataset_cifar
from torch.utils.data import SubsetRandomSampler
from sklearn.model_selection import StratifiedShuffleSplit
from dataset_cifar import DataIterator, SubsetSamp... |
"""
Unit and regression test for the qm_2019_sss_6 package.
"""
# Import package, test suite, and other packages as needed
import qm_2019_sss_6
# import NobleGasModel.py
import pytest
import sys
import numpy as np
atomic_coordinates = np.array([[0.0, 0.0, 0.0], [3.0, 4.0, 5.0]])
# Derived from user input
number_of_at... |
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
import itertools as iter
from shutil import get_terminal_size
from threading import Thread
import sys
import pathlib
import time
from time import sleep
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[9... |
"""
Evocraft entry
Make sure to run the server first!
Example commandlines for various experiments:
# Default evolutionary novelty search experiment
perform_experiment.py
# Evolutionary novelty search + automated planner
perform_experiment.py --composition --predict
... |
from PyQt5 import QtGui,QtCore,QtWidgets
from PyQt5.QtGui import QColor, QPixmap
from PyQt5.QtCore import pyqtSignal, Qt
from PyQt5.QtWidgets import QMessageBox, QFileDialog
from . import improv_fit
from improv.store import Limbo
from improv.actor import Spike
import numpy as np
from math import floor
import time
impor... |
import ast
from itertools import chain
import kivy
from kivy.config import Config
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.checkbox import CheckBox
from kivy.uix.dropdown import DropDown
from kivy.u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#######################################################
import os
import sys
import codecs
from UDFManager import UDFManager
#######################################################
#
def setupcondition():
# check 'calc_condition.udf' and make it.
findudf()
# Read udf and... |
import json
import random
import sqlite3
from collections import Counter
from pathlib import Path
from typing import Callable
import fastText
import matplotlib.pyplot as plt
import nltk
import numpy as np
import tensorflow as tf
from models.speller.recurrent_speller import RecurrentSpeller
from project_paths import P... |
#----------------------------------------------------------
# File shapekeytransfer.py
#----------------------------------------------------------
#
# ShapeKeyTransfer - Copyright (C) 2018 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... |
#!/usr/bin/env python3
#
# Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import multiprocessing as mp
import os
import pickle
import signal
import time
from typing import Any, Dict, Optional
import zmq
from .controller import (cl... |
# --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
from . import _init_paths
from ycb_render.ycb_renderer import YCBRenderer
from ycb_render.robotPose.robot_pykdl import *
from . import config
... |
# Mrs
# Copyright 2008-2012 Brigham Young University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import logging
import re
from collections import defaultdict
from copy import deepcopy
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ValidationError
from django.db import transaction, IntegrityError
from django.db.mo... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
import random
import subprocess
import sys
import time
from collections import Counter
from sys import exit as _exit
from sys import platform as _platform
import numpy as np
import tensorflow as tf
from sklearn.metrics import accuracy_score, confusion_matrix, f1_sc... |
'''
@function:
@Author: swortain
@Date: 2020-03-02 16:45:38
@LastEditTime: 2020-03-18 00:17:22
'''
import sys
import getopt
import serial.tools.list_ports
import threading
import math
import struct
from SerialComboBox import SerialComboBox
from serial import Serial
import serial.tools.list_ports
import ... |
#!/usr/bin/env python3
# Ryu OpenFlow controller that connects to the Zeek OpenFlow
# framework using Broker.
#
# Start with ./ryu/bin/ryu-manager controller.py
import datetime
import ipaddress
import logging
import time
import re
import ryu.app.ofctl.api
from netaddr import IPNetwork
from ryu.base import app_manage... |
"""Test the APD module."""
from unittest import mock
import aiohttp
from aioresponses import aioresponses
import asynctest
from faker import Faker
from loguru import logger
import pytest
from tenacity import RetryError
from tenacity import stop_after_attempt
from scrapd.core import apd
from scrapd.core.constant impor... |
import chess
import chess.engine
import time
from pyfirmata import Arduino
from TaserChess_Engine import *
import pygame
import pygame.font
from pygame import mixer
import random
import math
pygame.font.init()
mixer.init()
mixer.music.set_volume(0.3)
# Constant Variables
WIDTH, HEIGHT = 1920, 1080
... |
# Graphical interface for signal visualization and interaction with ELEMYO MYOblue sensors
# 2021-09-01 by ELEMYO (https://github.com/ELEMYO)
#
# Changelog:
# 2021-10-04 - serial port connection stability improved
# 2021-09-01 - initial release
# Code is placed under the MIT license
# Copyright (c) 20... |
import numpy as np
import torch
import os
import argparse
import time
from attrdict import AttrDict
from tqdm import tqdm
# from data.dataloader import KittiDataLoader
from data.kitti_dataloader import SingleKittiDataLoader
from script.cuda import get_device, to_device
from script.tools import rel_distribution_to_abs_... |
import betterplotlib as bpl
import matplotlib.patheffects as PathEffects
import matplotlib.patches as patches
from .element import Element, ColorChange
bpl.set_style(font="Avenir", fontweight="medium")
# Element fractions come from <NAME>
# https://science.sciencemag.org/content/363/6426/474
# specifically table S1
... |
# uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: lib.coginvasion.gui.InventoryGui
from direct.showbase.DirectObject import DirectObject
from direct.directnotify.DirectNotify import Dire... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from _polytope_ import Polytope, Face
import utilities as utils
from collections import OrderedDict
import numpy as np
import time
import copy
import convex_adversarial.convex_adversarial as ca
import full_lp as flp
class PLNN(nn.Module):
#TODO: ... |
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""logs_util.py tests.
"""
__author__ = '<EMAIL> (<NAME>)'
import logging
import unittest
from viewfinder.backend.storage.object_store import ObjectStore
from viewfinder.backend.storage.file_object_store import FileObjectStore
from viewfinder.backend.base.testing... |
"""
Utilities for oriented bounding box manipulation and GIoU.
"""
import torch
def box_center_to_corners(b):
"""
Converts a set of oriented bounding boxes from
centered representation (x_c, y_c, w, h, theta) to corner representation (x0, y0, ..., x3, y3).
Arguments:
b (Tensor[N, 6]): boxes to... |
#!/usr/bin/env python
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# This file is a modification of existing CARLA code:
# Copyright (c) 2018 Intel Labs.
# authors: <NAME> (<EMAIL>)
#
# This work is licensed under the terms of the MIT license.
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "S... |
#!/usr/bin/env python
"""It works with a different modification in the moveit config of the KTH
New modification: Changed the parameter in the trajectory_execution.launch.xml"""
from copy import deepcopy
import rospy
from typing import List
from moveit_msgs.msg import *
from moveit_commander import *
from trajector... |
#!/usr/bin/python2.5
#
# Except for the default python packages for python 2.5, this program requires:
# pydot - a python interface for graphviz (which requires the libraries graphviz and networkx)
################################################################################
import sys
import re
import util
import ... |
import json
from functools import reduce
from operator import or_
from urllib.parse import urlencode
from django.conf import settings
from django.contrib.admin.utils import lookup_needs_distinct
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.models import Permission
from django.contrib.au... |
import json
import paramiko
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.views.generic import TemplateView, CreateView, UpdateView, DeleteView
from ran... |
"""
Program: Classes for working with parse graphs
Date: Jan. 31, 2008
Author: <NAME>
Description: This file contains classes and functions for working with
sentence parse graphs. A parse graph can be created from interaction xml.
The nodes can be modified and assigned attributes like weight, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from sensor_msgs.msg import PointCloud2
import sensor_msgs.point_cloud2 as pc2
from std_msgs.msg import Header
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from jsk_recognition_msgs.msg import BoundingBox, BoundingBoxArray
import cv2
import... |
# Copyright (c) 2016-2021 <NAME>
# SPDX - License - Identifier: MIT
from enum import Enum
import functools
import os
from pathlib import Path, PureWindowsPath
import re
import shlex
import shutil
import subprocess
from typing import Optional, Tuple, NamedTuple
from urllib.parse import urlparse, unquote
import urllib.... |
######################################################
# schema
schemaclipboard = None
SCHEMA_WRITE_PREFERENCE_DEFAULTS = [
{"key":"addchild","display":"Add child","default":True},
{"key":"remove","display":"Remove","default":True},
{"key":"childsopened","display":"Childs opened","default":False},
{"k... |
import abc as _abc
import numpy as np
import logging
from sklearn.linear_model.base import SparseCoefMixin
from sklearn.metrics import r2_score, accuracy_score, log_loss
from sklearn.model_selection import train_test_split
from sklearn.utils import check_X_y
from sklearn.preprocessing import StandardScaler
from scipy.... |
#!/usr/bin/env python
"""
tools.py
Part of Dooplicity framework
Includes a class for iterating through streams easily and a few other tools.
The functions which() and is_exe() was taken from
http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python
and is not covered under the license below.
Lice... |
# Copyright 2014 The Oppia 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 ... |
# ===============================================================================
#
# Copyright (c) 2013-2017 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# ===============================================================================
"""
Create... |
#!/usr/bin/env python
# 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... |
from bs4 import BeautifulSoup
from urllib.parse import urlencode, quote_plus, quote
import json
import re
import subprocess
import requests
import time
import os
import datetime
from urllib.request import urlretrieve, build_opener, install_opener, urlcleanup
import socket
import ssl
socket.setdefaulttimeout(3)
opener ... |
import json
from functools import partial
from pathlib import Path
import attr
import torch
import torch.cuda
import torch.nn as nn
import torch.nn.functional as F
@attr.s(slots=True)
class HyperParams:
classes = attr.ib(default=list(range(10)))
net = attr.ib(default='UNet')
n_channels = attr.ib(default=... |
"""Module containing TIE and SITIE reconstruction routines.
Routines for solving the transport of intensity equation; for use with Lorentz
TEM through focal series (tfs) to reconstruct B field magnetization of the sample.
Known Bugs:
- Longitudinal derivative gives a magnetization scaling error for some
experi... |
import pytest
import re
import warnings
import hashlib
import numpy as np
import pandas as pd
import matplotlib as mpl
from matplotlib import pyplot as plt
# import at module level or multiprocessing + pymer4 + rpy2 errors
from pymer4 import Lmer
import fitgrid
from fitgrid import DATA_DIR
from fitgrid.utils.summary ... |
"""Test signatures module
# Notes to the reader
Both in the code and in the docs, we'll use short hands for parameter (argument) kind.
PK = Parameter.POSITIONAL_OR_KEYWORD
VP = Parameter.VAR_POSITIONAL
VK = Parameter.VAR_KEYWORD
PO = Parameter.POSITIONAL_ONLY
KO = Parameter.KEYWORD_ONLY
"""
impo... |
import functools
import json
import math
import numpy as np
import shutil
from svg.path import parse_path, Line, CubicBezier
import xml.etree.ElementTree as ET
FILES = ["HardStandard"]
BPM = 67
BASE_HJ = 1
SNS = {"xmlns": "http://www.w3.org/2000/svg"}
# scale, x, y, z, list[time, name]
MODELS = [
[8, 0, -2, 30,... |
from util import*
import data_handling
from funcs import cluster, classification, misc, models
def parse_arguments(args):
'''Takes in command line arguments and outputs them as a dictionary.
The main argument or "command" is handled by the parser, all subsequent
argument are passed to the corresponding subparser.... |
# -*- coding: iso-8859-15 -*-
import os, re, sys, warnings, xml.etree.ElementTree as ET
import numpy as np, scipy.sparse as sp, scipy.stats as stats
from sklearn.externals import joblib
from unidecode import unidecode
from utils import convert_into_str as _to_str
from utils import convert_into_unicode as _to_unicode... |
import os, glob, random, argparse
import torch, transformers
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as torchdata
import augment
import numpy as np
import pandas as pd
import soundfile as sf
import pytorch_lightning as pl
from pathlib import Path
from typing import List
fro... |
import numpy as _numpy
import math as _math
import pandas as _pd
import datetime as _datetime
import warnings
from apodeixi.util.a6i_error import ApodeixiError
from apodeixi.util.warning_uti... |
# -*- coding: utf-8 -*-
"""
SH bindings to ObsPy core module.
:copyright:
The ObsPy Development Team (<EMAIL>)
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, print_function,
uni... |
# coding: utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import random
import time
from .config import *
from .utils import *
from .uer.utils.tokenizer import *
from .uer.utils.vocab import Vocab
from .uer.model_builder import build_model
from .uer.utils.optimizers import Ad... |
import sympy as sp
import numpy as np
import pandas as pd
import yaml
class SymbolicLMDI:
"""Class to decompose changes in a variable using symbolic matrices
Example input (standard LMDI approach, Residential):
{'variables': ['E_i', 'A_i'],
'LHS_var': 'E_i',
'decomposition': 'A*A_i/A*E_i/A_i'... |
import numpy as np
from reader import DataReader, InstanceData
import copy
ZERO2 = np.zeros((2, 2), dtype='float64')
def sqrtm(mat):
e, p = np.linalg.eig(mat)
e_0, e_1 = e[0], e[1]
if e_0 <= 0.0 and e_1 <= 0.0:
return ZERO2
e0 = 0.0
e1 = 0.0
if e_0 > 0.0:
e0 = np.sqrt(e[0])
... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Klimaat
import os
import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import importlib
import configparser
from scipy.ndimage import map_coordinates
from rnlyss.hyperslab import HyperSlab
from rnlyss.grid import Grid
from rnlyss.psychro im... |
#!/usr/bin/python
import numpy as np
import os
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
from scipy import optimize
__version__ = "0.1.6"
# number of components initially and initial guess values
init_ncomp = 3
max_ncomp = 4
guess = [1700, 700, 1.2, .08, 200, 1.5, .18]
'''
... |
"""
.. interface::interface
Interface container
"""
from typing import Dict, Generator, List, Union, Collection, Tuple, Set, Sequence
import itertools
from toposort import toposort
import redax.spaces as sp
from .spaces import OutOfDomainError
class Interface(object):
r"""Wrapper for translating between con... |
# -*- coding: utf-8 -*-
from random import choice, randint
import logging
logger = logging.getLogger("membership.test_utils")
# Finnish population register center's most popular first names for year 2009
from membership.models import Membership, Contact
first_names = [
u"Maria", u"Juhani", u"Aino", u"Veeti", u"... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, earthians and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import datetime
from hms_tz.hms_tz.utils import validate_customer_created
from frappe.utils import nowdate, nowtime, now... |
import cv2
import os
from math import cos, sin, pi, floor, sqrt, atan
import numpy as np
import pygame
from adafruit_rplidar import RPLidar
import matplotlib.pyplot as plt
import time
"""
# Set up pygame and the display
os.putenv('SDL_FBDEV', '/dev/fb1')
pygame.init()
lcd = pygame.display.set_mode((1280,720))
pygame.m... |
#!/usr/bin/python3
import random;
import countdowntourney;
import htmlform;
import cgicommon
import urllib.request, urllib.parse, urllib.error;
import re
import fixgen
import json
name = "Manual Pairings/Groups"
description = "Player groups are specified manually. A fixture is generated between each pair in a group. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.