source
stringlengths
3
86
python
stringlengths
75
1.04M
conftest.py
import pytest import torch from multiprocessing import Process from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy import os import sys # We need to add our rest api as a path since it is a separate application # deployed on Heroku: sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + ...
test_examples.py
# Copyright 2017 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 writing, so...
HiwinRA605_socket_ros_test_20190625191321.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
server.py
import asyncio import os import traceback from functools import partial from inspect import isawaitable from multiprocessing import Process from signal import SIG_IGN, SIGINT, SIGTERM, Signals from signal import signal as signal_func from socket import SO_REUSEADDR, SOL_SOCKET, socket from time import time from httpt...
sauron.py
"""API maintains queries to neural machine translation servers. https://github.com/TartuNLP/sauron Examples: To run as a standalone script: $ python /path_to/sauron.py To deploy with Gunicorn refer to WSGI callable from this module: $ gunicorn [OPTIONS] sauron:app Attributes: app (flask....
server2.py
# server2.py # multithreaded import socket from threading import Thread from fib import fib def fib_server(addr): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(addr) sock.listen(5) while True: client, addr = sock.accept() ...
env_wrappers.py
""" Modified from OpenAI Baselines code to work with multi-agent envs """ import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv, CloudpickleWrapper def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while Tru...
util.py
import os import re import shutil import sys import ctypes import warnings from pathlib import Path from colorama import Fore, Back, Style from taichi.misc.settings import get_output_directory, get_build_directory, get_bin_directory, get_repo_directory, get_runtime_directory from taichi.misc.util import get_os_name, ge...
multi_env.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 28 10:33:41 2019 @author: edward """ from itertools import islice from collections import deque import multiprocessing as mp import numpy as np from arguments import parse_a2c_args from doom_environment import DoomEnvironment def pipe_wor...
test_httplib.py
import errno from http import client import io import itertools import os import array import socket import unittest TestCase = unittest.TestCase from test import support here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' CERT_localhost = os.path.join(here, 'keycert.pem') # Self-signed cert fil...
interactive_debugger_plugin.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...
test_graph.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2019, Nigel Small # # 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 # # Unle...
restapi.py
""" __author__ = 'Christopher Fagiani' """ from flask import Flask, request import json import datetime import threading import logging logger = logging.getLogger(__name__) app = Flask(__name__) apiInstance = None @app.route("/events", methods=["GET"]) def list_events(): """lists all events in the system ""...
tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017, 2018 MinIO, 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 Lice...
ArduinoConnectorForwardModel.py
import math import re from threading import Thread import serial from ...LightSkin import ForwardModel, LightSkin, EventHook class ArduinoConnectorForwardModel(ForwardModel): """ Connects to an Arduino running the Arduino Connector Script on the given port with the given baudrate Parses the input in a n...
helpers.py
""" Helper functions file for OCS QE """ import base64 import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time from concurrent.futures import ThreadPoolExecutor from subprocess import PIPE, TimeoutExpired, run from uuid import uuid4 i...
TRAINui.py
from numpy.core.fromnumeric import var from models import create_model from data import CreateDataLoader import sys, threading import tkinter as tk from tkinter import * from tkinter import tix from tkinter import ttk from tkinter import filedialog from tkinter import scrolledtext from options import train_options imp...
perception.py
__author__ = 'Mehmet Mert Yildiran, mert.yildiran@bil.omu.edu.tr' import pyaudio # Provides Python bindings for PortAudio, the cross platform audio API import wave # Provides a convenient interface to the WAV sound format import datetime # Supplies classes for manipulating dates and times in both simple and complex wa...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Hello, I'm alive" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
pydev_transport.py
import socket import struct import threading from _pydev_comm.pydev_io import PipeIO, readall from _shaded_thriftpy.thrift import TClient from _shaded_thriftpy.transport import TTransportBase REQUEST = 0 RESPONSE = 1 class MultiplexedSocketReader(object): def __init__(self, s): self._socket = s ...
visdom_logger.py
from typing import Dict, List, Union from collections import Counter import logging import queue import threading import time from alchemy.logger import Logger import visdom from catalyst.core.callback import ( Callback, CallbackNode, CallbackOrder, CallbackScope, ) from catalyst.core.runner import IR...
train_ac_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn """ import numpy as np import tensorflow as tf import tensorflow_probability as tfp im...
test_cmd2.py
# coding=utf-8 # flake8: noqa E302 """ Cmd2 unit/functional testing """ import argparse import builtins import io import os import sys import tempfile from code import ( InteractiveConsole, ) import pytest import cmd2 from cmd2 import ( COMMAND_NAME, ansi, clipboard, constants, exceptions, ...
deep_speech2.py
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP # # 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 appli...
thr_recv.py
"""Sends messages as fast as possible to test throughput of the DataFlow """ import erdos import time import sys import threading import copy import argparse import zenoh import pickle from zenoh.net import config, SubInfo, Reliability, SubMode class ZenohRecvOp(erdos.Operator): def __init__(self, write_stream, ...
__init__.py
""" Base classes for job runner plugins. """ import os import time import string import logging import datetime import threading import subprocess from Queue import Queue, Empty import galaxy.eggs import galaxy.jobs from galaxy.jobs.command_factory import build_command from galaxy import model from galaxy.util impor...
api.py
#!/usr/bin/python3 -OO # Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org> # # 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 2 # of the License, or (at your option) any late...
Serveur.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Fichier Serveur.py Le fichier génère un serveur et reçoit plusieurs connexions en simultané. Créé le : Mon Feb 11 2019 """ import multiprocessing as mp from multiprocessing import Queue, Manager, Process from multiprocessing.sharedctypes import Value, Array from soc...
test_parallel_backend.py
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import """ Tests the parallel backend """ import threading import multiprocessing import random import os import sys import subprocess import numpy as np from numba import config, utils from numba import unittest_support as unittest from numba ...
stream_layered_image.py
""" This script generates a Docker image from a set of store paths. Uses Docker Image Specification v1.2 as reference [1]. It expects a JSON file with the following properties and writes the image as an uncompressed tarball to stdout: * "architecture", "config", "os", "created", "repo_tag" correspond to the fields ...
main_career_report.py
#!/usr/bin/env python3 """ Main career report. This module for create main career report by 'master' and complate it by 'boss' users. It can count worker salary and compilate statistic of brigades results. class MainReportS: .unofficial_workers() - return list of unofficial workers. .count_result() - count totall ...
example_bookticker.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_bookticker.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html # Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://unicor...
waste.py
#!/usr/bin/env python3 from multiprocessing import Process from setproctitle import setproctitle import os import numpy as np from common.realtime import sec_since_boot def waste(pid): # set affinity os.system("taskset -p %d %d" % (1 << pid, os.getpid())) m1 = np.zeros((200,200)) + 0.8 m2 = np.zeros((200,200)...
test_forward.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...
stateful.py
from __future__ import division import datetime import os import time import threading from pulsar.client.util import filter_destination_params from pulsar.managers import ManagerProxy from pulsar.managers import status from pulsar.managers.util.retry import RetryActionExecutor from .staging import preprocess from .s...
notes_example.py
# A very simple notetaking application that uses Python to load # and save a string in a text file in the user's home directory. import os import threading import time import pyotherside class Notes: def __init__(self): self.filename = os.path.expanduser('~/pyotherside_notes.txt') self.thread = N...
core.py
# -*- coding: utf-8 -*- # # 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 writing, software ...
test_dag_serialization.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...
transfer_learning_lstm.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys, os import cv2 import numpy as np import pandas as pd import keras.backend as K import tensorflow as tf from progressbar import ProgressBar from keras import losses, optimizers from keras.models import model_from_json, Sequential from keras.callbacks import Mod...
metrics_manager.py
from __future__ import division import logging from time import time, sleep from threading import Thread from multiprocessing import Process import os from os import kill, getpid import traceback from sys import version_info import os.path from ast import literal_eval from timeit import default_timer as timer # @added...
test_logging.py
# Copyright 2001-2017 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...
train.py
#!/usr/bin/env python import os import json import torch import numpy as np import queue import pprint import random import argparse import importlib import threading import traceback os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,5" from tqdm import tqdm from utils import stdout_to_tqdm from config import system_configs f...
main.py
import threading from queue import Queue from spider import Spider from domain import * from general import * PROJECT_NAME = 'new-egg' HOMEPAGE = 'https://www.newegg.com/global/in' DOMAIN_NAME = get_domain_name(HOMEPAGE) QUEUE_FILE = PROJECT_NAME + '/queue.txt' CRAWLED_FILE = PROJECT_NAME + '/crawled.txt' N...
tutorial_eventqueue.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....
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
teos.py
#!/usr/bin/python3 import os import subprocess import threading import time import re import pathlib import shutil import pprint import json import sys import math import psutil import eosfactory.core.errors as errors import eosfactory.core.logger as logger import eosfactory.core.utils as utils import eosfactory.core...
bbc_network.py
# -*- coding: utf-8 -*- """ Copyright (c) 2017 beyond-blockchain.org. 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 l...
version.py
import os import logging from threading import Thread __version__ = '1.2.4' try: os.environ['OUTDATED_IGNORE'] = '1' from outdated import check_outdated # noqa except ImportError: check_outdated = None def check(): try: is_outdated, latest = check_outdated('ogb', __version__) if is_...
test_nanny.py
import asyncio from contextlib import suppress import gc import logging import os import random import sys import multiprocessing as mp import numpy as np import pytest from tlz import valmap, first from tornado.ioloop import IOLoop import dask from distributed.diagnostics import SchedulerPlugin from distributed imp...
fastcov.py
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT # Copyright 2018-present, Bryan Gillespie """ Author: Bryan Gillespie https://github.com/RPGillespie6/fastcov A massively parallel gcov wrapper for generating intermediate coverage formats fast The goal of fastcov is to generate code coverage inter...
client.py
from __future__ import absolute_import import functools import six import sys import socket from base64 import b64encode from random import shuffle from six.moves.queue import Queue from time import time from threading import Lock, Thread, Event # utilize the ca_certs path from requests since we already depend on it ...
RegionMatching.py
from PIL import Image, ImageTk from numbers import Number try: import Tkinter as tk import tkMessageBox as tkmb except ImportError: import tkinter as tk import tkinter.messagebox as tkmb import multiprocessing import subprocess import pyperclip import tempfile import platform import numpy import time im...
test_config.py
import asyncio import copy import pytest import random import yaml from replaceme.util.config import create_default_replaceme_config, initial_config_file, load_config, save_config from replaceme.util.path import mkdir from multiprocessing import Pool from pathlib import Path from threading import Thread from time impo...
utils.py
from constants import PATHS, BASE_URL #import stock_trade.TradeType from urllib import parse import re from functools import wraps import inspect from decimal import Decimal import copy import warnings import datetime from threading import Thread import queue import traceback class TradeExceedsMaxSharesException(Exce...
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing...
curse.py
import curses from time import sleep import threading import queue import random import sys import os prompt = '[Ctrl-C to exit] Enter a message: ' q = queue.Queue() def main(stdscr, functions=None): curses.use_default_colors() curses.echo() body, in_box, winy, winx = init_boxes(stdscr) init_threads(in_box, funct...
__init__.py
import os import argparse from multiprocessing import Pool, Queue from pysam import VariantFile import tempfile import sys import subprocess import time import re from functools import partial from itertools import chain, zip_longest , islice import multiprocessing as mp from threading import Thread # ctx = mp.get_c...
squash_client2.py
import requests import time import json from scipy import misc import imageio import cv2 from io import BytesIO from tqdm import tqdm from queue import Queue import threading from simple_pid import PID import json import numpy as np # README: # - All requests must contain a code # - Requests are limited to 20 Hz # -...
vw.py
import sys from fileutil import * import json from wabbit_wappa import * from subprocess import call import numpy as np import random from socket import * import threading, Queue, subprocess import time import psutil import pandas as pd from seldon.pipeline.pandas_pipelines import BasePandasEstimator from sklearn.util...
多进程的代码示范.py
# -*- coding: utf-8 -*- # @Time    : 2020/2/15, 12:08 # @Author  : 高冷 # @FileName: 多进程的代码示范.py # 1.创建一个普通的线程 import threading def A(c): print("123"+c) f = threading.Thread(target=A,args=("c",)) f.start() # 2.LOCK锁 lock.acquire(),lock.release() import time num = 100 def TIMES(): global num ...
Thread_determine.py
# studi kasus cerdas cermat import threading import time def peserta1(): print (threading.currentThread().getName()+str('--> memulai mengerjakan \n')) time.sleep(2) print (threading.currentThread().getName()+str( '--> berhenti mengerjakan \n')) return def peserta2(): print (threading.currentThread...
analysis.py
""" Contains all of the anaylsis processes, delegating workers from one eula down to three categories to many heuristics. """ import os, logging, traceback from multiprocessing import BoundedSemaphore, Process, Manager from models import category from models.categories import substantive, procedural, formal def anal...
trainer.py
# Copyright 2018 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...
app.py
from flask import Flask, jsonify, request import os from os import listdir from os.path import isfile, join import threading HOST = '0.0.0.0' HTTP_PORT = 5555 TCP_PORT = 9999 UPLOAD_DIRECTORY = '/app/config_files' app = Flask(__name__) @app.route('/classify/<noofsignals>/', methods=['GET', 'POST']) def classify(noof...
webcamThread.py
# import the necessary packages from threading import Thread import cv2 class webcamThread: def __init__(self, src=0): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.read()...
manage.py
#!/usr/bin/env python import os import sys import multiprocessing from threading import Thread from Control.dataShowListener import getData from dl.model_serverX import classify_process if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'FaceV1.settings') os.environ["CUDA_VISI...
UServerTest.py
# import network import os from request.Request import Request from request.RequestMethods import RequestMethods from request.Logger import Logger from response.Response import Response from response.BadRespond import BadRespond from response.ErrorResponse import ErrorResponse from helpers.RegexHelpers import uregex...
check_plugin_help.py
# Copyright 2021 Sony Group 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 law or agreed to ...
chatroom.py
import sys import argparse import json import re import socket import threading class ClientConnection(threading.Thread): def __init__(self, parent, socket, address): threading.Thread.__init__(self) # Load init from super class self.parent = parent self.socket = socket self.address = address self.userid = "...
test_sender.py
from __future__ import print_function import os import pytest import six from six.moves import queue import threading import time import shutil import sys import wandb from wandb.util import mkdir_exists_ok from .utils import first_filestream def test_send_status_request_stopped(mock_server, backend_interface): ...
grpc_communicator.py
# Copyright 2021 Fedlearn 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
test_cluster_setup.py
import re from unittest import TestCase from testconfig import config from tests.integration.core.remote_operations import RealRemoteOperations import logging logger = logging.getLogger("test") logger.setLevel(logging.DEBUG) class TestClusterSetup(TestCase): @property def config_servers(self): ret...
networking.py
import os import asyncio import ipaddress from threading import Thread from typing import Optional, List, Dict, TYPE_CHECKING, Tuple from urllib.parse import urlparse import grpc from grpc.aio import AioRpcError from jina.logging.logger import JinaLogger from jina.proto import jina_pb2_grpc from jina.enums import Pol...
server_thread.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Fib microservice from socket import * from fib import fib from threading import Thread def fib_server(address): sock = socket(AF_INET, SOCK_STREAM) sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) sock.bind(address) sock.listen(5) while True: cli...
threading_example.py
import time import threading start = time.perf_counter() def do_something(seconds=2): print(f'Sleeping {seconds} second(s)...') time.sleep(seconds) return f'Done sleeping... {seconds}' t1 = threading.Thread(target=do_something) t2 = threading.Thread(target=do_something) t1.start() t2.start() t1.join() t2.joi...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
plotting_client.py
import Queue import os import socket import sys import threading import time import uuid import pickle from collections import namedtuple from artemis.general.should_be_builtins import is_lambda from artemis.plotting.matplotlib_backend import get_plotting_server_address from artemis.remote.child_processes import Python...
onedrive.py
import base64 import random import os import re import time from datetime import datetime import copy import traceback import sys import json from pydispatch import dispatcher from requests import Request, Session #Invader imports from lib.common import helpers from lib.common import agents from lib.common import encr...
utils_test.py
from __future__ import print_function, division, absolute_import from contextlib import contextmanager from glob import glob import logging from multiprocessing import Process, Queue import os import shutil import socket from time import time, sleep import uuid from tornado import gen from tornado.ioloop import IOLoo...
data_store.py
#!/usr/bin/env python """The main data store abstraction. The data store is responsible for storing AFF4 objects permanently. This file defines the basic interface of the data store, but there is no specific implementation. Concrete implementations should extend the DataStore class and provide non-abstract methods. T...
file_fuzzer.py
from pydbg import * from pydbg.defines import * import utils import random import sys import struct import threading import os import shutil import time import getopt class file_fuzzer: def __init__(self, exe_path, ext, notify): self.exe_path = exe_path self.ext = ext se...
socket_test.py
import array import os import shutil import sys import tempfile import eventlet from eventlet.green import socket from eventlet.support import greendns import tests def test_create_connection_error(): try: socket.create_connection(('192.0.2.1', 80), timeout=0.1) except (IOError, OSError): pass...
road_speed_limiter.py
import json import threading import time import socket import fcntl import struct from threading import Thread from common.params import Params from common.numpy_fast import interp current_milli_time = lambda: int(round(time.time() * 1000)) CAMERA_SPEED_FACTOR = 1.05 BROADCAST_PORT = 2899 RECEIVE_PORT = 843 class...
__init__.py
"""WSGI unit test package NERC DataGrid Project """ __author__ = "P J Kershaw" __date__ = "23/02/09" __copyright__ = "(C) 2010 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = '$Id$' from os import path im...
windowManager.py
# coding: utf-8 import commands from logger import logger from threading import Thread import os terminal_id = os.environ["HOME"] + "/.tickeys/tickeys_terminal_window_id" gui_id = os.environ["HOME"] + "/.tickeys/tickeys_GUI_window_id" def save_terminal_window_id(): try: stat, terminalId = commands.gets...
devtools_browser.py
# Copyright 2017 Google Inc. All rights reserved. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Base class support for browsers that speak the dev tools protocol""" import glob import gzip import logging import os import re import shutil import subprocess im...
register.py
import logging, traceback, sys, threading try: import Queue except ImportError: import queue as Queue from ..log import set_logging from ..utils import test_connect logger = logging.getLogger('itchat') def load_register(core): core.auto_login = auto_login core.configured_reply = configured_repl...
IntegrationTests.py
import multiprocessing import sys import time import unittest import percy from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC TIMEOUT = 20 class IntegrationTests(unittest....
stockbarcollector.py
# **************************************************************************** # # # # ::: :::::::: # # stockBarCollector.py :+: :+: :+: ...
server.py
import socket, hashlib, base64, threading class PyWSock: MAGIC = b'258EAFA5-E914-47DA-95CA-C5AB0DC85B11' HSHAKE_RESP = b"HTTP/1.1 101 Switching Protocols\r\n" + \ b"Upgrade: websocket\r\n" + \ b"Connection: Upgrade\r\n" + \ b"Sec-WebSocket-Accept: %s\r\n" + \ ...
spinner_thread.py
import threading import itertools import time def spin(msg, done): for char in itertools.cycle("|/-\\"): status = char + " " + msg print(status, flush=True, end="\r") if done.wait(0.1): break print(" " * len(status), end="\r") def slow_function(): time.sleep(3) re...
server.py
#!/bin/python # pylint: disable=C0302, line-too-long, unused-wildcard-import, wildcard-import, invalid-name, broad-except ''' The danger_finger copyright 2014-2020 Nicholas Brookins and Danger Creations, LLC http://dangercreations.com/prosthetics :: http://www.thingiverse.com/thing:1340624 Released under Creative Commo...
setup.py
"""setup for the dlib project Copyright (C) 2015 Ehsan Azar (dashesy@linux.com) License: Boost Software License See LICENSE.txt for the full license. This file basically just uses CMake to compile the dlib python bindings project located in the tools/python folder and then puts the outputs into standard python pa...
teams-presence.py
##!/usr/bin/env python # Python script to show Teams presence status on led # Author: Maximilian Krause # Date 04.11.2020 # Define Error Logging def printerror(ex): print('\033[31m' + str(ex) + '\033[0m') def printwarning(warn): print('\033[33m' + str(warn) + '\033[0m') def printgreen(msg): print('\0...
test_currentthreadscheduler.py
import pytest import unittest import threading from datetime import timedelta from time import sleep from rx.scheduler import CurrentThreadScheduler from rx.internal.basic import default_now class TestCurrentThreadScheduler(unittest.TestCase): def test_currentthread_singleton(self): scheduler = [ ...
cli.py
#!/usr/bin/env python # ############################################################################ # Name : cli.py """ Summary : simple ipython debug CLI with basic fallback __author__ = "Klaus Foerster" """ # ############################################################################# from __future...
A3C_distributed_tf.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning. The Cartpole example using distributed tensorflow + multiprocessing. View more on my tutorial page: https://morvanzhou.github.io/ """ import multiprocessing as mp import tenso...
scheduler.py
""" State Transfer Object Scheduler """ import threading import logging _log = logging.getLogger(__name__) class BaseScheduler(object): def new_task(self, objs): raise NotImplementedError class ThreadScheduler(BaseScheduler): def __init__(self): """ Load config from config file and init thr...
esi.py
# esi.py import requests import threading import uuid import webbrowser from .server import StoppableHTTPServer, AuthHandler from shortcircuit.model.logger import Logger class ESI: ''' ESI We are bad boys here. What should have been done is proxy auth server with code request, storage and all that stuff. ...
_c_test.py
# Copyright 2015, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...