source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
planetcycles.py | from sys import stdin
from collections import defaultdict, deque
from threading import Thread
def bfs(t, graph, visited):
visited[t] = True
# parent[t] = -1
q = deque()
q.append(t)
clen = 0
st = set()
while len(q) > 0:
node = q.popleft()
st.add(node)
... |
tello.py | """Library for interacting with DJI Ryze Tello drones.
"""
# coding=utf-8
import logging
import json
import socket
import time
from threading import Thread
from typing import Optional, Union, Type, Dict
from datetime import datetime
import cv2 # type: ignore
from .enforce_types import enforce_types
threads_initializ... |
test_imperative_signal_handler.py | # Copyright (c) 2019 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 appli... |
client_udp2.py | import os
import socket
import threading
from tzlocal import get_localzone
code_table = 'utf-8'
name = input("Username. No more then 16 symbols: ")
if len(name) > 16:
print("No more then 16 symbols, try again")
name = input("Username: ")
hostS = 'networkslab-ivt.ftp.sh'
hostL = '127.0.0.1'
port... |
tasks.py | from ctypes import c_char_p
import logging
import traceback
from multiprocessing import Semaphore, Condition, Lock, Value, Pipe, Process
class Task:
class State:
def __init__(self):
pass
NEW = 'NEW'
RUNNING = 'RUNNING'
DONE = 'DONE'
FAILED = 'FAILED'
def... |
random_shuffle_queue_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... |
db_reader_window.py | #!/usr/bin/env python
# System modules
import sys
import os,stat
import shutil
import time
import threading
import gtk
import gtk.glade
import unittest
# TREX modules
import TREX.util
from TREX.widgets_gtk import trex_glade_path
from TREX.core.assembly import Assembly
from TREX.io.db_reader import DbReader
######... |
host.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... |
Gtest.py | import cv2
import numpy as np
from multiprocessing import Process
def send():
cap_send = cv2.VideoCapture('videotestsrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! appsink', cv2.CAP_GSTREAMER)
out_send = cv2.VideoWriter('appsrc ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=s... |
gui.py | import datetime
import errno
import gettext
import itertools
import json
import locale
import os
import queue
import signal
import subprocess
import sys
import threading
import wx
import wx.adv
import openslides
from openslides.utils.main import (
detect_openslides_type,
get_default_user_data_dir,
Portab... |
test_run_tracker.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import http.server
import json
import threading
from urllib.parse import parse_qs
from pants.auth.cookies import Cookies
from pants.goal.run_tracker import RunTracker
from pants.util.cont... |
__init__.py | import sys
import socket
import threading
import subprocess
import errno
from pkg_resources import resource_string
import io
import paramiko
try:
import queue
except ImportError:
import Queue as queue
import logging
from .util import *
from .stream import *
class ServerInterface(paramiko.ServerInterface):
... |
pid_test.py | '''
Created on 12/04/2015
@author: david
'''
from math import sin, cos
import random
from threading import Thread
import time
from flight.stabilization.pid import PID
class SensorReader(object):
def __init__(self, readDelegate):
self._readDelegate = readDelegate
d... |
irc.py | # IRC Crawler
# Jimmy Trimer
import socket
import time
import datetime
import threading
#from darkweb.modules.base
from darkweb.modules.base.crawler import Crawler
from darkweb.modules.base.result import *
from darkweb.modules.base.crawlerconfig import *
#from crawler import Crawler
#from result import *
#from crawler... |
azync.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import threading
__all__ = ['await_callback']
class ThreadExceptHookHandler(object):
"""Workaround to deal with a bug in the Python interpreter (!).
Report: http://bugs.python.org/issue1... |
vehicle.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 10:44:24 2017
@author: wroscoe
"""
import time
from statistics import median
from threading import Thread
from prettytable import PrettyTable
try:
from ROAR.ROAR_Jetson.memory import Memory
except:
from memory import Memory
class PartP... |
game-client.py | import socket
import threading
import subprocess
class Client:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
message = ""
server_address = 0
player_number = 0
def welcome(self):
print("Welcome, please enter the address of the connection you want to reach")
try:
address = input("Address: ")
por... |
videoovercrow.py | #!/usr/bin/env python3
import io
import numpy as np
import cv2
from PIL import Image
import pycrow as crow
import threading
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 320);
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 240);
cap.set(cv2.CAP_PROP_SATURATION,0.2);
crow.create_udpgate(12, 10011)
addr = ".12.1... |
poor_mans_profiler_gdb.py | import threading
import time
import signal
import os
debug = True
gdb.execute('set pagination 0')
def log(*msg):
if debug:
print(*msg)
def pause_after_sec(secs, end):
global pausestart
log("Thread starting. Stopping after %ss" % secs)
time.sleep(end-time.time())
# stop running gdb by send... |
example_test.py | from __future__ import unicode_literals
from tiny_test_fw import Utility
import os
import serial
import threading
import time
import ttfw_idf
class SerialThread(object):
'''
Connect to serial port and fake responses just like from a real modem
'''
# Dictionary for transforming received AT command to ... |
headless.py | """
A simple voice-enabled client that has no user interface. It currently supports
keyword-based activation through either pocketsphinx or
`snowboy <https://snowboy.kitt.ai/>`_ models.
.. warning::
This client is experimental and is currently under active development.
Requirements
++++++++++++
* Requires a worki... |
04-tank-switchable.py | #!/usr/bin/env python3
# Functionality:
# IR channel 0: normal tank
# IR channel 1: fast tank
# IR channel 2: slow tank
# backspace -> exit
# down -> toggle color saying
# up -> follow the current color
import math
import logging
import threading
import signal
import time
import ev3dev.ev3 as ev3
import sys
fro... |
ScreenBroadcast.py | from PyQt5.QtCore import QObject
from PyQt5.QtGui import QImage, QPixmap
from Module.Packages import ScreenBroadcastFlag
import socket
import struct
import zlib
from threading import Thread, Lock
from queue import Queue
import logging
class ScreenBroadcast(QObject):
def __init__(self, parent, current_ip, socket_i... |
tasks.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Miguel Grinberg <miguelgrinberg50@gmail.com>
#
# Distributed under terms of the MIT license.
import threading
import time
import uuid
from datetime import datetime
from flask import current_app, request
from flask_restful import Resou... |
tcpserver.py | #!/usr/bin/env python3
import errno
import os
import signal
import socket
import struct
import sys
import threading
import time
from optparse import OptionParser
from fprime.constants import DATA_ENCODING
try:
import socketserver
except ImportError:
import SocketServer as socketserver
__version__ = 0.1
__d... |
networking.py | import ast
import asyncio
import ipaddress
import socket
from abc import abstractmethod
from argparse import Namespace
from threading import Thread
from typing import Optional
import grpc
from jina.logging.logger import JinaLogger
from jina.proto import jina_pb2_grpc
from jina.types.message import Message
from .. imp... |
base_use.py | import os
import time
from multiprocessing import Process
def me_process(process_name):
time.sleep(3)
print('current process name is : {} **** pid is {}'.format(process_name, os.getpid()))
class MeProcess(Process):
def __init__(self, name, *args, **kwargs):
super().__init__(*args, **kwargs)... |
Robot.py | __author__ = 'Edward J. C. Ashenbert'
import sys
import threading
import time
import serial
from NavigationSystem.UtilitiesMacroAndConstant import *
import datetime
import numpy as np
class Robot:
def __init__(self, port, baud_rate):
try:
print("Opening serial port: %s..." % port + ".")
... |
context-info-callback.py | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in global_info_callback in
# src/ssl/context.c. In 0.7 and earlier, this will somewhat reliably
# segfault or abort after a few dozen to a few thousand iterations on an SMP
# machine (generally not on a UP machine)... |
index.py | #!/usr/bin/pypy3
#!/usr/bin/python3
from http.client import HTTPSConnection
from base64 import b64encode
import json
import mysql.connector
from datetime import datetime, timedelta
from threading import Thread
import cgi
class ukcompanieshouse:
URL = 'api.companieshouse.gov.uk'
KEY = ''
def __init__... |
app.py | """
import tkinter as tk
from tkinter.ttk import *
import tkinter.font as font
import tkinter.scrolledtext as tkst
"""
import subprocess
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver
import socket
from io import BytesIO
import threading
import requests
import os
import signal
import cod... |
multiprocess_logging.py | import socket
import threading
import multiprocessing as mp
import multiprocessing.connection as mpc
import logging
import sys
import signal
import time
import os
from pipeline_cluster import util
def _handle_connection(conn, caddr):
while True:
try:
msg = conn.recv()
logging.debug... |
SerialHandler.py | from PyQt5.Qt import *
import threading
import serial
import time
from collections import namedtuple
from MotorCommand import MotorCommand
from array import array
from io import BytesIO
from struct import *
"""
Class Serial handler
This class opens a serial device with the defined port and baudrate
and keeps emit... |
server.py | from flask import Flask,jsonify
import flask
import threading
import time
app = Flask(__name__)
k=1
threads=[]
def thread_function(name):
t = threading.currentThread()
while getattr(t, "do_run", True):
print("work ",name)
time.sleep(name)
@app.route('/strat')
def hello_world():
global k
... |
handler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/5/25 0025 14:52
# @Author : Hadrianl
# @File : handler.py
# @Contact : 137150224@qq.com
import pymongo as pmo
from .utils import logger, handler_profiler, zmq_ctx
from threading import Thread, Timer
from abc import abstractmethod
import zmq
import p... |
unit.py | import os
import re
import ssl
import sys
import json
import time
import shutil
import socket
import select
import argparse
import platform
import tempfile
import unittest
import subprocess
from multiprocessing import Process
class TestUnit(unittest.TestCase):
pardir = os.path.abspath(os.path.join(os.path.dirname... |
data_util.py | '''
this file is modified from keras implemention of data process multi-threading,
see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py
'''
import multiprocessing
import threading
import time
import numpy as np
try:
import queue
except ImportError:
import Queue as queue
class Generato... |
photos.py | # -*- coding: UTF-8 -*-
from .core import *
class Photos(object):
def __init__(self, ProxyDictionary, keywords=[], *args):
self.keywords = keywords
self.ProxyDictionary = ProxyDictionary
self.photos_queue = Queue()
def _loadAlbumsPage(self, page_num):
# url example:
... |
thread_demo.py | from threading import Thread, current_thread
def thread_test(name):
print("thread {} is running...".format(current_thread().name))
print("hello ", name)
print("thread {} ended".format(current_thread().name))
if __name__ == '__main__':
print("thread {} is running...".format(current_thread().name))
... |
util.py | # -*- coding: utf-8 -*-
import random
import re
import string
import threading
import traceback
import warnings
from typing import Any, Callable, List, Dict, Optional, Union
# noinspection PyPep8Naming
import queue as Queue
import logging
from telebot import types
try:
import ujson as json
except ImportError:
... |
mitzonURLCmdProcessor.py | import logging
import logging.handlers
import logging.config
import sys, traceback
import cherrypy
# try:
from cheroot.wsgi import Server as WSGIServer
# except ImportError:
#from cherrypy.wsgiserver import CherryPyWSGIServer as WSGIServer
from MitzonBackend.Sensor import Sensor
from MitzonBackend.Constants import *
f... |
runners.py | # -*- coding: utf-8 -*-
import locale
import os
import struct
from subprocess import Popen, PIPE
import sys
import threading
import time
from .util import six
# Import some platform-specific things at top level so they can be mocked for
# tests.
try:
import pty
except ImportError:
pty = None
try:
import ... |
Analysis.py | """
This module contains the ``analysis`` class.
It includes common classes for file management and messaging and all
calls to AEDT modules like the modeler, mesh, postprocessing, and setup.
"""
from __future__ import absolute_import # noreorder
import os
import shutil
import threading
import warnings
from collecti... |
reapply_constraints.py | #!/usr/bin/env python
import argparse, psycopg2, sys, time
from multiprocessing import Process
parser = argparse.ArgumentParser(description="Script for reapplying additional constraints managed by pg_partman on child tables. See docs for additional info on this special constraint management. Script runs in two distin... |
spaceteam.py | import random
from server import Command, commands
from proto.spaceteam_pb2 import SpaceteamPacket
from threading import Thread
BASE_TIME = 50
LOSE_POINTS = 0
WIN_POINTS = 200
POINT_INCREMENT = 15
POINT_DECREMENT = 15
class SpaceTeam:
def __init__(self, lobby, server):
self.lobby = lobby
self.server = ser... |
ConnectSpecCamera.py | # -- coding: utf-8 --
import time
import sys
import threading
import msvcrt
from ctypes import *
sys.path.append("../MvImport")
from MvCameraControl_class import *
g_bExit = False
# 为线程定义一个函数
def work_thread(cam, pData):
stOutFrame = MV_FRAME_OUT()
memset(byref(stOutFrame), 0, sizeof(stOutFrame))
whi... |
test_state.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import shutil
import sys
import tempfile
import textwrap
import threading
import time
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.h... |
sniffing_service.py | from __future__ import absolute_import
import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
import threading
from threading import Lock
from topology.sniffer.daemon import SniffingDaemon
from topology.sniffer.devices import open_connection
from serv... |
conftest.py | import pytest
import math
@pytest.fixture(scope='function')
def IpcServer():
from gpopup import ipc
from random import randint
val = ipc.Server._default_sock_name()
rando = '_' + '{:d}'.format(randint(0, int(1e6)))
class _IpcServer(ipc.Server):
@classmethod
def _default_sock_name(cl... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017-2020 The Zelantus Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test zelantusd shutdown."""
from threading import T... |
launch_two.py | from server import Main as Server
from tkinter.font import Font
from random import randint
from tkinter import *
import threading
import socket
import select
from client import Main as client
from time import sleep
def StartClient1():
main1 = client()
def StartClient2():
main2 = client()
threading.Thread(tar... |
conftest.py | import os
import shutil
import pytest
from time import sleep
import multiprocessing
from grpc import RpcError
from multiprocessing import Process
from teos.teosd import main
from teos.cli.teos_cli import RPCClient
from common.cryptographer import Cryptographer
from test.teos.conftest import config
multiprocessing.set... |
views.py | # Django related libs
from django.shortcuts import render
from django.http import StreamingHttpResponse
from django.core.files.base import ContentFile
from django.core.files import File
#libraries existing in the project
from .models import Image
from .forms import ImageForm, TempForm
from backend.settings import BAS... |
serve.py | import abc
import argparse
import importlib
import json
import logging
import multiprocessing
import os
import platform
import subprocess
import sys
import threading
import time
import traceback
import urllib
import uuid
from collections import defaultdict, OrderedDict
from itertools import chain, product
from typing i... |
portable_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... |
vehicle_detection_node.py | #!/usr/bin/env python
from copy import deepcopy
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import BoolStamped
from geometry_msgs.msg import Point32
from mutex import mutex
from sensor_msgs.msg import CompressedImage, Image
from std_msgs.msg import Float32
import cv2
import numpy as np
import... |
temperature_server_IOC copy.py | """Temperature controller server
The server communicates with Lightwave( previously known as temperature controller IOC) and Oasis IOC to synchronize the temperature changes.
Authors: Valentyn Stadnydskyi, Friedrich Schotte
Date created: 2019-05-08
Date last modified: 2019-05-14
"""
__version__ = "0.1" # Friedrich Sch... |
test_running.py | # Copyright 2019 The PlaNet 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 applicable... |
mod_modPackInformer.py | # -*- coding: utf-8 -*-
import json
import os
import threading
import urllib
import urllib2
import BigWorld
import ResMgr
from gui.Scaleform.daapi.view.dialogs import DIALOG_BUTTON_ID, ConfirmDialogButtons, SimpleDialogMeta
from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView
from gui import DialogsInterface... |
auth_server.py | #!/usr/bin/env python
# Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import base64
import collections
import http.server
import json
import logging
import os
import re
import socketserver
impor... |
train.py | #! /usr/bin/env python3
"""
PPO: Proximal Policy Optimization
Written by Patrick Coady (pat-coady.github.io)
Modified by Tin-Yin Lai (wu6u3) into asynchronous version
PPO uses a loss function and gradient descent to approximate
Trust Region Policy Optimization (TRPO). See these papers for
details:
TRPO / PPO:
htt... |
audiocontrol2.py | '''
Copyright (c) 2019 Modul 9/HiFiBerry
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, distribu... |
demo02.py |
from multiprocessing import JoinableQueue,Process
def customer (queue) :
while True:
r = queue.get()
print("消费:" + r)
queue.task_done() # 消费完成, 通知继续生产
def product(queue,name) :
for i in range(10):
queue.put(name)
print("生产骨头")
queue.join() # 阻塞当前,让队列中其他执行
if... |
main.py | #!/usr/bin/env python3
import argparse
import threading
from time import sleep
import cv2
import depthai as dai
import socket
from common import target_finder
from common.config import NN_IMG_SIZE
from pipelines import object_tracker_detection, object_edge_detection
import logging
from common.mjpeg_stream import Mj... |
service_streamer.py | # coding=utf-8
# Created by Meteorix at 2019/7/13
import logging
import multiprocessing
import os
import threading
import time
import uuid
import weakref
import pickle
from queue import Queue, Empty
from typing import List
from redis import Redis
from .managed_model import ManagedModel
TIMEOUT = 1
TIME_SLEEP = 0.001... |
tcp.py | # -*- coding: utf-8 -*-
'''
TCP transport classes
Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})"
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
import logging
import msgpack
import socket
import os
import weakref
import ti... |
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... |
udp.py | import logging
import socket
import sys
import threading
import hooker
from relay import status
hooker.EVENTS.append([
"udp.start",
"udp.pre_recv",
"udp.post_recv",
"udp.pre_c2s",
"udp.post_c2s",
"udp.pre_s2c",
"udp.post_s2c",
"udp.stop"
])
_KILL = False
_RELAYPORT = 0
_REMOTEADDRESS... |
main.py | import os
import sys
def resource_path(file):
try:
directory = os.path.abspath(sys._MEIPASS)
except:
directory = os.path.abspath('.')
return os.path.join(directory, file)
from kivy.config import Config
Config.set('graphics', 'maxfps', '5000')
Config.set('input', 'mouse', 'mouse,disable_mult... |
moviepy_test.py | #!/usr/bin/env python3
from pathlib import Path
from mpl_toolkits.mplot3d import Axes3D
import rospy
import glob
import numpy as np
import matplotlib.pyplot as plt
import mayavi.mlab as mlab
import moviepy.editor as mpy
import torch
from multiprocessing import Process
from pcdet.config import cfg, cfg_from_yaml_file
... |
ProcessLineReaderWin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@copyright: (c)Copyright 2013, Intel Corporation All Rights Reserved.
The source code contained or described here in and all documents related
to the source code ("Material") are owned by Intel Corporation or its
suppliers or licensors. Title to the Material remains wi... |
ProjectServer.py | from typing import List, Optional, Tuple
from collections import defaultdict
import pickle
import json
from os import path
import threading
import click
from tqdm import tqdm
from flask import Flask, jsonify, request
from qanta.ProjectModel import *
from qanta.ProjectDataLoader import *
from qanta import util
if (t... |
dbx.py | from __future__ import print_function
import base64
import copy
import json
import os
import time
from builtins import object, str
from textwrap import dedent
from typing import List
import dropbox
from pydispatch import dispatcher
from empire.server.common import encryption, helpers, templating
from empire.server.d... |
utils.py | from bitcoin.core import COIN # type: ignore
from bitcoin.rpc import RawProxy as BitcoinProxy # type: ignore
from bitcoin.rpc import JSONRPCError
from contextlib import contextmanager
from pathlib import Path
from pyln.client import RpcError
from pyln.testing.btcproxy import BitcoinRpcProxy
from collections import Or... |
rdma.py | # Windows Azure Linux Agent
#
# Copyright 2016 Microsoft 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 ... |
test_threads.py | import threading
import timeit
from restkit import *
#set_logging("debug")
urls = [
"http://yahoo.fr",
"http://google.com",
"http://friendpaste.com",
"http://benoitc.io",
"http://couchdb.apache.org"]
allurls = []
for i in range(10):
allurls.extend(urls)
def fetch(u):
... |
test_collection.py | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from... |
endpoint.py | # Copyright 2012 the V8 project authors. 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 must retain the above copyright
# notice, this list of conditi... |
sock4.py | import socket
import select
import socketserver
import logging
import json
#import http
from multiprocessing import Process
with open('config.json', 'rb') as f:
config = json.load(f)
#port = int(config['loaclport'])
serverdd = config['server']
port = int(config['port'])
pss = config['passw... |
compliancetest.py | import os
import threading
import shutil
import lockfile
class ComplianceTest(object):
def __init__(self):
self.saved_class = lockfile.LockFile
def _testfile(self):
"""Return platform-appropriate file. Helper for tests."""
import tempfile
return os.path.join(tempfile.gettempd... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
ssl = None
imp... |
visual.py | from threading import Condition, Thread
from time import sleep
from tkinter import Tk, Canvas, Frame, BOTH, TclError, font
from adversary import RandomAdversary
from arguments import parser
from board import Board, Direction, Rotation, Action, Shape
from constants import BOARD_HEIGHT, BOARD_WIDTH, DEFAULT_SEED,... |
spamhandling.py | import sys
from threading import Thread
from findspam import FindSpam
from datahandling import *
from parsing import get_user_from_url, unescape_title,\
escape_special_chars_in_title, to_protocol_relative
from globalvars import GlobalVars
from datetime import datetime
from parsing import url_to_shortlink, user_url_... |
audioTNC.py | '''
Created on Sep 26, 2016
@author: matth
'''
#plan
# auto find com port (atelast ask for port number)
# verify that port is good
# background thread the serial read
'''
import serial
import threading
from threading import Thread
from queue import Queue
import AFSK.afsk as afsk
class AudioTNC():
def... |
runCrawler.py | # !/usr/bin/python3.6
# -*- coding: UTF-8 -*-
# @author: guichuan
from scrapy.utils.project import get_project_settings
import sys
path = r'/home/alex/桌面/Python/Project/Spider_Project/GubaCrawler'
sys.path.append(path)
from GubaCrawler.spiders.createEastMoneySpider import EastMoneySpider
from scrapy.crawler import Craw... |
client.py | import socket
import sys
import time
from tkinter import *
from threading import Thread
def showMultilineMsg(message_div, message_to_display): # displays multiline messages one line at a time as tkinter does not understand the line break \n symbol
message_div.insert(END, ' ')
for item in message_to_display.split('\... |
web_server.py | import functools
import logging
import random
import socketserver
import time
from multiprocessing.context import Process
from tradingkit.utils.request_handler import RequestHandler
class WebServer:
@staticmethod
def serve(routing: dict, open_browser=False, timeout=None, filename=''):
p = Process(ta... |
AVR_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official AVR Miner 2.74 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from os import _exit, execl, mkdir
from os import name as osname
from os import path
from os import system as ossystem
from platform impor... |
reTestIP.py | import redis
from tools.common import test_http_proxy
import threading
def http_task():
# 连接redis数据库
POOL = redis.ConnectionPool(host='127.0.0.1', port=6379)
CONN_REDIS = redis.Redis(connection_pool=POOL)
# 取出一个ip进行测试
# proxy = CONN_REDIS.("freeProxy:AfterVerifyOKhttp")
ip = CONN_REDIS.srandme... |
step.py | """Copyright 2017-2017 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" file accompanyi... |
smoketest.py | """
Agent smoketest code.
This python script is meant to be invoked within a docker image in which the proper python version is activated (e.g.
via pyenv). In this way, the agent can be validated against different python versions.
Concept:
This code serves as a common code-base for different types of smoketest "... |
monitor.py | """
JobMon - Job Monitoring
=======================
Controls and monitors child processes - this handles both starting and stopping
subprocesses, as well as notifying the owner that the subprocesses have started
(or stopped) via an event queue. An example usage of :class:`ChildProcessSkeleton`
(which is used by the :m... |
main.py | import cv2
import sys
from mail import sendEmail
from flask import Flask, render_template, Response
from camera import VideoCamera
from flask_basicauth import BasicAuth
import time
import threading
email_update_interval = 600 # sends an email only once in this time interval
video_camera = VideoCamera(flip=True) # crea... |
test_Server.py | # coding: utf-8
"""Integration tests for comms module using Server class."""
import sys
import time
import pytest
import natnet
if sys.platform == 'win32':
# For some reason multiprocessing is letting me pickle lambdas everywhere except on Windows.
# The 'multiprocess' library from pathos uses dill instead... |
launcher.py | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... |
gst-rtsp-launch.py | #!/usr/bin/python
# --------------------------------------------------------------------------- #
# Supporting arguments
# --------------------------------------------------------------------------- #
import argparse
parser = argparse.ArgumentParser(description="gst-rtsp-launch-py V0.1")
parser.add_argument('-v', '--... |
systemdservices.py | import threading
import time
from groundstation.models import SystemdServiceRunning, SystemdServiceEnabled, SystemdService
from groundstation.utils import sendstate
services = [
"roscore.service",
"rosrecord.service",
"cameras.service",
"infrastructure.service",
"lidar.service",
"missioncontro... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import os
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, List, Optional, Type, Union, cast
import warnings
import zipfile
imp... |
test_master_slave_connection.py | # Copyright 2009-2014 MongoDB, 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 writin... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_vtc.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_vtc.bip32 import BIP32Node
from electrum_vtc import constants
from electrum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.