source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
gaia_project.py | import os
import random
import sys
from threading import Thread
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
from PIL import Image
import constants as C
from automa import Automa
from federation import FederationToken
from player import Player
from research import Research
from scoring import Scor... |
c3po.py | # Copyright 2015-2018 CERN for the benefit of the ATLAS collaboration.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
browser.py | '''
Copyright (c) 2019 Vanessa Sochat
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, merge, publish, distribute... |
recipes_broadcast.py | """
Sends every X seconds a list of recipes.
"""
import threading
import time
import common.mqtt_messages as mqtt_messages
import common.mqtt_connection as mqtt_connection
import common.mqtt_topics as mqtt_topics
import server.database as database
_RECIPES_SECONDS_DELAY = 5
def _recipes_sender():
"""
... |
setup.py | #!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... |
producer_consumer.py | # coding: utf-8
import threading
from datetime import datetime
from time import sleep
MESSAGE_CACHE = []
def log(msg):
print('[' + str(datetime.now().second) + ']' + msg)
class Producer(threading.Thread):
def __init__(self, event, message_count=100):
super(Producer, self).__init__()
self.p... |
snmp_ifTable.py | #!/usr/bin/python
import logging
logging.basicConfig(level=logging.ERROR)
import os
import time
import datetime
import subprocess
import threading
import Queue
# own modules
import tilak_centreon
def get_snmp_table(hostname, table_oid, community, index=False):
"""
hostname : <str>
table_oid : <str>
com... |
metrix_Store_MetrixColors.py | # Embedded file name: /usr/lib/enigma2/python/Plugins/Extensions/MyMetrix/metrix_Store_MetrixColors.py
import thread
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from twisted.web.client import downloadPage... |
worker.py | # PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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 ap... |
QATdx_adv.py | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... |
pc-stats.py | import time
import psutil, socket
from datetime import datetime
import requests, sys
from threading import Thread
def parseCPU():
log = psutil.cpu_freq(percpu=False).current
return log
def parseTemp():
log = str(psutil.sensors_temperatures()).split("current=")[1].split(",")[0]
return '{} C'.format(log)
def parse... |
app.py | from kivy.app import App
from kivy.app import async_runTouchApp
from kivy.uix.layout import Layout
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.progressbar import ProgressBar
from kivy.uix.textinput import... |
client.py | import http.client
import json
import logging
import threading
from urllib.parse import quote_plus
from .handler import ADMIN_PATH, CaptureRequestHandler, create_custom_capture_request_handler
from .server import ProxyHTTPServer
log = logging.getLogger(__name__)
class AdminClient:
"""Provides an API for sending... |
trigger.py | import time
import json
import redis
import threading
import sys
sys.path.append('..')
from logger.Logger import Logger, LOG_LEVEL
class Trigger():
def __init__(self, main_thread_running, system_ready, name='Trigger',key=None, source=None, thresholds=None, trigger_active=None, frequency='once', actions=[], trigger_... |
hello_run.py | import os
from flask import Flask, render_template, session, redirect, url_for
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
from flask_sqlalchemy import SQLAlchemy
from flask... |
server.py | """
Web Server
"""
import socket
import threading
from todo.config import HOST, PORT, BUFFER_SIZE
from todo.utils import Request, Response
from todo.controllers import routes
def process_connection(client):
"""处理客户端请求"""
# 接收请求报文数据
# 解决客户端发送数据长度等于 recv 接收的长度倍数时阻塞问题
# https://docs.python.org/zh-cn/3.7... |
strategies.py | import tensorflow as tf
import uuid
import numpy as np
import concurrent.futures
import asyncio
from threading import Thread
import os
from mincall.common import TOTAL_BASE_PAIRS
from keras import models
from mincall.external.tensorflow_serving.apis import predict_pb2
from mincall.external.tensorflow_serving.apis impo... |
cookie-clicker-advanced.py | from coockieClickerUtils import *
# import threading
# Navigate to the application home page.
driver.get('https://orteil.dashnet.org/cookieclicker/')
load()
# Wait 2 seconds for the page to finish loading.
time.sleep(2)
# Load a script to speed up clicking.
hackCoockie()
# Accept cookies and chose English as langu... |
test_c10d.py | import copy
import math
import operator
import os
import random
import signal
import sys
import tempfile
import threading
import time
import traceback
import unittest
from unittest import mock
from contextlib import contextmanager
from datetime import timedelta
from functools import reduce
from itertools import groupby... |
crawler.py | # -*- codeing = utf-8 -*-
from bs4 import BeautifulSoup # 网页解析,获取数据
import re # 正则表达式,进行文字匹配`
import urllib.request, urllib.error # 制定URL,获取网页数据
import xlwt # 进行excel操作
import time
import random
import re
import time
import requests
import threading
from lxml import html
etree=html.etree
from bs4 import BeautifulSo... |
split.py | import torch
import os, sys
from multiprocessing import Process, Manager
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'submodels', 'SoftConciseNormalForm')))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'submodels', 'RegexGenerator')))
from collections import Co... |
test_selenium.py | #-*- coding: utf-8 -*-
import re
import threading
import time
import unittest
from selenium import webdriver
from app import create_app, db
from app.models import Role, User, Post
class SeleniumTestCase(unittest.TestCase):
client = None
@classmethod
def setUpClass(cls):
# start Firefox
tr... |
ssh_utils.py | #!/usr/bin/env python
# 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
# "Li... |
weixin.py | #!/usr/bin/env python
# coding: utf-8
import qrcode
from pyqrcode import QRCode
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import http.cookiejar
import requests
import xml.dom.minidom
import json
import time
import ssl
import re
import sys
import os
import subpro... |
misc.py | import os
import sys
import linecache
import functools
import io
from threading import Thread
from . import logger
class TimeoutError(Exception):
pass
def timeout(seconds, error_message='Time out'):
def decorated(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
share... |
tts.py | from __future__ import annotations
from typing import Callable, List, Tuple
from queue import Queue
import threading
import time
import accessible_output2.outputs.auto
from .log import warning, exception
class _TTS:
_end_time = None
def __init__(self, wait_delay_per_character):
self.o = accessibl... |
ircthread.py | #!/usr/bin/env python
# Copyright(C) 2021 CryptoLover705
#
# 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,... |
authenticate.py | # shows a user's playlists (need to be authenticated via oauth)
import threading
import spotipy.oauth2 as oauth2
import spotipy
import queue
import os
from os.path import isdir, expanduser
from urllib.parse import urlparse
from bottle import route, run, response, request
auth_token_queue = queue.Queue()
event_queue ... |
playback.py | import os
import time
import random
import threading
import RPi.GPIO as GPIO
# Define sounds
SOUNDS = {11: {'audio': ['CS_01.wav', 'CS_02.wav', 'CS_06.wav', 'CS_07.wav', 'CS_08.wav', 'CS_09.wav'], 'last_action': 0},
12: {'audio': ['CHM_01.wav', 'CHM_02.wav', 'CHM_03.wav', 'CHM_04.wav', 'CHM_05.wav'], 'last_... |
runserver.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import sys
from threading import Thread
from pogom import config
from pogom.app import Pogom
from pogom.models import create_tables
from pogom.search import search_loop, set_cover, set_location, search_loop_async
from pogom.utils import get_args
log = logging.... |
examples.py | # ------------------------------------------------------------------------------
# Created by Tyler Stegmaier.
# Property of TrueLogic Company.
# Copyright (c) 2020.
# ------------------------------------------------------------------------------
#
# ------------------------------------------------------------------... |
downloader.py | """
Support for functionality to download files.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/downloader/
"""
import logging
import os
import re
import threading
import requests
import voluptuous as vol
from homeassistant.helpers import validate_con... |
get_rates.py | """ main module """
from concurrent.futures import ThreadPoolExecutor
from datetime import date
from requests import request
import time
import threading
from rates_demo.business_days import business_days
def get_rates() -> None:
""" get the rates """
start_date = date(2021, 1, 1)
end_date = date(2021, ... |
main.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import os.path
import sys
import tempfile
import tfi
import tfi.driver
import tfi.driverconfig
from tfi.resolve.model import _detect_model_file_kind, _model_mo... |
algo_six.py | from functools import reduce
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.mqtt.client as mqtt... |
animationcontroller.py | # led-control WS2812B LED Controller Server
# Copyright 2021 jackw01. Released under the MIT License (see LICENSE for details).
import math
import random
import time
import traceback
import RestrictedPython
from threading import Event, Thread
from ledcontrol.controlclient import ControlClient
import ledcontrol.animat... |
example_test.py | # Need Python 3 string formatting functions
from __future__ import print_function
from threading import Thread
import ttfw_idf
# Define tuple of strings to expect for each DUT.
master_expect = ("CAN Master: Driver installed", "CAN Master: Driver uninstalled")
slave_expect = ("CAN Slave: Driver installed", "CAN Slave... |
worker.py | import json
import socket
import time
import sys
import random
import numpy as np
import threading
from datetime import datetime
port_no=int(sys.argv[1])
worker_id=sys.argv[2]
class worker:
def __init__(self):
self.req()
''' Function which decrements the duration of the task until 0 i.e executes the task and sen... |
oes_td.py | import time
from copy import copy
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from gettext import gettext as _
from threading import Lock, Thread
# noinspection PyUnresolvedReferences
from typing import Any, Callable, Dict
from vnpy.api.oes.vnoes import OesApiClientEnvT, OesApi... |
parallel_senders.py | import threading
import BB
class ParallelSender(object):
'''
Sends a command and waits for the answer in parallel to other thread's execution,
allowing other thread's to poll if the response have been received.
:param Command command: Command to be sent, must be an instance of class Command.
:... |
hunitytools.py | import threading
from .gextension import Extension
from .hmessage import HMessage, Direction
from .hunityparsers import HUnityEntity, HUnityStatus
class UnityRoomUsers:
def __init__(self, ext: Extension, users_in_room=28, get_guest_room=385, user_logged_out=29, status=34):
self.room_users = {}
se... |
package.py | import os
import threading
import uuid
import yaml
from django.db import models
from common.models import JsonTextField
from django.utils.translation import ugettext_lazy as _
from fit2ansible.settings import PACKAGE_DIR
from kubeops_api.package_manage import *
__all__ = ['Package']
class Package(models.Model):
... |
autologin1.py | import time
import pythoncom
from manuallogin import *
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer
from multiprocessing import Process
from PyQt5.QAxContainer import QAxWidget
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import openapi_path
class Wi... |
live_stream_app.py | import cv2
import os
import sys
from time import time
from datetime import datetime
import argparse
from imutils.video import FPS
import utils
from threading import Thread
from queue import Queue
def live_stream(cam_id):
""" """
# cam = utils.WebCam(cam_id, 'Live Streaming')
cam = utils.IPCam('https://www.... |
test.py | import os
import sys
import unittest
import time
import urllib
import threading
import six
from six.moves.urllib import request as urllib_request
from six.moves.urllib import parse as urllib_parse
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
TEST_DEFAULTS = {
'ROOT_URLCONF': 'j... |
12_push_constants.py | import sys, os
#get path of script
_script_path = os.path.realpath(__file__)
_script_dir = os.path.dirname(_script_path)
pyWolfPath = _script_dir
if sys.platform == "linux" or sys.platform == "linux2":
print "Linux not tested yet"
elif sys.platform == "darwin":
print "OS X not tested yet"
elif sys.platform ==... |
test_config_server.py | # (C) Copyright 2020- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... |
shad0w.py | #!/usr/bin/env python3
import os
import sys
import ssl
import socket
import asyncio
import argparse
from threading import Thread
from lib import debug
from lib import banner
from lib import http_server
from lib import console
from lib import encryption
from lib import buildtools
from lib import mirror
from lib impor... |
message_spammer.py | import requests , threading , random , time
from colorama import Fore , Style
"""
Developed by CRYONICX
All responsibility for the project is on you.
DISCORD = CRYONICX#9999 ID = 788124670556766209
"""
class Message_spammer:
def __init__(self, token , channel_id ,message):
liste = [""]
self.messag... |
cli.py | import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import ckan.logic as logic
import ckan.model as model
import ckan.include.rjsmin as rjsmin
import ckan.include.rcssmin as rcssmin
import ckan.lib.fanstatic_resources as fanstatic_resources... |
test_tracer.py | # -*- coding: utf-8 -*-
"""
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
import os
from os import getpid
import threading
from unittest.case import SkipTest
import mock
import pytest
import six
import ddtrace
from ddtrace.constants import ENV_KEY
from ddtrace.constants import HOSTNAME_... |
ProxyServer.py | import socket
from threading import Thread
from RequestParser import RequestParser
CONNECTION_RESPONSE = "HTTP/1.0 200 Connection established\r\n\r\n"
class ProxyServer:
def __init__(self):
self.listening_socket = None
self.buf_length = 8192
def run_server(self, ip="0.0.0.0", port=5000):
... |
app.py | #!/usr/bin/env python3
import sys
import cv2
import glob
import logging
import numpy as np
import tkinter as tk
import tkinter.messagebox as pop_msg
import os
from tkinter import ttk
import tkinter.filedialog as filedialog
from PIL import Image, ImageTk
import threading as td
import subprocess
from threading import RL... |
sigproc.py | # https://github.com/jameslyons/python_speech_features
# This file includes routines for basic signal processing including framing and computing power spectra.
# Author: James Lyons 2012
#
# This file was updated with additional speech processing routines for feature extraction, such as MFCC and LPC
# Author: Anurag Ch... |
test_threading.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import random
import asyncio
import threading
from aioutils import Group, Yielder, yielding
@asyncio.coroutine
def f(c):
yield from asyncio.sleep(random.random()*0.02)
return c
def test_group_threading():
""" Ensure that Pool and Group are thread-... |
basics2_thread.py | import threading
import time
ls =[]
def count(n):
for i in range(1, n+1):
ls.append(i)
time.sleep(0.5)
def count2(n):
for i in range(1, n+1):
ls.append(i)
time.sleep(0.5)
x = threading.Thread(target=count, args=(5,))
x.start()
y = threading.Thread(target=count2, args=(5,))
... |
ib_gateway.py | """
Please install ibapi from Interactive Brokers github page.
"""
from copy import copy
from datetime import datetime
from queue import Empty
from threading import Thread
from ibapi import comm
from ibapi.client import EClient
from ibapi.common import MAX_MSG_LEN, NO_VALID_ID, OrderId, TickAttrib, TickerId
from ibapi... |
__init__.py | # coding: utf8
# Copyright 2013-2017 Vincent Jacques <vincent@vincent-jacques.net>
from __future__ import division, absolute_import, print_function
import ctypes
import datetime
import multiprocessing
import os.path
import pickle
import sys
import threading
# We import matplotlib in the functions that need it becau... |
deadsimpledb.py | import logging
import csv
import os
import pickle
import shutil
import time
from typing import Any, Dict, List, Tuple
import copy
import numpy as np
import PIL.Image
import simplejson as json
from os.path import isfile, join
import threading
from multiprocessing import Process
# from multiprocessing import SimpleQueue ... |
PointTest.py | # test point
import src.Point as Point
from threading import Thread
def prod(point):
for i in range(9):
point.set(i, i)
def cons(point):
for i in range(9):
print(point.get())
test_point = Point.Point()
pro = Thread(target=prod, args=[test_point])
con = Thread(target=cons, args=[test_point]... |
NN.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 31 19:25:08 2021
@author: akshat
"""
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import rdkit
from rdkit import Chem
from rdkit import RDLogger
from rdkit.Chem import Descriptors
RDLogger.DisableLo... |
mineportproxy.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###################################################
#........../\./\...___......|\.|..../...\.........#
#........./..|..\/\.|.|_|._.|.\|....|.c.|.........#
#......../....../--\|.|.|.|i|..|....\.../.........#
# Mathtin (c) #
#############... |
writer.py | import os
import time
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms, write_json
DEFAULT_VIDEO_SAVE_OPT = {
'savepath... |
Threads.py | from threading import Thread
from random import randint
import time,cv2
import hashlib
from collections import deque
class MyThread(object):
def __init__(self):
self.frame = deque(maxlen=5)
def run(self):
self.cap = cv2.VideoCapture(0)
while(True):
ret, lframe = self.cap.re... |
_threading_local.py | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... |
fts_free_tier_limits.py | # coding=utf-8
import json
import threading
from lib import global_vars
from lib.SystemEventLogLib.fts_service_events import SearchServiceEvents
from pytests.security.rbac_base import RbacBase
from .fts_base import FTSBaseTest
from .fts_base import NodeHelper
from lib.membase.api.rest_client import RestConnection
fro... |
hashy.py | from socket import socket, AF_INET, SOCK_STREAM, getprotobyname
from hashlib import sha256, sha512, md5, sha1, sha384, sha224, blake2b, blake2s, shake_128, sha3_512, sha3_384, sha3_256, shake_256, shake_128
from argparse import ArgumentParser
from Cryptodome.Cipher.AES import new, MODE_GCM, MODE_CBC
from Cryptodome... |
conn.py | #!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: Guannan Ma
"""
:descrition:
connection related module
1. There's only 1 thread reading/receiving data from the interface.
2. There might have more than 1 thred writing data into the network
queue. ... |
dns_v2.py | import threading
import socket
import datetime
def resolveDns(hostnames):
for host in hostnames:
try:
print(f"{host}: {socket.gethostbyname(host)}")
except Exception as e:
print(f"{host}: {e}")
continue
if __name__ == "__main__":
filename = "hostnames.... |
MyMultiportUdpListener.py | #!/usr/bin/python3
import time
import threading
import socketserver
class MyMultiportUdpListener:
def __init__(self, portlist):
self.portlist = portlist
self.start_listeners()
def start_udpserv(self, port):
self.MySinglePortListener(('127.0.0.1', port), self)
def start_listeners... |
xvfb.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs tests with Xvfb and Openbox on Linux and normally on other platforms."""
import os
import os.path
import platform
import s... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import test... |
slam.py | from breezylidar import URG04LX as Lidar
from breezyslam.algorithms import RMHC_SLAM
from breezyslam.sensors import URG04LX as LaserModel
from slam_visualization import SlamShow
import threading
from time import sleep
MAP_SIZE_PIXELS = 500
MAP_SIZE_METERS = 10
def save_image(display):
while True:
displa... |
utils.py | import os
import numpy as np
from itertools import zip_longest, accumulate, product,repeat
from types_utils import F
from typing import Any, Iterable, Callable, Sized
from threading import Thread
PATH = os.path.dirname(__file__)
RESOURCES_PATH = os.path.abspath(f"{PATH}/../resources")
def start_join_threads(threads... |
test_pytest_cov.py | import glob
import os
import subprocess
import sys
from distutils.version import StrictVersion
from itertools import chain
import coverage
import py
import pytest
import virtualenv
from process_tests import TestProcess as _TestProcess
from process_tests import dump_on_error
from process_tests import wait_for_strings
f... |
test_read_only_job_plugin.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... |
match_text.py | GEVENT = False
import zlib
import datetime
import settings
import pymongo
import traceback
import os
import re
import multiprocessing
from Queue import Empty
from regs_models import *
from oxtail.matching import match
# arguments
from optparse import OptionParser
arg_parser = OptionParser()
arg_parser.add_option("-... |
CreateFrames.py | import ctypes
import time
import cv2
from multiprocessing import Process, Pipe
from multiprocessing.sharedctypes import RawArray
from osr2mp4 import logger
from osr2mp4.VideoProcess.Draw import draw_frame, Drawer
from osr2mp4.VideoProcess.FrameWriter import write_frame, getwriter
import os
def update_progress(frame... |
server.py | from __future__ import print_function
# Copyright (c) 2016-2021 Twilio Inc.
import os
import threading
import time
try: # Python 3
from queue import Queue
except ImportError: # Python 2
from Queue import Queue
import psycopg2
dburl = os.getenv('DATABASE_URL')
if not dburl:
dburl = 'dbname=test user=cs... |
MainWindow.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#===============================================================================#
#title :MainWindow.py #
#description :Defines the MainWidow for gtk. #
#author :August B. San... |
event_subscribe.py | from typing import Callable, Dict, List, Optional
from collections import OrderedDict
import threading
import time
import json
from wpath import *
from hexbytes import HexBytes
from web3 import Web3
from web3.exceptions import (
InvalidEventABI,
LogTopicError,
MismatchedABI,
)
from brownie.network.middlewa... |
experiment.py | #!/usr/bin/python3
import os
import socket
import ssl
import threading
import time
hostname = '127.0.0.1'
port = 40000
thisdir = os.path.dirname(os.path.realpath(__file__))
CA_FOLDER = thisdir + '/ca-rsa'
CLIENT_FOLDER = thisdir + '/client-rsa'
SERVER_FOLDER = thisdir + '/server-rsa'
def server_thread():
#srvc... |
p_scan.py | #!/usr/bin/python
#@syntax
# network/mask port_range (timeout)
# ex. p_scan.py 192.168.1.0/24 20-1024 (20)
import socket
import sys
from math import floor, ceil
from multiprocessing import Process, Queue
def find_next_host(last_host_ip):
s = 3
tmp_host_func = last_host_ip
while(True):
... |
pulse_creator.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import time
from multiprocessing import Process, Pipe
#from PyQt5.QtWidgets import QListView, QAction, QWidget
from PyQt5.QtWidgets import QFileDialog
from PyQt5 import QtWidgets, uic #, QtCore, QtGui
from PyQt5.QtGui import QIcon
import atomize.gener... |
journal_scraper.py | import logging
from get_sd_ou.classUtil import Journal, JournalsSearch, Volume, Article
from queue import Queue
from threading import Thread, current_thread, Lock
from get_sd_ou.databaseUtil import insert_article_data, init_db
from get_sd_ou.config import Config
def scrape_and_save_article(article_url_queue, mysql_... |
zcam.py | #!/usr/bin/python3
from telebot import types
import telebot
from constraints import API_KEY, BITLY_ACCESS_TOKEN, ngrok_auth_token
import threading
from flask import Flask, render_template, request
from datetime import datetime
import base64
import os
from pyngrok import ngrok
import pyfiglet
import logging
import pys... |
interactive.py | import asyncio
import logging
import os
import tempfile
import textwrap
import uuid
from functools import partial
from multiprocessing import Process
from typing import (
Any, Callable, Dict, List, Optional, Text, Tuple, Union)
import numpy as np
from aiohttp import ClientError
from colorclass import Color
from sa... |
video.py | # -*- coding: utf-8 -*-
"""Video readers for Stone Soup.
This is a collection of video readers for Stone Soup, allowing quick reading
of video data/streams.
"""
import datetime
import threading
from abc import abstractmethod
from queue import Queue
from typing import Mapping, Tuple, Sequence, Any
from urllib.parse im... |
zmq_socket_tests.py | #!/usr/bin/env python3
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import unittest
from multiprocessing import Process
import zmq
from openr.Lsdb import ttypes as lsdb_types
from openr.... |
recognition.py | import numpy as np
import multiprocessing
import face_recognition
import os
import pickle
from faceApi import settings
import cv2
class Recognizer:
'''
face recognition using face_recognition api
'''
def __init__(self, known_faces_encodes_npy_file_path, known_faces_ids_npy_file_path, face_tag_model_pa... |
email.py | from . import mail
from flask_mail import Message
from flask import current_app, render_template
from threading import Thread
"""La funzione mail.send() blocca l’applicazione durante l’operazione di spedizione.
Per questo l’operazione stessa viene delegata ad un thread che lavora in background,
evitando che il browser... |
train_pg_v2.py | import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
from multiprocessing import Process
import shutil
class MyArgument(object):
def __init__(self,
exp_name='vpg',
env_name='CartPole-v1',
n_iter=100,
... |
apptrace.py | import os
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
try:
import SocketServer
except ImportError:
import socketserver as SocketServer
import threading
import tempfile
import time
import subprocess
import os.path
import elftools.elf.elffile as elffile
import ... |
isulogger.py | """
ISULOG client
"""
from __future__ import annotations
import json
import time
import urllib.parse
import sys
import requests
import threading
from queue import Queue
class IsuLogger:
def __init__(self, endpoint, appID):
self.endpoint = endpoint
self.appID = appID
self.queue = Queue()
... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
TOTAL_SCONS_... |
microtvm_api_server.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... |
misc.py | """
Misc module contains stateless functions that could be used during pytest execution,
or outside during setup/teardown of the integration tests environment.
"""
import contextlib
import errno
import multiprocessing
import os
import re
import shutil
import stat
import sys
import tempfile
import time
import warnings
... |
tools.py | from .exceptions import UnexpectedValue
from .constants import *
import socket, struct, threading, time
class Tools:
atype2AF = {
ATYP_IPV4:socket.AF_INET,
ATYP_IPV6:socket.AF_INET6,
ATYP_DOMAINNAME:socket.AF_INET
}
def recv2(conn:socket.socket, *args):
... |
lisp-etr.py | #-----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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 ... |
conftest.py | import requests_mock
import os
from click.testing import CliRunner
import pytest
from wandb.history import History
from tests.api_mocks import *
import wandb
from wandb import wandb_run
from wandb.apis import InternalApi
import six
import json
import sys
import threading
import logging
from multiprocessing import Proce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.