source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
from kivy.uix.widget import Widget from kivy.uix.boxlayout import BoxLayout from kivy.properties import ( ObjectProperty, StringProperty ) from kivy.config import Config Config.set('graphics', 'width', '800') Config.set('graphics', 'height', '600') Config.set('input', 'mouse', 'mouse,disable_multitouch') from kivy....
MultiThreadMaskRCNN.py
import numpy as np import cv2, sys, queue, threading from samples import coco from mrcnn import utils from mrcnn import model as modellib import os ROOT_DIR = os.getcwd() MODEL_DIR = os.path.join(ROOT_DIR, "logs") COCO_MODEL_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5") if not os.path.exists(COCO_MODEL_PATH): ...
gdal2tiles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: gdal2tiles.py ac171f5b0fe544a6c1ff7400249f6ce362e9ace0 2018-04-16 06:32:36 +1000 Ben Elliston $ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: ...
debug.py
import os import sys import threading import time import traceback from debug_toolbar.panels import DebugPanel from django.template.loader import render_to_string from redis_models import CanvasRedis from canvas import util class RedisPanel(DebugPanel): name = 'Redis' has_content = True def __init__(sel...
app.py
import json import logging import multiprocessing as mp import os import signal import sys import threading from logging.handlers import QueueHandler from typing import Dict, List import traceback import yaml from peewee_migrate import Router from playhouse.sqlite_ext import SqliteExtDatabase from playhouse.sqliteq im...
e2e_throughput.py
#!/usr/bin/python3 from bigdl.serving.client import InputQueue, OutputQueue from bigdl.common.encryption_utils import encrypt_with_AES_GCM import os import cv2 import json import time from optparse import OptionParser import base64 from multiprocessing import Process import redis import yaml import argparse from numpy ...
server.py
#!/usr/bin/env python import zmq import time import dill import logging import threading import numpy as np import ami.comm from ami import LogConfig from ami.export.nt import NTBytes, NTObject, NTGraph, NTStore from p4p.nt import NTScalar, NTNDArray from p4p.server import Server, StaticProvider from p4p.server.thread ...
mockradio.py
#!/usr/bin/python #Temporary mock radio test layer import socket import serial import SocketServer import threading import Queue import binascii import struct msgQueue = Queue.Queue() class ConnectHandler(SocketServer.BaseRequestHandler): def handle(self): try: self.request.settimeout(30) se...
__init__.py
# -*- coding: UTF-8 -*- #virtualBuffers/__init__.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2007-2017 NV Access Limited, Peter Vágner import time import threading import ctypes import collections import i...
__init__.py
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
status_test.py
# -*- coding: utf-8 -*- # @Time : 2021/1/1 下午4:50 # @Author : JakeShihao Luo # @Email : jakeshihaoluo@gmail.com # @File : 0.py # @Software: PyCharm from scanner import * from tello_node import * import multiprocessing import numpy as np import copy import re def scheduler(tello_node, permission_flag): p...
nxs_redis_queue.py
import time import pickle import numpy as np from threading import Thread from typing import Any, List, Dict from nxs_libs.queue import NxsQueuePuller, NxsQueuePusher from nxs_utils.nxs_helper import init_redis_client from nxs_utils.logging import write_log, NxsLogLevel class NxsRedisQueuePuller(NxsQueuePuller): ...
federated_learning_keras_consensus_FL_threads_MNIST_gradients_exchange.py
from DataSets import MnistData from DataSets_task import MnistData_task from consensus.consensus_v4 import CFA_process from consensus.parameter_server_v2 import Parameter_Server # use only for consensus , PS only for energy efficiency # from ReplayMemory import ReplayMemory import numpy as np import os import tensorflo...
threads.py
import threading import time from django_formset_vuejs.models import Book def start_cleanup_job(): def cleanup_db(): while True: time.sleep(60*60) print('hello') Book.objects.all().delete() thread1 = threading.Thread(target=cleanup_db) thread1.start()
processkb.py
import logging; logger = logging.getLogger('mylog'); import time from multiprocessing import Process import socket from reasoner import reasoner_start, reasoner_stop from thought import thought_start, thought_stop #import reasoner #import thought import kb #import conflictFinder DEFAULT_MODEL = 'K_myself' THRESHO...
client.py
import http.client import json import logging import threading import wrapt from urllib.parse import quote_plus from SeleniumProxy.logger import get_logger, argstr, kwargstr from SeleniumProxy.proxy.handler import ADMIN_PATH, CaptureRequestHandler, create_custom_capture_request_handler from SeleniumProxy.proxy.server i...
lock_unittest.py
# Copyright 2016 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. import multiprocessing import os import time import unittest import tempfile from py_utils import lock def _AppendTextToFile(file_name): with open(file...
500A.py
# 500A - New Year Transportation # http://codeforces.com/problemset/problem/500/A import sys import threading def dfs(s, g, vis): vis[s] = 1 for x in g[s]: if not vis[x]: dfs(x, g, vis) def main(): n, t = map(int, input().split()) arr = [int(x) for x in input().split()] v...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node from electrum import constants from electr...
mk_gal_mp.py
# coding: utf-8 """ Created on Mon Jun 1 00:15:25 2015 @author: hoseung """ from galaxymodule import galaxy import load import tree import numpy as np import utils.sampling as smp from utils import util #ncore = int(input("How man cores? \n")) #wdir = input("Working directory \n") wdir = '/home/hoseung/Work/data/A...
mpiexec-mesos.py
#!/usr/bin/env python import mesos.interface import mesos.native from mesos.interface import mesos_pb2 import os import sys import time import re import threading from optparse import OptionParser from subprocess import * def mpiexec(): print "We've launched all our MPDs; waiting for them to come up" while cou...
descriptor2rdf.py
import sys, os, threading, Queue import numpy as np ''' This scripts converts the numpy vectors of the descriptors into RDF files according to the IMGpedia ontology ''' if len(sys.argv) != 3: print "usage: python descriptor2rfd.py descriptor_path output_path" exit(-1) descriptor_path = sys.argv[1] output_path = ...
thread_func.py
# @Time : 2020/12/25 # @Author : Naunter # @Page : https://github.com/Naunters # @Page : https://github.com/BDO-CnHope/bdocn_client from threading import Thread def thread_it(func, *args): t = Thread(target=func, args=args) t.setDaemon(True) t.start() #t.join()
line.py
import threading class new_line(threading.Thread): def __init__(self, ID = 8080,name = 'new_line', counter = 101010): threading.Thread.__init__(self) self.threadID = ID self.name = name self.counter = counter def run(self): self.code() def end(self): self.john...
rq_worker.py
from qpanel.job import start_process from multiprocessing import Process from rq_scheduler.scripts.rqscheduler import main def start_jobs(): p = Process(target=start_process) p.start() start_scheduler() def start_scheduler(): p = Process(target=main) p.start() if __name__ == '__main__': sta...
ParallelDownload.py
import threading, wget class ParallelDownloader: def __init__(self): pass def dUrl(self,url,i): try: wget.download(url) except: print("Error with : "+url) def logic1(self): urls = ["https://images.s3.amazonaws.com/PdfLabelFiles/flipkartShippingLabel_OD107312205540085000-1731220554008500.pdf", "...
stdout_supress.py
# Code Author Github user minrk # Originally from https://github.com/minrk/wurlitzer/blob/master/wurlitzer.py from __future__ import print_function from contextlib import contextmanager import ctypes import errno from fcntl import fcntl, F_GETFL, F_SETFL import io import os try: from queue import Queue except I...
main.py
# Copyright (c) 2019, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: MIT # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT import ipdb if __name__ == "__main__": import torch.multiprocessing as mp # https://github.com/pytorch/pytorch/i...
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...
test_search.py
import threading import time import pytest import random import numpy as np from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks prefix = "search_collection" s...
clang_format.py
#!/usr/bin/env python """ A script that provides: 1. Ability to grab binaries where possible from LLVM. 2. Ability to download binaries from MongoDB cache for clang-format. 3. Validates clang-format is the right version. 4. Has support for checking which files are to be checked. 5. Supports validating and updating a se...
session.py
"""API for communicating with twitch""" from __future__ import absolute_import import functools import logging import os import threading import m3u8 import oauthlib.oauth2 import requests import requests.utils import requests_oauthlib from pytwitcherapi.chat import client from . import constants, exceptions, model...
__init__.py
############################################################################ # # Copyright (c) Mamba Developers. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ############################################################################ """ Compon...
spot_finder_backend.py
""" Reference: Python Multiprocessing with ZeroMQ http://taotetek.net/2011/02/02/python-multiprocessing-with-zeromq/ """ import iotbx.phil import libtbx.phil import os import stat import time import datetime import getpass import zmq import re import Queue import collections #import sqlite3 import pysqlite2.dbapi2...
app.py
import os import multiprocessing from datetime import datetime from bot import Bot from db import DB def startBot(username, password, copy): b = Bot(username, password, copy) b.run() if __name__ == "__main__": db = None jobs = [] while True: print("\nSelect an Option:\n" ...
dx_operations_vdb_orig.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 Usage: ...
destination.py
#!/usr/bin/env python import socket # for python Socket API import time # used to generate timestamps import struct # used in decoding messages from threading import Thread # used for multithreaded structure # Destination node if __name__ == "__main__": # host1 = listen address for destination from r1 host1 = (...
test_basic.py
import gc import re import sys import time import uuid import weakref from datetime import datetime from platform import python_implementation from threading import Thread import pytest import werkzeug.serving from werkzeug.exceptions import BadRequest from werkzeug.exceptions import Forbidden from werkzeug.exceptions...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developed and maintained by the Spyder Proj...
crawler.py
import random import subprocess from functools import partial import sys import threading from datetime import datetime, timedelta from itertools import chain from os import path from time import sleep from typing import Callable, Iterable, Union from datetimerange import DateTimeRange from loguru import logger from s...
test_scale_square.py
# scale.py import os import threading import unittest from sql30 import db DB_NAME = './square.db' class Config(db.Model): TABLE = 'square' PKEY = 'num' DB_SCHEMA = { 'db_name': DB_NAME, 'tables': [ { 'name': TABLE, 'col_order': ['num', 'square...
datacollector.py
from multiprocessing import Process, Queue def get_dates(queue, start_date='2010/07/17', end_date='2023/01/07'): from bs4 import BeautifulSoup #module for web scraping install by pip install beautifulsoup4 import requests #for requesting html. install by pip install requests from requests.adapters import HTTPAdapter...
launcher.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI 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 ...
Spec.py
import glob import os import sys from collections import defaultdict from functools import partial as curry from . import ( biblio, boilerplate, caniuse, conditional, config, constants, datablocks, dfns, extensions, fingerprinting, h, headings, highlight, idl, ...
FactorUpdateManager.py
from Core.DAO.TickDataDao import TickDataDao from Core.DAO.FactorDao.FactorDao import FactorDao from Core.Conf.TickDataConf import TickDataConf from Core.WorkerNode.WorkerNodeImpl.WorkerTaskManager import TaskGroup, TaskConst, Task from Core.Error.Error import Error from Core.Conf.PathConf import Path from Core.WorkerN...
2dVisualizer.py
""" Created on 2/11/20 Marquette Robotics Club Danny Hudetz Purpose: read from the hdf5 format and visualize the coordinates mapped nearest to user input in 2 dimensions """ import numpy as math import pygame import threading import vis # Define some colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREEN = (...
setup.py
#!/usr/bin/env python import os import re import sys from setuptools import setup from setuptools import find_packages from setuptools.command.test import test as TestCommand v = open(os.path.join(os.path.dirname(__file__), 'spyne', '__init__.py'), 'r') VERSION = re.match(r".*__version__ = '(.*?)'", v.read(), re.S)...
flask_server.py
from utils import log import config import cv2 import numpy as np from flask import Flask, request from flask import render_template from flask_cors import CORS import os import json import time import threading import sys print('path: ',os.path.dirname(os.path.abspath(__file__))) # 获取资源路径 def resource_path(relative_...
test_win_runas.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import inspect import io import logging import os import socket import subprocess # Service manager imports import sys import textwrap import threading import time import traceback import salt.ext.six import salt.utils.files import salt...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
adapters.py
import cvra_bootloader.can import socket import struct import serial from queue import Queue import threading class SocketCANConnection: # See <linux/can.h> for format CAN_FRAME_FMT = "=IB3x8s" CAN_FRAME_SIZE = struct.calcsize(CAN_FRAME_FMT) def __init__(self, interface, read_timeout=1): """ ...
email.py
from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_app._get_current_object() msg = Mess...
predict_datapoint.py
import glob import multiprocessing import os import subprocess import argparse import h5py import tensorflow as tf import numpy as np from src.TreeModel import TreeModel from src.SettingsReader import SettingsReader def convert_to_uint16(input, threshold=0.1): if input.dtype != np.uint16: max_value = fl...
material_unload_server.py
#! /usr/bin/env python """ Copyright 2013 Southwest Research Institute 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 req...
keyboard_reader.py
from pynput.keyboard import Listener, Controller, Key import time import threading class ComboListener: def __init__(self): self.cur_keys = [] self.keymap = { 'aaa': 'aster', 'bbb': 'good boy' } self._run() def _on_press(self, key): try: ...
settingswindow_qt.py
import numbers import os import sys import threading from xmlrpc.server import SimpleXMLRPCServer # pylint: disable=no-name-in-module try: # Style C -- may be imported into Caster, or externally BASE_PATH = os.path.realpath(__file__).rsplit(os.path.sep + "castervoice", 1)[0] if BASE_PATH not in sys.path: ...
meteorDL-pi.py
# by Milan Kalina # based on Tensorflow API v2 Object Detection code # https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md from os import path, system, mkdir, makedirs import cv2 import time import os import argparse import numpy as np from datetime import datetime from threading im...
test.py
# -*- coding: utf-8 -*- import redis import unittest from hotels import hotels import random import time from RLTest import Env from includes import * from common import getConnectionByEnv, waitForIndex, toSortedFlatList # this tests is not longer relevant # def testAdd(env): # if env.is_cluster(): # rais...
test_thread_safe_fixtures.py
import asyncio import threading import pytest @pytest.fixture(scope="package") def event_loop(): loop = asyncio.get_event_loop_policy().new_event_loop() is_ready = threading.Event() def run_forever(): is_ready.set() loop.run_forever() thread = threading.Thread(target=lambda: run_for...
run.py
#!/usr/bin/env python """ Created on Mon Aug 29 2016 Modified from the similar program by Nick @author: Adrian Utama Modified from authors above to have python work seamlessly in Windows and Linux. @author: Chin Chean Lim Optical Powermeter (tkinter) Version 1.03 (last modified on Aug 29 2019) v1.01: There was a bug...
setupModels.py
def setupModels(sys,os,utils,config,random,mproc,modelList): processes = [] from FMModel import FMModel from SVDModel import SVDModel for trial in range(0,config.TRIALS): strTrial = str(trial) print("Setting up trial " + strTrial) p = mproc.Process(target=setupTrial, ...
PureSDN22.py
# Copyright (C) 2016 Huang MaChi at Chongqing University # of Posts and Telecommunications, Chongqing, China. # Copyright (C) 2016 Li Cheng at Beijing University of Posts # and Telecommunications. www.muzixing.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
counter.py
#counter.py ##############NETWORK CONFIG############### import csv import os allfile = os.listdir() def Save(data): with open('config_counter.csv','w',newline='') as file: #fw = 'file writer' fw = csv.writer(file) fw.writerows(data) print('Save Done!') def Read(): if 'config_counter.csv' n...
views.py
from django.http.response import HttpResponseNotFound from joplin_vieweb.edit_session import EditSession from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.conf import settings from .joplin import Joplin, ReprJsonEncoder import ...
resnet32_network.py
""" #Trains a ResNet on the CIFAR10 dataset. ResNet v1: [Deep Residual Learning for Image Recognition ](https://arxiv.org/pdf/1512.03385.pdf) ResNet v2: [Identity Mappings in Deep Residual Networks ](https://arxiv.org/pdf/1603.05027.pdf) Model|n|200-epoch accuracy|Original paper accuracy |sec/epoch GTX1080Ti :-----...
gps_stability_test.py
#!/usr/bin/env python3 # flake8: noqa import os import sys import time import random import threading sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) from panda import Panda, PandaSerial # noqa: E402 INIT_GPS_BAUD = 9600 GPS_BAUD = 460800 def connect(): pandas = Panda.list() pr...
lenovo_fix.py
#!/usr/bin/env python3 from __future__ import print_function import argparse import configparser import dbus import glob import gzip import os import re import struct import subprocess import sys from collections import defaultdict from dbus.mainloop.glib import DBusGMainLoop from errno import EACCES, EPERM from gi.r...
client.py
from cmd import Cmd from os import path from random import choice from string import ascii_lowercase from project8.server import Node, UNHANDLED from threading import Thread from time import sleep from xmlrpc.client import ServerProxy, Fault import sys HEAD_START = 0.1 # Seconds SECRET_LENGTH = 100 def randomString...
simple-tcp-server.py
import socket import threading bind_ip = "0.0.0.0" bind_port = 9999 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip,bind_port)) server.listen(5) print("[*] Listening on %s:%d" % (bind_ip,bind_port)) # this is our client-handling thread def handle_client(client_socket): # print ...
test_worker.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import os import shutil from datetime import timedelta from time import sleep import signal import time from multiprocessing import Process import subprocess import sys from unittest imp...
utils_test.py
from __future__ import annotations import asyncio import concurrent.futures import contextlib import copy import functools import gc import inspect import io import logging import logging.config import multiprocessing import os import re import signal import socket import subprocess import sys import tempfile import t...
save_tiles_tfr_multiprocessing.py
#!/usr/bin/env python import multiprocessing from subprocess import call import csv try: import mapnik2 as mapnik except: import mapnik import sys, os, random as rd import tensorflow as tf, cv2 # Define some parameters layers = ['complete','amenity', 'barriers','bridge','buildings','landcover','landuse','nat...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
wtimegui3.py
#!/usr/bin/env python3 # # wtimegui - Working time class with GUI # import sys import time try: from Tkinter import * import ttk import tkMessageBox from threading import * except ImportError: from tkinter import * from tkinter import ttk from threading import * from tkinter import messa...
main.py
# -*- coding: utf-8 -*- """ Created on Wed May 6 03:38:43 2020 @author: hp """ import cv2 import dlib import numpy as np import threading from yolo_helper import YoloV3, load_darknet_weights, draw_outputs from dlib_helper import (shape_to_np, eye_on_mask, contouri...
servers.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import os import subprocess import sys import threading import time import debugp...
record.py
import logging as log import os import errno from threading import Thread try: from urllib import urlopen from urlparse import urlparse import unicodecsv as csv except ImportError: from urllib.request import urlopen from urllib.parse import urlparse import csv class FolderCreationError(Excep...
oxcart.py
""" This is the main script for doing experiment. It contains the main control loop of experiment. @author: Mehrpad Monajem <mehrpad.monajem@fau.de> TODO: Replace print statements with Log statements """ import time import datetime import h5py import multiprocessing from multiprocessing.queues import Queue import thr...
solver_wrapper.py
import logging import multiprocessing import os import subprocess from pysat.solvers import Solver from dfainductor.logging_utils import log_info class SolverWrapper: def __init__(self, name): logger_format = '%(asctime)s:%(threadName)s:%(message)s' logging.basicConfig(format=logger_format, leve...
Wallet.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Tkinter GUI Wallet (v2.52) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2019-2021 ########################################## import os import sys from base64 import b64decode, b6...
DialogPackageManager.py
''' Created on Oct 6, 2013 (from DialogPluginManager.py) @author: Mark V Systems Limited (c) Copyright 2013 Mark V Systems Limited, All rights reserved. ''' from tkinter import simpledialog, Toplevel, font, messagebox, VERTICAL, HORIZONTAL, N, S, E, W from tkinter.constants import DISABLED, ACTIVE try: from tkinte...
livereload_tests.py
#!/usr/bin/env python import contextlib import email import io import os import sys import threading import time import unittest from pathlib import Path from unittest import mock from mkdocs.livereload import LiveReloadServer from mkdocs.tests.base import tempdir class FakeRequest: def __init__(self, content):...
app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import six import threading import json from PIL import Image from BaseHTTPServer import HTTPServer import SocketServer as socketserver from CGIHTTPServer import CGIHTTPRequestHandler from Queue import Queue sys.path.append('./cgi-bin') # Switch LED...
dothread.py
import time, threading def loop(): print('thread %s is running...' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('thread %s >>> %s' % (threading.current_thread().name, n)) time.sleep(1) print('thread %s ended' % threading.current_thread().name) ...
bot.py
#!/usr/bin/env python3 """ bot.py - Phenny IRC Bot Copyright 2008, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://inamidst.com/phenny/ """ import importlib import irc import logging import os import re import sys import threading import traceback import tools logger = logging.getLogge...
main.py
#!/bin/env python """ The MIT License Copyright (c) 2010 The Chicago Tribune & Contributors 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 ...
service.py
# Author: asciidisco # Module: service # Created on: 13.01.2017 # License: MIT https://goo.gl/5bMj3H import threading import SocketServer import socket import xbmc from xbmc import Monitor from xbmcaddon import Addon from resources.lib.WidevineHTTPRequestHandler import WidevineHTTPRequestHandler import util # helper...
main1.py
# run on your system # new file #test import socket import requests import threading import json import datetime import time import netifaces as ni import random import pymongo import hashlib from blockchain import Blockchain import sys import _thread ip = "http://192.168.43.168:5000" page = "/ul" login_p = '/logi'...
preprocess_tuning.py
from calibration.grid import GridProcessor import os import random import numpy as np import threading import queue import cv2 IMAGE_FOLDER = 'C:\\Users\\smerk\\Downloads\\images' IMAGES = os.listdir(IMAGE_FOLDER) SAMPLES = 8 IMAGES_SAMPLE = random.sample(IMAGES, SAMPLES) IMAGES_FULL = [os.path.join(IMAGE_FOLDER, imag...
threads.py
from threading import Thread from time import sleep def carro(velocidade, piloto): trajeto = 0 while trajeto <= 100: print(f'O piloto {piloto} já percorreu {velocidade}Km') trajeto += velocidade sleep(0.5) carro_1 = Thread(target=carro, args=[1, 'Maki']) carro_2 = Thread(...
test_multi.py
import argparse import cv2 import numpy as np import tensorflow as tf import multiprocessing import os import neuralgym as ng from inpaint_model import InpaintCAModel parser = argparse.ArgumentParser() parser.add_argument('--image_dir', default='', type=str, help='The folder containing images to...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
test_basic.py
from threading import Thread from time import sleep import pytest from busypie import wait, wait_at_most, ConditionTimeoutError, \ FIVE_HUNDRED_MILLISECONDS, MILLISECOND def test_wait_until_condition_passed(): countdown = CountDown() countdown.start_from(3) wait().until(lambda: countdown.done) a...
connection.py
from logging import getLogger from selectors import DefaultSelector, EVENT_READ from socket import socket, SO_REUSEADDR, SOL_SOCKET from struct import calcsize, pack, unpack from threading import Lock, Thread from time import sleep class Connection: """ Provides an interface to a multi-thre...
phone.py
from threading import Event, Thread from Queue import Queue, Empty from serial import Serial from time import sleep import logging import string import shlex def has_nonascii(s): ascii_chars = string.ascii_letters+string.digits+"!@#$%^&*()_+\|{}[]-_=+'\",.<>?:; " return any([char for char in ascii_chars if cha...
__main__.py
from __future__ import annotations import argparse import asyncio import os import signal import sys import threading from typing import Any, Set from .exceptions import ConnectionClosed from .frames import Close from .legacy.client import connect if sys.platform == "win32": def win_enable_vt100() -> None: ...
udp_socket.py
""" GeckoUdpSocket - Gecko UDP socket implementation """ import socket import logging import threading import time _LOGGER = logging.getLogger(__name__) class GeckoUdpProtocolHandler: """ Protocol handlers manage both sides of a specific conversation part with a remote end. The protocol is either i...
run.py
from pyA20.gpio import port from pyA20.gpio import gpio from threading import Thread from datetime import datetime from time import sleep import json import time # config inputPort = port.PA11 reportServerAddress = 'http://chcesiku.pl' statusEndPoint = '/api/status' heartbeatEndPoint = '/api/heartbeat' interval = 10...
__init__.py
from multiprocessing import cpu_count, Process from threading import Thread from time import perf_counter from statistics import mean, variance from sum_seq.python.sum_seq import sum_seq as py_sum_seq from sum_seq.c.sum_seq import sum_seq as c_sum_seq from sum_seq.cython.sum_seq import sum_seq as cy_sum_seq FUNCTION...
views.py
import collections import datetime import re import threading import time from collections import defaultdict from operator import itemgetter import simplejson as json import yaml from django.contrib.auth.decorators import login_required from django.core.exceptions import ValidationError from django.db.models import Q...