source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
sim.py | #! /usr/bin/env python
#
# python flipdot display simulator
import curses
import threading
import time
from PIL import Image
from flipdot import display
from flipdot.handler import *
class DisplaySim(threading.Thread):
def __init__(self, w, h, stdscr, refresh_rate=0.06, panels=None, portrait=False, debug=Fals... |
mask_rcnn.py | """Mask RCNN Estimator."""
# pylint: disable=consider-using-enumerate,abstract-method
import os
import math
import time
import logging
from multiprocessing import Process
import numpy as np
import mxnet as mx
from mxnet import gluon
from mxnet.contrib import amp
from .... import data as gdata
from .... import utils a... |
communication.py | import logging
import multiprocessing
import bagua_core as B
from bagua.service import AutotuneService
from collections import defaultdict
from . import env
from .env import (
get_master_addr,
get_world_size,
get_rank,
get_local_rank,
get_local_size,
get_default_bucket_size,
get_bagua_servic... |
utils.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... |
queue_sys.py | #!/usr/bin/env python3
# ===================================================================================
# Copyright @2020 Yanyu Zhang zhangya@bu.edu
# HW4 : Build queue system
# ===================================================================================
import queue
from tweepy_get import tweepy_get
from i... |
vwsfriend.py | import os
import sys
import re
import argparse
from datetime import datetime, timedelta, timezone
import logging
import time
import tempfile
import netrc
import getpass
import threading
from pyhap.accessory_driver import AccessoryDriver
from weconnect import weconnect
from weconnect.__version import __version__ as _... |
presplash.py | # Copyright 2004-2018 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... |
26'sTradeSpam.py | import sys
from g_python.gextension import Extension
from g_python.hmessage import Direction
from time import sleep
import threading
extension_info = {
"title": "26'sTradeSpam",
"description": "ts: on&off&cho ",
"version": "0.2",
"author": "funkydemir66"
}
ext = Extension(extension_info... |
worker_run_state.py | import docker
import glob
import logging
import os
import threading
import time
import traceback
import codalab.worker.docker_utils as docker_utils
from collections import namedtuple
from pathlib import Path
from codalab.lib.formatting import size_str, duration_str
from codalab.worker.file_util import remove_path, g... |
web.py | ## Copyright 2017 Knossos authors, see NOTICE file
##
## 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... |
base.py | import hashlib
import httplib
import os
import threading
import traceback
import socket
import urlparse
from abc import ABCMeta, abstractmethod
from ..testrunner import Stop
from protocol import Protocol, BaseProtocolPart
here = os.path.split(__file__)[0]
# Extra timeout to use after internal test timeout at which t... |
runner_config.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
db_sync_screen.py | import pathlib
import threading
import subprocess
import json
from pw_manager.utils import utils, decorators, constants
from pw_manager.db_sync import db_sync
from pw_manager.db import Database
from YeetsMenu.menu import Menu, Option
from colorama import Style, Fore
from cryptography.fernet import InvalidToken
@dec... |
base_events.py | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... |
ws_thread.py | import sys
import websocket
import threading
import traceback
import ssl
from time import sleep
import json
import decimal
import logging
from market_maker.settings import settings
from market_maker.auth.APIKeyAuth import generate_expires, generate_signature
from market_maker.utils.log import setup_custom_logger
from m... |
__init__.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Implements context management so that nested/scoped contexts and threaded
contexts work properly and as expected.
"""
import collections
import functools
import logging
import os
import platform
import socket
import string
import subprocess
import sys
import threading
... |
final.py | from imutils.video import FPS
import imutils
import cv2
import numpy as np
import heapq
import time
import multiprocessing
from multiprocessing import Pool, Queue
RESIZE = 100
def worker(input_q, output_q):
while True:
frameinfo = input_q.get()
# frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) ... |
sixteens_full.py | #!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import MetadataObject, GenObject, make_path, write_to_logfile, \
run_subprocess
from genemethods.sipprCommon.objectprep import Objectprep
from genemethods.sipprCommon.sippingmethods import Sippr
from Bio.Blast.Applications import NcbiblastnC... |
tree_topology.py | from mininet.net import Mininet
from mininet.topolib import TreeTopo
from mininet.node import Controller, RemoteController,OVSSwitch
import random
import threading
# Create and start mininet topology
tree_topo = TreeTopo(depth=3, fanout=2)
net = Mininet(topo=tree_topo, controller=RemoteController,switch=OVSSwitch)
ne... |
test_connector.py | import unittest
from cbint.utils.detonation import DetonationDaemon, CbAPIProducerThread
from cbint.utils.detonation.binary_analysis import DeepAnalysisThread
from cbopensource.connectors.lastline.bridge import LastlineConnector, LastlineProvider
import os
import sys
import tempfile
from time import sleep
import multip... |
webui.py | import email.utils
import hashlib
from http.client import HTTPConnection
from http.server import BaseHTTPRequestHandler, HTTPServer
import mimetypes
import os
import random
import threading
import time
import webbrowser
def start_server(
server_port=8080,
public_html_path=os.path.realpath(os.path.join(
... |
proxyarpTest.py |
# Copyright 2017-present Open Networking Foundation
#
# 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 ag... |
manager.py | #!/usr/bin/env python
"""Manager of worker subprocesses.
This module invokes the worker subprocesses that perform the cloud
security monitoring tasks. Each worker subprocess wraps around a cloud,
store, event, or alert plugin and executes the plugin in a separate
subprocess.
"""
import copy
import logging.config
i... |
server.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
test_session.py | import threading
import unittest
from mongoengine import sessions
class SessionTest(unittest.TestCase):
def tearDown(self):
sessions.clear_all()
def test_set_get_local_session(self):
session = {"db": "1"}
sessions.set_local_session("test", session)
self.assertEqual(session, s... |
start_pipelined.py | """
Copyright (c) 2018-present, Facebook, Inc.
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. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import logging
import threa... |
server.py | #!/usr/bin/env python
######################################################
# Author: Andrea Fioraldi <andreafioraldi@gmail.com> #
# License: BSD 2-Clause #
######################################################
"""
classic rpyc server running a SlaveService + angrdbg + IPython shell
usa... |
test_event.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
tests.integration.modules.event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import
import time
import threading
# Import Salt Testing libs
from tests.support.case import Modu... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
test_socketserver.py | """
Test suite for socketserver.
"""
import contextlib
import io
import os
import select
import signal
import socket
import tempfile
import unittest
import socketserver
import test.support
from test.support import reap_children, reap_threads, verbose
try:
import _thread
import threading
except ImportError:
... |
ssh.py | from __future__ import absolute_import
from __future__ import division
import inspect
import logging
import os
import re
import shutil
import six
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from pwnlib import term
from pwnlib.context import context, LocalContext
f... |
main.py | import json
import threading
import time
from threading import Lock
from cloudwatch.config import *
import boto3
from cloudwatch.cwl import CloudWatchLogs
from cloudwatch.consumer_mixpanel import MixpanelConsumer
from cloudwatch.consumer_filesystem import FileSystemConsumer
from cloudwatch.utils import create_file_if_d... |
face_mask_auto_ipwebcam.py | import cv2
import numpy as np
import os
import PIL
import time
import requests
import tensorflow as tf
import keras
import subprocess
# import screee
import multiprocessing
# from mss import mss
import pickle
labels = ["with_mask", "without_mask"]
url = "http://hjk:005@192.168.43.1:8080/shot.jpg" # r... |
stoppable_thread.py | # Copyright 2015-2021 Espressif Systems (Shanghai) CO LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
collaborative.py | from __future__ import annotations
import logging
from dataclasses import dataclass
from threading import Event, Lock, Thread
from typing import Dict, Iterator, Optional
import numpy as np
import torch
from pydantic import BaseModel, StrictBool, StrictFloat, confloat, conint
from hivemind.dht import DHT
from hivemin... |
test_async.py | from amuse.support.interface import InCodeComponentImplementation
from amuse.test.amusetest import TestWithMPI
from amuse.support import exceptions
from amuse.support import options
import os
import time
from amuse.units import nbody_system
from amuse.units import units
from amuse import datamodel
from amuse.rfi.tool... |
resilient-service.py | # -*- coding: utf-8 -*-
from datetime import datetime
import io
import os.path
import time
import threading
from wsgiref.validate import validator
from wsgiref.simple_server import make_server
EXCHANGE_FILE = "./exchange.dat"
def update_exchange_file():
"""
Writes the current date and time every 10 seconds i... |
FrontFollowing.py | import numpy as np
import os,sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
data_path = os.path.abspath(
os.path.dirname(os.path.abspath(__file__)) + os.path.sep + ".." +
os.path.sep + "data")
import tim... |
terminal-ui.py | import npyscreen
import curses.ascii
from curses import endwin
from hand_object import hand
from communication_framework import Comframe, getOpenPorts
from ui_widgets import TSlider, TimeSlider, BoxSelectOne, BoxOptions, PortBox
class MainForm(npyscreen.FormBaseNew):
DEFAULT_LINES = 26
def create(self):
... |
interactive.py | import asyncio
import logging
import os
import tempfile
import textwrap
import uuid
from functools import partial
from multiprocessing import Process
from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union, Set
import numpy as np
from aiohttp import ClientError
from colorclass import Color
from rasa... |
ConnectionHandler.py | import socket
import threading
import logging
import json
import sys
import time
from PyQt5 import QtWidgets, QtCore, QtGui
from . import SocketMsgHandler
from Utils.PopUpWindow import PopUpWindow
from Application.GameWindow import GameWindow
class ConnectionHandler(QtCore.QObject):
room_created_signal = QtCore.p... |
lib_track.py | """ PTC-Sim's collection of railroad component classes, including the track,
locomotives, base stations, etc., and the Track Simulator
Author: Dustin Fast, 2018
"""
import Queue
import multiprocessing
from time import sleep
from json import loads
from threading import Thread
from datetime import datetime
fro... |
analyser_controller.py | # -*- coding: utf-8 -*-
'''
This module controls the fetcher and analyser. It also starts
a thread that monitors the memory usage in the analyser process.
'''
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import threading
import multiprocessing
import Qu... |
abc.py | # -*- coding: utf-8 -*-
import FXR
from FXR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re
#kk = FXR.LINE()
#kk.login(qr=True)
#kk.loginResult()
cl = FXR.LINE()
cl.login(token="EmJP3cTCBBbxHq0PFdBb.TOwfr+vlbbebmmu/8etFgW.Tzn0ZFqDvUXD/jWhM/c/CgsPuaiV1kssQy... |
__init__.py | """
Yay! It's NOT IDA!!!1!!1!one!
"""
import os
import re
import sys
import time
import string
import hashlib
import logging
import binascii
import itertools
import traceback
import threading
import contextlib
import collections
try:
import Queue
except ModuleNotFoundError:
import queue as Queue
# The en... |
test_fx.py | # Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import io
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
import torch.nn.utils._stateless as _... |
test_vizdoom_multiplayer.py | import time
import unittest
from multiprocessing import Process
from unittest import TestCase
from multi_sample_factory.envs.env_utils import vizdoom_available
from multi_sample_factory.utils.utils import log, AttrDict
@unittest.skipUnless(vizdoom_available(), 'Please install VizDoom to run a full test suite')
class... |
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... |
bhpnet.py | import sys
import socket
import getopt
from threading import Thread
import subprocess
# define some global variables
LISTEN = False
COMMAND_SHELL = False
UPLOAD = False
EXECUTE = ""
TARGET = "" # localhost
UPLOAD_DEST = ""
PORT = 0
def run_command(command):
# run the command and ... |
gather.py | import os
import sys
import PySpin
from absl import app
from absl import flags
import numpy as np
import cv2
import time
from os import mkdir
from os.path import isdir, exists
import threading
import queue
import logging
import boto3
from botocore.exceptions import ClientError
from dataclasses import dataclass
WINDOW_... |
web.py | # Electrum ABC - lightweight eCash client
# Copyright (C) 2020 The Electrum ABC developers
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 restr... |
Transport.py | import os
import RNS
import time
import math
import struct
import threading
import traceback
from time import sleep
from .vendor import umsgpack as umsgpack
class Transport:
"""
Through static methods of this class you can interact with the
Transport system of Reticulum.
"""
# Constants
BROADCA... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
colorrise.py | #!/usr/bin/python
# Color-Rise
# (C) 2016 Mike Estee, MIT License
import time
from colour import Color
from flask import Flask, render_template, request
import threading
# https://github.com/jgarff/rpi_ws281x
import _rpi_ws281x as ws
import neopixel
# https://api.forecast.io/forecast/57fe5197b6b5632dbe542ff8c1cae6ba... |
parallel.py | # coding: utf-8
"""
brownie.tests.parallel
~~~~~~~~~~~~~~~~~~~~~~
Tests for :mod:`brownie.parallel`.
:copyright: 2010 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
from __future__ import with_statement
import time
from threading import Thread
from attest import Tests, Assert,... |
sync.py | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... |
dispatcher.py | from __future__ import unicode_literals
import subprocess
import time
import sys
import datetime
try:
import queue as queue
except ImportError:
import Queue as queue
from functools import partial
from random import shuffle, seed
import multiprocessing as mp
import threading
import os
import re
MAX_PARALLEL_JOBS = ... |
CKCrawler.py | from bs4 import BeautifulSoup as bs
from urllib.request import urlopen
from urllib.request import Request
import threading
import webbrowser
from collections import OrderedDict
class CKCrawler(object):
def __init__(self, tid, keywod, p1, p2):
homeData = self.getpageData(tid, 1)
lastPage = int(home... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import const... |
surface.py | """
@ Author : Jimeng Shi
@ Date : 1/23/2021
@ FileName : surface.py
"""
import tkinter as tk
from tkinter.filedialog import *
from tkinter import ttk
import predict
import cv2
from PIL import Image, ImageTk
import threading
import time
class Surface(ttk.Frame):
pic_path = " "
view_high = 600
view_wide = ... |
dark0vh.proxy.py | import urllib.request
import re
import random
from bs4 import BeautifulSoup
import threading
# dichiarazione della lista degli useragents per evitare che il sito ci blocchi per le numerose richieste
useragents=["AdsBot-Google ( http://www.google.com/adsbot.html)",
"Avant Browser/1.2.789rel1 (http://www.avantbrowser... |
test_index_remote.py | import multiprocessing as mp
import os
import time
import unittest
import numpy as np
from jina.drivers.helper import array2pb
from jina.enums import FlowOptimizeLevel
from jina.executors.indexers.vector.numpy import NumpyIndexer
from jina.flow import Flow
from jina.main.parser import set_gateway_parser
from jina.peap... |
loop.py | import time
from musket_core.kaggle_train_runner.kernel import Project, Kernel, KERNEL_STATUS_UNKNOWN, KERNEL_STATUS_CANCELED, KERNEL_STATUS_COMPLETE, KERNEL_STATUS_ERROR, KERNEL_STATUS_NOINTERNET, KERNEL_STATUS_RUNNING
from musket_core.kaggle_train_runner import connection
import threading
from async_promises impo... |
api_image_test.py | import contextlib
import json
import shutil
import socket
import tarfile
import tempfile
import threading
import pytest
from http.server import SimpleHTTPRequestHandler
import socketserver
import docker
from ..helpers import requires_api_version, requires_experimental
from .base import BaseAPIIntegrationTest, TEST_... |
controller.py | #! /usr/bin/env python3
import os
import re
import time
import json
import logging
import pickle
import threading
import requests
from argparse import ArgumentParser
from configparser import ConfigParser
from pathlib import Path
from tempfile import NamedTemporaryFile
from cs import read_config, CloudStack
import cat... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2021 The Vivuscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test vivuscoind shutdown."""
from test_framework.test_fr... |
subscribe_client.py | import ssl
import threading
import time
import websocket # pip3 install websocket_client
websocket.enableTrace(True)
def on_wss_msg(evt):
print(evt)
class SubscribeClient(websocket.WebSocketApp):
def __init__(self, url, on_wss_open, on_wss_msg):
self.url = url
self.reconnect_intv_sec = 60... |
start.py | # -*- coding:utf-8 -*-
import gevent
from gevent import monkey
monkey.patch_all()
import os
from settings import DAYS_DICT, avoid_experts_db, LOTTERY_DICT_2, DATA_FILE, \
miss_urls_db, SETUP_FILE, BASE_DIR, saved_db, REAL, SETUP_TEMPLATE
os.chdir(BASE_DIR)
import signal
from multiprocessing import Process
from ... |
rspet_client.py | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
"""rspet_client.py: RSPET's Client-side script."""
from __future__ import print_function
from sys import exit as sysexit, argv
from time import sleep
from subprocess import Popen, PIPE
from multiprocessing import Process, freeze_support
from socket import socket, IPPROTO_U... |
service.py | import asyncio
import itertools
import threading
import time
import rclpy
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import SingleThreadedExecutor
from rclpy.node import Node
from std_srvs.srv import SetBool
import asyncx
import asyncx_ros2
_thread = asyncx.EventLoopThread()
SERVIC... |
honeypot.I.py | #!/usr/bin/env python
#
# This script is an experimental honeypot.
#
# Liang Wang @ Dept. Computer Science, University of Helsinki, Finland
# 2011.10.03
#
import os
import sys
import socket
import pickle
import time
import threading
import resource
from honeypot_bt import *
from khash import *
from bencode import be... |
utils.py | # coding=utf-8
"""Shared utility functions"""
import argparse
import collections
import functools
import glob
import inspect
import itertools
import os
import re
import subprocess
import sys
import threading
import unicodedata
from enum import (
Enum,
)
from typing import (
IO,
TYPE_CHECKING,
Any,
... |
main.py | from kivy.app import App
import config
import datetime
import time
import threading
import pprint
from operator import itemgetter
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from kivy.storage.jsonstore import JsonStore
from kivy.uix.button import Button
from kivy.uix.widget imp... |
main.py | # -*- coding: utf-8 -*-
import datetime
import socket
import logging
import os
import pprint # noqa
import string
import threading
import time
from pytg.utils import coroutine
from pytg.receiver import Receiver
from pytg.sender import Sender
from pytg.exceptions import ConnectionError
from storage import Storage
... |
fuzzer.py | # Copyright (C) 2016-present the asyncpg authors and contributors
# <see AUTHORS file>
#
# This module is part of asyncpg and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
import asyncio
import socket
import threading
import typing
from asyncpg import cluster
class StopServ... |
images.py | ##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is avai... |
discretization.py | # Copyright (c) 2011-2016 by California Institute of Technology
# Copyright (c) 2016 by The Regents of the University of Michigan
# 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. Redistrib... |
test_base.py | # Copyright 2014 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
TCP_Server.py | import os
import sys
import logging
import socket as sock
import threading as thrd
import socketserver
import json
import ujson
import datetime as dt
import json
from enum import Enum
#import yaml
import dill
import Redis_DB_Controller as rsdb
from DB.RedisDB_Test_Client import DbNumberSelector
class ForkedTCPServer(... |
display.py | """Simple display library for check-your-pulse."""
# Standard Python Libraries
import itertools
import os
import shutil
import sys
import threading
import time
class Color:
"""Provide us with a means of making colored text."""
@staticmethod
def _red(line: str) -> str:
return f"\x1b[1;31m{line}\x... |
image-builder.py | #!/usr/bin/python3
import os
import sys
import re
import yaml
import threading
#################################
# Util
#################################
class ThreadPool:
def __init__(self):
self._threads = []
def add_thread(self, proc):
thrd = threading.Thread(target=pro... |
plot_pil.py | # coding=utf-8
import threading
import numpy as np
import os
import time
import imageio
import errno
from PIL import Image, ImageDraw, ImageFont
axial_to_pixel_mat = np.array([[3 / 2., 0], [np.sqrt(3) / 2.0, np.sqrt(3)]])
# Circles in 24x24 bounding boxes
CIRCLE_BOUNDING = np.array([24, 24])
# Circles 24 apart
CIRC... |
Orchestrator.py | import threading
import matplotlib.pyplot as plt
from base.DAG import DAG
from base.CAC import DAG_C
import time
import random
startTime = 0
def getTime():
global startTime
if startTime == 0:
startTime = time.time()
timeNow = time.time()
time_ = timeNow - startTime
return int(time_)
... |
video_stream.py | from .face_capture import deep_convert
import cv2
import numpy as np
import json
import requests
import threading
import queue
que = queue.Queue()
def storeInQueue(f):
def wrapper(*args):
que.put(f(*args))
return wrapper
@storeInQueue
def get_tf_response(config, roi, model_mode):
max_idx = 5
max_percentag... |
experiment.py | from abc import ABC, abstractmethod
import logging
import os
import signal
import threading
from catkit import datalogging
from catkit.multiprocessing import DEFAULT_TIMEOUT, EXCEPTION_SERVER_ADDRESS, Process, SharedMemoryManager
from catkit.util import raise_signal
STOP_EVENT = "catkit_stop_event"
FINISH_EVENT = "ca... |
__init__.py | # -*- coding: utf-8 -*-
"""JIRA utils used internally."""
import threading
from jira.resilientsession import raise_on_error
class CaseInsensitiveDict(dict):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``collections.MutableMapping`` as well as dict's ``copy``. Also... |
email.py | #!/usr/bin/env python3
# encoding: utf-8
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = curren... |
model_v2.py | # -*- coding: utf-8 -*-
"""Model V2.0.ipynb
Written by : Aditya, Nikhil
"""
###################### Importing Libraries ###################################
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
from tqdm import tqdm
import time
import tensorflow as tf
from tensorflow.keras.models import... |
test_s3boto3.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import threading
from datetime import datetime
from unittest import skipIf
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.files.base import ContentFile
from django.test import TestCase
from djang... |
base_test.py | # Copyright 2013-2020 Barefoot Networks, Inc.
# Copyright 2020-2021 Open Networking Foundation
# Copyright 2021-present Princeton University
#
# 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
#
... |
helpers.py | """
This file contains various helpers and basic variables for the test suite.
Defining them here rather than in conftest.py avoids issues with circular imports
between test/conftest.py and test/backend/<backend>/conftest.py files.
"""
import functools
import logging
import multiprocessing
import os
import subprocess... |
test_callbacks.py | import os
import multiprocessing
import numpy as np
import pytest
from csv import reader
from csv import Sniffer
import shutil
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Dropout, add
from kera... |
system_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
__init__.py | import os
import pathlib
import subprocess
from pathlib import Path
from queue import Queue
from threading import Thread
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from uvicorn import Config, Server
from jina import __version__, __resources_path__
from jina.logging.logger import Ji... |
sampler.py | """
Samplers to measure durations and garbage collection.
You instantiate a sampler with an ``ObservationBucket`` where sampled time
series get buffered. The bucket (memory buffer) is thread-safe and gets
automatically flushed to secondary storage when it fills up.
"""
import gc
from resource import getrusage, RUSAGE_... |
thread-key-gen.py | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in RSA and DSA key generation. 0.12 and
# older held the GIL during these operations. Subsequent versions release it
# during them.
from threading import Thread
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, PKe... |
run_benchmark.py | # Helper class to run tasks in multiple processes
import os
import subprocess
import shutil
import random
import argparse
import sys
from threading import Thread
from queue import Queue
# Simple task queue
class ShellTaskQueue(Queue):
def __init__(self, nWorkers=1, timeout=99999999999):
Queue.__init__(... |
portable_runner.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
PyAutoWp.py | import main
import check
from threading import Thread
check.windowCheck()
while True:
a = main.wcbo("Please choose an option:\n1-I will send my message to many people.\n2-I will send my message to 1 person.", "1 or 2: ", ["1","2"])
if a == "1":
phoneNumberData = check.phoneListCheck()
phoneNumberData = main.con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.