source
stringlengths
3
86
python
stringlengths
75
1.04M
client.py
__version__ = '0.0.1' import os.path import urlparse import urllib from threading import Thread, RLock import logging logger = logging.getLogger('onvif') logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.CRITICAL) import suds.sudsobject from suds.client import Client from suds...
stream.py
#!/usr/bin/env python import os import http.server import time import threading from urllib.parse import urlparse from cheapmp3 import CheapMP3 root = os.getcwd() +"/" cach_dir = root + 'cache/' class AP(http.server.BaseHTTPRequestHandler): #protocol_version = "HTTP/1.1" t = 0 def __init__(self, request...
MotorControlTest.py
#!/usr/bin/python from __future__ import division import time # Import the PCA9685 module. #import Adafruit_PCA9685 import socket #import socket module import time,threading import serial, string import time output = " " lon=0 lat=0 stringVal="" ser = serial.Serial('/dev/ttyUSB0',115200, 8, 'N',1, tim...
demo5.py
import threading import time mutex_a = threading.Lock() mutex_b = threading.Lock() def fun1(): mutex_a.acquire() time.sleep(1) mutex_b.acquire() mutex_a.release() mutex_b.release() print("------- fun1 over ------") def fun2(): mutex_b.acquire() time.sleep(1) mutex_a.acquire()...
makeLabeledSet.py
import argparse import sys import time import numpy as np import cPickle as pickle from multiprocessing import Process, Queue sys.path.append('./') from ml_utils import nnet_utils from ml_utils import search_utils from environments import env_utils import os def heurProc(dataQueue,resQueue,modelLoc,useGPU,Environment...
swivel.py
#!/usr/bin/env python # # 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 require...
service.py
from modules import worker from flask import Flask, request, Response, json, url_for import threading import uuid app = Flask(__name__) # dictionary which stores currently processed requests background_tasks = {} # default index page @app.route("/") def indexPage(): return "Service is deployed at /service" # s...
basic.py
import socket import threading def recvall(sock, BUFF_SIZE = 2048): data = b"" while True: part = sock.recv(BUFF_SIZE) data += part if len(part) < BUFF_SIZE: break return data class Client: def __init__(self, host, port): self...
test_cursor.py
# Copyright 2009-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
test_socketserver.py
""" Test suite for socketserver. """ import contextlib import io import os import select import signal import socket import tempfile import threading import unittest import socketserver import test.support from test.support import reap_children, verbose from test.support import os_helper from test.support import sock...
lavaPlatformer.py
from tkinter import * from tkinter import messagebox import tkinter.simpledialog as s import time, sys, random, os, sqlite3, json, threading, requests, shutil import shop, statistics, settings from soundplayer import SoundPlayer filept = os.path.abspath(os.listdir()[0]) class Game: def __init__(self, st=False, ktc=...
menu_screen.py
import curses import math import os import traceback import threading import time import random import getpass import json import sqlite3 import string import re import completer import datetime class CursedMenu(object): #TODO: name your plant '''A class which abstracts the horrors of building a curses-based m...
router.py
# -*- coding: utf-8 -*- """RIP protocol simulation Author: Heng-Da Xu <dadamrxx@gmail.com> Date: Oct 18, 2019 """ import argparse import pickle import socket import threading import time class Item: DYNAMIC = 0 STATIC = 1 def __init__(self, next_hop, distance): self.next_hop = next_hop ...
DyStockTradeOneKeyHangUp.py
from datetime import datetime from time import sleep import threading import tushare as ts from EventEngine.DyEvent import * from DyCommon.DyCommon import * from DyCommon.DyScheduler import DyScheduler from Stock.Common.DyStockCommon import DyStockCommon class DyStockTradeOneKeyHangUp(object): """ 股票交易一...
main.py
import prometheus_client as prom import random import time from threading import Thread from flask import Flask, request from flask_prometheus import monitor req_summary = prom.Summary('python_my_req_example', 'Time spent processing a request') @req_summary.time() def process_request(t): time.sleep(t) app = F...
view.py
import socket import struct from threading import Thread from python_qt_binding.QtCore import QMutex, QMutexLocker, QTimer from qt_gui.plugin import Plugin from pymavlink.mavutil import mavlink_connection from pymavlink.dialects.v10.ardupilotmega \ import MAVLink_global_position_int_message from pymavlink.dialect...
test_runtime_captures_signals.py
import multiprocessing import os import signal import time import pytest from jina import Document, DocumentArray, Executor, requests from jina.clients.request import request_generator from jina.parsers import set_gateway_parser, set_pod_parser from jina.serve.networking import GrpcConnectionPool from jina_cli.api im...
aiflow_client.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...
hypothesis_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy import time from functools import partial, reduce from future.utils import viewitems, viewkeys from hypothesis import assume, given, settings, HealthCheck import hypothesis.strate...
streaming.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import httplib from socket import timeout from threading import Thread from time import sleep import urllib from tweepy.models import Status from tweepy.api import API from tweepy.error import TweepError from tweepy.utils import import_simple...
test_cursor.py
# Copyright 2009-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
dataquery.py
import os os.system('pip install requests') from datetime import datetime import json import requests import time import threading import random import urllib.parse sqlStatements2 = [ "select fname from customer;", "select fname from customer where customer_num > 108;" ] sqlStatements = [ "select fname from...
event.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` tests.integration.modules.event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import python libs from __future__ import absolute_import import time import threading # Import Salt Testing libs from salttesting.helpers import ens...
network.py
import pickle import socket import sys import threading from concurrent.futures.thread import ThreadPoolExecutor import player from constants import local_port, buffer_size, tetris_height, tetris_width from packet import Packet, PacketType class Network: local_ip = "" # IP of the other player remote_ip =...
__init__.py
# coding: utf8 # Copyright 2013-2017 Vincent Jacques <vincent@vincent-jacques.net> import ctypes import datetime import multiprocessing import os.path import pickle import sys import threading # We import matplotlib in the functions that need it because # upgrading it while using it leads to segfault. And we upgra...
main.py
#!/usr/bin/python # -*- coding: utf-8 -*- import flask import notifier from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons import os import re import sys import struct import json import requests import argparse import get...
sender.py
#!/usr/bin/env python import os import sys import pika import subprocess import threading from datetime import datetime def sendPayload(message, network, host, port, username, password, channel, connection): channel.basic_publish(exchange='', routing_key=network, body=mess...
test_signal.py
import errno import os import random import signal import socket import statistics import subprocess import sys import time import unittest from test import support from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi except ImportError: _testcapi = None class GenericTes...
celery.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 use ...
popen.py
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu" __license__ = "MIT" import os import copy import stat import time import Queue import signal import tempfile import threading import traceback import subprocess import radical.utils as ru from .... import pilot as rp from ... import utils ...
silent.py
#!/usr/bin/env python """ """ __docformat__ = 'restructuredtext' __version__ = '$Id: $' import threading import time import mt_media import pyglet _debug = pyglet.options['debug_media'] class SilentAudioPlayer(mt_media.AbstractAudioPlayer): # When playing video, length of audio (in secs) to buffer ahead. ...
test_stream.py
from tomostream import solver from tomostream import util import numpy as np import dxchange import time import threading class Simulate(): def __init__(self): proj, flat, dark, theta = dxchange.read_aps_32id('/local/data/2020-07/Nikitin/scan_057.h5', sino=(0, 2048)) proj=proj[:,::2,::2] da...
bot.py
""" файл для обработки команд пользователя """ import os from datetime import datetime from telebot import types import threading import functions import loopWork import dataBase import pg_connect import telebot import args print("------------------------НАЧАЛАСЬ ЗАГРУЗКА БОТА------------------------") ...
test_asyncore.py
import asyncore import unittest import select import os import socket import sys import time import warnings import errno from test import test_support from test.test_support import TESTFN, run_unittest, unlink from StringIO import StringIO try: import threading except ImportError: threading ...
xla_client_test.py
# Copyright 2017 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...
hands_free_dmm.py
#! /usr/bin/env python3 # The MIT License (MIT) # # Copyright (c) 2016 Charles Armstrap <charles@armstrap.org> # If you like this library, consider donating to: http://bit.ly/pyvirtualbench # Anything helps. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software an...
vg_to_imdb.py
# coding=utf8 import argparse, os, json, string from Queue import Queue from threading import Thread, Lock import h5py import numpy as np from scipy.misc import imread, imresize def build_filename_dict(data): # First make sure all basenames are unique basenames_list = [os.path.basename(img['image_path']) for...
L4_multithread.py
# This will be a minimal example of demonstrating multithreading for SCUTTLE. # IMPORT EXTERNAL ITEMS import time import threading # only used for threading functionsdddd # IMPORT INTERNAL ITEMS import L3_driveGP as drive import L3_tellHeading as tell # CREATE A THREAD FOR SPEAKING def loop_speak( ID ): tell.go(...
backupset.py
# -*- coding: utf-8 -*- # -------------------------------------------------------------------------- # Copyright Commvault Systems, 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 # # ...
postmaster.py
import logging import multiprocessing import os import psutil import re import signal import subprocess import sys from patroni import PATRONI_ENV_PREFIX, KUBERNETES_ENV_PREFIX # avoid spawning the resource tracker process if sys.version_info >= (3, 8): # pragma: no cover import multiprocessing.resource_tracker ...
master.py
"""Galaxy CM master manager""" import commands import datetime as dt import logging import logging.config import os import shutil import subprocess import threading import time from cm.instance import Instance from cm.services import ServiceRole from cm.services import ServiceType from cm.services import service_state...
__init__.py
# Copyright 2019 Atalaya Tech, 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,...
car_helpers.py
import os import threading import json import requests from common.params import Params from common.basedir import BASEDIR from selfdrive.version import comma_remote, tested_branch from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars from selfdrive.car.vin import get_vin, VIN_UNKNOWN from ...
pool.py
import logging import multiprocessing as mp import os import queue import signal import threading import warnings from datetime import datetime from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Sized, Union try: import numpy as np NUMPY_INSTALLED = True except ImportError: np = N...
recorder.py
import numpy import pyaudio import threading class SwhRecorder: """Simple, cross-platform class to record from the microphone.""" def __init__(self): """minimal garb is executed when class is loaded.""" self.RATE = 48100 self.BUFFERSIZE = 4024 * 2 # 1024 is a good buffer size ...
remoteterminal.py
# Copyright 2021 Northern.tech AS # # 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 ag...
multiprocessing_env.py
# 该代码来自 openai baseline,用于多线程环境 # https://github.com/openai/baselines/tree/master/baselines/common/vec_env import numpy as np from multiprocessing import Process, Pipe def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while True: cmd, data = remote.r...
utils.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...
trade.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ __title__ = '' __author__ = 'HaiFeng' __mtime__ = '2016/9/22' """ import threading import itertools import time import os import platform from .enums import OrderType, InstrumentStatus, DirectType, OffsetType, HedgeType, TradeTypeType from .structs import InfoField, Instr...
collection.py
# 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 law or agreed to in writin...
util.py
import os import shutil import sys import ctypes from pathlib import Path if sys.version_info[0] < 3 or sys.version_info[1] <= 5: print("\nPlease restart with Python 3.6+\n") print("Current Python version:", sys.version_info) exit(-1) tc_core = None def in_docker(): if os.environ.get("TI_IN_DOCKER", "") == ...
engine.py
# Copyright 2013: Mirantis 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 b...
async_rl.py
import math import multiprocessing as mp import time from collections import deque import psutil import torch from rlpyt.runners.base import BaseRunner from rlpyt.utils.collections import AttrDict from rlpyt.utils.logging import logger from rlpyt.utils.prog_bar import ProgBarCounter from rlpyt.utils.quick_args import...
humidity-sensor.py
from connection import * import connection, threading, socket from datetime import datetime value = -1 humidityTimes = {} with open(SOURCE_FILE, mode='r+') as csv_file: for row in csv_file: if (row.split(',')[3] == '\n'): humidityTimes[row.split(',')[1]] = 'error' continue ...
event_processor.py
#!/usr/bin/env python3 import concurrent.futures import threading import queue import time import json def main(): incoming = queue.Queue() outgoing = queue.Queue() receiver = threading.Thread(target=receive, args=(incoming,), daemon=True) processor = threading.Thread(target=process, args=(incoming,...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading import gc import textwrap from test....
utils.py
"""Util functions.""" import os import threading COMMAND_GET_IP = ("gcloud compute instances describe {} --zone={}" + " --format='get(networkInterfaces[0].networkIP)'") SSH_COMMAND = "gcloud compute ssh {} --ssh-flag='-t' --command='{}'" SCP_COMMAND = "gcloud compute scp --recurse {src} {address}:{...
wxJobManager.py
''' Created on 27 févr. 2022 @author: slinux ''' import logging import threading import time from threading import Thread, Lock import wx import wx.adv from wxRavenGUI.application.pluginsframework import Job import importlib from wxRavenGUI.application.core.jobs.wxRaven_RemoteJob import Job_RemoteJob from .jobs im...
misc.py
""" Misc module contains stateless functions that could be used during pytest execution, or outside during setup/teardown of the integration tests environment. """ import contextlib import errno import http.server as SimpleHTTPServer import multiprocessing import os import re import shutil import socketserver import st...
lnet.py
#!/usr/bin/env python2.7 # pylint: disable=bad-indentation, no-member, invalid-name, line-too-long import os import shutil import random import argparse import multiprocessing as mp import cv2 import h5py import caffe import numpy as np from caffe.proto import caffe_pb2 from google.protobuf import text_format from jfd...
shcommon.py
# -*- coding: utf-8 -*- """ The Control, Escape and Graphics are taken from pyte (https://github.com/selectel/pyte) """ import os import sys import platform import functools import threading import ctypes from itertools import chain from stash.lib.libslog import slog PY3 = sys.version_info.major == 3 _pyfile_ = __fi...
webcam_demo.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import time from collections import deque from queue import Queue from threading import Event, Lock, Thread import cv2 import numpy as np from mmpose.apis import (get_track_id, inference_top_down_pose_model, init_pose_model, vis_...
parallel_runner_maven.py
from envs import REGISTRY as env_REGISTRY from functools import partial from components.episode_buffer import EpisodeBatch from multiprocessing import Pipe, Process import numpy as np import torch as th from modules.bandits.const_lr import Constant_Lr from modules.bandits.uniform import Uniform from modules.bandits.rei...
main.py
import threading as th import time start = time.perf_counter() def do_something(seconds=1): print(f'\nSleeping {seconds} second(s)...') time.sleep(seconds) print(f'Done Sleeping {seconds}') threads = [] for i in range(10): t = th.Thread(target=do_something, args=[i]) t.start() # Empieza la e...
test_units.py
#!/usr/bin/env python ''' test_units.py - some unit tests for parts of brozzler amenable to that Copyright (C) 2016-2017 Internet Archive 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:/...
worker.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
magnet.py
# coding: utf-8 import requests import re import json import time from queue import Queue import threading from function_requests import get_html_html from requests_html import HTMLSession from bs4 import BeautifulSoup from jinja2 import PackageLoader,Environment def sukebei_findindex(searchid): url = 'https://s...
device_manager.py
""" Copyright (C) Cortic Technology Corp. - All Rights Reserved Written by Michael Ng <michaelng@cortic.ca>, 2021 """ import paho.mqtt.client as mqtt import logging import time import re import os import subprocess import threading import pyaudio import spidev from ctypes import * import bluetooth logging.getLogge...
SearchInferredDrugsTab.py
__author__ = 'aarongary' from app import PubMed from app import elastic_search_uri from collections import Counter from elasticsearch import Elasticsearch from bson.json_util import dumps import matplotlib.pyplot as plt import matplotlib.colors as mpclrs import pymongo from multiprocessing import Manager, Process impo...
TaskManager.py
import threading import time from queue import Queue import config Max = config.MAX_VIDEO_PROCESS class TaskManager(threading.Thread): # 用队列保存所有待检测任务,如果没有达到最大处理数,就不断取出,达到后等待 taskQueue = Queue() def __init__(self, n): super(TaskManager, self).__init__() # 重构run函数必须要写 self.number = n ...
utils.py
"""Utility functions used by the various awsorgs modules""" import os import sys import re import pkg_resources import difflib import threading try: import queue except ImportError: import Queue as queue import boto3 from botocore.exceptions import ClientError import yaml import logging S3_BUCKET_PREFIX = '...
ipu_multi_worker_strategy_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...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
frame_server_impl.py
from ...config import camera_config from ...config import file_writer_config from ...scene import scene from ..gen import frameserver_pb2 from ..gen import frameserver_pb2_grpc from ..gen import renderserver_pb2 from ..gen import renderserver_pb2_grpc from concurrent import futures from google.protobuf import json_form...
miniterm.py
#!/usr/bin/env python # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import threading import serial from serial.tools.list_ports impo...
server.py
# Copyright 2020 Adap GmbH. 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 ag...
TincanInterface.py
# ipop-project # Copyright 2016, University of Florida # # 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...
wsclient.py
from ws4py.client.threadedclient import WebSocketClient import threading import asyncio import discord import inspect import json import _thread as thread from discord.ext.commands import Bot import secret as tokens from discord.ext import commands from discord.ext.commands import has_permissions, MissingPermissions, C...
sniffer.py
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
desarrolladores.py
#Guadarrama Flores Edgar Alejandro hackers = 0 #inicializo el numero de hackers en cero porque aun no llega nadie a formarse serfs = 0 #De la misma manera a los serfs mutex = Semaphore(1) colaHack = Semaphore(0) #Para controlar el numero de hackers que pasan colaMicro = Semaphore(0) #Controlar el numero de serfs que ...
h01.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: h01.py Author: Scott Yang(Scott) Email: yangyingfa@skybility.com Copyright: Copyright (c) 2021, Skybility Software Co.,Ltd. All rights reserved. Description: """ import os import threading import random import time from threading import Thread, enumerate, Lock, R...
memory_manager.py
import threading from typing import Dict from typing import List from typing import Optional import biplist from macuitest.lib import core class MemoryManager: """Interface to memory (RAM) information and manipulations on it.""" def __init__(self, executor): self._memory_slots: Optional[List[Dict[s...
osc_server.py
import threading from pythonosc import dispatcher from pythonosc import osc_server class OscServer(object): def __init__(self, ip, port): self.ip = ip self.port = port self.is_done = False self.img_path = '' def activate(self, address='/done'): self.dispatcher = dispat...
test_basic_auth.py
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import base64 import os import threading from contextlib import contextmanager from http.server import BaseHTTPRequestHandler, HTTPServer from pants.auth.basic_auth import BasicAuth, Basi...
scheduler.py
import random import time import os from multiprocessing import Process from .connection import ConnectionManager from .SchedulerBackend import SchedulerBackend from .ResultsBackend import ResultBackend from kubernetes import client, config, utils from kubernetes.client.rest import ApiException from croniter import cro...
fexm.py
#!/usr/bin/env python3 import argparse import multiprocessing import sys from threading import Thread from typing import List, Optional import config_parser from helpers import utils from helpers.utils import run_celery from docker_scripts import pacmanfuzzer_setup, aptfuzzer_setup, githubfuzzer_setup from seed_crawl...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import multiprocessing import os import socket import shutil import s...
QKeithleySolar.py
# --------------------------------------------------------------------------------- # QKeithleySolar -> QVisaApplication # Copyright (C) 2019 Michael Winters # github: https://github.com/mesoic # email: mesoic@protonmail.com # --------------------------------------------------------------------------------- # # Pe...
translate.py
import threading import time import tkinter import hashlib import random from tkinter.filedialog import * import pyperclip import requests import json import shutil path = '' def openFolder(): os.system('explorer.exe /n,%s' % path) def changeFolder(pat): pt.delete(0, tkinter.END) filepath = askdirector...
app.py
import os, os.path import sys import wx import wx.adv import threading import subprocess from furion.furion import setup_server ID_ICON_TIMER = wx.NewIdRef() OPEN_CONFIG=wx.NewIdRef() SHOW_LOGS=wx.NewIdRef() def resource_path(relative_path): """ Get absolute path to resource, works for dev and for PyInstaller "...
monobeast.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
messenger_server.py
import socket import threading import ast import sqlite3 import os.path from os import path import codecs import encryption import sys sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) sock.bind(('',1560)) sock.listen(10) connections = list() authorized_users = dict() client_keys= dict() def makedb(): if...
plainws.py
# demo at the end of this file import asyncio import websockets import threading import traceback class Connection: def __init__(self, client): self.client = client self.sendQueue = [] class Server: def __init__(self, port = 8000, maxConnections = 1): self.loop = None self.server = None self.port = port...
machine_repository_1.py
#!/usr/bin/env pybricks-micropython import time from threading import Thread import ujson import urequests from pybricks.ev3devices import Motor, ColorSensor, UltrasonicSensor from pybricks.parameters import Port, Stop, Direction from pybricks.tools import wait # Initialize the motors belt_motor = Motor(Port.D, Direc...
test_oddball.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Oddball cases for testing coverage.py""" import sys from flaky import flaky import pytest import coverage from coverage import env from coverage.backward impo...
thread_and_processes.py
import multiprocessing import random import threading import time NUM_WORKERS = 10 size = 10000000 out_list = list() def do_something(count, out_list_p): for m in range(count): out_list_p.append(random.random()) """ #Serial start_time = time.time() for _ in range(NUM_WORKERS): do_something(size,out...
perf_test_rest_api.py
""" Description: Scale up REST API functional tests to performance tests using threading. Note: requests module is synchronous and does not support asyncio to await for responses. Another option is to use aiohttp module, which uses asyncio for asynchrony. This option requires re-writing the API test functions, thou...
Original.py
#!/usr/bin/env python # coding: utf-8 # In[17]: import os from flask import Flask, request, redirect, url_for, render_template, send_from_directory from werkzeug.utils import secure_filename from datetime import datetime import time from threading import Thread now = datetime.now() app = Flask(__name__, static_url...
local.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # 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 r...
gpstest.py
#!/usr/bin/python from gps import * import time,threading import multiprocessing global gpsd import os os.system("gpsd /dev/ttyUSB0") time.sleep(1) def handle(gpsd): try: #global gpsd # gpsd.next() # while (gpsd.fix.latitude==0.0): # gpsd.next() # gpsd.next() # gpsd.next() while True: gpsd.next() ...