source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
automated_run.py | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... |
search.py | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... |
HXTool.py | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 9 13:22:07 2018
Updated on Thu May 9
@author: Kiranraj(kjogleka), Himanshu(hsardana), Komal(kpanzade), Avinash (avshukla)
"""
import warnings
warnings.filterwarnings(action='ignore', module='.*paramiko.*')
import subprocess
import paramiko
import threading
im... |
readCoilsException.py | import os
import threading
from System.Core.Global import *
from System.Core.Colors import *
from System.Core.Modbus import *
from System.Lib import ipcalc
class Module:
info = {
'Name': 'Read Coils Exception Function',
'Author': ['@enddo'],
'Description': ("Fuzzing Read Coils Exception Function"),
... |
download_pdfs_v2.py | import requests
import re
import os
import dotenv
import google.cloud.storage as storage
import pandas as pd
import numpy as np
import threading
"""
Input: None
Output: GCS Client Object
"""
def connect_to_gcs():
client = storage.Client.from_service_account_json(os.getenv('credentials'))
print('successful cli... |
leap.py | #!/usr/bin/env python3
'''
Climb up and leap forward
Copyright (C) 2020 Simon D. Levy
MIT License
'''
import gym
import numpy as np
import threading
import time
ALTITUDE_TARGET = 10 # meters
def update(env):
# Create and initialize copter environment
env.reset()
# Start with moto... |
music.py | #!/usr/bin/env python3
# @File:music.py
# @Date:2018/05/28
# @Update:2018/06/11
# Author:Cat.1
# 2018/7/20 适应升级后的json版本
# 2018/7/27 添加token验证
import requests
import argparse
import json
import os
import re
import threading
import subprocess
import Logger
import random
import rsa
import base64
from valid_token import v... |
5pro.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
im... |
test_util_test.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... |
personlost.py | #! /usr/bin/env python
# -*- encoding: UTF-8 -*-
# DOCUMENTATION
# http://doc.aldebaran.com/2-5/naoqi/peopleperception/alengagementzones-api.html#alengagementzones-api
import qi
import argparse
import sys
import os
import time
import threading
import math
from naoqi import ALProxy
import conditions
from conditions ... |
report.py | # -*- coding: UTF-8 -*-
################################################################################
#
# Copyright (c) 2018 Baidu.com, Inc. All Rights Reserved
#
################################################################################
"""
**state_service** 状态展示模块,用于对支持中的状态进行展示,返回json数据
.. Note:: 当前只提供了根据op... |
client_server.py | import Pyro.core
import Pyro.naming
import os
import sys
import subprocess
import threading
from threading import Thread
class DirectoryEntity(Pyro.core.ObjBase):
def __init__(self, daemon, name, dir_path):
Pyro.core.ObjBase.__init__(self)
self.name = name
self.daemon = daemon... |
tracker.py | # 2020 - Rafael Urben
# https://github.com/rafaelurben/django-discordbot/tree/master/discordbot/files/amongus
import json
import threading
import time
import pyautogui
import requests
import sys
from win10toast import ToastNotifier
from rich import print
from rich.table import Table
from rich.text import Text
from ri... |
redis_to_ap.py | #!/usr/bin/env python3
# Set MAVLink protocol to 2.
import os
os.environ["MAVLINK20"] = "1"
import time
import threading
import traceback
import logging
from apscheduler.schedulers.background import BackgroundScheduler
from mycelium.components import RedisBridge, Connector
from mycelium_utils import Scripter, utils,... |
mavlink.py | from __future__ import print_function
import logging
import time
import socket
import errno
import sys
import os
import platform
import copy
from dronekit import APIException
from pymavlink import mavutil
from queue import Queue, Empty
from threading import Thread
if platform.system() == 'Windows':
from errno imp... |
strategies.py | import logging
import threading
import time
from typing import List
from brownie import Contract, chain
from eth_utils import encode_hex, event_abi_to_log_topic
from yearn.utils import safe_views, contract
from yearn.multicall2 import fetch_multicall
from yearn.events import create_filter, decode_logs
STRATEGY_VIEW... |
mp.py | ''' Doc_String '''
####################################################################
r'''################################################################
pydub makes stuff quieter by:
applying a gain to the audio_segment like this:
def apply_gain(self, volume_change):
self._data --> is ... |
__init__.py | """
# an API for Meshtastic devices
Primary class: SerialInterface
Install with pip: "[pip3 install meshtastic](https://pypi.org/project/meshtastic/)"
Source code on [github](https://github.com/meshtastic/Meshtastic-python)
properties of SerialInterface:
- radioConfig - Current radio configuration and device setting... |
watch.py | import asyncio
from multiprocessing.context import Process
from pathlib import Path
from time import time
from aiohttp import web
from aiohttp.web_exceptions import HTTPMovedPermanently, HTTPNotFound
from aiohttp.web_fileresponse import FileResponse
from aiohttp.web_response import Response
from watchgod import Python... |
Barbot.py | #!/usr/bin/python3
import eventlet
eventlet.monkey_patch()
import sys, os, signal, logging, time, argparse
from threading import Thread, Event
from peewee import IntegrityError
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import barbot.config
config = barbot.config.load()
import ba... |
executor.py | # Copyright 2019 The Meson development team
# 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 ... |
rfswarm.py | #!/usr/bin/python
#
# Robot Framework Swarm
#
# Version v0.6.1-beta
#
# Helpful links
#
# making things resize with the window https://stackoverflow.com/questions/7591294/how-to-create-a-self-resizing-grid-of-buttons-in-tkinter
#
import sys
import signal
import os
import glob
import configparser
import hashlib
i... |
TAXIIServer.py | import demistomock as demisto
from CommonServerPython import *
from flask import Flask, request, make_response, Response, stream_with_context
from gevent.pywsgi import WSGIServer
from urllib.parse import urlparse, ParseResult
from tempfile import NamedTemporaryFile
from base64 import b64decode
from typing import Callab... |
squash_server.py | #License MIT 2017 Ahmad Retha
import os
import pygame
import pygame.mixer
import threading
import queue
import json
import flask
import numpy as np
from PIL import Image
from io import BytesIO
import logging
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from glob import glob
impor... |
workerpool.py | """Worker pool module."""
import logging
from threading import Thread, Event
from six.moves import queue
class WorkerPool(object):
"""Worker pool class to implement single producer/multiple consumer."""
def __init__(self, worker_count, worker_func):
"""
Class constructor.
:param wor... |
loader.py | # Copyright 2004-2019 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... |
trainer.py | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
photo.py | from multiprocessing import Process, Queue
import cv2
from PIL import ImageTk
from PIL import *
from PIL import Image
import tkinter as tk
def image_capture(queue):
vidFile = cv2.VideoCapture(0)
while True:
flag, frame=vidFile.read()
frame = cv2.cvtColor(frame,cv2.cv.CV_BGR2RGB)
... |
surface_stats_collector.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import Queue
import threading
# Log marker containing SurfaceTexture timestamps.
_SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps'
_... |
synthetic_test.py | from socialsent import constants
from socialsent import util
import polarity_induction_methods
import time
from socialsent import seeds
from socialsent import vocab
import random
import numpy as np
from socialsent import evaluate_methods
from Queue import Empty
from multiprocessing import Process, Queue
from socialsent... |
logging.py | import copy
import logging
import time
from pathlib import Path
from collections import defaultdict, deque
import logging.handlers
import ipywidgets as widgets
from contextlib import contextmanager
import psutil
from . import widgets, paths
from .contextlib import maybeasynccontextmanager
import sys
import traceback
im... |
elevator.py | #!/usr/bin/python
import csv
import threading
import urllib
import os
import time
import sys
VERSION = '0.1'
DB = "files.csv"
END = False
def process_exploit(exploit, url_opener):
filename = exploit['file'][exploit['file'].rindex('/') + 1:]
files_to_delete = [filename]
try:
global END
... |
online.py | import types
from typing import List, Callable
from enum import Enum
from io import IOBase, StringIO
from pandas import DataFrame
from iclientpy.rest.apifactory import OnlineAPIFactory
from iclientpy.rest.api.model import DataItemType, PostMyDatasItem, Layer, LayerType, SourceType, PostMapsItem, Point2D, \
R... |
paramiko_mulitprocess.py | '''
Requires paramiko >=1.8.0 (paramiko had an issue with multiprocessing prior
to this)
Example code showing how to use netmiko for multiprocessing. Create a
separate process for each ssh connection. Each subprocess executes a
'show version' command on the remote device. Use a multiprocessing.queue to
pass data fro... |
donkey_sim.py | # Original author: Tawn Kramer
import asyncore
import base64
import math
import time
from io import BytesIO
from threading import Thread
import numpy as np
from PIL import Image
from modules.config import INPUT_DIM, ROI, THROTTLE_REWARD_WEIGHT, MAX_THROTTLE, MIN_THROTTLE, \
REWARD_CRASH, CRASH_SPEED... |
ssh.py | from __future__ import absolute_import
import inspect
import logging
import os
import re
import shutil
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from pwnlib import term
from pwnlib.context import context
from pwnlib.log import Logger
from pwnlib.log import getLo... |
sobol.py | # Dakota Python Driving Script
# necessary python modules
import dakota.interfacing as di
import subprocess
import sys
import os
import multiprocessing
sys.path.append('../../scripts')
import input as inp
import output as oup
import external_cym
cycdir = '../../cyclus-files/sobol/'
# -----------------... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines, fixme
# pylint: disable=too-few-public-methods
# pylint: disable=import-error
"""
Dask extensions for distributed training
----------------------------------... |
app.py | #!/usr/bin/env python
from importlib import import_module
import os
from flask import Flask, render_template, Response, send_from_directory
from flask_cors import *
# import camera driver
from camera_opencv import Camera
import threading
# Raspberry Pi camera module (requires picamera package)
# from camera_pi import... |
bot.py | import io
import random
import re
import string
from multiprocessing import Process, Manager
from flask import Flask, url_for
from mutagen.mp3 import MPEGInfo
import requests
import telebot
from app.dotawiki import DotaWikiScrapper
def telegram_audio_result(response: dict, answer_id: int, results: list):
text = ... |
MotorV3.py | import RPi.GPIO as GPIO
import threading
import time
class Motor:
def __init__(self, pwma_pin, pwmb_pin, ain1_pin, ain2_pin, bin1_pin, bin2_pin, stby_pin):
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
# Motor 1: forwards/backwards
self.ain1_pin = ain1_pin
... |
s.py | # coding: utf-8
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from bs4 import BeautifulSoup
from threading import Thread,Lock
import os
import csv
from selenium.webdriver.support import expected_conditions as EC
from pyquery import PyQuery as pq
from selenium.webdrive... |
server_test.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... |
test_new_kvstore.py | import os
import time
import numpy as np
import socket
from scipy import sparse as spsp
import dgl
import backend as F
import unittest
from dgl.graph_index import create_graph_index
import multiprocessing as mp
from numpy.testing import assert_array_equal
if os.name != 'nt':
import fcntl
import struct
def get... |
basic.py | import os
import random
import requests
import subprocess
import sys
import threading
import time
import unittest
class BasicTests(unittest.TestCase):
def setUp(self):
self.process = None
def tearDown(self):
if self.process:
self.process.terminate()
self.process.wait()
... |
datasets.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Dataloaders and dataset utils
"""
import glob
import hashlib
import json
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import Pool, ThreadPool
from pathlib import Path
from threading import Thread
from zipfile im... |
thread_custom.py | import queue
from threading import Thread, Event
def threaded(f, daemon=False):
def wrapped_f(q, *args, **kwargs):
'''this function calls the decorated function and puts the
result in a queue'''
ret = f(*args, **kwargs)
q.put(ret)
def wrap(*args, **kwargs):
'''this is... |
profile_scraper.py | import requests
import threading
from bs4 import BeautifulSoup
import Queue
from sys import argv
def formUrl(user_id, page):
return 'https://www.ratebeer.com/ajax/user/{0}/beer-ratings/{1}/5/'.format(user_id, page)
def getPagnination(soup):
try:
pages = int(soup.ul.findChildren()[-1]['href'].split('/')[-3])... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
def unblock_stdout():
# get a non-blocking stdout
child_pid, child_pty = os.forkpty()
if ch... |
websocket_unittest.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import BaseHTTPServer
import hashlib
import socket
import threading
import unittest
from telemetry.core.backends.chrome_inspector import webso... |
benchmark_test.py | import requests
import json
import threading
from pprint import pprint
import random
import time
webserver_user = ""
webserver_passwd = ""
MAX_CONCURRENT_NUM = 200
SERVER_ADDRESS = "http://localhost:8080/api/v1/"
DAG_DIR = "dags/tutorial/dagRuns"
def make_a_request():
random_ID = str(random.randint(7, 19991))
... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
import os
import pickle
import random
import re
import subprocess
import sys
import sysconfig
import textwrap
import time
import unittest
from test import support
from te... |
client.py | # Copyright 2014 Cloudera 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, so... |
afk.py | import platform
from threading import Event, Thread
from datetime import datetime, timedelta
import logging
from pymouse import PyMouse, PyMouseEvent
from pykeyboard import PyKeyboard, PyKeyboardEvent
from ..base import Watcher, Activity
def _repeat_trigger(waiter: Event, trigger: Event, timeout):
if waiter.wai... |
rabbitmq_transport.py | # -*- coding: utf-8 -*-
from queue import queue
import pika
import ssl
from threading import Thread
import time
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class RabbitmqTransport(BaseTransport):
def __init__(self, beaver_config, logger=N... |
test_backend.py | import base64
import copy
import datetime
import threading
import time
import unittest
from datetime import timedelta
from unittest.mock import Mock, patch
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.core.cache import DEFAULT_CACHE_ALIAS,... |
backend_overview.py | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
gloable_way3.py | from share_var.gloable import lis
import threading
def consume():
for i in lis:
with open('aabc.txt', 'a+') as file:
file.write('{},{}\n'.format(i, threading.current_thread().name))
if __name__ == '__main__':
from threading import Thread
t1 = Thread(target=consume, name='t1')
t2... |
game.py | # -*- coding: utf-8 -*-
import time
import curses
from sys import exit
import threading
SÜD = 2
NORD = 0
OST = 1
WEST = 3
KEY_RIGHT = 454
KEY_LEFT = 452
KEY_DOWN = 456
KEY_UP = 450
def error(msg):
print(msg)
exit(-1)
def gamefieldToArray(thisfield):
splitlines = thisfield.splitlines()
arrfield = []... |
shaker.py | import yaml
import os
from mako.template import Template
from socketIO_client import SocketIO,BaseNamespace
import redis,sys,getopt,pxssh,getpass,StringIO,contextlib,pexpect
from threading import Thread
# import custom module
from modules import *
r = redis.StrictRedis()
nsGlobal.init()
class Namespace(BaseNamespace):
... |
manager.py | #!/usr/bin/env python3
import datetime
import importlib
import os
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import textwrap
import time
import traceback
from multiprocessing import Process
from typing import Dict
from common.basedir import BASEDIR
from common.spinner import Sp... |
jobStoreTest.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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... |
c3po.py | # -*- coding: utf-8 -*-
# Copyright 2015-2020 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... |
EyeTrackVR.py | import cv2
import numpy as np
import threading
import time
import os
try:
fy= open("camport.txt","r+")
camport = fy.read().strip()
fy.close
except:
camport = 0
cam = open('camport.txt', 'w+')
cam.write('0')
cam.close
print('Error: Run Gui first and adjust camera port')
time.sleep(1... |
TCP_OFPTxx.py | """Questo è il file che mi serve per testare in TCP la riuscita della connessione """
import copy
import ctypes
import random
from threading import Thread
import dataclasses
import socket
from time import sleep
from pyof.foundation.basic_types import UBInt32, UBInt16, UBInt8, UBInt64, DPID
from pyof.utils import unpa... |
run_benchmark.py | # coding: utf-8
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
import numpy as np
import pandas as pd
import json
import time
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from multiprocessing import Pool, Process, cpu_count, Manager
from ensemble_boxes import *
def get_coco_annotat... |
run_server.py | #!/usr/bin/env python
# Copyright 2013 Brett Slatkin
#
# 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... |
oper.py | #!/usr/bin/python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Zhao Minghao, Guannan Ma
"""
:description:
shell operations related module
"""
from __future__ import print_function
import os
import sys
import time
import uuid
import tempfile
import shutil
import signal
import rand... |
gcp_janitor.py | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... |
controller.py | import time
import logging
import threading
from typing import Optional, Callable, Union, Text
logger = logging.getLogger(__name__)
class missionController:
FLAG: bool = False
okderby: Union[Callable, None] = None
job_name: Text = ""
watch_thread = threading.Thread()
auto_derby_thread = threading... |
worker.py | #!/usr/bin/python3
# first init env
import env, tools
config = env.getenv("CONFIG")
tools.loadenv(config)
# must import logger after initlogging, ugly
from log import initlogging
initlogging("docklet-worker")
from log import logger
import xmlrpc.server, sys, time
from socketserver import ThreadingMixIn
import thread... |
replay_actions.py | #!/usr/bin/python
# Copyright 2017 Google 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/LICENSE-2.0
#
# Unless required by ... |
P36_SimpleReaderWriter.py | # Edgar Barrera / Github: https://github.com/EdgarCastillo101/EdgarCastillo101
# Copyright (c) 2021 Edgar Barrera
#In this example, we will see how to implement a simple reader Writer program using Python (Mutex)
import threading as thread
import random
global x #Shared Data
x = 0
lock = thread.Lock()... |
test_io.py | import numpy as np
import numpy.ma as ma
from numpy.ma.testutils import (TestCase, assert_equal, assert_array_equal,
assert_raises, run_module_suite)
from numpy.testing import assert_warns, assert_
import sys
import gzip
import os
import threading
from tempfile import mkstemp, NamedTemporaryFile
import time
from... |
server.py | ########################################################################################################
# AI人工智障写作 - https://github.com/BlinkDL/AI-Writer
########################################################################################################
import math
import json
import random
import time
_DEBUG_L... |
_threads.py | import threading
import queue as stdlib_queue
from itertools import count
from . import _core
__all__ = [
"current_await_in_trio_thread", "current_run_in_trio_thread",
"run_in_worker_thread",
]
def _await_in_trio_thread_cb(q, afn, args):
async def await_in_trio_thread_task():
nonlocal afn
... |
client.py | import asyncio
import logging
import sys
import time
from threading import Thread, Event
from typing import Union, List, Tuple
from asyncio import Transport, Protocol
from bs4 import BeautifulSoup
import kik_unofficial.callbacks as callbacks
import kik_unofficial.datatypes.exceptions as exceptions
import kik_unofficia... |
Utils.py | import datetime
import pickle
import struct
import hashlib
import json
import socket
from threading import Thread
import os, sys
import random
from RSA import RSA
import pandas as pd
prKey = (98581262173360837326167111125113695068362686677036762762847714161386363356381, 394325048693443349304668444500454780270931536429... |
test_api_end_to_end.py | from threading import Event, Thread
from unittest import TestCase
import json
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
from autobahn.twisted.resource import WebSocketResource
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.static i... |
game_controller.py | import os
import threading
import time
import cv2
from template_finder import TemplateFinder
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 i... |
reddit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import sys
import time
import os.path
import math
import re
import argparse
import traceback
import json
import bz2
import gzip
from nltk.tokenize import TweetTokenizer
from flashtext import Keywo... |
sshconfigfs.py | #!/usr/bin/env python
# FUSE filesystem to build SSH config file dynamically.
# Mark Hellewell <mark.hellewell@gmail.com>
import errno
import glob
import logging
import logging.handlers
import os
import stat
import threading
import time
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
stderrhandler = log... |
face2rec2.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... |
__main__.py | import argparse
import asyncio
import os
import signal
import sys
import threading
from typing import Any, Set
from .client import connect
from .exceptions import ConnectionClosed, format_close
if sys.platform == "win32":
def win_enable_vt100() -> None:
"""
Enable VT-100 for console output on Wi... |
data_migration.py | # Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
"""
Script to perform database migration from dynamodb instance in easyclav1 to RDS in easyclav2
"""
import logging
import os
import sys
import threading
from datetime import datetime
from queue import Queue
from ... |
collect.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
////////////////////////////////////////////////////////////////////
// Android logcat collect tool
// Usage:
// python collect.py
// -f force restart or not
// -p the_package_to_collect_log
// -l the_path_to_output_log
// Colle... |
dynamic_secret_rotation_db_conn.py | import logging
import threading
import mysql.connector
from ssm.requester import Error, LoopTimer, get_current_account
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
class Config:
"""完整配置信息类,包括数据库连接配置,SSM 账号信息等
"""
def __init__(self, params=None):
"... |
fed_server.py | # Copyright (c) 2021-2022, NVIDIA 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/LICENSE-2.0
#
# Unless required by ... |
log.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2017 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import os
import signal
import socket
import SocketServer
import sys
import threading
import time
import traceback
from core.common import check_whitelisted
from core.common import check_s... |
swan_miner.py | import threading
from swan_miner_deal_downloader import downloader
from swan_miner_deal_importer import importer
from swan_miner_deal_scanner import scanner
if __name__ == "__main__":
swan_miner_downloader = threading.Thread(target=downloader)
swan_miner_importer = threading.Thread(target=importer)
swan_m... |
beacon_client.py | # -*- coding: utf-8 -*-
"""
Event server simple client
Waits for I-Beacons and sends messages
Temporary stores messages in file
MIT License
Copyright (c) 2017 Roman Mindlin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Softwar... |
patch_progress.py | # Copyright (c) Trainline Limited, 2017. All rights reserved. See LICENSE.txt in the project root for license information.
import time
import sys
import threading
import math
import datetime
import progressbar.utils
from progressbar import ProgressBar, FormatLabel, Timer, Bar, RotatingMarker, Percentage
class PatchP... |
UpnpLibrary.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
import re
import sys
import os
import subprocess
import threading
if __name__ != '__main__':
from robot.api import logger
else:
try:
from console_logger import LOGGER as logger
except ImportError:
import logging
... |
simpleserver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: moxie/tests/simpleserver.py
"""
Defines the class that instantiates a basic http server.
Classes:
SimpleServer: Wrapper object for the HTTPServer object.
Attributes:
HOST_NAME (str): Hostname used for creating SERVER_URL elsewhere.
HOST_IP (str): I... |
heartrate_monitor.py |
from max30102 import MAX30102
import hrcalc
import threading
import time
import numpy as np
class HeartRateMonitor(object):
"""
A class that encapsulates the max30102 device into a thread
"""
LOOP_TIME = 0.01
def __init__(self, print_raw=False, print_result=False):
self.bpm = 0
... |
__init__.py | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__release__ = '3.0-dev'
__version__ = '$Id: e4000cc8b1ddcd00ae795cdeca1a4c903d8a321e $'
__u... |
tiny_yolo_processor.py | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# NPS
# processes images via tiny yolo
from mvnc import mvncapi as mvnc
import numpy as np
import cv2
import queue
import threading
class tiny_yolo_processor:
# Tiny Yolo assumes input images are ... |
pyinstall.py | #!E:\softWare\python\FirstPython\venv\Scripts\python.exe
import sys
import os
import optparse
import pkg_resources
import urllib2
import urllib
import mimetypes
import zipfile
import tarfile
import tempfile
import subprocess
import posixpath
import re
import shutil
try:
from hashlib import md5
except ImportError:
... |
server.py | import socket, os, time, threading, sys, json
from queue import Queue
from cryptography.fernet import Fernet
arrAddresses = []
arrConnections = []
strHost = "0.0.0.0"
intPort = 3000
intBuff = 1024
queue = Queue()
# function to return string with quotes removed
remove_quotes = lambda string: string.replace("\"", ""... |
example3.py | import threading
import random
random.seed(0)
import time
def update(pause_period):
global counter
with count_lock:
current_counter = counter # reading in shared resource
time.sleep(pause_period) # simulating heavy calculations
counter = current_counter + 1 # updating shared resou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.