text stringlengths 6.04k 39.5k |
|---|
import os
import numpy as np
from gym import utils, error
from gym.envs.robotics import rotations, hand_env
from gym.envs.robotics.utils import robot_get_obs
try:
import mujoco_py
except ImportError as e:
raise error.DependencyNotInstalled(
"{}. (HINT: you need to install mujoco_py, and also perform t... |
import sys
import os
import time
import importlib
import argparse
import numpy as np
import torch
from torch import nn, optim
from data import SupervisedTextData
from modules import VAE, SemisupervisedVAE
from modules import LSTMEncoder, LSTMDecoder
from logger import Logger
clip_grad = 5.0
decay_epoch = 2
lr_decay... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file was part of pyunicorn --
# Unified complex network and recurrence analysis toolbox.
#
# Copyright (C) 2008--2013 <NAME> and pyunicorn authors
# Authors (this file):
# <NAME> <<EMAIL>>
#
# URL: <http://www.pik-potsdam.de/members/donges/software>
# Mail: <N... |
import unittest
import numpy as np
from ibllib.atlas import (BrainCoordinates, cart2sph, sph2cart, Trajectory,
Insertion, ALLEN_CCF_LANDMARKS_MLAPDV_UM, AllenAtlas)
from ibllib.atlas.regions import BrainRegions
def _create_mock_atlas():
"""
Instantiates a mock atlas.BrainAtlas for ... |
# Copyright 2020 Dragonchain, Inc.
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
# 6. Tr... |
"""
Trajectories
--------
This part of the package provide convenient utilities to manage trajectories.
A :class:`~means.simulation.trajectory.Trajectory` object is generally a time series
containing the values of a given moment (e.g. mean, variance, ...) over a time range.
Trajectories are typically returned by simul... |
import os, sys
print('Globals library imported')
class AttributeKey:
KW_API = 'api'
KW_EXTENSION = 'extension'
KW_DEPENDENCY = 'dependency'
KW_LIST = 'list'
KW_UPDATE = 'update'
GLOBALS_API_LIST = f'{KW_API}.{KW_LIST}'
API_EXTENSION = f'{KW_API}.{KW_EXTENSION}'
UPDATE_GLOBALS = f'{K... |
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2021 <NAME> / project 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 limitation t... |
# --------------------------------------------------------
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
import ray
from core.utils import *
from core.replay_memory import BaseMemory
import datetime
import os
import IPython
from tensorboardX impor... |
# distutils: language = c
import itertools
import os
from operator import itemgetter
from typing import Any, Callable, List, Optional, Tuple
import numpy as np
import plotly.express as px
from dtw import dtw
from dtw.stepPattern import StepPattern
from fastcluster import linkage
from joblib import Parallel, delayed
f... |
# -*- coding:utf-8 -*-
'''
从项目中抽取license相关信息
'''
import re
import os
rootDir = os.path.dirname(__file__) + "/"
unDir = rootDir + '/unzips/'
outputDir000 = rootDir + '/output/'
outputDir = rootDir + '/output/pros/'
DIR = outputDir
checked_repos_list = []
finished_pac_list = []
ex_pac_list = []
def acquire_run_hist... |
# coding: utf-8
import copy
import datetime
import re
from abc import ABC, abstractmethod
from . import _common
_KEY_TIMESTAMP = _common.KEY_TIMESTAMP
_KEY_STATEMENT = _common.KEY_STATEMENT
# keys for internal processing
_KEY_DATE = "date"
_KEY_TIME = "time"
class _HeaderParserBase(ABC):
_date_keys = ["year",... |
'''
This module provides functions for plotting strain
'''
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.text import Text
from pygeons.plot.ivector import disable_default_key_bindings
from pygeons.plot.ivector import without_interactivity
from pygeons.plot.ivector import one_sigfig
from pygeons.pl... |
import collections
import os
import pathlib
import sys
import munch
import pickle
import numpy as np
import pandas as pd
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layers import LSTM, Dense, BatchNormalization, Masking
... |
#
# @Author: kuroitu (2020)
# @email: <EMAIL>
#
import os
import numpy as np
from ..dual import *
##########
# 配列ユーティリティ関数 array-utility function
#######
def ndim(obj):
return np.ndim(obj.re)
def shape(obj):
return np.shape(obj.re)
def size(obj):
return np.size(obj.re)
def is_symmetry(obj):
o... |
import re
from datetime import datetime
from PIL import Image, ImageDraw, ImageFont
from dateutil.parser import parse
from flexget import db_schema
from flexget.manager import Session
from loguru import logger
from matplotlib.font_manager import findfont, FontProperties
from sqlalchemy import Column, String, Integer, ... |
import os
import pydart2 as pydart
import numpy as np
from math import exp, pi, log
from PyCommon.modules.Math import mmMath as mm
from random import randrange, random
import gym
import gym.spaces
from gym.utils import seeding
import PyCommon.modules.Resource.ysMotionLoader as yf
import itertools
def exp_reward_term... |
from unicorn import *
from unicorn.arm_const import *
import ctypes
import os
import sys
from os import path
from .exit import do_exit
from .models import timer
native_lib = None
mmio_cb_wrapper = None
timer_cb_wrapper = None
timer_cb_user_data = None
# just like unicorn does we need to keep references to ctype cb ob... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
LED Helper
Collection of LED functions for Micropython boards like BE32-01 and others
"""
from machine import Pin
import neopixel
import _thread
import time
# custom packages
# typing not natively supported on MicroPython
from .typing import Union
class Led(objec... |
# imports
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
import numpy as np
from matplotlib.animation import FuncAnimation
import matplotlib.gridspec as gridspec
import os
import time
from manipulate_readinuvot import uvot
import scipy
from scipy.interpolate import interp1d
import matplot... |
from discord.ext import commands
import discord
import aiohttp
import rs3clans
from typing import Optional
import datetime
import json
from bot.bot_client import Bot
from bot.cogs.raids import time_till_raids
from bot.utils.tools import right_arrow, has_any_role
from bot.utils.checks import is_authenticat... |
import json
import numpy as np
from scipy.special import wofz
from scipy.special import gamma as tgamma
from scipy.constants import m_p as pmass_kg
from scipy.constants import e as qe
from scipy.constants import c as clight
pmass = pmass_kg*clight**2/qe
from xobjects import JEncoder
"""
19/10/2021: add test attribu... |
import sys
import gym.spaces
import itertools
import random
import numpy as np
import tensorflow as tf
import torch
import torch.nn as nn
import math
from tqdm import tqdm
sys.path.append("./../")
from logger import Logger
from collections import namedtuple
from dqn_utils import *
OptimizerSpec = name... |
# Python
# author: Orange
# Phone: 17802005679
# Date: 2021.5.18
import argparse
from torch._C import Value
import torch.backends.cudnn as cudnn
from xlsxwriter import workbook
from models.experimental import *
from utils.datasets import *
from utils.utils import *
import dlib
import os
import sys
original_path = os... |
"""Evaluation
"""
from collections import defaultdict as dd
import logging
import math
import sys
import subprocess
import codecs
import numpy as np
import os
import dynet
from toolkit.joint_ner_and_md_model import MainTaggerModel
from utils import eval_script, iobes_iob, eval_logs_dir
from utils.loader import... |
# === Start Python 2/3 compatibility
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future.builtins import * # noqa pylint: disable=W0401, W0614
from future.builtins.disabled import * # noqa pylint: disable=W0401, W0614
# === End Python 2/3 compatib... |
from collections import namedtuple
import requests.exceptions
import pytest
import gitlab
import repobee_plug as plug
import _repobee
from _repobee import exception
import constants
class Group:
"""Class mimicking a gitlab.Group"""
_Members = namedtuple("_Members", ("create", "list"))
_Member = namedt... |
import os
import numpy as np
import pytest
import torch
from skimage.metrics import peak_signal_noise_ratio as ski_psnr
import ignite.distributed as idist
from ignite.exceptions import NotComputableError
from ignite.metrics import PSNR
from ignite.utils import manual_seed
def test_zero_div():
psnr = PSNR(1.0)
... |
"""Interfaces to data from specific instruments
"""
import logging
import numpy as np
import pandas as pd
import re
import xarray
from .exceptions import SourceNameError
from .reader import DataCollection, by_id, by_index
log = logging.getLogger(__name__)
MAX_PULSES = 2700
def _guess_axes(data, train_pulse_ids):
... |
import math
from functools import partial
import torch
import torch.nn.functional as F
from torch import nn, einsum
from lie_transformer_pytorch.se3 import SE3
from einops import rearrange, repeat
from lie_transformer_pytorch.reversible import SequentialSequence, ReversibleSequence
# helpers
def exists(val):
r... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2021 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function
try:
import sys
sys.dont_write_bytecode = True
try:
__import__("lib.utils.versioncheck") # this has to be the first n... |
# General
import numpy as np
import random
from collections import defaultdict
import networkx as nx
import sys
import time
# Pytorch
import torch
# Our Methods
sys.path.insert(0, '..') # add config to path
import config
import subgraph_utils
#######################################################
# Triangular Rando... |
import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
def entropy_loss(x):
b = F.softmax(x, dim=1) * F.log_softmax(x, dim=1)
b = -1.0 * b.sum()
return b
def train(i_epoch,
filter, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 27 18:08:24 2017
@author: christopher
"""
import sys
from scipy import *
import matplotlib.pyplot as plt
Calculate500 = True
def dragLossUpToAltitude(altitude):
"""gives the drag loss up to the given altitude"""
if 0 <= altitude and alti... |
"""Object wrappers for working with Unreal Engine installations."""
# Future Standard Library
from __future__ import annotations
# Standard Library
import glob
import json
import logging
import os
import subprocess # nosec
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Union
try:... |
import numpy as np
import torch
import random
from nltk.translate.bleu_score import sentence_bleu
import os
from metric import get_bleu, get_recall
import torch.nn.functional as F
import datetime
import csv
class _INFER(object):
def __init__(self, vocab_obj, args, device):
super().__init__()
self.... |
__docformat__='reStructuredText'
__author__ = '<NAME>, <EMAIL>'
__all__ = ['NormApproxMu', 'NormApproxC', 'MAP', 'NormApprox']
from .Node import ZeroProbability
from .Model import Model, Sampler
from numpy import zeros, inner, asmatrix, ndarray
from numpy import reshape, shape, arange, ravel, log, Inf
from numpy.rand... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: train_tdnn.py
@Time: 2019/9/19 上午11:42
@Overview: Todo: extract fbank24 for vox1 and train TDNN
"""
from __future__ import print_function
import random
import time
import torch.nn as nn
import torch
import pat... |
import re
import pytest
from hypothesis import assume, given, example
from hypothesis.strategies import characters, text
from ics.grammar import Container, ContentLine, ParseError, QuotedParamValue, escape_param, string_to_container, unfold_lines
CONTROL = [chr(i) for i in range(ord(" ")) if i != ord("\t")] + [chr(0... |
import enum
import hashlib
import json
import requests
import sqlalchemy as sql
import typing
import urllib.parse
import app.common.utils as utils
import app.database as db_module
import app.database.user as user_module
db = db_module.db
safe_request_get_json = utils.ignore_exception(Exception, None)(lambda l: reques... |
import json
import pkgutil
import importlib
from time import gmtime, strftime
import six
import theano
import numpy as np
from six.moves import cPickle as pickle
import neupy
from neupy.utils import asfloat
from neupy.core.docs import shared_docs
from neupy.layers.utils import extract_connection
__all__ = (
'sa... |
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as tdata
import pandas as pd
from tqdm import tqdm
from scipy.special import softmax
from c3pO.utils import coverage_size, sort_sum
def get_logits_targets(model, loader):
logits = torch.zeros((len(loader.data... |
import numpy as np
import networkx as nx
import scipy as sp
from sklearn import ensemble
from sklearn.metrics import mean_squared_error
import math
import multiprocessing as mp
import sys
import os
path1 = "ORC PLB IDM 2007/train_graphs/"
path2 = "ORC PLB IDM 2007/test_graphs/"
if not os.path.exists(pa... |
"""
Handling connection to the research database containing data from PDMS.
"""
import datetime as dt
import functools
import psycopg2
import sqlalchemy
from psycopg2 import sql
import pandas as pd
def cur_conn_wrapper(func):
@functools.wraps(func)
def decorated(*args, **kwargs):
args[0].init_cur_co... |
import argparse
from datetime import datetime
import glob
import io
import itertools
import logging
import os
import re
import sre_constants
import sys
import warnings
from configparser import (
ConfigParser,
RawConfigParser,
NoOptionError,
)
from bumpversion import __version__, __title__
from bumpversion.... |
import math
import os
from copy import copy
from functools import partial
import torch
from easydict import EasyDict
from einops import rearrange
from slowfast.models import stem_helper
from slowfast.models.attention import MultiScaleBlock
from slowfast.models.utils import round_width
from torch import nn
from torch.n... |
import time
import os
import inspect
import glob
import yaml
import importlib
import gym
try:
import pybullet_envs
except ImportError:
pybullet_envs = None
from gym.envs.registration import load
from stable_baselines.deepq.policies import FeedForwardPolicy
from stable_baselines.common.policies import FeedForw... |
import time
import re
import logging
from selenium.common.exceptions import NoSuchAttributeException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import MoveTargetOutOfBoundsException
from selenium.webdriver.suppor... |
"""Module for creating Cloudnet ice particle effective radius file using Z-T method."""
from collections import namedtuple
from typing import Optional
import numpy as np
from numpy import ma
from cloudnetpy import output, utils
from cloudnetpy.categorize import atmos
from cloudnetpy.datasource import DataSource
from ... |
from collections import OrderedDict
from pathlib import Path
from unittest.mock import Mock
import pytest
from pyfomod import fomod, installer
def test_installeroption():
test_option = fomod.Option()
test_option.name = "name"
test_option.description = "description"
test_option.image = "image"
te... |
# -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, <NAME> <<EMAIL>>
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... |
#!/usr/bin/env python
###GENERIC
import pandas as pd
import os,sys
from pathlib import Path
import logging
logging.basicConfig(format='%(asctime)s %(levelname)-7s %(message)s',
stream=sys.stderr, level=logging.DEBUG)
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WARNING)
... |
import json
import operator
import time
from collections import OrderedDict
from datetime import datetime
from vkwave.bots import DefaultRouter, SimpleBotEvent, \
simple_bot_message_handler, PayloadFilter
from config import get_db
from keyboards.kb import menu, boss_kb
from mpets import MpetsApi
from sql import c... |
# Data loading based on https://github.com/NVIDIA/flownet2-pytorch
import numpy as np
import torch
import torch.utils.data as data
import os
import random
from glob import glob
import os.path as osp
from RAFT.core.utils import frame_utils
from RAFT.core.utils.augmentor import FlowAugmenter, SparseFlowAugmenter
from ... |
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import pylab
from skimage import measure
import os
from scipy.optimize import curve_fit
import pandas as pd
import time
import sys
import MDAnalysis
"""
Use the Director parameters (n) to distinguish if the lipid is in the ... |
from collections import OrderedDict
from typing import List
import torch
import torch.nn.functional as F
from torch import nn
from .common import EncoderModule, make_n_channel_input, _take
__all__ = ["HRNetV2Encoder18", "HRNetV2Encoder34", "HRNetV2Encoder48"]
HRNETV2_BN_MOMENTUM = 0.1
def hrnet_conv3x3(in_planes... |
##
# @file process.py
# @package openmoc.process
# @brief The process module provides utility functions for processing of
# OpenMOC simulations.
# @details This module provides downstream data processing capabilities for
# OpenMOC simulations, such as storing and retrieving simulation
# statepo... |
import os
import sys
import json
import time
import logging
import data_helper
import numpy as np
import tensorflow as tf
import math
from model import seq2CNN
from tensorflow.contrib import learn
from sklearn.model_selection import train_test_split
def count_words(count_dict, text):
'''Count the number of occurre... |
# Batchable Classifier based on Inception and Tensorflow Slim
# @<NAME> @Yt Su
from models import dataset_utils
from models import imagenet
from models import inception_preprocessing
from models import inception_v4 as inception4
from models import inception_v3 as inception3
from models import inception_v2 as inception... |
# -*- coding: utf-8 -*-
"""Main module for MPTools.
This module is largely based on Pame<NAME>'s MPTools project and is
subject to the following licence.
MIT License
Copyright (c) 2019, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation... |
from typing import (
Callable,
Dict,
Hashable,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
Union,
)
import numpy as np
import torch
import torch.nn as nn
from toolz.dicttoolz import valmap
from torch.utils.data import DataLoader, Dataset, random_split
import swyft
import swyft.utils
... |
"""
inventory
"""
from __future__ import absolute_import, division, print_function
import contextlib
import json
import logging
from mcedit2.command import SimpleRevisionCommand
from mcedit2.util.mimeformats import MimeFormats
from PySide import QtGui, QtCore
from PySide.QtCore import Qt
from mcedit2.widgets.item... |
from functools import reduce, lru_cache
import extinction
import hashlib
import lcdata
import numpy as np
import sncosmo
"""This file contains instrument specific definitions."""
band_info = {
# Information about all of the different bands and how to handle them. We assume
# that all data from the same teles... |
""" Veracity Identity API
It is not possible to use the Microsoft authentication library (msal) or the Azure
identity package (azure.identity) to authenticate with Veracity because they do not
direct to the correct login page. This is because they lack the policy query parameter.
Instead, this package constructs... |
import unittest
from unittest import mock
from unittest.mock import MagicMock
from clovars.scientific import (
CellSignal,
ConstantCellSignal,
EMGaussianCellSignal,
GaussianCellSignal,
get_cell_signal,
SinusoidalCellSignal,
StochasticCellSignal,
StochasticSinusoidalCellSignal,
)
class... |
#Written by <NAME> <<EMAIL>>
about = \
"""
Integrate - Alpha
Instructions:
1) Set parameters on right:
o Select button to indicate whether peak is from Carbon, Nitrogen, or Sulfur
o Input sample weight(default is 2500 mg)
o Input correction factor, deri... |
import json
import os
import pickle
import sys
import keras
from keras.preprocessing.sequence import make_sampling_table
from keras.preprocessing.sequence import skipgrams
import numpy as np
import pandas as pd
import utils
#os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # for Tensorflow cpu usage
#os.environ["CU... |
import cv2
import time
import datetime
import pyautogui
import numpy as np
import os, os.path
from PIL import Image
from settings import PASSWORD, NAME
############
# Settings #
PAUSE_TIME = 1.5
TIMING_MULT = 1.5
CLOSENESS_THRESHOLD = 0.8
ROLLS_FOLDER = 'rolls'
############
pyautogui.PAUSE = PAUSE_TIME
pyautogui.FAIL... |
from pathlib import Path
from typing import List, Tuple, Dict
import json
from lxml.etree import fromstring, Element
from random import shuffle
import celery
from tqdm import tqdm
from transformers import AutoTokenizer, BatchEncoding, ByT5Tokenizer
from .xml2labels import CodeMap
from .encoder import XMLEncoder
from .c... |
# Utilities for the NN exercises in ISTA 421, Introduction to ML
from __future__ import print_function
import numpy as np
import math
import visualize
import matplotlib.pyplot as plt
# -------------------------------------------------------------------------
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def deriv... |
import time
import unittest
import os
import sys
import site
ai4_dir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
site.addsitedir(ai4_dir)
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras.layers import Dense, Input
from sklearn.datasets import make_classificatio... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... |
import numpy as np
import gym
from gym import utils
from gym import spaces
from meta_mb.envs.cassie.assets.cassiemujoco import CassieSim, CassieVis, pd_in_t, state_out_t, CassieState
from meta_mb.logger import logger
# CASSIE_TORQUE_LIMITS = np.array([4.5*25, 4.5*25, 12.2*16, 12.2*16, 0.9*50]) # ctrl_limit * gear_rat... |
#!/usr/bin/env python3
# molmass_web.py
# Copyright (c) 2005-2021, <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:
#
# 1. Redistributions of source code must retain the above copyright not... |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 24 17:59:20 2017
@author: amirbitran
Various functions that serve to compute the contacts matrix for a series of PDB snapshots
"""
import numpy as np
import glob
#from matplotlib import pyplot as plt
import sklearn
from sklearn import metrics
def read_PDB(file, atom... |
#!/usr/bin/env python3
"""Deploy WDL to Terra.
"""
import argparse
import csv
import collections
import concurrent.futures
import contextlib
import copy
import functools
import glob
import gzip
import io
import json
import logging
import multiprocessing
import operator
import os
import os.path
import pathlib
import r... |
# Copyright 2022 IBM Corporation
#
# 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, ... |
#!/usr/bin/env python3
import argparse
import logging
import os
import stat
import subprocess
import sys
import time
import yaml
import paramiko
'''
{config_agent: {name: RiftCA, type: riftca}, init_config: {7cceec3f-b29d-42e2-ab7c-0f4e44bcbfd0: {},
ad92b819-d459-4c93-826d-b1d850d44b88: {}, c7a93b87-b419-4f50-aa73... |
import os
import datetime
import geopandas as gpd
import folium
import streamlit as st
import geemap.foliumap as geemap
from datetime import date
from .rois import *
@st.cache
def uploaded_file_to_gdf(data):
import tempfile
import os
import uuid
_, file_extension = os.path.splitext(data.name)
fil... |
import numpy as np
import pandas as pd
from scipy.io import loadmat
from borsar.utils import find_range
from .utils import group, extend_slice
# TODOs:
# - [ ] create_middle_events should be made more universal
def din_dataframe(eeg):
'''
Turns DIN1, DIN2, ... channels of an egi file
into a dataframe with latenc... |
import numpy as np
import pandas as pd
import os
from rasterstats import point_query
from shapely.geometry import Point
from scipy.interpolate import CubicSpline
from sklearn.linear_model import RANSACRegressor, LinearRegression
import matplotlib.pyplot as plt
from .WaveForm import waveForm
from .utils import *
class ... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
"""
Definition for the FiducialInfo NGA modified RDE/AFRL labeling object
"""
__classification__ = "UNCLASSIFIED"
__authors__ = "<NAME>"
from typing import Optional, List
import logging
import numpy
from sarpy.io.xml.base import Serializable
from sarpy.io.xml.descriptors import IntegerDescriptor, SerializableDescri... |
from tools import assure_decimal
from decimal import Decimal
class Shape:
def __init__(self, line_cap=2, line_join=2, miter_limit=4):
self.set_line_cap(line_cap)
self.set_line_join(line_join)
self.set_miter_limit(miter_limit)
def line_cap(self):
return self._line_cap
def s... |
# -*- coding: UTF-8 -*-
import magento
from collections import defaultdict
import logbook
from trytond.model import ModelSQL, ModelView, fields
from trytond.transaction import Transaction
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval
from decimal import Decimal
__all__ = [
'Category', 'M... |
#!/usr/bin/env python
# coding: utf-8
# # Topology optimization using the SIMP method
#
# This numerical tour investigates the optimal design of an elastic structure through a topology optimization approach. It consists in finding the optimal distribution of a material in a computational domain which minimizes the co... |
from scipy import stats
import time
import numpy as np
import pickle
from Pipeline.CBASS_L1_AddPhaseRandomizedSignal import AddPhaseRandomizedSignal
from Pipeline.CBASS_L1_GetTrough import GetTrough
from Pipeline.CBASS_L2_PartitionTrough import PartitionTrough
def Main_DetectEvents(db2LFP, inSampleRate, cBAND, cSTA... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# +
imp... |
import os, sys, math
import numpy as np
from .env.xsim_manager import XSimManager
from .env.communication_service import CommunicationService
from .env.env_runner import EnvRunner
from .agent.env_cmd import CmdEnv
from .render import RenderBridge
from .converter import Converter
from .endgame import EndGame
from UTILS.... |
# coding=utf-8
# Copyright (C) 2020 NumS Development 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/LICENSE-2.0
#
# Unless required by applicable... |
#
# Based on Gramps model.py
#
from django.db import models
from GenealogyViewer.apps.web.models import FamilyTree
#from django.contrib.contenttypes.models import ContentType
#from django.contrib.contenttypes import generic
#from gramps.gen.lib.date import Date as GDate, Today
#from gramps.gen.utils.id import creat... |
import os
import time
import math
import pickle
import logging
import pandas as pd
import numpy as np
import torch
import scipy.stats
from torch.optim.lr_scheduler import CosineAnnealingLR
from holoclean.dataset import Dataset
from pyvacy.pyvacy.analysis import comp_epsilon
from synthesizer.kamino import hc_repair
fr... |
#!/usr/bin/env python
# coding:utf-8
__version__ = '1.0'
import sys
import os
import sysconfig
sys.path += [os.path.abspath(os.path.join(__file__, '../packages.egg/%s' % x)) for x in ('noarch', sysconfig.get_platform().split('-')[0])]
import gevent
import gevent.server
import gevent.timeout
import gev... |
import os
import random
import numpy as np
import pandas as pd
from geopandas import GeoDataFrame as Gdf
import warnings
from itertools import repeat
import cea.config
import cea.inputlocator
import cea.utilities.parallel
from cea.constants import HOURS_IN_YEAR, MONTHS_IN_YEAR
from cea.datamanagement.schedule_helper... |
# First Party
# Standard Library
import json
import re
from builtins import Exception, dict, hash, sorted, str
from datetime import datetime
from smdebug.core.logger import get_logger
from smdebug.profiler.utils import (
TimeUnits,
convert_utc_datetime_to_microseconds,
convert_utc_datetime_to_nanoseconds,
... |
import itertools as it, operator as op, functools as ft
from collections import namedtuple, defaultdict, OrderedDict
import os, sys, re, csv, math, datetime, enum
try: import pytz
except ImportError: pytz = None
from . import utils as u, types as t
log = u.get_logger('gtfs')
@u.attr_struct(vals_to_attrs=True)
cla... |
import yaml
import copy
import rospy
import tf2_ros
import tf2_geometry_msgs
from math import sin, cos, pi
from tf.transformations import *
from interbotix_common_modules import geometry as g
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import TransformStamped, Quaternion, Pose, PoseSta... |
"""
Markdown parser to render the Biostar style markdown.
"""
import re
import inspect, logging
from functools import partial
import mistune
import requests
from xml.sax.saxutils import unescape
from django.shortcuts import reverse
from django.db.models import F
import bleach
from bleach.linkifier import Linker
from bl... |
"""
MIT License
Copyright (c) 2018-2019 <NAME>
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, merge, publish, d... |
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
# matplotlib.rcParams['ps.useafm'] = True
# matplotlib.rcParams['pdf.use14corefonts'] = True
# matplotlib.rcParams['text.usetex'] = True
matplotlib.use('Agg')
import matplotlib.pyplot as plot
import numpy
from rvs import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.