text stringlengths 8.04k 46.5k |
|---|
import requests
from bs4 import BeautifulSoup
import jinja2
import re
class Chara:
name = ''
job = ''
hp = 0
mp = 0
str = 0
end = 0
dex = 0
agi = 0
mag = 0
killer = ""
counter_hp = ""
skills = ""
passive_skills = ""
class HtmlParser:
def __init__(self, text):
... |
# -*- coding: utf-8 -*-
# API-documentation: https://app.swaggerhub.com/apis/klacol/ClageHomeServer/1.0.0
import requests
import datetime
from json import JSONDecodeError
from datetime import datetime
import urllib3
NUMBER_OF_CONNECTED_HEATERS = 1 # I have only one heater, so i start with this scenario
class ... |
# -*- coding: utf-8 -*-
# @Date : 2022/4/30 15:52
# @Author : WangYihao
# @File : trainer.py
import os
import platform
import random
import time
from decimal import Decimal
import numpy as np
from loguru import logger
from prettytable import PrettyTable
from tqdm import tqdm
from fairscale.optim.oss import OSS
... |
# Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Special classes for DICOM value representations (VR)"""
from copy import deepcopy
from decimal import Decimal
import re
from datetime import (date, datetime, time, timedelta)
# don't import datetime_conversion directly
from pydicom import config
... |
"""Classes for efficient reading of multipage tif files.
PIL/pillow will parse a tif file by making a large number of very small reads. While this is in general perfectly fine
when reading from the local filesystem, in the case where a single read is turned into an http GET request (for
instance, reading from AWS S3),... |
'''
Created on 2020-03-24 14:33:48
Last modified on 2020-10-27 18:30:27
@author: <NAME> (<EMAIL>)
Main goal
---------
Create an RVE class from which more useful classes can inherit.
Notes
-----
-Based on code developed by <NAME>.
References
----------
1. <NAME>., et al. (2000). Mechanics of Materials 32(8): 449-46... |
from sklearn.utils import resample
from itertools import chain
import random
import numpy as np
import os
import math
from skfeature.function.statistical_based import CFS
from sklearn.feature_selection import SelectKBest, SelectPercentile
from sklearn.feature_selection import chi2, f_classif
from sklearn.ensemble imp... |
def nozzle_size(value, units):
returnDict = {}
if units == 'mm':
returnDict['mm'] = value
returnDict['1/8in'] = value * 0.3149606
returnDict['16/in'] = value * 0.6299213
returnDict['32/in'] = value * 1.2598425
returnDict['64/in'] = value * 2.519685
elif units == '1/8i... |
import asyncio
import importlib
import json
import logging
import math
import os
import random
import sys
import time
import linecache
import aiohttp
import discord
from discord.ext import commands
import code.Perms as Perms
import code.settingsBackend as settings
Perms = Perms.Perms
settings = sett... |
from __future__ import annotations
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from typing import (TYPE_CHECKING, Any, Callable, Dict, Generic, List,
Protocol, Optional, Sequence, Set, Type, TypeVar, Union,
cast)
import typing
from frozenlist imp... |
import sys,time,os,subprocess,json, importlib, binascii, hashlib, shutil
import xml.etree.ElementTree as ET
# from flask_script import Manager
# from app.tables.IAT import Project, Tree, Sample, Task, iatShellData, GlobalValues, iatCaseInfo, iatKeyValues
# from app import app,db
from datetime import datetime
# im... |
import argparse
from sklearn.svm import SVC, LinearSVC
from sklearn.feature_selection import VarianceThreshold
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
from sk... |
"""
MIT License
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
"""The InterUSS Platform Data Node storage API server.
This flexible and distributed system is used to connect multiple USSs operating
in the same general area to share safety information while protecting the
privacy of USSs, businesses, operator and consumers. The system is focused on
facilitating communication among... |
from web3 import Web3
ITEMS = [
("0x72Cb10C6bfA5624dD07Ef608027E366bd690048F", "JEWEL", "Jewel"),
("0x3a4edcf3312f44ef027acfd8c21382a5259936e7", "DFKGOLD", "Gold"),
("0x24eA0D436d3c2602fbfEfBe6a16bBc304C963D04", "DFKTEAR", "Gaia’s Tears"),
("0x6e1bC01Cc52D165B357c42042cF608159A2B81c1", "DFKAMBRTFY", "Ambertaffy... |
# internal data manipulations
import numpy as np # operate on data from the hdf5 file and image generation
import pandas as pd # Data frames from numpy arrays, especially for output
# image generation, manipulation, and analysis
import cv2
from matplotlib import path # dealing with voronoi facets polylines as paths... |
# ext/mypy/decl_class.py
# Copyright (C) 2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from typing import Optional
from typing import Sequence
from typing import Tuple
f... |
import datetime
from dateutil.parser import parse as dateutil_parse
import copy
import numpy as np
from uncertainties import ufloat
from becquerel.tools.isotope import Isotope
from becquerel.tools.isotope_qty import IsotopeQuantity, NeutronIrradiation
from becquerel.tools.isotope_qty import IsotopeQuantityError, UCI_TO... |
#!/usr/bin/env python3
"""
Reads Tags to use them, but not write to them
dependencies: exiftool, Pillow
"""
import datetime as dt
import os
import re
from collections import OrderedDict
import numpy as np
from sortedcollections import OrderedSet
from EXIFnaming.helpers import settings, fileop
from EXIFnaming.helper... |
import os
import errno
import numpy as np
import csv
import time
import json
import pickle
from copy import deepcopy
from src.models.config import cfg
from datetime import datetime
from torch.nn import init
import torch
import torch.nn as nn
import torchvision.utils as vutils
from src.data.nrrd_rw import write_nrrd
... |
import re
import sys
from io import BytesIO
from binascii import unhexlify
from collections import OrderedDict
from datetime import datetime, timedelta, date
from decimal import Decimal
from email.mime.text import MIMEText
from fractions import Fraction
from ipaddress import ip_address, ip_network
from uuid import UUID... |
from __future__ import absolute_import
import re
from distutils.version import LooseVersion
from functools import total_ordering
import numpy as np
import pandas as pd
from numba import jit
from pandas.api.extensions import (
ExtensionDtype, ExtensionArray, register_extension_dtype)
from numbers import Integral... |
"""
Tests of printing functionality
"""
from __future__ import print_function
import logging
from nose.plugins.skip import SkipTest
import numpy
from six.moves import StringIO
import theano
import theano.tensor as tensor
from theano.printing import min_informative_str, debugprint
def test_pydotprint_cond_highligh... |
import numpy as np
import pandas as pd
import matplotlib as mpl
mpl.use("agg", warn=False) # noqa
import matplotlib.pyplot as plt
import matplotlib.colors
import matplotlib.patches
import matplotlib.gridspec
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import seaborn as sns
import networkx as nx
fr... |
"""The dialog for calculating minimal cut sets"""
import io
import traceback
import scipy
from qtpy.QtCore import Qt, Slot
from qtpy.QtWidgets import (QButtonGroup, QCheckBox, QComboBox, QCompleter,
QDialog, QGroupBox, QHBoxLayout, QHeaderView,
QLabel, QLineEdit... |
"""
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublic... |
#!/usr/bin/env python
'''
A program that converts pseudocode to .png flowcharts
'''
import re
import os
from math import log, floor
import click
from PIL import Image, ImageDraw, ImageFont
from tree import newTree,newNode
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Developer"
__vers... |
from __future__ import absolute_import
import random
import logging
from datetime import datetime
from time import time
from django.utils import timezone
from django.conf import settings
import sentry_sdk
from sentry_sdk.tracing import Span
from sentry_relay.processing import StoreNormalizer
from sentry import feat... |
from __future__ import absolute_import, division, print_function
import scitbx.math.gaussian
from scitbx.math import golay_24_12_generator
from scitbx import lbfgs
from scitbx import lbfgsb
from scitbx.examples import immoptibox_ports
from scitbx.array_family import flex
from libtbx.math_utils import ifloor
from libtbx... |
from OpenGL.GL import *
from OpenGL.GL.shaders import compileProgram, compileShader
import json
import pyrr
import numpy as np
from utils.picker import Picker
from utils.text import TextDrawer
from utils.window import Window
class Drawer:
def __init__(self, path, win_params):
# data
with open(pa... |
#!/usr/bin/env python
import datetime
import json
import os
import pathlib
import re
import sys
from typing import List, Optional, Tuple
from pydantic import ValidationError
from vaccine_feed_ingest_schema import location as schema
from vaccine_feed_ingest.utils.log import getLogger
ALL_DAYS = (
schema.DayOfWee... |
import collections as _collections
import contextlib as _contextlib
import itertools as _itertools
import math as _math
import re as _re
import sys as _sys
def identity(x):
"""
Return itself
>>> identity(1)
1
"""
return x
def filter_null(iterable):
"""
Filter out elements that do no... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CasperAPI class - call the Casper API and parse the data it returns, creating various
objects that are useful for reporting. Some reports supported:
- List all Chrome extensions or per-user.
- List all Chrome extensions with the number of instances of each
- List all s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
'''
The ``exportxml`` module will convert a corpus in Negra ExportXML format [1]
(e.g. Tüba-D/Z [2]) into a document graph.
[1] http://www.sfs.uni-tuebingen.de/resources/exformat3.ps
[2] http://www.sfs.uni-tuebingen.de/ascl/ressourcen/corpora/tu... |
import ctypes
import types
from appvalidator.constants import MAX_STR_SIZE
from appvalidator.python.copy import deepcopy
import instanceactions
import utils
from jstypes import JSArray, JSContext, JSGlobal, JSLiteral, JSObject
NUMERIC_TYPES = (int, long, float, complex)
# None of these operations (or their augment... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org, https://github.com/cloudedbats
# Copyright (c) 2020-present <NAME>
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import os
import asyncio
import time
import wave
import pathlib
import psutil
from collections ... |
from __future__ import print_function
import argparse
import json
import logging
import os
import re
import sys
import wdl.parser
from jinja2 import Environment, FileSystemLoader
__version__ = '0.2'
handlers = {}
# set up logging
logger = logging.getLogger('Main')
logger.setLevel(logging.INFO)
ch = logging.StreamH... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 05 14:05:24 2013
Aug 15 2020: add brunnermunzel, rank_compare_2indep
Author: <NAME>
"""
from statsmodels.compat.python import lzip
import numpy as np
from numpy.testing import (assert_allclose, assert_almost_equal,
assert_approx_equal, assert_)... |
# Author: <NAME>, <NAME>
# Copyright 2021- IBM Inc. All rights reserved
# SPDX-License-Identifier: MIT
import time
import numpy as np
import tensorflow as tf
import gym
import safe_rl.pg.trust_region as tro
from safe_rl.pg.agents import PPOAgent, TRPOAgent, CPOAgent
from safe_rl.pg.buffer import CPOBuffer
from safe_r... |
"""
The trained 1900-dimensional mLSTM babbler.
From the UniRep Paper [Alley2019]
"""
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import tensorflow_addons as tfa
import tensorflow_probability as tfp
import numpy as np
import pandas as pd
import sys
sys.path.append('../')
from utils import aa_seq_to_int,... |
import functools
import numpy as np
import tensorflow as tf
import roi_pooling_layer.roi_pooling_op as roi_pool_op
import psroi_pooling_layer.psroi_pooling_op as psroi_pooling_op
import roi_pooling_layer.roi_pooling_op_grad
from rpn.proposal_layer import proposal_layer as proposal_layer_py
from rpn.anchor_target_layer ... |
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
r"""# Interface Library for ingress_per_unit.
This library wraps relation endpoints using the `ingress_per_unit` interface
and provides a Python API for both requesting and providing per-unit
ingress.
## Getting Started
To get started using t... |
import os
import random
import pathlib
import struct
import pyclipper
from torch.utils import data
import glob
import numpy as np
import cv2
from dataset.augment import DataAugment
from utils.utils import draw_bbox
import torch
data_aug = DataAugment()
def get_dgrl_data(file_path, char_dict, is_train=True):
wi... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from __future__ import annotations # Allow subscripting Popen
from dataclasses import dataclass, replace
from datetime... |
import os
import pytest
import copy
from microsim.microsim_model import Microsim
from microsim.column_names import ColumnNames
from microsim.population_initialisation import PopulationInitialisation
import multiprocessing
# ********************************************************
# These tests run through a whole dumm... |
import struct
import datetime
from navegador5.content_parser import amf3_decode
# amf0_U8 :
# An unsigned byte, 8-bits of data, an octet
def amf0_Get_U8(unhandled_Bytes):
handled_Bytes = b''
(unhandled_Bytes,U8_raw) = (unhandled_Bytes[1:],unhandled_Bytes[0:1])
return((unhandled_Bytes,U8_raw))
def amf0_U8... |
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_table
import plotly.express as px
import plotly.graph_objects as go
import dash_daq as daq
from dash.dependencies import Input, Output, State
from flask impor... |
"""
This module lists the component vectors of the direct and reciprocal lattices
for different crystals.
It is based on the following publication:
<NAME> and <NAME>, "High-throughput electronic band
structure calculations: Challenges and tools", Comp. Mat. Sci. 49 (2010),
pp. 291--312.
"""... |
import logging
from datetime import datetime
import xml.etree.ElementTree as ET
from indra.statements import *
from indra.statements.statements import Migration
from indra.statements.context import MovementContext
from indra.util import UnicodeXMLTreeBuilder as UTB
logger = logging.getLogger(__name__)
class CWMSEr... |
"""
Parser functions for gender*render templates.
"""
import copy
from typing import Tuple, Callable, List, Dict, Union, FrozenSet
from . import errors
from . import handle_context_values
from . import gender_nouns
from . import warnings
from . import global_capitalization_system
# Some helpful type hints:
ParsedT... |
import os, sys
import csv
import pandas as pd
import math
import logging
import subprocess
logger = logging.getLogger(__name__)
dir_path = os.path.dirname(os.path.realpath(__file__))
DATA_SRC = os.path.join(dir_path, "language_src/sentiment_data.csv")
SENTIMENT_SRC = os.path.join(dir_path, "language_src/sentiment140.c... |
from collections import deque
import torch
import pickle
import numpy as np
from tqdm import tqdm
from diora.data.reading import NLIReader, PlainTextReader, ConllReader, JSONLReader, PartItTextReader, PartItWholeTextReader
from diora.data.batch_iterator import BatchIterator
from diora.data.bert_batch_iterator import... |
#!git clone https://github.com/26medias/keras-face-toolbox.git
#!mv keras-face-toolbox/models models
#!mv keras-face-toolbox/utils utils
#!rm -r keras-face-toolbox
#!gdown https://drive.google.com/uc?id=1H37LER8mRRI4q_nxpS3uQz3DcGHkTrNU
#!mv lresnet100e_ir_keras.h5 models/verifier/insightface/lresnet100e_ir_keras.h5
#... |
import json, re, sys, abc, argparse, math
import numpy as np
from typing import Any, Dict, List, Tuple
from dataclasses import dataclass
from tqdm import tqdm
import pandas
import intervaltree
# Tokens that can be ignored from the recall scores (because they
# do not carry much semantic content, and there are discre... |
import os
import torch
import torchvision
import torch.nn as nn
from SCNN import SCNN
from PIL import Image
from scipy import stats
import random
import torch.nn.functional as F
import numpy as np
import time
import scipy.io
import itertools
from torch.optim import lr_scheduler
def pil_loader(path):
# open path a... |
import math
import cv2
import numpy as np
import scipy
from scipy import ndimage
from scipy.ndimage import filters, gaussian_filter
from cv2 import warpAffine
from cv2 import INTER_LINEAR
from scipy.spatial import distance
def inbounds(shape, indices):
assert len(shape) == len(indices)
for i, ind... |
def camCalibrate(imagesPath, chessInnerCorner_x, chessInnerCorner_y, save = False, plot = True):
"""
Calibrate the camera used to take pictures of the chessboard appended on the wall. All the images must be of the same size
imagesPath: path of the images containing chessboard picture
chessInner... |
from os.path import dirname, join
from glob import glob
from shutil import move
from time import time
from .. import os as xm_os
from ..imprt import preset_import
from ..log import get_logger
logger = get_logger()
def set_cycles(w=None, h=None,
n_samples=None, max_bounces=None, min_bounces=None,
... |
from bottle import template, request
from cork import Cork, AAAException
from beaker.middleware import SessionMiddleware
from cork.json_backend import JsonBackend
from redis import StrictRedis, utils
import json
import os
import re
import base64
import shutil
from datetime import datetime
from six.moves.urllib.parse ... |
#!/usr/bin/env python
# Copyright 2016 The Fuchsia 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 applicable ... |
"""Collect Faucet information and generate ACLs"""
import abc
import argparse
import copy
import os
import shutil
import sys
import tempfile
import threading
import yaml
from forch.utils import get_logger, yaml_proto
from forch.proto.devices_state_pb2 import DevicesState, SegmentsToVlans
from forch.proto.devices_sta... |
"""Simplification and optimization for Cozy-generated implementations.
The key methods are
- stream
- simplify_and_optimize
- simplify_and_optimize_expression
"""
from cozy.common import fresh_name
from cozy.syntax import (
BOOL, INT, INT_BAG, TSet, THandle,
Exp, ZERO, ONE, ETRUE, EFALSE, EVar, ENum, ELamb... |
"""
Contributors can be viewed at:
http://svn.secondlife.com/svn/linden/projects/2008/pyogp/lib/base/trunk/CONTRIBUTORS.txt
$LicenseInfo:firstyear=2008&license=apachev2$
Copyright 2009, Linden Research, Inc.
Licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at:
http://www.apa... |
"""
Created on September 5 2021
This module build all language models: Action2Vec, Player2Vec, as well as additional plot & utils functions.
@author: <NAME> (@Magdaci)
"""
from gensim.models import Word2Vec
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from gensim.models import KeyedVectors
import os
im... |
import re
import json
import sys
import numpy as np
from time import time
import pandas as pd
from PeakListParser import PeakListParser
import zipfile
import gzip
import os
#import pyteomics.fasta as py_fasta
import SimpleFASTA
class CsvParseException(Exception):
pass
class MissingFileException(Exception):
p... |
#!/usr/bin/env python2.7
#
# macosac.py
# macOS Artifact Collector can collect forensics artifact files on macOS.
# Please use other tools for analyzing (e.g. AutoMacTC, mac_apt, etc).
#
# Copyright 2020 <NAME> <<EMAIL>> (@unkn0wnbit)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... |
import re
import json
from Bio.Seq import Seq
from edge.blast import blast_genome
from edge.models import Genome, Fragment, Operation
from edge.primer import design_primers_from_template
from edge.pcr import pcr_from_genome
from edge.orfs import detect_orfs
SINGLE_CROSSOVER_MAX_GAP = 2000
MAX_INTEGRATION_SIZE = 500... |
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `cross_sections` module."""
import numpy as np
import pytest
import xarray as xr
from metpy.calc import (absolute_momentum, cross_section_components, normal_component,
... |
# coding: utf-8
# Copyright (c) 2021 AkaiKKRteam.
# Distributed under the terms of the Apache License, Version 2.0.
from copy import deepcopy
import pandas as pd
import numpy as np
from sklearn.metrics import mean_absolute_error
_SUCCESS_ = "O"
_FAILED_ = "X"
_NO_REF_ = "-"
_FILL_STR_ = "-"
_PAD_STR_ = " "
_CURRE... |
import os
from abc import abstractmethod, ABC
from collections import Counter, namedtuple
from logging import getLogger
from typing import List, Type, Union, Optional, NamedTuple, Iterator, Tuple
from ..api import Dataset, KeywordQueryLog, RangeDatabase, RangeQuerySpace, RangeQueryLog
from ..api.constants import FIGUR... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# # VIP This ... |
'''
Created on 2015/11/18
:author: hubo
'''
from vlcp.config import defaultconfig
from vlcp.server.module import Module, api, depend
import vlcp.service.connection.httpserver
from vlcp.utils.http import Dispatcher, HttpInputException
from vlcp.event.stream import MemoryStream, FileStream
from time import time
import o... |
from lizard.msg.data import *
from lizard.msg.codes import *
from lizard.util.rtl.interface import Interface, IncludeSome, UseInterface
from lizard.util.rtl.method import MethodSpec
from lizard.util.rtl.mux import Mux
from lizard.util.rtl.types import Array
from lizard.util.rtl.packers import Packer
from lizard.util.r... |
# Copyright 2020 Makani Technologies 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# Lint as: python3
# Copyright 2021 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 ... |
#!/usr/bin/env python
# coding: utf-8
import json, math, copy
from geosnap.io import store_ltdb
from geosnap import Community, datasets
from geosnap.io import store_census
import pandas as pd
import shapely.wkt
import shapely.geometry
from datetime import datetime
from datetime import timedelta
from pathlib import Pat... |
import pytest, numbers, warnings
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from scipy.sparse import rand as sprand
from scipy import optimize
from pyuoi import UoI_L1Logistic
from pyuoi.linear_model.logistic import (fit_intercept_fixed_coef,
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Use global -simulate option for test purposes. No changes to live wiki
will be done.
This bot creates a pages with links to tennis players.
Call:
python pwb.py masti/ms-psb.py -page:"Wikipedysta:PuchaczTrado/PSB" -maxlines:10000 -summary:"Bot uaktualnia tabelę"
python... |
# Copyright 2018 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... |
# Copyright 2017 <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
#
# Unless required by applicable law or agree... |
__author__ = '<NAME>.'
__version__ = '0.1'
__date__ = '17.09.20'
__all__ = ['AggregatedKarhunenLoeveResults']
import openturns as ot
import uuid
from collections import Sequence, Iterable
from copy import copy, deepcopy
def all_same(items):
'''Checks if all items in a list are the same
'''
return all(x ... |
import random
import sys
import os
import string
import tkinter as tk
from tkinter import messagebox
import numpy as np
from scipy.signal import convolve2d
from scipy.misc import imsave, imread
def generate_minefield(rows, cols, num_mines, r, c):
# generate mines
mines = np.zeros((rows,cols), dtype=bool)
... |
#!/usr/bin/env python
"""
:mod:`disco.worker` -- Python Worker Interface
==============================================
In Disco, :term:`workers <worker>` do the brunt of the data processing
work. When a :class:`disco.job.Job` is created, it gets passed
a :class:`Worker` instance, which is responsible for defining th... |
# This class represents a Demo to be executed in SimDem.
import datetime
import difflib
from itertools import tee, islice, zip_longest
import json
import os
import re
import sys
import urllib.request
from environment import Environment
from cli import Ui
import config
def get_next(some_iterable, window=1):
items... |
import sys
import collections
from dataclasses import dataclass
import copy
from chiptunesak.base import *
from chiptunesak import goat_tracker
from chiptunesak.rchirp import RChirpOrderList, RChirpPattern, RChirpOrderEntry
"""
Compression routines the work for GoatTracker and may work for other formats
"""
MAX_PAT... |
"""Chapterisation module"""
__all__ = ['Chapter', 'Chapters', 'OGMChapters', 'MatroskaXMLChapters',
'MplsChapters', 'MplsReader',
'IfoChapters', 'IfoReader']
import os
import random
from abc import ABC, abstractmethod
from fractions import Fraction
from pprint import pformat
from typing import L... |
import copy
import datetime
import logging
import os
import time
from functools import partial
from os.path import join as joinpath
from pathlib import Path
from typing import Any, Dict, Optional, Union
import numpy as np
from memory_profiler import memory_usage
from monty.json import MSONable
from pymatgen import Str... |
import torch
import logging
from transformers import BertModel, BertTokenizer
from transformers import *
from typing import List
from itertools import chain
import argparse
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import json
from t... |
# Math and data related packages
import numpy as np
from numpy import inf, log, log10, absolute, angle, sqrt
import pandas as pd
from math import pi
from scipy.optimize import minimize, Bounds
import matplotlib.pyplot as plt
# DRTtools related package
import general_fun as gf
import Bayes_HT as BHT
from hmc_e... |
import os
import typing
from qtpy import QtCore as QC
from qtpy import QtWidgets as QW
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlobals as HG
from hydrus.core import HydrusSerialisable
from hydrus.client import ClientApplicationCommand as CAC
from hydr... |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Read and write properties for the CloudSDK."""
import collections
import ConfigParser
import os
import threading
from googlecloudsdk.core import config
from googlecloudsdk.core import exceptions
from googlecloudsdk.core.credentials import devshell as c_devshell
fr... |
#!/usr/bin/env python
#
# __init__.py -
#
# Author: <NAME> <<EMAIL>>
#
import os
import os.path as op
import gc
import re
import sys
import time
import shlex
import shutil
import logging
import tempfile
import ... |
import numpy as np
from . import regimes as REGI
from . import user_output as USER
import multiprocessing as mp
import scipy.sparse as SP
from .utils import sphstack, set_warn, RegressionProps_basic, spdot, sphstack
from .twosls import BaseTSLS
from .robust import hac_multi
from . import summary_output as SUMMARY
from ... |
import requests, json, os
import math
from sqlalchemy import create_engine
from starlette.responses import JSONResponse
from wallet import Wallet, NetworkEnvironment # ergopad.io library
from config import Config, Network # api specific config
from fastapi import APIRouter, status
from typing import Optional
f... |
import re
import traceback
from pathlib import Path
from unittest.mock import Mock, patch, call
from math import sqrt, isclose
import pytest
import sys
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QColor, QImage, QPixmap
from PyQt5.QtWidgets import QApplication, QLabel
from PyQt5.QtWidgets import QHBoxLayo... |
"""
Script and Functions to assmeble gates for the DMFT Loop
"""
from CQS.util.PauliOps import I
from CQS.util.verification import Nident
import qiskit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
from collections import OrderedDict
from openfermion.ops import FermionOperator, QubitOpe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# <NAME>
#
# Version 2
#
# Harmonise GWAS summary statistics against a reference VCF
import os
import sys
import gzip
import argparse
from copy import deepcopy
from subprocess import Popen, PIPE
from collections import OrderedDict, Counter
from lib.SumStatRecord import S... |
import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader, sampler
import h5py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from itertools import cycle
import seaborn as sns
from matplotlib.colors import ListedColormap
import matplotlib as mpl
from matplotlib.font_man... |
############################################################################
#This program accepts various CSV files containing information about Romans
#and uses them to generate a family tree in d3.js.
#Produces different trees representing different levels of certainty.
#
#Author: <NAME> (<EMAIL>)
#Last Modifi... |
# coding: utf-8
import sys
import time
import requests
from requests.exceptions import HTTPError
from bs4 import BeautifulSoup
#from openpyxl import Workbook
import random
import pickle as pck
import re
import numpy as np
#stdout = sys.stdout
#reload(sys)
#sys.setdefaultencoding('utf-8')
#sys.stdout = stdout
# pytho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.