source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
AutoObs.py | #!/usr/bin/env python
"""Drive SISPI observations by triggering obstac to fill the queue whenever the state of the queue changes
:Authors: Eric H. Neilsen, Jr.
:Organization: Fermi National Accelerator Laboratory
"""
__docformat__ = "restructuredtext en"
from time import sleep
import os
import posix
import pdb
import... |
robot.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... |
feeder.py | import numpy as np
import os
import threading
import time
import traceback
from tacotron.utils.text import text_to_sequence
from infolog import log
from sklearn.model_selection import train_test_split
import tensorflow as tf
_batches_per_group = 32
class Feeder:
"""
Feeds batches of data into queue on ... |
keylogger.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Import modules
from time import ctime
from io import BytesIO
from core.logger import Log
from threading import Thread
from core.messages import services as Messages
from pynput.keyboard import Listener, Key # pip install pynput
from services.keyboard import controller
from... |
test.py | from utils import api, json, redis, mongo, battlenet, log
from pymongo import UpdateOne
from bson import json_util
from threading import Thread, Lock
import time
from tenacity import retry, wait_fixed, stop_after_attempt, RetryError
# data = api.get_api_response("/ladder/1")
# print(json.dumps(data))
# test = redis.ge... |
youtube_content_downloader.py | import threading
import time
import logging
from webdriver_wrapper import WebDriverWrapper
import youtube_content_downloader_utils
# TODO:
# 1) Fix bugs (Unwanted behaviors (strange and inconsistent element selection))
# 2) Add logging for each important step (using LOCK to avoid conflicts)
# 3) Add try/exc... |
takeoff_land2.py | #!/usr/bin/env python
import rospy
import geometry_msgs.msg
import mavros_msgs.srv
import mavros_msgs.msg
import ursa.srv
import tf2_ros
import tf2_geometry_msgs
import threading
import nav_msgs.msg
setpoint = geometry_msgs.msg.TransformStamped()
takeOff=False
tf_buffer = tf2_ros.Buffer(rospy.Duration(10.0)) #tf buffe... |
main.py | """Contains the main function."""
import argparse
import signal
import sys
import time
import threading
import keyboard
from .version import NAME, DESCRIPTION, VERSION
# Control keys
CONTROL_KEY_DEFAULT = "space"
def format_time(seconds):
"""Returns seconds as a formatted string.
The format is "hours:minut... |
walking_simulation.py | #!/usr/bin/env python3
import os
import numpy as np
import tf
import rospy
import rospkg
import threading
import random
import ctypes
import raisimpy as raisim
import time
from sensor_msgs.msg import Image, Imu, JointState, PointCloud2, PointField
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Transfo... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
# from collections import OrderedDict
# import socketserver
import threading
import http.server
import json
import queue
import socket
import su... |
eval_image_segmentation_sanity.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
task.py | #!/usr/bin/env python3
# Copyright (C) 2016 Christoph Gaukel <christoph.gaukel@gmx.de>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
manager.py | # -*- coding: utf-8 -*-
import logging
from .redis_manager import RedisManager
import threading
logger = logging.getLogger(__name__)
class EmptyManager():
def store(self, item_name, remote_addr):
pass
empty_manager = EmptyManager()
class StoreManager(object):
@staticmethod
def create_manager... |
diskover_storage_agent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover storage agent
See README.md or https://github.com/shirosaidev/diskover-storage-agent
for more information.
Copyright (C) Chris Park 2019
diskover storage agent is released under the Apache 2.0 license.
See LICENSE for the full license text.
"""
from scandir im... |
test_gil_scoped.py | # -*- coding: utf-8 -*-
import multiprocessing
import threading
from pybind11_tests import gil_scoped as m
def _run_in_process(target, *args, **kwargs):
"""Runs target in process and returns its exitcode after 10s (None if still alive)."""
process = multiprocessing.Process(target=target, args=args, kwargs=kw... |
main.py | #!/usr/bin/python3
# coding=utf-8
import pymysql
import pydle
import random
from random import choice
import datetime
import time
from threading import Timer, Thread
import urllib.request
import requests
import json
import threading
import math
import functools
from string import ascii_letters
from collections import d... |
souhu_new.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = 'AJay'
__mtime__ = '2019/5/9 0009'
"""
from urllib.parse import urlparse
from souhu.config import size, type_name, new_url_list
from db import MongoArticle, MongoUrl
import requests
import time
import datetime
import threading
import queue
from urllib imp... |
client_config.py | # -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2017 McAfee Inc. - All Rights Reserved.
################################################################################
import logging
import threading
from Queue import Queue
import os.path ... |
drmaa_wrapper.py | #!/usr/bin/env python
################################################################################
#
#
# drmaa_wrapper.py
#
# Copyright (C) 2013 Leo Goodstadt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software... |
metric_funcs.py | """This file contains functions to compute various metric distances.
.. module:: GMDA_main
:platform: linux
.. moduleauthor:: Ivan Syzonenko <is2k@mtmail.mtsu.edu>
"""
__license__ = "MIT"
__docformat__ = 'reStructuredText'
import numpy as np
import os
import subprocess
import multiprocessing as mp
from scipy.sp... |
base.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
time_func.py | import threading
import _thread # import thread in python2
import time
class timeout():
def __init__(self, time):
self.time = time
self.exit = False
def __enter__(self):
threading.Thread(target=self.callme).start()
def callme(self):
time.sleep(self.time)
if self.... |
__init__.py | #####################################################################
# #
# /__init__.py #
# #
# Copyright 2013, Monash University ... |
miniterm.py | #!/usr/bin/env python
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from serial.tools.list_ports impo... |
miner.py | import logging
import multiprocessing as mp
import time
from crankycoin.models.block import Block
from crankycoin.models.transaction import Transaction
from crankycoin.models.enums import MessageType, TransactionType
from crankycoin.services.queue import Queue
from crankycoin import config, logger
class Min... |
bgtunnel.py | """bgtunnel - Initiate SSH tunnels in the background
Useful when you need to connect to a database only accessible through
another ssh-enabled host. It works by opening a port forwarding ssh
connection in the background, using threads. The connection(s) are
automatically closed when the process exits, or when explicitl... |
twi-douga-floater.py | import argparse, sys, random, string, datetime, time, threading
import requests, urllib3.request, urllib3.contrib.socks, socket, socks
from pathlib import Path
from requests import Timeout
from urllib3.exceptions import MaxRetryError
from fake_useragent import UserAgent
urllib3.disable_warnings(urllib3.exceptions.Inse... |
image_reader.py |
import os
import sys
import time
import Queue
import multiprocessing as mp
import numpy as np
import cv2
import random
from random import randint
from preprocess import preprocess
use_multiprocessing = False
timeout_multiprocessing = 60 # timeout in seconds
class ImageReader():
def __init__(self, config_Imag... |
queue_manager.py | from queue import Queue
import json
from threading import Thread
import time
import random
from server.utils import settings_utils
from server.database.playlist_elements import ShuffleElement, TimeElement
TIME_CONVERSION_FACTOR = 60*60 # hours to seconds
class QueueManager():
def __init__(self, app, socketi... |
base.py | import numpy as np
import math
import pyrobot.utils.util as prutil
import habitat_sim.agent as habAgent
import habitat_sim.utils as habUtils
from habitat_sim.agent.controls import ActuationSpec
import habitat_sim.errors
import quaternion
import threading
import time
from ..locobot.base_control_utils import LocalAction... |
server.py | """Inicialização do servidor e sua interface GUI"""
import os
import argparse
import threading
import coffeechat.Server as Server
import coffeechat.utils as utils
import tkinter as tk
def start_server(host, window):
"""
Inicia o servidor com base no host passado na GUI.
Attributes:
host (str): Endereço IP servi... |
test.py | from flask import Flask
import wsgiref.simple_server
from time import sleep
import threading
import sys
app = Flask(__name__)
remote_server = wsgiref.simple_server.make_server('localhost', 10000, app)
remote_server.timeout = 0
test=1
global mydict
mydict = {'test': 1}
@app.route('/')
def hello_world():
update... |
test_socketlog.py |
"""
Tests for socketlog
"""
import configparser
import json
import socket
import threading
from twisted.trial import unittest
from cowrie.output import socketlog
PORT = 53483
TIMEOUT = 5
class SocketLogTests(unittest.TestCase):
def setUp(self):
self.cfg = configparser.ConfigParser()
conf_str... |
clean_hs2tj.py | from os import path
from threading import Thread
import fire
import numpy as np
from deepword.utils import eprint
def clean_hs2tj(hash_states2tjs, tjs):
"""
Due to code problem, some hash_states2tjs contains states that don't have
tjs companions.
These states should be removed, otherwise the request... |
light_control.py | import RPi.GPIO as io
import threading
from db import get_kv, set_kv
from gevent import sleep
def read_leds(led):
# try to database, but have a default as a backup
rgb = get_kv(("LED%d" % led)) or "100,100,100"
# return as an array of ints
return [int(x) for x in rgb.split(",")]
def write_leds(rgb_values,led):
r... |
circles-ui.py | # doc-export: SineExample
"""
A sine, with sliders to manipulate phase and amplitude.
"""
from flexx import flx, event
import subprocess
import threading
import time
import asyncio
import logging
logging.basicConfig(level="INFO")
fileVin = "/etc/libpanda.d/vin"
fileX725BatteryVoltage = "/etc/libpanda.d/x725batteryv... |
training_image_collection.py | import threading
import io
import socket
import struct
import serial
import pygame
import _thread as thread
import cv2
import numpy as np
import os
import time
'''
Note that the pygame window will take a few moments to warm up and may be unresponsive during this time.
'''
folder = 'training_images'
def rc_controll... |
streaming_dispatcher.py | import logging
import re
import signal
import threading
from contextlib import contextmanager
from enum import Enum
from queue import Empty, Queue
from typing import List, Optional, Pattern, Tuple, Union, Callable
from ..protos.clearly_pb2 import PatternFilter, TaskMessage, WorkerMessage
from ..utils.data import accep... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
if __name__ == "__main__":
if os.path.isfile("/init.qcom.rc") \
and (not os.path.isfile("... |
OwenExample2.py | import builtins
from threading import Thread
from queue import Queue, Empty
import time
import os
import Owen
import serial
from tkinter import *
from tkinter.messagebox import *
from tkinter.scrolledtext import *
OWEN_COMPORT = 'COM8'
OWEN_SPEED = 115200
def OwenIODaemon():
global owenDevError
... |
main.py | import socket
import threading
from queue import Queue
#here the target is the address of the home router
target = "192.168.0.1"
queue = Queue()
open_ports = []
def portscan(port):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((target, port))
return True
e... |
base_camera.py | import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a new frame is
... |
EchoService.py | import arc
import time
logger = arc.Logger(arc.Logger_getRootLogger(), 'EchoService.py')
wsrf_rp_ns = "http://docs.oasis-open.org/wsrf/rp-2"
echo_ns = "http://www.nordugrid.org/schemas/echo"
import threading
class EchoService(object):
def __init__(self, cfg):
logger.msg(arc.INFO, "EchoService (python) co... |
util.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import base64
import binascii
import colorsys
import contextlib
import codecs
import errno
import hashlib
import json
import getpass
import logging
import math
import os
import re
import shlex
import socket
imp... |
downloader.py | #-*- coding=utf-8 -*-
import requests
import threading
import os
import random
import math
def randip():
return str(random.randint(0, 255)) + "."\
+ str(random.randint(0, 255)) + "."\
+ str(random.randint(0, 255)) + "."\
+ str(random.randint(0, 255))
class downlo... |
ctrl.py | import os, threading, logging
def _wait_conmand(pipe_file, server):
with pipe_file:
while True:
try:
b = pipe_file.read(1)
if b == b'C':
logging.info("read close command from the control pipe")
break
except:
logging.exception("reading pipe command")
server.shutdown()
def start_server_... |
grpc_util_test.py | # Copyright 2019 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... |
subproc_vec_env.py | from multiprocessing import Process, Pipe
import numpy as np
from . import VecEnv, CloudpickleWrapper
from .tile_images import tile_images
def _worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.var()
while True:
try:
cmd, data = remote.recv()
... |
thread_1_简单实现.py | #!/usr/bin/env python3
# file: thread_demo_1.py
# Created by Guang at 19-7-15
# description:
# *-* coding:utf8 *-*
import threading
import time
def func1():
for i in range(5):
print("这是一个线程测试函数func1")
time.sleep(1)
def func2():
for i in range(5):
print("这是一个线程测试函数func2")
t... |
base_camera.py | import os
import cv2
import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients... |
conftest.py | import socket
import threading
import pytest
from pysandra.v4protocol import V4Protocol
class Cassim:
def __init__(self, condition, port=0):
self.port = port
self.condition = condition
self._proto = V4Protocol(server_role=True)
self._sock = socket.socket(socket.AF_INET, socket.SO... |
routes.py | import json
import queue
import requests
import re
from collections import namedtuple
from flask import (
redirect,
render_template,
request,
url_for
)
from app import app
from threading import Thread
NetworkInfo = namedtuple('NetworkInfo', ['watchdog', 'explorer', 'staking', 'endpoint'])
watchdog = '... |
tests.py | """
Skeleton for unitesting bonapity.
TODO: complete
"""
import unittest
import time
import queue
import threading
import json
import pickle
import typing
import functools
import urllib
from http.server import BaseHTTPRequestHandler, HTTPServer
from bonapity import bonapity
from bonapity.server import BonAppServe... |
multiple_instances.py | #!/usr/bin/env python3
import os
from random import choice
from time import time
import vizdoom as vzd
from multiprocessing import Process
from threading import Thread
# Run this many episodes
episodes = 1
config = os.path.join(vzd.scenarios_path, "multi_duel.cfg")
def player1():
game = vzd.DoomGame()
game.... |
batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet
from electrum.paymentrequest import InvoiceStore
from electrum.util import pro... |
gluon-shim.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016, Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list... |
views.py | from hashlib import sha256
import hmac
import logging
import threading
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden
from django.views.generic import View
from .sync import synchronize_calibre
logger = logging.getLogger(__name__)
class DropboxWebhookView(View):
d... |
loopclosing.py | import numpy as np
import cv2
import g2o
from g2o.contrib import SmoothEstimatePropagator
import time
from threading import Thread, Lock
from queue import Queue
from collections import defaultdict, namedtuple
from .optimization import PoseGraphOptimization
from .components import Measurement
# a very simple impl... |
test_ssl.py | # -*- coding: utf-8 -*-
# Test the support for SSL and sockets
import sys
import unittest
from test import test_support as support
from test.script_helper import assert_python_ok
import asyncore
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
impor... |
vault.py | import os
import base64
import time
import functools
import threading
import logging
import hvac
import requests
from hvac.exceptions import InvalidPath
from requests.adapters import HTTPAdapter
from sretoolbox.utils import retry
from reconcile.utils.config import get_config
LOG = logging.getLogger(__name__)
VAULT_... |
GUItwitter.py | import forecastio
from tkinter import *
from PIL import Image, ImageTk
import sqlite3
import time
import datetime
import twitterAPI
import threading
def weersvoorspelling():
'''Return weather forecast using the Darsky API.'''
api_key = "XXXXXXXXXXXXXXXXXXXXXXXX"
# Utrecht
latitude = 52.0884851
lon... |
FtpServer.py | import click
import threading
# https://pypi.org/project/pyftpdlib/
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
server: FTPServer
def start_server():
global server
authorizer = DummyAuthorizer()
authorizer.add_user("us... |
TCPClient.py | '''
File: TCPClient.py
Aim: Define TCP client object for BCI application.
'''
# Imports
import time
import socket
import threading
import traceback
# Local Imports
from .sessions import TrainSession, BuildSession, ActiveSession, PassiveSession
from . import logger, tcp_params, decode, encode, pack, unpac... |
nanny.py | from __future__ import print_function, division, absolute_import
from datetime import timedelta
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
import uuid
import dask
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError
from tornado.lo... |
main.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import importlib
import threading
from absl import app
from absl import flags
from pysc2 import maps
from pysc2.env import available_actions_printer
from pysc2.env import sc2_e... |
screens.py | from kivy.uix.floatlayout import FloatLayout
from kivy.core.window import Window
# execute func by timer
import sched, time, threading
from player import Player
from popups import AddNewStationPopup, ErrorMessagePopup
class PlayerScreen(FloatLayout):
"""Main screen of player."""
def __init__(self, list_ada... |
testingquee.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 26 17:03:26 2018
@author: Mohammad SAFEEA
Test script of iiwaPy class.
"""
import time
from threading import Thread
from queue import LifoQueue
def poll_pos(pos):
counter = 0
# read some data from the robot
while True:
try:
counter = cou... |
h1.py | '''
创建三个函数,非别的功能是, 求得斐波那契数列的第n项, 求n的阶乘,求n的前n项和
请比较三个函数单线程分别调用,和三个函数多线程并发的效率(相差多长时间)
假定n的值是15
'''
from time import *
import threading
def febncii(n):
if n == 1:
return 1
elif n == 2:
return 1
return febncii(n-1)+febncii(n-2)
def factor(n):
if n == 1:
return 1
else:
r... |
pystream.py | from concurrent.futures import ThreadPoolExecutor
from time import sleep
from collections.abc import Sequence
import random
import queue
import threading
class GeneratorIterator:
def __init__(self, func):
self.func = func
def __next__(self):
result = self.func()
return result
class ... |
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... |
planningclient.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2016 MUJIN Inc
"""
Planning client
"""
# system imports
import threading
import weakref
import os
import time
# mujin imports
from . import APIServerError, GetMonotonicTime
from . import controllerclientbase, zmqclient
from . import zmq
# logging
import logging
log = logg... |
connector.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
main_prog.py | import threading
from queue import Queue
from Crawler import Spider
from domain_name import *
from general import *
PROJECT_NAME = 'viper-seo'
HOMEPAGE = 'http://viper-seo.com/'
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QUEUE_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '/crawled.txt'
NUMBER_OF_THREA... |
main.py | """
A simple program for testing functionality during development.
"""
import sys
import time
import threading
import subprocess
from resolver import package_root
sys.path.append(package_root())
from mlte.report import Report, Dataset, User, UseCase, Limitation, render
from mlte.suite import Suite, SuiteReport
from... |
tasks.py | #!/usr/local/bin/python3
# coding: utf-8
# ytdlbot - tasks.py
# 12/29/21 14:57
#
__author__ = "Benny <benny.think@gmail.com>"
import logging
import os
import pathlib
import re
import subprocess
import tempfile
import threading
import time
import traceback
import typing
from hashlib import md5
from urllib.parse impor... |
threading_emaill_6b.py | import os
from threading import Thread
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... |
main.py | # Project: Resistor-Band-Picture-Creator
# Author: Dominic Gaiero
# File: main.py
# This program outputs an image of a resistor's color bands and was written
# for IEEE's Cal Poly Student Branch and their online parts website.
from tkinter import filedialog
from tkinter.filedialog import askdirectory
from tkinter impo... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hello. I am alive!"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
firehose.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# (c) B.Kerler 2018-2019
import binascii
import io
import platform
import time
import json
from struct import unpack
from binascii import hexlify
from queue import Queue
from threading import Thread
from edl.Library.utils import *
from edl.Library.gpt import gpt
from edl.Libr... |
test_browser.py | # coding=utf-8
# Copyright 2013 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.
import argparse
import json
import multiprocessing
imp... |
main_form.py | from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal, Qt
import sys
import os
import cv2
import pickle
import threading
import numpy as np
from myui import Ui_Main_Form
from mychange import create_page_sheet
from listen_microphone import ListenMusic
from utils import *
FRET = ... |
accern_xyme.py | from typing import (
Any,
Callable,
cast,
Dict,
IO,
Iterable,
Iterator,
List,
Optional,
overload,
Set,
TextIO,
Tuple,
TYPE_CHECKING,
Union,
)
import io
import os
import sys
import json
import time
import weakref
import inspect
import textwrap
import threading
... |
main.py | #python3 main.py --bin ssd_mobilenet/MobileNetSSD_deploy.bin --xml ssd_mobilenet/MobileNetSSD_deploy.xml --labels ssd_mobilenet/labels.txt --conf_threshold=0.4
#python3 main.py --bin ssd_resnet50/saved_model.bin --xml ssd_resnet50/saved_model.xml --labels ssd_resnet50/labels.txt --conf_threshold=0.1
##################... |
piano.py | import pygame
import pyaudio
import wave
import threading
import time
import sys
import os
tone = {49: "piano_C3",
50: "piano_D3",
51: "piano_E3",
52: "piano_F3",
53: "piano_G3",
54: "piano_A3",
55: "piano_B3",
97: "human_C3",
115: "human... |
test.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
threadControl.py | #coding=UTF-8
'''
Created on 2011-7-13
@author: Administrator
'''
import threading
import tongcheng58
import ganji
import soufun
from optparse import OptionParser
import cmdganji
import cmdsoufun
import cmdtc58
def getArgsDict(l):
tplargs=("citycode","kind","upc","st1","st2")
args={}
for k in range(len... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module.
Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through
3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use
... |
pabot.py | #!/usr/bin/env python
# Copyright 2014->future! Mikko Korpela
#
# 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 ... |
dnsCapture.py | from scapy.all import *
import os
import sys,socket
def credits():
creds="""Author : Vasilis Manthelas
Python version : 3.8.2(tested)
Version : 0.1"""
return creds
def help():
return """HELP
import dnsCapture.__main__ as dnsCapture
1](capture dns requests)
dns=dnsCapture.DNS_TRAFFIC()
... |
qt.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 | # +----------------------------------------------------------------------
# | Python-SimpleProxyPool
# +----------------------------------------------------------------------
# | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
# +----------------------------------------------------------------------
# | Author:... |
Varken.py | import platform
import schedule
from time import sleep
from queue import Queue
from sys import version
from threading import Thread
from os import environ as env
from os import access, R_OK, getenv
from distro import linux_distribution
from os.path import isdir, abspath, dirname, join
from argparse import ArgumentParse... |
traverse_graph.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... |
bot.py | import cgi
import logging
import os
import re
from signal import signal, SIGINT, SIGTERM, SIGABRT
from threading import Thread, Lock
from time import sleep
import types
import json
import requests
from cached_property import cached_property
from expiringdict import ExpiringDict
from requests import Request
from reques... |
worker.py | import argparse
import pickle
import json
import time
import threading
import pprint
import deep_architect.utils as ut
from google.cloud import pubsub_v1
from deep_architect.contrib.misc.datasets.loaders import (load_cifar10,
load_mnist)
from deep_architect.con... |
Processing.py | #! /usr/bin/env python
#-----------------------------------------#
# Written by Kelcey Damage, 2013
# Imports
#-----------------------------------------------------------------------#
import sys, os
from multiprocessing import Pool, Process, Queue
# Processing Class
#--------------------------------------... |
scalene_profiler.py | """Scalene: a scripting-language aware profiler for Python.
https://github.com/plasma-umass/scalene
See the paper "docs/scalene-paper.pdf" in this repository for technical
details on an earlier version of Scalene's design; note that a
number of these details have changed.
by Emery Berger
http... |
util.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Various low-level utilities.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime
import json
import math
import os
import re
import select
import si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.