source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
timer_control.py | import datetime
import os
import threading
from time import sleep
from devdeck_core.controls.deck_control import DeckControl
class TimerControl(DeckControl):
def __init__(self, key_no, **kwargs):
self.start_time = None
self.end_time = None
self.thread = None
super().__init__(key_... |
decorators.py | from threading import Thread
import cProfile, pstats, io, os, errno, signal, time
from functools import wraps
from contextlib import contextmanager
from utilmy.debug import log
def test_all():
test_decorators()
test_decorators2()
def test_decorators():
"""
#### python test.py test_decorators
... |
run.3-ex-out-parallel.py | """
file: run.3-ex-out-parallel.py
As able, get the latest image add to queue, then repeat
As able, get the latest queued and process, then repeat
Usage:
```sh
# as printed out humans
docker run --entrypoint="/usr/bin/python3" --volume="$(pwd)/out:/out" -it care-tpe-scripts:latest \
run.3-ex-out-parallel.py --mod... |
Downloader.py | # -*- coding: utf-8 -*-
__author__ = 'Mayank Gupta'
__version__ = '1.1'
__license__ = 'License :: MIT License'
from typing import Union, Callable
from typing import List, Tuple
from typing import Dict, Type
from typing import Any, Optional
import socket,select,re,ssl,threading,sys,os
from urllib.parse impo... |
onecard.py | import LED_display as LED
import threading
import time
import random
card=[[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]... |
parallel.py |
import sys
import time
import traceback
import threading
import utilities.common as utils
# change this to 1 to force single entry thread calls
min_items = 2
shutting_down = False
def set_shutting_down():
global shutting_down
shutting_down = True
in_parallel = 0
def set_in_parallel(val):
global in_paral... |
cobble.py | # Wrapper around Cobble native DLL
# TODO: Test on Windows (may need to use stdcall)
from ctypes import *
from enum import Enum, unique
import platform
import sys
import os
from queue import Queue, Empty
import signal
# Required for runloop
if platform.system() == 'Darwin':
from PyObjCTools import AppHelper
from ... |
plugtest.py | # -*- coding: utf-8 -*-
from Queue import Queue
import random
import socket
import threading
import unittest
from coapthon.messages.message import Message
from coapclient import HelperClient
from coapthon.messages.response import Response
from coapthon.messages.request import Request
from coapthon import defines
from c... |
server.py | import time
import json
import logging
from threading import Thread
from datetime import datetime, timedelta
from functools import wraps
import serial
import schedule
import forecastio
import mandrill
from flask import Flask, request, jsonify
from influxdb.influxdb08 import InfluxDBClient
from twilio.rest import Twili... |
async_command.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tools for running command line processes compatibly with asyncio.
"""
import asyncio
import datetime
import logging
import pprint
import queue
import sys
import threading
import time
import traceback
import weakref
from functools import partial
from typing import Calla... |
test_log_monitor.py | import multiprocessing as mp
import random
from multiprocessing import Process, Queue
from queue import Empty
from time import sleep
import pytest
import mnqueues as mnq
from mnqueues.log_monitor import LOGMonitor
def test_gcp_monitor():
g = LOGMonitor("test")
return True
def consumer(q: mnq.MNQueue):
... |
pico_project.py | #!/usr/bin/env python3
#
# Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import argparse
import os
import shutil
from pathlib import Path
import sys
import subprocess
from time import sleep
import platform
import shlex
import csv
import tkinter as tk
from tkinter import m... |
views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.core.files.storage import FileSystemStorage
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_protect
from .models import *
import json
import threading
import time
import os
import subprocess
import s... |
client.py | """
Web socket client.
"""
from socket import AF_INET, SOCK_STREAM, socket
from subprocess import call
from sys import argv
from sys import exit as sys_exit
from threading import Thread
from colorama import Fore
END = "END"
def main() -> None:
"""
main function of the program.
"""
port: int = get_... |
app.py | #!/usr/bin/env python
# This work is based on original code developed and copyrighted by TNO 2020.
# Subsequent contributions are licensed to you by the developers of such code and are
# made available to the Project under one or several contributor license agreements.
#
# This work is licensed to you under ... |
blockchain.py | #!/usr/bin/python3
import sys
sys.path.insert(0, 'Utilities')
sys.path.insert(0, 'Utilities/ProofOfStake')
import datetime
from main import ProofOfStakeMAIN
from tinydb import TinyDB, Query
from cryptography_testing import *
import hashlib
import time
import json
from urllib.parse import urlparse
from uuid import uui... |
ftp_client.py | import os
from datetime import datetime
from ftplib import FTP
from threading import Thread
from namenode.fs_tree import Directory, File
def create_replica(status, source_ip, dest_ip, path_from, path_to, auth_data):
try:
with FTP(source_ip, **auth_data) as ftp:
responce = ftp.sendcmd(f"REPL {... |
dafunc.py |
# vim: set ts=4 sw=4 expandtab :
'''
Copyright (c) 2016, 2017 Tim Savannah All Rights Reserved.
Licensed under the Lesser GNU Public License Version 3, LGPLv3. You should have recieved a copy of this with the source distribution as
LICENSE, otherwise it is available at https://github.com/kata198/func_tim... |
setup.py | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""Miscellaneous I/O utility functions for setting up the render pipeline.
Abstracts over the setup that has... |
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... |
channel.py | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep, time
import pandas as pd
from threading import Thread
import requests
import re
from random import random
# choose a driver
wd = webdriver.Chrome()
# specify the the wait time for a new page to be fully loaded
wait_... |
test_event_processor.py | import json
import pytest
from threading import Thread
import time
import uuid
from ldclient.config import Config
from ldclient.diagnostics import create_diagnostic_id, _DiagnosticAccumulator
from ldclient.event_processor import DefaultEventProcessor
from ldclient.util import log
from testing.http_util import start_se... |
robot_controller_utils.py | import hebi
from math import pi
from time import sleep, time
import numpy as np
import threading
import sys
import trace
joint_state = {"base": 0, "shoulder": 0, "elbow": 0}
class KThread(threading.Thread):
"""A subclass of threading.Thread, with a kill() method."""
def __init__(self, *args, **keywords):
thre... |
hockey_twitter_bot.py | # -*- coding: utf-8 -*-
"""
This module parses the NHL Schedule & Live Feed API endpoints
to gather rather relevant game events and tweet them to the
game bot Twitter acount.
"""
# pylint: disable=C0103
# pylint: disable=wildcard-import, pointless-string-statement
# pylint: disable=too-many-statements, too-many-branc... |
googlesearch.py | '''
Created on May 5, 2017
@author: anthony
'''
# compact
import sys
if sys.version_info < (3,):
import urllib2
else:
import urllib
import urllib.request
import urllib.parse
import math
import re
from bs4 import BeautifulSoup
from threading import Thread
from collections import deque
from time import ... |
thread_cpu_test.py | #!/usr/bin/env python3
#-*- coding: utf-8 -*-
import threading, multiprocessing
def loop():
x = 0
while True:
x = x ^ 1
for i in range(multiprocessing.cpu_count()):
t = threading.Thread(target=loop)
t.start()
|
__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io>
import sys
import threading
import time
import uuid
import warnings
from collections import namedtuple
from functools import wraps
import numpy as np
import zmq
from zmq.utils import jsonapi
__all__ = ['__versio... |
taskManager.py | # BSD 2-Clause License
#
# Copyright (c) 2021-2022, Hewlett Packard Enterprise
# 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... |
message_server.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.
import Queue
import logging
import threading
import time
import tornado.ioloop
import tornado.web
MESSAGE_SERVER = None
BLANK_PAGE = """<html>
<head>
<title>Blank<... |
hypothesis_test.py | import numpy as np
import copy
import time
from functools import partial, reduce
from future.utils import viewitems, viewkeys
from hypothesis import assume, given, settings, HealthCheck
import hypothesis.strategies as st
import unittest
import threading
from caffe2.python import core, workspace, tt_core, dyndep
import... |
__init__.py | #####################################################################
# #
# /__init__.py #
# #
# Copyright 2013, Monash University ... |
main_train.py | # Copyright 2021 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,... |
test_secappend.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
k8s_secret_replicator.py | #!/usr/bin/env python3
import kubernetes
from kubernetes.client.rest import ApiException
import threading
import logging
import os
FORMAT = "%(levelname)s: %(asctime)s [%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
logging.basicConfig(format=FORMAT)
log = logging.getLogger(__name__)
log.setLevel(logging... |
computer_vision.py | # ############################## Start the webserver, the opencv color grabber and the GUI #############################
import Twophase.start_server
from threading import Thread
from Twophase.vision2 import grab_colors
background_thread = Thread(target=Twophase.start_server.start, args=(8080, 20, 2))
background_threa... |
dataset.py | """Data fetching with pandas
"""
# MIT License
#
# Copyright (c) 2018 Yichun Shi
#
# 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 righ... |
fsapi_core.py | import inspect
import sys
import threading
import requests
import re
import time
from requests.exceptions import ReadTimeout, ConnectTimeout
from xml.dom import minidom
from .fsapi_exception import *
class FSAPI_Node_Blocked_Exception(Exception):
def __init__(self, message="Device is controlled from... |
rrino.py | import os
import json
import urllib2
import datetime
import threading
from httplib import BadStatusLine
import weechat
SCRIPT_NAME = 'rrino'
SCRIPT_AUTHOR = 'Matteo Bigoi <bigo@crisidev.org>'
SCRIPT_VERSION = '0.1'
SCRIPT_LICENSE = 'MIT'
SCRIPT_DESC = 'Pass highlights and private messages to the OS X 10.8+ Notificati... |
ffmpeg.py | import subprocess
from threading import Thread
from queue import Queue
queue_720 = Queue()
queue_480 = Queue()
def ffmpeg_720():
try:
file = queue_720.get()
filename = file.split('.')
output_name = filename[0] + '_720p.mp4'
cmd = 'ffmpeg -i {input} -b:v {bit_rate}M -r {... |
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... |
GUI_multiple_threads_sleep_freeze.py | '''
Created on May 28, 2019
Ch06
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import Spinbox
from time impor... |
covid_certificate.py | """ Generate certificate required to leave home during Covid confinement in France
As part of the management of the Covid-19 pandemic in France, the population
may be confined at home for some weeks when the situation becomes critical.
During these periods, residents can leave their place of confinement only in
a (ver... |
threading.py | """Functionality for working multi-threaded code."""
import inspect
import logging
import threading
import time
from typing import Dict, Tuple
from .._internal.trace import trace_str
class DeadlockMonitor:
"""A monitor for deadlocked LoggingLocks."""
timeout_sec: float
sleep_sec: float
locks: Dict[... |
default_sound.py | from multiprocessing import Process, Queue
from threading import Lock
import numpy as np
import pyaudio as pa
import soundfile as sf
audio = pa.PyAudio()
sound_lock = Lock()
class Microphone:
FORMAT = pa.paFloat32
CHANNELS = 2
RATE = 44100
CHUNK = 1024
def __init__(self, audio=audio):
r"""Initialize the mi... |
tag2folder.py | from mutagen.flac import FLAC
from mutagen.mp3 import MP3
from mutagen.ogg import OggFileType
from mutagen.oggopus import OggOpus
from shutil import move
import itertools
import os
import re
import sys
import threading
import time
def loading():
for s in itertools.cycle(['|', '/', '-', '\\']):
if done:
... |
QUBOValues.py | import math
import random
import multiprocessing
from os import pardir
from time import time
from pprint import pformat, pprint
from numba.core.types.containers import List
from numpy import array
from utils import (
get_variables_combinations,
get_variables_combinations_with_replacement,
get_variables_per... |
test_dp_correctness.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
dankMemer.py | from colored import fg, attr
import requests
import threading
import time
import random
r = fg(241) # Setup color variables
r2 = fg(255)
b = fg(31)
w = fg(15)
def start():
token = input(f"\n {r2}[{b}?{r2}] Token: ")
channel = input(f" {r2}[{b}?{r2}] Channel Id: ")
def execute_command(command = "", cooldo... |
wsgi.py | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
# Copyright (c) 2009 Domen Kozar <domen@dev.si>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... |
quadcopter.py | import numpy as np
import math
import scipy.integrate
import time
import datetime
import threading
class Propeller():
def __init__(self, prop_dia, prop_pitch, thrust_unit='N'):
self.dia = prop_dia
self.pitch = prop_pitch
self.thrust_unit = thrust_unit
self.speed = 0 #RPM
sel... |
player.py | import mido
from mido import MidiFile, MetaMessage
import time
import random
import threading
class SonascaPlayer(object):
_output_port = None
_note_on_queue = {}
_note_adj_factor = 0
_note_adj_counter = 0
_mangle_enabled = False
def __init__(self, note_adj_factor=0, note_adj_frequency=10):
... |
traybar.py | import os
from .win32_adapter import *
import threading
import uuid
class SysTrayIcon(object):
"""
menu_options: tuple of tuples (menu text, menu icon path or None, function name)
menu text and tray hover text should be Unicode
hover_text length is limited to 128; longer text will be truncat... |
controllers.py | from ...db.settings import db, oidc, socketio, mongoclient
from flask import Flask, Blueprint, render_template, abort, g, request, jsonify, redirect
from oauth2client.client import OAuth2Credentials
from flask_socketio import emit, join_room, leave_room, send
from flask_jwt_extended import (create_access_token, create... |
fpipe.py | """
Copyright 2021-2021 The jdh99 Authors. All rights reserved.
管道操作
Authors: jdh99 <jdh821@163.com>
"""
import tziot.config as config
import tziot.param as param
import socket
import threading
import lagan
import dcompy as dcom
import utzpy as utz
from typing import Callable
PIPE_NET = 0xffff
class _Api:
# 是... |
run.py | '''
Module with functions to run subprocesses and manage files
Also point of entry to run over external data
'''
from sys import argv
import sys
import traceback
import time
from datetime import date
import os
import json
from os.path import join as path_join
import shutil
import glob
import subprocess
from tqdm impor... |
nn_sq_train_grpc.py | # -*- coding: utf-8 -*-
"""neural_network square.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/github/tseth92/NeuralNet_Square/blob/master/neural_network_square.ipynb
"""
'''Training a neural network to predict the square of a number'''
import numpy ... |
data_flow_system.py | #!/usr/bin/python
import urllib
import urllib2
import xml.etree.ElementTree as ET
import exifread
from pymongo import MongoClient
import pymongo.errors
import Queue
import threading
# Get XML list of photos
req = urllib2.Request('https://s3.amazonaws.com/waldo-recruiting')
try: response = urllib2.urlopen(req)
except u... |
project.py | import logging
from threading import Thread
import django_filters
import rest_framework
from rest_framework import filters, mixins, permissions, status
from rest_framework.decorators import action
from rest_framework.exceptions import APIException
from rest_framework.pagination import CursorPagination
from rest_framew... |
mixins.py | from __future__ import (
unicode_literals,
print_function,
absolute_import,
division,
)
nstr = str
str = type('')
import inspect
import weakref
from functools import wraps
from threading import Event
from collections import deque
from time import time
try:
from statistics import median
except I... |
exchange_checker_gtk.py | """
GTK Exchange checker application
"""
import threading
import time
import gi
from tzlocal import get_localzone
gi.require_version("Gtk", "3.0")
gi.require_version("AppIndicator3", "0.1")
# pylint: disable=wrong-import-position
from gi.repository import AppIndicator3 as appindicator, GLib, Gtk as gtk
from exchang... |
server.py | from flask import Flask , render_template , request
from flask import jsonify
import subprocess # nosec #pylint-disable type: ignore
import os
import json_config
import pafy
import vlc
from modules import youtube_videos
from modules import coverpy
from flask_cors import CORS
import threading
app = Flask(__name__)
C... |
clientMQTT.py | from serial import *
import serial.tools.list_ports
import paho.mqtt.client as mqtt
import time
import sys
import os
import threading
## network parameters
# remote
# HOST = '169.254.1.1'
# local
HOST = '127.0.0.1'
PORT = 1883 # default mqtt port
## serial parameters
# windows
WIN = True
LINUX = not(WIN)
if WIN:
... |
main_terminalinfo.py | import fcntl
import sys
import threading
import os
import termios
import tty
from select import select
from main_terminalGetKey import getKey
class Raw(object):
"""Set raw input mode for device"""
def __init__(self, stream):
self.stream = stream
self.fd = self.stream.fileno()
def __ente... |
stillReceiver.py | from .stillProcessor import StillProcessor
from .cameraAPI import RecordMode
import threading
import time
from queue import Queue
import requests
class StillReceiver:
def __init__(self, cameraManager):
self.cameraManager = cameraManager
self.image_queue = Queue()
self.runLoop = False
... |
test_base_events.py | """Tests for base_events.py"""
import concurrent.futures
import errno
import math
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from test.test_asyncio import utils as test_utils
from test imp... |
efs-manager.py | #!/usr/bin/env python
import boto3
import datetime
import kubernetes
import kubernetes.client.rest
import logging
import os
import random
import re
import requests
import string
import threading
import time
import yaml
base_stunnel_port = int(os.environ.get('BASE_STUNNEL_PORT', 20490))
efs_polling_interval = int(os.e... |
flaskProvider.py | from flask import Flask
from threading import Thread
# Using Flask for HTTP monitor
app = Flask("")
# Monitoring status
@app.route("/")
def home():
return "Twitter Scraper is ON"
# Running locally on port 8080
def run():
app.run(host="0.0.0.0", port=8080)
# Threading, keeping on monitoring in a singl... |
test.py | import threading
#import threading.thread
import queue
import multiprocessing as mp
import sys
global stop_threads
import tensorflow as tf
import pandas as pd
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequenti... |
CorretorMTP_FINAL.py | # Copyright 2017 GABRIEL JABLONSKI
#
# 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, merge, publish, dis... |
connhandler.py | import platform
import requests
import json
import time
from pythonapm import constants
from pythonapm.agentfactory import get_agent
from pythonapm.constants import api_connect, api_data
from pythonapm.logger import agentlogger
from pythonapm.collector.reqhandler import send_req
from pythonapm.collector.reshandler impo... |
main_qt.py | # QtServer
from websocket_server import WebsocketServer
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore
import threading
import datetime as dt
import json
app = pg.QtGui.QApplication([])
peak = 0
y_hr = []
x_time = []
pg.setConfigOptions(antialias=True)
view = pg.GraphicsLayoutWidget(title="HR2PC QTRewrite")... |
runner.py | from contextlib import suppress
import signal
import asyncio
import os
from molotov.api import get_fixture
from molotov.listeners import EventSender
from molotov.stats import get_statsd_client
from molotov.sharedcounter import SharedCounters
from molotov.util import cancellable_sleep, stop, is_stopped, set_timer
from ... |
sess.py | """M2Crypto.SSL.Session client demo: This program requests a URL from
a HTTPS server, saves the negotiated SSL session id, parses the HTML
returned by the server, then requests each HREF in a separate thread
using the saved SSL session id.
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""
from M2Cryp... |
test_manual_activities.py | # -*- mode:python ; fill-column:120 -*-
import time
import unittest
import os
from threading import Thread
from botoflow import (WorkflowDefinition, execute, return_,
ThreadedActivityExecutor, WorkflowWorker, ActivityWorker,
workflow_starter)
from botoflow.manual_activity_c... |
test_helm.py | import unittest
import os
import sys
from unfurl.yamlmanifest import YamlManifest
from unfurl.job import Runner, JobOptions
from six.moves import urllib
manifest = """
apiVersion: unfurl/v1alpha1
kind: Manifest
spec:
service_template:
imports:
- repository: unfurl
file: configurators/helm-template.... |
t_est_gui.py | """
Created on 18th April, 2021
"""
import subprocess
import threading
from time import sleep
import pytest
import pyautogui
WIDTH = 800
HEIGHT = 600
class show:
def __init__(self):
self.subP = ()
self.info = ''
self.subP = subprocess.Popen(
'python local_t_est.py',
... |
pytest_pre_encrypted_ota.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import http.server
import multiprocessing
import os
import socket
import ssl
from typing import Callable
import pexpect
import pytest
from pytest_embedded import Dut
from RangeHTTPServer import RangeReque... |
pane.py | from datetime import datetime
import json
import docker
import urwid
import subprocess
import os
import tempfile
import sys
import time
import ast
import socket
import threading
import logging
import multiprocessing
from contextlib import closing
from twisted.internet import threads, reactor
from console.app import ... |
local_benchmark.py | # Copyright (c) The Libra Core Contributors
# SPDX-License-Identifier: Apache-2.0
# Sample benchmark to profile performance and observe bottlenecks.
#
# Run as:
# $ python -m cProfile -s tottime src/scripts/run_perf.py > report.txt
#
from ..business import VASPInfo
from ..libra_address import LibraAddress
from ..payme... |
Colector_dockwidget.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
ColectorGPSDockWidget
A QGIS plugin
Complemento que permite la recolección de información espacial y alfanumérica en QGIS
Generated by Plugin Builder: http://g-sherman.github.io/Q... |
FFmpegPipeline.py | from modules.Pipeline import Pipeline # pylint: disable=import-error
from modules.PipelineManager import PipelineManager # pylint: disable=import-error
from common.utils import logging # pylint: disable=import-error
import string
import shlex
import subprocess
import time
import copy
from threading import Thread
imp... |
log.py | import json
import sys
import time
from pathlib2 import Path
from logging import LogRecord, getLogger, basicConfig, getLevelName, INFO, WARNING, Formatter, makeLogRecord, warning
from logging.handlers import BufferingHandler
from threading import Thread, Event
from six.moves.queue import Queue
from ...backend_api.serv... |
serve.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import abc
import argparse
import json
import logging
import os
import platform
import signal
import socket
import sys
import threading
import time
import traceback
from six.moves import urllib
import uuid
from collections import defaultdict, OrderedDict
f... |
usage.py | import uuid
import time
import hashlib
import os
import getpass
import json
import logging
import socket
import sys
import platform
from parsl.multiprocessing import ForkProcess
from parsl.version import VERSION as PARSL_VERSION
logger = logging.getLogger(__name__)
def async_process(fn):
""" Decorator function ... |
registry.py | import logging
import threading
import time
from typing import List
from brownie import Contract, chain, web3
from joblib import Parallel, delayed
from web3._utils.abi import filter_by_name
from web3._utils.events import construct_event_topic_set
from yearn.events import create_filter, decode_logs, get_logs_asap
from ... |
raft_node.py | import rpyc
import threading
from random import randint
from rpyc.utils.server import ThreadedServer
from config_reader import ConfigReader
from node_dao import NodeDAO
import logging
import sys
import os
# States of Raft node
LEADER = "LEADER"
FOLLOWER = "FOLLOWER"
CANDIDATE = "CANDIDATE"
# AppendRPC return stat... |
__main__.py | # -*- coding: utf-8 -*-
# 2021/2/1
# create by: snower
import sys
import os
import multiprocessing
def show_help_message(filename):
sys.argv[0] = filename
with open(filename) as fp:
exec(fp.read())
print()
if __name__ == "__main__":
if "-h" not in sys.argv:
exit(0)... |
img_preprocess.py | import threading, queue, time
from queue import Queue
from threading import Thread, currentThread
from concurrent.futures import ThreadPoolExecutor
import os
from CalibrateTransfer.img_operation import ScreenSHot_batch
from CalibrateTransfer.data_preprocess import write_data_to_json_file,read_data_from_json_file,make_... |
test.py | # -*- coding: utf-8 -*-
import io
import os
import sys
import json
import datetime
import decimal
from time import *
import threading
coding = 'utf-8'
def test():
import informixdb
conn = informixdb.connect('odbc_demodb@ol_gbasedbt10','gbasedbt','P@ssw0rd0LD')
conn.autocommit = 0 # WE NEED THIS FOR DDL T... |
session_test.py | # Copyright 2015 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... |
generate-dataset-canny.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Hongzhuo Liang
# E-mail : liang@informatik.uni-hamburg.de
# Description:
# Date : 20/05/2018 2:45 PM
# File Name : generate-dataset-canny.py
import numpy as np
import sys
import pickle
from dexnet.grasping.quality import PointGraspMetrics3D
from... |
cleaner.py | # -*- coding: utf-8 -*-
# Copyright 2013-2020 CERN
#
# 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... |
USBCameraStream.py | """
The MIT License (MIT)
Copyright (c) 2015 Adrian Rosebrock, http://www.pyimagesearch.com
"""
# import the necessary packages
from threading import Thread
import cv2
class USBCameraStream:
def __init__(self, src=0):
# initialize the video camera stream and read the first frame
# from the stre... |
keys.py | # Code by Daniel Kukiela (https://twitter.com/daniel_kukiela)
import ctypes
from threading import Thread
from time import time, sleep
from queue import Queue
# main keys class
class Keys(object):
common = None
standalone = False
# instance of worker class
keys_worker = None
keys_process = None
... |
sqlite3_isolation_levels.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Illustrate the effect of isolation levels.
"""
#end_pymotw_header
import logging
import sqlite3
import sys
import threading
import time
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s (%(thre... |
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... |
grpc_comm_manager.py | import logging
import os
import threading
from concurrent import futures
from typing import List
import grpc
from ..gRPC import grpc_comm_manager_pb2_grpc, grpc_comm_manager_pb2
lock = threading.Lock()
from ...communication.base_com_manager import BaseCommunicationManager
from ...communication.message import Messag... |
refactor.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... |
sql_isolation_testcase.py | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... |
session.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.