source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
main.py | import threading
import pygame
from pen_group import PenGroup
from sprite import Sprite
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
# Initialize Pygame
pygame.init()
# Set the height and width of the screen
screen_width = 700
screen_height = 400
screen = pygame.display.set_mo... |
idf_monitor.py | #!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run "make (or idf.py) flash" (Ctrl-T Ctrl-F)
# - Run "make (or idf.py) app-flash" (Ctrl-T Ctrl-A)
# - If gdbstub output is... |
gui_interface.py | """
GUI process
CUSF 2018/19
"""
from .packets import *
import time
import queue
import threading
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QThread, pyqtSignal, QTimer
from PyQt5.QtWidgets import QMainWindow, QApplication
from multiprocessing import Pipe, Process
from .frontend.main_window_real import Ui... |
test.py | import stewart
import threading
import time
# Create the environment object
env = stewart.environment()
def code():
''' Your main code here
'''
# This function send the angles to servo motors
angles = [90,90,90,90,90,90]
env.step(angles, 0.1, 100)
# Create the threading for main code running
cod... |
test_subscriber_storage.py | import threading
import time
import pytest
from smartcameras.storagehandler import CameraRegister, PoliceMonitor
from smartcameras.subscriber import VehicleInspector
from smartcameras.speedcamera import SpeedCamera
def test_camera_register():
cameraRegister = CameraRegister()
threadConsumer = threading.Thread(... |
regrtest.py | #! /usr/bin/env python
"""
Usage:
python -m test.regrtest [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabeti... |
process.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import random
import subprocess
from multiprocessing import Process, Queue
from multiprocessing import Pool
def run_proc(name):
print('run child process %s (%s)...' % (name, os.getpid()))
def start_proc():
print('run parent process %s.' % ... |
multiuser_ner.py | import prodigy
from multiprocessing import Process
from time import sleep
from prodigy.recipes.ner import batch_train
import atexit
from pathlib import Path
import datetime as dt
class MultiProdigy:
def __init__(self, tag_list = ["LOC", "GPE", "PERSON"]):
self.tag_list = tag_list
self.processes = [... |
gee.meter.py | #!/usr/bin/python3
## GeeMeter for DCS:FC3 + A10C
version = 0.53
################################################
# This monstrosity was created by crash_horror
# and comes without warranty of any kind,
# read the license.
# (https://github.com/crash-horror)
################################################
from tkint... |
random_explore.py | import json
import time
import os
import random
import multiprocessing
import numpy as np
import tensorflow as tf
import nsm
from nsm import data_utils
from nsm import env_factory
from nsm import graph_factory
from nsm import model_factory
from nsm import agent_factory
from nsm import executor_factory
from nsm import... |
messagebus.py | """
Pyro MessageBus: a simple pub/sub message bus.
Provides a way of communicating where the sender and receivers are fully decoupled.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
from __future__ import print_function
import threading
import uuid
import datetime
import time
imp... |
my_face4_knn.py | import os
import cv2
import queue
import random
import threading
import face_recognition
import numpy as np
from sklearn import svm
import joblib
q = queue.Queue()
# 加载人脸图片并进行编码
def Encode():
print("Start Encoding")
image_path = 'C:\\Users\\Administrator\\Desktop\\face_recognition-master\\examples\\knn_exam... |
video_capture.py | import cv2
import time
import sys
from threading import Thread
from app.filesystem.snapshot_storage import SnapshotStorage
class VideoCapture:
__snapshot_frequency = 0.3
__delay = 10
def __init__(self) -> None:
self.__video = cv2.VideoCapture(0)
self.__video.set(cv2.CAP_PROP_FRAME_WIDTH, ... |
main.py | #----- EDIT THIS -----#
threadsamount = 5
message = "@everyone"
webhooks = [""]
useproxies = True
timeouttime = 3
#------ DONT EDIT BELLOW ------#
import requests
import threading
import time
from colorama import Fore
import random
proxies = open('proxies.txt','r').read().splitlines()
proxies = [{'https':'http://'+p... |
test_submit_handlers.py | # Copyright 2017 Intel Corporation
#
# 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 wri... |
netinfo.py | #!/usr/bin/env python3.8
# TODO: Insert hop zero (router source IP / client default gateway)
# TODO: Parse traceroute output
# TODO: Stylize web frontend
import argparse
import json
import logging
import os
import queue
import re
import signal
import sys
import threading
import time
from netmiko import ConnectHandle... |
main.py | from threading import Timer, Thread
import time
import os
import sys
def kill():
print("TLE")
exit(1)
testCases = int(sys.argv[1])
timeLimit = int(sys.argv[2])
def runCode(timeout):
if os.system("gcc -std=c11 -O2 /source/code.c -o /source/code > /source/out/compile_out.txt 2> /source/out/compile_error.tx... |
cloud_server_coordinator.py | import pickle
import socket
import struct
import threading
from ball_tracking_example.taskified import tasks
HOST = ''
PORT = 8089
def run_task(task_func, args):
# Call task
if args is None:
# No args to pass
return task_func()
elif type(args) is tuple:
# Unzip tuple into args
... |
workbench.py | # -*- coding: utf-8 -*-
import ast
import collections
import importlib
import logging
import os.path
import pkgutil
import platform
import queue
import re
import shutil
import socket
import sys
import tkinter as tk
import tkinter.font as tk_font
import traceback
from threading import Thread
from tkinter import message... |
xlink_secure_wrapper.py | """
Allows API of xlink driver C library to be called in Python.
Copyright (C) 2019-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import logging
import threading
import os
from ctypes import *
from threading import Lock
from typing import Callable, Tuple
import time
from inbm_vision_lib.... |
train.py | import os
import time
from collections import deque
from multiprocessing import Process, Value, Array, Queue
from threading import Thread
import subprocess
import settings
from sources import start_carla, restart_carla
from sources import STOP, get_hparams
from sources import run_agent, AGENT_STATE
from sources import... |
__init__.py | # coding=utf-8
from __future__ import absolute_import
import threading
import time
from base64 import b64decode
from datetime import timedelta, datetime
import humanfriendly
import octoprint.plugin
import octoprint.settings
import os
import requests
import socket
import subprocess
import logging
from PIL import Image... |
test_conveyor.py | # -*- coding: utf-8 -*-
# Copyright 2021 CERN
#
# 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... |
udp_syslog_message.py | #!/usr/bin/env python2.7
"""Script injecting UDP messages to a remote syslog server
"""
from __future__ import print_function
import socket
import sys
import threading
import time
from random import randint
NEVER_ENDING = True
SYSLOG_SERVER = 'localhost'
SYSLOG_SERVER_PORT = 514
NB_THREADS = 1
NB_MESSAGES = 100
""... |
minispray.py | #!/usr/bin/python3
import lcddriver
import time
import sys
import requests
import json
import os,subprocess
import re
import atexit
from time import sleep
import screens
import threading
from gpiozero import LED
import multiprocessing
import queue
import services
#VARIABLES
block=' '
stop=' '
id=' '
display = lcd... |
localhost.py | #
# (C) Copyright Cloudlab URV 2021
#
# 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 wr... |
copyutil.py | # cython: profile=True
# 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
# "... |
parajob.py | #!/usr/bin/python
import os
import threading
import glob
def parajob():
caldirs = glob.glob('paraCal*')
numthread = len(caldirs)
runs = []
for i in range(numthread):
runs.append(threading.Thread(target=execvasp, args=(caldirs[i],)))
for t in runs:
t.start()
for t in runs:
... |
mpi.py | """
DMLC submission script, MPI version
"""
# pylint: disable=invalid-name
from __future__ import absolute_import
import sys
import subprocess, logging
from threading import Thread
from . import tracker
def get_mpi_env(envs):
"""get the mpirun command for setting the envornment
support both openmpi and mpich2... |
server2.py | # cenario 2
# IMPORTS {{{
import pygame
import socket
import threading
import time
import tkinter as tk
from aux_server import manageInput, manageGameLogic, manageOutput
from global_var import *
from kobra_kombat_game.game import Game
# }}}
fila = []
flag = True
dur = {
'i_time': 0,
'o_time': 0,
'g_time... |
helper.py | # ㄒㄩ尺Ҝ乇ㄚ ㄒ乇卂爪
from linepy import *##ㄒㄩ尺Ҝ乇ㄚ ㄒ乇卂爪
from akad.ttypes import Message ## TURKEY TEAM
from liff.ttypes import LiffChatContext, LiffContext, LiffSquareChatContext, LiffNoneContext, LiffViewRequest
from akad.ttypes import ContentType as Type
from akad.ttypes import TalkException
from ZarifKing.thrift.protocol im... |
client.py | '''HTTP Client'''
from __future__ import annotations
__all__ = ['Client']
import asyncio
import logging
from concurrent.futures import Future
from contextlib import asynccontextmanager
from copy import deepcopy
from functools import partial
from queue import Empty, Queue
from threading import Thread
from time import... |
session_worker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
import tensorflow as tf
from lib.mpvariable import MPVariable
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY2:
import Queue
elif PY3:
import queue as Queue
class SessionWorker():
# TensorFlow Session Thr... |
connection_module.py | import threading
import socket
# Client Device info
host = ''
port = 9000
device_address = (host, port)
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
tello_address = ('192.168.10.1', 8889)
sock.bind(device_address)
print("Tello Python3 Terminal")
print('Command List: ')
print('')
pr... |
demo.py | # Copyright (c) 2022 Shuhei Nitta. All rights reserved.
""" Example of RemoteWeb """
import time
import webbrowser
from threading import Thread
from http.server import HTTPServer, SimpleHTTPRequestHandler
from remoteweb import RemoteWebServer, RemoteWebClient
def run_remoteweb_server() -> None:
"""Run RemoteWebS... |
test_scp.py | #
# Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
#
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
task_queue.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Doc."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import time
import sys
import threading
class ActionQueue(object):
"""."""
def __init__(self, delay=... |
player.py | import threading
import queue
from subprocess import Popen, PIPE
q = queue.Queue()
process = None
current = {}
def worker():
global current, process
while True:
item = q.get()
current = item
item["start"][0](
*item["start"][1],
quote=True
... |
env_wrappers.py | """
Modified from OpenAI Baselines code to work with multi-agent envs
"""
import numpy as np
import torch
import multiprocessing as mp
from multiprocessing import Process, Pipe
from abc import ABC, abstractmethod
from onpolicy.utils.util import tile_images
class CloudpickleWrapper(object):
"""
Uses cloudpickle... |
sql.py |
# Native libraries
import os
import atexit
from traceback import format_exc
from time import time
from typing import List
from collections import namedtuple
from threading import Thread, Lock, Event
# Installed libraries
import pymysql
import paho.mqtt.client as mqtt
from dotenv import load_dotenv
load_dotenv()
HOS... |
test_stream_handlers.py | import time
import threading
import unittest
from sleekxmpp.test import SleekTest
from sleekxmpp.exceptions import IqTimeout
from sleekxmpp import Callback, MatchXPath
class TestHandlers(SleekTest):
"""
Test using handlers and waiters.
"""
def setUp(self):
self.stream_start()
def tearDo... |
tank.py | from baseComponent import BaseComponent
from threading import Thread
import time
class Tank(BaseComponent):
def __init__(self,componentIn,componentOut,height,baseArea,flowIn = 0,flowOut = 0):
super.__init__()
self._componentIn=componentIn
self._componentOut=componentOut
self._heigh... |
jsonalignmentconsumer.py | import json
import logging
import random
import string
import threading
from kafka import KafkaConsumer, TopicPartition
from service.alignmentservice import AlignmentService
from service.jsonalignmentservice import JsonAlignmentService
from logging.config import dictConfig
from utilities.alignmentutils import Alignmen... |
Loader.py | """MIT License
Copyright (c) 2019 Zdravko Georgiev
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, publis... |
logging.py | import ntpath
import random
import time
import threading
import requests
from inspect import getframeinfo, stack
from termcolor import colored
def stackInfo():
caller = getframeinfo(stack()[3][0])
return ntpath.basename(caller.filename), caller.lineno
LEVELS = {
"debug": ["magenta"],
"info": ["cyan... |
videoio.py | from pathlib import Path
from enum import Enum
from collections import deque
from urllib.parse import urlparse
import subprocess
import threading
import logging
import cv2
LOGGER = logging.getLogger(__name__)
WITH_GSTREAMER = False
class Protocol(Enum):
IMAGE = 0
VIDEO = 1
CSI = 2
V4L2 = 3
RT... |
21xiechengdecorate.py | # -*- coding:utf-8 -*-
import time
import threading
# yield 关键字的作用挂起函数,并且将函数右面的返回, 第一次执行到右半边,继续执行的时候返回值往下,停不下来的时候报错
gen_model = None
def new_long_io():
# 接受一个函数作为参数
"""def func():"""
"""执行完线程的方法调用回调函数
第一次执行到右半边,继续执行的时候返回值往下,停不下来的时候报错
"""
global gen_model
print("开始耗时操作~~~~~~~~~~~... |
test_local_api_service.py | """
Function test for Local API service
"""
import os
import shutil
import random
import threading
import requests
import time
import logging
from samcli.commands.local.lib import provider
from samcli.commands.local.lib.local_lambda import LocalLambdaRunner
from samcli.local.lambdafn.runtime import LambdaRuntime
from... |
main.py |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2015 Juniper Networks, Inc.
# All rights reserved.
#
# Use is subject to license terms.
#
# 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 ... |
train.py | """
Written by Matteo Dunnhofer - 2017
models training on ImageNet
"""
import sys
import os.path
import time
from models import alexnet
import tensorflow as tf
import train_util as tu
import numpy as np
import threading
def train(
epochs,
batch_size,
learning_rate,
dropout,
momentum,
lmbda,
resume... |
RaKIB401.py | #!/usr/bin/env python
from datetime import datetime
import os
import hashlib
import sys
import time
import threading
import string
import random
import shutil
import urllib.request
import urllib.parse
try:
import requests
except ImportError:
print('[!] Error: some dependencies are not installed')
print('Ty... |
utils.py | from bitcoin.rpc import RawProxy as BitcoinProxy
from lightning import LightningRpc
import logging
import os
import re
import subprocess
import threading
import time
BITCOIND_CONFIG = {
"rpcuser": "rpcuser",
"rpcpassword": "rpcpass",
"rpcport": 57776,
}
LIGHTNINGD_CONFIG = {
"bitcoind-poll": "1s",
... |
test_threaded.py | import os
import signal
import threading
from multiprocessing.pool import ThreadPool
from time import time, sleep
import pytest
from dask.context import set_options
from dask.compatibility import PY2
from dask.threaded import get
from dask.utils_test import inc, add
def test_get():
dsk = {'x': 1, 'y': 2, 'z': (... |
ProxyListener.py | import socket
import SocketServer
import threading
import sys
import glob
import time
import importlib
import Queue
import select
import logging
import ssl
from OpenSSL import SSL
from ssl_utils import ssl_detector
from . import *
import os
BUF_SZ = 1024
class ProxyListener(object):
def __init__(
se... |
mqtt_ssl_example_test.py | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import re
import os
import sys
import ssl
import paho.mqtt.client as mqtt
from threading import Thread, Event
try:
import IDF
except ImportError:
# this is a test case write with tiny-test-fw.
# to run t... |
__init__.py | """
homeassistant.util
~~~~~~~~~~~~~~~~~~
Helper methods for various modules.
"""
import collections
from itertools import chain
import threading
import queue
from datetime import datetime
import re
import enum
import socket
import random
import string
from functools import wraps
from .dt import datetime_to_local_str... |
build.py | ## @file
# build a platform or a module
#
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
# Copyright (c) 2020, ARM Limited. All rights reserved.<... |
server.py |
from time import sleep
from ccg_seed_pb2 import *
from lstm_parser_bi_fast import FastBiaffineLSTMParser
from google.protobuf.json_format import *
import numpy as np
import os, sys, chainer, argparse, socket, struct
from tagger import *
from pathlib import Path
import multiprocessing
def log(msg):
print("[server... |
django_3d_reconstruction.py | import datetime
import threading
import time
from termcolor import colored
import signal
import os
import pause
stop = False
def signal_handler(signal, frame):
global stop
print_str = '[] Ctrl+C KeyboardInterupt'
print(colored(print_str, 'yellow', attrs=['bold']))
stop = True
def job():
while not... |
replay_helper.py | from __future__ import print_function
import json
import sqlite3
import threading
import time
import traceback
import docker_helper
import requests
_database_path = docker_helper.read_configuration(
"REPLAY_DATABASE", "/var/config/webhooks/replay", "webhooks-replay.db"
)
_schedule_condition = threading.Conditio... |
TofaatTevaService.py | #Service.py
import time
from pprint import pprint as pp
TLAST = {0:None}
from threading import Thread
import traceback
class TofaatTevaService(object):
id = "TofaatTeva"
name = "🚀TofaatTeva🚀"
welcome = "Welcome to 🚀TofaatTeva🚀 Service \nUsed for system experiments"
help = "TofaatTeva TofaatTeva TofaatTeva"
im... |
sat.py | from __future__ import division
__author__ = 'shengjia'
import subprocess, threading
import random
import time
import os
import math
import numpy as np
import copy
import heapq
import sklearn.feature_selection
try:
import cPickle as pickle
except ImportError:
import pickle
MACHINE = 'atlas'#'atlas' #'atlas' ... |
test_http.py | import json
import threading
from http.server import HTTPServer, BaseHTTPRequestHandler
import pytest
from testplan.testing import multitest
from testplan import TestplanMock
from testplan.common.utils.testing import argv_overridden
from testplan.exporters.testing import HTTPExporter
class PostHandler(BaseHTTPReque... |
fabfile.py | import os
from fabric.api import cd, env, local, run, task
CONFIG = {
"host": "www-data@mmmoney.406.ch",
"domain": "mmmoney.406.ch",
"project": "mmmoney",
"branch": "master",
}
env.forward_agent = True
env.hosts = [CONFIG["host"]]
def _configure(fn):
def _dec(string, *args, **kwargs):
... |
tests.py | from django.test import TestCase, TransactionTestCase
from fixture_generator import fixture_generator
from fixture_generator.base import (
calculate_requirements, CircularDependencyError)
from multiprocessing import Process, Pipe
@fixture_generator()
def test_func_1():
pass
@fixture_generator(requires=["tes... |
base.py | import os
import subprocess
import time
from multiprocessing import Queue
from queue import Empty
from threading import Thread
from typing import Optional
import streamlit as st
import logging
from streamlit_ace import st_ace
from streamlit_autorefresh import st_autorefresh
logger = logging.getLogger(__name__)
cl... |
estrangement.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module implements the Estrangement Confinement Algorithm (ECA) and various functions necessary
to read the input snapshots, process information and return the results and/or print them to file.
"""
__all__ = ['make_Zgraph','read_general','maxQ','repeated_runs','ECA... |
io.py | # Copyright (c) 2018 PaddlePaddle 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 app... |
sampler.py | # Copyright 2018 The Cirq Developers
#
# 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 ... |
jobStoreTest.py | # Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 o... |
build_image_data.py | # Copyright 2016 Google 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 law or a... |
test_tcp_server.py | # coding: utf-8
import socket
import threading
import time
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 9999))
s.listen(5)
print('Waiting for connection...')
def tcplink(sock, addr):
"""
:type sock: socket.socket
:type addr: tuple
"""
print('Accept new connection ... |
client.py | ### forked from GitHub
### ADAPTED by Boaz to integrate PonyCrypt
########################################################################################################
# PonyCrypt Library: client script #
# Team Boaz: Urian Lee, Sandhya Ramachandrai... |
train_sampling_multi_gpu.py | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import argparse
from _thread import start_new... |
supervisor.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... |
example_test.py | import re
import os
import socket
import BaseHTTPServer
import SimpleHTTPServer
from threading import Thread
import ssl
from tiny_test_fw import DUT
import ttfw_idf
import random
import subprocess
server_cert = "-----BEGIN CERTIFICATE-----\n" \
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCz... |
test__threading_monkey_in_thread.py | # We can monkey-patch in a thread, but things don't work as expected.
from __future__ import print_function
import threading
from gevent import monkey
import gevent.testing as greentest
class Test(greentest.TestCase):
@greentest.ignores_leakcheck # can't be run multiple times
def test_patch_in_thread(self):... |
browser.py | # -*- coding: utf-8 -*-
import curses
try:
from dns import resolver
except:
pass
from copy import deepcopy
import random
import json
from os import path
import collections
from operator import itemgetter
try:
import requests
except:
pass
import threading
import logging
from .player import info_dict_to_l... |
email.py | from flask import render_template
from flask_mail import Message
from app import app, mail
from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, recipi... |
events_example.py | # This example demonstrates the use of pyotherside.send() to send events to Qt.
import pyotherside
import threading
import time
print('Using PyOtherSide version', pyotherside.version)
COLORS = ['red', 'green', 'blue']
def thread_func():
i = 0
while True:
pyotherside.send('append', 'Next Number: ', ... |
MongoUtil_test.py | # -*- coding: utf-8 -*-
import os
import unittest
from configparser import ConfigParser
import inspect
import copy
import threading
import queue
from random import randrange
from mongo_util import MongoHelper
from AbstractHandle.Utils.MongoUtil import MongoUtil
class MongoUtilTest(unittest.TestCase):
@classmeth... |
docker.py | import argparse
import docker
import io
import os
import random
import requests.exceptions
import sys
import tempfile
import threading
try:
from retro import data_path
except ImportError:
def data_path():
raise RuntimeError('Could not find Gym Retro data directory')
class LogThread:
def __init__(s... |
Thread.py | import logging
import threading
import time
def thread_function(name, t):
logging.info("Thread %s: starting", name)
time.sleep(t)
logging.info("Thread %s: finishing", name)
if __name__ == "__main__":
format = "%(asctime)s: %(message)s"
logging.basicConfig(format=format, level=logging.INFO,
... |
test_file2k.py | import sys
import os
import unittest
import itertools
import select
import signal
import stat
import subprocess
import time
from array import array
from weakref import proxy
try:
import threading
except ImportError:
threading = None
from test import test_support
from test.test_support import TESTFN, run_unitte... |
Server.py | #!/usr/bin/python3
# Copyright 2018 Stephen Blystone, Taniya Riar, Juhi Bhandari, & Ishwank Singh
# 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-... |
log.py | # coding:utf-8
# Copyright (c) 2020 PaddlePaddle 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 req... |
manager.py | import os
import sys
# #import re
# #from time import sleep
from setproctitle import setproctitle
import multiprocessing
# #from multiprocessing.managers import BaseManager
from multiprocessing.managers import SyncManager
from queue import Queue
# #import concurrent.futures
#-#from ctypes import cdll, CFUNCTYPE, c_char... |
server.py | #!flask/bin/python
import asyncio
import atexit
import colorsys
import importlib
import inspect
import json
import os.path
import threading
import time
import multiprocessing
import traceback
from timeit import default_timer as timer
import jsonpickle
import numpy as np
from flask import Flask, abort, jsonify, request... |
http_com.py | from __future__ import print_function
from builtins import str
from builtins import object
import logging
import base64
import random
import os
import ssl
import time
import copy
import json
import sys
from pydispatch import dispatcher
from flask import Flask, request, make_response, send_from_directory
# Empire impor... |
dbus_exporter.py | from . import interfaces
import dbus.service
import dbus.mainloop.glib
import dbus.exceptions
import threading
import signal
import tuned.logs
import tuned.consts as consts
from inspect import ismethod
from tuned.utils.polkit import polkit
from gi.repository import GLib
from types import FunctionType
try:
# Python3 v... |
ThreadedTCPServer.py | from SocketServer import ThreadingMixIn
from Queue import Queue
import time
import socket
import logging
import threading
import SocketServer
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s '
'[%(levelname)s] (%(threadName)-10s) %(message)s',)
class ThreadedTCPReq... |
postmaster.py | import logging
import multiprocessing
import os
import psutil
import re
import signal
import subprocess
import sys
from patroni import PATRONI_ENV_PREFIX, KUBERNETES_ENV_PREFIX
# avoid spawning the resource tracker process
if sys.version_info >= (3, 8): # pragma: no cover
import multiprocessing.resource_tracker
... |
httpserver.py |
import queue
import threading
import json
import time
import re
from collections import defaultdict
from enum import Enum
from contextlib import suppress, contextmanager
from copy import copy
from typing import Any, Callable, List, Mapping, MutableMapping, Optional, Tuple, Union, Pattern
from ssl import SSLContext
imp... |
management.py | """This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import... |
mna.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Mna - A Currency Converter program
# Copyright (c) 2012-2021, Petros Kyladitis <http://www.multipetros.gr/>
# This is free software, distributed under the FreeBSD Lisence
import wx
import wx.lib.plot as plot
import webbrowser
import ConfigParser
import xml.e... |
common.py | '''
Do not execute this file directly.
Use ycdl_flask_dev.py or ycdl_flask_prod.py.
'''
import flask; from flask import request
import threading
import time
from voussoirkit import flasktools
from voussoirkit import pathclass
from voussoirkit import vlogging
log = vlogging.getLogger(__name__)
import ycdl
from . imp... |
experiment_queue.py | #####################################################################
# #
# /experiment_queue.py #
# #
# Copyright 2013, Monash ... |
test_autograd.py | # Owner(s): ["module: autograd"]
import contextlib
import gc
import io
import math
import os
import random
import sys
import tempfile
import threading
import time
import unittest
import uuid
import warnings
import operator
import subprocess
from copy import deepcopy
from collections import OrderedDict
from itertools i... |
fn_api_runner.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... |
backend.py | """Interface for job launching backend.
Run/Job and Task are container classes encapsulating functionality.
User creates them through make_run/make_job/make_task methods
"""
# Job launcher Python API: https://docs.google.com/document/d/1yTkb4IPJXOUaEWksQPCH7q0sjqHgBf3f70cWzfoFboc/edit
# AWS job launcher (concepts): h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.