source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
patcher_importlib_lock.py | from __future__ import print_function
import sys
import eventlet
# no standard tests in this file, ignore
__test__ = False
def do_import():
import encodings.idna
if __name__ == '__main__':
eventlet.monkey_patch()
threading = eventlet.patcher.original('threading')
sys.modules.pop('encodings.idna... |
engine.py | import os
import math
import time
import torch
import datetime
import threading
import numpy as np
from ..lib import utils
from ..lib.options import Options
from ..lib.logger import Logger
class Engine(object):
"""Contains training and evaluation procedures
"""
def __init__(self):
self.hooks = {}... |
svm_trainer.py | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import pickle
import threading
import numpy as np
from iopath.common.file_io import g_pathmgr
from sklearn.model_selection impo... |
mosaic_image.py | import numpy as np
import cv2
from imutils import resize
import threading
from mosaic_maker.image_processor import ImageProcessor
from mosaic_maker.patch import Patch
class MosaicImage:
def __init__(self, image, patch_size, pach_picker):
self.original_image = image
self.patch_size = patch_size
... |
update_submission_record_tool.py | #!/usr/bin/python
import threading
import pymongo
import numpy as np
import pdb
import time
from bson.objectid import ObjectId
MONGO_DB = 'copo_mongo'
MONGO_HOST = '127.0.0.1'
MONGO_PORT = 27017
collection_name = 'test_submisson_progress_collection'
collection = pymongo.MongoClient(MONGO_HOST, MONGO_PORT)[MONGO_DB][c... |
client.py | # Copyright (c) 2012-2014 Roger Light <[email protected]>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
... |
hdj.py | import src.hdj_fileio as hdj_fileio # setup.py does not include other files if imported not like this
import src.hdj_linkchecker as hdj_linkchecker
import src.hdj_util as hdj_util
import argparse
import sys
import threading
"""
Command link argument program control
"""
def main(arguments):
if arguments.url:
... |
demo66.py | # -*- coding:utf-8 -*-
# @Time :2019/11/27 9:43 上午
# @Author :Dg
import random
import time
from multiprocessing import Process, JoinableQueue
def custom(q):
while 1:
print("消费者消费{}".format(q.get()))
time.sleep(random.random())
q.task_done()
def produce(q):
for x in range(4):
... |
threads_queue.py | import threading
import time
from random import randint
from queue import Queue
def get_url_list(url_queue):
# 爬取文章列表页的url:生产者
print("get_url_list begining")
while True:
for i in range(10):
url_queue.put("www.studyai.com/"+str(randint(1,2000))+"/")
time.sleep(2)
print("... |
lsl-viewer.py | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import butter, lfilter, lfilter_zi, firwin
from time import sleep
from pylsl import StreamInlet, resolve_byprop
from optparse import OptionParser
import seaborn as sns
from threading import Thread
sns.set(style="whitegrid")
par... |
ppo.py | import argparse
from copy import copy, deepcopy
from collections import defaultdict
from datetime import timedelta
import concurrent.futures
import gc
import gzip
import os
import os.path as osp
import pickle
import psutil
import pdb
import subprocess
import sys
import threading
import time
import traceback
import warn... |
wxFixGUI.py | import asyncore
import os
import wx
import math
import wx.lib.agw.floatspin as FS
from time import sleep
from ViewPane import ViewPane
from protocolPane import ProtocolPane
from controlPanel import ControlPanel
from LightCrafter import wxLightCrafterFrame
from PreferencesDialog import PreferencesDialog
import socket
i... |
email.py | from threading import Thread
# from flask.ext.mail import Message
from flask_mail import Message
from app import app, mail
def send(recipient, subject, body):
'''
Send a mail to a recipient. The body is usually a rendered HTML template.
The sender's credentials has been configured in the config.py file.
... |
socket_file_server.py | #!/usr/bin/env python3
"""
Copyright (c) 2018 NSF Center for Space, High-performance, and Resilient Computing (SHREC)
University of Pittsburgh. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
1. Redistri... |
dx_operations.py | #!/usr/bin/env python
# Corey Brune - Oct 2016
# This script starts or stops a VDB
# requirements
# pip install docopt delphixpy
# The below doc follows the POSIX compliant standards and allows us to use
# this doc to also define our arguments for the script.
"""List all VDBs or Start, stop, enable, disable a VDB
Usag... |
ZeusCloryXXX.py | import os, sys, codecs
try:
import socks, requests, wget, cfscrape, urllib3
except:
if sys.platform.startswith("linux"):
os.system("pip3 install pysocks requests wget cfscrape urllib3 scapy")
elif sys.platform.startswith("freebsd"):
os.system("pip3 install pysocks requests wget cfscrape url... |
zonal_stats_parallel.py | from rasterstats import zonal_stats
import time
import fiona
import multiprocessing as mp
from shapely.geometry import mapping, shape
#input zones
zone_f = "zones.shp"
#output zonal stats
zonal_f = "zonal_stats.shp"
#Raster you want to use to compute zonal stastics from, here the 10m DEM of whole Finland
vrt = "/appl/... |
mqtt.py | import socket
import threading
import json
from .const import (
LOGGER, SHELLY_TYPES
)
class MQTT_connection:
def __init__(self, mqtt, connection, client_address):
self._mqtt = mqtt
self._connection = connection
#connection.settimeout(5)
self._client_address = clie... |
threadable.py | #!/usr/bin/env python3
import time
import threading
class Threadable:
def __init__(self):
self.stopper = threading.Event()
def start(self):
threading.Thread(target=self.target).start()
def stop(self):
self.stopper.set()
def loop(selt):
time.sleep(1)
def target(s... |
test_laser.py | #!/usr/bin/python
# Copyright (c) 2020 Carnegie Mellon University
#
# 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, co... |
fcnet.py | """TensorFlow implementation of fully connected networks.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import warnings
import time
import numpy as np
import tensorflow as tf
import threading
import collections
import deepchem as dc
from deepchem.nn ... |
solution.py | # python3
from abc import ABC
from collections import namedtuple
from sys import setrecursionlimit, stdin
from threading import stack_size, Thread
from typing import AnyStr, IO, List
from unittest import TestCase
setrecursionlimit(10 ** 6)
stack_size(2 ** 27)
test = namedtuple('test', 'input expected')
class TreeO... |
__init__.py | # coding=utf-8
from __future__ import absolute_import
import threading
import octoprint.plugin
from octoprint.events import Events
import re
import numpy as np
import logging
import flask
import json
class bedlevelvisualizer(
octoprint.plugin.StartupPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plu... |
acl_compressor.py | import multiprocessing
import os
import platform
import queue
import threading
import time
import signal
import sys
# This script depends on a SJSON parsing package:
# https://pypi.python.org/pypi/SJSON/1.1.0
# https://shelter13.net/projects/SJSON/
# https://bitbucket.org/Anteru/sjson/src
import sjson
def parse_argv... |
test_notification.py | # Copyright 2016-2017 IBM Corp. 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... |
phlsys_multiprocessing__t.py | """Test suite for phlsys_multiprocessing."""
# =============================================================================
# TEST PLAN
# -----------------------------------------------------------------------------
# Here we detail the things we are concerned to test and specify whic... |
debug_server.py | import threading
import cv2
import numpy as np
from flask import Flask, Response, render_template_string, abort
app = Flask(__name__)
image_container = {}
def camera_stream(image_name):
if image_name not in image_container:
return abort(404)
while True:
_, payload = cv2.imencode('.jpg', ima... |
__init__.py | # -*- coding: utf-8 -*-
import os
import sys
import json
import copy
import platform
import urllib.request
import urllib.error
import urllib.parse
import traceback
import time
import base64
import threading
import ssl
import certifi
import semver
import logging
import inspect
import re
from time import gmtime, strftim... |
Navigator_rs_tx2.py | #encoding=utf-8
'''
project overview:
Subscribe:
1.slam pose(global/local pose) *
2.octomap_server/global map
3.local pointcloud/local octomap
4.target input(semantic target/visual pose target/gps target)
Publish:
1.Mavros(amo) Command
2.Navigator status
Algorithms:
1.D*
2.state transfer
... |
__init__.py | import argparse
import gettext
import os
import threading
import time
import pkg_resources
from collections import defaultdict
from http.server import HTTPServer, SimpleHTTPRequestHandler
from tempfile import TemporaryDirectory
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
... |
kill_thread.py | import threading
import time
import inspect
import ctypes
__all__ = ['stop_thread']
def _async_raise(tid, exctype):
"""raises the exception, performs cleanup if needed"""
tid = ctypes.c_long(tid)
if not inspect.isclass(exctype):
exctype = type(exctype)
res = ctypes.pythonapi.PyThreadState_Set... |
tests.py | #! /usr/bin/env python3
import hashlib
import http.server
import os
import shutil
import socket
import subprocess
import tempfile
import threading
import unittest
class WrapperScriptTests(unittest.TestCase):
http_port = 8080
default_bash = "/usr/bin/bash"
minimum_script_dependencies = [
"/usr/bi... |
REDItoolDnaRna.py | #!/home/epicardi/bin/python27/bin/python
# Copyright (c) 2013-2014 Ernesto Picardi <[email protected]>
#
# 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 ... |
api.py | """
Expose all variables in core sub-package.
"""
# noinspection PyUnresolvedReferences
import flowsaber
# noinspection PyUnresolvedReferences
from flowsaber.core.channel import *
# noinspection PyUnresolvedReferences
from flowsaber.core.engine.flow_runner import *
# noinspection PyUnresolvedReferences
from flowsaber.c... |
views.py | # Mostly copied from https://gitlab.com/patkennedy79/flask_recipe_app/blob/master/web/project/users/views.py
#################
#### imports ####
#################
from flask import render_template, Blueprint, request, redirect, url_for, flash, abort
from sqlalchemy.exc import IntegrityError
from flask_login import lo... |
gmproc.py |
import multiprocessing as mp
import time
class Workers:
def __init__(self):
self.targets = {}
self.queue = mp.Queue()
self.results = {}
def add(self, id, target, params=None):
self.targets[id] = ProcessWrapper(id, target, params)
def set_params(self, id, new_value):
self.targets[id].param... |
test_locking.py | #emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ... |
plugin.py | #!/usr/bin/env python3
#
# Oregano - a lightweight Ergon client
# CashFusion - an advanced coin anonymizer
#
# Copyright (C) 2020 Mark B. Lundeberg
#
# 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 So... |
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. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
container.py | ##################################################################
# Copyright 2018 Open Source Geospatial Foundation and others #
# licensed under MIT, Please consult LICENSE.txt for details #
##################################################################
import os
import pywps.configuration as config
from... |
process_replay.py | #!/usr/bin/env python3
import capnp
import os
import sys
import threading
import importlib
if "CI" in os.environ:
def tqdm(x):
return x
else:
from tqdm import tqdm # type: ignore
from cereal import car, log
from selfdrive.car.car_helpers import get_car
import selfdrive.manager as manager
import cereal.messa... |
Trading.py | # -*- coding: UTF-8 -*-
# @yasinkuyu
# Define Python imports
import os
import sys
import time
import config
import threading
import math
# Define Custom imports
from Database import Database
from Orders import Orders
class Trading():
# Define trade vars
order_id = 0
order_data = None
buy... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask("")
@app.route("/")
def home():
return "Hello, World! I am running"
def run():
app.run(host='0.0.0.0', port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
client_test.py | try:
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
except ImportError:
from http.server import HTTPServer, BaseHTTPRequestHandler
import socket
from threading import Thread
import json
import random
import urllib
from urlparse import urlparse
import alluxio
from random_option import *
from ran... |
test_simple.py | import multiprocessing
import os
import time
from unittest import mock
import requests
from coworks.utils import import_attr
class TestClass:
@mock.patch.dict(os.environ, {"WORKSPACE": "local"})
@mock.patch.dict(os.environ, {"FLASK_RUN_FROM_CLI": "false"})
def test_run_simple(self, samples_docs_dir, un... |
youku.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__all__ = ['youku_download', 'youku_download_playlist', 'youku_download_by_id']
from ..common import *
import json
from random import randint
from time import time
import re
import sys
def trim_title(title):
title = title.replace(' - 视频 - 优酷视频 - 在线观看', '')
title... |
01_clear.py | import sys, os
#get path of script
_script_path = os.path.realpath(__file__)
pyWolfPath = os.path.dirname(_script_path)
if sys.platform == "linux" or sys.platform == "linux2":
print "Linux not tested yet"
elif sys.platform == "darwin":
print "OS X not tested yet"
elif sys.platform == "win32":
pyWolfPath =... |
11.robot_servo_ball.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
* @par Copyright (C): 2010-2020, Hunan CLB Tech
* @file robot_sevo_ball
* @version V1.0
* @details
* @par History
@author: zhulin
"""
from __future__ import division
import cv2
import time
import numpy as np
import Adafruit_PCA9685... |
replay_checks.py | import os
import sys
# sys.path.append(os.path.join(os.environ['ALFRED_ROOT']))
# sys.path.append(os.path.join(os.environ['ALFRED_ROOT'], 'gen'))
sys.path.append(os.path.join('/home/jiasenl/code/alfred'))
sys.path.append(os.path.join('/home/jiasenl/code/alfred', 'gen'))
import argparse
import json
import numpy as np
i... |
event_output.py | """
Functions for output pegasus-monitord events to various destinations.
"""
##
# Copyright 2007-2011 University Of Southern California
#
# 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
#... |
mailService.py | # Remote Services Calls
from threading import Thread
import jwt
from flask import url_for
from flask_mail import Message
from . import app
from . import mail
def send_async(app, msg):
with app.app_context():
mail.send(msg)
def send_verification_mail(recipient, token):
link = url_for('verify_email',... |
session_test.py | # Copyright 2015 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... |
soundboard.py | import threading
from pynput import keyboard
from playsound import playsound
BATZ = './batz.m4a'
BLJAD = './bljad.m4a'
SHESH = './shesh.m4a'
OH_SHIT = './oh_shit.m4a'
def play_sound(sound_name):
playsound(sound_name)
def on_press(key):
try:
if key == keyboard.Key.space:
threading.Thread(... |
utils.py | import numpy as np
import keras
import keras.backend as K
import heapq
import copy
from multiprocessing import Pool, Process, SimpleQueue, Pipe
import dgl
import networkx as nx
inf = 1e10
class Multiprocessing:
@staticmethod
def work(fun, child_conn, args):
ret = fun(args[0], child_conn, args[2])
... |
test_browser.py | import BaseHTTPServer, multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex
from runner import BrowserCore, path_from_root
from tools.shared import *
# User can specify an environment variable EMSCRIPTEN_BROWSER to force the browser test suite to
# run using another browser command line tha... |
client.py | import socketio
from utils.utility import uploadImg
from utils.analysis import analysis
from hardware.controller import Controller
import subprocess
import time
import threading
print("Start Running Client ...")
controller = Controller()
# standard Python
sio = socketio.Client()
host = "https://smartsmokedetection.her... |
cronerror.py | from events.processrepo import ProcessRepo
import threading
from threading import Thread
from configs.configs import error_cron_interval_sec, shared_storage_path, error_prefix, error_batch_size
from .cronrepo import StoreRepo
import logging
from events.errorrepo import ErrorRepo
from events.processrepo import ProcessRe... |
player.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-07-15 15:48:27
# @Last Modified by: AlanAlbert
# @Last Modified time: 2018-11-21 14:00:00
"""
网易云音乐 Player
"""
# Let's make some noise
from __future__ import print_function, unicode_literals, division, absolute_import
import subprocess
impo... |
server.py | import threading
import socket
import json
import time
import chess
__all__ = ['Server', 'Communicator', 'Communicator2']
class Server(object):
def __init__(self, app):
self.app = app
self._names = [
None,
None
]
# self._communicators = [
# Co... |
pyusb_backend.py | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... |
rf_interpreter_server_manager.py | from robocorp_ls_core.robotframework_log import get_logger
from robocorp_ls_core.basic import is_process_alive, log_and_silence_errors
import itertools
from functools import partial
import os
import sys
import threading
from typing import Any, Dict, Optional
from robocorp_ls_core.protocols import ActionResultDict, ICon... |
__main__.py | import multiprocessing as mp
import json
from time import sleep
from Network.networking import send_data, form_packet
from arduino_ver1.Translation import buzzer_on, SetLock, SetAngle, rc_time, light, writeWarning
def start_polling(poll_output_queue: mp.Queue, host: str):
"""Start polling the server for data"""
... |
tcp3server.py | import socket
import threading
import CompressAndDecompress
from CompressAndDecompress import Compressed
class TCPserver():
def __init__(self):
self.server_ip='localhost'
self.server_port = 9999
def main(self):
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
... |
test_client.py | import asyncio
from collections import deque
from concurrent.futures import CancelledError
import gc
import logging
from operator import add
import os
import pickle
import psutil
import random
import subprocess
import sys
import threading
from threading import Semaphore
from time import sleep
import traceback
import wa... |
index.py | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 gomashio1596
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 us... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask.ext.mail import Message
from . import mail
from app.tool.send_mail import send_email,send_163
def send_async_email(app, msg):
with app.app_context():
send_163(msg)
def send_email(to, subject, template, **kwargs):
... |
generate-runtime-tests.py | #!/usr/bin/env python
# Copyright 2014 the V8 project 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 itertools
import js2c
import multiprocessing
import optparse
import os
import random
import re
import shutil
import signal
imp... |
test_interactive.py | import time
from threading import Thread
import pytest
from pji.control import interactive_process, ResourceLimit, InteractiveProcess, RunResultStatus
# noinspection DuplicatedCode
@pytest.mark.unittest
class TestControlProcessInteractive:
def test_interactive_process_simple(self):
_before_start = time.... |
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 support
threading = support.import_module('threading')
QUEUE_SIZE = 5
def qfull(q):
return q.maxsize > 0 and q.qsize() == q.maxsize
# A thread to run... |
nr_example.py |
#Copyright (c) 2017 Joseph D. Steinmeyer (jodalyst)
#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, m... |
emails.py |
from flask_mail import Message
from . import mail
from flask import current_app, render_template
from threading import Thread
def send_asynx_mail(app, msg):
with app.app_context():
mail.send(msg)
def send_mail(to,subject, template, **kwargs):
app = current_app._get_current_object()
msg = Message(... |
server.py | import cherrypy
from cherrypy.lib.static import serve_file
import os
import sys
import webbrowser
import threading
import time
import socket
import json
from client import addClient, loadClients, clearClients, clientsList, removeClient
from transmitJSON import sendJSON, recvJSON
def getRootDir():
return os.path.di... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return 'Wrong place. Go to discord to interact with bot.'
def run():
app.run(host='0.0.0.0',port=3333)
def keep_alive():
t = Thread(target=run)
t.start()
|
test_request_safety.py | # Copyright 2019, OpenTelemetry Authors
#
# 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 i... |
A3C_Allocation.py | from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file
import threading
import multiprocessing
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.contrib.slim as slim
import scipy.signal
import pandas as pd
from model.helper import *
from model... |
serialwriter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2012,2013 Andreas Vogel [email protected]
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and a... |
recording_video_with_opencv_multithreading.py | from threading import Thread
import cv2
import time
class VideoWriterWidget(object):
def __init__(self, video_file_name, src=0):
# Create a VideoCapture object
self.frame_name = str(src)
self.video_file = video_file_name
self.video_file_name = video_file_name + '.avi'
self.c... |
bindshell.py | from libs.config import alias, color
from libs.myapp import send
from libs.functions.webshell_plugins.bindshell import *
from threading import Thread
from time import sleep
@alias(True, func_alias="bs", _type="SHELL")
def run(port: int = 7777, passwd: str = "doughnuts"):
"""
bind shell
Bind a port and wa... |
utils.py | from colorama import init, Fore, Back, Style
from datetime import datetime
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from webhook import DiscordWebhook, DiscordEmbed
from chromedriver_py import binary_path as driver_path
import js... |
server.py | import socket
import sys
from threading import *
import time
import traceback
import logging
from logging.handlers import RotatingFileHandler
import os
# create logger
logger = logging.getLogger('WIZARD-CHAT')
logger.setLevel(logging.DEBUG)
log_file = os.path.join('{}/Documents/wizard/log/'.format(os.getenv("USERPR... |
demo6.py | """
【Python多任务编程】父子进程数据共享问题 2019/11/02 14:50
"""
# TODO: 进程间数据不共享
"""
在一个程序中,如果创建了一个子进程,那么这个子进程会拷贝一份当前进程所有的资源作为子进程的运行环境。
也就是说,子进程中的变量可能跟父进程一样,但其实是另外一个块内存区域了。他们之间的数据是不共享的。
所有资源:变量,函数,class 类等
"""
from multiprocessing import Process
AGE = 1
def greet(names):
global AGE
AGE += 1
names.append('ketang')
... |
main.py | # !!!注意!!!
# 本项目(yibanAutocheakin)涉及的任何代码,仅供学习测试研究,禁止用于商业用途
# !!!!!!!!!!!!!!!!!!!!特别注意!!!!!!!!!!!!!!!!!!!!
# 如果出现发热、干咳、体寒、体不适、胸痛、鼻塞、流鼻涕、恶心、腹泻等症状。
# 请立即停止使用本项目(yibanAutocheakin),认真实履行社会义务,及时进行健康申报。
# !!!!!!!!!!!!!!!!!!!!特别注意!!!!!!!!!!!!!!!!!!!!
# 如有侵权,请提供相关证明,所有权证明,本人收到后删除相关文件。
# 无论以任何... |
AsyncSave.py | import datetime
import threading
import time
import os
import cv2
def TimeStamp(mode='msec'):
ts = time.time()
if mode == 'msec-raw':
return str(int(time.time()*1000))
if mode == 'msec':
return datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d.%H-%M-%S.%f')
if mode == 'minute':
... |
__init__.py | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... |
main.py | #! /usr/bin/env python
import importlib
import os
import logging
import tempfile
import signal
import shutil
import time
import sys
import threading
import json
import optparse
import email
import subprocess
import hashlib
import yaml
import requests
import coloredlogs
import alexapi.config
import alexapi.tunein as ... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum_axe.bitcoin import TYPE_ADDRESS
from electrum_axe.storage import WalletStorage
from electrum_axe.wallet import Wallet
from electrum_axe.paymentrequest import InvoiceStore
from electrum... |
proyecto2.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Sistemas Operativos
# Rene Vazquez Peñaloza
import random
import threading
import time
#En esta variable se define en numero de clientes que puede haber conectados al servidor
UsuariosConectados=2
#Se definen los multiplex que nos permiten controlar el flujo en cada dire... |
platform.py | from typing import Dict, Tuple
from queue import Queue, Empty
from threading import Thread
from time import sleep
from rpicam.cams.cam import Cam
from rpicam.servo.servo import Servo
from rpicam.utils.logging_utils import get_logger
class Platform:
CAM_RES_POLL_TIMEOUT = 2
def __init__(
self, cam: ... |
websocket_client.py | import json
import logging
import socket
import ssl
import sys
import traceback
from datetime import datetime
from threading import Lock, Thread
from time import sleep
from typing import Optional
import websocket
from vnpy.trader.utility import get_file_logger
class WebsocketClient:
"""
Websocket API
Af... |
jre_validator.py | #! /usr/bin/env python
import os
from dbx_logger import logger
import threading
import subprocess
import traceback
import shlex
import C
class Command(object):
"""
Enables to run subprocess commands in a different thread with TIMEOUT option.
Based on jcollado's solution:
http://stackoverflow.com/quest... |
run.py | import random
from random import shuffle
import numpy as np
from datetime import datetime
import time
import queue
import threading
import logging
from PIL import Image
import itertools
import re
import os
import glob
import shutil
import sys
import copy
import h5py
from typing import Any, List, Tuple
import torch
impo... |
capture.py | import copy
import os
import time
import threading
import typing
import queue
from absl import app, flags
from cv2 import cv2
from genicam.gentl import TimeoutException
from harvesters.core import Harvester
import numpy as np
import s3_util
WINDOW_NAME = "Capture"
flags.DEFINE_string(
"gentl_producer_path",
... |
lossy_layer.py | # ------------------------
# Tom Aarsen - s1027401
# Bart Janssen - s4630270
# ------------------------
import socket, select, threading, time
from btcp.constants import *
from btcp.btcp_segment import BTCPSegment
# Continuously read from the socket and whenever a segment arrives,
# call the lossy_layer_input meth... |
__init__.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... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
test__subprocess.py | import sys
import os
import errno
import unittest
import time
import gc
import tempfile
import gevent.testing as greentest
import gevent
from gevent.testing import mock
from gevent import subprocess
if not hasattr(subprocess, 'mswindows'):
# PyPy3, native python subprocess
subprocess.mswindows = False
PYPY... |
filter.py | import modules.core.database as database
#import modules.core.extract as extract
import modules.core.extract as extract
import modules.core.unparse as unparse
import time
import threading
import json
class filter_switch():
def __init__(self,update,context) -> None:
self.update = update
... |
test_pool.py |
# Copyright 2013 Red Hat, 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 agr... |
test_sigma_dut.py | # Test cases for sigma_dut
# Copyright (c) 2017, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import logging
logger = logging.getLogger()
import os
import socket
import struct
import subprocess
import threading
import tim... |
producer_pool.py | try:
import Queue
except:
import queue as Queue
import logging
import multiprocessing
import os
import sys
import time
import traceback
import numpy as np
logger = logging.getLogger(__name__)
class NoResult(Exception):
pass
class ParentDied(Exception):
pass
class WorkersDied(Exception):
pass
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.