text stringlengths 8.04k 46.5k |
|---|
"""This module formats the IN/OUT trace messages to ease function call
tracking.
It supports thread highlighting: if a trace starts with {id} where id is a
decimal value representing the thread that prints out the trace, thread
differenciation is done.
"""
from configparser import ConfigParser
from logging import FATA... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##
## Name: eyepopper.py
## Purpose: Simple mailbox-to-POP3 gateway.
##
## Copyright © 2002 <NAME>. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are ... |
"""
Classes that represent different GEO entities
"""
import os
import re
import abc
import sys
import gzip
import json
import time
import subprocess
from . import utils
from sys import stderr, stdout
from pandas import DataFrame, concat
try:
from urllib.error import HTTPError
except ImportError:
from urllib2 ... |
###############################################################################
# apogee.spec.lsf: Utilities to work with APOGEE LSFs
# routines from github jobovy, modified by holtz to work in apogee product context
###############################################################################
import os, os.path
from... |
import time
import math
import torch
import torch.nn as nn
from torch import optim
import torchvision
from a5_helper import *
import matplotlib.pyplot as plt
def hello_single_stage_detector():
print("Hello from single_stage_detector.py!")
def GenerateAnchor(anc, grid):
"""
Anchor generator.
Inputs:
- ... |
"""
Assemblyline's built in Object Document Model tool.
The classes in this module can be composed to build database
independent data models in python. This gives us:
- single source of truth for our data schemas
- database independent serialization
- type checking
"""
import copy
import json
import re
import typin... |
""" Module to scrape reservoir data from National Water Agency of Brazil (ANA
for short in Portuguese).
The data is available on the Reservoir Follow-up System (SAR for short in
Portuguese), available on this URL: https://www.ana.gov.br/sar0/Home. Data is
grouped in three different systems, as follows: 'SIN', 'No... |
# -*- coding: utf-8 -*-
"""
Normalized n-dimensional cross-correlation.
:copyright: <NAME>
:source: http://stackoverflow.com/a/12254938/3381305
:license: Unknown
"""
import numpy as np
# import scipy as sp
from scipy.ndimage import convolve
# Try and use the faster Fourier transform functions from the anfft module if... |
# -*- coding: utf-8 -*-
from qa4sm_reader.img import QA4SMImg
import os
import seaborn as sns
from qa4sm_reader.plot_utils import *
import pandas as pd
def _make_cbar(fig, im, cax, ref_short, metric):
try:
label = globals._metric_name[metric] + \
globals._metric_description[metric].format(... |
from datetime import timedelta
import json
import redis
from urllib.parse import urljoin
from django.conf import settings
from django.contrib.auth.decorators import login_required, user_passes_test
from django.db.models import Q
from django.db.models.query import Prefetch
from django.http import HttpResponse, Http404
... |
#!/usr/bin/env python3
# Copyright (C) 2017-2022 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except... |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numbers
import numpy as np
from vispy.gloo import Texture2D, VertexBuffer
from vispy.visuals.shaders import Function, Varying
from vispy.visuals.filters... |
# -*- coding: utf-8 -*-
import uuid
import enum
import abc
import threading
import queue
import datetime
import logging
import argparse
_MOD_LOGGER = logging.getLogger(__name__)
from .errors import LeetPluginError, LeetError
class LeetJobStatus(enum.Enum):
'''Flags the status of an individual job.
How are t... |
# PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - <NAME> and <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
... |
import discord
import UnitData
import NukeTest
import UpgradeTest
import re
import os
import asyncio
import ReceiveNewUpdate
import JuckPae
from BotData import *
shutOutNewUpdateChannel = None
testVoiceChannel =None
async def onNewUpdate(response):
if shutOutNewUpdateChannel is not None:
await shutOutNewUpd... |
##
# Special thanks to @krey for the python3 support
##
import numpy as np
import colorsys
import colorlover as cl
import operator
import copy
from collections import deque
from six import string_types
from IPython.display import HTML, display
from .utils import inverseDict
from .auth import get_config_file
from .ex... |
import math
import random
import numpy as np
import re
import sys
sys.setrecursionlimit(99999)
SPLIT_CACHE = {}
class Rule:
def __init__(self, priority, ranges):
# each range is left inclusive and right exclusive, i.e., [left, right)
self.priority = priority
self.ranges = ranges
s... |
#
# GtkHelp.py -- customized Gtk2 widgets
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
import os.path
import math
from ginga.misc import Bunch, Callback
from ginga.fonts import font_asst
import ginga.toolkit
import gtk
import gobject
import... |
# -*- coding: utf-8 -*-
"""
Tools for scraping documents from The Royal Society of Chemistry.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import re
from bs4 import UnicodeDammit
from lxml.etree... |
__author__ = 'Altertech, https://www.altertech.com/'
__copyright__ = 'Copyright (C) 2019 Altertech'
__license__ = 'MIT'
__version__ = '0.6.13'
import curses
import sys
import rapidtables
import os
import threading
import shutil
import subprocess
from types import SimpleNamespace
from collections import OrderedDict
fr... |
# !/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = '<EMAIL> (<NAME>)'
from datetime import datetime
from sets import Set
imp... |
from warnings import warn
import sys
try: # python 3.5+
from typing import TypeVar, Union, Tuple, Callable, Any
try: # old python 3.5
from typing import Type
except ImportError:
pass
T = TypeVar('T')
except ImportError:
pass
from mini_lambda.base import get_repr, _PRECEDENCE_BITWI... |
'''
Parse rules-ng-ng XML format.
See rules-ng-ng.xsd and rules-ng-ng.xml for documentation of the format.
'''
# Copyright (c) 2012-2013 <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 Softw... |
import cv2
import numpy as np
import itertools
from primesense import openni2
from primesense import _openni2 as c_api
import matplotlib
matplotlib.use("TkAgg")
import scipy.misc
import matplotlib.pyplot as plt # noqa: ignore=E402
import os
import warnings
with warnings.catch_warnings():
warnings.filterwarnings(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# twitwist
#
# Generate and resolve twitter handle variations to detect typo squatting,
# phishing and corporate espionage.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
"""Tests for corpus_utils.py"""
from fractions import Fraction
import pandas as pd
import harmonic_inference.utils.corpus_utils as cu
import harmonic_inference.utils.rhythmic_utils as ru
measures_dicts = [
# No offsets
pd.DataFrame({
'mc': [1, 2, 3, 4, 5, 6, 7],
'act_dur': [Fraction(1),
... |
import numpy as np
from ALS.ALS1D import *
from ALS.twoDsub import *
from ALS.tracker import *
from os import sched_getaffinity
import multiprocessing as mp
def rndm(upper, nsmpl):
'''Function to create a given amount of random integer values in a given half-open interval
with lower border set to 0.
[... |
import numpy as np
from skimage.filters import threshold_otsu
import torch
import logging
from typing import List, Tuple, Optional, Union, Dict
from .opto_ws import OptopatchBaseWorkspace, OptopatchDenoisingWorkspace
from .opto_utils import pad_images_torch, crop_center, get_nn_spatio_temporal_mean
logger = logging.g... |
# -*- coding: utf-8 -*-
#
# Author: <NAME>, Finland 2016-2018
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waived all
# copyright and related or neighboring rights to Kunquat.
#
"""A wrapper for ... |
# ===============================================================================
#
# Copyright (c) 2013-2017 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
#
# ===============================================================================
import mat... |
"""Hydrogen optimization for PDB2PQR
This is an module for hydrogen optimization routines.
TODO - This module is insane... so many lines!
Authors: <NAME>, <NAME>, <NAME>
"""
import logging
import math
from xml import sax
from .. import input_output as io
from .. import aa
from .. import cells
from .. import topolog... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... |
# Copyright 2019 Jetperch 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 in writing,... |
import contextlib, sys, re, logging, time, html, jieba, json
from collections import defaultdict
from collections import namedtuple
import numpy as np
import tensorflow as tf
from sklearn.decomposition import TruncatedSVD
from bs4 import BeautifulSoup, UnicodeDammit
from xml.etree import ElementTree
import xml.... |
# coding: utf-8
from __future__ import unicode_literals, division
import re
import logging
import time
from itertools import islice
from collections import Iterable
from datetime import date, datetime
import dateutil.parser
import six
if six.PY3:
from urllib.parse import urlencode
else:
from urllib import url... |
# 根据大小自动设置分割区域
# 还是要根据食物的位置来判断,
# 还是根据视频来去除背景
#
# 参数
import os
import cv2
import time
import numpy as np
import matplotlib.pyplot as plt
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from egg_cut_video import cut_video_batch_process
from egg_cut_video import get_video... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import yaml
from jinja2 import Template
import json
import copy
import os
from enum import Enum
from os.path import abspath
from ..mydocker import gen_image_name
from .conf import PRIVATE_REGISTRY, DOMAIN, DOCKER_APP_ROOT
from ..util import lain_based_path
SOCK... |
import tensorflow as tf
import numpy as np
try:
import imgaug as ia
from imgaug import augmenters as iaa
except Exception:
raise ImportError("Pls install imgaug")
ia.seed(1)
## a seq of img augumentation ##
data_aug_seq = iaa.SomeOf(3,[
iaa.Fliplr(0.5), # horizontal flips
iaa.Crop(percent... |
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from sklearn.metrics import roc_auc_score, average_precision_score
# DNA LOADERS
class Genome:
def __init__(self, data_path, shift=0, img=False, methylation=False, merge_size=1):
"""C... |
from backend.config import Config
from backend.models import Recipe, Step, Replacement
from backend.functions import generate_new_id
from datetime import datetime
from pytest import raises
def step_creator(recipe: Recipe, steps_to_create=1, multiplier=1,
use_step_number_as_id=False) -> Recipe:
""... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
from tensorflow.keras.layers import Activation, Add, Dense, BatchNormalization, Concatenate, Dropout, Subtract, Flatten, Input, Lambda, Reshape
from tensorflow.keras.layers import Conv3D, Conv3DTranspose, MaxPool3D, AveragePooling3D, UpSampling3D, ConvLSTM2D
from tensor... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import defaultdict
from itertools import chain
import torch
from torch.nn.parallel import DistributedDataParallel
from torch.utils.data import DataLoader, TensorDataset
from ignite.engine import Engine,... |
################################################################################
# Name : ALF debugging library
# Author : <NAME> & <NAME>
#
# Copyright 2014 BlackBerry Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
# Copyright (c) 2018 <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <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 ... |
#!/usr/local/bin/python3
###############################################################################
import argparse
import copy
import json
import pathlib
import re
import sys
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import yaml
#######################################################... |
# Copyright 2015 Brocade Communications System, 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
#
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.
# SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>>
# NOTICE: authors should document their contributions in concisely in NOTICE
# with details inline in source files... |
import numpy as np
import torch
from bgtorch.utils.autograd import batch_jacobian
from bgtorch.nn.flow.base import Flow
def xyz2ic(x, Z_indices, torsion_cut=None):
""" Computes internal coordinates from Cartesian coordinates
Parameters
----------
x : array
Catesian coordinates
Z_indices :... |
#!/usr/bin/env python
# coding:utf-8
# @Author: Carter.Gao
# @Email: <EMAIL>
# @Date: 2019/8/21 15:45
# @IDE: PyCharm
# @About: 封装EXCEL操作
import os
from time import strftime
from shutil import move
import openpyxl
from openpyxl.chart.series import DataPoint
from openpyxl.chart import PieChart, Reference, ... |
from __future__ import print_function
import random
import numpy as np
from tqdm import tqdm
from functools import reduce
from .history import History
from .replay_memory import ReplayMemory
from .utils import get_time, save_pkl, load_pkl
import os
import tensorflow as tf
class BaseModel(object):
"""Abstract obje... |
#############################
##CS4386 Semester B, 2019-2020
##Assignment 2
##Name: <NAME>
##Student ID: [40128550]
###########################
# #
# # Alpha-Beta Algorithm mostly inspired from here:
# # https://github.com/K1ntus/Othello-Solver/blob/master/intelligence/movemanager/AlphaBeta.py
# # ( which is ... |
from pylab import *
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import datetime
import requests
import pandas_datareader.data as web
from Create_PDF_Report import portfolio_report
ALPHA_VANTAGE_KEY = 'ENTER_KEY'
RESULT_DETAILED = True
USER_AGENT = {
'User-Agent': (
... |
#
# MIT License
#
# Copyright (c) 2020-2021 NVIDIA CORPORATION.
#
# 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, ... |
# -*- coding:utf-8 -*-
# Copyright xmuspeech (Author: Snowdar 2020-02-28)
import sys
import torch
import torch.nn.functional as F
sys.path.insert(0, "subtools/pytorch")
import libs.support.utils as utils
from libs.nnet import *
def conv3x3(in_planes, out_planes, Conv=nn.Conv2d, stride=1, groups=1, dilation=1):
... |
"""
Environment for reinforcement learning
"""
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import warnings
import random
import itertools
import pprint
from collections import defaultdic... |
from skimage import io, measure, metrics, util, img_as_ubyte
from os.path import splitext, split
from wand.image import Image
from wand.color import Color
from decimal import *
from skimage.draw import rectangle
import json
import time
import re
import cv2
import pytesseract
from pytesseract import Output
from wand.ima... |
import os
import sys
import re
import unittest
import copy
import traceback
try:
from unittest import mock
except ImportError:
import mock
from io import StringIO
from click.testing import CliRunner
import numpy as np
import pandas as pd
from gpgrouper import gpgrouper
from gpgrouper import cli
# from .. impo... |
import tensorflow as tf
import numpy as np
from functools import partial
import itertools
import shutil
import os
import matplotlib.pyplot as plt
from matplotlib import animation
import matplotlib.patches as patches
from matplotlib.colors import to_rgb
from dps import cfg
from dps.utils import Param, Config, AttrDict... |
import logging
import os
import time
import torch
import numpy as np
from torch import nn, optim
from tensorboardX import SummaryWriter
from torch.nn.utils import clip_grad_norm_
# from evaluator import Evaluator
from tqdm import tqdm
from utils import tensor2text, calc_ppl, idx2onehot, add_noise, word_drop
# import... |
import argparse
import os
import re
import math
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
try:
import cupy as cp
from chainer.backends import cuda
except Exception as e:
None
import chainer.distributions as D
... |
"""
@author: <NAME>
"""
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
from scipy.interpolate import griddata
from mpl_toolkits.mplot3d import Axes3D
from pyDOE import lhs
import time
from plotting import newfig, savefig
import matplotlib.gridspec as gridspec
from mpl_toolki... |
import synlib_functions
inMsgString0 = '''
int CELL_delays(A_cells *self,int Src,int Dst,char Dval);
int CELL_setups(A_cells *self,int Src,int Dst,char Dval);
'''
inMsgString1 = '''
void inMsgCELL(A_cells *self,A_msgs *Msg,char Val){
int Changed = inMsgFirst(self,Msg,Val);
if (!Changed) return;
int Pi... |
import numpy as np
import os
import subprocess
from . import asteroseismic_functions as astero
__all__ = ['write_uniform_prior',
'write_data_range',
'get_background',
'set_peakbagging',
'run_peakbagging',
'run_asymptotic']
def write_uniform_prior(filename, bound... |
#-*- coding:utf8 -*-
# Import libraries
from utils import mapping_geom
import pandas as pd
import numpy as np
from geopy import Nominatim, BANFrance
from geopy.exc import GeocoderTimedOut
import math
import warnings
warnings.filterwarnings('ignore')
from get_connection import get_connection
from elasticsearch import h... |
# This code inserts hands from an image to another relative to their respective head poses.
#
# Dlib is used to estimate the head poses, stolen from GitHub:
# <NAME> (lincolnhard) Taiwan, <EMAIL>
#
# The head pose estimation uses a PnP solver to match between
# the detected facial landmarks and a predefined landmarks s... |
import os
import subprocess
import re
import json
import time
import pandas as pd
from keyboard import press
from shutil import copy
from distutils.dir_util import copy_tree
class Script(object):
"""Master object for holding and modifying .cmd script settings,
creating .cmd files, and running them through Ven... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/11 14:05
# @Author : Tao.Xu
# @Email : <EMAIL>
"""Mock Elasticsearch"""
import sys
import string
import base64
from functools import wraps
import unittest
# from mock import patch
from elasticsearch.client.utils import query_params
from elasticse... |
#!/usr/bin/env python3
import sys
import math
from PIL import Image, ImageDraw, ImageFont
EPS = 0.0001
g = 0.69 # TRESHOLDS for lasso classification
h = 0.55
sl = 1.5
R = 2 # precision for rounding an output
WIDTH = 400
HEIGHT = 400
FONT_SIZE = int(WIDTH / 27)
FONT_SIZE_SMALL = int(WIDTH / 35)
FONT_TYPE = "/usr/sha... |
import os
import random
import sqlite3
import sys
import time
import string
from spats_shape_seq.parse import FastFastqParser
SHOW_SLOW_QUERIES = False
class _ConnWrapper(object):
def __init__(self, conn):
self._conn = conn
def execute(self, query, args = []):
start = time.time()
res... |
# _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... |
__author__ = '<NAME>'
import itertools
import copy
import sys
import logging
import time
import random
from multiprocessing import Pool, cpu_count
import signal
from utility.logconfig import *
from PIL import ImageGrab
from utility.mouse import *
from utility.screen import *
# Adjustment factor for each level deep ... |
from .imports import *
from .callback import Callback
from .layer_optimizer import *
from .utils.extras import draw_line, draw_text, curve_smoothing
from enum import IntEnum
from timeit import default_timer as timer
class Recorder(Callback):
r"""
Saves and displays loss functions and other metrics. Also the de... |
# -*- coding: utf-8 -*-
""" BoardGameGeek spider """
import os
import re
import statistics
from functools import partial
from itertools import repeat
from urllib.parse import urlencode
from pytility import batchify, clear_list, normalize_space, parse_float, parse_int
from scrapy import signals
from scrapy import Re... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from . import data_extraction as de
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import itertools
"""
ROUTINES FOR REGULARLY GRIDDED DATA
The below functions only work/make sens... |
"""
Author : zhangxianbing
Date : 2021-12-05 12:50:05
Description :
LastEditors : zhangxianbing
LastEditTime : 2021-12-07 11:34:36
"""
__version__ = "0.1.6"
__author__ = "zhangxianbing"
import logging
import random
from itertools import cycle
from typing import Optional, Tuple
Color = Tuple[int, int,... |
import methoddispatch
import time
import math
import copy
import itertools
import networkx as nx
from functools import reduce, lru_cache, wraps
from crestdsl.caching import Cache
from . import checklib
from .tctl import * # I know, I know... but otherwise the formulas become unreadable !!
from .tctl import NamedAto... |
# coding=utf-8
import os
import sys
import commands
from multiprocessing import Pool
import time
import pickle
import numpy as np
import math
np.set_printoptions(threshold=np.inf)
sys.path.append('/home/dsjxtjc/2018211149/')
import utils.io_utils as iou
import dfs_sqy.dfs as dfs
import client.dfs_client as dfs_c... |
import time
from enum import Enum
from typing import List, Union, Optional, TYPE_CHECKING
import mstrio.config as config
import mstrio.utils.helper as helper
from mstrio.admin.server import ServerSettings
from mstrio.api import monitors, objects, projects
from mstrio.utils.entity import Entity, ObjectTypes
from mstrio... |
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
#
from kopf.structs.bodies import Body
from .. import consts, errors, kubeutils, shellutils, utils, config, mysqlutils
from .. import diagnose
from ..she... |
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from matplotlib import pyplot as plt
# from skimage import draw
import sys
import os
import logging
# from data import BratsIter, ConvertToMultiChannelBasedOnBratsClassesd
from heatmap_utlis import load_mri, ImageSliceViewer3D, read_bgmask_from_id
from ski... |
"""Streams."""
import asyncio
import os
import reprlib
import typing
import weakref
from asyncio import CancelledError
from contextvars import ContextVar
from time import monotonic
from typing import (
Any,
AsyncIterable,
AsyncIterator,
Callable,
Dict,
Iterable,
Iterator,
List,
Mapp... |
from ._base import *
# make stuff compatible and compliant with posix
# https://www.tensorflow.org/datasets/api_docs/python/tfds/core/ReadWritePath?hl=en
class LazyFile:
def __init__(self, filename, method='tmp', overwrite=True, cleanup=True):
self._dest_filename = filename
self._method = method
... |
# Copyright (C) 2003-2016, <NAME> <<EMAIL>>
# and ftputil contributors (see `doc/contributors.txt`)
# See the file LICENSE for licensing terms.
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import stat
import time
import pytest
import ftputil
import f... |
# (c) copyright by Politecnico di Milano
# original authors: <NAME>, <NAME>, <NAME>
#
# fard_node_manager.py
# This file contains classes for task management, task launch and FARD node
# management.
#
# FARD functionalities (completed and ongoing):
# - proxy network communication
# - routing and distributed communica... |
"""
Data Formats:
identification{
u'category': u'improving',
u'created_at': u'2011-12-04 05:08:30.290905',
u'current': u't',
u'id': u'53829',
u'observation_id': u'41053',
u'taxon_change_id': None,
u'taxon_id': u'47792',
u'user_id': u'3891'
}
observation{
u'community_taxon_id': u'47817', # Can also b... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from array import array
from itertools import combinations
from logging import DEBUG, getLogger
import sys
log = getLogger(__name__)
... |
import tensorflow as tf
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Add
from tensorflow.keras.layers import AveragePooling2D
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Conv2DTranspose
from t... |
import wx, wx.lib.newevent
from numpy import sign
import matplotlib as mpl
def fraction_to_value(fraction, min_value, max_value):
return (max_value - min_value) * fraction + min_value
def value_to_fraction(value, min_value, max_value):
try:
res = float(value - min_value) / (max_value - min_value)
... |
#!/usr/bin/env python3
# Technical Debt
# --------------
# - support repos.yaml for github repo resolution
# - worth doing the smart thing for externals? (yes for Sims)
# Known Bugs
# ----------
from codekit.codetools import debug, info, warn, error
from codekit import codetools, eups, pygithub, versiondb
import ar... |
import numpy as np
import yaml
from physics import *
import h5py as hp
import toml
# physical constants, etc.
h = 6.6261e-34
kB = 1.3806e-23
c = 299792458.0 # m/s
mu0 = 1.256637e-6
ep0 = 8.854188e-12
Z0 = np.sqrt(mu0/ep0)
Tcmb = 2.725
def get_atmos_from_hdf5(sim, nu):
# Given: (site, elevation, and pwv), plus th... |
import collections
import enum
import warnings
try:
import ssl
except ImportError: # pragma: no cover
ssl = None
from . import constants
from . import exceptions
from . import protocols
from . import transports
from .log import logger
if ssl is not None:
SSLAgainErrors = (ssl.SSLWantReadError, ssl.SSLSys... |
import tensorflow as tf
import tensorflow.contrib as tf_contrib
import numpy as np
# Xavier : tf_contrib.layers.xavier_initializer()
# He : tf_contrib.layers.variance_scaling_initializer()
# Normal : tf.random_normal_initializer(mean=0.0, stddev=0.02)
# l2_decay : tf_contrib.layers.l2_regularizer(0.0001)
weight_init ... |
import asyncio
import discord
from discord.ext import commands
import re
import xml.dom.minidom
from urllib.parse import quote as uriquote
import pytz
from datetime import datetime, timedelta
from utils.time import human_timedelta
WEMOJI ={
"cloudy": "\N{CLOUD}",
"partly-cloudy-day": "\N{WHITE SUN WITH SMALL ... |
from logging import exception
from math import fabs
from remind import client
import os
import sys
import re
from datetime import datetime
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from dateutil.parser import parse
from subprocess import call
import time
from securedata import secu... |
#!/usr/bin/env python
"""Wrapper objects for building and sending Message Cards."""
import json
from collections import OrderedDict, namedtuple
try:
# Python 3
from urllib import request
except ImportError:
# Fallback to python 2
import urllib2 as request
__version__ = "0.1.0"
Field = namedtuple("S... |
###############################################################################
# Copyright 2012-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... |
from enum import Enum, IntEnum
from typing import Tuple, List, Dict
from .utils import StateObservable
from . import gameconfiguration as GameConfig
class Direction(IntEnum):
NORTH = 0
NORTH_EAST = 1
EAST = 2
SOUTH_EAST = 3
SOUTH = 4
SOUTH_WEST = 5
WEST = 6
NORTH_WEST = 7
# Matrix for... |
# -*- coding: utf-8 -*-
"""
Individuals database models
--------------------
"""
from app.extensions import FeatherModel, db
from flask import current_app
import uuid
import logging
import app.extensions.logging as AuditLog
from datetime import datetime
from app.modules.names.models import Name
log = logging.getLogge... |
import os
import time
import sys
import random
import h5py
import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from keras.utils import Sequence
from sklearn.utils import class_weight
from keras.utils.np_utils import to_categorical
import src.exogenous_data as exogenous_data
####... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.