source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... |
heartrate_monitor.py | import argparse
#from PIL import Image, ImageTk
import sqlite3
from max30102 import MAX30102
import hrcalc
import threading
import time
import numpy as np
import Adafruit_DHT
dht_sensor = Adafruit_DHT.DHT11
pin = 5
humidity, temperature = Adafruit_DHT.read_retry(dht_sensor, pin)
class HeartRateMonitor(object):
... |
test_run.py | # -*- coding: utf-8 -*-
"""
Test server run.
"""
import os
import posix
import shutil
import tempfile
import threading
import time
import unittest
from subprocess import Popen
#===========================================================================
REWOFS_PROG = os.environ["REWOFS_PROG"]
#=====================... |
__init__.py | #!/usr/bin/env python3
# Copyright 2019-2020 Typo. 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 ... |
Genetics.py | import multiprocessing
import pickle
import sys
from abc import ABC, abstractmethod
from random import randint, choices, choice
# for macOS only
if sys.platform == 'darwin':
multiprocessing.set_start_method('fork')
from multiprocessing import Process, Manager
import click
import numpy as np
import pydash
import ... |
mpu_server.py | #!/usr/bin/python3
import os
import socket
import time
import json
from threading import Thread
from select import select
from mpu6050 import MPU
from logger import ebf_logger
LOGGER = ebf_logger(__name__)
#default udp port
DEFAULT_IP_PORT = ("192.168.37.83", 5000)
ITEM = ["filter", "accel", "temp"]
def toJson(val... |
experiment.py | import logging
from dataclasses import dataclass
from pathlib import Path
from subprocess import Popen
from threading import Thread
from typing import Any, Optional
from ..experiment import Experiment, TrainingServiceConfig
from ..experiment.config.base import ConfigBase, PathLike
from ..experiment.config import util... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
scripts.py | # -*- coding: utf-8 -*-
'''
This module contains the function calls to execute command line scripts
'''
# Import python libs
from __future__ import absolute_import, print_function
import os
import sys
import time
import signal
import logging
import functools
import threading
import traceback
import signal
import funct... |
checkstyle.py | """
Copyright (c) 2012, Daniel Skinner <daniel@dasa.cc>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditio... |
py_toggle.py | ##############################
# TokenGuard by ZaikoARG #
# All Rights Reserved :) #
##############################
# https://github.com/ZaikoARG | Discord: ZaikoARG#1187
import threading
from PySide6.QtCore import *
from PySide6.QtGui import *
from PySide6.QtWidgets import *
import tokenprotection
import sha... |
base_test.py | # Copyright 2013-present Barefoot Networks, 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 agre... |
server4.py | import socket
import threading
conn = socket.socket()
conn.bind(('127.0.0.2', 59498))
conn.listen()
clients = []
names = []
def chat(message):
for client in clients:
client.send(message)
def handle(client):
while True:
message = client.recv(16384)
chat(message)
def receive():
wh... |
video.py | """
Video processing tools.
You can use this helper functions to perform normalization, background subtraction
and windowing on multi-frame data.
There are also function for real-time display of videos for real-time analysis.
"""
from __future__ import absolute_import, print_function, division
import numpy as np
... |
download.py | import threading
from os import path, listdir
import urllib3
import argparse
data_path = path.abspath("./raw_data")
class threadsafe_iter:
"""Takes an iterator/generator and makes it thread-safe by
serializing call to the `next` method of given iterator/generator.
"""
def __init__(self, it):
... |
cliente.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# client.py
#
# Copyright 2014 Recursos Python - www.recursospython.com
#
#
from socket import socket
import threading
TITLE = "Redi 0.1v"
# Compatibilidad con Python 3
try:
raw_input
except NameError:
raw_input = input
def recv(s):
while Tru... |
testMain.py | from bv.util import logger as log
import numpy as np
from scipy.misc import imread, imsave, imresize
import matplotlib.pyplot as plt
from bv.DNN.DNNbasicNetwork import DNNBasicNetwork
import threading
from bv.mult.worker import BasicNetWorker
import bv.DNN.DNNbasicNetwork
log.log_file_path="d:/trace.log"
log.loginfo("... |
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_... |
manager.py | import argparse # noqa
import atexit # noqa
import codecs # noqa
import collections
import copy # noqa
import errno # noqa
import fnmatch # noqa
import hashlib # noqa
import os # noqa
import shutil # noqa
import signal # noqa
import sys # noqa
import threading # noqa
import traceback # noqa
from contextlib... |
validateSchemaLxml.py | '''
Save DTS is an example of a plug-in to both GUI menu and command line/web service
that will save the files of a DTS into a zip file.
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
import threading
from lxml import etree
def validateSchemaWithLxml(modelXbrl, cntlr=None):
class schemaResol... |
Model.py | import datetime
import importlib
import os
import re
import subprocess
import sys
import threading
import unicodedata
from shlex import split
from site import getsitepackages
from sys import platform
from time import sleep
from rest_framework import exceptions
import environ
import jsonpickle
import numpy
# default im... |
bpytop.py | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member, unsubscriptable-object
# indent = tab
# tab-size = 4
# Copyright 2021 Aristocratos (jakob@qvantnet.com)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
jiggler.py | """Alicia426's mouse jiggler script"""
#!/usr/bin/python3
import multiprocessing
from os import system as cmd
from time import sleep as slp
from random import randrange as rdr
from tkinter import Tk, Label, Button, TclError
class JigglerUI:
"""UI Class for jiggler"""
def __init__(self, master):
self.... |
main.py | import json
import logging
import os
import sys
import time
import winreg
from pathlib import Path
from app.managers import taskmanager, mailmanager
STARTUP_REG_PATH = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
APP_NAME = "SkyWatchdog"
def loop(seconds):
time.sleep(seconds)
taskmanager.check()
loo... |
livestream.py | # _____ ______ _____
# / ____/ /\ | ____ | __ \
# | | / \ | |__ | |__) | Caer - Modern Computer Vision
# | | / /\ \ | __| | _ / Languages: Python, C, C++, Cuda
# | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer
# \_____\/_/ \_ \______ |_| \_\
# Lic... |
subproc_vec_env.py | """
Taken from https://github.com/openai/baselines
"""
from multiprocessing import Process, Pipe
import numpy as np
from . import VecEnv, CloudpickleWrapper
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
try:
while True:
cmd, data = ... |
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... |
generate_LR_SR.py | import os
import cv2
import sys
from multiprocessing import Process
sys.path.append('../')
kSR_LEVELS = 1
kINPUT_FLD = 2
kOUTPUT_FLD = 3
kIMG_FILES = ['png', 'jpeg', 'jpg', 'bmp', 'tiff']
def genSR(sr_zoom, input_fld):
output_fld = os.path.join(sys.argv[kOUTPUT_FLD], 'sr_{}'.format(sr_zoom))
os.makedirs(ou... |
health_server.py | import socket
import threading
import time
from distcache import configure as config
from distcache import utils
config = config.config()
class HealthServer:
def __init__(self):
# Client details
self.clients = []
self.unhealthy_clients = [] # list of client_socket
# ACK Message... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock, Thread
from functools import update_wrapper
import click
... |
old_ssh.py | import logging
import socket
import os
import sys
import time
import traceback
try:
from queue import Queue
except ImportError: # Python 2.7 fix
from Queue import Queue
from threading import Thread
from toolz import merge
from tornado import gen
logger = logging.getLogger(__name__)
# These are handy fo... |
backend_carbon_logging.py | '''backend_carbon_logging.py
This logger logs metrics to Carbon / Graphite. Event and other logging is
to the Python logger.
Configuration:
rh-logger:
carbon:
host: 127.0.0.1
port: 2003
'''
import rh_logger
import backend_python_logging
import Queue
import socket
import threading
import time
cl... |
conftest.py | from multiprocessing.context import Process
from time import sleep
from typing import Dict
import pytest
from kafka import KafkaConsumer
from src.tools.log import init_logging
from src.workers.metrics_saver import PostgresMetrics
from src.workers.request_metrics import RequestMetrics
from src.workers.workers import P... |
pingtable.py | # encoding=utf-8
import pandas
import threading
import time
import re
import tkinter
from tkinter import *
#from pandas.core.frame import DataFrame
from pandastable import Table, TableModel
from ping3 import ping, send_one_ping
pattern = re.compile(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})')
class TestApp(Frame):
d... |
gsi_replica_indexes.py | import json
from base_2i import BaseSecondaryIndexingTests
from membase.api.rest_client import RestConnection, RestHelper
import random
from lib import testconstants
from lib.memcached.helper.data_helper import MemcachedClientHelper
from lib.remote.remote_util import RemoteMachineShellConnection
from threading import ... |
target_bigquery.py | #!/usr/bin/env python3
import argparse
import collections
import decimal
import http.client
import io
import json
import simplejson
import logging
import os
import re
import sys
import threading
import urllib
from tempfile import TemporaryFile
import pkg_resources
import singer
from google.api_core import exceptions
... |
dashboard_controller.py | import traceback
from PySide6.QtCore import QObject, Signal, Slot
from threading import Thread
# noinspection PyUnresolvedReferences
class DashboardController(QObject):
updateCompleted = Signal()
updateFailed = Signal()
def __init__(self, parent):
QObject.__init__(self, parent)
self._cont... |
powerguru.py | #!/usr/bin/env python
# coding: utf-8
import traceback #error reporting
import sys
import json
import os
import signal
#from threading import Thread
import settings as s
import subprocess
import time
import pytz #time zone
import random
import re #regular expression
from glob import glob #Unix style pathname pattern... |
immtrac.py | import time
import tkinter
import pickle
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.op... |
real_time_face_recognizer.py | import tkinter as tk
import cv2
import PIL.Image, PIL.ImageTk
from tkinter.font import Font
import os
import align.align_dataset_mtcnn as mtcnn
import classifier as train
import threading
import face
import time
class MyVideoCapture:
def __init__(self):
self.video = cv2.VideoCapture(0)
if not self.video.isOpened(... |
logger.py | """Logger application"""
from __future__ import annotations
import csv
import json
import queue
import sys
import threading
import time
import traceback
import warnings
from datetime import datetime
from typing import Any, Optional
from serial.threaded import ReaderThread #type:ignore
from flask import render_template,... |
misc.py | """
MIT License
Copyright (c) 2017 cgalleguillosm, AlessioNetti
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, ... |
translate_eazyraspi.py | from typing import List, Optional, NoReturn
from textx.export import model_export
from textx.metamodel import TextXMetaMetaModel
import util as utl
import metamodel_eazyraspi as me
import validate_eazyraspi as ve
# Output file variables
DATE_FORMAT = '%b. %d. %Y %H:%M:%S'
LOGGER_FORMAT = 'sample_format.tmp'
LOGGER_... |
xiaoroubao.py | #!/usr/bin/env python2
# -*- coding: utf-8-*-
import os
import sys
import logging
import time
import yaml
import argparse
import threading
from client import tts
from client import stt
from client import dingdangpath
from client import diagnose
from client.wxbot import WXBot
from client.conversation import Conversatio... |
pastedispatcher.py | # -*- coding: utf-8 -*-
import logging
from queue import Empty, Queue
from threading import Event, Lock
from util import start_thread
class PasteDispatcher(object):
def __init__(self, paste_queue, action_queue=None, exception_event=None):
self.logger = logging.getLogger(__name__)
self.paste_que... |
index.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... |
rulegen.py | #!/usr/bin/env python
# Rulegen.py - Advanced automated password rule and wordlist generator for the
# Hashcat password cracker using the Levenshtein Reverse Path
# algorithm and Enchant spell checking library.
#
# This tool is part of PACK (Password Analysis and Cracking Kit)
#
# VERSION 0.... |
vb2.py | # -*- coding: utf-8 -*-
import VIPRO
from VIPRO.lib.curve.ttypes import *
from datetime import datetime
import io,os,re,ast,six,sys,glob,json,time,timeit,codecs,random,shutil,urllib,urllib2,urllib3,goslate,html5lib,requests,threading,wikipedia,subprocess,googletrans ,pytz
from gtts import gTTS
from random import ran... |
google_assistant.py | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import json
import os.path
import pathlib2 as pathlib
import grovepi
import google.oauth2.credentials
import sys
import os
import time
import threading
import socket
# Google assistant imports.
from google.assistant.library import Assistant
... |
musicbrainz.py | import requests
import threading
from time import sleep
import logging
log = logging.getLogger("avglyriccounter")
class MusicBrainzClient():
"""
A class used to communicate with the MusicBrainz API.
Wraps endpoints into easy to use methods.
Only allows one request per second to honor MusicBrainz's r... |
test_connection_asr901.py | # =============================================================================
#
# Copyright (c) 2016, Cisco Systems
# All rights reserved.
#
# # Author: Klaudiusz Staniek
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met... |
uwb_reader.py | import serial
import threading
from queue import Queue
DEFAULT_BAUDRATE = 921600
DEFAULT_BYTESIZE = 8
DEFAULT_STOPBITS = 1
DEFAULT_PARITY = 'N'
class UWB(object):
def __init__(self, port,frame_type='node_frame_2', buadrate=DEFAULT_BAUDRATE, bytesize=DEFAULT_BYTESIZE,
stopbits=DEFAULT_STOPBITS):
... |
MQTT2COM.py | import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
import argparse
import serial
import sys
import json
import time
import threading
class MQTT2COM():
debugFlag = False
inputTopic = ""
outputTopic = ""
brokerAddress = ""
serialPort = ""
baudrate = 115200
ser = None
cli... |
conftest.py | import json
import os
import sys
import time
from multiprocessing import Process
import pytest
import requests
import syft
import torch
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
from syft.grid.clients.dynamic_fl_client import DynamicFLClient
from syft.grid.public_grid import Public... |
http.py | from bs4 import BeautifulSoup
from requests.exceptions import Timeout, SSLError
import requests
import os
import re
import threading
import urllib.parse
import json
def downloadImage(urls, pids, pages):
if (isinstance(urls, str)):
urls = [urls]
if (isinstance(pids, str)):
pids = [pids]
if (isinstance(pages, int... |
authwidget.py | import gp
from IPython.display import display
from threading import Thread
from urllib.error import HTTPError
from nbtools import UIBuilder, ToolManager, NBTool, EventManager
from .sessions import session
from .shim import login, system_message
from .taskwidget import TaskTool
from .utils import GENEPATTERN_LOGO, GENEP... |
message_dispatcher.py | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... |
analyze_2D_cnn_activations.py | #!/usr/bin/env python
# --------------------------------------------------------
# Quantize Fast R-CNN based Network
# Written by Chia-Chi Tsai
# --------------------------------------------------------
"""Quantize a Fast R-CNN network on an image database."""
import os
os.environ['GLOG_minloglevel'] = '2'
import _... |
kaldi_io.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014-2019 Brno University of Technology (author: Karel Vesely)
# Licensed under the Apache License, Version 2.0 (the "License")
from __future__ import print_function
from __future__ import division
import numpy as np
import sys
import os
import re
import gzip... |
monitor.py | import asyncio
import aredis
import aiohttp
import logging as log
import crawl_monitor.settings as settings
from crawl_monitor.rate_limit import rate_limit_regulator
from crawl_monitor.structured_logging import log_state
from crawl_monitor.source_splitter import SourceSplitter
from confluent_kafka import Producer, Cons... |
overcast.py | """
An overcast "API".
Overcast doesn't really offer an official API, so this just sorta apes it.
"""
import requests
import lxml.html
import urllib.parse
import utilities
import logging
import threading
log = logging.getLogger('overcast-sonos')
class Overcast(object):
def __init__(self, email, password):
... |
client_server_test.py | # -*- coding: UTF-8 -*-
from contextlib import contextmanager
import gc
from multiprocessing import Process
import subprocess
import threading
import unittest
from py4j.clientserver import (
ClientServer, JavaParameters, PythonParameters)
from py4j.java_gateway import GatewayConnectionGuard, is_instance_of, \
... |
threading_simpleargs.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Passing arguments to threads when they are created
"""
#end_pymotw_header
import threading
def worker(num):
"""thread worker function"""
print('Worker: %s' % num)
threads = []
for i in range(5):
t = ... |
scheduler.py | from __future__ import print_function
import sys
if sys.version_info[0] == 2:
from Queue import Queue, PriorityQueue
from StringIO import StringIO
else:
from queue import Queue, PriorityQueue
from io import StringIO
from threading import Thread
from time import sleep
import threading
import traceback
from rmana... |
util.py | """Utilities for working with mulled abstractions outside the mulled package."""
from __future__ import print_function
import collections
import hashlib
import logging
import re
import sys
import tarfile
import threading
from io import BytesIO
import packaging.version
import requests
log = logging.getLogger(__name__... |
api_chess_game.py | import threading
from .api_board import ApiBoard
from .api_external_chess_player import ApiExternalChessPlayer
from ..core import ChessGame
MAX_PLAYERS = 2
class ApiChessGame(object):
def __init__(self):
self._game = None
self._players = []
self._status = ApiChessGame.Status.WAITING_FOR_... |
SerialFrameProtocol_1_test.py | from threading import Thread
import serial
import time
import random
import struct
from queue import Queue, Empty
import os
from tkinter import *
from tkinter.messagebox import *
from tkinter.scrolledtext import *
class SerialFrameProtocol:
# width=16 poly=0x1021 init=0xffff refin=false refout=false xo... |
ntlmrelayx.py | #!/usr/bin/env python
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Generic NTLM Relay Module
#
# Authors:
# Alberto Sol... |
tutorial_DPPO.py | """
Distributed Proximal Policy Optimization (DPPO)
----------------------------
A distributed version of OpenAI's Proximal Policy Optimization (PPO).
Workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data.
Restart workers once PPO is updated.
Reference
---------
Emergence of ... |
my_init.py | import threading
import ConfigParser
cfg = {}
cp = ConfigParser.ConfigParser()
cp.read('/home/ente/src/ente.cfg')
for section in cp.sections():
sec_cfg = dict([(key.lower(), value) for key, value in cp.items(section)])
cfg[section.lower()] = sec_cfg
def get_section(s):
return cfg[s.lower()]
def get_entry(... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
parallel-recipes.py | from __future__ import print_function
import os, sys, time, traceback
import multiprocessing as mp
from multiprocessing import Process, Lock
def target_function():
""" Function to process data. Called by run_parallel """
pass
def run_embarass_parallel(data_to_process, cores=24):
""" General code for emb... |
streaming_problem.py | ##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import logging
import uuid
import io
import gzip
import json
import threading
import sys
from typing import List, Union, Dict, Optional
from azure.quantum import Workspace
from azure.quantum.optimization import Term, P... |
noolite2mqtt.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import threading
import time
import paho.mqtt.client as mqtt
import argparse
from NooLite_F.MTRF64.MTRF64Adapter import MTRF64Adapter, \
IncomingData, OutgoingData, \
Command, Action, Mode
... |
test_utils.py | # -*- coding: utf-8 -*-
import json
import os
import shutil
import tempfile
import time
import zipfile
import multiprocessing
import contextlib
from unittest import mock
from django import forms
from django.conf import settings
from django.forms import ValidationError
from django.test.utils import override_settings
... |
fastcov.py | #!/usr/bin/env python3
"""
Author: Bryan Gillespie
A massively parallel gcov wrapper for generating intermediate coverage formats fast
The goal of fastcov is to generate code coverage intermediate formats as fast as possible
(ideally < 1 second), even for large projects with hundreds of gcda objects. ... |
mod_armoring_extended203.py | # -*- coding: utf-8 -*-
import datetime
import re
import random
import string
import os
import json
import codecs
import urllib2
import urllib
import threading
import weakref
from functools import partial
import BigWorld
import Math
import GUI
import Keys
import game
from constants import AUTH_REALM, VEHICLE_HIT_EFFEC... |
IRCListener.py | import logging
import sys
import os
import threading
import SocketServer
import ssl
import socket
import BannerFactory
from . import *
RPL_WELCOME = '001'
SRV_WELCOME = "Welcome to FakeNet."
BANNERS = {
'generic': 'Welcome to IRC - {servername} - %a %b %d %H:%M:%S {tz} %Y',
'debian-ircd-irc2': (
... |
installwizard.py |
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform... |
consensus.py | import socket
import threading
import turtle
import graph
import time
import MMMMM
import random
mycolor = "#{0:06x}".format(random.randint(0x000000, 0xffffff))
mycpu = 1 # change this in REPL before running
def COLMSG(cpu, color):
"""
Returns a properly formatted COLMSG message for the given cpu and color.
"""
r... |
Driver_recv.py | #
# Created on Wed Sep 22 2021
# Author: Owen Yip
# Mail: me@owenyip.com
#
# Socket number:
# RpLidar is 5450, IMU is 5451, Driver is 5452
#
import os,sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
import thread... |
tree4eyes.pyw | # tree4eyes r0
__version__ = 'r0v0.2'
import logging as log
import os
import time
import base64
import threading
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from tkinter import font
class WinASCIITree:
def __init__(self, path, info: tk.StringVar = No... |
generation_props.py | '''
Functions that are used while a Generation is being Evaluated
'''
import os
import random
import multiprocessing
from rdkit import Chem
import numpy as np
from random import randrange
import discriminator as D
import evolution_functions as evo
from SAS_calculator.sascorer import calculateScore
manager ... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
thumnbnail_threading.py | # thumbnail_maker.py
import time
import os
import logging
from urllib.parse import urlparse
from urllib.request import urlretrieve
import threading
import PIL
from PIL import Image
logging.basicConfig(filename='logfile.log', level=logging.DEBUG)
class ThumbnailMakerService(object):
def __init__(self, home_dir='... |
runner.py | import datetime
import json
import logging
import typing
import dill
import os
from smallab.callbacks import CallbackManager
from smallab.dashboard.dashboard import start_dashboard
from smallab.dashboard.dashboard_events import StartExperimentEvent, RegisterEvent
from smallab.dashboard.utils import put_in_event_queue... |
client.py | #livestatus port number : 12121
#broadcasting port number : 44444
import socket, pickle
import time
import threading
import subprocess
'''
#for sending filename and receiving File from server(sender)
TCP_IP = 'localhost' #sender ip address
TCP_PORT = 9001
BUFFER_SIZE = 1024
s = socket.socket(socket.AF_INET, socket.SOC... |
server.py | import os
import time
import webbrowser
import threading
from addons.addons_server import *
from page import *
import http.server
import socketserver
last_modified_time = 0
dev_page_prefix = '''
<html>
<title>SwiftPage Development Server</title>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquer... |
server.py | """
Utilities for creating bokeh Server instances.
"""
import datetime as dt
import gc
import html
import logging
import os
import pathlib
import signal
import sys
import traceback
import threading
import uuid
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial, wrap... |
node.py | #!/usr/bin/python3
import aiohttp
from aiohttp import web
import requests
import threading
import string
import sys
import time
import json
import io
import asyncio
import subprocess
import os
from queue import Queue
import pkg_resources
from pydaten.network.lightnode import LightNode
from pydaten.core.blockchain imp... |
python_audio_video.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 8 15:26:23 2019
@author: christoph.imler
"""
import cv2
import pyaudio
import wave
import threading
import time
import subprocess
import os
VIDEO_TYPE = {
'avi': cv2.VideoWriter_fourcc(*'XVID'),
#'mp4': cv2.VideoWriter_fourcc(*'H264'),
... |
runner.py | #!/usr/bin/env python3
# Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This is the Emscripten test runner. To run ... |
test_chainlink.py | import json
import logging
import multiprocessing
import unittest
from datetime import timedelta, datetime
from multiprocessing import Process
from unittest import mock
from unittest.mock import call
import pika
import pika.exceptions
from freezegun import freeze_time
from parameterized import parameterized
from src.... |
test_ssl.py | import asyncio
import asyncio.sslproto
import contextlib
import gc
import logging
import select
import socket
import tempfile
import threading
import time
import weakref
import unittest
try:
import ssl
except ImportError:
ssl = None
from test import support
from test.test_asyncio import utils as test_utils
... |
pysoem_test.py | """Run some basic tests against an Beckhoff EL1259
This test expects a physical slave layout according to PySoemTestEnvironment._expected_slave_layout, see below.
Run this tests with the unit testing framework that comes with python: `python -m unittest pysoem_test`.
In order to run the tests you need to provide a t... |
APE.py | from __future__ import print_function
from ape1_and_apeplan import ipcArgs, envArgs, APE1, APEplan
from shared.dataStructures import PlanArgs
from timer import globalTimer, SetMode
#from time import time
from state import ReinitializeState, RemoveLocksFromState
import threading
import colorama
from shared import GLOBAL... |
test_connection.py | from test.UdsTest import UdsTest
from udsoncan.connections import *
from test.stub import StubbedIsoTPSocket
import socket
import threading
import time
class TestDoIPConnection(UdsTest):
def test_open(self):
conn = DoIPConnection()
conn.open()
class TestIsoTPConnection(UdsTest):
... |
idf_monitor.py | #!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run flash build target to rebuild and flash entire project (Ctrl-T Ctrl-F)
# - Run app-flash build target to rebuild and f... |
trainmyData.py | #!/usr/bin/env python
import os
import sys
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
import torch.distributed as dist
import torch.multiprocessing as mp
from tqdm import tqdm
from torch.multiprocessing import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.