source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
MovePolygonGUI.py | # This example shows how RoboDK and the Python GUI tkinter can display graphical user interface to customize program generation according to certain parameters
# This example is an improvement of the weld Hexagon
from robodk.robolink import * # API to communicate with RoboDK
from robodk.robomath import * # Robot tool... |
process.py | import importlib
import os
import signal
import time
import subprocess
from abc import ABC, abstractmethod
from multiprocessing import Process
from setproctitle import setproctitle # pylint: disable=no-name-in-module
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASE... |
bittrexticker.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys, traceback
import threading
import time
import simplejson as json
import urllib2
from PyQt4 import QtGui,QtCore
from boardlet import Boardlet
from modellet import Modellet
class BittrexTicker(Boardlet):
def __init__(self, parent, targetCurr):
supe... |
delegate.py | import time
from abc import ABC
from multiprocessing.connection import Client, Listener
from threading import Thread
from typing import Any, Optional
__all__ = [
'Delegate',
'Emitter',
'check_event', 'on_event'
]
class Delegate(ABC):
def check_event(self, event: str, data: Any = None) -> int:
... |
hub.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import os
import select
import socket
import threading
import time
import uuid
import warnings
import queue
import xmlrpc.client as xmlrpc
from urllib.parse import urlunparse
from .. import log
from .constants import SAMP_STATUS_OK
from .co... |
multiprocessing_daemon.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Daemon vs. non-daemon processes.
"""
#end_pymotw_header
import multiprocessing
import time
import sys
def daemon():
p = multiprocessing.current_process()
print 'Starting:', p.name, p.pid
sys.stdout.flush... |
test_urllib.py | """Regresssion tests for urllib"""
import urllib.parse
import urllib.request
import http.client
import email.message
import io
import unittest
from test import support
import os
import tempfile
import warnings
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()
... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
import linecache
from contextlib import ExitStack
from io import StringIO
from test.support import os_helper
# This little helper cl... |
Video_AudioThread_3D.py | import threading
import cv2
import pyaudio
import wave
import time
import numpy as np
import matplotlib.pyplot as plt
import math
# DEFINING AUDIO AND VIDEO RECORDING FUNCTIONS
def AudioRec(FORMAT,CHANNELS,RATE,CHUNK):
WAVE_OUTPUT_FILENAME = "Audio1.wav"
RECORD_SECONDS = 5
p = pyaudio.PyAudio()
stream =... |
gui.py | import Tkinter
from Tkinter import *
import tkMessageBox
import subprocess
from subprocess import call
import sys
import csv
from collections import deque
from threading import Thread
#from threading import Timer
import test_rpca_ec
import os
from os.path import abspath
import Queue
import time
import PIL
from PIL impo... |
test_smtplib.py | zaimportuj asyncore
zaimportuj email.mime.text
z email.message zaimportuj EmailMessage
z email.base64mime zaimportuj body_encode jako encode_base64
zaimportuj email.utils
zaimportuj socket
zaimportuj smtpd
zaimportuj smtplib
zaimportuj io
zaimportuj re
zaimportuj sys
zaimportuj time
zaimportuj select
zaimportuj errno
z... |
test_application.py | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... |
TestProxy.py | import os,time
from PIL import Image
import numpy as np
import tensorflow as tf
from IutyLib.mutithread.threads import LoopThread
from IutyLib.commonutil.config import Config
from multiprocessing import Process,Manager
from prx.PathProxy import PathProxy
from prx.ClassProxy import ClassProxy
from prx.CoachProxy imp... |
base.py | import json
import copy
import threading
import array
import struct
import time
import csv
import os
import random
from sources.utils.sml_runner import SMLRunner
try:
from sources.buffers import CircularBufferQueue, CircularResultsBufferQueue
except:
from buffers import CircularBufferQueue, CircularResultsBuff... |
twisterlib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
hdfs_utils.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... |
turn_classification.py | import cv2
import threading
import tensorflow as tf
import numpy as np
import time
import capturer
from utils.circularBuffer import CircularBuffer
labels = ['Left Turn', 'No Turn', 'Right Turn']
model_path = "./turn_classification/turn_classification_model_final_v1.h5"
readings_buffer_size = 20
image_preprocessing_dim... |
test_context.py | import pytest
import time
from threading import Thread
from threading import Event
from p4client.p4grpc import P4RuntimeGRPC
from packettest.test_context import TestContext
from simple_switch.simple_switch_runner import make_switch
merged_config = {
'switch_name': 'meow',
'network_name': 'meow_net',
'dev... |
train_navigation_agent.py | # Trains the navigation module using random start and end points.
import numpy as np
import pdb
import os
import random
import threading
import tensorflow as tf
import time
from networks.free_space_network import FreeSpaceNetwork
from supervised.sequence_generator import SequenceGenerator
from utils import tf_util
i... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import lo... |
stream_infer.py | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# Python script to start a USB camera and feed frames to
# the Movidius Neural Compute Stick that is loaded with a
# CNN graph file and report the inferred results
import sys
sys.path.insert(0, "../../... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
dishes.py | import multiprocessing as mp
def washer(dishes, output):
for dish in dishes:
print('Myję talerz na', dish)
output.put(dish)
def dryer(input):
while True:
dish = input.get()
print('Wycieram talerz na', dish)
input.task_done()
dish_queue = mp.JoinableQueue()
dryer_proc =... |
mininet_multicast_pox.py | #!/usr/bin/env python
from groupflow_shared import *
from mininet.net import *
from mininet.node import OVSSwitch, UserSwitch
from mininet.link import TCLink
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.node import Node, RemoteController
from scipy.stats import truncnorm
from numpy.rando... |
test_c10d_nccl.py | import copy
import math
import os
import random
import signal
import sys
import tempfile
import threading
import time
import unittest
from contextlib import contextmanager
from datetime import timedelta
from itertools import product
from unittest import mock
import torch
import torch.distributed as c10d
if not c10d.i... |
bmv2.py | # Copyright 2018-present Open Networking Foundation
#
# 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... |
via_app_data.py | """Bootstrap"""
from __future__ import absolute_import, unicode_literals
import logging
import sys
import traceback
from contextlib import contextmanager
from subprocess import CalledProcessError
from threading import Lock, Thread
from virtualenv.info import fs_supports_symlink
from virtualenv.seed.embed.base_embed i... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau... |
concurrent.py | #!/usr/bin/env python3
import argparse
from urllib.request import urlopen
import yaml
import statistics
import os
import sys
import time
import re
from subprocess import Popen, PIPE
import traceback
from threading import Thread,Lock
import random
import bench_base
import matplotlib.pyplot as plt
from matplotlib imp... |
GetMem.py | # coding:utf8
'''
Created on 2016��8��30��
@author: zhangq
'''
from serial import Serial
import re
from threading import Thread
import time
import datetime
import pygal
import os
class FilterMem(object):
def __init__(self, port, baudrate):
self.serial_obj = Serial()
self.serial_obj.port = port-1
... |
GravarEventosMouseTeclado.py | #!/usr/bin/python3
import os
import sys
import time
import json
import requests
from tkinter import *
from PIL import ImageTk, Image
from .database.database import *
from .database.datalocal import *
from datetime import date, datetime
from threading import Thread
class GravarEventosMouseTeclado:
... |
test_connection_pool.py | import os
import pytest
import re
import redis
import time
from unittest import mock
from threading import Thread
from redis.connection import ssl_available, to_bool
from .conftest import skip_if_server_version_lt, _get_client, REDIS_6_VERSION
from .test_pubsub import wait_for_message
class DummyConnection:
desc... |
run_reducer_admin.py | import asyncio
import os
import threading
from gevent.pywsgi import WSGIServer
from src.logic.reducer import Reducer
from src.admin.app import app
from src import utils
from src import secret
reducer_started_event = threading.Event()
def reducer_thread(loop: asyncio.AbstractEventLoop, reducer: Reducer) -> None:
... |
test_queue.py | # Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import Queue
import time
import unittest
from test import test_support
threading = test_support.import_module('threading')
QUEUE_SIZE = 5
# A thread to run a function that unclogs a blocked Queue.
class _TriggerT... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends: - CherryPy Python module
:optdepends: - ws4py Python module for websockets support.
:configuration: All authentication is done through Salt's :ref:`external auth... |
runAll.py | #!/usr/bin/python
import sys, getopt
import os
import threading
import ntpath
import ghProc
CPP_PATH = 'projects' + os.sep + 'top_C++'
C_PATH = 'projects' + os.sep + 'top_C'
def processProject(projPath):
"""thread worker function"""
print('processProject : %s\n' % projPath)
#print threading.current_thread()... |
email.py | from threading import Thread
from flask import current_app
from flask_mail import Message
from app import mail
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=subject, sender=sender, reci... |
lisp-itr.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... |
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... |
Recognizer.py | import audioop
import collections
import math
import threading
import time
from danspeech.errors.recognizer_errors import ModelNotInitialized, WaitTimeoutError, WrongUsageOfListen, NoDataInBuffer
from danspeech.DanSpeechRecognizer import DanSpeechRecognizer
from danspeech.audio.resources import SpeechSource, AudioData... |
dpp-nfc.py | #!/usr/bin/python3
#
# Example nfcpy to wpa_supplicant wrapper for DPP NFC operations
# Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
# Copyright (c) 2019-2020, The Linux Foundation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import struct
import... |
test_logging.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
proxy.py | #!/usr/bin/env python
import sys
import socket
import threading
def server_loop(local_host,local_port,remote_host,remote_port,receive_first):
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
server.bind((local_host,local_port))
except:
print "[!!] Failed to listen on %s... |
crawler.py | # -*- coding: utf-8 -*-
"""
Contains the crawling logic.
"""
from __future__ import unicode_literals, absolute_import
import base64
from collections import defaultdict
import logging
import sys
import time
from pylinkvalidator.included.bs4 import BeautifulSoup, UnicodeDammit
import pylinkvalidator.compat as compat
f... |
faucet_mininet_test.py | #!/usr/bin/env python
"""Mininet tests for FAUCET.
* must be run as root
* you can run a specific test case only, by adding the class name of the test
case to the command. Eg ./faucet_mininet_test.py FaucetUntaggedIPv4RouteTest
It is strong recommended to run these tests via Docker, to ensure you have
all depen... |
test_cli.py | #!/usr/bin/python3
"""
(C) 2018,2019 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
"""
import subprocess
import sys
import os
import logging
import optparse # pylint: disable=deprecated-module
import time
import shutil
import tempfile
import re
import random
import json
import binas... |
trello-hipchat.py | """
Simple Flask Webapp to receive Trello Webhook API callbacks and Post to
a HipChat room.
Copyright 2013 Valentin v. Seggern <valentin.vonseggern@telekom.de>
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 ... |
worker.py | # Copyright 2014 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 ... |
__init__.py | import os
import subprocess
import threading
from multiprocessing import Process
from platypush.backend import Backend
from platypush.backend.http.app import application
from platypush.context import get_or_create_event_loop
from platypush.utils import get_ssl_server_context, set_thread_name
class HttpBackend(Backe... |
__init__.py | ########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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 requir... |
ssh.py | # -*- coding: utf-8 -*-
import paramiko
import threading
from threading import Thread
from utils.tools.tools import get_key_obj
import traceback
import socket
import json
import os
import logging
import time
logging.basicConfig(level=logging.INFO)
zmodemszstart = b'rz\r**\x18B00000000000000\r\x8a'
zmodemszend = b'**\... |
test_betfairstream.py | import unittest
import socket
import time
import threading
from unittest import mock
from betfairlightweight.compat import json
from betfairlightweight.streaming.betfairstream import (
BetfairStream,
HistoricalStream,
HistoricalGeneratorStream,
)
from betfairlightweight.exceptions import SocketError, Liste... |
prometheus_client_fix.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... |
telegram.py | import os, time, multiprocessing
import telepot
import telegram_cfg
import objtrack
p = multiprocessing.Process()
act = multiprocessing.Value('i', 0)
def sendCapture(chat_id):
bot.sendPhoto(chat_id=chat_id, photo=open('capture.jpg', 'rb'), caption='\U0001F4F7 Instant capture')
act.value = 0
def sendVideo(cha... |
track_visualisation_rt_near.py | from object_tracking_rt_near import track_objects_realtime, imshow_resized
import math
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
import multiprocessing
import csv
class TrackPlot():
def __init__(self, track_id):
self.id = track_id
... |
africa.py | # import package
import africastalking
from django.shortcuts import redirect
from . gateway import AfricasTalkingGateway, AfricasTalkingGatewayException
from .models import Event
from multiprocessing import Process
import schedule
import time
import datetime as dt
def sms(request):
print('smsing')
phones = []... |
pydoc.py | #!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
watchdog.py | # -*- coding: utf-8 -*-
from kazoo.client import KazooClient
import os
import sys
import logging
import time
import signal
from multiprocessing import Process
main_dir = "/root/V3/project/"
signal_dir = '/signal/hexunblog'
task_type = "hexunblog"
def run_proc():
os.chdir(main_dir +"hexunblog/hexunblog/spiders")
... |
onevent.py | #!/usr/bin/python
import paho.mqtt.client as mqtt
import os
import subprocess
import urllib.request
from shutil import copyfile
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import argparse
import youtube.get_music_video_url
from multiprocessing import Process
base_path = '/home/pi/scripts/github/... |
ServerPlugin.py | __author__ = 'Scott Davey'
"""Simple tyre temperature plugin for Assetto Corsa"""
import sys
import ac
import acsys
import traceback
sys.path.insert(0, 'apps/python/ServerPlugin/ServerPlugin_lib/stdlib')
try:
import socketserver
import threading
from ServerPlugin_lib.UDPServer import UDPServer
except Excep... |
radosBindings.py | import rados
import re
import os
import time
import threading
import signal
CONF_DIR = '/home/kostis/git/django/ceph/demo/utils'
CEPH_CONF = os.path.join(CONF_DIR, 'ceph.conf')
KEYRING = os.path.join(CONF_DIR, 'ceph.client.admin.keyring')
POOL = 'data'
TIMEOUT = 2
cluster = None
def _connect():
globa... |
s3.py | """
Object Store plugin for the Amazon Simple Storage Service (S3)
"""
import logging
import multiprocessing
import os
import shutil
import subprocess
import threading
import time
from datetime import datetime
from galaxy.exceptions import ObjectNotFound
from galaxy.util import umask_fix_perms
from galaxy.util.direc... |
py_os_pipe_perf.py | """
https://cardinalpeak.com/blog/inter-thread-communication-without-a-mutex/
"""
import gc
import os
import time
import ctypes
import threading
count = int(1e5)
def buffer_perf():
""
gc.collect()
flags = os.O_DIRECT | os.O_CLOEXEC # packet mode, propagate exception
reader_fd, writer_fd = os.pipe... |
ScanNetwork.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__doc__="""
# Digite o Primeiro IP Completo (EX: 10.32.0.1)
# Depois o ultimo Octeto (EX: 254)
# No final será mostrado os IP's E OS MAC's conectados
# E DIRÁ O NÚMERO DE EQUIPAMENTOS ONLINE NA REDE
"""
import sys
import subprocess
import os
import subprocess
import time
i... |
test_tls.py | import datetime as dt
import itertools
import multiprocessing as mp
import pickle
import platform
import select
import socket
import sys
import time
import pytest
from mbedtls import hashlib
from mbedtls.exceptions import TLSError
from mbedtls.pk import RSA
from mbedtls.tls import *
from mbedtls.tls import _BaseConfi... |
gerrit_util_test.py | #!/usr/bin/python3.8
#
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import http.server
import threading
from unittest import mock
from typing import List, Optional
import gerrit_util
... |
test_util.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... |
HiwinRA605_socket_ros_test_20190625193623.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
crawler.py | #-*- coding: UTF-8 -*-
import socket
import struct
import math
import sys
import time
import traceback
import json
import conf
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from spiders.amz_product_crawl import AmazonSpider_01
# 设置本机的hostname,用该名字去redi... |
train_faster_rcnn_alt_opt.py | #!/usr/bin/env python
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Faster R-CNN network using alternat... |
tdvt.py | """
Test driver script for the Tableau Datasource Verification Tool
"""
import sys
if sys.version_info[0] < 3:
raise EnvironmentError("TDVT requires Python 3 or greater.")
import argparse
import glob
import json
import pathlib
import queue
import shutil
import threading
import time
import zipfile
from pathl... |
test_drop_collection.py | import pdb
import pytest
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
from utils import *
from constants import *
uniq_id = "drop_collection"
class TestDropCollection:
"""
******************************************************************
Th... |
RetinaDetector.py | # -*- coding:utf-8 -*-
# @author : cbingcan
# @time : 2021/8/24/024 15:29
import cv2
import os
import time
import numpy as np
from threading import Thread
import queue
from PIL import Image, ImageDraw
import sophon.sail as sail
import threading
from detection.rcnn.processing.bbox_transform import clip_boxes
fr... |
freqperyear.py | import argparse
import os
import random
import collections
from Queue import Empty
from multiprocessing import Process, Queue
from nltk.corpus import stopwords
import ioutils
from cooccurrence import matstore
def merge(years, out_pref, out_dir):
word_freqs = collections.defaultdict(dict)
word_lists = {}
... |
telemetry.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
dl_yaani24.py | from ._utils import *
baseURL = 'https://yaani24.net'
async def GetOneVideoURL(aniLink, loop):
soup = await GetSoup(aniLink, referer=baseURL, loop=loop)
epiTitle = soup.find('div', {'class':'view_info_box'}).find_all('div')[0].text
bigTitle = ' '.join(epiTitle.split(' ')[0:-1])
link = soup.fin... |
plot_emgs.py | import pygame
from pygame.locals import *
import multiprocessing
from pyomyo import Myo, emg_mode
# ------------ Myo Setup ---------------
q = multiprocessing.Queue()
def worker(q):
m = Myo(mode=emg_mode.RAW)
m.connect()
def add_to_queue(emg, movement):
q.put(emg)
m.add_emg_handler(add_to_queue)
def prin... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import sys
import traceback
from multiprocessing.context import Process
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.params import Params
from common.text_window import TextWindow
from selfdrive.boardd.set_time import se... |
client.py | # !/usr/bin/python3
# -*- coding:utf-8 -*-
import socket
import threading
def client_send(tcpSock):
while True:
try:
sendInfo = input('')
tcpSock.send(sendInfo.encode('utf-8'))
except:
pass
def client_recv(tcpSock):
while True:
try:
rec... |
CCTV.py | import logging
import threading
import time
import datetime
import picamera
import keyboard
import cv2
camera = picamera.PiCamera()
savepath = '/home/pi/bestwo/python3/savedVideo'
def thread_function(name):
now = time.strftime('%H-%M-%S',time.localtime(time.time()))
print(now)
camera.start_recording(output... |
test.py | import unittest
import time
import requests
import multiprocessing
import logging
import datetime
import sys
logging.basicConfig(
handlers=[logging.StreamHandler(sys.stdout)],
level=logging.DEBUG,
format='%(asctime)s [%(threadName)s] [%(levelname)s] %(message)s'
)
import authenticated_test_service
import... |
python实例手册.py | python实例手册
#encoding:utf8
# 设定编码-支持中文
0 说明
手册制作: 雪松 littlepy www.51reboot.com
更新日期: 2020-03-06
欢迎系统运维加入Q群: 198173206 # 加群请回答问题
欢迎运维开发加入Q群: 365534424 # 不定期技术分享
请使用"notepad++"或其它编辑器打开此文档, "alt+0"将函数折叠后方便查阅
请勿删除信息, 转载请说明出处, 抵制不道德行为
错误在所难免, 还望指正!
[python实例手册] [shell实例手册] [LazyMan... |
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... |
main_vec_delay.py | import argparse
import math
from collections import namedtuple
from itertools import count
import numpy as np
from eval import eval_model_q
import copy
import torch
from ddpg_vec import DDPG
from ddpg_vec_hetero import DDPGH
import random
import pickle
from replay_memory import ReplayMemory, Transition, ReplayMemory_e... |
multiprocess_iterator.py | import logging
import os
from queue import Empty
from typing import Iterable, Iterator, List, Optional
from torch.multiprocessing import JoinableQueue, Process, Queue, get_logger
from allennlp.common.checks import ConfigurationError
from allennlp.data.dataset import Batch
from allennlp.data.dataset_readers.multiproce... |
io.py | import pickle as pickle
import codecs
import contextlib
from contextlib import contextmanager
import gzip
import json
import os
import random
import shutil
import subprocess
import sys
import time
from queue import Queue, Empty
from abc import ABCMeta, abstractmethod
from collections import Mapping, OrderedDict
from o... |
master.py | import socket
import multiprocessing
import errno
import sys
import logging
from queue import Empty
from time import sleep
from datetime import datetime
from hurricane.utils import *
from hurricane.messages import MessageTypes
from hurricane.messages import TaskManagementMessage
from hurricane.messages import Heartbeat... |
MainFacadeService.py | # -*- coding: utf-8 -*-
import socket
import sys
import time
from threading import Thread
from bottle import response, request
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.errors import ConfigException
from pip_services3_commons.refer import IReferences
from pip_services3_commons.r... |
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... |
feature_extract_dcl.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Process
sys.path.append(".... |
url_loader_pipes.py | #!/usr/env/bin python
from multiprocessing import Process, Pipe
import urllib.request
def load_url(url, pipe):
url_handle = urllib.request.urlopen(url)
url_data = url_handle.read()
# The data returned by read() call is in the bytearray format. We need to
# decode the data before we can print it.
ht... |
backend.py | # -*- coding: utf-8 -*-
import ast
import builtins
import copy
import functools
import importlib
import inspect
import io
import logging
import os.path
import pkgutil
import pydoc
import re
import signal
import site
import subprocess
import sys
import tokenize
import traceback
import types
import warnings
from collect... |
updateikfiles.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 Masaho Ishida, Rosen Diankov <rosen.diankov@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www... |
plotting.py | """PyVista plotting module."""
import collections.abc
import ctypes
from functools import wraps
import io
import logging
import os
import pathlib
import platform
import textwrap
from threading import Thread
import time
from typing import Dict
import warnings
import weakref
import numpy as np
import scooby
import pyvi... |
main.pyw | import getpass, shutil, json, os, re, sys, subprocess
from time import sleep, perf_counter
from threading import Thread
import datetime as dt
from tkinter import ttk, filedialog, messagebox
import tkinter as Tk
# classes
from classes.logger import Logger
from classes.game import Game
from classes.backup import Backup
... |
test_messaging.py | import multiprocessing
import pytest
import time
from datetime import datetime
from pocs.utils.messaging import PanMessaging
@pytest.fixture(scope='module')
def mp_manager():
return multiprocessing.Manager()
@pytest.fixture(scope='function')
def forwarder(mp_manager):
ready = mp_manager.Event()
done = ... |
roast.py | """
The implementation module for roast.vim plugin. This module does most of the heavy lifting for the functionality
provided by the plugin.
Example: Put the following in a `api.roast` file and hit `<Leader><CR>` on it.
GET http://httpbin.org/get name=value
Inspiration / Ideas:
https://github.com/Huachao/vsc... |
AutoBookTKB-GUI.py | # !/usr/bin/python
# -*-coding:utf-8 -*-
import tkinter as tk
from tkinter import ttk
import json
import sys
import threading
class AutoBookTKB_GUI:
def __init__(self, master):
self.load_json('AutoBookTKB-settings.json')
self.master = master
self.master.title("AutoBookTKB")
self... |
AltAnalyze.py | #!/usr/local/bin/python2.6
###AltAnalyze
#Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - nsalomonis@gmail.com
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Softwar... |
mirrorview.py | import sys
from decimal import Decimal
import cv2
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from controller.viewcontroller import ViewController
from threading import Thread
from queue import Queue
qtCreatorFile = "views/mirrorwindow.ui" # Enter file here.
Ui_MirrorWindow, QtBaseClass = uic.loadUiType(qtCreatorF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.