text stringlengths 8.04k 46.5k |
|---|
# https://stackoverflow.com/questions/60736027/how-to-set-text-color-to-gradient-texture-in-kivy
# https://gist.github.com/tshirtman/4247921
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.graphics import Rectangle
from kivy.graphics.texture import Texture
from kivy.properties import (
... |
"""CBMA methods from the ALE and MKDA families."""
import logging
import multiprocessing as mp
import nibabel as nib
import numpy as np
import pandas as pd
from scipy import ndimage
from tqdm.auto import tqdm
from ...base import MetaEstimator
from ...results import MetaResult
from ...stats import null_to_p, nullhist_... |
import datetime
from collections import defaultdict
from enum import Enum
from functools import total_ordering, reduce
from operator import __and__
from typing import Tuple, List, Optional, Union, Dict, Iterable, Any, TypeVar
import django.dispatch
from django.contrib.auth.models import User
from django.db import mode... |
import multiprocessing
import os
import time
from datetime import datetime, timedelta
import sys
from functools import partial
import mongo_proxy
from pymongo import UpdateOne, ReplaceOne, DeleteMany, MongoClient
sys.path.extend([sys.argv[1]])
import settings
from mongo_orm import MongoDB, AnyField
from project_custom... |
import cv2
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import numpy as np
from IPython.display import HTML
from base64 import b64encode
from math import floor
video = cv2.VideoCapture('project_video.mp4') # Load the source video
nFrames = int(video.get(cv2.CAP_PROP_FRAME_COU... |
"""Utilities around managing distributed locks and leases.
These locks (technically leases, since they expire, but referred
to in this file as "locks") can be used as an alternative to
db/ndb transactions in appropriate situations. See
http://engineering.khanacademy.org/posts/user-write-lock.htm
for details.
NOTE... |
#!/usr/bin/env python
# 12.01.2007, c
import os.path as op
import shutil
from optparse import OptionParser
import sfepy
from sfepy.base.base import *
from sfepy.base.conf import ProblemConf, get_standard_keywords
from sfepy.fem import ProblemDefinition
from sfepy.fem.evaluate import assemble_by_blocks
from sfepy.homo... |
from collections import Counter
from collections import OrderedDict
from evaluator import Evaluator
from model import Model
# from second_model import Model
# from variants import Model
import gc
import math
import numpy as np
import os
import pandas as pd
import random
import sys
import time
import visualize
import wa... |
#!/usr/bin/env python3
import datetime
import math
import os
import subprocess
import sys
import tempfile
from collections import OrderedDict
import dirsAndFiles as logistic
import gffutils
import gffutils.gffwriter as gffwriter
from Bio import SeqIO
from simplesam import Reader, Writer
#============================... |
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import object
from builtins import range
from builtins import input
from builtins import zip
from builtins import next
from builtins import str
import sys
import os
... |
import cv2
import numpy as np
import base64
from math import atan2
import pickle
import glob
from natsort import natsorted
from PIL import Image, ImageDraw
from sub_modules import *
IGNORE_KERNEL_SIZE = 12
P = 60
def image_preprocess(base64Image, calib=False):
tmp1 = base64.b64decode(base64Image)
tmp2 = np.f... |
from __future__ import print_function
from __future__ import division
import numpy as np
import os
import sys
import cv2
import random
import pickle
import torch
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
import torch.optim as optim
from torch.optim import lr_scheduler
import torch.utils.... |
from collections import defaultdict
from dataclasses import fields
from pathlib import Path
from typing import cast
import xarray as xr
from pydantic.dataclasses import dataclass
from ravenpy.config.commands import (
HRU,
LU,
BaseDataCommand,
BasinIndexCommand,
HRUState,
Sub,
)
from ravenpy.co... |
# using GNPy v2.1
import getpass
import logging as lg
import time
import json
import networkx as nx
import gnpy.core.ansi_escapes as ansi_escapes
import matplotlib.pyplot as plt
import numpy as np
import plotly.graph_objects as go
from gnpy.core.elements import Transceiver, Fiber, RamanFiber, Edfa
from gnpy.core.equi... |
# Creates figures with measured astrometry and background tracks
# <NAME>, June 2014
# main driver routine + usage() and read_input_file()
import os,sys,getopt
import numpy as np
from utils import *
from astropy import units as u
from astropy.time import Time
from astropy.coordinates import ICRS, Angle
import pickle
... |
# -*- coding: utf-8 -*-
import sys
import os
import socket
import ssl
import select
import httplib
import urlparse
import threading
import gzip
import zlib
import time
import json
import re
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
from cStringIO import String... |
#!/usr/bin/env/python3
"""
Recipe for training a Blind SI-SNR estimator
Authors:
* <NAME> 2021
* <NAME> 2021
* <NAME> 2021
"""
import os
import sys
import torch
import speechbrain as sb
import speechbrain.nnet.schedulers as schedulers
from speechbrain.utils.distributed import run_on_main
from hyperpyyaml import lo... |
# -*- coding: utf-8 -*-
# pylint: disable=all
"""
Econ CLI entry points.
"""
import click
import logging
from math import ceil
import os
import pprint
import time
from warnings import warn
from reV.config.project_points import ProjectPoints, PointsControl
from reV.config.sam_analysis_configs import EconConfig
from reV... |
import numpy as np
import pandas as pd
from typing import List, Dict, Tuple, Union, Optional, Set
import warnings
__all__ = ['to_cartesian', 'to_pt_eta_phi', 'delta_phi', 'twist', 'add_abs_mom', 'add_mass', 'add_energy', 'add_mt', 'get_vecs', 'fix_event_phi', 'fix_event_z',
'fix_event_y', 'event_to_cartesia... |
import math
import torch
import torch.nn as nn
from torch.nn import init
from torch.autograd import Variable
from torch.nn import Parameter
from torch.nn import functional as F
from torch.nn.modules.utils import _pair
import slowfast.utils.logging as logging
from .build import MODEL_REGISTRY
from slowfast.models i... |
"""
Generates the README.md file.
"""
import os
import sys
import typing
from analysis import plot_distance, plot_transits, plot_acceleration, plot_common, plot_events, video_data
class LineWordCharCount:
def __init__(self):
self.lines = 0
self.words = 0
self.chars = 0
def update(s... |
import numpy as np
import pandas as pd
from tqdm import tqdm
from glob import glob
from natsort import natsorted
import matplotlib.cm
import matplotlib.pyplot as plt
import os
from .simulation import load_lookup_functions
from .utils import load
def reconstruct(folder, lookupfile, muperpixel, outfile=None, r_min=... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Distributed under the terms of the MIT License.
"""
Module for plotting cage properties.
Author: <NAME>
Date Created: 29 May 2020
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cm
from pandas import r... |
# coding: utf-8
import torch.nn as nn
import torch
from ..registry import HEADS
from ..utils import ConvModule
from .bbox_head_semantic import BBoxSemanticHead
import ipdb
import numpy as np
import torch.nn.functional as F
from ..losses import accuracy
from mmdet.core import (auto_fp16, bbox_target, delta... |
from _helper import TestCase, download, check_internet_connectifity
from jfscripts import list_files
from jfscripts import pdf_compress
from jfscripts._utils import check_dependencies
from jfscripts.pdf_compress import FilePath, State, Timer
from pathlib import Path
from subprocess import check_output, run
from unittes... |
# -*- coding: utf-8 -*-
#
# This file is part of RERO ILS.
# Copyright (C) 2017 RERO.
# Copyright (C) 2019 UCLouvain.
#
# RERO ILS 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 2 of the
# Lice... |
import re
import copy
from ctypes import c_float, POINTER, c_void_p
from contextlib import contextmanager
import logging
import numpy as np
import PIL.Image as Image
import OpenGL.GL as gl
c_float_p = POINTER(c_float)
NULL_PTR = c_void_p(0)
CHECK_GL_ERRORS = False
DTYPE_COMPONENT_TYPE = {
np.dtype(np.uint16... |
# -*- coding: UTF-8 -*-
"""
-------------------------------------------------
# @Project -> File :joint-model -> alg
# @Author :bosskai
# @Date :2020/7/8 14:47
# @Email :<EMAIL>
-------------------------------------------------
"""
# -*- coding: utf-8 -*-
import torch
def numericalize_sibs(sequence):
sibs =... |
from typing import Tuple
import warnings
warnings.simplefilter("ignore", UserWarning)
from functools import partial
from multiprocessing.pool import Pool
import pandas as pd
import numpy as np
import numpy_groupies as npg
from cellphonedb.src.core.core_logger import core_logger
from cellphonedb.src.core.models.comple... |
# -*- coding: utf-8 -*-
from pycobot.pycobot import BaseModel
from peewee.peewee import CharField, IntegerField
import random
import copy
class games:
def __init__(self, core, client):
# Nos fijamos si somos el único (o el primer) m_games que se cargo.
# Si es así, entonces cargamos los timehandl... |
# -*- coding: utf-8 -*-
#
from mmd.module.MMath import MRect, MVector2D, MVector3D, MVector4D, MQuaternion, MMatrix4x4 # noqa
from mmd.utils.MLogger import MLogger # noqa
import numpy as np
import bezier
logger = MLogger(__name__)
# MMDでの補間曲線の最大値
INTERPOLATION_MMD_MAX = 127
# MMDの線形補間
LINEAR_MMD_INTERPOLATION = [MVec... |
"""
PyBoy GameBoy (TM) Emulator
constants.LCD Video Display Processor
"""
from pypy.lang.gameboy import constants
from pypy.lang.gameboy.ram import iMemory
class VideoCallWraper(object):
def call(self, pos, color, mask):
pass
class set_overlapped_object_line_call_wrapper(VideoCallWraper):
de... |
#For this code to run, KaggleSubmissionFile10836.csv is to be submitted as input file.
#The concept here is the best score file is fedback to the model as training data along with actual train.csv
import matplotlib
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import mat... |
import pythreejs
import ipywidgets
import ipywidgets.embed
from vis.viewer_base import *
# Threejs apparently only supports square textures, so we need to add padding to rectangular textures.
# The input UVs are assumed to take values in [0, 1]^2 where (0, 0) and (1, 1) are the lower left and upper right
# corner of ... |
'''
Created on Apr 27, 2017
@author: eze
'''
import glob
import logging
import os
from itertools import combinations
from tqdm import tqdm
import numpy as np
import pymongo
from bson.objectid import ObjectId
from mongoengine import connect, register_connection
from tqdm import tqdm
from Bio.Seq import Seq
from Bio.S... |
# python imports
import sys, os
# torch imports
import torch
import torch.nn as nn
# numpy imports
import numpy as np
# graphviz imports
from graphviz import Digraph
# code imports
import settings_file as sf
from node_classes import *
import parse_input_forms as pf
#################
# General utilities
###############... |
from . import ns, get_encoded_text, MY_API_KEY
import requests
import xml.etree.ElementTree as ET
import os
import sys
SCOPUS_XML_DIR = os.path.expanduser('~/.scopus/xml')
SCOPUS_ISSN_DIR = os.path.expanduser('~/.scopus/issn')
if not os.path.exists(SCOPUS_XML_DIR):
os.makedirs(SCOPUS_XML_DIR)
if not os.path.exis... |
'''
*
* Copyright (C) 2020 Universitat Politècnica de Catalunya.
*
* 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 requi... |
#!/usr/bin/env python3
#===============================================================================
# seqalign.py
#===============================================================================
"""Easy management of sequence alignment data
A mini-module for managing sequence alignment data. The language of this ... |
"""
This Modules performs the basic preprocessing on the raw data:
1. R-Peaks are detected to seperate the signal into individual heartbeats
2. Heartbeats with less than 5% unique values are clipped
3. Every heartbeat is interpolated to dimension 100
4. Individual interpolated heartbeats are saved
Outputs several pr... |
# coding: utf-8
import datetime
from django.core.validators import RegexValidator
from django.db import models
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from . import managers
from spec... |
NS = 4
central_mass = 0
length = 10
resol = 128
# If you own a supercomputer, can try 384 or 512
solitons = [[6,[1,1,0],[0,0,0],0],
[6,[-1,-1,0],[0,0,0],0],
[6,[1,-1,0],[0,0,0],1],
[6,[-1,1,0],[0,0,0],1]]
Plot = 'Phi' # 'Rho'
# Mass, 3-Position, 3-Velocity, Phase (/ pi)
start_ti... |
import subprocess
import re
import struct
# make from 5-9 list of integers
def split_range(numstr):
num1, num2 = numstr.split('-')
return list(range(int(num1), int(num2)+1))
# join continuous data in array -> [1, 2, 4, 5] --> ({first:1, total:2}, {first:4, total:2})
def join_ranges(arr):
last_f... |
from sympy import (
Symbol,
Dummy,
diff,
Derivative,
Rational,
roots,
S,
sqrt,
hyper,
cos,
gamma,
conjugate,
factorial,
pi,
oo,
zoo,
binomial,
RisingFactorial,
legendre,
assoc_legendre,
chebyshevu,
chebyshevt,
chebyshevt_root,
... |
import codecs
import argparse
import logging
import random
import emoji
import re
import string
from tqdm import tqdm
random.seed(2020)
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
parser = argparse.Argum... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
from __future__ import print_function
import threading
import traceback
import os
import sys
import hashlib
import uuid
import time
import glob
import base64
import subprocess
import six
import shutil
import socket
import json
import binascii
import decimal
import logging
import tempfile
import requests
import zipfile... |
import xarray as xr
import numpy as np
import os
import os.path
from dask.diagnostics import ProgressBar
import oas_erf.data_info.variable_info
import oas_erf.util.eusaar_data.distc_var as distc_var
from oas_erf.data_info import get_nice_name_case
from oas_erf.data_info.variable_info import sized_varListNorESM
from o... |
# -*- coding: utf-8 -*-
import numpy as np
import scipy
from scipy import fftpack
import torch
from math import cos, sin
from numpy import zeros, ones, prod, array, pi, log, min, mod, arange, sum, mgrid, exp, pad, round
from numpy.random import randn, rand
from scipy.signal import convolve2d
import cv2
import random
#... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import dataclasses
import importlib.resources
import json
import logging
import os
from collections import defaultdict
from dataclasses import dataclass... |
# Copyright 2021 Prayas Energy Group(https://www.prayaspune.org/peg/)
#
# 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... |
# Copyright 2018 The TensorFlow Probability 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 o... |
"""Types used in the intermediate representation.
These are runtime types (RTypes), as opposed to mypy Type objects.
The latter are only used during type checking and not directly used at
runtime. Runtime types are derived from mypy types, but there's no
simple one-to-one correspondence. (Here 'runtime' means 'runtim... |
# -*- coding: utf-8 -*-
"""
This module contains methods for constructing timeseries figures.
================================================================================
@Author:
| <NAME>, NSSC Contractor (ORAU)
| U.S. EPA / ORD / CEMM / AMCD / SFSB
Created:
Mon Jan 27 08:49:12 2020
Last Updated:
Wed Ju... |
"""Auth related view functions"""
from __future__ import unicode_literals # isort:skip
import base64
from datetime import datetime
import hashlib
import hmac
import json
from authomatic.adapters import WerkzeugAdapter
from authomatic.exceptions import CancellationError, ConfigError
from flask import (
Blueprint,... |
#!/usr/bin/python3
import http.server
import urllib
import sys
import os
import cgi
import socketserver
import subprocess
import threading
import logging as pylogging
import logging.handlers
import traceback
from datetime import datetime
from GuestFishWrapper import GuestFishWrapper
from GuestFishWrapper import DiskIn... |
import sys
import numpy as np
import datetime
from collections import defaultdict
import os
# from sklearn.metrics import confusion_matrix
import glob
import keras
from Bio import pairwise2
import _pickle as cPickle
import copy
from ..features.helpers import scale_clean, scale_clean_two
from .helper import lrd
import c... |
"""several auxiliary functions"""
import argparse
import datetime
import itertools
import sys
import torch
import os
import numpy as np
import time
def info(t, name=''):
print(name, '|', t.type(), '|', t.shape)
def flatten(list_in):
return [list(itertools.chain.from_iterable(list_item)) for list_item in lis... |
#!/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... |
"""Dirac notation for states."""
from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt,
Tuple)
from sympy.printing.pretty.stringpict import stringPict
from sympy.physics.quantum.qexpr import QExpr, dispatch_method
__all__ = [
'KetBase',
'BraBase',
'StateBase',
'... |
# Copyright 2018-2021 Xanadu Quantum 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 applicable law or... |
# ICA functions
'''
authors:
<NAME>
<NAME>
email: <EMAIL>
Change history:
21.01.2020: - changes in ica_array
- now returns an MNE-type of ICA object (default)
- in fastica changed default to whiten=False
- added function to convert any ica objec... |
import GPy
import numpy as np
#import GPy.util.choleskies # TODO use GPy's cholskies module
import choleskies
import plotting
from special_einsum import special_einsum
class Layer(GPy.core.parameterization.Parameterized):
"""
A general Layer class, the base for hidden, input and output layers.
"""
def ... |
import abc
import socket
import sys
import tarfile
import typing as ty
import urllib.parse
import multiaddr # type: ignore[import]
from multiaddr.protocols import (P_DNS, P_DNS4, P_DNS6, # type: ignore[import]
P_HTTP, P_HTTPS, P_IP4, P_IP6, P_TCP, P_UNIX)
from . import encoding
from... |
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
import json
import logging
from pathlib import Path
import re
import numpy as np
import mtscomp
from brainbox.core import Bunch
from ibllib.ephys import neuropixel as neuropixel
from ibllib.io import hashfile
SAMPLE_SIZE = 2 # int16
DEFAULT_BATCH_SIZE = 1e6
_logger = logging.getLogger('ibllib')
class Reader:
... |
# Copyright (C) 2020 THL A29 Limited, a Tencent company.
# All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may
# not use this file except in compliance with the License. You may
# obtain a copy of the License at
# https://opensource.org/licenses/BSD-3-Clause
# Unless required by appl... |
import warnings as test_warnings
from unittest.mock import patch
import pytest
from rotkehlchen.assets.asset import Asset
from rotkehlchen.assets.converters import UNSUPPORTED_POLONIEX_ASSETS, asset_from_poloniex
from rotkehlchen.constants.assets import A_BTC, A_ETH
from rotkehlchen.errors import DeserializationError... |
# -*- coding: utf-8 -*-
"""
Rearranging and Restructuring Lists
These functions reorder and rearrange lists.
"""
import functools
from collections import defaultdict
from itertools import chain
from typing import Callable
from mathics.builtin.base import (
Builtin,
MessageException,
)
from mathics.core.ex... |
import numpy as np
from scipy.spatial.distance import mahalanobis
from dipy.tracking.streamline import (set_number_of_points, nbytes,
select_random_set_of_streamlines,
values_from_volume,
orient_by_streamli... |
# Builtin
import logging
# External
from Qt import QtWidgets
from Qt import QtGui
from Qt import QtCore
# Internal
import nxt_editor
from nxt_editor import user_dir
from nxt_editor.dockwidgets.dock_widget_base import DockWidgetBase
from nxt import nxt_path
logger = logging.getLogger(nxt_editor.LOGGER_NAME)
class ... |
import os
import json
import time
import subprocess
import collections
import asyncio
import logging
import socket
import platform
import filecmp
import tempfile
import threading
import shutil
from queue import Queue
from contextlib import closing
from ..tools import publish
from ..vendor.Qt import QtCore
from avalon ... |
# load_data module
# contains functions to load data from various formats of file
version = '29th April 2021'
# Nexus is a registered trademark of the Halliburton Company
import logging
log = logging.getLogger(__name__)
log.debug('load_data.py version %s', version)
# defs:
# def file_exists(file_name):
# def ... |
# NOTE: While this is definitely ready for use, it should be noted that it does
# *not* play nicely with the asterisk-undo in the English steno system; and that
# it also *won't* play nicely with the suggestions window. To fix both of these,
# all keypresses would have to be marked as, well, keypresses, but I'll only a... |
#!/usr/bin/env python3
# Copyright 2016 The Kubernetes 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 appl... |
# Copyright (c) 2019, NVIDIA CORPORATION. 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 conditions a... |
# "Tiled" TMX loader/renderer and more
# Copyright 2012 <NAME> <<EMAIL>>
# This code is placed in the Public Domain.
#
# Changes (July 2013 by <NAME>):
# Ported to Python 3
# Added selective area support SpriteLayer.draw
import sys
import struct
import pygame
from pygame.locals import *
from pygame import Rect
from x... |
import datetime
import functools
import os
from urllib.parse import urljoin
import arcgis
import geopandas
import numpy
import pandas
import requests
from airflow import DAG
from airflow.hooks.base_hook import BaseHook
from airflow.models import Variable
from airflow.operators.python_operator import PythonOperator
fro... |
import socket
from threading import Thread
from collections import defaultdict
from datetime import datetime
import os
import time
# from config import channels_dict, ip_server, ip_client, TIME_FORMAT, __version__
from config import channels_dict, TIME_FORMAT, __version__
from ftplib import FTP
import pandas as pd
impo... |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... |
"""Tests for hermite_e module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.hermite_e as herme
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
assert_almost_equal, assert_raises, assert_equal, assert_,
run_module_su... |
# Copyright 2018 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 cv2
import numpy as np
import random
import torch
ARTIFACT_CATEGORIES = dict((name, artf_id) for artf_id, name in enumerate([
'nothing', 'backpack', 'phone', 'survivor', 'vent', 'robot', 'helmet',
'rope', 'breadcrumb', 'drill', 'fire_extinguisher', 'cube'
#'toolbox', 'electrical_box', 'radio', 'valv... |
from . import ClientConstants as CC
from . import ClientExporting
from . import ClientGUIACDropdown
from . import ClientGUICommon
from . import ClientGUIDialogs
from . import ClientGUIListBoxes
from . import ClientGUIListCtrl
from . import ClientGUIScrolledPanels
from . import ClientGUIScrolledPanelsEdit
from . import ... |
# import argparse
import os
# from glob import glob
import sys
import numpy as np
import cv2
import matplotlib.pyplot as plt
# import functools
# import random
import torch
import torch.backends.cudnn as cudnn
# import numpy as np
# from torch.utils.data import DataLoader
import segmentation_models_pytorc... |
"""Frontend widget for the Qt Console"""
# Copyright (c) Jupyter Development Team
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
from collections import namedtuple
import sys
import uuid
try:
from queue import Empty
except ImportError:
from Queue import Empty... |
# Copyright 2021 The Flax 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 wri... |
import json
import os
import shutil
import subprocess
import unittest
import uuid
from typing import List, Optional
from toil.test import ToilTest
from toil.version import exactPython
from toil.wdl.wdl_functions import (WDLPair,
WDLRuntimeError,
c... |
import __main__
import gzip
import io
from lxml import etree
parser = etree.XMLParser(remove_comments=True, remove_blank_text=True)
from json import loads
from reportlab.pdfgen import canvas
from reportlab.lib import pagesizes
# from reportlab.lib.units import inch, mm
import reportlab.lib.colors as colors
import log... |
import datetime
import os
import matplotlib.pyplot as plt
import numpy as np
import tuh_sz_extract_metadata as mt
def seconds_to_human_readble_time(seconds):
"""Converts a number of seconds to a readable string.
(days, hours, minutes, seconds, etc.)
Args:
seconds: the number of seconds to conv... |
# Copyright: 2006-2011 <NAME> <<EMAIL>>
# License: GPL2/BSD
__all__ = (
"ProfileError", "ProfileNode", "EmptyRootNode", "OnDiskProfile",
"UserProfile", "PkgProvided", "AliasedVirtuals"
)
import errno
from functools import partial
from itertools import chain
import os
from snakeoil import caching, compatibili... |
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1
# DIALS_ENABLE_COMMAND_LINE_COMPLETION
from __future__ import absolute_import, division, print_function
import copy
import libtbx.phil
import gltbx
import gltbx.gl as gl
import wx
import wxtbx.utils
from dials.util import wx_viewer
from dxtbx.model im... |
"""
Procedural generation of SafeLife levels.
"""
import numpy as np
from scipy import ndimage, signal
from .safelife_game import CellTypes, SafeLifeGame
from .random import coinflip, get_rng
from . import speedups
import logging
logger = logging.getLogger(__name__)
COLORS = {
'black': np.uint16(0),
'red': ... |
from .CCDefaults import getDefault
from .naturalGas import NatGasFootprint
#
# based on <NAME> spreadsheet "ASHP Energy Calculations" - version 11/22/2015
#
# inputs:
# home_annual_heating_load - default 114.3 MMBTU
# ASHP_seasonal_COP
# Fraction_heating_load_offset
# boiler_efficiency(heat_fuel) - def 0.82
# ... |
"""
Reconstruct the MalConv architecture from the Flush+Reload results
"""
# basic
import os
import json
import argparse
from math import ceil
from copy import deepcopy
from itertools import product
# externals (numpy, networkx, matplotlib)
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
... |
# -*- coding: utf-8 -*-
#
# cip_base.py - A set of classes methods and structures used to implement Ethernet/IP
#
#
# Copyright (c) 2014 <NAME> <<EMAIL>>
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Starting with
# https://codereview.stackexchange.com/questions/98247/wordsearch-generator
from __future__ import print_function
import itertools
import logging
import random
import sys
from random import randint
import unicodedata
# Set up fill letters, including tho... |
from configparser import ConfigParser
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type as TypingType, Union
from mypy.errorcodes import ErrorCode
from mypy.nodes import (
ARG_NAMED,
ARG_NAMED_OPT,
ARG_OPT,
ARG_POS,
ARG_STAR2,
MDEF,
Argument,
AssignmentStmt,
B... |
import tkinter as tk
from tkinter import ttk, simpledialog, filedialog
import numpy as np
import json
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from scipy.stats import norm
from scipy import optimize
from datasample import DataSample
matplot... |
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Loss functions
"""
import torch
import torch.nn as nn
from torch.nn import functional as F
from utils.metrics import bbox_iou
from utils.torch_utils import de_parallel
from utils.torch_utils import is_parallel
def smooth_BCE(eps=0.1): # https://github.com/ultralytics/y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.