source
stringlengths
3
86
python
stringlengths
75
1.04M
mixins.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` ============= Class Mix-Ins ============= Some reusable class Mixins ''' # pylint: disable=repr-flag-used-in-string # Import python libs from __future__ import absolute_import, print_function import os import sys...
BB84.py
# importing Qiskit from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute, BasicAer # Import basic plotting tools from qiskit.tools.visualization import plot_histogram # import utility modules import math from flask import Flask, request import requests import pickle import sys import multipro...
clientWebsocket_2.py
import argparse import asyncio import json import logging import pickle import ssl from tkinter import * import queue import time import threading import time from tkinter import messagebox from typing import Callable, Deque, Dict, List, Optional, Union, cast from urllib.parse import urlparse from tkinter import * impo...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JSO...
prova_thread.py
from threading import Thread from time import sleep import os def function(i): #i = args[0] name = 'm_topo_thr_' + str(i) os.system('touch ' + name) with open(name, "w") as file: file.write("Thread " + str(i)) if __name__ == "__main__": threads = [] for i in range(1,5): thread...
source.py
#master: https://github.com/yagamiraku/tarkov_flea_bot_toTherapis # └──fork: https://github.com/astron4ik/tarkov_flea_bot_toTherapis # └──this fork: https://github.com/Avnsx/EFT_Flea_Market_Bot #Master: yagamiraku | fork: astron4ik | this fork: Avn import requests,zlib,hashlib,json,configparser,random,os,time,threadi...
bot.py
import datetime as dt import logging import os import sys from threading import Thread from dotenv import load_dotenv from logbook import Logger, StreamHandler from logbook.compat import redirect_logging from telegram import ( InlineKeyboardButton, InlineKeyboardMarkup, MessageEntity, ParseMode, Up...
test_waffle.py
from __future__ import unicode_literals import random import threading import unittest from django.contrib.auth import get_user_model from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from django.db import connection, transaction from django.test import RequestFactory, Trans...
speedtest.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2012-2014 Matt Martz # 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.or...
main.py
from urllib.request import urlopen from bs4 import BeautifulSoup as Soup from threading import Thread from queue import Queue, Empty from os import mkdir from sys import argv base_url = "http://jandan.net/ooxx/page-" page_raws = Queue() img_urls = [] def download(idx_start, idx_end): for idx in range(idx_start...
build.py
# Copyright 2014 The Oppia 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 applicable ...
PG_consumer.py
#! /home/techstar/anaconda3/bin/python # -*- coding: utf-8 -*- import os,sys from kafka import KafkaProducer,KafkaConsumer import json import pandas as pd import time import signal import daemon from datetime import datetime import threading,socket consumer = KafkaConsumer("PGsimulation",bootstrap_servers='m1:2181,m2:...
multipro2.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' 验证父子进程关系 ''' from multiprocessing import Pool from multiprocessing import Process import os import time def info(title): print title print 'module name',__name__ if hasattr(os, 'getppid'): print 'parent process:',os.getppid() time.sleep(15) ...
node.py
""" Minimal NEO node with custom code in a background thread. It will log events from all smart contracts on the blockchain as they are seen in the received blocks. """ import threading from time import sleep from logzero import logger from twisted.internet import reactor, task from neo.Network.NodeLeader import Nod...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Vibe - Music Discord Bot === Owner longbep#2751 ===" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
download_data_demo2.py
""" 我们使用币安原生的api进行数据爬取. """ import pandas as pd import time from datetime import datetime import requests import pytz from howtrader.trader.database import database_manager pd.set_option('expand_frame_repr', False) # from howtrader.trader.object import BarData, Interval, Exchange BINANCE_SPOT_LIMIT = 1000 BINA...
sim_weight_process.py
# python 3.7 # -*- coding: utf-8 -*- import sys from gensim.models.keyedvectors import KeyedVectors import numpy as np import pandas as pd from datetime import datetime import time from threading import Thread from multiprocessing import Process import multiprocessing # # load pre-train model on my own corpus # mod...
demon.py
import argparse import datetime import os import time from threading import Thread base_dir = os.path.dirname(os.path.abspath(__file__)) os.chdir(base_dir) class Demon: def __init__(self, port): self.port = port self.on = True def demon(self): print(f'\n数字铁路服务器守护进程运行中... {datetime.da...
trainingserver.py
#! /usr/bin/env python import argparse import sys import tensorflow as tf import netifaces import dns.resolver import pieshell import multiprocessing import click FLAGS = None def run_server(spec, job_name, task_index): print "Starting server /job:%s/task:%s as %s..." % (job_name, task_index, spec[job_name][task_...
host-scanner-via-udp.py
#!/usr/bin/python # # Simple UDP scanner determining whether scanned host replies with # ICMP Desitnation Unreachable upon receiving UDP packet on some high, closed port. # # Based on "Black Hat Python" book by Justin Seitz. # # import os import sys import time import ctypes import struct import socket import threadi...
_client_application.py
# Copyright 2017 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...
t4.py
''' 现有两个进程,1号进程向文件写入10个"hello" 2号进程向文件 写入10个"world",两个进程并发执行 如何使得文件中的内容一定 是"hellohellohellohellohello.....worldworldworld......." ''' from multiprocessing import Process,Lock import time def job(flname,arg,mylock): with mylock: # time.sleep(10) f=open(flname,'a+') f.write(arg*10) f.c...
redis_queue_server.py
# redis_queue_server.py import os import logging import multiprocessing from tasks import get_word_counts from redis_queue_worker import worker PROCESSES = 4 def run(): processes = [] print(f'Running with {PROCESSES} processes!') while True: for w in range(PROCESSES): p = multiproc...
crawlerTask.py
import threading import time from lib import mongodbConnection from lib import crawler from datetime import datetime import logging logger = logging.getLogger(__name__) class CrawlerTask(object): def __init__(self, app, interval=10): self.interval = interval self.app = app thread = threadi...
online_bci.py
# Copyright (c) 2019 MindAffect B.V. # Author: Jason Farquhar <jason@mindaffect.nl> # This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>. # # pymindaffectBCI is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
log-prefixer.py
#!/usr/bin/env python3 # Copyright Materialize, Inc. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this so...
main_general.py
# -*- coding: utf-8 -*- """ Created on Sat Jan 8 19:12:55 2022 @author: Rechacalos""" from threading import Thread from alarme_test1 import * from transformateur_image_en_video import * if __name__ == '__main__': camera = 0 kernel_blur=3 seuil=15 surface=1000 ...
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...
calculator.pyw
# Written by Rishi # Completed on 7 July, 2020 import math from threading import Thread from time import sleep from tkinter.__init__ import Tk, Button, Label, Frame, StringVar, BooleanVar, Menubutton, Menu, Toplevel from tkinter.constants import * from playsound import playsound #pip install playsound #unc...
firebase_data_injection_multiuser.py
import requests import json import time import multiprocessing # Firebase def load_data_firebase(data): start = time.time() prev_time = start for line in data: response_insert = requests.post('http://localhost:3000/firebase/write/crypto',json=line).text end = time.time() print("...
util_arp.py
from scapy.all import * import subprocess import os import multiprocessing #masq_ip: ip we masquerade as. #masc_mac: Masqueraded mac address #source_mac: Our mac address #Dest IP: target ip #Dest Mac: target mac address #ex: arpDos("10.0.0.1", "00:0c:29:5f:e7:50", "b8:27:eb:c2:1c:52", "10.0.0.57", "00:0c:29:08:45:1a") ...
telloCV.py
""" tellotracker: Allows manual operation of the drone and demo tracking mode. Requires mplayer to record/save video. Controls: - tab to lift off - WASD to move the drone - space/shift to ascend/descent slowly - Q/E to yaw slowly - arrow keys to ascend, descend, or yaw quickl - backspace to land, or P to palm-land - ...
network.py
#!/usr/bin/env python3 """network.py: The network file for the WebFile project.""" __author__ = "Rhys Read" __copyright__ = "Copyright 2020, Rhys Read" import socket import os import logging from threading import Thread HOST = '0.0.0.0' SEPARATOR = '<SEPARATOR>' BUFFER_SIZE = 4096 # (bytes) LISTEN_PORT = 5001 ...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import copy import os import re import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
app.py
""" Handles front-end web requests and makes calles to back end data, news and scheduling handlers. Attributes: log (Logger): The logger for the covid_dashboard. """ from datetime import datetime, timedelta import threading import logging from flask import Flask, render_template, Markup, request, redirect from sch...
spawn.py
''' Spawn is mechanism so that a cortex can execute different queries in separate processes ''' import os import asyncio import logging import threading import contextlib import collections import multiprocessing import concurrent.futures import synapse.exc as s_exc import synapse.glob as s_glob import synapse.common...
o_gui_user.py
#!/usr/bin/env python3 import matplotlib matplotlib.use('TkAgg') import socket import os import ast from threading import Thread import random as r import time import datetime as dt import paho.mqtt.client as mqtt import matplotlib.pyplot as plt from drawnow import * import subprocess as sp import config import smtplib...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
logging_and_multiprocessing.py
################################### # File Name : logging_and_multiprocessing.py ################################### #!/usr/bin/python3 import logging import multiprocessing def worker(count): print ("count : %s" % count) def main(): multiprocessing.log_to_stderr() logger = multiprocessing.get_logger() ...
__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...
test_adb.py
# -*- coding: UTF-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may...
master_sync.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # 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...
trustedcoin.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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...
handlers.py
import datetime import json import gzip import time from logging import StreamHandler, DEBUG from logging.handlers import RotatingFileHandler from threading import Thread import certifi from . import settings from .log_object import LogObject, ErrorLogObject, SqlLogObject from elasticsearch import Elasticsearch from ...
DataCollection.py
''' Created on 21 Feb 2017 @author: jkiesele ''' from DeepJetCore.TrainData import TrainData from DeepJetCore.dataPipeline import TrainDataGenerator import tempfile import pickle import shutil import os import copy import time import logging from DeepJetCore.stopwatch import stopwatch logger = logging.getLogger(__na...
erere.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # python 3.3.2+ Hammer Dos Script v.1 # by Tampansky # hayoooo MAu RECODE Ea TOD from queue import Queue from optparse import OptionParser import time,sys,socket,threading,logging,urllib.request,random def user_agent(): global uagent uagent=[] uagent.append("Mozilla/5.0 (...
power_monitoring.py
import random import threading import time from statistics import mean from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau...
test_pdb.py
# -*- coding: utf-8 -*- from __future__ import print_function import bdb import inspect import io import os import os.path import re import subprocess import sys import textwrap import traceback from io import BytesIO import six import py import pytest import pdbpp from pdbpp import DefaultConfig, Pdb, StringIO try...
filter_contigsServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
simulation.py
import utm_simulator.environment as environment import utm_simulator.layer_environment as layer_environment import utm_simulator.centralized_manager as centralized_manager from utm_simulator.my_utils import MyLogger from threading import Thread import numpy as np import heapq import json class Simulation: def __i...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
conftest.py
import multiprocessing import os import tempfile import threading import time import config import pytest from selenium import webdriver from app import app, db class LiveClient(object): def __init__(self): app.config.from_object(config.Config) app.config.from_envvar("WOLFIT_SETTINGS") ...
main.py
import hashlib import itertools import threading import time from datetime import datetime import sys from colorama import Fore, Back class style: BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033[0m' done = False # Headers print(Fore.RED + '░░░██╗░██╗  ░██╗░░██╗░█████╗░░██████╗██╗...
ope_dns.py
import os import socket import sys import socketserver import threading class ThreadingDNSHandler(socketserver.DatagramRequestHandler): def handle(self): print("data in") # Deal with request data, sock = self.request data = self.request.recv(1024, 'ascii') socket = self.r...
xiami.py
#!/usr/bin/env python # -*- coding:utf-8 _*- """ @author: HJK @file: xiami.py @time: 2019-01-21 从虾米搜索和下载音乐 """ import threading import requests from .. import config from ..exceptions import RequestError, ResponseError, DataError from ..music import Music __all__ = ["xiami_search", "xiami_download"] def xiami_sea...
anomaly.py
import urllib.request import json import random import time, datetime import threading from collections import deque import paho_mqtt url = 'https://ussouthcentral.services.azureml.net/workspaces/8854f731dde4458bb29d0138178c472e/services/75278a1d64fe4c89ad4d767c4d076e19/execute?api-version=2.0&format=swagger' api_key ...
keyboard_teleop_sim.py
#!/usr/bin/env python # Author: Silvia Knappe # Control movo with keyboard teleop, moves base and torso! import rospy import actionlib from copy import copy from geometry_msgs.msg import Twist from movo.system_defines import TRACTOR_REQUEST from movo_msgs.msg import ConfigCmd, LinearActuatorCmd from control_msgs.msg ...
standalone.py
from __future__ import ( absolute_import, unicode_literals, ) import importlib import logging import sys __all__ = ( 'django_main', 'simple_main', ) if sys.path[0] and not sys.path[0].endswith('/bin'): # When Python is invoked using `python -m some_module`, the first item in the path is always ...
psp-r-server.py
''' Server Web que implementará la API de PSP. Por el momento es simplemente un sandbox para hacer algunas pruebas de las librerías de Python y otros conceptos. ''' import asyncio import logging import signal import uvicorn import os import multiprocessing from multiprocessing import Process from fastapi import Body, ...
GUI.py
import PyQt5.QtCore as QtCore import PyQt5.QtWidgets as QtWidgets import PyQt5.QtWebEngineWidgets as QtWebEngineWidgets from threading import Thread class GUI: def __init__(self, app, host="127.0.0.1", port=5000, debug=False): self.flask = app self.host = host self.port = port self....
Bot.py
import os from dataclasses import dataclass from datetime import datetime from pathlib import Path from threading import Thread from urllib.request import urlopen from enum import Enum import requests import tarfile import time import shutil from Bot import Config from Utils import Logger from Utils.Command import Com...
process_comments.py
""" Will process all files that match data/{sub}_comment.(csv|pkl) and output them to processed/{sub}_comment.csv """ import re import os import pandas as pd from time import sleep from helpers import apply_vader from multiprocessing import Process, Queue p = re.compile(r'^([a-zA-Z0-9_]+)_comment\.(csv|pkl)$') data =...
stress-test.py
# A stress test program to perform repeated operations in multiple processes. # # 1. Write data between 0 and BATCH_SIZE blocks at a random offset # 2. Read data between 0 and BATCH_SIZE blocks at a random offset # 3. Remove a replica and add it back, causing a rebuild # # Test patterns are stored in shared memory for...
train.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import distributed from models import data_loader, model_builder from models.data_loader i...
utils.py
#================================================================ # # File name : utils.py # Author : PyLessons # Created date: 2020-09-27 # Website : https://pylessons.com/ # GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3 # Description : additional yolov3 and yolov4 functio...
test_dag_serialization.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...
pepper_runner.py
import threading, os, re, sys, platform from paths import coptic_nlp_path sys.path.insert(0, coptic_nlp_path) from coptic_nlp import exec_via_temp PY2 = sys.version_info[0] < 3 def compress_pepper_out(pepper_msg, full_log=False): empty_spans = 0 if PY2: pepper_msg = pepper_msg.decode("utf8") ...
mcd_calculate.py
#!/usr/bin/env python3 # encoding: utf-8 # Copyright 2020 Nagoya University (Wen-Chin Huang) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) # Calculate MCD using converted waveform. import argparse import fnmatch import multiprocessing as mp import os from fastdtw import fastdtw import numpy as np impo...
imagenetDownloader.py
#!/usr/bin/env python # Based on a script by Ivan T. F. Antunes F. With the following copyright # Copyright (c) 2017 Ivan T. F. Antunes F. # # 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 w...
threadpool.py
import ctypes import threading import time from queue import Queue from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Union, cast import attr import hypothesis from ..._hypothesis import make_test_or_exception from ...models import CheckFunction, TestResultSet from ...stateful import Feedbac...
test_client.py
# test_client.py -- Compatibilty tests for git client. # Copyright (C) 2010 Google, Inc. # # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any later version. You can redistribute it and/or ...
log-prefixer.py
#!/usr/bin/env python3 # Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source Licen...
curses_ui_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...
measure_methods.py
# pylint: disable=invalid-name,too-many-function-args,too-many-nested-blocks """ Functions that run on executor for measurement. These functions are responsible for building the tvm module, uploading it to remote devices, recording the running time costs, and checking the correctness of the output. """ import logging...
dorna.py
import threading import json from random import random import time from .ws import ws from .track import track_cmd class dorna(ws): """docstring for Dorna""" def __init__(self): super(dorna, self).__init__() def id_loop(self): while self.connected: time.sleep(0) ms...
lichess-bot.py
import argparse import chess from chess.variant import find_variant import chess.polyglot import engine_wrapper import model import json import lichess import logging import logging.handlers import multiprocessing import logging_pool import signal import time import backoff import sys import random from config import l...
test_util_test.py
<<<<<<< HEAD # 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 requir...
server.py
from flask import Flask, send_from_directory, render_template, jsonify from time import sleep import threading import os import Adafruit_DHT as dht #Set DATA pin DHT = 4 app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') @app.route('/data') def get_weather_data(): retu...
test_wrapper.py
# Copyright 2017 The Nuclio 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 w...
gen_protos.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...
many-parallel-tasks.py
#!/usr/bin/env python """ More complex demonstration of what's possible with the progress bar. """ from __future__ import unicode_literals import threading import time from prompt_toolkit2 import HTML from prompt_toolkit2.shortcuts import ProgressBar def main(): with ProgressBar( title=HTML('<b>Exam...
rpc_test.py
import concurrent.futures import contextlib import json import logging import os import sys import threading import time import unittest import warnings from collections import namedtuple from functools import partial from threading import Event from threading import Lock from unittest import mock import torch impo...
graphics_server.py
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Mar 7, 2014 Graphics server which uses ZeroMQ PUB so...
app.py
# TODO # Add state callbacks - Try to attach to post fork loop #import gc import signal import asyncio import traceback import socket import os, sys, random, mrpacker import multiprocessing import faulthandler import functools from wsgiref.handlers import format_date_time import inspect, copy #from inspect import ...
test_zmq.py
import time import threading import zmq worker_url="inproc://worker" def worker_routine1(context=None): """Worker routine""" context = context or zmq.Context.instance() receiver = context.socket(zmq.PAIR) receiver.bind(worker_url+"1") while True: string = receiver.recv() print("R...
image.py
"""Abstract base class for tools working on images. """ # standard imports from typing import Tuple from threading import Thread import logging # third party imports import numpy as np # toolbox imports from .tool import Tool from ..base.data import Data from ..base.image import Image, Imagelike, ImageGenerator fro...
store_warmup_binance_future.py
import threading import time import traceback import ccxt class StoreWarpupBinanceFuture: def __init__(self, store=None, logger=None, min_interval=None): self.store = store self.logger = logger self.min_interval = min_interval def start(self): self.thread = threading.Thread(tar...
node.py
import collections import copy import json import logging import queue import threading import typing import uuid import caracal.declaration.datatypes as cara_types import caracal.declaration.nodetype as node_type import caracal.execution.session as session import caracal.proto.basictypes_pb2 as basic_types_pb2 import...
cifar10-fast.py
#!/usr/bin/env python import argparse import numpy as np import os import multiprocessing as mp import tensorflow as tf from tensorpack import * from tensorpack.utils import logger from tensorpack.tfutils.tower import TowerFunc from tensorpack.tfutils.varreplace import custom_getter_scope from tensorpack.dataflow imp...
2_1_forking_mixin_socket_server2.py
#!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 2 # This program is optimized for Python 3.5.2. # It may run on any other version with/without modifications. # # Need some modifications to make it run on Python 2.7.x: # For the start, replace "socketserver" with "SocketServer" ...
monitor.py
import frida import sys import time import logging #import analysis import subprocess import os, threading class Monitor(object): """ this class monitor the sensitive api """ def __init__(self): self.packageName = None self.device = None self.sensitive_api = list() ...
threespace_utils.py
#!/usr/bin/env python2.7 """ This module is a utility module used in the ThreeSpace API. The ThreeSpace Utils module is a collection of functions, structures, and static variables to be use exclusivly with the ThreeSpace API module to find available ThreeSpace devices on the host system and informatio...
untitled2.py
from poco.drivers.android.uiautomation import AndroidUiautomationPoco #poco = AndroidUiautomationPoco(force_restart=False) # -*- encoding=utf8 -*- __author__ = "Admin-Y" __title__ = "test script title" __desc__ = """ this is a test script. """ import threading import os def install_app(): os.system("adb install C...
apps.py
# -*- coding: utf-8; -*- # # @file apps.py # @brief coll-gate messenger application # @author Frédéric SCHERMA (INRA UMR1095) # @date 2017-10-06 # @copyright Copyright (c) 2017 INRA/CIRAD # @license MIT (see LICENSE file) # @details import socketserver import threading from igdectk.common.apphelpers import Applicatio...
run_one_instance_per_video.py
"""1. Police department uploads the video to S3 bucket for incoming videos 2. As video are saved in the bucket a threaded script creates an EC2 instance per item in bucket 3. The threaded script sends a command over SSH with the argument being the key name of the video on the S3 bucket 4. The called script then saves ...
bpytop.py
#!/usr/bin/env python3 # pylint: disable=not-callable, no-member # indent = tab # tab-size = 4 # Copyright 2020 Aristocratos (jakob@qvantnet.com) # 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...
eva_locker.py
import threading import time from .eva_errors import EvaLockError class EvaWithLocker: """ The EvaWithLocker class is used to keep an Eva locked for the entirety of a Python with scope. It expects an already locked Eva object to be passed in, and for the duration of the with scope it will renew the l...
sequence_input_layer.py
#!/usr/bin/env python #Data layer for video. Change flow_frames and RGB_frames to be the path to the flow and RGB frames. import sys sys.path.append('../../python') import caffe import io from PIL import Image import matplotlib.pyplot as plt import numpy as np import scipy.misc import time import pdb import glob imp...
preprocess.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 Reo Yoneyama (Nagoya University) # based on a Quasi-Periodic Parallel WaveGAN script by Yi-Chiao Wu (Nagoya University) # (https://github.com/bigpon/QPPWG) # and also based on a Parallel WaveGAN script by Tomoki Hayashi (Nagoya University) # (https://gith...