source
stringlengths
3
86
python
stringlengths
75
1.04M
training_queue.py
import threading from concierge import constants from concierge.concierge_queue import ConciergeQueue def event_queue_worker(): eq = ConciergeQueue(constants.CF_EVENT,constants.event_queue,constants.EVENT_RATINGS_FILE) eq.poll() def media_queue_worker(): mq = ConciergeQueue(constants.CF_MEDIA,constants.media_...
client.py
from __future__ import print_function import grpc from google.protobuf import json_format import file_pb2 import file_pb2_grpc from threading import Thread import json from multiprocessing import Queue try: import queue except ImportError: import Queue as queue class Client: """ gRPC Client class for stre...
Downloader.py
import os import multiprocessing as mp import requests from PyQt4.QtCore import * from PyQt4.QtGui import * from logger import Logger class Downloader(QThread): def __init__(self, name='Downloader', nprocs=2, log_dir='.', parent=None): ...
cert_puffin_reconnect_logic.py
#!/usr/bin/env python import logging import socket import time from threading import Thread from bidfx import Session, Subject, Field """ Example of Pixie reconnect logic. """ def on_price_event(event): print(f"Price update to {event}") def on_subscription_event(event): print(f"Subscription to {event.sub...
__init__.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its own dedicated window. Works on Windows, OS X and Linux and compatible with Python 2 and 3. (C) 2014-2018 Roman Sirokov and contributors Licensed under B...
creating _db_values.py
import os import random import datetime import csv import threading import time random.seed(os.urandom(16)) pessoa = {"sexo": ["M","F"], "idade":[str(x) for x in range(128)], "renda":[str(x) for x in range(1024)], "escolaridade":["0","1","2","3"], "idioma":[str(x) for x in ran...
multi2.py
""" Use multiprocess anonymous pipes to communicate. Returns 2 connection object representing ends of the pipe: objects are sent on one end and received on the other, though pipes are bidirectional by default """ import os from multiprocessing import Process, Pipe def sender(pipe): """ send object ...
util.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: util.py Description: util module for Python SDK sample. """ from threading import Thread import io import operator import os.path from PIL import Image import wx try: import cognitive_face as CF except ImportError: import sys ROOT_DIR = os.path.dirn...
RansomWare.py
# Imports from cryptography.fernet import Fernet # encrypt/decrypt files on target system import os # to get system root import webbrowser # to load webbrowser to go to specific website eg bitcoin import ctypes # so we can intereact with windows dlls and change windows background etc import urllib.request # used f...
dual_tor_io.py
import datetime import threading import time import socket import random import struct import ipaddress import logging import json import scapy.all as scapyall import ptf.testutils as testutils from operator import itemgetter from itertools import groupby from tests.common.utilities import InterruptableThread from nat...
base_camera.py
import time import threading import cv2 try: from greenlet import getcurrent as get_ident except ImportError: try: from thread import get_ident except ImportError: from _thread import get_ident class CameraEvent(object): """An Event-like class that signals all active clients when a new...
wsgi_restart.py
# This code lifted from the mod_wsgi docs. import os from pathlib import Path from typing import Sequence import sys import signal import threading import atexit import queue _interval = 1.0 _times = {} _files = [] # type: Sequence[Path] _running = False _queue = queue.Queue() # type: queue.Queue _lock = threading....
client-socket.py
import socket import threading # Choosing a nickname nickname = input("Enter a nickname: ") # Connecting the client to the server clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) clientSocket.connect((socket.gethostbyname(socket.gethostname()), 12458)) # Listening to the server and Sending the nickna...
duckypad_autoprofile.py
import time from tkinter import * from tkinter import filedialog from tkinter import simpledialog from tkinter import messagebox import urllib.request import tkinter.scrolledtext as ScrolledText import traceback import json import os import webbrowser import sys import threading import logging import hid_rw import get_...
login.py
import os, sys, time, re import threading import json, xml.dom.minidom import copy, pickle, random import traceback, logging import requests from .. import config, utils from ..returnvalues import ReturnValue from .contact import update_local_chatrooms from .messages import produce_msg logger = logging....
tests.py
"""Tests for the HTTP server To run the tests simply issue: python tests.py To create (or delete) an example database of users, use the following command: $ python tests.py create_db or $ python tests.py delete_db """ import sys import time import unittest from multiprocessing import Process from os import remove...
AlleleReferenceManager.py
import os import re import pandas as pd import urllib.request import sys # from glob import glob import shutil import utilities import seq_utilities from _collections import defaultdict from Bio import SeqIO # LocusTableMask = 'locus_list*.tab' LocusTableFile = 'locus_list.tab' # LocusTableColumns = ['locus','isORF','...
multiplayer_over_net_agent.py
'''An example docker agent.''' import json import time import os import threading import requests import docker from . import BaseAgent from .. import utility from .. import characters class MultiPlayerAgent(BaseAgent): """The Docker Agent that Connects to a Docker container where the character runs.""" def...
create_files.py
#!/usr/bin/env python from subprocess import call import sys from threading import Thread from Queue import Queue queue = Queue() num = 9 #num threads and #size = 10240 #creates 10MB image size = 102400 #creates 100MB image def createImage(i,q,dest = "/tmp"): """creates N 10mb identical image files"""...
heartbeat.py
import os import sys import http.server import threading sys.path.append(os.path.join(os.path.dirname( __file__), '../../../libbeat/tests/system')) from beat.beat import TestCase from time import sleep class BaseTest(TestCase): @classmethod def setUpClass(self): self.beat_name = "heartbeat" ...
packagemeta.py
""" Copyright (c) 2012, Daniel Skinner <daniel@dasa.cc> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditio...
django.py
import json import logging import threading from functools import partial from django.http import HttpResponse, HttpRequest from .httpbased import HttpContext, HttpHandler, run_event_loop from .utils import make_applications from ..utils import STATIC_PATH, iscoroutinefunction, isgeneratorfunction, get_free_port log...
interpreter.py
# Copyright 2019 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 applicable law or agreed to ...
video_to_ascii.py
from image_to_ascii import image_to_ascii import cv2,os,numpy as np import concurrent.futures from threading import Thread from time import perf_counter,sleep as nap import argparse # may add sound later .\ class ascii_video : """ working of class extract image and yield convert into asc...
parameter_server.py
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import os from hops import hdfs as hopshdfs from hops import tensorboard from hops import devi...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from pyln.client import RpcError, Millisatoshi from shutil import copyfile from pyln.testing.utils import SLOW_MACHINE from utils import ( only_one, sync_blockheight, wait_for, TIMEOUT, account_balance, first_channel_id, closing_fee, TEST_NETWORK...
core.py
# -*- coding: utf-8 -*- # # 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 #...
app.py
############################################################################# # Copyright (c) 2018, Voila Contributors # # # # Distributed under the terms of the BSD 3-Clause License. # # ...
system_controller.py
import alsaaudio import pulsectl import threading from config import TEST_ENV import pydbus import time class SystemController(): def __init__(self): self.system_volume = alsaaudio.Mixer().getvolume()[0] def get_volume(self): return self.system_volume def set_volume(self, vol): th...
alarmSpeaker.py
""" alarmSleaker.py Summay: Alarm sleaker. """ import os import cv2 import wave import pyaudio import random import threading from detectionSleepiness import DetectionSleepiness class AlarmSpeaker: """ AlarmSpeaker. """ # Sound path. __SOUNDS_DIR = "./sounds" def __init__(self): ...
LedService.py
import argparse import multiprocessing import time from rpi_ws281x import * from LEDMEthods import * import RPi.GPIO as GPIO from threading import Thread # LED strip configuration: LED_COUNT = 120 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!). # LED_PIN = 10 # GPI...
ad_service.py
#!/usr/bin/python from collections import deque import time from ad_req_interface import AdReqInterface import urllib2, urllib import threading import uuid import os import json class HttpReq(object): def __init__(self, type, url="http://xssp.maxbit.cn/adapi/ad/getAd"): self.__MAX_TIMES = 2 self....
utils.py
from logger import LOGGER try: from pyrogram.raw.types import InputChannel from wrapt_timeout_decorator import timeout from apscheduler.schedulers.asyncio import AsyncIOScheduler from apscheduler.jobstores.mongodb import MongoDBJobStore from apscheduler.jobstores.base import ConflictingIdError ...
enaml_video_model.py
from atom.api import Atom, Typed, Unicode, Int, Bool, Signal from enaml.core.declarative import d_ from enaml.application import deferred_call from time import sleep from collections import deque from threading import Thread from numpy import ndarray import numpy as np from typing import Tuple import os.path as p fr...
pika.py
import json import logging import os import time import typing from collections import deque from threading import Thread from typing import Callable, Deque, Dict, Optional, Text, Union, Any, List, Tuple from rasa.constants import ( DEFAULT_LOG_LEVEL_LIBRARIES, ENV_LOG_LEVEL_LIBRARIES, DOCS_URL_PIKA_EVENT_...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.utils import xyxy2xywh, xywh2xyxy, torch_dist...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
cluster.py
################################################################################ # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors # # This file is a part of the MadGraph5_aMC@NLO project, an application which # automatically generates Feynman diagrams and matrix eleme...
test_statsd_thread_safety.py
# stdlib from collections import deque from functools import reduce import threading import time import unittest # 3p from mock import patch # datadog from datadog.dogstatsd.base import DogStatsd from datadog.util.compat import is_p3k class FakeSocket(object): """ Mocked socket for testing. """ def ...
bootstrap.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # The code is placed into public domain by: # anatoly techtonik <techtonik@gmail.com> # # Bootstrap dependencies for compiling Mingwpy # toolchain on Windows # # Securely fetch files using known hash/size # combination, unpack them locally into .locally/ # subdir. #...
DEMO_multi_processing.py
import time import numpy as np import multiprocessing as mp """An Tutorial of multi-processing (a Python built-in library) """ def func_pipe1(conn, p_id): print(p_id) time.sleep(0.1) conn.send(f'{p_id}_send1') print(p_id, 'send1') time.sleep(0.1) conn.send(f'{p_id}_send2') ...
controller.py
import os import asyncio import threading from aiosmtpd.smtp import SMTP from public import public from typing import Any, Dict @public class Controller: def __init__(self, handler, loop=None, hostname=None, port=8025, *, ready_timeout=1.0, enable_SMTPUTF8=True, ssl_context=None, ...
views.py
from app import app import logging logging.basicConfig(level=logging.DEBUG) from flask import Flask, render_template, request, redirect, url_for, flash, jsonify from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, TextAreaField from wtforms.validators import DataRequired, Email from flask_mail ...
main.py
# Online Judge Discord Bot # Main python executable import time import discord import os import sys import subprocess import math import dns import asyncio import judging import contests import requests import secrets import string import grpc import judge_pb2 import judge_pb2_grpc import uuid import hashlib import Pr...
io.py
# Copyright (c) 2018 PaddlePaddle 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 app...
Blogs_Preprocessing_I.py
# coding: utf-8 # # Erstellung des Datensatzes # Texte: Blogbeiträge der Blogplattform Hypotheses.org # Labels: Die von den Wissenschaftlern gewählten Themen und Disziplinen # # Autorin: Maria Hartmann # In[2]: # Import libraries import numpy as np import csv # for csv output import requests # HTTP for humans fr...
project.py
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
tarina.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ```````` `````` ``````` ``` ```` ``` `````` # ` ``` ` `` ``` ``` ``` ``` ```` `` `` ``` # ``` ``````` ``` ```` ``` ```````` `````` # ``` `` `` `````` ``` `` ````` ``` `` # ``` ``` ``` ``` ``` ``` ``` ```` ``` `...
sympy.py
# -*- coding: utf-8 -*- import logging import multiprocessing try: from sympy.solvers import solve from sympy import Symbol from sympy.core import sympify except ImportError: logging.error("m_sympy: Sympy no está instalado.") class sympy: def __init__(self, core, client): try: ...
api.py
# -*- coding: utf-8 -*- """ api ~~~ Implements API Server and Interface :author: Feei <feei@feei.cn> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 Feei. All rights reserved """ import socket import errno impo...
_flaskserver.py
""" Serve web page and handle web sockets using Flask. """ # Improvements to be done in the future: # 1) Code from MainHandler, AppHandler and WSHandler should be moved in # _serverHandlers.py. Only RequestHandler and MyWebSocketHandler # 2) manager should be overloadable from _flaskserver.py to allow MainHandler, ...
cclient.py
import socket,threading,requests,os,json,re os.system("clear") port = 2230 unms = raw_input("Name : ") R = "\x1b[1;31m" G = "\x1b[1;32m" Y = "\x1b[1;33m" B = "\x1b[1;34m" P = "\x1b[1;35m" C = "\x1b[1;36m" W = "\x1b[1;37m" def tjs(msg,to="public"): return json.dumps({"msg":msg,"to":to}) class client: s = sock...
p2p_stress.py
import testUtils import p2p_test_peers import random import time import copy import threading from core_symbol import CORE_SYMBOL class StressNetwork: speeds=[1,5,10,30,60,100,500] sec=10 maxthreads=100 trList=[] def maxIndex(self): return len(self.speeds) def randAcctName(self): ...
monitor.py
import sys sys.path.append(r"/home/anoldfriend/OpenFOAM/anoldfriend-7/utilities/") import signal import multiprocessing as mp import time from residual_monitor import read_residuals,plot_multiple_residuals,quit log="run.log" pressure_name="p_rgh" nCorrectors=1 interval=10 sample_size=300 # m_residuals=[["h"],["Ux"...
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...
YiPun.py
from tkinter import * from tkinter import ttk from tkinter.ttk import Notebook from tkinter import messagebox import random from googletrans import Translator import os from gtts import gTTS from playsound import playsound import csv from threading import Thread ############### ''' L = ["pip install gtts...
test_decorators.py
from datetime import datetime from threading import Thread from django.test import TestCase from drf_util.decorators import await_process_decorator, await_checker, set_await @await_process_decorator(5, 7) def simple_print(text): print(datetime.now(), text) class DecoratorsTests(TestCase): def test_await_...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Copyright (c) 2018-2021 The CSPN Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test cspnd shutdown.""" from test_framework.test_framewo...
main.py
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
videostream_example.py
import numpy as np import cv2 from multiprocessing import Process def send(): cap_send = cv2.VideoCapture('videotestsrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! appsink', cv2.CAP_GSTREAMER) out_send = cv2.VideoWriter('appsrc ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=s...
subscription_client.py
#!/usr/bin/env python3 # Copyright (c) 2004-present Facebook All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import json import logging import queue import ssl import threading import uuid from base64 import b64encode from types import Tracebac...
app_New.py
import base64 import datetime import plotly import plotly.figure_factory as ff import os import dash import dash_bootstrap_components as dbc import dash_daq as daq import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State from dash.exceptions import Preven...
facility.py
import inspect import logging import os.path import threading import time from collections import abc from collections import defaultdict from speedling import cfgfile from speedling import conf from speedling import gitutils from speedling import inv from speedling import localsh from speedling import piputils from s...
transport.py
# -*- coding: utf-8 -*- """ bromelia.transport ~~~~~~~~~~~~~~~~~~ This module defines the TCP transport layer connections that are used by the Diameter application protocol underlying. :copyright: (c) 2020-present Henrique Marques Ribeiro. :license: MIT, see LICENSE for more details. """ impo...
remind.py
""" remind.py - Willie Reminder Module Copyright 2011, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://willie.dftba.net """ import os import re import time import threading import collections from pytz import timezone, all_timezones_set import pytz import codecs from datetime import dat...
ISICDataset.py
# ---------------------------------------- # Written by Xiaoqing GUO # ---------------------------------------- from __future__ import print_function, division import os import torch import pandas as pd import cv2 import multiprocessing from skimage import io from PIL import Image import numpy as np from torch.utils.d...
test_presence.py
"""Test the presence service.""" import time from multiprocessing import Process import pytest from fm_server.presence import presence_service @pytest.mark.usefixtures("database_base_seed") def test_presence_start(): """Test that the presence service starts.""" presence_controller = Process(target=presence...
lldb_batchmode.py
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://...
TrafficMonitor.py
import threading import logging import time import datetime from src.utils.utils import merge_dict, FlowKey, FlowPkt from src.Classifier import DomainClassifier from src.utils.utils import get_mac, get_device_name, get_vendor_from_mac, disable_if_offline, IP_is_private from src.utils.utils import StopProgramExce...
ext_openbox_mfes.py
import time import numpy as np from ext_algs.base import Ext_opt from xbbo.core.trials import Trial, Trials import ConfigSpace from ConfigSpace import Configuration from xbbo.utils.constants import Key import sys from multiprocessing import Process sys.path.append('../open-box') from openbox.apps.multi_fidelity.mq_m...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
execution_test.py
from unittest.mock import MagicMock from concurrent.futures import ThreadPoolExecutor import concurrent.futures import platform import threading import pytest import numpy as np from common import small_buffer import vaex def test_evaluate_expression_once(): calls = 0 def add(a, b): nonlocal calls ...
__init__.py
""" Tests for pyramid_webpack """ import os import inspect import re import json import shutil import tempfile import webtest from mock import MagicMock from pyramid.config import Configurator from pyramid.renderers import render_to_response from six.moves.queue import Queue, Empty # pylint: disable=E0401 from thread...
event_loop_in_processes.py
import asyncio import os import random import typing from multiprocessing import Process processes = [] def cleanup(): global processes while processes: proc = processes.pop() try: proc.join() except KeyboardInterrupt: proc.terminate() async def worker(): ...
deadlock.py
import numpy as np import psutil import time import subprocess as sp from threading import Thread import matplotlib.pyplot as plt # mat = {'p0': ['cpu', 'mem', 'storage']} cpu = [] store = [] mem = [] need = { 'p0': [0, 1, 0, 0], 'p1': [0, 4, 2, 1], 'p2': [1, 0, 0, 1], 'p3': [0, 0, 2, 0], 'p4': [0...
interactive_shell.py
# -*- coding: UTF8 -*- import sys from subprocess import PIPE, Popen from threading import Thread from Queue import Queue, Empty import time import traceback ON_POSIX = 'posix' in sys.builtin_module_names def write_output(out, queue): try: for c in iter(lambda: out.read(1), b""): queue.put(c) out.close() e...
five.py
from threading import Thread def bomb(): t1 = Thread(target=bomb).start() t2 = Thread(target=bomb).start() t1.join() t2.join() bomb()
dynamicCoro.py
import asyncio from threading import Thread async def production_task(): i = 0 while 1: # 将consumption这个协程每秒注册一个到运行在线程中的循环,thread_loop每秒会获得一个一直打印i的无限循环任务 asyncio.run_coroutine_threadsafe(consumption(i), thread_loop) # 注意:run_coroutine_threadsafe...
dataset.py
# Copyright 2020 - 2021 MONAI Consortium # 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...
test__semaphore.py
### # This file is test__semaphore.py only for organization purposes. # The public API, # and the *only* correct place to import Semaphore --- even in tests --- # is ``gevent.lock``, never ``gevent._semaphore``. ## from __future__ import print_function from __future__ import absolute_import import weakref import geve...
resource_handlers.py
#!/usr/bin/python ''' # ===================================================================== # Abstract resource handlers for ROS Actions and ROS Services # # .. Warning:: ROS Services are currently not supported # # Author: Marc Sanchez Net # Date: 05/15/2019 # Copyright (c) 2019, Jet Propulsion Laboratory. # ====...
server.py
# -*- coding: utf-8 -*- """ Peer Server Module ------------------ Contains the server engine for the peer. """ __all__ = ['PeerServer'] # std imports import re import json import socket import traceback import threading # compatibility from six import add_metaclass # package imports import net # package imports f...
interfaceserver.py
""" This module provides an interface for interacting with long lasting calculations via a TCP socket. """ # source: http://stackoverflow.com/questions/23828264/ # how-to-make-a-simple-multithreaded-socket-server-in-python-that-remembers-client import socket import threading import time import Queue from log import...
watchdog.py
#!/usr/bin/python # Copyright (c) Microsoft Corporation # All rights reserved. # # MIT License # # 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 limitatio...
helpers.py
import multiprocessing import time import socket import logging import re from contextlib import contextmanager from playhouse.test_utils import _QueryLogHandler from data.database import LogEntryKind, LogEntry3 class assert_action_logged(object): """ Specialized assertion for ensuring that a log entry of ...
ydlidar_node.py
import time import threading import math import traceback from sensor_msgs.msg import LaserScan import rclpy from rclpy.node import Node from rcl_interfaces.msg import ParameterDescriptor from .driver import YDLidar from .parser import YDLidarScanParser from .logging_rclpy import * class YDLidarNode(Node): def ...
a_pg.py
import multiprocessing import threading import tensorflow as tf import numpy as np import gym import os import shutil import matplotlib.pyplot as plt import gym_sandbox import multiprocessing import time GAME = 'police-killall-trigger-3dgrid-v0' OUTPUT_GRAPH = True LOG_DIR = './log' N_WORKERS = multiprocessing.cpu_cou...
functional_tests.py
#!/usr/bin/env python """ This script cannot be run directly, because it needs to have test/functional/test_toolbox.py in sys.argv in order to run functional tests on repository tools after installation. The install_and_test_tool_shed_repositories.sh will execute this script with the appropriate parameters. """ import ...
client_test.py
import sys import unittest import tornado.httpclient import tornado.concurrent import tornado.testing import tornado.gen import tornado.ioloop import tornado.iostream import tornado.tcpserver import subprocess import threading import tempfile import time import json import socket import ssl import os from datetime im...
test_006_threadlocal_simple_container.py
#!/bin/false # Copyright (c) 2022 Vít Labuda. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list of conditions an...
mt_media.py
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
test_github.py
from threading import Thread from unittest import TestCase from parameterized import parameterized from hvac import exceptions from tests import utils from tests.utils.hvac_integration_test_case import HvacIntegrationTestCase from tests.utils.mock_github_request_handler import MockGithubRequestHandler try: # Pyt...
RawListener.py
import logging import os import sys import threading import SocketServer import ssl import socket class RawListener(): def __init__(self, config, name = 'RawListener', logging_level = logging.INFO): self.logger = logging.getLogger(name) self.logger.setLevel(logging_level) s...
tcp_server.py
import socket import sys import time import threading def tcplink(sock, addr): print('Accept new connection from %s:%s...' % addr) # sock.send(b'Welcome!') # while True: data = sock.recv(1024) print(data) # time.sleep(1) # if not data or data.decode('utf-8') == 'exit': # ...
portfolio_base.py
from threading import Thread from queue import Queue # import simplejson as json from datetime import datetime # import re from .base_strategy import BaseStrategy, logger from ...markets import market_watcher, market_simulator, position from ...db.utils import generate_uuid from ...db.models import Result, Portfolio, S...
report_runner.py
import csv import pandas as pd import math import multiprocessing import os import shutil import time import uuid from definitions import ROOT_DIR from multiprocessing import Pool, Manager, Process from tqdm import tqdm def write_to_csv(q, csv_file_name, headers, buffer_size=500): # Create the output files c...
core.py
# -*- coding: utf-8 -*- """ envoy.core ~~~~~~~~~~ This module provides envoy awesomeness. """ import os import sys import shlex import signal import subprocess import threading __version__ = '0.0.2' __license__ = 'MIT' __author__ = 'Kenneth Reitz' def _terminate_process(process): if sys.platform == 'win32': ...
local_operations.py
import os import pty import time import shutil import threading import subprocess from ..utils.constants import Constants from ..utils.printer import Printer from ..utils.utils import Utils class LocalOperations(object): # =============================================================================...
logs_handler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals import codecs import logging import multiprocessing import os import re import sys import threading import time import traceback from logging.handlers import BaseRotatingHandler, _MIDNIGHT from stat import...
MapCanvas.py
#!/usr/bin/env python3 """ Project: PyGTK Map Canvas Title: MapCanvas & UITool Classes Function: Provides GTK widget for displaying a map. Author: Ben Knisley [benknisley@gmail.com] Created: 8 December, 2019 """ ## Import Python built-ins import threading import time ## Import PyGtk modules import gi import cairo gi.r...