text stringlengths 3.07k 12.6k |
|---|
import functools
import re
from collections import namedtuple
import pygments.lexers.teraterm
import pygments.styles.xcode
from pygments.formatters import HtmlFormatter
from pygments_ansi_color import ExtendedColorHtmlFormatterMixin
from pyquery import PyQuery as pq
from fluffy.component.styles import DEFAULT_STYLE
#... |
# @author : <NAME> (<EMAIL>)
# School of Computing, University of Utah
# contain utility functions for optimized code generation for given sympy expressions.
import dendro
import sympy
import numpy as np
import networkx as nx
from sympy.printing.dot import dotprint
import matplotlib.pyplot as plt
"""
replace user d... |
"""
homeassistant.components.group
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to group devices that can be turned on or off.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import homeassistant.core as ha
from homeassistant.helpers ... |
import argparse
import os
import random
import sys
import numpy as np
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader, Dataset
from torchvision import datasets, transforms
from train import input_size
from models import build_model
test_transforms = transforms.Compose([
t... |
import torch
import os, glob
import random, csv
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from PIL import Image
class Pokemon(Dataset):
def __init__(self, root, resize, mode):
super(Pokemon, self).__init__()
self.root = root
self.resize = resize
... |
# -*- coding: utf-8 -*-
# Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Auth... |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from pymavlink import mavutil
import numpy as np
import zmq
import sys
import time
import pickle
import sys
import cv2
import os
import shutil
import hsv_track
import sys
import demo_config
import struct
show_cv=True
sys.path.append(os.environ['UNREAL_PROXY_PATH'])... |
""""""
from os import getenv
from typing import Dict, List
import unittest
import shimoku_api_python as shimoku
from shimoku_api_python.exceptions import ApiClientError
api_key: str = getenv('API_TOKEN')
universe_id: str = getenv('UNIVERSE_ID')
business_id: str = getenv('BUSINESS_ID')
app_id: str = getenv('APP_ID')
... |
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Experiment module."""
import asyncio
import logging
from contextlib import asynccontextmanager
from pathlib import Path
from typing import Iterable
from typing import List
from typing import Union
from openfl.federated import Plan
f... |
from flask import Flask, jsonify, request
from functions.verify_inputs import verify_new_patient, verify_input_hr
from functions.verify_inputs import patient_is_in_database
from functions.verify_inputs import verify_input_internal_average
from functions.hr_calculations import append_heart_rate, get_heart_rates
from fun... |
#!/usr/bin/python3
import argparse
import itertools
import os
import shutil
import time
from pathlib import Path
import tensorflow as tf
import config
from data.dataset_builder import DatasetBuilder
from models.model_builder import GPUModelBuilder
def clear_all():
print("Clearing old data/checkpoints!")
if ... |
'''
Created on 28Oct.,2016
@author: <NAME>
'''
import os
import json
import dateutil.parser
from datetime import datetime
from dateutil import tz
import pytz
from glob import glob
import hashlib
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) # Initial logging level ... |
"""The Genome class represents a shape sequence and its various properties, from which an image can be built."""
import pickle
import numpy as np
from shapevolve.utils import unadjust
class MismatchedGenomeError(Exception):
"""An error that occurs when two genomes do not share the same properties with one anot... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ADAPDET FROM ReachingDelayResponse
import numpy as np
import neurogym as ngym
from neurogym import spaces
#%% helper functions
def gauss(x,sd=1,mu=0):
'''
Gaussian function
Parameters
----------
x : numpy array
Axis for the gaussian fun... |
from config import Config
from error import Error
from image import Image
from path import Path
import os
import re
import time
import urllib.request as request
from threading import Thread
from queue import Queue
from json import JSONDecodeError
# small temporary hack:
# allow to change error handling implement... |
import datetime
import keras
import tensorflow as tf
from keras import backend as K
import numpy as np
from numpy.linalg import LinAlgError
def get_preactivation_tensors(layers):
"""Get all valid layers for computing saturation."""
dense_outputs = []
for layer in layers:
if 'dense' in layer.nam... |
# Copyright 2018 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import json
import sys
import os, shutil
import boto3
import collections
tempDir = '../Temp/'
infraPath = '../Templates/'
import requests
def download_url(url, save_path, chunk_size=128):
r = requests.get(url, stream=True)
with open(save_path, 'wb') as fd:
print("writing to file" + save_path)
... |
from keras.preprocessing.image import ImageDataGenerator, DirectoryIterator
import json
import numpy as np
from keras.models import model_from_json
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import MaxPooling2D, Conv2D
from keras.constraints import maxnorm
imp... |
import pytest
from orion.packages.mag.parsing_mag_data import parse_papers
from orion.packages.mag.parsing_mag_data import parse_affiliations
from orion.packages.mag.parsing_mag_data import parse_authors
from orion.packages.mag.parsing_mag_data import parse_fos
from orion.packages.mag.parsing_mag_data import parse_jou... |
# -*- coding: utf-8 -*-
"""Module with classes to format results from the Amazon Translation API"""
import logging
from typing import AnyStr
from typing import Dict
import pandas as pd
from plugin_io_utils import API_COLUMN_NAMES_DESCRIPTION_DICT
from plugin_io_utils import ErrorHandlingEnum
from plugin_io_utils imp... |
'''
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, distribute, sublicense,and/or sell copies
of th... |
# -*- encoding: utf-8 -*-
import nltk
from nltk.corpus import stopwords
### Find the 50 most frequent bigrams (see Week 6) in Jane Austen's Emma.
### Then find the 50 most frequent bigrams that do not include a stopword.
emma = nltk.corpus.gutenberg.words('austen-emma.txt')
print ("Find the 50 most frequent bigra... |
import logging
from typing import TYPE_CHECKING, Any, List
import cda_client
from cda_client.api.query_api import QueryApi
from cdapython.ConvertionMap import convertionMap
from cdapython.Result import get_query_result
from cdapython.constantVariables import table_version
from cdapython.Qparser import parser
from typin... |
import os
import logging
import numpy as np
import pathlib
from common.util import load_memory
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger("setup_functions")
def setup_folder(args, env_name):
if not os.path.exists(args.save_to+"a3c/"):
os.makedirs(a... |
import argparse, sys
import numpy as np
from PIL import Image
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from transform import random_transform_generator
from dataset import SEMDataset
from modules import *
... |
#!/usr/bin/python
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LIC... |
# Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
import argparse
import textwrap
from os.path import dirname
from utils.common_cli import make_subcommand_gunicorn, float_between_0_and_1
from otd.constants import SIMTYPE_ALL, SIMTYPE_AUTOTAG, SIMTYPE_SIMILARITY, simtypes, DATAONTOSEARCH_ENGINE, GOOGLE_ENGINE, engines
def register_subcommand(add_parser):
register... |
"""
Inline-optimized Sheet classes
"""
import param
from topo.base.cf import CFIter
from topo.base.projection import NeighborhoodMask
from topo.misc.inlinec import inline,provide_unoptimized_equivalent,c_header
from topo.sheet.lissom import LISSOM
from topo.sheet import compute_joint_norm_totals # pyflakes:ignore (r... |
import sys
import camelot
import tabula
import json
import numpy as np
def get_table_height(table):
all_y = []
for item in table.rows:
all_y.extend(item)
all_y = list(all_y)
return max(all_y) - min(all_y)
def get_table_width(table):
all_x = []
for item in table.cols:
all_x.ex... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2022 F4PGA 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
#
# Unl... |
# Driver Assist Machine Learning Using Masking-RCNN
import cv2
import numpy as np
import os
import sys
from soco import coco
from mrcnn import utils
from mrcnn import model as modellib
# This portion of the code is specifying the path to the appropiate directories, while also grabbing the weights for the pre-trained... |
from flask import render_template, request, redirect, url_for, Flask, session, abort, flash
from flask_wtf import Form
import os, gc
from wtforms import TextField, PasswordField
from wtforms.validators import DataRequired, Email, Length, EqualTo
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import... |
import speech_recognition as sr
import screen_brightness_control as sbc
import time
import datetime
from time import ctime
from gtts import gTTS
import random
import playsound
import os
import webbrowser
import wikipedia
import cv2
from better_profanity import profanity
import tkinter
from tkinter impor... |
# -*- coding: utf-8 -*-
from google.appengine.api import mail
from flaskext import wtf
import flask
import config
import model
import util
app = flask.Flask(__name__)
app.config.from_object(config)
app.jinja_env.line_statement_prefix = '#'
app.jinja_env.line_comment_prefix = '##'
app.jinja_env.globals.update(slugify=... |
# vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
from . import VERSION
from .data import get_data
from .template import Template
raw_open = open
from argparse import ArgumentParser
from codecs import open
try:
import configparser
_CONFIG_PARSER = configparser.... |
import codecs
import io
import pickle
import tarfile
import warnings
from dataclasses import dataclass
from typing import BinaryIO, List, Mapping, MutableSequence, Optional, Tuple, Type
import numpy as np
from packaging.version import Version
from starfish.core.errors import DataFormatWarning
from starfish.core.types... |
# df_maze.py
# Create a maze using the depth-first algorithm described at
# https://scipython.com/blog/making-a-maze/
# <NAME>, April 2017.
class Cell:
"""A cell in the maze.
A maze "Cell" is a point in the grid which may be surrounded by walls to
the north, east, south or west.
"""
# A wall se... |
# coding: utf-8
import requests
import creds
import time
import datetime
from slackclient import SlackClient
import json
import sqlite3
from tqdm import tqdm
import tweepy
InProduction = True
WantTweets = False
WantShortNotice = True
ReportOutagesOver = 1500 # Slack message when we see PBC-MRT-STL outages over 1500,... |
'''MIT License
Copyright (C) 2020 <NAME>, Intel Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, m... |
import dndTools
import numpy as np
class business: #this is not very elegant please ignore the countless circular dependencies!
def __init__(self, products={}, producers={}, locations={}, day=0, total_gp=0):
self.products = products #dict of product objects with product names as keys
self.producers... |
''' Copyright [2018] [<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
https://github.com/Robosid/Drone-Intelligence/blob/master/License.pdf
https://github.com/Robosid/Dro... |
from .Gadget import Gadget
from collections import OrderedDict
from fnmatch import filter
import h5py
import numpy as np
def list_to_table(lst, titles, margins=3, sort=True):
"""
Formats a table from a nested list, where the first index is the row.
"""
if sort:
lst = sorted(lst)
result = '... |
#!/usr/bin/env python
#coding: UTF-8
import socket
from typing import List, Optional
from . import config
from .classes import CpuType,CPUSeries,PacketType, Protocol, EtherFrame, SerialFrameID, MCCommand, SerialFrameID
from .fxdevice import FxDevice, FxDataType, FxDeviceType
class Eth():
@staticmethod
def ge... |
import sys
import numpy as np
import re
from propeller import log
import itertools
from propeller.paddle.data import Dataset
import six
if six.PY2:
import operator
def accumulate(iterable, func=operator.add, initial=None):
'Return running totals'
# accumulate([1,2,3,4,5]) --> 1 3 6 10 15
... |
import os.path
import shutil
import json
import re
import os
from wok.task import task
from wok.config.data import Data
from intogensm.exceptions import InternalError
from intogensm.utils import match_id, list_projects
from intogensm.paths import get_project_path, get_temp_path, create_combination_folders
from intoge... |
from cobe.brain import Brain, CobeError
from cobe.tokenizers import MegaHALTokenizer
import pickle as pickle
import os
import unittest
TEST_BRAIN_FILE = "test_cobe.brain"
class testInit(unittest.TestCase):
def setUp(self):
if os.path.exists(TEST_BRAIN_FILE):
os.remove(TEST_BRAIN_FILE)
def... |
from gevent import monkey
monkey.patch_all()
from flask import Flask,render_template,request,redirect,url_for,session,flash
import MySQLDatabase
import config
from TikTokApi import TikTokApi
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, Form, Boolean... |
#!/usr/bin/env python3
"""Meant to be run from inside python-test-runner container,
where this track repo is mounted at /python
"""
import argparse
from functools import wraps
from itertools import zip_longest
import json
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile
from typing im... |
import theano
import theano.tensor as tt
from collections import OrderedDict
from unification.utils import transitive_get as walk
from theano.gof import (FunctionGraph as tt_FunctionGraph, Query)
from theano.gof.graph import (inputs as tt_inputs, clone_get_equiv,
io_toposort)
from thean... |
from .image_crawler import card_image_crawler, banner_image_crawler
from .image_transport import image_to_coolq_file
import time
import json
from .json_crawler import json_crawler
characters = {}
skills = {}
eventTypes = {
'versus': '对邦',
'story': '协力',
'mission_live': '任务',
'challenge': 'CP',
'... |
import asyncio
import json
import logging
import os
import random
import string
import time
from datetime import datetime
from functools import partial
from typing import Optional
from aiohttp import web
from peewee import DoesNotExist
from app.models import ExtendedDBManager, Article
from app.serializers import Arti... |
import os
import boto3
from time import strftime, gmtime
s3_client = boto3.client('s3')
def process_event(event, context):
print(event)
event_source_s3 = event['Records'][0]['s3']
print("S3 Put event source: {}".format(get_full_path(event_source_s3)))
timestamp = strftime("%Y-%m-%d-%H-%M-%S", gmtim... |
# MIT License
#
# Copyright (c) 2020 <NAME> (Talendar)
#
# 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, m... |
#-------------------------------------------------------------------------------
# Parser for ASDL [1] definition files. Reads in an ASDL description and parses
# it into an AST that describes it.
#
# The EBNF we're parsing here: Figure 1 of the paper [1]. Extended to support
# modules and attributes after a product. W... |
#!/usr/bin/env python3
import pybullet as p
import numpy as np
import rospy
import time
import threading
import pybullet_data
from sensor_msgs.msg import JointState
from sensor_msgs.msg import Imu
import matplotlib.pyplot as plt
from simple_pid import PID
def init_simulation():
global boxId, motor_id_list, compen... |
import numpy as np
import os
from taco_salad.toppings import ConfidenceCutter, criteria
def generate(n, purity, x_lims=[-1., 1]):
d = (-1) * (0.5 * np.sqrt(1 - purity)) / (np.sqrt(1 - purity) - np.sqrt(2))
y = 2. / (0.5 + d)
x_c = 0.5 - d
a = y / (1 - (1 / x_c))
m = -a / x_c
r = np.random.uni... |
# from statistics import linear_regression
from re import X
from turtle import title
from scipy import stats
from pyparsing import PrecededBy
from IMLearn.utils import split_train_test
from IMLearn.learners.regressors import LinearRegression
import os
from typing import NoReturn
import numpy as np
import pandas as pd... |
from hask3.lang.typeclasses import Show
from hask3.lang.typeclasses import Read
from hask3.lang.syntax import H
from hask3.lang.syntax import sig
from hask3.lang.syntax import t
from hask3.lang.syntax import data
from hask3.lang.syntax import d
from hask3.lang.syntax import deriving
from hask3.lang.syntax import inst... |
import os
import time
import numpy as np
import torch
import torchvision
import torchvision.transforms as transforms
from appfl.config import *
from appfl.misc.data import *
from appfl.misc.utils import *
from models.cnn import *
from models.resnet import *
import appfl.run_serial as rs
import appfl.run_mpi as rm
... |
from mpi4py import MPI
import mpiunittest as unittest
class TestCommNull(unittest.TestCase):
def testContructor(self):
comm = MPI.Comm()
self.assertEqual(comm, MPI.COMM_NULL)
self.assertFalse(comm is MPI.COMM_NULL)
def construct(): MPI.Comm((1,2,3))
self.assertRaises(TypeEr... |
#
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
import sys
import torch
import numpy as np
sys.path.append('./yolov5')
from models.experimental import attempt_load
from utils.torch_utils import select_device, time_sync
from utils.general import check_img_size, non_max_suppression, scale_coords
class Model:
""" Class to interact with YOLOv5 model """
def _... |
import logging
import typing
from typing import List
from dbnd._core.errors import DatabandRuntimeError
from dbnd._core.settings import EngineConfig, RunConfig
from dbnd._core.task_build.task_context import TaskContextPhase
from dbnd._core.task_build.task_registry import build_task_from_config
from dbnd._core.task_ct... |
import os
import cv2
import torch
import numpy as np
import torch.nn as nn
from torch.utils.data import Dataset
class Cub200(Dataset):
def __init__(self, root, split, img_size, center_crop_scale, label_to_onehot = False):
super(Cub200, self).__init__()
if split not in ['train', 'test']:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2016 <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 2 of the License, or
# (at your option) any later version.... |
#!/usr/bin/env python3
import os, numpy as np, argparse
def relFit(nu, eps): return 7.10538 * np.power(eps, 1/6.0) / np.sqrt(nu)
def etaFit(nu, eps): return np.power(eps, 0.25) * np.power(nu, 0.75)
def lambdaFit(nu, eps): return 5.2623 * np.power(eps,-1/6.0) * np.sqrt(nu);
def runspec(nu, eps, run):
retu... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class Tests:
prefilter_instance_count = (
"Found the expected number of instances before applying ... |
import sys
import time as t
import numpy as np
from depthy.misc import Normalizer
def get_indices(offset: int = 0, dim: int = 0, direction: tuple = (0, 0), height: int = 0) -> (np.ndarray, np.ndarray):
"""
Compute array of indices diagonal directions (SE, SW, NW, NE) of the slice.
:param offset: differ... |
# coding:utf-8
"""
UDP服务端,等待客户端的连接。
有连接呼入时接收文件并保存。
"""
import asyncio
import hashlib
import json
import os
import random
import threading
def display_file_length(file_size):
"""格式化文件长度"""
if file_size < 1024:
return '{0:.1f}B'.format(file_size)
elif 1024 <= file_size < 1048576:
return '{0:... |
"""
Export QCircuits as qpic files
https://github.com/qpic/qpic/blob/master/doc/qpic_doc.pdf
"""
from tequila.circuit.compiler import Compiler
from tequila.circuit import gates
from tequila.circuit import QCircuit
from tequila.tools import number_to_string
from tequila.objective.objective import FixedVariable
import ... |
#All code copyright 2014, <NAME>. All rights reserved.
import numpy as np
def arc_distance(lon0=None, lat0=None, lon1=None, lat1=None, R=1.,
input_coords='radians'):
"""
Gets the arc distance between (lon0, lat0) and (lon1, lat1).
Either pair can be a pair or an array. R is the radius of... |
import bpy
import os
import ntpath
#Script Created By: Average Godot Enjoyer
def fixBones():
#print('Running Mixamo Armature Renaming Script.')
bpy.ops.object.mode_set(mode = 'OBJECT')
if not bpy.ops.object:
print('Please select the armature')
bpy.ops.object.transform_ap... |
#
# Copyright (c) 2014, Arista Networks, Inc.
# 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 condit... |
import pandas as pd
from A00_File_name import file_name
output_file_1 = file_name[:-4] + '_URLs_from_WB.csv'
file_df = pd.read_csv(output_file_1, sep=';', encoding='latin-1', index_col=[0])
# #############################################################################################################
# """ ...... |
import pytest
import numpy as np
from graspologic.embed.ase import AdjacencySpectralEmbed
from graspologic.simulations.simulations import sbm
from graspologic.nominate import SpectralVertexNomination
# global constants for tests
n_verts = 50
p = np.array([[0.7, 0.25, 0.2], [0.25, 0.8, 0.3], [0.2, 0.3, 0.85]])
labels =... |
from __future__ import print_function
from __future__ import division
from . import _C
import torch
from fuzzytorch.utils import TDictHolder, tensor_to_numpy, minibatch_dict_collate
import numpy as np
import fuzzytools.files as files
from fuzzytools.matplotlib.utils import save_fig
from fuzzytools.matplotlib.animators... |
# <NAME>
# <EMAIL>
# April 12, 2018
"""
Miscellaneous utilities
"""
from __future__ import absolute_import
import numpy as np
import pickle
import os
import argparse
from tempfile import mkdtemp
def get_local_config_param(key, force_update=False):
"""
Read the local config file to find a parameter. If it'... |
#!/usr/bin/env python3
"""
Uses ICMP Echo Request to ping a host, or trace the hops to a host.
Copyright (c) 2018 <NAME>
Version 1.4
"""
import os, sys, socket, struct, select, time, argparse
def checksum(data):
"""
Calculate the 16 bit checksum for data
Described in http://www.faqs.org/rfcs/rfc107... |
from tqdm import tqdm
import xgboost
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor, AdaBoostRegressor
from sklearn.linear_model import Ridge, Lasso
from sklearn.svm import SVR
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.ensemble import StackingRegressor
fro... |
"""Simple GUI tools. Could almost certainly be greatly improved.
"""
import keyword
import os
import tkinter as tk
import tokenize
from io import StringIO
from tkinter import filedialog, ttk
class Token:
"""Token as generated from tokenize.generate_tokens written here in
a more convenient form for our pu... |
import sqlite3
import shutil
import os.path
import defines
from datetime import timedelta,datetime
def category_is_empty(sql_cursor):
sql_cursor.execute("SELECT COUNT(*) FROM category")
sqL_result = sql_cursor.fetchone()
return sqL_result[0] == 0
def create_goods_table(sql_cursor, name):
s... |
from __future__ import annotations
import typing as ty
import aurflux
import discord
import itertools as itt
import collections as clc
import asyncio as aio
if ty.TYPE_CHECKING:
import datetime
def message2embed(message: discord.Message, embed_color: discord.Color = None):
embeds = []
# for image in messag... |
import builtins
from speech_emotion_recognition import __version__
from speech_emotion_recognition import speech_emotion_recognition
from unittest.mock import patch
import pytest
import mock
def test_version():
assert __version__ == '0.1.0'
def test_extract_features():
# Arrange
expected = -726.2172241210... |
"""
IO
--
This module contains high-level I/O functions to read and write tur-by-turn data objects in different
formats. While data can be loaded from the formats of different machines / codes, each format getting its
own reader module, writing functionality is at the moment always done in the ``LHC``'s **SDDS** forma... |
"""Advent of Code 2019 Day 11 - Space Police."""
from collections import defaultdict
class EHPR:
"""Class for the Emergency Hull Painting Robot."""
def __init__(self, code, inputs):
"""Initialises the EHPR with code (dict) and inputs (list)."""
self.code = code
self.inputs = inputs
... |
import io
from io import BytesIO, StringIO
from unittest.mock import call
import pytest
# noinspection PyProtectedMember
from scalpel.green.utils.io import AsyncFile, _has, wrap_file, open_file
# noinspection PyMethodMayBeStatic
class DummyIO:
"""A file-like class to help in tests"""
writelines_called = Fal... |
import torch
import torch.nn as nn
import torch.optim as optim
import copy
from torch.autograd import Variable
from modelnet40_data import classes, PointnetDataset, load_data, Normalize, toTensor
from Pointnet_model import Pointnet
from torchvision import transforms
from torch.utils.data import DataLoader
import ... |
'''
chop.py
Takes a list of input ingredient names. Chops each ingredient, and adds the
resulting model to the current blend or a new blend
<NAME>
2016
'''
import sys
import argparse
import bpy
import numpy as np
import os
import bmesh
from math import *
from mathutils import *
import random
def createMesh(name, o... |
import statistics
import numpy as np
import matplotlib.pyplot as plt
from operator import itemgetter
from explainability_utils import plot_warping
from dtw_utils import dtw_path
from load_data import (load_classification_data,
load_current_test_data,
load_nn_with_false_lab... |
"""
records.py
This module provides functions for visualizing records and labels.
By: <NAME> and <NAME>, 2019
"""
# 3rd party imports
import os
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from matplotlib.colors import ListedCo... |
import gym
import gym.spaces
import gym.utils
import gym.utils.seeding
import numpy as np
from gym_extensions.continuous import mujoco
import sys
try:
from gym.envs.mujoco.mujoco_env import MujocoEnv
except:
print("This example depends on mujoco, see README.md for information on installing.")
sys.exit()
try... |
# -*- coding: utf-8 -*-
from .. import dot
from ..core import ConsMDP
from ..distribution import uniform
# ## Almost sure reachability example
# * it should distinguish between positive and almost-sure reachability:
# - target that does not reach any other target
# - target reachable by an action that can lead... |
# -*- coding: utf-8 -*-
import socket
import sys
LISTEN_CHUNKSIZE = int(1024)
LISTEN_SAMPLERATE = 44100
LISTEN_MIC_INDEX = None
LISTEN_TIMEOUT = None
LISTEN_HOTWORD_MAX_DURATION = 0.8
LISTEN_HOTWORD_MIN_DURATION = 0.025 #at least 50% of the voice needs to be above the energy_threshold
LISTEN_PHRASE_TOTALTIMEOUT = 5... |
import re
import os.path
from itertools import islice
from bisect import insort
from heapq import merge
from vial import vim, vfunc
from vial.fsearch import get_files
from vial.utils import focus_window, get_projects, buffer_with_file, mark, single, echom
from vial.widgets import ListFormatter, ListView, SearchDialog... |
import json
import logging
import os
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.files.storage import FileSystemStorage
from django.http import JsonResponse
from django.shortcuts import render
from rest_framework.rendere... |
import math
# matplotlib imports
from matplotlib.pyplot import show, xticks, savefig, close, subplots, subplots_adjust
# local imports
from .base import Graph
from ..data import Categorical, is_group, is_categorical
from ..analysis.exc import MinimumSizeError, NoDataError
class CategoricalGraph(Graph):
def __i... |
import numpy as np
import heapq
class Node:
def __init__(self, coord, parent=None, g=0, h=0):
self.coord = coord
self.parent: Node = parent
self.g = g
self.h = h
self.f = g + h
self.master = 0
# self.iter = self.gen_data()
# def gen_data(self):
# ... |
import faker
from dataclasses import dataclass, asdict
fake_data = faker.Faker()
@dataclass
class Campaign(object):
name: str = None
conversion_funnel_id: None = None
objective: str = None
enable_offline_goals: bool = None
targetings: dict = None
age_restrictions: None = None
date_start: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.