text stringlengths 6.04k 39.5k |
|---|
from tqdm import tqdm
import scipy.io
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from skimage import img_as_float
import numpy as np
np.set_printoptions(threshold=np.nan)
def distance(x,y):
return np.sqrt(np.sum((x-y)**2))
plt.ion()
data = scipy.io.loadmat("C:\\Users\\admin\\Dropbox\\hw3\\faceda... |
#
# Project ft
# ftlib4 enthält die allgemeinen Klassen
#
import random
import time
import queue
from math import sqrt
from datetime import datetime
# Definitionen
class Le():
lea = {}
# Kontrolliert Bewegungen in einem FT Zyklus bereichsübergreifend
moved = {}
def __init__(self, leid... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from pyqmri.models.template import BaseModel, constraints
import numexpr as ne
plt.ion()
def _expAttT1b(del_t, del_t_sc, T1b):
return ne.evaluate(
"exp(-(del_t*del_t_sc)... |
# -*- coding: utf-8 -*-
"""
The Change point detection algorithm :cite:`cpd-Messer2014_2027` determines if
a spike train `spiketrain` can be considered as a stationary process (constant
firing rate) or not as stationary process (i.e. presence of one or more points
at which the rate increases or decreases). In case of ... |
# coding=utf-8
# @Author : zhzhx2008
# @Time : 19-7-11
import os
import warnings
import jieba
import numpy as np
from keras import Model
from keras import backend as K
from keras.callbacks import EarlyStopping
from keras.callbacks import ModelCheckpoint
from keras.engine.topology import Layer, Input
from keras.... |
# encoding: utf-8
"""
Test suite for the docx.parts.document module
"""
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from mock import Mock
from docx.opc.constants import CONTENT_TYPE as CT, RELATIONSHIP_TYPE as RT
from docx.opc.package import PartFactory
from docx.opc.pack... |
# RCS14_entrainment_naive.py
# Generate timeseries analysis and power estimate
# Author: maria.olaru@
import os
from matplotlib import pyplot as plt
import numpy as np
import scipy.signal as signal
import pandas as pd
def get_name(gp, out_name_full):
out_plot_dir = gp + '/' + 'plots/'
if not os.path.isd... |
#!/usr/bin/env python
try:
import sys
import os
import threading
import time
import collections
import json
from random import seed, randint
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
from pygame_cards import game_app, controller, deck, card_holder, enums, a... |
import numpy as np
import tensorflow as tf
from wavenet_vocoder.util import sequence_mask
from .mixture import discretized_mix_logistic_loss
class Embedding:
"""Embedding class for global conditions.
"""
def __init__(self, num_embeddings, embedding_dim, std=0.1, name='gc_embedding'):
#Create embedding table
s... |
from pathlib import Path
from typing import IO, TYPE_CHECKING, Dict, Set, Tuple, Union
import ele
import numpy as np
from openff.units import unit
from openff.interchange.components.mdtraj import (
_iterate_angles,
_iterate_impropers,
_iterate_pairs,
_iterate_propers,
_store_bond_partners,
)
from ... |
import copy
import torch
from torch import nn
import transformers
from transformers.modeling_roberta import RobertaPreTrainedModel, RobertaConfig, RobertaModel, RobertaLayer, \
RobertaLMHead
from modules import layers
from modules.modeling_reusable_graph_attention import TransformerDecoder
from general_... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
print("Starting ")
from tkinter import *
from tkinter import filedialog
from tkinter import font
from tkinter import messagebox
from tkinter import colorchooser
from tkinter import messagebox
from tkinter import ttk
from tkinter.ttk import *
try:
from tkinter import *
from tkinter import filedialog
fro... |
import os
import numpy as np
import matplotlib.pylab as plt
import matplotlib
import xlrd
from matplotlib import rcParams
from matplotlib.colors import LinearSegmentedColormap
from matplotlib import cm
def split_data(data):
result = list()
temp = data.split("\t")
for i in range(len(temp)):
if tem... |
#!/usr/bin/env python
"""Contains utilities for use with the Workflow Control Language.
"""
# Notes:
# * position of <<include matters, all includes not processed first
# * includes do not expand wildcards
import sys
import re
import os
from collections import OrderedDict
from importlib import import_module
... |
""" Wrappers for result objects and iterators """
from abc import ABC, abstractmethod, abstractproperty
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
ItemsView,
Iterable,
Iterator,
KeysView,
List,
Optional,
Tuple,
Union,
ValuesView,
overload,
)
from .c... |
"""CUDA target independent of PyCUDA."""
from __future__ import division, absolute_import
__copyright__ = "Copyright (C) 2015 <NAME>"
__license__ = """
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 Sof... |
import PySimpleGUI as sg
import pandas as pd
from functools import reduce
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from math import pi
from pylab import *
def user_input_GUI():
global stock_share_hash, index_hash, chart_num
layout = [
[sg.Text('Please enter Portfolio a... |
import mock
import pytest
import urllib3
from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.urllib3 import patch
from ddtrace.contrib.urllib3 import unpatch
from ddtrace.ext import errors
from ddtrace.ext import http
from ddtrace.pin import Pin
from tests.opentracer... |
import torch
from argparse import ArgumentParser
import os
from utils import data_iterator, get_dataset_finish_by, save_model, load_model, detokenize
from pytorch_pretrained_bert.modeling import BertModel
from tokens_vocab import Vocab
import domains
from optimizer import NoamOpt
from semantic_parser import TSP, BSP
fr... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017-2018 <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 u... |
"""Gym environment for chnging colors of shapes."""
import numpy as np
import torch
import torch.nn as nn
import gym
from collections import OrderedDict
from dataclasses import dataclass
from gym import spaces
from gym.utils import seeding
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mp... |
"""
Copyright (C) 2022 Red Hat, Inc. (https://github.com/Commonjava/charon)
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 a... |
from itertools import product
import random
import sys
sys.path.append(
'/home/rpl/Documents/rasmus/crazyswarm/ros_ws/src/crazyswarm/scripts/perceived-safety-study/utils'
)
from Participant import Participant
from globalVariables import DRONE_START_X, DRONE_START_Y, GOAL_OFFSET_X, GOAL_OFFSET_Y, HEIGHT_OFFSET, PA... |
'''
LDA where priors are defined by Theano function of alpha.
<NAME>
'''
import argparse, logging, os, sys, time
from logging import info, warn, error
import numpy as np
import utils
from utils import timeit, EPS, getLeakyRelu
import opt, mlp
from neural_prior import LdaCounts, NeuralPrior, buildSpriteParams
fro... |
# Copyright 2013-2017 The Meson development team
# Copyright © 2021 Intel Corporation
# SPDX-license-identifier: Apache-2.0
# 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.ap... |
"""Parameters.py - Parameter handling for ruffus pipelines
==========================================================
Reference
---------
"""
import re
import collections
import os
import configparser
import sys
import CGATCore.Experiment as E
import CGATCore.IOTools as IOTools
from CGATCore.Pipeline.Utils impor... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import copy
import itertools
import logging
from typing import List
import torch
import torch.nn as nn
from detectron2.layers import ShapeSpec
from detectron2.modeling import (
BACKBONE_REGISTRY,
RPN_HEAD_REGISTRY,
... |
"""Score-based MCMC samplers"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import jax
import jax.numpy as jnp
import tensorflow_probability as tfp; tfp = tfp.substrates.jax
from tensorflow_probability.python.mcmc.internal import util as mcmc_util
__al... |
from django.test import TestCase, Client
from carbon_calculator.models import Event, Station, Action, Group, Question
from carbon_calculator.views import importcsv
from database.models import UserProfile
from django.db.models import Count
import json
import jsons
import requests
import os
import pprint, sys
from django... |
from anytree import Node, RenderTree, PreOrderIter
import random as rnd
from matplotlib import pyplot as plt
import datetime
# Tic Tac Toe Stats and Game simulator.
# Allows us to estimate for arbitrary grid sizes whether there is a first mover advantage or not.
# Also allows us to estimate which is the best grid refe... |
#!/usr/bin/env python3
#
# Copyright 2019 ROBOTIS CO., LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
#!/usr/bin/env python3
""" Script to generate actuators.json metadata from module.yaml config file(s)
"""
import argparse
import lzma #to create .xz file
import json
import os
import sys
from output_groups_from_timer_config import get_timer_groups, get_output_groups
try:
import yaml
except ImportError as e:
... |
import sys
#sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
import numpy as np
import math
import time
def getDepth(detHeight, detX, detY, height, width):
#detHeight *= 2
#f = 0.28
f = 0.397 #gopro 5
#f = 0.400
ballHeight = 2*7.96
sensorHeight = 0.455 #gopro 5
#sensorHeight = 0.358 #... |
## https://www.freecodecamp.org/news/weekend-projects-sign-language-and-static-gesture-recognition-using-scikit-learn-60813d600e79/
## A Machine Learning pipeline that performs hand localization and static-gesture recognition built using the scikit learn and scikit image libraries http://www.ssreehari.com/Sign-langua... |
#!/usr/bin/env python
from __future__ import unicode_literals
__version__ = "20191123"
__author__ = "<NAME>"
import copy
from collections import defaultdict
import time
import types
class ldtable(object):
def __init__(self, items=None, attributes=None, default_attribute=None,
exclude_attributes... |
"""Event parser and human readable log generator."""
from __future__ import annotations
from collections.abc import Callable, Generator
from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime as dt
import logging
import re
from typing import Any
from sqlalchemy.engine.row impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Soundclim Utilities
Module with functions useful to compile datasets for SoundClim
VERSION 0.2
Created on Feb 2019 (version 0.1)
Updated on May 2019 (version 0.2)
Updated on July 2019 (version 0.3):
bug on batch_feature_rois solved by removing db_range parameter
... |
import pytest
import numpy as np
import mici
SEED = 3046987125
STATE_DIM = 2
N_ITER = 2
N_WARM_UP_ITER = 2
N_CHAIN = 2
@pytest.fixture
def rng():
return np.random.default_rng(SEED)
def neg_log_dens(pos):
return np.sum(pos ** 2) / 2
def grad_neg_log_dens(pos):
return pos
@pytest.fixture
def system(... |
import sys
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from Bio import SeqIO
from six import StringIO
from Bio.SeqUtils.ProtParam import ProteinAnalysis
from Bio.SeqUtils.ProtParam import ProtParamData
from modlamp.plot import helical_wheel
# Protparam scales:
# kd → Kyte & Dool... |
import collections
import json
import sys
import html2text
import requests
import logging
import os
import re
from datetime import datetime, timedelta, timezone
from dateutil.parser import parse
import errno
from tqdm import tqdm
import time
from random import randint
from rich.logging import RichHandler
from rich.con... |
r"""
this is documentation string
it is multiline head
-----------------------------------------------------------------
Escape sequences
-----------------------------------------------------------------
\newline Backslash and newline ignored
\\ Backslash (\)
\' Single quote (')
\" Double quote... |
# import os
# import sys
import shelve
import random
import textwrap
from time import sleep, time
from collections import namedtuple
from bearlibterminal import terminal as term
# sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + '/../')
import spaceship.strings as strings
from .screen_functions import *
... |
import os
import pandas as pd
import numpy as np
import copy
import glob
from mojave import get_mojave_mdl_file
from mojave import download_mojave_uv_fits
from mojave import convert_mojave_epoch_to_float
from mojave import mojave_uv_fits_fname
from uv_data import UVData
from spydiff import import_difmap_model, modelfit... |
#!/usr/bin/env python3
""" Automated processing of spectramax plate-reader data """
import sys
import os
import time
import re
import json
import argparse ## https://docs.python.org/3/library/argparse.html
import yaml
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats
DEBUG = False
# latest github v... |
import io
import subprocess
import unittest
import mock
import time
from imagemounter import FILE_SYSTEM_TYPES
from imagemounter._util import check_output_
from imagemounter.filesystems import UnknownFileSystemType
from imagemounter.parser import ImageParser
from imagemounter.disk import Disk
from imagemounter.volume ... |
import json
from unittest.mock import patch
import pytest
from click.core import ParameterSource # type: ignore
from click.testing import CliRunner
from requests.exceptions import ConnectionError as RequestsConnectionError, ConnectTimeout
from raiden.accounts import KeystoreAuthenticationError, KeystoreFileNotFound
... |
import matplotlib.pyplot as plt
import pydicom
import numpy as np
from skimage.measure import label
import cv2 as cv
from scipy.signal import argrelextrema
from scipy import ndimage
import cv2
try:
from utils.LUT_table_codes import extract_parameters, get_name_from_df
except:
from LUT_table_codes import extra... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 27 19:30:32 2022
@author: <NAME>
"""
from PIL import Image
import numpy as np
from numpy.fft import fftn
from numpy.fft import ifftn
import math
import matplotlib.pyplot as plt
import os
from scipy.optimize import curve_fit
#TODO what is the actual dimen... |
# import xml Elementtree which seems the most suitable way to parse html files and works exactly the same way as for xml files
import xml.etree.ElementTree as ET
import re
import syntok.segmenter as segmenter
import csv
import os
from copy import deepcopy
import re
from src.additional_merge import additional_info
def ... |
# Copyright 2019 NEC 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... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import os
from random import sample
import sys
from typing import Any, List, Optional, Union
impo... |
import glob
import os
from matplotlib.ticker import MultipleLocator
from scipy.stats import norm
import matplotlib as mpl
import matplotlib.pyplot as plt
from numpy import *
# from mpl_toolkits.mplot3d import Axes3D
# import matplotlib.patches as mpatches
mpl.use('Agg')
# TS sampling
def open_tsfile(file_name):
... |
from pyftdi.gpio import GpioSyncController
from pyftdi.gpio import GpioAsyncController
import time
import sys
class BitBangSPI:
def __init__(self, device, SCLK, MOSI, MISO, CS, defaultDirection, defaultState, transactionList, frequency=1e4):
self.device = device
self.SCLK = SCLK
self.MOSI = MOSI
self.MISO = ... |
import json
import logging
import re
import uuid
from string import Template
# Python 2 and 3: urllib compatibility between both versions
try:
from urllib.parse import urlencode, urlparse, parse_qs
except ImportError:
from urllib import urlencode
from urlparse import urlparse, parse_qs
from sequoia import... |
###################################################################################################
#
# PairIdentification.py
#
# Copyright (C) by <NAME>, <NAME> & <NAME>.
#
# Please see the file LICENSE in the main repository for the copyright-notice.
#
#################################################################... |
# -*- coding: utf-8 -*-
"""
Module for GCS destination.
"""
import os
import re
import socket
from contextlib import contextmanager
from multiprocessing import Process
from urlparse import urlparse
import time
from google.cloud import storage, exceptions
from twindb_backup import LOG, TwinDBBackupError
from twindb_... |
'''
Preparing the UKB data - cleaning and filtering
- remove individuals that withdraw consent
- remove individuals with prior CVD
- remove individuals with missing baseline factors
- bring data into long format
'''
# Modules
# =========================================================================================... |
# -*- coding: utf-8 -*-
##
# Copyright 2018 Telefonica S.A.
#
# 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 appl... |
#!/usr/bin/python
# Copyright: (c) 2020, DellEMC
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
... |
# Copyright (c) 2014, Oracle and/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. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
import GPy
import numpy as np
import time
from os import getpid
import pandas as pd
import matplotlib.pyplot as plt
import scipy.spatial as spatial
from scipy import stats
from scipy.special import inv_boxcox
import multiprocessing
import math
# se cargan los datos de entrenamiento
train_data = pd.read_csv('../../GP_... |
from collections import defaultdict
from itertools import chain
import logging
import random
import torch
from tqdm import tqdm
from scripts.dataset_walker import DatasetWalker
from scripts.knowledge_reader import KnowledgeReader
from .utils.data import pad_ids, truncate_sequences
logger = logging.getLogger(__name__... |
from collections import namedtuple
from game.scrabble_box import Rulebook
from game.exceptions import InvalidPlacementError
import sys
# TODO: REMOVE DEBUG STATEMENTS
debug_mode = False
class Player(object):
def __init__(self, id, init_tiles, rulebook, name=None):
while name is None:
name =... |
# Copyright (C) 2014-2017 <NAME>, <NAME>, <NAME>, <NAME> (in alphabetic order)
#
# This file is part of OpenModal.
#
# OpenModal 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, version 3 of the License.
#
... |
# -*- coding: utf-8 -*-
import asyncio
import io
import os
import signal
import subprocess
import sys
import time
from collections import defaultdict
from collections import deque
from copy import deepcopy
from functools import partial
from typing import Any as AnyType
from typing import Awaitable
from typing import Ca... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# NAME: RMpeakfit_3D.py #
# #
# PURPOSE: Fit peak of RM spectra, for every pixel in 3D FDF cube. #
#
# Initial version: <NAME>, ... |
import numpy as np
import pandas as pd
import torch
import warnings
import numba
import rpy2.robjects as robjects
import scipy.integrate as integrate
from dataclasses import InitVar, dataclass, field
from Evaluations.custom_types import NumericArrayLike
def check_and_convert(*args):
""" Makes sure that the given... |
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from pathlib import Path
from collections import defaultdict
import csv
import scanpy as sc
import diffxpy.api as de
import pandas as pd
import anndata
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from scipy.s... |
from __future__ import print_function
import sys, time, sqlite3, string, json
from . import param
def db():
conn = sqlite3.connect('rss.db', 60.0)
conn.row_factory = sqlite3.Row
return conn
def rebuild_v_feed_stats(c):
sql = c.execute("select sql from sqlite_master where name='v_feeds_snr'")
if sql:
c.e... |
# -*- coding: utf-8 -*-
import simpy
import itertools
import numpy as np
from collections import defaultdict
import datetime
from utils import _normalize_scores, _get_random_age, _draw_random_discreet_gaussian, _json_serialize
from config import * # PARAMETERS
from base import *
class Visits:
parks = defaultdic... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import cv2
class VGGGray(nn.Module):
def __init__(self):
super(VGGGray, self).__init__()
self.data_bn = self.__batch_normalization(2, 'data/bn', num_features=3, eps=9.999999747378752e-06, momentum=0... |
# Project Quex (http://quex.sourceforge.net); License: MIT;
# (C) 2005-2020 <NAME>;
#_______________________________________________________________________________
from quex.input.files.specifier.ppt_list import PPTList_Builder
from quex.input.regular_expression.pattern import Pattern_Pr... |
"""Training script"""
import os
import time
import copy
import shutil
import random
import numpy as np
import torch
from sklearn.mixture import GaussianMixture
from data import get_loader, get_dataset
from model import SGRAF
from vocab import Vocabulary, deserialize_vocab
from evaluation import i2t, t2i, encode_data... |
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Email: <EMAIL>
# @Date: 2019-06-04 18:24:29
# @Last Modified by: <NAME>
# @Last Modified time: 2020-02-03 21:42:50
import inspect
import logging
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from ..core import NeuronalBilayerSonophore, Batch
fr... |
#!/usr/bin/python3
# coding=utf-8
"""
考勤机脚本入口
"""
__author__ = 'LCD'
import sys
import win32com.client
from rx.subjects import Subject
from cd_tools import *
import json
import openpyxl
import xlwt
import requests
zk = win32com.client.Dispatch('zkemkeeper.ZKEM.1')
key_am = 'am'
key_pm = 'pm'
... |
import torch
from typing import Union, Mapping, Any
import functools
from xitorch.linalg.linop import LinearOperator
from xitorch.linalg.solve import solve
from xitorch.debug.modes import is_debug_enabled
from xitorch._utils.assertfuncs import assert_runtime
from xitorch._utils.bcast import get_bcasted_dims
from xitorc... |
import json
import os
import re
import typing
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5.QtGui import QFontDatabase
from PyQt5.QtWidgets import (QApplication, QComboBox, QDialog, QHBoxLayout, QLabel,
QLineEdit, QListWidget, QMainWindow, QPushButton,
... |
from __future__ import print_function, division
import copy
import logging
import numpy as np
from scipy.optimize import fmin_l_bfgs_b
__all__ = ["guess_sky", "fit_galaxy_single", "fit_galaxy_sky_multi",
"fit_position_sky", "fit_position_sky_sn_multi",
"RegularizationPenalty"]
def _check_resu... |
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT license.
"""
from __future__ import print_function
from __future__ import unicode_literals
import ctypes
import sys
import os
import traceback
from Crypto.PublicKey import RSA
from Crypto.PublicKey import ECC
from Crypto.Signature imp... |
import time
import asyncio
import multiprocessing as mp
import multiprocessing.synchronize
import random
import heapq
import uuid
from itertools import chain
from typing import Optional
import numpy as np
import dht
from typing import List, Dict
from dht import DHT, DHTNode, get_dht_time
from dht.protocol import DHTP... |
# from ..aerodynamics import np
from .misc import isIterable
from numpy import float64
from os import popen
def csvLineWrite(*obj, sep=',', end='\n'):
line = ''
k = len(obj)
if k == 0: return end
for i,o in enumerate(obj):
Sep = sep
if i == k-1: Sep = ''
if type(o) == float or t... |
'''
Created on 20/01/2014
@author: MMPE
See documentation of HTCFile below
'''
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import zip
from builtins import int
from builtins import str
from future im... |
import discord
from discord.ext import commands
import datetime
import random
import pickle
import json
from quote_db import QuoteDB
from quoted import Quoted
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='%', intents=intents)
spam_horizon = datetime.datetime(year=1000, m... |
import csv
import math
from typing import List, Dict, Optional, Tuple
import numpy as np
import torch
import wandb
from torch import nn, optim
from torch.cuda.amp import GradScaler, autocast
from torch.nn import DataParallel
from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau, CosineAnnealingLR, Cosin... |
#!/usr/bin/env python3
import collections
import glob
import json
import re
import lxml
from lxml.builder import E
import xlsxwriter
def od(**x):
return collections.OrderedDict([(("class" if a == "klass" else a), str(b)) for a,b in sorted(x.items())])
def tei(x):
return '{http://www.tei-c.org/ns/1.0}' + x
d... |
# Copyright 2021 University College London. 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 appl... |
import joulescope
from joulescope.data_recorder import DataRecorder
import signal
import argparse
import time
import sys
import os
import datetime
import logging
import json
import weakref
import numpy as np
# NOTE: Example code in the joulescope library, NOT CREATED BY <NAME>
BASE_PATH = os.path.expanduser('Power... |
import unittest, re, string
import sqlite3 as lite
import logging
logger = logging.getLogger(__name__)
from utils import flatten
def allgrams(text):
tokens = text.split(' ')
return tokens
class GenreTokenizer(object):
"""
Try to tokenize those pesky genre texts.
"""
def __init__(self, method=... |
import re
from typing import Any, Callable, Dict, Iterator, List, Mapping, OrderedDict, Union
import asdf
from asdf import ValidationError
from asdf.schema import _type_to_tag
from asdf.tagged import TaggedDict
from weldx.asdf.extension import WxSyntaxError
from weldx.asdf.tags.weldx.time.datetimeindex import Datetim... |
import numpy
import theano
from theano import tensor
from blocks.bricks import Initializable
from blocks.bricks.recurrent import recurrent, BaseRecurrent
from blocks.bricks.base import lazy, application
from blocks.graph import ComputationGraph
from blocks_contrib.utils import diff_abs, l2_norm_cost
floatX = theano.c... |
# coding: utf-8
# Copyright (c) 2016 <NAME> <<EMAIL>>
# License: MIT (see LICENSE file)
import os
import csv
import time
from micropayment_core import util
from micropayment_core import keys
from micropayment_core import scripts
from picopayments_cli import etc
HISTORY_FIELDNAMES = [
'timestamp',
'handle',
... |
from typing import Iterable
import bpy
from bpy.types import Armature, Context, EditBone, Object
from ..maps.bones.heads import HeadMap
from ..maps.bones.rolls import RollMap
from ..maps.bones.tails import TailMap
from ..ops.body_group import BodyGroup
def add_bone(armature: Armature, bone_name: str, head: list, ta... |
# MIT License
# Copyright (c) 2017 <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... |
# mcu.py
# a comprehensive library for communicating with the MATE OQBot.
# please read docs/packet_structure.md and docs/command_list.md for more information.
# there is a CLI for testing available at mcu_cli.py. read docs/mcu_cli.md for usage.
import serial
import struct
import time
import threading
from queue impor... |
# Copyright 2021, Robotec.ai sp. z o.o.
#
# 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 i... |
# ------------------------------------------------------------------------------
# Portions of this code are from
# CornerNet (https://github.com/princeton-vl/CornerNet)
# Copyright (c) 2018, University of Michigan
# Licensed under the BSD 3-Clause License
# -------------------------------------------------------------... |
# PYTHON PASSWORD VAULT
# ========================================================================================================
# The Python Password Vault is an AES-256 Encrypted Database in which you can store your passwords
# The Vault uses 3 seperate salts that are conn... |
import warnings
import numpy as np
from GPy.models import GPRegression
from GPy.kern import Matern32
from sklearn.preprocessing import StandardScaler
from scipy.optimize import minimize
from scipy.special import erfc
from scipy.stats import norm
class OptimisationResult(object):
def __init__(self, other=None):
... |
from tkinter import *
from tkinter import messagebox
import logging
logging.basicConfig(level='WARNING')
class Square(Canvas):
''' Acts as a square in the checker board,'''
def __init__(self, x, y, master, colorback, colorcir=None):
Canvas.__init__(self,master,width=80,height=80,bg=colorback,\
bd=5,relief... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.