text stringlengths 6.04k 39.5k |
|---|
"""This is a helper which provides a set of definitions and Actors
that can be used to run external commands and gather responses from
them.
Create a RunCommand Actor and send it a Command object defining the
command to be run; the RunCommand will execute the command, monitoring
its progress, and sends a CommandResult... |
import numpy as np
import random
from sklearn.neighbors import KNeighborsClassifier
import timeit
from . import heuristics
from ..io import portie
import sys
def baco(x_data, y_data, t_percent=40, heu_meth="method_1", ml_alg="knn1", iter_num=10):
(my_bool, msg_err) = check_baco_args(t_percent, heu_meth, ml... |
'''
############ TRADING BOT #############
This bot gets the signal via webhook from TradingView and executes the trades in Alpaca
'''
import alpaca_trade_api as tradeapi
import requests, json
import time, re
import os
import pandas as pd
import datetime as dt
import logging
from datetime import datetime
... |
# ------------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# Code written by <NAME>.
# ------------------------------------------------------------
# Testing Script for quantitative evaluations
# Inputs:
# - single view ... |
import itertools
import networkx as nx
def get_animate_words():
animate_words = set(line.strip() for line in open('../animacy/animate.unigrams.txt', 'r', encoding='utf8'))
animate_words.update({"i", "me", "myself", "mine", "my", "we", "us", "ourself", "ourselves", "ours", "our",
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2... |
'''
Module for parsing chip types
'''
import os
import re
import subprocess
import copy
import math
from .chipinfo import params, aliases
#TODO: Need to incorperate by-chip functions
# TrimDat (eccTools.py)
# analyze_cal_re (cal.py)
# analyze_cal_noise_data (cal... |
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import (
ModelComposed,
cached_property... |
import torch
from flask import Flask, request, send_from_directory, send_file, jsonify
from flask import Response
import jsonrpcserver
from jsonrpcserver import methods
import json
from flask_cors import CORS
import time
import datetime
import math
import random
import hashlib
import os
import os.path as p... |
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md
import warnings
from types import SimpleNamespace
import torch
from torch import nn
from torch.nn import Upsample a... |
"""
Utilities for stamping PDF files.
Here 'stamping' loosely refers to adding small overlays (QR codes, text boxes,
etc.) on top of already existing content in PDF files.
The code in this module is also used by the :mod:`.sign` module to render
signature appearances.
"""
import uuid
from binascii import hexlify
fro... |
import enum
from os import name
from typing import List, Dict, Optional, Tuple
import torch
from torch import nn, einsum
from einops import rearrange, repeat
from comvex.vit import ViTBase
from comvex.utils import FeedForward, PathDropout, ProjectionHead, PatchEmbeddingXd
from comvex.utils.helpers import name_with_ms... |
import os
import time
from typing import Any, Tuple
import pytest
from requests.exceptions import HTTPError
from autouri.autouri import AutoURI, URIBase
from autouri.httpurl import HTTPURL, ReadOnlyStorageError
from autouri.s3uri import S3URI
from .files import (
common_paths,
make_files_in_dir,
recurse_... |
import pyqtgraph as pg
import numpy as np
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import os
import pickle
from regions import Regions, CRTFRegionParserError
from PyQt5.QtGui import QDesktopServices
class roi_dialog(object):
def __init__(self, img_size, cfreqs):
self.world = False
s... |
#!/bin/python
# -*- coding: utf-8 -*-
import warnings
import os
import time
import tqdm
import numpy as np
import pandas as pd
import scipy.stats as ss
import scipy.optimize as so
from scipy.special import gammaln
from grgrlib.core import timeprint
from grgrlib.stats import mode
def mc_error(x):
means = np.mean(... |
"""
This should be rewritte with vispy but I don't have time now...
"""
from .myqt import QT
import pyqtgraph as pg
from matplotlib.path import Path as mpl_path
import numpy as np
import pandas as pd
import itertools
from .base import WidgetBase
from .tools import ParamDialog
from ..tools import median_mad, get_nei... |
from git import (
Repo
)
from tempfile import (
mkdtemp
)
from subprocess import (
PIPE,
Popen
)
from os.path import (
join,
isfile,
isdir,
abspath,
dirname
)
from shutil import (
copyfile,
copytree,
rmtree
)
from time import (
time
)
from matplotlib import (
pypl... |
"""Rectangular open channel flow over an inclined bed with friction. (4 min)
The case is described in "Shallow Water and Navier-Stokes SPH-like numerical
modelling of rapidly varying free-surface flows", <NAME>, Doctoral
dissertation, University of Parma, pp 99-103 (2010).
"""
import os
# Numpy
from numpy import (on... |
#!/usr/bin/env python3
import re
import sys
import os
import argparse
import logging
import itertools
import collections.abc
from collections import defaultdict
from lxml import etree
# Typing
import io
from typing import Sequence, Mapping, Iterator, Generic, AbstractSet, Callable
from typing import Any, List, Tuple... |
# coding: utf-8
# ## 3.6 Lab - Linear Regression
# ### 3.6.1 Libraries
# In[1]:
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmodels.sandbox.regression.predstd import wls_prediction_std
fr... |
import bokego.go as go
import os
from math import sqrt
from tqdm import trange
import numpy as np
import pandas as pd
import torch
from torch.distributions.categorical import Categorical
from torch.utils.data import Dataset, DataLoader
from torch.nn.modules.utils import _pair
from torch.nn.parameter import Parameter
im... |
#! /usr/bin/env python
import logging
import threading
import time
import traceback
from urllib import urlopen
from autopyfactory.interfaces import WMSStatusInterface, _thread
from autopyfactory.info import WMSStatusInfo
from autopyfactory.info import WMSQueueInfo
from autopyfactory.info import SiteInfo
from autopyf... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# @file phasespace.py
# @author <NAME> (<EMAIL>)
# @date 25.02.2019
# =============================================================================
"""Implementation of the Raubold and Lync... |
import re
from torch.utils.data import Dataset
import json, os
from tqdm.autonotebook import tqdm as tqdm
import torch
import numpy as np
import random
import pickle
class LanguasitoTokenizer:
def __init__(self, no_space_language=False):
self._no_space_language = no_space_language
def __call__(self, ... |
import os
import struct
import subprocess
from copy import copy
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
class Chunk:
__header_size = 8
header = None
data_position = -1
fd = None
def __init__(self, file):
initial_pos = file.tell()
self.header = fil... |
#!/usr/bin/env python3
import logging
import numpy as np
import tensorflow as tf
import pygame
from abc import ABC
from abc import abstractmethod
from termcolor import colored
from time import sleep
logger = logging.getLogger("game_ac_network")
class GameACNetwork(ABC):
"""Actor-Critic Network Base Class."""
... |
#!/usr/bin/python3
import phue
import json
import random as rng
import time, datetime
from Repeater import repeater, time_delta # Timed effects
import argparse #Accept cli arguments
import sys #Accept cli arguments
from copy import deepcopy # Copy dicts
BRIDGES = {
'Bridge1' : {'ip': '<ip>', 'uname': '<username>'},... |
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
from datetime import datetime, timedelta
from flask import request, redirect, render_template, url_for, abort, flash, g, session
from flask import current_app, make_response, send_from_directory
from flask.views import Metho... |
import os
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import os
def getRewardsSingle(rewards, window=1000):
moving_avg = []
i = window
while i-window < len(rewards):
moving_avg.append(np.average(rewards[i-window:i]))
i += window
moving_avg = np.array(movi... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 14 15:30:59 2017
@author: lbechberger
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.path import Path
import matplotlib.patches as patches
from matplotlib.widgets import RadioButtons, CheckButtons
from collections import deque... |
import glob
import os
from copy import deepcopy
from typing import Any, Dict, Optional
from unittest.mock import patch
from uuid import UUID, uuid1, uuid4
import pytest
from django.core.exceptions import ImproperlyConfigured
from openapi_tester import (
OPENAPI_PYTHON_MAPPING,
CaseError,
DocumentationErro... |
""" test automol.geom
"""
import numpy
import automol
from automol import geom
C2H2CLF_GEO = (('F', (2.994881276150, -1.414434615111, -0.807144415388)),
('C', (1.170155936996, 0.359360756989, -0.513323178859)),
('C', (-1.201356763194, -0.347546894407, -0.3408392500119)),
('... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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
import sys
import numpy as np
start_time = time.time()
marker = 1
node = {}
local_skyline = {}
candidate_skyline = []
global_skyline = []
shadow_skyline = {}
virtual_point = {}
why_not_points = {}
n_updated_flag = {}
data_length = 0
t = 5
rsl = []
safe_region = []
number_of_preference = 0
customer_... |
# -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ 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 r... |
# Internal
import tkinter as tk
import subprocess
import asyncio
import os
from time import localtime, strftime
# Ext
import webbrowser
# User Defined
from screen_translate.JsonHandling import JsonHandler
from screen_translate.LangCode import *
from screen_translate.Mbox import Mbox
from screeninfo import get_monitor... |
#!/usr/bin/env python3
'''
Web UI for the ICS SDN-based IDS.
'''
import os
import sys
import json
import base64
import threading
import signal
import time
import collections
import netaddr
import cherrypy
import sdnids
import pyonos
class MissingArgumentException(Exception):
'''Simple exception to indicate missin... |
# Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""Linear models based on Torch library."""
from copy import deepcopy
from typing import Sequence, Callable, Optional, Union
import numpy as np
import torch
from log_calls import record_history
from scipy import sparse
from torch import nn
from torch import optim
from ...tasks.losses import TorchLossWrapper
from ...... |
import math
import numpy as np
from pydmfet import qcwrap,tools,libgen
def subocc_to_dens_part(P_ref, occ_imp, occ_bath, dim_imp, dim_bath):
dim = dim_imp + dim_bath
P_imp = np.zeros([dim,dim], dtype=float)
P_bath = np.zeros([dim,dim], dtype=float)
for i in range(dim):
if(i < dim_imp):
... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD (3-clause)
from __future__ import division
from os import path as op
import numpy as np
from scipy.linalg import pinv
from math import factorial
from .. import pick_types, pick_info
from ..io.constants import FIFF
from ..forward._compute_forward... |
import random
import constants as C
import exceptions as e
class Booster:
def __init__(self, img, income1=False, income2=False,
special=False, vp=False):
self.img = img
self.income1 = income1
self.income2 = income2
self.special = special
self.vp = vp
... |
# Copyright 2022 OpenMined.
#
# 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/python3
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
from tkinter.filedialog import *
import tkinter.messagebox
import pymysql
from PIL import Image, ImageTk, ImageGrab
from hyperlpr import *
import cv2
import threading
from threading import Thread
import lib.img_function as predict... |
############################################################################
# Copyright (c) 2015-2017 Saint Petersburg State University
# Copyright (c) 2011-2015 Saint Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
##################################################################... |
"""
Created on Wednesday Jan 16 2019
@author: <NAME>
@github: https://github.com/s3yyy3d-m
"""
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "7"
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn import manifold, datasets
import random
i... |
import os
import matplotlib.pyplot as plt
import time
import random
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data.sampler import RandomSampler, SequentialSampler
from globalbaz import args, DP, device
from dataset import *
from models import *
from test import *
from... |
import sys
import os
import json
import pickle
import argparse
import glob
import math
import numpy as np
import time
import traceback
from tqdm import tqdm
from collections import defaultdict
from graphviz import Digraph
import bisect
from denoising_event_lm.utils.utils import read_data
def get_all_doc_spans(doc_l... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import time
import dask
import dask.dataframe as dd
import multiprocessing
import os
import logging
import scipy.stats as stats
import bisect
from wistl.config import unit_vector_by_bearing, angle_between_unit_vectors
class Tower(object):
"""
class... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2016 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this ... |
#!/usr/bin/env python3
'''
The classes produced by ImageItem are the various types of items that can be
installed into an image. The compiler will verify that the specified items
have all of their requirements satisfied, and will then apply them in
dependency order.
To understand how the methods `provides()` and `req... |
# ==============================================================================
# Authors: <NAME>
#
# Python functions: A streaming VHDL parser
#
# Description:
# ------------------------------------
# TODO:
#
# License:
# ========================================================================... |
'''
@Author: KnightofLuna
@Project Link: https://github.com/KnightofLuna/sokoban-solver
@Modified by: Zhao
@Date: 2021.3.31
'''
import sys
import collections
import numpy as np
import heapq
import time
class PriorityQueue:
"""Define a PriorityQueue data structure that will be used"""
def __init__(self):
... |
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import matplotlib.pyplot as plt
from py_wake.rotor_avg_models.rotor_avg_model import gauss_quadrature, PolarGridRotorAvg, RotorCenter, \
polar_gauss_quadrature, EqGridRotorAvg, GQGridRotorAvg, CGIRotorAvg
from py_wake.tests import npt
import numpy as np
from py_wake.examples.data.iea37._iea37 import IEA37Site, IEA3... |
# coding: utf-8
'''
equiv.py
Construct each of the .beleq files, given a particular dataset.
This involves gathering all the terms and determining whether
or not there are existing terms that refer to the same thing.
Terms are either then equivalenced to something else, or given
a new uuid.
'''
import uuid
im... |
import re
def OR(*lst):
return "(" + "|".join(lst) + ")"
QV = r"_q\.v\._"
ETC = r"&c\."
CAP_WORD = r"\*?[A-ZÞȜ\-][a-zéþȝ()<>\- ]*-?"
MULTI_CAP_WORD = OR(
"<NAME>",
"<NAME>",
)
HEADWORD = fr"#({CAP_WORD}|{MULTI_CAP_WORD})#(, #{CAP_WORD}#)*"
HEADWORD_REF = fr"({CAP_WORD}(, {CAP_WORD})*)"
pos = [
r"1... |
"""This module contains backend core classes like Backend and BackendAgent.
The concrete backends like tfagent or baselines are implemented in seprate modules.
"""
from abc import ABC, ABCMeta, abstractmethod
from typing import List, Optional, Tuple, Type, Dict
import datetime
import gym
import os
import shutil
im... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
#!/usr/bin/env python
# Intended for Python2
#"""
# /etc/browserConfig/ must be created with the
# correct files placed within it for this to work
# properly.
#
# * /etc/browserConfig/style.css
#"""
import sys
import config
import re
from PyQt5.QtWidgets import (
QApplication,
QMainWindow,
QWi... |
#! /usr/bin/env python3
"""
Copyright (c) 2010 - 2020, ETH Zurich, Computer Engineering Group
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copy... |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,too-many-instance-attributes, too-many-arguments
"""
Copyright 2019 <NAME>
Copyright 2015 <NAME>.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.readthedocs.org
Supporting book at:
https://github.com/rlabbe/Kalman-and-Baye... |
#pip install websocket-client
import websocket
from random import random, shuffle, randint
from ast import literal_eval as literal
from multiprocessing import Process
from threading import Thread
from datetime import datetime
from statistics import mode
import logging
import time
import json
# Solid State Drive (SS... |
import torch
import numpy as np
import time
import os
import csv
import cv2
import argparse
import glob
import os
import warnings
import cv2
import geopandas as gpd
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import rasterio
import torch
import torchvision.transforms as T
from lib.BoundingB... |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
############### is proportional in parse!
import gevent
from gevent import monkey
import itertools
from urllib.parse import urljoin
import copy
from utils import flatten, get_json, get_xpath, parse_cell, sanitize, split
monkey.patch_all()
class BaseCrawler(object):
... |
"""
A Pangeo Forge Recipe
"""
import logging
from abc import ABC, abstractmethod
from contextlib import contextmanager
from dataclasses import dataclass, field
from typing import Callable, Dict, Hashable, Iterable, NoReturn, Optional
import fsspec
import xarray as xr
import zarr
from rechunker.types import MultiStage... |
#!/usr/bin/env python3
#
# Copyright 2016-2017 Games Creators Club
#
# MIT License
#
import time
import traceback
import pyroslib
NAME = "fine driver service"
TOPIC = "finemove"
WHEEL_CIRCUMFERENCE = 15.0 # 15mm
DELAY = 0.50
STRAIGHT = 1
SLANT = 2
SIDEWAYS = 3
MODE_NOTHING = 0
MODE_STARTING = 2
MODE_DRIVING = 3... |
"""OAuth 2.0 WSGI server middleware providing MyProxy certificates as access tokens
"""
__author__ = "<NAME>"
__date__ = "09/12/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "<EMAIL>"
__revision__ = "$Id$"
import htt... |
import colorsys
from enum import Enum
import numpy as np
import pybullet as p
import time
import typing
p.connect(p.GUI)
p.setGravity(0, 0, -10)
p.setRealTimeSimulation(0)
p.setTimeStep(1 / 1000)
test_case = 1
rigid_body = False
apply_force_torque = True
apply_force_local = True
apply_torque_local = True
if test_ca... |
# Collision Detection Cars and Pedestrians
# <NAME>, <NAME>
# July 10, 2018
import os, sys
sys.path.append("..")
from math import cos, sin
from components.pedestrian import Pedestrian
from components.car import KinematicCar, DynamicCar
import assumes.params as params
import numpy as np
# input center coords of car to... |
import io
import json
import os
import threading
import time
from datetime import datetime
from multiprocessing import cpu_count
from random import shuffle
import bson
import numpy as np
import tensorflow as tf
from queue import Queue
from skimage.data import imread
from model import get_model_vgg16
THREADS = cpu_co... |
import numpy as np
from radynpy.utils import voigt_H, gaunt_bf_h, hydrogen_absorption, hydrogen_bf_profile
import struct
import os
here = os.path.dirname(os.path.abspath(__file__)) + '/'
# Almost everything in here is a verbatim translation of the Radyn IDL routines
# supplied by <NAME>, many improvements could be mad... |
from typing import List, Tuple, Any
import os
import numpy as np # type: ignore
import random
import torch
from torch.utils.data import Dataset
from matplotlib.colors import to_rgba # type: ignore
from matplotlib import pyplot as plt # type: ignore
from matplotlib.lines import Line2D # type: ignore
from sklearn.da... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 24 20:20:03 2022
@author: d4kro
"""
#%%-----------0. loading package-----------------------------------------------
import pandas as pd
import numpy as np
import scipy.sparse
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.... |
#!/usr/bin/env python
import threading
import time
import math
import roslib; roslib.load_manifest('optnav_fcs')
import rospy
import tf
from tf.transformations import euler_from_quaternion, quaternion_from_euler
import std_msgs.msg
import nav_msgs.msg
from dji_sdk.dji_drone import DJIDrone
import dji_sdk.msg
impor... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# Author : <NAME>
# Version : 3.7.1
import cv2
import numpy as np
import serial
import datetime
import time
# 데이터를 저장할 위치(서버저장)
store_location = "C:/Data_Record"
accum = 0 # 누적 판독
OK = 0
NG = 0
check_year = 0
check_month = 0
check_day = 0
def nothing(x):
pass
def leave_log(serialnum, OK, NG):
global che... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) IBM Corporation 2019
#
# 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
#
# U... |
#!/usr/bin/python
#
# jvm-blocking-monitor.py Monitor JVM threads and prints stacktraces for long blocking threads.
# For Linux, uses BCC, eBPF.
#
# USAGE: jvm-blocking-monitor.py [-h] [-p PID | -u | -k] [-U | -K]
#
# Copyright 2021 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License")
#... |
"""
pyrad.io.read_data_cosmo
========================
Functions for reading COSMO data
.. autosummary::
:toctree: generated/
cosmo2radar_data
cosmo2radar_coord
get_cosmo_fields
read_cosmo_data
read_cosmo_coord
_ncvar_to_dict
_prepare_for_interpolation
_put_radar_in_swiss_coord
"... |
#!/usr/bin/env python2.7
"""
generate files to deploy libvirt vms and nws, possibly in a docker environment
"""
from __future__ import print_function
import logging
import os
import shutil
import sys
import shlex
import argparse
from copy import deepcopy
from enum import Enum
from lxml import etree
import argh
from a... |
# -*- coding: utf-8 -*-
import scipy as sp
def make_oct_cqt_kernel(fmax, n_bins, fs, q=1.0, atom_hop_factor=0.25, thr=0.0005, window='blackmanharris', perf_rast=False):
"""
CQTのKernel設計(Klapuri CQT用)
"""
def nextpow2(i):
# n = 2
# while n < i:
# n = n * 2
n = int(s... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
from astroplan import Observer
from astropy.coordinates import SkyCoord
from astropy.time import Time
import astropy.units as u
import observesim.wea... |
from __future__ import print_function
from .prox_fn import ProxFn
from proximal.lin_ops import CompGraph, mul_elemwise
import numpy as np
import numexpr as ne
from proximal.utils.utils import Impl, fftd, ifftd
from scipy.sparse.linalg import lsqr, LinearOperator
from proximal.halide.halide import Halide
class sum_squ... |
import os
import random
import pygame as _
from pygame.constants import *
# Constants
FPS = 60
COLORS = {
"white": (255, 255, 255)
}
STATE = {
"AppIsRunning": True,
"IsPaused": False,
"IsGameOver": False,
}
INPUTS = {
"up": False,
"down": False,
"left": False,
"right": False,
"fi... |
"""
postgresql:
sudo -u postgres psql
list dbs: \l
use a db: \c dbname
list tables: \d
quit: \q
"""
# TODO: deal with companies without tickers in the story, e.g.
# https://www.reuters.com/article/us-sprint-m-a-t-mobile/trump-advisor-touts-sprint-t-mobile-deal-while-denying-lobbying-idUSKBN1L01R4
# Trump advisor t... |
""" Take the output from do-like-javac (dljc) and turn this into an argfile for
javac.
"""
import json
import argparse
import os
import path_utils as putils
import re
import readline
import os_utils as otils
def setup_args():
""" Setup commandline arguments
Returns
-------
object containing args
... |
"""
The ``sde`` module contains functions to fit the single diode equation.
Function names should follow the pattern "fit_" + fitting method.
"""
import numpy as np
from pvlib.ivtools.utils import _schumaker_qspline
# set constant for numpy.linalg.lstsq parameter rcond
# rcond=-1 for numpy<1.14, rcond=None for nu... |
import os
import sys
import pandas as pd
from Bio import SeqIO
import matplotlib.pyplot as plt
import matplotlib as mpl
import scipy.stats as st
import random as rnd
#
#
from matplotlib.ticker import MaxNLocator
from matplotlib.patches import ConnectionPatch
from matplotlib.patches import Rectangle
from matplotlib.tick... |
#!/usr/local/bin/python2.6 -tt
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (... |
import hashlib
import json
from itertools import chain
import logging
from typing import List, Optional, Dict, Any, Union
import time
from enum import Enum
import uuid
import boto3 # type: ignore
from bugout.data import BugoutSearchResults, BugoutSearchResult
from bugout.journal import SearchOrder
from ens.utils impo... |
"""
Reliable and extremely fast kernel density estimator for one and two-dimensional
samples.
The kernel density estimations here are kept as simple and as separated from the rest
of the code as possible. They do nothing but kernel density estimation. The
motivation for their partial reimplementation is that the exist... |
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import numpy as np
import argparse
import time
from tensorboardX import SummaryWriter
import torch
import torch.nn as nn
from torchvision import datasets
import torchvision.transforms as transforms
from torch.autograd import Variable
from lfads import LFADS... |
"""create_index_docs.py
Merge information from different views and export JSON files that can be loaded
into ElasticSearch.
Usage:
$ python create_index_docs.py -d DATA_DIR -f FILELIST (-b BEGIN) (-e END)
Directories:
lif LIF files created from the OCR output
top topics
spl sentence splitting
pos parts of s... |
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2022 <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 res... |
import json
import argparse
import os
import re
import textwrap
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
FONT_FILE = os.path.join(os.path.dirname(__file__), 'templates/fonts/Seagull-Medium.otf')
def clean_disc_string(string):
# replace <br> with line break
cleaned_string = re.sub('<br>', '\n'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# fileame: test.py
import os
import sys
import time
import re
from datetime import datetime
from collections import OrderedDict
import logging
import requests
import sqlite3
import pymongo
# import smtplib
# from email.mime.text import MIMEText
# from email.utils import f... |
import math
import os
import logging
from micropsi_core.world.world import World
from micropsi_core.world.worldadapter import WorldAdapter
from micropsi_core.world.worldobject import WorldObject
from micropsi_core.world.island import png
class Island(World):
""" A simple Doerner Island-World"""
supported_wor... |
# The MIT License (MIT)
# Copyright (c) 2021 by the xcube development team and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation... |
"""
This module module provides functionality to load data
from a container into memory in chunks.
"""
import gc
import random
import numpy as np
import audiomate
from audiomate import containers
from audiomate.utils import units
class PartitioningContainerLoader:
"""
Load data from one or more containers ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.