text stringlengths 6.04k 39.5k |
|---|
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Extraction of thumbs from sd09 dataset
"""
import os
import argparse
import shutil
import progressbar
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.signal
import scipy.ndimage
import scipy.spatial
import scipy.misc
from scipy.ndimage.filters ... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn.bricks import ConvModule
from mmcv.runner import BaseModule, auto_fp16, force_fp32
from mmdet.core import build_assigner, build_bbox_coder, build_sampler
from mmdet.core.anchor import build_prior_generator
from mmdet.core.b... |
# Authors: <NAME> <<EMAIL>>
#
# Copyright (C) 2006 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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; version 2 only
#
# This program... |
import tensorflow as tf
from model.transformer_utils import positional_encoding, scaled_dot_product_attention
class PointWiseFFN(tf.keras.layers.Layer):
def __init__(self, model_dim: int, dense_hidden_units: int, **kwargs):
super(PointWiseFFN, self).__init__(**kwargs)
self.d1 = tf.keras.laye... |
#!/usr/bin/env python3
from tqdm import tqdm, trange
import os.path, os
import numpy as np
import pandas as pd
from numpy import array as arr
from glob import glob
from scipy import signal, stats
from scipy.interpolate import splev, splrep
from scipy.spatial.distance import cdist
from scipy.spatial import cKDTree
from... |
import os
import json
from collections import Counter, defaultdict
import pandas as pd
import networkx as nx
import statistics
import math
from sklearn.metrics import cohen_kappa_score
import seaborn as sns
import pandas
import matplotlib.pyplot as plt
ANNOTATION_TASKS = ["participants", "subevents"]
TASK_TO_INDEX ... |
import math
import torch
from torch import nn
from munch import Munch
import numpy as np
from timm.models.layers import DropPath
from timm.models.layers import trunc_normal_
from drloc import DenseRelativeLoc
class Token_performer(nn.Module):
def __init__(self, dim, in_dim, head_cnt=1, kernel_ratio=0.5, dp1=0.1,... |
import sys
import wx
import wx.lib.mixins.inspection
from wxutils import SetTip
FRAME_BG = (253, 253, 250) ## light grey
TITLE_BG = (253, 253, 250) ## light grey
FGCOL = ( 20, 20, 120) ## blue
BGCOL = (253, 253, 250) ## light grey
BGSEL = (250, 250, 200) ## yellow
FGSEL = (200, 0, 0) ## red
class Pe... |
import math
from qiskit import QuantumRegister, QuantumCircuit, ClassicalRegister
from qiskit.circuit.library import QFT, U1Gate
from qiskit.visualization import circuit_drawer
def myQFT(n, inverse=False):
qr = QuantumRegister(n)
gate = QFT(n, inverse=inverse, do_swaps=False).to_gate()
gate.name = 'QFT'
... |
#!/usr/bin/env python
"""
Author: <NAME>
Mail: <EMAIL>
Last updated: 24/04/2020
Takes a dataset and an optional tolerance as arguments
Produces a report file containing the confusion matrix, ACC, MCC and selected
threshold for 10 randomised cross validation runs on a 80/20 split of the
dataset.
It produces also a roc... |
#===============================================================================
# Copyright (c) 2012-2015, GPy authors (see AUTHORS.txt).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Red... |
import time
from src.independent.typing_imports import *
from src.model.Sort import Sort, SortOpApp, AtomicSort
from src.model.FnTypes import OverloadedFnType, SimpleFnType, SimpleFnType
from src.typechecking.standard_sorts import AtomicSortsAndDimensionedNumericSorts, TDMapKeySorts, TimeDelta, Bool, \
UnboundedNu... |
# ===========================
# Imports required libraries
# ===========================
import pygame
import random
from sys import exit
# =============================================
# Sets up window - might move to display class
# =============================================
print("Setting up window")
pygame.i... |
##! python3
##==============================================================================
## Copyright (c) 2021 COMPAL Electronic Inc. All rights reserved.
## This program contains proprietary and confidential information.
## All rights reserved except as may be permitted by prior written consent.
##
## ... |
import numpy as np
seed_value = 423 # Set random seed for reproducible results
np.random.seed(seed_value) # Set the `numpy` pseudo-random generator fixed
import os
import random
import errno
from pathlib import Path
from tqdm.autonotebook import tq... |
import shutil, atexit, os, tempfile, logging
import numpy as np
import cv2
from scipy import ndimage
import ray
from src.focus_stack.utilities import Utilities
import src.focus_stack.RayFunctions as RayFunctions
# Setup logging
log = logging.getLogger(__name__)
class ImageHandler:
image_storage = {}
image_s... |
import torchgeometry as tgm
import torch.nn as nn
import torch.nn.functional as F
import torch
import logging
import datetime
import os, json, sys
import numpy as np
from utils.Quaternions import Quaternions
from utils.Pivots import Pivots
import scipy.ndimage.filters as filters
import copy
device = torch.device("cud... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... |
import asyncio
import os
import random
from contextlib import suppress
from time import sleep
from unittest import mock
import pytest
from tlz import first, partition_all
from dask import delayed
from distributed import Client, Nanny, wait
from distributed.comm import CommClosedError
from distributed.compatibility i... |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_activation_layer, build_norm_layer
from mmcv.cnn.bricks.transformer import (FFN, TRANSFORMER_LAYER,
MultiheadAttention,
... |
'''
/*#############################################################################
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems(R).
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 Li... |
import argparse
from argparse import RawDescriptionHelpFormatter
from collections import Iterable
import datetime
import errno
import os
import sys
import textwrap
from appdirs import AppDirs
import requests_cache
from .output import set_level, set_silent
from .v20.enums import CHECK_CODES as CHECK_CODES20
from .v21.... |
import math
import numpy
import pytest
import chainerx
import chainerx.testing
from chainerx_tests import array_utils
# Value for parameterization to represent an unspecified (default) argument.
class _UnspecifiedType:
def __repr__(self):
return '<Unspecified>'
_unspecified = _UnspecifiedType()
@py... |
import argparse
import csv
def formatSignificantDigits(q):
"""
Truncate a float to 2 significant figures, with exceptions for numbers below 1
Only works for numbers [-100;100]
Arguments:
q : a float
Returns:
Float with only n s.f. and trailing zeros, but with a possible small overflow.
... |
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Copyright (c) 2018 by SN Systems Ltd., Sony Interactive Entertainment Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... |
"""
Copyright (c) 2018-2021 Intel Corporation
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 wri... |
from beluga.visualization import BelugaPlot
from beluga.visualization.datasources import Dill, GPOPS
import matplotlib.pyplot as plt
import matplotlib.cm as cmx
from matplotlib2tikz import save as tikz_save
from matplotlib.font_manager import FontProperties
from mpl_toolkits.axes_grid1 import make_axes_locatable
import... |
import curses
import datetime
import os.path
import pickle
import re
import sys
from collections import defaultdict
import scrapy
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from itemloaders.processors import Ta... |
import os
import re
import redis
import pickle
import zlib
import warnings
import pygsheets
import pandas as pd
from copy import deepcopy
from django.conf import settings
from rest_framework import status
# Global module variables
REDIS_EXPIRATION_TIME = os.getenv('MEDICINE_REDIS_EXPIRATION') or 3600
REDIS_HOSTNAME =... |
"""
vars that are still not updated to be precise:
- start amount a
- rent a
- rent growth a
- savings return a
- net salary x
- house price a
- house price growth a
- mortgage interest (currently close estimation, not precise) a
- annual mortgage payment (percentage of net income, plus every 6 years from the keren his... |
from manimlib.imports import *
def temperature_to_color(temp, min_temp=0, max_temp=15):
colors = [BLUE, TEAL, GREEN, YELLOW, "#ff0000"]
alpha = inverse_interpolate(min_temp, max_temp, temp)
index, sub_alpha = integer_interpolate(
0, len(colors) - 1, alpha
)
return interpolate_color(
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
import random
from .voxel_transformer import VoxTransformer, BertConfig
import torchvision.models as models
from torch.autograd import Variable
from enum import Enum
from collections import OrderedDict
from .guid... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 30 16:29:39 2020
@author: Abdurrahim
"""
#importing libraries
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
#importing dataset
#s... |
"""
MIT License
Copyright (c) 2020 <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 limitation the rights
to use, copy, modify, merge, publish, distri... |
# * Imports a Pinnacle Studio Project into the Vegas Timeline
# *
# * Revision Date: Jan 19,2019
# * Version: 1.0
# * Copyright: <NAME>
#
import clr
clr.AddReference('ScriptPortal.Vegas')
import ScriptPortal.Vegas
from ScriptPortal.Vegas import *
clr.AddReference('System.Windows.Forms')
import ... |
"""Image utilities
Some general image utilities using PIL.
"""
import Queue
import collections
import io
import mimetypes
import os
import struct
import threading
from gi.repository import (
GLib,
GObject,
GdkPixbuf,
Gtk,
Gdk,
)
from PIL import Image, ImageFilter
mimetypes.init()
# Generating a ... |
import argparse
import datetime
from logzero import logger
from nltk.translate import bleu_score
import numpy
import progressbar
import six
import chainer
from chainer.backends import cuda
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
impo... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["GP"]
import warnings
import numpy as np
from scipy.linalg import LinAlgError
from . import kernels
from .solvers import TrivialSolver, BasicSolver
from .modeling import ModelSet, ConstantModel
from .utils import multivariate_gaussia... |
import wf_core_data.utils
import pandas as pd
import numpy as np
import inflection
import collections
import itertools
import copy
import os
import logging
logger = logging.getLogger(__name__)
TIME_FRAME_ID_VARIABLES = [
'school_year',
'term'
]
STUDENT_ID_VARIABLES = [
'fast_id'
]
STUDENT_INFO_VARIABLES... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (C) 2019, <NAME> <<EMAIL>>
# All rights reserved
#
# 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 co... |
#!/usr/bin/env python
from collections import Counter
from multiprocessing import Pool
from functools import partial
import cPickle as pickle
import logging
import json
import os
from humanfriendly import format_size
WITHIN_HYPOTHESIS = 'within-hypothesis'
WITHIN_PREMISE = 'within-premise'
BETWEEN_PREM_HYPO = 'bet... |
"""
Usage:
source ../app-config.sh
python main.py generate_config_json
python main.py generate_app_config_sh
python main.py generate_aks_scripts
python main.py generate_kub_config_yaml
python main.py generate_kub_cluster_scripts
python main.py generate_aks_relay_journey tmp/aks-clusters-info.txt
"""
# Py... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""This mo... |
import pygame
import random
#Inisialisasi game
pygame.font.init()
pygame.mixer.init()
# Variabel Global
s_width = 650
s_height = 650
play_width = 300
play_height = 600
block_size = 30
top_left_x = (s_width - play_width) // 3
top_left_y = s_height - play_height
#sounds
sound_move = pygame.mixer.Sound("resource\sound... |
#!/usr/bin/env python3
r'''
Backend script to plot drifting, narrowband events in a generalized cadence of
ON-OFF radio SETI observations. The main function contained in this file is
:func:`~.plot_candidate_events` uses the other helper functions
in this file (described below) to plot events from a turboSETI event .cs... |
from summit import Runner
from summit.utils.multiobjective import pareto_efficient, hypervolume
from neptune.sessions import Session, HostedNeptuneBackend
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib as mpl
from matplotlib.colors import ListedColorm... |
#بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
# Maker : Khie # N̴̳̰̓ͬ͡ǫ̷̅̏̚ͅỗ͍̟̏͡b̴͙͙ͮ͢͜C̛͈̿ͥͣ͠ơ̡͑̈́ͩ͜d̼ͯ͋͌ͬ͡e̢̢̝̞̯̅ŗ̞̺̈̾̽
from linepy import *
from liff.ttypes import LiffChatContext, LiffContext, LiffSquareChatContext, LiffNoneContext, LiffViewRequest
from akad.ttypes import Message
from akad.ttypes import ContentType as... |
import torch
import numpy as np
from time import time
from common.arguments.basic_args import parse_args
from common.transformation.cam_utils import *
from common.dataset.pre_process.utils import fetch
from common.dataset.post_process.process3d import post_process3d
from common.visualization.plot_pose3d import plot17... |
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Tuple
import torch
import os
from torch import Tensor
import torch.nn as nn
from fairseq import options, utils, checkpoint_utils
from fairseq.dataclass import ChoiceEnum, FairseqDataclass
from fairseq.models import (
transformer,... |
# -*- coding: utf-8 -*-
"""
@file
@brief Quelques questions d'ordre général autour du langage Python.
"""
import os
import io
import re
def entier_grande_taille():
"""
.. faqref::
:tag: python
:title: Quel est l'entier le plus grand ?
La version 3 du langage Python a supprimé la co... |
"""
Implements three classes:
Node - an element in a tree
Tree - maintains and manages the relationships between a
Node's parent and its children
TreeIterator - provides depth-first traversal of Trees
PositionTree - A Tree that tracks the relationship between its
children (referred to as pos... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import os
import socket
import struct
import array
import sys
class Display(object):
def __init__(self):
self.connection = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
path = os.path.join(os.getenv("XDG_RUNTIME_DIR"), "wayland-0")
self.connection.connect(path)
self.open_ids... |
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.forms.models import modelform_factory, modelformset_factory, inlineformset_factory
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.core.exc... |
"""Automated Rectification of Image.
References
----------
1. Chaudhury, Krishnendu, <NAME>, and <NAME>.
"Auto-rectification of user photos." 2014 IEEE International Conference on
Image Processing (ICIP). IEEE, 2014.
2. Bazin, Jean-Charles, and <NAME>. "3-line RANSAC for orthogonal
vanishing point ... |
from collections import UserList
from contextlib import contextmanager
from io import BytesIO
import logging
import math
from fontTools.misc.transform import Transform, Identity
from fontTools.misc.arrayTools import unionRect
from fontTools.ttLib import TTFont
from fontTools.ttLib.tables.otTables import CompositeMode, ... |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 <NAME> <yamahata at private email ne jp>
#
# 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://ww... |
#!/usr/bin/env python3
# encoding: utf-8
# Copyright 2020, Technische Universität München;
# <NAME>, <NAME>
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
# Contribution: s920128 @ Github for prepare_tokenized_text()
"""CTC segmentation.
This file contains the core functions of CTC segme... |
import tvm
from tvm import topi
from tvm.topi.util import get_const_int, get_const_tuple
from tvm.topi import nn
from tvm.topi.nn.winograd_util import winograd_transform_matrices
from tvm import te, autotvm
from tvm.topi import util
from tvm.contrib.util import tempdir
import numpy as np
def _infer_tile_size(data, ke... |
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""This module is for sending scripts through Adams/PPT
"""
import os
import subprocess
import re
import time
import platform
import jinja2
from numpy import genfromtxt
import matplotlib.pyplot as plt
from thornpy.signal import manually_clean_sig, remove_data_point, manually_clean_sigs, low_pass
from thornpy.signal i... |
import argparse
import contextlib
import functools
import itertools
import os
import shutil
import time
from pathlib import Path
import numpy as np
import torch
import torch.multiprocessing as mp
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
import cargan
########################... |
import os
import torch
import torch.optim as optim
import torch.utils.data
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import torch.backends.cudnn as cudnn
import random
from PIL import Image
import numpy as np
from architecture_pgan import Generator, Discriminat... |
import os
import re
import asyncio
import aiofiles
from nonebot import CommandGroup, on_command, export, get_driver, logger
from nonebot.rule import to_me
from nonebot.permission import SUPERUSER
from nonebot.typing import T_State
from nonebot.adapters.cqhttp.bot import Bot
from nonebot.adapters.cqhttp.event import Mes... |
# python
import lx, lxu, traceback
from lxifc import UIValueHints, Visitor
from operator import ior
from Var import *
class CommanderClass(lxu.command.BasicCommand):
"""Wrapper for lxu.command.BasicCommand. Improves and simplifies common
command UI implementations, like popups, sPresetText fields, and
Fo... |
import math
from citlab_python_util.geometry import linear_regression as lin_reg
from citlab_python_util.geometry.point import rescale_points
from citlab_python_util.geometry.rectangle import Rectangle
from citlab_python_util.math.rounding import round_to_nearest_integer
class Polygon(object):
def __init__(self... |
# -*- coding: utf-8 -*-
#
# This file is part of Flask-IIIF
# Copyright (C) 2014, 2015, 2016, 2017 CERN.
# Copyright (C) 2020 data-futures.
#
# Flask-IIIF is free software; you can redistribute it and/or modify
# it under the terms of the Revised BSD License; see LICENSE file for
# more details.
"""Multimedia Image AP... |
import numpy as np
import math
import random
import logging
from abc import ABC, abstractmethod
from stable_baselines.deepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
from stable_baselines.common.schedules import LinearSchedule
from rl_with_teachers.utils import parse_noise_types
def make_behavior_poli... |
#!/usr/bin/env python
##############################################################################
# DESCRIPTION
##############################################################################
"""
new SRM probe, using gfal2, NAP, and compatible with python3
"""
import sys
import time
import gridutils
import tempfil... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
from django.contrib.postgres.fields import ArrayField
from django.contrib.auth.models import AbstractUser
from django.utils.text import slugify
from django.conf import settings
from django.urls import reverse
from django.db import models
import unidecode
import uuid
import re
class User(AbstractUser):
id = models... |
import os
from pathlib import Path
import numpy as np
import pkg_resources
import pooch
import xarray as xr
import yaml
from numba import jit, prange
try:
from tqdm import tqdm
except ImportError:
tqdm = None
# On Cheyenne/Casper and/or CGD machines, use local inputdata directory
# See: https://github.com/N... |
# coding=utf-8
# Created by max on 17-12-28
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import time
import argparse
import yaml
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from pandas ... |
import timeit
import click
import os
import functools
import numpy as np
from time import sleep
from os import listdir
from os.path import isfile, join
from enum import Enum
"""Create file in csv format for writing stats."""
class WriteCSVData():
def __init__(self, file, sep = ","):
self.file = open(file, 'w')
... |
import networkx as nx
import numpy as np
import copy
from . import LDstats_mod
from . import Numerics
## check nx version (must be >= 2.1)
def check_nx_version():
assert (float(nx.__version__) >= 2.0), "networkx must be version 2.0 or higher to use Demography"
tol = 1e-12
"""
We define a demography on an acyclic... |
"""
Copyright (c) 2018 <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 limitation the rights
to use, copy, modify, merge, publish, distribute, sublic... |
# Implementation of batch-normalized LSTM.
# Some code is from Pytorch source code and https://github.com/jiesutd/LatticeLSTM
import torch
from torch import nn
import torch.autograd as autograd
from torch.autograd import Variable
from torch.nn import functional, init
import numpy as np
# LSTM Cell for words
class Word... |
import unittest.mock
from ConfigSpace import EqualsCondition
import scipy.optimize
import numpy as np
import sklearn.datasets
import sklearn.model_selection
from smac.configspace import (
ConfigurationSpace,
UniformFloatHyperparameter,
CategoricalHyperparameter,
convert_configurations_to_array,
)
from... |
"""Adapted from Nematode: https://github.com/demelin/nematode """
import tensorflow as tf
import exception
import rnn_inference
import sampler_inputs
from transformer import INT_DTYPE, FLOAT_DTYPE
import transformer_inference
class BeamSearchSampler:
"""Implements beam search with one or more models.
If th... |
# Lint as: python3
# Copyright 2019 Google LLC
#
# 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 agr... |
def Vacuum_dV(motor_isp, wet_mass, dry_mass):
"""Calculates the total available vacuum-dv by the Tsiakovlsy rocket equation
Args:
motor_isp (float): The ISP rating of the motor_isp
wet_mass (float): Total mass of the fully fueld Rocket
dry_mass (float): Mass of the empty Rocket
Retur... |
from __future__ import absolute_import
import tvm
from flextensor.nn import conv2d_nchw
from expr_visitor import ExprVisitor
from graph import TensorNode, IndexNode
def gcd(a, b):
if a > b:
tmp = a
a = b
b = tmp
while a > 0:
r = b % a
b = a
a = r
return b
... |
# Author: <NAME>, <NAME>
# Summer 2015
from __future__ import division,absolute_import,print_function,unicode_literals #for Python 2.7
#from pylab import *
from scipy.special import wofz,jn,ive
from scipy.optimize import fsolve,root,newton
from numpy import amin,matrix,tile,linspace,repeat,empty,log10,sqrt,... |
from gensim.models import KeyedVectors
import io, os, sys, re, requests, time, argparse
import wget
from collections import defaultdict, OrderedDict
import pandas as pd
import numpy as np
from hyperopt import fmin, tpe, hp, STATUS_OK, Trials
from hyperas.distributions import choice, uniform
from hyperas import optim
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: leeyoshinari
import json
import logging
import traceback
from django.shortcuts import render, redirect, resolve_url
from django.conf import settings
from .models import TestPlan, ThreadGroup, TransactionController
from .models import HTTPRequestHeader, ... |
# Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
from celery import shared_task
from django.db.models import Sum, Avg, Window, F, RowRange, Value, query
from task.models import TaskLog
from data.models import RawSteps
from data.models import ThreeHour
from data.models import Predicted_Actual
from data.models import TaskInfo
from analysis.tools import T
from date... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 08:54:27 2021
@author: <NAME>
"""
"""
A class to manage a Gaussian basis for the Jolanta potential with l=1
Lots of helper functions not in the class to keep the legacy notebooks working.
"""
import numpy as np
import scipy.special
from scipy.... |
import functools
import logging
import pickle
import sys
import time
from collections import Counter
from datetime import datetime
from pathlib import Path
from typing import Dict
from typing import Set
from typing import Union, Tuple, List
import igraph as ig
import matplotlib.pyplot as plt
import networkx as nx
impo... |
import os
import re
import subprocess
import sys
import time
import zipfile
from typing import Optional
import requests
import selenium
from datetime import datetime
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.android.web... |
""" document/__init__.py
This package is for Python coders who have at least a passing familiarity
with html, but do not wish to write it.
The objects can also be use programmatically to create static pages or
(potentially) templates.
This package expects to make it easy to write compliant, well-formed, SEO,
and b... |
"""
@author: <NAME> "Mayou36"
DEPRECEATED! USE OTHER MODULES LIKE rd.data, rd.ml, rd.reweight, rd.score and rd.stat
DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!
The reweighting module consists of function to reweight a distribution by learning from
two other distributions as well as reweighting ... |
import numpy as np
import scipy.interpolate
from netCDF4 import Dataset
import pdb
class Data3d:
"""basic data element that contains a 3D (plevs/lat/lon) data field"""
def __init__(self,array3d=[],lon=[],lat=[],plevs=[],time=[],minv=-9e9):
"""Data3d(array[time,plevs,lat,lon], lon, lat, plevs, time,minv): 3D data ... |
import os, torch, numpy, base64, json, re, threading, random
from torch.utils.data import TensorDataset, DataLoader
from collections import defaultdict
from netdissect.easydict import EasyDict
from netdissect.modelconfig import create_instrumented_model
from netdissect.runningstats import RunningQuantile
from netdissec... |
from setuptools import setup
import os
import sys
import fnmatch
import setuptools.command.build_ext
import setuptools.command.sdist
import setuptools.command.install
import pathlib
from distutils.extension import Extension
# This code replaces ...
# import theonionbox.stamp as stamp
# used here up to TOB 19.2
# b... |
# 如果没有安装 requests,请执行 pip install requests
import requests, re, os, os.path, json, time, threading, configparser
import tkinter as tk
import tkinter.filedialog, tkinter.ttk
g_ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.55' # 请求头... |
import logging
import json
from aiohttp import web
from aiohttp import BasicAuth
clogger = logging.getLogger("dnstap_receiver.console")
class Handlers:
def __init__(self, apikey, basicauth, stats, cfg_stats):
self.api_key = apikey
self.basic_auth = basicauth
self.cfg_stats = cfg_stats
... |
# ********************************************************************************** #
# #
# Project: FastClassAI workbecnch #
# ... |
from datetime import datetime, date
from decimal import Decimal
from typing import Tuple, Any, Optional, Dict
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils.dateparse import parse_date
from django.utils.translation import gettext ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.