source
stringlengths
3
86
python
stringlengths
75
1.04M
watcher.py
import sys import time import json import elemental import threading import requests from seleniumwire import webdriver from selenium.webdriver.support.ui import Select from subprocess import check_output from dataclasses import dataclass from datetime import datetime import argparse import gc from logger import get_lo...
rqt_rosbag_control.py
#!/usr/bin/env python """ RQT Plugin to control rosbag playback """ import os import time import threading from python_qt_binding import loadUi # pylint: disable=import-error from python_qt_binding.QtGui import QPixmap, QIcon # pylint: disable=no-name-in-module, import-error from python_qt_binding.QtWidgets import ...
main_test_alone.py
# Copyright (c) 2020 PaddlePaddle 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 app...
bucketprocessor.py
from threading import Lock from threading import Thread from threading import Condition from framerate import FrameRate from frameduration import FrameDuration class BucketProcessor: def __init__(self,stream,ipdictionary, ipselection): print("Creating BucketProcessor for " + stream.name) self._lo...
flovis.py
# coding=utf-8 import websocket import socket import ssl import json import time import uuid from threading import Thread from helpers import log class Flovis: def __init__(self, host): self.host = host initialized = False attempts = 0 while not initialized and attempts < 5: ...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
generate_breakpad_symbols.py
#!/usr/bin/env python # Copyright (c) 2013 GitHub, Inc. All rights reserved. # Copyright (c) 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. """A tool to generate symbols for a binary suitable for breakpad. Currently...
udp_shotgun.py
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
train_abstractive.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch # from pytorch_transformers import BertTokenizer from transformers import BertTokenizer, AutoTokenizer import distributed from models imp...
utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ utility classes """ __author__ = "Robert Wen <robert.wen@nyu.edu>, Caicai Chen <caicai.chen@nyu.edu>" import os import md5 import json import Queue import threading import time class Worker(object): ''' Worker thread for concurrent process of tasks from a queue ...
raspivoice.py
import setproctitle #Set process name to something easily killable from threading import Thread import cv2 import os import subprocess #so I can run subprocesses in the background if I want #import ConfigParser #To read the config file modified by menu.py from subprocess import call #to call a process in the foreground...
test_tracker.py
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. # Copyright 2019 Kakao Brain # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this f...
test_kvstore.py
# -*- coding: utf-8 -*- import threading import unittest from sorl.thumbnail.kvstores.cached_db_kvstore import KVStore class KVStoreTestCase(unittest.TestCase): @unittest.skipIf(threading is None, 'Test requires threading') def test_cache_backend(self): kv = KVStore() cache_backends = [] ...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest from pathlib import Path from unittest import mock, skipIf from django.conf impo...
web_utils.py
#!/usr/bin/env python # -*-coding:utf-8-*- import threading import logging import requests import js2py from my_fake_useragent import UserAgent from datetime import datetime from dateutil.relativedelta import relativedelta from .cache_utils import cachedb, func_cache from .datetime_helper import get_times...
util.py
#!/usr/bin/python3 import os import sys import shutil import threading import traceback from time import sleep from datetime import time, date, datetime, timedelta class ansi: RESET = "\033[0m" BLACK = "\033[30m" RED = "\033[31m" GREEN = "\033[32m" YELLOW = "\033[33m" ...
datasets.py
import glob import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import math import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.general import xyxy2xywh, xywh2xyxy, torch_di...
local_timer_test.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import multiprocessing as mp import signal import time import unittest import unittest.moc...
server.py
from socket import socket from threading import Thread from multiprocessing import Process from bitgov.protocol.utilities import process_incoming, process_outgoing, switch def server_config(IPv, PROTOCOL, host, port): print("\033[1;33mSetting up the server.. \033[0;0m", end="") try: with socket(IPv, ...
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/...
absinthe_server.py
import threading import pyjsonrpc import json import os from geventwebsocket import WebSocketServer, WebSocketApplication, Resource from absinthe.tools.commands import CommandRequestHandler, external_jsonrpc_command from absinthe.message import Message from absinthe.tools.utils import SimpleResponse from absinthe.too...
main.py
import configparser import json import os import sys import threading import time import telebot import vk_api from telebot import types config = configparser.ConfigParser() config.read("settings.ini") vk_login = config["VK"]["login"] vk_password = config["VK"]["password"] telegram_token = config["Telegram"]["token...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
async_producer.py
# async_producer.py # # Implement same functionality as producer.py but without threads import time from collections import deque import heapq class Scheduler: def __init__(self): self.ready = deque() # Functions ready to execute self.sleeping = [] # Sleeping functions self.sequence = ...
test_operator_gpu.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
callbacks_test.py
# Copyright 2021 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...
experiment.py
import os import threading import traceback import yaml import json import helm import benchmark import logging from common import load_profiles, Context INVOCATIONS_DIR = "invocations" METRICS_DIR = "metrics" log = logging.getLogger('abm') def run(context: Context, args: list): """ Runs a single benchmark ...
process_task.py
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: process_task for a task(ProcessMode) Created: 2016/12/12 """ import unittest import time import multiprocessing import threading import sys import types import warnings from multiprocessing import Pipe from pprint import pprint...
estim.py
# Modified by Daniel Gomez-Sanchez: adding portableQueue dependency for MacOS compatibility, and opening bgzipped pileups from portableQueue import Queue import numpy as np from prob_cond_true_freq import prob_cond_true_freq from multiprocessing import Process, Lock import parse_pileup as pp class A: "class A" ...
parallelize.py
""" Author: Anastassios Dardas, PhD - Higher Education Specialist at Education & Research at Esri Canada Date: Q4 - 2021 About: Perform parallel processing. """ from multiprocessing import Process, Pool, set_start_method, cpu_count from tqdm import tqdm class ParallelProcess: def __init__(self, st...
test_external_step.py
import os import tempfile import time import uuid from threading import Thread import pytest from dagster import ( DynamicOut, DynamicOutput, Failure, Field, MetadataEntry, ModeDefinition, ResourceDefinition, RetryPolicy, RetryRequested, String, execute_pipeline, execut...
pygments_style.py
"""Display a "Color Styles" menu.""" from __future__ import annotations import threading import tkinter from typing import List, Optional, Tuple from pygments import styles, token # type: ignore[import] from porcupine import get_main_window, get_tab_manager, menubar, settings, utils def get_colors(style_name: str...
test.py
#!/usr/bin/env python3 import json import os import requests import tempfile import time import threading import queue import unittest from multiprocessing import Process from pathlib import Path from unittest import mock from websocket import ABNF from websocket._exceptions import WebSocketConnectionClosedException ...
manager.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...
test_stack.py
# -*- encoding: utf-8 -*- import os import threading import time import timeit import pytest from ddtrace.vendor import six from ddtrace.profiling import _nogevent from ddtrace.profiling import collector from ddtrace.profiling import profiler from ddtrace.profiling import recorder from ddtrace.profiling import _serv...
core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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-...
main.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from __future__ import division from __future__ import print_function import yaml import argparse import multiprocessing from qlib_server.config import init, LoggingConfig from qlib.log import get_module_logger, set_log_with_config from qlib_s...
utils.py
# coding=utf-8 # Copyright 2019 The SEED Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
mock_server.py
# ----------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ----------------------------------------------------------------------------- ""...
broadcast.py
#!/usr/bin/env python # # Peter F. Klemperer # # No-Frills Basic Broadcast Mechanism # # If re-writing this code, consider # seperating the networking functions # into a subclass apart from the # broadcast specific functions # # TODO # * Change the node_set into a Set() # # from __future__ import print_function impor...
dining-philosophers.py
import time from multiprocessing import Process, Semaphore n = 5 # number of philosophers m = 10 # number of times each philosopher eats # make semaphores sticks = [Semaphore(1) for _ in range(n)] procs = [] # making each philosopher hungry m times for i in range(n): def f(i): stick1, stick2 = (sticks[i...
evaluator.py
# -*- coding: utf-8 -*- # Copyright 2013-2021 CERN # # 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 a...
main.py
# Purpose: This is the main script of CB2 Bot, a work-in-progress Twitch chat # bot that performs basic notification and chat interaction tasks # including greeting chat users, thanking followers, cheerers, and # subscribers, and storing and executing custom text commands. # Author: Kyle Land...
optimizer_tcp_manager.py
import yaml import os import subprocess import socket import json import logging import time import math import pkg_resources from threading import Thread from retry import retry from .solver_response import SolverResponse class OptimizerTcpManager: """Client for TCP interface of parametric optimizers This c...
pretty_progress.py
# coding=utf-8 from __future__ import absolute_import, division, print_function, unicode_literals try: from Queue import Empty # for python 2 except ImportError: from queue import Empty # for python 3 from multiprocessing import Process, Queue from os import environ from os.path import join from re import su...
computersinger.py
''' Function: 让电脑主板上的蜂鸣器哼歌 Author: Charles 微信公众号: Charles的皮卡丘 ''' import os import sys import time import threading from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * '''让电脑主板上的蜂鸣器哼歌''' class ComputerSinger(QWidget): tool_name = '让电脑主板上的蜂鸣器哼歌' def __init__(self, par...
main.py
import cv2, difflib, re, sys, time, snap7, threading, os, Img, subprocess import numpy as np from PyQt6 import QtWidgets, QtCore, QtGui from paddleocr import PaddleOCR, draw_ocr from style import Ui_mainWindow os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" class MainWindow(QtWidgets.QMainWindow): def __in...
threading_simpleargs.py
#!/usr/bin/env python # encoding: UTF-8 import threading def worker(num): print'Worker:%s'%num return threads=[] for i in range(5): t=threading.Thread(target=worker,args=(i,)) threads.append(t) t.start()
Missile.py
import time from Mechanics import * from Zone import Zone from Projectile import Projectile class Missile(Projectile): # how often aim-updaing function to run def __init__(self, img, x, y, distance=0, rotation_speed=0.0, max_speed=0, damage=...
utils.py
# Copyright (c) 2013 Ondrej Kipila <ok100 at openmailbox dot org> # This work is free. You can redistribute it and/or modify it under the # terms of the Do What The Fuck You Want To Public License, Version 2, # as published by Sam Hocevar. See the COPYING file for more details. """Common functions used across the whol...
presubmit_support.py
#!/usr/bin/env python # 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. """Enables directory-specific presubmit checks to run at upload and/or commit. """ from __future__ import print_function __versio...
game_controller.py
import os import threading import time import cv2 from utils.auto_settings import check_settings from bot import Bot from config import Config from death_manager import DeathManager from game_recovery import GameRecovery from game_stats import GameStats from health_manager import HealthManager from logger import Logg...
loader_wsl.py
"""Detectron data loader. The design is generic and abstracted away from any details of the minibatch. A minibatch is a dictionary of blob name keys and their associated numpy (float32 or int32) ndarray values. Outline of the data loader design: loader thread\ loader thread \ / GPU 1 enqueue thread...
RedisScheduler.py
import redis, json, multiprocessing, pytz, uuid, boto3, botocore from datetime import datetime, timezone import dateutil.parser from dateutil.tz import * class RedisScheduler: def __init__(self, host='localhost', port=6379, path=None, db=0, password=None): try: if path: self.r...
test_StandardCpuBenchmark.py
# -*- coding: utf-8 -*- import threading from pip_benchmark_python.standardbenchmarks.StandardCpuBenchmark import StandardCpuBenchmark class TestStandardCpuBenchmark: benchmark = None def callback(self, arg=None): print('Is Done!') def setup_method(self): self.benchmark = StandardCpuBe...
VideoUtil.py
from subprocess import call import threading player = 'D:/PotPlayer/PotPlayerMini64.exe' def play(link): """ 调用potplayer播放视频 :param link: 视频链接 :return: None """ # 开启线程播放 t = threading.Thread(target=_play_, name='播放', args=(link,)) t.start() pass def _play_(link): call([playe...
main.py
#!/usr/bin/env python2 """A simple terminal using Google spreadsheets as the menu. Meant for casual RPG use. """ import curses from linewindows import create_hline_window, create_vline_window from main_terminal import MainTerminal from time import sleep from random import randint from google_credentials import userna...
refactor.py
# Part of the awpa package: https://github.com/habnabit/awpa # See LICENSE for copyright. # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directo...
joy_multi_xbox360.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ## # @brief [py example simple] motion basic test for doosan robot # @author Kab Kyoum Kim (kabkyoum.kim@doosan.com) import rospy import os import threading, time import sys from sensor_msgs.msg import Joy sys.dont_write_bytecode = True sys.path.append( os.path.a...
dispatch.py
""" File : dispatch.py Author : ian Created : 04-21-2017 Last Modified By : ian Last Modified On : 04-21-2017 *********************************************************************** The MIT License (MIT) Copyright © 2017 Ian Cooper <ian_hammond_cooper@yahoo.co.uk> Permission is hereby g...
runserver.py
from django.core.management.commands.runserver import Command as BaseCommand from atlassian_connect_django.addon import JiraAddon, ConfluenceAddon import time, threading class Command(BaseCommand): def get_handler(self, *args, **options): handler = super(Command, self).get_handler(*args, **options) ...
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import multiprocessing import threading import six try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K f...
pika.py
import json import logging import os import time import typing from collections import deque from contextlib import contextmanager from threading import Thread from typing import ( Callable, Deque, Dict, Optional, Text, Union, Any, List, Tuple, Generator, ) from rasa.constants i...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
__init__.py
from __future__ import print_function, division, absolute_import import os import sys import shutil import subprocess import optparse import math import signal import threading import atexit import types import re import pprint import time import traceback import locale import inspect import getpass import tempfile im...
speedtest_server.py
import socket import time import json import threading import sys from queue import Queue import struct MAX_PACKET_LOSS = .15 def max_packet_loss(pl_dict): max_p_loss = 0 for key in pl_dict: if pl_dict[key]['packet_loss'] > max_p_loss: max_p_loss = pl_dict[key]['packet_loss'] return ma...
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...
message_mass_send.py
from work_materials.globals import dispatcher, psql_creditals import logging, traceback, time, threading, psycopg2 def mass_send(text): conn = psycopg2.connect("dbname={0} user={1} password={2}".format(psql_creditals['dbname'], psql_creditals['user'], ...
nrf802154_sniffer.py
#!/usr/bin/env python # Copyright 2018, Nordic Semiconductor ASA # 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...
standings.py
import time import threading import os import sys import itertools from selenium import webdriver from selenium.webdriver.chrome.options import Options done = False def wait(): for c in itertools.cycle(['+', '-', '*', '/']): if done: break sys.stdout.write('\rloading ' + c) sys.s...
dialogs.py
# -*- coding: utf-8 -*- from threading import Thread, RLock import xbmc import xbmcaddon import xbmcgui def select_ext(title, populator, tasks_count, sort_function = None): addonPath = xbmcaddon.Addon().getAddonInfo('path').decode('utf-8') dlg = SelectorDialog("DialogSelect.xml", addonPath, title=title, ...
psdns.py
""" Functions for resolving hostnames and IPs """ import dns.reversename import dns.resolver import multiprocessing import multiprocessing.dummy import os import Queue import socket import threading # See Python 2.6 workaround below. import weakref __DEFAULT_TIMEOUT__ = 2 def dns_default_timeout(): return __...
_server.py
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
braeker.py
import winsound import time import datetime import re import ctypes import socket import threading from os.path import isfile from ctypes import wintypes user32 = ctypes.windll.user32 SW_SHOWMAXIMIZED = 3 SW_HIDE = 0 SW_MINIMIZE = 6 keybd_event = ctypes.windll.user32.keybd_event alt_key = 0x12 extended_key = 0x0001 ke...
core.py
# -*- coding: utf-8 -*- # author: Григорий Никониров # Gregoriy Nikonirov # email: mrgbh007@gmail.com # #~ import GUI.core as gg from GUI.core import * from GUI.core import _TEXTURIES from MGD.item import Inventory,Item,_ITEM_CLASS,_ITEM_TYPES import glob import random import time import threading def ...
testthread.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by vici on 22/01/2017 import threading import platform import time import logging from Queue import Queue from random import randint __doc__ = """ 抄董伟明,官方文档,廖雪峰 bogo 。。。。 threading 实验结果记录 """ logging.basicConfig(level=logging.DEBUG, format=...
batcher.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
util.py
import subprocess from rc.exception import RunException import sys from collections import namedtuple import os from typing import Union, List import io from threading import Thread from queue import Queue from concurrent.futures import ThreadPoolExecutor, as_completed RunResult = namedtuple('RunResult', ['stdout', 's...
related_metrics.py
import logging from time import time, sleep from threading import Thread from multiprocessing import Process import os import sys from os import kill, getpid import traceback from ast import literal_eval import settings from skyline_functions import get_redis_conn, get_redis_conn_decoded from functions.metrics.get_met...
randoscript.py
from collections import OrderedDict import sys from ssrando import Randomizer, VERSION from options import OPTIONS, Options def process_command_line_options(options): if 'help' in options: print('Skyward Sword Randomizer Version '+VERSION) print('Available command line options:\n') longest...
__init__.py
# pylint: disable=too-many-lines # (Yes, it has a point!) from __future__ import division, absolute_import, print_function __copyright__ = "Copyright (C) 2009-2013 Andreas Kloeckner" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docume...
client.py
# Krishna Chaitanya Naragam # 1001836274 from tkinter import * from datetime import datetime import threading import random import string import requests # methods # generate a random string of length specified # https://pynative.com/python-generate-random-string/ def get_random_string(length): # Random string w...
DialogPluginManager.py
''' Created on March 1, 2012 @author: Mark V Systems Limited (c) Copyright 2011 Mark V Systems Limited, All rights reserved. based on pull request 4 ''' from tkinter import Toplevel, font, messagebox, VERTICAL, HORIZONTAL, N, S, E, W from tkinter.constants import DISABLED, ACTIVE try: from tkinter.ttk import Tre...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including witho...
utils.py
import threading import numpy as np import jesse.helpers as jh from jesse.models.Candle import Candle from jesse.models.Orderbook import Orderbook from jesse.models.Ticker import Ticker from jesse.models.Trade import Trade def store_candle_into_db(exchange: str, symbol: str, candle: np.ndarray): """ store c...
test_client.py
import asyncio from collections import deque from contextlib import suppress from functools import partial import gc import logging from operator import add import os import pickle import psutil import random import subprocess import sys import threading from threading import Semaphore from time import sleep import tra...
netcat.py
import socket, threading class Netcat2: def __init__(self): self.RHOST = '' self.RPORT = 0 self.LHOST = '' self.LPORT = 0 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.default_recv_len = 1024 self.server_mode = False self.connecte...
stockbarcollector.py
# **************************************************************************** # # # # ::: :::::::: # # stockbarcollector.py :+: :+: :+: ...
detection_input.py
from __future__ import division from __future__ import print_function import cv2 import numpy as np import mxnet as mx from queue import Queue from threading import Thread from operator_py.cython.bbox import bbox_overlaps_cython from operator_py.bbox_transform import nonlinear_transform as bbox_transform class Dete...
n1ql_fts_integration_phase2.py
from .tuq import QueryTests from membase.api.exception import CBQError from lib.membase.api.rest_client import RestConnection from pytests.fts.fts_base import CouchbaseCluster from remote.remote_util import RemoteMachineShellConnection import json from pytests.security.rbac_base import RbacBase from lib.remote.remote_u...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import tempfile import urllib.request import traceback import asyncore import weakref import platform import functools ssl =...
benchmark.py
import threading import time from datetime import datetime import rpcgrid as rpcg from rpcgrid.providers.socket import SocketProvider def create_server(p=None): @rpcg.register def sum(x, y): return x + y @rpcg.register def sleep(x): print('start sleep:', x, datetime.now()) ti...
remove_duplicate_ips.py
import socket, sys from queue import Queue from threading import Thread q = Queue(maxsize=0) file = open(sys.argv[1], 'r') urls = [x.strip() for x in file.readlines()] results = {} for i, url in enumerate(urls): q.put(url) def get_host(q, result): while not q.empty(): work = q.get() try: ...
cef_application.py
import pywintypes import ctypes import logging import os import threading import tkinter as tk import win32api import win32con import win32gui import win32gui_struct from cefpython3 import cefpython as cef log = logging.getLogger() # log.setLevel(logging.ERROR) class SysTrayIcon (object): '''SysTrayIcon类用于显示任务栏...
server.py
import random import os import socket from threading import Thread colors_cells = [ (80, 252, 54), (36, 244, 255), (243, 31, 46), (4, 39, 243), (254, 6, 178), (255, 211, 7), (216, 6, 254), (145, 255, 7), (7, 255, 182), (255, 6, 86), (147, 7, 255) ] dots = {j: {'x': random.randint(20,1980), 'y': random.randin...
utils.py
import re import os import time import threading import ssl import json try: import urllib.request as urllib_request # for Python 3 except ImportError: import urllib2 as urllib_request # for Python 2 and Jython try: from urllib.parse import urlparse # for Python 3 except ImportError: from urlparse imp...
run_ex1.py
import os, sys, time import threading, urllib.request, urllib.error, urllib.parse from pyraft import raft def url_checker(node): while not node.shutdown_flag: time.sleep(5) if node.state != 'l': continue for k, v in node.data.items(): if not k.startswith('url_'): continue try: url = v ...
Loader.py
# import os # import sys # from threading import Thread # from queue import Queue # # import cv2 # import scipy.misc # import numpy as np # # from CalibrateTransfer.img_operation import ScreenSHot # from CalibrateTransfer.data_preprocess import write_data_to_json_file,read_data_from_json_file,make_dir,read_subdata,read...
gui.py
'''File containing the class controlling the GUI''' import Tkinter as tk from threading import Thread from Queue import Queue from time import sleep ''' GUI object that uses Tkinter to display information from the robot\'s sensors. Additionally, the GUI acts as the main thread and the wrapper to connect the other obje...
bulk_decompile.py
''' A helper script that takes all the binary code from cache_code, and decompiles all of it, saving results into cache_pan It uses multi-processing. This is useful with testing new changes to the decompiler. Run the decompilation on a few hundred contracts and look for any serious bugs / wei...