source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
helpers.py | import functools
import threading
import logging
import requests
import datetime
from requests.models import HTTPBasicAuth
logger = logging.getLogger(__name__)
def thread_it(func):
"""A wrapper function to run func in a daemon thread.
Args:
func (function): The function to run in a thread
Retu... |
camera.py | import time
import threading
import cv2
import numpy as np
from PIL import Image
from yolo import YOLO
from tools.alarm import alarm
from tools.save_csv import save_record
from tools.client import client
if __name__ == "__main__":
"""
這是用來捕捉攝影機畫面並將畫面送進模型預測的程式
"""
yolo = YOLO()
cnt_x = 0
client... |
test_operator.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... |
stream_reciver.py | import time
import logging
import json
from tkinter.constants import NW
import tkinter as tk
import base64
import numpy as np
import cv2
from PIL import Image, ImageTk
from mqtt_client import MqttClient
from threading import Thread
FPS = 30
CHANNELS = 1
RATE = 44100
MQTT_BROKER = "mqtt.item.ntnu.no"
MQTT_PORT = 1883
... |
p2000.py | #!/usr/bin/env python3
"""RTL-SDR P2000 Receiver for Home Assistant."""
# See README for installation instructions
import calendar
import configparser
import fnmatch
import json
import os
import re
import subprocess
import sys
import threading
import time
import logging
from datetime import datetime
from logging.handl... |
build_environment.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains all routines related to setting up the package
build environment. All of this is set up by packa... |
__init__.py | """ Snapcast Client. """
import logging
import queue
import socket
import threading
import time
from snapcast.client.messages import (hello_packet, request_packet,
command_packet, packet,
basemessage, BASE_SIZE)
from snapcast.client.gstreamer... |
ch10_listing_source.py |
import binascii
from collections import defaultdict
from datetime import date
from decimal import Decimal
import functools
import json
from queue import Empty, Queue
import threading
import time
import unittest
import uuid
import redis
CONFIGS = {}
CHECKED = {}
def get_config(conn, type, component, wait=1):
key... |
CTGP7ServerHandler.py | from http.server import HTTPServer
from http.server import BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import threading
import ssl
from urllib import parse
import bson
import sqlite3
import datetime
import os
import traceback
import subprocess
from .CTGP7Requests import CTGP7Requests
from .CTGP7Serv... |
open-nti.py |
#!/usr/bin/env python
# coding: utf-8
# Authors: efrain@juniper.net psagrera@juniper.net
# Version 2.0 20160124
# root@ocst-2-geo:/opt/open-nti# make cron-show
# docker exec -it opennti_con /usr/bin/python /opt/open-nti/startcron.py -a show -c "/usr/bin/python /opt/open-nti/open-nti.py -s"
# * * * * * /usr/bin/pytho... |
client.py | # -*- coding: utf-8
import pycurl
import os
import shutil
import threading
import lxml.etree as etree
from io import BytesIO
from re import sub
from webdav.connection import *
from webdav.exceptions import *
from webdav.urn import Urn
try:
from urllib.parse import unquote
except ImportError:
from urllib impor... |
lisp.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... |
tsleepd.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Trusted Sleep Monitor Bot
This bot monitors group members' sleep time using online status.
Threads:
* tg-cli
* Event: set online state
* Telegram API polling
* /status - List sleeping status
* /average - List statistics about sleep time
* /help - About the b... |
player.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
网易云音乐 Player
"""
# Let's make some noise
from __future__ import print_function, unicode_literals, division, absolute_import
import subprocess
import threading
import time
import os
import random
from future.builtins import str
# from ui import Ui
from storage import... |
test_collection.py | # -*- coding: utf-8 -*-
# Copyright 2009-2015 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 l... |
jobs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle import Bottle, request, template, abort, static_file
import os
import uuid
import sh
import json
import yaml
from datetime import datetime
import time
import threading
import functools
import psutil
import shutil
import adb
app = Bottle()
app.config.setdefault... |
img_loader.py | from keras.preprocessing import image
import sklearn.utils as skutils
from enum import Enum
import os
import numpy as np
import psutil
from threading import Thread
import math
from matplotlib import pyplot as plt
#################################################################################
# ... |
PlainTasks.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime, sublime_plugin
import os
import re
import webbrowser
import itertools
import threading
from datetime import datetime, tzinfo, timedelta
import time
platform = sublime.platform()
ST3 = int(sublime.version()) >= 3000
if ST3:
from .APlainTasksCommon import P... |
report_server.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... |
run_callback_receiver.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import logging
import os
import signal
import time
from uuid import UUID
from multiprocessing import Process
from multiprocessing import Queue as MPQueue
from Queue import Empty as QueueEmpty
from Queue import Full as QueueFull
from kombu import Conne... |
regularized_embeddings.py | """
Ben Athiwaratkun
Training code for Gaussian Mixture word embeddings model
Adapted from tensorflow's word2vec.py
(https://github.com/tensorflow/models/blob/master/tutorials/embedding/word2vec.py)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
impo... |
multithreads6.py | import time, random
import queue, threading
q = queue.Queue()
def Producer(name):
count = 0
while count < 10:
print("制造包子ing")
time.sleep(random.randrange(3))
q.put(count)
print('生产者 %s 生产了 %s 包子..' % (name, count))
count += 1
q.task_done()
# q.join()
... |
experiment_queue.py | #####################################################################
# #
# /experiment_queue.py #
# #
# Copyright 2013, Monash Univ... |
test_lib.py | '''
Create a common test libs for all integration test stubs.
@author: Youyk
'''
import time
import os
import string
import random
import traceback
import sys
import threading
import uuid
import zstackwoodpecker.setup_actions as setup_actions
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.... |
assistant_library_with_snowboy_demo.py | #!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
MyContigFilter3Server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
worker.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 app... |
example_ticker_and_miniticker.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_ticker_and_miniticker.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: htt... |
limiter.py | # coding: utf-8
from __future__ import unicode_literals
import time
from datetime import datetime
from queue import Queue, Full, Empty
from threading import Thread
class BaseRateLimiter(object):
def __init__(self, rate):
self.rate = rate
def acquire(self, count=1):
raise NotImplementedErro... |
nanny.py | import asyncio
from contextlib import suppress
import errno
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
import uuid
import warnings
import weakref
import dask
from dask.system import CPU_COUNT
from tornado.ioloop import IOLoop, PeriodicCallback
from to... |
server2.py | #!/usr/bin/env python3
"""
Author: Rafael Schreiber
Created: 21-06-2018
This is TCPChat2 Server. This programm is distributed as closed source. This program handles all
ingoing connections and manages them. It also offers a feature-rich server console, where the server
administrator can man... |
main.py | from config import BOTNAME,BOTTOKEN,DEBUG,PROXY,PY
from api import GetUserInfo,ChangeUserInfo
import requests
reqChange=requests.Session()
reqSender=requests.Session()
reqUpdater=requests.Session()
reqCallback=requests.Session()
req=requests.Session()
if len(PROXY)>0:
reqChange.proxies={"http":PROXY,"https":PROXY... |
main.py | import sys
import time
import numpy as np
import random
import matplotlib.pyplot as plt
import queue
import matplotlib.animation as animation
import threading
from scipy.io.wavfile import read as wavread
from scipy.signal import blackmanharris
from pysoundcard import *
from math import log
from sys import float_info
fr... |
runner.py | # Copyright 2019 Uber Technologies, 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 applica... |
externing.py | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* -------... |
GenThreadExecutor.py | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... |
processPoolUtil.py | """
.. Hint::
进程池使用方法
方便的使用python开启多进程
.. literalinclude:: ..\..\..\example\进程池测试.py
:language: python
:caption: 代码示例
:linenos:
:lines: 1-40
"""
import multiprocessing
from pyefun import 事件锁
class 进程队列:
def __init__(self):
self.队列对象 = multiprocessing.Queue()
def 加入数据(self... |
procs.py | #!/usr/bin/env python3
"""
procs.py: shows that multiprocessing on a multicore machine
can be faster than sequential code for CPU-intensive work.
"""
# tag::PRIMES_PROC_TOP[]
import sys
from time import perf_counter
from typing import NamedTuple
from multiprocessing import Process, SimpleQueue, cpu_count # <1>
from ... |
baseThreadedAgent.py | from threading import Thread
from time import sleep
from agents.baseAgent import baseAgent
class baseThreadedAgent(baseAgent):
'''Extends baseAgent in order to provide multithreading functionality.
Attributes:
thread (Thread): Thread used by agent to do precalculations.
isStopping (bool): ... |
mcedit.py | # !/usr/bin/env python2.7
# -*- coding: utf_8 -*-
# import resource_packs # not the right place, moving it a bit further
#-# Modified by D.C.-G. for translation purpose
#.# Marks the layout modifications. -- D.C.-G.
from __future__ import unicode_literals
"""
mcedit.py
Startup, main menu, keyboard configuration, auto... |
plugin.py | ###
# Copyright (c) 2020, Triple A
# All rights reserved.
#
#
###
from supybot import utils, plugins, ircutils, callbacks
from supybot.commands import *
try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('StreamlabsIRC')
except ImportError:
# Placeholder that allows to ... |
node.py | #!/usr/bin/python3
import socket
import sys
import binascii
import time
import threading
import logging
import _thread
SDN_CONTROLLER_ADDRESS = '10.0.254.1'
SDN_CONTROLLER_PORT = 14323
TICK_TIME = 1
class RootNode(threading.Thread):
def __init__(self, evntObj, cachLck, cache):
threading.Thread.__init__(s... |
t265_to_mavlink.py | #!/usr/bin/env python3
#####################################################
## librealsense T265 to MAVLink ##
#####################################################
# This script assumes pyrealsense2.[].so file is found under the same directory as this script
# Install required packages:
# pip i... |
main_window.py | from tkinter import *
from tkinter import ttk
import uuid
import requests
import json
import threading
from popup_window import PopupWindow
from events import EventsManager, AddEvent, DeleteEvent, EditEvent
server = 'https://treedb.herokuapp.com/'
# server = 'http://127.0.0.1:8080/'
def run_in_thread(fn):
def ru... |
presubmit_support.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
from __future__ import print_function
__versio... |
streaming_generator.py | import sys
sys.path.insert(0, "/home/mclrn/dlproject/")
import datetime
from threading import Thread
from selenium import webdriver
from slackclient import SlackClient
import traceback
import os
from selenium.webdriver.support.ui import WebDriverWait
# import trafficgen.Streaming.win_capture as cap
# import trafficge... |
halo_notebook.py | from __future__ import absolute_import, print_function, unicode_literals
import sys
import threading
import cursor
from halo import Halo
from halo._utils import decode_utf_8_text
class HaloNotebook(Halo):
def __init__(self, text='', color='cyan', spinner=None, placement='left',
animation=None,... |
active_measurements.py | import socket
import urlparse
import os
import sys
import threading
import Queue
import subprocess
import time
import errno
DNS_PORT_SEND = 51004
DNS_PORT_RECV = 51003
DNS_HOST = socket.gethostbyname('cs5700cdnproject.ccs.neu.edu')
# Initiates active measurements
def active_measurements():
pipe = Queue.Queue()
# ... |
people_detector.py | ######## Webcam Object Detection Using Tensorflow-trained Classifier #########
#
# Author: Evan Juras
# Date: 10/27/19
# Description:
# This program uses a TensorFlow Lite model to perform object detection on a live webcam
# feed. It draws boxes and scores around the objects of interest in each frame from the
# ... |
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... |
NotificationPreferences.py | from flask import request, render_template
from flask_restful import Resource
from flask_jwt_extended import get_jwt_identity, jwt_required
from flask_mail import Message
import boto3
import random
import string
import json
import iot_logging
from threading import Thread
from datetime import datetime, timedelta
from ... |
load_generator.py | import pyodbc
import os
from multiprocessing import Process
def get_file_content(full_path):
"""Get file content function from read_sql_files_to_db.py"""
print(full_path)
bytes = min(32, os.path.getsize(full_path))
raw = open(full_path, 'rb').read(bytes)
if '\\xff\\xfe' in str(raw):
print("... |
server_controller.py | import subprocess
import sys
import functools
import os.path as path
from threading import Thread
from queue import Queue, Empty
module_dir = path.abspath(path.join(path.dirname(__file__)))
_root_dir = path.abspath(path.join(module_dir, '..'))
class StdOutReader:
def __init__(self, stream, verbose=False):
self... |
visualizer.py | import math
import numpy as np
import threading
import open3d as o3d
from open3d.visualization import gui
from open3d.visualization import rendering
from collections import deque
from .boundingbox import *
from .colormap import *
from .labellut import *
import time
class Model:
"""The class that helps build visu... |
Client.py | import subprocess
import threading
import time
import socket
import os, sys, random
class Client():
send=0
run=False
def __init__(self):
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host ,port= '127.0.0.1',9999
self.s.connect((host, port))
self.start()
def __ddos(self,*args):
... |
image_utils__unused.py | import threading
from pathlib import Path
from uuid import uuid4
from base64 import b64encode
from traceback import print_exc
from subprocess import call
import os, shutil
import imageio
import cv2
import numpy as np
#####################
# Generic Functions #
#####################
from shared_utils import folder_util... |
dispatcher.py | from multiprocessing import cpu_count
from queue import Queue
from threading import Thread
from .runner import Runner
class Dispatcher:
def __init__(self):
self.tasks = Queue()
self.available = cpu_count()
self.runners = []
self.manage_thread = Thread(target=self.run)
s... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
import signal
from collections import namedtuple
import capnp
import cereal.messaging as messaging
from cereal import car, log
from cereal.services import service_list
from common.params import Params
from common.timeout import ... |
multi_process_runner_test.py | # Copyright 2019 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... |
avnet_face_detection_mt.py | '''
Copyright 2020 Avnet 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 writing, software
dis... |
junctionf_gui.py | import os
import sys
import struct
import cPickle
import subprocess
from sys import platform as _platform
from collections import Counter
import threading
import multiprocessing
import functions.process as process
import functions.structures as sts
import libraries.joblib.parallel as Parallel
def threaded(fn):
de... |
inference_request.py | import grpc
import time
import json
import sys
from arch.api.proto import inference_service_pb2
from arch.api.proto import inference_service_pb2_grpc
import threading
def run(address):
ths = []
with grpc.insecure_channel(address) as channel:
for i in range(1):
th = threading.Thread(target=... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test monkecoind shutdown."""
from test_framework.test_framework import MonkecoinTestFramework
from tes... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner v2.7 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
from multiprocessing import L... |
test_multiprocess.py | import os
import cv2
import pylab
import warnings
import argparse
import numpy as np
import scipy.ndimage as nd
from multiprocessing import Process
import torch.nn.functional as F
import torch
import network as models
from utils.util import load_model
import krahenbuhl2013
import skimage.color as imgco
import skimage.i... |
dense_update_ops_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... |
data_helper.py | import copy
import hashlib
import json
import random
import socket
import threading
import time
import uuid
import zlib
from multiprocessing.process import BaseProcess as Process
from multiprocessing.queues import Queue
from queue import Queue
from random import Random
import crc32
import logger
import memcacheConstan... |
build_image_data.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
lib_images_io.py | #!/usr/bin/env python
'''
Classes for reading images from video, folder, or web camera,
and for writing images to video file.
Main classes and functions:
* Read:
class ReadFromFolder
class ReadFromVideo
class ReadFromWebcam
* Write:
class VideoWriter
* Display... |
Controller.py | from scapy.all import *
from packet_sender import Raft, send_no_reply, COMMANDS
from threading import Event
from utils.Switch_Register_Manager import CustomConsole
from timeit import default_timer as timer
import argparse
RANDOM_TIMEOUT = {'min': 150, 'max': 300} # min max values in ms
RAFT_HEARTBEAT_RATE = 50
STATU... |
cdp.py | import threading
import json
import websocket
from websocket import WebSocketTimeoutException, WebSocketConnectionClosedException
from types import FunctionType
from typing import Callable, Union
from .request import CDPRequest
from .response import CDPResponse
from .events import Events
from ..utils.logger import debu... |
Client2.py | import ipaddress
import random
import socket
import struct
import sys
from random import randint
from time import *
import threading
import math
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RE... |
mtsleepD.py | #!/usr/bin/venv python3
import threading
from time import sleep, ctime
loops = [4, 2]
class ThreadFunc(object):
def __init__(self, func, args, name=''):
self.nanme = name
self.func = func
self.args = args
def __call__(self):
self.func(*self.args)
def loop(nloop, nsec):
p... |
main.py | import os
import atexit
from pathlib import Path
from argparse import ArgumentParser
import shutil
import sys
import threading
import logging
import coloredlogs
import requests
from decouple import config
from cachetools import cached, TTLCache
from filesystem.folderwatcher import folderwatcher
from filesystem.FileSyst... |
GUI.py | import Tkinter as Tk
from Video_Process import *
from threading import Thread
class GUI:
def __init__(self):
# Main windows of the app
self.root = Tk.Tk()
self.root.title("Selfie Camera")
self.root.geometry("1156x620")
self.video_processor = VideoProcess()
self.vide... |
start_pipelined.py | """
Copyright (c) 2018-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import logging
import threa... |
reader.py | from __future__ import print_function
import arvados
import Queue
import threading
import _strptime
from crunchstat_summary import logger
class CollectionReader(object):
def __init__(self, collection_id):
logger.debug('load collection %s', collection_id)
collection = arvados.collection.Collectio... |
DockerPython.py | # DockerPython.py
# Demonstrates an alternative to CDDDockerJava for managing docker containers
# See README.md
import json
import logging
import os
import platform
import docker
import threading
import greengrasssdk
import boto3
import base64
# main is located at the bottom of this file
# Create a greengrass core sd... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
from weakref import proxy
import contextlib
imp... |
test_protocol_util.py | # Copyright 2018 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 applicable law or agreed to in... |
jsview_3d.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from libtbx.math_utils import roundoff
import traceback
from cctbx.miller import display2 as display
from cctbx.array_family import flex
from cctbx import miller, sgtbx
from scitbx import graphics_utils
from scitbx import matrix
im... |
__main__.py | from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3
import os
import labscript_utils.excepthook
try:
from labscript_utils import check_version
except ImportError:
raise ImportError('Require labscript_utils > 2.1.0')
check_version('labscript_ut... |
test_pytorch_multiprocessing.py | # Future
from __future__ import print_function
# Standard Library
import os
import shutil
# Third Party
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tests.zero_code_change.utils import build_json
from torchvision import datasets... |
threaded.py | # This program is public domain
# Author: Paul Kienzle
"""
Thread and daemon decorators.
See :function:`threaded` and :function:`daemon` for details.
"""
from functools import wraps
import itertools
import threading
#TODO: fix race conditions
# notify may be called twice in after()
# 1. main program calls fn() which... |
chair_item.py | """Object that passes through the chair/click pipeline"""
from os.path import join
from threading import Thread
import cv2 as cv
from imutils.video import FileVideoStream
from vframe.settings import types
from vframe.settings import vframe_cfg as cfg
from vframe.models.media_item import MediaRecordItem
from vframe.u... |
tests.py | import random
import multiprocessing
import time
def main1():
x = 14
y = 18
z = []
z = ExtendedEuclid(x,y,z)
if(z[0]):
print('{}和{}互素,乘法的逆元是:{}\n'.format(x, y, z[1]))
else:
print('{}和{}不互素,最大公约数为:{}\n'.format(x, y, z[1]))
return 0
def ExtendedEuclid(f, d , ... |
test.py | #importing modules, all preinstalled normally
from threading import Thread
from tkinter import *
from random import randint
from time import sleep, time
"""
██████╗ ███████╗ █████╗ ██████╗████████╗██╗ ██████╗ ███╗ ██╗ ████████╗███████╗███████╗████████╗
██╔══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝██║██╔═══██╗████╗ █... |
threads.py | from threading import *
import time
import atexit
class Threader(object):
def __init__(self, threads, onSucess=None, onError=None, actions=[]):
self.waitForWork = False
self.threads = []
self.threadCount = threads
self.work = actions
self.errors = None
self.onSucess... |
segment.py | """Controls functions for segmentation of white/gray matter and other things in the brain.
"""
import os
import time
import shlex
import warnings
import numpy as np
import subprocess as sp
from builtins import input
import multiprocessing as mp
from . import formats
from . import blender
from . import freesurfer
from ... |
nxbt.py | from multiprocessing import Process, Lock, Queue, Manager
import queue
from enum import Enum
import atexit
import signal
import os
import sys
import time
import json
import dbus
from .controller import ControllerServer
from .controller import ControllerTypes
from .bluez import BlueZ, find_objects, toggle_clean_bluez
... |
chordnet.py | # import music-code modules
from music_code import MusicCode
from sql_kit import SQL_Kit
# audio
import pyaudio
import wave
# data
import numpy as np
import pandas as pd
import mysql.connector
from mysql.connector import MySQLConnection, Error
# plotting
import matplotlib.pyplot as plt
import seaborn
# GUI
from tki... |
demoserver.py | #!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Run this server and then in Vim you can open the channel:
# :let handle = ch_open('localhost:8765')
#
# Then Vim can send requests to the server:
# :let response = ch_sendexpr(handle, 'hello!')
#
# And you can control Vim by typing a JSON... |
supervisor.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
app.py | '''
author(s): xujing from Medcare
date: 2019-03-20
flask调用opencv并基于yolo-lite做目标检测。
解决了:
在html中嵌入opencv视频流
opencv putText的中文显示
darknet调用yolo-lite
多线程,多点同时访问
ajax异步更新echarts的json数据,实时绘制识别结果!
问题: yolo-lite在no-GPU下的识别FPS没有做到paper中说的那么高!
'''
from flask import Response
from flask import Flask
from fla... |
autosave.py | #!/usr/bin/python3.9
# Copyright (c) 2021 MobileCoin Inc.
# Copyright (c) 2021 The Forest Team
import asyncio
import logging
import os
import time
from pathlib import Path
from subprocess import PIPE, Popen
from typing import Any
import aioprocessing
from aiohttp import web
from forest import fuse, mem, utils
_memf... |
utils.py | import psutil
import shutil
import os
import os.path as osp
from enum import Enum
import multiprocessing as mp
from queue import Queue
import time
import threading
from ctypes import CDLL, c_char, c_uint, c_ulonglong
from _ctypes import byref, Structure, POINTER
import platform
import string
import logging
import socke... |
server.py | import json
import logging
import os
import uuid
from typing import List
import sys
import cache
import math
import base64
from random import randint
from multiprocessing import Process, Pool
from threading import Thread
import boto3
import botocore
import requests
import uvicorn as uvicorn
from fastapi import FastAPI... |
AGv7.py | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 24 09:40:28 2018
@author: Paulo Augusto
"""
import numpy as np
#from numpy import fft
import matplotlib.pyplot as plt
#import scipy.signal as sig
import os
import random
import emgReaderClass_v2 as erc
import threading
import multiprocessing
import dataP... |
celda.py | import serial
import argparse
import time
import csv
from threading import Thread
def main():
with open('celda.csv') as out:
ser = serial.Serial(port)
csv_reader = csv.reader(out)
for row in csv_reader:
time.sleep(0.4)
ser.write((row[0] + "\n").encode())
parser = ar... |
lisp.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.