source
stringlengths
3
86
python
stringlengths
75
1.04M
sftp_file.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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,...
decorators.py
from threading import Thread def async(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() return wrapper
deviceserver.py
#!/usr/bin/env python # # Copyright (c) 2015-2016, Yanzi Networks AB. # 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 # n...
maintainer.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ A wiki-maintainer script that shares tasks between workers, requires no intervention. This script requires the Python IRC library http://python-irclib.sourceforge.net/ Warning: experimental software, use at your own risk """ __version__ = '$Id: 55d29d9f38fc751e8f84d9...
main.py
from minecraft import Minecraft from ircd import IRC import threading thread_lock = threading.Lock() def main(): mc = Minecraft() irc = IRC() mc.set_irc(irc) irc.set_mc(mc) mc.set_thread_lock(thread_lock) irc.set_thread_lock(thread_lock) th = threading.Thread(target=irc.run) th.s...
scanner.py
import socket import os import struct import threading import time from netaddr import IPNetwork, IPAddress from ctypes import * """ This script sniffs network packets received to a given host and decodes the packets to show packet type, source, and destination in human readable form. Note: Promiscuous mode is need...
pipeline.py
import time from collections import OrderedDict from itertools import chain, cycle from threading import Thread from .queue import AsyncQueue, Signal, StubQueue, VoidQueue, is_stop_signal from .timer import TimerGroup, IncrementalTimer class PipelineStep: def __init__(self): self.input_queue = None ...
matchmaker_service.py
import firebase_admin from firebase_admin import credentials, firestore from game import Game from game_engine import messages from game_engine.common import GameOptions, GameSchedule, STV_I18N_TABLE, ISODayOfWeek, log_message from game_engine.database import Database from game_engine.engine import Engine from g...
config_csr1000v.py
#!/usr/bin/env python3 # scripts/config_csr1000v.py # # Import/Export script for vIOS. # # @author Andrea Dainese <andrea.dainese@gmail.com> # @copyright 2014-2016 Andrea Dainese # @license BSD-3-Clause https://github.com/dainok/unetlab/blob/master/LICENSE # @link http://www.unetlab.com/ # @version 20160719 import ge...
Keeper.py
import socket import argparse import threading import re import pickle import time from colorama import Fore, Style from argparse import RawTextHelpFormatter styleKeeper = Fore.CYAN + Style.BRIGHT styleHeartbeat = Fore.RED + Style.BRIGHT class Keeper(): def __init__(self, ip, port): ''' Construto...
kb_assembly_compareServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import verbose, import_module, cpython_only, unlink from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import time import unittest import wea...
nn.py
r""" Neural network modules, datasets & data loaders, and other utilities """ import collections import functools import multiprocessing import operator import os import queue import signal from math import ceil, sqrt from typing import Any, Hashable, List, Mapping, Optional, Tuple import numpy as np import pynvml im...
GEMMA_GWASServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
eventEngine.py
# encoding: UTF-8 # 系统模块 from Queue import Queue, Empty from threading import Thread from time import sleep from collections import defaultdict # 第三方模块 from qtpy.QtCore import QTimer # 自己开发的模块 from .eventType import * ######################################################################## class EventEngine(object...
checkData.py
#!/usr/bin/python # -*- coding:utf-8 -*- import obsPyCmd import hashlib import random import logging import re import time import os import threading logFile = 'log/checkData.log' if not os.path.exists('log'): os.mkdir('log') if os.path.exists(logFile) and os.path.getsize(logFile) > 104857600: os.remove(logFile) logg...
ShellGuiWebSocketHandler.py
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, # as published by the Free Software Foundation. # # This program is also distributed with certain software (including # ...
test.py
import argparse import json import os from pathlib import Path from threading import Thread import numpy as np import torch import yaml from tqdm import tqdm from models.experimental import attempt_load from utils.datasets import create_dataloader from utils.general import coco80_to_coco91_class, check_dataset, check...
multipartupload.py
import argparse import boto3 import json import multiprocessing # Starts Multipart Upload def start_upload(bucket, key): boto3.setup_default_session(profile_name='cloudguru') s3_client = boto3.client('s3') response = s3_client.create_multipart_upload( Bucket = bucket, Key = key ) ...
tcp_serial_redirect.py
#!/usr/bin/env python # (C) 2002-2009 Chris Liechti <cliechti@gmx.net> # redirect data from a TCP/IP connection to a serial port and vice versa # requires Python 2.2 'cause socket.sendall is used import sys import os import time import threading import socket import codecs import serial try: True except NameErro...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import multiprocessing import os import random import shutil import sys import tarfile import threading import time import traceback import zipfile ...
wallet.py
# Electrum ABC - lightweight eCash client # Copyright (C) 2020 The Electrum ABC developers # 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 restr...
vc.py
# -*- coding: utf-8 -*- """Prompt formatter for simple version control branches""" # pylint:disable=no-member, invalid-name import os import sys import queue import builtins import threading import subprocess import re import xonsh.tools as xt from xonsh.lazyasd import LazyObject RE_REMOVE_ANSI = LazyObject( lam...
crusher.py
import stuff.banner import argparse import sys import threading import random import socket import time # Arguments # parser = argparse.ArgumentParser( prog="Crusher", description="A Powerful, Modern DDoS Attack Tool", epilog="Copyright (c) 2020, Paxv28, All rights reserved." ) parser.add_argument( "-t...
application.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...
example2.py
import threading import random import time def update(): global counter with count_lock: current_counter = counter # reading in shared resource time.sleep(random.randint(0, 1)) # simulating heavy calculations counter = current_counter + 1 counter = 0 count_lock = threading.Lock() ...
monitor-cloud.py
from threading import Thread import time from django.core.management.base import BaseCommand from clouds.models import Instance class Command(BaseCommand): help = 'monitor cloud resource periodly' def handle(self, *args, **options): while True: for instance in Instance.objects.exclude(uuid...
stopcron.py
#!/usr/bin/python import argparse import getpass import os import sys import paramiko import socket import Queue import threading import time def sshStopCron(retry,hostname): global user global password if retry == 0: print "Stop Cron Failed in", hostname q.task_done() return t...
multiprocess.py
import torch.multiprocessing as mp import keyboard from PIL import Image import torchvision from base import * from test import Time_counter import _init_paths from utils.demo_utils import OpenCVCapture, Open3d_visualizer class Multiprocess(Base): def __init__(self): self.run_single_camera() ...
daemon.py
#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- ############################################################################ # # # Copyright (c) 2017 eBay Inc. # # ...
test_pypi.py
# The piwheels project # Copyright (c) 2017 Ben Nuttall <https://github.com/bennuttall> # Copyright (c) 2017 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistribution...
test_script.py
import threading as th import time class Flag: def __init__(self, status=True, data=[]): self.status = status self.data = data def toggle(self): self.status = not self.status def counter(flag): while 1: if len(flag.data) == 10: print('Lista llena') ...
train.py
#!/usr/bin/env python import os import json import torch import numpy as np import queue import pprint import random import argparse import importlib import threading import traceback from tqdm import tqdm from utils import stdout_to_tqdm from config import system_configs from nnet.py_factory import NetworkFactory fr...
controller_img_dnn.py
#!/usr/bin/env python3 from datetime import datetime from pathlib import Path import subprocess import gym import os from silence_tensorflow import silence_tensorflow silence_tensorflow() from stable_baselines import DQN from stable_baselines import PPO2 import threading import time import configparser import loggers i...
test_pantsd_integration.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import datetime import itertools import os import re import signal import sys import threading import time import unittest from textwrap import dedent from pants.util.contextutil import e...
td_rtd.py
"""Excel RTD (RealTimeData) Server sample for real-time stock quote. """ import excel_rtd as rtd import tdapi as ta from datetime import datetime import threading import pythoncom import win32api import win32com.client from win32com.server.exception import COMException import logging import os import time import asynci...
kegman_conf.py
import json import copy import os import threading import time from selfdrive.swaglog import cloudlog from common.basedir import BASEDIR def read_config(): default_config = {"cameraOffset": 0.06, "lastTrMode": 1, "battChargeMin": 90, "battChargeMax": 95, "wheelTouchSeconds": 1800, "battPercOff": ...
xla_client_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...
data_utils.py
# Lint as python3 # Copyright 2018 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 r...
dalton.py
#!/usr/local/bin/python """ Dalton - a UI and management tool for submitting and viewing IDS jobs """ # Copyright 2017 Secureworks # # 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...
update_features.py
import Queue import threading from tqdm import tqdm import pandas as pd import requests from app.utils import website_exists def update_df(path="data/processed_data.csv"): THREADS_COUNT = 5 data_frame = pd.DataFrame.from_csv(path) bar = tqdm(total=len(data_frame)) df_q = Queue.LifoQueue() df_q.put...
measure motion time with PIR.py
# Import standard python modules import time import datetime import sys import threading # Import GPIO Module import RPi.GPIO as GPIO # Control of sincronization in Threads lock = threading.RLock() # Setup Sensor pin var SENSOR_PIN = 5 # Setup var controls showDataTime=5 # Define class for instance objects in th...
SentenceTransformer.py
import json import logging import os import shutil from collections import OrderedDict from typing import List, Dict, Tuple, Iterable, Type, Union, Callable from zipfile import ZipFile import requests import numpy as np from numpy import ndarray import transformers import torch from torch import nn, Tensor, device from...
runtests.py
#!/usr/bin/env python3 # vim:ts=4:sw=4:et: # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # no unicode literals from __future__ import absolute_import, division, print_function import argp...
transaction.py
#!/usr/bin/env python3 # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including withou...
main_thread.py
import threading import time def my_child_thread(): print("Child Thread Starting") time.sleep(5) print("Current Thread ----------") print(threading.current_thread()) print("-------------------------") print("Main Thread -------------") print(threading.main_thread()) print("------------...
wait_for_tests.py
#pylint: disable=import-error from six.moves import queue import os, time, threading, socket, signal, shutil, glob #pylint: disable=import-error from distutils.spawn import find_executable import logging import xml.etree.ElementTree as xmlet import CIME.utils from CIME.utils import expect, Timeout, run_cmd_no_fail, sa...
ExtToolDefs.py
import json import time from threading import Thread def fileToJson(filename, encoding="utf-8"): f = open(filename, 'r') content = f.read() f.close() try: return json.loads(content) except: return None class BaseIndexWriter: ''' 基础指标输出工具 ''' def __init__(self): ...
conftest.py
import logging import os import tempfile import pytest import threading from datetime import datetime import random from math import floor from ocs_ci.utility.utils import TimeoutSampler, get_rook_repo from ocs_ci.ocs.exceptions import TimeoutExpiredError from ocs_ci.utility.spreadsheet.spreadsheet_api import GoogleSp...
surface_stats_collector.py
# Copyright 2013 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. import Queue import datetime import logging import re import threading from pylib import android_commands from pylib.device import device_utils # Log marke...
convert_tfrecords.py
# Copyright 2018 Changan Wang # 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, so...
pocketsphinxtrigger.py
import os import threading import logging import platform from pocketsphinx import get_model_path from pocketsphinx.pocketsphinx import Decoder import alexapi.triggers as triggers from .basetrigger import BaseTrigger logger = logging.getLogger(__name__) class PocketsphinxTrigger(BaseTrigger): type = triggers.TYP...
proxy.py
import socket, threading, sys, json from enum import Enum import hexdump from colorama import Fore import select from .util import Direction, print_info, get_direction_label from .proxy_config import load_config, ProxyConfig, ProxyItem import time from select import poll running_proxies = {} stop_proxies = False confi...
command.py
# -*- coding: UTF-8 -*- # This file is part of the jetson_stats package (https://github.com/rbonghi/jetson_stats or http://rnext.it). # Copyright (c) 2019 Raffaello Bonghi. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published...
mar_server.py
import socket, time, sys, struct, os import cv2, pickle, threading import numpy as np from flask import request, url_for from flask_api import FlaskAPI, status, exceptions from os import listdir from os.path import isfile, join HOST = '0.0.0.0' USER_PORT = 9001 REST_PORT = 10001 BUFFER_SIZE = 256 SIZE = 100 # number ...
test_poplib.py
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import errno from unittest import TestCase, skipUnless from test import support as test_support threading = test_suppo...
__init__.py
#!/usr/bin/env python3 import mido from mido import Message, MidiFile, MidiTrack from dissect.cstruct import cstruct import threading import time import sys import bz2 import statistics from collections import defaultdict pico_in = mido.get_input_names()[1] # NOQA -- I like this indentation better pico_ou...
http.py
from __future__ import print_function import base64 import copy import json import logging import os import random import ssl import string import sys import threading import time from builtins import object from builtins import str from flask import Flask, request, make_response, send_from_directory from werkzeug.se...
model.py
""" -*- coding: utf-8 -*- Python Version: 3.6 Course: GEOG5790M Programming-for-Spatial-Analysts-Advanced-Skills Author: Annabel Whipp File name: model.py """ # imports from landscape import Landscape from agent import Agent import random import multiprocessing class Model : ...
socketserver.py
""" Copyright (c) 2006 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc 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, or (at your option) any later ...
tests.py
#! /usr/bin/env python3 import http.server import os import shutil import socket import subprocess import tempfile import threading import unittest class WrapperScriptTests(unittest.TestCase): http_port = 8080 default_download_url = "http://localhost:" + str(http_port) + "/test/testapp.jar" minimum_scri...
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...
handlers.py
# coding: utf-8 from operator import attrgetter import multiprocessing import threading import logging import sys import traceback from getpass import getpass import smtplib import email.utils from email.message import EmailMessage from logging import StreamHandler, ERROR, LogRecord from logging.handlers import SMTPHan...
device_controller.py
''' Device Controller to handle devices ''' import json import logging import queue import threading from http import HTTPStatus import requests from utils import utils from utils.errors import AldebaranError, ArchitectureError from utils.utils import GenericRequestHandler, GenericServer from hardware.memory.memory ...
cyber_launch.py
#!/usr/bin/env python3 # **************************************************************************** # Copyright 2018 The Apollo 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 o...
run.py
from sancty.deps_types import Queue, Event, QueueEmpty, Terminal, Callable from sancty.read import Reader, ReaderProtocol from sancty.render import Renderer, RendererProtocol import multiprocessing as mp def create_process_reader(clss: ReaderProtocol): class ProcessReadr(clss): render_queue: Queue ...
uexpect.py
# Copyright (c) 2019 Vitaliy Zakaznikov # # 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 i...
test_upload_and_restore.py
import filecmp import os import tempfile import threading from concurrent import futures import grpc import pytest from pysrbup.backup_system_pb2_grpc import (BackupStub, add_BackupServicer_to_server) from pysrbup.client import BackupClient from pysrbup.server import Backup...
server.py
from flask import Flask,render_template,request,jsonify import multiprocessing as mp import feedparser import tweepy import time from dateutil import parser #config app = Flask(__name__) #setup variables setup=[] feed=[] running=False process=None user = "Bot Inactive" #authenticating twitter accoun...
logger_hanlder.py
import re import sys import json import atexit import logging import traceback from enum import Enum from time import time, sleep from threading import Thread import six from .logclient import LogClient from .logitem import LogItem from .putlogsrequest import PutLogsRequest from .version import LOGGING_HANDLER_USER_A...
CAPSTONEPT2edit.py
import hashlib import time import os import multiprocessing as mp import concurrent.futures from threading import Thread hashvalues = [] threads = [] processes = [] cpus = os.cpu_count() textfile = "sampleData.txt" currentDir = os.getcwd() text_file = open(os.path.join(currentDir, textfile), 'r') text = text_file.read...
game_loop_process.py
import asyncio from aiohttp import web from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor from multiprocessing import Queue, Process import os from time import sleep async def handle(request): index = open("index.html", 'rb') content = index.read() return web.Response(body=content, co...
threadtest.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """" a test module """ __author__ = 'zmy' import time, threading # 新线程执行的代码: def loop(): print('thread %s is running...' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('thread %s >>> %s' % (threading.current_thread()...
main.py
print('Import io') import io print('Import os') import os print('Import base64') import base64 print('Import cv2') import cv2 print('Import json') import json print('Import time') import time print('Import queue') import queue print('Import threading') import threading print('Import flask') from flask import Flask, se...
websocket_layer.py
import threading from channels.generic.websocket import WebsocketConsumer from django.conf import settings from server.models import RemoteUserBindHost from webssh.models import TerminalSession import django.utils.timezone as timezone from django.db.models import Q from asgiref.sync import async_to_sync from util.tool ...
fork_sample.py
import meinheld from multiprocessing import Process import signal workers = [] def hello_world(environ, start_response): status = '200 OK' res = "Hello world!" response_headers = [('Content-type','text/plain'),('Content-Length',str(len(res)))] start_response(status, response_headers) # print enviro...
safaribooks.py
#!/usr/bin/env python3 # coding: utf-8 import re import os import sys import json import shutil import pathlib import getpass import logging import argparse import requests import traceback from html import escape from random import random from lxml import html, etree from multiprocessing import Process, Queue, Value f...
port_scanner.py
#!/usr/bin/python ################ # Port Scanner - A Multi-threaded approach # Scans well-known system ports and returns if they are open or closed. # To increase performance of scanning, adjust delay where necessary. ################ import socket, threading host = raw_input("Enter an address to scan: ") ip = socket....
messaging.py
from threading import Thread from traceback import format_exc import zmq import logging class MessageQueue(): def __init__(self): self.__handlers = {} self.__zmq_context = zmq.Context() self.__out_socket = self.__zmq_context.socket(zmq.PUSH) self.__thread = None self.__protocol = None self._...
def_parser.py
""" Author: Geraldo Pradipta BSD 3-Clause License Copyright (c) 2019, The Regents of the University of Minnesota 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 ...
mouse_control.py
import wiiboard import pygame import time import pyautogui import threading pyautogui.FAILSAFE = False THRESHOLD = 5 MOVEMENT_SCALE = 2 mouse_move_data = None done = False click = False key_sim = None def avg(x,y): return (x+y)/2 def threshold(x): return x**2 if abs(x) > THRESHOLD else 0 def move_mouse(tr,br,bl,...
injector.py
# Copyright 2015-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
installwizard.py
import sys import os from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import electrum_arg as electrum from electrum_arg import Wallet, WalletStorage from electrum_arg.util import UserCancelled, InvalidPassword from electrum_arg.base_wizard import BaseWizard from electrum_arg.i18n imp...
rdd.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...
cmd_telm_monitor.py
#!/usr/bin/env python import matplotlib matplotlib.use('TkAgg') from numpy import arange, sin, pi from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure from Tkinter import * import sys import threading import Queue import os import math import P...
utils.py
import requests import ConfigParser from bs4 import BeautifulSoup from time import sleep from clint.textui import progress import os, sys, itertools from threading import Thread from logs import * def ip_address(): """ Gets current IP address """ response = requests.get('http://www.ip-addr.es') pr...
threaded_portscan.py
"""Scan ports.""" import socket import threading from queue import Queue host = 'pythonprogramming.net' def portscan(host, port): """Scan ports.""" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: con = s.connect((host, port)) print('>>>', port, 'is open') con.close() ...
pmbus.py
# Copyright (c) 2021, Xilinx, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
dsc_io.py
#!/usr/bin/env python __author__ = "Gao Wang" __copyright__ = "Copyright 2016, Stephens lab" __email__ = "gaow@uchicago.edu" __license__ = "MIT" ''' Test rpy2 installation: python -m 'rpy2.tests' ''' from dsc.utils import flatten_list def load_mpk(mpk_files, jobs=2): import msgpack, collections from multiproc...
watchout_1.0.py
import sys sys.path.insert(0, './yolov5') from yolov5.utils.datasets import LoadImages, LoadStreams,LoadWebcam,LoadRealsense from yolov5.utils.general import check_img_size, non_max_suppression, scale_coords from yolov5.utils.torch_utils import select_device, time_synchronized from deep_sort_pytorch.utils.parser impor...
windbg.py
from multiprocessing.connection import Listener from pykd import * import os import re import string import sys import threading import time poll_time = .25 conn = None base = module.begin(getModulesList()[0]) bps = { } ip = None def start(pipe): global conn listener = Listener('\\\\.\\pipe\\' + pipe, backlo...
solution.py
import time import random from collections import defaultdict import numpy as np import copy import multiprocessing def process_generate_scratch(schedule_agent, cur_time, job_status, machine_status, coeff_tardiness, makespan_dict, data_ct_dict): makespan, op_seq_machines, job_seq_machines, start_time_op_macs, en...
cli_session.py
import sys from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x ON_POSIX = 'posix' in sys.builtin_module_names class CliSession(): def __init__(self, process): self.process = process self.stdout = Queue() ...
ircthread.py
#!/usr/bin/env python # Copyright(C) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, m...
Collect_and_labelV1.1.0.py
import pygatt # To access BLE GATT support import signal # To catch the Ctrl+C and end the program properly import os # To access environment variables from dotenv import load_dotenv # To load the environment variables from the .env file from random import random # Import required library for serial import time fro...
async.py
from modules import renderer, Path #from utils import alphaBlend import time import numpy as np from multiprocessing import Queue, Process import cv2 import os '''def alphaBlend(top, bottom): # takes an HSLA top and a bottom, blends and returns a HSL image #assert top.shape[0] == 4, "top must have ...
eNoseConnector.py
import re from threading import Thread from .EventHook import EventHook from threading import Lock import serial import serial.tools.list_ports import sys class eNoseConnector: """ Connects to an eNose on the given port with the given baudrate. Parses the input in a new thread and updates its values acco...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import queue import random import select import socket import subprocess import sys import tempfile import threading import time from collections import namedtuple from datetime import datetime from functools import partial from typing ...
rpc_test.py
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
getIp.py
# *-* coding:utf-8 *-* import requests from bs4 import BeautifulSoup import bs4 import lxml from multiprocessing import Process, Queue import random import json import time import requests class Proxies(object): """docstring for Proxies""" def __init__(self, page=3): self.proxies = [] self...