source
stringlengths
3
86
python
stringlengths
75
1.04M
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import multiprocessing import threading import six try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K f...
__init__.py
"""Websocket API. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import errno import fnmatch import glob import heapq import io import json import logging import os import re import sqlite3 imp...
tcp.py
""" TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" """ import errno import logging import os import queue import socket import threading import urllib import salt.ext.tornado import salt.ext.tornado.concurrent import salt.ext.tornado.gen import salt.ext.tornado...
benchmark.py
import shelve import sys import threading import time class Benchmark(object): def __init__(self, concurrency=10, iterations=10): self.concurrency = concurrency self.iterations = iterations self.shelf = Shelf() def __call__(self, f): def wrapped(*args, **kwargs): p...
scan.py
import click import os import fnmatch import sys import time import threading import git import tmanager.core.messages.messages as msg import tmanager.utilities.file_system as utl_fs import tmanager.utilities.commands as utl_cmds from tmanager.core.tool.repository.repository import Repository @click.command(options_...
profiler_test.py
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
api.py
# Copyright 2016-2022 The FEAGI 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...
server.py
""" Server recebe novas conexoes de usuarios a qualquer momento. Tambem fica responsavel pela parte do processamento de listar os usuarios ativos """ from constants import CMD_CHAT, CMD_LIST_USERS, CMD_QUIT, SERVER_NAME, SERVER_PORT import sys import socket import threading import select as s from datetime import date...
main.py
import socket import threading import ws def connect(): print("Connect") def recv(dt): print(f"Echo: {dt}") ws.send(f"Echo: {dt}") def disconnect(): print("Close") try: cfg=socket.getaddrinfo("0.0.0.0",8080,0,socket.SOCK_STREAM,socket.IPPROTO_TCP,socket.AI_PASSIVE)[0] ss=socket.socket(cfg[0],cfg[1],cfg[2]) ...
pivot_apertium.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ PivotAlign: A system for inducing bilingual dictionaries from parallel texts and pre-existing dictionaries for other language pairs. Script for pivoting through the Apertium dictionaries to create a candidate list Copyright (C) 2021 Steinþór Steingrímsson....
main.py
from ..models import Autobase as AutobaseDatabase from .. import app from . import default_config from .twitter_autobase import Autobase as AutobaseApp import logging logger = logging.getLogger(__name__) autobase_app = dict() # {'app_name':object, 'app_name_2':'error'} # Change default_config type object to dictiona...
net_suite_test.py
import re import os import socket from threading import Thread, Event import subprocess import time from shutil import copyfile from tiny_test_fw import Utility, DUT import ttfw_idf stop_sock_listener = Event() stop_io_listener = Event() sock = None client_address = None manual_test = False def io_listener(dut1): ...
test_change_stream.py
# Copyright 2017 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 writing, so...
test_pr_preview.py
try: from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer except ImportError: # Python 3 case from http.server import BaseHTTPRequestHandler, HTTPServer import contextlib import errno import json import os import shutil import stat import subprocess import tempfile import threading subject = os.pa...
sdca_ops_test.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...
manage.py
#!/usr/bin/env python3 """ Scripts to drive a donkey 2 car Usage: manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical)] [--camera=(single|stereo)] [--meta=<key:value> ...] [--myconfig=<filename>] manage.py (train) [--tubs=tubs] (--model=<model>) [--type=(linear|inferred|tensorrt_linear|tflit...
stage_manager.py
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
gui.py
from kuma1to2 import * import PySimpleGUI as sg import threading import os def main(): system_msg = sg.Multiline( "msg: please fill in the blanks\n", text_color="gray", size=(60, 10), autoscroll=True) password_input = sg.Input("", disabled=True) ok_button = sg.OK() layout = [ ...
tests.py
#-*- coding:utf-8 -*- import unittest from datetime import datetime from time import sleep import mock from pytest import fail from tornado import gen from tornado import testing from pybreaker import * class CircuitBreakerStorageBasedTestCase(object): """ Mix in to test against different storage backings....
tcp_test.py
from __future__ import absolute_import, print_function import failover import logging from select import select from six.moves.http_client import ( HTTPConnection, INTERNAL_SERVER_ERROR, NOT_FOUND, OK, SERVICE_UNAVAILABLE) from socket import ( AF_INET, create_connection, INADDR_ANY, SOCK_STREAM, socket, SOL_SOC...
new_install.py
#!/usr/bin/env python import sys sys.path = [".", "lib"] + sys.path import threading import queue import time import random import install_utils, install_constants import logging.config import os from membase.api.exception import InstallException import traceback logging.config.fileConfig("scripts.logging.conf") log...
audio_reader.py
import fnmatch import os import random import re import threading import librosa import numpy as np import tensorflow as tf FILE_PATTERN = r'p([0-9]+)_([0-9]+)\.wav' def get_category_cardinality(files): id_reg_expression = re.compile(FILE_PATTERN) min_id = None max_id = None for filename in files: ...
tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import threading import time import unittest import warnings from datetime import datetime, timedelta from django.core.cache import cache from django.core.exceptions import SuspiciousFileOpe...
retropong.py
import threading import pygame import ball import bar import mainWindow import randomball import time import os from randomMusicplayer import WavPlayerRandom from multiprocessing import Process # Thread List threads = [] BALLSPEED = 1 MUSIC_ON = True SOUND_ON = True PVP_CONTROL = True COMPUTERONLYCONTROL = True TIM...
__init__.py
import asyncio import json import threading from threading import Thread import numpy as np import pydash as _ from si_prefix import si_format, si_parse from dropbot import SerialProxy from micropede.client import MicropedeClient , dump_stack from micropede.async import MicropedeAsync SCHEMA = { "t...
merge.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Author: rjayapalan Created: March 09, 2022 """ import os import csv from typing import Callable, Optional import logging import time from .common import constant, error log = logging.getLogger(__name__) class Merge: def __init__(self, inputdir: str, outputdir:...
api.py
from flask import Flask, request, render_template import requests import json import importlib, inspect from parametric import Parameter, Instrument from parametric.factory import Knob, Switch, Measurement, Selector from vigilant import Monitor import attr from threading import Thread from optimistic.algorithms import ...
dalek_state.py
#!/usr/bin/env python3 """Dalek State Machine This module provides a state machine that enables a Dalek to recognise people within its field of view and either welcome them by name, or threaten them if it doesn't recognise them. It assumes: * the use of an Adafruit Servo Controller to control an iris servo ...
serachsql.py
import json import logging import time import re import threading import configparser from django.db.models import Count from libs import util from rest_framework.response import Response from libs.serializers import Query_review, Query_list from libs import baseview, send_email from libs import con_database from core....
consumer_producer.py
import time import random from multiprocessing import Queue,Process def consumer(name,q): while True: res=q.get() time.sleep(random.randint(1,3)) print('消费者》》%s 准备开吃%s。'%(name,res)) def producer(name,q): for i in range(5): time.sleep(random.randint(1,2)) res='大虾%s'%i ...
cloudscan.py
#!/usr/bin/env python # Copyright 2015 Lockheed Martin Corporation # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Licensed under the Apache License, Version ...
make.py
# coding: utf-8 from __future__ import print_function import argparse import multiprocessing import os import platform import shutil import subprocess import sys import threading import time import zipfile # The current test/decompression data version in use current_test_data = 'test_data_v3' current_decomp_data = '...
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. from __future__ import print_function import multiprocessing import o...
autobot.py
#!/usr/bin/python3 from libs.telegramText import NotifyBot, SendDocumentBot, CheckTokens, GetTokens import libs.coloredOP as co from pathlib import Path from zipfile import ZipFile from halo import Halo import threading import os import datetime import re import requests import subprocess import argparse impor...
convertor.py
# !pip3 install xlrd import pandas as pd import numpy as np from pathlib import Path import os from threading import Thread from queue import Queue import multiprocessing # !pip3 install khayyam from khayyam import JalaliDate, JalaliDatetime xcelLocation = "../xcels/" !export xcelLocation="../xcels/" HEADER = ["symbo...
hwtest.py
################################################################################ # # rpiloui - a python game engine for hasbros looping loui game controlled via a # raspberry pi single board computer # # This code is released under: # # Copyright (c) 2020 nasrudin2468 # # Permission is hereby granted, free o...
scheduler.py
import schedule import threading from time import sleep import datetime from biliob_tracer.task import ProgressTask import requests import redis from lxml import etree import json import requests from db import redis_connection from db import db import logging from biliob_analyzer.author_rate_caculate ...
face_helper.py
#coding=utf-8 import face_recognition from PIL import Image, ImageDraw import numpy as np import os import argparse import multiprocessing import logging SUPPORTED_IMAGE_EXT = ['.jpg', '.png'] def is_image_file(filename): _, ext = os.path.splitext(filename) if not ext.lower() in SUPPORTED_IMAGE_EXT: r...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import test_support import asyncore import socket import select import time import gc import os import errno import pprint import urllib, urlparse import traceback import weakref import functools import platform from BaseHTTPServer import HTT...
server26.py
# -*- coding: utf-8 -*- import json import select import threading import SocketServer from server_common import (SimpleJSONRPCDispatcher, SimpleJSONRPCRequestHandler) class SimpleJSONRPCServer(SocketServer.TCPServer, SimpleJSONRPCDispatcher): """...
server-tad-pi-v2.py
import socket from multiprocessing import Process, Manager import time import sys import RPi.GPIO as GPIO import os ''' !!!THIS IS FOR LOCALHOST TESTING!!! Writen by Gunnar Bjorkman to control a robot via raspberrypi Current design: * Recieve client's inputs and send server/robot info to client ove...
queue_order.py
#!/usr/bin/python from multiprocessing import Process, Queue import time import random # the example demonstrates how to get the # correct order of the calculations for input data def square(idx, x, queue): time.sleep(random.randint(1, 3)) queue.put((idx, x * x)) def main(): data = [2, 4, 6, 3, 5, 8,...
udpclientv2.py
import socket import sys import time import serial import threading import numpy as np from scipy import signal from scipy.signal import lfilter , iirnotch , butter , filtfilt , medfilt import csv writeToFile = True read = True def process(): global strm,m1p,m2p,m3p,m4p,o1p,o2p,o3p,o4p,win,cnt if strm >= 1...
tmalign.py
''' (c) 2011-2012 Thomas Holder, MPI for Developmental Biology ''' from __future__ import print_function __author__ = 'Thomas Holder' __version__ = '1.1' __license__ = 'BSD-2-Clause' from pymol import cmd, CmdException def save_pdb_without_ter(filename, selection, **kwargs): ''' DESCRIPTION Save PDB file witho...
udp_echo_client.py
""" mbed SDK Copyright (c) 2011-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 law or agreed to in wr...
litex_term.py
#!/usr/bin/env python3 # This file is Copyright (c) 2015-2019 Florent Kermarrec <florent@enjoy-digital.fr> # This file is Copyright (c) 2015 Sebastien Bourdeauducq <sb@m-labs.hk> # This file is Copyright (c) 2016 whitequark <whitequark@whitequark.org> # License: BSD import sys import signal import os import time impo...
test_softmax_fpga.py
# Simple test for softmax for FPGA # NOTE: for the moment being it supports only the last axis # TODO: add more tests from dace.transformation.interstate import FPGATransformSDFG, InlineSDFG import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from daceml.pytorch import DaceModule...
peripheral.py
""" This example exhibits some of the functionality of a peripheral BLE device, such as reading, writing and notifying characteristics. This peripheral can be used with one of the central examples running on a separate nordic device, or can be run with the nRF Connect app to explore the contents of the service "...
utils_test.py
import cv2 from queue import Queue from threading import Thread import os from config import imshape import json import numpy as np from config import hues, labels, imshape, mode import pydensecrf.densecrf as dcrf from pydensecrf.utils import unary_from_softmax from tensorflow.keras.utils import to_categorical class ...
multi.py
import dearpygui.core as core import time import multiprocessing def t1(): core.set_vsync(True) core.add_window("##base", no_background=True) core.start_dearpygui(primary_window="##base") def t2(): core.set_vsync(True) core.add_window("##base") core.start_dearpygui(primary_window="##base") i...
global_lib.py
import rollbar import pprint import yaml import os, os.path import sys import time import signal from shutil import copy from distutils.sysconfig import get_python_lib from tabulate import tabulate from pg_chameleon import pg_engine, mysql_source, pgsql_source import logging from logging.handlers import TimedRotatingF...
test_flight.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...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from __future__ import with_statement import sys import time import random import unittest from test import test_support as support try: import thread import thre...
test_io.py
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import mkstemp, mktemp, NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib...
p2p_client.py
import logging import pickle import socket import struct import threading from time import perf_counter import socks from crdt.ops import RemoteOp from crdt.vector_clock import VectorClock from network.network_client import NetworkClient, pack_and_send, recvall from tools.connected_peers import ConnectedPeers from to...
pinobot.py
#!/usr/bin/python3 from modules.pino_boot_loader import PinoBootLoader import time , threading, logging from logging.handlers import RotatingFileHandler from enum import Enum from google.api_core.exceptions import Unknown class PinoState(Enum): IDLE = 0 SENSOR_ON =1 STILL_ON = 2 SENSOR_OFF = 3 L...
bomber.py
#!/usr/bin/env python from datetime import datetime import os import hashlib import sys import time import threading import string import random import base64 import urllib.request import urllib.parse try: import requests except ImportError: print('[!] Error: some dependencies are not installed') print('Ty...
asyncio_client_generator.py
from ib_tws_server.codegen.generator_utils import GeneratorUtils from ib_tws_server.api_definition import * from ib_tws_server.codegen.generator_utils import * import inspect def forward_method_parameters_dict_style(params: List[inspect.Parameter]) -> str: return ",".join([ f"{v.name} = {v.name}" for v in params ]...
main.py
""" MIT License Copyright (c) 2021 Jiusoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
appdaemon.py
#!/usr/bin/python3 from pkg_resources import parse_version import json import sys import importlib import traceback import configparser import argparse import logging import os import os.path from websocket import create_connection from logging.handlers import RotatingFileHandler from queue import Queue from sseclient ...
simple_async.py
import threading import time EMIT_NOTIFICATIONS = False def ct(): return time.strftime('%H:%M:%S') class AsyncExec: def __init__(self, f, args=(), kwargs={}, name='unnamed'): assert callable(f) self._name = name self._function = f self._args = args self._kwargs = kw...
kb_DRAMServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
example.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import sys if not ('packages.zip' in sys.path): sys.path.insert(0, 'packages.zip') import flask from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps im...
mutil_processing_image_generator_balance.py
"""Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new preprocessing methods, etc... """ from __future__ import absolute_import from __future__ import print_function import numpy as np import re from scipy import linalg import sc...
reflectionhandler.py
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
runCtaTrading.py
# encoding: UTF-8 import multiprocessing from time import sleep from datetime import datetime, time from vnpy.event import EventEngine2 from vnpy.trader.vtEvent import EVENT_LOG, EVENT_ERROR from vnpy.trader.vtEngine import MainEngine, LogEngine from vnpy.trader.gateway import futuGateway from vnpy.trader.app import ...
tensor.py
import os.path from collections import OrderedDict from contextlib import contextmanager from typing import Dict, List, Tuple import subprocess import time import numpy as np import logging logger = logging.getLogger(__name__) from torch import Tensor from torch.cuda.amp import GradScaler, autocast from torch.multipro...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.test_support import sys, os, cStringIO import struct import operator class SysModuleTest(unittest.TestCase): def tearDown(self): test.test_support.reap_children() def test_original_displayhook(self): import __builtin__ sa...
jupyter_kernel.py
# Originally based on simple_kernel.py # by Doug Blank <doug.blank@gmail.com> # # To adjust debug output, set debug_level to: # 0 - show no debugging information # 1 - shows basic running information # 2 - also shows loop details # 3 - also shows message details # from __future__ import print_function ## General P...
app.py
# coding: utf-8 from datetime import datetime, timedelta import json from flask import Flask from flask import render_template, request, session, redirect, url_for, flash from flask_sockets import Sockets from flask_mongoengine.pagination import Pagination from flask_bootstrap import Bootstrap from flask_...
pythread3.py
#/usr/bin/env python # -*- coding: utf-8 -*- from threading import Thread import subprocess from Queue import * # Queue num_threads = 3 queue = Queue() ips = ["10.0.0.1", "10.0.0.51"] def pinger(i, q): """ping subnet""" while True: ip = q.get() print "Thread %s: Pingping %s" % (i, ip) ret = subprocess.ca...
server.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Author : LimerBoy # github.com/LimerBoy/NukeShell # Import modules from sys import exit from time import sleep from colorama import Fore from threading import Thread from Core.clients import Client, ClientsManager from socket import socket, \ AF_INET, SOCK_STREAM, SO_R...
client.py
import threading from enum import Enum from typing import Union, List, TYPE_CHECKING from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, InputMediaPhoto from telegram.ext import Updater, CallbackQueryHandler, CallbackContext if TYPE_CHECKING: from harbor.db.models import DbApartment, DbApartm...
dashboard.py
try: import bokeh.command.bootstrap import bokeh.document # NOQA import bokeh.layouts import bokeh.models import bokeh.models.widgets import bokeh.plotting import bokeh.themes import tornado.gen _available = True except ImportError as e: _available = False _import_error = e ...
server.py
import socket from threading import Thread import threading def get_user(): while True: conn, addr = sock.accept() conns.append({"conn": conn, "socket": addr}) print("connected:", addr) threading.Thread(target=receive, args=[conn]).start() def receive(conn): while True: ...
common.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python from datetime import timedelta import json import yaml import logging import os import subprocess import re import stat import subprocess import urllib.parse import threading import contextlib import tempfile import psutil from functools import reduce,...
dashboard.py
try: import bokeh.command.bootstrap import bokeh.document # NOQA import bokeh.layouts import bokeh.models import bokeh.models.widgets import bokeh.plotting import bokeh.themes import tornado.gen _available = True except ImportError as e: _available = False _import_error = e ...
exceptionTest.py
#!/usr/bin/env python from pcaspy import Driver, SimpleServer import time prefix = 'MTEST:' pvdb = { 'RAND' : { 'prec' : 3, 'count': 3, }, } import threading import numpy class myDriver(Driver): def __init__(self): super(myDriver, self).__init__() self.value = numpy.arra...
sample_graph.py
import asyncio import logging import multiprocessing from datetime import datetime from matplotlib import pyplot from matplotlib.animation import FuncAnimation import lelof1py as f1client from sample_gui import * class GraphContext: graph_x_count = 0 graph_x = [] graph_y = [] figure = None line = None anima...
test_auto_scheduler_measure.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...
utils.py
import asyncio import functools import html import importlib import inspect import json import logging import multiprocessing import os import pkgutil import re import shutil import socket import sys import tempfile import threading import warnings import weakref import xml.etree.ElementTree from asyncio import Timeout...
emulated_chiller_heatpump.py
from pyfmi import load_fmu import yaml import numpy as np import asyncio from flask import Flask, jsonify import threading from flexlab.db_layer import db_interface import datetime import pytz import pandas as pd class Emulated_Chiller_Heatpump: def __init__(self, config_file='flexlab/models/chiller_heatpump_fmu...
main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import threading import os import time from timeit import default_timer as timer # pip install opencv-python import cv2 import numpy as np import pyautogui import keyboard from common import get_logger, get_current_datetime_str, find_rect_con...
live.py
#standard libraries import time from datetime import datetime import csv import os import json from concurrent import futures import threading import multiprocessing import math #external libraries import numpy as np import pandas as pd from discord import Webhook, RequestsWebhookAdapter from binance.client import Cli...
stable_topology_fts.py
# coding=utf-8 import copy import json import random from threading import Thread import Geohash from membase.helper.cluster_helper import ClusterOperationHelper from remote.remote_util import RemoteMachineShellConnection from TestInput import TestInputSingleton from fts_base import FTSBaseTest from lib.membase.api....
webcamvideostream.py
# import the necessary packages from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=0, name="WebcamVideoStream", resolution=(320, 240)): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) self.stream.set(3, in...
post_processing_gw.py
#------------------------------------------------------------ # Copyright 2017 Congduc Pham, University of Pau, France. # # Congduc.Pham@univ-pau.fr # # This file is part of the low-cost LoRa gateway developped at University of Pau # # This program is free software: you can redistribute it and/or modify # it under th...
simulation.py
''' Created on Oct 12, 2016 @author: mwittie ''' import network import link import threading from time import sleep ##configuration parameters router_queue_size = 0 #0 means unlimited simulation_time = 1 #give the network sufficient time to transfer all packets before quitting if __name__ == '__main__': object_L...
ami.py
import logging import time from importlib import import_module from threading import Thread import numpy as np from ophyd.device import Device, Component as Cpt, Staged from ophyd.signal import Signal from ophyd.status import Status from ophyd.utils.errors import ReadOnlyError from toolz.itertoolz import partition fr...
tests.py
''' Simplistic test of pooling code Created on Mar 28, 2013 @author: greg ''' import random import threading n_threads = 6 n_fast_tests = 1000 n_slow_tests = 10 def test_slow_connection(execs_remaining): print '%s: Test slow %s' % (threading.current_thread().name, n_slow_tests - execs_remaining) signa...
using_threading_module.py
import time import threading #create function for thread def Tfunc(i): print("Thread no.:%d" % (i+1)) time.sleep(5) print("%d finished sleeping from thread\n" % i) #start the thread for function for i in range(3): t1 = threading.Thread(target=Tfunc, args=(i,)) t1.start() #check thread is alive or not c=t1....
manager.py
#!/usr/bin/env python3 import datetime import os import signal import subprocess import sys import traceback from multiprocessing import Process import cereal.messaging as messaging import selfdrive.crash as crash from common.basedir import BASEDIR from common.params import Params, ParamKeyType from common.text_window...
CommandIssue.py
import Queue import threading class DummyBus: def __init__(self): self.CMDqueue = Queue.Queue(1) # arbitrary commnad queue self.CMDdaemon = threading.Thread(target=self._issueRoutine, name='Command Issue Routine') self.CMDdaemon.setDaemon(True) self.CMDdaemon.start() sel...
gui_start.py
import kivy from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.button import Button from kivy.uix.spinner import Spinner from kivy.uix.sli...
git_common.py
# Copyright 2014 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. # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. # Derived from https://gist.github.com/aljungberg/626518 import multiprocessing.pool ...
console.py
import subprocess import queue import threading import tkinter as tk from tkinter.font import Font from tkinter.scrolledtext import ScrolledText from tkinter import N, S, E, W from config import CommandsConfig config = CommandsConfig() class Console: def __init__(self, frame): self.frame = frame s...
drEngine.py
# encoding: UTF-8 ''' 本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。 使用DR_setting.json来配置需要收集的合约,以及主力合约代码。 ''' import json import csv import os import copy import traceback from collections import OrderedDict from datetime import datetime, timedelta from Queue import Queue, Empty from threading import Thread from pymongo.er...
startProgram.py
""" Starting point for running the program. """ from multiprocessing import Process from MainWindow import start_main_win from Utilities.IO.IOHelper import create_config_file,create_configt_file if __name__ == '__main__': create_config_file() create_configt_file() p = Process(target=start_main_win) ...
wrappers.py
# Copyright 2019 The Dreamer 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 applicabl...
layer-7.py
# Udah Recode aja Intinya Credit import socket import os, sys import time import threading, random print(""" [ - ]====================[ - ] [ ! ] Layer-7 [HTTP-Flooder] [ ! ] Coded By NumeX [ ! ] Made with Love -/ [ - ]====================[ - ] \n""") ip = input("[ ? ] Enter IP Target : ") ip = socket.gethostbyname(i...