text stringlengths 6.04k 39.5k |
|---|
"""
The physcalc module contains the routine that calculates the ionic
fraction and the NEI X-ray spectrum based on the physical conditions
in an ASCII file.
V0.1 - <NAME>, May 22, 2019: initial release
V0.2 - <NAME>, May 28, 2019: separate the CIE and NEI case
V0.3 - <NAME>, Jun 01, 2019: standardize for github uploa... |
#!/usr/bin/env python
import argparse
import os
from tqdm import tqdm
import pprint as pp
import numpy as np
import h5py
import json
import torch
import torch.optim as optim
import torch.autograd as autograd
from torch.optim import lr_scheduler
from torch.autograd import Variable
from torch.utils.data import DataLoade... |
"""
A library for working with B-series.
We use the coefficient normalization that appears in
HLW (1.23), and in CHV2010 on the middle of p. 411.
"""
indices = 'jklmpqrstuvwxyz'
import sympy
h = sympy.Symbol('h')
y = sympy.Symbol('y')
import numpy as np
class BSeries(object):
def __init__(self, coeffs=None, F... |
# NCC: Neural Code Comprehension
# https://github.com/spcl/ncc
# Copyright 2018 ETH Zurich
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follo
# wing conditions are met:
# 1. Redistributions of source code must retain the abov... |
#
# Copyright (c) 2017 by QA Cafe.
# All Rights Reserved.
#
"""Module for accessing CDRouter System."""
import os.path
from marshmallow import Schema, fields, post_load
class Version(object):
"""Model for CDRouter Release Versions.
:param raw: (optional) Raw version as string.
:param major: (optional) ... |
from __future__ import print_function
import ConfigParser
import argparse
import pickle
import sys
import os
import subprocess
import shutil
import time
pickle_name = "dump.pkl" # contains all the measurement objects in a list
history_file = "history.log"
clock_interval = 20 # in seconds
STATE_NONE = -1
STATE_ITERATI... |
import numba
import numpy as np
from scipy.ndimage import convolve1d
from immutabledict import immutabledict
import strax
import straxen
export, __all__ = strax.exporter()
@export
@strax.takes_config(
strax.Option('coincidence_level_recorder_nv', type=int, default=4,
help="Required coincidence l... |
import os
import numpy as np
from collections import Counter
import abc
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
import torch.nn.functional as F
from .utils.coqa import compute_eval_metric
from .utils.quac import eval_fn as quac_eval_fn
fro... |
import sys
import numpy as np
import matplotlib.pyplot as plt
def boost(vault, eth_price, gas_price, service_fee):
'''
Given a vault (dictionary), checks if the vault can be boosted, and if yes, boosts it and returns the new vault.
Parameters:
vault (dictionary): A dictionary representin... |
"""
Support for range types adaptation.
"""
# Copyright (C) 2020-2021 The Psycopg Team
import re
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Type, Tuple
from typing import cast
from decimal import Decimal
from datetime import date, datetime
from .. import errors as e
from .. import postgres
f... |
import sentencepiece as spm
import re
import numpy as np
from collections import OrderedDict
from typing import List
from tensorlayerx import logging
class Trie:
"""
Trie in Python. Creates a Trie out of a list of words. The trie is used to split on `added_tokens` in one pass
Loose reference https://en.wi... |
import argparse
from collections import defaultdict
import heapq
import logging
import time
from typing import List
import numpy as np
from .decoder import Decoder
from ..annotation import Annotation
from . import utils
from .. import headmeta, visualizer
# pylint: disable=import-error
from ..functional import caf_c... |
# -*- coding: utf-8 -*-
# This file is part of Exdir, the Experimental Directory Structure.
#
# Copyright 2017 <NAME>
#
# License: MIT, see "LICENSE" file for the full license terms.
#
# This file contains code from h5py, a Python interface to the HDF5 library,
# licensed under a standard 3-clause BSD license
# with c... |
"""
This module contains geoscience-related transfer functions whose use is completely optional.
"""
from __future__ import division
import numpy as np
import datashader.transfer_functions as tf
from datashader import Canvas
from datashader.colors import rgb
from datashader.utils import ngjit, lnglat_to_meters # ... |
import random
import struct
import sys
from typing import List
# for (j = 0LL; j != 64; j += 8LL)
# {
# v736[j + 0] = (((((((v735[j] * pubkey_part[128] % 0xFFFFFFFB + v735[j + 1] * pubkey_part[136]) % 0xFFFFFFFB + v735[j + 2] * pubkey_part[144]) % 0xFFFFFFFB + v735[j + 3] * pubkey_part[152]) % 0xFFFFFFFB + v735[j... |
"""
Compute mixed Nash equilibria of a 2-player normal form game by the
Lemke-Howson algorithm.
Edit
"""
import numbers
import numpy as np
from numba import jit
from .utilities import NashResult
TOL_PIV = 1e-10
TOL_RATIO_DIFF = 1e-15
def lemke_howson(g, init_pivot=0, max_iter=10**6, capping=None,
f... |
import ast
import math
import pickle
import random
from copy import deepcopy
from typing import List, Tuple, Union
import numpy as np
import pandas as pd
from rl_coach.core_types import CsvDataset, Episode, Transition
from rl_coach.filters.filter import InputFilter
from rl_coach.logger import screen
from rl_coach.memo... |
"""Convert foyer ForceField XMLs to the GMSO format."""
import pathlib
from lxml import etree
from gmso.exceptions import ForceFieldParseError
def from_foyer_xml(
foyer_xml, gmso_xml=None, overwrite=False, validate_foyer=False
):
"""Convert a foyer XML to a gmso XML.
Parameters
----------
foyer... |
from __future__ import print_function
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from astroquery.simbad import Simbad
import astroquery
import astropy
import astropy.coordinates
import astropy.units as u
import astropy.coordinates
from astropy.time import Time
from astropy.coordinates impor... |
"""
flask_security.datastore
~~~~~~~~~~~~~~~~~~~~~~~~
This module contains an user datastore classes.
:copyright: (c) 2012 by <NAME>.
:copyright: (c) 2019-2020 by <NAME> (jwag).
:license: MIT, see LICENSE for more details.
"""
import json
import uuid
from .utils import config_value
class Da... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Urwid escape sequences common to curses_display and raw_display
# Copyright (C) 2004-2011 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free So... |
import tempfile
import typing
import asyncio
from urllib.parse import SplitResult, parse_qsl, urlencode, urlsplit
from rpcpy.types import Environ, Scope
from rpcpy.utils import cached_property
__all__ = [
"FormData",
"MutableHeaders",
"Headers",
"UploadFile",
"URL",
]
class URL:
def __init__... |
#!python
import copy
##Author: Lijun
#
#History:
#V0.4 2022-01-05
#增加功能:1)在运行过程中增加“自动完成”功能,自动模拟完成操作。
#
#V0.3 2021-12-18
#增加功能:增加初始场景,游戏可以从多个初始场景中选择1个。
#
#V0.2 2021-12-16
#增加功能:返回上一步;返回上一步后,删除本步骤、上一步变为最后一步;如果没有上一步则菜单不显示
#V0.1 2021-12-15
#实现基础功能:一种初始化图形,可以人工操作游戏,游戏成功有提示
#
#
#
#
#Guanyu=11 (*1) ;关羽2*1(水平*竖直,下同) ... |
"""
Module implements Constraint class and DPQuery class.
Constraint is a querybase query with sign and answer to that query.
DPQuery is a querybase query with noisy answer and information about DP mechanism used to get that answer (budget, variance, mechanism name)
Also StackedConstraint and StackedDPQuery classes ar... |
# coding: utf-8
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
# A note on the tests.
# These tests are for asserting the command line syntax.
# These tests do NOT need to connect to the control plane.
# Tests:
# test-1: Run command without any arguments.
# Assert that the output ... |
#!/usr/bin/env python3
#
# Copyright 2015 Dovetail Genomics LLC
#
#
from __future__ import division
from __future__ import print_function
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
import math
import sys
"""Chicago likelihood model calculations as de... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 <NAME>
"""Module with statement download tests for all supported P2P platforms."""
from datetime import date
import logging
import os
import tempfile
from typing import Optional, Tuple
import unittest.mock
import pandas as pd
from selenium.common.exceptions import W... |
import copt
import torch
from irlco.masking import generate_square_subsequent_mask, generate_batch_of_sorted_element_masks
from irlco.routing.env import BatchCircuitRoutingEnv
from irlco.routing.mp_evaluation import mp_evaluate
def greedy_decode(env, initial_states, policy_net, device=torch.device('cuda'), return_all... |
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A factory test that utilizes Chameleon to do automated display testing."""
import contextlib
import logging
import os
import xmlrpc.client
from PIL i... |
from tkinter import *
import random as r
import tkinter.messagebox
from functools import partial
tk=Tk()
tk.geometry('1794x700')
tk.configure(bg="deep sky blue")
tk.title("Jeu du Pendu")
Canvas=Canvas(tk, bg="deep sky blue", width=1794, height=700)
tk.resizable(False, False)
#---------------Définition des variables--... |
# -*- coding: utf-8 -*-
"""
This module contains functions for formulating systems of Ordinary Differential
Equations (ODE-systems) which may be integrated numerically to model temporal
evolution of concentrations in reaction systems.
"""
from __future__ import (absolute_import, division, print_function)
from collecti... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import nextcord
from nextcord.abc import _Overwrites
from nextcord.interactions import Interaction
import mongodb
import UpdateELO
from battle import Battle
from datetime import datetime as dt
import logging
import bot
import sys
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.F... |
import cv2
import numpy as np
import os
import math
from scipy.spatial import distance as dist
from collections import OrderedDict
lower_green = np.array([89, 250, 250])
upper_green = np.array([90, 255, 255])
lower_rgb = np.array([10,180,120])
upper_rgb = np.array([40,255,250])
class Bouncing_point():
def __in... |
import sys
import requests
import urllib3
import pyttsx3
from threading import Thread
from time import sleep
from copy import deepcopy
from prettytable import PrettyTable
from localisation import *
server = "https://10.10.10.100:8006"
auth = {'username': "root@pam", 'password': "<PASSWORD>"}
message = EN # Localisati... |
# simulation setup and simulation objects
from __future__ import generators # retain python 2.2 compatibility
from decimal import *
import copy, re
from PyPlotter import Gfx, Colors
from PopulationDynamics import Dynamics
import PrisonersDilemma as PD
from PopulationDynamics.Compatibility import *
from Logging import ... |
from typing import Optional, Union
import torch
import torch.nn as nn
import torch.distributions as D
from .functions import *
from .common import *
class MultiDecoder(nn.Module):
def __init__(self, features_dim, conf):
super().__init__()
self.image_weight = conf.image_weight
self.vecobs... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
#!/usr/bin/env python
# coding: utf-8
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
import argparse
import sys
import os
from copy import deepcopy
import re
import csv
import time
import configparser
import h5py
import traceback
import math
import numpy as np
# from PIL import Image
import ... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
import geoip2.database
from scapy.all import *
import collections
from pyecharts import options as opts
from pyecharts.charts import Pie
from pyecharts.charts import Geo
from pyecharts.charts import Line
from pyecharts.globals import ChartType, SymbolType
def line_base(in_x, in_y, out_y):
c = (
Line()
... |
# coding: utf-8
import os
import sys
import uuid
import json
import time
import subprocess
from math import ceil
from copy import deepcopy
import george
import numpy as np
import pandas as pd
import cymetric as cym
import dtw
MONTH_SHUFFLE = (1, 7, 10, 4, 8, 6, 12, 2, 5, 9, 11, 3)
NULL_SCHEDULE = {'build_times': [{'... |
from datetime import date, time, datetime
import zlib
from tablite import Table
from tablite.stored_list import StoredList
def test_basic_table():
# creating a tablite incrementally is straight forward:
table = Table(use_disk=True)
table.use_disk = True
table.use_disk = False
table.use_disk = Tru... |
import datetime
import queue
import logging
import signal
import time
import threading
import tkinter as tk
from tkinter.scrolledtext import ScrolledText
from tkinter import ttk, VERTICAL, HORIZONTAL, N, S, E, W
import os
from tkinter import filedialog
from tkinter import *
import pandas as pd
from time im... |
"""
This module contain the Vec2d class that is used in all of easymunk when a
vector is needed.
The Vec2d class is used almost everywhere in easymunk for 2d coordinates and
vectors, for example to define position vector in a Body. However, easymunk is
smart enough to convert tuples to Vec2ds so you usually do not nee... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import numpy as np
import os
import nibabel as nib
import glob
import re
import matplotlib.pyplot as plt
import matplotlib
# matplotlib.use('TKAgg') # Use this for console plotting
import argparse
def read_file(filename):
img = nib.load(filename)
data = img.get_fdata()
aff = img.affine
return data, a... |
# -*- coding: utf-8 -*-
"""
Data Table View
===============
"""
# %% IMPORTS
# Built-in imports
# Package imports
from qtpy import QtCore as QC, QtGui as QG, QtWidgets as QW
# GuiPy imports
from guipy import layouts as GL, widgets as GW
from guipy.plugins.data_table.widgets.headers import (
HorizontalHeaderVi... |
import os
import time
import random
import math
import subprocess
import pynex
import pygame
# Init
pynex.request_android_default_permissions()
pygame.init()
# Create window and main frame
display_flags = pygame.RESIZABLE | pynex.FORCE_FULL_SCREEN # | pygame.DOUBLEBUF
screen = pygame.display.set_mode((800, 600), di... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
import copy
import os
import numpy as np
import pytest
from numpy.testing import assert_array_equal
astropy = pytest.importorskip("astropy")
from astropy.io import fits
from astropy.table import Table
from jsonschema.exceptions import ValidationError
import asdf
from asdf import fits_embed, get_config
from asdf impo... |
from flask import Blueprint, render_template, abort, flash, redirect, request
from flask_login import current_user, login_required
from app.decorators import admin_required
from app.email import send_email
from .forms import *
organisations = Blueprint('organisations', __name__)
ALLOWED_EXTENSIONS = {'png', 'jpg', '... |
from nmt.model.transformer.model import build_model
from utils.context import Context
from nmt.data.batch import Batch
from nmt.utils.pad import subsequent_mask
from torchtext import data
from torch.autograd import Variable
from torch import nn
import torch
import time
global max_src_in_batch, max_tgt_in_b... |
#! /usr/bin/python3
""" Snow / static simulation using curses. """
import argparse
import curses
import datetime
import os
import sys
from random import randint
from random import choice
from time import sleep
from typing import List
from typing import Optional
from typing import Sequence
if sys.version_info >= (3, ... |
#!/usr/bin/env python
import AcqirisWrapper as Aq
import InstrumentDriver
from InstrumentConfig import InstrumentQuantity
import numpy as np
# for long integer py2/py3 compatibility
from builtins import int
class Error(Exception):
pass
class Driver(InstrumentDriver.InstrumentWorker):
""" This class implement... |
#!/usr/bin/python
# Copyright (c) 2017, 2018, 2019, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TX... |
r"""
Affine factorization crystal of type `A`
"""
#*****************************************************************************
# Copyright (C) 2014 <NAME> <anne at math.ucdavis.edu>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*************... |
#!/usr/bin/env python
# -*- coding:utf8 -*-
# ================================================================================
# Copyright 2022 Alibaba Inc. All Rights Reserved.
#
# History:
# 2022.03.01. Be created by xingzhang.rxz. Used for language identification.
# 2018.04.27. Be created by jiangshi.lxq. Forked an... |
"""Dash HTML-ish layout."""
import base64
import logging
from typing import Any, Dict, List, Tuple, Union
import dash_bootstrap_components as dbc # type: ignore[import]
import dash_daq as daq # type: ignore[import]
import visdcc # type: ignore[import]
from dash import dcc, html # type: ignore
from dash.dependenci... |
from enum import Enum
import random
from copy import deepcopy
class Role(Enum):
NOTHING = 0
VILLAGER = 1
WEREWOLF = 2
SEER = 3
TROUBLEMAKER = 4
ROBBER = 5
HUNTER = 6
TANNER = 7
MINION = 8
MASON = 9
DRUNK = 10
INSOMNIAC = 11
DOPPELGANGER = 12
class Card():
def __... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
class Const(object):
"""
Generic constants that don't have another home
"""
JSON_CONTENT_TYPE = "application/json"
JSON_CONTENT_ENCODING = "utf-8"... |
"""Base classes and functionalities for dataloaders"""
from collections.abc import Mapping
import inspect
from ..base import NID, EID
from ..convert import heterograph
from .. import backend as F
from ..transforms import compact_graphs
from ..frame import LazyFeature
from ..utils import recursive_apply
def _set_lazy_f... |
# encoding: utf-8
import sys
import re
import argparse
from workflow.workflow import MATCH_ATOM, MATCH_STARTSWITH, MATCH_SUBSTRING, MATCH_ALL, MATCH_INITIALS, MATCH_CAPITALS, MATCH_INITIALS_STARTSWITH, MATCH_INITIALS_CONTAIN
from workflow import Workflow3, ICON_WEB, ICON_WARNING, ICON_BURN, ICON_ERROR, ICON_SWITCH, IC... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
import seaborn as sns
import json
import argparse
import os
import sys
from typing import List, Dict, Any
from ast import literal_eval
"""
Plot heatmap or violinplot of tactics and vendors
"""
CPE_ID_NOR... |
###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... |
from tkinter import ttk, Tk, StringVar, END, N, S, E, W, NORMAL, DISABLED
from tkinter.scrolledtext import ScrolledText
import time, clipboard
from timekeeper.grid_table import GridTable
from timekeeper.Export import Export
from timekeeper.Popups import PopConfirm, EntryBox
class ReportEditApp(): ### 'Report hours' ... |
"""
Module to read ANSYS ASCII block formatted CDB files
"""
import sys
import logging
import numpy as np
from vtk import (VTK_TETRA, VTK_QUADRATIC_TETRA, VTK_PYRAMID,
VTK_QUADRATIC_PYRAMID, VTK_WEDGE, VTK_QUADRATIC_WEDGE,
VTK_HEXAHEDRON, VTK_QUADRATIC_HEXAHEDRON)
import pyvista as pv... |
from pylivetrader.backend import alpaca
from unittest.mock import Mock, patch
from requests.exceptions import HTTPError
import pytest
import pandas as pd
import numpy as np
from alpaca_trade_api.entity import Asset, Account, Position, Order
from alpaca_trade_api.polygon.entity import Aggsv2, Trade
from alpaca_trade_ap... |
"""
Parse mkvmerge into a class
Track options assumed appear after --language
r"|--sync "
r"|--cues "
r"|--default-track "
r"|--forced-track "
r"|--blockadd "
r"|--track-name "
r"|--tags "
r"|--aac-is-sbr "
r"|--reduce-to-core "
r"|--remove-dialog-normalization-gain "
r"|--timestamps "
r"|--default-duration "
r"|--... |
"""Definition of the primary parser for RepoBee.
.. module:: mainparser
:synopsis: The primary parser for RepoBee.
.. moduleauthor:: <NAME>
"""
import types
import argparse
import pathlib
from typing import Union, Mapping
import repobee_plug as plug
from repobee_plug.cli import categorization
import _repobee... |
#
# Copyright Ericsson AB 2013. All rights reserved
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<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/li... |
# Copyright (c) 2019. Partners HealthCare and other members of
# Forome Association
#
# Developed by <NAME> based on contributions by <NAME>,
# <NAME>, <NAME> and other members of Division of
# Genetics, Brigham and Women's Hospital
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... |
import pickle
import numpy as np
from collections import defaultdict
from app.model.preprocessor import Preprocessor as img_prep
import random
class LiteOCR:
def __init__(self, fn="app/model/alpha_weights.pkl", pool_size=2):
# [weights, meta] = pickle.load(open(fn, 'rb'), encoding='latin1') #currently, this class M... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#
# Deep High-Resolution Representation Learning for Human Pose Estimation, CVPR 2019
from __future__ import division
impo... |
import codecs
import fnmatch
import json
import markdown
import os
import re
from collections import OrderedDict
from flask import Blueprint, render_template, request, abort, redirect, Markup
from assemblyline.al.common.security import generate_async_keys
from assemblyline.common.isotime import iso_to_local
from asse... |
from itertools import cycle
import random
import sys
import pygame
import pygame.freetype
from pygame.locals import *
from globals import *
from evolution import *
def main():
global SCREEN, FPSCLOCK, FPS, GAMEFONT
pygame.init()
FPSCLOCK = pygame.time.Clock()
SCREEN = pygame.display.set_mode((SCREEN... |
# program for the little one to practice spelling (and Spanish!)
import cv2
import enum
import tensorflow as tf
import pandas as pd
import numpy as np
import os
from PIL import Image as im
from translate import Translator
from threading import Thread
from datetime import datetime
# only play the spanish word if found ... |
# 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 agreed to in writing, ... |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
"""
Contains :class:`Simulation` and :class:`_poolMemory` classes.
.. currentmodule:: quanguru.classes.QSim
.. autosummary::
Simulation
_poolMemory
.. |c| unicode:: U+2705
.. |x| unicode:: U+274C
.. |w| unicode:: U+2000
======================= ================== ===... |
#
# Copyright © 2020 Intel Corporation.
#
# This software and the related documents are Intel copyrighted
# materials, and your use of them is governed by the express
# license under which they were provided to you (License). Unless
# the License provides otherwise, you may not use, modify, copy,
# publish, distribute,... |
# test_c_est.py test a pretrained DeepFit model and export all estimated parameters
# Author:<NAME> <EMAIL>bs[at]gmail.com
# If you use this code,see LICENSE.txt file and cite our work
from __future__ import print_function
import argparse
import os
import sys
import random
import numpy as np
import torch
import torch.... |
# Copyright 2016 VMware, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
#!/user/bin/python -tt
"""
Call transcription units (TUs) de novo from RNA-Seq in each individual sample.
There are three major steps:
1. keep bins of window size w with >= n average read density (count per bp / length)
2. merge consecutive bins if >= p% of positions covered
3. trim/extend ends
"""
import os
import s... |
import numpy as np
import pandas as pd
from scripts.utils import remove_outliers, linear_regression
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.svm import SVC
from sklearn.preprocessing import normalize
#from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_absolute... |
# -*- coding: utf-8 -*-
""" Plot function for the PDF class
Tools to make nice plots from RooFit pdfs.
The function fast_plot is used by the PDF class
to make default plots.
Todo:
* Plotter class containing the RooFit frame
* Equal length ticks
* Provide matplolib functionality
"""
from __future__ impor... |
# Imports
import os
import jinja2
import webapp2
import logging
import json
import urllib
import MySQLdb
import math
import numpy as np
from datetime import timedelta, datetime
#import pandas as pd
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['... |
import errno
import os
import re
import requests
import sys
import signal
import webbrowser
from contextlib import closing
from time import sleep
from distutils.version import StrictVersion
from livestreamer import (Livestreamer, StreamError, PluginError,
NoPluginError)
from livestreamer.cac... |
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
import sys
from torch.autograd import Variable
import math
def flip(x, dim):
xsize = x.size()
dim = x.dim() + dim if dim < 0 else dim
x = x.contiguous()
x = x.view(-1, *xsize[dim:])
x = x.view(x.size(0), x.size(1)... |
# -*- coding: utf-8 -*-
from typing import List, Tuple
from collections import Counter
import logging
import torch
from ...wrapper import TargetWrapper, Batch
from ...utils.chunk import detect_nested, filter_clashed_by_priority
from ...nn.modules import CombinedDropout, SoftLabelCrossEntropyLoss
from ...nn.init import... |
# Copyright 2015 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... |
#!/usr/bin/env python
# coding: utf-8
import sys
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import norm
from scipy.io import loadmat, savemat
from nbs_class import Ppi, Patient
from subprocess import call
# import h5py
import os
import glob
import time
import datetime
# NOTE mutationProfileD... |
"""Imagniary time analytic continuation kernel routines."""
"""
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ... |
"""
Hyperparameter search parameters
"""
import random
from wandb.util import get_module
from .util import get_numpy
#import scipy.stats as stats
stats = get_module('scipy.stats')
class HyperParameter():
CONSTANT = 0
CATEGORICAL = 1
INT_UNIFORM = 2
UNIFORM = 3
LOG_UNIFORM = 4
Q_UNIFORM = 5
... |
# Starting from ONS dropout data, try to make model predicting proportions of dropouts of ORF1ab (abbreviated to OR), N, S.
# Following on from <NAME>'s analysis at https://theo.io/post/2021-01-22-ons-data/.
# Data from tabs 1a, 1b of spreadsheet here https://www.ons.gov.uk/peoplepopulationandcommunity/healthandsocialc... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" infotext.py v0.2
Simply prints data and stats from various sources. Most useful as input
program to xscreensavers that simply takes some text and displays it.
Currently implemented:
* MPD playing status
* OpenWeatherMap weather data and forecast
* System stats: Loc... |
import json
from decimal import Decimal
from django import forms as django_forms
from django.core.urlresolvers import reverse
from django.http import Http404
import commonware
from rest_framework import exceptions, response, serializers, status, viewsets
from rest_framework.decorators import action
from rest_framewor... |
import numpy as np
import tensorflow as tf
from tqdm import tqdm as tqdm
from distance import levenshtein
import os
import math
import re
class Hparams:
batch_size = 512
enc_maxlen = 20 # The maximum size of the graphemes word (Максимальный размер исходного слова)
dec_maxlen = 20 # The maximum s... |
"""
Implement a complete music player to play local media and youtube videos.
Employ youtube_dl to fetch/transcode youtube videos to a cache.
A general purpose player supporting basic features like
play/pause/next/previous/shuffle
Use a general Song object to modle/persist played volume & repeat se... |
import synapse.exc as s_exc
import synapse.cortex as s_cortex
import synapse.lib.stormsvc as s_stormsvc
import synapse.tests.utils as s_t_utils
class TestService(s_stormsvc.StormSvc):
_storm_svc_name = 'test'
_storm_svc_pkgs = (
{
'name': 'foo',
'version': (0, 0, 1),
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.