source
stringlengths
3
86
python
stringlengths
75
1.04M
client.py
#!python import socket import threading def chatInput(connection): while True: text = input() connection.sendall(text.encode()) def chatMessage(connection): while True: data = connection.recv(1024) print(f"{data.decode()}") if data.decode() == "shutdown": ...
test_lib.py
#!/usr/bin/env python """A library for tests.""" from __future__ import division import codecs import datetime import email import functools import logging import os import pdb import platform import shutil import socket import sys import tempfile import threading import time import unittest from builtins import ran...
conftest.py
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2014 Sean Vig # Copyright (c) 2014-2015 Tycho Andersen # # 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 Soft...
test.py
#!/usr/bin/python3 # this file is part of shus. # # Copyright (c) 2015 Dima Krasner # # 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...
test_exception.py
import time import threading import logging import pyautogui from balsa import get_logger, Balsa, __author__, traceback_string from test_balsa import enter_press_time def press_enter(): for _ in range(0, 2): time.sleep(enter_press_time) pyautogui.press('enter') def test_balsa_exception(): ...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from functools import reduce from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos impor...
runtime_car.py
import setup_path import airsim import time import sys import threading def runSingleCar(id: int): client = airsim.CarClient() client.confirmConnection() vehicle_name = f"Car_{id}" pose = airsim.Pose(airsim.Vector3r(0, 7*id, 0), airsim.Quaternionr(0, 0, 0, 0)) print(f"Crea...
quantize_tiny-yolov2-my.py
#!/usr/bin/env python # -------------------------------------------------------- # Quantize Fast R-CNN based Network # Written by Chia-Chi Tsai # -------------------------------------------------------- """Quantize a Fast R-CNN network on an image database.""" import os os.environ['GLOG_minloglevel'] = '2' from fast...
multissh.py
#file: multissh.py #description: A tool for doing multiple ssh connections at one #author: @mastahyeti from ssh_exceptions import * from traceback import print_exc from Queue import Queue,Empty from copy import copy from time import time import paramiko import threading import socket import random #...
test_ibmq_job.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 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...
settings_20210906110737.py
""" Django settings for First_Wish project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathli...
server.py
"""Fix TCP server module.""" import errno import socket import select import threading from six.moves import queue from testplan.common.utils.timing import ( TimeoutException, TimeoutExceptionInfo, wait, ) from testplan.common.utils.sockets.fix.utils import utc_timestamp class ConnectionDetails(object):...
poc.py
#!/usr/bin/env python # Author: b0yd # Ex: AppJailLauncher.exe /outbound /key:flag.txt /port:4444 ConsoleApplication2.exe from pwn import * import sys import binascii ##### ##Uncomment the following code to use BugId as the test harness while trying to catch crashes # #sBaseFolderPath = "C:\Users\user\Documents\GitHu...
bot.py
#!/usr/bin/env python3 """ bot.py - Phenny IRC Bot Copyright 2008, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://inamidst.com/phenny/ """ import importlib import irc import logging import os import re import sys import threading import traceback import tools from tools import GrumbleE...
ReadUBX.py
""" Largely borrowed from UBX Examples """ from sys import platform from io import BufferedReader from threading import Thread from time import sleep from pyubx2 import UBXMessage, POLL, SET, UBX_CONFIG_MESSAGES from pyubx2.ubxreader import UBXReader from pyubx2.exceptions import UBXStreamError from serial import Se...
node.py
from __future__ import print_function import time # import socket # import subprocess # import argparse # import base64 import uuid import threading import tornado.web import tornado.ioloop import tornado.options import tornado.httpserver # import tornado.httpclient # import tornado.websocket import tornado.gen impor...
test_telnetlib.py
import socket import telnetlib import time import Queue from unittest import TestCase from test import test_support threading = test_support.import_module('threading') HOST = test_support.HOST EOF_sigil = object() def server(evt, serv, dataq=None): """ Open a tcp server in three steps 1) set evt to true ...
Hiwin_RT605_Socket_v3_20190628112439.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_v3 as TCP import HiwinRA605_socket_Taskcmd_v3 as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.s...
spiderdao.py
import ast import asyncio import os import re import threading import time import timeago import datetime import pickledb import websocket from scalecodec.type_registry import load_type_registry_preset #from scalecodec.updater import update_type_registries from substrateinterface import Keypair, SubstrateInterface im...
gstreamer.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
main.py
import os import cv2 import numpy as np from skimage.measure import ransac from skimage.transform import EssentialMatrixTransform from multiprocessing import Process, Queue import OpenGL.GL as gl import pangolin from cameraconfig import CameraConfig from orb.orb_extractor import OrbExtractor from kf.kalman_filter imp...
_nixcommon.py
# -*- coding: utf-8 -*- import struct import os import atexit from time import time as now from threading import Thread from glob import glob try: from queue import Queue except ImportError: from Queue import Queue event_bin_format = 'llHHI' # Taken from include/linux/input.h # https://www.kernel.org/doc/Docu...
autologin1.py
import time import pythoncom from manuallogin import * from PyQt5 import QtWidgets from PyQt5.QtCore import QTimer from multiprocessing import Process from PyQt5.QAxContainer import QAxWidget sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import openapi_path app = QtWi...
test_forward.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...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mixins.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` ============= Class Mix-Ins ============= Some reusable class Mixins ''' # pylint: disable=repr-flag-used-in-string # Import python libs from __future__ import absolute_import, print_function import os import sys...
autojs.py
#coding:utf-8 import types import sublime import sublime_plugin import socket import json import threading import traceback from io import StringIO from contextlib import closing hostname = '' port = 1209 class AutoJsServer: def __init__(self, hostname, port): self.hostname = hostname self.ip=N...
test_crawler.py
import collections import sys import unittest import warnings from http.server import HTTPServer, SimpleHTTPRequestHandler from threading import Thread import requests from crawler import Crawler class TestCrawler(unittest.TestCase): """A test class for the Crawler class""" SERVER_ADDRESS = "localhost" ...
_app.py
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library 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 Foundation; either version 2.1 of the License, ...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ from decimal import D...
log1_analysis.py
#!/usr/bin/env python #coding:utf-8 import commands import threading import sys import json from multiprocessing import Process,Manager,Pool manager=Manager() patter="cat 20160603.log |egrep 'HTTP/1.1\" 200|HTTP/1.1\" 301|HTTP/1.1\" 302'|grep -iEv 'HEAD|spider|bot|getTZ|roleid'|grep -icE " subpatter="cat 20160603.log |...
error_handling.py
""" "๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์˜ˆ์‹œ"์ ˆ ์˜ˆ์‹œ ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์Šค๋กœํ‹€๋ง / ๋น„์œจ ์ œํ•œ์„ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•œ๋‹ค. """ import random import time from queue import Queue, Empty from threading import Thread import requests SYMBOLS = ("USD", "EUR", "PLN", "NOK", "CZK") BASES = ("USD", "EUR", "PLN", "NOK", "CZK") THREAD_POOL_SIZE = 4 def fetch_rates(base): ...
main.py
#By Wang Haolong print("ๆญค็จ‹ๅบ็”ฑ็Ž‹ๆตฉ้พ™ๅˆถไฝœ\n\n") import Modulars.Subject as su import threading as th import time word = '' catalog={} catalog['่ฏญๆ–‡'] = su.Sunject('่ฏญๆ–‡') catalog['ๆ•ฐๅญฆ'] = su.Sunject('ๆ•ฐๅญฆ') catalog['่‹ฑ่ฏญ'] = su.Sunject('่‹ฑ่ฏญ') catalog['็‰ฉ็†'] = su.Sunject('็‰ฉ็†') catalog['ๅŒ–ๅญฆ'] = su.Sunject('ๅŒ–ๅญฆ') catalog['็”Ÿ็‰ฉ'] = su.Sunject('็”Ÿ...
web.py
import click import tensorflow as tf from flask import Flask, jsonify, request, render_template from threading import Thread from PIL import Image from six.moves import _thread from luminoth.tools.checkpoint import get_checkpoint_config from luminoth.utils.config import get_config, override_config_params from luminot...
create_vocab_proto.py
# Copyright 2017 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://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
player.py
# Gum sound editor (https://github.com/stackp/Gum) # Copyright 2009 (C) Pierre Duquesne <stackp@online.fr> # Licensed under the Revised BSD License. import alsaaudio import threading from gum.lib.event import Signal import numpy class AlsaBackend(object): def __init__(self, rate=44100): self._pcm = alsaa...
health_manager.py
from template_finder import TemplateFinder from ui import UiManager from ui import BeltManager from pather import Location import cv2 import time import keyboard from utils.custom_mouse import mouse from utils.misc import cut_roi, color_filter, wait from logger import Logger from screen import Screen import numpy as np...
websockets.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...
email.py
from flask_mail import Message from threading import Thread from app import app, mail # Async send message def send_async_mail(app, msg): with app.app_context(): mail.send(msg) # Main reset functionality def reset_password_email(address, password): msg = Message("ACM Programming Contest - Password ...
echo_server_threading.py
import threading import socketserver import socket SERVER_HOST = 'localhost' SERVER_PORT = 0 # Tells kernel to pick port randomly BUF_SIZE = 1024 ECHO_MSG = b'Hello echo Server!' def client(ip, port, message): """ A client to test the server """ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
pyPuzzle.py
#!/usr/bin/python """" NPR Puzzle Script 1/31/21 Version 0.1 Build 1 (1/31/21) Author: Stephen Friederichs License: Beerware License: If you find this program useful and you ever met me, buy me a beer. (I like Saisons) This script will hopefully provide the answer to the NPR Puzzle posed on 1/31/21, which is as follows...
workers.py
import logging logger = logging.getLogger(__name__) import select import traceback from socket import socket from threading import Thread from .exceptions import TimeoutError from .utils import Request, Response, queuedict, JsonSerializable from ..._compat import queue, raise_from class ThreadedSocketWorker(object...
views.py
#views.py #Flask app for the Aeropendulum_IOT project #8th October 2019 #Ricard Lado <ricardlador@iqs.edu> from flask import Blueprint, render_template, Response #Camera from .camera_opencv import Camera #Chart modules from datetime import datetime import time import json #Serial comunications from multiprocessing imp...
triplet_100Kg.py
#!/usr/bin/env python import rospy from Phidget22.Phidget import * from Phidget22.Devices.VoltageRatioInput import * from std_msgs.msg import Float64 from geometry_msgs.msg import Vector3 import time from threading import Thread class force_sensor(): def __init__(self): self.VR = [0.0, 0.0, 0....
generate_val_1.py
import json import os from multiprocessing import Process def chunks(lst, n): """Yield successive n-sized chunks from lst.""" for i in range(0, len(lst), n): yield lst[i:i + n] def cut_videos(cmds, i): for i in range(len(cmds)): cmd = cmds[i] print(i, cmd) os.system(cmd) ...
SMWiredPy.py
__version__="1.0.4" __VERSION__=__version__ from os import read, write import serial import threading import time import queue import atexit from enum import Enum from sys import argv, stdout from argparse import ArgumentParser #Before importing SMComPy check the .so or .dll file! import SMComPy WIRED_APPLICATION_BAU...
run-tests.py
#!/usr/bin/env python3 # # 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 "L...
app.py
from flask import Flask, render_template, request from flask.helpers import send_file from werkzeug.utils import secure_filename from bson.objectid import ObjectId import multiprocessing as mp import datetime import os import logging import pymongo import zipfile from io import BytesIO from worker import worker_proce...
test_local_task_job.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...
catch_mongodb_mzi.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- #http://cuiqingcai.com/3363.html __author__ = 'Demi Yu' import os import time import threading import multiprocessing from catch_mongodb_queue import MogoQueue from Download import request from bs4 import BeautifulSoup SLEEP_TIME = 1 def mzitu_crawler(max_threads=10): ...
lep.py
import threading import Queue import json import SocketServer import socket import ipaddress from time import sleep from sh import ping, ping6, traceroute, mtr try: import lepconf except ImportError, err: print "Couldn't import the config." raise err ping = ping.bake(c=4, _ok_code=[0,1]) ping6 = ping6.bake(c=4, _...
run_noui_test.py
import os import sys from app.data_recorder import DataRecorderAppPro ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) sys.path.append(ROOT_PATH) if not os.path.exists(".vntrader"): os.mkdir(".vntrader") import multiprocessing from time import sleep from datetime import datetime, ...
server.py
#!/usr/bin/python import fcntl import time import unittest import subprocess import threading import json from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer PORT_NUMBER = 8080 #TEMPERATURE = "0" #HUMIDITY = "0" class SHT21: """Class to read temperature and humidity from SHT21, much of class was de...
detect_service.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Tencent is pleased to support the open source community by making Metis available. Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with th...
app.py
############################################################################# # Copyright (c) 2018, Voila Contributors # # # # Distributed under the terms of the BSD 3-Clause License. # # ...
test_server.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_zcash import Wallet, WalletStorage from electrum_zcash.util import UserCancelled, InvalidPassword from electrum_zcash.base_wizard import BaseWizard, HWD_SETUP_DECRYP...
pixels.py
# coding=utf-8 import recorder import threading import time import signal import sys import numpy as np has_gui = '-gui' in sys.argv has_cli = '-cli' in sys.argv has_leds = '-leds' in sys.argv if has_leds: from neopixel import * LED_COUNT = 283 # Number of LED pixels. LED_PIN = 18 #...
test_worker.py
# -*- encoding: utf-8 -*- # # 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 ...
test_subprocess.py
import unittest from unittest import mock from test import support from test.support import import_helper from test.support import os_helper from test.support import warnings_helper import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback ...
files.py
# data.world-py # Copyright 2017 data.world, 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 agr...
get_location.py
# ์ถ”์ถœํ•œ ํŒŒ์ผ ์ •๋ณด๋ฅผ ํ† ๋Œ€๋กœ api์š”์ฒญ์„ ๋ณด๋‚ธ ๋’ค {์›๋ž˜ ํŒŒ์ผ ๋ช…:๋ฐ”๋€” ํŒŒ์ผ ๋ช…} ํ˜•์‹์œผ๋กœ ์ €์žฅํ•œ๋‹ค from threading import Thread from .check_online import ConnectionCheck from .log_gongik import Logger from .meta_data import GPSInfo from .local_db_gps import LocalDB from .reverse_geocode import LocationRequest #์˜จ๋ผ์ธ ์ฒดํฌ from .file_property import FileProp c...
client4.py
import socket import threading class Client(): def __init__(self): self.username = input('Enter your username: ') self.sock = socket.socket() self.sock.connect(('localhost', 5678)) self.sock.sendall((self.username + ' endered chat').encode()) print('You entered chat as ' + s...
feature.py
# coding=utf-8 # # Yu Wang (University of Yamanashi) # Dec, 2020 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
email.py
#!/usr/bin/env python3 # coding:utf-8 from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_...
uffsBot.py
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler import telegram from Utils import Utils import RuBot, BusBot, CalendarBot, CanteenBot, EventsBot, DateBot, DatabaseConnection from conf.settings import telegramToken import threading ruBot = RuBot.RuBot() canteenBot = CanteenBot.CanteenBot(...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import random import fnmatch import logging import threading import traceback import c...
pkb.py
# Copyright 2019 PerfKitBenchmarker 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 appli...
api.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' mavproxy - a MAVLink proxy program Copyright Andrew Tridgell 2011 Released under the GNU GPL version 3 or later ''' import sys, os, time, socket, signal reload (sys) sys.setdefaultencoding('utf-8') import fnmatch, errno, threading import serial, Queue...
test_server.py
import requests from multiprocessing import Process from time import sleep import unittest from unittest import TestCase import uuid from server import ServerBase, Command, Attribute class ServerWithCommand(ServerBase): @Command def cmd1(self, arg1, arg2): ret_val = { 'arg1': arg1, ...
Bot.py
import logging import traceback from threading import Lock from threading import Thread from django.contrib.auth.models import Group from apps.bot.classes.consts.ActivitiesEnum import ActivitiesEnum from apps.bot.classes.consts.Consts import Platform, Role from apps.bot.classes.consts.Exceptions import PWarning, PErr...
helpers.py
""" Helper functions file for OCS QE """ import base64 import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time from concurrent.futures import ThreadPoolExecutor from subprocess import PIPE, TimeoutExpired, run from uuid import uuid4 i...
GenLInt.py
from .Polynomial import * from .Sbox import * from .Term import * from .Vector import * from multiprocessing import Process, Lock from threading import Thread #from pudb import set_trace; set_trace() class GenLInt(object): def __init__(self, values, inputLength, outputLength ): self.probability_bit = 0 ...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test syscoind shutdown.""" from test_framework.test_framework import SyscoinTestFramework from test_fr...
utils.py
from flask import render_template, current_app, Blueprint from threading import Thread from flask_mail import Message, Mail class Utils(): def __init__(self): self.mail = None def async_send_mail(self, app, msg): self.mail = Mail(app) with app.app_context(): self.mail.send(msg) def send_ma...
server.py
#!/usr/bin/env python """ Client to communicate with RabbitMQ and extension of Population which add parallel computing capabilities. """ import json import pika import queue import threading import time import uuid import ast from .populations import Population, Flock,GridPopulation import pymongo db_client=pymongo.Mo...
detector.py
from alphapose.utils.read_img import read_img import os import sys from threading import Thread from queue import Queue import cv2 import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.read_img import read_img from alphapose.utils.presets import SimpleTransform from alphapose.models ...
yayagram.py
# coding=utf-8 from __future__ import unicode_literals from __future__ import print_function import base64, sys from configparser import ConfigParser from pytg.utils import coroutine from pytg import Telegram from Adafruit_Thermal import * from datetime import datetime from multiprocessing import Process import textwr...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import multiprocessing from random imp...
54moo.py
# -*- coding: utf-8 -*- ''' ยฉ 2018SelfBot ProtectV3.5 ''' from important import * # Setup Argparse parser = argparse.ArgumentParser(description='ยฉ 2018SelfBot ProtectV3.5') parser.add_argument('-t', '--token', type=str, metavar='', required=False, help='Token | Example : Exxxx') parser.add_argument('-e', '--email', typ...
multiprocessing_module.py
import multiprocessing from level_1.module.gesture_control import main_avm queue_shared = multiprocessing.Queue() process_object = multiprocessing.Process(target = main_avm, args = (queue_shared,))
stream.py
# _____ ______ _____ # / ____/ /\ | ____ | __ \ # | | / \ | |__ | |__) | Caer - Modern Computer Vision # | | / /\ \ | __| | _ / Languages: Python, C, C++ # | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer # \_____\/_/ \_ \______ |_| \_\ # Licensed ...
engine.py
""" This file contains functions to regulate game play. """ import matplotlib as mpl mpl.use('Agg') from matplotlib.backends.backend_pdf import PdfPages from api import State, Planet from multiprocessing import Process, Manager def play( player1, player2, state, # type...
test_httplib.py
import errno from http import client import io import itertools import os import array import re import socket import threading import warnings import unittest TestCase = unittest.TestCase from test import support from test.support import socket_helper here = os.path.dirname(__file__) # Self-signed cert file for 'lo...
test_functools.py
import abc import builtins import collections import copy from itertools import permutations import pickle from random import choice import sys from test import support import unittest from weakref import proxy try: import threading except ImportError: threading = None import functools py_functools = support....
auto_rotate.py
import sys, os, sh, threading, time from tablet_mode_detection import pipe_switch_output, listen_for_switch_state DNAME = "LVDS-1" #This is your display name--may be different STYLUS_NAME = "Wacom Serial Penabled Pen stylus" #This is your stylus device name--may be different ##rotate() method: #Loops until tablet...
xxe-server.py
#!/usr/bin/env python # Dwight Hohnstein # Rhino Security Labs 2017 # # This is more or less a direct python port # of the Java XXE FTP Server outlined by # Ivan Novikov from http://lab.onsec.ru/2014/06/xxe-oob-exploitation-at-java-17.html # # Essentially, when sending your XXE request Java # will send the data over FT...
test_rpc.py
# -*- coding: utf-8 -*- # Copyright (c) 2016, French National Center for Scientific Research (CNRS) # Distributed under the (new) BSD License. See LICENSE for more info. import threading, atexit, time, logging from pyacq.core.rpc import RPCClient, RemoteCallException, RPCServer, QtRPCServer, ObjectProxy, ProcessSpawne...
InstancingConverterTest.py
########################################################################## # # Copyright (c) 2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
build_data.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import Counter from collections import namedtuple from datetime import datetime import json import os.path import random import sys import threading import cPickle import nltk.tokenize import nu...
ivy.py
""" Using an IvyServer ------------------ The following code is a typical example of use: .. python:: from ivy.ivy import IvyServer class MyAgent(IvyServer): def __init__(self, name): IvyServer.__init__(self,'MyAgent') self.name = name self.start('127.255.255.255:2010') ...
gear_selection_manager.py
import time import numpy import struct import threading from . import tunePDNR_covMat_v3 from .touchcomm_manager import TouchcommManager debug = False def log(message): if debug: print(message) else: pass def convert_chunk(i): return struct.unpack('<f', bytearray(i))[0] def convert_to_fl...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import warnings import unittest from math import sqrt from pathlib import Path from torch.multiprocessing import Process from torch.te...
AVSP-test.py
import tkinter as tk from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk) from matplotlib import (pyplot as plt, animation) import threading import time import logging import socket from queue import Queue import artgallery as ag import funcgnss import funcgnss as fg __author__ = 'Sa...
non_blocking_file_handler.py
""" Non blocking logging file handler by using threads. """ from threading import Thread from logging import FileHandler from queue import Queue class NonBlockingFileHandler(FileHandler): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._queue = Queue(maxsize=9999) ...
context_manager.py
from input.input import InputProxy from output.output import OutputProxy from actions import ContextSwitchAction from action_manager import ActionManager from functools import wraps from threading import Thread, Lock from helpers import setup_logger logger = setup_logger(__name__, "info") def context_target_wrapper...
influx.py
# -------------------------------------------------------------------------------------- # Copyright 2016, Benedikt J. Daurer, Filipe R.N.C. Maia, Max F. Hantke, Carl Nettelblad # Hummingbird is distributed under the terms of the Simplified BSD License. # -------------------------------------------------------------...
test_concurrent_futures.py
from test import support from test.support import import_helper from test.support import threading_helper # Skip tests if _multiprocessing wasn't built. import_helper.import_module('_multiprocessing') from test.support import hashlib_helper from test.support.script_helper import assert_python_ok import contextlib im...
train.py
import torch import torch.distributed as dist import torch.multiprocessing as mp from ogb.graphproppred import Evaluator from torch.utils.data import DataLoader from data import Vocab, MyDataset, STR, END, CLS, SEL, rCLS, sparsify_batch, worker_init_fn from generator import Generator from extract import LexicalMap fr...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.test_support from test.script_helper import assert_python_ok, assert_python_failure import sys, os, cStringIO import struct import operator class SysModuleTest(unittest.TestCase): def tearDown(self): test.test_support.reap_children() def test_origina...