source
stringlengths
3
86
python
stringlengths
75
1.04M
infeed_test.py
# Copyright 2019 Google LLC # # 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, ...
pulseGPIO.py
# -*- coding: utf-8 -*- from __future__ import print_function, division, unicode_literals from __future__ import absolute_import import time import sys import RPi.GPIO as gpio from multiprocessing import Process, Queue class PulseGPIO(object): """Set Signal on Raspberry Pi GPIO pin""" def pulseGPIOpin(self)...
launch_glam2_cross.py
# # Copyright John Reid 2009 # """ Code to launch the GLAM2 algorithm on the cross-validation of several fragments concurrently. """ import os, subprocess, logging, sys, Queue, threading from optparse import OptionParser from glam2 import * # # Initialise the logging # format='%(asctime)-15s %(message)s' logging.bas...
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...
api.py
""" This module defines the API class, which makes use of a JSON-RPC client to provide higher-level methods to interact easily with a remote aria2c process. """ import shutil import threading from base64 import b64encode from pathlib import Path from loguru import logger from .client import Client, ClientException fr...
crawler.py
import time import json import re import datetime import threading import requests from lxml import etree from config import configger from verification import verify from storage import ProxyInstance from webapi import APIMiddleware class CrawlerMeta(object): def __init__(self, *args, **kwargs): self.h...
ledStatus.py
#!/usr/bin/env python import board import requests import argparse import busio import json import time import datetime import adafruit_bme280 import threading import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library import subprocess import logging import sys from systemd import journal """ blink the LED according ...
IG_Autolike.py
import argparse import yaml import instaloader import threading import signal import sys from instapy import InstaPy from instapy.util import web_address_navigator, get_relationship_counts from instapy.like_util import get_links_from_feed, check_link, like_image, verify_liking from selenium.common.exceptions import No...
server.py
#!/usr/bin/env python3 import socketserver import sys import threading # usage: ./server.py [PORT] [HOST] CLIENTS = [] class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): # Class is instantiated once per connectio...
autocast_variable_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...
osa_utils.py
#!/usr/bin/python """ (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import ctypes import queue import time import threading import re from avocado import fail_on from ior_test_base import IorTestBase from mdtest_test_base import MdtestBase from command_utils import Co...
detect.py
""" author: LSH9832 reference: https://github.com/Megvii-BaseDetection/YOLOX """ import os import cv2 import torch import sys import argparse import yaml this_path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(this_path) if not this_path in sys.path else None #print('start from this proj...
kafka_broker_integration_test.py
#!/usr/bin/python import random import os import shutil import socket import subprocess import tempfile from threading import Thread, Semaphore import time import unittest from kafka import KafkaAdminClient, KafkaConsumer, KafkaProducer, TopicPartition from kafka.admin import ConfigResource, ConfigResourceType, NewPa...
Constellation.py
# Constellation Python proxy # Version: 1.8.0.16091 (31 Mar 2016) # (c) 2015-2016 Sebastien.warin.fr import inspect, json, sys, time, uuid, zmq from collections import namedtuple from enum import Enum from threading import Thread reload(sys) sys.setdefaultencoding("utf-8") class MessageScope(Enum): none = 0 ...
leveldb.py
# Tencent is pleased to support the open source community by making GNES available. # # Copyright (C) 2019 THL A29 Limited, a Tencent company. 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...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test elcashd shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_fra...
ort_eps_test.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import unittest import torch import onnxruntime_pybind11_state as torch_ort import os import sys def is_windows(): return sys.platform.startswith("win") from io import StringIO import sys import threading import time c...
windows.py
import contextlib import ctypes import ctypes.wintypes import io import json import os import re import socket import socketserver import threading import time import typing import click import collections import collections.abc import pydivert import pydivert.consts if typing.TYPE_CHECKING: class WindowsError(OS...
run.py
from wenku8 import Wenku8 import threading import pymongo import time # 整体配置 max_thread = 9 + 1 max_bid = 2596 max_uid = 530655 max_rid = 191767 # MongoDB数据库 client = pymongo.MongoClient() db = client.wenku8 # Wenku8 的爬虫对象 wk = Wenku8() wk.login() def db_book_info(result: dict): print(result) db.book.inser...
examplev3.py
#!/usr/bin/python # -*- coding: utf-8 -*- import flask from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons import os import re import sys import struct import json import requests import argparse import getpass import thre...
caffe_googlenet_client.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...
MicroPython simple RPC - Host PC.py
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.2.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + import asyncio import...
request_session.py
import socket import json import threading import time import select import sys import signal import os import argparse s = None t1 = None def prGreen(skk): print("\033[92m {}\033[00m".format(skk)) def receive_data(): global s global session_type while True: # checking wheather first messag...
tello.py
# coding=utf-8 import logging import socket import time import threading import imutils import cv2 import pygame import numpy as np from enum import IntEnum from threading import Thread from djitellopy.decorators import accepts from djitellopy.game_events import GameEvents class State(IntEnum): idle = 0 yawin...
test__issue600.py
# Make sure that libev child watchers, implicitly installed through the use # of subprocess, do not cause waitpid() to fail to poll for processes. # NOTE: This was only reproducible under python 2. from __future__ import print_function import gevent from gevent import monkey monkey.patch_all() import sys from multipro...
VLANHopperDTP.py
#!/usr/bin/python # # This script is performing DTP Trunk mode detection and VLAN Hopping # attack automatically, running sniffer afterwards to collect any other # VLAN available. # # To be launched only in Unix/Linux environment as the script utilizes # following applications: # - 8021q.ko # - vconfig # - ifc...
test_eventqueue_multithread.py
# eventpy library # Copyright (C) 2020 Wang Qi (wqking) # Github: https://github.com/wqking/eventpy # 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....
load.py
# EDMC plugin for reporting a rich presence on discord which will include some basic location information and plugin_name = "DiscordPresence" plugin_version = "4.0.0-beta1" plugin_author = "garud, rglx" plugin_license = "Apache, 2.0" # removed config interfacing stuff. if you installed the plugin and then disabled i...
main.py
from ..service import BuildAction from ..service import ConvergenceStrategy from ..service import parse_repository_tag from ..service import Service from .. import config from ..config.environment import Environment from ..config.environment import split_env from ..config.config import ConfigDetails from ..config.confi...
simulator.py
from functools import partial from bokeh.models import ColumnDataSource, Toggle, Slider, Div, Label from threading import Thread from bokeh.themes import built_in_themes from bokeh.plotting import curdoc, figure from bokeh.layouts import column, row from tornado import gen from bokeh.document import without_document_lo...
http_com.py
import logging import base64 import random import os import ssl import time import copy import json import sys from pydispatch import dispatcher from flask import Flask, request, make_response, send_from_directory # Empire imports from lib.common import helpers from lib.common import agents from lib.common import encr...
vccu.py
import os import time import logging import threading from xmlrpc.server import SimpleXMLRPCServer from xmlrpc.server import SimpleXMLRPCRequestHandler import xmlrpc.client import json LOG = logging.getLogger(__name__) LOCAL = "127.0.0.1" LOCALPORT = 2001 DEVICE_DESCRIPTIONS = "devicetypes/json/device_descriptions.jso...
main.py
#!/usr/bin/env python #_*_ encoding: utf-8 _*_ import webapp2 import time import json import os import threading import datetime from cook import worker as worker # Video render and concat unit from cook import translate as translate from convert import jsonhelper as jsonhelper # convert functions about json from pa...
slushserver.py
#!/usr/bin/python # -*- coding: utf-8 -*- import cherrypy import serial import io import threading import simplejson as json import os temperature = [ 0,0,0 ] def arduinoReceive(): global temperature serialIn = serial.Serial('/dev/ttyACM0', 9600, bytesize=8, parity='N', stopbits=1, timeout=0) sio = io.TextIOWrapp...
ccbench.py
# This file should be kept compatible with both Python 2.6 and Python >= 3.0. from __future__ import division from __future__ import print_function """ ccbench, a Python concurrency benchmark. """ import time import os import sys import functools import itertools import threading import subprocess import socket from...
get_brwac_urls.py
import json import lxml.etree as ET from codecs import open import argparse from os import listdir from os.path import isfile, join from nltk import word_tokenize from hash_tools import HashTable def read_brwac_docs(buffer): #print(buffer) last_doc_close_pos = buffer.rindex('</doc>') buffer_out = buffer[l...
book_edit_window.py
""" coding:utf-8 file: book_edit_window.py @author: jiangwei @contact: jiangwei_1994124@163.com @time: 2020/5/10 9:12 @desc: """ from threading import Thread from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QWidget from ui.add_book_window import Ui_Form from util.dbutil...
interaction_genetic_processor.py
import logging import multiprocessing import csv import re import json import os import sys import urllib.request from tqdm import tqdm from datetime import datetime from string import Template from processor import Processor logger = logging.getLogger(__name__) class HeaderTemplate(Template): delimiter = '%' ...
debug.py
# -*- coding: utf-8 -*- """ debug.py - Functions to aid in debugging Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from __future__ import print_function import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading from . import pt...
wrapper.py
#!/usr/bin python3 """ Process wrapper for underlying faceswap commands for the GUI """ import os import re import signal import subprocess from subprocess import PIPE, Popen, TimeoutExpired import sys import tkinter as tk from threading import Thread from time import time from .utils import Images class ProcessWrap...
shared_memory_speed_test.py
# https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py import numpy as np from collections import deque import gym from gym import spaces import cv2 cv2.ocl.setUseOpenCL(False) class NoopResetEnv(gym.Wrapper): def __init__(self, env, noop_max=30): """Sample initial st...
test_operator.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...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight ZClassic 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 with...
mic.py
import abc import numpy as np import struct import audioop import threading from . import configuration try: # noinspection PyPep8Naming import Queue as queue except ImportError: # noinspection PyUnresolvedReferences import queue if configuration.is_raspberry(): import alsaaudio else: import ...
s99.py
import logging import subprocess import time import threading import os import tkinter as tk from tkinter import ttk, PhotoImage from PIL import Image, ImageTk from modlunky2.constants import BASE_DIR, IS_EXE from modlunky2.ui.widgets import PopupWindow, Tab from modlunky2.utils import is_windows, tb_info logger = l...
test_spark.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import os from urlparse import urlparse, parse_qsl from urllib import unquote_plus from urlparse import urljoin import json import BaseHTTPServer import threading import ssl import time import requests i...
util_tests.py
# coding: utf-8 # pystacia/tests/util_tests.py # Copyright (C) 2011 by Paweł Piotr Przeradowski # # This module is part of Pystacia and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import math from time import sleep from random import randint, choice, sample from threading im...
WorkloadPatch.py
#!/usr/bin/python # # Copyright 2015 Microsoft Corporation # # 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...
test_wait.py
import signal import threading import time from socket import socket, socketpair from types import FrameType from typing import Any, Callable, Generator, List, Optional, Tuple import pytest from urllib3.util.wait import ( _have_working_poll, poll_wait_for_socket, select_wait_for_socket, wait_for_read,...
example_test.py
import re import os import sys import socket import BaseHTTPServer import SimpleHTTPServer from threading import Thread import ssl try: import IDF except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, # we need to set environment variable `TEST_FW_...
test_sigma_dut.py
# Test cases for sigma_dut # Copyright (c) 2017, Qualcomm Atheros, Inc. # Copyright (c) 2018-2019, The Linux Foundation # # This software may be distributed under the terms of the BSD license. # See README for more details. import binascii import errno import fcntl import hashlib import logging logger = logging.getLog...
distributed.py
import os import sys current_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(root_path) import signal import threading import torch import experiments.options as options from experiments.train import main as single_process_ma...
draw_device_test.py
import matplotlib.pyplot as plt import matplotlib.animation as animation import threading from time import sleep count = 0 def wrapper(): global count while True: print(count) count += 1 sleep(1) def main(): read_thread = threading.Thread(target=wrapper,daemon = True) read_thread.start(...
test_sub.py
from common.base import GenericTestBase from tcutils.wrappers import preposttest_wrapper import test from heat_test import HeatStackFixture from nova_test import * from vm_test import * from jinja2 import Environment, FileSystemLoader import yaml from port_fixture import PortFixture from ipaddress import IPv4Network fr...
httpd.py
#!/usr/bin/env python2 """ Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ import BaseHTTPServer import cStringIO import datetime import httplib import glob import gzip import hashlib import io import json import mimetypes import os...
WrapItUp.py
# Max van Leeuwen - maxvanleeuwen.com/WrapItUp # WrapItUp - 1.9 # # Collect all media, gizmos and files associated with a nuke script, and copy it all to a separate folder - along with a relinked duplicate of the nuke script. WIU_Title = 'WrapItUp 1.9 - maxvanleeuwen.com' WIU_Log = '[WrapItUp] ' # imp...
bench_queue.py
import sys import time import fiber import multiprocessing as mp from threading import Thread from fiber import SimpleQueue as Queue from datetime import datetime import logging import time import random logger = logging.getLogger('fiber') logger.setLevel(logging.DEBUG) NUM = int(1e6) MSG = "MESSAGE_"# * 1024 def wo...
picam.py
# import the necessary packages from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread import cv2 class PiVideoStream: def __init__(self, resolution=(320, 240), framerate=32, rotation=0): # initialize the camera and stream self.camera = PiCamera() self.camera.resolution...
benchmark.py
import socket import json import threading import random from timeit import default_timer as timer import engine as m_engine import server as m_server def direct_benchmark(nr_of_orders, midpoint=100): engine = m_engine.MatchingEngine() orderbook_size = len(engine.orderbook) orders = [] for i in rang...
views.py
# -*- coding: utf-8 -*- from datetime import datetime from django.contrib.auth.models import User from django.http import Http404 from django.shortcuts import render from espnff import League from rest_framework import authentication, permissions from rest_framework.decorators import api_view from rest_framework.re...
oldtest.py
''' SPDX-License-Identifier: BSD-2-Clause Copyright 2017 Massachusetts Institute of Technology. ''' import unittest import threading import tornado_requests import os import json import base64 import configparser import common import crypto import tempfile import signal import subprocess import queue import uuid ...
docker_base.py
import json import logging import os import threading from multiprocessing import Process, Queue from queue import Empty from typing import Tuple, Union from docker import DockerClient from docker.models.containers import Container from test.cl_node.errors import CommandTimeoutError, NonZeroExitCodeError from test.cl_...
tensorboard_manager.py
# -*- coding: utf-8 -*- import os import sys import threading import time import itertools from collections import namedtuple import logging sys.argv = ["tensorboard"] from tensorboard.backend import application # noqa try: # Tensorboard 0.4.x above series from tensorboard import default ...
transport.py
''' implements the client side of the Debug Adapter protocol documentation can be found here https://microsoft.github.io/debug-adapter-protocol/specification https://microsoft.github.io/debug-adapter-protocol/overview a list of server implementers can be found here https://microsoft.github.io/debug-adapter-prot...
covid_voice_assistant.py
import requests import json import pyttsx3 import speech_recognition as sr import re import threading import time API_KEY = "tjouGqHAS-5X" PROJECT_TOKEN = "t-Ub-trMaofD" RUN_TOKEN = "t5zp4TEoB6zY" class Data: def __init__(self, api_key, project_token): self.api_key = api_key self.project_tok...
example.py
#!/usr/bin/python # -*- coding: utf-8 -*- #test223 import flask from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons import os import re import sys import struct import json import requests import argparse import getpass imp...
ChatApplication_server.py
# -*- coding: utf-8 -*- """ Chat Room for Client Server Architecture. University of the West of Scotland. Author: Guillermo Siesto Sanchez B00334584 e-Mail: b00334684 at studentmail.uws.ac.uk Date: 2018 Description: The purpose of this coursework is to develop a distributed chat system without using any t...
clang-tidy-diff.py
#!/usr/bin/env python3 # #===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===# # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===--------...
face2rec2.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...
create_molcache2.py
'''Takes a bunch of types training files. First argument is what index the receptor starts on Reads in the gninatypes files specified in these types files and writes out a monolithic receptor cache file. Version 2 is optimized for memory mapped storage of caches. keys (file names) are stored first followed by dense...
settings.py
# MIT License # Copyright (c) 2017 GiveMeAllYourCats # 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, mer...
beauty_scraper.py
# -*- coding: utf-8 -*- import os import requests import shutil import time import threading import beauty_scraper_util as bsUtil from bs4 import BeautifulSoup from abc import ABCMeta, abstractmethod DL_FOLDER_NAME = 'downloads' class BeautyScraper(object): '''Inherit this class and overwrite all the abstractmet...
test_cursor.py
# Copyright 2009-present MongoDB, 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 wri...
ws_thread.py
import sys import websocket import threading import traceback import ssl from time import sleep import time import json import decimal import datetime as dt import logging from market_maker.settings import settings from market_maker.auth.APIKeyAuth import generate_expires, generate_signature from market_maker.utils.log...
logging_handler.py
import logging import logging.config import logging.handlers import threading from multiprocessing import Queue _console_log = 15 class LogLevelFilter(logging.Filter): def __init__(self, param=None): self._level = param def filter(self, record): return record.levelno in self._level and record....
run-p4-sample.py
#!/usr/bin/env python2 # Copyright 2013-present Barefoot Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
test_httpservice.py
import threading import unittest import urllib.request from httpservice.app import Server, parsePort from http.server import HTTPServer import time # Extended Class to remove output to stdout in test class QuietServer(Server): def log_message(self, *args): pass class TestRequests(unittest.TestCase): ...
mate_ksx3267v2.py
#!/usr/bin/env python # # -*- coding: utf-8 -*- # # Copyright (c) 2018 JiNong, Inc. # All right reserved. # import struct import time import socket import select import traceback import hashlib import json from enum import IntEnum from threading import Thread, Lock from mate import Mate, ThreadMate, DevType from mbloc...
porttest.py
import os, pty from serial import Serial import threading def listener(port): #continuously listen to commands on the master device while 1: res = b"" while not res.endswith(b"\r\n"): #keep reading one byte at a time until we have a full line res += os.read(port, 1) ...
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 ...
swipam_d42.py
#!/usr/bin/env python import sys import os import json import base64 import ConfigParser import threading import Queue import time import requests try: requests.packages.urllib3.disable_warnings() except: pass CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) CONFIG = os.path.join(CURR...
local_runner.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import atexit import json import os import signal import subprocess import sys import time from six.moves import xrange from multiprocessing import Process from tensorflow.python.platform import tf_logging as logging from po...
decoder.py
import logging import platform from datetime import datetime from multiprocessing import Process, Pool from time import sleep import psutil from ais import stream from pymongo import MongoClient, errors from requests import post from src.functions import more_processing software_version = 0.2 inFile = "ais_undecoded...
parallel_runner.py
from envs import REGISTRY as env_REGISTRY from functools import partial from components.episode_buffer import EpisodeBatch from multiprocessing import Pipe, Process import numpy as np import torch as th from modules.utils.maven_module import EZAgent as enza # Based (very) heavily on SubprocVecEnv from OpenAI Baselin...
dokku-installer.py
#!/usr/bin/env python2.7 import cgi import json import os import re import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.12.13' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = ...
main.py
import argparse import queue import threading import signal from pathlib import Path import cv2 import depthai import numpy as np from imutils.video import FPS from math import cos, sin parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent debug output") parse...
agents.py
# BSD-3-Clause License # # Copyright 2017 Orange # # 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 conditions and the followi...
armory.py
# Armory 3D Engine # https://github.com/armory3d/armory bl_info = { "name": "Armory", "category": "Render", "location": "Properties -> Render -> Armory", "description": "3D Game Engine for Blender", "author": "Armory3D.org", "version": (0, 6, 0), "blender": (2, 80, 0), "wiki_url": "http:...
interface.py
""" =========================================================================== MIT License Copyright (c) 2021 Manish Meganathan, Mariyam A.Ghani 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 w...
__init__.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import urllib, urllib2 import random, cgi from threading import Thread from SocketServer import ThreadingMixIn from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer class Client(object): PROTOCOL_VERSION = "SPOMSKY/0.91" class Server(Thre...
ThreadImpl.py
import threading import thread class ThreadImpl: def __init__(self, threadId, taskName): self.threadId = threadId self.taskName = taskName def execute(self): print(self.threadId, self.taskName) threadImpl = ThreadImpl("1", "Task 1") #t = threading.Thread(target=threadImpl.execute)...
main.py
"""Main loop for scheduler subsystem.""" from shared import config from shared.controller import Controller from scheduler.scheduler import Scheduler from flask import Flask, request, jsonify from flask_htpasswd import HtPasswdAuth from flask_cors import CORS import threading from shared.streamtologger import StreamTo...
lrp_indicator.py
#################################################################### # ### lrp_indicator.py ### #################################################################### # ### Author: SAS Institute Inc. ### ############################################...
lock.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """These tests ensure that our lock works correctly. This can be run in two ways. First, it can be run as a node-local t...
server.py
''' Main script: server handling client/lock connection Usage: Set the IP-address to the server's IP-address. Launch the lock before logging in with the client. ''' import socket import sys import os from threading import * import mysql.connector from configparser import ConfigParser config = ConfigParser() config.re...
main.py
from concurrent.futures import thread import json import os import sys import threading import time import webbrowser import webview import client import dotenv import flask from flask_socketio import SocketIO, emit, join_room, leave_room, \ close_room, rooms, disconnect env = dotenv.load_dotenv() #load env toke...
check_public_headers.py
#!/usr/bin/env python # # Checks all public headers in IDF in the ci # # Copyright 2020 Espressif Systems (Shanghai) PTE LTD # # 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...
test_observable.py
import logging import multiprocessing import sys import time from unittest import TestCase import rexpython as rx logging.basicConfig(format="%(asctime)-15s %(name)-25s %(levelname)s %(process)d %(message)s") log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) class TestOnError(TestCase): def test_on...
main.py
import argparse import atexit import fcntl import os import platform import re import shutil import signal import stat import subprocess import sys import tempfile import time import unittest from multiprocessing import Process class TestUnit(unittest.TestCase): current_dir = os.path.abspath( os.path.joi...
test_cancel.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # test_cancel.py - unit test for query cancellation # # Copyright (C) 2010-2011 Jan Urbański <wulczer@wulczer.org> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by...