source
stringlengths
3
86
python
stringlengths
75
1.04M
fard_task_container.py
# (c) copyright by Politecnico di Milano # original authors: Samuele Barbieri, Fabiola Casasopra, Rolando Brondolin # # fard_task_container.py # Internal classes to manage tasks during their execution import threading import zmq import time import pickle import signal from queue import Queue, Empty from fard_task impo...
ssh_clients.py
import os import json import time import socket import random import requests import threading import subprocess from .app import * from .ssh_create import * from .ssh_statistic import * from .ssh_stabilizer import * class ssh_clients(object): _connected = set() def __i...
tunnel.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
helpers.py
# -*- coding: utf-8 -*- ''' :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers ''' # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
_process.py
""" ffmpeg_streaming.process ~~~~~~~~~~~~ Run FFmpeg commands and monitor FFmpeg :copyright: (c) 2020 by Amin Yazdanpanah. :website: https://www.aminyazdanpanah.com :email: contact@aminyazdanpanah.com :license: MIT, see LICENSE for more details. """ import shlex import subprocess import threading import logging imp...
search.py
''' Based on idea of googlesearch.py of @anthony https://github.com/anthonyhseb/googlesearch/blob/master/googlesearch My changes: - add Bing search - use requests instead of urllib2 - use boilerpipe to extract content of webpage required package "boilerpipe" git clone https://githu...
test_h5storage.py
#!/usr/bin/env python ############################################################################## ## # This file is part of Sardana ## # http://www.sardana-controls.org/ ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Sardana is free software: you can redistribute it and/or modify # it under th...
__init__.py
# -*- coding: utf-8 -*- """ Create ssh executor system """ # Import python libs from __future__ import absolute_import, print_function, unicode_literals import base64 import binascii import copy import datetime import getpass import hashlib import logging import multiprocessing import os import re import subprocess im...
test_menu.py
import signal import threading import unittest import sys if sys.version_info > (3, 0): from queue import Queue else: from Queue import Queue from django.conf import settings from django.template import Template, Context from django.test import TestCase from django.test.client import RequestFactory from menu...
terminal.py
#!/usr/bin/env python3 from asciimatics.widgets import Frame, TextBox, Layout, Background, Widget from asciimatics.scene import Scene from asciimatics.screen import Screen from asciimatics.exceptions import ResizeScreenError from asciimatics.parsers import AnsiTerminalParser from asciimatics.event import KeyboardEvent...
session_debug_testlib.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...
kickthemout.py
#!/usr/bin/env python3 # -.- coding: utf-8 -.- # kickthemout.py """ Copyright (C) 2017-18 Nikolaos Kamarinakis (nikolaskam@gmail.com) & David Schütz (xdavid@protonmail.com) See License at nikolaskama.me (https://nikolaskama.me/kickthemoutproject) """ import os, sys, logging, math, traceback, optparse, threading from ...
_channel.py
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
myplex.py
# -*- coding: utf-8 -*- import copy import threading import time from xml.etree import ElementTree import requests from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER, log, logfilter, utils) from plexapi.base import PlexObject from plexapi.client impor...
main.py
""" CrowdStrike / Security Hub integration Original version: Dixon Styres Modification: 11.15.20 - jshcodes@CrowdStrike, SQS integration Modification: 07.15.20 - jshcodes@CrowdStrike, MSSP functionality Event Streams -> {Parsed & Confirmed} -> SQS -> Lambda -> {Instance Confirmed} -> Security Hub """ # This is free a...
test_full_system.py
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. im...
stream_chart.py
import zmq import pandas as pd import datetime as dt import numpy as np import bqplot as bplot import ipywidgets import threading import subprocess import signal import os import datetime import time from IPython.display import display from bqplot import (OrdinalScale, DateScale, LinearScale, Bars, Lines, Axis, Figure)...
_channel.py
# Copyright 2016, 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 f...
chogm.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2007 Jared Crapo # # 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 right...
test_runner.py
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) import sublime import sublime_plugin import os import unittest import contextlib import threading from D...
stock_calculator.py
# **************************************************************************** # # # # ::: :::::::: # # stock_calculator.py :+: :+: :+: ...
email.py
# ------------------------------------------------------------------------------ # Copyright (c) 2020. Anas Abu Farraj. # ------------------------------------------------------------------------------ from threading import Thread from flask import current_app, render_template from flask_mail import Message from appli...
server.py
import socket import threading #LocalHost host = '127.0.0.1' #Choosing unreserved port port = 12346 #socket initialization, IPv4 protocol domain, TCP communication type server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #binding host and port(socket address) to socket server.bind((host, port)) ...
bar.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- from multiprocessing import Process import os # 子进程要执行的代码 def run_proc(name): print('Run child process %s (%s)...' % (name, os.getpid())) if __name__=='__main__': print('Parent process %s.' % os.getpid()) p = Process(target = run_proc, args = (...
worker.py
import io import os import sys import time import queue import threading as mt import multiprocessing as mp import radical.utils as ru from .. import Session from .. import utils as rpu from .. import constants as rpc # ---------------------------------------------------------------------------...
test_signal.py
import unittest from test import support from contextlib import closing import enum import gc import pickle import select import signal import socket import struct import subprocess import traceback import sys, os, time, errno from test.script_helper import assert_python_ok, spawn_python try: import threading excep...
simulation.py
#!/usr/bin/python # coding: utf8 import time from threading import Thread from random import random from random import randint class OvenSimulator(object): def __init__(self, start_temp=25.0): self.temp = start_temp self.timer = 0.0 self.heat = False self.fan = False self....
xiami.py
#!/usr/bin/env python #-*- coding:utf-8 _*- """ @author: HJK @file: xiami.py @time: 2019-01-21 从虾米搜索和下载音乐 """ import datetime import threading import glovar from core.common import * from core.exceptions import * from utils.customlog import CustomLog logger = CustomLog(__name__).getLogger() def xiami_search(...
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 collections import OrderedDict import importlib.machinery import importlib.util import os import pickle import random import re import subprocess import sys import t...
GPGAN_fast.py
import argparse import os import cv2 import chainer from chainer import cuda, serializers from skimage import img_as_float from skimage.io import imread, imsave import scipy as sp from gp_gan import gp_gan from model import EncoderDecoder, DCGAN_G basename = lambda path: os.path.splitext(os.path.basename(path))[0] i...
watcher.py
from queue import Queue from threading import Thread from collections import OrderedDict from readerwriterlock import rwlock from teos.logger import get_logger import common.receipts as receipts from common.appointment import AppointmentStatus from common.tools import compute_locator from common.exceptions import Basi...
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
application_runners.py
import sys import os import uuid import shlex import threading import shutil import subprocess import logging import inspect import ctypes import runpy import requests from dash.testing.errors import ( NoAppFoundError, TestingTimeoutError, ServerCloseError, DashAppLoadingError, ) from dash.testing imp...
sageGateBase.py
############################################################################ # # DIM - A Direct Interaction Manager for SAGE # Copyright (C) 2007 Electronic Visualization Laboratory, # University of Illinois at Chicago # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # mo...
cronjobs.py
#!/usr/bin/env python """Cron Job objects that get stored in the relational db.""" import abc import collections import logging import threading import time import traceback from grr_response_core import config from grr_response_core.lib import rdfvalue from grr_response_core.lib import utils from grr_response_core.l...
Handler.py
# Copyright (c) 2012, Jeff Melville # 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 an...
engine.py
"""""" from threading import Thread from queue import Queue, Empty from copy import copy from vnpy.event import Event, EventEngine from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.object import ( SubscribeRequest, TickData, BarData, ContractData ) from vnpy.trader.event import EV...
make_style_dataset.py
import os, json, argparse from threading import Thread from Queue import Queue import numpy as np from scipy.misc import imread, imresize import h5py """ Create an HDF5 file of images for training a feedforward style transfer model. """ parser = argparse.ArgumentParser() parser.add_argument('--train_dir', default='d...
service.py
import asyncio import threading import time import requests from urllib3.exceptions import ReadTimeoutError from ..exceptions import LoopError threadLock = threading.Lock() threads = [] class BackgroundRun(threading.Thread): def __init__(self, threadID, name, counter): threading.Thread.__init__(self) ...
mini_nlp_1.py
from kivy.uix.label import Label from kivy.uix.floatlayout import FloatLayout from kivy.app import App from kivy.uix.scatter import Scatter from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.screenmanager import ScreenManager,Screen from kivy.uix.relativelayout im...
show_choices.py
import numpy as np import time import sys,os import curses import threading data = 'some value' def draw_menu(stdscr): global data # Turn cursor off curses.curs_set(False) # Start colors in curses curses.start_color() # Initialization height, width = stdscr.getmaxyx() # Declaration...
fast-reboot.py
# #ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";fast_reboot_limit=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";default...
redis_aof_common.py
import os import json import time import struct import socket import logging import traceback import threading import SocketServer import uuid from threading import Thread from datetime import timedelta # Function definitions: def GenDateRange(dtStartIP, dtEndIP): '''Generator. Outputs a range of date objects se...
task.py
import atexit import json import os import shutil import signal import sys import threading import time from argparse import ArgumentParser from operator import attrgetter from tempfile import mkstemp, mkdtemp from zipfile import ZipFile, ZIP_DEFLATED try: # noinspection PyCompatibility from collections.abc im...
ob_logger.py
#!/usr/bin/python3.7 import json import os import pymongo import sys import time from bot_utils import get_data, get_pairs, save_to_mongo from multiprocessing import Process MIN_TIME = 30 old_stdout = sys.stdout def mini_logger(symbol, conf, limit, auth_string, db_name): client = pymongo.MongoClient(auth_strin...
a.py
from threading import Thread import socket import logging import argparse import os import common logging.basicConfig(format = '%(asctime)s; %(levelname)s; %(name)s; %(thread)d; %(filename)s:%(lineno)d; %(funcName)s; %(message)s', level = logging.INFO) logger = logging.getLogger(__name__) MAX_CONNECTS_QUEUED = 20 F...
test_path_utils.py
# -*- coding: utf-8 -*- u""" Copyright 2018 Telefónica Investigación y Desarrollo, S.A.U. This file is part of Toolium. 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/lic...
ssh.py
from __future__ import absolute_import from __future__ import division import inspect import logging import os import re import shutil import string import sys import tarfile import tempfile import threading import time import types from pwnlib import term from pwnlib.context import context from pwnlib.log import Log...
download.py
# -*- coding: utf-8 -*- # Vstream https://github.com/Kodi-vStream/venom-xbmc-addons from resources.lib.handler.inputParameterHandler import cInputParameterHandler from resources.lib.handler.outputParameterHandler import cOutputParameterHandler from resources.lib.handler.pluginHandler import cPluginHandler from resource...
shareVar.py
# -*-coding:utf8-*- from threading import Thread from multiprocessing import Process import os def work(): global n n -=1 print(n) n = 100 if __name__ == '__main__': p = Process(target=work) # p = Thread(target=work) p.start() p.join() print '主{}'.format(n)
sublert.py
#!/usr/bin/env python # coding: utf-8 # Announced and released during OWASP Seasides 2019 & NullCon. # Huge shout out to the Indian bug bounty community for their hospitality. import argparse import dns.resolver import sys import requests import json import difflib import os import re import psycopg2 from tld import g...
CloudConnection.py
""" The Cloud Variables File. Go to https://scratch.mit.edu/projects/578255313/ for the Scratch Encode/Decode Engine! """ import json import requests import websocket import time from pyemitter import Emitter from threading import Thread from scratchconnect import Exceptions from scratchconnect.scEncoder i...
myOpenANT_Manager.py
# Copyright (c) 2020, Martin Schmoll <martin.schmoll@meduniwien.ac.at> # # The following software uses a modified version the openSource Project openant # by Gustav Tiger available at https://github.com/Tigge/openant # # The software provides a client to communicate with the Powermeter 2INPOWER from Rotor # https://rot...
dense_slam_gui.py
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2018-2021 www.open3d.org # # Permission i...
Driver.py
#!/usr/bin/env python # Copyright 2017 Battelle Energy Alliance, 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 appl...
nums_xgb.py
import uuid import time import logging from threading import Thread from typing import Dict import numpy as np import xgboost as xgb from nums.core.systems import utils as systems_utils from nums.core.array.blockarray import BlockArray, Block from nums.core.application_manager import instance as _instance from nums.c...
orbslam_stereo_kittim.py
#!/usr/bin/env python3 import sys import os.path import orbslam2 from maskrcnn_benchmark.config import cfg from demo.predictor import COCODemo import fcntl import numpy as np import cv2 as cv import traceback import g2o from threading import Thread import os import shutil from sptam.dynaseg import DynaSeg from sp...
predict_basesarojini.py
import numpy as np import argparse import glob from PIL import Image import json, time, copy import cv2,os, glob import pandas as pd from collections import OrderedDict from torch.autograd import Variable import torch from torchvision import datasets, transforms, utils import torchvision.models as models from torch.ut...
main.py
#!/usr/bin/python import paho.mqtt.client as paho import pyupm_grove as grove import json import uuid import pywapi import signal import sys import time import dweepy from threading import Thread from flask import Flask from flask_restful import Api, Resource DeviceID = 0 Sensor = 0 Actuator = 0 class DataActuatorR...
blockchain.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@ecdsa.org # # 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...
zui.py
import sys import time import threading from PyQt4 import QtCore, QtGui from zui_config import * class MainWindow(QtGui.QMainWindow): """main window""" def __init__(self, parent=None): # init super(MainWindow, self).__init__(parent) self.setWindowTitle(WINDOWS_TITLE) self.res...
node.py
# Roman Soldatov # B19-SD-01 # Chord protocol. Stores Node class which implements the behavior of p2p node of Chord # Available RPC commands: get_finger_table; quit import time import xmlrpc.client import zlib from socket import gaierror from threading import Thread from xmlrpc.server import SimpleXMLRPCServer def ...
test_signal.py
import os import random import signal import socket import statistics import subprocess import sys import threading import time import unittest from test import support from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi except ImportError: _testcapi = None class Generi...
reporter.py
import json try: from collections.abc import Iterable except ImportError: from collections import Iterable import six import numpy as np from threading import Thread, Event from ..base import InterfaceBase from ..setupuploadmixin import SetupUploadMixin from ...utilities.async_manager import AsyncManagerMixi...
collect_logs.py
# Microsoft Azure Linux Agent # # Copyright 2020 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
client.py
#!/usr/bin/python3 import argparse import boto3 import json import os import inotify.adapters from multiprocessing import Process, Queue import time # Search for pdfs # Upload pdf to buckets # Send sqs message for transcoding job # Delete pdf in directory def monitor(path, queue, inputb, outputb, pqueue): i = ...
gui.py
__author__ = "James Clark" __copyright__ = "Copyright 2020, F.R.A.M.E Project" __credits__ = ["James Clark"] __version__ = "1.0" # Import in necessary libraries import signal import tkinter as tk import threading from tkinter import messagebox import cv2 import face_recognition from PIL import Image, ImageTk import d...
no_notebook.py
from .vpython import GlowWidget, baseObj, vector, canvas from ._notebook_helpers import _in_spyder, _undo_vpython_import_in_spyder from http.server import BaseHTTPRequestHandler, HTTPServer import os import platform import sys import threading import json import webbrowser as _webbrowser import asyncio from autobahn.a...
subscriber.py
#!/usr/bin/env python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
main.py
import imgurScraper as IS import Tkinter, Tkconstants, tkFileDialog, tkMessageBox, tkFileDialog, threading, os class Interface: def __init__(self, top): self.downloadThread = None top.resizable(0, 0) frame = Tkinter.Frame(top, borderwidth=3) self.scraper = IS.scraperObject() ...
utils.py
from bitcoin.core import COIN # type: ignore from bitcoin.rpc import RawProxy as BitcoinProxy # type: ignore from bitcoin.rpc import JSONRPCError from contextlib import contextmanager from pathlib import Path from pyln.client import RpcError from pyln.testing.btcproxy import BitcoinRpcProxy from collections import Or...
tag.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,requests,urllib,urllib2,urllib3 from bs4 import BeautifulSoup from urllib import urlopen from gtts import gTTS from googletrans import Translator cl = LINETCR.L...
bluetooth_bridge_server_node.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ## @package docstring # This package provides the bridge between Bluetooth and ROS, both ways. # Initially it receives "String" messages and sends "String" messages # import rospy import math import sys import signal import bluetooth import select import time from std_m...
server.py
import argparse import socket from threading import Thread import websockets import asyncio from beerbot.hardware_backends.chassis_backend import HBridgeMotorizedChassis, DummyChassisBackend from beerbot.hardware_backends.gimbal_backend import SG90ServoGimbalBackend, DummyGimbalBackend from beerbot.common.server_pack...
pipetteServer.py
#!/usr/bin/env python3 import os import csv import sys import pickle import shutil import getpass import datetime import platform import collections import time import cProfile import threading import queue import atexit import optparse import LocalEngine class Jobs: def __init__(self, commdir...
http.py
import socket import requests from lxml.html import fromstring import datetime import sys import ipaddress import threading import os BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[1;94m', '\033[1;91m', '\33[1;97m', '\33[1;93m', '\033[1;35m', '\033[1;32m', '\033[0m' class ThreadManager(object): i = 0 d...
pivideostream.py
''' Raspberry Pi video stream. Originally written by jrosebr1 https://github.com/jrosebr1/imutils/blob/master/imutils/video/pivideostream.py Modified by Philip Linden - Removed OpenCV dependency (opencv is unused in this class) ''' # import the necessary packages from picamera.array import PiRGBArray f...
GenericsIndexerServer.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...
DataCollection.py
''' Created on 21 Feb 2017 @author: jkiesele ''' #from tensorflow.contrib.labeled_tensor import batch #from builtins import list from __future__ import print_function import os from Weighter import Weighter from TrainData import TrainData, fileTimeOut #for convenience import logging from pdb import set_trace import co...
ocd.py
import json import csv import re import queue import time from libs import dbcon from libs import getobd from threading import Thread dbconnection = None def set_connection(): global dbconnection dbconnection = dbcon.BaseConnection() def send_to_data_base(): sql_query = """INSERT INTO FIATSTILO VALUES...
prof_main.py
""" Profile-related data controllers. :class:`ProfileManager` is the main class to control profiles. - Any controls besides tests and access to permission promotion record should use this class to manipulate the profile data. """ from threading import Thread from typing import Optional, List, Dict, Set, Uni...
commands.py
import sys import base64 import argparse import logging from functools import partial from itertools import cycle, repeat from threading import Thread from time import sleep import json import multiprocessing as mp from queue import Empty import coloredlogs from websocket import create_connection import bigchaindb_b...
loons.py
# coding=utf-8 # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
main.py
#! /usr/bin/env python # -*- coding: utf8 -*- import sys reload(sys) sys.setdefaultencoding('utf8') #from espeak import espeak #Charging #from sensor_msgs.msg import BatteryState import time import threading import traceback import os, json #import telepot #from telepot.loop import MessageLoop import rospy # Head...
bitfinex.py
# Import Built-Ins import logging import json import time import queue import threading from threading import Thread # Import Third-Party from websocket import create_connection, WebSocketTimeoutException from websocket import WebSocketConnectionClosedException # Import Homebrew from bitex.api.WSS.base import WSSAPI ...
gcloud_agent.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
__init__.py
from .server import run import threading # Run the flask app in a new thread. process_thread = threading.Thread(name='register_publisher', target=run) process_thread.setDaemon(True) process_thread.start()
test_util.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...
test_runner_from_rest.py
import unittest import sys import sofine.rest_runner as rest_runner import sofine.lib.utils.conf as conf import urllib2 import json import multiprocessing class TestCase(unittest.TestCase): def setUp(self): from wsgiref.simple_server import make_server server = make_server('localhost', conf.RE...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import copy import errno import signal import socket import hashlib import logging import weakref import threading from random import randint # Im...
ClientSocket.py
from OSC import OSCStreamingClient, OSCMessage import math, re, socket, select, string, struct, sys, threading, time, types, array, errno, inspect from socketserver import UDPServer, DatagramRequestHandler, ThreadingMixIn, StreamRequestHandler, TCPServer from contextlib import closing """This class manages connection ...
Eth_Hunt2.py
# -*- coding: utf-8 -*- """ @author: iceland Special Thanks to AlbertoBSD for a lot of help, always. :) """ import bit import time import binascii import random import sys import gmp_ec as ec import re from eth_hash.auto import keccak from multiprocessing import Manager, Event, Process, Queue, Value,...
webtrader.py
# -*- coding: utf-8 -*- import abc import logging import os import re import time from threading import Thread import requests import requests.exceptions from . import exceptions from .log import logger from .utils.misc import file2dict, str2num from .utils.stock import get_30_date # noinspection PyIncorrectDocstri...
reader.py
# -*- coding: utf-8 -*- # 18/7/30 # create by: snower import time import threading class Reader(object): def __init__(self, client, connection): self._connection = connection self._client = client self._reader_thread = None self._is_stop = False @property def is_running(se...
test_master_slave_connection.py
# Copyright 2009-2012 10gen, 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,...
player.py
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz 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, merg...
PI_test.py
import os import serial import time import libs.MAPS_mcu as mcu import libs.MAPS_pi as pi import libs.display as oled from datetime import datetime import requests import threading #import current file's config, by getting the script name with '.py' replace by '_confg' #ex: import "maps_V6_general.py" > "maps_V6_gene...
player.py
from absl import logging import argparse import tensorflow as tf import tensorflow_hub as hub import os from PIL import Image import multiprocessing from functools import partial import time import pyaudio as pya import threading import queue import numpy as np from moviepy import editor import pygame pygame.init() os....
threading.py
import threading import time class BackgroundFunction(object): """ Threading example class The run() method will be started and it will run in the background until the application exits. """ def __init__(self, func, interval=1, *args, **kwargs): """ Constructor :type interval: int...
listen.py
from django.conf import settings from respa_outlook.models import RespaOutlookReservation from django.core.exceptions import ValidationError from exchangelib.errors import ErrorItemNotFound from time import sleep, time from copy import copy from threading import Thread, Event class Listen(): def __init__(self,...