source
stringlengths
3
86
python
stringlengths
75
1.04M
ps5.py
# 6.0001/6.00 Problem Set 5 - RSS Feed Filter # Name: # Collaborators: # Time: import feedparser import string import time import threading from project_util import translate_html from mtTkinter import * from datetime import datetime import pytz #----------------------------------------------------------------------...
controlportclient.py
# # Copyright (c) 2013-2014 - Adjacent Link LLC, Bridgewater, New Jersey # 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 # ...
example.py
import pickle import threading import time from djitellopy import Tello, TelloSwarm from conf import Configuration #ip = ['192.168.33.147', '192.168.33.200', '192.168.33.213', '192.168.33.251', '192.168.33.38', '192.168.33.6', '192.168.33.75'] def get_satate_background(swarm, path): """Start a process in backg...
streaming.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import logging import httplib from socket import timeout from threading import Thread from time import sleep import ssl from tweepy.models import Status from tweepy.api import API from tweepy.error import TweepError from tweepy.utils import i...
semaphore.py
#!/usr/bin/env python3 # """""" import time import random import threading TOTAL_SPOTS = 3 class Garage: def __init__(self): self.semaphore = threading.Semaphore(TOTAL_SPOTS) self.cars_lock = threading.Lock() self.cars = [] def count_parked_cars(self): return len(self.cars)...
SLOReader.py
########################################################################## # # Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
httpserver.py
### # Copyright (c) 2011, Valentin Lorentz # 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 of conditi...
test_logging.py
# Copyright 2001-2021 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
main.py
# -*- coding: utf-8 -*- import copy import datetime import imp from importlib import import_module import inspect import logging from multiprocessing import Process, Queue import operator import os from os.path import abspath, dirname import re import signal import sys import threading import time import traceback try...
T_Loop.py
from config import UnitsC, f_triggers, web_url, upload_url, key, your_token, your_domain, img_url, key from lbh2 import * import time import numpy as np import json import urllib2 import requests import threading from base_camera import BaseCamera from camera_pi import pCamera bWriteImages = True bSaveVideo = True d...
webcam.py
"""A datasource reading images from a webcam. This module mainly provides the class :py:class:`Webcam` that is a Datasource interface for accessing the a webcam. Examples -------- from dltb.datasource.webcam import Webcam webcam = Webcam() webcam.prepare() frame = webcam.get_data() image = fram...
futures.py
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
Speedtest.py
# # Speedtest.py # SpaceWire RMAP Benchmark # # 2011/06/01 K. Sakai (sakai@astro.isas.jaxa.jp) from pyspw import SpaceWire, RMAP import time import threading def execute(): """ RMAP Protocol Benchmarking """ # Target and method host = raw_input('Hostname or IP address: ') method = -1 while method not in (1, ...
ssh.py
#!/usr/bin/env python3 """ DMLC submission script by ssh One need to make sure all slaves machines are ssh-able. """ from __future__ import absolute_import from multiprocessing import Pool, Process import os, subprocess, logging from threading import Thread from . import tracker def sync_dir(local_dir, slave_node, s...
metrics.py
import logging import threading import time try: # Py3 from urllib.error import URLError except ImportError: # Py2 from urllib2 import URLError from prometheus_client import CollectorRegistry, push_to_gateway registry = CollectorRegistry() def prometheus_pusher(config): url = '{}:9091'.format...
scheduler_job.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...
elg_demo.py
#!/usr/bin/env python3 """Main script for gaze direction inference from webcam feed.""" import argparse import os import queue import threading import time from gazedb import GazeDB import coloredlogs import cv2 as cv import numpy as np import tensorflow as tf from tensorflow.python.client import device_lib import kera...
dev.py
import multiprocessing from entitykb import rpc, environ from .app import app subprocess = None @app.on_event("startup") async def startup_event(): """ Start RPC Server for development purposes. """ global subprocess kw = dict(root=environ.root, host=environ.rpc_host, port=environ.rpc_port) subproce...
test_logging.py
import logging from threading import Thread from unittest.mock import patch import pytest from pip._internal.utils.logging import ( BrokenStdoutLoggingError, ColorizedStreamHandler, IndentingFormatter, indent_log, ) from pip._internal.utils.misc import captured_stderr, captured_stdout logger = loggin...
main.py
#!/usr/bin/env python3 import threading import queue import time import os #from LidarLite3Ext import LidarLite3Ext from Pro2 import Pro2 #from Con1 import Con1 from MuleBot import MuleBot as Con1 from Accessory import Accessory #lidarLite3Ext = LidarLite3Ext() #lidarLite3Ext.init() # Delete existing log files. t...
logger.py
#!/usr/bin/env python import types import re import rospy import time import threading import os from datetime import datetime from shipcon.msg import gps_position, gps_local_position, gps_navinfo, gps_time, gyro, motor_info from std_msgs.msg import Int16, Float32 #Constants-----------------------------------------...
game.py
import datetime import random import threading import time import typing import sys import discord import schedule from discord.ext import commands import decorators import election import files import models.channels import models.villager import models.election import models.server import models.game import abilit...
demo.py
#!/usr/bin/python import paho.mqtt.client as paho import signal import sys import time from threading import Thread from upm import pyupm_grove as grove from upm import pyupm_biss0001 as grovemotion light = grove.GroveLight(0) relay = grove.GroveRelay(2) motion = grovemotion.BISS0001(6) button = grove.GroveButton(4)...
train_faster_rcnn_alt_opt.py
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a Faster R-CNN network using alternat...
amqp_exchange.py
try: import kombu from kombu import pools except ImportError: kombu = None import socket import logging import threading from time import sleep log = logging.getLogger(__name__) KOMBU_UNAVAILABLE = "Attempting to bind to AMQP message queue, but kombu dependency unavailable" DEFAULT_EXCHANGE_NAME = "puls...
aReadUntil.py
#!/usr/bin/env python from read_until import ReadUntil import time import errno from socket import error as socket_error import socket import threading, thread import sys, os, re from Bio import SeqIO from Bio.Seq import Seq from Bio.Alphabet import generic_dna from StringIO import StringIO import string import mlpy im...
notification.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. import threading import http.server import queue from contextlib import contextmanager from loguru import logger as LOG class PostQueueRequestHandler(http.server.BaseHTTPRequestHandler): def __init__(self, reque...
main.py
import sublime import sublime_plugin import webbrowser import urllib import re import os import sys import shutil import zipfile import json import pprint import time import xml from . import requests from . import processor from . import context from . import util from .salesforce.lib import xmlformatter from .sale...
core_service.py
import time import commons import threading import multiprocessing import RPi.GPIO as GPIO import audio_service as aS import serial_service as sS import network_service as nS def core_service(serial_dict, sock, sock_lock): try_call = 0 gps_time = 0 while True: call_signal = GPIO.input(commons.call...
test_detect_vitis_pp.py
#!/usr/bin/env python # # // SPDX-License-Identifier: BSD-3-CLAUSE # # (C) Copyright 2019, Xilinx, Inc. # from __future__ import print_function import cv2 import multiprocessing as mp import numpy as np import os import sys import timeit import waa_rt from ctypes import * from six import itervalues, iteritems from va...
lisp.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...
testing.py
""" Testing utilities. """ import os import re import struct import threading import functools from tempfile import NamedTemporaryFile import numpy as np from numpy import testing from numpy.testing import (assert_array_equal, assert_array_almost_equal, assert_array_less, assert_array_almos...
test_run.py
import contextvars import functools import platform import sys import threading import time import types import warnings from contextlib import contextmanager, ExitStack from math import inf import attr import outcome import sniffio import pytest from async_generator import async_generator from .tutil import check_se...
lock_mean_example.py
import threading from exercises.utils import fuzzy rabbits_colony_size: int = 0 counter_lock = threading.Lock() printer_lock = threading.Lock() def rabbit_counter(number_of_rabbits: int): global rabbits_colony_size fuzzy() with counter_lock: fuzzy() rabbits_colony_size += number_of_rabb...
usermanagement.py
""" Very simple user management for the MicroPsi service The user manager takes care of users, sessions and user roles. Users without a password set can login with an arbitrary password, so make sure that users do not set empty passwords if this concerns you. When new users are created, they are given a role and stor...
fork_tryjoin.py
import time from typing import * # use type hints to make signatures clear import wrappers # the function that will be executed on a thread def f() -> List[int]: print("f() will sleep for 500 ms") time.sleep(0.5) return [i for i in range(200)] # return a large list # spawn a thread t = wrappers.Threa...
prime.py
from flask import Flask, request, session, redirect, url_for, make_response app = Flask(__name__) from time import time from sympy import factorint from multiprocessing import Process, Queue, BoundedSemaphore, Manager from functools import wraps from random import uniform BUFFER_SIZE = 3 CONCURRENCY = 1 TPAUSE=1 TINT...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
client.pyw
#!/usr/bin/env python3 # Hydrus is released under WTFPL # You just DO WHAT THE FUCK YOU WANT TO. # https://github.com/sirkris/WTFPL/blob/master/WTFPL.md try: import locale try: locale.setlocale( locale.LC_ALL, '' ) except: pass # initialise Qt here, important it is done early from h...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
spinner.py
# Copyright 2020 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
pfserver.py
#!/usr/bin/env python3 from collections import OrderedDict from concurrent.futures import thread from datetime import time, datetime, timedelta from http.server import BaseHTTPRequestHandler from http.server import HTTPServer, urllib from objectFormatter import ObjectFormatter from os import unlink from pprint import ...
sandboxjs.py
"""Evaluate CWL Javascript Expressions in a sandbox.""" from __future__ import absolute_import import errno import json import os import re import select import sys import threading from io import BytesIO from typing import Any, Dict, List, Tuple, Union import six from pkg_resources import resource_stream from typing...
http.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 use ...
bind_benchmark.py
#!/usr/bin/env python3 import dns.message import dns.rdataclass import dns.rdatatype import dns.query import threading import time from random import choice times = [] def query(base, server): aa = "foo" + str(choice(base)) + ".example.aa" qname = dns.name.from_text(aa) q = dns.message.make_query(qname, dns...
evaluate_f0.py
#!/usr/bin/env python3 # Copyright 2021 Wen-Chin Huang and Tomoki Hayashi # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """Evaluate log-F0 RMSE between generated and groundtruth audios based on World.""" import argparse import fnmatch import logging import multiprocessing as mp import os from typing i...
_uart.py
#----------------------------------------------------------------------------- # Title : PyRogue protocols / UART register protocol #----------------------------------------------------------------------------- # Description: # Module containing protocol modules #---------------------------------------------------...
core.py
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified). __all__ = ['get_notebook_path', 'read_colab_nb', 'find_default_export_for_notebook', 'get_module_name', 'get_package_name', 'reload_package_modules', 'export_and_reload_all', 'run_process', 'get_run_args', 'ge...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper from test.support import warnings_helper import sock...
test_payload.py
import errno import logging import threading import time import pytest import salt.exceptions import salt.payload import zmq log = logging.getLogger(__name__) @pytest.fixture def echo_port(): yield 8845 class EchoServer: def __init__(self, port=8845): self.thread_running = threading.Event() ...
tpu_estimator.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...
cisd.py
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
pyagent.py
"""Agent - Agent object. Manage wandb agent. """ import ctypes import logging import os import queue import socket import threading import time import wandb from wandb import util from wandb import wandb_sdk from wandb.apis import InternalApi logger = logging.getLogger(__name__) def _terminate_thread(thread): ...
test_basic.py
import twink import logging import signal import binascii import unittest signal_stop = lambda: True signal.signal(signal.SIGINT, lambda num,fr:signal_stop()) def dummy_handle(message, channel): pass # print "dummy", binascii.b2a_hex(message), channel class BasicTestCase(unittest.TestCase): def test_...
ssh.py
# -*- coding: utf-8 -*- # # Copyright 2018 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 requir...
run-tests.py
#!/usr/bin/env python3 # # 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 "L...
test_two_threads.py
from threading import Thread from time import sleep def fun1(n): for i in range(1000): sleep(0.01) print("finished fun1()", n) def fun2(m): sleep(2) for i in range(1000): sleep(0.01) #breakpoint print("finished fun2()", m) threads = [Thread(target=fun1, args=(24,), name="Thread...
vc_engine.py
''' Created on Oct 14, 2011 @author: IslamM ''' from util import catalog from vmware.vcenter import vCenter from threading import Thread from engines.threadpool import threadpool import base64, time from logging import getLogger log = getLogger(__name__) class vc_engine: def __init__(self, vcent...
EV0.00000006.py
' litepresence 2018 ' def WTFPL_v0_March_1765(): if any([stamps, licenses, taxation, regulation, fiat, etat]): try: print('no thank you') except: return [tar, feathers] # dependencies import matplotlib import numpy as np from tkinter import * # pybitshares modules from bit...
process.py
from concurrent.futures import ThreadPoolExecutor from contextlib import contextmanager from functools import partial, reduce, wraps import inspect import io import logging import multiprocessing as mp import os import platform import queue import re import select import signal import stat import subprocess import sys ...
profile_pictures.py
import logging import os from threading import Thread import requests from kik_unofficial.device_configuration import kik_version_info from kik_unofficial.datatypes.exceptions import KikApiException, KikUploadError from kik_unofficial.utilities.cryptographic_utilities import CryptographicUtils from kik_unofficial.util...
test_s3.py
import boto3 import botocore.session from botocore.exceptions import ClientError from botocore.exceptions import ParamValidationError from nose.tools import eq_ as eq from nose.plugins.attrib import attr from nose.plugins.skip import SkipTest import isodate import email.utils import datetime import threading import re ...
server.py
from http.server import BaseHTTPRequestHandler, HTTPServer from py_essentials import hashing as hs from tinydb import TinyDB, Query from flask import Flask, app, request, jsonify import os import json import time import base64 import random import secrets import logging import requests import binascii im...
node_client.py
import os import subprocess import threading import time import json import sublime import sublime_plugin import time from .logger import log from . import json_helpers from . import global_vars # queue module name changed from Python 2 to 3 if int(sublime.version()) < 3000: import Queue as queue else: impor...
RTSP_video_writer.py
from threading import Thread import cv2 class RTSPVideoWriterObject(object): def __init__(self, src=0): # Create a VideoCapture object self.capture = cv2.VideoCapture(src) # Default resolutions of the frame are obtained (system dependent) self.frame_width = int(self.capture.get(3))...
responder.py
from flask import Flask, jsonify, request import threading import time import datetime import requests """ Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"...
main.py
import tkinter as tk import threading import time import json globalBoard = [] def main(): global globalBoard root = tk.Tk() root.title("Conway's Game Of Life -Click to add cell, right click to remove") myCanvas, globalBoard = setUp(root,500,500) generateDefaultBoardState(myCanvas,globalBoard) ...
alpaca_paper_trade_multicrypto.py
# /* # # MIT License # # Copyright (c) 2021 AI4Finance # # Author: Berend Gort # # Year: 2021 # # GitHub_link_author: https://github.com/Burntt # # 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 Softwa...
outlierPairsCurveFitting.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 3 11:50:36 2020 @author: mavroudo """ from pm4py.algo.filtering.log.attributes import attributes_filter as log_attributes_filter from pm4py.objects.log.importer.xes import factory as xes_factory from sklearn.preprocessing import StandardScaler fro...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
socks_server.py
# WebSocket server for Blender # Ben Farrell # Heavily lifted from: # Copyright 2015 Jonathan Giroux (Bloutiouf) # Licensed under MIT (http://opensource.org/licenses/MIT) # Originally found at https://github.com/KoltesDigital/websocket-server-for-blender import bpy import json import mathutils import threading from ...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import platform import array import contextlib from weakref import proxy import signal import math import pickle import struct impo...
ch05_listing_source.py
import bisect import contextlib import csv from datetime import datetime import functools import json import logging import random import threading import time import unittest import uuid import redis QUIT = False SAMPLE_COUNT = 100 config_connection = None # <start id="recent_log"/> SEVERITY = { ...
composed_writer.py
#!/usr/bin/env python3 import logging import sys import threading sys.path.append('.') from logger.transforms.transform import Transform from logger.writers.writer import Writer from logger.utils import formats ################################################################################ class ComposedWriter(Wri...
test_channel.py
#!/usr/bin/python # # Server that will accept connections from a Vim channel. # Used by test_channel.vim. # # This requires Python 2.6 or later. from __future__ import print_function import json import socket import sys import time import threading try: # Python 3 import socketserver except ImportError: #...
houndify.py
############################################################################## # Copyright 2017 SoundHound, Incorporated. All rights reserved. ############################################################################## import base64 import hashlib import hmac import httplib import json import threading import time ...
decorator.py
import _thread import contextlib import random import sys import threading import time from functools import wraps from threading import Thread import numpy as np from torch.multiprocessing import Process from torch.nn.modules.batchnorm import _BatchNorm # in order to export functions def export(fn): mod = sys.m...
tcinit.py
from tkinter import * from tkinter import font, ttk, messagebox, filedialog from tooltip import ToolTip from tkinter.scrolledtext import ScrolledText from urllib.request import urlopen import platform, os, sys, threading, json, requests, time from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException system_t...
test_multiprocessing.py
import pytest import multiprocessing import contextlib import redis from redis.connection import Connection, ConnectionPool from redis.exceptions import ConnectionError from .conftest import _get_client @contextlib.contextmanager def exit_callback(callback, *args): try: yield finally: callba...
installwizard.py
from functools import partial import threading import os from typing import TYPE_CHECKING 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 Butto...
main.py
import os from signal import signal, SIGINT import time, threading import tkinter as tk from configparser import ConfigParser from JtmanTk import JtmanTk import Qsos from logger import LOGGER as log import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) sys.path.append("./pywsjtx...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Version 3.2.3 is currently recommended when SSL is enabled, since this version worked the best with SSL in internal testing....
__main__.py
import subprocess import sys import threading FILES = { "ca-langs.py": "wikidict/lang/ca/langs.py", "en-form-of.py": "wikidict/lang/en/form_of.py", "el-langs.py": "wikidict/lang/el/langs.py", "en-labels.py": "wikidict/lang/en/labels.py", "en-langs.py": "wikidict/lang/en/langs.py", "en-places.py...
music_maker.py
# Created by Xinyu Zhu on 2020/12/21, 1:31 import pygame.midi import time import threading from ply_standardlizer import auto_format_for_file class MidiPlayer: def __init__(self): # 对于简谱上的一个数, 实际的声调应该在基础音阶的基础上增加多少 self.unit_offset = { "1": 0, "2": 2, "3": 4, ...
cross_device_ops_test.py
# Copyright 2020 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...
backtester1.py
import os import sys import sqlite3 import pandas as pd from matplotlib import pyplot as plt from multiprocessing import Process, Queue sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import db_stg, db_tick, db_backtest, graph_path from utility.static import now, strf_t...
api_server.py
# Copyright 2020 Open Source Robotics Foundation, 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...
start_io_server.py
import os import sys sys.path.append(os.path.abspath( os.path.abspath(os.path.dirname(__file__)) + '/../')) from httpserver.http_server import start_web_server import multiprocessing web_server = multiprocessing.Process(target=start_web_server, args=()) web_server.start()
menu.py
from graphics import * import states from pathlib import * import threading from sound import * def mainMenu(win, state): '''Draw the MainMenu Buttons, Background and Animations''' drawMainMenu(win) '''Detect presses on the MainMenu Buttons''' while state == states.MAIN_MENU: clicked = win...
test_poplib.py
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import time import errno from unittest import TestCase, skipUnless from test import support as test_support threading ...
tello.py
"""Library for interacting with DJI Ryze Tello drones. """ # coding=utf-8 import logging import socket import time from threading import Thread from typing import Optional, Union, Type, Dict from .enforce_types import enforce_types threads_initialized = False drones: Optional[dict] = {} client_socket: socket.socket...
mockserver.py
#!/usr/bin/python3 # Copyright 2021 Northern.tech AS # # 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 a...
physics_manager.py
# -*- coding: utf-8 -*- """ Created on Thu Jul 1 15:00:02 2021 @author: aviat """ from quadcopter import Quadcopter from payload import Payload from cable import Cable from controller import Controller import numpy as np import datetime import time import threading WINDY = False WIND_Z = False WIND_FORCE = (0,0,0) ...
mock_web_api_server_http_retry.py
import logging import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing.context import Process from typing import Type from unittest import TestCase from tests.helpers import get_mock_server_mode class MockHandler(SimpleHTTP...
worker.py
import threading import logbook import os import pickle import time import collections import platform from six.moves import xmlrpc_client from .server import NO_MORE_TESTS, PROTOCOL_ERROR, WAITING_FOR_CLIENTS from ..exceptions import INTERRUPTION_EXCEPTIONS from ..hooks import register from ..ctx import context from ....
PiVideoStream.py
# import the necessary packages from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread, Lock from scipy import misc import numpy as np import os class PiVideoStream: """ Threaded reading from PiCamera directly into a numpy array From: http://www.pyimagesearch.com/2...
main.py
import json from tp import ThreadPoolManger from ctypes import * # from ctypes import CDLL, string_at, c_uint64 import time import inspect import ctypes import sys import os from threading import Thread, Lock dll = CDLL("./WebSocketTools/x64/Debug/WebSocketTools.dll") class Server: def __init__(self, port_num=88...
server.py
#!/usr/bin/python3 # # drag — Lightweight Webhook server for Docker containers # # Copyright (C) 2021 Marcel Waldvogel import hashlib import hmac import logging import os import sys import time import subprocess import deltat import threading from http.server import BaseHTTPRequestHandler, HTTPServer VERSION = '0.1.3...
ply2fbx_recursive.py
#!usr/bin/python # -*- coding: utf-8 -*- # # convert ply to fbx # ply2fbx [in.ply] [out.fbx] [work_blender_path] [--hair|--hair_origin|--face|--accessory|--upper|--lower|--static_x10|--static_x1] # --- options --- # hair import a hair skeletal mesh with offset position # hair_origin import a hair skeleta...
train.py
#!/usr/bin/env python3 # Copyright 2019-2020 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang) # Apache 2.0 import logging import os import sys import warnings from multiprocessing import Process # disable warnings when loading tensorboard warnings.simplefilter(action='ignore', category=FutureWarning) import num...