text stringlengths 3.07k 22.1k |
|---|
import datetime
from cluster_vcf_records import vcf_file_read, vcf_record
import pyfastaq
from clockwork import utils
def _combine_minos_and_samtools_header(minos_header, samtools_header, ref_seqs):
header_start = [
"##fileformat=VCFv4.2",
"##source=clockwork merge samtools gvcf and minos vcf",
... |
import json
import time
import threading
import base64
import cv2
import numpy as np
import onnxruntime
from flask import Flask, request, Response
import requests
from azure.iot.device import IoTHubModuleClient
from object_detection import ObjectDetection
from utility import get_file_zip
MODEL_DIR = 'model'
UPLOAD_... |
import copy
import math
from functools import partial
from typing import Optional, Sequence
import torch
import torch.nn as nn
from .flatten import Flatten
from .convs import ModuleWithIntermediate
from ..basic_typing import KernelSize, Stride, TorchTensorNCX, ModuleCreator
from .layer_config import LayerConfig, defau... |
"""Utilities to train a model."""
from abc import ABCMeta, abstractmethod
import argparse
import os
import re
import signal
import torch as th
from .utils import get_logger
LOG = get_logger(__name__)
__all__ = ["ModelInterface", "Trainer", "Checkpointer", "BasicArgumentParser"]
class BasicArgumentParser(argpar... |
import re
import sys
import types
class GlueError(Exception):
pass
class RecursionError(GlueError):
pass
class NoSuchAttributeError(GlueError):
pass
def ispackage(m):
""" Determine if a module is a package - that means, sub-modules can be imported
Currently uses that it has a file name that ... |
import os
import json
import sys
import argparse
# 0th operand is a modified dest register
dest_instructions = set(['add', 'addi', 'addiu', 'addu', 'divu', 'mulu', 'mulou', 'clo', 'clz', 'la', 'li', 'lui', 'move', 'negu', 'seb', 'seh', 'sub', 'subu', 'rotr', 'rotrv', 'sll', 'sllv', 'sra', 'srav', 'srl', 'srlv', 'and',... |
# Copyright (c) 2018 Ustack, Inc.
#
# 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 writ... |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import math
import os
# https://github.com/vsingla2/Self-Driving-Car-NanoDegree-Udacity/tree/master/Term1-Computer-Vision-and-Deep-Learning/Project1-Finding-Lane-Lines
def grayscale(img):
"""Applies the Grayscale transf... |
# coding: utf-8
# Copyright (C) 2021, [Breezedeus](https://github.com/breezedeus).
# 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 f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 <NAME> 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
#
... |
"""
Utility functions for working with Jobman.
"""
import os
import sys
import yaml
import numpy as np
import itertools as it
from keras.callbacks import EarlyStopping, ModelCheckpoint
from adios.datasets import *
from adios.callbacks import HammingLoss
from adios.metrics import f1_measure
from adios.metrics import ... |
import json
import pytest
from requests.exceptions import RequestException
from braze_user_csv_import import app
def test_lambda_handler_fails_assert_event_logged(mocker, capsys):
headers = ["header1", "header2"]
offset = 7256
event = {"Records": [
{"s3": {"bucket": {"name": "test"}, "object": {"... |
import sys
import re
import numpy as np
from scipy.optimize import minimize,LinearConstraint
from numpy import savetxt,loadtxt
from scipy.stats import chi2
import os
import time
version="QCv1.1"
def read_files_for_P(file, quartets, gnum, GENE_NUM):
topologies = []
genes_pp = {}
NN= GENE_NUM
... |
# import numpy as np
import pandas as pd
import numpy as np
from functools import reduce
import preprocessing as pre
# from pandas.util._validators import validate_bool_kwarg
def get_row(df, iloc, drop=False, reset_index=True):
"""Get a row from a DataFrame based on its integer-location index.
If drop is True... |
import nltk
import re
import pandas as pd
from nltk import sent_tokenize, word_tokenize, pos_tag
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk import sent_tokenize, word_tokenize, pos_tag
from emoji.unicode_codes import UNICODE_EMOJI
from nltk.tokenize import RegexpTokenizer
impor... |
#!/usr/bin/env python
"""
Defragment a given region file.
"""
import locale, os, sys
import collections
from optparse import OptionParser
import gzip
import zlib
from struct import unpack
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be found in the parent fo... |
"""
Template.
Places markdown in HTML with the specified CSS and JS etc.
Licensed under MIT
Copyright (c) 2014 - 2015 <NAME> <<EMAIL>>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import jinja2
from os import path
from . import util
import co... |
import logging
import os
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
from idpyoidc.logging import configure_logging
from idpyoidc.util import load_config_file
DEFAULT_FILE_ATTRIBUTE_NAMES = [
"server_key",
"server_cert",
"filename",
"template_di... |
#!/usr/bin/python3
#
# Copyright 2018 Infineon Technologies AG
#
# This file is part of ETISS tool, see <https://github.com/tum-ei-eda/etiss>
#
# The initial version of this software has been created with the funding support by the German Federal
# Ministry of Education and Research(BMBF) in the project EffektiV under ... |
""" Define distrubution parameters for nibabel, including package version
This file contains defines parameters for nibabel that we use to fill settings
in setup.py, the nibabel top-level docstring, and for building the docs. In
setup.py in particular, we exec this file, so it cannot import nibabel.
"""
import re
fr... |
# Copyright 2007 <NAME>. 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 copyright notice,
# this list of conditions and the foll... |
from functools import wraps
from json import JSONDecodeError
from urllib.parse import urlencode, quote, unquote
import nacl
import requests
from bottle import Bottle, request, abort, redirect, response
from nacl.public import Box
from nacl.signing import VerifyKey
from jumpscale.loader import j
REDIRECT_URL = "https... |
#!/usr/bin/python3
import queue
import threading
import time
import sys
import rclpy
from rclpy.parameter import Parameter
from rclpy.node import Node
from sensor_msgs.msg import Image
from std_msgs.msg import Float32MultiArray, MultiArrayDimension, String, Int32
import cv2
import numpy as np
from perspectiveImage imp... |
from io import BytesIO
import hashlib
import hmac
from buidl.helper import (
big_endian_to_int,
encode_base58_checksum,
encode_bech32_checksum,
hash160,
hash256,
int_to_big_endian,
raw_decode_base58,
)
from buidl._libsec import ffi, lib
GLOBAL_CTX = ffi.gc(
lib.secp256k1_context_crea... |
from gyb_syntax_support import SYNTAX_TOKEN_MAP, create_node_map, SYNTAX_NODES
from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS
from gyb_syntax_support.kinds import lowercase_first_word
from ExpressibleAsConformances import SYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES
from utils import flat_documentation
class S... |
import math
#XOR
Dados = [
[0.0, 0.0],
[1.0, 0.0],
[0.0, 1.0],
[1.0, 1.0]
]
Classe = [0.0, 1.0, 1.0, 0.0]
PesosCamadaEntrada = [0.1,0.2,0.3,0.4,0.1,0.3,0.0,0.1]
PesosCamadaIntermediara = [0.1,0.1,0.2,0.0,0.0,0.2,0.1,0.2]
PesosCamadaSaida = [0.0,0.0]
Bias = 1.0
PesosBias = [0.0, 0.2, 0.3,0.1,0.2,0.3,0.0]
TaxaDeApren... |
from __future__ import division
from IPython.display import display
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
import seaborn as sns
from statsmo... |
# command line interface
import asyncclick as click
from range_set import RangeSet
from distkv.util import yprint, PathLongener, P
from collections.abc import Mapping
@click.group(short_help="Control internal state.") # pylint: disable=undefined-variable
async def cli():
"""
This subcommand queries and con... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#****************************************************************************************************************************************************
# Copyright 2017 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifi... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 1 19:02:33 2018
@author: sandr
"""
import make_dataset
import build_data
import pandas as pd
import numpy as np
import sklearn.feature_selection as fs
from sklearn.preprocessing import QuantileTransformer
from sklearn.preprocessing import RobustScaler
from time import ... |
import pygame
import sys
import numpy as np
import gym
from gym import spaces
from gym.spaces import Discrete, Box
from stable_baselines3 import PPO
import random
import time
pygame.init()
WIDTH = 600
HEIGHT = 600
LINE_WIDTH = 15
WIN_LINE_WIDTH = 15
BOARD_ROWS = 3
BOARD_COLS = 3
SQUARE_SIZE = 200
CIRCLE_RADIUS = 60
C... |
#!/usr/bin/env python3
import argparse
import json
import re
import subprocess
import sys
class BenchmarkResult:
def __init__(self, obj):
if isinstance(obj, list):
self.group_name = obj[0][0]
self.test_name = obj[0][1]
self.avg = obj[0][2]
self.rel_std_dev =... |
"""
This module provides a solver for the spin-boson model at zero temperature
using the hierarchy equations of motion (HEOM) method.
"""
# Authors: <NAME>, <NAME>
# Contact: <EMAIL>
import numpy as np
from copy import copy
from qutip import Qobj, qeye
from qutip.states import enr_state_dictionaries
from qutip.supe... |
import re
import os
import sys
import operator
import smdrreader
from collections import defaultdict
def debug_print(message, file=sys.stderr):
if debug_mode is True:
print(message, file=file)
def read_all_data(file_dict, date):
all_data = []
for dir,file in file_dict.items():
if file is... |
#!/usr/bin/env python
import os
import re
from ricecooker.chefs import SushiChef
from ricecooker.classes import nodes, files
from ricecooker.config import LOGGER # Use LOGGER to print messages
from ricecooker.exceptions import raise_for_invalid_channel
from le_utils.constants import licenses, languages
imp... |
#Given a stochastic set of ruptures as exported from OQ and a (mean_disagg.csv) disaggregation result
#(processed using the /home/mhaas/RIESGOS/disaggregation/createPlot.py routine)
#returns the stochastic set of events associated with the poe of the disaggregation bin it belongs to
import os
import pandas
import numpy... |
import os
import tensorflow as tf
from PIL import Image
import numpy as np
import time
import util
# from skimage.measure import compare_ssim as ssim
import data
def train(args, model, sess, saver):
if args.fine_tuning :
saver.restore(sess, args.pre_trained_model)
print("saved model is loaded for f... |
import datetime
import os
import re
import shutil
import subprocess
# Defaults
defaults = {}
defaults['path'] = './private/var/radmind/'
defaults['comm'] = defaults['path'] + 'client/command.K'
defaults['port'] = '6223' # For certs
defaults['auth'] = '2' # For certs
defaults['fsdo'] = '/tmp/fsdiff_out.T'
def full(... |
"""FFmpeg based player
======================
:class:`FFmpegPlayer` can play USB cameras, video files, etc using
:mod:`ffpyplayer`.
"""
import re
import time
from collections import defaultdict
from functools import partial
from time import perf_counter as clock
from os.path import splitext, join, exists, isdir, absp... |
from flask import Blueprint, jsonify, render_template
from flask import current_app as app
from flask import request as rq
from flask_apispec import use_kwargs, marshal_with
from flask_apispec.views import MethodResource
from app.api.schema import * #schema
import logging
logger = logging.getLogger('root')
import re... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .. import core as erfa
def test_erfa_wrapper():
"""
Runs a set of tests that mostly make sure vectorization is
working as expected
"""
jd = np.linspace(2456855.5, 2456855.5+1.0/24.0/60.0, 60*2+1)
ra = np.... |
#!/usr/bin python3
# Imports
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python:
from datetime import datetime
from os import getenv
from uuid import uuid4, UUID as PyUUID
# 3rd party:
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.pool import ... |
# Lint as: python3
# Copyright <NAME> 2020. All Rights Reserved.
# <EMAIL>
#
# 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 requir... |
"""Astroid hooks for the Python 2 standard library.
Currently help understanding of :
* hashlib.md5 and hashlib.sha1
"""
import sys
from functools import partial
from textwrap import dedent
from astroid import (
MANAGER, AsStringRegexpPredicate,
UseInferenceDefault, inference_tip,
YES, InferenceError, ... |
import os
import time
import shutil
from admix.interfaces.rucio_dataformat import ConfigRucioDataFormat
from admix.interfaces.rucio_summoner import RucioSummoner
from admix.interfaces.keyword import Keyword
from admix.interfaces.database import ConnectMongoDB
from admix.utils import make_did
DB = ConnectMongoDB()
DTY... |
import os
import glob
import numpy as np
import math
"""
Conversion between kitti coordinates and camera coordinates is:
Cam: x,y,z ==> Kitti: -y,-z,x
"""
BASE_DIR="./"
LABEL_DIR="training/label_2"
LOC_DIR="training/locational"
REF="_out1"
def read_client_dir():
folders = next(os.walk(BASE_DIR))[1]
return folders
... |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016,2017
from future.builtins import *
import os.path
import sys
import site
import inspect
import types
import collections
import logging
from streamsx.topology import _debug
import streamsx.topology._stdlib as _stdlib
class _DependencyRes... |
import time
import logging
import tensorflow as tf
# from tensorflow.keras.utils import Progbar
# from tensorflow.python.keras import callbacks as callbacks_module
# import nvtx.plugins.tf as nvtx_tf
logger = tf.get_logger()
# Neural Network
class TFOptimizedSGPU(tf.keras.Model):
def __init__(self, hp, mixed_prec... |
# Copyright 2013, 2014 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
from gi.repository import Gtk, GObject
from quodlibet.qltk import pygobject_version
def _gets_marshal... |
from builtins import range
from builtins import object
import scipy.interpolate
import pyfftlog
import numpy as np
from cosmosis.datablock import option_section
# These are the ones the user can use
TRANSFORM_W = "w"
TRANSFORM_XI = "xi"
TRANSFORM_GAMMAT = "gamma"
# If they use xi then it splits into xip and xim.
TRAN... |
from svphase.utils.config import PRECISION
from itertools import izip, count
import pandas as pd
import numpy as np
class FeatureSubset(object):
def __init__(self):
pass
def _nonzero(self, df):
return ((df > PRECISION)).apply(any, axis=0)
def has_allele(self):
return True
def _nonzero_per_data_subset(self, d... |
"""Examines user input on the HTCondor slot configuration."""
from . import display, SLOTS_CONFIGURATION, logger
from .utils import split_num_str, to_minutes, to_binary_gigabyte
import math
import json
def filter_slots(slots: dict, slot_type: str) -> list:
"""Filters the slots stored in a dictionary according to... |
import abc
import autosar.base
import xml.sax.saxutils
import json
import collections
from autosar.element import DataElement
from decimal import Decimal
class BaseWriter:
def __init__(self, version=3.0, patch=None):
self.version=version
d = Decimal(float(version))
self.major=int(d.qua... |
import collections
import functools
import openpathsampling as paths
from openpathsampling.netcdfplus import StorableNamedObject
from openpathsampling.numerics import LookupFunction
import pandas as pd
import numpy as np
from .core import (MultiEnsembleSamplingAnalyzer, TransitionDictResults,
TISAn... |
"""Views for preprocess jobs"""
import json, collections
from django.conf import settings
from django.shortcuts import render
from django.urls import reverse
from django.views.decorators.csrf import csrf_exempt
from decimal import Decimal
from django.http import \
(JsonResponse, HttpResponse,
Http404, HttpResp... |
###############################################################################
# Name: ed_msg.py #
# Purpose: Provide a messaging/notification system for actions performed in #
# the editor. #
... |
import curses
import os
import pty
from io import BytesIO
from tempfile import TemporaryFile
import pytest
from snakeoil import formatters
from snakeoil.test import mk_cpy_loadable_testcase, protect_process
# protect against python issue 7567 for the curses module.
issue7567 = protect_process
class TestPlainTextFor... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.http import HttpResponseRedirect, JsonResponse, HttpResponseNotFound
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.utils impo... |
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# See LICENSE.txt included in this distribution for the specific
# language governing permissions and li... |
"""
PyTorch policy class used for PPO.
"""
import gym
import logging
import numpy as np
from typing import Dict, List, Optional, Type, Union
import ray
from ray.rllib.agents.ppo.ppo_tf_policy import setup_config
from ray.rllib.agents.ppo.ppo_torch_policy import kl_and_loss_stats, \
vf_preds_fetches, setup_mixins, ... |
# -*- coding: utf-8 -*-
import numpy
import copy
from math import sqrt
from itertools import product
from sagar.crystal.structure import Cell
from sagar.toolkit.mathtool import is_int_np_array, extended_gcd
def _factor(n):
"""
https://rosettacode.org/wiki/Factors_of_an_integer#Python
realize that facto... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
info:
author:uasier
github:https://github.com/uasier/
update_time:2019-4-1
"""
import time # 用来延时
from selenium import webdriver # selenium方式爬数据
import pymysql # 用来操作数据库
import logging # 设置日志
# 日志相关配置
logger = logging.Logger('log', level=logging.WARNING)
sh = logg... |
# Copyright 2017 ZTE 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 ... |
import numpy as np
import torch
import dgl
import stag
class Net(torch.nn.Module):
def __init__(
self,
layer,
in_features,
hidden_features,
out_features,
depth,
activation=None
):
super(Net, self).__init__()
... |
'''Fine-tune existing model
Fine tune an existing model on a small data set by freezing bottom layers and
training on the top layers by using a small learning rate.
'''
import os
from datetime import datetime
import random as rnd
from glob import glob
import click
import numpy as np
import tensorflow as tf
from skim... |
"""
This script extracts surrounding buildings of the zone geometry from Open street maps
"""
import math
import os
import numpy as np
import osmnx.footprints
import pandas as pd
from geopandas import GeoDataFrame as gdf
from geopandas.tools import sjoin as spatial_join
import cea.config
import cea.inputlocator
from... |
# -*- coding: utf-8 ; test-case-name: bridgedb.test.test_filters ; -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: <NAME> <<EMAIL>>
# Isis Lovecruft 0xA3ADB67A2CDB8B35 <<EMAIL>>
# pl... |
from __future__ import print_function, division, absolute_import
import numpy as np
from pandas.core.groupby import Grouper
from pandas.core.groupby.groupby import BaseGrouper, Grouping, _is_label_like
from pandas.core.index import Index, MultiIndex
from pandas import compat
from pandas.core.series import Series
from... |
import numpy as np
from ..utils import light, density, viscosity
class IBM:
def __init__(self, config):
# --- Adjustable parameters ---
# Light extinction coefficient [1/m], exponential decay rate of daylight by depth
# coeff = 0 ==> Crystal clear water
# coeff = k ==> Daylig... |
# 1-й путь к сайту типа '/sites/site' 2-й для копилирования cpl
# python lang.py /sites/site cpl
import sys, getopt, os, time
from shutil import *
import re
#from settings import *
#from core.dao_core import vd
#def vd(*mess):
# logee(mess)
#from logbook import Logger, FileHandler
#def logee(mess):
# file = FileHan... |
#!/usr/bin/env python
import os
import sys
import json
from argparse import ArgumentParser
import numpy as np
from scipy import stats
from mglib import safe_print, VERSION, AUTH_LIST, biom_to_matrix, metadata_from_biom, tab_to_matrix
prehelp = """
NAME
mg-correlate-metadata
VERSION
%s
SYNOPSIS
mg-correl... |
# ----------------------------------------------------------------
#
#
# <NAME>
# Implementation of TF-IDF aided by:
# https://towardsdatascience.com/natural-language-processing-feature-engineering-using-tf-idf-e8b9d00e7e76
# --------------------------------------------------------------
#from sklearn.metrics import co... |
import sys
import traceback
import json
from deckconverter import converter
from deckconverter import scryfall
from deckconverter import queue
from deckconverter import images
from deckconverter import logger
from deckconverter.logger import *
import argparse
import requests
import re
import os
import subprocess
from ... |
import discord
from discord import Forbidden
from discord.errors import HTTPException, InvalidArgument, NotFound
from discord.ext import commands
from discord.ext.commands.errors import MemberNotFound, BadArgument
from src.bot import Bot
import logging
import typing
#straight from the documentation cuz I'm lazy lol
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import datas
import sys
import scipy.stats as stats
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
params = {'binarize... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from functools import wraps
import re
import json
import tempfile
import logging
from http import HTTPStatus
from urllib.parse import quote, unquote, urlparse, urljoin, urlencode
import aiohttp
from .constants import BASE_URI, SEARCH_BASE... |
from __future__ import absolute_import, division, print_function
import json as _json
from six.moves.urllib.request import urlopen
from six.moves.urllib.parse import urlencode, quote_plus
from .config import ServerConfig, _server_configs
from .utils import _split_arg
__all__ = ['const', 'HttpJsonRequest', 'HttpJsonC... |
import appdaemon.plugins.hass.hassapi as hass
from enum import Enum
import voluptuous as vol
import voluptuous_helper as vol_help
from datetime import datetime, time, timedelta
"""
Automatically adjust the gallery shutter position and tilt_position
based on the sun elevation, sun azimuth, temperature instide and outs... |
## ========================================================================= ##
## Copyright (c) 2019 <NAME>. ##
## This code is licensed under the MIT license. ##
## simulation_b2d_walker.py ##
## ======... |
"""Generate datasets."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# MIT License
from typing import List, Text
from absl import app
from absl import flags
import os
import more_itertools
import numpy as np
import pandas as pd
from enzynet import constants
from enzynet import pdb
from enzynet import... |
from sympy.stats import (Normal, LogNormal, Exponential, P, E, Where, Density,
Var, Covar, Skewness, Gamma, Pareto, Weibull, Beta, Uniform, Given, pspace, CDF, ContinuousRV, Sample)
from sympy import (Symbol, exp, S, N, pi, simplify, Interval, erf, Eq, symbols,
sqrt, And, gamma, beta, Piecewise, Integra... |
import random
import threading
from typing import Union
from sqlalchemy import BigInteger, Boolean, Column, String, UnicodeText
from lsf.database import BASE, SESSION
from lsf.handlers.msg_types import Types
DEFAULT_WELCOME = "Hey {first}, how are you?"
DEFAULT_GOODBYE = "Nice knowing ya!"
# Discord welcome messages... |
import numpy as np
import nvector as nv
from pygeodesy.geoids import GeoidPGM
__version__ = '0.2.1'
SEMI_MAJOR = np.float64(6378137.0)
SEMI_MINOR = np.float64(6356752.31)
NV_A = SEMI_MAJOR
NV_F = 1 - (SEMI_MINOR / SEMI_MAJOR)
_egm96 = GeoidPGM('/usr/share/GeographicLib/geoids/egm96-5.pgm', kind=-3)
class Position... |
import logging
import math
import numpy
from genomeview.intervaltrack import Interval, IntervalTrack
from genomeview.utilities import match_chrom_format
class Transcript:
def __init__(self, chrom, start, end, strand="+", name=None, coding_start=None,
coding_end=None, exons=None, color=None):
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
from multiprocessing import dummy as multiprocessing
import PIL.Image
import numpy as np
import os
import shutil
import six
from scipy.stats import ttest_ind
def chunks(lst, n):
for i in r... |
#!/usr/bin/env python
# Following the tutorial from
# https://www.tensorflow.org/get_started/mnist/pros
import datetime
import random
import math
import gzip
import tensorflow as tf
from tensorflow import flags
from tensorflow.contrib import learn
import tensorflow.contrib.image
from tensorflow.contrib.learn.python.le... |
'''
Adapted from course 16831 (Statistical Techniques).
Initially written by <NAME> (<EMAIL>), 2018
Updated by <NAME> (<EMAIL>), 2021
Modified by <NAME> (<EMAIL>), <NAME> (<EMAIL>), <NAME> (<EMAIL>), March 2021
'''
import argparse
import numpy as np
import sys, os
from map_reader import MapReader
from... |
# библиотека pygame
import pygame
# константы
COLORS = {
'white': (255, 255, 255),
'blue': (0, 0, 200),
'red': (200, 0, 0),
'green': (0, 255, 0),
'yellow': (255, 255, 0),
'X_color': (84, 84, 84),
'O_color': (255, 255, 255)
}
WIDTH, HEIGHT = (600, 600)
WINDOW = pygame.display.set_mode((WIDT... |
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.mail import EmailMessage
from django.core.validators import validate_comma_separated_integer_list
from django.forms import Form
from django.forms.fields import BooleanField, CharFiel... |
import random
from sys import exit
import pygame
def display_score():
"""
Updates the score on the screen
:return: the current score
"""
curr_time = (pygame.time.get_ticks() // 1000) - start_time
score_surf = game_font.render(f'{curr_time}', False, (64, 64, 64))
score_rect = score_surf.ge... |
# /***********[KUS.py]
# Copyright (c) 2018 <NAME>, <NAME>, <NAME>, <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 us... |
from tinder_api import session
from tinder_api.utils import request_handlers as r
from tinder_api.utils.wrapper import JsonWrapper
import json
import datetime
import dateutil.parser
class UserModel():
def __init__(self, uid, name, bio, age, birth_date, photos,
gender, distance, job_name, job_title, sc... |
import hou
# A framework to quickly make node setups / configure parameters
def parameter_processor(the_node, params): # I wrote the_node in order to not confuse with 'a_node', which means housing node.
while "!" in params:
#print(params)
param_name = params[1:params.find(":")] # we know the first... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) University of St Andrews 2020-2021
# (c) University of Strathclyde 2020-2021
# (c) James Hutton Institute 2020-2021
#
# Author:
# <NAME>
#
# Contact
# <EMAIL>
#
# <NAME>,
# Biomolecular Sciences Building,
# University of St Andrews,
# North Haugh Campus,
# St Andrews... |
## -------------------------------------------------------------------------------------------------
## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks
## -- Package : mlpro.wrappers
## -- Module : pettingzoo.py
## ----------------------------------------------------------------------... |
import datetime
import json
import pandas as pd
import pytest
from python_etl import transform_data
@pytest.fixture()
def base_jh_data():
base_jh_data_dict = {
"Date": ["2020-01-22", "2020-01-22", "2020-01-23", "2020-01-24"],
"Country/Region": ["UK", "US", "US", "US"],
"Province/State": ["... |
# ==============================================================================
# == Copyright 2016 <NAME> ==
# == ==
# == Licensed under the Apache License, Version 2.0 (the "License"); ==
# == yo... |
'''
Author: zyq
Date: 2020-11-30 17:19:51
LastEditTime: 2020-12-09 17:24:59
LastEditors: Please set LastEditors
Description: 数值分析上机题 课本 P195 37题 3次样条插值
FilePath: /code/chapter4/q4-37-1.py
'''
import numpy as np
import matplotlib.pyplot as plt
from pylab import mpl
import sys, os
'''
description:
param {*} x n+1 个插值点
... |
import json
import logging
import re
from abc import abstractmethod, ABC
from cms.models.pagemodel import Page
from cms.utils import get_current_site
from django import forms
from django.contrib.admin.sites import site as admin_site
from django.contrib.admin.widgets import AdminSplitDateTime
from django.core.exception... |
import tkinter as tk
from tkinter import ttk
import queue
import threading
import sys
import time
from ess_visa import TEST_XM
from ess_xl import TEST_XL
class std_redirector(object):
def __init__(self, widget):
self.widget = widget
def write(self, string):
self.widget.config(state = "normal")... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.