source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
mousetrap.py | #!/usr/bin/env python
import threading
import argparse
import os
import sys
from threading import Event
from Xlib.display import Display
from Xlib import X
from Xlib.ext import record
from Xlib.protocol import rq
"""
Much of this application was derived from the example code that can be found at
https://github.com/py... |
viewerclient.py | from __future__ import absolute_import, division, print_function
import time
import json
import os
import tempfile
import threading
from collections import defaultdict, namedtuple, Iterable
import numpy as np
from lcm import LCM
from robotlocomotion import viewer2_comms_t
from director.thirdparty import transformation... |
ray.py | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... |
test_calibration.py | # Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import tempfile
from multiprocessing import Process
import h5py
import mmcv
from mmdeploy.apis import create_calib_table
calib_file = tempfile.NamedTemporaryFile(suffix='.h5').name
ann_file = 'tests/data/annotation.json'
def get_end2end_deploy_c... |
rw_frames.py | import time
import cv2
from threading import Thread
#
# Properties of VideoWriter and VidepCapture
# https://docs.opencv.org/3.3.1/d4/d15/group__videoio__flags__base.html#gaeb8dd9c89c10a5c63c139bf7c4f5704d
#
class VideoCapture:
def __init__(self, path=0, settings=[]):
self.path = path
self.cap ... |
start.py | import logging
import threading
import time
import ezcbot
log = logging.getLogger(__name__)
def main():
client = ezcbot.EZCBOT(ezcbot.CONFIG.ROOM, ezcbot.CONFIG.USERNAME)
t = threading.Thread(target=client.connect)
t.daemon = True
t.start()
while not client.is_connected:
time.sleep(2)
... |
provider.py | """
Various providers that a ptype can be sourced from.
Each ptype instance can read and write it's data to particular provider type. A
provider type is responsible for keeping track of the current offset into some
byte-seekable data source and exposing a few general methods for reading and
writing to the source.
The... |
util.py | import os
import re
import shutil
import sys
import ctypes
from pathlib import Path
from colorama import Fore, Back, Style
from .settings import *
if sys.version_info[0] < 3 or sys.version_info[1] <= 5:
print("\nPlease restart with Python 3.6+\n")
print("Current Python version:", sys.version_info)
exit(-1)... |
Fuzzer.py | ## FuzzingTool
#
# Authors:
# Vitor Oriel C N Borges <https://github.com/VitorOriel>
# License: MIT (LICENSE.md)
# Copyright (c) 2021 Vitor Oriel
# 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 ... |
stress_test.py | from threading import Thread
import requests
import time
import requests
import json
KERAS_REST_API_URL = "http://localhost:5000/predict"
# CURL_REQUEST = "curl --header \"Content-Type: application/json\" --request POST --data '{\"text\": \"you like the movie\"}' http://localhost:5000/predict"
payload = {"text": "you... |
kickthemout.py | #!/usr/bin/env python3
# -.- coding: utf-8 -.-
# kickthemout.py
"""
Copyright (C) 2017-18 Nikolaos Kamarinakis (nikolaskam@gmail.com) & David Schütz (xdavid@protonmail.com)
See License at nikolaskama.me (https://nikolaskama.me/kickthemoutproject)
"""
import os, sys, logging, math, traceback, optparse, threading
from ... |
testclient.py | #! /usr/bin/env python
# -*- coding:UTF-8 -*-
# 并发测试客户端
import socket
import threading
import sys
def work(host, port):
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host, port))
sys.stdout.write("%s is running: \n"%threading.currentThread())
s.send("Hello world!")
while True:
... |
vnhuobi.py | # encoding: utf-8
import urllib
import hashlib
import json
import requests
from time import time, sleep
from Queue import Queue, Empty
from threading import Thread
# 常量定义
COINTYPE_BTC = 1
COINTYPE_LTC = 2
ACCOUNTTYPE_CNY = 1
ACCOUNTTYPE_USD = 2
LOANTYPE_CNY = 1
LOANTYPE_BTC = 2
LOANTYPE_LTC = 3
LOANTYPE_USD = 4
... |
label_sync.py | # ElectrumSV - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
# Copyright (C) 2019 ElectrumSV developers
#
# 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... |
train.py | #!/usr/bin python3
""" The script to run the training process of faceswap """
import os
import sys
import threading
import cv2
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
from lib.utils import get_folder, get_image_paths, set_system_verbosity
from plugins.PluginLoader import Plug... |
service.py | import os
import re
import sys
import time
import click
import psutil
import importlib
import threading
import subprocess
import anchore_engine.configuration.localconfig
from watchdog.observers import Observer
from watchdog.events import RegexMatchingEventHandler
import anchore_manager.util
import anchore_manager.uti... |
containerize.py | import time
import threading
import logging
from flask import request, render_template, g, abort
from sqlalchemy.exc import IntegrityError
from redistrib.connection import Connection
from app.bpbase import Blueprint
from app.utils import json_response
import models.cluster
import models.node
import models.proxy
import... |
server.py | # Programacao com sockets em python: script ativo
import sys
import socket
import threading
import select as s
HOST = ''
PORT = 5000
ENCODING = 'utf-8'
# Lista de comandos
EXIT_KEYWORD = '$exit'
LIST_THREADS = { '$list threads', '$lt' }
LIST_CLIENTS = { '$list clients', '$lc'}
HELP = '$help'
# Entradas para esculta... |
views.py | import json
import threading
import time
from django.db.models import Sum
from django.http import HttpResponse
from django.shortcuts import render
from django.utils import timezone
from scapy.all import *
from flow.models import device, flow, connection
from flow.sniffer import Sniffer
sniffer = Sniffer()
write_lock... |
test_tcp.py | """
:codeauthor: Thomas Jackson <jacksontj.89@gmail.com>
"""
import logging
import threading
import pytest
import salt.config
import salt.exceptions
import salt.ext.tornado.concurrent
import salt.ext.tornado.gen
import salt.ext.tornado.ioloop
import salt.transport.client
import salt.transport.server
import salt.u... |
start_test_voltmf_proxy.py | # Copyright 2020 Broadband Forum
#
# 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 writi... |
daepe_hw.py | import threading, time, random
server = int(input('카운터 수 : '))
tm_item = float(input('한 물건 당 계산 시간(sec) : '))
tm_cm = float(input('평균 고객 발생 시간 간격(sec) : '))
item_f = int(input('고객 한 명이 가지는 물건 개수의 시작 범위 : '))
item_l = int(input('고객 한 명이 가지는 물건 개수의 끝 범위 : '))
timer = time.time()
count_cm = int(input('고객 수 : '))
... |
jot.py | import logging
from http.server import HTTPServer, BaseHTTPRequestHandler
from collections import defaultdict, namedtuple
import threading
import json
import datetime
import os.path
import os
from uuid import uuid4
import re
import urllib.parse as urlparse
import base64
# Configuration
jopen = open
# This is so one ... |
servers_test.py | # Copyright 2019 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
utils.py | import asyncore
import base64
import cherrypy
import contextlib
import email
import errno
import io
import json
import os
import smtpd
import socket
import threading
import time
from six.moves import queue, range, urllib
_startPort = 31000
_maxTries = 100
class MockSmtpServer(smtpd.SMTPServer):
mailQueue = queu... |
base_controller.py | #!/usr/bin/env python
# coding: utf-8
import time
import pybullet
import threading
from qibullet.tools import *
from qibullet.controller import Controller
class BaseController(Controller):
"""
Class describing a robot base controller
"""
FRAME_WORLD = 1
FRAME_ROBOT = 2
def __init__(self, ro... |
main.py | import os
import sys
import json
import logging
import threading
from copy import copy
from datetime import date, timedelta
import boto3
import requests
from six.moves.queue import Queue
from six import iteritems, iterkeys
from sentinel_s3.crawler import get_products_metadata_path, get_product_metadata_path
from senti... |
imagetopoints.py | from math import ceil, floor
from tkinter import Tk, StringVar, Frame, Button, Spinbox, Text, END
from tkinter import filedialog, messagebox
from traceback import print_exc
from threading import Thread, Event
from typing import Any
from PIL import Image
import numpy as np
COLOR = "#36393f"
BRAILLE = (
... |
pants_daemon.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os
import sys
import threading
from contextlib import contextmanager
from dataclasses import dataclass
from typing import Optional
from setproctitle import setprocti... |
signbot.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) Count Count, 2019
#
# Original code by zhuyifei1999
# (https://wikitech.wikimedia.org/wiki/User:Zhuyifei1999)
# Heavily modified by Count Count
# (https://de.wikipedia.org/wiki/Benutzer:Count_Count)
#
# DUAL LICENSED: You are free to choose either or both of below licen... |
kk.py | from linepy import *
from akad.ttypes import Message
from akad.ttypes import ContentType as Type
from akad.ttypes import ChatRoomAnnouncementContents
from akad.ttypes import ChatRoomAnnouncement
from multiprocessing import Pool, Process
from datetime import datetime
from time import sleep
from bs4 import BeautifulSoup
... |
module.py | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
ServersPanel.py | #!/usr/bin/env python
"""Controls when data collection is suspended, in case the X-ray beam is
down
Author: Friedrich Schotte, Valentyn Stadnytskyi
Date created: 2017-11-13
Date modified: 2019-06-01
"""
__version__ = "1.2.1" # newline at last line
from logging import debug,info,warn,error
import traceback
from serve... |
50-save_log.py | import os
import sys
import shutil
import inspect
import time
import subprocess
import threading
from datetime import datetime
from pathlib import Path
if not is_re_worker_active():
BlueskyMagics.positioners = motor_txm + motor_optics + motor_pzt + motor_lakeshore
class Auto_Log_Save(object):
"""
Auto sa... |
bilibili.py | # -*- coding: utf-8 -*-
# @Author: gunjianpan
# @Date: 2019-04-07 20:25:45
# @Last Modified by: gunjianpan
# @Last Modified time: 2019-08-10 17:09:17
import codecs
import json
import os
import pickle
import random
import re
import shutil
import sys
import threading
import time
from configparser import ConfigParse... |
cornershot.py | import queue
import threading
import time
from random import uniform,shuffle
from xml.etree.ElementInclude import include
from .shots import PORT_UNKNOWN,PORT_FILTERED,PORT_OPEN
from .shots.even import EVENShot
from .shots.even6 import EVEN6Shot
from .shots.rprn import RPRNShot
from .shots.rrp import RRPShot
from . i... |
task.py | '''
传输文件
包括下载,上传,两个远程主机互传.
输入是多个文件项
linux文件名区分大小写,windows不区分.
例如在linux下可能在一个目录中同时存在: a.txt 和 A.txt
复制到windows下就有问题, 因为 a.txt 和 A.txt 会当成一个文件!
因此需要检测是否重名,以及(为了方便)自动重命名.
由于会发生自动重命名,软连接也可能失效.因此软连接直接复制源文件.
'''
import os
import time
from threading import Thread, Lock
from common import get_safe_tempfile, get_floder_size... |
UpdateGUI.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################
# File: update_remote_project.py
# Created Date: Wednesday February 26th 2020
# Author: Chen Xuanhong
# Email: chenxuanhongzju@outlook.com
# Last Modified: Tuesday, 5th January 2021 3:34:29 pm
# Modified By: Che... |
sh.py | #===============================================================================
# Copyright (C) 2011-2012 by Andrew Moffat
#
# 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 restrict... |
gcsio.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... |
tdtest.py | # encoding: UTF-8
import sys,os
vnpy_root = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','..','..','..','..'))
if vnpy_root not in sys.path:
print(u'append {}'.format(vnpy_root))
sys.path.append(vnpy_root)
from time import sleep
#from qtpy import QtGui
from vnpy.api.ctp_se.vnctptd import *
... |
SociaLite.py | import socialite.engine.LocalEngine as LocalEngine
import socialite.engine.ClientEngine as ClientEngine
import socialite.engine.Config as Config
import socialite.tables.QueryVisitor as QueryVisitor
import socialite.tables.Tuple as Tuple
import socialite.util.SociaLiteException as SociaLiteException
import socialite.typ... |
revolabsFLXInterface.py | import usb.core
import usb.util
import os,sys,time
import fcntl
import threading
from hidDefs import *
class RevolabsFLXInterface:
ENDPOINT_ADDR_INTR_IN = 0x84
ENDPOINT_ADDR_INTR_OUT = 0x05
ENDPOINT_ADDR_BULK_IN = 0x87
ENDPOINT_ADDR_BULK_OUT = 0x08
KERNEL_PATH = "/dev/usb/hiddev0"
def __in... |
main.py | import time
import mido
import pyaudio
import numpy
from functools import lru_cache
import os
import pathlib
import sys
import matplotlib.pyplot as plt
import argparse
from pprint import pprint
import inputs
from multiprocessing import Process
import math
numpy.set_printoptions(threshold=sys.maxsize)
p... |
op_util.py | # Copyright 2017-2021 TensorHub, 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... |
p2p.py | # Created by MysteryBlokHed on 13/12/2019.
import socket
from datetime import datetime
from math import ceil
from threading import Thread
from time import sleep
from .encryption import *
from .exceptions import *
from .status import *
HEADERSIZE = 16
class P2P(object):
"""
`port: int` - The port to host Encw... |
binanceYQ.py | """
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed as, a recommendation
or as a guarantee... |
daemon.py | import os
import asyncio
import warnings
from ahk.autohotkey import AsyncAHK, AHK
import subprocess
import threading
import queue
import atexit
def escape(s):
s = s.replace('\n', '`n')
return s
class STOP:
"""A sentinel value"""
...
class AHKDaemon(AHK):
proc: subprocess.Popen
_template_p... |
test_zeromq.py | # -*- coding: utf-8 -*-
'''
:codeauthor: Thomas Jackson <jacksontj.89@gmail.com>
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import time
import threading
import multiprocessing
import ctypes
from concurrent.futures.thread import ThreadPoolExecutor
# ... |
recover_server.py | #!/usr/bin/env python
"""
Script used to recover testbed servers after reboot/upgrade/black-out.
- Cleanup server
- Start vms
- Add topos
- Deploy minigraphs
"""
from __future__ import print_function
import argparse
import collections
import datetime
import imp
import logging
import os
import subprocess... |
vertical_bar_plot_color.py | import pglive.examples_pyqt6 as examples
import signal
from math import sin
from threading import Thread
from time import sleep
from pglive.sources.data_connector import DataConnector
from pglive.sources.live_plot import LiveVBarPlot
from pglive.sources.live_plot_widget import LivePlotWidget
"""
In this example Verti... |
test_promise.py | #
# Copyright (C) 2010 - 2020 Softbank Robotics Europe
#
# -*- coding: utf-8 -*-
import time
import threading
import pytest
from qi import Promise, Future, futureBarrier, runAsync
pytest_plugins = ("timeout",)
def waiterSetValue(promise, waiter):
# time.sleep(t)
waiter.wait()
try:
promise.setVal... |
helpers.py | # -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
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 | # Copyright 2012-2015 MongoDB, 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 writin... |
unet_industrial.py | # Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import argparse
import numpy as np
import tensorflow.compat.v1 as tf
from functools import partial
from packaging import version
import time
import os
import random
from threading import Thread
from tensorflow.keras.layers import Activation, Conv2D, Conv2DTransp... |
cloak.py | # Copyright (c) 2020 Oxford-Hainan Blockchain Research Institute
#
# 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 appl... |
pg_notifcations.py | #!/usr/bin/env python
import importlib
import select
from contextlib import contextmanager
from functools import partial
from multiprocessing import Process, Queue
import click
import psycopg2
import psycopg2.extensions
from jinja2 import Template
from psycopg2.extras import RealDictCursor
TRIGGER_FUNCTION = """
... |
controller.py | from drone.tello import Tello
import threading
import time
class Controller:
COMMAND_FREQ = 0.05
def __init__(self, tello: Tello):
self.tello = tello
self._pitch_mag = 0
self._roll_mag = 0
self._thrust_mag = 0
self._yaw_mag = 0
self._send_rc_control = F... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
parser = ar... |
tieba_sign.py | #!/usr/bin/env python3
# coding=utf-8
import hashlib
import json
import os
import prettytable as pt
import pyzbar.pyzbar as pyzbar
import requests
import time
from io import BytesIO
from PIL import Image
from random import choice
from threading import Thread
class Tieba(object):
def __init__(self,... |
2-8,9,10tsTcInt.py | __Author__ = "noduez"
from socket import *
import threading
from time import sleep
HOST = 'localhost'
PORT = 2050
BUFSIZ = 1024
ADDR = (HOST, PORT)
tcpCliSock = socket(AF_INET, SOCK_STREAM)
tcpCliSock.connect(ADDR)
username = input("Please set your username:")
tcpCliSock.send("%s join the server".encode('utf-8') % u... |
okex_api.py | '''这个模块的功能先确定一下,连接到交易所之后
1,通过websocket拿到数据,推给handler
2,完成portfolio发出来的订单的具体下单执行。
3,拿到数据后还有做成df,然后推送到套利的队列里面'''
import pandas as pd
import asyncio
import websockets
import json
import requests
import dateutil.parser as dp
import hmac
import base64
import zlib
from functools import partial
def inflate(data):
decom... |
main.py | from flask import Flask
from threading import Thread
from flask_mqtt import Mqtt
from flask_socketio import SocketIO
import eventlet
import time
import db
import auth
import products
import logging
import recipes
def mqtt_thread(mqtt, app):
count = 0
while True:
time.sleep(1)
app: Flask
mqtt: Mqtt
log... |
editor.py | import os
import platform
import sys
import tempfile
from distutils.version import LooseVersion as CheckVer
import time
import threading
from gi.repository import GLib, GObject
import pygtkcompat
from odml.property import BaseProperty
import odml.terminology as terminology
from odml.terminology import cache_load
i... |
collectd_dogstatsd.py | import threading
import time
import dogstatsd
PLUGIN_NAME = "dogstatsd"
DEFAULT_SOCKET = None
DEFAULT_IP = "0.0.0.0"
MAX_RECV_SIZE = 65535
INGEST_URL = "https://ingest.signalfx.com"
class Logger(object):
def __init__(self, collectd_module):
self.verbose_logging = False
self.collectd_module = col... |
analyzer.py | from __future__ import division
import logging
try:
from Queue import Empty
except:
from queue import Empty
from redis import StrictRedis
from time import time, sleep, strftime, gmtime
from threading import Thread
from collections import defaultdict
# @modified 20190522 - Task #3034: Reduce multiprocessing Mana... |
testing.py | """Pytest fixtures and other helpers for doing testing by end-users."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from contextlib import closing
import errno
import socket
import threading
import time
import pytest
from six.moves import http_client
import raspimote_https.... |
base.py | # Copyright 2014 ETH Zurich
#
# 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, sof... |
process_controller.py | # Copyright (C) 2016-2017 Perceval Wajsburt <perceval.wajsburt@gmail.com>
#
# This module is part of SublimeTerm and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import fcntl
import logging
import os
import select
import signal
import struct
import subprocess
import time
from... |
marathon_steps.py | import sys
import time
import multiprocessing
from distutils.version import StrictVersion
import marathon
from behave import given, when, then
from itest_utils import get_marathon_connection_string
sys.path.append('../')
@given('a working marathon instance')
def working_marathon(context):
"""Adds a working mara... |
module_manager.py | import copy
import hashlib
import importlib
import inspect
import logging
import math
import os
import shutil
import threading
import core.utility as util
from core.result_types import ResultType
from core.result_processor import InvalidResultException
from core.scan_result_processor import ScanResultProcessor
from co... |
filemanager.py | import time
import os
import threading
from multiprocessing import Process
import concurrent.futures
from kivy.clock import Clock, mainthread
from kivy.graphics import *
from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.event import EventDispatcher
from kivy.properties import ObjectProperty
from ... |
common.py | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from datetime import timedelta
import json
import yaml
import logging
import os
import subprocess
import re
import stat
import subprocess
import urllib.parse
import threading
import contextlib
import tempfile
import psutil
from functools import reduce,... |
xinterface.py | #!/usr/bin/env python3
import re
import subprocess
import threading
import queue
from Xlib import X, display
from Xlib.ext import record
from Xlib.protocol import rq, event
import shared, CONSTANTS
class Interface(object):
def __init__(self):
self.main_loop = threading.Thread(
target=self._m... |
runner.py | import asyncio
import concurrent.futures
import contextlib
import threading
import types
from typing import TYPE_CHECKING, Any, Optional, Tuple, Type, cast
import click.testing
from typing_extensions import Literal
from kopf import cli
from kopf._cogs.configs import configuration
from kopf._core.intents import regist... |
test_freezetime.py |
import pytest
import random
import datetime
from threading import Thread, RLock
from Acquire.Accounting import Account, Transaction, TransactionRecord, \
Ledger, Receipt, Refund, \
create_decimal, Balance, Accounts
from Acquire.Identity import Authorisati... |
crawl.py | #! -*- coding: utf-8 -*-
import random
from tkinter import *
import threading
import urllib
import http.cookiejar
import time
import webbrowser
from PIL import Image, ImageTk
from tkinter import ttk
import json
import ctypes
import inspect
# 进度条变量
progress_var = None
# 进度数值
progress = 0
# 进度条
progress_bar = None
# 进度提... |
websocket.py | import asyncio
import json
import os
from threading import (
Thread,
)
import websockets
from webu.providers.base import (
JSONBaseProvider,
)
def _start_event_loop(loop):
asyncio.set_event_loop(loop)
loop.run_forever()
loop.close()
def _get_threaded_loop():
new_loop = asyncio.new_event_lo... |
CVE-2019-1003000_CVE-2018-1999002_exploit_chain.py | #!/usr/bin/env python
#
# Exploit Title : jenkins-preauth-rce-exploit.py
# Date : 02/23/2019
# Authors : wetw0rk & 0xtavian
# Vendor Homepage : https://jenkins.oi
# Software Link : https://jenkins.io/download/
# Tested on : jenkins=v2.73 Plugins: Script Security=v1.49, Pipeline:... |
manager.py |
from multiprocessing import Process
from twitterStreamToDb import startTwitterStreamToDb
from hurriyetApiToDb import startHurriyetApiToDb
from ituNlpPipeline import startItuNlpApi
from securityEventsWebPortal import securityEventsWebPortalStart
from twitterPremiumApi import startTwitterPremiumApi
if __name__ == '__... |
Front_end.py | from tkinter import *
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib import pyplot as plt, animation
import csv
from PIL import ImageTk, Image
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import calculation_module as calc
from multi... |
pypoly_server.py | # TODO:
# Usuwanie użytkowników
import argparse
import queue
import signal
import socket
import sys
import threading
import time
import rolypoly_pb2
class SocketInfo:
def __init__(self, addr, port):
self.addr = addr
self.port = port
@staticmethod
def from_str(init_str):
addr, p... |
pre_commit_linter.py | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
cli.py | """Command line interface for polybot"""
import re
import sys
import logging
import importlib
from platform import system
from argparse import ArgumentParser, Namespace
from threading import Thread
from typing import Optional
import yaml
import requests
from colmena.task_server.base import BaseTaskServer
from polybot... |
coordinator.py | '''
* Copyright (c) 2017 LIBBLE team supervised by Dr. Wu-Jun LI at Nanjing University.
* 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 Licen... |
phase_group_test.py | """Unit tests for PhaseGroups generally and running under the test executor."""
import threading
import unittest
import mock
import openhtf as htf
from openhtf import plugs
from openhtf.core import base_plugs
from openhtf.core import phase_collections
from openhtf.core import test_record
from openhtf.util import test... |
arduino_input.py | import serial
import threading
import serial.tools.list_ports
class ArduinoInput:
_port = None
_baudrate = None
_serial = None
_running = False
_callback = None
def __init__(self, callback, port='COM4', baudrate=9600):
self._port = port
self._baudrate = baudrate
self._... |
grabber.py | import os
from urllib import request
if os.name != "nt": exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from datetime import datetime
from threading import Thread
from time import sleep
from sys i... |
thread_info.py | from os import system
import threading
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime as dt
import time
def extract_data(pid):
system("top -H -p "+pid+" -d 0.5 -b >> migrations.txt")
def get_hops(tid):
top_thread = open("migrations.txt")
thread_data ... |
misc.py | from fnmatch import fnmatch
import multiprocessing
from time import sleep, time
import itertools
__copyright__ = "Copyright 2016-2018, Netflix, Inc."
__license__ = "Apache, Version 2.0"
import sys
import errno
import os
import re
from vmaf import run_process
from vmaf.tools.scanf import sscanf, IncompleteCaptureErro... |
test_autograd.py | import gc
import io
import math
import os
import random
import sys
import tempfile
import threading
import time
import unittest
import uuid
import warnings
from copy import deepcopy
from collections import OrderedDict
from itertools import product, permutations
from operator import mul
from functools import reduce, par... |
game.py | from random import *
import playsound
from tkinter import *
from PIL import Image, ImageTk
from threading import Thread
import speech_recognition as sr
import pyttsx3
import time
from pynput.keyboard import Key, Controller
def closeWindow():
keyboard = Controller()
keyboard.press(Key.alt_l)
keyboard.pr... |
vtf_to_tga.py | import sys, os, re
import subprocess
import threading, multiprocessing
import shutil
from pathlib import Path
import shared.base_utils2 as sh
# https://developer.valvesoftware.com/wiki/VTF2TGA
# Runs vtf2tga.exe on every vtf file
# Same thing as `VTFCmd.exe -folder "<dir>\materials\*.vtf" -recurse`
sh.importing = Pa... |
multi_processing.py | '''
Object Tracking with multi-models simultaneously
Created by lolimay at 2019.08.20
'''
import os
import multiprocessing
import torch
import os
import sys
import torchvision
import torchvision.transforms as transforms
from utils.tracking_with_siamfc import tracking_with_siamfc
import numpy as np
# Use GPU if cuda i... |
server.py | #
# Copyright 2015 riteme
#
import threading
import socket
import sys
SOCKET_IP = '127.0.0.1'
SOCKET_PORT = 2048
SOCKET_LISTEN = 4
if __name__ == '__main__':
if len(sys.argv) > 1:
SOCKET_IP = sys.argv[1]
if len(sys.argv) > 2:
SOCKET_PORT = int(sys.argv[2])
if len(sys.argv) > 3:
SO... |
make.py | import glob
import json
import os
import shutil
import time
import stat
import subprocess
import threading
import webbrowser
import shlex
import errno
import math
import bpy
import arm.assets as assets
from arm.exporter import ArmoryExporter
import arm.lib.make_datas
import arm.lib.server
import arm.log as log
import... |
email.py | from flask_mail import Message
from flask import render_template
from app import mail, app
from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender=sender, reci... |
utils.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import threading
import json
from .resilientsession import raise_on_error
class CaseInsensitiveDict(dict):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of
``collections.MutableMapping`` as well as d... |
trezor.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, versiontuple, UserCancelled
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT, is_address)
from electrum import constants
from electrum.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.