text
stringlengths
3.07k
22.1k
# Breakout game using pygame import pygame import math SCREEN_WIDTH = 400 SCREEN_HEIGHT = 600 SCREEN_SIZE = (SCREEN_WIDTH, SCREEN_HEIGHT) RED = '#A31E0A' ORANGE = '#C2850A' GREEN = '#0A8533' YELLOW = '#C2C229' WHITE = '#CCCCCC' BLUE = '#0A85C2' x = 180 y = 550 block_width = 26 block_height = 10 paddle_width = 40 p...
# # -*- coding: UTF-8 -*- # trial on the : Satomi machine # Created by Ush on 2018/5/18 # Project name : class10_ODE # Please contact CHIH, HSIN-CHING/D0631008 when expect to refer this source code. # NOTE : no liability on any loss nor damage by using this source code. it is your own risk. from _...
import requests from flask import Flask, render_template, request, redirect, url_for, g, session from flask_bootstrap import Bootstrap from c_form import YForm, ManagerForm, AudioInfoForm, AudioDetailForm import audio_db import manage_db from models import * import os import json # from test import tes...
import os import numpy as np import numpy.random as rnd import matplotlib.pyplot as plt import logging from pandas import DataFrame from ..common.data_plotter import * from .aad_globals import * from .aad_support import * from .forest_description import * from .anomaly_dataset_support import * """ pythonw -m ad_ex...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Author: <NAME> 2018 # http://blog.onlinux.fr # # # Import required Python libraries import os import logging import logging.config from hermes_python.hermes import Hermes from snipshelpers.config_parser import SnipsConfigParser # Fixing utf-8 issues when sending Snips...
import logging import os import pickle from collections import namedtuple import gym import numpy as np from catastrophe_wrapper import * from catastrophe_wrapper import CatastropheWrapper from classifier_tf import (SavedCatastropheBlockerTensorflow, SavedCatastropheClassifierTensorflow) l...
# coding=utf-8 """ 本模块提供配置文件选项定义以及载入功能,外部需统一通过本模块的CONF来读取配置信息 """ from __future__ import absolute_import from collections import Mapping import copy import json import functools import re import warnings from mako.template import Template from talos.core import utils VAR_REGISTER = {} CONFIG_RESERVED = ('set_optio...
import sys import numpy as np from scipy.misc import logsumexp from copy import deepcopy import snl.ml.trainers as trainers import snl.ml.models.mdns as mdns import snl.ml.step_strategies as ss import snl.ml.loss_functions as lf import snl.pdfs as pdfs import snl.simulators as simulators import snl.inference.mcmc as ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import tensorflow as tf import os import logging import io from lxml import etree import PIL.Image from PIL import Image, ImageOps from object_detection.utils import lab...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import matplotlib matplotlib.use("Agg") from matplotlib import pyplot as plt from scipy.io import wavfile from vocoder.hifigan_generator import Generator import hparams as hp import os import text import json from pyd...
import unittest import numpy as np from pandas import Index from pandas.util.testing import assert_almost_equal import pandas.util.testing as common import pandas._tseries as lib class TestTseriesUtil(unittest.TestCase): def test_combineFunc(self): pass def test_reindex(self): pass def ...
#!/usr/bin/env python # # Example usage: # help # ./run_tests.py -h # # run everything with default sizes # output is redirected; summary information is printed on stderr # ./run_tests.py > output.txt # # run Level 1 BLAS (axpy, dot, ...) # with single, double and default sizes # ./run_tests.py --blas1 --ty...
# Copyright (c) 2013, Taazur Limited Company and contributors # For license information, please see license.txt from __future__ import unicode_literals import datetime from six import iteritems import frappe from frappe import _ from frappe.utils import flt, formatdate from erpnext.controllers.trends import get_peri...
import pytest from ding.data.buffer import DequeBuffer from ding.framework import Context, OnlineRLContext, OfflineRLContext from ding.framework.middleware.functional.data_processor import \ data_pusher, offpolicy_data_fetcher, offline_data_fetcher, offline_data_saver, sqil_data_pusher from ding.data.buffer.midd...
from importlib import import_module import dash import dash_html_components as html import dash_core_components as dcc import dash_table from dash.dependencies import Input, Output from flask_caching import Cache from flask_login import current_user import uuid from parade.core.context import Context from parade.serv...
import os import re import uuid import time from collections import namedtuple from datetime import datetime from enum import Enum from random import randint from string import ascii_letters from types import SimpleNamespace import pytest import requests from labelbox import Client from labelbox import LabelingFronte...
import os import os.path from options.transfer_options import TransferOptions from data import CreateDataLoader from data.face_dataset import FaceDataset from data.audio_dataset import AudioDataset from models import create_model from util.visualizer import save_images from util import html import torch import torch.nn...
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import asyncio from rate_limit.rl_wallet import RLWallet from chiasim.clients.ledger_sim import connect_to_ledger_sim from chiasim.wallet.deltas import additions_for_body, removals_for_body from chiasim.hashable import BLSPublicKey, Coin from chiasim.hashable.Body import BodyList from utilities.decorations import print...
from unittest import TestCase from bs4 import BeautifulSoup from django.template.loader import render_to_string from lite_forms.components import ( Form, DetailComponent, TextInput, FormGroup, _Component, Label, HelpSection, Option, DateInput, BackLink, HiddenField, Num...
__all__ = ['eig_seg', 'initialize_eigenanatomy', 'sparse_decom2'] import numpy as np from scipy.stats import pearsonr import pandas as pd from .. import core from .. import utils from ..core import ants_image as iio def sparse_decom2(inmatrix, inmask=(None, None), ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Metadata for export index data from moex.com """ import decimal import typing import enum import datetime import dataclasses from ...base import ( InstrumentValue, InstrumentInfo, InstrumentValueProvider, InstrumentInfoProvider, InstrumentHistoryDownloadParam...
"""Tools for manual context management.""" import asyncio from contextvars import Context, copy_context from functools import partial, wraps from typing import Callable, Coroutine, TypeVar _ReturnT = TypeVar("_ReturnT") def bind_to_snapshot_context( fn: Callable[..., _ReturnT], *args, **kwargs ) -> Callable[......
import datetime import os import urllib from http.client import IncompleteRead from urllib.request import Request import bs4 as bs import pandas as pd from django.conf import settings from core.models import CourseModel, UpdateModel # FILE PATHS my_path = os.path.abspath(os.path.dirname(__file__)) stopwords_path = ...
# /usr/bin/python3 import sys from Bio import SeqIO from os import path import time import argparse import logging as log import numpy as np import pandas as pd import warnings from scipy.spatial.distance import squareform def makePairs(popmap): pairs = [] for x in popmap: for y in popmap: ...
# -*- coding: utf-8 -*- # Builtin Modules import os import sys import time import json import logging import socket # 3rd-party Modules import simplejson import arrow # Project Modules from worker.utils import yaml_resources, toolkit from worker.utils.colors import colors CONFIG = yaml_resources.get('CONFIG') # Co...
"""Tasked dataset for multitask continual learning setup. Module contains TaskedDataset class, which controls its content based on the current task_id, which can be set by set_task() function. prepare_dataset() function fetches the data according to the dataset name provided, splits train into train-validation and co...
import subprocess import sys from pathlib import Path from unittest import TestCase from unittest.mock import Mock, create_autospec from botocore.credentials import Credentials from pyfakefs.fake_filesystem_unittest import TestCase as FsTestCase from sceptre.connection_manager import ConnectionManager from sceptre.exc...
import discord from discord.ext import commands import sys import logging import typing import pendulum import random import feedparser import aiohttp import textwrap import asyncio from bs4 import BeautifulSoup class MiscCog(commands.Cog, name="Miscellaneous"): def __init__(self, bot): self.bot = bot ...
""" Format a set of INDRA Statements into an HTML-formatted report which also supports curation. """ from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import re import uuid import itertools from os.path import abspath, dirname, join from jinja2 import Template impo...
# !/usr/bin/env python3 # -*-coding:utf-8-*- # @file: extrac_frames.py # @brief: # @author: <NAME>, <EMAIL>, <EMAIL> # @version: 0.0.1 # @creation date: 20-10-2020 # @last modified: Sat 24 Oct 2020 05:51:32 PM EDT import sys import argparse import cv2 import numpy as np #print(cv2.__version__) def extractImages(path...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
import logging import json from flask import Flask, render_template, url_for, send_from_directory from flask import request, redirect, abort, jsonify from flask_caching import Cache from episcan import lang, manga from episcan.database import Database from episcan.scraper import main as scraper_main DEBUG = F...
"""Implementation of SEIRD Epidemiological Model on COVID-19 data.""" from typing import Dict import COVID19Py import matplotlib.pyplot as plt import numpy as np import pandas as pd from lmfit import Model, Parameters from scipy.integrate import odeint from scipy.stats import linregress from covid_seird.exceptions im...
import time import os.path as osp import itertools import argparse import wget import torch from scipy.io import loadmat from torch_scatter import scatter, segment_coo, segment_csr short_rows = [ ('DIMACS10', 'citationCiteseer'), ('SNAP', 'web-Stanford'), ] long_rows = [ ('Janna', 'StocF-1465'), ('GH...
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
""" Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ from __future__ import print_function import re import sys import collections import gettext import os.path py = os.path.dirname(sys.argv[0]) top = os.path.dirname(py) sys.path...
import numpy as np import itertools as it import scipy import statsmodels.api as sm import os from sys import argv def read_chrom(chrom_file): """ Read a list of chromosomes. Args: chrom_file (str): name of the file (ex: 'dm3.chrom.sizes') Returns: chrom_list (list): list of chromosome na...
""" File Import """ import CTM_Net """ Set GPU """ import os # set visible devices os.environ["CUDA_VISIBLE_DEVICES"] = "5,6,7" """ Package Import """ import numpy as np import torch import torch.nn as nn import matplotlib.pyplot as plt import datetime import zarr import sys import joblib from rtpt import RTPT from...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------# # Copyright © 2015-2016 VMware, Inc. All Rights Reserved. # # # # Licensed under the BSD 2-Clause License (the “License...
# Copyright 2013: Mirantis 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 required b...
# Inference on Large-Scale Datasets from __future__ import division, print_function import os, sys sys.path.append('/n/pfister_lab2/Lab/xingyu/Human/pytorch_connectomics') import torch import torch.nn as nn import numpy as np import h5py, yaml, json from matplotlib.pyplot import imread import itertools # model from ...
# coding=utf-8 from enum import Enum, IntEnum, auto import time import random import math import numpy import cv2 from utils import readimage, writeimage import matching class Phases(IntEnum): """任务执行的阶段""" BEGIN = 0 RUNNING = 1 END = 2 class Results(Enum): """任务执行的结果""" PASS = auto() SUC...
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from collections import defaultdict import copy import logging import numbers import numpy as np fro...
import os import random import tensorflow as tf from embedding import * from rnn_text_classifier import RnnTextClassifier from sentence import Sentence # Data parameters tf.flags.DEFINE_string("data_dir", "data_qc", "The path of the tweet training data_qc") tf.flags.DEFINE_string("model_dir", ...
import numpy as np import torch import os import os.path as osp import cv2 import scipy.misc as misc import shutil from skimage import measure import math import traceback from sklearn import metrics import zipfile def adjust_learning_rate(args, optimizer, epoch): """ Sets the learning rate to the initial LR ...
import sys import argparse import subprocess as subp missing_modules = False # Run with -setup to install required modules # (based on requirements.txt) # (generated with pipreqs .) try: import yaml from pathlib import Path from timeit import default_timer as timer import re from loguru import log...
import numpy as np from . import boost class ParBoost(object): # it is practically a struct def __init__(self, phi, alpha): self.sphi = np.sin(phi) self.cphi = np.cos(phi) self.tphi = np.tan(phi) self.salpha = np.sin(alpha) self.calpha = np.cos(alpha) def tobuffer...
from fun import * table ={0x0000:"A", 0x0001:"B", 0x0002:"C", 0x0003:"D", 0x0004:"E", 0x0005:"F", 0x0006:"G", 0x0007:"H", 0x0008:"I", 0x0009:"J", 0x000A:"K", 0x000B:"L", 0x000C:"M", 0x000D:"N", 0x000E:"O", 0x000F:"P", 0x0010:"Q", 0x0011:"R", 0x0012:"S", 0x0013:"T", 0x0014:"U", 0x0015:"V", 0x0016:...
# Files in the NNModel Package developed by <NAME> github.com/1aidea import os import numpy as np import cupy as cp from tensorflow import keras from tensorflow.keras import utils from tensorflow.keras.layers import BatchNormalization, Dense, Dropout from tensorflow.keras.models import Sequential from NNModel.Util.hel...
"""Automated tests for the analysis functions.""" import unittest from pyspedas.analysis.tsmooth import smooth from pyspedas import (subtract_average, subtract_median, tsmooth, avg_data, yclip, time_clip, deriv_data, tdeflag, clean_spikes, tinterpol) from pytplot import get_...
# Copyright 2021 Canonical Ltd. # See LICENSE file for licensing details. from contextlib import nullcontext as does_not_raise import logging from pathlib import Path from unittest import mock from charm import MetacontrollerOperatorCharm, CheckFailed import lightkube.codecs from lightkube.resources.apps_v1 import De...
# ***************************************************************************** # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this fi...
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix, roc_curve, roc_auc_score, auc, average_precision_score #import scikitplot as skplt import numpy as np import matplotlib.pyplot as plt import seaborn as sns from keras.callbacks import History, ReduceLROnPlateau,EarlyStopping,Mo...
# -*- coding: utf-8 -*- from collections import namedtuple from typing import Dict, List, Union LDCreatorResult = namedtuple("LDCreatorResult", ["success", "json_ld_object", "keys", "messages"]) DATALAD_SCHEMA_BASE = "https://schema.datalad.org" class SMMProperties: AFFILIATION = "affiliation" AUTHOR = "...
""" Unit tests for the zerotier utility Every test in this module uses parametrization to test various inputs and outcomes. """ # standard python imports import unittest.mock as mock import json # 3rd party imports import pytest # two1 imports import two1.commands.util.zerotier as zerotier @pytest.mark.par...
import math import os import random from random import randint from collections import deque import pygame from pygame.locals import * import sys # import time # import datetime FPS = 60 ANIMATION_SPEED = 0.18 # пикселей в мс WIN_WIDTH = 284 * 2 # Размер заднего фона : 284x512 px WIN_HEIGHT = 512 screen_rect = (0,...
#!/usr/bin/env python import os import time from dynamixel_sdk import * # Uses Dynamixel SDK library if os.name == 'nt': import msvcrt def getch(): return msvcrt.getch().decode() else: import sys, tty, termios fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) ...
#!/usr/bin/env python3 import click import numpy as np import getpy as gp import pyrosetta import logging # import faulthandler import h5py from file_io import retrieve_string_archive logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG) def update_unique_key_dict(key_dict, keys_loops_iter...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd import youtube_transcript_api from youtube_transcript_api import YouTubeTranscriptApi from youtube_transcript_api.formatters import TextFormatter import requests import simplejson as json from collections import Counter import re import time import scr...
from gevent import monkey monkey.patch_all() import base64 import gzip import json import os import socket import threading import time import requests from cryptography.fernet import Fernet, InvalidToken from flask import Flask, jsonify, request, Response from flask_socketio import SocketIO, emit, join_room, leave_...
#!/usr/bin/env python2 # This is a GIMP Python plugin that I created to help me when saving stains for multiple themes simultaneously. # It also saves a mapping of the output! # Standard Library import errno import glob import json import os import time # third party from gimpfu import * gettext.install("gimp20-pyt...
import random ##----------------------------------------------------------------## from gii.core import app, signals from gii.qt import QtEditorModule from gii.qt.IconCache import getIcon from gii.qt.controls.GenericTreeWidget import GenericTreeWidget from gii.qt.controls.PropertyEdit...
from pyqc.gates import * from .import numpy as np class Var: def __init__(self, value=0, grad=0, coefficient=1, id=-1): self.value = value self.grad = grad self.coef = coefficient self.id = id @property def angle(self): return self.value*self.coef ...
# -*- coding: utf-8 -*- from tastypie.authentication import BasicAuthentication from tastypie.authorization import Authorization from tastypie.resources import ModelResource from tastypie import fields from tastypie.exceptions import ImmediateHttpResponse from tastypie.constants import ALL_WITH_RELATIONS from django....
"""Télécharger les arrêtés de péril depuis le site de la ville. 2021-06 : les arrêtés sont maintenant classés par arrondissement, puis par rue (par ordre alphabétique) TODO - stocker chaque item en HTML et appliquer extract_address(), predict_doc_class() en post-traitement - sortir directement les classes finales """...
""" Taking into consideration that pytorch dataset and dataloader seem to be clumsy for daily self-use, I would like to construct a specialised light-weight dataloader for training and testing TODO: add num_workers for data load parallelization TODO: add single image prediction test dataloader """ import logging impor...
try: from functools import reduce except ImportError: pass from pony.orm.decompiling import Decompiler from pony.thirdparty.compiler.ast import * from lxml import etree import ctypes import collections import functools __all__ = 'DOM X xpath query'.split() __author__ = '<NAME>' DEBUG = False class _DOM(...
import numpy as np from typing import Optional, Union, Tuple, Callable, List from ..initialisations import lookup_normal_init from ....utils.misc import to_device from .abs_block import AbsBlock from torch import Tensor import torch.nn as nn __all__ = ['ClassRegMulti'] class AbsTail(AbsBlock): def __init__(sel...
# Copyright 2021 Akamai Technologies, 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 required by applicab...
import matplotlib.pyplot as plt import numpy as np import random as rdm import json plt.rcParams['image.cmap'] = 'gray' # size = (40, 40) # noisysquare = np.zeros((40, 40)) noisysquare[10:-10, 10:-10] = 1 # # np.random.seed(2) # x, y = (40 * np.random.random((2, 20))).astype(np.int) # noisysquare[x, y] = 1 # plt.im...
import argparse from datetime import timedelta from dynaconf import Dynaconf, Validator from dynaconf.base import Settings from logging import Logger import pluggy from multiprocessing import JoinableQueue from queue import Empty import signal import sys from threatbus import appspecs, backbonespecs, logger, stoppable_...
""" python 位左移问题 参考: https://blog.csdn.net/pzqingchong/article/details/77991187 from https://github.com/onetwo1/du-app """ import os import execjs import requests from urllib.parse import quote, unquote # url = "https://m.poizon.com/mapi/product/recommendDetail?recommendId=73&lastId=&sign=555e33ce226ab...
# import the necessary packages from imutils import face_utils import numpy as np import argparse import imutils import dlib import cv2 import os import string from faceplusplus import face_landmarking from PIL import Image # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_...
import datetime import decimal from django.db import models from customer.models import Customer from groupon.constant import GrouponStatus, GrouponAttendStatus, GrouponType, GrouponAttendLineStatus from product.models import Product from promotion.abstract import AbstractPromotionRule from shop.models import Shop fr...
import os import time import numpy as np import os.path as osp from baselines import logger from collections import deque from baselines.common import explained_variance, set_global_seeds from baselines.common.policies import build_policy from baselines.ppo2.model import Model try: from mpi4py import MPI except Imp...
from .forms import AddImageToWorkOrderForm, AddTechnicianToWorkOrderForm, CreateLeadForm, UpdateLeadForm, CreateWorkOrderForm, UpdateWorkOrderForm, CloseWorkOrderForm, SubmitWorkOrderForm from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.contrib.auth.decorators import logi...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import flywheel import argparse import os import logging import warnings import json import shutil import re import csv from pathlib import Path from ..query import print_directory_tree logging.basicConfig(level=logging.INFO) logger = logging.getLogger('fw-heudiconv-exporter') def get_nested(dct, *keys): for ke...
import sys import toml from panda3d.core import NodePath from panda3d.core import TextNode from panda3d.core import TextFont from direct.showbase.ShowBase import ShowBase from direct.gui.DirectGui import DirectLabel from direct.gui.DirectGui import DirectFrame from valuereg.value_reg import add_value_registry from ...
""" API for initiating and tracking requests for credit from a provider. """ import datetime import logging import uuid import pytz from django.db import transaction from edx_proctoring.api import get_last_exam_completion_date from openedx.core.djangoapps.credit.exceptions import ( CreditProviderNotConfigured, ...
# Copyright (c) Microsoft Corporation # Licensed under the MIT License. import os from pathlib import Path from tempfile import TemporaryDirectory import numpy as np import pandas as pd import pytest from responsibleai import ModelTask, RAIInsights from responsibleai._internal.constants import ManagerNames from .co...
import pygame, random, sys from pygame.locals import * import pathlib import time # Consts RANDOM_X = [140, 295, 440, 588] SCREEN_WIDTH = 900 SCREEN_HEIGHT = 600 FPS = 60 X = 350 Y = 100 # Colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) # Assets font_name = "elephant" PLAYER_IMAGE = pathli...
import pybullet import time import numpy as np import random # np.random.seed(5) # random.seed(5) import sys import os import argparse import cv2 import csv from collect_pose_data import PoseDataCollector sys.path.insert(1, '../utils/') from coord_helper import * from data_helper import * import bullet_client as bc...
# Copyright 2021 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 15 14:21:06 2019 @author: adonay test MNEprepro class """ from MNEprepro import MNEprepro import glob import sys import mne import os.path as op from m_set_directories import set_paths subject = '18011045C' # example # options 'Movie', 'CarTas...
# ========================================================================================== # file: softmax.py # description: Softmax # ========================================================================================== from math import exp from permutation import IsolatedPermutation from proto import Architec...
from copy import deepcopy import re import string # Matches (#), (M#), and (#'). commitnames_re = r"(?:\d+)|(?:M\d+)|(?:\d+\')|(?:\d+\-)" # Matches "C C C C C" and so on where C is a commit name. space_separated_commitnames_re = "(({0}) )*({0})".format(commitnames_re) # Matches beginning of line of form "C : C C C ...
import tensorflow as tf def format_example_rnn(example): """Function that prepares example for input into a RNN. Formats positions for a RNN and returns input with shape [game_length, 3, board_size, board_size]: 1. channel: current players stones 2. channel: enemy players stones 3. ch...
""" MIT License Copyright (c) 2021 <NAME> Bot-Name:- Cybel Github:- https://github.com/codePerfectPlus/Cybel Invite-Link:- https://top.gg/bot/832137823309004800/invite """ import random import discord from discord.ext import commands import aiohttp from src.utils import _fetch from src.utils import weather_image_li...
# %% from bdb import set_trace import os import pickle import torch import numpy as np from math import ceil from model_vc_mel import Generator from model_vc_stft import GeneratorSTFT from model_vc_wav import GeneratorWav import matplotlib.pyplot as plt from librosa import display from librosa.filters import mel from s...
"""Orbita theoretical model.""" from typing import Tuple import numpy as np from pyquaternion import Quaternion from numpy import linalg as LA from scipy.spatial.transform import Rotation as R def rot(axis, deg): """Compute 3D rotation matrix given euler rotation.""" return R.from_euler(axis, np.deg2rad(deg...
import logging from re import template from zlib import crc32 from django.apps import apps from django.core.cache import cache from django.core.paginator import Paginator from django.http import ( HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseNotAllowed, Http404, ) from django.shortc...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init from torch.autograd import Variable import numpy as np class ChannelShuffle(nn.Module): def __init__(self, groups): super(ChannelShuffle, self).__init__() self.groups = groups def forward(self, x): ...
""" factor.py """ from operator import attrgetter from numbers import Number from numpy import ( apply_along_axis, float64, nan, ) from scipy.stats import rankdata from zipline.errors import ( UnknownRankMethod, UnsupportedDataType, ) from zipline.lib.rank import rankdata_2d_ordinal from zipline.p...
import collections import inspect import sys import logging import traceback from readerwriterlock import rwlock from pprint import pprint _THREADING_LOCK = rwlock.RWLockWrite() def _retrieve_class_path(obj): if not inspect.isclass(obj): raise Exception("Object must be a class") paths = obj.__module__...
#!/usr/bin/env python2 # coding:utf-8 # Based on GAppProxy 2.0.0 by <NAME> <<EMAIL>> # Based on WallProxy 0.4.0 by <NAME> <<EMAIL>> # Contributor: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # V.E.O <<EMAIL>> # <NAME> <<EMAIL>> # Al...
import asyncio from multiprocessing import Queue import discord import time import pyttsx3 from discord.ext import commands, tasks class Funny(commands.Cog): __slots__ = ['client', 'reddit', 'top_memes', 'top_boobs', 'players', 'engine'] def __init__(self, client): self.client = client self.p...
from photons_app.mimic.packet_filter import Filter, SendReplies, SendUnhandled, SendAck from photons_app.errors import PhotonsAppError, ProgrammerError from photons_app.mimic.event import Events from photons_app import helpers as hp from photons_protocol.messages import Messages from delfick_project.norms import dict...
import sys import os import platform import ctypes import inspect import importlib.machinery as imm import importlib.util as imu import asyncio import traceback import time import signal _os = platform.system() _libfly_dir = os.path.abspath( os.path.join( os.path.dirname(__file__), 'lib...