text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python
# The MIT License (MIT)
#
# 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 t... |
# coding: utf-8
import datetime
import json
import os
import re
import sys
import time
from socket import error as SocketError
import emoji
import neologdn
from requests_oauthlib import OAuth1Session
DIALOG_CNT = 3
class TweetData:
def __init__(self, id, text, status_id):
self.cnt = 0
self.ids ... |
import os
import random
import shutil
from pathlib import Path
from subprocess import DEVNULL, check_call
from typing import List
import orjson
import typer
from sauronlab.core import SauronlabResources, logger
MAIN_DIR = os.environ.get("SAURONLAB_DIR", Path.home() / ".sauronlab")
cli = typer.Typer()
class Install... |
'''
Features for interacting with Ripple's Neuroport neural recording system
'''
import time
import fnmatch
import os
from riglib import bmi
from riglib.bmi import extractor
from .neural_sys_features import CorticalData, CorticalBMI
from riglib import ripple
class RelayRipple(object):
'''Sends full data directly... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from supra.Utils.Classes import Constants
consts = Constants()
def getPressure(z):
p = 10*101.325*np.exp(-0.00012*z)*100
# in Pa
return p
def anglescan(S, phi, theta, z_profile, vfreq, P_amb, wind=True, debug=Tru... |
# -*- coding: utf-8 -*-
"""Runs the server in uwsgi or http modes.
Also supports starting nginx proxy.
:copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import p... |
# -*- coding: utf-8 -*-
"""
//////////////////////////////////////////////////////////////////////////////////////////
// Original author: <NAME>
// Github: https://github.com/aritzLizoain
// My personal website: https://aritzlizoain.github.io/
// Description: CNN Image Segmentation
// Copyright 2020, <NAME>.
// Licens... |
# The whole syntax of aleat3
__all__ = ["InitError",
"Aleatoryous",
"coinToBinary",
"coinToBool",
"LIST_EXAMPLE",
"COIN_NAME",
"DICE_NAME",
"ROULETTE_NAME"]
import random
from typing import Optional
if __name__ != "__main__"... |
import pandas
from scipy.stats import zscore
from IMLearn.learners import MultivariateGaussian
from IMLearn.utils import split_train_test
from IMLearn.learners.regressors import LinearRegression
from typing import NoReturn, Tuple
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.e... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'YOLOV3.ui'
#
# Created by: PyQt5 UI code generator 5.15.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5.QtWidgets import *
fro... |
import locale
import os
from enum import Enum, IntEnum
from functools import lru_cache
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
gi.require_version("Notify", "0.7")
from gi.repository import Gtk, Gdk, Notify
from app.settings import Settings, SettingsException, IS_DARWIN
# Init not... |
__source__ = 'https://leetcode.com/problems/stamping-the-sequence/'
# Time: O(N(N-M)
# Space: O(N(N-M)
#
# Description: Leetcode # 936. Stamping The Sequence
#
# You want to form a target string of lowercase letters.
#
# At the beginning, your sequence is target.length '?' marks.
# You also have a stamp of lowercase l... |
"""HPO script."""
import argparse
import logging
import pathlib
import random as rn
import sys
from enum import Enum
from typing import Any, Mapping, Tuple
import numpy as np
import torch
from ray import tune
from sklearn.metrics import mean_absolute_error, mean_squared_error
from nlkda.data.base import DatasetEnum, ... |
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import streamlit as st
@st.cache
def infer_dtypes(df):
dtype_dict = dict()
for col_name in df.columns:
series = df[col_name]
dtype_dict[col_name] = 'categorical'
nunique = df[col_name].nunique()
if nuniqu... |
import sys
from typing import Collection, Tuple, Optional
import numba
import pandas as pd
import numpy as np
from numpy import linalg as la
from scipy.sparse import issparse
from anndata import AnnData
from .. import logging as logg
from ..utils import sanitize_anndata
def _design_matrix(
model: pd.DataFram... |
########################################################################################################
## pyFAST - Fingerprint and Similarity Thresholding in python
##
## <NAME>
## 11/14/2016
##
## (see Yoon et. al. 2015, Sci. Adv. for algorithm details)
##
############################################################... |
from app import app, db
from flask import request
from app.models import User, Course, Test, Question, Result, enrolments, Submission
from app.forms import LoginForm, RegistrationForm, NewTestForm, NewCourseForm, RenameTestForm, QuestionForm, QuestionSubmissionForm, AddStudentToCourseForm, MarkTestForm, FeedbackForm
fr... |
# -*-coding:utf-8-*-
"""
相关配置配置读写解析
@author <NAME>
"""
import configparser
import os
import re
import urllib.parse
import win32con
import const_config
import mylogger
import utils
from utils import create_dialog_w
log = mylogger.default_loguru
def get_bg_abspaths():
"""
获取壁纸目录下的绝对路径列表
不包括子目录
:... |
from __future__ import (division, print_function, absolute_import)
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import scipy.integrate as integrate
import scipy.optimize as optimize
from datetime import datetime
from elecsus.goal_functions import *
import time
import sys... |
''' Various kinds of data table (data grid) widgets.
'''
from __future__ import absolute_import
from ...core.enums import DateFormat, FontStyle, NumeralLanguage, TextAlign, RoundingFunction
from ...core.has_props import abstract
from ...core.properties import Bool, Color, Either, Enum, Float, Instance, Int, List, Ove... |
#!/usr/bin/env python3
'''
This Script Loads the Existing Scenario and Run the Simultaenous Throughput over time and Generate Report and Plot the Graph
This Scrip has three classes :
1. LoadScenario : It will load the existing saved scenario to the Lanforge (Here used for Loading Bridged VAP)
2... |
'''
Runs the XYZA axes for 24-hours, and every 10 cycles will test to see if
any of the axes have skipped by >0.5 mm
Run through an SSH session by calling with "nohup" to keep it running after
disconnecting the terminal
Example of calling this script:
nohup python -m opentrons.tools.overnight_test &
'''
import... |
import os
import sys
import collections
import typing
import re
from json import JSONDecoder
from typing import List
import pandas as pd
import requests
from d3m.primitive_interfaces.transformer import TransformerPrimitiveBase
from d3m.primitive_interfaces.base import CallResult
from d3m import container, utils
from d... |
from __future__ import print_function,division
import os,sys,re
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import h5py
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage import median_filter
from scipy.optimize import leastsq, curve_fit
from scipy.signal import lombscargl... |
# Copyright (C) 2016 Bouygues Telecom.
#
# 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 functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import models.modules.module_util as mutil
from utils.util import opt_get
class ResidualDenseBlock_3C(nn.Module):
def __init__(self, nf=64, gc=32, bias=True):
super(ResidualDenseBlock_3C, self).__init__()
# gc: gro... |
# Copyright (c) 2017 The Khronos Group 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 ... |
import os
import shutil
import tempfile
import lbryum.wallet
from decimal import Decimal
from collections import defaultdict
from twisted.trial import unittest
from twisted.internet import threads, defer
from lbrynet.core.Error import InsufficientFundsError
from lbrynet.core.Wallet import Wallet, LBRYumWallet, Reserv... |
import re
from collections import OrderedDict
import pandas as pd
import numpy as np
import probablepeople
import usaddress
STATES = {"AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "N... |
import re
from os import environ
import boto3
import pytest
from botocore.exceptions import ClientError
from moto import mock_efs
from tests.test_efs.junk_drawer import has_status_code
ARN_PATT = r"^arn:(?P<Partition>[^:\n]*):(?P<Service>[^:\n]*):(?P<Region>[^:\n]*):(?P<AccountID>[^:\n]*):(?P<Ignore>(?P<ResourceType... |
#!/usr/bin/env python
'''
graph a MAVLink log file
<NAME> August 2011
'''
from __future__ import print_function
from builtins import input
from builtins import range
import datetime
import matplotlib
import os
import re
import sys
import time
from math import *
try:
from pymavlink.mavextra import *
except:
pr... |
"""
These functions are originally located at `Catalyst. Reproducible and fast DL & RL`_
Some methods were formatted and simplified.
.. _`Catalyst. Reproducible and fast DL & RL`:
https://github.com/catalyst-team/catalyst
"""
import argparse
import copy
import json
import re
from collections import OrderedDict, M... |
'''
Copyright (C) 2010-2021 Alibaba Group Holding Limited.
'''
# pylint: disable=invalid-name,too-many-branches,too-many-statements
import os
import sys
import uuid
from torch import nn
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
try:
import PlainNet
from PlainNet import _get_ri... |
import os
import warnings
from argparse import ArgumentParser
import torch
import torch.nn as nn
import torch.optim as optim
from ignite.contrib.handlers import ProgressBar
from ignite.contrib.handlers.tensorboard_logger import *
from ignite.engine import Events, Engine
from ignite.metrics import RunningAverage, Loss,... |
import datetime
from os import environ
import mohawk
import pytest
from freezegun import freeze_time
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APIClient
from django.conf import settings
from export_readiness.tests.factories import ArticlePageFactory
... |
import pickle
import argparse
import sys
import onmt
from codit.clone_based_model import clone_based_structural_transformation
from codit.grammar import JavaGrammar
from translate_structure import translate_all as structure_translate
import os
from defj_experiment.translate_token import main as token_translate
from u... |
#!/usr/bin/python
import sys
from os.path import join,exists,dirname
import numpy as np
from numpy.random import randint
from sklearn.datasets import load_svmlight_file
from torch.autograd import Function, Variable
import torch.nn as nn
import torch.optim as optim
import torch
from torch import FloatTensor
from uda_c... |
from typing import Dict, Union, Callable, Iterable
from abc import ABC
from textwrap import dedent
from datetime import datetime
from functools import partial
import swimport
from swimport.model import FileSource
import swimport.swim as swim_module
class Pool(ABC):
"""a class for pools or pools with partial ar... |
# -*- coding: utf-8 -*-
# Copyright 2018 NTT Communications
#
# 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 app... |
import logging
import numpy as np
from numpy.linalg import norm
from scipy.stats import moment
from scipy.special import cbrt
def common_usr(molecule, ctd=None, cst=None, fct=None, ftf=None, atoms_type=None):
"""Function used in USR and USRCAT function
Parameters
----------
molecule : oddt.toolkit.M... |
# ===============================================================================
# Copyright 2020 ross
#
# 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/LICE... |
import os
import shutil
import subprocess
import pandas as pd
from oemof.tools.logger import define_logging
from pandas.testing import assert_frame_equal
import yaml
def setup_logging(log_path):
define_logging(logpath=log_path, logfile="oemoflex.log")
def load_yaml(file_path):
with open(file_path, "r") as ... |
from typing import Tuple, List
import argparse
import random
from pathlib import Path
from itertools import chain
from functools import reduce
import cv2
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.utils import Sequence
from tensorflow.keras import optimizers as op... |
import logging
from farm.modeling.tokenization import Tokenizer, tokenize_with_metadata, truncate_sequences
from transformers import BertTokenizer, RobertaTokenizer, XLNetTokenizer
import re
def test_basic_loading(caplog):
tokenizer = Tokenizer.load(
pretrained_model_name_or_path="bert-base-cased",
... |
"""
Ludolph: Monitoring Jabber Bot
Original Library: Copyright (C) 2011 <NAME> (https://github.com/jsleetw/crontab.py)
Ludolph Modification: Copyright (C) 2014-2017 Erigones, s. r. o.
This file is part of Ludolph.
See the LICENSE file for copying permission.
"""
import logging
import time
from datetime import datetime... |
# Copyright 2021 NREL
# 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 writing, software
# distri... |
##
# Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved.
#
# File: lownerjohn_ellipsoid.py
#
# Purpose:
# Computes the Lowner-John inner and outer ellipsoidal
# approximations of a polytope.
#
#
# Note:
# To plot the solution the Python package pyx is required.
#
#
# References:
# [1] ... |
import datetime
import os
import sys
import traceback
from os.path import expanduser
from shutil import copyfile
import nose.plugins.base
from jinja2 import Environment, FileSystemLoader
from nose.plugins.base import Plugin
class MarketFeatures(Plugin):
"""
provide summery report of executed tests listed per... |
# get overview of data
# read data from given files, and produce a reduced image of each data file
import argparse
import logging
import math
import os
import shutil
import subprocess
from typing import Any, Dict, List, Optional
import h5py
import nibabel as nib
import numpy as np
from PIL import Image
from tqdm impo... |
from typing import Dict, List
from dataclasses import dataclass, field
import tvm
from tvm import relay
import pickle
import random
import numpy as np
import random
from copy import deepcopy
from .tvmpass import PassDependenceGraph, PassNode
# TODO: Add parameters.
# TODO: Add more passes.
_RELAY_FUNCTION_HARD_PASSE... |
import os
import argparse
import matplotlib.pyplot as plt
from datetime import datetime, timedelta, date
import nottingham_covid_modelling.lib.priors as priors
import numpy as np
import pints
from nottingham_covid_modelling import MODULE_DIR
# Load project modules
from nottingham_covid_modelling.lib._command_line_args... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/aghast/blob/master/LICENSE
import math
import numbers
try:
from inspect import signature
except ImportError:
try:
from funcsigs import signature
except ImportError:
raise ImportError("Install funcsigs package w... |
"""
Utilities for starting up a test slapd server
and talking to it with ldapsearch/ldapadd.
"""
import sys, os, socket, time, subprocess, logging
_log = logging.getLogger("slapd")
def quote(s):
'''Quotes the '"' and '\' characters in a string and surrounds with "..."'''
return '"' + s.replace('\\','\\\\')... |
"""
Replace markdown tags by html tags.
TO DO:
* replace ### \|+ headers not by <hx> but by <div><hx>title</hx>content</div>?
"""
import re
from bs4 import BeautifulSoup
if __name__ == '__main__':
from os import sys, path
root_folder = path.dirname(path.dirname(path.abspath(__file__)))
root_folder = path.... |
from collections import defaultdict, namedtuple
from math import ceil, floor
from time import time
import sublime
import sublime_plugin
from ..core import RequestCommandMixin
from ..core.parsers import parse_requests
from ..core.responses import prepare_request
ResponseMetrics = namedtuple("ResponseMetrics", "elapse... |
import re
import pathlib
import tempfile
from collections import OrderedDict
from enum import Enum
from functools import lru_cache
from typing import List, Union, Dict
from hikari.resources import cif_core_dict
from hikari.utility import make_abspath
class CifBlock(OrderedDict):
"""
CifBlock object handles ... |
#!/usr/bin/python3
""" Redis Note Connector module
"""
import re
import time
import redis
import uuid
import ashaw_notes.utils.search
import ashaw_notes.utils.configuration
CONFIG_SECTION = 'redis_notes'
logger = ashaw_notes.utils.configuration.get_logger()
def is_enabled():
"""Checks if connector is enabled""... |
import unittest
import numpy as np
import matplotlib
matplotlib.use('Agg')
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal
from openmdao.utils.testing_utils import use_tempdirs
import dymos as dm
class _BrachistochroneTestODE(om.ExplicitComponent):
def initialize(self):
... |
from __future__ import absolute_import, division, print_function
import time
from mmtbx.validation import validate_ligands
from mmtbx.validation.validate_ligands import master_params_str
import mmtbx.model
import iotbx.pdb
from libtbx.utils import null_out
import libtbx.load_env
from libtbx.test_utils import approx_equ... |
import rclpy
from rclpy.node import Node
from spherov2 import scanner
from spherov2.sphero_edu import SpheroEduAPI
from spherov2.types import Color
from datetime import datetime
from datetime import timedelta
import argparse
from sensor_msgs.msg import Imu
from nav_msgs.msg import Odometry
from geometry_msgs.msg imp... |
#!/usr/bin/env python
# coding=UTF-8
import os
import sys
import getpass
import traceback
from operators.op import op
from globalConfig import globalConfig
from db.controllers.ServidorController import ServidorController
serverManager = None
class ServerManager():
'''
# Base Server Manager
Description ... |
"""
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... |
#!/usr/bin/env python3
# encoding: utf-8
# Copyright 2020 Nagoya University (<NAME>)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
# Calculate MCD using converted waveform.
import argparse
import fnmatch
import multiprocessing as mp
import os
import numpy as np
import pysptk
import pyworld as pw
impor... |
# -----------------------------------------------------------
# MIT Licence (Expat License Wording)
# -----------------------------------------------------------
# Copyright © 2020, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation f... |
import numpy as np
def load_synth_spectra(regridded=True, small=False, npca=10,\
noise=False, SN=10, datapath=None,\
wave_split=None, boss=False, hetsced=False,
bossnoise=False, test=False):
if datapath is None:
datapath = "/net/vdesk/d... |
from __future__ import absolute_import
import six
from abc import abstractmethod
import logging
from django.db.models import Prefetch
from django.core import exceptions as django_exceptions
from clims.services.exceptions import DoesNotExist
from clims.models.extensible import ExtensibleProperty
from clims.models impor... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
def _upsample_like(src, tar):
src = F.interpolate(src, size=tar.shape[2:],
mode='bilinear',
align_corners=True)
return src
class ConvBNReLU(nn.Module):
... |
import base64
import urllib2
import json
import os
import logging
from celery import task
from django.conf import settings
from django.utils.timezone import now
from github.GithubObject import NotSet
from github import Github, GithubException, InputGitTreeElement
from ide.git import git_auth_check, get_github
from id... |
from enum import Enum
import os
import pygame
import pygame.gfxdraw
import pygame.ftfont
import pygame.image
import pygame.transform
import numpy as np
import game_logic as game
from square_rect import SquareRect
from config import config
SQUARESIZE = 100
HALF_SQUARE = int(SQUARESIZE / 2)
RADIUS = int(HALF_SQUARE - ... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
#!/usr/bin/env python
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/cspp_base.py
@author <NAME>
@brief Base Parser for a cspp dataset driver
Release notes:
initial release
"""
import copy
import re
import string
from mi.core.log import get_logger
from mi.core.common i... |
"""The Breaktrough game."""
from sys import argv
from typing import List, Any, Tuple
from random import choice
Row = List[int]
Board = List[Row]
def new_board(n: int, p: int) -> Board:
"""Initialize a fresh new board of n rows and p columns and returns it."""
empty_board = [[0 for x in range(p)] for y in ra... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import datetime
import collections
from midas.compat import unittest
class PigSchemaToPyStructTests(unittest.TestCase):
def _get_target(self):
from midas.pig_schema import pig_schema_to_py_struct
return pig_schema_to_py_struct
... |
import discord
import asyncio
import discord
import asyncio
from discord.ext import commands
import random
from discord.ext.commands.cooldowns import BucketType
import datetime
import psycopg2
from Principais.principais import bot, mydb, cursor
bot = bot
mydb = mydb
cursor = cursor
async def On_command_error(ctx,... |
from django.utils import simplejson
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from basic.blog.models import Post, Category
from django.conf import settings
from django import http
from django.template import loader, Context
from django_proxy.models import Proxy
from django.view... |
# import the necessary packages
from imutils.video import VideoStream
import numpy as np
import argparse
import imutils
import time
import cv2
import os
import torch
from PIL import Image
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
from torch.autograd import Variable
import ... |
# version code 80e56511a793+
# Please fill out this stencil and submit using the provided submission script.
# Be sure that the file voting_record_dump109.txt is in the matrix/ directory.
## 1: (Task 2.12.1) Create Voting Dict
def create_voting_dict(strlist):
"""
Input: a list of strings. Each string rep... |
from __future__ import absolute_import, print_function
import os.path
from uuid import uuid4
from functools import wraps
import warnings
import logging
logger = logging.getLogger(__file__)
from six import add_metaclass, iteritems
from six.moves.urllib.parse import urlsplit
from .embed import autoload_static, autolo... |
"""Turnt is a simple expect-style testing tool for command-line
programs.
"""
import click
import tomlkit
import os
import shlex
import subprocess
import tempfile
import shutil
import sys
import re
import contextlib
from concurrent import futures
__version__ = '1.6.0'
DIFF_DEFAULT = 'diff --new-file --unified'
STDOUT... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
# @author Darrell
import os
import re
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageColor
_visualizeMargins = False
# -----------------------------------------------------------------------------
class FontData:
de... |
import collections
import contextlib
import sys
import wave
import webrtcvad
import librosa
def read_wave(path):
with contextlib.closing(wave.open(path, 'rb')) as wf:
num_channels = wf.getnchannels()
assert num_channels == 1
sample_width = wf.getsampwidth()
assert sample_width ==... |
import math
from typing import Dict, Optional, Union, Tuple, List, cast
from collections import defaultdict
from .backends import Ops, NumpyOps, CupyOps, get_current_ops
from .types import Generator, FloatsXd
from .config import registry
KeyT = Tuple[int, str]
FloatOrSeq = Union[float, List[float], Generator]
IntOr... |
"""
Library to deal unstable species
"""
import automol
from mechlib import filesys
from mechlib.amech_io import printer as ioprinter
# Handle reaction lst
def split_unstable_full(pes_rlst, spc_rlst, spc_dct,
spc_model_dct_i, save_prefix):
""" Loop over the pes reaction list and break up... |
from itertools import tee
import numpy as np
import scipy.interpolate as intp
from scipy.signal import savgol_filter
def get_edge_bin(array):
"""Detect the edge indcies of a binary 1-D array.
Args:
array (:class:`numpy.ndarray`): A list or Numpy 1d array, with binary
(0/1) or boolean (True... |
from ctypes import *
import threading
import json
import os
import arcpy
class MyBuffer(threading.local):
def __init__(self):
self.buf = create_string_buffer(65535)
self.bufSize = sizeof(self.buf)
#arcpy.AddMessage("Created new Buffer {}".format(self.buf))
tls_var = MyBuffer()
from .G2Exception import ... |
"""This package provides compatibility interfaces for v1/v2."""
import cStringIO
import gzip
import hashlib
import json
from containerregistry.client.v2 import docker_image as v2_image
from containerregistry.client.v2 import util as v2_util
from containerregistry.client.v2_2 import docker_http
from containerregistr... |
#!/usr/bin/env python3
"""
Hexdump Utility
===============
A command line hexdump utility.
See the module's `Github homepage <https://github.com/risapav/ihex_analyzer>`_
for details.
"""
# pouzite kniznice
import struct
import codecs
# definovanie konstant
ROWTYPE_DATA = 0x00 # Data container
ROWTYPE_EOF = 0x01 # E... |
import os
import json
import torch
import sys
import time
import random
import numpy as np
from tqdm import tqdm, trange
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
from apex.parallel import DistributedDataParallel as DDP
from apex import amp
s... |
# -*- coding: utf-8 -*-
import os, sys, pdb
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as data
from torchvision import datasets, transforms
import numpy as np
import cv2, copy, time
import matplotlib.pyplot as plt
from scipy.ndimage import binary_fill_hol... |
import os
import subprocess
from inspect import isclass
import configargparse
import numpy as np
import sqlalchemy
import yaml
from IPython import embed
from angular_solver import solve
from database import Config, ConfigHolder, Graph, Task, get_session, DatabaseGraphGenome
from genetic_algorithm import (GeneticAlgo... |
import os
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.jit.annotations import List, Dict
from torchvision.ops.misc import FrozenBatchNorm2d
from .feature_pyramid_network import FeaturePyramidNetwork, LastLevelMaxPool
class Bottleneck(nn.Module): # conv block 和 identity block
... |
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... |
# Copyright (c) 2020 PaddlePaddle 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 appli... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
"""
Submlime Text Package File Search.
Licensed under MIT
Copyright (c) 2012 <NAME> <<EMAIL>>
"""
import sublime
import re
from os import walk, listdir
from os.path import basename, dirname, isdir, join, normpath, splitext, exists
from fnmatch import fnmatch
import zipfile
__all__ = (
"sublime_package_paths",
... |
import contextlib
import numbers
import typing
import numpy as np
import pandas as pd
from river import base
from river import optim
from river import utils
__all__ = [
'LinearRegression',
'LogisticRegression',
'Perceptron'
]
class GLM:
"""Generalized Linear Model.
This serves as a base class... |
"""Prioritization scheme for identifying follow up variants in tumor-only samples.
Generalizes the filtering scheme used in VarDict post-processing:
https://github.com/AstraZeneca-NGS/VarDict/blob/9ffec9168e91534fac5fb74b3ec7bdd2badd3464/vcf2txt.pl#L190
The goal is to build up a standard set of prioritization filter... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 5 13:38:43 2022
@author: Dartoon
"""
import numpy as np
from scipy import ndimage
import scipy.optimize as op
from galight.tools.astro_tools import plt_fits
import matplotlib.pyplot as plt
def shift_img(img, shift_pix, order=1):
shift_pix = s... |
import yaml
import numpy as np
from os import path
from absl import flags
from pysc2.env import sc2_env
from pysc2.lib import features
from pysc2.lib import actions
sc2_f_path = path.abspath(path.join(path.dirname(__file__), "..", "configs", "sc2_config.yml"))
with open(sc2_f_path, 'r') as ymlfile:
sc2_cfg = yam... |
#!/usr/bin/env python
# title : savegolds.py
# description : Saves replay buffer of your best livesplit segment
# authors : hies, Bootscreen
# date : 2020 08 06
# version : 1.0-0
# dependencies : Python 3.6, livesplit, livesplit.server, moviepy
# notes ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.