text stringlengths 6.04k 39.5k |
|---|
import datetime
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import ClassVar, Optional, Union
import fsspec
import numpy as np
import pandas as pd
import xarray as xr
from power_perceiver.consts import BatchKey, Location
from power_perceiver.exceptions import NoPVSystemsInSlic... |
import os
import json
import logging
import torch
import torchvision
import matplotlib.pyplot as plt
from tqdm import tqdm
from torch import nn
from spikingjelly.clock_driven import neuron, functional
import numpy as np
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
EPOCHS, BATCH_SIZE, LR, MOMENTNUM = 100, 1... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.relaxed_categorical import RelaxedOneHotCategorical
from torch.distributions import Categorical
import numpy as np
import itertools
# Function from https://github.com/ikostrikov/pytorch-a2c-ppo-acktr/blob/master/model.py
def in... |
from manimlib.imports import *
class MyBox(Cube):
CONFIG = {
'pos': ORIGIN,
'box_height': 2,
'bottom_size': [1, 1],
'fill_opacity': 1,
}
def __init__(self, **kwargs):
Cube.__init__(self, **kwargs)
self.box_size = np.array([self.bottom_size[0], self.bottom_s... |
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Saves a PYPOWER case file.
"""
from sys import stderr
from os.path import basename
from numpy import array, c_, r_, any
from scipy.io import savemat
from py... |
import re
from itertools import permutations
from typing import Dict, List, Mapping, Union
import pytest
from conftest import cc
from vardb.deposit.annotationconverters import ConverterArgs, VEPConverter
CSQ_META = {
"Description": "onsequence annotations from Ensembl VEP. Format: Allele|Consequence|IMPACT|"
... |
import pygame #! biblioteca capaz de produzir o jogo
from pygame.locals import * #! Variáveis do submódulo
from time import sleep #! Classe para se ter um controle da velocidade do loop(Aqui implementado)
from sys import exit #! Módulo para forçar que a janela feche
import pla... |
"""Provide utility functions for RPC."""
import sys
if sys.version_info < (3, 7):
import aiocontextvars # noqa: F401
import asyncio
import contextvars
import copy
import io
import locale
import os
import secrets
import string
import threading
import traceback
import uuid
from .werkzeug.local import Local
def ... |
#!/usr/bin/env python3.7
"""
Mastering Object-Oriented Python 2e
Code Examples for Mastering Object-Oriented Python 2nd Edition
Chapter 3. Example 4.
"""
from typing import Iterable, cast, Any, Union, Type, Tuple
import random
from collections import defaultdict
from Chapter_3.ch03_ex1 import card2, Suit, Card2, Ace... |
import base64
import io
import json
import os
import gdown
#import fastbook
#fastbook.setup_book()
import fastai
import pandas as pd
import requests
import torchtext
import nltk
import snscrape.modules.twitter as sntwitter
from copy import deepcopy
from torchvision import models
from torchvision import transforms
from... |
import asyncio
import datetime
import unittest
from typing import Optional
import necrobot.exception
from necrobot.botbase.necroevent import NEDispatch, NecroEvent
from necrobot.botbase.manager import Manager
from necrobot.config import Config
from necrobot.condorbot import condordb
from necrobot.database import dbuti... |
#!/usr/bin/env python3
import re
from enum import Enum, auto
from typing import Optional
import dataclasses
from PyQt5.QtCore import (Qt, QMimeData, QObject, QSizeF, QRectF, QEvent, pyqtSignal)
from PyQt5.QtGui import (QTextOption, QContextMenuEvent, QTextObjectInterface, QTextFormat, QTextCharFormat,
... |
import re
import os
from ucscGb.gbData import ordereddict
from ucscGb.encode import encodeUtils
from ucscGb.gbData.ra.raFile import RaFile
from ucscGb.gbData.ra.raStanza import RaStanza
def extractValue(val, prefix='', removeComments=1):
val2 = val.replace(prefix, '')
if removeComments and '#' in val2:
... |
### clue-klef-polysynth v0.3
### Polyphonic synth for Kitronik KLEF with Adafruit CLUE
### Tested with an Adafruit CLUE (Alpha) and CircuitPython and 5.3.0
### copy this file to CLUE board as code.py
### MIT License
### Copyright (c) 2018 Kitronik Ltd
### Copyright (c) 2020 <NAME>
### Permission is hereby granted,... |
import lyli.context as context
import lyli.ast as ast
import lyli.func as func
import lyli.eval as eval
import lyli.type
import operator
import re
def _print(arg):
print(arg.val)
def _str_pair(p):
#print(str(p.type))
if _is_pair(p.type):
return "pair({},{})".format(_str_pair(p.val[0]), _str_pair(p.val[1]... |
import os
from pathlib import Path
from copy import deepcopy
from collections import OrderedDict, defaultdict
import itertools
import math
import random
import numpy as np
import torch
import torch.nn as nn
import torch.distributed as dist
from mycv.utils.general import ANSI
def set_random_seeds(seed=1):
random... |
import numpy as np
np.set_printoptions(suppress=True)
def compute_iou(bboxes1, bboxes2, bbox_format='cxcywh'):
if bbox_format == 'cxcywh':
# if bboxes are composed of center point xy and wh/2.
cx1, cy1, w1, h1 = np.split(bboxes1, 4, axis=1)
cx2, cy2, w2, h2 = np.split(bboxes2, 4, axis=1)
... |
"""此文件用于整理米仔的照片到相应的folder。
自动创建folder,格式使用“.../20141120-20151119 (0-1岁合集)/20141120-20141219 (1岁0个月)”
其他照片或视频,以文件的LastModifiedTime 作为标准,将照片转入相应folder内。
有些单反拍摄的文件,时间可能不对。
"""
import os
import re
import logging
import time
import shutil
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
f... |
#!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('mct_transform_2d')
import rospy
import numpy
import cv
import cv2
import sys
import threading
import mct_active_target
import functools
import scipy.optimize
from mct_blob_finder import BlobFinder
from mct_utilities import f... |
#!/usr/bin/python
# Imports
# To parse arguments
import argparse
# Import logging module
import logging
# Import ConfigParser Module
try:
# Python 2
import ConfigParser
except ImportError:
# Python 3
import configparser
# Import os to read config file path from env var
import os
# For exit (codes) an... |
#!/usr/bin/env python3
import csv
import getopt
from random import choice, random
import sys
# TODO:
# More options for CSV. We need some high level stats
# Better printout for town stats
class Resident:
''' A resident is a single person within a town.
Each resident has an age, a socioeconomic statu... |
import re
from functools import lru_cache
from typing import Any, Dict, List, Pattern
from gitlab2prov.utils.types import Note
classifiers: Dict[str, List[str]] = {
"change_target_branch": [
r"^changed target branch from `(?P<old_target_branch>.+)` to `(?P<new_target_branch>.+)`$"
],
"change_epi... |
# -*- coding: utf-8 -*-
"""
Tools for calculating open-water evaporation using the aerodynmaic mass-transfer approach.
"""
import cmath as cm
import numpy as np
import math as m
import pandas as pd
import multiprocessing as mp
class Aero(object):
"""
Manages meterological time series input/output for aerodyn... |
"""
@package generalUtility This module contains some general-purpose utility functions
@copyright GNU Public License
@author written 2009-2014 by <NAME> (www.christian-herbst.org)
@author Partially supported by the SOMACCA advanced ERC grant, University of Vienna,
Dept. of Cognitive Biology
@note
This program is f... |
'''
Esse arquivo terá todos os textos necessários para os titulos/textos dos menus. Além disso,
terá as versões do programa em outros idiomas.
'''
criptografias_disponiveis = {'Cifra de César': ['Apenas letras', 'Vários caracteres'],
'Substituição simples': ['Apenas letras (letras mensagem ... |
import time
from datetime import datetime
import cv2
import numpy as np
import threading
import json
import sys
from cv_image_utils import put_text_multiline
from cv_image_utils import cat_vert
from cv_image_utils import cat_horiz
from cv_image_utils import get_camera_name
# TODO: Display GUI FPS
# TODO: Timestamp fr... |
"""Spotify musicprovider support for MusicAssistant."""
import asyncio
import json
import logging
import os
import platform
import time
from json.decoder import JSONDecodeError
from typing import List, Optional
from asyncio_throttle import Throttler
from music_assistant.constants import CONF_PASSWORD, CONF_USERNAME
fr... |
#!/usr/bin/env python3
import string
import sys
import argparse
from typing import List
from utility import Utility
from dataclasses import dataclass
@dataclass
class SuggestedWordsResults:
words:List[str]
word_list_file_path:str = None
class WorldSolverMultiList:
def __init__(self, word_list_file_p... |
# -*- coding: utf-8 -*-
# file: yolov3.py
# brief: YOLOv3 implementation based on PyTorch
# author: <NAME>
# date: 2019/11/9
import torch
import numpy as np
class YOLOv3Decoder(torch.nn.Module):
def __init__(self, in_size, num_classes, anchors):
super(YOLOv3Decoder, self).__init__()
se... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... |
# -*- coding: utf-8 -*-
import logging
from dialogs.sentence_types import *
from dialogs.helpers.sentence_atoms import *
from dialogs.helpers.printers import pprint, level_marker
from dialogs.helpers.helpers import colored_print
from dialogs.resources_manager import ResourcePool
from functools import reduce
class ... |
# coding: utf-8
import time
import logging
try:
import ui
except ImportError:
import dummyui as ui
from .shcommon import IN_PYTHONISTA, ON_IPAD, PYTHONISTA_VERSION_LONG
from .shterminal import ShTerminal, StubTerminal
class ShVk(ui.View):
"""
The virtual keyboard container, which implements a swipe ... |
"""Extract information from a buildout with python/zope/django.
A buildout should be inside ``/srv/``, the id of a buildout is the directory
name. So ``/srv/reinout.vanrees.org/`` has the id ``reinout.vanrees.org``.
Originally copied from ``buildout.py`` in
https://github.com/reinout/serverinfo/
"""
from serverscrip... |
from torchvision import datasets, transforms
from base import BaseDataLoader
from torch.utils.data import ConcatDataset, IterableDataset, Sampler, DataLoader
import torch
import numpy as np
from PIL import Image
import os
import os.path
import numpy as np
import pickle
from torchvision import datasets
from torchvision... |
import argparse
import ephem
from ephem import degree
import pandas as pd
import numpy as np
import datetime
from multiprocessing import Pool
def get_parameters():
"""
Parse command line parameters
:return: namespace with parameters
"""
parser = argparse.ArgumentParser()
parser.add_argument('f... |
#!/usr/bin/python
# <NAME> - uni --> ck2840
import sys
import queue
import math
import heapq
import resource
import time
# Getting data
method = str(sys.argv[1])
istate = str(sys.argv[2])
#method = 'ida'
#istate = '0,8,7,6,5,4,3,2,1'
#istate = '1,2,5,3,4,0,6,7,8'
seed = istate.split(',')
size_n = len(seed)
rsize ... |
__author__ = "<NAME>"
__project__ = "gme.estimate"
__created__ = "05-24-2018"
__edited__ = "<NAME>"
import pandas as pd
import numpy as np
from typing import List
from typing import Union
import statsmodels.api as sm
import time as time
import traceback
#---------------------------------------------------------------... |
__all__ = ['sisotool', 'rootlocus_pid_designer']
from control.exception import ControlMIMONotImplemented
from .freqplot import bode_plot
from .timeresp import step_response
from .lti import issiso, isdtime
from .xferfcn import tf
from .statesp import ss
from .bdalg import append, connect
from .iosys import tf2io, ss2i... |
#
# Copyright 2020 Clement
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. ... |
"""Integrator module.
This module contains the actual time integration component of the depletion
algorithm. This includes matrix exponents, predictor, predictor-corrector, and
eventually more.
"""
from subprocess import call
import os
from openmc_wrapper import *
import scipy.sparse as sp
import scipy.sparse.linalg... |
import http.client
import os
import socket
import json
import threading
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler
from http.server import ThreadingHTTPServer, HTTPServer
from io import IOBase, TextIOBase
TEA_MODULE = "module"
TEA_FUN_NAME = "fun_name"
TEA_METHODS = "methods"
REQ_PARAM_Q... |
import torch
import torch.nn as nn
import itertools
from util import *
from torchvision import transforms, models
import numpy as np
from torch.nn.utils import weight_norm
args = get_args()
class G_u(nn.Module): #
def __init__(self, args):
super(G_u, self).__init__()
self._relu = nn.R... |
#!/usr/bin/env python3
import docker
import unittest
import re
import time
# Regex patterns used for testing
# Checks if TLS 1.3 was negotiated
RE_PATTERN_HELLO_TLS_13_NORESUME = r"^.*Hello TLS 1.3 \(draft .*\) _o/$|^.*Hello TLS 1.3 _o/$"
# Checks if TLS 1.3 was resumed
RE_PATTERN_HELLO_TLS_13_RESUME = r"Hello TLS... |
import collections
import enum
import json
import logging
import os
import re
import runez
from runez.render import PrettyTable
from portable_python.tracking import Trackable, Tracker
from portable_python.versions import PPG
LOG = logging.getLogger(__name__)
RX_DYNLIB = re.compile(r"^.*\.(so(\.[0-9.]+)?|dylib)$")
... |
import aglfn
import string
import pytest
values_to_test = [
("A", "A"),
("AE", "Æ"),
("AEacute", "Ǽ"),
("Aacute", "Á"),
("Abreve", "Ă"),
("Acircumflex", "Â"),
("Adieresis", "Ä"),
("Agrave", "À"),
("Alpha", "Α"),
("Alphatonos", "Ά"),
("Amacron", "Ā"),
("Aogonek", "Ą"),
... |
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from skimage.measure import label, regionprops
from tqdm import tqdm
from .nii_dataset import NiiDataset
__all__ = ["froc", "plot_froc", "evaluate"]
# detection key FP values
DEFAULT_KEY_FP = (0.5, 1, 2, 4, 8)
# classification c... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict
import fnmatch
import json
import os
from os.path import join, dirname, isfile, isdir
import re
import sys
import requests
CHANNEL_NAME = "main"
CHANNEL_ALIAS = "https://repo... |
from typing import Optional, List, Dict, Union, Iterable, Callable, Any
from urllib.parse import urlparse
from datetime import datetime, timezone
import logging
import os
import os.path
import jwt
from jwt import decode
from jwt.exceptions import InvalidTokenError
import toml
from stellar_sdk.sep.stellar_web_authentic... |
# import random
# import numpy as np
# import pandas as pd
import math
import algorithm3 as alg3
import PGRR
import OLHPGRR
def framework(S,groupDict,dict,budget,Ycardinality,delta,filepath,dimension,auctionMethod=None,randomiser=None):
"""
:param S: whole data
:param groupDict: grouped indexes by the at... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# # noqa: E501
# ◼◼◼ ◼◼ ◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼ ◼◼◼ ◼◼◼ ◼◼◼ ◼◼ ◼◼◼ # noqa: E501
# ... |
#
# test_app
#
import re
import sys
import types
import pytest
from asyncio.coroutines import iscoroutine
from mocks import * # noqa
from unittest import mock
from growler import growler, Application, GrowlerStopIteration
from mock_classes import (
MockReques... |
from wiserHeatingAPI.wiserHub2 import (
DEFAULT_AWAY_MODE_TEMP,
DEFAULT_DEGRADED_TEMP,
WiserAPI,
WiserDiscovery,
WiserModeEnum,
WiserUnitsEmun,
WiserAwayActionEnum,
WiserHubAuthenticationError,
WiserHubConnectionError,
WiserHubRESTError,
)
from datetime import datetime
from guppy... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2020/11/29 9:25 AM
@Author : Caroline
@File : 数据清洗
@Description :
* (1)使用jieba进行分词、并做停用词处理
* (2)tf-idf统计词特征
* (3)textrank统计词特征
* (4)将数据写入hive表
"""
import os
import sys
import os
import re
import jieba
import jie... |
import logging
import sys
import os
import os.path
import re
import shutil
import hashlib
import time
from . import signals
from . import jsonHelper
##----------------------------------------------------------------##
from .cache import CacheManager
from .asset import AssetLibrary
##-------------------------------... |
import datetime
from django.db.models import F, Func, Value
from django.db.models.functions import Upper, Lower, Concat
from django.db import models
from operator import itemgetter
from collections import OrderedDict, defaultdict
from core.services import get_admin_account, delimit_filtervalue
from .services import... |
import os
from typing import Dict, List
import numpy as np
import pandas as pd
import argparse
import re
from pprint import pprint
from PyInquirer import style_from_dict, Token, prompt
from PyInquirer import Validator, ValidationError
import getpass
import json
import time
from src.caplena_api_demo import CaplenaAPI, ... |
import json
import logging
import os
import traceback
from datetime import datetime, timedelta, timezone
import humanize
from praia.models import (AstrometryAsteroid, AstrometryInput, AstrometryJob,
AstrometryOutput, Run)
from tno.condor import (check_condor_job, check_job_history, get_job_b... |
#!/usr/bin/python
# 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
# (the "License")... |
"""Variational methods (iEnKS, 4D-Var, etc)"""
from dapper import *
@DA_Config
def iEnKS(upd_a,N,Lag=1,nIter=10,wtol=0,MDA=False,step=False,bundle=False,xN=None,infl=1.0,rot=False,**kwargs):
"""Iterative EnKS.
Special cases: EnRML, ES-MDA, iEnKF, EnKF [Raa19b]_.
As in [Boc14]_, optimization uses Gauss-Newton.... |
#from .utils import try_gpu
import numpy as np
from itertools import combinations
import seaborn as sns
from scipy.spatial import distance as spdist
import tqdm
from torch_geometric.data import Data, Batch
import torch
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from rdkit.Che... |
# Copyright 2019 Verily Life Sciences 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 appli... |
"""
House File which implements the Hiven House type and its methods (endpoints)
---
Under MIT License
Copyright © 2020 - 2021 <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... |
"""
MonitoringLocation Admin
"""
import csv
from django.contrib import messages
from django.contrib.admin import ModelAdmin, RelatedFieldListFilter, ChoicesFieldListFilter
from django.db.models.functions import Upper
from django.forms import ModelForm, Textarea, ModelChoiceField
from django.http import HttpResponse
fr... |
# Copyright 2021 <NAME>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# Copyright 2021 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... |
# -*- coding: utf-8 -*-
########### SVN repository information ###################
# $Date: 2019-11-23 04:28:42 +0900 (土, 23 11月 2019) $
# $Author: vondreele $
# $Revision: 4192 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/imports/G2pwd_fxye.py $
# $Id: G2pwd_fxye.py 4192 2019-11-22 19:28:42Z vondreele $
... |
#!/dls_sw/apps/python/anaconda/1.7.0/64/bin/python
"""
usage: pacman [-h|--help] [FILE or DIR] [OPTIONS]
Plot I24 chip results.
Methods:
FILE Plot results from a hitfinding file
DIR
file=/path/to/file.out Alternate method to plot from file
dir=/path/to/dir
Additional optio... |
# ===============================================================================
# Copyright 2018 dgketchum
#
# 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... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
UTILS
Utility functions.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 <NAME>. @ppizarror
Permission is hereby granted, free of charge, to any person obtaining a
copy of this ... |
import xml.etree.ElementTree as ElementTree
import os
import re
import sys
import json
import dateutil.parser
from hs_restclient import HydroShareNotFound, HydroShareAuthBasic, HydroShareAuthOAuth2, HydroShare, HydroShareException
from oauthlib.oauth2 import InvalidClientError, InvalidGrantError
from wx.lib.pubsub im... |
from shlex import quote
import argparse
import os
import re
import shutil
import subprocess
import sys
from pathlib import Path
import junitparser as junit
import requests
import yaml
def log(message):
print(message)
def cli_config_build(args):
_file = Path(args.config_file)
config = _read_config(_file... |
"""
Various post-processing steps of batches of simulations.
All steps work incrementally, detecting which sims have already been processed and which haven't.
All steps load and save the batch multiple times.
"""
import logging
from tqdm.auto import tqdm as pbar
import numpy as np
import pandas as pd
import gc
from ... |
import asyncio
import base64
from io import BytesIO
from logging import NOTSET
import os
import re
from abc import ABCMeta, abstractmethod
from typing import Iterable
from aiohttp import ClientSession
from PIL import Image
from selenium import webdriver
try:
import winreg
def get_windwos_proxy():
sub... |
import streamlit as st
from ..global_data import Constants, load_data, load_pred, get_csv, get_excel
import pandas as pd
from pathlib import Path
# from sklearn.preprocessing import MinMaxScaler
import io
import json
from contextlib import redirect_stdout
from covid_forecasting_joint_learning.data import cols as Data... |
import shutil
from datetime import datetime
from pathlib import Path
from time import time
import numpy as np
import pandas as pd
import pytz
import torch
from torch.utils.tensorboard import SummaryWriter
"""all checkpoints should be included at the moment
implemented callbacks:
Recorder: Tracking ... |
from matrix_instant import *
import LED_display_instant as LMD
import threading
from random import *
def LED_init():
thread=threading.Thread(target=LMD.main, args=())
thread.setDaemon(True)
thread.start()
return
arrayBlk = [ [ 1 ] ]
ghost = [ [ 3 ] ]
ghost2 = [ [ 3 ] ]
ghost3 = [ [ 3 ] ]
... |
from torch import nn
import torch
from torch.nn import LSTMCell
from attrdict import AttrDict
import torch.nn.functional as F
from collections import namedtuple
from torch.distributions.bernoulli import Bernoulli
from torch.distributions.normal import Normal
from torch.distributions.kl import kl_divergence
from copy im... |
# kernel.py
#
# Copyright (C) 2015
# <NAME> (Dabeaz LLC), http://www.dabeaz.com
# All rights reserved.
#
# This is the core of curio. Definitions for tasks, signal sets, and the kernel
# are here.
import socket
import heapq
import time
import os
import sys
import logging
import inspect
import signal
from selectors... |
"""Simple ReasonerStdAPI server."""
import copy
import datetime
import hashlib
import os
import uuid
import json
import logging
import traceback
import pprint
from typing import Optional
import asyncio
from fastapi import Body, Depends, HTTPException, BackgroundTasks, Request
from fastapi.openapi.docs import (
get... |
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from torch.utils.data import WeightedRandomSampler
from common.laserscan import LaserScan, SemLaserScan
import random
from torchvision import transforms
EXTENSIONS_SCAN = ['.bin']
EXTENSIONS_LABEL = ['.label']
# TODO: Create a different pa... |
# -*- coding: utf-8 -*-
"""This module implements all CAD database manipulations using skill commands.
"""
from typing import List, Dict, Optional, Any, Tuple
import os
import shutil
import yaml
from jinja2 import Template
import bag.io
from .database import DbAccess
calibre_tmp = bag.io.read_resource(bag.__name_... |
from copy import deepcopy
from collections import namedtuple
from itertools import groupby
import json
import os
import numpy as np
from flask import abort
from xpclient.utils import write_config_file
from xpctl.xpserver.models import Experiment as ServerExperiment
from xpctl.xpserver.models import Result as ServerRe... |
import multiprocessing # 多线程模块
import threading # 线程模块
import queue
import tensorflow as tf
import numpy as np
import gym
import os
import shutil # 拷贝文件用
import matplotlib.pyplot as plt
from FeudalBatchProcessor import FeudalBatchProcessor
import policy_utils
from LSTMmodel import SingleStepLSTM
Game = 'CartPole-v0... |
import random
import numpy as np
import scipy.sparse as sp
import torch
import sys
import os
import pickle as pkl
import networkx as nx
from normalization import fetch_normalization, row_normalize
from synthetic_data import make_donuts
from time import perf_counter
from torch.utils import data
from sklearn.model_select... |
"""
atomtools for geometry
"""
import os
import math
import itertools
import numpy as np
from numpy.linalg import norm
import modlog
import chemdata
BASEDIR = os.path.dirname(os.path.abspath(__file__))
EXTREME_SMALL = 1e-5
logger = modlog.getLogger(__name__)
def cos(theta, arc=False):
factor = 1 if arc else ... |
from abc import abstractmethod
import atexit
from collections import OrderedDict
from concurrent.futures import ThreadPoolExecutor
import io
import logging
import math
import os
import sys
from typing import Any, Dict, List, Tuple
import weakref
import h5py
import kaldiio
import ray
import soundfile
from torch.utils.d... |
"""
// ---------------------------------------------------------------------------
//
// Security Advising Modules (SAM) for Cloud IoT and Mobile Ecosystem
//
// Copyright (C) 2020 Instituto de Telecomunicações (www.it.pt)
// Copyright (C) 2020 Universidade da Beira Interior (www.ubi.pt)
//
// This program is free s... |
#библиотеки
from tkinter import *
import time
#переменные
money = 0
oranges = 0
helper = 0
upgrade_level = 0
upgrade_cost = 0
#окно
okno = Tk()
okno.title('Апельсин?')
okno.geometry("1050x550")
okno["bg"] = "black"
#defs
def plant():
global oranges
global money
#прибавк... |
import logging
from collections import OrderedDict
from .status import DeviceStatus
from .signal import (Signal, EpicsSignal, EpicsSignalRO)
from .device import (Device, Component as C, DynamicDeviceComponent as DDC,
Staged, BlueskyInterface, ALL_COMPONENTS, Kind)
from .areadetector import Epics... |
"""
roi_analys.py
This script contains functions for ROI mask and projection analysis.
Authors: <NAME>
Date: January, 2021
Note: this code uses python 3.7.
"""
import logging
from pathlib import Path
import numpy as np
import pandas as pd
from util import logger_util, gen_util
from sess_util import sess_load_uti... |
# Copyright (c) ByteDance, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Misc functions, including distributed helpers.
Mostly copy-paste from torchvision references.
"""
import io
import os
... |
from math import *
from mathutils import *
"""
on factor;
off period;
procedure bez(a, b);
a + (b - a)*s;
lin := bez(k1, k2);
quad := bez(lin, sub(k2=k3, k1=k2, lin));
cubic := bez(quad, sub(k3=k4, k2=k3, k1=k2, quad));
on fort;
lin;
df(lin, s);
quad;
df(quad, s);
df(quad, s, 2);
cubic;
df(cubic, s);
df(cubic... |
"""
Implementations for Flow-Conditioners.
Conditioners implemented in this class:
* `AutoregressiveNaive`: conditioner defined by a separate network
for each dimension. Only use for one-dimensional flows.
* `MADE`: Masked Autoregressive flow for Density Estimation.
* `CouplingLayers`: CouplingLayers Conditioner... |
import logging
from django.db.models import (
F,
Q,
Sum,
Count,
Min,
ExpressionWrapper,
FloatField,
)
from django.views.decorators.cache import cache_page
# Create your views here.
from rest_framework import viewsets
from rest_framework.decorators import api_view
from rest_framework.pagin... |
import warnings
import weakref
from math import log
from collections import Iterable
from itertools import chain
from numbers import Integral
import numpy as np
from Orange.data import (
Unknown,
Variable,
ContinuousVariable,
DiscreteVariable,
StringVariable,
)
from Orange.util import deprecated,... |
#!/usr/bin/env python
"""
Given a corpus of features between two US presidential candidates, predicts which one is most likely to win.
"""
from __future__ import print_function
import os
import sys
import csv
import copy
from collections import defaultdict
import tempfile
import subprocess
from datetime import date
fro... |
import basicsynbio as bsb
import pytest
from .test_fixtures import (
gfp_basicpart,
gfp_seqrec,
gfp_orf_seq,
cmr_p15a_basicpart,
cmr_p15a_backbone,
five_part_assembly_parts,
five_part_assembly_linkers,
five_part_assembly,
gfp_orf_seqrec,
gfp_orf_basicpart,
bseva_68_seqrec,
... |
"""Base package for gate API code."""
import abc
import base64
from datetime import datetime, timedelta
from hashlib import sha1
import json
import secrets
from typing import Dict, Generic, Optional, TypeVar, Union, cast
import uuid
from xml.etree.ElementTree import Element # nosec
from Crypto.Cipher import AES # no... |
# Copyright (C) 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... |
import torch
import torch.nn as nn
from collections import OrderedDict
import random
import time
from pathlib import Path
import predicting_performance.metrics as metrics
from predicting_performance.stats_collector import StatsCollector
from predicting_performance.trainer import Trainer
from automl.utils.utils_dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.