text stringlengths 8.04k 46.5k |
|---|
"""Provide a plugin manager."""
import asyncio
import datetime
import os
import platform
import subprocess
import sys
import threading
import time
import traceback
import uuid
import GPUtil
from imjoy import __version__, API_VERSION, IMJOY_PACKAGE_DIR
from imjoy.connection.decorator import socketio_handler as sio_on
... |
# -*- coding: utf-8 -*-
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""cros tryjob: Schedule a tryjob."""
from __future__ import print_function
import json
import os
import sys
import time
from c... |
#!/usr/bin/env python3
'''
This script loads a specific leg
And tries to move it to arbitrary angles
USAGE:
./controller_shakeout.py --simulate 1/0
2021-05-13
audio,1 => move forward or back
audio,2 => move randomly side to side
audio,3 => tilt f/b or side/side
manual => engage control
horn => noop
head lights => t... |
'''
astronaut_webapp
<NAME>
'''
import sys
import os
import flask
import json
import config
import psycopg2
api = flask.Blueprint('api', __name__)
def get_connection():
''' Returns a connection to the database described in the
config module. May raise an exception as described in the
docum... |
import numpy as np
import pickle, os, random, math
from networks_v0_2 import *
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras.models import load_model
from tensorflow.keras.backend import clear_session
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
fro... |
import numpy as np
from numba import njit
# from matplotlib.colors import BoundaryNorm
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib.ticker import MaxNLocator
from IPython.display import clear_output
import seaborn as sns
# lpf = linearized position fit
#
# <NAME> - Feb. 2... |
#!/usr/bin/env python
# coding: utf-8
# Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved BSD-3 license. (c) <NAME>, <NAME> 2017. Thanks to NSF for support via CAREER award #1149784.
# [@LorenaABarba](https://twitter.com/LorenaABarba)
# 12 steps to N... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
class implementations for real-time 3D feature extraction
"""
import pandas as pd
import os
import glob
import numpy as np
from tomo_encoders import *
from tensorflow import keras
from tomo_encoders import Patches
import tensorflow as tf
from tensorflow.keras.mode... |
# Copyright (c) Facebook, Inc. and its affiliates.
# Original copyright notice:
# nuScenes dev-kit.
# Code written by <NAME>, 2018.
import copy
import os.path as osp
from abc import ABC, abstractmethod
from functools import reduce
from typing import Tuple, List, Dict, TYPE_CHECKING, Any, Optional
import numpy as np
... |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
import sys
import time
import platform
import getpass
from... |
# This code is a part of XMM: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
# Last modified by <NAME> (<EMAIL>) 09/06/2021, 10:36. Copyright (c) <NAME>
import os
from random import randint
from shutil import rmtree
from typing import Union
import numpy as np
from astropy.units impo... |
"""
`mytrie.py` -- Generic tries for Python
=====================================
Copyright 2011 by <NAME>.
Distributed subject to the Creative Commons Attribution 3.0 Unported license
(CC BY 3.0): http://creativecommons.org/licenses/by/3.0/
A library of generic Trie data structures
------------------------------... |
from math import atan, degrees, sqrt
import numpy as np
from skimage.exposure import equalize_adapthist
from skimage.feature import canny
from skimage.filters import threshold_otsu
from skimage.io import imread
from skimage.morphology import binary_dilation, binary_erosion, remove_small_objects, binary_closing
from sk... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# To build simple dialogues etc. (requires pyqt4)
#
# Part of the PsychoPy library
# Copyright (C) 2002-2018 <NAME> (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import absolute_import, print_... |
import os, sys
import numpy as np
import pandas as pd
import subprocess
import glob
import json
import csv
import pickle
from scipy import stats
from Bio.Seq import Seq
from itertools import product
import multiprocessing as mp
from peak_synchronization import *
#-----------------------------------------------------... |
# ugui.py Micropython GUI library
# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2019-2022 <NAME>
# Requires uasyncio V3
import uasyncio as asyncio
from uasyncio import Event
from time import ticks_diff, ticks_ms
import gc
from gui.core.colors import *
from hardware_setup import ssd
from gui.... |
# Copyright (c) 2014 EMC Corporation.
# 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 requ... |
import sys
import glob
import numpy as np
from popcorn import resampling, input_output
import spekpy as sp
import skimage.io as io
import pandas as pd
def loading_bar(iteration, total_iterations):
"""
Args:
iteration ():
total_iterations ():
Returns:
"""
percent = "{0:.1f}".f... |
# Copyright 2020 Magic Leap, 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 writing... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import hashlib
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
from cms.models import CMSPlugin, PlaceholderField... |
from fitMasses import FitClass
import fitfunctions as ffs
import numpy as np
import matplotlib.pyplot as plt
import Basefile as Bf
from DataFittingWindow import Ui_MainWindow
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import os
with open('Last_Directory.txt', 'r') as f:
plt.rcParams["savefig.directory"]... |
# -*- coding: utf-8 -*-
import importlib
import numpy as np
from PIL import Image
import os
import sys
import cv2
import random
import json
import string
from .file_utils import inorder_choose_data
import torch
def get_datasets_without_mask(
imgs_dir, label_dir, height, width, channels, train_test="null"
):
N... |
#!/usr/bin/python3
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Interface Innovations"
__credits__ = ["<NAME>"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import inspect
import os
import sys
top_folder = os.path.split(os.path.re... |
from . import FmdlFile, PesSkeletonData
import numpy
#
# FMDL meshes have a maximum number of vertices and faces in them, and the
# bone groups they reference have a maximum number of bones in them. All these
# limits are strict enough to hit them frequently in practice.
#
# This extension will transparently cut any m... |
#!/usr/bin/env python
import gzip
import sklearn
import Bio
import rdkit
import re
import scipy as sp
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import pubchempy as pc
from Bio.KEGG import Compound
from Bio.KEGG import REST
from Bio.KEGG import... |
import time
from datetime import datetime
import os
import sys
sys.path.insert(0, '/mnt/e/Dev/Polyglot/PolyglotDB')
import re
import yaml
import csv
import platform
import polyglotdb.io as pgio
from polyglotdb import CorpusContext
from polyglotdb.io.enrichment import enrich_speakers_from_csv, enrich_lexicon_from_csv
... |
# Copyright (c) 2011-2015 Rackspace US, Inc.
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
"""
Currently the tests do not pass in Appveyor. Specifically, we got the following error
for all the the failed cases.
Traceback (most recent call last):
File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
self.test(*self.arg)
File "C:\projects\py-stringsimjoin\py_stringsimjoin\tests\test_... |
#defines the class of the polar plot
class polar_axis():
step=5
def __init__(self,fig,ax,data):
self.fig = fig #pylab.figure()
self.ax = ax #pylab.axes([0.025,0.025,0.95,0.95], polar=True)
self.data=data
self.reset=True
self.ax.cla()
datatmp=self.data
self.subdata=self.dump_timing_level(... |
# -*- coding: utf-8 -*-
import numpy as np
from ..crystal import Sample
from ..energy import Energy
from ..instrument import Instrument
from ..instrument.tas_instrument import TripleAxisInstrument
from ..instrument.tof_instrument import TimeOfFlightInstrument
taz_keys = {'algo': 'method',
'ana_d': 'ana.d'... |
import sqlite3
import math
import time
from pprint import pprint
from lxml import html
import requests
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import... |
'''Assignment 2
In this assignment you'll explore the relationship between model complexity and generalization performance,
by adjusting key parameters of various supervised learning models. Part 1 of this assignment will look at
regression and Part 2 will look at classification.'''
'''Part 1 - Regression
First, run... |
def get_stroke_freq(Ax, Az, fs_a, nperseg, peak_thresh, stroke_ratio=None):
"""Determine stroke frequency to use as a cutoff for filtering
Args
----
Ax: numpy.ndarray, shape (n,)
x-axis accelermeter data (longitudinal)
Ay: numpy.ndarray, shape (n,)
x-axis accelermeter data (lateral)... |
"""
Implementation of paper: "Rethinking BiSeNet For Real-time Semantic Segmentation", https://arxiv.org/abs/2104.13188
Based on original implementation: https://github.com/MichaelFan01/STDC-Seg, cloned 23/08/2021, commit 59ff37f
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from super_gradien... |
# hackathon T - Hacks 3.0
# flask backend of data-cleaning website
import matplotlib.pyplot as plt
#import tensorflow as tf
#from tensorflow.keras import layers
import pandas as pd
import numpy as np
from flask import *
import os
from datetime import *
from subprocess import Popen, PIPE
from math import floor
import co... |
"""
This module implements the intermediates computation
for plot(df) function.
"""
from sys import stderr
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import dask
import dask.array as da
import dask.dataframe as dd
import numpy as np
import pandas as pd
from scipy.stats import gaussian_kde... |
from __future__ import print_function
import argparse
import math
# import models
import numpy as np
import PIL.Image as Image
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
import torchvision.transforms as transforms
from torch.autograd import Variable
def convbn(in_plan... |
# Copyright (C) 2017 MongoDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARR... |
"""
https://data-apis.github.io/array-api/latest/API_specification/type_promotion.html
"""
import pytest
from hypothesis import given, example
from hypothesis.strategies import from_type, data, integers, just
from .hypothesis_helpers import (shapes, two_mutually_broadcastable_shapes,
... |
"""
Program to test point map-relative and view-relative placement.
Select what to show and experiment with placement parameters.
Usage: test_point_placement.py [-h|--help] [-d] [(-t|--tiles) (GMT|OSM)]
"""
import os
import sys
import wx
import pyslip
from appstaticbox import AppStaticBox
from rotextctrl import ROTe... |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from poke_env.player.env_player import Gen8EnvSinglePlayer
from poke_env.player.random_player import RandomPlayer
from rl.agents.dqn import DQNAgent
from rl.policy import LinearAnnealedPolicy, EpsGreedyQPolicy
from rl.policy import BoltzmannQPolicy
fr... |
'''Test it all'''
from __future__ import division
from builtins import range
import numpy as np
import mtm_stats
from mtm_stats.testing_utils import (generate_test_set, run_timing_test,
naive_counts, naivest_counts, is_naive_same)
TEST_SET_1 = [('a1', 'b1'),
('a1', ... |
"""
Train CMC with AlexNet
"""
from __future__ import print_function
import os
import sys
import time
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
import argparse
import socket
import numpy as np
import tensorboard_logger as tb_logger
from torchvision impor... |
#!/usr/bin/python3
import json, time, re, sys, os
from mailbox import mailbox_data
def type_to_variant( btype ):
if re.search(r"^list", btype) is not None:
return "QVariantList"
if re.search(r"^str", btype) is not None:
return "QString"
if re.search(r"^float", btype) is not None:
... |
# Plotting utils
import glob
import os
import random
from copy import copy
from pathlib import Path
import cv2
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import torch
import yaml
from PIL import Image, ImageDraw
from scipy.signal import butter, filtfilt
from utils.general import... |
from __future__ import unicode_literals
from dvc.utils.compat import str, open
import re
import os
import yaml
import subprocess
from dvc.utils.fs import contains_symlink_up_to
from schema import Schema, SchemaError, Optional, Or, And
import dvc.prompt as prompt
import dvc.logger as logger
import dvc.dependency as ... |
from sympy import AccumBounds, Symbol, floor, nan, oo, zoo, E, symbols, \
ceiling, pi, Rational, Float, I, sin, exp, log, factorial, frac, Eq, \
Le, Ge, Gt, Lt, Ne, sqrt, S
from sympy.core.expr import unchanged
from sympy.testing.pytest import XFAIL
x = Symbol('x')
i = Symbol('i', imaginary=True)
y = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2012-2018 EMBL - European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by <NAME> <<EMAIL>>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Functions required to execute app components
---------------------------------------------
Note:
FOR INTERNAL USE ONLY
"""
... |
"""Report test results in JUnit-XML format, for use with Jenkins and build
integration servers.
Based on initial code from <NAME>.
Output conforms to
https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
"""
import functools
import os
import ... |
# Copyright 2013-2018 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
"""Communication container startup script."""
import array
import asyncio
import functools
import json
import logging
import os
import shutil
import signal
import socket
import sys
import threading
from contextlib import suppress
from distutils.util import strtobool
from pathlib import Path
from typing import Any, Opt... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... |
#!/usr/bin/env python3
###############################################################################
###############################################################################
## ##
## _ ___ ___ ___ ___ ___ ... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import time
from enum import Enum
import paramiko
import subprocess
from contextlib import contextmanager
import infra.path
import uuid
import ctypes
import signal
import re
import stat
import shutil
from coll... |
import pdb
import sys
import os
import ctypes
import struct
from enum import Enum, auto
from typing import Type, Any, Iterable, Dict, Optional, Mapping
import tempfile
import atexit
import shutil
from get_annotations import get_annotations
tempfolder = tempfile.mkdtemp()
atexit.register(shutil.rmtree, tempfolder)
__a... |
from __future__ import print_function
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_equal,
assert_allclose, assert_array_equal)
from scipy import sparse
from nose.tools import assert_true, assert_raises
import copy
import warnings
from m... |
#!/usr/bin/env python
__year__ = [2016, 2017]
__status__ = "Testing"
__contact__ = "<EMAIL>"
import argparse
import logging
import string
import pyric
import pyric.pyw as pyw
import pyric.lib.libnl as nl
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from tkinter import *
import tkMessageBox
from ... |
"""
MIT License
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish... |
# Copyright 2019 The dm_control 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 i... |
# -*- coding: utf-8 -*-
'''
Management of zc.buildout
=========================
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout int... |
#!/usr/bin/python3
#
# Copyright (c) 2016-2019 The Khronos Group 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... |
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import sys
import os
import numpy as np
import pandas as pd
import click
from matplotlib.ticker import MultipleLocator
from astropy.table import Table
from tqdm import tqdm
from fact.factdb import connect_database, RunInfo
from astropy.io import fits
... |
# Lint as: python3
# Copyright 2018, The TensorFlow Federated 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 ... |
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins import object
import numpy as np
from functools import reduce
from future.utils import with_metaclass
na = np.newaxis
import scipy.special as special
import abc, copy
from warnings im... |
from __future__ import print_function
import os
import shutil
import subprocess
import sys
from threading import Timer
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
from ..test.command import assert_command
from ..configuration import IrodsConfig
from .. import test
from ..... |
import base64
import builtins
import os
from collections import defaultdict
from functools import wraps
import matplotlib
import numpy as np
from yt._maintenance.deprecation import issue_deprecation_warning
from yt.config import ytcfg
from yt.data_objects.time_series import DatasetSeries
from yt.funcs import ensure_d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 The CASICloud 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/licen... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from trident.optims.pytorch_trainer import ImageClassificationModel
from trident.layers.pytorch_initializers import trunc_normal, fill_zeros, fill_ones
from trident.backend.common import TensorShape, OrderedDict
from trident.layers.pytorch_... |
import random
import itertools
import numpy as np
from gym import spaces
from traffic.traffic_env import TrafficEnv
from traffic.road import Road, RoadSegment
from traffic.car import Car
from traffic.drivers.driver import Driver, XYSeperateDriver
from traffic.drivers.oned_drivers import IDMDriver, PDDriver, PDriver
fr... |
import json
import logging
import os
import subprocess
import time
from dataclasses import dataclass
from functools import lru_cache
import yaml
n_wait_blocks = 50 # number of blocks to wait for the relayer to act
burn_gas_cost = 160000000000 * 393000 # see x/ethbridge/types/msgs.go for gas
lock_gas_cost = 16000000... |
# (c) 2021 <NAME>
############################################################################
# robosoc2d GUI
############################################################################
# to install (be sure to have robosoc2d installed previously and to have a
# python version with Tkinter built-in):
# python3 setu... |
'''@file trainer.py
neural network trainer environment'''
import os
import time
import cPickle as pickle
from abc import ABCMeta, abstractmethod
from math import ceil
import tensorflow as tf
from tensorflow.python.client import device_lib
from nabu.processing import input_pipeline
from nabu.neuralnetworks.trainers imp... |
# --- built in ---
import os
import abc
import sys
import math
import time
import logging
# --- 3rd party ---
import numpy as np
# --- my module ---
from unstable_baselines.lib import utils as ub_utils
__all__ = [
'SegmentTree',
'ReplayBuffer',
'DynamicBuffer',
'UniformSampler',
'PrioritizedSampl... |
#!/usr/bin/env python
"""
Regenerate Unicode tables (tables.rs).
"""
# This script uses the Unicode tables as defined
# in the UnicodeFiles class.
# Since this should not require frequent updates, we just store this
# out-of-line and check the tables.rs file into git.
# Note that the "curl" program is required for ... |
# curio/task.py
#
# Task class and task related functions.
# -- Standard library
import warnings
import logging
from collections import deque
import linecache
import traceback
import os.path
from functools import partial
log = logging.getLogger(__name__)
# -- Curio
from .errors import *
from .traps import *
from .... |
#!/usr/bin/env python3
"""
JSong:直接从 python 包 orangecontrib 中 fork,未作修改
原文:
This module implements FP-growth [1] frequent pattern mining algorithm with
bucketing optimization [2] for conditional databases of few items.
The entry points are :obj:`frequent_itemsets()`, :obj:`association_rules()`, and
:obj:`rules_stats()... |
""" History related magics and functionality """
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team.
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
... |
from PIL import Image
import pytesseract
import statistics
import pdf2image #poppler needs to be added and added to the path variable
import os
import csv
import pdfminer
import cv2
import multiprocessing
import functools
import copy
from CNN_Table_Finder import table_split
from keras.models import model_fr... |
#!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pre... |
#!/usr/bin/env python3
"""Abstract classes for defining datasets, graphs and training models"""
########################################################################
# File: abstract.py
# executable: abstract.py
# Author: <NAME>
# History: 12/08/17 Created
##########################################################... |
#
# Copyright 2019 British Broadcasting Corporation
#
# 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... |
"""
This module defines export functions for decision trees.
"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD 3 clause
import warnings
from numbers impo... |
import os
import sys
import math
import trio
import heapq
import signal
import sniffio
import asyncio
import warnings
import concurrent.futures
from ._handles import ScopedHandle, AsyncHandle
from ._util import run_aio_future, run_aio_generator
from ._deprecate import deprecated, deprecated_alias
from . import _util
... |
from time import time
from typing import Tuple
import cv2
import cv2.aruco as aruco
import numpy as np
import math
import logging
from shared import get_image_publisher
from .line_fit import goal_to_dist
from .managed_threading import ManagedThread, ThreadManager
logger = logging.getLogger("image_recognition")
aruc... |
import multiprocessing
import os
import sys
import numpy as np
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d
from tqdm import tqdm
import amical
from amical.analysis import models
from amical.dpfit import leastsqFit
from amical.tools import mas2rad
from amical.tools import roundSciDigit
... |
import unittest
import numpy as np
from sscanss.core.math import Vector3, matrix_from_xyz_eulers, Plane
from sscanss.core.geometry import (Mesh, MeshGroup, closest_triangle_to_point, mesh_plane_intersection, create_tube,
segment_plane_intersection, BoundingBox, create_cuboid, path_len... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This can be used to measure head pose estimation using
68 facial landmark detection along with pretrained hog and linear svm
face detection in dlib.
"""
import math
import os
import logging
import cv2
import dlib
import numpy as np
from pathlib import Path
from cssi... |
# Copyright 2017 Battelle Energy Alliance, 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 t... |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Purpose of this module is to hold common script/commandline functionality.
This ranges from optparse, to a basic script wrapper setup (much like
w... |
#
# Standard parameters for lead-acid battery models
#
"""
Standard Parameters for lead-acid battery models
"""
import pybamm
import numpy as np
from scipy import constants
# --------------------------------------------------------------------------------------
"File Layout:"
# 1. Dimensional Parameters
# 2. Dimensio... |
import open3d as o3d
import numpy as np
import cv2
import copy
import argparse
from math import *
from scipy.spatial.transform import Rotation as R
from pathlib import Path
import os
from realsense import RealsenseDataset
from coco_writer import CocoWriter
def get_arguments():
"""
Parse arguments from com... |
# Defining all modules within an ima and its methods (Propagate and or Update)
# Also define sime support functions (commonly used)
# 'Propagate' is the combinational part evaluation
# 'Update' - (NOT BEING USED CURRENTLY!) is the flip fop evaluation (for clocked elements of the circuit only)
import sys
import numpy ... |
# coding: utf-8
import sys
from python_environment_check import check_packages
import os
import tarfile
import time
import urllib.request
import pyprind
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
impor... |
#!/usr/bin/env python3
import os
import sys
import re
import argparse
import configparser
from subprocess import Popen, PIPE, call
def sort_index(bam, samtools):
"""
Sort and index BAM file.
:param bam: Path to BAM file.
:type bam: str
:param samtools: Path to samtools.
:type samtools: str
... |
import re
import os
import numpy as np
import itertools
import collections
from unidecode import unidecode
from .._utils._utils import download_file
from ._tatabahasa import stopword_tatabahasa, stopwords, stopwords_calon
from ._english_words import _english_words
from ._malay_words import _malay_words
from .._transfor... |
# /*
# * Copyright 2019 Balena 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 ... |
# AutoAugment policies found on Cifar.
# Paper: https://arxiv.org/abs/1805.09501
# Code: https://github.com/DeepVoltaire/AutoAugment
# License: MIT
# Code: https://github.com/tensorflow/models/blob/903194c51d4798df25334dd5ccecc2604974efd9/research/autoaugment/policies.py
# license: Apache v2
from PIL import Image, Imag... |
import numpy as np
import scipy.sparse as sparse
import scipy.io as sio
from time import time
import cmath
import os
from abc import ABCMeta, abstractmethod
class Builder(metaclass=ABCMeta):
def __init__(self, name, shape):
self.name = name
self.shape = shape
self.term = None
self... |
from abc import abstractmethod
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as dist
from .base import VariationalMixin
from .utils import EPS, prod, inverse_softplus, vec_to_chol
from ....distributions import MatrixNormal
__all__ = [
"InducingDeterministicMixin"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.