text stringlengths 3.07k 22.1k |
|---|
import tensorflow as tf
from kgcnn.layers.base import GraphBaseLayer
from kgcnn.layers.modules import LazyConcatenate
from kgcnn.layers.norm import GraphLayerNormalization
from kgcnn.layers.mlp import GraphMLP
from kgcnn.layers.gather import GatherNodesOutgoing, GatherNodes
from kgcnn.layers.pooling import PoolingLoca... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 21 17:16:33 2018
@author: <NAME>
"""
import math
import numpy as np
from numba import float64, guvectorize, cuda
@guvectorize([(float64[:], float64, float64[:], float64[:, :], float64[:], float64[:])], '(n), (), (n), (n, m), (m)->(n)', target='cuda... |
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import PIL.Image
import vgg16
vgg16.maybe_download()
def load_image(filename, crop_resize):
image = PIL.Image.open(filename)
if (crop_resize == True):
#image = center_crop(image, 500, 3)
image = image.... |
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2017 New Vector 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... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 02 15:40:07 2017
@author: ug4d
"""
import random
import numpy as np
import math
import networkx as nx
class Population:
"""The population class stores a collection of persons."""
def __init__ (self, initialPop, startYear, minStartAge, maxStartAge,
... |
"""
There are the functions for carry out the training, the evaluation, the model saving, and the AP calculator.
The AP calculator is taken from https://github.com/Tandon-A/emotic/blob/master/Colab_train_emotic.ipynb.
"""
import os
import numpy as np
from time import sleep
import torch
import torch.nn as nn
import ... |
import os
import sys
import re
import warnings
import logging
import urllib
import urllib.request
import zipfile
import random
import tqdm
import torch
import torchaudio
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
warnings.filterwarnings("ignore")
logging.b... |
from opcodes import *
from coloring import failure, success, warning
from utils import to_number
# Interpreter
class Interpreter():
stack = []
stack_count = 0
chunk = None
index = 0
had_error = False
global_variables = {}
local_variables = []
interpreter = Interpreter()
... |
# -*- coding: utf-8 -*-
"""Routines and Class definitions for constructing basis sets using the
diffusion maps algorithm.
@author: Erik
"""
from __future__ import absolute_import, division, print_function
import numpy as np
import scipy.sparse as sps
import scipy.sparse.linalg as spsl
from pydiffmap.diffusion_map i... |
# coding: utf-8
"""Infotech staff."""
try:
from StringIO import StringIO, StringIO as BytesIO # pylint: disable=reimported
from .ordered_attrib import ET
def xml_to_string(obj):
"""Dump ET to string py2."""
output = BytesIO()
obj.xml.write(output, encoding=obj.codepage)
ret... |
"""
Name: <NAME>
CIS 41B Fall 2020
Lab Assignment 0
Execution results are at the end of this file.
"""
from collections import namedtuple
from collections import defaultdict
from functools import reduce
import re
TEMPERATURE_DATA_FILE = "Temperature.html"
CO2_DATA_FILE = "Co2.html"
Temperature = namedtuple("Tempe... |
#!/usr/bin/env python
# pylint: disable=W0201
import sys
# sys.path.extend(['../'])
import argparse
import yaml
import numpy as np
import time
import itertools
import os
# torch
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from s... |
import sympy as sp
from sympy import symbols, simplify, Eq
import math
Cd = .6
Cq = .001
L = 2.1*2+.9*2
rho = 1.200
A_corr = 1
def cp_calc(ratio=1, bldg_type = 'highrise', azimuth=0, room_type='1_window', cp_eq=True, zone_x=10, zone_y=10, wwr=.1, zn=0, corner_window=True):
# print(ratio, bldg_type, azimuth, ... |
from datetime import datetime
from eth_utils import to_checksum_address
import datetime as dt
from src.queries import getAllAllocations, getActiveAllocations, getClosedAllocations, getAllocationDataById, \
getCurrentBlock
from src.helpers import initialize_rpc, initializeRewardManagerContract, ANYBLOCK_ANALYTICS_ID... |
# coding=utf-8
from fastapi import FastAPI, Depends, Request
from fastapi.exceptions import RequestValidationError
from fastapi.staticfiles import StaticFiles
from starlette.exceptions import HTTPException as StarletteHTTPException
from starlette.middleware.wsgi import WSGIMiddleware
from starlette.middleware.base imp... |
import os
from flask import (
Blueprint, g, redirect, render_template, request, session, url_for, current_app, jsonify
)
from werkzeug.utils import secure_filename
from blueprints.auth import get_current_user_id, login_required, verified_required, tos_required, get_current_username
from modules.data.database.q... |
#for DnCNN
import torch
import torch.nn as nn
import os
#+ for MemNet
import torch.nn.functional as F
from torch.autograd import Variable
#+ for RIDNet
from RIDmodel import ops
from RIDmodel import common
#+ for RNAN
# import math
# from RNANmodel import common
######################################################... |
import stable_baselines
import tensorflow as tf
import argparse
import gym_minigrid
import gym
import os
from stable_baselines.common.vec_env import DummyVecEnv, VecNormalize, SubprocVecEnv
from stable_baselines.deepq.policies import CnnPolicy as CnnDQNPolicy
from stable_baselines.common.policies import CnnPolicy, Cn... |
#!/usr/bin/env python
"""Basic implementation of CHOMP trajectory optimization algorithm.
Optimize over q1...qn, with q0 and qn+1 the fixed end points.
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import sparse
import IPython
from mm2d import models
class CircleField:
def __init__(self, c,... |
#!/usr/bin/env python3
""" Signal processing to filter cardiac calcium traces
Process the data and write a stat file:
.. code-block:: bash
$ ./analyze_ca_data.py /path/to/data/dir
Process the data and plot the annotations on the curves
.. code-block:: bash
$ ./analyze_ca_data.py /path/to/data/dir --plot-... |
# WWOSFLASKAPP.PY
# Main application code for WWOS
#
# Copyright <NAME> 2013
# Released under MIT License http://opensource.org/licenses/MIT
import os
import io
import sys
import string
from flask import Flask
from flask import request
from flask import render_template
import pymongo
import json
from bson import json... |
"""
Standard functions for general data.
Many of these are added to Plate and other classes as methods with
default arguments.
"""
import numpy as np
import pandas as pd
from .parsers import _parse_data_obj
from .util import check_df_col
def normalize(
obj,
value=None,
to=None,
zero=None,
groupb... |
# -*- coding: utf-8 -*-
"""
通过PING等方式,判断远程主机的存活状态
对系统中所有主机执行PING,默认每一分钟执行一次,默认PING为5秒超时;
对每台主机:
记录最后一次PING成功的时间,并与当前时间比较
1分钟以内,正常(界面上绿色图标)
大于1分钟,小于2分钟,故障(界面上黄色图标)
大于2分钟,离线(界面上红色图标)
"""
import time
import threading
import socket
import select
import struct
from app.base.configs import tp_cfg... |
##################################################################
######### Apriori Algorithm For Association Rule Mining ##########
################# By <NAME> ####################
##################################################################
import csv
####################################################... |
import networkx as nx
from spira.gdsii.elemental.label import Label
from spira.param.field.typed_graph import PathList
from spira import param
from spira.core.initializer import ElementalInitializer
import spira
from spira import log as LOG
from spira.core.mixin.gdsii_output import OutputMixin
def _loops(g):
"""
... |
import datetime
import logging
import pylti
from flask import Blueprint, current_app, jsonify, render_template, url_for
from lti import ToolConsumer
from pylti.flask import lti
from kerasltiprovider import context
from kerasltiprovider.assignment import find_assignment
from kerasltiprovider.database import Database
f... |
from typing import List, Union, Optional, Tuple, Dict
from typing_extensions import TypedDict
from collections import defaultdict
from pathlib import Path
import torch
from torch.utils.data import Dataset
from torch.utils.data.dataloader import default_collate, DataLoader
from torch.nn.utils.rnn import pad_sequence
fro... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from itertools import izip
import tables
import numpy as np
from astropy.table import Table, vstack
from Chandra.Time import DateTime
import healpy as hp
from agasc import sphere_dist, get_star
import matplotlib.pyplot as plt
NSIDE = 16
MIN_AC... |
from process_json import *
import numpy as np
BS = 32
"""def create_tags(text,a):
#Text includes entities marked as BEG__w1 w2 w3__END. Transform to a tags list.
mya = a.lower()
a = mya.split()
tags = []
inside = False
for w in text.split():
w_stripped = w.strip()
if w_stripped... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import argparse
import logging
from pprint import pprint
from pyparsing import ParseException
from parsing import parse_string, parse_settings, BlockToken, EnumerationToken, PropertyToken
from domains import Building, Buildings, Technology, Technologie... |
"""
Web application
(from lessweb)
"""
from datetime import datetime
import itertools
import json
import logging
import os
import re
import traceback
from types import GeneratorType
from typing import List, Any, Callable, Dict, Optional
from .webapi import BadParamError, NotFoundError, HttpStatus
from .webapi import h... |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from skimage.transform import resize
from IPython.display import clear_output
def color_mask(img, size=512):
# dict_labels = {'fondo':0, 'vidrio':1, 'consolidación':2, 'pleura':3}
# A cada label le ponemos un rgba
dict_color = {0:[... |
"""Setup the file structure for the software. Specifies several folders:
software_dir: path of installation
"""
import inspect
import os
import warnings
from socket import getfqdn
import pandas as pd
from immutabledict import immutabledict
import typing as ty
import dddm
import numpy as np
export, __all__ = dddm.exp... |
# Authored by <NAME>
import sys
import numpy as np
import psi4
emitter_yaml = False
emitter_ruamel = False
try:
try:
import ruamel.yaml as ruamel
except ImportError:
import ruamel_yaml as ruamel
emitter_ruamel = True
except ImportError:
import yaml
emitter_yaml = True
preamble="... |
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
import numpy as np
n_iter=0
def group_weight(module):
group_decay = []
group_no_decay = []
for m in module.modules():
if isinstance(m, nn.Linear):
group_decay.append(m.weight)
... |
import re
import numpy as np
import pandas as pd
from dateutil.tz import tzutc
from dateutil.parser import parse as parse_date
from datetime import datetime, timedelta, timezone
from qset.utils.numeric import custom_round
# NOTE: slow
def parse_human_timestamp_re(hts, min_date_str="2000"):
"""
:param hts: Hum... |
# encoding: UTF-8
# api: streamtuner2
# title: User Plugin Manager Ⅱ
# description: Downloads new plugins, or updates them.
# version: 0.5
# type: hook
# category: config
# depends: uikit >= 1.9, config >= 2.7, streamtuner2 >= 2.1.8, pluginconf < 1.0
# config:
# { name: plugin_repos, type: text, value: "http://fossil... |
from django.db import IntegrityError
from django.db.models.signals import (
pre_save,
post_save,
pre_delete,
post_delete,
m2m_changed,
)
from django.dispatch import receiver
from django.conf import settings
from ..models.authors import Author
from ..models.projects import ProjectSeries
from ..mode... |
"""Pipeline support for barcode analysis and de-mulitplexing.
"""
import os
import copy
import subprocess
from Bio import SeqIO
from Bio.SeqIO.QualityIO import FastqGeneralIterator
from bcbio import utils
from bcbio.pipeline.fastq import get_fastq_files
from bcbio.distributed.transaction import file_transaction
def ... |
# Author: <NAME>
import h5py
import io
import json
import numpy as np
import os
import torch
import torch.nn.functional
import torchvision.transforms as transforms
from collections import defaultdict
from PIL import Image
from torch.utils.data import Dataset
import pprint
def _process_resize_crop_norm_funcs(image_con... |
# Author <NAME> for Encoder training
import torch
import torch.nn as nn
import sys
import os
sys.path.append("./model")
sys.path.append("./loss")
sys.path.append('./utils')
import dataset
import torch.autograd as autograd
import VGANCox
import argparse
from torch.backends import cudnn
import datetime
import time
impo... |
import bokeh.models
import bokeh.layouts
import forest.colors
from forest.observe import Observable
from forest import layers
class Modal:
"""Modal component"""
def __init__(self, view=None):
if view is None:
view = Default()
self.view = view
self.layout = bokeh.layouts.col... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009 by xt <<EMAIL>>
# Copyright (c) 2009 by penryu <<EMAIL>>
# Copyright (c) 2010 by <NAME> <<EMAIL>>
# Copyright (c) 2010 by <NAME> <<EMAIL>>
# Copyright (c) 2010 by <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/7/2 7:25 PM
# @Author : Slade
# @File : model.py
# -*- coding:utf-8 -*-
import tensorflow as tf
from tensorflow.contrib import rnn
import tensorflow.contrib.layers as layers
"""wd_5_bigru_cnn
两部分使用不同的 embedding, 因为RNN与CNN结构完全不同,共用embedding会降低性能。
titl... |
# -*- coding:utf-8 -*-
import math
import time
from datetime import datetime
import requests
from django.db import models
from main.settings import LOL_URL, PROJECT_PATH
from main.utility.api import get_lol_last_version
from main.utility.util import load_champion_info
class Champion(models.Model):
key = models... |
from datetime import datetime
import sqlite3
import sys
def Conn(database):
if database:
print("[+] Inserting into Database: " + str(database))
conn = init(database)
if isinstance(conn, str):
print(str)
sys.exit(1)
else:
conn = ""
return conn
def in... |
# -*- coding: utf-8 -*-
from . import bytes_to_cstruct, IMAGE_PATH
from vulkan import vk, helpers as hvk
from ctypes import Structure, c_ubyte, c_uint32, sizeof, memmove
from collections import namedtuple
from pathlib import Path
from io import BytesIO
import struct
KTX_ID = hvk.array(c_ubyte, 12, (0xAB, 0x4B, 0x54, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2014 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... |
# -*- coding: utf-8 -*-
'''
split long seq into small sub_seq,
feed sub_seq to lstm
'''
from __future__ import division, print_function, absolute_import
import tflearn
import tflearn.data_utils as du
import numpy as np
import ReadData
import tensorflow as tf
from tensorflow.contrib import learn
from tensorflow.con... |
''' Start Coding on 26/08/2017 '''
''' (c) 2017, 2020 <NAME>. All rights reserved. '''
import os
import random
Robot_Name = "Parker"
ReleaseYear = 2020
BuildVersion = "0.4.0118"
# ''' START OF CREDITS INFORMATION '''
print("* DvNET " + Robot_Name + " [version " + BuildVersion + "] Developed by <NAME>. *"... |
"""
A smart alarm clock presented by a bootstrap web interface, using the Flask Module in Python.
It contains information about the latest Weather, News and Covid-19 cases in the region set in the config.json file.
The user is able to select and cancel alarms for which an announcement goes off and passively recieve n... |
import asyncio
import io
import json
import math
import random
import discord
import requests
from discord.ext import commands
from discord.ext.commands import Bot
from discord.utils import get
with open('private/token.json', 'r') as f:
token = json.load(f)
client = commands.Bot(command_prefix = 'e!')
client.remov... |
import argparse
import glob
import importlib
import os
import sys
import numpy as np
import torch as th
import yaml
import gym
from stable_baselines3.common.utils import set_random_seed, obs_as_tensor
from stable_baselines3.common.vec_env import VecVideoRecorder
import utils.import_envs # noqa: F401 pylint: disable=... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 13:02:21 2020
@author: James
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import os
from plotUtils import *
from physUtils import *
#TODO: obtain these values from the data files
#TODO: check conformal time used... |
import csv
import glob
import io
import os
import sys
import cv2
import numpy as np
from PIL import Image as PILImage
from pdf2image import convert_from_path
from skimage.metrics import structural_similarity
class Image:
STD_WIDTH = 2500
STD_HEIGHT = 1600
def __init__(self, path, debug=False):
s... |
'''
Generate transaction sequence and other necessary input information
'''
import yaml
import argparse
import numpy as np
from numpy.random import default_rng
import random
import math
import pickle
import pdb
import scipy.stats as stats
from os.path import dirname
from os.path import abspath
from pathlib import P... |
'''
Handles all the updates to covid data from the covid API and handles
the scheduling for these updates.
'''
import logging
import sched
import time
import datetime
import json
from uk_covid19 import Cov19API
from app import *
logging.basicConfig(filename='sys.log',level=logging.DEBUG)
API_schedule_covi... |
import requests
import json
import subprocess
import time
request_timeout = 30
class UpdateError(Exception):
pass
def get_current_release():
try:
with open('/root/release.json') as f:
return json.load(f)
except FileNotFoundError:
raise UpdateError('FileNotFoundError')
e... |
from __future__ import unicode_literals
import json
from django.test import TestCase
from django.core import serializers
from django.utils.encoding import smart_text
from markupfield.markup import DEFAULT_MARKUP_TYPES
from markupfield.fields import MarkupField, Markup
from markupfield.widgets import MarkupTextarea, A... |
# Debian packaging tools: Version comparison and sorting.
#
# Author: <NAME> <<EMAIL>>
# Last Change: April 19, 2020
# URL: https://github.com/xolox/python-deb-pkg-tools
"""
Pure Python implementation of Debian version comparison and sorting.
The :mod:`deb_pkg_tools.version` module previously integrated with python-a... |
import datetime
import os
import uuid
from core.blockchain.projectpai.paicoin import paicoin_cli
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.signals import post_save
from djang... |
from vsi.tools import Try
import numpy as np
import os
class Register(object):
def __init__(self):
self.readers = []
def register(self, reader):
if reader not in self.readers:
self.readers.append(reader)
registered_readers=Register()
registered_writers=Register()
# @@@ Generic classes @@@
class Rea... |
# Copyright (c) 2022, 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... |
"""
Provides memoisation of function calls.
For long-running functions, it is sometimes nice to store the result,
and then simply load it the next time the function is called with the same
parameters. This module uses pickle to store the result to disk, and to
load it again.
Instead of:
result = func(*args, **kw... |
import os
from musurgia.pdf.text import PageText
from musurgia.pdf.positioned import Positioned
from prettytable import PrettyTable
from quicktions import Fraction
from musurgia.fractaltree.fractalmusicsquare import Module
from musurgia.timeline.timeline import TimeLine
path = os.path.abspath(__file__).split('.')[0]... |
from abc import ABCMeta , abstractmethod
from math import cos , sin
import taichi as ti
from helper_functions import clamp , distance , distance_sqr
from basic_types import Vector , Float , Int
"""
TODO: Not well complete .
1. bounding_box query
2. ray intersects check
"""
@ti.data_oriented
class Ray:
... |
import pickle
import os
class Knowledge:
"""
先验知识的保存
"""
FILENAME_KNOW = "chatbot.know"
FILENAME_DIALOG = "chatbot.dialog"
def __init__(self, path="./data/", load=True):
self.path = path
self.known = {}
self.dialog = {}
if load:
self.load()
de... |
# LSTM
# https://towardsdatascience.com/lstm-text-classification-using-pytorch-2c6c657f8fc0
# https://blog.floydhub.com/a-beginners-guide-on-recurrent-neural-networks-with-pytorch/
from matplotlib import use
import matplotlib.pyplot as plt
import pandas as pd
import torch
from torch import tensor
import numpy as np
#... |
"""
.NET-style event system in Python
The aim of this module is to create an event system using only Python's base installation (e.g. no Anaconda, PyPy, etc.)
"""
if __name__ == "__main__":
# MAJOR +1 represents an added function.
__MAJOR = 1
# MINOR +1 represents a change in existing function(s) w... |
from keras import backend as K
import os
# Parameters
candle_lib = '/data/BIDS-HPC/public/candle/Candle/common'
def initialize_parameters():
print('Initializing parameters...')
# Obtain the path of the directory of this script
file_path = os.path.dirname(os.path.realpath(__file__))
# Import the ... |
from bmeg import Allele, Project
genome = 'ncbi_build'
chromosome = 'chromosome'
start = 'start_position'
end = 'end_position'
reference_bases = 'reference_allele'
alternate_bases = 'tumor_seq_allele2'
strand = 'strand'
amino_acids = 'amino_acids'
codons = 'codons'
cds_position = 'cds_position'
cdna_position = 'cdna_p... |
"""
Utitlity functions that will be used by the sequence data
generators
IGNORE_FOR_SPHINX_DOCS:
List of functions:
getChromPositions - returns two column dataframe of chromosome
positions spanning the entire chromosome at
a) regular intervals or b) random l... |
import os
import codecs
import logging
import difflib
from concurrent.futures import ThreadPoolExecutor
from shutil import copyfileobj
from pathlib import Path
from functools import lru_cache
import editor
from .storage.storages import S3Storage, GCStorage, LocalStorage, s3etag
from .storage.files import File
from .s... |
import ctypes
from ctypes import Structure, Union
from abc import ABC, abstractmethod
ULONG32 = ctypes.c_uint32
ULONG = ULONG32
RVA = ULONG32
RVA64 = ctypes.c_uint64
ULONG64 = ctypes.c_uint64
USHORT = ctypes.c_ushort
UCHAR = ctypes.c_uint8
WCHAR = ctypes.c_wchar
DWORD = ctypes.c_uint32
ULONGLONG = ctypes.c_ulonglong
L... |
import json
import umsgpack
from pydic import Parameters
import re
import time
try:
#python 2.x
from urllib import quote_plus as url_encode
except ImportError:
#python 3.x
from urllib.parse import quote_plus as url_encode
class Request:
def __init__(self, method, path=None,
query=... |
# define bond, angle and dihedral parameters
def format_atoms(line1):
if line1[0] == ";":
formated_string = "; Not required"
else:
formated_string = '{:>5} {:>6} {:>12} {:>6}'.format(line1[4], line1[1], line1[6], line1[5])
return formated_string
def format_bonds(line1):
if li... |
# -*- coding: utf8 -*-
import xlsxwriter
import csv
import os
import sys
import datetime
import argparse
# version 2.1 updated on 27-04-2019
# <NAME>, PhD (cand.)
# University of Toronto
# Depedencies: xlsxwriter install with `pip3 install xlsxwriter`
# documentation: https://xlsxwriter.readthedocs.io/contents.html
... |
"""EfestoClient provides controlling Efesto heat devices
"""
import warnings
import logging
import requests
import socket
from datetime import datetime, timedelta
from requests.packages.urllib3.exceptions import InsecureRequestWarning
try:
import http.client as http_client
except ImportError:
# Python 2
im... |
from xscontainer import api_helper
from xscontainer import docker
from xscontainer import remote_helper
from xscontainer import util
from xscontainer.util import log
from xscontainer.util import tls_secret
import os
import thread
import time
import signal
import socket
import sys
import XenAPI
import xmlrpclib
MONITO... |
import os
import pygame
from enum import IntEnum
from pygine.base import PygineObject
from pygine.draw import draw_image
from pygine import globals
from pygine.sounds import load_sound_paths
from pygine.utilities import Timer
SPRITE_SHEET = None
TEXT_SHEET = None
BOSS_BACKGROUNDS = []
BOSS_SPRITES = []
BACKGROUNDS ... |
import unittest
import src.camera.process_img as pi
import time
class TestBoardState(unittest.TestCase):
def test_start_state(self):
state = pi.get_board_state('src/camera/qrcodes/start_state.png')
print('state = ' + str(state))
class TestQrScan(unittest.TestCase):
def test_scanner(self):
... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import os
import datetime
import json
import git
import sys
repo = git.Repo("./", search_parent_directories=True)
homedir = repo.working_dir
def makeHMMUnSupData(Input, colname, fipsname):
#Takes input dataframe, and gives out HMM format... |
from flask import Flask, request
import time
import requests
import yaml
import random
import logging
from apscheduler.schedulers.background import BackgroundScheduler
import sys
# Define Flask frontend
app = Flask("frontend")
# Load Server configs from yaml
with open('config.yml', 'r') as file:
config = yaml.loa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Amazon Web Services. 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/li... |
#!/usr/bin/env python3
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import sys
import os
from tabulate import tabulate
#
# Process the data
#
# get the results file
if len(sys.argv) < 2:
print("provide the results file as an argument")
sys.exit(-1)
results_file ... |
from flask import Flask, render_template
from flask import request, redirect
from db_connector.db_connector import connect_to_database, execute_query
#create the web application
webapp = Flask(__name__)
#provide a route where requests on the web application can be addressed
@webapp.route('/hello')
#provide a view (fan... |
from __future__ import annotations
from pathlib import Path
import numpy as np
import typing
import logging
from datetime import timedelta, datetime
import xarray
from matplotlib.pyplot import draw, pause, figure
from matplotlib.colors import LogNorm
import matplotlib.ticker as mt
try:
import cartopy
from cart... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
#!/usr/bin/env python
""" basename, dirname - return filename or directory portion of pathname
License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause)
Author: <NAME>
"""
import getopt
import logging
import re
import os
import sys
# Version string used by the what(1) and ident(1) commands:
ID = "@(#) ... |
import logging
from PyQt5 import QtCore, QtOpenGL, QtWidgets
from PyQt5.QtCore import Qt
from candy_editor.core import signals
from candy_editor.moai.MOAIRuntime import getAKU
from candy_editor.SceneEditor.SceneEditor import SceneEditorModule
##----------------------------------------------------------------##
clas... |
from datetime import datetime
class Moderator:
"""Someone who moderates. Has an ID and name for the moderator."""
id = 0
name = ""
class Warn:
"""A warning, usually to a user"""
warner = Moderator()
reason = ""
channel = ""
datetime = ""
def from_dict(self, warn_dict: dict):
... |
import copy
import numpy as np
import random
from collections import namedtuple, deque
from keras import layers, models, optimizers
from keras import backend as K
class ReplayBuffer:
def __init__(self, buffer_size, batch_size):
self.memory = deque(maxlen=buffer_size)
self.batch_size = batch_s... |
import argparse
import serial
import serial.tools.list_ports
import requests
import re
import os
import signal
import esptool
TARGET_DIR = os.path.dirname(__file__) + "/firmwares"
read_file_one = os.path.dirname(__file__) + "/data/boot_app0.bin"
read_file_two = os.path.dirname(__file__) + "/data/bootloader_qio_80m.b... |
import numpy as np
import time
import sys
from ServoMotor import *
from fns import *
# Initialize motor control library & USB Port
filename = "/dev/ttyUSB0"
motor = ServoMotor(filename)
IO = motor.IO_Init()
if IO < 0:
print('IO exit')
sys.exit()
# Call corresponding function to convert sim2real/real2sim
def convFns... |
from abc import abstractmethod
from gwpycore.gw_basis.gw_exceptions import GruntWurkUserEscape
from gwpycore.gw_basis.gw_config import GlobalSettings
from pathlib import Path
from PyQt5.QtCore import QFileInfo
from PyQt5.QtGui import (
QColor,
QFont,
QFontDatabase,
QTextCursor,
QTextDocument,
QT... |
import argparse
import math
import os
import pickle
import shutil
import sys
import traceback
import librosa
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler
from dataset impo... |
import json
import os
from flask import Blueprint
from flask_testing import TestCase
from app import manager
manager.app.tests_blueprint = Blueprint("tests", __name__)
manager.load_views(manager.app.tests_blueprint, "pysite/views/tests")
manager.app.register_blueprint(manager.app.tests_blueprint)
app = manager.app
... |
#!/usr/bin/env python
# coding=utf-8
import argparse
import re
import os
from urllib import request
from xml.dom import minidom
from quote import Quote
from util import dump_xml, sanitize_filename, save_foreign_title_ref
""" Wikiquote api parser, yay
assumptions:
- no trailing / on directories or URLs
- ... |
'''
this Adapter is designed to wrap the sending and receiving activities of the Battery Management extension if
it is applied.
'''
from tools.singleton import Singleton
import api.ecu_sim_api as api
import copy
from api.core.component_specs import SimpleECUSpec, SimpleBusSpec
from enums.sec_cfg_enum import CAE... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 16 2021
@author: <NAME>
"""
# Import Module
import os
import sys
import numpy as np
# Constants
inputPath = "C:/Users/<NAME>/.spyder-py3/AI_HW1_SearchAlgs/input.txt"
SOLUTION = np.array([[1,2,3],[4,0,5],[6,7,8]])
DEPTH_LIMIT = 10
# takes a puzzle matrix and returns the p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.