source
stringlengths
3
86
python
stringlengths
75
1.04M
dest.py
import socket import threading import hashlib import sys import time from utils import * class Receiver: def __init__(self, port0, port1, port2, host0, host1, host2): self.port_n0 = port0 self.port_n1 = port1 #port numbers self.port_n2 = port2 self.host_n0 = host0 self.hos...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test_proxy_scale.py
import multiprocessing import pytest from pymilvus import MilvusException from customize.milvus_operator import MilvusOperator from common import common_func as cf from common.common_type import CaseLabel from scale import scale_common as sc, constants from utils.util_log import test_log as log from utils.util_k8s im...
vsearch4web.not.slow.with.threads.fixed.py
from flask import Flask, render_template, request, escape, session, copy_current_request_context from vsearch import search4letters from DBcm import UseDatabase, ConnectionError, CredentialsError, SQLError from checker import check_logged_in from threading import Thread from time import sleep app = Flask(__name__) ...
core.py
''' Created on May 29, 2015 @author: mzwier ''' import collections import contextlib import errno import logging import json import multiprocessing import os import re import signal import socket import sys import tempfile import threading import time import traceback import uuid import zmq import numpy as np # Eve...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2021 The DRiyal Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JSON...
test_flight.py
# -*- coding: 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 # "...
store_utils.py
# Copyright 2011 OpenStack Foundation # Copyright 2012 Red Hat, 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 # a copy of the License at # # http://www.apache.org/licenses/...
zs_weight_perturb.py
import numpy as np import os import sys import argparse #from gen_faultmap import * #from defs import * import pdb import realm_utils as utils import torch import matplotlib.pyplot as plt import multiprocessing as mp visualize=False ## This class of model is characterized by the following parameters - # ber - bit ...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import pdb import sys import types import unittest import subprocess import textwrap from test import support # This little helper class is essential for testing pdb under doctest. from test.test_doctest import _FakeInput class PdbTestInpu...
test_models.py
import fcntl from multiprocessing import Process from pathlib import Path import shutil import mock from django.core import mail from django.utils.encoding import force_bytes, force_text from django_celery_beat.models import PeriodicTask from mayan.apps.common.serialization import yaml_dump from mayan.apps.document...
client.py
import json import logging import queue import re import socket import ssl from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass from threading import Event, RLock, Thread from time import monotonic as now, sleep from typing import Callable, List, Dict, Match, Optional, Pattern, Tuple, Uni...
__init__.py
# # Copyright (c) 2010 Brian E. Granger # # This file is part of pyzmq. # # pyzmq is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option)...
PC_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official PC Miner 2.74 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2021 """ from time import time, sleep, strptime, ctime from hashlib import sha1 from socket import socket from multiprocessing import L...
HueSSDP.py
import time import random import socket import struct from threading import Thread import logging logger = logging.getLogger(__name__) class SSDP: def __init__(self, ip, port, mac): self._ip = ip self._port = port self._mac = mac self._search_running = False self._broadc...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import multiprocessing import os import socket import shutil import s...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') from test.support.script_helper import assert_python_ok import contextlib import itertools imp...
ProcessDialog.py
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project from __future__ import print_function from Qt import QtCore, QtWidgets from rezgui.util import create_pane from rezgui.mixins.StoreSizeMixin import StoreSizeMixin from rezgui.widgets.StreamableTextEdit import StreamableTextEdit from re...
xcvrd.py
#!/usr/bin/env python2 """ xcvrd Transceiver information update daemon for SONiC """ try: import ast import json import multiprocessing import os import signal import sys import threading import time from enum import Enum from sonic_py_common import daemon_base, device...
test_lock.py
import pytest from conda.lock import DirectoryLock, FileLock, LockError from os.path import basename, exists, isfile, join def test_filelock_passes(tmpdir): """ Normal test on file lock """ package_name = "conda_file1" tmpfile = join(tmpdir.strpath, package_name) with FileLock(tmpfile) as ...
thread_test.py
import threading import time def say(msg): while True: time.sleep(1) print(msg) for msg in ['you', 'need', 'python']: t = threading.Thread(target = say, args = (msg,)) t.daemon = True t.start() for i in range(100): time.sleep(0.1) print(i)
Check.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Autor: rique_dev (rique_dev@hotmail.com) import gc import threading import time import requests class CheckProxy: # Listagem de Proxys (funcional) __goodList: list = [] # Listagem de Proxis (geral) __proxylist: list = [] # Timeout setado __ti...
process.py
#!/usr/bin/env python3 # This script was written for the NIH BioData Catalyst to process an input manifest file # containing file locations and file metadata, and upload the files to Amazon and Google # Cloud services. # # usage: process.py [-h] --tsv TSV [--gs] [--aws] [--test] [--resume] # [--threa...
demo_client.py
import signal import sys import threading from email.parser import Parser import json import logging import socket from http_classes.http_classes import Request, Response, HTTPError, MAX_HEADERS, MAX_LINE from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot from PyQt5 import QtWidgets, uic from gui_templates.login im...
proxy.py
import threading import socket try: from toolkit.network import basic # pylint: disable=import-error except: import basic class Proxy(): def __init__(self, serverport, serveraddr, clientport, clientaddr): threading.Thread.__init__(self) self.running = True self.serverAddr = (clien...
oku.py
#python ile büyük dosyaları satır satır okuma işleme arama yapma import os,time,re,sys,random,threading #regex desenimiz regex = r"[0-9]+" dosyaYolu='data.txt' def oku(boyut): bas=boyut.split('/')[0] son=boyut.split('/')[1] f=open(dosyaYolu) f.seek(int(bas)) lines=f.read(int(son)).spli...
test_streaming_https.py
# -*- coding: utf-8 -*- from unittest import TestCase import poster import webob from paste import httpserver import urllib2 import threading, time import sys from OpenSSL import SSL poster.streaminghttp.register_openers() port = 5124 request = None params = None def app(environ, start_response): global params...
DependencyNodeTest.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
main.py
import os import sys import time import dotenv import logging import datetime from threading import Thread from telegram.ext import Updater, CallbackContext, CommandHandler, MessageHandler, Filters from telegram import Update from core.commands import start, help_cmd, about, unknown, unknown_text, get from api_loader i...
TestProgressReporting.py
""" Test that we are able to broadcast and receive progress events from lldb """ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil import threading class TestProgressReporting(TestBase): mydir = TestBase.compute_mydir(__file__) ...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_spectrumcash.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_spectrumcash.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum_spectrumcash.bip32 import BIP32Node from electrum_spectrumcash import constants from...
clamav.py
import logging import os import pathlib import queue import subprocess # WARNING, POSSIBLE SECURITY ISSUE: Bandit report: 'Consider possible security implications associated with subprocess module.' import threading class ClamAV(): """ ClamAV command class. This is not a stand-alone scanner. It depends on ori...
MainTable_parallel.py
import numpy as np import base64 import pandas as pd from time import sleep from multiprocessing import Process from FRETboard.SafeH5 import SafeH5 from FRETboard.SafeHDFStore import SafeHDFStore from FRETboard.FileParser import FileParser from FRETboard.helper_functions import numeric_timestamp, colnames_w_labels, col...
detection_test.py
import os import math import pprint from core.detection_module import DetModule from core.detection_input import Loader from utils.load_model import load_checkpoint from utils.patch_config import patch_config_as_nothrow from functools import reduce from queue import Queue from threading import Thread import argparse ...
frontendcomm.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ In addition to the remote_call mechanism implemented in CommBase: - Implements _wait_reply, so blocking calls can be made. """ import pickle import socket import...
nnetSolve.py
import os import sys import numpy as np import pickle as pickle import argparse import time from subprocess import Popen, PIPE from multiprocessing import Process, Queue # works locally o_path = os.getcwd() sys.path.append(o_path) sys.path.append(os.path.join(o_path, "..")) sys.path.append(os.path.join(o_path, "..", "...
ducks_are_monsters_node.py
#!/usr/bin/env python import rospy import numpy as np import math from duckietown_msgs.msg import Twist2DStamped, LanePose from sensor_msgs.msg import CompressedImage, Image from cv_bridge import CvBridge, CvBridgeError import cv2 import sys from duckietown_utils.jpg import image_cv_from_jpg import time import threadi...
ExpressionServicesServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys, json, traceback from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, log, ServerError, ParseError, InvalidRequestError from os ...
ServerTest.py
import socket # Server settings pi_ip_address = pc_ip_address = # next create a socket object s = socket.socket() # reserve a port on your computer port = 12345 # Next bind to the port s.bind(('ADRESSE_ORDINATEUR', port)) # put the socket into listening mode s.listen(5) actionOpcode = 0 data = None VECT_FORCE_UP...
wsgi_server.py
''' A HTTP server that is packaged using class(the same as "static_web_server.py") This http server can retrieve html file in the './static' and run & print the result of xx.py in the './wsgipython' 1. create a socket 2. bind & reuse addr 3. listen 4. while True: 4.1 accept 4.2 n...
__init__.py
"""Interact with Taskwarrior.""" import datetime import os import re import threading import traceback from pathlib import Path from shutil import which from subprocess import PIPE, Popen from typing import List, Optional, Tuple, Union import albert as v0 # type: ignore import dateutil import gi import taskw from fu...
key_display.py
from key_test import capture_keys from tkanvas import TKanvas import Queue as queue # py 2.x compatibility try: import Tkinter as tkinter from Tkinter import mainloop except ImportError: from tkinter import mainloop import numpy as np from multiprocessing import Queue, Process import matplotlib import tim...
climatology.py
#!/usr/bin/env python ''' Tobey Carman October 2018 Scripts for looking at and evaluating input data files for dvmdostem. Generally data has been prepared by M. Lindgren of SNAP for the IEM project and consists of directories of well labled .tif images, with one image for each timestep. This script has (or will have)...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
node.py
import threading import multiprocessing as mp import multiprocessing.connection as mpc from pipeline_cluster import util from pipeline_cluster import pipeline import pipeline_cluster.multiprocess_logging as mpl import signal import traceback import time import os import subprocess import importlib import sys class Com...
domainanalyze.py
from resolve import * import signal import time import os from exchange import get_exchange from actorwrapper import ActorWrapper from multiprocessing import Queue, Process, Event import json import conf from sqlalchemy import create_engine from sqlalchemy import select, and_, or_, not_, func, text, bindparam from sqla...
common.py
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
webcam.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 import threading import time import os class WebcamVideoStream: """ Reference: https://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/ """ def __init__(self): self.vid = None self.out = None ...
MultiClampTelegraph.py
# -*- coding: utf-8 -*- from __future__ import print_function import sys sys.path.append('C:\\cygwin\\home\\Experimenters\\luke\\acq4\\lib\\util') import ctypes import struct, os, threading, time, weakref from acq4.util.clibrary import * DEBUG = False if DEBUG: print("MultiClampTelegraph Debug:", DEBUG) __all__ =...
_flowsheet.py
# -*- coding: utf-8 -*- """ As BioSTEAM objects are created, they are automatically registered. The `find` object allows the user to find any Unit, Stream or System instance. When `find` is called, it simply looks up the item and returns it. """ from graphviz import Digraph from IPython import display from ._utils i...
online_visualizer.py
from queue import Queue import numpy as np import sys import time import os import torch import torch.multiprocessing as mp from multiprocessing import Process from multiprocessing import Queue as pQueue from threading import Thread import json import cv2 sys.path.append('../') import config #from fast_re...
mini_web.py
import socket import threading import sys class HTTPServer: def __init__(self, port): tcp_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tcp_server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True) tcp_server.bind(('', port)) tcp_server.listen(128) self.t...
deployment.py
import yaml import os from multiprocessing import Process from threading import Thread from shutil import copy from collections import OrderedDict from utils import * from containers import * from pipelines import * from templating.templates import * from mpls import * from chimaclient import * from triggers import * ...
flic.py
""" Support to use flic buttons as a binary sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.flic/ """ import logging import threading import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant....
accessory_driver.py
"""AccessoryDriver - glues together the HAP Server, accessories and mDNS advertising. Sending updates to clients The process of sending value changes to clients happens in two parts - on one hand, the value change is indicated by a Characteristic and, on the other, that change is sent to a client. To begin, typically...
bt_server.py
import os import re import socket import subprocess import sys import threading from logic.file_handler import get_newest_datetime, zip_articles, unzip_articles, DIR_TRANSFER from datetime import datetime import platform class bt_server: def __init__(self): #####self.device_os = None self.host_mac...
__init__.py
# coding=utf-8 # encoding: utf-8 from __future__ import absolute_import from tempfile import mkstemp from datetime import timedelta from slackclient import SlackClient from slacker import Slacker, IncomingWebhook from imgurpython import ImgurClient from imgurpython.helpers.error import ImgurClientError, ImgurClientRate...
deepwalk.py
import torch import argparse import dgl import torch.multiprocessing as mp from torch.utils.data import DataLoader import os import random import time import numpy as np from reading_data import DeepwalkDataset from model import SkipGramModel from utils import shuffle_walks, sum_up_params class DeepwalkTrainer: d...
streamlit.py
import streamlit as st import time import numpy as np import IPython.display as ipd #ipd.Audio(audio, rate=16000) from online_scd.model import SCDModel from online_scd.streaming import StreamingDecoder import timeit from online_scd.utils import load_wav_file import multiprocessing import playsound import queue imp...
carla_runner.py
import carla from carla import ColorConverter as cc from ROAR_Sim.carla_client.util.sensors import CollisionSensor from ROAR_Sim.configurations.configuration import Configuration as CarlaConfig import logging import pygame from ROAR.utilities_module.data_structures_models import SensorsData from ROAR.utilities_module.v...
test_exceptions.py
import pytest import threading from zaber.serial import UnexpectedReplyError, TimeoutError, AsciiReply, BinaryReply, AsciiCommand, AsciiDevice def test_unexpectedreplyerror_accepts_reply(): rep = AsciiReply("@01 0 OK IDLE -- 0\r\n") ex = UnexpectedReplyError("Oh no!", rep) assert(ex.args == ("Oh no!", )) ...
base.py
import argparse import base64 import copy import itertools import json import os import re import sys import threading import time import uuid import warnings from collections import OrderedDict from contextlib import ExitStack from typing import Optional, Union, Tuple, List, Set, Dict, overload, Type from .builder im...
load-data.py
#!/usr/bin/env impala-python # # 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 (...
binance_futures.py
import logging import requests import time import typing from urllib.parse import urlencode import hmac import hashlib import websocket import json import threading from models import * logger = logging.getLogger() class BinanceFuturesClient: def __init__(self, public_key: str, secret_key: str, testnet: bo...
gateway.py
# this is the "main" file of the gateway program # **********includes*********** # # include libraries import json # include functions import booking import reservation import streams import sensordata import globals import subprocess import pathlib import time import client import os # include classes from parki...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
various_web_demo_env.py
import random import base64 from collections import OrderedDict from flask import Flask, render_template, request, jsonify from flask_cors import CORS from queue import Queue, Empty from threading import Thread import time import traceback import re from openchat.base.envs.base import BaseEnvironment from openchat.ba...
bhnet_2.py
# -*- coding: utf-8 -*- import sys import socket import getopt import argparse import threading import subprocess def client_sender(args, buf): client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: client.connect((args.target, args.port)) if len(buf): client.send(buf) ...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
redsnarf.py
#! /usr/bin/python # Released as open source by NCC Group Plc - https://www.nccgroup.trust/uk/ # https://github.com/nccgroup/redsnarf # Released under Apache V2 see LICENCE for more information from __future__ import print_function import os, argparse, signal, sys, re, binascii, subprocess, string, SimpleHTTPServer, m...
IoExpI2C.py
#!/usr/bin/env /usr/bin/python3 # -*- coding: utf-8 -*- # ----------------------------------------------- # IO Expander (MCP23017) Control Class # # The MIT License (MIT) # Copyright (C) 2019 myasu. # ----------------------------------------------- import smbus import threading import time # ------------------------...
player.py
""" The MIT License (MIT) Copyright (c) 2015-2021 Rapptz Copyright (c) 2021-present Disnake Development 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 limi...
updatequeue.py
"""Update Manager. """ # # Copyright (c) 2005-2014 shinGETsu Project. # 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. Redistributions of source code must retain the above copyright # not...
process_pool.py
import time from multiprocessing import Process, Queue class ProcessPool: def __init__(self, func, process_count=5): self.func = func self.process_count = process_count self.queue = Queue() self._create_processes() def _create_processes(self): for i in range(0,...
run.py
#!/usr/bin/env python3 import json import cv2 import sys import time import threading import numpy as np from datetime import datetime from threading import Timer from picamera import PiCamera from securepi import app from securepi import tools from securepi.DetectorAPI import DetectorAPI from securepi.camera import V...
http_utils.py
""" @author: tyrantlucifer @contact: tyrantlucifer@gmail.com @blog: https://tyrantlucifer.com @file: http_utils.py @time: 2021/2/21 22:43 @desc: 提供http pac代理功能 """ import atexit import signal import socket import re import requests import threading from shadowsocksr_cli.logger import * class Daemon(object): """ ...
test_generate_key_pairs.py
import json from stellar_base.address import * from stellar_base.builder import Builder from wrapper.client import Client def op(source, destination, amount): builder = Builder(secret=source) builder.append_payment_op(destination=destination,amount=amount) builder.sign() builder.submit() # master ...
runCtaTrading.py
# encoding: UTF-8 from __future__ import print_function import sys try: reload(sys) # Python 2 sys.setdefaultencoding('utf8') except NameError: pass # Python 3 import multiprocessing from time import sleep from datetime import datetime, time from vnpy.event import EventEngine2 from vnpy.trader.v...
process_environment.py
import multiprocessing import threading from typing import Any, Callable, Iterable, Mapping, Optional, Type, TypeVar, Union from puma.buffer import Buffer, MultiProcessBuffer from puma.buffer.implementation.managed_queues import ManagedProcessQueue, ManagedQueueTypes from puma.environment import Environment from puma....
speech_cls_task.py
# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. # 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/LI...
signals.py
from threading import Thread from django.db.models.signals import post_save from .models import Task from catalog.management.commands.get_books import run_crawler def handler_run_scraper(sender, instance, **kwargs): if kwargs.get('created'): try: start, end = instance.arg.split(',') ...
hypnotixLiteS.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- ### based on hypnotix ### https://github.com/linuxmint/hypnotix import gi gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk import sys import warnings import mpv import threading from os import path as fpath, linesep warni...
timer.py
import time import ast import os def updator(lisst): file = open("raspisanie_otpravok.txt", "w") file.write(str(lisst)) file.close() # процесс с ботом телеги. тут осуществляется проверка на наличие ошибки соединения, так как она ловится только тут. в main она за ошибку не считается. def send...
autonomous_v8.py
''' NOTES Goal: Make nn take the second-best from the previous prediction. Result: THIS ALSO SEEMS TO BE A BUST. KEEPS GETTING STUCK IN THESE LOOPS OF (predict; ctrl-z), ETC. ''' import car import cv2 import numpy as np import os import serial import socket import threading import time from imutils.object_detection ...
util.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Mara Alexandru Cristian # Contact: alexandru.mara@ugent.be # Date: 18/12/2018 # This file provides a set of functions for importing binary classifiers from a given sting and for running command line # calls and python functions in independent processes with given...
socketHelper.py
import socket,pickle,threading,time,random import basicUser import User import Action createBasicUser = basicUser.UserBasic createAction = Action.Action createUser = User.User socket_server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) class mySocket(threading.Thread): sockets=[] session=[] bullet...
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...
Socket_Singleton.py
from sys import argv from socket import socket from threading import Thread, Timer from collections import deque class Socket_Singleton: """ Allows a single instance of a python application to run at a time. First one that binds to the specified port wins, and will collect the arguments fr...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from multiprocessing import Process from typing import Dict from common.basedir import BASEDIR from common.spinner import Sp...
http_server.py
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # 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 derivative wo...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum from electrum.bitcoin import TYPE_ADDRESS from electrum import WalletStorage, Wallet from electrum_gui.kivy.i18n import _ from electrum.paymentrequest import InvoiceStore from electr...
data_util.py
# # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
CatBot_Selfbot.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests cl = LINETCR.LINE() cl.login(qr=True) #cl.login(token='') cl.loginResult() print "===[Login Success]===" helpMessage =""" ====={...
aio_client.py
# coding=utf-8 """ Copyright (c) 2018-present, Ant Financial Service Group 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 Un...
ports.py
import socket import threading from queue import Queue q = Queue() ports_list = [] list_lock = threading.Lock() ip = "" def get_ports(host_ip): global ip ip = host_ip init_ports_scan() for x in range(100): t = threading.Thread(target=threader) t.daemon = True t.start() q....
gvt_control.py
#!/usr/bin/env python import argparse import sys import socket import random import struct import threading import time import thread import json from scapy.all import sendp, send, get_if_list, get_if_hwaddr from scapy.all import Packet from scapy.all import Ether, IP, UDP, TCP from proposalHeader import GvtProtocol ...
web.py
import requests import json import threading import random import re usernames = json.loads(open("usernames.json", "r").read()) texts = json.loads(open('starwars.json', 'r').read()) #discussions = json.loads(open("discussions.json", "r").read()) password = '%4B%65%6E%79%6F%6E%35%25' # A hex encoded password siteurl = ...
data_recording_api.py
# encoding: UTF-8 import multiprocessing from time import sleep from datetime import datetime, time from event import EventEngine2 from vtEvent import EVENT_LOG, EVENT_ERROR from vtEngine import MainEngine, LogEngine from gateway import ctpGateway from app import dataRecorder #---------------------------------------...