source
stringlengths
3
86
python
stringlengths
75
1.04M
kb_SPAdesServer.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...
helpers.py
"""High-level functions to help perform complex tasks """ from __future__ import print_function, division import os import multiprocessing as mp import warnings from datetime import datetime import platform import struct import shutil import copy import time from ast import literal_eval import traceback import sys im...
concurrent_executor.py
# Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ...
test_c10d.py
import copy import math import operator import os import random import signal import sys import tempfile import threading import time import traceback import unittest from unittest import mock from contextlib import contextmanager from datetime import timedelta from functools import reduce from itertools import groupby...
Hiwin_RT605_Socket_20190629191347.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import Hiwin_RT605_socket_TCPcmd as TCP import Hiwin_RT605_Socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv i...
exchange_rate.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal ...
use_threadlocal.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import threading # 创建全局ThreadLocal对象: local_school = threading.local() def process_student(): # 获取当前线程关联的student: std = local_school.student print('Hello, %s (in %s)' % (std, threading.current_thread().name)) def process_thread(name): # 绑定ThreadLocal的st...
drawable_dfa.py
from dfa import DFA from drawable_state import DrawableState from time import sleep from threading import Thread class DrawableDFA(DFA): def __init__(self, alphabet = ['0','1'], x = 60, y = 355): DFA.__init__(self, alphabet) self._states[0] = DrawableState(True, False, x, y) self._selected ...
experiments.py
## # MySlice version 2 # # Experiments process service: will keep the list of slices and projects configured in sync # Will also manage slice/project creation, deletetion, status etc. # # (c) 2016 Ciro Scognamiglio <ciro.scognamiglio@lip6.fr> ## import signal import threading from queue import Queue import mys...
test_proxies.py
''' # Date: 4/17/2020 Author: Yehan Wasura Description: Reads a file that contains a list of proxies and determines whether or not that list is good. Each line in the file must be in the format of ip:port ''' import platform from os import system from time import sleep from requests import Session from th...
main.py
import pdb import time import os import subprocess import re import random import json import numpy as np import glob from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import socket import argparse import threading import _thread import signal from datetime import datetime from sklearn...
m_thread.py
# # Copyright 2013 Y12Studio # # 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, ...
lisp-etr.py
#----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.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 ...
test_capture.py
from __future__ import absolute_import, division, print_function # note: py.io capture tests where copied from # pylib 1.4.20.dev2 (rev 13d9af95547e) import pickle import os import sys from io import UnsupportedOperation import _pytest._code import py import pytest import contextlib from six import binary_type, text_...
buildserver.py
#!/usr/bin/python3 import argparse import ctypes import functools import shutil import subprocess import sys import tempfile import threading import traceback import os.path sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__))))) from youtube_dlc.compat import ( compat_input, compat_...
blockcheck.py
#!/usr/bin/env python3 # coding: utf-8 import argparse import json import urllib.request import urllib.parse import urllib.error import socket import ssl import sys import os.path import dns.resolver import dns.exception import ipaddress import ipwhois ''' ================================= IMPORTANT Make sure to ru...
sensor.py
#!/usr/bin/env python """ Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from __future__ import print_function # Requires: Python >= 2.6 import sys sys.dont_write_bytecode = True import cProfile import inspect import math impor...
hd_active.py
import logging import threading import time from collections import deque from datetime import datetime from os import PathLike, urandom from pathlib import Path from typing import Deque, Iterable, Optional, Set, Union from app.hd_action_state import HdActionState FILE_NAME = '_hd_active.txt' logger = logging.getLogg...
test_sanity.py
from base import async_insert, pipeline, clean_db import getpass import os import psycopg2 import pytest import tempfile import threading import time def test_create_drop_continuous_view(pipeline, clean_db): """ Basic sanity check """ pipeline.create_stream('stream0', id='int') pipeline.create_cv('cv0', 'SE...
a3c_ppotest_frames.py
# Code modified from https://github.com/seungeunrho/minimalRL/blob/master/a3c.py import os, sys from numpy.core.fromnumeric import squeeze sys.path.append(os.path.dirname(sys.path[0])) project_dir = os.path.dirname(os.path.dirname(sys.path[0])) sys.path.append(project_dir) sys.path.append(os.path.join(project_dir,...
crawler.py
import os import time import threading import multiprocessing from MongoQueue import MongoQueue from Download import request from bs4 import BeautifulSoup SLEEP_TIME = 1 def mzitu_crawler(max_threads=10): crawl_queue = MongoQueue('meinvxiezhenji', 'crawl_queue') img_queue = MongoQueue('meinvxiezhenji', 'img_q...
ajax.py
import threading import webbrowser try: from http.server import HTTPServer from http.server import BaseHTTPRequestHandler from urllib.request import pathname2url from queue import Queue except ImportError: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from urllib import ...
__init__.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import operator import os import re import string from typing import ( Any, Callable, ContextManager, List, Optional, Sequence, Tuple, Ty...
PreventCapture.py
# -*- coding: utf-8 -*- """ Created on Fri Feb 14 13:59:32 2020 @author: Gebruiker """ import winput, time import ctypes import win32clipboard import threading import win32ui def getCurrentForegroundWindow(): return win32ui.GetForegroundWindow().GetWindowText() def isSlackSelected(): retu...
test_datasets.py
import json import os import threading import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from test.support import EnvironmentVarGuard from urllib.parse import urlparse from kaggle_secrets import (_KAGGLE_URL_BASE_ENV_VAR_NAME, _KAGGLE_USER_SECRETS_TOKEN_ENV_VAR_NAME...
test_docxmlrpc.py
from xmlrpc.server import DocXMLRPCServer import http.client import sys from test import support threading = support.import_module('threading') import time import socket import unittest PORT = None def make_request_and_skipIf(condition, reason): # If we skip the test, we have to make a request because the # t...
misc_test.py
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import numpy as np import pytest import cntk from cntk.device import * import sys fr...
command.py
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import enum import json import logging import os import resource import signal import subprocess import threading from abc import A...
get.py
import requests import optparse import cv2 import numpy as np import sys import threading import os from os.path import basename import json import base64 parser = optparse.OptionParser() parser.add_option( '-u', '--url', default='http://localhost:5000/cloth', dest='url') def test(): # Use base64 to encode...
measure_methods.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...
test_output.py
# encoding: utf-8 from subprocess import call import os import threading import time import pytest import csv import numpy as np def read_from_csv_(file): fp = open(file, 'r') names = fp.readline() a = fp.readlines() return a,names def write_in_csv_(file,a,names,i): fp = open(file, 'w') fp.wri...
__init__.py
try: import numpy as np except: numpy = False try: from io import BytesIO except: BytesIO = False try: import json except: json = False try: import datetime except: datetime = False try: import random except: random = False try: from flask import request except: flas...
worker.py
from contextlib import contextmanager import atexit import faulthandler import hashlib import inspect import io import json import logging import os import redis import sys import threading import time import traceback from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union # Ray modules from ra...
scrape_test.py
# Copyright (c) 2021 AllSeeingEyeTolledEweSew # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERC...
Carrot-gui.py
from tkinter import * import threading from time import sleep class Window: def __init__(self): self.flg = False self.root = Tk() self.LiPo = DoubleVar() self.motor_x = DoubleVar() self.motor_y = DoubleVar() self.EMERGENCY = BooleanVar() self.LiPo.set(25) ...
test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None imp...
multi_task_main.py
""" This file defines the main object that runs experiments. """ import matplotlib as mpl mpl.use('Qt4Agg') import numpy as np import tensorflow as tf import logging import imp import os import os.path import sys import copy import argparse from datetime import datetime import threading import pprint import time impo...
main.py
# coding:utf-8 from multiprocessing import Process import ctypes import _ctypes def do_work(src_img, ref_img, out_img): welsh_lib = ctypes.cdll.LoadLibrary('src/welsh/libWelsh.so') welsh_lib.welsh(ctypes.c_char_p(src_img.encode('utf-8')), ctypes.c_char_p(ref_img.encode('utf-8')), ctypes.c_...
game.py
from __future__ import annotations import collections.abc import random import typing from threading import Thread import more_itertools from playsound import playsound import boxed from boxed import grid from boxed.border import draw_boundary KEY_OFFSETS = { "KEY_DOWN": (0, 1), "KEY_UP": (0, -1), "KEY_...
6-2(2).py
import sys, threading sys.setrecursionlimit(10**7) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size def IsBinarySearchTree(j, mn, mx): if not j in tree: return True if tree[j][0] < mn or tree[j][0] > mx: return False return IsBinarySearchTree(tree[j][1], mn, tre...
__init__.py
from appfd.models import Order from appfd.scripts.create import create_csv, create_geojson, create_images, create_shapefiles, create_xypair, create_pdf from appfd.scripts.ai import update_country_code_ranks_for_order from apifd.scripts.create.frequency_geojson import run as create_frequency_geojson from multiprocessing...
youtube_downloader.py
from tkinter import * from threading import * from pytube import YouTube from tkinter import messagebox, filedialog, ttk def thread_downloader(): thread = Thread(target=downloader) thread.start() def browse(): download_path = filedialog.askdirectory() download_directory.set(download_path) file_size =...
multi2.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import argparse import cv2 from maskrcnn.config import cfg from predictor import COCODemo from maskrcnn.structures.keypoint import PersonKeypoints import time import torch import pyzed.sl as sl import numpy as np import math from threading import...
zeekctld.py
from __future__ import print_function from collections import defaultdict from threading import Thread, Lock from Queue import Queue import os import time import random import traceback from ZeekControl import config from ZeekControl import version from ZeekControl.zeekctl import ZeekCtl from ZeekControl import ser as...
joystick_creator.py
import sys import os import argparse import json import time import math from irmark1.parts.datastore import Tub from irmark1.utils import * from irmark1.parts.controller import JoystickCreatorController try: from prettytable import PrettyTable except: print("need: pip install PrettyTable") class CreateJoyst...
tello.py
import threading import socket import time import datetime import struct import sys import os from . import crc from . import logger from . import event from . import state from . import error from . import video_stream from . utils import * from . protocol import * from . import dispatcher log = logger.Logger('Tello...
main.py
import requests import bs4 import threading import datetime import os import json import time import smtplib from email.mime.text import MIMEText from email.header import Header from email.mime.multipart import MIMEMultipart from log_manager import log, CONFIG_PATH class Bing: def __init__(self):...
heartrate_monitor.py
from max30102 import MAX30102 import hrcalc import threading import time import numpy as np class HeartRateMonitor(object): """ A class that encapsulates the max30102 device into a thread """ def __init__(self, print_raw=False, print_result=False, LOOP_TIME=0.01): self.bpm = 0 self.sp...
timer.py
import sys import time import math import threading from pysample.context import SampleContext, SampleContextFactory, SampleContextManager class SampleTimer: """ Sample event triggered by "SampleTimer". Only one SampleTimer is running at the same time. Usually use the "start_timer" function to start...
genetic_algo_tsp.py
import random import sys import math import numpy as np import time from multiprocessing import Process def read_coordinates(coordinate_file): """ Reads coordinates from file and creates coordinates list """ coordinates = [] for line in coordinate_file: node_id, x, y = line.split(" ") coor...
io.py
# Copyright (c) 2018 PaddlePaddle 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 app...
aula_se.py
# -*- coding: utf-8 -*- """ Created on Mon Oct 01 17:20:59 2018 @author: Leonardo """ # -*- coding: utf-8 -*- """ Spyder Editor Este é um arquivo de script temporário. """ #aula sistemas distribuidos 24/09/2018 import threading import time ''' def seu_coracao(): print ('<3') return t...
xbmcmm.py
from flask import render_template, request, json, jsonify from maraschino import app, logger from maraschino.tools import requires_auth, get_setting_value, create_dir, download_image from maraschino.noneditable import server_api_address from maraschino.models import XbmcServer from jinja2.filters import FILTERS from tv...
test_deployments.py
import json import os from multiprocessing import Process import pytest from jina.clients.request import request_generator from jina.enums import PollingType from jina.parsers import set_gateway_parser from jina.parsers import set_deployment_parser from jina.orchestrate.deployments import Deployment from jina import ...
__init__.py
from flask import Flask from config import Config from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager from logging.handlers import SMTPHandler,RotatingFileHandler from flask_mail import Mail, Message import logging,os, smtplib from threading import Thread app...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
inference_server.py
import torch import zmq import sys import gflags import time import multiprocessing import threading import msgpack import msgpack_numpy msgpack_numpy.patch() from .inference import find_tracker gflags.DEFINE_string('addr', '', '') gflags.DEFINE_string('weights_file', '', '') gflags.DEFINE_integer('n_worker', 1, '') ...
websocket.py
import aiohttp import asyncio import threading import typing import time import sys import json import zlib from aiohttp.http_websocket import WSMessage, WSMsgType class WebSocket: # websocket opcodes DISPATCH = 0 HEARTBEAT = 1 IDENTIFY = 2 PRESENCE = 3 VOICE_STATE = 4 VOICE_PING = 5 ...
client.py
#!/usr/bin/env python # Author: Manoel Vilela import socket import threading import readline HOST = 'chat.lerax.me' PORT = 5558 # set editing-mode on input readline.parse_and_bind('set editing-mode vi') s = socket.socket() s.connect((HOST, PORT)) read_stream = s.makefile() write_stream = s.makefile(mode='w') def ...
manager.py
#!/usr/bin/env python3 import datetime import os import signal import subprocess import sys import traceback from multiprocessing import Process import cereal.messaging as messaging import selfdrive.crash as crash from common.basedir import BASEDIR from common.params import Params, ParamKeyType from common.text_window...
server.py
#!/usr/bin/env python """ SSL server for Forge tests. - The server changes to the directory of the server script. - SSL uses "server.key" and "server.crt". - Sever performs basic static file serving. - Starts Flash cross domain policy file server. - Defaults to HTTP/HTTPS port 19400. - Defaults to Flash socket policy...
deepwalk.py
import torch import argparse import dgl import torch.multiprocessing as mp from torch.utils.data import DataLoader import os import random import time import numpy as np from reading_data import DeepwalkDataset from model import SkipGramModel from utils import thread_wrapped_func, shuffle_walks, sum_up_params class D...
scheduler_job.py
# pylint: disable=no-name-in-module # # 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, Versio...
server4.py
from threading import Thread import socket def connect(): while True: conn, addr = sock.accept() users.append([conn, addr]) print(addr) th_listen = Thread(target=resend, args=(conn,)) th_listen.start() def resend(conn): while True: try: data = con...
installwizard.py
import sys from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import electrum_sib from electrum_sib.i18n import _ from seed_dialog import SeedDisplayLayout, SeedWarningLayout, SeedInputLayout from network_dialog import NetworkChoiceLayout from util import * from password_dialog import...
index.py
import json, requests, sys import socket, urllib3, time import os, random, threading from time import time as tom cnt=(0) ping=(0) count=(0) threads=(0) working=(0) loop=(True) debugg=(False) not_working=(0) key=('Test-Key') types=(['http','https','socks4','socks5']) headers=({'Content-Type': 'application/json', 'Autho...
app.py
import os from threading import Thread from datetime import datetime from sh.contrib import git from flask import * from flask_bootstrap import Bootstrap from flask_talisman import Talisman from flask_moment import Moment from flask_wtf import FlaskForm from wtforms import * from sqlalchemy.sql.expression import func ...
containers.py
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
test_examples.py
import itertools import multiprocessing import runpy import sys from os import path as osp import pytest def run_main(*args): # patch sys.args sys.argv = list(args) target = args[0] # run_path has one difference with invoking Python from command-line: # if the target is a file (rather than a dire...
utils.py
import re import os import time import threading import ssl import json import random import string try: import urllib.request as urllib_request # for Python 3 except ImportError: import urllib2 as urllib_request # for Python 2 and Jython try: from urllib.parse import urlparse # for Python 3 except Import...
httpsRequest.py
# ================================================================================ # # httpsRequest.py # # This is the https client request program written for my proof of concept program # to demonstrate the SSLv3 Padding Oracle On Downgraded Legacy Encryption. # (POODLE) attack. # # Written in Python 2.7.7, ...
WebSockets.py
from flask import Flask, render_template, request from socketio import socketio_manage from socketio.namespace import BaseNamespace from werkzeug.wsgi import SharedDataMiddleware from socketio.server import SocketIOServer from time import sleep from threading import Thread import os class CatNamespace(BaseNamespace):...
autocast_variable_test.py
# Copyright 2019 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...
cacheutils.py
"""Caching-related python utilities, written by Neeraj Kumar. Licensed under the 3-clause BSD License: Copyright (c) 2013-4, Neeraj Kumar (neerajkumar.org) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...
miniterm.py
#!d:\alex munoz\new-cisco-config\venv\scripts\python.exe # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import threading import seria...
test_events.py
"""Tests for events.py.""" import collections.abc import concurrent.futures import functools import io import os import platform import re import signal import socket try: import ssl except ImportError: ssl = None import subprocess import sys import tempfile import threading import time import errno import uni...
display_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 us...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.testing import assert_raises from sqlalchemy.testing import assert_raises_message f...
conjugate_gradient_descent.py
# Copyright (c) 2012-2014, Max Zwiessele # Licensed under the BSD 3-clause license (see LICENSE.txt) from .gradient_descent_update_rules import FletcherReeves, \ PolakRibiere from Queue import Empty from multiprocessing import Value from multiprocessing.queues import Queue from multiprocessing.synchronize import E...
dweed.py
#!/usr/bin/python import dweepy import uuid import time import collections import threading import random class DweepyThreadListener(object): def __init__(self, thing, callback, timeout=32): def listen_dweets(thing, callback): while 1: try: print('Start lis...
a3c_for_cartpole.py
import threading import tensorflow as tf import numpy as np import gym import os import shutil import matplotlib.pyplot as plt import multiprocessing GAME = 'CartPole-v0' OUTPUT_GRAPH = True LOG_DIR = './log' # N_WORKERS = 3 N_WORKERS = multiprocessing.cpu_count() MAX_GLOBAL_EP = 3000 GLOBAL_NET_SCOPE = 'Global_Net' U...
scan_manager.py
# =============================================================================== # Copyright 2012 Jake Ross # # 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...
monitored_session_test.py
# pylint: disable=g-bad-file-header # 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/LICENS...
temy.py
"""Temy: TemTem Assistant Usage: temy.py -h | --help temy.py -v | --version temy.py --espeak=<str> [--debug] [--windowed] Options: -h, --help Show this screen. -v, --version Show version. phone. --espeak=<str> Location of Espeak CLI executable. --debug Start program in debug mode...
etherscan_py.py
import requests import IPython import copy from threading import Thread, Lock import itertools from toolz import partition class EtherscanEvent: def __init__(self, event): self.address = event['address'] self.topics = event['topics'] self.data = event['data'] self.block_height = int...
pagent.pyw
import subprocess, platform, os from threading import Thread import ctypes, wmi from multiprocessing import Process system = platform.system() lines = [] def main(): for line in lines: line = line.rstrip('\n') p = Process(target=KILL, args=(line,)) p.start() def KILL(process): ...
Zip_cracker.py
import zipfile from threading import Thread import time from termcolor import colored def extract_zip(zFile,passwd): duration = time.time() - curr_time try: zFile.extractall(pwd=bytes(passwd,'utf-8')) print(colored("[+] Match Found : "+ passwd,'green')) print(colored("[-] Exited at"+str(duration)+"Se...
Main_Program_v9.py
''' Main Program v9 --- Features: - Support for reading GPS position values through LCM - Support for reading GPS command values through LCM - Support for Mode change - Support for infrared lane following - Transfered to uno - Support for Odometry. - Serial interface with the Arduino has been disabled - Fuse ...
tab_base_classes.py
##################################################################### # # # /tab_base_classes.py # # # # Copyright 2013, Monash University ...
bench.py
#!/usr/bin/env python import logging import threading import random import Queue import requests import time QUEUE = Queue.Queue() REQUEST_COUNT = 10 THREAD_COUNT = 10 log = logging.getLogger("bench") log.setLevel(logging.INFO) log_handler = logging.StreamHandler() log_handler.setLevel(logging.INFO) log_formatter = ...
tensorflow-pipeline.py
#!/bin/python3 import argparse import multiprocessing as mp import numpy as np from sklearn.preprocessing import LabelEncoder import socket import sys import time import tensorflow as tf import traceback import impute import serialize # disable eager mode -> run in graph mode tf.compat.v1.disable_eager_execution() ...
tuq_advisor.py
from remote.remote_util import RemoteMachineShellConnection from .tuq import QueryTests import time from deepdiff import DeepDiff from membase.api.exception import CBQError import threading class QueryAdvisorTests(QueryTests): def setUp(self): super(QueryAdvisorTests, self).setUp() self.log.info(...
app-2020-0805-2000-AAC-QuickTest.py
#!/usr/bin/env python3 ##jwc o #!/usr/bin/env python # Key Notes # # jwc 2020-0519 Convert from Crickit_Adafruit to RoboHat_4tronix # jwc 2020-0519 Use 'gpiozero' for noise-free servo-control # jwc Add 'robohat.init()' # jwc Make sure 'servod' copied in from 'RoboHat' dir # jwc Using 'r...
test_lib.py
#!/usr/bin/env python """A library for tests.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import datetime import doctest import email import functools import itertools import logging import os import shutil import threading import time import unitt...
A3C_discrete_action.py
""" Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning. The Cartpole example. View more on my tutorial page: https://morvanzhou.github.io/2_tensorflow_old/ Using: tensorflow 1.8.0 gym 0.10.5 """ import multiprocessing import threading import tensorflow as tf import numpy as...
client.py
import socket import json import sys import threading import abc import queue import os,signal,time import argparse from datetime import datetime parser = argparse.ArgumentParser() parser.add_argument('host', help="server's host.") parser.add_argument('port', help="port to connect to server.", type=int) args = parser....
process.py
import atexit import logging import os import shlex import subprocess import threading import time from http import HTTPStatus from urllib.request import Request, urlopen import yaml from pyngrok import conf, installer from pyngrok.exception import PyngrokNgrokError, PyngrokSecurityError __author__ = "Alex Laird" __...
process_manager.py
"""Tools for managing subprocesses.""" from enum import Enum, auto as enum_auto import subprocess from typing import NamedTuple, Optional from threading import Thread import os import signal class ProcessExitResult(Enum): """Result of the process termination.""" # Process exited succesfully. Ok = enum_au...
runtime.py
import tvm import time import _thread import queue from tvm import tg """ These are deprecated functions, will be removed in future """ # def run_function(func, real_bufs, q): # func_beg = time.time() # func(*real_bufs) # func_end = time.time() # q.put((func_end - func_beg) * 1e3) # print("from process=",...
gotytv_thread_scraper.py
import bs4 from bs4 import BeautifulSoup import lxml import re import threading import requests import time import csv links = [] def link_scraper(count): # Obtaining links url = f"https://gotytv.com/tvseries?page={count}" html_data = requests.get(url).text soup = BeautifulSoup(html_data, "lxml")...