text stringlengths 8.04k 46.5k |
|---|
import copy
import sys
import json
import os
import re
from os import path
from contrib.fate_script.compiler.Compiler import StringBuilder as sb
from contrib.fate_script.compiler.Compiler import *
from contrib.fate_script.compiler.parser.FmlParser import *
from contrib.fate_script.compiler.parser.FmlLexer import *
from... |
from bearlibterminal import terminal
import tdl
import objects
import maps
import gui
import colors
import log
import effects
import raycast
import math
import sys
import shelve
attack_animations = {'west' : 0xE250, 'northwest' : 0xE251,
'north' : 0xE252, 'northeast' : 0xE253, 'east'... |
# -*- coding: utf-8 -*-
"""
Python File Template
"""
import copy
import string
from collections import Counter
import spacy
import re
import numpy as np
from onmt.newssum import fragutils
from tools.stanfordcorenlp import StanfordCoreNLP
from nltk.tokenize import sent_tokenize
import onmt.newssum.rouge_eval.rouge a... |
import cv2
import math
import numpy as np
from PIL import Image, ImageEnhance
import torch
import base64
import requests
from viterbi import calculate
from config_url import DETECT_URL, RECOGNISE_URL
# DETECT_URL = 'http://172.30.81.191:32021/text_predict'
# RECOGNISE_URL = 'http://172.30.81.191:32020/predict'
def ... |
import os
import abc
import yaml
import contextlib
import collections
import MyUtilities.common
from API_Database.utilities import json
NULL = MyUtilities.common.NULL
openPlus = MyUtilities.common.openPlus
class Config_Base(MyUtilities.common.EnsureFunctions, MyUtilities.common.CommonFunctions, metaclass = abc.ABC... |
#!/usr/bin/env python
"""Status and control for the enclosure controller.
To do:
- Enhance buttons to handle None as a state
History:
2005-08-02 ROwen
2005-08-15 ROwen Modified to not show enclosure enable (it doesn't seem to do anything).
2005-10-13 ROwen Removed unused globals.
2006-05-04 ROwen Modified to... |
#!/usr/bin/python3
import time
import http.server
import signal
import os
import logging
import sys
import json
import shutil
import datetime
import jinja2
import hashlib
import requests
import subprocess
import cgi
import urllib
SOUNDOUT_PERIOD = 1
CONFIG_SAVE_PERIOD = 10
DEVEL_MODE = True
#LIB_FOLDER_PATH = '/var/l... |
import rq_album
import rq_user
import env
import util
import random
import string
import json
import rq_studies
def test_init():
env.initialize()
print()
def test_get_token():
print()
token = util.get_token(username="titi", password="<PASSWORD>")
env.env_var["USER_1_TOKEN"] = token
token = uti... |
#!/usr/bin/env python
import argparse
import os
import pkt_kg as pkt
import psutil
import re
from rdflib import Graph
from rdflib.namespace import OWL, RDF, RDFS
from tqdm import tqdm
import glob
import logging.config
import time
from datetime import timedelta
from lxml import etree
from urllib.request import urlopen
... |
"""
Pipeline to record EDD data.
Currently only gates spectrometer dta format is understood.
Requires python 3.7+ and spead 3+
"""
from __future__ import print_function, division, unicode_literals
from tornado.gen import coroutine, sleep
from tornado.ioloop import PeriodicCallback
import logging
logging.getLogger("ma... |
import numpy as np
import matplotlib.pyplot as plt
import bisect
from collections import defaultdict
import logging
from .tick import Tick
from .position import PositionMap
from .math import *
logger = logging.getLogger('uniswap-v3.pool')
class SwapState:
def __init__(self):
"""
Container class... |
#!/usr/bin/env python
# This file is part of psdparser.
#
# Psdparser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Psdparser is... |
"""
There are two layered materials commonly used in structural glass design:
- Glass plys
- Interlayers
Typically, interlayer materials are used to bond glass layers into a laminate.
Common commercial applications use either ionoplast (SGP) or polyvinyl butyral
(PVD) as the bonding layers between glass layer... |
from __future__ import absolute_import, division, print_function
import argparse
import importlib
import itertools
import time
from multiprocessing import Pool
import numpy as np
import os
import pdb
import pickle
import subprocess
import sys
import tensorflow as tf
import tensorflow.contrib.slim as slim
import thr... |
def ispublic(cls, name):
return not name.startswith("_") and name != 'type_id' and not callable(getattr(cls, name))
class EnumType(type):
def __new__(metacls, name, bases, namespace):
cls = super().__new__(metacls, name, bases, namespace)
cls._value2name = {}
cls._name2valu... |
# File: i2c_device.py
'''Classes to support i2c devices.
Uses the smbus2 package: https://pypi.python.org/pypi/smbus2/0.2.0
Developed and tested on Raspberry Pi machines using Fedora and
Raspbian systems.
i2c buses are accessed via character special files such as:
/dev/i2c-0 (i2c bus 0)
/dev/i2c... |
#! /usr/bin/env python3
r"""Generate acceptable spans from the ANCOR corpus
Usage:
spangen [options] <in-file> [-m <f>] [-a <f>]
Arguments:
<in-file> an ANCOR corpus file (in XML-TEI-URS format) `-` for standard input
Options:
-h, --help Show this screen.
-m, --mentions <f> Mention detection data file (... |
from .ATS import AcquisitionController
import math
import numpy as np
import logging
import time
from qcodes.utils import validators as vals
from .ATS import AcquisitionController
class Triggered_AcquisitionController(AcquisitionController):
"""
Acquisition controller that acquires a record after each trigge... |
import pytest
import unittest.mock as mock
import tilemapbase.ordnancesurvey as ons
import os, re
def test_project():
assert ons.project(-1.55532, 53.80474) == pytest.approx((429383.15535285, 434363.0962841))
assert ons.project(-5.71808, 50.06942) == pytest.approx((134041.0757941, 25435.9074222))
assert o... |
from django.shortcuts import render,redirect
from django.http import JsonResponse, HttpResponse
from .models import Wheel, Recommend, ClothesType, Jacket, Pants, Shoes, Others, User, Cart, Address, \
OrderInfo, OrderGoods
from django.core.paginator import Paginator
import random
import time
import re
from django.c... |
# Lista de Imports
import csv
import time
import matplotlib
import ndlib.models.epidemics as ep
import ndlib.models.ModelConfig as mc
import networkx as nx
import matplotlib.pyplot as plt
from random import random, sample
from sklearn.metrics import mean_squared_error
# from sklearn.metrics import mean_absolute_error... |
#freqle.py
import trace
import numpy as np
from numpy import random as rnd
from time import time
from termcolor import colored
import matplotlib.pyplot as plt
class bosonGrid():
# This class generates a boson grid mass
def __init__(self,
n_mus = 300,
mu_min = 2.15e-13,
... |
# code for building PlaqueGAN generator and discriminator.
# Adapted from code of official FastGAN implementation:
# https://github.com/odegeasslbc/FastGAN-pytorch
# with additional adaptations from:
# https://github.com/lucidrains/lightweight-gan
import torch
import torch.nn as nn
from torch.nn.utils import s... |
""":mod:`pandas.io.html` is a module containing functionality for dealing with
HTML IO.
"""
import os
import re
import numbers
import collections
import warnings
from distutils.version import LooseVersion
import numpy as np
from pandas.io.common import _is_url, urlopen, parse_url
from pandas.io.parsers import Text... |
from pathlib import Path
import json
import numpy as np
import itk
import SimpleITK as sitk
from wsireg.utils.reg_utils import json_to_pmap_dict
from wsireg.utils.itk_im_conversions import (
sitk_image_to_itk_image,
itk_image_to_sitk_image,
)
from wsireg.parameter_maps.transformations import (
BASE_RIG_TFOR... |
# coding: utf-8
"""Testing the metric for classification with imbalanced dataset"""
# Authors: <NAME> <<EMAIL>>
# <NAME>
# License: MIT
from functools import partial
import numpy as np
import pytest
from sklearn import datasets
from sklearn import svm
from sklearn.preprocessing import label_binarize
from ... |
import asyncio
import functools
import json
import logging
import time
import datetime as dt
import pymongo
import seaborn as sns
import numpy as np
from numpy.fft import fft, ifft
from matplotlib import pyplot as plt
from collections import defaultdict
from os import environ
import discord
from discord.ext import co... |
import os
import numpy as np
import math
from GPy.util import datasets as dat
class vertex:
def __init__(self, name, id, parents=[], children=[], meta = {}):
self.name = name
self.id = id
self.parents = parents
self.children = children
self.meta = meta
def __str__(self)... |
#-*- coding: utf-8 -*-
#Vstream https://github.com/Kodi-vStream/venom-xbmc-addons
#refonctionne au 06/11
from resources.lib.gui.hoster import cHosterGui
from resources.lib.gui.gui import cGui
from resources.lib.handler.inputParameterHandler import cInputParameterHandler
from resources.lib.handler.outputParameterHandler... |
import gym
from gym.spaces import Discrete, MultiDiscrete, Tuple
import numpy as np
from mujoco_worldgen.util.rotation import mat2quat
from mae_envs.wrappers.util import update_obs_space
from mae_envs.util.geometry import dist_pt_to_cuboid
from copy import deepcopy
from itertools import compress
class GrabObjWrapper(... |
"""Generator of dynamically typed draft stubs for arbitrary modules.
Basic usage:
$ mkdir out
$ stubgen urllib.parse
=> Generate out/urllib/parse.pyi.
For Python 2 mode, use --py2:
$ stubgen --py2 textwrap
For C modules, you can get more precise function signatures by parsing .rst (Sphinx)
documentation f... |
# By <NAME>
# - <EMAIL> (you can email me if you have any questions about the code or how it works)
# - 3/1/2016
from locorobo import LocoRobo
from locorobo import Data
from locorobo import MotorDirection
from locorobo import WaitType
from locorobo import Song
from locorobo import Note
from collections im... |
# Copyright 2019 Canonical 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 in writin... |
# -*- coding: utf8 -*-
import json
import logging
import os
import textwrap
import threading
import time
import yaml
import pytest
from ocs_ci.framework import config
from ocs_ci.ocs import constants, ocp
from ocs_ci.ocs.exceptions import UnexpectedVolumeType
from ocs_ci.ocs.resources import pod
from ocs_ci.ocs.reso... |
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os.path
import random
import tempfile
import time
from datetime import datetime
from django.conf import settings
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.common.exceptions import NoS... |
import sys
from textwrap import dedent
import inspect
import pytest
from ..helpers import TestCase
from jedi import cache
from jedi.parser_utils import get_signature
from jedi import Interpreter
def assert_signature(Script, source, expected_name, expected_index=0, line=None, column=None):
signatures = Script(so... |
"""Script to spot cat faces in videos and draw bounding boxes around them.
Expects file 'model.best.tar' to exist (generated by train.py).
Writes outputs to outputs/videos/ by default."""
from __future__ import print_function, division
import argparse
import numpy as np
import os
from collections import defaultdict
fro... |
from collections import namedtuple
ZoneEntrance = namedtuple(
"ZoneEntrance",
"stage_name room_num scls_exit_index spawn_id entrance_name island_name warp_out_stage_name warp_out_room_num warp_out_spawn_id"
)
DUNGEON_ENTRANCES = [
ZoneEntrance("Adanmae", 0, 2, 2, "Dungeon Entrance On Dragon Roost Island", "Drag... |
#----------------------------------------------------------------------
# This programme provides a simple example of how to use "approach control"
# for colour light (and to improve the automation of semaphore signals.
#
# For Colour Light Signals - this can be used where it is necessary to slow
# a train down to take... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import log_loss, roc_auc_score, accuracy_score,precision_score,recall_score,f1_score
from sklearn.metrics import confusion_matrix
from imblearn.metrics import specificity_score, sensitivity_score
from skl... |
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# Date: October 20, 2011
"""
This is the scons rules genearator module which invokes all
the builder objects or scons objects to generate scons rul... |
import sqlite3
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import argparse
import networkx as nx
import os
from typing import Union, Optional, List
from scipy.stats import uniform, pearsonr, randint
from sklearn.svm import SVR
from sklearn.base import BaseEstimator, TransformerMixin
from sk... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import argparse
import ast
import copy
import os
import sys
from collections import OrderedDict
import yaml
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
KERNEL_WHITELIST = [
"awkward_new_Identities",
"awkward... |
#!/usr/bin/env python3
from . import command_codes as cc
import asyncio
from collections import namedtuple
import logging
import re
from typing import List, Callable, Union, Sequence, Any
from types import coroutine
class LoggerMetaClass(type):
def __new__(mcs, name, bases, namespace):
inst = type.__ne... |
import operator
from typing import Tuple
from ...datalog.expression_processing import conjunct_formulas
from ...expression_pattern_matching import add_match
from ...expression_walker import ExpressionWalker, PatternWalker
from ...expressions import Constant, Definition, FunctionApplication, Symbol
from ...logic import... |
#!/usr/bin/env python
#
# PrettyTable 0.5
# Copyright (c) 2009, <NAME> <<EMAIL>>
# All rights reserved.
# With contributions from:
# * <NAME>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sou... |
# Copyright 1999-2021 Alibaba Group Holding 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 a... |
# -*- coding: utf-8 -*-
"""Classes for signals"""
from copy import deepcopy
from ELDAmwl.bases.base import DataPoint
from ELDAmwl.bases.columns import Columns
from ELDAmwl.bases.factory import BaseOperation
from ELDAmwl.bases.factory import BaseOperationFactory
from ELDAmwl.component.interface import ICfg
from ELDAmwl... |
import bpy
import datetime
from . properties import *
from . operators import *
from . sun_calc import Degrees, format_lat_long, degToRad, \
format_time, format_hms, Move_sun
#---------------------------------------------------------------------------
#
# Draw the Sun Panel, sliders, et. al.
#
#----------------... |
from bs4 import BeautifulSoup
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from six.moves.urllib_parse import urlsplit
import collections
import datetime
... |
import typing
from typing import Callable, Optional, Tuple
import equinox as eqx
import jax
import jax.lax as lax
import jax.numpy as jnp
from ..custom_types import Array, Bool, PyTree, Scalar
from ..misc import nextafter, nextbefore, rms_norm, ω
from ..solution import RESULTS
from ..solver import AbstractImplicitSol... |
import sys, os, time, multiprocessing, io, string, pickle
from bs4 import BeautifulSoup # don't need everything, it has several components
import settings
import django.http # to raise 404's
import django.utils.encoding
from django.db import close_old_connections
from django.contrib.sessions.backends.db import Session... |
from task_execution import *
from train import ModelTrainer
from data import *
def add_all_configs_to_runner(runner: JobRunner, tasks: List[Task], **kwargs):
# function that adds experiment configurations to a runner which can then execute them later
sigma = kwargs.get('post_sigma', 0.1)
compute_eff_dim =... |
#!/usr/bin/env python
###############################################################
# ========================= INFO ==============================
# NAME: check_cisco_stack.py
# AUTHOR: <NAME> (wershlak), <NAME> (ziesemer)
# WEBSITE: https://github.com/ziesemer/wershlak-nagios_plugins
# LICENSE: ... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitati... |
"""
lotsizing.py: solve the multi-item, multi-stage lot-sizing problem.
Approaches:
- mils_standard: standard formulation
- mils_echelon: echelon formulation
Copyright (c) by <NAME> and <NAME>, 2012
"""
import random
from pyscipopt import Model, quicksum, multidict
def mils_standard(T,K,P,f,g,c,d,h,a,M,UB,p... |
from builtins import str
# -*- coding: utf-8 -*-
#
# Building Outlines Test documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 13 11:20:05 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are pr... |
from . import ClientConstants as CC
from . import ClientGUIDragDrop
from . import ClientGUICommon
from . import ClientGUICore as CGC
from . import ClientGUIFunctions
from . import ClientSerialisable
from . import ClientGUIShortcuts
from . import HydrusData
from . import HydrusExceptions
from . import HydrusGlobals as H... |
# 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"); you may not use ... |
# Copyright 2019 The Matrix.org Foundation CIC
#
# 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 agre... |
#/usr/bin/env python3
import random
import time
import signal
import sys
import json
import socket
import threading
from typing import List, Any, Dict, Set
from socketserver import TCPServer, BaseRequestHandler
PORT = 3880 # group port range start, port = PORT + server_id
PORT_HEARTBEAT = 3870 # group hea... |
#!/usr/bin/env python3
from __future__ import annotations
from __future__ import print_function
from __future__ import with_statement
""" Python Script to find dependencies/modules from import-statements in python files
usage: findpydeps [-h] [-i input [input ...]] [-d expr] [-r policy] [-l] [-s] [--blocks] [--no-blo... |
from datetime import datetime, timedelta
import logging
import itertools
from celery.canvas import chain
from celery.task import task
from django.db import transaction
from django.db.models import Q
from corehq.apps.products.models import SQLProduct
from corehq.apps.locations.models import Location, SQLLocation
from cu... |
import copy
import math
import random
import sys
import time
from functools import partial # pip install functools
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import onnxruntime as ort
import torch
from gym import spaces
from l... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: plda.py
@Time: 2019/12/6 上午10:42
@Overview:
Reference:
kaldi: The original script is 'kaldi/src/ivector/plda.h kaldi/src/ivector/plda.cc'
the code avaliable at https://github.com/vzxxbacq/PLDA/blob/master/plda.... |
import os
import sys
import time
import glob
import logging
import argparse
import pickle
import copy
import numpy as np
import warnings
warnings.filterwarnings('ignore')
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision.transform... |
#
# Created by djz on 2021/01/21.
#
"""EET fairseq gpt2 model. """
import os
import math
import time
from turtle import forward
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from typing import Any, Dict, List, Optional, Tuple
from fairseq.models.transformer import Transform... |
"""
Copyright 2019 Inmanta
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__release__ = '2.0rc4'
__version__ = '$Id: e26392a530582f286edf2d99e729218b2e93405e $'
import datetime
imp... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# coding=utf8
"""
*Availability: 3+*
``tools`` contains a number of useful miscellaneous tools and shortcuts for use
in Willie modules.
tools.py - Willie misc tools
Copyright 2008, <NAME>, inamidst.com
Copyright © 2012, <NAME> <<EMAIL>>
Copyright 2012, <NAME>, embolalia.net
Licensed under the Eiffel Forum License 2.
... |
#!/usr/bin/env python
"""
Docstring for instanceinfo.py. This script will act as an abstraction layer
between the connection information for AWS instances and private instances that
might reside beyond a proxy server.
Several namedtuples are used in the script and are defined as:
IPAddressSet defines the elements for... |
"""Functions used by least-squares algorithms."""
from math import copysign
import numpy as np
from numpy.linalg import norm
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from scipy.sparse import issparse
from scipy.sparse.linalg import LinearOperator, aslinearoperator
EPS = np.finfo(float).eps
# Fu... |
"""Contains definitions for the preactivation form of Residual Networks.
Residual networks (ResNets) were originally proposed in:
[1] <NAME>, <NAME>, <NAME>, <NAME>
Deep Residual Learning for Image Recognition. arXiv:1512.03385
The full preactivation 'v2' ResNet variant implemented in this module was
introduce... |
import os
import sys
import time
import torch
import numpy as np
import multiprocessing as mp
from elegantrl.envs.Gym import build_env, build_eval_env
from elegantrl.train.replay_buffer import ReplayBufferMP
from elegantrl.train.evaluator import Evaluator
def train_and_evaluate_mp(args, agent_id=0):
args.init_bef... |
#!/usr/bin/env python
# coding: utf-8
# # Generate Graphviz DOT Format Graph for Mercurial Repository
#
# For a big project, it soon becomes very tedious if not impossible to draw detailed diagram of the Mercurial repository graph depicting the branching, merges, tags, and release.
#
# TortoiseHg Workbench is a good... |
# -*- coding: utf-8 -*-
"""Convolution kernels.
@author: <EMAIL>
"""
# TODO:
# . Implement Sinc kernel
# . Use inplace operations if gradients not required
import torch
from . import utils
__all__ = ['smooth', 'energy', 'energy1d', 'energy2d', 'energy3d',
'make_separable', 'imgrad']
def make_separable(... |
#!/usr/bin/env python
"""
Name: compute_transects.py
Author: <NAME>, <NAME>, <NAME>, <NAME>
Computes transport through sections.
"""
# ensure plots are rendered on ICC
from __future__ import absolute_import, division, print_function, \
unicode_literals
import os
import matplotlib as mpl
mpl.use('Agg')
import num... |
#!/usr/bin/env python3
from __future__ import division, print_function
from string import Template
from CommandRunner import *
from ECUtils import *
import tempfile
import xml.etree.ElementTree as ET
import logging
import sys,os,re
import subprocess
import signal
import argparse
import string
import glob
import trace... |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import logging
import indra.statements as ist
logger = logging.getLogger(__name__)
class EnglishAssembler(object):
"""This assembler generates English sentences from INDRA Statements.
Parameters
-----... |
import copy
import os
import re
import string
import tempfile
import warnings
from types import SimpleNamespace
from typing import Dict, Any, Union, TextIO, Optional, List, Tuple
import yaml
from yaml.constructor import FullConstructor
from jina.jaml.helper import (
JinaResolver,
JinaLoader,
parse_config_... |
# coding: utf-8
"""
Defines the DEQATN class and sub-functions.
The capitalization of the sub-functions is important.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
from numpy import (
cos, sin, tan, log, log10, mean, exp, sqrt, square, mod, abs, sum,
arcsin as asin... |
from rpython.flowspace.operation import op
from rpython.rlib import debug
from rpython.rlib.rarithmetic import is_valid_int
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.tool.sourcetools import func_with_new_name
# ____________________________________________________________
# Implementation of... |
"""
Command line interface for CasperLabsClient.
"""
import argparse
import textwrap
import base64
import sys
import os
import functools
import logging
from pathlib import Path
from casperlabs_client import (
CasperLabsClient,
DEFAULT_HOST,
DEFAULT_PORT,
DEFAULT_INTERNAL_PORT,
bundled_contract,
)
... |
# Copyright 2017 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... |
"""Copyright (c) 2020 <NAME>"""
import os
import math
import copy
import torch
from torch import nn, einsum
import torch.nn.functional as F
from inspect import isfunction
from functools import partial
from torch.utils import data
from pathlib import Path
from torch.optim import Adam
from torchvision import transforms... |
# Imports
import dash
import ast
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objs as go
from whitenoise import WhiteNois... |
#!/usr/bin/env python3
"""@@@
Main Module: LThreadBuilder.py
Objects: LThreadBuilder
NodeVisitor
Author: <NAME>
creation date: 170725 (originally part of Threads.py & RThreads.py and later TreeNode)
last update: 200211 (upgraded to python3), 191016
version: 0.1
Purpose:
Th... |
import traceback
import functools
import pdb
import sys
import torch
import nestedtensor
import unittest
from utils import TestCase
import random
import utils
from torch.nn import functional as F
def _iter_constructors():
yield nestedtensor.as_nested_tensor
yield nestedtensor.nested_tensor
def ntnt(x): retu... |
import base64
from collections import OrderedDict
from datetime import datetime, timedelta
import json
import glob
import logging
import os
import re
import subprocess as sp
import time
from functools import reduce
from pathlib import Path
import cv2
from flask.helpers import send_file
import numpy as np
from flask i... |
'''
script for generating spectra (noiseless, BGS-like, etc) for SV prep work
'''
import os
import h5py
import numpy as np
import astropy.units as u
# -- feasibgs --
from feasibgs import util as UT
from feasibgs import skymodel as Sky
from feasibgs import catalogs as Cat
from feasibgs import forwardmodel as FM
... |
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved.
import os
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as transforms
from tqdm import tqdm
pretrained_settings = {
"resnet101": {
... |
#!/usr/bin/env false
"""TODO: Write
"""
# Internal packages (absolute references, distributed with Python)
# External packages (absolute references, NOT distributed with Python)
from pytest import raises
# Library modules (absolute references, NOT packaged, in project)
from utility import my_assert as is_
from src_g... |
from configparser import RawConfigParser
from collections import defaultdict
from functools import lru_cache
import json
from logging import info, error, debug
import os
from pathlib import Path, PurePath
import pkg_resources
import re
import shutil
from subprocess import CalledProcessError, STDOUT
import sys
from time... |
# Copyright (c) 2018, ZIH,
# Technische Universitaet Dresden,
# Federal Republic of Germany
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain t... |
import dataloader as DL
from config import config
import network as net
from math import floor, ceil
import os, sys
import torch
import torchvision.transforms as transforms
from torch.autograd import Variable
from torch.optim import Adam
from tqdm import tqdm
import tf_recorder as tensorboard
import utils as utils
impo... |
#Code mis à jour la dernière fois le 06.10.2019
#Pour vérifier le contenu de la table :
# "use NomBaseDeDonnée" et ensuite "select date_detection, url from tableLiens;"
import feedparser
import requests
import time
import schedule
import mysql.connector
from datetime import datetime
conn = mysql.connector.connect(hos... |
from __future__ import absolute_import
import logging
import six
from collections import defaultdict
from datetime import timedelta
from uuid import uuid4
from django.db import IntegrityError, transaction
from django.utils import timezone
from rest_framework import serializers
from rest_framework.response import Re... |
#!/usr/bin/env python
# encoding: utf-8
#
# test_map.py
#
# @Author: <NAME> <andrews>
# @Date: 2017-07-02 13:08:00
# @Last modified by: andrews
# @Last modified time: 2018-03-01 11:03:79
from copy import deepcopy
import numpy as np
from astropy import units as u
import matplotlib
import pytest
from marvin import... |
# -*- coding=utf-8 -*-
##############################################################
# description:
# data augmentation for obeject detection
##############################################################
# 包括:
# 1. 裁剪(需改变bbox)
# 2. 平移(需改变bbox)
# 3. 改变亮度
# 4. 加噪声
# 5. 旋转角度(需要改变bbox)
# 6. 镜... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.