text stringlengths 957 885k |
|---|
import datetime
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from discord.ext.commands.errors import BadArgument
from ..exceptions import APIError, APIForbidden, APINotFound
from ..utils.chat import embed_list_lines, zero_width_space
class GeneralGuild:
@... |
<filename>erised/connector.py<gh_stars>0
from __future__ import annotations
import itertools
import multiprocessing as mp
import queue
from typing import Any, Dict, Iterator, Optional, Tuple
from erised.future import Future, FutureState
from erised.remote import run
from erised.task import CallTask, GetAttrTask, SetA... |
<gh_stars>1-10
"""
Demonstration of capabilities of the module
"""
from __future__ import absolute_import
import time
import numpy as np
import numpy.linalg as la
import scipy.special as spec
import matplotlib.pyplot as plt
import adaptive_interpolation.adapt as adapt
import adaptive_interpolation.generate as generat... |
<filename>dj_plotter/plotter.py
### DATAJOINT + PLOTTING CLASS
from copy import copy
import pathlib
from datetime import datetime
import numpy as np
import pandas as pd
# Drawing
from matplotlib import pyplot as plt
import seaborn as sns
from tqdm.auto import tqdm
# Load more colormaps
import cmasher as cmr
# ... f... |
<reponame>ralfjon/IxNetwork
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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... |
<reponame>alanszlosek/hd-raspi-surveillance<gh_stars>1-10
import cv2
import datetime
import gpiozero
import http.server
import json
import math
import numpy
import os
import pathlib
import picamera
import requests
import signal
import socket
import subprocess
import threading
import time
import urllib
# Hi! Use this c... |
# Generated by Django 3.0.4 on 2020-03-24 11:15
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
... |
#!/usr/bin/env python3
import os,re,sys, traceback
# read files of Mathematica equation exports
# change variable names to corresponding things in C
# insert things in the corresponding C file
class Inserter:
# the file used in C
filename_cpp = "numsolve.cpp"
paramstruct_name = "paramstruct"
# spe... |
<gh_stars>1-10
import numpy as np
from scipy.spatial.transform import Rotation as R
from pyscf.symm.basis import _ao_rotation_matrices as aorm
#symmetry operations on bezene
def old_rotate_matrix(M,mol,atm_idx): # to rotate the idx of the carbon atoms
pt=mol.aoslice_by_atom()[atm_idx,-2]
Mr=np.zeros_l... |
<reponame>tapnair/DXFer
# Purpose: acdsdata section manager
# Created: 05.05.2014
# Copyright (C) 2014, <NAME>
# License: MIT License
"""
ACDSDATA entities have NO handles, therefor they can not be stored in the drawing entity database.
every routine written until now (2014-05-05), expects entities with valid handle - ... |
# I got this from http://svn.navi.cx/misc/trunk/djblets/djblets/util/decorators.py (sbf)
# It should make useful template tag creation much less tedious and annoying when
# needing any complex functionality such as access to the context or a block
# This is part of the djiblets template library.
#
# decorators.py ... |
import time
import cv2 as cv
import numpy as np
import math
from libs.centroid_object_tracker import CentroidTracker
from scipy.spatial import distance as dist
from libs.loggers.loggers import Logger
class Distancing:
def __init__(self, config):
self.config = config
self.ui = None
self.de... |
<filename>python_modules/libraries/dagster-cron/dagster_cron_tests/test_cron_scheduler.py<gh_stars>0
import os
import re
import subprocess
import sys
from contextlib import contextmanager
from tempfile import TemporaryDirectory
import pytest
import yaml
from dagster import ScheduleDefinition
from dagster.core.definiti... |
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate, logout
from django.contrib.sites.shortcuts import get_current_site
from dj... |
<filename>dm/catawampus_test.py
#!/usr/bin/python
# Copyright 2014 Google 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-... |
"""Adapted from MoCo implementation of PytorchLightning/lightning-bolts"""
from typing import Union, List, Tuple
import torch
from torch import nn
from torch.nn import functional as F
import pytorch_lightning as pl
from pl_bolts.metrics import mean, precision_at_k
# from torchmetrics import IoU
from .resnet import B... |
<reponame>antmicro/raviewer<filename>tests/grayscale_test.py
from raviewer.parser.grayscale import ParserGrayscale
import unittest
import numpy
from unittest.mock import (Mock, patch)
from enum import Enum
class DummyPixelFormat(Enum):
MONO = 1
class DummyEndianness(Enum):
LITTLE_ENDIAN = 1
BIG_ENDIAN =... |
from flask import Flask, render_template, Response, redirect, request, session
import cv2
import time
import requests
from flask_socketio import SocketIO, emit
import os
import threading
import tts_stt
import base64
import numpy as np
import glob
import argparse
import dlib
import os
from utils.aux_functions import *
... |
<gh_stars>10-100
import os
import sys
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import constant_op
from tensorflow.python.platform import test
from tensorflow.python.ops import gradient_checker
sys.path.append('../..')
from cext import primitive_mutex_loss
os.environ['TF... |
from schematics import Model
from schematics.exceptions import ValidationError
from schematics.types import StringType, IntType, EmailType, LongType, BooleanType
from schematics.types.compound import ListType, ModelType, BaseType
from server.models.dtos.stats_dto import Pagination
from server.models.postgis.statuses i... |
<gh_stars>10-100
import json
from typing import Any, Dict, List, Optional, Set, Text
import junit_xml
REQUIRED = "required"
class TestResult:
"""Encapsulate relevant test result data."""
def __init__(
self,
return_code,
standard_output,
error_output,
duration,
... |
import copy
import json, ast, filecmp, itertools
import os, shutil, ast
from threading import Thread
from subprocess import Popen, PIPE, check_output, STDOUT, CalledProcessError
from TestInput import TestInputSingleton, TestInputServer
from alternate_address.alternate_address_base import AltAddrBaseTest
from membase.a... |
<reponame>humancomputerintegration/dextrEMS<gh_stars>1-10
#Copyright © 2018 Naturalpoint
#
#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 ... |
import os
from multiprocessing.pool import ThreadPool
from pathlib import Path
from tqdm import tqdm
from typing import Sequence, Tuple, List
import requests
from sec_certs.files import search_files
CC_WEB_URL = 'https://www.commoncriteriaportal.org'
def download_file(url: str, output: Path) -> int:
r = reques... |
<filename>sandbox/test_solver.py
import sys
import os
import numpy as np
import matplotlib.pyplot as plt
sys.path.insert(1, '/home/axel/workspace/contomo/')
import utils
from FVM import FiniteVolumes
from solver import FVMSolver
from sinogram_interpolator import SinogramSplineInterpolator
from basis import LinearTetra... |
<reponame>ICEGXG/UntitledNuker
import json
import os
import traceback
import colorama
import discord
import requests
from colorama import Fore
from discord.ext import commands
colorama.init()
os.system('cls')
try:
with open("version.txt") as data:
version = data.readline()
except FileNotFoundError:
t... |
<filename>lib/googlecloudsdk/command_lib/compute/vpn_gateways/flags.py
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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... |
from collections import Iterable
import numpy as np
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QButtonGroup,
QVBoxLayout,
QRadioButton,
QPushButton,
QLabel,
QComboBox,
QSlider,
)
from .qt_base_layer import QtLayerControls, QtLayerProperties
from ..layers.shapes._constants impor... |
import csv
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model, datasets
folder = "trained_data/"
filename = "train.csv"
gender_to_number = {
'male' : 0,
'female': 1
}
port_to_number = {
'' : 0,
'S': 0,
'C': 1,
'Q': 2
}
keys_to_remove = [
'Name',
'Fare... |
from concurrent.futures import ThreadPoolExecutor
import numpy
import operator
import random
import sys
from threading import Thread, Lock
import time
from timeit import default_timer as timer
import traceback
from apimux.log import logger
from apimux.rwlock import ReadWriteLock
from apimux import config
class APIMu... |
<filename>skbl/computeviews.py
"""Define helper functions used to compute the different views."""
import json
import os.path
import smtplib
import urllib.parse
from collections import defaultdict
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from hashlib import md5
from urllib.req... |
# -*- coding: utf-8 -*-
"""Tests for the cli module"""
import pytest
from bach_generator import cli
def test_no_filepath():
parser = cli.construct_parser()
with pytest.raises(SystemExit):
parser.parse_args("")
@pytest.mark.parametrize(
"input_args, expected", [("a", "a"), ("test_dir/test.midi",... |
<filename>pyinstaller_exe.py<gh_stars>1-10
#!/usr/bin/env python3
"""Generate .exe files with PyInstaller."""
from os import devnull, getcwd, listdir, makedirs, remove
from os.path import basename, exists, join
from platform import architecture
from shutil import copy, copytree, rmtree
from subprocess import STDOUT, c... |
#coding=utf8
"""
Created on Thu Mar 12 17:48:23 2020
@author: <NAME>
Hint max() is a built-in function in Python
"""
import pickle
import matplotlib.pyplot as plt
import numpy as np
def hinge_loss(f_x,y_true,margin=1):
"""
Compute the hinge loss given the returned value from
a li... |
<reponame>nicoguillier/gdal<filename>autotest/pyscripts/test_gdal_calc.py
#!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id: test_gdal_calc.py 25549 2013-01-26 11:17:10Z rouault $
#
# Project: GDAL/OGR Test Suite
# Purpose: gdal_calc.py... |
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
#
# Copyright (C) 2014-2015 UAVCAN Development Team <uavcan.org>
#
# This software is distributed under the terms of the MIT License.
#
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
from __future__ import division, absolute_import, print_function, unicode_literals
import sys
import time
import math
import ... |
<reponame>Jon-Burr/dbobj
from builtins import zip
from future.utils import PY3, iteritems
from itertools import repeat
import operator
if PY3:
from collections.abc import Iterator, Iterable
else:
from collections import Iterator, Iterable
class CollMonad(Iterable):
""" Special type of iterable that allows ... |
<filename>scripts2/script2_1.py
# Simulation implemented for the Distributed-Q Learning Based Power Control algorithm found in
# <NAME>., <NAME>., <NAME>., <NAME>. and <NAME>., 2016, September. Q-learning based power control algorithm for D2D communication.
# In 2016 IEEE 27th Annual International Symposium o... |
<filename>tests/test_pdf.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Zheng <<EMAIL>>
# Date: 2019-05-07
# Desc:
import io
from reportlab.lib.units import inch
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas
from reportlab.lib.colors import white
def mm_to_dpi(mm):
"""
... |
<filename>ever/api/trainer/trainer.py<gh_stars>0
import argparse
import torch
import shutil
import os
from ever.core import config
from ever.core.builder import make_dataloader
from ever.core.builder import make_learningrate
from ever.core.builder import make_model
from ever.core.builder import make_optimizer
from eve... |
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
# Constants
G = 6.67408 * 10 ** -11 # m^3 kg^-1 s^-2
M_Earth = 5.972 * 10 ** 24 # kg
# print(G * M_Earth)
R = 6378.137 # km
g = (G * M_Earth) / ((R * 1000) ** 2) # m s^-2
# print(g)
m_stage_1 = 422000 # kg
m_s_1_propellant = ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 28 10:20:57 2019
@author: zmddzf
"""
import numpy as np
import matplotlib.pyplot as plt
import numpy.linalg as la
class Birds:
"""
鸟群类,用于承载粒子群的数据结构
"""
def __init__(self, popsize, dim):
"""
鸟群构造器,初始化鸟群实例
:param popsize: 种群个数
... |
<reponame>joesantana/doxx<gh_stars>0
#!/usr/bin/env python
# encoding: utf-8
import webbrowser
from Naked.toolshed.system import stderr, stdout
docs_dict = {
"docs": "http://doxx.org",
"blog": "http://things.doxx.org",
"updates": "https://twitter.com/doxxapp",
"source": "https://github.com/chrissimpki... |
<filename>tensorflow_datasets/text/glue_test.py<gh_stars>1-10
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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://w... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import functools
from dataclasses import dataclass
from enum import Enum
import typing as t
import boto3
from datetime import datetime, timedelta
from hmalib.metrics import measure_performance, METRICS_NAMESPACE
@functools.lru_cache(maxsize=None... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Procedures to simplify the use of external tools.
#
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import subprocess
import logging
import hashlib
import distutils.spawn
from brainvisa.installer.bvi_utils.system imp... |
<reponame>vikeshpandey/amazon-sagemaker-edge-manager-workshop
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import ipywidgets as widgets
import random
import time
class WindTurbine(object):
""" Represents virtually and graphically a wind turbine
It us... |
# This program 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 License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,... |
import warnings
import numpy as np
import pandas as pd
import xgboost as xgb
from joblib import Parallel, delayed
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import BallTree
from sklearn.preprocessing import OneHotEncoder
# lib utils
from xgbse._base import XGBSEBaseEstimator, DummyLogis... |
<reponame>gdanezis/off-chain-reference
# Copyright (c) The Libra Core Contributors
# SPDX-License-Identifier: Apache-2.0
from jwcrypto.common import base64url_encode
from cryptography.exceptions import InvalidSignature
from libra import txnmetadata, utils
from jwcrypto import jwk, jws
import json
class OffChainInval... |
'''Setuptools commands for working with node/npm'''
from distutils.core import Command
from distutils.errors import DistutilsError
import os
from pathlib import Path
import platform
import shutil
import subprocess
import sys
import tarfile
import urllib.request
import zipfile
from .util import chdir, RunnerMixin
cl... |
#!/usr/bin/env python3
import logging
from data.key import key as Key
import utils.match as match
import utils.model as model
import utils.logging
logger = logging.getLogger(utils.logging.getLoggerName(__name__))
def parse(output_def):
output_data_type = output_def.get("type", "list")
if output_data_type ==... |
<reponame>disiji/active-assess<gh_stars>1-10
import argparse
import pathlib
import random
from collections import deque
from typing import List, Dict, Tuple, Union
from data import Dataset, SuperclassDataset
from data_utils import *
from sampling import *
import numpy as np
from tqdm import tqdm
LOG_FREQ = 10
output_d... |
import tensorflow as tf
import collections
import random
import numpy as np
class QRDQN:
def __init__(self, sess, output_size, mainNet, targetNet, batch_size, max_length=1000000):
self.memory = collections.deque(maxlen=max_length)
self.lr = 0.00005
self.output_size = output_size
sel... |
#
# tinremote_ext_setup.py
# A tinremote extension module build script
#
import os
#from distutils.core import setup, Extension
from setuptools import setup, find_packages, Extension
# Remove the "-Wstrict-prototypes" compiler option, which isn't valid for C++.
import distutils.sysconfig
cfg_vars = distutils.syscon... |
"""Define tests for the SimpliSafe config flow."""
from simplipy.errors import (
InvalidCredentialsError,
PendingAuthorizationError,
SimplipyError,
)
from homeassistant import data_entry_flow
from homeassistant.components.simplisafe import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOUR... |
# -*- coding: utf-8 -*-
import datetime as dt
import os
import re
from flask import current_app
from flask_bcrypt import Bcrypt
from flask_caching import Cache
from flask_mail import Mail
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CsrfProtect
from raven import ... |
<reponame>mattbellis/hepfile
import numpy as np
import hepfile as hep
people = np.loadtxt('sheet1.csv', unpack=True, dtype=str,
delimiter=",")
#with open('sheet2.csv') as input:
# cols = input.read().split('\n')
# for col in cols:
# print(len(col.split(',')))
vehicles = ... |
<gh_stars>0
# [TODO] complex object extents: between, of-on, to-for, for-to
# [TODO] how to parse sentences that contain if
#!/usr/bin/env python
from owlready2 import *
import owlready2
owlready2.JAVA_EXE = "C:\\Program Files (x86)\\Java\\jre1.8.0_221\\bin\\java.exe"
import re
import csv
def prulars_to_singular(my_... |
#!/usr/bin/env python3
import argparse
import glob
import hashlib
import logging
import OpenSSL
import os
import random
import requests
import sys
import textwrap
import time
import yaml
from datetime import datetime
__author__ = '<NAME>'
__copyright__ = 'Copyright 2017, <NAME>'
__credits__ = ['<NAME>']
__license__ =... |
<gh_stars>100-1000
# from hydrachain import protocol
from hydrachain.consensus.base import Vote, VoteBlock, VoteNil, LockSet, ishash, Ready
from hydrachain.consensus.base import DoubleVotingError, InvalidVoteError, MissingSignatureError
from hydrachain.consensus.base import BlockProposal, genesis_signing_lockset, Inval... |
<filename>clamm/util.py
""" utils
"""
import os
import sys
import time
import inspect
import subprocess
import colorama
from clamm import config
SPLIT_REGEX = '&\s*|,\s*|;\s*| - |:\s*|/\s*| feat. | and '
ARTIST_TAG_NAMES = ["ALBUMARTIST_CREDIT",
"ALBUM ARTIST",
"ARTIST",
... |
<filename>boilerplate/templatetags/boilerplate.py
# -*- coding: utf-8 -*-
from django import template
from django.contrib.admin.utils import NestedObjects
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.db import DEFAULT_DB_ALIAS
from django.util... |
<gh_stars>1-10
# Copyright 2019 ChangyuLiu 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 requ... |
#!/usr/bin/env python3
from neutrinomass.tensormethod import D, L, Q, H, eb, ub, db, eps, delta
from neutrinomass.tensormethod.core import IndexedField, Field
from neutrinomass.completions.topologies import Leaf
from neutrinomass.completions.core import (
EffectiveOperator,
Completion,
cons_completion_fiel... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import random
import torch
import numpy as np
import torch_geometric.datasets
from ogb.graphproppred import PygGraphPropPredDataset
from ogb.lsc.pcqm4m_pyg import PygPCQM4MDataset
import pyximport
pyximport.install(setup_args={"include_dirs": np.... |
import json
import queue
import weakref
import mupf.exceptions as exceptions
import time
from .. import _command
from .. import _enhjson as enhjson
from .. import _features as F
from .. import _symbols as S
from .._remote import CallbackTask, RemoteObj
from ..log import loggable, LogManager
from . import _crrcan
fr... |
<reponame>rubendfcosta/neural
from os import listdir
from os.path import join
import cv2
from numpy import array
from torch.utils.data import Dataset
class Cityscapes(Dataset):
CLASSES = array([
'unlabeled', 'ego vehicle', 'rectification border', 'out of roi',
'static', 'dynamic', 'ground', 'road'... |
# -*- coding: utf-8 -*-
#
# Author: <NAME> <<EMAIL>>
#
# Layers for the autoencoder(s)
from __future__ import print_function, absolute_import, division
from sklearn.base import BaseEstimator
from sklearn.externals import six
import tensorflow as tf
import numpy as np
from abc import ABCMeta, abstractmethod
from ..util... |
<gh_stars>1-10
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
class PositionalEncoding(nn.Module):
def __init__(self, max_seq_len, features_dim):
super(PositionalEncoding, self).__init__()
pos_enc = np.array(
[[pos/np.... |
<reponame>szpotona/cloudify-aws-plugin<gh_stars>0
# Copyright (c) 2018 Cloudify Platform Ltd. 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.... |
import argparse
from director import consoleapp
from director import cameraview
from director import applogic
from director import viewbehaviors
from director import objectmodel as om
from director import vtkAll as vtk
import PythonQt
from PythonQt import QtGui
class ImageViewApp(object):
def __init__(self):
... |
# Copyright 2014 <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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
<filename>pyatv/protocols/airplay/auth/__init__.py<gh_stars>100-1000
"""Pick authentication type based on device support."""
import logging
from typing import Tuple
from pyatv import exceptions
from pyatv.auth.hap_pairing import (
NO_CREDENTIALS,
TRANSIENT_CREDENTIALS,
AuthenticationType,
HapCredential... |
# TODO check if jwt is used and all modules are present
from ..._py2 import *
from future.utils import with_metaclass
import logging
import re
from datetime import datetime
from collections import OrderedDict
import hashlib
# optional features
try:
from passlib import hash as unix_hash
except ImportError:
pa... |
<reponame>linksdl/futuretec-project-self_driving_cars_projects
# imports
import numpy as np
import matplotlib
#matplotlib.use('wxagg') # change backend so that figure maximizing works on Mac as well
import matplotlib.pyplot as plt
class Camera:
'''Camera sensor class including measurement matrix'''
def __init_... |
<gh_stars>1-10
import sys
from PIL import Image
from pathlib import Path
import os
import shutil
import glob
import time
from dataloaders.kitti_loader import rgb_read
import cv2
import matplotlib.pyplot as plt
import numpy as np
"""
Choose samples from the gt (and not from vel, so we could have more options to sample... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin and Qogecoin Core Authors
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test external signer.
Verify that a qogecoind node can use an external signer command
See al... |
from __future__ import print_function
import os
from semnav.config import get_config
from semnav.dataset.frame_by_frame_dataset import FrameByFrameDataset
from semnav.dataset.temporal_dataset import TemporalDataset
from semnav.dataset.graph_net_dataset import GraphNetDataset
from semnav.dataset.graph_net_frame_datase... |
import pytest
from django.test import override_settings
from ozpcenter.recommend.recommend import RecommenderDirectory
from ozpcenter.scripts import sample_data_generator as data_gen
from ozpcenter.utils import shorthand_dict
from tests.ozp.cases import APITestCase
from tests.ozpcenter.helper import APITestHelper
@o... |
# Author: <NAME>
# Python Version: 3.6
## Copyright 2019 <NAME>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any la... |
<reponame>sergioisidoro/hass-ruuvi
"""Tests for the config flow."""
from unittest import mock
from homeassistant.const import CONF_MAC, CONF_NAME, CONF_PATH
from pytest_homeassistant_custom_component.common import AsyncMock, patch, MockConfigEntry
from custom_components.ruuvi import config_flow
from custom_component... |
import face_alignment
import skimage.io
import numpy
from argparse import ArgumentParser
from skimage import img_as_ubyte
from skimage.transform import resize
from tqdm import tqdm
import os
import imageio
import numpy as np
import warnings
warnings.filterwarnings("ignore")
def extract_bbox(frame, fa):
if max(fram... |
<filename>tagvalueprettyprinter/PrettyPrinter.py<gh_stars>1-10
class PrettyPrinter():
def __init__(self):
'''Initialize fix with fcgm properties'''
from pyfixorchestra import FixDictionary
field = FixDictionary('fields')
self.fields = (field.generateDictionary()) # [names, temp]
... |
<filename>codes/dataops/opencv_transforms/opencv_transforms/extra_functional.py<gh_stars>1-10
# from __future__ import division
#import torch
import math
import random
import numpy as np
import cv2
#import numbers
#import types
#import collections
#import warnings
from .common import preserve_shape, preserve_type, pr... |
<reponame>lmnotran/gecko_sdk
from pyradioconfig.calculator_model_framework.interfaces.iprofile import IProfile
from pyradioconfig.parts.common.profiles.ocelot_regs import build_modem_regs_ocelot
from pyradioconfig.parts.common.profiles.profile_common import buildCrcOutputs, buildFecOutputs, buildFrameOutputs, \
bui... |
<gh_stars>1-10
import json
import os
import random
from shutil import copyfile
from time import time
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image, ImageMath # Using https://pillow.readthedocs.io
import i2c_domain
from generator import Generator
from generator_static import ts
from i2c_dom... |
<filename>statsmodels/genmod/tests/test_glm.py
"""
Test functions for models.GLM
"""
import warnings
import os
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_raises,
assert_allclose, assert_, assert_array_less)
import pandas as pd
from pandas.testing i... |
<filename>tensorlayer/exp/exper_resnet.py
#! /usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import tensorflow as tf
import tensorlayer as tl
bitW = 8
bitA = 8
tf.logging.set_verbosity(tf.logging.DEBUG)
tl.logging.set_verbosi... |
<filename>mitdeeplearning/lab3.py<gh_stars>1000+
import io
import base64
from IPython.display import HTML
import gym
import numpy as np
import cv2
def play_video(filename, width=None):
encoded = base64.b64encode(io.open(filename, 'r+b').read())
video_width = 'width="' + str(width) + '"' if width is not None el... |
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
Video QA dataset
"""
import random
from torch.utils.data import Dataset
import torch
from torch.nn.utils.rnn import pad_sequence
from toolz.sandbox import unzip
import horovod.torch as hvd
from .data import (VideoFeatSubTokDataset... |
"""
============================================================
Reproducing the simulations from Foygel-Barber et al. (2020)
============================================================
:class:`mapie.estimators.MapieRegressor` is used to investigate
the coverage level and the prediction interval width as function
of ... |
"""Conversions between transform representations."""
import math
import numpy as np
from ._utils import (check_transform, check_pq, check_screw_axis,
check_screw_parameters, check_exponential_coordinates,
check_screw_matrix, check_transform_log,
check_dual_... |
#!/usr/bin/env python
"""
Base class for controllers
Author - <NAME>
Date: 3 Jan, 2020
"""
from abc import ABC, abstractmethod
import copy
from gym.utils import seeding
import numpy as np
from mjmpc.utils import helpers
class Controller(ABC):
def __init__(self,
d_state,
d_obs,
... |
# 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... |
<filename>BinanceGUI.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# <NAME> (https://sites.google.com/view/a2gs/)
from os import getenv
from sys import exit, argv
from textwrap import fill
import configparser
import PySimpleGUI as sg
from binance.client import Client
from binance.exceptions import BinanceAPIExce... |
#
# Copyright 2019 <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provi... |
<filename>tests/Exscript/util/urlTest.py
from builtins import str
import sys
import unittest
import re
import os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from Exscript.util.url import Url
urls = [
# No protocol.
('testhost',
'telnet://testhost:23'),
('testhos... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.