source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
train copy.py | # Copyright (c) 2021, Xu Chen, FUNLab, Xiamen University
# All rights reserved.
import os
import torch
import numpy as np
import random
from pathlib import Path
from pprint import pprint
from torch.utils.tensorboard import SummaryWriter
import torch.multiprocessing as mp
from multiprocessing import Queue
from multipro... |
test_numpy.py | from __future__ import division, absolute_import, print_function
import queue
import threading
import multiprocessing
import numpy as np
import pytest
from numpy.random import random
from numpy.testing import (
assert_array_almost_equal, assert_array_equal, assert_allclose
)
from pytest import raises a... |
1.Learning_rate_finder.py | import neptune.new as neptune
import os
import torch.nn as nn
import torch
import torch.nn.functional as F
from torch.optim import SGD, Adam
from torch.utils.data import DataLoader, random_split
from torch.optim.lr_scheduler import CyclicLR, LambdaLR
import torch.multiprocessing as mp
import numpy as np
import random
i... |
cruceDelRio.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import threading
import time
import random
umbral_balsa = 4
serfs = 0
hackers = 0
sem_balsa = threading.Semaphore(4)
mutex_hackers = threading.Semaphore(1)
barrera_hackers = threading.Semaphore(0)
mutex_serfs = threading.Semaphore(1)
def serf(yo):
global serfs
while ... |
interface.py | #
# -*- coding: utf-8 -*-
"""Backend Sender - Send to internal process
Manage backend sender.
"""
import json
import logging
import threading
import uuid
import six
from six.moves import queue
import wandb
from wandb import data_types
from wandb.proto import wandb_internal_pb2 as pb
from wandb.proto import wandb_te... |
base.py | # Copyright 2018 Alibaba Cloud 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 appli... |
sudoku_triadoku_multicore.py | import math
import copy
import multiprocessing
import argparse
import sys
input = [[0,0,6, 0,0,0, 0,0,0], [0,0,0, 0,0,0, 0,4,0], [1,0,9, 0,0,0, 0,0,0], [0,8,0, 0,0,0, 0,3,0], [0,0,2, 5,0,1, 4,0,0], [3,4,0, 8,0,7, 0,0,0], [0,0,0, 0,6,0, 0,0,7], [0,3,0, 0,5,0, 0,0,1], [4,0,0, 0,0,1, 0,0,9]]
#nput = [[4, 8, 6, 5, 2, 3, ... |
async_quart.py | import os
import sys
import time
import asyncio
import threading
from quart import Quart
# This is just here for the sake of examples testing
# to make sure that the imports work
# (you don't actually need it in your code)
sys.path.insert(1, ".")
import quart.flask_patch
from flask_discord_interactions import (Disco... |
javascript.py | """
domonic.javascript
====================================
- https://www.w3schools.com/jsref/jsref_reference.asp
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
"""
import array
import datetime
import gc
import json
import math
import multiprocessing
import os
import random
import... |
Loopimer.py | import threading
import time
import datetime as dt
from threading import Semaphore,Timer
import queue
import math
import sys
import os
class loopi:
def __init__(self,**kwargs):
self.__kwargs=kwargs
def _nslice(s, n, truncate=False, reverse=False):
"""Splits s into n-sized chun... |
crawlin.py | from threading import Thread
import requests
from requests.auth import HTTPBasicAuth
import time
import re
def craw(crawlin):
global result
global count
print('crawlin on {} \n'.format(crawlin), end ='' )
res = browser.get(crawlin)
ret = re.findall('<a rel="nofollow" target="_blank" href=".*</a>', ... |
main.py | # This solution is somewhat close to one presented on the book,
# but pusher and smoker responsibilities are united in single worker.
from threading import Semaphore, Lock, Thread
io = Lock()
agent = Semaphore(1)
tobacco = Semaphore(0)
paper = Semaphore(0)
match = Semaphore(0)
def agent_a():
whil... |
httpd.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function
import datetime
import glob
import gzip
import hashlib
import io
import json
import mimetypes
import os
import re
import... |
Multi_Thread.py | # 线程是操作系统直接支持的执行单元
# Python的线程是真正的Posix Thread, 不是虚拟出来的线程
# Python的标准库提供了两个模块: _thread和threading,
# _thread是低级模块, threading是高级模块, 对_thread进行了封装
# 启动一个线程就是把一个函数传入并创建Thread实例, 然后调用start()开始执行
import time, threading
# 新线程执行的代码
def loop():
print('thread %s is running...' % threading.current_thread().name)
n = 0
while ... |
dataset_test.py | # Lint as: python3
# Copyright 2019 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
InventoryBuilder.py | from flask import Flask
from gevent.pywsgi import WSGIServer
from threading import Thread
from resources.Resourceskinds import NSXTMgmtPlane
from tools.Vrops import Vrops
import time
import json
import os
import logging
logger = logging.getLogger('vrops-exporter')
class InventoryBuilder:
def __init__(self, atlas... |
__init__.py | import logging
import collections
from queue import Queue, Empty
from threading import Thread, Event
from google.cloud import logging as glogging
class GCloudBatchedLogHandler(logging.Handler):
"""
A batched log handler that sends the log output to Google Cloud Logging service using
the Google clou... |
subproc_vec_env.py | from multiprocessing import Process, Pipe
import numpy as np
from gym import spaces
from mrl.utils.vec_env import VecEnv, CloudpickleWrapper
def _worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.var()
while True:
try:
cmd, data = remote.recv()... |
on_error_test.py | #!/usr/bin/env vpython3
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import atexit
import cgi
import getpass
import json
import logging
import os
import platform
import re
import socket
impor... |
Binance Detect Moonings.py | """
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed as, a recommendation
or as a guarantee... |
batch_loader.py | import asyncio
from logging import getLogger
from threading import Thread
from time import time
from typing import Any, Callable, Dict, Iterable
from kivy.clock import mainthread, Clock
from kivy.event import EventDispatcher
from kivy.uix.widget import Widget
from tesseractXplore.app import get_app
from tesseractXplo... |
extract_lip.py | import os
import cv2
import glob
import time
import numpy as np
from multiprocessing import Pool, Process, Queue
def get_position(size, padding=0.25):
x = [0.000213256, 0.0752622, 0.18113, 0.29077, 0.393397, 0.586856, 0.689483, 0.799124,
0.904991, 0.98004, 0.490127, 0.490127, 0.490127, 0.490127... |
pytest_log_handler.py | # -*- coding: utf-8 -*-
"""
pytestsalt.salt.log_handlers.pytest_log_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Salt External Logging Handler
"""
import atexit
import copy
import logging
import os
import pprint
import socket
import sys
import threading
import traceback
import salt.utils.msgpack
import sal... |
test_index.py | import logging
import time
import pdb
import copy
import threading
from multiprocessing import Pool, Process
import numpy
import pytest
import sklearn.preprocessing
from utils import *
from constants import *
uid = "test_index"
BUILD_TIMEOUT = 300
field_name = default_float_vec_field_name
binary_field_name = default_b... |
make_multiple_calls.py | import uuid
from ondewo.vtsi.client import VtsiClient
from ondewo.vtsi.voip_pb2 import StartCallInstanceResponse, StartMultipleCallInstancesResponse
# SIP
SIP_SIM_VERSION: str = "latest"
# VTSI_SERVER
# For testing purposes 0.0.0.0 can be used
VTSI_HOST: str = "grpc-vtsi.ondewo.com"
VTSI_PORT: int = 443
# ... |
badblood.py | from __future__ import division
from http.server import HTTPServer, BaseHTTPRequestHandler
from multiprocessing import Pool
from functools import partial
from itertools import repeat
from threading import Thread
import argparse
import socket
import time
import ssl
import sys
import os
def do_banner():
print("")
... |
output_devices.py | from __future__ import (
unicode_literals,
print_function,
absolute_import,
division,
)
from threading import Lock
from itertools import repeat, cycle, chain
from colorzero import Color, Red, Green, Blue
from collections import OrderedDict
from .exc import OutputDeviceBadValue, GPIOPinMissing
from .de... |
GD2.py | import math
import threading
from enum import Enum
from Touch_Detector import Touch_Detector
from datetime import datetime
import cv2
class Gestures(Enum):
NO_GESTURE=0
THREE_PRESS_HOLD=1 # back to previous board
FOUR_PRESS_HOLD=2 # reset to 4*4
SWIPE_UP=3
SWIPE_DOWN=4
SWIPE... |
RandomReplay.py | #!/bin/env python3
'''
'''
# 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 ... |
multi_gym_example.py | #!/usr/bin/env python3
import gym
import numpy as np
import ffai
from multiprocessing import Process, Pipe
from ffai.ai.renderer import Renderer
def worker(remote, parent_remote, env):
parent_remote.close()
# Get observations space (layer, height, width)
obs_space = env.observation_space
# Get acti... |
events.py | # Copyright 2022 iiPython
# Modules
import os
import time
import tempfile
from copy import copy
from typing import Tuple
from threading import Thread
from datetime import datetime
from types import FunctionType
from iipython import keys, readchar, clear, color, Socket
from .config import config
from .themes import Th... |
enjoy_tmax.py | import random
import sys
import time
from collections import deque
from threading import Thread
import cv2
import numpy as np
from pynput.keyboard import Key, Listener, KeyCode
from algorithms.utils.algo_utils import main_observation, goal_observation, EPS
from algorithms.utils.env_wrappers import reset_with_info
fro... |
__init__.py | import sys
import types
import warnings
from threading import Thread
from functools import wraps
import stackprinter.formatting as fmt
from stackprinter.tracing import TracePrinter, trace
def _guess_thing(f):
""" default to the current exception or current stack frame"""
# the only reason this happens up he... |
settings_20210906111205.py | """
Django settings for First_Wish project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathli... |
multiprocessing_env.py | #This code is from openai baseline
#https://github.com/openai/baselines/tree/master/baselines/common/vec_env
import numpy as np
from multiprocessing import Process, Pipe
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
while True:
cmd, data = remote... |
p2p_stress.py | import testUtils
import p2p_test_peers
import random
import time
import copy
import threading
from core_symbol import CORE_SYMBOL
class StressNetwork:
speeds=[1,5,10,30,60,100,500]
sec=10
maxthreads=100
trList=[]
def maxIndex(self):
return len(self.speeds)
def randAcctName(self):
... |
test_concurrent_futures.py | from test import support
# Skip tests if _multiprocessing wasn't built.
support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
support.import_module('multiprocessing.synchronize')
from test.support.script_helper import assert_python_ok
import contextlib
import itertools
import l... |
GridSearch.py | import itertools
import logging
import os
import threading
import time
import boto3
import math
import graph
from utils import *
import automate
import configuration
import parameter_server
logging.basicConfig(filename="cirrusbundle.log", level=logging.WARNING)
class GridSearch(object):
# All searches that are c... |
minecraft_server.py | import os
import re
import json
import time
import psutil
import schedule
import datetime
import threading
import logging.config
import pexpect
from pexpect.popen_spawn import PopenSpawn
from app.classes.mc_ping import ping
from app.classes.console import console
from app.classes.models import History, Remote, MC_se... |
usercog.py | import io
import logging
from datetime import datetime, timedelta
from threading import Thread
import discord
import jikanpy
import timeago
from discord.ext import tasks, commands
from jikanpy import Jikan
from tqdm import tqdm
from naotomori.util import jikanCall
logger = logging.getLogger('NaoTomori')
class User... |
chat_server.py | #!/usr/bin/env python3
"""Script Python : Server multithread per Chatgame - Nave pirata.
Corso di Programmazione di Reti - Università di Bologna"""
import sys
import random as rnd
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
from time import sleep
from collections import defaul... |
webserver.py | # -- Importing Packages -- #
from flask import Flask
from threading import Thread
from logging import getLogger, ERROR
# -- Disables Flask App Logging -- #
log = getLogger('werkzeug')
log.setLevel(ERROR)
# - Webserver Setup -- #
app = Flask('')
@app.route('/')
def home():
return '<h1> Hosting Active ... |
test_greenlet.py | import gc
import sys
import time
import threading
import unittest
from abc import ABCMeta, abstractmethod
from greenlet import greenlet
class SomeError(Exception):
pass
def fmain(seen):
try:
greenlet.getcurrent().parent.switch()
except:
seen.append(sys.exc_info()[0])
raise
r... |
webgui01.py | try:
import BaseHTTPServer
except ImportError:
import http.server as BaseHTTPServer
import time
import cgi
import threading
import traceback
from pymol import cmd
_server = None
def _shutdown(self_cmd=cmd):
if _server != None:
_server.socket.close()
self_cmd.quit()
# Note, this handler assum... |
server.py | # -*- coding: utf-8 -*-
import logging
import socket
import sys
from threading import Thread
import logconfig
from lisp import LispReader
from protocol import SwankProtocol
from repl import repl
import ulisp
try:
import SocketServer as socketserver
except ImportError:
# Python 3 support
import socketserve... |
build_mscoco_data.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
gui.py | import curses
from curses import textpad
import os
import threading
import traceback
import time
import client
import curses_util
class GUI():
def __init__(self, stdscr):
global client_obj
self.client_obj = client_obj
self.username = 'G'
self.password = 'password'
self.y = 10
self.ms... |
cluster.py | # Standard
import ast
import importlib
import signal
import socket
import traceback
import uuid
from multiprocessing import Event, Process, Value, current_process
from time import sleep
# External
import arrow
# Django
from django import db
from django.conf import settings
from django.utils import timezone
from djang... |
PinnedComputationLayer.py | import multiprocessing
import threading
import time
from math import pow
from PiCN.Processes import LayerProcess
from PiCN.Packets import Name, Interest, Content, Nack, NackReason
class PinnedComputationLayer(LayerProcess):
def __init__(self, replica_id, log_level=255):
super().__init__(logger... |
app.py | from os import makedirs, path as osPath
from numpy import loadtxt, savetxt
import threading
from .given import given
from .sudoku import Sudoku
from .settings import DIGIT_NUMBER, GOAL, OpenButtonOption, RenderOption, SolveButtonOption, WriteButtonOption
from .ui import Ui
class App:
def __init__(self):
s... |
test2.py | import utility
import threading
import time
threading.Thread(target=utility.startTimer).start()
time.sleep(2)
print utility.getTime()
time.sleep(1)
print utility.getTime()
utility.startTimer()
time.sleep(1)
print utility.getTime()
time.sleep(1)
print utility.getTime() |
views_dashboard.py | from django.shortcuts import render
from django.http import HttpResponseRedirect, JsonResponse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from speakInOut.helper import parse_session, authentication_check, register_user
from .forms import LoginForm, AccountReg... |
import_logs.py | #!/usr/bin/python
# vim: et sw=4 ts=4:
# -*- coding: utf-8 -*-
#
# Piwik - free/libre analytics platform
#
# @link http://piwik.org
# @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
# @version $Id$
#
# For more info see: http://piwik.org/log-analytics/ and http://piwik.org/docs/log-analytics-tool-how-... |
main.py | '''
__author__ = "Rodrigo Sobral"
__copyright__ = "Copyright 2021, Rodrigo Sobral"
__credits__ = ["Rodrigo Sobral"]
__license__ = "MIT"
__version__ = "1.0.1"
__maintainer__ = "Rodrigo Sobral"
__email__ = "rodrigosobral@sapo.pt"
__status__ = "Beta"
'''
import discord, datetime
from doten... |
test_subprocess.py | import unittest
from test import script_helper
from test import support
import subprocess
import sys
import signal
import io
import locale
import os
import errno
import tempfile
import time
import re
import selectors
import sysconfig
import warnings
import select
import shutil
import gc
import textwrap
try:
import... |
test_stim_client_server.py | import threading
import time
import pytest
from mne.realtime import StimServer, StimClient
from mne.externals.six.moves import queue
from mne.utils import requires_good_network, run_tests_if_main
_server = None
_have_put_in_trigger = False
_max_wait = 10.
@requires_good_network
def test_connection():
"""Test T... |
test_fx.py | # Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
from math import sqrt
from torch.multiprocessin... |
test_api.py | import jsonapi_requests, logging, requests, unittest, time
from jsonapi_requests.orm import OrmApi, AttributeField, RelationField, ApiModel
from threading import Thread
import sys
sys.path.append('..')
class Api(OrmApi):
def disco(self, obj_name, obj_type = None, attributes = [], relations = [] ):
... |
main.py | import os
import sys
from . import __version__
from .root import (
root,
config,
change_siz,
tails,
)
from .menu import bind_menu
from .tab import (
nb,
nb_names,
bind_frame,
delete_curr_tab,
cancel_delete,
create_new_reqtab,
create_new_rsptab,
create_helper,
change... |
demon1.py | import threading
import time
def run():
time.sleep(2)
print('当前线程的名字是: ', threading.current_thread().name)
time.sleep(2)
if __name__ == '__main__':
start_time = time.time()
print('这是主线程:', threading.current_thread().name)
thread_list = []
for i in range(5):
t = threading.Thread... |
thread_local.py | """ thread local demo """
import threading
import time
my_data = threading.local()
def do_it2() -> None:
""" do it 2 """
print("doIt2: thread id: " + str(threading.get_ident()) + ", my data: " + my_data.x)
def do_it() -> None:
""" do it """
time.sleep(1)
my_data.x = "x: " + threading.current_... |
master.py | import sys
import json
import socket
import time
import random
import numpy as np
import requests
import threading
import copy
def initConfig():
with open(sys.argv[1]) as f:
conf = json.load(f)
# structure: [ [id, slot, port], [id, slot, port],... ]
config = []
for k, v in conf.items():
for worker in v:
l ... |
email.py | # -*- coding:utf-8 -*-
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_... |
learner.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
" The code for the learner in the actor-learner mode in the IMPALA architecture"
# modified from AlphaStar pseudo-code
import os
import traceback
from time import time, sleep, strftime, localtime
import threading
import itertools
import torch
from torch.optim import Adam... |
_threadedselect.py | # -*- test-case-name: twisted.test.test_internet -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Threaded select reactor
The threadedselectreactor is a specialized reactor for integrating with
arbitrary foreign event loop, such as those you find in GUI toolkits.
There are three things... |
test.py | from flask import Flask, request
import requests
from threading import Thread
import time, pickle
def start_server():
app = Flask(__name__)
@app.route('/test', methods=['POST'])
def test():
print(pickle.loads(request.get_data()))
return "", 200
app.run(host='0.0.0.0', port=3000)
try:... |
test_schedule_planner.py | import logging
import time
from threading import Thread
from unittest import TestCase
from unittest.mock import MagicMock
import schedule
import databay
from databay import Link
from databay.errors import MissingLinkError
from databay.planners import SchedulePlanner
from databay.planners.schedule_planner import Sched... |
example_binance_us.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_us.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html
# Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://unicor... |
Program.py | from PyQt4.QtCore import * # Qt core
from PyQt4.QtGui import * # Qt GUI interface
from PyQt4.uic import * # ui files realizer
from PyQt4 import QtGui, uic
from operator import methodcaller
import threading
import time
#
# simple machine for running a mash program
#
# the machine consumes a text file with commands
#... |
BuildReport.py | ## @file
# Routines for generating build report.
#
# This module contains the functionality to generate build report after
# build all target completes successfully.
#
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made a... |
predictBlock.py | # TODO(developer): Uncomment and set the following variables
from multiprocessing import Process
import os
import CloudServiceConfig as config
from google.cloud import automl_v1beta1 as automl
from google.cloud import vision
import Blocks
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = config.conf['service_API_Path']
p... |
explanation_dashboard.py | from flask import Flask, request
from flask_cors import CORS
from jinja2 import Environment, PackageLoader
from IPython.display import display, HTML
from interpret.utils.environment import EnvironmentDetector, is_cloud_env
import threading
import socket
import requests
import re
import os
import json
import atexit
from... |
zssdk.py | import re
import sys
try:
import urllib3
except ImportError:
print 'urlib3 is not installed, run "pip install urlib3"'
sys.exit(1)
import string
import json
from uuid import uuid4
import time
import threading
import functools
import traceback
import base64
import hmac
import sha
from hashlib import sha1
i... |
test.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import coco80_to_coco91_class, check_dataset, check... |
main.py | import threading
from queue import Queue
from spider import Spider
from domain import *
from general import *
ALL_OF_MY_CATEGORYS = read_file('category.txt')
i = read_file('category.txt')[0]
PROJECT_NAME = ALL_OF_MY_CATEGORYS[0].split('\n')[0]
DOMAIN_NAME = get_domain_name('https://builtwith.com')
QUEUE_FILE = PROJECT... |
common.py | #! /usr/bin/env python3
"""
Main commonTarget class + misc common functions
"""
from besspin.base.utils.misc import *
import os, sys, glob
import pexpect, subprocess, threading
import time, random, secrets, crypt
import string, re
import socket, errno, pty, termios, psutil
from collections import Iterable
from bess... |
utils.py | """
Author: Norio Kosaka
==== joystick input ====
x = self.JoystickX
y = self.JoystickY
forward = self.A
jump = self.RightBumper
use_item = self.C_left
==== Joystick output vector ====
[x, y, forward, jump, use_item]
"""
from PIL import ImageTk, Image
from inputs import get_gamepad
from skimage.t... |
test_host_connection_pool.py | # Copyright DataStax, 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, softwa... |
__init__.py | import enum
import logging
import threading
import time
from platypush.message.response import Response
from platypush.plugins import Plugin
from platypush.context import get_plugin
from platypush.config import Config
class Direction(enum.Enum):
DIR_UP = 'up'
DIR_DOWN = 'down'
DIR_LEFT = 'left'
DIR_R... |
main.py | import multiprocessing
from db import DbBridge
from comunications import SocketServer, WebsocketServer
if __name__ == "__main__":
db = DbBridge()
db.initDB()
connectionsClients = {}
socket = SocketServer(connectionsClients)
websocket = WebsocketServer(connectionsClients)
try:
# creatin... |
configurationManager.py | # -------------------------------------------------------------------------------
# Copyright 2006-2021 UT-Battelle, LLC. See LICENSE for more information.
# -------------------------------------------------------------------------------
import os
import sys
import importlib
import importlib.util
import tempfile
import... |
_threading_local.py | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-... |
spec_utils.py | import os
import librosa
import numpy as np
import soundfile as sf
import math
import json
import hashlib
import threading
from tqdm import tqdm
def crop_center(h1, h2):
h1_shape = h1.size()
h2_shape = h2.size()
if h1_shape[3] == h2_shape[3]:
return h1
elif h1_shape[3] < h2... |
brutus.py | # Plutus Bitcoin Brute Forcer
# Made by Isaac Delly - change for single adress Bruteforce by Christian Hummel
# https://github.com/Isaacdelly/Plutus - https://github.com/diehummel/Brutus-with-fastecdsa
# Added fastecdsa - June 2019 - Ian McMurray
import os
import pickle
import hashlib
import binascii
import multiproce... |
experiment_mqtt.py | __package__ = "modelconductor"
import threading
import sys
import logging
import yaml
import os
import asyncio
import concurrent.futures
import json
import time
from datetime import datetime as dt
from hbmqtt.broker import Broker
from hbmqtt.client import MQTTClient, ConnectException
from hbmqtt.errors import MQTTExce... |
subproc.py | import gym
import time
import ctypes
import numpy as np
from collections import OrderedDict
from multiprocessing.context import Process
from multiprocessing import Array, Pipe, connection
from typing import Callable, Any, List, Tuple, Optional
from tianshou.env.worker import EnvWorker
from tianshou.env.utils import Cl... |
build.py | #!/usr/bin/env python
# Copyright 2020 The Defold Foundation
# Licensed under the Defold License version 1.0 (the "License"); you may not use
# this file except in compliance with the License.
#
# You may obtain a copy of the License, together with FAQs at
# https://www.defold.com/license
#
# Unless required by applica... |
noise_restored.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Wu Yi-Chiao (Nagoya University)
# based on a WaveNet script by Tomoki Hayashi (Nagoya University)
# (https://github.com/kan-bayashi/PytorchWaveNetVocoder)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from __future__ import division
import ... |
__init__.py | """Package entroq provides a client library for working with EntroQ.
"""
import base64
import json
import threading
import time
import uuid
import grpc
from google.protobuf import json_format
from grpc_health.v1 import health_pb2
from grpc_health.v1 import health_pb2_grpc
from grpc_status import rpc_status
from . i... |
auto.py | from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import object
import os
import queue
import threading
import time
import zlib
from androguard.core import androconf
from androguard.core.bytecodes import apk, dvm
from androguard.core.analysis import analys... |
chromecast.py | import json
import logging
from random import randint
from select import select
from struct import pack, unpack, unpack_from
import socket
import ssl
from threading import Thread, Event
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty
CONNECTION_NS = "urn:x-cast:com.goog... |
test_concurrent_futures.py | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
from test.support.script_helper import assert_python_ok
import contextlib
import itertools
imp... |
utils.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-11-06 11:50:13
import math
import logging
import hashlib
import datetime
import socket
import base64
import warnings
import threading
from lxml.html i... |
web.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
MinecraftSkinDownloader_ttkthemes.py | '''
作品名:MinecraftSkinDownloader
Github仓库地址:https://github.com/NewbieXvwu/MinecraftSkinDownloader
Gitee仓库地址:https://gitee.com/NewbieXvwu/MinecraftSkinDownloader
关于本程序:这是一个可以简单地下载任何Minecraft正版玩家的皮肤的软件,使用Python编写,由NewbieXvwu维护。
作者:NewbieXvwu
'''
version_int=2.4#程序主版本号
ispreview=False#程序是否是预览版
previewversion="0"#预览版本号(不自动更... |
ircthread.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# 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, m... |
file_server.py | import sys
sys.path.insert(0, "../md_server")
import grpc
import file_server_pb2 as fs
import file_server_pb2_grpc as fs_grpc
import md_server_pb2 as ms
import md_server_pb2_grpc as ms_grpc
import ms_conf
from concurrent import futures
import time
import threading
import os
import os.path as ospath
# send heartbeat... |
data_utils.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
util.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Various low-level utilities.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime
import json
import math
import os
import re
import select
import si... |
RandomSearch.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 10/03/2018
@author: Maurizio Ferrari Dacrema
"""
from ParameterTuning.AbstractClassSearch import AbstractClassSearch, DictionaryKeys, writeLog
from functools import partial
import traceback, pickle
import os, gc, math
import multiprocessing
from multiproc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.