source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
t3_2.py | #!/usr/bin/env python
from PyQt5 import QtCore, QtGui, QtWidgets
import threading
import rospy
from geometry_msgs.msg import Point, Twist
from nav_msgs.msg import Odometry
import math
from tf.transformations import euler_from_quaternion
# Defining Global Variables
# For selected button and linear, angular speed cha... |
server.py | # @license
# Copyright 2017 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... |
cgi_server.py | from sys import stderr, version_info
from multiprocessing import Process, current_process
# Decide imports based on Python version
if version_info[0] < 3:
from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from CGIHTTPServer import CGIHTTPRequestHandler
el... |
sidecar_evaluator_test.py | # Lint as: python3
# Copyright 2020 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 ... |
integration.py | try:
import SimpleHTTPServer as http
except ImportError:
import http.server as http
try:
import SocketServer as socketserver
except ImportError:
import socketserver
import contextlib
import os
import sys
import threading
import tempfile
from os.path import join, dirname, exists
import cmsis_pack_manage... |
control_demo.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 19:02:13 2019
@author: evertoncolling
@email: evertoncolling@gmail.com
@licence: MIT
"""
from __future__ import print_function, division
from ipywidgets import widgets as wi
from IPython.display import display
import threading
import time
import... |
vc.py | # -*- coding: utf-8 -*-
"""Prompt formatter for simple version control branches"""
# pylint:disable=no-member, invalid-name
import os
import sys
import queue
import builtins
import threading
import subprocess
import re
import pathlib
import xonsh.tools as xt
from xonsh.lazyasd import LazyObject
RE_REMOVE_ANSI = Lazy... |
temp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from multiprocessing import Process
print("""
This example shows you a feature of the Dot HAT.
You should see the Temperature of your Raspberry Pi!
Press CTRL+C ... |
maverick.py | #!/usr/bin/env python3
# coding=utf-8
import argparse
import queue
import threading
import time
import jsonwriter
import pigpio
import protocol
import pinchangehandler
parser = argparse.ArgumentParser(description='Receives Wireless BBQ Thermometer Telegrams via RF-Receiver')
parser.add_argument('--pin', default=18, ... |
lisp-itr.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
synchronization_core.py | # -*- coding: utf-8 -*-
# Synchronization core module for Storj GUI Client #
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
import threading, csv
HANDLE_ON_MOVE_EVENT = True
HANDLE_ON_DELETE_EVENT = True
SYNC_DIRECTORIES_FILE = "storj_sync_dirs.csv"
class ... |
fit_rotation_curves_feathered.py |
'''
Create moment maps compatible with DiskFit, run DiskFit, and create useful
outputs.
'''
from astropy.io import fits
import numpy as np
import os
from threading import Thread
from galaxies import Galaxy
from cube_analysis.rotation_curves import run_diskfit
from paths import (fourteenB_wGBT_HI_file_dict, fourteen... |
test_poll.py | # Test case for the os.poll() function
import os
import subprocess
import random
import select
import threading
import time
import unittest
from test.support import TESTFN, run_unittest, reap_threads, cpython_only
try:
select.poll
except AttributeError:
raise unittest.SkipTest("select.poll not defined")
def... |
test_state.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import threading
import time
# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.helpers import flaky
from tests.support.paths import TMP
# Im... |
base_crash_reporter.py | # Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish... |
car.py | import threading
import time
from robustness import airsim
from .tools.car_controller import CarController
from .sim_object import SimObject
from .detection_modules import DetectionSystem
class Car(SimObject):
def __init__(self, name='car', detection_model=None, enable_api_control=True):
super().__init__(... |
IgnaleoG.py | #coding:utf-8
#使用gevent使requests异步化
import asyncio,gevent
from gevent import monkey
monkey.patch_all()
import functools,os,time,gc,random,re
repattern=re.compile('voting_token" value="(.*?)"')
waiting_time_pattern = re.compile('''<input id="voting_form_submit" type="submit" value="(.*?)" disabled="">''')
po... |
app.py | from flask import Flask, request, render_template, redirect, url_for
from dwImages import getMerakiImage, loopVerification
import threading, os, time
from os import path
app = Flask(__name__)
statuspath = os.path.abspath(os.getcwd()) + "/mask-detection/status/"
@app.route('/', methods=['GET', 'POST'])
def imagesAPI()... |
importer.py | # # ===============================================================================
# # Copyright 2012 Jake Ross
# #
# # 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.a... |
update_from_github.py |
import os
import sys
import urllib2
import time
import subprocess
import threading
import re
import zipfile
import shutil
import stat
import ssl
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath( os.path.join(current_path, os.pardir))
top_path = os.path.abspath(os.path.join(root_pa... |
sniffkin3.py | from wifipumpkin3.core.config.globalimport import *
from wifipumpkin3.core.common.uimodel import *
from threading import Thread
import queue
from scapy.all import *
import wifipumpkin3.core.utility.constants as C
from wifipumpkin3.core.utility.collection import SettingsINI
from wifipumpkin3.plugins.sniffkin3 import *
f... |
packetQueue.py | import time,threading
from queue import Queue
from mirage.libs.utils import exitMirage
class StoppableThread(threading.Thread):
'''
This class is just a simplistic implementation of a stoppable thread.
The target parameter allows to provide a specific function to run continuously in background.
If the stop method ... |
__init__.py | import logging
from queue import Empty, Full, Queue
from threading import Lock, Thread
from typing import Iterable
from .utils import in_scope, get_links_in_script, normalize_url, get_page, extract_pure_url
import requests
class Crawler:
def __init__(self, base_urls: Iterable[str], scope, on_url_found=None, **... |
04_dynamic_web_server.py | # coding:utf-8
import socket
import re
import sys
from multiprocessing import Process
# 设置静态文件根目录
HTML_ROOT_DIR = "./html"
WSGI_PYTHON_DIR = "./wsgipython"
class HTTPServer(object):
""""""
def __init__(self):
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.serve... |
qsub.py | #!/bin/env/python
#-*- encoding: utf-8 -*-
"""
"""
from __future__ import print_function
from __future__ import division
import numpy as np
import subprocess
import threading
import random
import pickle
import shutil
import time
import sys
import os
import re
import cloudpickle
# import clusterweb.cloudpickle as clo... |
hsw.py | from ..utils import is_main_process
import os
import random
import socketio
import subprocess
import threading
import time
if is_main_process():
from flask import Flask
from flask_socketio import SocketIO
app = Flask(__name__)
sio_server = SocketIO(app)
@sio_server.on("request")
def reque... |
__init__.py | # coding=utf-8
from __future__ import absolute_import
import io
import logging
import os
import socket
import subprocess
import threading
import time
from base64 import b64decode
from datetime import timedelta, datetime
from io import BytesIO
from threading import Thread, Event
from typing import Tuple, Optional
impo... |
Python.py | from __future__ import print_function
import myo
import serial
import time
import numpy as np
from collections import deque
from threading import Lock, Thread
channel1=5 #Channel for in
channel2=1 #Channel for out
channel1multiplier=1.2 #strength multiplier for 1st channel
minimumemg=4 #Threshold for acti... |
csv_record.py | #!/usr/bin/env python
import csv
import time
import schedule
from threading import Thread, Lock
from pyModbusTCP.client import ModbusClient
# set global
regs = [None] * 5
clone_regs = []
cycle_count = 0
good_count = 0
error_count = 0
regs_lock = Lock()
# modbus polling thread
def polling_thd():
global regs, cycl... |
main.py | import os
import time
from tkinter import *
import tkinter.font as tkFont
from tkinter.messagebox import showerror, showinfo
import speech_recognition as sr
from threading import Thread
from queue import Queue, Empty
import logging
from speech2dartcounter.listener import Listener
from speech2dartcounter.recognizer impo... |
utils.py | import threading
import contextlib
from flask import request, url_for
import requests
@contextlib.contextmanager
def serve_app(app, port, https=False):
opts = {'ssl_context': 'adhoc'} if https else {}
app.config['PREFERRED_URL_SCHEME'] = 'https' if https else 'http'
app.config['SERVER_NAME'] = 'localhos... |
utils.py | # Copyright (c) 2019 Uber 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 or agreed... |
main.py | import threading as thr
import huion.daemon.daemon as daemon
import huion.events.buttons as buttons
import huion.events.touchstrip as touchstrip
import huion.gui.gui as gui
class Main:
def __init__(self):
self.gui = gui.Gui()
self.buttons = buttons.Buttons(self.gui)
self.touchstrip = touchstrip.Touchstr... |
train.py | import gfootball.env as football_env
import time, pprint, json, os, importlib, shutil
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Categorical
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
... |
Downloader.py | # -*- coding: utf-8 -*-
__author__ = 'Mayank Gupta'
__version__ = '1.1'
__license__ = 'License :: MIT License'
from typing import Union, Callable
from typing import List, Tuple
from typing import Dict, Type
from typing import Any, Optional
import socket,select,re,ssl,threading,sys,os
from urllib.parse impo... |
swivel.py | #!/usr/bin/env python3
#
# Copyright 2016 Google Inc. All Rights Reserved.
# Copyright 2017 Sourced Technologies S. L.
#
# 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.apach... |
main.py | from collections import deque
from datetime import datetime, timedelta
from io import BytesIO
import logging
from queue import Queue
import re
from subprocess import check_output, run
from threading import Lock, Thread
import time
import traceback
import matplotlib.pyplot as plt
import numpy as np
from scipy.io.wavfil... |
Extração MagMax COVID_POOL_v3_STARLAB.py | from opentrons.types import Point
import json
import os
import math
import threading
from time import sleep
metadata = {
'protocolName': 'USO_v6_station_b_M300_Pool_magmax',
'author': 'Nick <ndiehl@opentrons.com',
'apiLevel': '2.3'
}
NUM_SAMPLES = 8 # start with 8 samples, slowly increase to 48, then 94 (... |
jetson_power.py | #!/usr/bin/python3
# Modified version of https://github.com/opendr-eu/jetson_power
import os
import subprocess
import sys
import threading
import time
from logging import getLogger
from time import sleep
logger = getLogger("pytorch_benchmark")
class PowerEstimator:
def __init__(
self,
idle_load_... |
__init__.py | import sys
import io
import time
import json
import threading
import traceback
import collections
try:
import Queue as queue
except ImportError:
import queue
# Patch urllib3 for sending unicode filename
from . import hack
from . import exception
def flavor(msg):
"""
There are fiv... |
server.py | import abc
import socket
from threading import Lock, Thread
import six.moves.cPickle as pickle
from flask import Flask, request
from multiprocessing import Process
from ..utils.sockets import determine_master
from ..utils.sockets import receive, send
from ..utils.serialization import dict_to_model
# from multiprocessi... |
channel_close_test.py | # Copyright 2018 gRPC 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 applicable law or agreed to in writing... |
message.py | """
Process communication
=====================
classes in this source file are used for communication among processes, user should not use them directly. the start and
stop action of listener should only be called in fedflow framework.
"""
__all__ = [
"Handler",
"Message",
"MessageListener"
]
import abc... |
chat_server.py | #!/usr/bin/env python3
"""Server for multithreaded (asynchronous) chat application."""
import logging
import os
import socket
import threading
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accept()
print("%s:%s has ... |
Trainer.py | # Author: SiliconSloth 18/1/2018
import bluetooth, threading, serial, time, os
import cv2
# PyCharm seems to need this to work properly.
# try:
# from cv2 import cv2
# except:
# pass
# This script is used to record training videos, by manually controlling the robot with the RobleyRemote app.
# Co... |
test_quickstart2.py | import threading
import time
import pytest
import requests
from coworks import aws
from coworks.cws.command import CwsCommandError
from coworks.cws.runner import ThreadedLocalServer
from coworks.utils import import_attr
class TestClass:
def test_run_quickstart2(self, monkeypatch, s3_session, samples_docs_dir):... |
callbacks_test.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... |
main (copy).py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import threading
import numpy as np
import signal
import random
import math
import os
import sys
import time
import logging
from helper import logger_init, gene... |
http_request_handler_test.py | from http.server import HTTPServer
import inspect
import json
import logging
import random
import requests
import sys
import threading
import time
import unittest
from modules import http_request_handler
def load_tests(loader, tests, pattern):
suite = unittest.TestSuite()
for (name, obj) in inspect.getmember... |
bot.py | import time
import json
from slackclient import SlackClient
from peewee import *
import threading as th
import requests
import pprint
import stellarnetwork
import db_explore as db
pp = pprint.PrettyPrinter(indent=4)
from collections import defaultdict
import configparser
import stellarnetwork
class Bot1(object):
... |
plugins.py | import abc
import copy
import logging
import itertools
import os
import uuid
import sys
import time
import datetime
import signal
import subprocess
import re
import multiprocessing
import signal
from yapsy.PluginManager import PluginManager
from yapsy.IPluginLocator import IPluginLocator
from threading import Thread
f... |
main.py | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
import wx
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
import threading
import inspect
import ctypes
from _main import RTxxx_main
from _main import RTyyyy_main
from ui import RTyyyy_uidef
from ui import RTxxx_uidef
from ui import uidef
from ... |
server.py | #!/usr/bin/env python
"""
Dummy server used for unit testing.
"""
from __future__ import print_function
import errno
import logging
import os
import random
import string
import sys
import threading
import socket
from tornado.platform.auto import set_close_exec
import tornado.wsgi
import tornado.httpserver
import tor... |
thread-dispatch-bench.py | # Estimate the cost of simply passing some data into a thread and back, in as
# minimal a fashion as possible.
#
# This is useful to get a sense of the *lower-bound* cost of
# run_sync_in_worker_thread
import threading
from queue import Queue
import time
COUNT = 10000
def worker(in_q, out_q):
while True:
... |
basetask.py | # -*- coding:utf-8 -*-
import time
import threading
def sing():
for i in range(5):
print("running sing")
time.sleep(0.5)
def dance():
for i in range(5):
print("running to dance ...")
time.sleep(0.5)
if __name__=="__main__":
# 创建线程对象: threading.Thread
thread_sing = t... |
dispatcher.py | # Copyright 2017, 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
demo.py | import pyautogui
import pynput.keyboard as kb
import queue
import subprocess as sp
import threading
import time
slide = 0
slides = [
'''
# Give the Gift of Python
## Grant Jenks
# 1. Python trainer for Fortune 100 companies.
# 2. Married to Chemistry teacher, father of two.
# 3. 100s of hours of 4-12th grade instru... |
simulation_master_tx_datamanager.py | import TX as tx
import elinkmanager
#from datamanager import DataManager
from counterdown import CounterDown
import threading
from logger import InfoLogger, DataLogger, AdcsLogger
from time import sleep
import sys
#import RPi.GPIO as GPIO
import json
import Paths as paths
import Pins as pins
class Master:
__inst... |
ssd_model.py | # coding=utf-8
# Copyright 2021 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... |
train.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import os
import signal
import torch
import onmt.opts as opts
import onmt.utils.distributed
from onmt.utils.logging import logger
from onmt.train_single import main as single_main
def main(opt):
if opt.rnn_t... |
variable_scope_shim_test.py | # Copyright 2015 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... |
rockwell.py | # from blueprints.influxdb import *
# from main import *
from flask import Flask, render_template, request, redirect, url_for, flash, session, send_from_directory, send_file,Blueprint,current_app
from flask_bootstrap import Bootstrap
import random, datetime
from functools import wraps
import time
import functools
impo... |
vnoanda.py | # encoding: utf-8
from __future__ import print_function
import json
import requests
from Queue import Queue, Empty
from threading import Thread
API_SETTING = {}
API_SETTING['practice'] = {'rest': 'https://api-fxpractice.oanda.com',
'stream': 'https://stream-fxpractice.oanda.com'}
API_SETTI... |
report.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import threading
fr... |
delaytask.py | import itertools
import multiprocessing
import threading
import time
import traceback
class FakeProcProxy:
def is_alive(self):
return False
def join(self):
return
def terminate(self):
return
@property
def exitcode(self):
return 0
class TaskStatus:
def __ini... |
opencv_gst_camera.py | import traitlets
import atexit
import cv2
import threading
import numpy as np
from .camera_base import CameraBase
class OpenCvGstCamera(CameraBase):
value = traitlets.Any()
# config
width = traitlets.Integer(default_value=3280).tag(config=True)
height = traitlets.Integer(default_value=2464).... |
interface.py |
#Standard modules
import time
import matplotlib.pyplot as plt
import os
import numpy as np
import multiprocessing
import sys
import queue
import ctypes
import importlib
#RASH modules
import masterboard
import config
import Trajectory_Via as trj
import parser
import kinematics
import plotter as pltr
import simple_... |
multithread.py | import threading
import time
from queue import Queue
def thread_job():
print('T1 start \n')
for i in range(10):
time.sleep(0.1)
print('T1 finish \n')
def T2_job():
print('T2 start \n')
print('T2 finish \n')
def job(l):
for i in range(len(l)):
pass元组
def multithreading(data):
de... |
asynctasks.py |
import asyncio
from queue import Queue
from functools import partial
from aiohttp import web
from threading import Thread
from collections import deque
import json
import pprint
from collections import defaultdict
class Task:
'''
A task which will hold a coroutine executable when running the callable prot... |
4.py | # Dancing Dron - CrazyFly dancing for music beat
# Cnaan Aviv 2013-10-05
import time, sys
import usb
from threading import Thread
import logging
import cflib
from cflib.crazyflie import Crazyflie
from cfclient.utils.logconfigreader import LogConfig
from cfclient.utils.logconfigreader import LogVariable
lo... |
Ji.py |
import ADHVI
from ADHVI import *
from akad.ttypes import *
from multiprocessing import Pool, Process
from time import sleep
import pytz, datetime, pafy, time, timeit, random, sys, ast, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, wikipedia
from datetime import timedelta, date
... |
LazyEyesExample.py | import numpy as np
import cv2
import wx
import collections
import threading
import timeit
import pyfftw.interfaces.cache
from pyfftw.interfaces.scipy_fftpack import fft
from pyfftw.interfaces.scipy_fftpack import ifft
from scipy.fftpack import fftfreq
def cvResizeAspectFill(src, maxSize,
upInterpolation=cv2.INT... |
data_store_test.py | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""These are basic tests for the data store abstraction.
Implementations should be able to pass these tests to be conformant.
"""
import csv
import functools
import hashlib
import inspect
import logging
import operator
import os
import random
import string... |
web_server.py | import socket
import multiprocessing
import re
import time
import mini_framework
class WSGIServer:
def __init__(self):
"""初始化功能,创建套接字/绑定等"""
# 创建一个服务器套接字
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 套接字 地址重用选项 1设置0取消
self.server_socket.setsocko... |
test_utils.py | # coding: utf-8
#
import time
import threading
import pytest
from uiautomator2 import utils
def test_list2cmdline():
testdata = [
[("echo", "hello"), "echo hello"],
[("echo", "hello&world"), "echo 'hello&world'"],
[("What's", "your", "name?"), """'What'"'"'s' your 'name?'"""]
]
for... |
connection.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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... |
main.py | from flask import Flask, make_response, render_template, send_from_directory, Response
from app.rss import create_rss_feed
import multiprocessing
import os
import os.path
from os import path
import threading
import time
app = Flask(__name__, static_folder='/app/', static_url_path='')
app_start = time.time()
@app.befo... |
thread.py | # -*- coding:utf-8 -*-
#!/usr/bin/env Python
import threading,asyncio,logging
from typing import Callable
from .sleeper import Sleeper
class OnceshotThread(object):
def __init__(self, name:str, callable:Callable, *args, **kwargs):
self.__loop = asyncio.new_event_loop()
self.__thread = threading.Th... |
simulator.py | # -*- coding: utf-8 -*-
# @Author: Administrator
# @Date: 2019-04-30 11:25:35
# @Last Modified by: Administrator
# @Last Modified time: 2019-05-26 01:25:58
"""
无 GUI 的游戏模拟器,可以模拟播放比赛记录
"""
import sys
sys.path.append("../")
from core import const as game_const
import os
import time
import json
import subprocess
im... |
rpm.py | #!/usr/bin/python3
from gpiozero import Button
from http.server import BaseHTTPRequestHandler, HTTPServer
import time
import threading
hostName = "192.168.1.27"
hostPort = 9000
turns = 0
# HTTP server class.
class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
global turns
s... |
object_detector.py | # -*- coding: utf-8 -*-
# Copyright © 2017 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
"""
Class definition and utilities for the object detection toolkit.
"""
from __futu... |
utils.py | try:
from Crypto import Random
from Crypto.Cipher import AES
except:
from Cryptodome import Random
from Cryptodome.Cipher import AES
from colorama import init, Fore, Back, Style
from datetime import datetime
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.common.desired_capa... |
loader.py | import copy
import datetime
import functools
import importlib
import io
import json
import os
import shutil
import sys
import tempfile
import types
from threading import Thread
import requests
import yaml
from bs4 import BeautifulSoup
from httprunner import HttpRunner, logger
from requests.cookies import RequestsCooki... |
test_browser_credential.py | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
import random
import socket
import threading
import time
from azure.core.exceptions import ClientAuthenticationError
from azure.core.pipeline.policies ... |
ballisticacore_server.py | #!/usr/bin/env python3.8
# Released under the MIT License. See LICENSE for details.
#
"""BallisticaCore server manager."""
from __future__ import annotations
import json
import os
import signal
import subprocess
import sys
import time
from pathlib import Path
from threading import Lock, Thread, current_thread
from typ... |
fonts.py | from . import github
import fontforge
from json import load
from multiprocessing import cpu_count, Process
from os import makedirs, path, system, walk
from psMat import scale
from re import compile
from sys import stderr
from urllib import request
CHAR_DICTIONARY = { "ampersand": "&", "asciicircum": "^", "asciitilde": ... |
main.py | import time
from threading import Thread
import tools.SMS.sendRequest as request
import tools.SMS.numberTools as number
import tools.SMS.randomData as randomData
def SMS_ATTACK(threads, attack_time, phone):
global FINISH
FINISH = False
threads_list = []
services = request.getServices()
phone = number.... |
mpfps.py | import multiprocessing
import logging
import time
import sys
import numpy as np
import threading
from lib.mpvariable import MPVariable
import types
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY2:
import copy_reg
elif PY3:
import copyreg as copy_reg
def _pickle_method(m):
if m.im_self ... |
downloadclient.py | # Copyright 2018 CERN for the benefit of the ATLAS 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 appl... |
row_no_mat.py | #!/usr/bin/python
#
# This file is part of PyRQA.
# Copyright 2015 Tobias Rawald, Mike Sips.
"""
RQA, Fixed Radius, OpenCL, RowNoMat
"""
import numpy as np
import os
import pyopencl as cl
import threading
import Queue
from ....abstract_classes import AbstractRunnable
from ....opencl import OpenCL
from ....processin... |
test_habitat_env.py | #!/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 multiprocessing as mp
import os
import numpy as np
import pytest
import habitat
from habitat.config.default imp... |
observer.py | import logging
import shutil
import sys
import threading
import time
import cropping
import database
import os
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
import yaml
import datetime
with open("config.yml", "r") as ymlfile:
config = yaml.load(ymlfile)
api = SentinelAPI(config["sciuser"], co... |
Day05-00-3.py | ## 영상 처리 및 데이터 분석 툴
## (1) 파일 저장 추가
## (2) 스레드를 활용한 디스플레이 처리.... display() 함수만 변경됨. --> 성능 향상 없음.
from tkinter import *; import os.path ;import math
from tkinter.filedialog import *
from tkinter.simpledialog import *
import math
## 함수 선언부
def loadImage(fname) :
global window, canvas, paper, filename, inImage,... |
gcsio_test.py | #
# 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 us... |
ajaxterm.py | #!/usr/bin/env python
SWITCH_BETWEEN_PROPORTIONAL_AND_MONOSPACE = 0
""" Ajaxterm """
try:
import psyco
psyco.profile()
except:
pass
import array,cgi,fcntl,glob,mimetypes,optparse,os,pty,random,re,signal,select,sys,threading,time,termios,struct,pwd
os.chdir(os.path.normpath(os.path.dirname(__file__)))
#... |
togglee.py | import threading
import time
import requests
from togglee.helpers.mappers import map_json_to_toggles
from togglee.strategies.main import strategy_maps
class Togglee:
def __init__(self, url: str, refresh_rate: int, defaults: list):
self._url = url
self._refresh_rate = refresh_rate
self._t... |
piece_location.py | # Get extrinsic position from aruco marker
import cv2
import torch
import pickle
import numpy as np
from PIL import Image
from threading import Thread
def get_boxes(frame):
global box_data, ACTIVE_THREADS
ACTIVE_THREADS += 1
# Get prediction bounding boxes
results = model(frame, size=320)
box_data... |
sshforwarder.py | import os
import logging
import signal
from multiprocessing import Process, Value
from sshtunneler import Tunneler
wrapped_control_value = Value('i', 0)
def starttunneler(port, control_value):
tunneler = Tunneler(port, control_value)
tunneler.run()
def terminateProcess(signalNumber, frame):
logging.info(... |
thread_test.py | import threading
class Counter(object):
def __init__(self, start=0):
self.lock = threading.Lock()
self.value = start
def increment(self):
print(threading.current_thread(), 'Waiting for lock')
self.lock.acquire()
try:
print(threading.current_thread(), 'Acquire... |
test.py | import cv2
import time
from tornado import web, ioloop
import threading
import os
from motion import Motion
from config import config
import main
def nothing(x):
pass
def ManageMotion():
motion = Motion()
# Params to change on the fly
cv2.namedWindow('paramMinMaxPalm')
cv2.createTrackbar('MAX H'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.