source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
job.py | # Copyright (c) 2020 by Terry Greeniaus.
import threading
import json
import uuid
import os
import reap
class Job:
STATUS_PENDING = 0
STATUS_RUNNING = 1
STATUS_COMPLETE = 2
def __init__(self, name, module=None, function=None, args=(), kwargs=None,
cmd=None, cwd=None, notify_meta=N... |
server.py | import asyncio
import json
import threading
import flask
import websockets
from flask_socketio import SocketIO, emit, send
from flask_cors import CORS, cross_origin
host = "127.0.0.1"
port = 4040
app = flask.Flask(__name__)
app.config["DEBUG"] = True
app.config['CORS_HEADERS'] = 'Content-Type'
cors = CORS(app)
sock... |
PID.py | from tkinter import * #导入Tkinter模块
import tkinter.colorchooser
import tkinter.messagebox as messagebox
import threading
import datetime
import time
import math
import random
import sys
sys.setrecursionlimit(100000) #设置递归深度
root=Tk()
root.title("PID Simulator") #生成一个主窗口对象
root.geometry("885x... |
emitters.py | """
emitters.py
Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Version 2.0. You may obtain a copy of the Apache License Version 2.0... |
main_vec_dist_SeqMod.py | import argparse
import math
from collections import namedtuple
from itertools import count
import numpy as np
from eval import eval_model_q
import copy
import torch
from ddpg_vec import DDPG
from ddpg_vec_hetero import DDPGH
import random
import pickle
from replay_memory import ReplayMemory, Transition, ReplayMemory_e... |
chatClient.py | import socket
import struct
import sys
import threading
import msgpack # python -m pip install msgpack
import ssl
PORT = 10139
HEADER_LENGTH = 2
atos = lambda address: f'[{address[0]}:{address[1]}]'
def setup_SSL_context(cert: str, key: str, CA: str):
#uporabi samo TLS, ne SSL
context = ssl.SSLContext(ssl.PROTOC... |
executor.py | import os
import json
import time
import shlex
import socket
import shutil
import random
import subprocess
from threading import Thread
import docker
from kwikapi import Client
from basescript import BaseScript
from deeputil import AttrDict, Dummy, keeprunning
class Executor:
# State of the executor that it is... |
test_dist_graph_store.py | import os
os.environ['OMP_NUM_THREADS'] = '1'
import dgl
import sys
import numpy as np
import time
import socket
from scipy import sparse as spsp
from numpy.testing import assert_array_equal
from multiprocessing import Process, Manager, Condition, Value
import multiprocessing as mp
from dgl.heterograph_index import cre... |
fps.py | # -*- coding: utf-8 -*-
'''
@author: look
@copyright: 1999-2020 Alibaba.com. All rights reserved.
@license: Apache Software License 2.0
@contact: 390125133@qq.com
'''
'''FPS监控器
'''
import queue
import datetime
import time
import re
import threading
import os,sys
import copy
import csv
import traceback
... |
debug_bridge.py | import os
import time
import base64
import datetime
import types
import websockets
import threading
from queue import Queue
import http.server
from jinja2 import Template
from base64 import b64encode
import asyncio
import qrcode
import qrcode.image
import json
import netifaces
import logging
import subprocess
try:
... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import ast
import inspect
import os
import re
import ssl
import sys
... |
login.py | import os, sys, time, re, io
import threading
import json, xml.dom.minidom
import copy, pickle, random
import traceback, logging
import requests
from pyqrcode import QRCode
from .. import config, utils
from ..returnvalues import ReturnValue
from ..storage.templates import wrap_user_dict
from .contact impo... |
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... |
MemoryManagement.py | import Queue
from multiprocessing import Process
from cPickle import loads, dumps
from threading import Thread
import zmq
from time import time, sleep
from CellCycle.MemoryModule.Cache import CacheSlubLRU
from CellCycle.ChainModule.ListThread import ListThread
from CellCycle.ChainModule.ListCommunication import Interna... |
test_ffi.py | import sys, py
from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
class Test__ffi(BaseTestPyPyC):
def test__ffi_call(self):
from rpython.rlib.test.test_clibffi import get_libm_name
def main(libm_name):
try:
from _rawffi.alt import CDLL, types
... |
base.py | """
Progress bar implementation on top of prompt_toolkit.
::
with ProgressBar(...) as pb:
for item in pb(data):
...
"""
import datetime
import functools
import os
import signal
import sys
import threading
import traceback
from asyncio import (
CancelledError,
get_event_loop,
new_ev... |
frontendcomm.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
In addition to the remote_call mechanism implemented in CommBase:
- Implements _wait_reply, so blocking calls can be made.
"""
import pickle
import socket
impor... |
worker_measurements.py | #!env python
import argparse
import docker
import time
import socket
import platform
import enum
import threading
from threading import Event
import queue
#from queue import Queue
import functools
import redis
from redis import Redis
import signal
# My imports
import exceptions
from worker_interface import Worker... |
engine.py | """
Main BZT classes
Copyright 2015 BlazeMeter 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... |
search.py | from flask import request
from flask import jsonify
from flask_cors import cross_origin
import threading
from .sem_search import SemSearch
def load_in_background(nlp, app, stops_path):
ss = SemSearch(stops_path)
app.logger.info("🔋 sem_search ready")
nlp.set('search', ss)
def add_search(app, nlp, stops... |
thread_example_with_io.py | # -*- coding: utf-8 -*-
'''
j.philipson
9:32 PM, 1/27/2021
'''
import threading
#ref: https://stackoverflow.com/questions/6893968/how-to-get-the-return-value-from-a-thread-in-python
def addMyNumbers(a,b):
return a+b
x = threading.Thread(target=addMyNumbers, args=(1,2))
x.start()
x.join()
print(x)
print('don... |
event_queue.py | import copy
import queue
from collections import OrderedDict
from threading import Thread
from connman import ReDBConnection
from loggable import Loggable
from tornado.options import options as opts
from xenadapter import XenAdapterPool
from xenadapter.event_dispatcher import EVENT_DISPATCHER
import json
from dateti... |
__main__.py | #!/usr/bin/env python3
import argparse
import io
import itertools as it
import json
import multiprocessing as mp
import multiprocessing.dummy as mp_dummy
import os
import os.path as path
import subprocess
import sys
import threading
import time
import urllib.request
from datetime import timedelta, datetime
from glob im... |
metaserver.py | #!/usr/bin/env python
import sys, SimpleXMLRPCServer, getopt, pickle, time, threading, xmlrpclib, unittest
from datetime import datetime, timedelta
from xmlrpclib import Binary
# Presents a HT interface
class SimpleHT:
def __init__(self):
self.data = {}
def count(self):
return len(self.data)
# Retrie... |
LocalDispatcher.py | ##########################################################################
#
# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... |
support.py | """
Assorted utilities for use in tests.
"""
import cmath
import contextlib
import enum
import errno
import gc
import math
import platform
import os
import shutil
import subprocess
import sys
import tempfile
import time
import io
import ctypes
import multiprocessing as mp
import warnings
from contextlib import context... |
run.py | import websocket, multiprocessing, os, warnings
from datetime import datetime, timedelta
from dateutil.parser import parse
from flask import Flask, Response, request
from flask_cors import cross_origin
from osmosis_streaming_driver.proxy_server.token_store import TokenStore
PROXY_SERVER_PORT = 3580 if 'PROXY_SERVER_PO... |
PyThread.py | #! /usr/bin/env python
#-*- coding:utf-8 -*-
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().name, n)
time.sleep(1)
print 'thread... |
test_base.py | import asyncio
import fcntl
import logging
import threading
import time
import uvloop
import unittest
import weakref
from unittest import mock
from uvloop._testbase import UVTestCase, AIOTestCase
class _TestBase:
def test_close(self):
self.assertFalse(self.loop._closed)
self.assertFalse(self.loo... |
GridTopology.py | import math
import random
import threading
from MacawNode import MacawNode
import wsnsimpy.wsnsimpy_tk as wsp
from Utilization import Utilization
PACKET_SIZE = 256
TX_RANGE = 100
NUM_SENDERS = 10
NODE_SPACING = 60
GRID_BOUNDS = [50, 50, 600, 600]
class GridTopology:
def __init__(self):
self.nodes = []... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return open("index.html").read()
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
decorators.py | import logging, functools
from django.conf import settings
logger = logging.getLogger('biostar')
import threading
try:
# When run with uwsgi the tasks will be spooled via uwsgi.
from uwsgidecorators import spool, timer
except Exception as exc:
#
# With no uwsgi module the tasks will be spooled.
# ... |
thread-dispatch-bench.py | # Estimate the cost of simply passing some data into a thread and back, in as
# minimal a fashion as possible.
#
# This is useful to get a sense of the *lower-bound* cost of
# trio.to_thread.run_sync
import threading
from queue import Queue
import time
COUNT = 10000
def worker(in_q, out_q):
while True:
j... |
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... |
Setup.py | try:
from tkinter import Toplevel, ttk, Canvas, StringVar, BooleanVar
from tkinter.filedialog import askdirectory
from typing import ClassVar
from Components.Debugger import Debugger
from os.path import isfile, join, isdir, basename, abspath, join
from time import sleep
from PIL import Image... |
test_streams.py | """Tests for streams.py."""
import gc
import os
import queue
import socket
import sys
import threading
import unittest
from unittest import mock
try:
import ssl
except ImportError:
ssl = None
import asyncio
from asyncio import test_utils
class StreamReaderTests(test_utils.TestCase):
DATA = b'line1\nlin... |
futu_gateway.py | """
Please install futu-api before use.
"""
from copy import copy
from datetime import datetime
from threading import Thread
from time import sleep
import pytz
from futu import (
ModifyOrderOp,
TrdSide,
TrdEnv,
OpenHKTradeContext,
OpenQuoteContext,
OpenUSTradeContext,
OrderBookHandlerBase,... |
notice_client.py | # -*- coding: utf-8 -*-
import time
import random
import threading
from gevent.queue import JoinableQueue
from inner_lib.func_ext import get_md5, http_request
from inner_lib.func_ext import message_format
from conf.config import MAXSIZE
class NoticeClient(object):
init_flag = False
_instance = None
_ins... |
server.py | from shell import PRIMITIVE
import socket
import threading
import os
from utils import Utils
lock = threading.Lock()
class Server(object):
def __init__(self):
server_ip = "192.168.220.131"
server_port = 60000
self.server = socket.socket()
self.server.bind((server_ip, server_port)... |
conftest.py | import pytest
import threading
import traceback
import socket
from server import ConnectionListener
# fmt: off
motd_dict_test = {
"motd": [
"- Hello {user_nick}, this is a test MOTD!",
"-",
"- Foo",
"- Bar",
"- Baz",
"-",
"- End test MOTD"
]
}
# fmt... |
listener.py |
import os
import sys
if sys.version_info[0] < 3:
import Queue as queue
else:
import queue
import threading
import signal
import numpy
import pyaudio
from quiet.quiet import Decoder
class Listener(object):
def __init__(self):
self.pyaudio_instance = None
self.done = None
self.thr... |
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... |
wallet.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
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... |
results.py | from toolset.utils.output_helper import log
import os
import subprocess
import uuid
import time
import json
import requests
import threading
import re
import math
import csv
import traceback
from datetime import datetime
# Cross-platform colored text
from colorama import Fore, Style
class Results:
def __init__(... |
inference_dpframes.py | import os
import sys
import cv2
import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.nn import functional as F
import warnings
import _thread
from queue import Queue, Empty
warnings.filterwarnings("ignore")
from pprint import pprint, pformat
import time
import psutil
import multiprocessing... |
1-match_pc_psx.py | import os
import glob
import cv2
import shutil
import json
from multiprocessing import Process, Pool, Manager
import numpy as np
dir_path = os.path.dirname(os.path.realpath(__file__))
# Number of threads to use
NUM_THREADS = 12
# directory where the TIFF files for the PC background are located.
PC_FOLDER = os.path.j... |
base.py | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
import re
import time
import math
import threading
from .events import Events
from ..core.config.x_config import XCONF
from ... |
utils.py | from joblib import Parallel, delayed
from scipy import spatial
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import multiprocessing as mp
import copy
import time
tree = None
pred_vectors = None
def ordered_distance(i):
return tree.query(pred_vectors[i],k=1000)[1]
def load(a_tree, a_pred_ve... |
tests.py | """
Unit tests for reverse URL lookups.
"""
import pickle
import sys
import threading
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.http import HttpR... |
crawl-ssr.py | from urllib.request import *
from base64 import *
from threading import *
from queue import *
import re
ssrs = Queue()
threads = []
urls = [
'https://raw.githubusercontent.com/voken100g/AutoSSR/master/stable',
'https://raw.githubusercontent.com/voken100g/AutoSSR/master/online',
'https://raw.githubusercont... |
2021-08-09.py | from multiprocessing.context import Process
from numpy import floor
import wandb
from behavior.oscillator import Oscillator
from job.learner import Learner
from rl_ctrnn.ctrnn import Ctrnn
from random import randint
THREAD_COUNT = 10
PROGENITOR = {
"time_constants": {0: 1.0, 1: 1.0},
"biases": {0: 5.1544552029737... |
test_coordinate.py | # Copyright (C) 2021 Nippon Telegraph and Telephone Corporation
# 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/LICE... |
test_new_process.py | from multiprocessing import Process
import matplotlib.pyplot as plt
def plot_graph(*args):
plt.figure(figsize = (8,3))
plt.clf()
for data in args:
plt.plot(data)
plt.show()
p = Process(target=plot_graph, args=([1, 2, 3],))
p.start()
print 'yay'
print 'computation continues...'
print 'that rocks.... |
droidbox.py | import hashlib
import json
import os
import re
import signal
import subprocess
import sys
import threading
import time
import zipfile
from datetime import datetime
from subprocess import call, PIPE, Popen
from threading import Thread
from xml.dom import minidom
from utils import AXMLPrinter
# I have to modify DroidBo... |
test_job_handler.py | # test_job_handler.py
# How to start pytest?
# 1. def test_answer():
# 2. in test_sample.py
# 3. $ pytest
# 4. (only need assert exp, unlike unitest that you need to remember many assertTypes)
import logging
import time
from client.controller import JobHandler
from client.controller_raspi import ControllerRPi
from u... |
app.py | from flask import Flask
from MOOC.spiders.mooc_spider import Moocspider
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from multiprocessing import Process
from flask_cors import *
app = Flask(__name__, static_folder='frontend')
CORS(app, supports_credentials=True)
def... |
executor.py | """LowLatencyExecutor for low latency task/lambda-function execution
"""
from concurrent.futures import Future
import logging
import threading
import queue
# import pickle
from multiprocessing import Process, Queue
from ipyparallel.serialize import pack_apply_message # ,unpack_apply_message
from ipyparallel.serializ... |
Tools.py | import time
from threading import Thread
class Tools(object):
def __init__(self, api) :
self.__api = api
def WaitForReady(self) :
while True:
time.sleep(5)
if (self.__api.GetOperationMode() == 0) :
print("Ready")
break
def Star... |
utils.py |
import json
import sys
import re
import os
import stat
import fcntl
import shutil
import hashlib
import tempfile
import subprocess
import base64
import threading
import pipes
import uuid
import codecs
try:
from collections.abc import Iterable, Mapping
except ImportError:
from collections import Iterable, Mapp... |
main.py | from crawl_bot import Crawl_bot
from file_manage import *
from queue import Queue
import threading, sys, os
from get_domains import *
import tldextract
def input_url(base_url):
global BASE_URL, regex
BASE_URL=base_url
url_extract = tldextract.extract(BASE_URL)
regex = url_extract.domain
delete =... |
start.py | #!/usr/bin/env python3
from concurrent.futures import ThreadPoolExecutor, as_completed
from contextlib import suppress
from itertools import cycle
from json import load
from logging import basicConfig, getLogger, shutdown
from math import log2, trunc
from multiprocessing import RawValue
from os import urandom as randb... |
app.py | import cv2
import datetime
import numpy as np
import os
import threading
import time
import torch
from djitellopy import tello
from moviepy.editor import *
from tkinter import *
from PIL import Image, ImageTk # You have to import this last or else Image.open throws an error
from commands import start_flying,... |
test_tracking.py | import datetime
import logging
import multiprocessing
import pytest
import uuid
from c4.messaging import Envelope, MessageTracker, MessageTrackerDB
log = logging.getLogger(__name__)
@pytest.fixture(scope="function", params=[MessageTracker(), MessageTrackerDB()])
def tracker(request):
return request.param
def te... |
set_simulation_timer.py | #!/usr/bin/env python3
# Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator Authors
# licensed under the Apache license, Version 2.0
# cf. 3rd-party-licenses.txt ... |
common.py | """Test the helper method for writing tests."""
import asyncio
from collections import OrderedDict
from datetime import timedelta
import functools as ft
import json
import os
import sys
from unittest.mock import patch, MagicMock, Mock
from io import StringIO
import logging
import threading
from contextlib import contex... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
test_qgssvgcache.py | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSvgCache.
.. note:: 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 later version.
"""
__aut... |
ds18b20.py | # -*- coding: utf-8 -*-
"""
Main module for DS18B2 sensors.
"""
import os
import time
import sys
import logging
import exports
import collections
from threading import Thread, Lock, Event
"""
Private classes / functions
"""
class _SensorDictionary(object):
def __init__(self, sensors):
"""Private class ... |
test_user_secrets.py | import json
import os
import threading
import unittest
from http.server import BaseHTTPRequestHandler, HTTPServer
from test.support import EnvironmentVarGuard
from urllib.parse import urlparse
from datetime import datetime, timedelta
import mock
from google.auth.exceptions import DefaultCredentialsError
from google.cl... |
pyglview.py | #!/usr/bin/env python3
import logging
import os
import signal
import sys
import threading
import time
import numpy as np
from easydict import EasyDict as edict
try:
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
import OpenGL.GLUT
AVAILABLE_OPENGL = True
except Exceptio... |
test_dag_serialization.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... |
__init__.py | # -*- coding: utf-8 -*-
# This file is part of the Rocket Web Server
# Copyright (c) 2011 Timothy Farrell
# Modified by Massimo Di Pierro
# Removed python2 support and dependencies
# Import System Modules
import sys
import errno
import socket
import signal
import logging
import platform
import io
import urllib.parse... |
trezor.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_civx.util import bfh, bh2u, versiontuple, UserCancelled
from electrum_civx.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE_SCRIPT, is_address)
from electrum_civ... |
runner.py | import threading
from typing import Optional
from multiprocessing import Process
import json
import socket
import asyncio
import logging
import sys
from resources.commands import build_porter_command, build_porter_command_for_outputs
from shared.config import get_config
from resources.helpers import get_installation_id... |
test_base_events.py | """Tests for base_events.py"""
import errno
import logging
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from asyncio import events
from test.test_asyncio import utils a... |
parallel.py | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
server.py | import threading
import socket
host = '192.168.1.64'
port = 55555
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((host, port))
server.listen()
clients = []
nicknames = []
def broadcast(message):
for client in clients:
client.send(message)
def handle(client):
while True:
... |
test_browser.py | # coding=utf-8
from __future__ import print_function
import multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex
from runner import BrowserCore, path_from_root, has_browser, get_browser
from tools.shared import *
try:
from http.server import BaseHTTPRequestHandler, HTTPServer
except Impo... |
test_vrf.py | import sys
import time
import threading
import Queue
import yaml
import json
import random
import logging
import tempfile
import traceback
from collections import OrderedDict
from natsort import natsorted
from netaddr import IPNetwork
import pytest
from tests.common.fixtures.ptfhost_utils import copy_ptftests_direct... |
all.py | # -*- coding: utf-8 -*-
'''
@Date: 2020/1/8
@Author: fanyibin
@Description: 管理所有爬虫
'''
from config.config_parser import get_config
from os import popen
from multiprocessing import Process
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--view', help="--view all: view all spiders")
parser.add_ar... |
thread_crawler.py | import threading
import time
from queue import Queue
import requests
import os
from bs4 import BeautifulSoup
from PreprocessData.database_op import datasql
def run(que, json_load_path):
headers = {
'Cookie': 'OCSSID=4df0bjva6j7ejussu8al3eqo03',
'User-Agent': 'Mozilla/5.0 (Windows NT 10... |
test_discovery_serial.py | import unittest
import fixtures
import testtools
import traceback
from tcutils.wrappers import preposttest_wrapper
import uuid
import base
import test
import time
from time import sleep
import threading
from tcutils.config.discovery_util import DiscoveryServerUtils
from tcutils.contrail_status_check import ContrailStat... |
multiThreading.py | import time
import threading
def calc_sqr(ar):
for i in ar:
time.sleep(0.2)
print("square:", i*i)
def calc_cube(ar):
for i in ar:
time.sleep(0.2)
print("cube:", i*i*i)
ar = [2, 4, 8, 9]
t = time.time()
t1 = threading.Thread(target=calc_sqr, args=(ar,))
t2... |
AAT.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AAT.ui'
#
# Created: Wed Sep 09 12:06:25 2015
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
'''
* Copyright (C) 2015 Francisco Javier <https://mx.linkedin.com/in/fcojavierpena>
*
* Lice... |
client.py | # Author: Ernests
import requests
import time
import json
import threading
from sensible.database import insertOtherData
def runClient(lock, otherData, clientLog, deviceAddress, addresses, **kwargs):
threading.Thread(target=clientLoop, args=(lock, otherData, clientLog, deviceAddress, addresses)).start()
def clie... |
show_map.py | from PIL import Image
import threading
import matplotlib
import time
import numpy as np
from logging import getLogger
logger = getLogger('show_map')
class ShowMap:
"""
Class that implements the ShowMap object.
"""
def __init__(self, grid, show_gui = True, save_map_time = 5, name = 'map.png'):
... |
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... |
coap.py | import logging
import logging.config
import random
import socket
import threading
from coapthon.messages.message import Message
from coapthon.messages.response import Response
from coapthon import defines
from coapthon.layers.blocklayer import BlockLayer
from coapthon.layers.messagelayer import MessageLayer
from coapth... |
file_monitor.py | # Copyright 2017 Tufin Technologies Security Suite. 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... |
printer.py | # coding: utf8
from __future__ import unicode_literals, print_function
from collections import Counter
from contextlib import contextmanager
from multiprocessing import Process
import itertools
import sys
import time
import os
from .tables import table, row
from .util import wrap, supports_ansi, can_render, locale_es... |
marshal.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, ... |
console.py | # Copyright 2010 New Relic, 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 writ... |
main.py | from flask import Flask, request
import pickle, json, cv2, math, threading
from imgReg import run
import tensorflow as tf
from cnn import CNN
import matplotlib.pyplot as plt
img_count = 0 # to assign image name
cnn = CNN("colour")
graph = tf.get_default_graph() # to tackle thread issues
app = Flask(__name__)
# Endpoi... |
test_thread.py | from threading import Thread
from time import sleep
class test_thread:
def __init__(self):
self.direction = 0
self.step_counter = 0
def run(self):
thread_data = Thread(target=self.threaded_function_data)
thread_data.start()
sleep(2)
thread_data.killed = True
... |
batching_queue_test.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
http.py | #!/usr/bin/env python3
import random
import socket,threading,sys,random
import useragents
ip = sys.argv[1]
port = sys.argv[2]
print("[+] Attack Started >:)")
wdata = open("/home/kali/Desktop/DDoS/scripts/headers.txt","r")
data= wdata.read()
def attacks():
while True:
try:
ran = random.choic... |
FransLinkfinder.py | #
# BurpLinkFinder - Find links within JS files.
#
# Copyright (c) 2019 Frans Hendrik Botes
# Credit to https://github.com/GerbenJavado/LinkFinder for the idea and regex
#
from burp import IBurpExtender, IScannerCheck, IScanIssue, ITab
from java.io import PrintWriter
from java.net import URL
from java.util import Ar... |
drive_client.py | import logging
import asyncio
import os
import inject
from enum import Enum
from typing import List, AsyncIterator
from datetime import datetime
from collections import deque
from threading import Thread
from dataclasses import dataclass
from mycloud.constants import CHUNK_SIZE
from mycloud.mycloudapi.helper import gen... |
ticker.py | import os
import threading
import time
from collections import defaultdict
import atexit
import numpy
from gi.repository import Gtk, GObject
from matplotlib import rcParams
from matplotlib.animation import FuncAnimation
from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas
from matplo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.