source
stringlengths
3
86
python
stringlengths
75
1.04M
job_scheduler.py
import logging from threading import Thread, Lock from schedule import Scheduler, Job, ScheduleError, ScheduleValueError from resticweb.tools.job_build import JobBuilder from resticweb.tools.local_session import LocalSession from resticweb.models.general import Schedule, ScheduleJobMap from wtforms import ValidationErr...
train_ac_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn """ import numpy as np import tensorflow as tf #import tensorflow_probability as tfp i...
tests.py
from __future__ import unicode_literals import threading import warnings from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.fields import Field from django.db.m...
thread.py
from __future__ import annotations import traceback from threading import Thread from time import sleep from typing import Callable from tealprint import TealPrint def start_thread(function: Callable, seconds_between_calls: float = 1, delay: float = 0) -> None: """Start a function in another thread as a daemon"...
loader.py
""" The Salt loader is the core to Salt's plugin system, the loader scans directories for python loadable code and organizes the code into the plugin interfaces used by Salt. """ import contextvars import copy import functools import importlib.machinery # pylint: disable=no-name-in-module,import-error import importli...
base_camera.py
from flask_login import logout_user import time import threading try: from greenlet import getcurrent as get_ident except ImportError: try: from thread import get_ident except ImportError: from _thread import get_ident class CameraEvent(object): """An Event-like class that signals all ...
humming_ws_server.py
import asyncio import unittest.mock from threading import Thread import websockets from test.integration.humming_web_app import get_open_port import json from urllib.parse import urlparse class HummingWsServerFactory: _orig_ws_connect = websockets.connect _ws_servers = {} host = "127.0.0.1" # url_host...
t04.py
import threading import time def loop(): print(f"thread {threading.currentThread().name} is running...") n = 0 while n < 5: n = n + 1 print(f"thread {threading.currentThread().name} >>> {n}") time.sleep(1) print(f"thread {threading.currentThread().name} ended") print(f"thread...
main.py
from sys import stdout from requests import post from os import system, _exit, path from random import choice, randint from colors import green, red, reset from time import time, sleep, strftime, gmtime from threading import Thread, Lock, active_count from string import ascii_letters, ascii_lowercase, digits system('c...
broadcaster.py
import socket import struct from time import time, sleep from threading import Thread from dbus import DBusException DEFAULT_PORT = 1666 DEFAULT_HOST = '224.0.0.160' DEFAULT_INTERVAL = 1.0 # seconds class Broadcaster: def __init__(self, omxplayer, verbose=False, interval=DEFAULT_INTERVAL, host=DEFAULT_HOST, port=...
pull_subscriber.py
# -*- coding: utf-8 -*- from __future__ import ( absolute_import, division, print_function, unicode_literals ) import threading import signal import time from pubsub_controller.settings import ( GCP_PROJECT_ID, POLLING_TIME, SUBSCRIPTION_ID, ) from pubsub_controller.utils.log import log, e...
cryptbox.py
import os import sys import getpass import pyinotify import time import argparse import enum import threading import subprocess import encrypt if getpass.getuser() == "pi": import RPi.GPIO as GPIO class EventHandler(pyinotify.ProcessEvent): def __init__(self, public_key, led_manager): self.public_key ...
main.py
import settings import telebot import time import threading import logging from compragamer import compragamer logging.basicConfig(level=logging.INFO) bot = telebot.TeleBot(settings.TOKEN) chatids = [] @bot.message_handler(commands=['start', 'help']) def start_help_handler(message): logging.debug(msg="start rec...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.testing import assert_raises from sqlalchemy....
test_api.py
""" mbed SDK Copyright (c) 2011-2014 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...
pixels.py
import apa102 import time import threading from gpiozero import LED try: import queue as Queue except ImportError: import Queue as Queue from alexa_led_pattern import AlexaLedPattern from google_home_led_pattern import GoogleHomeLedPattern class Pixels: PIXELS_N = 12 def __init__(self, pattern=Alexa...
api.py
"""Defines the Python API for interacting with the StreamDeck Configuration UI""" import itertools import json import os import threading import time from functools import partial from io import BytesIO from typing import Dict, Tuple, Union, cast from warnings import warn import cairosvg from fractions import Fraction...
__init__.py
from __future__ import print_function import argparse import itertools import os import random import re import shlex import string import sys import traceback import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline from threading import Thread import pl...
watson.py
#! /usr/bin/env python3 """ Sherlock: Find Usernames Across Social Networks Module This module contains helper methods for Sherlock. """ # ==================== Imports ==================== # import requests import itertools import threading import time import sys from colorama import Fore, Style from requests_future...
consumers.py
import json import sys import time from multiprocessing import Process from channels.generic.websocket import WebsocketConsumer sys.path.append("..") from Work import Work class MyConsumer(WebsocketConsumer): def connect(self): self.accept() self.uid = self.scope['url_route']['kwargs']['uid'] ...
main.py
import logging import logzero import reverse_geocoder as rg from logzero import logger from sense_hat import SenseHat import datetime import os from time import sleep import threading import ephem import pprint import math import io class Astro_Pi(): """Class for every function used in experiment (a way to order t...
lambda_executors.py
import base64 import contextlib import glob import json import logging import os import re import subprocess import sys import threading import time import traceback import uuid from multiprocessing import Process, Queue from typing import Any, Callable, Dict, List, Optional, Tuple, Union from localstack import config...
main.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
chat_Server.py
import socket from threading import Thread import sys sock = socket.socket() sock.bind(("localhost", 24003)) sock.listen(10) arr = [] def recieve(): while True: for connection in arr: try: data = connection.recv(1024) if data: print(connectio...
web_application.py
from flask import Flask, render_template, request, url_for, redirect from flask_bootstrap import Bootstrap from forms import Enter_Order, Replace_Order, Cancel_Order, Submit_Order import threading import time import json from src.client import Client app = Flask(__name__) app.secret_key = "adkljrhLKJFHELJKFh" bootstra...
experiment_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 appl...
sockets.py
"""Deals with the socket communication between the PIMD and driver code. Copyright (C) 2013, Joshua More and Michele Ceriotti This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the ...
umb_producer.py
#!/usr/bin/env python2 import base64 import json import logging import ssl import subprocess import sys import threading import click import requests from rhmsg.activemq.producer import AMQProducer from rhmsg.activemq.consumer import AMQConsumer # Expose errors during signing for debugging logging.basicConfig(stream...
decorators.py
''' Holds decorators for use in api ''' from threading import Thread def async(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() return wrapper
audio.py
import os import wave from multiprocessing import Process import pyaudio class Audio: def __init__(self, video_path): audio_path = os.path.splitext(video_path)[0] + ".wav" if not os.path.exists(audio_path): os.system("ffmpeg -i " + video_path + " -b:a 128k " + audio_path) self...
callbacks_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...
SerialClient.py
#!/usr/bin/env python ##################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that th...
episode.py
import time import pymysql import multiprocessing from pymysql.cursors import DictCursor from multiprocessing import Process, Pool db1 = pymysql.connect("localhost", "root", "", "bidscore") db2 = pymysql.connect("localhost", "root", "", "miraihyoka") cursor_b = db1.cursor(DictCursor) cursor_m = db2.cursor(DictCursor...
base.py
import hashlib import httplib import os import threading import traceback import socket import urlparse from abc import ABCMeta, abstractmethod from ..testrunner import Stop from protocol import Protocol, BaseProtocolPart here = os.path.split(__file__)[0] # Extra timeout to use after internal test timeout at which t...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
client.py
from __future__ import division, absolute_import import threading import time import sys import posixpath import logging import requests import collections import datetime from itertools import chain from six.moves import queue, range from dwave.cloud.exceptions import * from dwave.cloud.config import load_config, le...
variable_scope_shim_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
freezing.py
"""Benchmark to test runtime and memory performance of different freezing approaches. Test A is done by setting `requires_grad=False` manually while filtering these parameters from the optimizer using ``skorch.helper.filtered_optimizer``. Test B uses the ``Freezer`` via ``ParamMapper`` without explicitly removing the...
TCPclient.py
from socket import * import tkinter as tk import tkinter.scrolledtext as tst import time import tkinter.messagebox import threading #定义输入服务器ip地址的类 class inputIPdialog(tk.Frame): def __init__(self,master): tk.Frame.__init__(self,master) self.ipInput=tk.Text(self,width=30,height=5) self.ipIn...
IMU.py
from threading import Thread import time class IMU: def __init__(self): print("you have created an IMU object") self.angle = 0.0 def startListrening(self, frequency): self.frequency = frequency Thread(target=self.__updateIMU__, args=()).start() def __updateIMU__(self): ...
sync-node.py
# -*- coding: utf-8 -*- import socket import json from pathlib import Path from enum import Enum from time import time from threading import Thread from subprocess import check_output # PATH TO WORK MYPATH = '.' # Constants INTERFACE = socket.AF_INET # interface type TRANSPORT = socket.SOCK_STREAM # transport ty...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper from test.support import warnings_helper import sock...
singlechain.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time import threading import json from collections import defaultdict from chain.const import IP_CONFIG, USERNAME, PASSWD from chain.gethnode import GethNode from chain.iplist import IPList from chain.conf import generate_genesis, generate_leaf_genesis ...
monodemo.py
# coding: utf-8 """Monolithic demo program Demonstration of the workflow and commands PiG uses to geotag an image. """ from collections import deque from threading import Thread from gi.repository import GExiv2 from gps import gps, isotime, WATCH_ENABLE from subprocess32 import Popen, PIPE, check_output last_fix...
safutils.py
# ATTENTION! File managed by Puppet. Changes will be overwritten. from __future__ import print_function import ConfigParser import StringIO import inspect import itertools import os import re import shlex import shutil import subprocess import threading import urllib import saf from saf.exceptions import * from sa...
order_book.py
#!/usr/bin/python # -*- coding: utf-8 -*- # bittrex_websocket/order_book.py # Stanislav Lazarov try: import queue as queue except ImportError: import Queue as queue from copy import deepcopy from threading import Thread from time import sleep, time from requests import get from bittrex_websocket.websocket_...
umich_daily.py
import argparse import sys from multiprocessing import cpu_count, Process, Queue import json import logging from datetime import datetime from elasticsearch import Elasticsearch from elasticsearch.helpers import bulk, scan import hashlib from helpers.certparser import process_cert from helpers.hostparser import procc...
castle.py
from ursina import * from .questionbtn import QuestionBtn, padding from .question import Question from .stone import Stone from .brick import Brick from .floor import Floor from .door import Door from .congrats import Congrats from .initbtn import InitButton from ..config import Z_LIMITS from ..config import X_LIMITS...
executor.py
from concurrent.futures import Future import typeguard import logging import threading import queue import pickle from multiprocessing import Process, Queue from typing import Dict, List, Optional, Tuple, Union import math from ipyparallel.serialize import pack_apply_message # ,unpack_apply_message from ipyparallel.s...
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. from __future__ import absolute_import from __future__ import division from __future__ import print_function import multiprocessing import os import tempfil...
tunnel.py
"""Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections. """ # Copyright (C) 2010-2011 IPython Development Team # Copyright (C) 2011- PyZMQ Developers # # Redistributed from IPython under the terms of the BSD License. from __future__ import print_function import atexit import os i...
db.py
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
test_channel.py
from __future__ import absolute_import import unittest import stackless try: import threading withThreads = True except ImportError: withThreads = False import sys import traceback import contextlib from support import test_main # @UnusedImport from support import StacklessTestCase, require_one_thread @c...
__init__.py
# Copyright 2019 TerraPower, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
data_utils.py
# Lint as python3 # Copyright 2018 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 r...
scripts.py
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import time import signal import logging import functools import threading import traceback import s...
test_utils.py
# Copyright (c) 2010-2012 OpenStack, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
utils.py
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: Provide some useful utils Created: 2016/10/29 """ import uuid import time import unittest from Queue import Queue import threading import multiprocessing from threading import Thread from multiprocessing import Process #---------------------...
cpuinfo.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2014-2018, Matthew Brennan Jones <matthew.brennan.jones@gmail.com> # Py-cpuinfo gets CPU info with pure Python 2 & 3 # It uses the MIT License # It is hosted at: https://github.com/workhorsy/py-cpuinfo # # Permission is hereby granted, free of charge, to an...
runner.py
import threading from publisher import EWalletPublisher from consumer import EWalletConsumer class EWalletRunner(): def __init__(self): self.publisher = EWalletPublisher('172.17.0.3', '1306398983') self.consumer = EWalletConsumer('172.17.0.3', '1306398983', self.publisher) publish_ping_th...
pingermaster.py
#!/usr/bin/env python import redis import yaml import json import time import threading from handlers import Handler class Config: def __init__(self): with open('./checks.yaml') as f: self.config = yaml.load(f) class Master: def __init__(self): self.handlers = Handler.plugins ...
views.py
import datetime import json import math import random import re import requests import logging import time import sys from django.conf import settings from django.db.models import Q from django.http import JsonResponse from drf_yasg.utils import swagger_auto_schema from rest_framework.filters import SearchFilter from r...
bodypix_gl_imx.py
# Copyright 2019 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, ...
guaji-v0.2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #author:dawson from Tkinter import * from tkMessageBox import * import requests import threading import time import json import random import base64 import os from icon import img reload(sys) sys.setdefaultencoding( "utf-8" ) wxkc=[] userlist=[] def btn_sub...
server.py
import socket, threading import firebase_admin from firebase_admin import credentials, auth, db cred = credentials.Certificate("firebase/opensw-team1-firebase-adminsdk-ln99u-734bf11a84.json") default_app = firebase_admin.initialize_app(cred, { 'databaseURL' : 'https://opensw-team1-default-rtdb.asia-southeast1.fire...
client.py
from Gamal import * from cert_utils import * from cryptography.hazmat.primitives.asymmetric import padding, rsa from cryptography.hazmat.primitives import serialization from flask import Flask, redirect, url_for, request import threading import os import base64 app = Flask(__name__) import requests import argparse fro...
miner.py
import time import hashlib import json import requests import base64 from flask import Flask, request from multiprocessing import Process, Pipe import ecdsa from miner_config import MINER_ADDRESS, MINER_NODE_URL, PEER_NODES node = Flask(__name__) class Block: def __init__(self, index, timestamp, data, previous_...
test_collection.py
import numpy import pandas as pd import pytest from pymilvus import DataType 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 from utils.utils import * from...
scraper.py
# Bodleian Booker Bot import time import sched import json import datetime import threading from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.service import Service # Define preference dictionary preference = {"UPPER BOD":["Upper Reading Room Desk Booking","...
picorv32_benchmark.py
#!/usr/bin/env python3 import os, sys, threading from os import path import subprocess import re num_runs = 8 if not path.exists("picorv32.json"): subprocess.run(["wget", "https://raw.githubusercontent.com/cliffordwolf/picorv32/master/picorv32.v"], check=True) subprocess.run(["yosys", "-q", "-p", "synth_ice40...
ch08_listing_source.py
import BaseHTTPServer import cgi import functools import json import math import random import socket import SocketServer import time import threading import unittest import uuid import urlparse import redis def acquire_lock_with_timeout( conn, lockname, acquire_timeout=10, lock_timeout=10): identifier = str...
ntlmrelayx.py
#!/usr/bin/env python # Impacket - Collection of Python classes for working with network protocols. # # SECUREAUTH LABS. Copyright (C) 2022 SecureAuth Corporation. All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # f...
__init__.py
# coding=utf-8 from collections import defaultdict from logging import getLogger import traceback import threading import re from nekbot import settings from nekbot.core.commands.argparse import ArgParse from nekbot.core.commands.doc import Doc from nekbot.core.exceptions import PrintableException from nekbot.utils.de...
multiprocessing.py
from multiprocessing import Queue, JoinableQueue import torch from PIL import Image from torch import multiprocessing from torchvision.transforms import Compose, Resize, ToTensor, ColorJitter torch.set_num_threads(1) T = Compose([Resize((224, 224)), ColorJitter(brightness=[0.8, 1.6]), ToTensor()]) def read_img( ...
deletionwatcher.py
# coding=utf-8 import json import os.path import requests import time import threading # noinspection PyPackageRequirements import websocket # noinspection PyPackageRequirements from bs4 import BeautifulSoup from urllib.parse import urlparse import chatcommunicate import metasmoke from globalvars import GlobalVars impo...
LedHandler.py
import time import LogHandler mylogger = LogHandler.LogHandler("ledhandler") try: import RPi.GPIO as GPIO except RuntimeError: mylogger.logger.error("Error importing RPi.GPIO! This is probably because you need superuser privileges. You can achieve this by using 'sudo' to run your script") import threading cl...
server.py
from socket import socket, AF_INET, SOCK_STREAM, timeout from threading import Thread from helper import * class Server: def __init__(self, address, port): self.sock = socket(AF_INET, SOCK_STREAM) self.sock.bind((address, port)) self.sock.listen() print("server started at " + str(...
app.py
############################################################################# # Copyright (c) 2018, Voilà Contributors # # Copyright (c) 2018, QuantStack # # # # Distri...
vnoanda.py
# encoding: utf-8 import traceback import json import requests from Queue import Queue, Empty from threading import Thread API_SETTING = {} API_SETTING['practice'] = {'rest': 'https://api-fxpractice.oanda.com', 'stream': 'https://stream-fxpractice.oanda.com'} API_SETTING['trade'] = {'rest'...
flask.py
import asyncio import json import logging from asyncio import Queue as AsyncQueue from queue import Queue as ThreadQueue from threading import Event as ThreadEvent from threading import Thread from typing import Any, Callable, Dict, NamedTuple, Optional, Tuple, Type, Union, cast from urllib.parse import parse_qs as par...
py_socket_api.py
# -*- coding: utf-8 -*- """ Class for handling Wifi operations - python 3.6 --------------------------------------- Author: Marcel Burda Date: 17.07.2019 """ import socket # udp services import time # time functions like e.g. sleep import threading # multi-threading and mutex import struct # packing and unpacking...
__init__.py
#!/usr/bin/python3 # @todo logging # @todo extra options for url like , verify=False etc. # @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option? # @todo option for interval day/6 hour/etc # @todo on change detected, config for calling some API # @todo fetch title into json # https://di...
transaction.py
#!/usr/bin/python3 import functools import sys import threading import time from enum import IntEnum from hashlib import sha1 from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import black import requests from eth_abi import decode_abi from hexbytes import HexByte...
base.py
import base64 import hashlib import io import json import os import threading import traceback import socket import sys from abc import ABCMeta, abstractmethod from http.client import HTTPConnection from typing import Any, Callable, ClassVar, Optional, Tuple, Type, TYPE_CHECKING from urllib.parse import urljoin, urlspl...
helpers.py
""" Helper functions file for OCS QE """ import base64 import random import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time import inspect from concurrent.futures import ThreadPoolExecutor from itertools import cycle from subprocess i...
threading_utils_test.py
#!/usr/bin/env vpython3 # Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import functools import signal import sys import threading import time import traceback import unittest # Mutates sys.pat...
main.py
# -*- coding: utf-8 -*- import sys,getopt from ui_server import Ui_server from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from Server import * class MyWindow(QMainWindow,Ui_server): def __init__(self): self.user_ui=True s...
download.py
#!/usr/bin/env python import logging import sys import os import time import datetime import argparse import getpass import json import threading import webbrowser import shutil import subprocess from socket import timeout, error as SocketError from ssl import SSLError from string import Formatter as StringFormatter i...
light_reaper.py
# Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
cloudstore.py
import requests import threading import time import json # initiates a parallel delayed function call def setTimeout(cb, delay, args=None, kwargs=None): t = threading.Timer(delay, cb, args, kwargs) t.start() return t class CloudStore: # static to limit across instances maxRate = 3...
test_logging.py
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
views.py
from threading import Thread import pandas import matplotlib.pyplot as plt import shutil import os import subprocess import time from django.template import loader import signal from django.http import HttpResponse from django.shortcuts import render, redirect import re threads=[] stop=False proc1 = None live_flag=0 ...
djitellopy.py
# # Code from https://github.com/damiafuentes/DJITelloPy. Please install from that original github. This here is only for reference. # # coding=utf-8 import logging import socket import time import threading import cv2 from threading import Thread from .decorators import accepts class Tello: """Python wrapper to...
_a4c_configure.py
from cloudify import ctx from cloudify.exceptions import NonRecoverableError from cloudify.state import ctx_parameters as inputs import subprocess import os import re import sys import time import threading import platform from StringIO import StringIO from cloudify_rest_client import CloudifyClient from cloudify im...
MainProcess.py
""" Created on 2017年10月7日 @author: Colin """ import threading import datetime import os import pandas import matplotlib.pyplot as plt import logging.config import math from colin.chen.shares import Utils from colin.chen.shares import DBUtils from colin.chen.shares import DataAnalysis '''logger配置''...
test_error.py
import time from winmutex import WinMutex, WinMutexAbandonedError from unittest import TestCase from threading import Thread class TestError (TestCase): def test_abandoned_error1 (self): mutex = WinMutex() def example (): mutex.acquire(blocking=True) thread = Thread(target=example) thread...
voiceRecognition.py
""" This is the final code structure for the R2D2 project Cornell Cup Robotics, Spring 2019 File Created by Yanchen Zhan '22 (yz366) """ ########## MAIN FILE STARTS HERE #hello ### import respective package import sys import speech_recognition as sr import pyaudio import nltk nltk.download('vader_lexicon') nltk.down...
stream.py
"""Lazily-evaluated, parallelizable pipeline. Overview ======== Streams are iterables with a pipelining mechanism to enable data-flow programming and easy parallelization. The idea is to take the output of a function that turn an iterable into another iterable and plug that as the input of another such function. Whi...
build_environment.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """ This module contains all routines related to setting up the package build environment. All of this is set up by packa...
server.py
import threading import socket #define host address, port number host = '127.0.0.1' #localhost (can also be the ip of the server if it's running on web server) port = 49800 #random port - not from well-known ports (0-1023) or registered ports (1024-49151) #starting the server server = socket.socket(socket.AF_...