text stringlengths 6.04k 39.5k |
|---|
# %%
import os
from pickle import TRUE
import time
from tqdm import tqdm
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import numba as nb
from collections import defaultdict
import sys
class actions:
north = 0
east = 1
south = 2
west = 3
_dict = {0: "N"... |
"""
Discussion API serializers
"""
from typing import Dict
from urllib.parse import urlencode, urlunparse
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.urls import reverse
from rest_framework import serializers
from common.djangoapps.student.models impor... |
# pylint: disable=invalid-name, global-variable-undefined, broad-except
"""
Utility classes and functions used in MODIS processing chain.
Author: <NAME>, April 2019
"""
from __future__ import absolute_import, division, print_function
from array import array
import ctypes
import datetime
import multiprocessing
import ... |
# Copyright 2019-2021 Cambridge Quantum Computing
#
# 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 a... |
"""Train a classifier on the Kaggle DSB2017 dataset"""
import random
import numpy as np
import os
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import keras
import keras.backend as K
import keras.callbacks
from keras.layers import Input, Conv3D, MaxPool3D, Lambda, Flatten, Dropout, Dense, Batc... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 25 11:06:28 2020
@author: <NAME>
"""
#Import AB data
import pandas as pd
x_ab = pd.read_csv('x_ABdata.csv')
x_ab = x_ab.values
y_ab = pd.read_csv('y_ABdata.csv', header = None)
y_ab = (y_ab.values).flatten()
#Import IWT data
iwt = pd.read_excel('TurgeonetalData.xlsx')... |
"""
This is a light version of SAGA: https://github.com/PQShield/SAGA
"""
# Estimators for moments
from scipy.stats import skew, kurtosis, moment
# Statistical (normality) tests
from scipy.stats import chisquare
# Distributions
from scipy.stats import chi2
# Numpy stuff
from numpy import cov, set_printoptions... |
from __future__ import absolute_import
from __future__ import unicode_literals
from .endpoints import CollectionView, GeoCollectionView
from flask import Response, jsonify, request
from flask_classy import route
import requests
import dpath.util
import io
import logging
import json
import six
from .auth import Teams
fr... |
import numpy as np
from math import log
import tensorflow as tf
class Video:
def __init__(self,max_length,B):
# max_length: total seconds in the video
self.sequences=[[list(), 0.0,0,list()]]
self.index_tracker={}
self.max_length=max_length
self.exclusive_beam_size=B
class ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 14:50:26 2020
@author: lars
"""
import os, glob
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import distance
from scipy.sparse.csgraph import minimum_spanning_tree
from datetime import datetime
impor... |
# Copyright(c) 2019-2020 Association of Universities for Research in Astronomy, Inc.
#
# astromodels.py
#
# This module contains classes and function to interface with the
# astropy.modeling module.
#
# New Model classes to aid with image transformations:
# Pix2Sky: allows modification of a WCS object as a FittableMode... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 17 00:41:04 2019
@author: Connor
"""
import tkinter
#from tkinter import *
from tkinter.ttk import *
import numpy as np
import random
import pickle
import operator
import copy
root = tkinter.Tk()
root.title("Pegs")
root.geometry('500x310')
'''File wit... |
#!/usr/bin/env python3
import molgrid
import numpy as np
import pandas as pd
from scipy.stats import pearsonr, spearmanr, kendalltau
import os
from argparse import Namespace
from glob import glob
import torch
def get_stats(epoch, pred_ddg, actual_ddg, pred_abs, actual_abs):
try:
r_ddg, _ = pearsonr(np.a... |
#!/usr/bin/python
import random
import sys
from datetime import datetime
import math
import re
import string
import collections
import os
def CapIt(s):
if not s.startswith('^'):
return '^' + s
return s
def UnCapIt(s):
return s.replace('^', '')
# Make first letter of string a capital letter
# Igno... |
import logging
from types import MethodType
from scapy.all import ByteEnumField
from scapy.all import ByteField
from scapy.all import ConditionalField
from scapy.all import Field
from scapy.all import FieldListField
from scapy.all import FlagsField
from scapy.all import lhex
from scapy.all import Packet
from scapy.all... |
# CommentSniper created by Travus on Dec. 12th 2018
from os import mkdir, path # For checking if key files exists.
from sys import exit # For graceful shutdown if crucial exception raised.
from urllib import request, error as urllib_error # For interacting with YouTube API.
from concurrent import futures # Fo... |
from __future__ import annotations
# dh import
try:
from dh.rdfdh import RDFDH
from dh.dhutil import gen_batch, get_rho_from_dm_gga, restricted_biorthogonalize, hermi_sum_last2dim
except ImportError:
from pyscf.dh.rdfdh import RDFDH
from pyscf.dh.dhutil import gen_batch, get_rho_from_dm_gga, restricted_... |
import numpy as np
import pytest
import itertools
from tensornetwork.block_sparse.utils import (flatten, fuse_stride_arrays,
fuse_ndarrays, fuse_degeneracies,
_find_best_partition,
_... |
#-------------------------------------------------------------------------------
# Name: lxtools
# Purpose: Helper library for baboonstack
#
# Author: <NAME>
#
# Created: 02.08.2013
# Copyright: (c) Litixsoft GmbH 2014
# Licence: Licensed under the MIT license.
#-------------------------------... |
import datetime
from itertools import cycle
from zoneinfo import ZoneInfo
import aiosqlite
import discord
from discord.ext import commands, tasks
from stringmatch import Match
import utils.time
from utils.ids import (
BGChannelIDs,
BGRoleIDs,
GuildIDs,
TGChannelIDs,
TGLevelRoleIDs,
... |
import core
from core.movieinfo import TheMovieDatabase
from core.library import Metadata, Manage
from core import searcher, snatcher
import cherrypy
import threading
import os
import json
import logging
logging = logging.getLogger(__name__)
api_version = 2.9
''' API
All methods output a json object:
{'response': t... |
import argparse
import itertools
import json
import os
import re
from collections import Counter
import pandas as pd
from spacy.tokens import Doc
import spacy
from tqdm import tqdm
from pig.data import SPLIT_SPEC
DATA_DIR = "data/out/180x100/"
REALIGNED_DATA_DIR = "data/out/realign/"
DATA_EVAL_DIR = "data/eval/"
F... |
#!/usr/bin/python3
#
# Maintainer: <EMAIL> / www.jeffskinnerbox.me
# Version: 0.4.1
#
# USAGE:
# python3 app.py -s picamera - using pi camera and no trace messages
# Source: "People Counter" series of blog by <NAME>
# http://www.femb.com.mx/people-counter/people-counter-9-counting/
#
import os
... |
import os
import glob
import pytest
from copy import deepcopy
import numpy as np
import becquerel as bq
import lmfit
SAMPLES_PATH = os.path.join(os.path.dirname(__file__), "samples")
# TODO: use these for fitting actual data
SAMPLES = {}
for extension in [".spe", ".spc", ".cnf"]:
filenames = glob.glob(os.path.joi... |
import numpy as np
from PIL import Image, ImageDraw
import os
import random
from tqdm import tqdm
from Detection.AdvancedEAST import cfg
def shrink(xy_list, ratio=cfg.shrink_ratio):
if ratio == 0.0:
return xy_list, xy_list
diff_1to3 = xy_list[:3, :] - xy_list[1:4, :]
diff_4 = xy_list[3:4, :] - xy_l... |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import logging
import numpy as np
import numpy.ma as ma
import warnings
from .lapjv import lapjv
from .utils.progress import pprogress
log = ... |
import itertools
from collections import defaultdict
from enum import Enum
from typing import Union, Tuple
import numpy as np
from g2o import SE3Quat
from scipy.spatial.transform import Rotation as Rot
import map_processing.graph as graph
from map_processing.graph_utils import camera_to_odom_transform, se3_quat_avera... |
import os
from sortedcontainers import SortedDict
import numpy as np
import collections
import constants
def loadNeuronProps(filename):
with open(filename) as f:
lines = f.readlines()
labels = lines[0].rstrip().split(",")
isSlice = "tissue_depth_low" in labels # rename tissue_depth
... |
from __future__ import print_function
import timeit
import cProfile as profile
import math
import numpy as np
import warnings
warnings.filterwarnings("ignore")
from parampy import Parameters,SIUnitDispenser,Quantity,SIQuantity,Unit, UnitDispenser, Units, errors
###################### UNIT TESTS ####################... |
# -*- coding: UTF-8 -*-
from unidecode import unidecode
from stdnum import es
def unidecode_str(s):
if isinstance(s, bytes):
s = s.decode('utf-8')
return unidecode(s)
class VAT:
def __init__(self, vat):
self.vat = vat
@staticmethod
def clean_vat(vat):
"""
Return... |
"""
Functional tests for Pydocweb: these go through real-use patterns with
the Django web client.
"""
import os, sys, re
from django.test import TestCase
from django.conf import settings
PASSWORD='<PASSWORD>'
class AccessTests(TestCase):
"""
Simple tests that check that basic pages can be accessed
and th... |
import datetime
from timeit import default_timer
import click
import numpy as np
import networkit as nk
from python_scripts.utils.utils import file_to_dict,run_graclus,write_new_sorted_cluster_dict
from python_scripts.utils.sql_utils import get_cursor_client_dict
def get_cluster_info_dict(cursor, table_name, graph,... |
# Copyright (c) 2020, 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
from dragonphy import Directory
import yaml, os
import kratos
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import importlib.util
from pathlib import Path
class Node:
def __init__(self, sources, sinks):
self._edges = {}
self._edges['sources'] = sources
self._edges['si... |
from machine import Pin, I2C, ADC, PWM, deepsleep
from math import floor
from time import sleep
import utime
import sys
import gc
gc.collect()
#import esp
#esp.osdebug(None) # Turn off vendor O/S debugging messages
#esp.osdebug(0) # Redirect vendor O/S debugging messages to UART(0)
debug = True
aux1 = Pin(32, Pi... |
"""
Make dask workers using condor
"""
from __future__ import absolute_import, division, print_function
import atexit
import collections
import errno
import itertools
import logging
import os
import tempfile
import time
import distributed
import tornado
import htcondor
import classad
if not hasattr(htcondor, 'Submi... |
# Copyright © 2014-2018 <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 restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... |
#!/usr/bin/python3
import os
import sys
import time
import subprocess as sub
import re
import shutil
import argparse
import datetime
import collections
import distutils.core
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
SCRIPT_DIR = os.path.dirname(os.path.re... |
"""Routines for updating the state of a node.
"""
import datetime as dt
import logging
import os
import re
import time
import peewee as pw
from peewee import fn
from . import acquisition as ac
from . import archive as ar
from . import config, db
from . import storage as st
from . import util
log = logging.getLogger... |
# app.py
import os
from telegram import Update
from telegram.ext import Updater, CommandHandler, MessageHandler, \
Filters, CallbackContext, ConversationHandler, Defaults
from uuid import uuid4
import logging
# Local Imports
import config
from create_db import Session, Tokens
from ipfs_util import create_ipfs, pi... |
from os import chdir
from pathlib import Path
from random import choice, randint
from typing import Union
import discord
from discord import Activity, ActivityType, Role, Member
from discord.ext import commands, tasks
from vk_api import VkApi
from vk_api.exceptions import ApiError, Captcha
from commands.poll import P... |
""" Code file to create functions used throughout the module """
import pickle
import numpy as np
import os
import glob
import math
import random
import time
import cv2
import datetime
import pandas as pd
from typing import Any, Dict, List, Tuple, Iterable
from sklearn.model_selection import train_test_split
from kera... |
"""Some dataset or transform utils adapted from MindSpore."""
from PIL import Image
import os
import numpy as np
from mindspore.dataset.vision import Inter
from mindspore.dataset import GeneratorDataset
from mindspore import communication as dist
augment_error_message = "img should be PIL image. Got {}. Use Decode() ... |
# coding = utf-8
'''
'''
import re
from copy import deepcopy
import numpy as np
from mykit.core.bandstructure import BandStructure
from mykit.core.cell import sym_nat_from_atoms
from mykit.core.dos import Dos
from mykit.core.log import Verbose
from mykit.core.numeric import Prec
from mykit.core.utils import conv_str... |
#!/usr/bin/env python3
#coding=utf-8
"""
AMI PFAT Extract
AMI BIOS Guard Extractor
Copyright (C) 2018-2020 <NAME>
"""
print('AMI BIOS Guard Extractor v3.0')
import sys
# Detect Python version
sys_ver = sys.version_info
if sys_ver < (3,7) :
sys.stdout.write('\n\nError: Python >= 3.7 required, not %d.%d!\n' % (sys_v... |
import os
import math
import numpy as np
import cv2
import time
from detection import extract_red, extract_yellow, extract_gray, extract_orange, extract_black, extract_white
import pygame
from pygame.locals import QUIT
class Cube:
def __init__(self,
input_image,
... |
import os
import argparse
import tqdm
import torch
import numpy as np
import yaml
from anomaly_detection.utils.loggers import Logger
from anomaly_detection.dpa.pg_networks import ProgGrowStageType, NetworkType
from anomaly_detection.piad.latent_dis import LatentDiscriminator
from anomaly_detection.dpa.pg_decoders impo... |
"""
Module containing utility functions - for the regression task of predicting xi_hat -
of train module.
"""
import ast
import copy
import os
import numpy as np
import torch as T
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, SubsetR... |
#!/usr/bin/env python3
import argparse
import configparser
import dbus
import os
import psutil
import struct
import subprocess
import sys
from collections import defaultdict
from dbus.mainloop.glib import DBusGMainLoop
from errno import EACCES, EPERM
from gi.repository import GLib
from mmio import MMIO, MMIOError
fro... |
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import messagebox
from PIL import ImageTk, Image
from datetime import datetime
from qr import decode_input
from qr import init_camera_settings, decode_input_camera, destroy_all_cv
from observer import Publisher, Subscriber
from matplotlib.backends.backend_tkagg ... |
import pytest
import numpy as np
from scipy.stats import norm, gaussian_kde
import pybnesian as pbn
import util_test
SIZE = 1000
df = util_test.generate_normal_data(SIZE)
seed = 0
def numpy_local_score(node_type, data, variable, evidence):
cv = pbn.CrossValidation(data, 10, seed)
loglik = 0
for train_df,... |
#this code is inspired by https://github.com/ajamjoom/Image-Captions/blob/master/main.py
import time
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_sequence
from torchvision import transforms
from pytorch_pretrained_bert import BertTokenizer, BertModel # pip install pytorch-... |
from typing import NamedTuple, Tuple, Callable, List, Dict
import tensorflow as tf
from .config import SearchConfig
from .util import shape_list
class SearchPlaceholders(object):
def __init__(self, defaults: SearchConfig):
with tf.name_scope('placeholders'):
# shape [batch, vocab], 0's to fi... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import os
import sys
import tensorflow as tf
import time
from lib import utils, metrics
from lib.AMSGrad import AMSGrad
from lib.metrics import masked_mae_loss, masked_rmse_loss, masked_mse_... |
# encoding: utf-8
# ------------------------------------------------------------------------
# Copyright 2020 All Histolab Contributors
#
# 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
#
# ... |
"""Copied from vtr-dataset-tools: https://github.com/utiasASRL/vtr-dataset-tools/blob/master/tools.py"""
import copy
import numpy as np
from src.utils.transform import Transform
class Vertex:
"""
The Vertex object represents a vertex that is part of a pose graph.
Args:
run_id (int): Id of the run... |
"""
This module provides an interface to the SER file format written by FEI
and <NAME>'s program TIA.
It reads STEM and TEM images and other datasets.
It is based on information provided by Dr <NAME> and work by
<NAME>' original serReader code in Matlab.
Note
----
General users:
Use the simplified ser.serReader(... |
#coding=utf-8
"""
@author: evilXu
@file: tgw_broker.py
@time: 2018/1/4 16:44
@description:
"""
import numpy as np
from copy import copy
from rqalpha.interface import AbstractBroker
from rqalpha.utils.logger import system_log
from rqalpha.events import EVENT, Event
from rqalpha.const import BAR_STATUS, SIDE, ORDER_TY... |
""" Handle the post processing step that converts the styled html pages to Jinja2 templates.
Implementation
--------------
At this time, the details of how the toctree directive works are not understood,
nor the process by which the html writer interacts with the theme. Consequently,
for pragmatic reasons, instead o... |
"""
New instance methods for Django models which are set up for Modified
Preorder Tree Traversal.
"""
import copy
from django.db import models
from django.db.models import base
from django.db.models.query import Q
from django.utils.datastructures import SortedDict
from mptt.managers import TreeManager
import operator
... |
import chardet
import glob
import sys
import os
import re
same_hierarchy = (os.path.dirname(sys.argv[0]))#同一階層のパスを変数へ代入
scenario_dir = os.path.join(same_hierarchy,'data','scenario')
first_ks = os.path.join(same_hierarchy,'data','script','first.ks')
char_dir = os.path.join(same_hierarchy,'char')
sel_spnum = 28
sel_spa... |
from __future__ import annotations
from typing import List
from os.path import join as pjoin
import copy
import time
import yaml
from loa import utils
from loa.unit import Unit
from loa.logging import write_log
from loa.exception import TeamConsistencyError
from loa.exception import ArrangeTimeoutError
... |
import torch
import copy
from . import Parameter, config
class Kernel:
"""
Base kernel.
Args:
input_dims (int): Number of input dimensions.
active_dims (list of int): Indices of active dimensions of shape (input_dims,).
name (str): Kernel name.
"""
def __init__(self, input_... |
# mypy: ignore-errors
import abc
import bz2
import glob
import json
import os
import shutil
from tqdm import tqdm
from typing import Iterable, Dict, List, Literal, Optional
import warnings
from rlo.analytics import events_filename
from rlo import blob_storage
from rlo.reporting import RemoteRunInfo
from rlo.reporting.... |
import argparse
import pathlib
from itertools import chain
import numpy as np
import torch
import torchvision.transforms as transforms
import torchbearer as tb
import torchbearer.metrics as metrics
from dsketch.experiments.characters.models import Encoder, Decoder
from dsketch.experiments.shared.utils import img_to_f... |
class Vertex:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
self.edges = set()
self.faces = set()
@property
def p(self):
return (self.x, self.y, self.z)
@property
def visibility(self):
return self.z
def transform(self, T... |
# Copyright 2022 Huawei Technologies 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 applicable law or agreed to... |
"""Compute dynamic domain & dynamic central longitude."""
# interesting link: https://stackoverflow.com/questions/13856123/setting-up-a-map-which-crosses-the-dateline-in-cartopy
# Standard library
import csv # necessary, if script should be used on its own
# Third-party
import cartopy.crs as ccrs
import matplotlib.... |
# -*- coding: utf-8 -*-
"""
Funções auxiliares
<NAME> (<EMAIL>)
Para obter informações das relações px-distância real:
https://eleif.net/photo_measure.html
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('Agg')
def load(path,number,numrows,n... |
#!/usr/bin/env python3
"""Task set generation with WATERS benchmark.
From the paper: 'Real world automotive benchmark for free' (WATERS 2015).
This part adapted from https://github.com/tu-dortmund-ls12-rt/end-to-end
"""
from scipy import stats
from scipy.stats import exponweib
from lib.task import task
import numpy as ... |
'''
Batchwise tally functions, analogous to tensor.topk, mean+variance,
bincount, covaraince, and sort (for quantiles), implemented in a way
that permits fast computation of statistics over large data sets that
do not fit in memory at once.
These functions are useful because, while many statistics are much
cheaper to ... |
from .sleep_util import *
def sleep_magnitude_peaks(timestamp, timestep, inputs):
strong_peaks = calculate_strong_peaks(inputs)
peaks = []
keys = sorted(strong_peaks.keys())
for large in keys:
peaks.append((large, "L"))
for small in strong_peaks[large]:
peaks.append((small... |
import networkx as nx
import numpy as np
from .nx_tools import get_RAG_neighbors, dfs_line_search
import skimage.measure as measure
from tqdm import tqdm
import scipy.ndimage as nd
from rasterio.transform import xy
from .nd_tools import get_features_from_array
from typing import Callable
def l2_difference(vec_1: tupl... |
#!/usr/bin/env python
"""
Reddit New Post Bot
"""
import re
import os
import json
import time
import logging
import datetime
# non-standard
import praw
import requests
__author__ = "/u/fwump38"
__version__ = "1.0.3b"
###################
## Config
###################
# Settings for PRAW
client_id = os.getenv("CLIE... |
"""
This module contains objects to define and integrate full material models.
In our context a material model is a ODE that defines the stress rate and
an associated set of internal variables. Mathematically, we can define
this as two ODEs:
.. math::
\\dot{\\sigma} = f(\\sigma, h, T, \\dot{\\varepsil... |
# encoding: utf-8
'''
因为SR的输出B''中有噪音的存在,所以R的提取效果不好,这里使用Init stage的A、B、B'和B''域数据对R进行微调,主要步骤:
1 得到A、B、B'和B''域数据
这里的数据:A和B的数据在路径:'/home/ay3/houls/watermark_dataset/derain/IniStage/train or valid'
B'的数据路径:
2 对R进行微调
'''
import argparse
import os
import shutil
import time
import torch
imp... |
import pandas as pd
import os
from os.path import join, abspath, dirname, isfile
from google_trans_new import google_translator
from sklearn.model_selection import train_test_split
import nlpaug.augmenter.word as naw
import spacy
from nltk.stem import SnowballStemmer
from utils import downloader, exploration, normaliza... |
import collections
import itertools
import json
import textwrap
from django.conf import settings
from django.db.models import Count, Q
from django.http import HttpResponse
from django.template import Context
from django.template.loader import get_template
from django.utils import timezone
from django.views.generic imp... |
"""
Extracts information from Visual Field Test files in XML format.
"""
import xml.etree.ElementTree as et
import os.path as osp
import numpy as np
import pandas as pd
from tqdm import tqdm
from constants import *
import matplotlib
#matplotlib.use('TkAgg')
# matplotlib.use('Qt5Agg')
# matplotlib.rcParams['toolbar'] ... |
from PyQt5 import QtGui, QtWidgets, QtCore
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QHBoxLayout, QRadioButton, QButtonGroup, QLabel, QLineEdit, QFormLayout, QMessageBox, QComboBox
from PyQt5.QtGui import QIcon, QPainter, QColor, QPen, QImage, QPalette, QBrush
from PyQt5.QtCore import QSize, Qt, Q... |
################################################################################
# Copyright (c) 2020, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http... |
#!/usr/bin/python
"""This is the flask server of the a windows VM
It accepts the requests in the form of protobufs
and executes the same in the specified path
"""
import argparse
import logging
import os
from pathlib import Path
import shutil
import subprocess
import threading
import timeit
import sys
import reque... |
import serial
import numpy as np
import time
class ADSyncError(Exception):
pass
class ADSync:
ANALOG_RANGE = 20
ANALOG_MAX = 65536
FREQ_MAX = 700000
MAX_ADDR = 16384
def __init__(self, port, baud=921600, timeout=0.5, debug=False):
"""
Initialize a AD sync de... |
from argo import settings
from django.http import Http404
from django_elasticsearch_dsl_drf.constants import SUGGESTER_TERM
from django_elasticsearch_dsl_drf.pagination import LimitOffsetPagination
from elasticsearch_dsl import A, Q
from rac_es.documents import (Agent, BaseDescriptionComponent, Collection,
... |
import numpy as np
from warnings import warn
from typing import TYPE_CHECKING
from desdeo_emo.othertools.Probabilitywrong import Probability_wrong
import matplotlib.pyplot as plt
from kneed import KneeLocator
# from pygmo import fast_non_dominated_sorting as nds
from pygmo import non_dominated_front_2d as nd2
from matp... |
import pygame as pg
import numpy as np
scr_width=700
scr_height=500
FPS=100
white=(255,255,255)
color_light=(170,170,170)
color_dark=(100,100,100)
black=(0,0,0)
red=(255,0,0)
green=(0,255,0)
blue=(0,0,255)
yellow=(255,255,0)
data=np.load('ttt_data.npy')
def button(btn_loc,btn_side,btn_col,font,cap... |
import socket
import json
import traceback
VALIDADOR = '2019057195:12142021:713956ac462e3cc9736660c44697d3b6d91ffbe60ee2911114890582c2435f72+2019056890:12142021:d4ae8849f0d2f8ccf163b12a3fcf45908b61c8f2239f3806fe6292f3428a37ce+3933183216bb827a7cdca38687047dd1a191952b1afb1a01bcfd92ade29ae224'
def entrada():
while Tru... |
import json
import os
import numpy as np
import pandas as pd
import random
from scipy.stats import norm
from pathlib import Path
from models.common.model import Model
from models.common.model_utils import day_of_week, normalize_to_one
def sum_to_x(n: int, x: float):
if n > 1:
values = [0.0, x] + list(np... |
import numpy as np
import pandas as pd
import os
from datetime import datetime, timedelta
import time
import plotly.graph_objects as go
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import flask
from flask_caching import Cache
impor... |
import itertools
import math
import random
from direct.interval import IntervalGlobal as intervals
import panda3d.core as p3d
from ..monster import Monster
from ..combatant import Combatant
from ..commonlighting import CommonLighting
from .. import bgnode
from .. import gamedb
from .gamestate import GameState
class... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************
# @Time : 2018/10/24 18:52
# @Author : <NAME> & <NAME>
# @Lab : nesa.zju.edu.cn
# @File : AttackEval.py
# **************************************
import argparse
import os
import random
import shutil
import sys
import warn... |
import os
import cv2
import time
import argparse
import warnings
# YOLO-v3 imports
from detector_YOLO_v3 import build_detector
from deep_sort import build_tracker
from utils.draw import draw_boxes
from utils.parser import get_config
from utils.log import get_logger
from utils.io import write_results
# YOLO-v3-REID im... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 21 15:09:51 2019
@author: JoeCalverley
"""
import numpy as np
import math
import scipy.stats as sk
import matplotlib.pyplot as plt
def choose_b(J_est):
# Input is the array of current estimates of means
b = J_est.index(min(J... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.decorators import method_decorator
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, redirect, reverse
from django.contrib.auth import authenticate, login, logout
from django.views import View
from ... |
import torch.utils.data as utils
import torch.nn.functional as F
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import math
dtype = torch.float32
if torch.cuda.is_available():
device = torch.device("cuda:0")
else:
device = torch.device("cpu")
... |
import six
import sys
from nose.tools import assert_raises
from syn.base_utils import hasmethod, mro, import_module, message, assign, \
capture
#-------------------------------------------------------------------------------
# Printing utilities
def test_eprint():
from syn.base_utils import eprint, capture
... |
"""
@Author : <NAME>
"""
import os, sys
import numpy as np
from math import ceil, floor, pi
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from collections import OrderedDict as odict
import cv2
from basic.common import add_path, env, rdict, cv2_wait, cv2_pu... |
import numpy as np
import pandas as pd
import geopandas as gpd
import sys
from IPython.display import Image
from shapely.geometry import Point, Polygon
from math import factorial
import datetime
import time
import scipy
from statsmodels.sandbox.regression.predstd import wls_prediction_std
from sklearn.linear_model imp... |
# Imports: standard library
import os
import logging
from typing import Any, Set, Dict, List, Optional
# Imports: third party
import numpy as np
import pandas as pd
# Imports: first party
from definitions.edw import EDW_FILES
from definitions.icu import BEDMASTER_EXT
from ingest.icu.utils import get_files_in_director... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.