text stringlengths 6.04k 39.5k |
|---|
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, pu... |
"""
Internal utility for converting arguments from a launch spec or call to wandb launch
into a runnable wandb launch script
"""
import enum
import json
import logging
import os
from shlex import quote
import tempfile
from typing import Any, Dict, List, Optional, Tuple
import wandb
from wandb.apis.internal import Api... |
import random
import numpy as np
import copy
"""
Authors: <NAME>, <NAME>, <NAME>
This file contains all Data structures and Data utilities used by our nsga2.py
All the NSGA2 processes are coded in the "nsga2.py" file, except the calculation of the fitness score,
and the genetic operations on chrom... |
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
import datetime as dt
import numbers
from collections import namedtuple
from collections.abc import Sequence
import cupy as cp
import numpy as np
import pandas as pd
import pyarrow as pa
from pandas.core.dtypes.common import infer_dtype_from_object
from pandas.core.dtype... |
# Read the bitcoin blockchain data and extract their topological properties
# Modify on 12.04.2021
from collections import defaultdict
from multiprocessing import Pool, Queue
import multiprocessing
import datetime
import math
import time
import pandas as pd
import requests
import numpy as np
import json
import os
impo... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
from itertools import combinations
import networkx as nx
import numpy as np
from pandapower.auxiliary import _init_nx_opt... |
# -*- coding: utf-8 -*-
"""Tools for loading/running NeuroChem input files."""
import torch
import os
import bz2
import lark
import struct
import itertools
import math
import timeit
from . import _six # noqa:F401
import collections
import sys
from ..nn import ANIModel, Ensemble, Gaussian
from ..utils import EnergyShi... |
import json
import logging
import os
import re
from auth.authorization import ANY_USER
from config.script.list_values import ConstValuesProvider, ScriptValuesProvider, EmptyValuesProvider, \
DependantScriptValuesProvider, NoneValuesProvider
from model.model_helper import resolve_env_var, replace_auth_vars, is_empt... |
"""Supervisor definition anc control.
Linux:
Manages daemontools-like services inside the container.
For each application container there may be multiple services defined, which
are controlled by skarnet.org s6 supervision suite.
Application container is started in chrooted environment, and the root
directory struc... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2018
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
"""
import re
def UnsupportedOperands(op, type1, type2):
def as_type(x):
return x if isinstance(x, type) else type(x)
fmt = "unsupported operand type(s) for {}: '{}' and '{}'"
type1 = as_... |
import json
import os
import sys
sys.path.append(os.path.join(os.environ['ET_ROOT']))
sys.path.append(os.path.join(os.environ['ET_ROOT'], 'gen'))
import threading
import time
import cv2
import numpy as np
import alfred.gen.constants as constants
from alfred.env.thor_env import ThorEnv
from tqdm import tqdm
from coll... |
# coding: utf-8
# Começando com os imports
import csv
import matplotlib.pyplot as plt
from datetime import date
# Vamos ler os dados como uma lista
print("Lendo o documento...")
with open("chicago.csv", "r") as file_read:
reader = csv.reader(file_read)
data_list = list(reader)
print("Ok!")
# Vamos verificar ... |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at:
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
import os
import numpy as np
import cv2
import datetime
import collections
import os
from pathlib import Path
import die_types
# Settings
CAPTURE_DIR = 'captured_data/cxd6p9_cxd6p10_cxd6p11_cxd6p12/20191006_185145/'
INPUT_EXT = '.jpg'
# Compartments ABCD; should match the types in die_types.py
DIE_TYPES... |
# This file is part of the pyMOR project (https://www.pymor.org).
# Copyright 2013-2021 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import functools
from hypothesis import strategies as hyst
from hypothesis import assume, given
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# -*- coding: utf-8 -*-
"""
A class that renders matplotlib plots of worm measurement and feature data.
This follows the [animated subplots example]
(http://matplotlib.org/1.3.0/examples/animation/subplots.html)
in inheriting from TimedAnimation rather than
using PyLab-shell-type calls to construct the animation.
... |
#-*- coding:utf-8 -*-
# Extremely loose JSON interpreter.
# Copyright 2013 Wa (logicplace.com)
# MIT Licensed
import re
try: unicode
except NameError: unicode = str
try: long
except NameError: long = int
try: unichr
except NameError: unichr = chr
class undefined(object):
def __nonzero__(self): return False
def _... |
#
# This file is part of LUNA.
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
"""
This module contains gateware designed to assist with endpoint/transfer state management.
Its components facilitate data transfer longer than a single packet.
"""
import unittest
from nmigen imp... |
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, QLineF
from PyQt5.QtGui import QColor, QIcon, QPixmap, QPainter, QPen, QBrush
from PyQt5.QtWidgets import (
QWidget,
QLabel,
QDockWidget,
QVBoxLayout,
QSizePolicy,
QGridLayout,
QAction,
QToolButton,
QHBoxLayout,
QComboBox,
QI... |
from __future__ import division, absolute_import
__copyright__ = "Copyright (C) 2012 <NAME>"
__license__ = """
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 witho... |
from collections import defaultdict
from jsonschema.exceptions import ValidationError
import pytest
from abridger.exc import (UnknownTableError, UnknownColumnError,
InvalidConfigError, RelationIntegrityError)
from abridger.extraction_model import (ExtractionModel, Relation,
... |
import datetime
import json
from pathlib import Path
import signal
import time
import pkg_resources
import logging
from typing import NamedTuple
import structlog
from sqlalchemy import create_engine
from web3 import Web3, HTTPProvider
from eth_utils import encode_hex
from eth_keys import keys
import monitor.db as ... |
'''
Copyright 2020 The Microsoft DeepSpeed Team
'''
import torch
import os
import copy
import collections
import json
from abc import ABC, abstractmethod
from deepspeed.utils import logger
class SDLoaderFactory:
@staticmethod
def get_sd_loader_json(json_file):
with open(json_file) as f:
d... |
import functools
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from src.utils.camera import Camera
depth_image_cmap = 'gist_yarg'
def plotlive(func):
"""
A decorator that updates t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rar
import zlib
import struct
import rescene
import os
from binascii import hexlify
# filenb = 12 # r11
# dir = "C:/dump/"
# avi = dir + "exvid-mzktv-cd2.avi"
# r09 = dir + "exvid-mzktv-cd2.r09"
# r10 = dir + "exvid-mzktv-cd2.r10"
# extract = dir + "r11extract.bi... |
# -*- coding: utf-8 -*-
'''
Basic APIs for accessing a parsed JMDict
Latest version can be found at https://github.com/neocl/jamdict
This package uses the [EDICT][1] and [KANJIDIC][2] dictionary files.
These files are the property of the [Electronic Dictionary Research and Development Group][3], and are used in conf... |
""" Holds the player class along with important functions that control the achievements, xp system, and much more. """
from random import randint
from enum import Enum
from copy import deepcopy
from other.colors import print_green, print_yellow, print_red, print_sleep, print_blue
from gamedata import GameData
from choi... |
from rdflib import RDF, RDFS, OWL
from cltl.brain.utils.constants import NAMESPACE_MAPPING
from cltl.brain.utils.helper_functions import hash_claim_id, get_object_id, \
confidence_to_certainty_value
from cltl.combot.backend.api.discrete import UtteranceType
from cltl.combot.backend.utils.casefolding import casefol... |
# -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
#
# 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... |
from PIL import Image
import os
import cv2 as cv
import matplotlib.pyplot as plt
from pylab import plot
import numpy as np
import json
import math
import glob
from functions import euclidean_dist, generate_cycle_mask, average_del_min
cycle = False
Root = '/media/D/GJY/ht/ProcessedData/JHU'
dst_Root = '/media/D/GJY/h... |
# 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 you under the Apache License, Version 2.0 (the
# "License... |
# Copyright 2016 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... |
import re
import os
import subprocess
import traceback
import shutil
from collections import defaultdict
import unidecode
import yaml
from sphinx.util.osutil import ensuredir
from sphinx.util.console import darkgreen, bold
from sphinx.errors import ExtensionError
from .base import PythonMapperBase, SphinxMapperBase
... |
# coding=utf-8
""" Creation of strip of images """
from __future__ import print_function
from .. import batch
from PIL import Image as ImPIL
from PIL import ImageDraw, ImageFont
import os.path
import ee
import logging
from copy import deepcopy
from ..tools import geometry
from .. import utils
import requests
from io ... |
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD 3 clause
import numpy as np
from scipy.special import gammaln
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_almost_equal
from sklearn.mixture.bayesian_mixture import _log_dirichlet_norm
from sklearn... |
import re
import uuid
import json
import traceback
from pathlib import Path
from urllib.parse import urlparse
from lyrebird.log import get_logger
from jinja2 import Template
from lyrebird.application import config
from lyrebird.mock.handlers import snapshot_helper
from lyrebird.mock.dm.jsonpath import jsonpath
PROP_F... |
import itertools
import os
import random
import re
import sys
from apiclient import discovery, errors
from flask import abort, redirect, render_template, request, send_file, session, url_for
from flask_login import current_user
from flask_wtf import FlaskForm
import sendgrid
from werkzeug.exceptions import HTTPExcepti... |
import tensorflow as tf
from tensorflow.keras import Model, Input
from tensorflow.keras import layers
from tensorflow.keras.initializers import TruncatedNormal
import math as m
def build_model_denoise(unet_args=None):
inputs=Input(shape=(None, None,2))
outputs_stage_2,outputs_stage_1=MultiStage_denoise(unet_... |
from datetime import datetime
import os
import xml.etree.ElementTree as ET
from collections import namedtuple
from enum import Enum, auto
from pathlib import Path
import numpy as np
from PIL import Image
from scipy.spatial.transform import Rotation
from d3d.abstraction import EgoPose
# ====== Common classes ======
#... |
# Author: <NAME>, TU Darmstadt (<EMAIL>)
# Parts of this code were adapted from https://github.com/ucbdrive/hd3
import argparse
import logging
import os
import shutil
import torch
from tensorboardX import SummaryWriter
import numpy as np
from PIL import Image
from datasets import datasets_segmentation, data_utils
imp... |
#Ligthning data module
import argparse
from . import __file__
from distributed import as_completed
import glob
import geopandas as gpd
import json
import numpy as np
import os
import pandas as pd
from pytorch_lightning import LightningDataModule
import rasterio as rio
from sklearn import preprocessing
from src import g... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""":Mod: load_data_table.py
:Synopsis:
:Author:
costa
ide
:Created:
5/9/19
"""
import csv
import hashlib
import math
import os
import re
import numpy as np
import pandas as pd
import time
from metapype.eml import names
from metapype.model.node import Node
... |
import sys
import numpy as np
from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL.GLUT import *
import glm
import threading
import time
import pywavefront
import pyrr
import os
from PIL import Image
from PIL import ImageOps
vao = None
vbo = None
shaderProgram = None # none, phong, flat, smooth
shaderP... |
"""Tests for OO layer of several polynomial representations. """
from sympy.polys.polyclasses import (
DMP, init_normal_DMP,
DMF, init_normal_DMF,
ANP, init_normal_ANP,
)
from sympy.polys.domains import ZZ, QQ
from sympy.polys.specialpolys import f_4
from sympy.polys.polyerrors import (
ExactQuotient... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Convenience functions for `astropy.cosmology`.
"""
import warnings
import numpy as np
from astropy.units import Quantity
from astropy.utils.exceptions import AstropyUserWarning
from .core import CosmologyError
__all__ = ['z_at_value']
__doctest_r... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
# Copyright 2019 The Forte 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 applicable ... |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# Copyright (c) 2021, Dell Inc. or its subsidiaries. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See the LICENSE file for details.
#
# This file is part of NVMe STorage Appliance Services (nvme-stas).
#
# Authors: <NAME> <<EMAIL>>
#
''' Module that provides a way to retrieve discovered
services fr... |
# %% imports
import logging
import warnings
from ..utils.general import is_numeric, is_categorical, make_iterable
from matplotlib import cm
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize, NoNorm, to_rgba, to_rgb, Colormap, ListedColormap
import seaborn as sns
import pandas as pd
# import matp... |
from bisect import bisect_left
import os
from tslearn.metrics import *
import csv
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
import numpy as np
from datetime import *
from scipy.signal import butter, lfilter, freqz
from scipy.spatial import distance
from pupil_tools.signal_tools import *
... |
import warnings
import numpy as np
from scipy.stats import norm, lognorm, beta, betaprime, gamma, uniform, gumbel_r
from .util import maxfloat
from .fast_truncnorm import truncnorm
META_NOISE_MODELS = (
'beta', 'beta_std',
'norm', 'lognorm', 'lognorm_varstd', 'betaprime', 'gamma',
'censored_norm', 'censo... |
import os
os.environ['DGLBACKEND']='pytorch'
from multiprocessing import Process
import argparse, time, math
import numpy as np
from functools import wraps
import tqdm
import sklearn.linear_model as lm
import sklearn.metrics as skm
import dgl
from dgl import DGLGraph
from dgl.data import register_data_args, load_data
... |
"""Define the Snoo API."""
import asyncio
import logging
import json
from datetime import datetime, timedelta
from typing import Dict, Optional, Union, Tuple
from aiohttp import ClientSession, ClientResponse
from aiohttp.client_exceptions import ClientError, ClientResponseError
from .const import (
BASE_ENDPOINT,
... |
import logging
import time
import typing
from itertools import islice
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data as data_utils
from pybnn.base_model import BaseModel
from pybnn.sampler import AdaptiveSGHMC, SGLD, SGHMC, PreconditionedSGLD, ConstantSGD, SGHMCHD
from pybnn.util.infinit... |
#!/usr/bin/env python3
# -*- coding = utf-8 -*-
# Copyright 2021 <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... |
#!/usr/bin/env python3
import datetime
import logging
import math
import os
import random
import re
import subprocess
import telnetlib
import time
import sys
MAX_RETRIES = 60
def gen_mac(last_octet=None):
"""Generate a random MAC address that is in the qemu OUI space and that
has the given last octet.
"... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 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... |
'''
title : BlockchainbasedFederatedLearning.py
description : Towards an Efficient IoMT: Privacy Infrastructure for COVID-19 Pandemic based on Federated Learning and Blockchain Technology
authors : <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>
date_created ... |
"""
ERP Integration Service Wrapper
"""
__all__ = ['ErpServiceApi', 'ErpServiceApiResponse']
import logging
import requests
import xml.etree.ElementTree as ET
from functools import wraps
from os.path import join as path_join
from xml.etree.ElementTree import Element, SubElement, tostring
from . im... |
"""Unaligned Packed Encoding Rules (UPER) codec.
"""
from . import DecodeError
from . import per
from . import restricted_utc_time_to_datetime
from . import restricted_utc_time_from_datetime
from . import restricted_generalized_time_to_datetime
from . import restricted_generalized_time_from_datetime
from . import add... |
import numpy as np
def HovorkaModel(x,t,parm,u,D):
"""
Hovorka model
Inputs: t: Time [min]
x: States
parm: Parameters
u: Manipulated variables [mU/min]
D: Disturbance (meal) [g CHO/min]
Outputs: dx: Derivative wrt. time.
... |
# TODO:
# 1. make exception renderer work (currently the code is in appserver.py)
# - srid
import warnings
warnings.warn("nevow.wsgi is deprecated.", category=DeprecationWarning)
import sys, socket, math, time
import cgi # for FieldStorage
import types
from urllib import unquote, quote
from zope.interface import im... |
#!/usr/bin/env python
"""
Command line tool for working with EC2 instances.
"""
from __future__ import print_function
import sys
import argparse
import csv
from datetime import datetime
from ConfigParser import NoOptionError
from dateutil import parser as dateutil_parser
from disco_aws_automation import DiscoAWS, Dis... |
#!/usr/bin/env python
# Copyright (c) 2013, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that
# the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this list of cond... |
#!/usr/bin/env python3
#Imports
import os
import re
import pexpect
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
import ast
from time import sleep
import datetime
import sys
import threading
from pathlib import Path
from copy import deepcopy
#functions and classes
class node:
''' This clas... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
"""
A command line interface to the qcfractal server.
"""
import os
import argparse
import shutil
import sys
import yaml
import qcfractal
from ..config import DatabaseSettings, FractalConfig, FractalServerSettings, _str2bool
from ..postgres_harness import PostgresHarness
from ..storage_sockets import storage_socket... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu May 17 14:07:03 2018
@author: avanetten
"""
from __future__ import print_function
import os
import json
import argparse
import pandas as pd
import numpy as np
import skimage.io
import cv2
import time
import logging
from jsons.config import Config
from ... |
import re
from collections import OrderedDict
from datetime import datetime
from enum import Enum, IntEnum
from base64 import b64encode
from base64 import b64decode
from typing import Callable
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from typing import Unio... |
# Copyright (c) 2020 <NAME>
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php
import random
import uuid
import logging
from twisted.internet.task import LoopingCall
from moneysocket.utl.bolt11 import Bolt11
from moneysocket.stack.... |
import math
import rlbot.utils.structures.game_data_struct as game_data_struct
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
# This file holds all of the objects used in gosling utils
# Includes custom vector and matrix objects
class GoslingAgent(BaseAgent):
# This is the main object of Go... |
from collections import Iterable as It
from makefun import add_signature_parameters, wraps
from six import raise_from, reraise, string_types
from wrapt import ObjectProxy
# try: # python 3.2+
# from functools import lru_cache
# except ImportError:
# from functools32 import lru_cache
try: # python 3.3+
... |
import graphene
from lingvodoc.models import (
User as dbUser,
BaseGroup as dbBaseGroup,
Client,
Group as dbGroup,
Grant as dbGrant,
Organization as dbOrganization,
Dictionary as dbDictionary,
DBSession
)
from lingvodoc.schema.gql_holders import (
LingvodocObjectType,
IdHolder,... |
'''
-- Implements a multiclass classifier learnt using neural network
-- Call L_layer_model(...) to train and predict(...) for prediction
-- Each column of X is one example
'''
import numpy as np
import math
def softmax(Z):
"""Compute the softmax of matrix Z"""
cache = Z
max_each_col = Z.max(axis=0)
e... |
import sublime
import sublime_plugin
import html
import os
import stat
import webbrowser
import time
import subprocess
from package_control import package_manager
from threading import Timer
from ..lib.requests import uninstalling, open_config, prefetch, autocomplete
SETTINGS_PATH = "TabNine.sublime-settings"
MAX_REST... |
#!/usr/bin/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 a... |
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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 applicabl... |
import argparse
import os
import sys
import time
import numpy as np
import torch
import torch.optim as optim
from model import Model
from xin_feeder_baidu import Feeder
from datetime import datetime
import random
import itertools
CUDA_VISIBLE_DEVICES='0'
os.environ["CUDA_VISIBLE_DEVICES"] = CUDA_VISIBLE_DEVICES
def... |
# -*- coding: utf-8 -*-
import numpy as np
__author__ = "<NAME>"
__email__ = "<EMAIL>"
def wigner_rotation(
ang_momentum_l,
R_in,
cos_alpha=None,
cos_beta=None,
wigner_matrix=None,
phase_alpha=None,
):
n = 2 * ang_momentum_l + 1
# if wigner_matrix is None:
n_orientation = cos_beta... |
from collections import OrderedDict
from itertools import chain
import errno
import json
import re
import six
import sys
from six import iteritems, iterkeys, string_types, with_metaclass
from toposort import toposort_flatten
from storage.backends import ContentFile
from .collection import ModelCollection
from .datast... |
#!/usr/bin/env python3
import faulthandler
import logging
import json
import os
import requests
import signal
import sys
import threading
import urllib.parse
from enum import Enum
from kubernetes import client as k8s_client, config as k8s_config
from kubernetes.client.rest import ApiException
from constant import REP... |
# coding=utf-8
# Copyright 2022 The Fiddle-Config 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... |
#!/usr/bin/python
"""Track and display progress, providing estimated completion time.
This module provides 2 classes to simply add progress display to any
application. Programs with more complex GUIs might still want to use it for the
estimates of time remaining it provides.
Use the ProgressDisplay class if your wor... |
# coding=utf-8
# Copyright 2019 The Google UDA 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 applicab... |
from base.base_model import BaseModel
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import *
from layers.utils_layers import resize_img
from losses.focal_loss import CategoricalFocalLoss
from losses.lovasz_softmax import MultiClassLovaszSoftmaxLoss
from tensorflow.keras import backen... |
import uuid
from collections import defaultdict
from glue.core import BaseData
from glue.config import colormaps
from glue.viewers.matplotlib.state import (MatplotlibDataViewerState,
MatplotlibLayerState,
DeferredDrawCallbackProperty... |
#!/usr/bin/env python
"""
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")... |
"""
This module contains functions to generate and merge stabilizer code simulation data.
"""
import collections
import itertools
import json
import logging
import statistics
import time
import numpy as np
from qecsim import paulitools as pt
from qecsim.error import QecsimError
from qecsim.model import DecodeResult
fro... |
from __future__ import print_function
import numpy as np
import tensorflow as tf
import copy
from sklearn.metrics import roc_curve
from scipy import interp
from tensorflow.python.platform import flags
from utils import CDL, L2_loss
from networks import ZZNet
FLAGS = flags.FLAGS
def average_gradients(tower_grads):
a... |
from pathlib import Path
from collections import (defaultdict, namedtuple)
from copy import deepcopy
import re
from ingest_validation_tools.yaml_include_loader import load_yaml
_table_schemas_path = Path(__file__).parent / 'table-schemas'
_directory_schemas_path = Path(__file__).parent / 'directory-schemas'
_pipelin... |
__source__ = 'https://leetcode.com/problems/decode-ways-ii/description/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 639. Decode Ways II
#
# A message containing letters from A-Z is being encoded to numbers using the following mapping way:
#
# 'A' -> 1
# 'B' -> 2
# ...
# 'Z' -> 26
# Beyond that, now the encod... |
import os.path as op
import numpy as np
import pandas as pd
from scipy import ndimage
import matplotlib as mpl
import nibabel as nib
from nipype import Workflow, Node, JoinNode, IdentityInterface, DataSink
from nipype.interfaces.base import traits, TraitedSpec
from nipype.interfaces import fsl, freesurfer as fs
from... |
# Copyright 2022 The jax3d 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 wr... |
# pylint: disable-msg=C0103
#
# backported code from 4Suite with slight modifications, started from r1.89 of
# Ft/Lib/Uri.py, by <EMAIL> on 2005-02-09
#
# part if not all of this code should probably move to urlparse (or be used
# to fix some existant functions in this module)
#
#
# Copyright 2004 Fourthought, Inc. (US... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" panache: Pandoc wrapped in styles
for more info: <https://github.com/sebogh/panache>
Author : <NAME> <<EMAIL>>
Copyright : Copyright 2017, <NAME>
License : BSD3
"""
import os
import errno
import sys
import tempfile
import re
import glob
import yaml
import loggin... |
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Elements' labels and properties for objects."""
# pylint: disable=too-few-public-methods
# pylint: disable=invalid-name
from collections import namedtuple
from lib.constants import objects, roles
class... |
#==========================================================================
# (c) 2019 Cirrus Logic, Inc.
#--------------------------------------------------------------------------
# Project : Parser for WMFW files
# File : wmfw_parser.py
#--------------------------------------------------------------------------
#... |
#
# Copyright 2019 Xilinx 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 writi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.