text stringlengths 3.07k 22.1k |
|---|
"""Tools for working with segmented systems."""
import inspect
from collections import namedtuple
import numpy as truenp
from .mathops import np
from .geometry import regular_polygon
from .coordinates import cart_to_polar
from .polynomials import sum_of_2d_modes
FLAT_TO_FLAT_TO_VERTEX_TO_VERTEX = 2 / truenp.sqrt(3)
... |
import threading
import pprint
import json
import asyncio
import uuid
from jsonrpc import JSONRPCResponseManager
from jsonrpc.dispatcher import Dispatcher
import logging
logger = logging.getLogger(__name__)
class CommTimeoutError(TimeoutError):
"""
Raised when communication error occurs
"""
pass
cl... |
import re
from typing import List, Tuple, Union, Optional
from config import config
from p1_utils.data_type import Register
from p1_utils.errors import RegisterInvalidError, AssemblyError
from p1_utils.file_line import Line
from p2_assembly.mac2_data_macro import macros
from p2_assembly.seg2_ins_operand import FieldBa... |
import os
import sys
import copy
import warnings
from bento.compat.api import json
import bento.compat.api as compat
from bento.core.node \
import \
find_root
from bento.core.platforms \
import \
get_scheme
from bento.utils.utils import subst_vars, same_content, fix_kw, explode_path
from bento... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import logging
import numpy as np
from collections import OrderedDict, Counter
from gensim.models.keyedvectors import KeyedVectors
import multiprocessing
from functools import partial
from contextlib import contextmanager
sys.path.append("../utils")... |
import random as r
from numpy import sqrt, pi, random
from fw_ddsm.parameter import *
def new_task(
mode_value, list_of_devices_power, pst_probabilities, max_care_factor, scheduling_window_width,
num_intervals=no_intervals, num_periods=no_periods, num_intervals_periods=no_intervals_periods
):
# --... |
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
from poutyne import Callback
def visualiser_difference_de_poids(poids_initiaux, poids_finaux):
"""
Affiche un graphique de la différence absolue moyenne entre les poids initiaux et finaux par couche.
Args:
poids... |
import uuid
import time
from typing import Dict, List, Optional
import docker
from docker.errors import APIError
from kubernetes import client as k8s_client
from kubernetes import config as k8s_config
from kubernetes.client.rest import ApiException
from cicada2.engine.config import (
CONTAINER_NETWORK,
CREATE... |
from django.db import models
from django.contrib.auth.models import User
from django.core.mail import send_mail, mail_admins
from django.template.loader import render_to_string
from confidencechronogram import settings
class ChronogramManager(models.Manager):
# usar search()
def search(self, query):
# return self... |
import os
import sys
import random
import math
from msg import *
from xml.dom import minidom
import traci
#PORT = 8873
class Vtype(object):
"""defines the vehicle types"""
def __init__(self, name, accel, decel, sigma, length, minGap, maxSpeed, guiShape):
self.name = name
self.acc... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Any, Dict, List, Optional, Tuple
import torch
from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDictionary
from pytext.common.constants import SpecialTokens
from pytext.config.component import C... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Standard Python imports
#
import os
import subprocess
import math
import datetime
# For progress bars
from tqdm import tqdm
# Modules directly associated with this application
#
import scoring
import utility
# TODO: More representative scoring functions
def generat... |
#!/usr/bin/env python
## TODO: expand the forest to use <slot>, <info>, <more>
## TODO: add <value> browser
## TODO: add <value>/<slot> browser.
## TODO: add <array>/<index> browser.
## TODO: add close button to popouts
## TODO: add static class list
import andbug, os.path, json, subprocess, threading
import re
try:... |
#!/usr/bin/env python
#Edited by <NAME>
#began: 2019-04-10
#last edited: 2019-09-17
'''
Excited States software: qFit 3.0
Contributors: <NAME>, <NAME>, <NAME>, <NAME>
Contact: <EMAIL>
'''
import pkg_resources # part of setuptools
from qfit.qfit import QFitRotamericResidue, QFitRotamericResidueOptions
from qfit.qfit_... |
##
# Copyright (c) 2006-2017 Apple 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 applicable l... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from utils.data import maybe_download, dict_to_example, get_label_map_dict
from utils.tf_image_processing import preprocess, scale, inv_preprocess, \
random_rotate, get_gt_... |
from . import mappings
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union
class Position(object):
__slots__ = ('start', 'end')
def __init__(self, start: int, end: int) -> None:
"""Container object for the position in the isd file. This should
be the exact ... |
"""
version 0.2
This script takes re-ordered output from lstm_decoder.lua or
ngram_decoder.py and randomly replaces unk, UNK, and N (for numbers) symbols,
maintaining these symbols within base NPs (if applicable), using the original,
un-preprocessed input.
None of the input files should have an EOS symbol.
""... |
'''
Created on Nov 21, 2011
@author: <NAME>, 2nd Look Consulting
http://www.2ndlookconsulting.com/
Copyright (c) 2013, <NAME>, Argonne National Laboratory
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following c... |
# Copyright (c) 2018 NVIDIA Corporation
import tensorflow as tf
from math import ceil
from open_seq2seq.parts.cnns.conv_blocks import conv_actv, conv_bn_actv
from .encoder import Encoder
def _get_receptive_field(kernel_size, blocks, layers_per_block):
dilations = [2 ** i for i in range(layers_per_block)]
return... |
import matplotlib.pyplot as plt
import tower
# PLOTTING STUFF
def handover_histogram(handover_data):
plt.title("Handovers")
plt.subplot(211)
plt.hist(handover_data[0], bins=600, range=(1, 2999))
plt.hist(handover_data[1], bins=600, range=(1, 2999))
plt.legend(("Successful handovers", "Unsuccessfu... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
# RPFrameworkUpdater by RogueProeliator <<EMAIL>>
# Class to manage plugin updates from Gi... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
'''
Survival (toxico-dynamics) models, forward simulation and model fitting.
References
----------
[1] <NAME> al. (2011). General unified threshold model of survival -
a toxicokinetic-toxicodynamic framework for ecotoxicology.
Environmental Science & Technology, 45(7), 252... |
import functools
import importlib
import pytest
import numpy as np
from numpy.testing import assert_allclose
from autoray import real
import opt_einsum as oe
import quimb as qu
import quimb.tensor as qtn
from quimb.tensor.optimize import parse_network_to_backend, _get_tensor_data
found_torch = importlib.util.find_s... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import warnings
from copy import deepcopy
from dataclasses import dataclass
from typing import Tuple, List,... |
#! usr/bin/python
# -*- coding:utf-8 -*-
"""
坐标系转换---从原来叉叉助手框架转移过来的
包含了锚点模式,适用于各种分辨率,刘海屏的坐标适配
"""
import logging
from typing import Union
class Point(object):
"""
Point.ZERO :一个x,y均为0的Point
Point.INVALID :一个x,y均为-1的Point
Point(void) :构造一个x,y均为0的Point
Point(x:int , y:int) ... |
# -*- coding: utf-8 -*-
# Copyright 2022, SERTIT-ICube - France, https://sertit.unistra.fr/
# This file is part of eoreader project
# https://github.com/sertit/eoreader
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... |
import os.path
import torch
import torch.sparse
def sym_lap(edge_index):
uniques, inverse, counts = torch.unique(edge_index[0], sorted=True, return_inverse=True, return_counts=True)
d_rsqrt = torch.rsqrt(counts.to(torch.double))
edge_count = edge_index.size(1)
sym_lap_values = torch.zeros(edge_count)
... |
import six
class Field(object):
"""Field base class"""
def __init__(self, name=None, required=True, default=None):
self._attr_name = None
self._resource = None
self.name = name
self.required = required
self.default = default
def contribute_to_class(self, cls, nam... |
from astropy.io import fits
from scipy import signal
import bottleneck as mp
import warnings as warnings
import numpy as np
import time
from lin_mini import lin_mini
def fit2dpoly(x, y, z):
# fit a 2nd order polynomial in 2d over x/y/z pixel points
ones = np.ones_like(x)
a = np.array([ones, x, y, ... |
# Copyright (c) 2010, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the foll... |
#!/usr/bin/env python3
import os, sys, re, collections, logging
import time, signal, importlib, inspect, configparser, hashlib
from contextlib import contextmanager
import tornado.locale
import tornado.web
import tornado.websocket
import tornado.netutil
from tornado.ioloop import IOLoop
from tornado.autoreload import ... |
from string import punctuation
import re
import glob
import os
import pickle
from tqdm import tqdm
def dosya_oku(dosyaIsmi):
"""
Okunacak dosyanın konumu verilince satirlari dondurur.
@param string dosyaIsmi : Dosya konumu
@return list : Dosyanin icindeki satirlar
"""
dosyaOkuyu... |
import io
import json
from pathlib import Path
import psycopg2
import requests
'''
DOCUMENTATION
Requisitos:
- DUMP.sql de la base anterior de rpl v1.
- Postgres 9.5.22
1. Instalar postgres y crear la DB y el usuario
CREEEO QUE (sudo apt install postgresql-9.5)
sudo -u postgres psql
create user rpl with passwor... |
import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import torch.nn.functional as F
__all__ = ['birealnet18', 'birealnet34']
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
... |
import json
import logging
import numbers
import os
import shutil
from PyQt5.QtCore import QObject, pyqtSignal
from surirobot.core import ui
from surirobot.core.api import api_converse, api_nlp, api_tts, api_stt
from surirobot.core.common import State, Dir, ehpyqtSlot
from surirobot.core.gui.progressbarupdater import... |
# Copyright 2021 The TEMPO Collaboration
#
# 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... |
import os
import cv2
import os.path as osp
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
"""
This file is part of the repo: https://github.com/tencent-ailab/hifi3dface
If you find the code useful, please cite our paper:
"High-Fidelity 3D Digital Human Creation from RGB-D Selfies."
<N... |
# Private Sphinx extension.
# The parts that Gillcup uses should work...
import io
import inspect
import sphinx.ext.autodoc
from docutils import nodes
from sphinx.util.compat import Directive
from gillcup import easings
class SpecialMethodDocumenter(sphinx.ext.autodoc.MethodDocumenter):
objtype = 'specialmetho... |
import unicodedata
from pycantonese.jyutping.parse_jyutping import parse_jyutping
from pycantonese.util import endswithoneof, startswithoneof, _deprecate
ONSETS_YALE = {
"b": "b",
"d": "d",
"g": "g",
"gw": "gw",
"z": "j",
"p": "p",
"t": "t",
"k": "k",
"kw": "k",
"c": "ch",
... |
import warnings
import numpy as np
BF = 0.54 * 721
z_min = 4
z_max = 60
D_MIN = BF / z_max
D_MAX = BF / z_min
def extract_stereo_matches(keypoint, keypoints_r, zz, phase='train', seed=0, method=None):
"""
Return:
1) a list of tuples that indicates, for a reference pose in the left image:
- the... |
########################################################################################################################
# Module: ssm/filtering.py
# Description: Particle filtering inc bootstrap filter.
#
# Web: https://github.com/SamDuffield/mocat
######################################################################... |
"""Monkey patch other python libraries."""
import numpy as np
import jax
from jax import core, lax, numpy as jnp
from jax._src.lib import xla_client as xc
from jax._src.lib.xla_bridge import get_backend as default_get_backend
from jax.interpreters import partial_eval as pe
from jax.interpreters.xla import (xops, jaxpr_... |
#!/usr/bin/env python3
# TODO maybe use python3-acora, fast searching for text.
import re
import string
import threading
class EBNFError(Exception):
pass
class TokenStream:
def __init__(self, token_string):
parts = re.split(r"""("[^"]*"|'[^']*')""", token_string)
# The str.split removes whi... |
from http import HTTPStatus
from typing import Any, Callable, Dict, List
from fastapi import APIRouter, Request, Response
from mlrun.api.crud.model_endpoints import ModelEndpoints, get_access_key
from mlrun.api.schemas import GrafanaColumn, GrafanaTable, ModelEndpointState
from mlrun.config import config
from mlrun.e... |
from torch.utils.data import Dataset, DataLoader
from generate_lidar import *
import os
import re
import json
import torch
from torchvision import transforms as T
import numpy as np
import cv2
import random
from matplotlib import pyplot
from PIL import Image
from mpl_toolkits.mplot3d import Axes3D
SHAPE_NPARTS = {
... |
# Copyright (c) OpenMMLab. All rights reserved.
import copy
import os
from tempfile import NamedTemporaryFile, TemporaryDirectory
from typing import Any
import mmcv
import numpy as np
import pytest
import torch
from torch.utils.data import DataLoader
from torch.utils.data.dataset import Dataset
import mmdeploy.backen... |
from joblib import Parallel
import threading
from typing import Any
import attr
import numpy as np
from sklearn.base import BaseEstimator, clone, RegressorMixin, ClassifierMixin
from sklearn.utils.fixes import delayed, _joblib_parallel_args
from sklearn.utils.validation import check_is_fitted, _check_sample_weight
... |
# 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 file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""See __init__.py for what is considered public here."""
import errno
import itertools
import logging
import os
import shutil
import struct
import sys
import tempfile
import xml.etree.ElementTree as etree
import zipfile
import urllib.request
def safe_open(path, overwrite=False):
"""
Open but do not overwri... |
import torch
import numpy as np
def cross_mul(a, b, c):
return (c[1] - a[1]) * (b[0] - a[0]) - (b[1] - a[1]) * (c[0] - a[0])
def triangle_area(A, B, C):
out = (C - A).flip([-1]) * (B - A)
out = out[..., 1] - out[..., 0]
return out
def xing_loss(x_list, scale=1.0): # x[ npoints,2]
loss = 0.
... |
import numpy as np
from math import exp
import torch
itop_sigmas = [0.107, 0.107,
0.079, 0.079, 0.072, 0.072, 0.062, 0.062,
0.107, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089]
class OKS:
"""Object Keypoints Similarity calculator class
This type of metrics is described in COCO, htt... |
import traceback
from flask import Flask, request
from flask_cors import CORS
from shexer.consts import NT, RDF_TYPE
from shexer.shaper import Shaper
from shexer.utils.uri import remove_corners
import json
################ CONFIG
PORT = 8080
HOST = "0.0.0.0"
MAX_LEN = 100000
################ PARAM NAMES
TARGET_CLA... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import os
import subprocess
import shlex
import time
import numpy as np
from fermipy.utils import mkdir
__all__ = [
'check_log',
'get_lsf_status',
'dispatch_job',
]
def parse_s... |
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import argparse
import time
import os
import json
def crawl(
url,
driver_path,
binary_path,
log_extraction_script,
profile_dir,
proxy_port,
strategy=None,
page_load_timeout=120,
file_write_timeo... |
# -*- coding: utf-8 -*-
# ProDy: A Python Package for Protein Dynamics Analysis
#
# Copyright (C) 2010-2012 <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 Lic... |
##########################################################################
# Copyright (c) 2009, 2010, 2011, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggstei... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..utils.generic_utils import to_cuda
from ..utils.constants import VERY_SMALL_NUMBER, INF
def compute_normalized_laplacian(adj):
rowsum = torch.sum(adj, -1)
d_inv_sqrt = torch.pow(rowsum, -0.5)
d_inv_sqrt[torch.isinf(d_in... |
import argparse
import sys
import typing
from enum import Enum, auto
import pkg_resources
import streamson
class Matcher(Enum):
SIMPLE = auto()
DEPTH = auto()
REGEX = auto()
@staticmethod
def from_name(name: str) -> "Matcher":
if name == "s" or name == "simple":
return Match... |
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## ... |
# Title: Weather Data Aggregator
# Description: Aggregates data from the weather station on Cockcroft from the OnCall API.
# Author: <NAME>
# Date: 17/12/2020
# Version: 1.0
# Import libraries
import pandas as pd
from pandas import json_normalize
import json
import requests
from datetime import datetime, timedelta
fr... |
import numpy as np
import scipy.stats as sps
import pytest
from contextlib import contextmanager
from surmise.emulation import emulator
from surmise.calibration import calibrator
import pyximport
pyximport.install(setup_args={"include_dirs":np.get_include()},
reload_support=True)
####################... |
from CheckForUpdates import updateBot
from EmbedHelper import AdminEmbed, ErrorEmbed, QueueUpdateEmbed, CaptainsRandomHelpEmbed
from Leaderboard import brokenQueue as lbBrokenQueue
from typing import List
from Types import Team
from bot import __version__
from discord import Role, Embed, Member, channel as Channel
impo... |
#!/usr/bin/env python3
__author__ = '<NAME>'
import ccxt
#import ccxt.async_support as ccxt
from datetime import datetime, timedelta
import time
import math
import argparse
import signal
import sys
import os
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlal... |
# pylint: disable=unused-variable
#
# qpecgen.avi.py
#
# Copyright (c) 2016 <NAME>
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#
from __future__ import absolute_import
from numpy import sign, array
import scipy
from qpecgen.base import QpecgenProblem
from . ... |
from __future__ import print_function
import os
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
from googleapiclient.http import MediaIoBaseDownload
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.tra... |
# Author: <NAME>
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
from sklearn.model_selection import StratifiedKFold, KFold
from pathlib import Path
import random as rd
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.metrics impor... |
import numpy as np
import random
import gym
import torch
from types import LambdaType
from scipy.linalg import block_diag
try:
import tensorflow as tf
except:
tf = None
def set_global_seeds(seed):
"""
set the seed for python random, tensorflow, numpy and gym spaces
:param seed: (int) the seed
"""
... |
'''
Functions to modify portfolio based on algorithm
'''
import sys
import pandas as pd
import numpy as np
from collections import OrderedDict
from datetime import datetime
from decimal import Decimal, ROUND_DOWN
import hashlib
import os.path
import pickle
import pytz
from yahoofinancials import YahooFinancials
from... |
def calcular_precio_producto(coste_producto):
"""
num -> num
Calcula el costo de un producto mas el 50% sobre el costo de fabrica
>>> calcular_precio_producto(1000)
1500.0
>>> calcular_precio_producto(2000)
3000.0
:param coste_producto: num que representa el costo de fabrica del prod... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
"""
File: accumulator.py
Project: analysis
Last Modified: 2021-8-2
Created Date: 2021-8-2
Copyright (c) 2021
Author: AHMA project (Univ Rennes, CNRS, Inria, IRISA)
"""
################################################################################
from list_manipulation import get_tag
from tqdm ... |
import positional
import uuid
# These arguments will be passed to a new context from the first available
# header to support backwards compatibility.
_ENVIRON_HEADERS = {
'auth_token': ['HTTP_X_AUTH_TOKEN',
'HTTP_X_STORAGE_TOKEN'],
'user': ['HTTP_X_USER_ID',
'HTTP_X_USER'],
... |
"""multi-label classification using toy dataset"""
import datetime
import isodate
import matplotlib.pyplot as plt # type: ignore
import numpy as np
import pandas as pd # type: ignore
import random
import tensorflow as tf # type: ignore
import sklearn.metrics # type: ignore
print("available tensorflow devices:", tf.con... |
# MIT License
# Copyright (c) 2018 nrajasin
# 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, publi... |
## coding: utf8
## Kaggle Challenge
## Utilisation de Python 3.5
## Chargement des bibliothèques
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import collections
import sklearn
from sklearn import linear_model
from sklearn import svm
from sklearn import learning_curve
from sklearn import ensem... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, 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... |
# ===== Inicialização =====
# ----- Importa e inicia pacotes
import pygame
import random
import time
pygame.init()
pygame.mixer.init()
# ----- Gera tela principal
WIDTH = 480
HEIGHT = 600
window = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption('Navinha')
# ----- Inicia assets
METEOR_WIDTH = 50
M... |
import random
import ssl
import websockets
import asyncio
import threading
import os
import sys
import json
import argparse
import time
from io import BytesIO
import cv2
import numpy
import sys
import mp as pn
detector = pn.Model()
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GLib... |
# Copyright 2020, 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... |
import copy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Implementation of Twin Delayed Deep Deterministic Policy Gradients (TD3)
# Paper: https://arxiv.org/abs/1802.09477
class Multiply(nn.Module):
def... |
import RPi.GPIO as GPIO
import time
import Adafruit_ADS1x15
import subprocess
from MFRC522_python.mfrc522 import SimpleMFRC522
import datetime
import requests
from pprint import pprint
import sys
import time
import json
import jwt
import paho.mqtt.client as mqtt
import random
import cv2
#GPIO.setwarnings(False) #Ignor... |
#!/usr/bin/python3.9
import datetime
import json
import logging
import os
import traceback
from pathlib import Path
import click
import click_log
import requests
from beautifultable import BeautifulTable
from elasticsearch import Elasticsearch, helpers
import europarl.jobs.crawler as ep_crawler
import europarl.jobs.... |
import dataclasses
import json
import os
import socket
import urllib.parse
from abc import abstractmethod, ABC
from collections import defaultdict
from typing import Dict
from typing import List, Optional
import bs4
import requests
import urllib3
import uvicorn
from bs4 import Tag
# noinspection PyPackageRequirements
... |
# MAIN REPO https://github.com/Annihilator708/PyNX_Terminal
import imgui
import imguihelper
import os
import _nx
import sys
from io import StringIO
import contextlib
import logging
from .screen import Screen
from .keyboard import Keyboard
from .python import Python
from .menu import Settings
from .utils import Utils
... |
# Copyright 2022 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law... |
##!/usr/bin/python
#
# ============================================================================
#
# 30.11.17 <-- Date of Last Modification.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ----------------------------------------------------------------------------
#
# MERGED MTZ DATA IMPORT FUNCTIONS
#
#... |
import cv2
from cv2 import Sobel, cv2, resize # make vscode not complain
from matplotlib import pyplot as plt
import math
from math import sin, cos, pi
import numpy as np
import copy
import random
PI = 3.1415926
def arctan_2pi(x,y): # return 0 ~ 2pi arctan of vector (x,y)
return np.arctan2(y,x) if y > 0 else np.a... |
#import collections
from warcio.statusandheaders import StatusAndHeaders
from warcio.statusandheaders import StatusAndHeadersParser
from warcio.statusandheaders import StatusAndHeadersParserException
from warcio.limitreader import LimitReader
from warcio.utils import to_native_str
from warcio.bufferedreaders import ... |
import logging
from asyncio import Future
from typing import Callable, Coroutine, Union, Generator, Optional, TypeVar, Any, List
import telethon
from telethon import events, Button
from telethon.errors import UserNotParticipantError
from telethon.tl.custom import message
from telethon.tl.custom.participantpermissions ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 3 10:33:41 2020
@author: <NAME>
"""
# =============================================================================
# Import Libraries
# =============================================================================
import numpy as np
from numba import jit
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import asyncio
import argparse
import itertools
import heuristics
import transposition_table
from base_board import Player
from collections import Counter
from heuristics import WeightedHeuristic
from board import SmallBoard, LargeBoard
from agent import HumanAgent, Auton... |
#!/usr/bin/env python3
# coding: utf-8
"""
_ _ _
| | __ _ _ __ __ _ ___ ___ _ __ (_) _ __ | |_
| | / _` || '__| / _` |/ __| / __|| '__|| || '_ \ | __|
| |___ | (_| || | | (_| |\__ \| (__ | | | || |_) || |_
|_____| \__,_||_| \__,_||___/ \___||_|... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# Copyright 2019 Zuru Tech HK Limited. 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 la... |
import os
import shutil
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import numpy as np
from tqdm import tqdm
from arguments import get_args
from augmentations import get_aug
from models import get_model
from tools import AverageMeter, knn_monitor, Logger, file_exist_check, get_... |
#!/usr/bin/python
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2017
# ---------------------------------------------------------------------------
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.