source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
pixels_aiy_v1.py | import time
import queue
import threading
import RPi.GPIO as GPIO
_GPIO_PIN = 25
class Pixels:
def __init__(self):
self.is_light_on = 1
self.count_down = 0
self.light_on_count = 0
self.light_off_count = 0
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO... |
test_execute.py | import asyncio
import tempfile
import time
from threading import Thread
import dagster_pandas as dagster_pd
import pytest
from dagster import (
DagsterUnmetExecutorRequirementsError,
InputDefinition,
ModeDefinition,
execute_pipeline,
execute_pipeline_iterator,
file_relative_path,
pipeline,
... |
qualysguard_host_list_detection.py | from __future__ import print_function
__author__ = 'Parag Baxi'
# System modules
import argparse
import ast
import ConfigParser
import datetime
import logging
import os
import sys
import time
from Queue import Queue
from threading import Thread
# Local modules
import qualysapi
from lxml import objectify, etree
def... |
pjf_testcase_server.py | """
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com>
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... |
markovbot.py | # -*- coding: utf-8 -*-
#
# For installation instructions and more information, please refer to:
# http://www.pygaze.org/2016/03/tutorial-creating-a-twitterbot/
# (This includes instructions to install the Twitter library used here)
#
# This file is part of markovbot, created by Edwin Dalmaijer
# GitHub: https://github... |
gui.py | #!/usr/bin python3
""" The optional GUI for faceswap """
import os
import re
import signal
import subprocess
from subprocess import PIPE, Popen, TimeoutExpired
import sys
from argparse import SUPPRESS
from math import ceil, floor
from threading import Thread
from time import time
import matplotlib
matplotlib.use('Tk... |
storage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
set
except NameError:
from sets import Set as set
from torngas.utils import safeunicode
from threading import local as threadlocal
import warnings
import sys, copy
PY3 = (sys.version_info >= (3,))
class Storage(dict):
"""
from web.py
对字典进行扩展,使其支持... |
getProxy.py |
import threading
import requests
import os
import platform
import json
import datetime
from pydoc import locate
from colorama import Fore,init
init()
__dirname = os.path.abspath(os.path.dirname(__file__))
RDIR = ["logs"] # rewuired directorys
for DIR in RDIR:
if not os.path.isdir(__dirname+'/'+D... |
ledmatrix8x8.py | #!/usr/bin/python3
''' Test Bed for Diyhas System Status class '''
import time
from threading import Thread
import random
from Adafruit_Python_LED_Backpack.Adafruit_LED_Backpack import BicolorMatrix8x8
FIBINACCI_MODE = 0
PRIME_MODE = 1
WOPR_MODE = 2
IDLE_MODE = 3
FIRE_MODE = 4
PANIC_MODE = 5
BLACK = 0
GREEN = 1
YEL... |
send_video.py | import subprocess
import shlex
import re
import os
import time
import platform
import json
import sys
import base64
import random
import datetime
import traceback
import robot_util
import _thread
import copy
import argparse
import audio_util
import urllib.request
import rtc_signalling
from subprocess import Popen, PIPE... |
tcp_pin.py | import socket
import time
import math
import rtde_control
import rtde_receive
import cv2
import pyrealsense2
import threading
import RPi.GPIO as GPIO
switch = 18
pump = 7
GPIO.setmode(GPIO.BOARD)
GPIO.setup(switch, GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.setup(pump, GPIO.OUT)
######################################... |
microprice.py | #!/usr/bin/env python3
import ssl
import os
import sys
import optparse
import websocket
from threading import Thread
import logging
import json
from enum import Enum
from random import randint
import datetime as dt
import time
from math import fabs
import socket
import numpy as np
from numpy_ringbuffe... |
fluffy.pyw | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""""
"Cute Penguin" was designed by fourminute. The font
used in the "Fluffy" logo is 100% royalty free.
Fluffy(this program) and the "Cute Penguin"
design is Copyright (c) 2019 fourminute
(https://github.com/fourminute)
Fluffy is free software: you can redistribute i... |
test_server.py | import asyncio
import json
import os
import time
import urllib.parse
import uuid
from contextlib import ExitStack
from http import HTTPStatus
from multiprocessing import Process, Manager
from multiprocessing.managers import DictProxy
from pathlib import Path
from typing import List, Text, Type, Generator, NoReturn, Dic... |
graphene_exchange.py | # DISABLE SELECT PYLINT TESTS
# pylint: disable=bad-continuation, broad-except, no-member, too-many-lines
# pylint: disable=no-name-in-module, too-many-arguments, too-many-public-methods
# pylint: disable=too-many-locals, too-many-instance-attributes, import-error
# pylint: disable=too-many-statements, useless-super-de... |
garbage.py | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Demonstrates garbage messages printed to std... |
yolo_datasets.py | # Dataset utils and dataloaders
import glob
import logging
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, Exif... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
import logging
import requests
from requests.exceptions import Timeout
from threading import Thread
from time import sleep
from HTMLParser import HTMLParser
import ssl
from tweepy.models import Status
from tweepy.api import API
from tweepy.err... |
generate.py | #!python3
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Lucas Nunes de Lima
#
# 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 ... |
run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ASL preprocessing workflow."""
import os
import re
from pathlib import Path
import logging
import sys
import gc
import uuid
import warnings
import json
from argparse import ArgumentParser
from argparse import ArgumentDefaultsHelpFormatter
from multiprocessing import cpu... |
scheduler.py | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import time
import threading
import logging
try:
import queue
except ImportError:
import Queue as queue
log = logging.getLogger(__name... |
lisp-core.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... |
orchestrator.py | #!/usr/bin/env python3
import argparse
import yaml
import importlib
import threading
import time
import random
from puppet_rat import PuppetRAT
from typing import List, Tuple
def import_puppet_rat(full_name: str) -> PuppetRAT:
module_name, class_name = full_name.rsplit('.', 1)
module = importlib.import_modu... |
utils.py | import binascii
import html
import json as js
import math
import os
import re
import threading
import unicodedata
import xml.etree.cElementTree as Etree
from collections import defaultdict
from collections import namedtuple
from io import BytesIO
from queue import Queue
import urllib3
from PIL import Image
from PIL im... |
national-song.py | from expression import *
from threading import Thread
def song():
changeDegree([3,5,9], [70,60,90])
changeDegree([7], [30])
os.system('aplay /home/pi/Robot-Blueberry/audio-files/national-song.wav')
takePosition()
def move():
time.sleep(1)
if __name__ == '__main__':
t1 = Thread(target=song)
... |
UlsMonitoring.py | # Copyright 2022 Akamai Technologies, 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 applicab... |
4. non_locked_threads.py | from threading import Thread
import time
import random
counter = 0
def increment_counter():
global counter
time.sleep(random.randint(0, 2))
counter += 1
time.sleep(random.randint(0, 2))
print(f'New counter value: {counter}')
time.sleep(random.randint(0, 2))
print('-----------')
for x in... |
cxx_sources_deps_rules.py | # this is a make/python hybrid file
# Normal make files are a make/sh hybrid.
# This makefile uses python instead of sh (or bash)
test_cxx_sources ?=
checkcxxsources $(cxxsources):$(out_init)
$(origin)
if (this == "checkcxxsources") and (not os.path.exists(env.cxxsources)):
leave()
caption()
if (this ==... |
tcp_server.py | # Copyright (c) 2017, 2018 Jae-jun Kang
# See the file LICENSE for details.
import asyncio
from threading import Thread
from x2py.util.trace import Trace
from x2py.links.server_link import ServerLink
from x2py.links.asyncio.tcp_session import TcpSession
class TcpServer(ServerLink):
def __init__(self, name):
... |
self_driver.py | import SocketServer
import threading
import numpy as np
import cv2
import sys
import serial
from keras.models import load_model
from self_driver_helper import SelfDriver
ultrasonic_data = None
# BaseRequestHandler is used to process incoming requests
class UltrasonicHandler(SocketServer.BaseRequestHandler):
dat... |
util.py | """Utilities for working with mulled abstractions outside the mulled package."""
from __future__ import print_function
import collections
import hashlib
import logging
import sys
import threading
import time
import packaging.version
import requests
log = logging.getLogger(__name__)
QUAY_REPOSITORY_API_ENDPOINT = 'h... |
stratum-miner.py | # Copyright (c) 2019, The Monero Project
#
# 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 ... |
transcript_etl.py | """Transcript ETL."""
import re
import logging
import multiprocessing
import uuid
from etl import ETL
from transactors import CSVTransactor
from transactors import Neo4jTransactor
class TranscriptETL(ETL):
"""Transcript ETL."""
logger = logging.getLogger(__name__)
# Query templates which take params a... |
bruteforcer.py | import requests,random,smtplib,telnetlib,sys,os,hashlib,base64,subprocess,time,xtelnet,os,threading#,requests_ntlm
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from ftplib import FTP
from .payloads import *
if os.path.isdir('/data/data')==True:
adr=True
if os.path.isdir('/data/... |
params.py | #!/usr/bin/env python3
"""ROS has a parameter server, we have files.
The parameter store is a persistent key value store, implemented as a directory with a writer lock.
On Android, we store params under params_dir = /data/params. The writer lock is a file
"<params_dir>/.lock" taken using flock(), and data is stored in... |
config_store_client_tests.py | #!/usr/bin/env python
#
# 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.
#
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from... |
Case.py | #! /usr/bin/env python3
# -*- coding: UTF-8 -*-
__author__ = 'Sean Yu'
__mail__ = 'try.dash.now@gmail.com'
import os,time,re
import sys
import traceback
libpath = os.path.sep.join([os.path.dirname(os.getcwd()),'lib'])
if libpath not in sys.path:
sys.path.insert(0,libpath)
libpath = os.path.sep.join([os.path.dirna... |
tones.py | # (c) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# (c) 2019 Jeff Geerling
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
... |
profiling.py |
import gc
import json
import logging
import os
import sys
import threading
import time
import objgraph
import psutil
def start_mem_check_thread(threshold=1024 * 1024 * 1024,
gc=False,
size_range=None,
interval=1
... |
tcpserver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import threading
bind_ip = '0.0.0.0'
port = 80
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, port))
server.listen(5)
print("[*] Server listening on {}:{}".format(bind_ip, port))
def handle(client_socket):
request = c... |
modbus_connector.py | # Copyright 2021. ThingsBoard
#
# 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 ... |
upgrade_center.py | import time
import threading
from .base.event_base import EventBase
class UpgradeCenter(EventBase):
def __init__(self):
super(UpgradeCenter, self).__init__()
self.workers = {}
self.run_status = []
self.is_processing = False
self.is_error = False
self.current = 0
... |
test_threaded.py | import os
import sys
import signal
import threading
from multiprocessing.pool import ThreadPool
from time import time, sleep
import pytest
import dask
from dask.compatibility import PY2
from dask.threaded import get
from dask.utils_test import inc, add
def test_get():
dsk = {'x': 1, 'y': 2, 'z': (inc, 'x'), 'w'... |
bench.py | import logging
import socket
import threading
import time
from .proto.packet import Packet
from .proto.opttypes import OptionType
from .proto.dhcpmsg import MessageType
def sync_worker(address, on_success, on_fail, oneshot=False, macaddr=None, relay_ip=None):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGR... |
myplex.py | # -*- coding: utf-8 -*-
import copy
import threading
import time
from xml.etree import ElementTree
import requests
from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT,
X_PLEX_IDENTIFIER, log, logfilter, utils)
from plexapi.base import PlexObject
from plexapi.client impor... |
halfcheetah-v2.py | import os, sys, signal
import random
import numpy as np
from multiprocessing import Process, Queue, current_process, freeze_support
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--pgmorl', default=False, action='store_true')
parser.add_argument('--ra', default=False, action='store_true')
pars... |
ops_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
LogsDownloader.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Doron Lehmann, Incapsula, Inc.
# Date: 2015
# Description: Logs Downloader Client
#
# ************************************************************************************
# Copyright (c) 2015, Incapsula, Inc.
# All rights reserved.
#
# Redistributio... |
api_music.py | import aiohttp, json, re, os, uuid, math, urllib, threading, re
import http.cookiejar as HC
from .shaonianzhentan import fetch_info
from homeassistant.helpers.network import get_url
# 全局请求头
HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Sa... |
twitch_bot.py | import datetime
import logging
import os
import time
from abc import ABC
from threading import Thread
from typing import AnyStr, Tuple, Union, List
import aiohttp
from twitchio import Message, Channel, Chatter
from twitchio.ext import commands, routines
from bots.irc_bot import IrcBot
from helpers.beatmap_link_parser... |
server.py | import sys
import os
from datetime import datetime
from threading import Thread
from socket import socket, AF_INET, SOCK_STREAM
# invalid arguments
if len(sys.argv) < 2:
print("Invalid inputs. Please stick to the format shown below.")
print("$ python3 client.py <portnumber>")
print("portnumber: the port of... |
task_launcher.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# TODO(#99) do we standardize some kinds of data loader formats? perhaps
# one that loads from files, and then an arbit... |
kblas-test-batch-parallel.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, getopt
import csv
import time
import commands
import threading
# create output log folder
KBLAS_HOME='.'
TEST_LOGS_PATH='kblas-test-log'
cmd = ('cd '+KBLAS_HOME+'; mkdir -p '+TEST_LOGS_PATH)
print cmd
sys.stdout.flush()
os.system(cmd)
BIN_PATH='./testin... |
agent.py | from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
import __future__
import struct
import time
import base64
import subprocess
import random
import time
impo... |
wx_connection.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import websocket
import commands
import time
import os
import threading
import sys
#f = file('/dev/null', 'w')
#sys.stderr = f
commands.getoutput("echo 18 > /sys/class/gpio/export")
commands.getoutput("echo out > /sys/class/gpio/gpio18/direction")
global... |
reverse_complement_2.py | # The Computer Language Benchmarks Game
# https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
#
# contributed by Joerg Baumann
from sys import stdin, stdout
# from os import cpu_count
from itertools import starmap
reverse_translation = bytes.maketrans(
b'ABCDGHKMNRSTUVWYabcdghkmnrstuvwy',
b'TVGHCDMK... |
test_credentials.py | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import logging
from threading import Thread, Event
from respeaker import Microphone, Player, pixel_ring
from olaf import Bot, Speech
from olaf.config import Logger
logger = logging.getLogger('olaf-voice.main')
def task(quit_event):
mic = Microphone(qui... |
__init__.py | # coding: utf-8
#
from __future__ import absolute_import, print_function
import threading
import re
import time
import datetime
import csv
import sys
import atexit
from collections import namedtuple
_MEM_PATTERN = re.compile(r'TOTAL[:\s]+(\d+)')
# acct_tag_hex is a socket tag
# cnt_set==0 are for background data
# c... |
stats_manager.py | # std
import logging
from datetime import datetime, timedelta
from typing import List
from threading import Thread
from time import sleep
# project
from . import HarvesterActivityConsumer, WalletAddedCoinConsumer, FinishedSignageConsumer
from .stat_accumulators.eligible_plots_stats import EligiblePlotsStats
from .stat... |
vehicle.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 10:44:24 2017
@author: wroscoe
"""
import time
import numpy as np
from threading import Thread
from .memory import Memory
from prettytable import PrettyTable
import traceback
class PartProfiler:
def __init__(self):
self.records = {... |
sel.py | # (c) 2005 Ian Bicking and contributors; written for Paste
# (http://pythonpaste.org)
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
Routines for testing WSGI applications with selenium.
Most interesting is :class:`~webtest.sel.SeleniumApp` and the
:func:`~webtest.sel.seleni... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
... |
ghost.py | #!/usr/bin/env python
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
import contextlib
import ctypes
import ctypes.util
import fcntl
import hashli... |
demo.py | from __future__ import print_function
import ipywidgets as widgets
from IPython.display import clear_output, display, Markdown, Javascript
import IPython
from demo import study_puzzles
from typing import List, Set, Tuple, Callable
import inspect
import shutil
import os
import re
import time
import threading
import pic... |
yara_safe.py | import os
import hashlib
import json
from FunctionAnalyzerRadare import RadareFunctionAnalyzer
from InstructionsConverter import InstructionsConverter
from FunctionNormalizer import FunctionNormalizer
import requests
from multiprocessing import Process, Queue
import traceback
import tempfile
import sys
tf_serving = "... |
test.py | import json
import pytest
import random
import re
import string
import threading
import time
from multiprocessing.dummy import Pool
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node1 = cluster.ad... |
kaldi_ros.py | # Original Source Code: https://github.com/alumae/kaldi-gstreamer-server
__author__ = 'tanel and flier@techfak.uni-bielefeld.de'
# STD
import os
import sys
import json
import time
import Queue
import urllib
import argparse
import threading
# WS4PY
from ws4py.client.threadedclient import WebSocketClient
# ROS
import... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 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 ... |
test_utils.py | # Third Party
# Standard Library
import os
import shutil
import tempfile
import time
from multiprocessing import Manager, Process
from os import makedirs
import pytest
# First Party
from smdebug.core.access_layer import (
DEFAULT_GRACETIME_FOR_RULE_STOP_SEC,
ENV_RULE_STOP_SIGNAL_FILENAME,
check_dir_exists... |
client.py | import asyncio
from streaming import AsyncClient
import comms
import threading
import sys
import getopt
import tankcontrol
ip = "127.0.0.1"
port = 8084
usePiCam = False
size = 1
controller = tankcontrol.TankControl((11, 12), (15, 16))
disableMotor = False
try:
opts, args = getopt.getopt(sys.argv[1:], "ha:p:s:", ... |
misty_wc.py | import json
from enum import Enum
import requests
import sys
import threading
from time import sleep
import websocket
from logging import getLogger
_logger = getLogger()
class JSONObjectEncoder(json.JSONEncoder):
def default(self, obj):
if type(obj) in PUBLIC_ENUMS.values():
retu... |
deal_watcher.py | from pygate_grpc.client import PowerGateClient
from pygate_grpc.ffs import get_file_bytes, bytes_to_chunks, chunks_to_bytes
from google.protobuf.json_format import MessageToDict
from pygate_grpc.ffs import bytes_to_chunks
import redis
import json
import time
import threading
import fast_settings
import queue
import sql... |
time3.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import time
import random
import datetime
from swiftclient import client
import threading
'''
if raw_input("restart swift or not (y/n):")=='y':
for k in os.popen('sudo python setup.py install').readlines():
pass
for j in os.popen('sudo swift-init ma... |
receiver.py | '''Receiver Module for receiving encoded data and decoding'''
import sys
import const
import threading
from datetime import datetime
# curr_datetime = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
class Receiver:
'''Receiver Class to receive sender sent encoded data and decode it to get the original data'''
d... |
otb2owl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: houzhiwei
# time: 2019/2/20 22:11
# TODO
from owlready2 import *
import json
import re
from JSON2OWL.OwlConvert.OwlUtils import OWLUtils
from JSON2OWL.OwlConvert.Preprocessor import Preprocessor
import datetime
module_uri = 'http://www.egc.org/ont/process/otb'
o... |
server.py | import socket
import threading
from typing import Tuple
from constants import SERVER_HOST_PORT
def setup_server(address: Tuple[str, str], backlog: int = 100) -> socket.socket:
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
... |
lisp-rtr.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... |
run_py_tests.py | #!/usr/bin/env python
# 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.
"""End to end tests for ChromeDriver."""
import base64
import json
import math
import optparse
import os
import socket
import subproce... |
broker.py | import os
import signal
import sys
import struct
import threading
import argparse
import websockets
import asyncio
import json
from random import random
from collections import defaultdict
from http.server import HTTPServer, SimpleHTTPRequestHandler
try:
import zmq
except:
pass # ZMQ not needed as a dependency... |
kaldi_io.py | #!/usr/bin/env python
# Copyright 2014-2016 Brno University of Technology (author: Karel Vesely)
# Licensed under the Apache License, Version 2.0 (the "License")
import numpy as np
import sys
import os
import re
import gzip
import struct
#################################################
# Adding kaldi tools to shell... |
d5 copy.py | '''
MIT License
Copyright (c) Chen-Yu Yen - Soheil Abbasloo 2020
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, ... |
engine.py | """
Main BZT classes
Copyright 2015 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
unit.py | import getopt
import logging
import multiprocessing
import os
import re
import shlex
import tempfile
import time
from urllib import parse
import requests
from PIL import Image
from bs4 import BeautifulSoup, Tag
from dogbot.cqsdk import CQImage
from mongoengine import QuerySet, Q
from selenium import webdriver
from co... |
modulewatcher.py | #####################################################################
# #
# modulewatcher.py #
# #
# Copyright 2013, Monash University ... |
injector_test.py | # encoding: utf-8
#
# Copyright (C) 2010 Alec Thomas <alec@swapoff.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Alec Thomas <alec@swapoff.org>
"""Functional tests for the "Injector" dependency inje... |
demo.py | import pygame as pygame
from pygame import image
from pygame.locals import *
import trainLib as lib
import time
import cmd, sys
import threading as th
# globals
globalGrid = None
stopDisplay = False
isDisplaying = False
displayThread = None
isDirty = False # needs sync across pygame and cmd threads.
trainPosRow = ... |
main_script.py | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 12 09:16:45 2019
@author: pepo
"""
import libardrone
#import pygame
from time import sleep
import time
import cv2
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from threading import Thread
import os
import math
from shapely.geo... |
concurrency.py | from threading import Thread
from rx3.core.typing import StartableTarget
def default_thread_factory(target: StartableTarget) -> Thread:
return Thread(target=target, daemon=True)
def synchronized(lock):
"""A decorator for synchronizing access to a given function."""
def wrapper(fn):
def inner(*... |
test_concurrent_futures.py | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more relevant error
# message: "No module n... |
test2.py | import winsound
from threading import Thread
from concurrent import futures
import threading # python3的threading函数
import time
from concurrent.futures import ThreadPoolExecutor
r = True;
def play_sound():
# winsound.PlaySound("dank", winsound.SND_ALIAS)
# winsound.PlaySound(r"dank")
global ... |
utopia.py | # Note: Use reflection to initialize custom GameServer.py
#from person import Person
#theObj = globals()["Person"]()
#print theObj.getName()
# Utopia - A government simulator that works
# Aurura 2017. Published under the MITv3 License.
# https://github.com/xhj1102/Utopia
#
# Entry for command-line interaction.
# utop... |
~test_selenium.py | # this is an old test built to use selenium on a hybrid flask test including selenium.
# This test is probably abandoned and will never be revised to confirm whether it continues to work,
# but it does contain some useful architecture for debugging selenium tests.
import threading
import traceback
from time import sle... |
Scanner.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import urllib2
import base64
import time
import sys
start_time = None
current_host = None
hosts_scanned = 0
found = []
usernames = ['admin', 'Admin', 'sysadmin', 'superuser', 'comcast', 'root', 'cisco', 'administrator', 'Administrator', 'netman', 'Any', '... |
test_system.py | # Copyright 2016 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 applicable law or a... |
pyshell.py | #! /usr/bin/env python3
import sys
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise SystemExit(1)
import tkinter.messagebox as tkMessageBox
if TkVersion < 8.5:
root = Tk() # othe... |
utilities.py | """
Utility functions
"""
from __future__ import absolute_import
import glob
import socket
import os
import logging
import uuid
import datetime
import shlex
import re
import sys
import threading
import time
import json
import tarfile
from subprocess import Popen, PIPE, STDOUT
import yaml
try:
from yaml import CDum... |
app.py | #
# This file is:
# Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com>
#
# MIT License
#
import os
from electroncash_gui.ios_native.monkeypatches import MonkeyPatches
from electroncash.util import set_verbosity
from electroncash_gui.ios_native import ElectrumGui
from electroncash_gui.ios_native.utils import... |
keep_bot_alive.py | from discord.ext import tasks
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Bot is running"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
@tasks.loop(seconds=10)
a... |
cron.py | # coding: utf-8
import uuid
import threading
import time
from . import patch
class Crontab(object):
def __init__(self):
self._tasks = {}
self._running = False
self._cycle = 3.0
self._drain()
def start(self):
self._running = True
def stop(self):
self._runni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.