source
stringlengths
3
86
python
stringlengths
75
1.04M
tuq_sanity.py
import datetime import json import math import random import re import time import threading from datetime import date from deepdiff import DeepDiff from membase.api.exception import CBQError from membase.api.rest_client import RestConnection from remote.remote_util import RemoteMachineShellConnection from collection....
server.py
import sys print(sys.path[0]) sys.path.append(sys.path[0] + '/../..') import socketserver import threading from time import sleep from NetworkVersion.Server.protocal import Protocol from NetworkVersion.game_manager import GameManager from NetworkVersion.utils import Action, Player_State g_conn_pool = [] # 连接池 rea...
autoSubmitter.py
from __future__ import print_function import configparser as ConfigParser import argparse import shelve import sys import os import subprocess import threading import shutil import time import re from helpers import * shelve_name = "dump.shelve" # contains all the measurement objects history_file = "history.log" clock...
test_xmlrpc.py
import base64 import datetime import sys import time import unittest import xmlrpclib import SimpleXMLRPCServer import threading import mimetools import httplib import socket import StringIO import os from test import test_support try: unicode except NameError: have_unicode = False else: have_unicode = Tru...
Thread_test.py
import threading import time class MyThread(threading.Thread): def __init__(self, target, args): self.target = target self.args = args threading.Thread.__init__(self) def run(self): add1(self.args) # time.sleep(1) print('Im {}'.format(self.name)) def add1(X):...
video.py
import subprocess as sp import os import cv2 import numpy as np import threading import socket import struct import io import config from video.detection import BallDetector class VideoPlayer: def __init__(self, detection): self.video_port = config.video_port self.detection = detection ...
keyboardCommand.py
# # Tello Python3 Control Demo # # http://www.ryzerobotics.com/ # # 1/1/2018 import threading import socket import sys import time host = '' port = 9000 locaddr = (host,port) # Create a UDP socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) tello_address = ('192.168.10.1', 8889...
common.py
"""Test the helper method for writing tests.""" import asyncio import os import sys from datetime import timedelta from unittest.mock import patch, MagicMock from io import StringIO import logging import threading from contextlib import contextmanager from aiohttp import web from homeassistant import core as ha, load...
core.py
########################################################## # pytorch-kaldi v.0.1 # Mirco Ravanelli, Titouan Parcollet # Mila, University of Montreal # October 2018 ########################################################## import sys import configparser import os from utils import is_sequential_dict, model_init, optim...
extract_pdf.py
from download.spiders import download_pdfs from utils import constants from gui import scroll_frame from extraction import adobe_json import fitz, logging, multiprocessing from tkinter import * from tkinter import font, filedialog, messagebox from tkinter.ttk import Progressbar from functools import partial class Ext...
measure.py
import matplotlib.pyplot as plt import matplotlib.patches as mpatches import re import signal import sys import threading import serial from time import gmtime from time import strftime signal.signal(signal.SIGINT, lambda sig, frame: plt.close('all')) readed_line_regex = re.compile('^(?P<time>[0-9.]+?) (?P<current>[0-...
apiConnector.py
""" Created on Mär 18 10:31 2019 @author: nishit """ import datetime import time import json import threading from abc import abstractmethod from queue import Queue from random import randrange import requests from senml import senml from IO.MQTTClient import MQTTClient from utils_intern.messageLogger import Messag...
__init__.py
import requests, threading, asyncio class Threads: def newThread(function, args=()): new_thread = threading.Thread(target=function, args=args) # error handle threads so they output into log file new_thread.start() return new_thread def postGuildCount(guild_count: str, token: str, threaded=True): # runs in back...
spark_model.py
from __future__ import absolute_import from __future__ import print_function import numpy as np from itertools import tee import socket from multiprocessing import Process import six.moves.cPickle as pickle from six.moves import range from flask import Flask, request try: import urllib.request as urllib2 except Im...
__init__.py
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # nimvelo/stream/__init__.py # Python 2.7 client library for the Nimvelo/Sipcentric API # Copyright (c) 2015 Sipcentric Ltd. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php import multiprocessing import requests import time import log...
Crawler_album_douban.py
#coding:utf-8 from __future__ import print_function from bs4 import BeautifulSoup import multiprocessing import urllib import re import os import time def Filter_input(inputlist): charlist = set(inputlist.split()) numlist = [] def is_number(char): try: int(char) return True except ValueError: return ...
p_bfgs.py
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
sanitylib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
GeneSeekr_tblastx.py
#!/usr/bin/env python3 from olctools.accessoryFunctions.accessoryFunctions import printtime, run_subprocess, write_to_logfile, make_path, \ combinetargets, MetadataObject, GenObject, make_dict from genemethods.assemblypipeline.GeneSeekr import GeneSeekr from Bio.Blast.Applications import NcbitblastxCommandline from...
utils.py
import logging from threading import Thread from django.utils import timezone from slacker import Slacker from slacksocket import SlackSocket def background(function): def decorator(*args, **kwargs): t = Thread(target=function, args=args, kwargs=kwargs) t.daemon = True t.start() retu...
pi_sensor_worker.py
import time import datetime import json import redis import threading import sys sys.path.append('..') from sensors.pi.float_sensor import (FloatSensor) from sensors.pi.humidity_sensor import (HumiditySensor) from sensors.pi.temperature_sensor import (TemperatureSensor) from sensors.pi.soil_sensor import (SoilSensor) ...
train.py
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import time import multiprocessing as mp from torch.autograd import Variable from utils import * def LC_Train(lower_network, upper_network, local_network, train_loader, test_lo...
mssqli-duet-plugin.py
#Import Burp Objects from burp import IBurpExtender, IBurpExtenderCallbacks, ITab, IContextMenuFactory, IMessageEditorTab, IMessageEditorController, IHttpRequestResponse #Import Java GUI Objects from java.awt import Dimension, FlowLayout, Color, Toolkit from java.awt.datatransfer import Clipboard, StringSelection from ...
process_parallelizer.py
import multiprocessing from typing import List from parallelizer.executor import Executor from parallelizer.executor_event import ExecutorEvent from parallelizer.parallelizer import Parallelizer class ProcessParallelizer(Parallelizer): def __init__(self, number_of_threads: int, timeout_in_seconds: float = 60): ...
run_fuzz_multiprocess_main.py
# Lint as: python3 # # Copyright 2020 The XLS 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...
dns_spoof.py
# dns_spoof.py # # Design and Program: Vishav Singh & Manuel Gonzales # # functions: # # def signal_handler(signum, frame) # def sniffer() # def get_address(interface, ip) # def start_mitm(interface, victim, gateway) # def parse(packet) # def redirectionRules(victim) # def getWebIP(website) # def main() # # Pro...
rt605_arm_control_api.py
#!/usr/bin/python # -*- coding: UTF-8 -*- import rospy import sys import time import numpy as np import os import datetime from ctypes import * import rospy from enum import Enum import threading from control_node.msg import robot_info # Init the path to the Hiwin Robot's SDK .dll file CURRENT_FILE_DIRECTORY = os.path...
process.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import, with_statement import copy import os import sys import time import errno import types import signal import logging import threading import contextlib import subprocess import multiprocessing import multiprocessing.util # Import salt...
project.py
import os import time import logging import threading import numpy as np import pandas as pd from datetime import datetime from typing import Optional, List, Dict from doppel.aws.ec2 import Ec2Client, Ec2 from doppel.aws.s3 import S3Bucket, S3Client from doppel.aws.iam import IamClient, Policy from doppel.ssh import S...
bot.py
from telegram.ext import CommandHandler, MessageHandler, CallbackQueryHandler, Filters from work_materials.globals import updater, dispatcher, castles as castles_const, classes_list as classes_const,\ conn, cursor, admin_ids import work_materials.globals as globals from libs.start_pult import rebuild_pult from bi...
main.py
import tkinter import cv2 import PIL.Image, PIL.ImageTk from functools import partial import threading import imutils import time stream = cv2.VideoCapture("./video/clip.mp4") flag = True def play(speed): global flag print(f"You clicked on play. Speed is {speed}") # Playing the video frame1 = stream.g...
ffmpeg_pipeline.py
''' * Copyright (C) 2019-2020 Intel Corporation. * * SPDX-License-Identifier: BSD-3-Clause ''' import string import shlex import subprocess import time import copy from threading import Lock from threading import Thread import shutil import re from collections import OrderedDict from collections import namedtuple from...
nuc.py
from __future__ import print_function from __future__ import division import sys import getopt import struct from functools import partial import operator import array import copy import time import re if sys.version_info[0] < 3: input = raw_input sys.path.append("../shell") import swapforth def truth(pred): ...
tests.py
from itertools import cycle from threading import Thread import queue from django.test import TestCase from bulk_saving.models import BulkSavableModel from testapp.models import ( Bulky, Foreign ) class BulkSavableModelTestCase(TestCase): def test_bulk_create_and_update(self): foreign1 = Forei...
IoManager.py
############################################################################### # Project: PLC Simulator # Purpose: Class to encapsulate the IO manager functionality # Author: Paul M. Breen # Date: 2018-07-17 ############################################################################### import logging import thre...
timeout.py
from multiprocessing import Process, Pipe class Timeout: def __init__(self, func, timeout): self.func = func self.timeout = timeout def __call__(self, *args, **kargs): def pmain(pipe, func, args, kargs): result = None try: result = func(*args, ...
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...
dynamixel_serial_proxy.py
# -*- coding: utf-8 -*- # # Software License Agreement (BSD License) # # Copyright (c) 2010-2011, Antons Rebguns. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source...
agent.py
#!/usr/bin/env python # # AzureMonitoringLinuxAgent Extension # # Copyright 2019 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
server.py
import socket from threading import Thread # server's IP address SERVER_HOST = "0.0.0.0" SERVER_PORT = 5002 # port we want to use separator_token = "<SEP>" # we will use this to separate the client name & message # initialize list/set of all connected client's sockets client_sockets = set() # create a TCP s...
threaded_queues.py
import csv import queue import threading class ThreadedQueue(queue.Queue): """Abstract implementation of a multi-threaded queue processor To implement a concrete multi-threaded queue processor based on ThreadedQueue, the following methods must be implemented: process_item(item) """ def __init__(self, threads, ...
rtorrent.py
import datetime import os import re import requests import threading import xmlrpc.client from pathlib import Path from typing import List, Optional from platypush.context import get_bus from platypush.plugins import action from platypush.plugins.torrent import TorrentPlugin from platypush.message.event.torrent impor...
Implement.py
import time import threading import Input_module from Analyzer import Analyzer import Output_Module def process(): # user_id, age, gender, heartrate, Systolic_BP, Diastolic_BP, blood_oxygen, temperature, time): #def __init__(self, Systolic_BP, Diastolic_BP, Heart_Rate, Heart_Oxy_Level, Body_temp): data=In...
osc_receive.py
#!/usr/bin/python import OSC import time, threading # tupple with ip, port. receive_address = '127.0.0.1' , 7000 # OSC Server. s = OSC.OSCServer(receive_address) # this registers a 'default' handler (for unmatched messages), # an /'error' handler, an '/info' handler. # And, if the client supports it, a '/subsc...
btccpro_okspot.py
import logging import config import time from .observer import Observer from .emailer import send_email from fiatconverter import FiatConverter from private_markets import okcoincny,btccprocny import os, time import sys import traceback from .basicbot import BasicBot # python3 arbitrage/arbitrage.py -oBTCCPro_OkSpot -...
DynamicEventLoop.py
import asyncio import threading class DynamicEventLoop: '''Creating a thread runs the event loop that can insert coroutine dynamically. ''' def __init__( self, loop: asyncio.AbstractEventLoop = None, thread: threading.Thread = None ): 'Define a loop and run it in a sep...
backend.py
#SPDX-License-Identifier: MIT """ Augur library commands for controlling the backend components """ from copy import deepcopy import os, time, atexit, subprocess, click, atexit, logging, sys import psutil import signal import multiprocessing as mp import gunicorn.app.base from gunicorn.arbiter import Arbiter from aug...
moto_alarm.py
import os import cv2 import time, datetime import mrcnn import mrcnn.config import mrcnn.utils import queue import threading import numpy as np import winsound from mrcnn.model import MaskRCNN from mrcnn import visualize from pathlib import Path VIDEO_SOURCE = "./assets/sample1.mp4" # put here URL to the video stream ...
core.py
#!/usr/bin/env python2 # core.py # # This file contains the main class of the framework which # includes the thread functions for the receive and send thread. # It also implements methods to setup the TCP connection to the # Android Bluetooth stack via ADB port forwarding # # Copyright (c) 2020 The InternalBlue Team. ...
util.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights t...
test_errcodes.py
#!/usr/bin/env python # test_errcodes.py - unit test for psycopg2.errcodes module # # Copyright (C) 2015 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software ...
network.py
# Electrum - Lightweight Bitcoin Client # Copyright (c) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the ri...
main.py
import tkinter import cv2 # pip install opencv-python import PIL.Image # pip install pillow import PIL.ImageTk # pip install pillow from functools import partial import threading import time import imutils stream= cv2.VideoCapture('Decision Review System/clip.mp4') flag = True def play(speed): global flag ...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper from test.support import warnings_helper import sock...
05_py_thread_id.py
""" py thread id """ import threading def do_it() -> None: print("did it") print(threading.get_ident()) print(threading.current_thread().name) thread1 = threading.Thread(target=do_it, name="thread1") thread1.start(); thread2 = threading.Thread(target=do_it, name="thread2") thread2.start(); thread1.jo...
indexer.py
import datetime import json import hashlib import logging import multiprocessing import time from dataclasses import asdict from queue import Queue from threading import Thread from typing import Dict, List, Callable, Set from redis import ResponseError import redis.exceptions from redisearch.query import Query import...
simulator.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: simulator.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import tensorflow as tf import multiprocessing as mp import time import os import threading from abc import abstractmethod, ABCMeta from collections import defaultdict import six from six.moves import queue imp...
ready_loop.py
# Called when the bot is ready to be used import asyncio import datetime import sqlite3 import threading import time import discord import flask from Data.Constants.import_const import Login, Ids, Main_bot, Useful from Script.import_emojis import Emojis if Main_bot: discord_token = Login["discord"]["token"] els...
vtouch_indicator.py
# Copyright (c) 2020-2021, NVIDIA 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 agre...
backend.py
from thonny.common import ( InputSubmission, InterruptCommand, EOFCommand, parse_message, ToplevelCommand, ToplevelResponse, InlineCommand, InlineResponse, UserError, serialize_message, BackendEvent, ValueInfo, execute_system_command, ) import sys import logging impor...
multithreading.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jul 1 00:21:21 2018 @author: arthur """ from Queue import Queue import numpy as np from threading import thread # # def encoder(): leitura = random.randint(0,50) print("Encoder: " + str(leitura) + " km/h") def ultrassom(): for i in ...
thread_old.py
import pdb pdb.set_trace() import threading def myfunc(i): print "sleeping 5 sec from thread %d" % i #for i in range(10): t = threading.Thread(target=myfunc, args=(1,)) t.start()
route.py
#!/usr/bin/env python """Route messages between clients. \ Tested with Python 2.7.6""" ##### Imports ##### from threading import Thread from sys import argv from socket import ( socket, AF_INET, SOCK_STREAM, SOL_SOCKET, SHUT_RDWR, SO_REUSEADDR, gethostname, ) from argparse import ( ArgumentParser...
daemon.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...
atari_wrappers.py
import gym import numpy as np from collections import deque from PIL import Image from multiprocessing import Process, Pipe # atari_wrappers.py class NoopResetEnv(gym.Wrapper): def __init__(self, env, noop_max=30): """Sample initial states by taking random number of no-ops on reset. No-op is assume...
lisp.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...
network.py
""" Copyright (c) 2015 SONATA-NFV ALL RIGHTS RESERVED. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to...
campaign.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/tabs/campaign.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # not...
test_dispatcher.py
import numpy as np import threading from numba import cuda, float32, float64, int32, int64, void from numba.cuda.testing import skip_on_cudasim, unittest, CUDATestCase import math def add(x, y): return x + y def add_kernel(r, x, y): r[0] = x + y @skip_on_cudasim('Dispatcher objects not used in the simula...
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 ...
dist_autograd_test.py
import sys import threading import time import unittest from enum import Enum import random import torch from datetime import timedelta import torch.distributed as dist import torch.distributed.autograd as dist_autograd import torch.distributed.rpc as rpc import torch.testing._internal.dist_utils from torch.autograd im...
invoker.py
# # (C) Copyright IBM Corp. 2019 # # 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 writi...
encoder.py
#!/usr/bin/env python3 # # Copyright (c) 2014-2016 Hayaki Saito # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, ...
run_second_thread.py
from queue import Queue import threading from time import sleep def worker(batch_queue): i = batch_queue.get() while i is not None: print('WORKER: I am worked on work {}'.format(i)) sleep(3) i = batch_queue.get() def upload(i, batch_queue): print('This is {} work'.format(i)) b...
test_ca.py
import numpy as np import threading from pycrazyswarm import * from time import sleep, ctime import scipy as sp radii = 0.7 class Waypoint: def __init__(self, agent, x, y, z, arrival, duration): self.agent = agent self.x = x self.y = y self.z = z self.arrival ...
reload.py
import sublime import sublime_plugin import os import posixpath import threading import builtins import functools import importlib import sys from inspect import ismodule from contextlib import contextmanager from .debug import StackMeter try: from package_control.package_manager import PackageManager def is...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ...
network.py
import imp import time import random from node_stub import NodeStub import asyncio from threading import Thread, Lock import queue import sys import logging THREAD_COUNT = 10 STR_SEPARATOR = ',' class Task: def __init__(self, node, function_name, args): self.node = node self.function_name = functi...
watch.py
import asyncio import os import signal import sys from multiprocessing import Process from aiohttp import ClientSession from watchgod import awatch from ..exceptions import AiohttpDevException from ..logs import rs_dft_logger as logger from .config import Config from .serve import WS, serve_main_app, src_reload cla...
pathplanner.py
from numpy.linalg import svd, det import multiprocessing as mp from module.camera import * import numpy as np from threading import Thread import module.config as conf class PathFinder: def __init__(self, car): self.cam = None self._car = car self._camera_offset = self._car.size[2] - self...
eureka_client.py
# -*- coding: utf-8 -*- """ Copyright (c) 2018 Keijack Wu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,...
ChipBluezMgr.py
# # Copyright (c) 2020 Project CHIP Authors # Copyright (c) 2019-2020 Google LLC. # Copyright (c) 2015-2018 Nest Labs, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
test_main.py
import sys import signal import threading import asyncio from copy import deepcopy import aiohttp import conf_loader import notifier import bili_sched import printer import bili_statistics from console_cmd import ConsoleCmd from tasks.login import LoginTask from tasks.live_daily_job import (HeartBeatTask, OpenSilverBox...
handle.py
import sys import threading from abc import ABCMeta, abstractmethod from collections import namedtuple import six from dagster import check from dagster.api.list_repositories import sync_list_repositories_grpc from dagster.core.definitions.reconstructable import repository_def_from_pointer from dagster.core.errors imp...
app.py
#coding: utf-8 from youey.view import * import json, os from urllib.parse import unquote import platform platf = platform.platform() webview_provider = 'Pythonista' if 'iPhone' in platf or 'iPad' in platf else 'pywebview' class AppBase(View): def __init__(self, title='Youey App', fullscreen=None): self.root = ...
test_serialization.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
meterpreter.py
#!/usr/bin/python # vim: tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab import binascii import code import os import platform import random import re import select import socket import struct import subprocess import sys import threading import time import traceback try: import ctypes except ImportError: has_windl...
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 threading import time import errno import unittest from unitt...
eventEngine.py
# encoding: UTF-8 ''' VNPY的事件引擎原有两版,一个用QTimer计时,一个用子线程计时 这里选择了子线程的版本 ''' # 系统模块 from queue import Queue, Empty from threading import Thread from collections import defaultdict from time import sleep EVENT_TIMER = 'eTimer' ######################################################################## class EventEngine(ob...
outlierDetection.py
#-*- coding: utf8 ''' Created on Aug 9, 2016 @author: zahran ''' #from __future__ import division, print_function from scipy.stats import chisquare from collections import OrderedDict from multiprocessing import Process, Queue import pandas as pd #import plac import numpy as np import math import os.path from MyEnum...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import subprocess import struct import operator import p...
app.py
#!/usr/bin/env python3 """ Duino-Coin REST API © MIT licensed https://duinocoin.com https://github.com/revoxhere/duco-rest-api Duino-Coin Team & Community 2019-2021 """ import gevent.monkey gevent.monkey.patch_all() from wrapped_duco_functions import * from Server import ( now, SAVE_TIME, POOL_DATABASE, CONFIG_WHI...
Tests.py
""" Что то подобие тестов. TODO: Надо переделать """ import threading from DB.DataBasePG import DataBasePg from HseUtils.HseTelegram import HseTelegram from Settings import SettingsTelegram from Telegram import TelegramApi from Utils.logging import Logging from Utils.statics import Statics from Utils.utils import Utils...
oper.py
#!/usr/bin/python # -*- coding: utf-8 -* # Copyright: [CUP] - See LICENSE for details. # Authors: Zhao Minghao, Guannan Ma """ :description: shell operations related module """ from __future__ import print_function import os import sys import time import uuid import tempfile import shutil import signal import rand...
GuiUtils.py
import queue import threading import tkinter as tk import traceback from Utils import data_path, is_bundled def set_icon(window): er16 = tk.PhotoImage(file=data_path('ER16.gif')) er32 = tk.PhotoImage(file=data_path('ER32.gif')) er48 = tk.PhotoImage(file=data_path('ER48.gif')) window.tk.call('wm', 'ico...
user_owned_games.py
import requests import time import json import threading import queue import yaml from sqlalchemy import create_engine from sqlalchemy.types import BigInteger, Integer import pandas as pd def split_list(l, n): for i in range(0, len(l), n): yield l[i:i + n] def worker_get_owned_games(lst_user_id, api_key,...
tcp.py
""" TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" """ import errno import logging import os import queue import socket import threading import time import traceback import urllib.parse import salt.crypt import salt.exceptions import salt.ext.tornado import salt.e...
parameter_dialog.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code mus...
test_singletonperthread.py
import uuid from multiprocessing import Queue from threading import Thread, currentThread from azurelinuxagent.common.singletonperthread import SingletonPerThread from tests.tools import AgentTestCase, clear_singleton_instances class TestClassToTestSingletonPerThread(SingletonPerThread): """ Since these test...
code.py
# Copyright (c) 2011-2020 Eric Froemling # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...