source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
from __future__ import print_function import os import sys import random import traceback import pickle from keras.optimizers import RMSprop, Adam from scipy.stats import rankdata import math from math import log from models import * import argparse random.seed(42) import threading import tables import configs impor...
test_memento.py
import pytest import testUtil as ipwbTest from ipwb import replay from ipwb import indexer from ipwb import __file__ as moduleLocation from time import sleep import os import subprocess import urllib2 import random import string import re import sys from multiprocessing import Process p = Process() def getURIMsFrom...
IndexFiles_JD.py
#!/usr/bin/env python # -*- coding:utf-8 -*- INDEX_DIR = "IndexFiles.index" import sys, os, lucene, threading, time from datetime import datetime from bs4 import BeautifulSoup import jieba from java.io import File from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer from org.apache.lucene.analy...
test.py
from mapper import Listener from pynput.keyboard import Controller as KBctrl from pynput.mouse import Controller as MOUSEctrl, Button as MOUSEbtn from threading import Thread import time cursor_move_max_speed = 1000 cursor_move_reaction_time = 1 / 120 kb = KBctrl() mouse = MOUSEctrl() RS_pos = [0, 0] listen = Listene...
batch_ops_test.py
# Copyright 2017 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...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Online" def run(): app.run(host='0.0.0.0') def keep_alive(): t = Thread(target=run) t.start()
guide.py
from midca import goals, base from midca import midcatime from _goalgen import tf_3_scen, tf_fire from midca.domains.logistics import deliverstate from midca.domains.blocksworld import blockstate from midca.worldsim import stateread import copy,csv import random from midca.modules.monitors import Monitor from threading...
photos.py
# -*- coding: UTF-8 -*- from .core import * class Photos(object): def __init__(self, keywords=[], *args): self.keywords = keywords self.photos_queue = Queue() def _loadAlbumsPage(self, page_num): # url example: # pornhub.com/albums/female-straight?search=arg1+arg2 ...
__init__.py
import contextlib import datetime import errno import functools import inspect import os import re import signal import socket import subprocess import sys import tempfile import threading from collections import namedtuple from enum import Enum from warnings import warn import six import yaml from six.moves import co...
process_utils.py
from multiprocessing import Process def spawn_daemon_process(fn, call_args=(), call_kw=None): call_kw = call_kw or {} process = Process(target=fn, args=call_args, kwargs=call_kw) process.daemon = True process.start() return process
__main__.py
#!/usr/bin/env python3 ''' * Copyright (C) 2019 Intel Corporation. * * SPDX-License-Identifier: BSD-3-Clause ''' import sys import os import connexion import asyncio from openapi_server import encoder sys.path.append(os.path.dirname(__file__) + "/../../") from common.settings import CONFIG_PATH from common.settings ...
testnd.py
'''Statistical tests for NDVars Common Attributes ----------------- The following attributes are always present. For ANOVA, they are lists with the corresponding items for different effects. t/f/... : NDVar Map of the statistical parameter. p_uncorrected : NDVar Map of uncorrected p values. p : NDVar | None ...
screen_service.py
# # Copyright 2016-2018 Games Creators Club # # MIT License # import gccui import os import pyroslib import pygame import roverscreen import subprocess import spidev import time import threading import traceback from pyroslib.logging import log, LOG_LEVEL_ALWAYS, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG import RPi.GPIO as G...
WebServer.py
from TrivialFunctions import * import threading import sys, os, socket from socketserver import ThreadingMixIn from http.server import SimpleHTTPRequestHandler, HTTPServer class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): pass def threadedSimpleServer(): HOST = "0.0.0.0" PORT = 8080 CWD = os....
test_mturk_manager.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. import unittest import os import time import json import threading import pickle from unittest import mock from parlai.m...
train_entry_point.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "l...
mmjpg.py
#coding=utf-8 import requests from bs4 import BeautifulSoup import os import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions i...
processor.py
from colorama import Fore from glob import glob import collections import datetime import heg import heg.app import logging import multiprocessing as mp import os import pandas as pd EXPORT_DIR = './export' class Processor(heg.app.App): def __init__(self, arguments=[]): """ Keyword Arguments: ...
train_net.py
#!/usr/bin/env python # -------------------------------------------------------- # FCN # Copyright (c) 2016 RSE at UW # Licensed under The MIT License [see LICENSE for details] # Written by Yu Xiang # -------------------------------------------------------- """Train a Fully Convolutional Network (FCN) on image segmen...
tick_events.py
from api.packets import * from api.properties import * from api.entity import Entity, Player from api.vehicle import Vehicle from threading import Thread from multiprocessing import Process, Queue import pygame from copy import deepcopy import util def onTickGenerateWorld(game, deltaTime, tick): """ Event Ho...
RequestMini.py
import urllib.request, urllib.error, urllib.parse import urllib.request, urllib.parse, urllib.error import http.cookiejar from . import RequestPage from threading import Thread from urllib.parse import urlparse from urllib.parse import urlsplit, urlunsplit ERROR_CONNECTION = 2 ERROR_LOGIN = 1 ERROR_HTTP = 3 ...
stream_audio_class.py
""" Author: Martijn Eppenga Date: 20-02-2021 """ import os import sys import time import threading import matplotlib.pyplot as plt from matplotlib.widgets import Button import numpy as np import sounddevice as sd import keyboard # Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process clas...
test_service.py
from unittest import TestCase import threading import os import shutil import json import time import logging import requests import random from mock import Mock from samcli.local.apigw.service import Route, Service from tests.functional.function_code import nodejs_lambda, API_GATEWAY_ECHO_EVENT, API_GATEWAY_BAD_PROX...
tecent_comic_spider_chrome.py
#!/usr/bin/python # coding:utf-8 __Author__ = 'Adair.l' import datetime import selenium.webdriver from selenium.webdriver.chrome.options import Options import selenium.webdriver.common.keys as keys import selenium.common import time import urllib.request import os import threading class Spider(): def __init__(sel...
uploader.py
#!/usr/bin/env python import os import time import stat import json import random import ctypes import inspect import requests import traceback import threading import subprocess from collections import Counter from selfdrive.swaglog import cloudlog from selfdrive.loggerd.config import ROOT from common.params import ...
maxinet.py
#!/usr/bin/python """MaxiNet main file This file holds the main components of MaxiNet and is intended to be the only part of MaxiNet which needs to be used by the user or third-party applications. Classes in this file: Experiment: Use this class to specify an experiment. Experiments are created for one-time-usag...
test_multiprocessing.py
import os from threading import BrokenBarrierError import time from multiprocess.context import TimeoutError from multiprocess.managers import State import numpy as np import pytest from catkit.multiprocessing import Process, SharedMemoryManager TIMEOUT = 10 # Use a shorter timeout for testing. def test_child_exc...
snippet.py
""" Play an audio file with pyaudio while concurrently showing audio playhead on a matplotlib plot of the audio time series and spectrogram. Adjust duration and filename in the script below to reflect your audio file. v. 0.1 21 Mar 2012 Eric Bruning """ import matplotlib # matplotlib.use('MacOSX') import pyaudio ...
httpserver.py
import http.server import os import queue import shutil import socketserver import tempfile import threading from ..extern.RangeHTTPServer import RangeHTTPRequestHandler __all__ = ["HTTPServer", "RangeHTTPServer"] def run_server(tmpdir, handler_class, stop_event, queue): # pragma: no cover """ Runs an HTTP...
cwipc_grab.py
import sys import os import time import threading import time import argparse import traceback import queue import struct import numpy as np from PIL import Image from .. import cwipc_write, cwipc_write_debugdump, CwipcError, CWIPC_FLAGS_BINARY from ._scriptsupport import * class FileWriter: def __init__(self, pc...
camera.py
#!/usr/bin/env python # coding: utf-8 import time import atexit import weakref import pybullet import threading import numpy as np from qibullet.link import Link class CameraResolution: """ Enumeration of the camera resolutions """ def __init__(self, width, height): """ Constructor ...
callbacks_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Pubnub.py
## www.pubnub.com - PubNub Real-time push service in the cloud. # coding=utf8 ## PubNub Real-time Push APIs and Notifications Framework ## Copyright (c) 2014-15 Stephen Blum ## http://www.pubnub.com/ ## ----------------------------------- ## PubNub 3.7.1 Real-time Push Cloud API ## ----------------------------------...
pants_daemon.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
common.py
import os import pickle from multiprocessing import Event, Value, Lock from multiprocessing.synchronize import Event as EventClass from threading import Thread from typing import Optional, Tuple, Mapping from .base import measure_thread, killer_thread, read_all_from_bytes_stream, GeneralProcess from .decorator import ...
platform_manager.py
#!/usr/bin/env python3 import argparse import logging import os import re import socketserver import subprocess import threading import time import yaml def acquire(client, platform): with condition: queue = wait_queue[platform] thread = threading.current_thread() queue.append(thread) ...
portSweeper.py
#!/usr/bin/python3 import socket import ipaddress from queue import Queue import threading import argparse parser = argparse.ArgumentParser(description="Look for open ports on a host or range of hosts.") parser.add_argument('--iprange', help="Provide IP or IP range (CIDR notation).") parser.add_argument('--sport', he...
conftest.py
import asyncio import json import os import threading import time import typing import pytest import trustme from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import ( BestAvailableEncryption, Encoding, PrivateFormat, load_pem_private_key, ) from...
get-tweet-by-user.py
import got3 as got import json import threading import os from time import sleep import random output_files = os.listdir('./user-tweet') def main(user_list): for user in user_list: tweetCriteria = got.manager.TweetCriteria().setUsername(user).setSince('2019-02-18').setUntil('2019-02-24') tweets = ...
MKTerminal.py
#!/usr/bin/env python import sys, os, threading, time if sys.version_info >= (3, 0): def character(b): return b.decode('latin1') else: def character(b): return b class MKConsole(object): def __init__(self): self.fd = sys.stdin.fileno() def getkey(self): c = os.read(se...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import csv from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob # See https://en.wikipedia.org/wiki/ISO_4217 CCY_PRECISIONS = {'BHD': 3, 'BIF':...
cubiculo.py
# -*- coding: utf-8 -*- """ @author: anita """ from threading import Thread, Semaphore from time import sleep import random y = random.randint(1,7) x = random.randint(2,10) class alumno(Thread): def __init__(self, id, alumnos_cub, Sentrada = None, Spregunta = None, Srespuesta = None, Mpregunta = None): ...
plotproc_qt5.py
import multiprocessing as mp import matplotlib as mpl mpl.use("tkagg") import matplotlib.pyplot as plt #def _f_proc(q, **kwargs): # """Process target function""" # _Plotter(q, **kwargs) class _Plotter(mp.Process): """Core plotting object. Controlled by queue message.""" def __init__(self, q, **kwargs): ...
test_logging.py
# Copyright 2001-2021 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
swarmlib.py
#!/usr/bin/env python from __future__ import division import rospy import tf from geometry_msgs.msg import PoseStamped, TransformStamped, Twist from nav_msgs.msg import Path from math import * import math import time from time import sleep from std_srvs.srv import Empty from tf2_msgs.msg import TFMessage import messa...
websocket_client.py
# encoding: UTF-8 import json import ssl import sys import traceback import socket from datetime import datetime from threading import Lock, Thread from time import sleep import websocket class WebsocketClient(object): """ Websocket API After creating the client object, use start() to run worker and pi...
pre_commit_linter.py
# coding: utf-8 # # 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 requi...
application_runners.py
from __future__ import print_function import sys import os import uuid import shlex import threading import shutil import subprocess import logging import inspect import runpy import future.utils as utils import flask import requests from dash.testing.errors import ( NoAppFoundError, TestingTimeoutError, ...
common_utils.py
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from PRIMeval_remote import primer_run, upload_results, update_status from multiprocessing import Process from rq import Queue, Worker, Connection, get_failed_queue from rq.job import Job from rq.registry import FinishedJobRegistry import shutil import random im...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
signalrc.py
from logging import getLogger from threading import Thread from time import sleep from signalrc.ws_transport import WebSocketsTransport logger = getLogger('signalr.client') class SignalRClient: def __init__(self, url, hub, session=None): self.url = url self._invokes_counter = -1 self.tok...
notifications.py
#!/usr/bin/python # example: python notifications.py <SDK-Key> # This example shows how to use the notifications endpoint to stream notifications using Server-Sent Events import json import requests import sys import threading from sseclient import SSEClient def print_notifications(sdk_key): # SSEClient (https:/...
run2017_2.py
# -*- coding: utf-8 -*- """ This program is free software created by Athanasios Raptakis and Viacheslav Honcharenko during WS2017 Roboface robotics practical. We expanded the work of previous semester done by Letitia Parcalabescu in order to add Lip Articulation for Roboface. This program is free software: ...
executors.py
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug # Copyright: (c) <spug.dev@gmail.com> # Released under the AGPL-3.0 License. from channels.consumer import SyncConsumer from django_redis import get_redis_connection from libs.ssh import SSH import threading import socket import json class SSHEx...
trezor.py
import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path from electrum import constants...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
overwatcher.py
#!/usr/bin/python3 """ REVISION -------- Added revisions for overwatcher. This has nothing to do with actual versions of the code and is used to track major changes to force rechecks of old tests and maybe keeping them up to date as new modifiers and options appear. New revisions are kinda subjective, but for example n...
test_telnetlib.py
import socket import select import telnetlib import time import contextlib from unittest import TestCase from test import support threading = support.import_module('threading') HOST = support.HOST def server(evt, serv): serv.listen(5) evt.set() try: conn, addr = serv.accept() conn.close()...
steps.py
from lettuce import * import os import yaml import time import string import random import gearman import threading import subprocess as subps from scalrpy import util from sqlalchemy import and_ from sqlalchemy import desc from sqlalchemy import func from scalrpytests.steplib import lib BASE_DIR = os.path.dirnam...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
feature_extraction.py
import os import sys import multiprocessing as multiproc from copy import deepcopy import logging import argparse #import pickle import numpy as np from lib.timer import Timer #import pandas as pd from sklearn.neighbors import NearestNeighbors, KDTree import math import glob import ntpath import errno def calculate_fe...
ia.py
#! /usr/bin/env python __author__ = 'Sean Yu' '''created @2015/11/13''' import os, sys pardir = os.path.dirname(os.path.realpath(os.getcwd())) subfolder = ['lib', 'dut'] for sub in subfolder: libpath = os.path.sep.join([pardir, sub]) if libpath not in sys.path: sys.path.insert(0, libpath) import thread...
test_msvccompiler.py
"""Tests for distutils._msvccompiler.""" import sys import unittest import os import threading from distutils.errors import DistutilsPlatformError from distutils.tests import support from test.support import run_unittest SKIP_MESSAGE = None if sys.platform == "win32" else "These tests are only for win32" @unittest...
flow.py
"""Core Class for Flow.""" from multiprocessing import Process, Manager from multiprocessing.managers import BaseManager import sys import json from .node import Node EXEC_MODE_BATCH = "batch" EXEC_MODE_STREAMING = "streaming" class Path(object): def __init__(self, source_node, source_port, target_node, target_...
thread_tap.py
import os, sys, operator, socket,subprocess # import direct_injection_exec # from direct_injection_exec import * import printer from printer import * def write_temp_py_file(write_str): # generates a file named printer thread tap in the same TL directory of RSF as the injector rsf_PATH_local = '/usr/local/bin'...
generic_scada.py
import argparse import csv import os.path import random import signal import sqlite3 import sys import time from collections import OrderedDict from datetime import datetime from decimal import Decimal from pathlib import Path import yaml from minicps.devices import SCADAServer from py2_logger import get_logger imp...
views.py
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from .models import Subscription, Item, Analysis, AnalysisItem from django.core import serializers import json from django.views.decorators.csrf import csrf_exempt from .crawler import getItems import threading import msgSe...
test_generator_mt19937.py
import sys import hashlib import pytest import numpy as np from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_raises, assert_equal, assert_allclose, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings) from numpy.random import G...
ema_ipyparallel.py
""" This module provides functionality for combining the EMA workbench with IPython parallel. """ import collections import logging import os import shutil import socket import threading import zmq from ipyparallel.engine.log import EnginePUBHandler from jupyter_client.localinterfaces import localhost from traitlets ...
test_client.py
import asyncio from collections import deque from contextlib import suppress from functools import partial import gc import logging from operator import add import os import pickle import psutil import random import subprocess import sys import threading from threading import Semaphore from time import sleep import tra...
test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, temp_dir, requires_type_collecting, TESTFN, unlink, import_module) from test.support.script_helper import assert...
connect_manager.py
#!/usr/bin/env python # coding:utf-8 """ This file manage the ssl connection pool. For faster access the target host, ssl link will save to pool after use. and need keep alive every 60 seconds. We create multi-thread to try-connect google cloud ip. we also keep host connect for direct connect. every ssl connect ca...
realtime.py
import win32api import time import logging import os import yara from datetime import datetime from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from threading import Thread class Rules(): def get_rules(self,): rules_files = {} for root, dirs, files in ...
test_main.py
import threading import time import asyncio import requests from uvicorn.config import Config from uvicorn.main import Server def test_run(): class App: def __init__(self, scope): if scope["type"] != "http": raise Exception() async def __call__(self, receive, send): ...
memprofile.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2020 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
test_internal_files.py
import sys import os import unittest import itertools import time from array import array from weakref import proxy try: import threading except ImportError: threading = None from test import test_support from test.test_support import TESTFN, run_unittest from UserList import UserList class AutoFileTests(unit...
lisp-itr.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...
api.py
import abc import asyncio import contextlib import io import json import os import sys import tempfile import traceback import threading from typing import Dict, Optional from .util.types import PathLike from .util import jsoncomm __all__ = [ "API" ] class BaseAPI(abc.ABC): """Base class for all API provide...
ensemblelda.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Authors: Tobias Brigl <github.com/sezanzeb>, Alex Salles <alex.salles@gmail.com>, # Alex Loosley <aloosley@alumni.brown.edu>, Data Reply Munich # Copyright (C) 2021 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl...
category_reshaper.py
#!/usr/bin/env __author__ = 'Florian Hase' #======================================================================== import time import numpy as np import multiprocessing from multiprocessing import Process, Manager from gryffin.utilities import Logger from .kernel_prob_reshaping import KernelReshaper #=========...
server.py
"""Basic http server for tests to simulate PyPI or custom indexes """ import sys import time import threading from setuptools.compat import BaseHTTPRequestHandler from setuptools.compat import (urllib2, URLError, HTTPServer, SimpleHTTPRequestHandler) class IndexServer(HTTPServer): "...
cracke-dit.py
import sys, glob, os, argparse, itertools, time from threading import Thread, Event import ntds_parser as ntds, outputs from database import HashDatabase, DomainDoesntExist BANNER = """\033[91m __ ___ __ ______________ ______/ /_____ ____/ (_) /_ / ___/ ___/ __ `/ _...
quark_threaded_runtime.py
# Quark's Threaded Runtime from __future__ import print_function __version__ = '0.4.2' from past.builtins import unicode, long import atexit import os import sys import threading import contextlib import time import traceback # future stdlib stuff is broken: https://github.com/PythonCharmers/python-future/issues/2...
network.py
import json from threading import Thread import socket import select import time import os import argparse from PyQt5.QtCore import * from os import path from clingo.symbol import parse_term class VisualizerSocket(object): def __init__(self, default_host = '127.0.0.1', default_port = 5000, socket_name = 'socket')...
donkey_sim.py
# Original author: Tawn Kramer import asyncore import base64 import math import time from io import BytesIO from threading import Thread import numpy as np from PIL import Image from config import INPUT_DIM, ROI, THROTTLE_REWARD_WEIGHT, MAX_THROTTLE, MIN_THROTTLE, \ REWARD_CRASH, CRASH_SPEED_WEIGHT ...
threaded.py
import threading import time from enum import Enum from queue import Empty, LifoQueue, Queue import cv2 import keyboard import numpy as np import tensorflow as tf class Key(Enum): UP = "up" DOWN = "down" LEFT = "left" RIGHT = "right" class DetectorAPI: def __init__(self, path_to_ckpt): ...
installwizard.py
# -*- mode: python3 -*- import os import random import sys import tempfile import threading import traceback import weakref from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electroncash import keystore, Wallet, WalletStorage from electroncash.network import Network from electro...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including witho...
sniffer_ip_header_decode.py
import threading import time import socket import os import struct from ctypes import * from netaddr import IPNetwork,IPAddress host = "192.168.88.1" subnet = "192.168.88.1/24" magic_message = "PYTHONRULES" def udp_sender(subnet,magic_message): time.sleep(5) sender = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) ...
PiCapture.py
#!/usr/bin/python import os import sys import time import glob import shutil import argparse import datetime import threading import subprocess logOnConsole = False def log(str): global logOnConsole if logOnConsole: print str def initializeDir(dirname): if not os.path.isdir(dirname): os.makedirs(dirname) log...
windows.py
from ...third_party import WebsocketServer # type: ignore from .configurations import ConfigManager from .configurations import WindowConfigManager from .diagnostics import ensure_diagnostics_panel from .logging import debug from .logging import exception_log from .message_request_handler import MessageRequestHandler ...
main.py
# coding=utf-8 import os import sys from selenium.webdriver import DesiredCapabilities import xml.etree.ElementTree as ET from threading import Thread from SRC.common.configFactory import ConfigFactory from SRC.common.const import Agent, RunType from SRC.common.config import EasyConfig from SRC.unittest.scene import Sc...
test_firehose.py
# pylint: disable=C0103,C0111,C0302,W0212 import datetime import pytest import numpy as np import quasardb import quasardb.firehose as qdbfh import test_batch_inserter as batchlib import time import itertools import multiprocessing from sys import platform def _ensure_timeout(f, timeout=3): # HACKS(leon): apparen...
client1.py
# livestatus port number : 12121 # broadcasting port number : 44444 # addFile() sharing port : 44445 # supernode to supernode communication PORT : 9999 # filelist listen from supernode on PORT 9001 # filename send to supernode on PORT 9002 # ipaddress for file downloading on PORT 9003 # Request Handler running on Port ...
assets.py
import binascii import logging import os import shutil import threading from concurrent.futures import ThreadPoolExecutor, wait from pathlib import Path from flask import Blueprint, current_app, render_template, request from s2_data.assets.assets import (EXTRACTED_DIR, KNOWN_ASSETS, OVERRIDES_DIR, ...
TWCManager.py
#! /usr/bin/python3 ################################################################################ # Code and TWC protocol reverse engineering by Chris Dragon. # # Additional logs and hints provided by Teslamotorsclub.com users: # TheNoOne, IanAmber, and twc. # Thank you! # # For support and information, please re...
touch_screen.py
import logging import os import traceback from threading import Thread from mopidy import core, exceptions import pygame import pykka from .screen_manager import ScreenManager logger = logging.getLogger(__name__) class TouchScreen(pykka.ThreadingActor, core.CoreListener): def __init__(self, config, core): ...
UserView.py
import simplejson, os,datetime import time from flask_mail import Message,Mail from flask_paginate import Pagination, get_page_parameter from flask_mail import Message from threading import Thread from ..model.forms import * from ..model.users import User from werkzeug.utils import secure_filename from flask_restf...
example_2_multiprocessing_ai_to_ao.py
# -*- coding: utf-8 -*- """ Created on Tue Aug 24 22:19:48 2021 @author: devoo """ import multiprocessing as mp import json import ni_daq_analog_in_out_module as aio def hardware_loop(settings: dict): """ This function is run in a different process for optimal stability and speed. It handles all the h...