source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_base_events.py | """Tests for base_events.py"""
import errno
import logging
import math
import os
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 asyncio import test_utils
try:
from test import support... |
server.py | import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
import os
import logging
import json
from google.protobuf import any_pb2
import grpc
import time
from threading import Thread
import sys
import redis
import cache
import service_pb2
import service_pb2_grpc
app = FastAPI()
# Mandatory variables... |
peak_picker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2012-2021 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# Permission is hereby gr... |
dataset.py | import copy
import glob
import typing
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from pathlib import Path
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
import scipy.ndimage
import chainer
import librosa
import numpy
import pysptk
imp... |
run-p4-sample.py | #!/usr/bin/env python3
# Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
__init__.py | #!/usr/bin/python3
import os
import sys
import json
import pygetwindow as gw
from tkinter import *
from socket import *
from PIL import ImageTk, Image
from threading import Thread
from ..database.datalocal import *
from ..database.database import *
from ..Notifications import Notification
from ..EventosMo... |
eos.py | from . import Handler
import hug
import threading
from pythonosc import udp_client, osc_server, dispatcher
class EosHandler(Handler):
def __init__(self):
self.name = 'eos'
super().__init__()
self.client = udp_client.SimpleUDPClient(
self.config['console']['ip'],
i... |
thr-ex0.py | #coding=utf-8
import threading
def thread_fun(num):
for n in range(0, int(num)):
print " I come from %s, num: %s" %( threading.currentThread().getName(), n)
def main(thread_num):
thread_list = list();
# 先创建线程对象
for i in range(0, thread_num):
thread_name = "thread_%s... |
rmqmultithread.py | import threading
import time
import pika
import random
import lorem
threads = []
def start_threads(thread_size,func_name):
for i in range(thread_size):
t = threading.Thread(target=func_name)
threads.append(t)
t.start()
def wait_for_search():
for thread in threads:
thread.join()
def rmq_sender(categ... |
cli.py | import click
from tensorhive.core.utils.colors import orange, green
from tensorhive.core.utils.exceptions import ConfigurationException
import tensorhive
import logging
import sys
'''
Current CLI Structure: (update regularly)
tensorhive
├── -v/--version
├── -u/--add-user
├── --log-level <level> (e.g. debug, info, warni... |
utilities.py | from time import sleep
from threading import Thread
from IPython.display import display, Audio
OUTPUT_AREA_CLASS = 'jp-OutputArea-child'
OUT_CLASS = 'jp-transient-html'
def try_to_hide_parent(css_class, level):
"""deprecated"""
return (
f'var parent = this{".parentNode" * level};'
f'if(paren... |
_a4c_stop.py |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify im... |
keyBinder.py | import keyboard
import threading
import os
import ctypes
import sys
class NoAdmin(Exception):
"""Raised when the the script does not have permissions to run the script
Attributes:
permission_level -- permission level
message -- explanation of the error
"""
def __init__(self, message="I... |
__init__.py | import time
import logging
import threading
import tornado.httpserver
from utils.server.tornado import TornadoDaemonBackend
logging.basicConfig(level=logging.DEBUG, format='%(levelname)s - - %(asctime)s %(message)s', datefmt='[%d/%b/%Y %H:%M:%S]')
def background(f):
"""
a threading decorator
use @backg... |
fix_db.py | import os
from threading import Thread
import pytest
import psycopg2
from psycopg2.extras import LogicalReplicationConnection, wait_select
from replisome.errors import ReplisomeError
@pytest.fixture
def src_db():
"Return the source database to connect for testing"
dsn = os.environ.get(
"RS_TEST_SRC_... |
jsview_3d.py |
from __future__ import absolute_import, division, print_function
from libtbx.math_utils import roundoff
import traceback
from cctbx.miller import display2 as display
from cctbx.array_family import flex
from cctbx import miller
from scitbx import graphics_utils
from scitbx import matrix
import scitbx.math
from libtbx.u... |
mpris.py | # -*- coding: utf-8 -*-
"""
Display song/video and control MPRIS compatible players.
There are two ways to control the media player. Either by clicking with a mouse
button in the text information or by using buttons. For former you have
to define the button parameters in the i3status config.
Configuration parameters:... |
callbacks.py | # -*- coding: utf8 -*-
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2014, James McCoy
# 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... |
plugins_plugin_norecord.py | #@<> Setup
import http.server
import threading
import os
import zipfile
import json
import urllib
import posixpath
try:
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
except:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketSer... |
c4Solver.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 13 18:50:06 2018
@author: Arpit
"""
import requests, yaml, os, random, threading
from cache import cached
from functools import lru_cache
from threading import Thread
FIFO = "games/c4solver67-pipe-in"
FIFO_OUT = "games/c4solver67-pipe-out"
FILE = "... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
cortex_client.py | import contextlib
import json
import logging
import multiprocessing
import os
import subprocess
import tempfile
import time
from contextlib import contextmanager
from copy import deepcopy
from datetime import datetime, timedelta
from json import JSONDecodeError
from math import ceil
from pathlib import Path
from thread... |
test_client.py | import os
import pytest
import time
import sys
import logging
import queue
import threading
import _thread
from unittest.mock import patch
import ray.util.client.server.server as ray_client_server
from ray.tests.client_test_utils import create_remote_signal_actor
from ray.tests.client_test_utils import run_wrapped_act... |
connect.py |
#from paraview.simple import Disconnect, ReverseConnect
from fabric.api import (env, run, cd, get, hide, settings,
remote_tunnel, show, shell_env)
from fabric.tasks import execute
from multiprocessing import Process, Value
import traceback
import sys
import multiprocessing as mp
# from multipr... |
testing.py | #############################################################################
#
# Copyright (c) 2004-2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
data_generation.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Simulation of random walks.
From an arbitrary intrinsic step size distribution and arbitrary bounds in 1D or 2D,
generate the modified step size distributions numerically.
"""
import logging
import multiprocessing
from time import time
import numpy as np
from .rejec... |
synchronous-concurrency.py | import sys
from Queue import Queue
from threading import Thread
lines = Queue(1)
count = Queue(1)
def read(file):
try:
for line in file:
lines.put(line)
finally:
lines.put(None)
print count.get()
def write(file):
n = 0
while 1:
line = lines.get()
if lin... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
from weakref import proxy
import contextlib
imp... |
cc.py | #!/usr/bin/python3
#Coded by Leeon123
import requests
import socket
import socks
import time
import random
import threading
import sys
import ssl
print ('''
///// ///// /////////////
CCCCC/ CCCCC/ | CC-attack |/
CC/ CC/ |-----------|/
CC/ CC/ | Layer 7 |/
... |
dataTool.py | from imports import *
import threading
import pandas as pd
from plyfile import PlyData
from sklearn.decomposition import PCA
from multiprocessing import Process
import random
from tqdm import tqdm
import laspy
from sklearn.neighbors import KDTree
if(os.path.exists("C:/") or os.path.exists("/home/jonas")):
import ... |
hypothesis_test.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
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
import hypothesis.strategies as st
im... |
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... |
test_learning.py | # Copyright Bernhard Firner, 2020
# Should be run with pytest:
# > python3 -m pytest
# For profiling:
# > python3 -m pytest test_learning.py --profile
# And then
# >>> import pstats
# >>> p = pstats.Stats('./prof/combined.prof')
# >>> p.strip_dirs()
# >>> p.sort_stats('cumtime')
# >>> p.print_stats(50)
# Or just call s... |
zsync_client.py | # -*- coding: utf-8 -*-
import zmq
import os
import time
from threading import Thread
from zhelpers import socket_set_hwm, zpipe
from zsync_server import CHUNK_SIZE, PIPELINE, ports, ip
dst_path = 'sync_files_dst'
def client_thread(ctx, port):
dealer = ctx.socket(zmq.DEALER)
socket_set_hwm(dealer, PIPELINE)
... |
test_config.py | import asyncio
import copy
import pytest
import random
import yaml
from shamrock.util.config import create_default_shamrock_config, initial_config_file, load_config, save_config
from shamrock.util.path import mkdir
from multiprocessing import Pool
from pathlib import Path
from threading import Thread
from time import ... |
script.py |
# python version Python 3.9.1
import zipfile
import argparse #argparse version '1.1'
from threading import Thread
import time
def extract_zip(zip_file, password):
try:
with open(password, 'r') as a:
for i in a.readlines():
passw = i.strip... |
test_bz2.py | #!/usr/bin/env python3
from test import support
from test.support import TESTFN, bigmemtest, _4G
import unittest
from io import BytesIO
import os
import random
import subprocess
import sys
try:
import threading
except ImportError:
threading = None
# Skip tests if the bz2 module doesn't exist.
bz2 = support.i... |
ardsimul.py | #!/usr/bin/env python
################################################################################
##
## MIT License
##
## Copyright (c) 2018 Team Roborex, NIT Rourkela
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "So... |
multi_processing.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from multiprocessing import Process
import os
# 子进程要执行的代码
def run_proc(name):
print('Run child process %s (%s)...' % (name, os.getpid()))
if __name__=='__main__':
print('Parent process %s.' % os.getpid())
p = Process(target=run_proc, args=('test',))
prin... |
map_reduce.py | r"""
Parallel computations using RecursivelyEnumeratedSet and Map-Reduce
There exists an efficient way to distribute computations when you have a set
`S` of objects defined by :func:`RecursivelyEnumeratedSet` (see
:mod:`sage.sets.recursively_enumerated_set` for more details) over which you
would like to perform the fo... |
algorithms.py | #!/usr/bin/python
# encoding: utf-8
# -- ; {{{1
#
# File : algorithms.py
# Maintainer : Felix C. Stegerman <flx@obfusk.net>
# Date : 2016-10-20
#
# Copyright : Copyright (C) 2016 Felix C. Stegerman
# Version : v0.0.3
# License : GPLv3... |
control_panel.py | # -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Jun 17 2015)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################
impor... |
sshagent.py | # -*- coding: utf-8 -*-
import sys
import paramiko
from scp import SCPClient
import time
import pickle
import threading
import queue
class SSH_Agent:
"""To distribute tasks over ssh to nodes we will use this method."""
def __init__(self, path=None, n_jobs=4):
"""Initialize class with empaty sets an... |
source.py | '''
Keylogger source, Python 2.7
'''
import time, os, threading, sys
import win32console, win32gui, win32event, win32api, winerror
import pythoncom, pyHook
sys.stderr = None
TMP = os.environ["TEMP"]
def hide():
window = win32console.GetConsoleWindow()
win32gui.ShowWindow(window, 0)
return True
objTimer =... |
c.py | # -*- coding: utf-8 -*-
import LINEPY
from LINEPY import *
from akad.ttypes import *
from multiprocessing import Pool, Process
from time import sleep
import pytz, datetime, pafy, time, timeit, random, sys, ast, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, wikipedia
from datetim... |
package.py | import sublime
import sublime_plugin
import sys
import os
import logging
from unittest import TextTestRunner, TestSuite
from .core import (
TestLoader,
DeferringTextTestRunner,
DeferrableTestCase
)
from .mixin import UnitTestingMixin
from .const import DONE_MESSAGE
from .utils import ProgressBar, StdioSplit... |
sniffer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This detector uses the Python CSV Sniffer to detect the dialect.
A timeout is needed on the Sniffer because the regular expression for detecting
double quotes can run into catastrophic backtracking if a CSV file has many
empty lines at the end that only contain deli... |
example_ticker_and_miniticker.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_ticker_and_miniticker.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: htt... |
cli.py | # Copyright (c) 2017 Sony Corporation. 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 applicabl... |
conftest.py | import pytest
import server
from multiprocessing import Process
@pytest.fixture(scope='session', autouse=True)
def server_setup():
instance = server.create_server()
process = Process(target=instance.serve_forever)
process.daemon = True
process.start()
|
process_control.py |
# TODO more comprehensive tests
from __future__ import division
from __future__ import absolute_import # XXX is this necessary?
from wx.lib.agw import pyprogress
import wx
from libtbx import thread_utils
from libtbx import runtime_utils
from libtbx import easy_pickle
from libtbx import easy_run
from libtbx.utils impo... |
run.py | # -*- coding: utf-8 -*-
__author__ = "苦叶子"
"""
公众号: 开源优测
Email: lymking@foxmail.com
"""
from flask import current_app, session
import threading
import multiprocessing
import time
from robot.api import TestSuiteBuilder, ResultWriter
from utils.file import exists_path, make_nod, write_file, read_file, mk_dirs
def... |
i3expod.py | #!/usr/bin/python3
import ctypes
import os
import configparser
import xdg
import pygame
import i3ipc
import copy
import signal
import sys
import traceback
import pprint
import time
import argparse
import random
from threading import Thread
from PIL import Image, ImageDraw
from xdg.BaseDirectory import xdg_config_home
... |
test_utils.py | """Utilities shared by tests."""
import collections
import contextlib
import io
import logging
import os
import re
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
from unittest import mock
from http.server import HTTPServer
from wsgiref.simple_server import WS... |
mv2.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
import threading
import camera
class Ui_MainWindow(object):
def... |
test_urllib.py | """Regression tests for urllib"""
import collections
import urllib
import httplib
import io
import unittest
import os
import sys
import mimetools
import tempfile
from test import test_support
from base64 import b64encode
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[... |
serialized_learning.py | import logging
import os
from multiprocessing import Process
import signal
import time
import zmq
from context import get_context, set_context
from create_base_weights import ensure_base_weights
from learn_clients import LearningController
from local_learner import local_learner
from global_learner import start_all_g... |
dlgui.py | # # # # # # # # # # # # # # #
# Author: Mustafa Mert Tunalı
# ---------------------------
# ---------------------------
# Deep Learning Training GUI - Class Page
# ---------------------------
# ---------------------------
# # # # # # # # # # # # # # #
# Libraries
import tensorflow as tf
from tensorflow.keras.models... |
quanjingCategoryImg_spider.py | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 23:13:44 2020
全景网分类图片爬取
@author: luohenyueji
"""
import os
import queue
import threading
import time
import requests
from bs4 import BeautifulSoup
# 链接名,根据category种类号110003设定,如果要查看其他的种类见 https://www.quanjing.com/category
string = 'https://www.quanjing.com/category/11... |
main2.py | # In this commit
# We set the Arduino to send 0 in order to run main() (see line 86).
# We set the arduino code to send the message it receives.
# The goal is to send a message and gurantee that it reaches
# the arduino without distortion.
# ##############################################################################... |
experiment.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
#django
# - - -
#python
import cv2
from pyModelChecking import *
from pyModelChecking.LTL import *
import os
import numpy as np
from . import ransac
from . import ClassyVirtualReferencePoint as ClassyVirtualReferencePoint
from decimal import Decimal
import... |
drone_control_ui.py | # This source code is create UI with Tkinter, glue a some components.
import sys
import numpy as np
from PIL import Image
from PIL import ImageTk
import Tkinter as tki
from Tkinter import Toplevel, Scale
import threading
import pytz
import datetime
import cv2
import os
import time
from drone_ar_flight import Drone_AR_... |
envs.py | # --- built in ---
import os
import re
import abc
import cv2
import csv
import sys
import glob
import json
import time
import random
import shutil
import inspect
import datetime
import tempfile
import distutils
import contextlib
import subprocess
import multiprocessing
from collections import deque
# --- 3rd party --... |
process.py | from .logging import debug, exception_log, server_log
import subprocess
import os
import shutil
import threading
try:
from typing import Any, List, Dict, Tuple, Callable, Optional, Union
assert Any and List and Dict and Tuple and Callable and Optional and Union
except ImportError:
pass
def add_extension_... |
process.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import tempfile
import subprocess
import tensorflow as tf
tf.compat.v1.disable_v2_behavior()
import numpy as np
import tfimage as im
import threading
import time
import multiprocessin... |
sensordb.py | from datetime import datetime, timedelta
import boto3
import json
from pybluemo.aws_srp import AWSSRP
from python_graphql_client import GraphqlClient
import os
import threading
import time
class GetOrCreateDataSourceInput(object):
DEVICE_ID_COHORT = "1e340cc4-ee98-4617-a96f-1ea6ecc19e79"
def __init__(self, o... |
test_sources.py | #
# Runtime Tests for Source Modules
#
import contextlib
import ctypes
import http.server
import json
import os
import socketserver
import subprocess
import tempfile
import threading
import unittest
import osbuild.sources
from .. import test
def errcheck(ret, _func, _args):
if ret == -1:
e = ctypes.get_... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
download_pbf.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from multiprocessing import Process
import urllib2
import math
import sys
import os
# token 池
token = [
'pk.eyJ1IjoiZ2FyeWh1IiwiYSI6ImNqZWYwdDF5aDFjODkzM28ycTBvMjM4NWsifQ.JU9SXOvw99tVm7fXxL4MrQ',
'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53... |
FindPosition.py | import cv2
import time
import numpy as np
import sys
import re
from pynput.mouse import Controller
from PyQt5.QtWidgets import QApplication
from Margin import App, Marquee, sleep
import threading as td
from flask import Flask, request
import sys
from pynput.mouse import Button, Controller
mouse = Controller()
DEBUG =... |
http_test.py | import time
from multiprocessing import Process
from flask import Flask, request, make_response
from exceptionalpy.HTTP import HTTPGetHandler
def main():
app = Flask(__name__)
@app.route("/notify")
def notify():
data = request.json
print(data)
return make_response()
app.run("... |
vato.py | #!/usr/bin/python
'''
@author: coldewey
'''
#
# Note: on *nix systems you may invoke 'lsof -i :5555' from the command line
# to determine which process is using port 5555
#
# Requires tornado libraries, which can be downloaded from tornadoweb.org
# (links to github). Make sure you use the right python version, i.e. ... |
login.py | import os, time, re, io
import threading
import json, xml.dom.minidom
import random
import traceback, logging
try:
from httplib import BadStatusLine
except ImportError:
from http.client import BadStatusLine
import requests
from pyqrcode import QRCode
from .. import config, utils
from ..returnval... |
test.py | import json
import os.path as p
import random
import socket
import threading
import time
import logging
import io
import string
import ast
import math
import avro.schema
import avro.io
import avro.datafile
from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient
from confluent_kafka.av... |
mainthreads.py | import time
import threading
import main
if __name__ == '__main__':
main.waitForTest()
thr = threading.Thread( target=time.sleep, args=(0.1, ) )
thr.start()
thr.join()
time.sleep(0.1)
main.exitTest()
|
eurekaclient.py | """
Eureka Client
"""
import json
import logging
import os
import random
import time
from threading import Thread
try:
from urllib.parse import urljoin
except ImportError:
pass
# from urlparse import urljoin
import dns.resolver
from .ec2metadata import get_metadata
from .httpclient import HttpClient... |
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... |
ObserverTabletGPS.py |
# -----------------------------------------------------------------------------
# Name: ObserverTabletGPS.py
# Purpose: Coordinate pull from GPS with Powershell/Serial Port
#
# Author: Jim Fellows <james.fellows@noaa.gov>
#
# Created: March 18, 2021 (For https://www.fisheries.noaa.gov/jira/browse/... |
test_thread.py | import threading
import time
def wrapper():
print('.')
time.sleep(10)
print('cabou')
t = threading.Thread(target=wrapper)
t.start()
print('deu certo')
|
capture.py | from picamera.array import PiRGBArray
from picamera import PiCamera
import numpy as np
from threading import Thread
class PiCameraStream(object):
"""
Continuously capture video frames, and optionally render with an overlay
Arguments
resolution - tuple (x, y) size
framerate - int
v... |
connector.py | """
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... |
process_output_monitor.py | import os
import time
from PyQt5.QtCore import QObject # pylint: disable=F0401
from PyQt5.QtCore import pyqtSignal
from threading import Thread
from .job_panel import JobPanel
class ProcessOutputMonitor(QObject):
"""
A Monitor for handling subprocess communication
"""
update_output = pyqtS... |
myticker.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys, traceback
import threading
import time
from PyQt4 import QtGui,QtCore
from boardlet import Boardlet
from modellet import Modellet
class MyTicker(Boardlet):
def __init__(self, parent, getbidobj, getaskobj):
super(MyTicker, self).__init__(parent)
... |
master.py | from .utils import zmq_addr, msg_deserialize, msg_serialize, get_host_ip, waiting_to_broadcast
from .scheduler import Scheduler, Worker, JTask, JobsTracker
from threading import Thread, Semaphore
import dill
import os
import time
import zmq
class MasterNode(object):
""" msg -> 8081 | ping -> 8080 """
def __ini... |
PRESUBMIT.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
multi_agents.py | #!/usr/bin/env python3
import multiprocessing
import subprocess
import sys, getopt
import atexit
from signal import signal, SIGINT
import os
os.environ['LD_LIBRARY_PATH'] = os.getcwd()
def usage():
print("Usage:")
print("\t-i <net_interface>")
print("\t-n <device_num>")
print("\t-s <start_id>")
p... |
callback.py | import Pyro4
import logging
Pyro4.config.REQUIRE_EXPOSE = True
log = logging.getLogger(__name__)
class CallbackServer(object):
def __init__(self, listen_port, remote_port):
self.daemon = Pyro4.Daemon(host='localhost', port=listen_port,
nathost='localhost', natport=remo... |
expudp.py | #
# connect to expedition and create the profiles
# based on the data feed
#
import sys
import signal
import socket
#import thread
# import the UDP_IP and UDP_PORT
from expconf import *
# the following is created based on the usrchannel.h header file in Expedition
# format is metric, the expedition variable name and... |
testing.py | import threading
from PyQt5 import QtGui
import pylsl
import ble2lsl
from ble2lsl.devices import muse2016
import functions
from StreamStaff import getStream_info
import time
from threads import runFunc
def thread_test():
streamer = ble2lsl.Streamer(muse2016)
info = getStream_info(muse2016)
#runFunc(functio... |
workerfindcomments.py | import time
import sqlite3
import threading
from reddit.redditconstants import WAIT, SUBREDDIT, IGNOREAUTHORS, KEYWORDS, MAXPOSTS, CLEANCYCLES
from reddit import workeranalyzecontent
from reddit.botinfo import message
message2 = False
def findComments(r):
subreddit = r.subreddit(SUBREDDIT)
cycles = 0
if... |
LaneDetect.py | import cv2
import numpy as np
# 'as' to make alias to use short word like plt => matplotlib.pyplot
import matplotlib.pyplot as plt
import time
from threading import Thread
from math import sqrt
def getLane(frame):
return Thread(target=update, args=(frame)).start()
def start(frame):
# canny_image = ... |
_cache.py | """Package index interfacing and caching."""
import io
import os
import re
import time
import shutil
import logging
import threading
import collections
import typing as t
from urllib import parse as urllib_parse
import requests
from lxml import etree as lxml_etree
INDEX_URL = os.environ.get("PROXPI_INDEX_URL", "http... |
mavros_airsim_test.py | from __future__ import division
PKG = 'px4'
import rospy
from geometry_msgs.msg import Quaternion, Vector3
from mavros_msgs.msg import AttitudeTarget
from mavros_test_common import MavrosTestCommon
# from pymavlink import mavutil
from six.moves import xrange
from std_msgs.msg import Header
from threading import Threa... |
__init__.py | # package is named tests, not test, so it won't be confused with test in stdlib
from __future__ import print_function
import contextlib
import errno
import functools
import gc
import json
import os
try:
import resource
except ImportError:
resource = None
import signal
try:
import subprocess32 as subprocess... |
systray.py | import os
import time
from io import StringIO
from threading import Lock, Thread
from typing import List
from PyQt5.QtCore import QThread, pyqtSignal, QCoreApplication, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QSystemTrayIcon, QMenu
from bauh import __app_name__
from bauh.api.abstract.controller i... |
server.py | """ Flask server for CO2meter
(c) Vladimir Filimonov, 2018
E-mail: vladimir.a.filimonov@gmail.com
"""
import optparse
import logging
import threading
import time
import glob
import os
import socket
import signal
import json
from io import StringIO
import flask
from flask import request, render_template, json... |
test.py | from cocotb.clock import Clock
from cocotb.triggers import FallingEdge
import cocotb
import pyuvm.utility_classes as utility_classes
from pyuvm import *
class CocotbProxy:
def __init__(self, dut, label):
self.dut = dut
ConfigDB().set(None, "*", label, self)
self.driver_queue = UVMQueue(ma... |
flask_tasks.py | #
# mostly copied from https://github.com/miguelgrinberg/flack/commit/0c372464b341a2df60ef8d93bdca2001009a42b5?diff=unified
# video https://www.youtube.com/watch?v=tdIIJuPh3SI&feature=youtu.be
#
import ctypes
import json
import logging
import os
import sys
import threading
import time
import traceback
import uuid
from... |
mock_ls.py | from __future__ import print_function
import sys
import os
sys.path.append(os.getcwd())
from multiprocessing import Queue
from pprint import pprint
from threading import Thread
import json
import libkak
import lspc
import subprocess
import time
import utils
class MockStdio(object):
r"""
A blocking BytesIO.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.