source
stringlengths
3
86
python
stringlengths
75
1.04M
AutoInterface.py
from .Interface import Interface import socketserver import threading import socket import struct import time import sys import RNS class AutoInterface(Interface): DEFAULT_DISCOVERY_PORT = 29716 DEFAULT_DATA_PORT = 42671 DEFAULT_GROUP_ID = "reticulum".encode("utf-8") SCOPE_LINK = "...
client.py
# -*- coding: utf-8 import pycurl import os import shutil import threading import lxml.etree as etree from io import BytesIO from re import sub from webdav.connection import * from webdav.exceptions import * from webdav.urn import Urn try: from urllib.parse import unquote except ImportError: from urllib impor...
against.py
#!/usr/bin/env python # -*- coding: latin-1 -*- ###################################################### # ____ _ __ # # ___ __ __/ / /__ ___ ______ ______(_) /___ __ # # / _ \/ // / / (_-</ -_) __/ // / __/ / __/ // / ...
base.py
""" Base, non-system specific abstract implementations. """ import os import subprocess import threading import weakref import abc import collections.abc import signal __all__ = ( # Base primitives 'Process', 'ProcessGroup', 'Pipe', 'PseudoTerminal', 'VirtualProcess', 'ThreadedVirtualProcess', # Constan...
test_collection.py
import numpy import pandas as pd import pytest from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.util_pymilvus import * prefix = "collection" exp_name = "name" exp_schema = "schema" exp_nu...
tornado_server.py
import logging import json import os import signal import sys import urllib import urlparse from multiprocessing.process import Process sys.path.insert(0, os.path.abspath(os.path.realpath(__file__) + '/../../../')) from oauth2 import Provider from oauth2.error import UserNotAuthenticated from oauth2.grant import Aut...
natick_OD.py
""" NATICK_OD.PY - Script for real-time object detection for Project Natick livestream Code adapted from https://github.com/tensorflow/models/tree/master/research/object_detection and from https://pythonprogramming.net/introduction-use-tensorflow-object-detection-api-tutorial/ 2018.08.15 Nile Wilson """ # Imports impor...
base.py
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import sys from argparse import ArgumentParser from konlpy.utils import PropagatingThread, pprint if sys.version_info[0] >= 3: import urllib...
graph_digest_benchmark.py
#!/usr/bin/env python """ This benchmark will produce graph digests for all of the downloadable ontologies available in Bioportal. """ from rdflib import Namespace, Graph from rdflib.compare import to_isomorphic from six.moves.urllib.request import urlopen from six.moves import queue import sys import csv from io i...
QSpaceConverter.py
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2015-2016 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017, 2018 MinIO, 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 Lice...
main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # __author__ = 'Liantian' # __email__ = "liantian.me+code@gmail.com" # # MIT License # # Copyright (c) 2018 liantian # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to ...
versionupdater.py
import time import pythoncom import pywintypes from manuallogin import * from PyQt5 import QtWidgets 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 class Window(QtWidgets...
Main.py
import subprocess, cv2, numpy as np, matplotlib.pyplot as plt, operator, math import matplotlib.pyplot as plt, random, time, colorspacious as cs, argparse from matplotlib import cm, colors from ortools.constraint_solver import routing_enums_pb2, pywrapcp from sklearn.cluster import MiniBatchKMeans from collections im...
stage_op_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
email.py
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_with_attachment(to, subject, template, **kwargs): app = current_app._get_current_object...
web.py
import logging import random import threading import time from abc import ABC from threading import Thread from typing import Any, Callable, Collection, List, NamedTuple, NewType, Union from absl import flags from cheroot.wsgi import Server as WSGIServer from injector import Binder, Injector, Module, inject, multiprov...
instance.py
import os import sys import time import shlex import signal import logging import traceback import subprocess as sp import multiprocessing as mp import path import daemon import packaging logger = logging.getLogger(__name__) def status(module_name): """ Return the status of the module *module_name* A mod...
EMAlgorithm.py
import math from TaxonomyTree import TaxonomyTree from threading import Thread from multiprocessing import Process class EMAlgorithm: def __init__(self): self.taxTree = TaxonomyTree() self.reads, self.genomes = [], [] self.pi_list, self.delta_list = [], [] self.a_list, self.b_list ...
cork.py
#!/usr/bin/env python # # Cork - Authentication module for tyyhe Bottle web framework # Copyright (C) 2013 Federico Ceratto and others, see AUTHORS file. # # This package 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 Soft...
test_lock.py
""" TestCases for testing the locking sub-system. """ import time import unittest from test_all import db, test_support, verbose, have_threads, \ get_new_environment_path, get_new_database_path if have_threads : from threading import Thread import sys if sys.version_info[0] < 3 : from thr...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_ltc.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum_ltc.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum_ltc.bip32 import BIP32Node from electrum_ltc import constants from electrum_ltc.i18n imp...
postproc.py
#!/usr/bin/python3 -OO # Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...
Steamwatcher.py
""" This Python modules describes an application that checks for active steam downloads and shuts down the computer when they are all finished. """ import os import signal import threading import subprocess import winreg as reg import tkinter as tk import tkinter.filedialog import tkinter.messagebox import tkinter.scr...
monitored_session_test.py
# pylint: disable=g-bad-file-header # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
Client.py
import socket, sys, threading, re, time, bcrypt, os, json, hashlib, rsa from tkinter import * class Logging: def log(message): if True: print(message) class SocketHandler: def start(_server, _port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server = _server ...
eventsSSL.py
import base64 import datetime import socket import select import ssl import sys from threading import Thread import xml from xml.dom import minidom from PyISY.Events import strings POLL_TIME = 5 SOCKET_BUFFER_SIZE = 4096 class SSLEventStream(object): def __init__(self, parent, lost_fun=None): self.paren...
analyze_cam_universal.py
import json import cv2 import numpy as np import time import requests from PIL import Image from io import BytesIO import threading from filelock import Timeout, FileLock import os historyQueue = [] # rolling history of recent webcam images to help detect spoofing timestamps = [] IMAGE = 0 # index of image for eac...
server.py
# Import libraries and necessary variables/classes import socket import threading from client import Client from vars import * # Intialize all variables needed for the server clients = [] stop_thread = False # Send a message to all clients def broadcast(msg): for client in clients: client.send(msg) ...
utils.py
# -*- coding: utf-8 -*- import logging import os import re import requests import time import zipfile from datetime import datetime from getpass import getpass from threading import Thread, Event from tqdm import tqdm from plexapi import compat from plexapi.exceptions import NotFound # Search Types - Plex uses these t...
tello.py
import socket import threading import time import cv2 from easytello.stats import Stats class Tello: def __init__(self, tello_ip: str='192.168.10.1', debug: bool=True): # Opening local UDP port on 8889 for Tello communication self.local_ip = '' self.local_port = 8889 self...
instrument_protocol.py
#!/usr/bin/env python """ @package ion.services.mi.instrument_protocol Base instrument protocol structure @file ion/services/mi/instrument_protocol.py @author Steve Foley, Bill Bollenbacher @brief Instrument protocol classes that provide structure towards the nitty-gritty interaction with individual instrument...
bridge.py
#!/usr/bin/env python # # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # """ Rosbridge class: Class that handle communication between CARLA and ROS """ try: import queue except ImportError: impor...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Elixir 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...
utils.py
import pandas as pd import numpy as np import matplotlib.pyplot as plt import os import time, sys import ipdb import json import requests import datetime import re import scipy.special import shutil import _settings LOG_FOLDER = _settings.LOG_OUTPUT_DIR TODAY_STR = datetime.datetime.today().strftime('%Y%m%d') def me...
flask_gunicorn_embed.py
# Asyncio wird benötigt um in python IO zu parallelisieren try: import asyncio except ImportError: raise RuntimeError("This example requries Python3 / asyncio") # Bokeh Abhängigkeiten from bokeh.application import Application from bokeh.application.handlers import FunctionHandler from bokeh.embed import serve...
test_keyinput.py
# See this github: https://gist.github.com/atupal/5865237 if 1: import sys, select print "You have ten seconds to answer!" i, o, e = select.select( [sys.stdin], [], [], 10 ) if (i): print "You said", sys.stdin.readline().strip() else: print "You said nothing!" elif 0: # erro...
player_wrapper.py
import logging import threading import time from collections import deque from concurrent.futures import ThreadPoolExecutor from enum import Enum from pathlib import Path import psutil from omxplayer import keys from omxplayer.player import OMXPlayer from .config import config from .history import History logger = ...
server.py
# -*- coding:utf-8 -*- import sys from flask import Flask from multiprocessing import Queue from multiprocessing import Manager, Value from multiprocessing import Process import sophon.sail as sail from pack import Pack from utils import * import time import signal import threading import cv2 import os import mult...
test_nvml.py
import multiprocessing as mp import os import pytest pytestmark = pytest.mark.gpu pynvml = pytest.importorskip("pynvml") import dask from distributed.diagnostics import nvml from distributed.utils_test import gen_cluster def test_one_time(): if nvml.device_get_count() < 1: pytest.skip("No GPUs availa...
test_create_collection.py
import pdb import copy import logging import itertools import time import threading from multiprocessing import Process import sklearn.preprocessing import pytest from utils import * from constants import * uid = "create_collection" class TestCreateCollection: """ ********************************************...
api.py
import threading from typing import Union import jesse.helpers as jh from jesse.models import Order class API: def __init__(self) -> None: self.drivers = {} if not jh.is_live(): self.initiate_drivers() def initiate_drivers(self) -> None: for e in jh.get_config('app.consi...
V6_2_SAC_Multi_EOP.py
''' Soft Actor-Critic version 2 using target Q instead of V net: 2 Q net, 2 target Q net, 1 policy net add alpha loss compared with version 1 paper: https://arxiv.org/pdf/1812.05905.pdf https://github.com/quantumiracle/SOTA-RL-Algorithms ''' import random import gym import numpy as np import time import torch impor...
test_server.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import threading import time import pytest import errno import os from ssdpy import SSDPServer from ssdpy.compat import LINUX, WINDOWS, MACOSX def test_server_ipv4(): server = SSDPServer("test-server", proto...
test_camera_over_thrift.py
import threading import sys import time import pytest from thriftpy.rpc import make_server, client_context from . import AbstractCameraContract from .. import pepi_thrift if sys.version_info < (3,): text_type = (str, unicode) binary_type = str else: text_type = str binary_type = bytes # noinspectio...
w3mo.py
#!/usr/bin/python3 import sys import socket import requests import threading import xml.etree.ElementTree as ET debug = False devices = {} ## self.state = 3 means setting state from function call failed class _DEFAULTS(): headers={ 'User-Agent': '', 'Accept': '', 'Content-Type...
GuiClient.py
#!/usr/bin/env python3 from tkinter import * from tkinter import ttk import sys from MessageEvents import MessageEvents import Client from threading import Thread args = sys.argv[1:] """ Receives the host and port from command line Then calls the Client to obtain the transport socket """ if len(args) != 2: print...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import io import errno import os import time try: import ssl except ImportError: ssl = None from unittest import TestCase from test im...
pre_commit_linter.py
# coding: utf-8 # # Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
datalogger.py
''' Created on Oct 14, 2018 @author: Vinu Karthek ''' import os, datetime, threading from classes import tkinter_app def init(datalog_path): #Initialize the class with Datalog file path max_file_size = 0 #Check if datalog path is a file or a directory if not os.path.isdir(datalog_path): datal...
Logger.py
import queue import threading from .constants import * def verifyKey(item, keyName): if type(keyName)!=str: raise Exception("Key type excpected to be str but got {}".format(type(keyName))) if keyName in item: return True else: raise Exception("Key {} doesn't exist in item: {}".format(keyName, item)) def veri...
test_scan_testdata.py
import unittest import subprocess import os import tempfile import http.server import ssl import threading TESTDATA_REPO = "https://github.com/hannob/snallygaster-testdata" TESTDATA = {"backup_archive": "[backup_archive] https://localhost:4443/backup.zip", "git_dir": "[git_dir] https://localhost:4443/.git...
exp_manager.py
import argparse import os import pickle as pkl import time import warnings from collections import OrderedDict from pprint import pprint from typing import Any, Callable, Dict, List, Optional, Tuple import gym import numpy as np import optuna import yaml from optuna.integration.skopt import SkoptSampler from optuna.pr...
multi_pro2.py
#!/bin/env python # coding:utf-8 from multiprocessing import Process, Queue import os, time, random # 写数据进程执行的代码: def write(q): for value in ['A', 'B', 'C']: print 'Put %s to queue...' % value q.put(value) time.sleep(random.random()) # 读数据进程执行的代码: def read(q): while True: if no...
__init__.py
"""Easy to use python subprocess interface.""" import logging import os.path import signal import subprocess import tempfile import threading import time from easyprocess.about import __version__ from easyprocess.unicodeutil import split_command, unidecode, uniencode log = logging.getLogger(__name__) log.debug("ver...
manager.py
#!/usr/bin/env python # coding=utf-8 """ Copyright (C) 2010-2013, Ryan Fan <ryan.fan@oracle.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your opti...
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...
server8001.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer except ImportError: from http.server import BaseHTTPRequestHandler,HTTPServer from datetime import datetime import socketserver, threading, time try: import urlparse except ImportError: from...
cmd_helper.py
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper for subprocess to make calling shell commands easier.""" import logging import os import pipes import select import signal import string im...
translation_train.py
from modules import * from loss import * from optims import * from dataset import * from modules.config import * #from modules.viz import * import numpy as np import argparse import torch from functools import partial import torch.distributed as dist def run_epoch(epoch, data_iter, dev_rank, ndev, model, loss_compute,...
tools.py
import atexit from ConfigParser import RawConfigParser from mininet.topo import Topo import logging import os import random import re import subprocess import tempfile import threading import time import Pyro4 if hasattr(Pyro4.config, 'SERIALIZERS_ACCEPTED'): # From Pyro 4.25, pickle is not supported by default d...
simple_program_gevent.py
from gevent import monkey monkey.patch_all() import threading # do not use pyddprofile; the monkey-patching would be done too late import ddtrace.profiling.auto from ddtrace.profiling import bootstrap from ddtrace.profiling.collector import stack def fibonacci(n): if n == 0: return 0 elif n == 1: ...
test_sslpsk.py
# Copyright 2017 David R. Bild # # 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 agree...
video2video.py
import cv2 import os import argparse import threading from dir_operation import * from tqdm import tqdm videocounter = 0 validThread = 4 def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--srcpath', required=True) parser.add_argument('--dstpath', required=True) # p...
web.py
#!/usr/bin/python3 import alarm import time import datetime import threading from bottle import route, request, run, template, static_file format = "%a %d-%b-%Y %H:%M" timeformat = "%H:%M" dateformat = "%Y-%m-%d" alarms = alarm.alarmset() def render_topbar(alarms): '''renders the top bar od the alarm from a temp...
MyStu_Tello3_Demo.py
# tello 使用 Python 控制 # 从这个官方代码来看 ,这开放了一个命令行接收和发送的 “字符”通信的API接口 # 这是设计的有够简单 # (看了一遍 做做笔记) import threading import socket import sys import time import platform # 模块 Platform : 这个模块尝试尽可能多的 平台标识数据,它通过函数API来提供这些信息 host = '' post = 9000 locaddr = (host,port) # 创建 UDP 接收字 模块 sock sock = socket.socket(socket.AF_INET,sock...
content_bruter.py
import urllib2 import urllib import threading import Queue threads = 5 target_url = "http://testphp.vulnweb.com" wordlist_file = "/tmp/all.txt" # from SVNDigger resume = None user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0" def build_wordlist(wordlist_file):...
queue.py
import time import threading from random import random from Queue import Queue q = Queue() def double(n): return n * 2 def producer(): while 1: wt = random() time.sleep(wt) q.put((double, wt)) def consumer(): while 1: task, arg = q.get() print( arg, task(arg)) ...
kafka_mesh_integration_test.py
#!/usr/bin/python import random import os import shutil import socket import subprocess import tempfile from threading import Thread, Semaphore import time import unittest import random from kafka import KafkaConsumer, KafkaProducer, TopicPartition import urllib.request class IntegrationTest(unittest.TestCase): ...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import _ from electrum.transaction im...
common.py
import logging import time from contextlib import contextmanager from queue import Empty from queue import PriorityQueue from queue import Queue from threading import Condition from threading import Event from threading import Thread from typing import Any from typing import Collection from typing import Generator from...
test_build.py
# This script should run without errors whenever we update the # kaggle/python container. It checks that all our most popular packages can # be loaded and used without errors. import numpy as np print("Numpy imported ok") print("Your lucky number is: " + str(np.random.randint(100))) # Numpy must be linked to the MKL....
j1939.py
import queue import cancat import struct from .J1939db import * from cancat import * import vstruct from vstruct.bitfield import * PF_RQST = 0xea PF_TP_DT = 0xeb PF_TP_CM = 0xec PF_ADDRCLAIM = 0xee PF_PROPRIETRY= 0xef PF_KWP1 = 0xdb PF_KWP2 = 0xda PF_KWP3 = 0xce PF_KWP4 = 0xc...
16_edf_wait_die_NS.py
from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp from threading import Thread import paramiko import ast import time import datetime as dt import os import getpass as gp import data hosts = {} # {hostname: i...
xmppclient.py
import logging import time from multiprocessing import JoinableQueue from multiprocessing import Lock from multiprocessing import Process import xmpp from pushmanager.core.settings import Settings class XMPPQueue(object): MAX_RETRY_COUNT = 3 retry_messages = {} retry_messages_lock = Lock() message_...
game2text.py
import eel import threading, os, platform from pathlib import Path from ocr import detect_and_log from translate import multi_translate from hotkeys import refresh_ocr_hotkey, esc_hotkey from util import RepeatedTimer, open_folder_by_relative_path, create_directory_if_not_exists from audio import get_recommended_device...
training.py
# Copyright 2018-2020 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' fil...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
data_transfer.py
""" High-level helper functions for uploading and downloading fragments. """ from __future__ import print_function import gzip import os import re from shutil import copyfileobj, move import tempfile from threading import Thread, Lock import requests from requests.adapters import HTTPAdapter from requests.packages.ur...
util.py
import re import itertools import threading import time import sys from termcolor import colored from fake_useragent import UserAgent from selenium import webdriver from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager ua = UserAgent() class Animate: d...
callbacks.py
### # Copyright (c) 2002-2005, Jeremiah Fincher # Copyright (c) 2008-2010, James Vega # 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 must retain the above c...
mpbz2.py
#!/usr/bin/env python # Simple test of parallelizing bz2 via multiprocessing # polypore: # 32768 40: 165 MiB/s (vs. 70.5 MiB/s for threads) # 32768 20: 120 MiB/s (vs. 90.7 MiB/s for threads) # 65536 20: 137 MiB/s (vs. 134 MiB/s for threads) # 65536 40: 177 MiB/s (vs. 136 MiB/s for threads) import sys import bz2 ...
MainFrame.py
# -*- coding: utf-8 -*- # import os import sys import wx import threading from form.panel.FilePanel import FilePanel from form.panel.MorphPanel import MorphPanel from form.panel.MultiPanel import MultiPanel from form.panel.ArmPanel import ArmPanel from form.panel.CameraPanel import CameraPanel from form.panel.CsvPanel...
main.py
import threading import queue import socket #import socks MAX_NUMBER_PORTS = 1000 # 65535 NUMBER_THREADS = 30 LOOPBACK_INTERFACE_IP = '127.0.0.1' TOR_PORT = 9050 ip = input("ip : ") my_queue = queue.Queue() #socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, LOOPBACK_INTERFACE_IP, TOR_PORT) #socket.socket = socks.socks...
Main.py
import pandas import City import threading import time import Codes #Creamos un objeto Codes a partir de los codigos IATA de la base de datos airportcodes IATA = Codes.Codes('airportcodes.csv') CODES = IATA.get_codes() #Lee el primer dataset y va imprimiendo en pantalla la información a partir del archivo def read1()...
peer_module.py
import socket import threading import random import p2p class Peer: """""" ip : str controlPort : int connectionPorts : list service : str peerList : list maxConnection : int serverThreads : list clientThreads : list serverState : list running : bool controlSocket : s...
client.py
# Copyright 2021 Cortex Labs, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
stingy_spendy.py
import time from threading import Thread, Lock class StingySpendy: money = 100 mutex = Lock() def stingy(self): for i in range(1000000): self.mutex.acquire() self.money += 10 self.mutex.release() print("Stingy Done") def spendy(self): for i...
SlicerExtensionBuildSystemTest.py
from __future__ import print_function import hashlib import io import json import os import unittest import random import re import string import subprocess import sys import textwrap import threading import http.server import socketserver as socketserver from urllib.parse import urlparse, parse_qs import SlicerExte...
ex3.py
import time import threading def thread_function (): for i in range (6): print (i) time.sleep(1) t = threading.Thread (target=thread_function, daemon=True) t.start() # main process for i in range (2): print ('main {}'.format (i)) time.sleep (1)
marshal_server.py
# Copyright 2019 Atalaya Tech, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, ...
test_concurrency.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" import glob import os import random import sys import threading import time from flaky import flaky import coverage from c...
messaging.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """An implementation of the session and presentation layers as used in the Debug A...
websocket_client.py
import json import logging import gzip import socket import ssl import sys import traceback from datetime import datetime from threading import Lock, Thread from time import sleep from typing import Optional import websocket from vnpy.trader.utility import get_file_logger class WebsocketClient: """ Websocke...
main.py
import os import sys import cv2 import numpy as np import threading import imutils import time import warnings import argparse from detector import Detector from imutils.video import VideoStream from flask import Flask, Response, url_for, redirect, render_template from yolo_config import * from web3 import Web3 warning...
exporter.py
#!/usr/bin/env python # vim: tabstop=4 expandtab shiftwidth=4 import argparse import requests import yaml import threading import time from os import environ # Prometheus client library from prometheus_client import CollectorRegistry from prometheus_client.core import Gauge from prometheus_client.exposition import CO...
restserver.py
import cherrypy, threading SERVER_PORT = 8080 MAX_COUNT = 1000 class RestServerHandler: """ Handler-Klasse für einen einfachen, eingebauten Webserver. Der Webserver startet auf Port SERVER_PORT und liefert eine einfache JSON-Struktur mit MAX_COUNT Datensätzen, die seit dem Start der Anwendung gemessen...
dal_ros_aml.py
#!/usr/bin/env python from __future__ import print_function import rospy import actionlib from move_base_msgs.msg import * from sim.utils import * from random_box_map import * from navi import * from sensor_msgs.msg import LaserScan from nav_msgs.msg import Odometry from geometry_msgs.msg import PoseStamped, Twist fro...
dokku-installer.py
#!/usr/bin/env python2.7 import cgi import json import os import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.4.14' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = subprocess....
image_server.py
#! /usr/bin/python3 import io import os import sys import time import gflags import logging import unittest import numpy as np import matplotlib.pyplot as plt from http.server import BaseHTTPRequestHandler, HTTPServer from PIL import Image from threading import Thread, Lock import hashlib import util gflags.DEFINE_in...