source
stringlengths
3
86
python
stringlengths
75
1.04M
sdbrute.py
#!/usr/bin/env python # -*- encoding: utf8 -*- ''' program: sdbrute author: 0xl00se time: 2017.5.1 ''' import linecache import threading import sys import optparse import requests def fileBlock(filename, num): lc = linecache.getlines(filename) lcLen = len(lc) step = lcLen / num threads = ...
contribute_engine.py
import json import os import random import shlex import shutil import subprocess import threading import time import traceback from collections import defaultdict from katrain.core.constants import OUTPUT_DEBUG, OUTPUT_ERROR, OUTPUT_INFO, OUTPUT_KATAGO_STDERR, DATA_FOLDER from katrain.core.engine import EngineDiedExce...
client3.py
import socket from threading import Thread sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('127.0.0.1', 8888)) def send_message(): while True: sock.send(input().encode('utf-8')) def receive_message(): while True: data = sock.recv(1024) print(data....
run.py
from __future__ import print_function import js2py from js2py.base import PyJsException, PyExceptionToJs from js2py.internals import seval from js2py.internals.simplex import JsException import os, sys, re, traceback, threading, ctypes, time, six from distutils.version import LooseVersion from node_eval import NodeJsEr...
clusterScalerTest.py
# Copyright (C) 2015-2021 Regents of the University of California # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
main.py
# -*- coding: UTF8 -*- import os import sys import logging import threading as th import sami def set_logging(func): def wrapper(*args, **kwargs): logging_level = logging.DEBUG logger = logging.getLogger() logger.setLevel(logging_level) formatter = logging.Formatter('%(asctime...
triggers.py
from datetime import timedelta, datetime from threading import Thread import threading from typing import Any import inspect from abc import ABC, abstractmethod from corvus.tools.time import quantize_time from typing import Callable class Event: """ Events are used to create a publish subscriber patte...
MapReduce1.py
''' Created on Apr 13, 2017 @author: dj ''' import os from threading import Thread class InputData(object): def read(self): raise NotImplementedError class PathInputData(InputData): def __init__(self, path): super().__init__() self.path = path def read(self...
dealerbase.py
"""data dealer interfaces""" # -*- coding:utf-8 -*- import queue import threading import traceback from abc import ABCMeta, abstractmethod from datacontract import DataMatcher, InputData from ..dbmanager.dbmanager import DbManager from .microservice import MicroService class DealerBase(MicroService): """decla...
baler.py
import ConfigParser import datetime as dt import gzip import json import logging import os import re import requests import sys import time import unicodecsv import threading from logger import get_logger from Queue import Queue logger = get_logger('baler') def tiq_output(reg_file, enr_file): config = ConfigPars...
client.py
from ..settings import SOCK_FILE import subprocess import socket import threading import json import sys import os import re from queue import SimpleQueue class Client: def __init__(self, listen=False, noconfig=False): self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.exit_flag ...
manager.py
import logging from multiprocessing import Value, Process, Manager import time import pantilthat as pth import signal import sys import numpy as np from rpi_deep_pantilt.detect.camera import PiCameraStream from rpi_deep_pantilt.detect.ssd_mobilenet_v3_coco import SSDMobileNet_V3_Small_Coco_PostProcessed, SSDMobileNet...
language_server.py
import enum import logging import os from snooty.lsp import CompletionItemKind import sys import threading from urllib.parse import urlparse from collections import defaultdict from dataclasses import dataclass from functools import wraps from pathlib import Path, PurePath from typing import ( Any, BinaryIO, ...
irc_client.py
import asyncio import logging import patterns import view import socket import threading import time import getpass import click logging.basicConfig(filename="client.log", level=logging.DEBUG) logger = logging.getLogger() class IRCClient(patterns.Subscriber): def __init__(self, host, port): super().__ini...
context.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...
workbench.py
# -*- coding: utf-8 -*- import ast import collections import importlib import logging import os.path import pkgutil import platform import queue import re import shutil import socket import sys import tkinter as tk import tkinter.font as tk_font import traceback from threading import Thread from tkinter import message...
train.py
#!/usr/bin/env python import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" import json import torch import numpy as np import queue import pprint import random import argparse import importlib import threading import traceback from tqdm import tqdm from utils import stdout_...
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...
AmbiGroup.py
# -*- coding: utf-8 -*- import datetime import os import time from threading import Thread, Event import xbmc import xbmcgui from PIL import Image from requests import ReadTimeout, ConnectionError from urllib3.exceptions import MaxRetryError from resources.lib import kodiHue, PROCESS_TIMES, cache, reporting, ADDONDIR...
sample_vnf.py
# Copyright (c) 2016-2017 Intel 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...
object_detection_multithreading.py
import os import cv2 import time import argparse import numpy as np import subprocess as sp import json import tensorflow as tf from queue import Queue from threading import Thread from utils.app_utils import FPS, HLSVideoStream, WebcamVideoStream, draw_boxes_and_labels from object_detection.utils import label_map_uti...
test_clientapp.py
import sys sys.path.append("yam") sys.path.append("../../yam") import config, clientapp, threading import time from devices import DevicePresenceBroadcaster, Device from player import LocalPlayer, RemotePlayer class TestClientApp: config.setConfigFolder('tests/config/') clientReceivedBroadcastMsg = False device =...
ssh_helper.py
"""ssh helper for starting remote dask scheduler""" from __future__ import print_function, division, absolute_import import os import socket import sys import time import traceback try: from queue import Queue except ImportError: # Python 2.7 fix from Queue import Queue import logging from threading import ...
dx_snapshot_db.py
#!/usr/bin/env python #Adam Bowen - Apr 2016 #This script snapshots a vdb or dSource #Corey Brune - March 2017 # Updated to allow backup of Sybase #requirements #pip install docopt delphixpy #The below doc follows the POSIX compliant standards and allows us to use #this doc to also define our arguments for the script...
Jarvis.py
import os import sqlite3 import os.path import sys, os import subprocess import datetime import socket import time import threading import requests import getpass import json import glob import psutil from random import randint if (sys.version_info > (3, 0)): from configparser import ConfigParser el...
addkline_csv.py
import pysnowball as ball import pandas as pd import tushare as ts import os import threading import time import datetime import argparse dir_path = os.path.dirname(os.path.abspath(__file__)) def parse_args(pargs=None): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatt...
agent_test.py
""" This file contains test cases to verify the correct implementation of the functions required for this project including minimax, alphabeta, and iterative deepening. The heuristic function is tested for conformance to the expected interface, but cannot be automatically assessed for correctness. STUDENTS SHOULD NOT...
test_writer.py
import os import socket import tempfile import threading import time import mock import pytest from ddtrace.compat import PY3 from ddtrace.compat import get_connection_response from ddtrace.compat import httplib from ddtrace.internal.uds import UDSHTTPConnection from ddtrace.internal.writer import AgentWriter from dd...
soundServer.py
#!/usr/bin/env python ################################################################################## #Copyright (c) 2016, Intel 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: # #1. ...
ipu_multi_worker_strategy_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...
extras.py
"""Very basic example script to inject a volume change event into Box Of Stops - this can be heard in the changing volume of the note - it can also be seen - look for the master volume changing in the browser interface See http://boxofstops.com/onlinehelp/Extras_script """ print("In extras") import boxofstops...
portable_runner.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...
stable_topology_fts.py
# coding=utf-8 import copy import json import random import time from threading import Thread import Geohash from membase.helper.cluster_helper import ClusterOperationHelper from remote.remote_util import RemoteMachineShellConnection from TestInput import TestInputSingleton from tasks.task import ESRunQueryCompare f...
state.py
""" The State Compiler is used to execute states in Salt. A state is unlike an execution module in that instead of just executing a command, it ensures that a certain state is present on the system. The data sent to the state calls is as follows: { 'state': '<state module name>', 'fun': '<state function name...
socket_client.py
""" Socket Client ============= """ from abots.helpers import eprint, cast, jots, jsto, utc_now_timestamp from struct import pack, unpack from socket import socket, timeout as sock_timeout from socket import AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR from ssl import wrap_socket from threading import Thread, E...
parallel_write.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script starts {nprocess} python processes in parallel, each process writes a local file stream into Alluxio. By default, each python process has an ID consecutively starting from 0 to {nprocess}. For each process, the local file data/5mb.txt is written to Alluxio ...
test_xmlrpc.py
import base64 import datetime import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import socket import os import re import io import contextlib from test import support try: import threading except ImportError: threading = N...
test_user_secrets.py
import json import os import subprocess import threading import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from test.support import EnvironmentVarGuard from urllib.parse import urlparse from datetime import datetime, timedelta import mock from google.auth.exceptions import DefaultCredentialsEr...
trezor.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, versiontuple, UserCancelled from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import deserialize_xpub from electrum import constants from electrum.i18n import _ from electrum.plugin import ...
grid_search.py
import json import logging import os import sys import argparse from multiprocessing import Process import urllib3 from influxdb import InfluxDBClient from classes.artificial_features import ArtificialFeatures from classes.features_analyzer import FeaturesAnalyzer from classes.inputs_gatherer import InputsGatherer fr...
firmware_update.py
# Copyright 2020-2021 AVSystem <avsystem@avsystem.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
utils.py
from collections import OrderedDict, defaultdict import contextlib import fnmatch import hashlib import json from locale import getpreferredencoding import libarchive import logging import logging.config import mmap import operator import os from os.path import (dirname, getmtime, getsize, isdir, join, isfile, abspath,...
dagger.py
#!/usr/bin/env python import rospy import sys import os import math import time import matplotlib.pyplot as plt from os import listdir from os.path import isfile, join from std_msgs.msg import Float32 from sensor_msgs.msg import Joy from sensor_msgs.msg import Image, CompressedImage from geometry_msgs.msg import Twist...
DBMgr.py
import pymongo import datetime import time import calendar import traceback from bson import ObjectId import json import pprint import copy from threading import Thread import sys #from past.builtins import xrange class MongoJsonEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import sys import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseM...
04_ipc.py
#!/user/bin/python3 # -*- coding: utf-8 -*- """ 进程间通信 Python的multiprocessing模块包装了底层的机制,提供了Queue、Pipes等多种方式来交换数据。 """ import os import random import time from multiprocessing import Process, Queue # 写数据进程执行的代码: def write(q): print('Process to write: %s' % os.getpid()) for value in ['A', 'B', 'C']: ...
tensorboard_manager.py
# -*- coding: utf-8 -*- import os import sys import threading import time import itertools from collections import namedtuple import logging import six sys.argv = ["tensorboard"] from tensorboard.backend import application # noqa try: # Tensorboard 0.4.x above series from tensorboard im...
gobject_worker.py
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*- ### BEGIN LICENSE # Copyright (C) 2010-2012 Kevin Mehall <km@kevinmehall.net> #This program is free software: you can redistribute it and/or modify it #under the terms of the GNU General Public License version 3, as published #by the Free Software Foundation...
Win8WriterThread.py
""" Copyright (C) 2018 Intel 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 writing, softw...
test_zmq_shell.py
""" Tests for zmq shell / display publisher. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from queue import Queue from threading import Thread import unittest from traitlets import Int import zmq from ipykernel.zmqshell import ZMQDisplayPublisher from jupy...
sspf.py
# straight spoof # dependencies python3, scapy, pip3, x-term, # arpspoof, tcpdump, dnsspoof, dhclient, macchanger, # ip, arp, arping, arptables, iptables # written by Synim Selimi from __future__ import absolute_import, division, print_function import logging logging.getLogger("scapy.runtime").setLevel(loggi...
kws_test.py
# !/usr/bin/env python # -*- coding:utf-8 _*- # @Author: swang # @Contact: wang00sheng@gmail.com # @Project Name: keyword_spotting_system # @File: test.py # @Time: 2021/11/11/21:51 # @Software: PyCharm import os import sys import time import random import warnings import numpy as np from copy import deepcopy import wav...
test_refleaks.py
"""Tests for refleaks.""" import gc from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob import threading import cherrypy from cherrypy import _cprequest data = object() def get_instances(cls): return [x for x in gc.get_objects() if isinstance(x, cls)] from cherrypy.test import helper class...
whale.py
from random import randint from dataclasses import dataclass from telnetlib import Telnet from time import sleep from datetime import datetime, timedelta from dataclasses import dataclass, field import argparse import yaml import sys import pyaudio import numpy as np import matplotlib.pyplot as plt from scipy import ...
helper.py
"""A library of helper functions for the Cheroot test suite.""" import datetime import io import logging import os import subprocess import sys import time import threading import types import portend import pytest import six import cheroot.server import cheroot.wsgi from cheroot._compat import HTTPSConnection, nto...
sc_func.py
# -*- coding: UTF-8 -*- import os import re import time import json import shutil import zipfile import threading from collections import OrderedDict class Singleton(object): """ 使用__new__实现抽象单例 """ def __new__(cls, *args, **kwargs): if not hasattr(cls, '_instance'): cls._instance = super(...
tcp_server.py
# Copyright 2017-2019 Nativepython 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...
Hiwin_RT605_ArmCommand_Socket_20190627194942.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 HiwinRA605_socket_TCPcmd as TCP import HiwinRA605_socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv imp...
postprocess_manager.py
# ----------------------------- __file__ = 'postprocess_manager.py' __doc__ = """ I-24 MOTION processing software. Top level process for live post-processing Spawns and manages child processes for trajectory fragment stitching and trajectory reconciliation. """ # ----------------------------- import multiprocessing as...
common.py
''' This is a extended unittest module for Kivy, to make unittests based on graphics with an OpenGL context. The idea is to render a Widget tree, and after 1, 2 or more frames, a screenshot will be made and be compared to the original one. If no screenshot exists for the current test, the very first one will be used. ...
main.py
from py_realdino import * from assistant_info import * from first_weather import * from second_weather import * import requests from bs4 import BeautifulSoup import time import schedule from auto_updating_naverWeather import * import threading def weather_init(): w_thread = threading.Thread(target=weather_main, a...
gui.py
import sys import os import shutil from PyQt4 import QtGui, QtCore from threading import Thread from tabbed_window import Ui_MainWindow import primes.utils.handles as handles from primes.utils.gl_pixdata import pixels_to_image from form_handler import FormHandler class StartGui(QtGui.QMainWindow): """This is th...
takeover.py
# -*- encoding: utf-8 -*- ''' @Time : 2021-08-07 @Author : EvilRecluse @Contact : https://github.com/RecluseXU @Desc : webdriver 接管操作系统启动的 Chrome ''' # here put the import lib from threading import Thread from os import popen from os.path import dirname, join as path_join from platform import system as...
test.py
import os.path as p import random import threading import time import pytest from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV from helpers.client import QueryRuntimeException from helpers.network import PartitionManager import json import subprocess import kafka.errors from kafka impor...
aem_hacker.py
#!/usr/bin/env python3 import concurrent.futures import itertools import json import datetime import traceback import sys import argparse import base64 import time from collections import namedtuple from http.server import BaseHTTPRequestHandler, HTTPServer from random import choice, randint from string import ascii_le...
test_socket_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 time import uuid from unittest import mock import parlai.core.testing_utils as testing_utils from...
attack_framework.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2020/9/17 09:41 # @Author : Dawnnnnnn # @Contact: 1050596704@qq.com import requests import hashlib import base64 from loguru import logger from config.config import receive_flag_server import threading import time import hmac import gzip import os logger.add...
client.py
import threading import json import tempfile from datetime import datetime import os # TODO Remove from this level. Abstract to unified non implementation specific client. from fedn.utils.dispatcher import Dispatcher import fedn.proto.alliance_pb2 as alliance import fedn.proto.alliance_pb2_grpc as rpc import grpc from ...
global_counter.py
import sys, os import threading sys.path.insert(0, os.path.abspath('..')) # root of the project from distcache.lru_cache import LRUCache lru_cache = LRUCache(100000) lru_cache.set("counter", 0) def function1(N=1000): for i in range(N): lru_cache.add("counter", 1) def test_counter(k=5, N=1000): th...
JoinWaitTimeOut.py
import threading import time import logging def daemon(): logging.debug('Starting') time.sleep(0.2) logging.debug('Exiting') def non_daemon(): logging.debug('Starting') logging.debug('Exiting') logging.basicConfig( level=logging.DEBUG, format='(%(threadName)-10s) %(message)s', ) d = t...
drEngine.py
# encoding: UTF-8 ''' 本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。 使用DR_setting.json来配置需要收集的合约,以及主力合约代码。 History <id> <author> <description> 2017050300 hetajen Bat[Auto-CTP连接][Auto-Symbol订阅][Auto-DB写入][Auto-CTA加载] 2017050301 hetajen DB[CtaTemplate增加日线bar数据获取接口][Mongo不保存Tick数据][新...
client.py
# Copyright (c) 2012-2019 Roger Light and others # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at # htt...
_serial.py
# Copyright (c) 2019 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: Pavel Kirienko <pavel@uavcan.org> import copy import typing import asyncio import logging import threading import dataclasses import concurrent.futures import serial import pyuavcan.transport from pyuavc...
main.py
from socket import * from peerbase import Node, ip from fastapi import FastAPI, staticfiles, responses, status from pydantic import BaseModel, ConfigError import threading import time import json import sys import os import logging from logging import debug, info, warning, error, critical from starlette.responses impor...
swarm.py
from threading import Thread, Barrier from queue import Queue from typing import List, Callable from .tello import Tello from .enforce_types import enforce_types @enforce_types class TelloSwarm: """Swarm library for controlling multiple Tellos simultaneously """ tellos: List[Tello] barrier: Barrier funcBarier: ...
utils.py
import itertools import shutil import sys import threading import time from pathlib import Path import imagehash import numpy as np from PIL import Image def getImagesFromPath(imgPath): """ Get all image files from given path :param imgPath Path: Path to directory of images """ imgFormats = [".gi...
views.py
from django.conf import settings from django.contrib.auth import logout as logout_func from django.http import HttpResponseRedirect from django.shortcuts import render, redirect from django.contrib import messages, auth from django.contrib.auth.models import User from django.urls import reverse from accounts.models imp...
utils.py
# Copyright 2019 Atalaya Tech, 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, ...
thermalpig.py
import threading import os import pigpio import sys from datetime import time as timestruct from datetime import datetime import dataclasses import struct import subprocess # structure for the event data # holds the sign of the change and the time of update @dataclasses.dataclass class EventData: """ datac...
imgur.py
# by larik import requests, string, urllib, random, os, urllib.request, threading try: from PIL import ImageFile except: print("Please install Pillow `python3 -m pip install pillow`") url_length = 6 # Imgur has moved to 7 character image names, # so changing this to 7 will get you newer images # but at a much slower ra...
subproc_env_vec.py
# Inspired from OpenAI Baselines import numpy as np from multiprocessing import Process, Pipe from tfrl.common.vec_env import VecEnv, CloudpickleWrapper from tfrl.common.tile_images import tile_images def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while T...
log.py
""" lantz.log ~~~~~~~~~ Implements logging support for Lantz. :copyright: 2012 by The Lantz Authors :license: BSD, see LICENSE for more details. """ import types import pickle import select import socket import struct import logging import threading from logging import DEBUG, INFO, WARNING, ER...
pipeline_step.py
import datetime import json import os import threading import time import traceback from abc import abstractmethod from enum import Enum, IntEnum import pytz import idseq_dag.util.command as command import idseq_dag.util.log as log import idseq_dag.util.s3 import idseq_dag.util.count as count from idseq_dag.util.cou...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from collections import OrderedDict import os import pickle import random import re import subprocess import sys import textwrap import threading import time import unitt...
donkey_sim.py
''' file: donkey_sim.py author: Tawn Kramer date: 2018-08-31 ''' import time from io import BytesIO import math import logging from threading import Thread import asyncore import base64 import numpy as np from PIL import Image from gym_donkeycar.core.fps import FPSTimer from gym_donkeycar.core.tcp_...
experiment.py
import random from threading import Thread from time import perf_counter import numpy as np class Experiment: def __init__(self, experiment_name, systems, n_reads, n_writes): self.experiment_name = experiment_name self.systems = systems self._current_system = None self.n_reads =...
main.py
from listingParser import parseListing from search import search import threading import queue if __name__ == "__main__": hrefs = search() que = queue.Queue() thread_list = [] for href in hrefs: t = threading.Thread(target=lambda que, href: que.put(parseListing(href)), args=(que, href)) t.start() ...
views.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from django.views.decorators.cache import cache_page from xml.etree import ElementTree as ET import threading import sys import datetime from django.http import HttpResponse from django.template import RequestContext from django.template import loader import socket socke...
miniterm.py
#!/usr/bin/env python # Very simple serial terminal # (C)2002-2011 Chris Liechti <cliechti@gmx.net> # Input characters are sent directly (only LF -> CR/LF/CRLF translation is # done), received characters are displayed as is (or escaped trough pythons # repr, useful for debug purposes) import sys, os, serial, thread...
PipelineOrchestrator.py
import os import subprocess import zipfile from threading import Thread from kuwala.common.python_utils.src.FileDownloader import download_file def download_demo(): script_dir = os.path.dirname(__file__) file_path = os.path.join(script_dir, f'../../../tmp/kuwala/db/postgres.zip') download_file(url='https:...
decode.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 Tomoki Hayashi (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import logging import math import os import sys import numpy as np import soundfile as sf import torch import torch.multiprocessing as mp from...
trustedcoin.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
__init__.py
# -*- coding: utf-8 -*- """JIRA utils used internally.""" from __future__ import unicode_literals import threading from jira.resilientsession import raise_on_error class CaseInsensitiveDict(dict): """A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableM...
test_EmbeddedR.py
import unittest import itertools import pickle import rpy2 import rpy2.rinterface as rinterface import sys, os, subprocess, time, tempfile, signal IS_PYTHON3 = sys.version_info[0] == 3 rinterface.initr() def onlyAQUAorWindows(function): def res(self): platform = rinterface.baseenv.get('.Platform') ...
check_mysql.py
#!/usr/bin/env python #coding:utf-8 import os import sys import string import time import datetime import traceback import MySQLdb import logging import logging.config logging.config.fileConfig("etc/logger.ini") logger = logging.getLogger("check_mysql") path='./include' sys.path.insert(0,path) import functions as func ...
test_controller.py
import json from multiprocessing import Process from unittest import mock import pytest import ujson from pytest_httpserver.httpserver import HandlerType from werkzeug.wrappers import Response from mite.__main__ import _controller_log_end, _controller_log_start from mite.__main__ import controller as main_controller ...
GenomeBrowserServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
stockgen.py
import random from random import seed from random import randint import csv import argparse import pymongo from pymongo import errors from datetime import date, timedelta, datetime as dt import threading import sys import json import os import time lock = threading.Lock() volatility = 1 # .001 #arrays used to stor...
multi_process.py
# -*- coding: utf-8 -*- # # Author: Daniel Garcia (cr0hn) - @ggdaniel # Github: https://github.com/cr0hn # import asyncio from multiprocessing import Process from threading import Thread, Event, BoundedSemaphore, currentThread class _ConcurrentManager(object): def __init__(self, n_process=2, n_threads=5, n_ta...
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...