text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python3
# Usage:
# PYTHONPATH=src ./train --dataset <file|directory|glob>
import argparse
import json
import os
import numpy as np
import tensorflow as tf
import time
import tqdm
from tensorflow.core.protobuf import rewriter_config_pb2
import model, sample, encoder
from load_dataset import load_qna_da... |
#!/usr/bin/python
#
# Copyright (c) 2019 Hewlett Packard Enterprise Development LP
#
# 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 re... |
from __future__ import annotations
import json
import logging
import selectors
import socket
import threading
from typing import Any, Callable, Dict, Iterator, List, TypeVar, Union, cast
from weakref import WeakMethod
from yellowbox.subclasses import YellowService
from yellowbox.utils import docker_host_name
__all__... |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
#
# Release 時のドキュメントを作成するスクリプト
#
# required
# pip install GitPython pyperclip
#
# 1. github release page の markdown => clipboard
# 2. changelog => docs/release/079/v0.XX.Y.md
# 3. download button => docs/index.html
#
import pathlib
import re
import subprocess
import git.repo
import re
import pathlib
import io
from fu... |
import logging
import re
from pprint import pformat
import hail as hl
from hail_scripts.elasticsearch.elasticsearch_client_v7 import ElasticsearchClient
from hail_scripts.elasticsearch.elasticsearch_utils import (
ELASTICSEARCH_INDEX,
ELASTICSEARCH_UPDATE,
ELASTICSEARCH_UPSERT,
ELASTICSEARCH_WRITE_OPE... |
#!/usr/bin/env python
"""
-- Locally run and manage a personal cluster in containers.
This script can be used to manage (setup, teardown) a personal
Mesos cluster etc in containers, optionally Peloton
master or apps can be specified to run in containers as well.
@copyright: 2019 Uber Compute Platform. All rights re... |
'''
Tests for deep learning procedure
'''
from pathlib import Path
import torch
from Bio import SeqIO
import numpy as np
import h5py
from coconet.core.config import Configuration
from coconet.fragmentation import make_pairs
from coconet.dl import initialize_model, load_model, train, save_repr_all
from coconet.dl imp... |
from fontTools.misc.xmlWriter import XMLWriter
from fontTools.ttLib import TTFont
from fontTools import mtiLib
import difflib
from io import StringIO
import os
import sys
import unittest
class MtiTest(unittest.TestCase):
GLYPH_ORDER = ['.notdef',
'a', 'b', 'pakannada', 'phakannada', 'vakannada', 'pevowel... |
# 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 re
import os
import json
import argparse
from string import punctuation
import torch
import yaml
import numpy as np
import librosa
import pyworld as pw
import audio as Audio
from torch.utils.data import DataLoader
from g2p_en import G2p
from pypinyin import pinyin, Style
from utils.model impo... |
# Copyright (C) 2017, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
#
# Copyright (c) 2018 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ... |
from .style_net import build_stylenet
import numpy as np
import torch
from .latent_projectors import ChannelWiseAddNoise
from . import gblocks
from .base import BaseGenerator
from .. import layers
from ..build import GENERATOR_REGISTRY
from ..layers.stylegan2_layers import Conv2dLayer, StyleGAN2Block, ToRGBLayer
from t... |
# Copyright 2011 <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 applicable law or agreed to in writing, soft... |
import gym
import numpy as np
from gym.envs import register
from joblib import Parallel, delayed
import pickle
import matplotlib.pyplot as plt
from q_learning import Qlearning
from tile_coding_action_value_function import TileCodingActionValueFunction
from true_online_sarsa_lambda import TrueOnlineSarsaLambda
register... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import os.path
import sys
import itertools
import warnings
import functools
import posixpath
import ntpath
import errno
FS_ENCODING = sys.getfilesystemencoding()
PY_LEGACY = sys.version_info < (3, )
TRUE_VALUES = frozenset(('true', 'yes', '1', 'enable', 'enabl... |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... |
#!/usr/bin/python3
# for all the images in the fitted group, generate a 2d polygon
# surface fit. Then project the individual images onto this surface
# and generate an AC3D model.
#
# Note: insufficient image overlap (or long linear image match chains)
# are not good. Ideally we would have a nice mesh of match pair... |
# -*- coding: utf-8 -*-
"""
lantz.drivers.olympus.ixbx
~~~~~~~~~~~~~~~~~~~~~~~~~~
When talking about the z-axis of a microscope, use "near" and "far" instead of "up" and "down." "Nearer" always means the objective ends closer to the sample; "farther" means the objective ends farther away. On an inverted mi... |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import datetime
import uuid
from aiohttp import web
from foglamp.common import utils
from foglamp.common import logger
from foglamp.common.configuration_manager import ConfigurationManager
from foglamp.common.storage_client.p... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import re
import time
import json
import random
import platform
from shutil import copy2 as copyfile
from shutil import copytree as copytree
import yaml
import itchat
from git import Repo
from jinja2 import Environment, FileSystemLoader
def initialize():
# 创建输出... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2021 Intel Corporation. All Rights Reserved.
"""
This module is for formatting and writing unit-tests in python. The general format is as follows
1. Use start() to start a test and give it, as an argument, the name of the test
2. Use whatever ch... |
import textwrap
import urllib
from csp.decorators import csp_update
from django.contrib import messages
from django.contrib.auth import logout
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.forms.models import BaseModelFormSet, inlineformset_factory
fro... |
import re
from argparse import Namespace
import os
import torch
from models import ReviewClassifier
from text_preparation import ReviewDataset
import torch.nn as nn
import torch.optim as optim
from models import generate_batches, make_train_state, set_seed_everywhere, handle_dirs, compute_accuracy, \
update_train_... |
#!/usr/bin/env python
# Copyright 2017 Google 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... |
import functools
import sqlalchemy as sa
import sqlalchemy.sql as sql
import ibis.expr.operations as ops
import ibis.expr.types as ir
from ibis.backends.base.sql.compiler import (
QueryBuilder,
Select,
SelectBuilder,
TableSetFormatter,
Union,
)
from .database import AlchemyTable
from .datatypes i... |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_table
import plotly.graph_objs as go
from plotly.subplots import make_subplots
import colorlover as cl
import datetime as dt
import flask
import os
import pandas as pd
import time
i... |
# -*- coding: utf-8 -*-
"""Negative binomial regression model that accounts for multiplicative sample scaling and additive sample background
(MLE/MAP in pytorch).
To address the usage of challenging reference data composed of multiple batches :math:`e=\{1..E\}`
the expression of each gene `g` in each single cell refer... |
#!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... |
import numpy as np
from numpy import array
import pandas as pd
import os
import glob
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense, Dropout, Conv2D, Activation, MaxPooling2D, Flatten
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import L... |
"""Tools for checking certificate revocation."""
from datetime import datetime
from datetime import timedelta
import logging
import re
from subprocess import PIPE
from subprocess import Popen
from cryptography import x509
from cryptography.exceptions import InvalidSignature
from cryptography.exceptions import Unsuppor... |
#!/usr/bin/env .python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
import hashlib
import json
import logging
from decimal import Decimal
import requests
from btcpay import crypto
from django.conf import settings
from django.contrib import messages
from django.core import signing
from django.db import transaction
from django.http import Http404, HttpResponse, HttpResponseBadRequest
fr... |
#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
##
# 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 ... |
from __future__ import print_function
import sys
import gdb.printing
class Iterator:
def __iter__(self):
return self
if sys.version_info.major == 2:
def next(self):
return self.__next__()
def children(self):
return self
def escape_bytes(val, l):
return '"' + val.string(encoding='Latin... |
# 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 use ... |
from openpathsampling.netcdfplus import StorableNamedObject
import pandas as pd
# NOTE: the biases that return here can still be more than 1. This is
# correct. You only fix them to min(1, value) in the Metropolis acceptance
# criterion.
class BiasFunction(StorableNamedObject):
"""Generic bias functions. Everythi... |
import matplotlib
# matplotlib.use('TkAgg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
import matplotlib.pyplot as plt
import csv
import os
from cnns.nnlib.utils.general_utils import get_log_time
print(matplotlib.get_backend())
# plt.interactive(True)
# http://ksrowell.com/blog-... |
# Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright... |
#!/usr/bin/env python3
# coding: utf-8
'''MIT License
Copyright (c) 2021 <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 ... |
# For HTML POST requests.
import requests
# For Python 3.x enumerated types.
from enum import Enum
# For XML parsing.
import xml.etree.ElementTree as et
# For time functions.
import time
###############################################################################
#
class Platform(Enum):
"""BAScontrol platform... |
'''
Training script for CIFAR-10/100
Copyright (c) <NAME>, 2017
'''
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import cv2
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import tor... |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 12:20:43 2020
@author: timhe
"""
Startdate = "2005-01-01"
Enddate = "2005-05-01"
freq = "D" # of MS for monthly
Example_file = r"D:/Project_MetaMeta/LEVEL_1/MSGCPP/SDS/daily/SDS_MSGCPP_W-m-2_daily_2018.01.21.tif"
input_format = r"F:\MSGCPP_Daily\{yyyy}\SDS_MSGCPP_W-m-2... |
from __future__ import print_function
from datetime import datetime
import logging
logging.basicConfig(filename="pytest" + datetime.now().strftime('%Y%m%d-%H:%M:%S') + '.log', level=logging.DEBUG)
import numpy as np
import ctypes as C
from pytest import raises
try:
from mock import patch, Mock
except ImportError... |
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Test Dataset cla... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016-2018 CNRS
# 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 limita... |
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import logging
import os
import shutil
import time
from datetime import timedelta
import sys
import numpy as np
import torch
from torch.autograd import Variable
import numpy as np
import torch.distributed as dist
from genotypes import PRIMITIVES... |
# encoding: utf-8
###########################################################################################################
#
#
# Filter with dialog Plugin
#
# Read the docs:
# https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Filter%20with%20Dialog
#
# For help on the use of Interface Build... |
#STANDARD LIB
from datetime import datetime
from decimal import Decimal
from itertools import chain
import warnings
#LIBRARIES
import django
from django.conf import settings
from django.db import models
from django.db.backends.util import format_number
from django.db import IntegrityError
from django.utils import tim... |
"""Fish Tank, by <NAME> <EMAIL>
A peaceful animation of a fish tank. Press Ctrl-C to stop.
Similar to ASCIIQuarium or @EmojiAquarium, but mine is based on an
older ASCII fish tank program for DOS.
https://robobunny.com/projects/asciiquarium/html/
https://twitter.com/EmojiAquarium
This and other games are available at h... |
# Copyright (C) 2015-2019 SignalFx, Inc. All rights reserved.
# Copyright (C) 2020 Splunk, Inc. All rights reserved.
import collections
import json
import logging
import pprint
import requests
import six
from six.moves import queue
import threading
import zlib
from .constants import DEFAULT_INGEST_ENDPOINT, DEFAULT_T... |
"""Miscellaneous tools for experiments
Author: <NAME> <<EMAIL>>
Created on: May 16, 2021
"""
__all__ = [
"append_num_to_filename",
"BoundingBox3D",
"image_one_hot",
"minmax_scale_batch",
"reshape_for_broadcasting",
"to_np",
"setup_log",
"split_filename",
]
import builtins
import loggin... |
"""Submodule provinding GAN model architectures."""
import torch
import torch.optim as optim
from torch import nn
from typing import Callable
class GANModel(torch.nn.Module):
def __init__(
self,
generator_model: torch.nn.Module,
encoding_model: torch.nn.Module,
masking_layer: torc... |
# -*- coding: utf-8 -*-
'''
Interface to SMBIOS/DMI
(Parsing through dmidecode)
External References
-------------------
| `Desktop Management Interface (DMI) <http://www.dmtf.org/standards/dmi>`_
| `System Management BIOS <http://www.dmtf.org/standards/smbios>`_
| `DMIdecode <http://www.nongnu.org/dmidecode/>`_
'''
... |
# pylint: skip-file
#
# All modification made by Intel Corporation: Copyright (c) 2016 Intel Corporation
#
# All contributions by the University of California:
# Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
# All rights reserved.
#
# All other contributions:
# Copyright (c) 2014, ... |
import os
import types
import operator
from functools import reduce
from collections import OrderedDict
from collections.abc import Sequence
from ..compiler import Compiler
from ..ref import DefnRef, TupleRef
from ..compatibility import IntegerTypes
from ..bit import Digital
from ..clock import Clock, Enable, Reset
fro... |
#!/usr/bin/env python
import sys
import logging
logger = logging.getLogger('gen_sonar_images')
if __name__ == '__main__':
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s')
logger.info('Importing python modules (takes a long time with holoviews)...')
import... |
# Copyright 2021 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import os
import sys
import ast
import tempfile
import runpy
import importlib
from fractions import Fraction
from importlib import reload
import pytest
import hy
from hy.lex import hy... |
import os
import smtplib
import time
import xml.etree.ElementTree as ET
from email import encoders
from email.header import Header
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from click import echo, style
from jinja2 import Template
import re... |
"""
Support for MySensors lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mysensors/
"""
import logging
from homeassistant.components import mysensors
from homeassistant.components.light import (ATTR_BRIGHTNESS, ATTR_RGB_COLOR,
... |
#!/usr/bin/env python3
import difflib
import logging
import multiprocessing
import os
import time
from queue import Empty
from typing import Iterator, List, Sequence, Tuple
import click
import sh
from fissix.pgen2.parse import ParseError
from fissix.refactor import RefactoringTool
from .types import (
BowlerExce... |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
from collections import OrderedDict
from dataclasses import dataclass, field
import itertools
import threading
from typin... |
#!/usr/bin/env python
from datetime import datetime
from os.path import isdir, basename
from os import mkdir
import os
import subprocess
def create_uri_filename_from_options(pipeline_name : str) -> str:
return os.path.abspath(os.path.join(os.curdir, pipeline_name + "_uri"))
# FIXME huge hack around not being abl... |
import requests
import json
import os
import platform
import gspread
import time
import datetime
from oauth2client.service_account import ServiceAccountCredentials
from dotenv import load_dotenv
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
import professorScra... |
# Copyright (c) 2021 Mira Geoscience Ltd.
#
# This file is part of geoapps.
#
# geoapps is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
import numpy as np
from SimPEG import directives, maps
from SimPEG.utils import cartesian2amplitude_... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from argparse import Namespace
from pathlib import Path
from typing import Dict, Optional
from fairseq.data import Dictionary
def get_config... |
# flash.py module for Embedded Artists' 2.7 inch E-paper Display. Imported by epaper.py
# Provides optional support for the flash memory chip
# <NAME>
# version 0.5
# 29th Aug 2015 Improved power control support
# Copyright 2013 Pervasive Displays, Inc, 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (t... |
# -*- coding: utf-8 -*-
"""
This script generates results and figures used to compare SNF with data
concatenation
"""
import os.path as op
import warnings
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as sstats
import seaborn as sns
from sklearn.cluster import spectral_clustering
from sklearn ... |
import tokenize
import warnings
from keyword import kwlist
from collections import defaultdict
RAW = 'RAW'
COMMENT = 'COMM'
VAR = 'VAR'
KEYWORD = 'KW'
CALL = 'CALL'
OP = 'OP'
def annotate(source_lines, line_offset=0, lineno=0, max_line=1e4):
"""
Find out where in a piece of code which variables live.
Th... |
import re
from num2words import num2words
from word2number.w2n import word_to_num
from pycorenlp import StanfordCoreNLP
class PostProcess:
month_map = {
1:'January',
2:'February',
3:'March',
4:'April',
5:'May',
6:'June',
7:'July',
8:'August',
... |
##############################################################################
# __ ___ #
# / / / (_)_________ #
# / /_/ / / ___/ ___/ #
# ... |
import yaml
import logging
from indra.belief.wm_scorer import get_eidos_bayesian_scorer
from indra.sources.eidos import reground_texts
from indra.tools import assemble_corpus as ac
from indra.belief import BeliefEngine
from . import file_defaults, default_key_base, InvalidCorpusError
from .corpus import Corpus
logger ... |
import numpy as np
from .cahn_hilliard_simulation import CahnHilliardSimulation
from .microstructure_generator import MicrostructureGenerator
from pymks import DiscreteIndicatorBasis, MKSRegressionModel
__all__ = ['make_delta_microstructures', 'make_elastic_FE_strain_delta',
'make_elastic_FE_strain_random',... |
from common import SizedIterable
from dsa import HashTable, Set, SinglyLinkedList
from itertools import chain
import random
from typing import Optional
__all__ = [
"Person",
"Post",
"SocialNetwork"
]
class Person:
def __init__(self, name: str, id: int, network: "SocialNetwork") -> None:
sel... |
"""
Various tools to process WAIS data
Author: <NAME> <<EMAIL>>
"""
import fnmatch
import numpy as np
import icecap as icp
import inspect
import os
import rsr.run as run
import rsr.fit as fit
import rsr.utils as utils
import rsr.invert as invert
#import string
import subradar as sr
import time
import pandas as pd
impo... |
# Copyright 2020 Pulser Development Team
#
# 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 i... |
import tensorflow as tf
# 每个数据前后加上相应的起止符
SENTENCE_START = '<s>'
SENTENCE_END = '</s>'
# 特殊字符的 Vocab表示
PAD_TOKEN = '[PAD]' # padding填充项
UNKNOWN_TOKEN = '[UNK]' # OOV
START_DECODING = '[START]' # Decode起始符
STOP_DECODING = '[STOP]' # Decode终止符
class Vocab(object):
def __init__(self, vocab_file, max_size): #... |
import os
import sys
import json
import shutil
import re
import time
def get_package_name():
config_file = os.path.join(os.getcwd(), '.openapi-generator', '.openapi-config.json')
with open(config_file, "r") as jsonFile:
config_data = json.load(jsonFile)
package_name = config_data["packageName"]
... |
from .properties import CollisionMatFlags
from ..resources.bound import *
from ..tools.meshhelper import *
from ..sollumz_properties import MaterialType, SollumType
from ..tools.utils import *
class NoGeometryError(Exception):
message = 'Sollumz Bound Geometry has no geometry!'
class VerticesLimitError(Exceptio... |
import numpy as np
# Photon history bits (see photon.h for source)
NO_HIT = 0x1 << 0
BULK_ABSORB = 0x1 << 1
SURFACE_DETECT = 0x1 << 2
SURFACE_ABSORB = 0x1 << 3
RAYLEIGH_SCATTER = 0x1 << 4
REFLECT_DIFFUSE = 0x1 << 5
REFLECT_SPECULAR = 0x1 << 6
SURFACE_REEMIT = 0x1 << 7
SURFACE_TRANSMIT = 0x1 << 8
... |
# Copyright The OpenTelemetry 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 law or agreed to in ... |
# Copyright 2013 IBM Corp.
#
# 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 t... |
import argparse
import os, sys
import shutil
import time
import numpy as np
import os
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.trans... |
"""Defines LightCurveFile classes, i.e. files that contain LightCurves."""
from __future__ import division, print_function
import os
import logging
import warnings
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
from astropy.io import fits as pyfits
from .utils import (bkjd_to_astro... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the Spectrum1D class. It is eventually supposed to migrate to astropy core
# Python packages
from abc import ABCMeta, abstractmethod, abstractproperty
from copy import copy, deepcopy
# External packages
import numpy as np
# Lo... |
"""Module defining the :class:`Result` object that is returned by
:func:`.optimize_pulses`.
"""
import copyreg
import datetime
import logging
import pickle
import time
from textwrap import dedent
from .conversions import _nested_list_shallow_copy, pulse_onto_tlist
from .objectives import Objective, _Control... |
#! /usr/local/bin/python3
import os
import re
import glob
import argparse
import sys
from shutil import copyfile, rmtree
from pathlib import Path
parser = argparse.ArgumentParser()
parser.add_argument('--version', nargs=1, default='5.0.4')
parser.add_argument('--pre', nargs=1, default='')
parser.add_argument('--buil... |
# -*- coding:utf-8 -*-
import gc
import glob
import json
import os
import torch
from os.path import join as pjoin
from others.logging import logger
from others.tokenization import BertTokenizer
class BertData():
def __init__(self, args):
self.args = args
self.tokenizer = BertTokenizer.from_pretr... |
from __future__ import print_function, division, absolute_import
import atexit
from datetime import timedelta
import logging
import math
from time import sleep
import weakref
import toolz
from tornado import gen
from .cluster import Cluster
from ..core import CommClosedError
from ..utils import (sync, ignoring, All,... |
import pickle
import os
import re
import json
import numpy as np
import datetime
from sklearn.feature_extraction.text import CountVectorizer, HashingVectorizer
from sklearn.feature_extraction import DictVectorizer
from sklearn.preprocessing import MinMaxScaler, QuantileTransformer, LabelBinarizer
from sklearn.decompos... |
import numpy as np
import os
from sklearn.datasets import make_blobs
import sys
import requests, zipfile, io
import pandas
__datasets = ['Adult', 'Bank', 'Synthetic', 'Synthetic-unequal', 'CensusII']
def dataset_names():
return __datasets
def read_dataset(name, data_dir,args):
data = []
sex_num = []
... |
"""
Manages the list of transactions for the wallet
"""
import os
from .persistence import write_csv, read_csv
from .helpers import get_address_from_dict
from embit.transaction import Transaction
from embit.liquid.networks import get_network
import json
import logging
from .util.tx import decoderawtransaction
logger =... |
#
# Access to statistics and calculated values.
#
import datetime
from shutil import disk_usage
import sqlite3
from flask import g
from sqlalchemy import or_
from common.utils import converters
from common.models.alerts import Alert
from common.models.stats import StatPlotCount, StatPlotsSize, StatTotalChia, StatNet... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2018, <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 re... |
import sys
from collections import defaultdict
import pysam
from rck.core.io import EXTERNAL_NA_ID, AG_LABELING
from rck.core.structures import AdjacencyGroup, AdjacencyGroupType, Strand
def infer_sniffles_molecule_groups(adjacencies, extra_rnames_field="rnames", gid_suffix=""):
reads_to_adjacencies_ids = defau... |
#!/usr/bin/env python
# coding: utf8
'''
@Creator: valor7
@Email: <EMAIL>
@File: models.py
@Time: 2017/10/15 15:30
@desc:
'''
from __future__ import unicode_literals
#from django.contrib.auth.models import User
from userauth.models import User, UserGroup, Department
from django.db import models
def user_dir_path(in... |
from __future__ import print_function, division
import copy, pickle, re, os, time, subprocess, datetime, itertools, sys, abc, argparse, matplotlib, glob
matplotlib.use('agg')
sys.path.append('/home/kengyangyao/Dropbox/temp_Linux/temp_research_proj/cluster_management/cm/src')
sys.path.append('/home/kengyangyao/Dropbox/t... |
#!/usr/bin/env python
# coding: utf-8
import json
from typing import Optional, List
import pandas as pd
import numpy as np
import plotly.graph_objs as go
from evidently import ColumnMapping
from evidently.analyzers.data_drift_analyzer import DataDriftAnalyzer, DataDriftAnalyzerFeatureMetrics
from evidently.model.wid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.