source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
main.py | # -*- coding: utf-8 -*-
appVersion = 2
import settings
import downloader
import texturepacks
import os
import sys
import tkinter
import requests
import threading
import webbrowser as web
from tkinter import messagebox # because getting AttributeErrors without
# Execute function
def exe(x):
exec(x)
# Program s... |
mdns_example_test.py | import os
import re
import select
import socket
import struct
import subprocess
import time
from threading import Event, Thread
import dpkt
import dpkt.dns
import ttfw_idf
from tiny_test_fw import DUT
from tiny_test_fw.Utility import console_log
stop_mdns_server = Event()
esp_answered = Event()
esp_delegated_answered... |
DEW.py | #!/usr/bin/env python
# coding: utf-8
# # Package Imports
# In[2]:
import pandas as pd
import numpy as np
import sys
import threading
import subprocess
import os
import json
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from matplotlib.lines import Line2D
get_ipython().run_line_magic('matplotlib... |
NavigationSystemServerController.py | __author__ = "Edward J. C. Ashenbert"
__version__ = "2.0.7"
__status__ = "20200908_1037"
import threading
import rclpy
from geometry_msgs.msg import Pose
from rclpy.node import Node
from transforms3d.euler import euler2quat
import NavigationSystemROS.NavigationSystemServer.NavigationSystemServerShareMemory as naviga... |
utils.py | from __future__ import print_function
import colorsys
import inspect
import json
import math
import os
import pickle
import platform
import signal
import numpy as np
import pybullet as p
import random
import sys
import time
import datetime
import shutil
from collections import defaultdict, deque, namedtuple
from iter... |
dnsserver.py | #!/usr/bin/python
import socket
from dnspacket import dnspacket
import argparse
import random
import Queue as queue
from georank import *
import threading
MAX_PACKET_SIZE=65535
SERVERS=[
'52.90.80.45',
'54.183.23.203',
'54.70.111.57',
'52.215.87.82',
'52.28.249.79',
'54.169.10.54',
'52.6... |
test_nntplib.py | import io
import socket
import datetime
import textwrap
import unittest
import functools
import contextlib
import os.path
from test import support
from nntplib import NNTP, GroupInfo
import nntplib
from unittest.mock import patch
try:
import ssl
except ImportError:
ssl = None
try:
import threading
except Im... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_vtc as electrum
from electrum_vtc.bitcoin import TYPE_ADDRESS
from electrum_vtc import WalletStorage, Wallet
from electrum_vtc_gui.kivy.i18n import _
from electrum_vtc.paymentrequest... |
osde2e-wrapper.py | #!/usr/bin/env python
# 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, sof... |
app.py | #!/usr/bin/env python
import json
from django.shortcuts import redirect
async_mode = None
if async_mode is None:
try:
import eventlet
async_mode = 'eventlet'
except ImportError:
pass
if async_mode is None:
try:
from gevent import monkey
async_mode... |
hardcoded_movements.py | from values import *
import sys
import time
import threading
import random
ENGINES = {
"fron_l_hori": HORI_FRONT_L,
"fron_l_knee": KNEE_FRONT_L,
"fron_l_vert": VERT_FRONT_L,
"fron_r_hori": HORI_FRONT_R,
"fron_r_knee": KNEE_FRONT_R,
"fron_r_vert": VERT_FRONT_R,
"midd_l_hori": HORI_MIDDLE_L,
... |
test_package_parallel.py | import os
import traceback
import py
from flaky import flaky
from tox.session.commands.run import sequential
@flaky(max_runs=3)
def test_tox_parallel_build_safe(initproj, cmd, mock_venv, monkeypatch):
initproj(
"env_var_test",
filedefs={
"tox.ini": """
[tox]
... |
bgpstreamkafka.py | import multiprocessing as mp
import os
import signal
import time
import _pybgpstream
import pytricia
import redis
import requests
import ujson as json
from artemis_utils import get_ip_version
from artemis_utils import get_logger
from artemis_utils.constants import CONFIGURATION_HOST
from artemis_utils.constants import... |
test_index.py | import multiprocessing as mp
import os
import time
import unittest
import numpy as np
from jina.drivers.helper import array2pb
from jina.enums import FlowOptimizeLevel
from jina.executors.indexers.vector.numpy import NumpyIndexer
from jina.flow import Flow
from jina.main.parser import set_flow_parser
from jina.proto i... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_pool.py | import heapq
import psycopg2 # Trigger import error if not installed.
import threading
import time
from peewee import *
from peewee import savepoint
from peewee import transaction
from playhouse.pool import *
from playhouse.tests.base import database_initializer
from playhouse.tests.base import PeeweeTestCase
class... |
webcamgrabber.py | import cv2
import numpy as np
import os
import threading
class Arducam():
def __init__(self, camera_string, calib_params="CalibParams_Stereo.yml"):
self._import_params(calib_params)
self._connect_to_camera(camera_string)
self._calculate_matched_roi()
self.thread_running ... |
conftest.py | """
Unit test fixture module.
"""
import threading
import time
import mock
import pytest
from mock.mock import MagicMock
from core.api.grpc.client import InterfaceHelper
from core.api.grpc.server import CoreGrpcServer
from core.api.tlv.corehandlers import CoreHandler
from core.emulator.coreemu import CoreEmu
from co... |
mqtt2db.py | #!/usr/bin/python3
from db_ingest import DBIngest
import paho.mqtt.client as mqtt
from threading import Thread, Condition, Timer
from signal import signal, SIGTERM
import traceback
import json
import time
import sys
import os
mqtthost = os.environ["MQTTHOST"]
scenario = os.environ["SCENARIO"]
dbhost = os.environ["DBH... |
trapd.py | '''
Created on Nov. 06, 2014
@author: yunli
'''
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
from pysnmp.carrier.asynsock.dgram import udp
from pyasn1.codec.ber import decoder
from pysnmp.proto import api
from threading import Thread, Event
import logging
import util
import signal
import sys
import... |
handover_net.py | from redisparser import RedisParser
from controller import Controller
import numpy as np
from sklearn import preprocessing
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Conv1D, MaxPooling1D, Activation, Flatten, GlobalMaxPooling1D, Embedding
f... |
main.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 signal
import math
import os
import time
from environment.environment import Environment
from model.model import UnrealModel
from train.... |
create_logger.py | import datetime
import threading
import os
from logging import handlers, getLogger
from .service_defaults import DATALOOP_PATH
logger = getLogger(name=__name__)
class DataloopLogger(handlers.BaseRotatingHandler):
"""
Based on logging.handlers.RotatingFileHandler
Create a new log file after reac... |
webcamvideostream.py | # import the necessary packages
from threading import Thread
import cv2
class WebcamVideoStream:
def __init__(self, src=0, name="WebcamVideoStream", resolution=(320, 240),
framerate=32):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
# se... |
LoadFileFromHTTPClass.py | import configparser
import urllib.request
from multiprocessing import Process, Event
from PIL import Image
from shutil import copyfile
import time
import os
class LoadFileFromHttp:
def __init__(self):
config = configparser.ConfigParser()
config.read('./config/config.ini')
self.TimeoutLoa... |
__init__old.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io>
import sys
import threading
import time
import uuid
import warnings
from collections import namedtuple
from functools import wraps
import numpy as np
import zmq
from zmq.utils import jsonapi
from .protocol impor... |
svenzva_driver.py | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2017 Svenzva Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... |
Echo_server.py | #TCP Echo server
# Make a TCP server in a process that handles multiple clients
# Echoes back the data the client sent
import logging
import multiprocessing
import socket
import select
logging.basicConfig(format='%(asctime)s.%(msecs)03d - %(levelname)s - %(message)s', datefmt='%H:%M:%S', level=logging.DEBUG... |
tinybar.py | import threading
import rumps
from algosdk.v2client.algod import AlgodClient
from tinyman.v1.client import TinymanClient, TinymanMainnetClient, TinymanTestnetClient
from src.common.constants import (
ALGO,
LEDGER_TYPE,
TINYBAR_ASSETS_DB,
TINYBAR_DATA_PATH,
USDC,
)
from src.common.models import ASA... |
XInput.py | import ctypes, ctypes.util
from ctypes import Structure, POINTER
from math import sqrt
import time
from threading import Thread, Lock
# loading the DLL #
XINPUT_DLL_NAMES = (
"XInput1_4.dll",
"XInput9_1_0.dll",
"XInput1_3.dll",
"XInput1_2.dll",
"XInput1_1.dll"
)
libXInput = None
for name in ... |
test_threading.py | """
Tests for the threading module.
"""
import test.support
from test.support import (verbose, import_module, cpython_only,
requires_type_collecting)
from test.support.script_helper import assert_python_ok, assert_python_failure
import random
import sys
import _thread
import threading
import... |
main.py | import time
import threading
import tkinter as tk
from tkinter import ttk, PhotoImage
class PomodoroTimer:
def __init__(self):
self.root = tk.Tk()
self.root.geometry('600x300')
self.root.title('Pomodoro Timer')
self.root.tk.call('wm', 'iconphoto', self.root._w, PhotoImage(file='tom... |
multi_thread.py | import copy
import inspect
import os
import pickle
import threading
import time
import numpy as np
import prettytable as pt
from ..experiment import StateIO
from ..index import IndexCollection, MultiLabelIndexCollection
from ..index.multi_label_tools import check_index_multilabel
from ..utils.interface import BaseColl... |
rpc.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... |
env_wrappers.py | """Env wrappers
Most common wrappers can be checked from following links for usage:
`https://pypi.org/project/gym-vec-env`
`https://github.com/openai/baselines/blob/master/baselines/common/wrappers.py`
"""
from collections import deque
from functools import partial
from multiprocessing import Pipe, Process, cpu_coun... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
empty_a3c.py | import multiprocessing as mp
import ctypes
import copy
import numpy as np
import chainer
from chainer import functions as F
from chainer import links as L
# This sample spread params of master network to workers
# and set gradients of master network to those of workers
# meaningless dummy network
class DummyNet(chain... |
scheduler_job.py | # pylint: disable=no-name-in-module
#
# 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, Versio... |
server.py | """Fix TCP server module."""
import errno
import socket
import select
import threading
import queue
from testplan.common.utils.timing import (
TimeoutException,
TimeoutExceptionInfo,
wait,
)
from testplan.common.utils.sockets.fix.utils import utc_timestamp
class ConnectionDetails(object):
"""
Co... |
kblogging.py | """
Common narrative logging functions.
To log an event with proper metadata and formatting use 'log_event':
You can also do free-form logs, but these will be ignored by
most upstream consumers.
"""
__author__ = 'Dan Gunter <dkgunter@lbl.gov>'
__date__ = '2014-07-31'
import collections
import logging
from logging ... |
iptestcontroller.py | # -*- coding: utf-8 -*-
"""IPython Test Process Controller
This module runs one or more subprocesses which will actually run the IPython
test suite.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2009-2011 The IPython Development Team
#
# Distributed under the t... |
test_parallel_v6.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 00:38:19 2020
@author: s150127
"""
# import sys
import numpy as np
from pims import ND2_Reader # reader of ND2 files
import time
import multiprocessing as mp
import os
import _code.fitters as fitting
import _code.roi_finding as roi_finding
import _code.tools as tools
... |
car_client.py | """
此模块做停车管理系统的客户端
Author:Recall
Date: 2018-10-19
module: socket、multiprocessing、sys、os、time、signal
Email:
"""
from socket import *
from setting import *
from messageAff import user_message
from multiprocessing import Process
import sys,os,time,signal
class carClient(object):
def __init__(self):
self.so... |
Multi_Process.py | # Unix/Linux 提供一个fork()函数调用, 普通函数调用调用一次返回依次
# fork()调用一次返回两次, 因为操作系统把当前进程(父进程)复制一份(子进程)
# 然后分别在父进程和子进程内返回, 子进程永远返回0, 父进程返回子进程的ID
# Python的os模块里封装了常见的系统调用, 其中就包括fork
'''
import os
print('Process (%s) start...' % os.getpid())
# Only works on Unix/Mac:
# pid = os.fork()
# if pid == 0:
# print('I am child Process (%s) an... |
run.py | #!/usr/bin/env python
import sys
import logging
import logging.config
from slackbot.bot import Bot
import slackbot_settings
from flask import Flask
import threading
from webapp import routes
def main():
kw = {
'format': '[%(asctime)s] %(message)s',
'datefmt': '%m/%d/%Y %H:%M:%S',
'level'... |
Main.py | import random
from tkinter.ttk import Labelframe
from gtts import gTTS
import playsound
import os
from tkinter import *
from functools import partial
import threading
import sys
global lpn
global lon
global aog
lon = []
def speaktext(ftghv, lang, fn):
try:
if fn is None:
o = gTTS(text=ftghv,... |
gui.py | import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
import geneticalgorithm as ga
from tkinter import *
from tkinter import filedialog
import os
import threading
import copy
import population as pop
import sett... |
test_celery.py | import threading
import pytest
pytest.importorskip("celery")
from sentry_sdk import Hub, configure_scope
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk._compat import text_type
from celery import Celery, VERSION
from celery.bin import worker
@pytest.fixture
def connect_signal(request... |
base.py | # vim:ts=4:sts=4:sw=4:expandtab
from copy import deepcopy
import datetime
import grp
import io
import json
import logging
import os
import pathlib
import pwd
import shutil
import sys
import tempfile
import threading
import time
from kolejka.judge import config
from kolejka.judge.exceptions import *
from kolejka.jud... |
soundmain2.py | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 10 16:45:42 2019
@author: ASUS PC
"""
from flask import Flask, render_template, Response, stream_with_context
import time
from threading import Lock, Thread
import queue
import socket
import math
from datetime import datetime
import audioop
from thre... |
distributed_train.py | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the 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.
import o... |
call.py | # Copyright (c) 2014-2015, Ruslan Baratov
# All rights reserved.
# Adapted to python3 version of: http://stackoverflow.com/questions/4984428
import os
import platform
import subprocess
import sys
import threading
import time
# Tests:
#
# Windows:
# * Control Panel -> Region -> Administrative -> Current languange for... |
server.py | #!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import os
from datetime import datetime
import shutil
import threading
import signal
import watchdog
from watchdog.events import PatternMatchingEventHandler
from watchdog.observers import Observer
import build_pipeline.build
refresh_js_path = os.path.j... |
hosting.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Your bot is ready"
def run():
app.run(host="0.0.0.0", port=8000)
def keep_running():
server = Thread(target=run)
server.start() |
test_warnings.py |
import unittest
import threading
import warnings
import src.warnings as gr_warnings
# Some exemplary warnings for testing:
test_warning = gr_warnings.NotAWordWarning
test_warning2 = gr_warnings.NotAPersonNounWarning
test_warning_text = "warn warn warn"
# testing classes:
class TestGlobals(unittest.TestCase):
... |
hello.py | import os
import sys
import inspect
import uuid
import time
import json
import base64
import numpy
import numpy as np
from threading import Thread
import tensorflow as tf
from keras.models import model_from_json
from flask import Flask, request, jsonify
import redis
try:
import preprocessing as prepmod
if hasat... |
base_camera.py | import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a new frame is
... |
taobaoitem.py | import time,leveldb
from urllib.parse import quote_plus
import re,json,sys
import itertools,requests
from queue import Queue
from threading import Thread
URL_BASE = 'http://s.m.taobao.com/search?q={}&n=200&m=api4h5&style=list&page={}'
def url_get(url):
# print('GET ' + url)
header = dict()
header['Acce... |
video_processing.py | from .video_capture import VideoCapture
import collections, datetime, numpy as np, threading, cv2, time, json, PIL.Image
import torch
import torchvision.transforms as transforms
from torch2trt import TRTModule
# https://github.com/NVIDIA-AI-IOT/trt_pose
import trt_pose.coco
from trt_pose.draw_objects import DrawObje... |
test_runner.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file acc... |
test_s3.py | from cStringIO import StringIO
import boto.exception
import boto.s3.connection
import boto.s3.acl
import boto.s3.lifecycle
import bunch
import datetime
import time
import email.utils
import isodate
import nose
import operator
import socket
import ssl
import os
import requests
import base64
import hmac
import sha
import... |
client.py | import socket
import threading
import pyaudio
class Client:
def __init__(self):
pass
def start(self, ip: str, port: int):
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
self.target_ip = ip
self.target_port = port
self.s.connect((sel... |
lora.py | import ctypes
import time
import os, signal
from multiprocessing import Process, active_children
from ctypes import cdll
lib = cdll.LoadLibrary('./lora-ttn.so')
# call C function for resetting Lora MAC state
def reset_lmic():
lib.reset()
def run_lora(str):
s = str.encode('utf-8')
lib.start_loop.argtypes ... |
imagenet_infer_reference_eval.py | # Copyright (c) 2018 Preferred Networks, Inc. All rights reserved.
import argparse
import math
import multiprocessing
import time
import cv2
import chainer
import chainer.links.caffe
import cupy
import numpy
if hasattr(time, 'perf_counter'):
timer = time.perf_counter # py3
else:
timer = time.time # py2... |
tello_states.py | import threading
from threading import Thread
import socket
import time
import netifaces
import netaddr
from netaddr import IPNetwork
from collections import defaultdict
from stats import Stats
import binascii
from time import sleep
import curses
class Tello_States:
def __init__(self):
self.local_ip = ''
... |
engine.py | """
Main BZT classes
Copyright 2015 BlazeMeter 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... |
forms.py | import smtplib
from threading import Thread
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.template import Context
from django.template.loader import get_template
from .settings import SUPPORT_EMAIL, SUPPORT_EMAIL_SUBJECT, SUPPORT_WAIT_SEND
def send_support... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 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... |
hod.py | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.conf import settings
from django.core.mail import send_mail, EmailMessage
from django.core.paginator import Pagi... |
topoplanner.py | #!/usr/bin/env python
"""
Topological planner
"""
import argparse
import random
import yaml
import rospy
import networkx as nx
import numpy as np
import webcolors
from termcolor import colored
from robot import Robot
from threading import Thread
from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion
... |
sudoku.py | from solver import Solver
from printer_utils import pretty_print, get_grid_from_filepath
import pygame as pg
import threading as thr
from typing import List, Optional, Tuple
class Sudoku:
def __init__(self, filepath: str):
self.model : List[List[Optional[int]]] = get_grid_from_filepath(filepath)
... |
cli.py | import numpy as np
from multiprocessing import Process
from lib.cli.RLTraderCLI import RLTraderCLI
from lib.util.logger import init_logger
from lib.cli.functions import download_data_async
from lib.env.reward import BaseRewardStrategy, IncrementalProfit, WeightedUnrealizedProfit
np.warnings.filterwarnings('ignore')
... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import Unic... |
simple_action_state.py |
import roslib; roslib.load_manifest('smach_ros')
import rospy
import threading
import traceback
import copy
from actionlib.simple_action_client import SimpleActionClient, GoalStatus
import smach
from smach.state import *
__all__ = ['SimpleActionState']
class SimpleActionState(State):
"""Simple action client s... |
emulated_battery.py | from pyfmi import load_fmu
import yaml
import numpy as np
import asyncio
from flask import Flask, jsonify
import threading
class Emulated_Battery:
def __init__(self, config_file='battery_config.yaml'):
with open(config_file) as fp:
self.config = yaml.safe_load(fp)
self._initial_SOC = ... |
TrainDataIterator.py | import numpy as np
from multiprocessing import Process, Queue
from mxnet.io import DataIter, DataBatch
import mxnet as mx
import numpy as np
from mxnet.io import DataIter
from PIL import Image
import os
import preprocessing
import logging
import sys
#rgb_mean=(140.5192, 59.6655, 63.8419), #mean on tote trainval
cla... |
PcapParser.py | # Copyright (C) 2016 Manmeet Singh, Maninder Singh, Sanmeet kour
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWA... |
connection.py | import datetime
import threading
from threading import Thread
import serial
class Connection:
def __init__(self, name:str = "", address:str = "", socketio = None, isvirtual: bool=False):
self.name = name
self.address = address
self.isvirtual = isvirtual
self.socketio_reference = ... |
scheduler.py | import time
from multiprocessing import Process
from flask1 import *
from crawl import *
from test import *
from setting import *
class Scheduler():
def schedule_tester(self, cycle=TESTER_CYCLE):
"""
定时测试代理
"""
tester = Tester()
while True:
print(... |
virtual.py | from erlport.erlterms import Atom
from erlport.erlang import cast, call
from octoprint.plugin import plugin_manager
from octoprint.plugins.virtual_printer import VirtualPrinterPlugin
from octoprint.plugins.virtual_printer.virtual import VirtualPrinter, VirtualEEPROM
from threading import Thread
import asyncio
import ... |
test_sys.py | import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support imp... |
python_ls.py | # Copyright 2017 Palantir Technologies, Inc.
import logging
import socketserver
import threading
from pyls_jsonrpc.dispatchers import MethodDispatcher
from pyls_jsonrpc.endpoint import Endpoint
from pyls_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter
from . import lsp, _utils, uris
from .config impor... |
tcp_port_scan.py | #!/usr/bin/python3
import sys
import socket
from multiprocessing import Process
max_port = 3000
min_port = 1
target_host = sys.argv[1]
def port_scan(target_host, port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
return_code = sock.connect_ex((target_host, port))
sock.close()
if not r... |
worker.py | # Copyright (c) 2020 DeNA Co., Ltd.
# Licensed under The MIT License [see LICENSE for details]
# worker and gather
import random
import threading
import time
import functools
from socket import gethostname
from collections import deque
import multiprocessing as mp
import pickle
from .environment import prepare_env, ... |
telemetry_server.py | #
# Copyright 2019 Games Creators Club
#
# MIT License
#
from telemetry import *
import functools
import os
import threading
import traceback
import uuid
DEBUG = False
class TelemetryServer:
def __init__(self):
self.streams = {}
self.stream_ids = {}
self.next_stream_id = 0
def regi... |
create_api.py | from flask import Flask, request, Response
from multiprocessing import Process
from os.path import join, dirname
from inspect import getmembers, getargspec
import socket
import threading
try:
from utils import callfunc
except Exception as e:
from .utils import callfunc
class CreateApi:
def __init__(self,... |
test_poll.py | # Test case for the os.poll() function
import os
import random
import select
try:
import threading
except ImportError:
threading = None
import time
import unittest
from test.test_support import TESTFN, run_unittest, reap_threads, cpython_only
try:
select.poll
except AttributeError:
raise unittest.Skip... |
pong_v0b.py | import pygame
import threading
import time
from empty_display import EmptyDisplay
import lib.colors as Color
WIDTH = 0
HEIGHT = 1
class BallPosition:
x = 1
class Ball(pygame.sprite.Sprite):
def __init__(self,
color,
width,
height,
initi... |
test_dbapi.py | # pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of t... |
4_edf_bankers_gui.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import ping_code as pc
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import getpass as gp
import psutil
from drawnow import *
fr... |
arch.py | global program_name
program_name = "Arch v4.22.21"
from threading import Thread
import tkinter
import tkinter.ttk
from tkinter import ttk
import tkinter.font
import tkinter.filedialog
from tkinter import messagebox
from audioplayer import AudioPlayer
import pyglet
try:
pyglet.font.add_file('Lato-Li... |
test_sending.py | # -*- coding: utf-8 -*-
import os
import signal
import threading
import multiprocessing
from unittest import skip
from unittest.mock import patch
from django.test import TestCase, TransactionTestCase
from django.conf import settings
from django.core.cache import cache
from django.core.management import call_command
fr... |
_a4c_start.py |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify im... |
test_thread_local.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 u... |
core.py | # Copyright 2018 John Reese
# Licensed under the MIT license
import asyncio
import sys
import time
from unittest import TestCase
from unittest.mock import patch
import aiomultiprocess as amp
from aiomultiprocess.tests.base import (
async_test,
do_nothing,
get_dummy_constant,
initializer,
raise_fn,... |
test_flight.py | # -*- coding: utf-8 -*-
# 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
# "... |
wiiboard.py | #!/usr/bin/env python
import collections
import time
import bluetooth
import sys
import subprocess
import threading
import numpy as np
# --------- User Settings ---------
WEIGHT_SAMPLES = 10
# ---------------------------------
# Wiiboard Parameters
CONTINUOUS_REPORTING = "04" # Easier as string with leading zero
C... |
rpotter.py | #/usr/bin/python
# -*- coding: utf-8 -*-
'''
_\
\
O O-O
O O
O
Raspberry Potter
Ollivander - Version 0.2
Use your own wand or your interactive Harry Potter wands to control the IoT.
Copyright (c) 2016 Sean O'Brien. Permission is hereby granted, free of charge, to any person obtaining a copy of this soft... |
test_httplib.py | import errno
from http import client
import io
import itertools
import os
import array
import socket
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Self-signed cert fil... |
data_queue.py | # coding=utf-8
# Copyright (C) ATHENA 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.