source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
ArnoldRenderTest.py | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
websocket_client.py | # gdax/WebsocketClient.py
# original author: Daniel Paquin
# mongo "support" added by Drew Rice
#
#
# Template object to receive messages from the gdax Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thread
from websocket impor... |
bm_fannkuch.py | """
The Computer Language Benchmarks Game
http://benchmarksgame.alioth.debian.org/
Contributed by Sokolov Yura, modified by Tupteq.
"""
import pyperf
import multiprocessing as mp
from mpkmemalloc import *
import os
import gc
import threading
import psutil
from six.moves import xrange
DEFAULT_ARG = 9
def fannkuch(... |
app.py | from flask import Flask
from flask import request
from flask import jsonify
from flask import url_for
from flask import redirect
import json
from datetime import datetime
import pika
import uuid
import docker
import time
import threading
import shlex
import subprocess
from kazoo.client import KazooClient, KazooState
... |
main.py | import inspect
import os.path
import json
import logging
from threading import Thread
from telegram.ext import CommandHandler, Updater
from tweepy import API, AppAuthHandler
from itcuabot.Database import Database
from itcuabot.EpicBot import EpicBot
class ConfigError:
def __init__(self):
pass
class Ap... |
rosbridge.py | import websocket
import threading
import json
import traceback
import time
import string
import random
class RosbridgeSetup():
def __init__(self, host, port):
self.callbacks = {}
self.service_callbacks = {}
self.resp = None
self.connection = RosbridgeWSConnection(host, port)
... |
devtools_browser.py | # Copyright 2017 Google Inc. All rights reserved.
# Use of this source code is governed by the Apache 2.0 license that can be
# found in the LICENSE file.
"""Base class support for browsers that speak the dev tools protocol"""
import glob
import gzip
import logging
import os
import re
import shutil
import subprocess
im... |
Zawody_nurkowe.py | import cv2
import numpy as np
import imutils
import threading
from threading import Lock
import math
import msvcrt
import os
import sqlite3
from datetime import datetime
import time
orangeLower = (0, 75, 0)
orangeUpper = (60, 255, 255)
class Camera:
last_frame = None
last_ready = None
lock = Lock()
d... |
SimpleLoggerSubscriber.py | from dppy.behavioral import pubsub
from multiprocessing import Process, SimpleQueue
def worker(q):
import logging
import logging.config
from ..configs.logging import d
logging.config.dictConfig(d)
logger = logging.getLogger('stream')
while True:
if not q.empty():
o = q.get(... |
main.py | from turtle import color
import requests
import os
import time
import random
import threading
import string
import colorama
import console
from console.utils import set_title
proxies = set()
with open("proxies.txt", "r") as f1:
fl1 = f1.readlines()
for line in fl1:
proxies.add(line.strip... |
train_mftcn.py | import matplotlib
matplotlib.use('Agg')
import os
import argparse
import torch
import numpy as np
import pickle
import sys
sys.path.append('./utils')
from torch import optim
from torch import nn
from torch import multiprocessing
from torch.optim import lr_scheduler
from torch.autograd import Variable
from torch.utils.... |
base.py | # -*- coding: utf-8 -*-
import os
import sys
import threading
import time
sys.path.append(os.path.join(os.getcwd(), "Lib"))
from Lib.OCC import BRepPrimAPI
from Lib.aocxchange import step_ocaf
from Lib.OCC.gp import gp_Pnt
from agent import Agent
def __createBlock__(color, step_exporter, position):
agent_box_shap... |
buildo.py | #!/usr/bin/env python3
import shutil
import glob
import argparse
import sys
import os
import os.path
import time
import subprocess
import threading
from concurrent.futures import ThreadPoolExecutor
from ilmklib import Graph, makedeps, WorkQueue, TimestampDict
def ts_directory(dirname):
if os.path.exists(dirname... |
test_binding.py | #!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, 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... |
WebServer.py | import os
import io
import re
import sys
import gzip
import glob
import time
import json
import base64
import urllib
import socket
import datetime
import traceback
import threading
import functools
from qrcode import QRCode
from io import StringIO
from urllib.parse import quote, urlparse, parse_qs
from cgi import pars... |
test_multiprocess.py | import sys
import platform
import multiprocessing
import pytest
import keyring
def subprocess_get():
keyring.get_password('test_app', 'test_user')
pytestmark = [
pytest.mark.xfail(
platform.system() == 'Linux',
reason="#410: keyring discovery fails intermittently",
),
]
def test_mult... |
exposition.py | #!/usr/bin/python
from __future__ import unicode_literals
import base64
import os
import socket
import sys
import threading
from contextlib import closing
from wsgiref.simple_server import make_server, WSGIRequestHandler
from . import core
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
fr... |
SquidWorms.py | import paramiko, os, socket, threading, sys, time
print("""
_____ _ _ __ __ __ ___
/ ____| (_) | | \ \ / / /_ | / _ \
| (___ __ _ _ _ _ __| |_____\ \ /\ / /__ _ __ _ __ ___ | || | | |
\___ \ / _` | | | |... |
yangCatalogApi.py | # Copyright The IETF Trust 2019, All Rights Reserved
# Copyright 2018 Cisco and its affiliates
#
# 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... |
test_mainwindow.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
# -----------------------------------------------------------------------------
"""
Te... |
plugin.py | import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum_rubycoin.rubycoin import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_bc_address, EncodeBase58Check,
TYPE_ADDRESS... |
observable_test.py | from termpixels.observable import Observable, poll_events, Event
import threading
import pytest
def test_observable_listen_emit():
o = Observable()
def listener():
raise Exception("fired")
o.listen("test", listener)
with pytest.raises(Exception, match="fired"):
o.emit("test")
p... |
datamanager.py | # -*- coding: utf-8 -*-
import argparse
import logging
import os
from datetime import datetime
from multiprocessing import Process
import pandas as pd
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from fooltrader import settings
from fooltrader.api import event
from ... |
utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import queue
import threading
import cv2
import numpy as np
import pickle
import zipfile
import json
from collections import defaultdict
import re
# special tokens
PAD = "#000#" # Hack, to make padding token at index 0 after sorting.
UNK = "#UNK#"
START = "#ST... |
game_screen_monitor.py | import threading
import win32gui, win32ui, win32con
from PIL import Image
from time import sleep
class GameScreenMonitor():
GAME_SCREEN_FILE = "game_screen.png"
interval = 3.0
def __init__(self, title, callback = None):
self.title = title
self.callback = callback
threading.Thread(... |
test_http.py | # -*- encoding: utf-8 -*-
import collections
import email.parser
import platform
import threading
import time
import pytest
from ddtrace import compat
from ddtrace.vendor import six
from ddtrace.vendor.six.moves import BaseHTTPServer
from ddtrace.vendor.six.moves import http_client
from ddtrace.vendor.six.moves.urlli... |
RpcServer.py | #-------------------------------------------------------------------------------
# Name: RpcServer
# Purpose:
#
# Author: Todd Hay
# Email: Todd.Hay@noaa.gov
#
# Created: Oct 23, 2014
# License: New BSD
#-------------------------------------------------------------------------------
from sock... |
subprocess_ctl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
subprocess を使って exe ファイルと通信する。
"""
# import libraries
import os
from subprocess import Popen, PIPE
from threading import Thread
import time
# define
STDOUT_THREAD_TIMEOUT_SEC = 1.0
def print_stdout(proc):
while True:
line = proc.stdout.readline()
... |
index.py | ''' Tornado Web Server Starting Script - Application Entry Point '''
from threading import Thread
from aiocron import crontab
from biothings.web.launcher import main
from discovery.handlers import HANDLERS, TemplateHandler
from discovery.notify import update_n3c_routine
from discovery.utils.backup import daily_backu... |
robot.py | import socket
import subprocess
import time
from threading import Thread
from IPython.core.debugger import Tracer
class robotstatus(object):
def __init__(self):
super(robotstatus,self).__init__()
self.power = False #false for off
self.running = False #servo motor running
self.moving = Fa... |
shallow_backup.py | # shallow_backup
# alichtman
import os
from os.path import expanduser
import sys
import glob
import shutil
import configparser
import subprocess as sp
import multiprocessing as mp
import click
import inquirer
from colorama import Fore, Style
from pprint import pprint
from constants import Constants
def print_versi... |
lambda_executors.py | import base64
import contextlib
import dataclasses
import glob
import json
import logging
import os
import re
import shlex
import subprocess
import sys
import tempfile
import threading
import time
import traceback
import uuid
from multiprocessing import Process, Queue
from typing import Any, Callable, Dict, List, Optio... |
mturk_manager.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import math
import os
import pickle
import threading
import time
import uuid
import errno
import requests... |
test_creator.py | from __future__ import absolute_import, unicode_literals
import difflib
import gc
import logging
import os
import shutil
import stat
import subprocess
import sys
from itertools import product
from stat import S_IREAD, S_IRGRP, S_IROTH
from textwrap import dedent
from threading import Thread
import pytest
from virtua... |
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... |
ansiblelaunchserver.py | # Copyright 2014 OpenStack 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 agreed to in... |
multiplexer.py | from __future__ import absolute_import
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # Python 3.x
STOP = object()
class Multiplexer(object):
"""
Create a single iterator from several iterators by running all of them in
para... |
eventscheduler.py | from datetime import datetime, timedelta
import sched
import calendar
import time
import threading
from plugins.pasteImporter import PasteImporter
from invoker import ReplyObject, Command
class EventScheduler:
"""Scheduler to run a set of PS commands at a
specific date and time. It will run once per week
... |
coordinator_test.py | """Tests for Coordinator."""
import sys
import threading
import time
import tensorflow.python.platform
import tensorflow as tf
def StopInN(coord, n_secs):
time.sleep(n_secs)
coord.request_stop()
def RaiseInN(coord, n_secs, ex, report_exception):
try:
time.sleep(n_secs)
raise ex
except RuntimeError... |
streaming.py | import re
import time
import copy
import threading
import codecs
import tweepy
from tweepy.api import API
# Special Exceptions
from requests.exceptions import Timeout
from requests.exceptions import ConnectionError
from requests.packages.urllib3.exceptions import ReadTimeoutError
def getTracker(coins):
tracker ... |
dataset.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import multiprocessing
from functools import partial
import numpy as np
import sys
import json
import concurrent.futures
from torch.multiprocessing import Manager, Process, Queue
from diff_representation.asdl.transition_system.hypothesis import... |
test_server.py | import os
import time
import unittest
from hashlib import sha256
from threading import Thread
from src.server import SurfstoreServer
LEADER_ELECTION_TIMEOUT = 2
LOG_REPLICATION_TIMEOUT = 0.02
BLOCK_TIMEOUT = 10 # how long consider block
def start_server(servers, index):
servers[index].proxies = {k: v for k, v ... |
weatherstation.py | # coding=utf-8
"""gui for weatherstation"""
import os
import datetime
import threading
import kivy.app
import kivy.uix.screenmanager
import kivy.core.window
import kivy.clock
import kivy.logger
from kivy.properties import ObjectProperty, StringProperty
from weatherstation.misc import utils, fileringlist
from weather... |
test_multiprocess.py | import sys
import platform
import multiprocessing
import pytest
import keyring
def subprocess_get():
keyring.get_password('test_app', 'test_user')
pytestmark = pytest.mark.xfail(
platform.system() == 'Linux', reason="#410: keyring discovery fails intermittently"
)
def test_multiprocess_get():
proc1 ... |
simulation.py | import os
import time
from multiprocessing import Process
from typing import Tuple
from collections import OrderedDict
import flwr as fl
import numpy as np
from flwr.server.strategy import FedAvg
import torch
import dataset
from SimpleNet import SimpleNet
DEVICE = torch.device("cuda:0" if torch.cuda.is_available() el... |
bgperf2.py | #!/usr/bin/env python3
#
# Copyright (C) 2015, 2016 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... |
user_info_download.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sqlite3 # 数据库
import gc
import urllib3
import multiprocessing # 多线程模块
import threading # 多线程模块
import ssl
import re # 正则表达式
from time import time
from queue import Queue
from bs4 import BeautifulSoup
from luogu import LuoguBrowser
"""
重构洛谷用户数据爬取
多进程爬虫 + 数据库存储 +... |
CrawlAction.py | import uuid
import scrapy
import random
from abc import abstractmethod
import scrapy.crawler as crawler
from .CrawlData import CrawlData
from twisted.internet import reactor
from scrapy.spiders import CrawlSpider
from .exceptions import SpiderException
from ..kernel.agent.Action import Action
from multiprocessing impor... |
relay_worker.py | import time
import datetime
import json
import redis
import threading
import sys
import RPi.GPIO as GPIO
sys.path.append('..')
import variables
#r = redis.Redis(host='127.0.0.1', port=6379)
GPIO.setmode(GPIO.BCM)
# ToDO Update relay to make a key if one is not set in config
class RelayWorker():
def __init__(self, ... |
base.py | import argparse
import base64
import copy
import inspect
import json
import multiprocessing
import os
import sys
import threading
import time
import uuid
import warnings
from collections import OrderedDict
from contextlib import ExitStack
from typing import (
TYPE_CHECKING,
Dict,
List,
Optional,
Set... |
RemoteSwingLibrary.py | # Copyright 2014 Nokia Solutions and Networks
#
# 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... |
ClientImportSubscriptions.py | import os
import random
import threading
import time
import typing
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlobals as HG
from hydrus.core import HydrusSerialisable
from hydrus.core import HydrusThreading
fr... |
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... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
run.py |
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University
# ServerlessBench is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/M... |
status_led_node.py | #!/usr/bin/env python
#################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 ... |
widget.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py.
"""
import datetime
import sys
import cStringIO
import time
import threa... |
app.py | from flask import Flask, render_template, request
import queue
import logging
import requests
import threading
from datetime import datetime
from signal import signal, SIGINT
app = Flask(__name__)
wsgi_app = app.wsgi_app
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
q = queue.Queue()
def shutdown... |
KahootFlooder.py | from time import sleep
from threading import Thread
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
numberOfBots = 25
baseName = 'Bot'
gamePin = '635746'
delayBeforeLeaving = 20
delayBetweenActions = 2.5
def createBot(pin, name):
options = Options()
options.add_argument(... |
eperf.py | import sys
import time
import json
import os
import gzip
import copy
import threading
from multiprocessing import Process
from functools import wraps
from TestInput import TestInputSingleton
from lib.membase.performance.stats import CallbackStatsCollector
from lib.membase.api.rest_client import RestConnection
from lib... |
multi_wcs.py | # -*- mode: python; coding: utf-8 -*-
# Copyright 2020-2021 the AAS WorldWide Telescope project
# Licensed under the MIT License.
"""
Generate tiles from a collection of images with associated WCS coordinate
systems.
This module has the following Python package dependencies:
- astropy
- reproject
- shapely (to optim... |
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... |
main.py | import argparse
import queue
import threading
from pathlib import Path
import cv2
import depthai
import numpy as np
from imutils.video import FPS
from math import cos, sin
parser = argparse.ArgumentParser()
parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent debug output")
parser.add_argument... |
srx.py | import logging
import Queue
import threading
from xml.sax.saxutils import escape
from xml.parsers import expat
import rdflib
from humfrey.sparql.results import Result
from .base import StreamingParser, StreamingSerializer
logger = logging.getLogger(__name__)
class SRXParser(StreamingParser):
class SRXContentHan... |
test_agent.py | import logging
import socket
import time
from unittest.mock import MagicMock
import pendulum
import pytest
from prefect.agent import Agent
from prefect.engine.state import Scheduled, Failed, Submitted
from prefect.utilities.configuration import set_temporary_config
from prefect.utilities.exceptions import Authorizati... |
run_accuracy_exp_tkde.py | import socket
from exec_utilities import time_out_util
from config import *
from exec_utilities.exec_utils import *
from multiprocessing import Process
def run_exp(env_tag=lccpu12_tag, with_c_group=True):
hostname = socket.gethostname()
with open('config.json') as ifs:
my_config_dict = json.load(ifs... |
bmv2.py | # coding=utf-8
"""
Copyright 2019-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 la... |
test_buffer_client.py | # Copyright 2019 Open Source Robotics Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... |
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... |
TCPBomb.py | import requests,time,socket,random,threading,os,sys
from datetime import datetime
sl = 0
global op
global port
global url
url = ""
port = 80
threads = 0
version = float(1.9)
currentversion = requests.get('https://raw.githubusercontent.com/Dr4k0D3v/TCPBomb/main/version')
currentversion = float(currentvers... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner v2.7 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
from multiprocessing import L... |
postprocess.py | import time, threading, queue
import logging
def enqueue(processor, *args):
# logging.debug("queueing %s with %s", processor, args)
_task_queue.put( (processor, args) )
def _process_queue(queue):
while True:
processor, args = queue.get()
logging.debug("calling %s with %d arguments: %s", processor, len(args), ... |
test_partition_20.py | import threading
import pytest
from base.partition_wrapper import ApiPartitionWrapper
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from common.code_mapping import PartitionErrorMessage
prefix = ... |
robot.py | import websocket
import threading
import time
import sys
import random
import json
from message.Message import PackArgument
from message.Message import initPack
from message.Message import unPacketMesage
def enum(**enums):
return type('Enum', (), enums)
Numbers = enum( INIT=1, CONNECT=2, LOGIN=3,ENTERROOM=4,CLOSE=... |
Segmentation.py | import numpy as np
import pandas as pd
from multiprocessing import Process, Queue, current_process, freeze_support, cpu_count
from NW import NW
from DTW import DTW
from utils import *
class Segmentation(object):
def __init__(self, executor, cpu = 0):
self.mode = type(executor).__name__
self.ex... |
gallery_selector.py | #!/bin/python3
import threading
import rospy
import std_msgs.msg as std_msg
import numpy as np
import math
from datetime import datetime
import time
def min_dis(angles, angle):
distances = (angles - angle + 2 * math.pi) % (2 * math.pi)
distances[distances > math.pi] = 2 * \
math.pi - distances[distanc... |
progress_pipe.py | import time
from multiprocessing import Pipe, Process
def product(pipe):
pipe.send('send product')
def consume(pipe):
time.sleep(2)
print(pipe.recv())
def fe(a):
print('result', a)
# pipe 实现进程间通信
# pipe性能高于queue
if __name__ == "__main__":
# 仅仅适用于两个进程间的通信
rece, send = Pipe()
p = Pr... |
collect_from_malmo.py | # Village People, 2017
from pig_chase.common import ENV_ACTIONS
from pig_chase.agent import PigChaseChallengeAgent
from pig_chase.common import ENV_AGENT_NAMES
from pig_chase.environment import PigChaseEnvironment, \
PigChaseSymbolicStateBuilder
from env.VillagePeopleBuilders import PigChaseVillagePeopleBuilder18... |
test_memory.py | import ctypes
import gc
import pickle
import threading
import unittest
import fastrlock
import pytest
import cupy.cuda
from cupy.cuda import device
from cupy.cuda import memory
from cupy.cuda import runtime
from cupy.cuda import stream as stream_module
from cupy import testing
class MockMemory(memory.Memory):
c... |
MultiThreading.py | from threading import Thread
import cv2
import HandTracking as ht
import pyvirtualcam
from PySide2.QtCore import QThread
import numpy as np
from Whiteboard import WhiteBoard,Signals
import time
class MainThread(QThread):
def __init__(self):
# Run all threads and initialize all classes
... |
test_fft.py | import functools
import numpy as np
import pytest
import cupy
from cupy.fft import config
from cupy.fft._fft import (_default_fft_func, _fft, _fftn,
_size_last_transform_axis)
from cupy import testing
from cupy.testing._helper import _wraps_partial
@pytest.fixture
def skip_forward_backwar... |
routes.py | from . import users_blueprint
from flask import render_template, flash, abort, request, current_app, redirect, url_for
from .forms import RegistrationForm, LoginForm, EmailForm, PasswordForm
from project.models import User
from project import database, mail
from sqlalchemy.exc import IntegrityError
from flask imp... |
__init__.py | import re
import argparse
from ..gateware.clockgen import *
__all__ = ["GlasgowAppletError", "GlasgowApplet", "GlasgowAppletTool"]
class GlasgowAppletError(Exception):
"""An exception raised when an applet encounters an error."""
class GlasgowApplet:
all_applets = {}
def __init_subclass__(cls, name,... |
videoManager.py | import threading
import cv2
import os
import copy
import queue
from utils import faceManager
from utils import fileManager
import threading
import ffmpeg
import sys
class videoManager:
def __init__(self):
self.fm = faceManager.faceManager()
self.status_queue = queue.Queue()
s... |
d1r5.py | print("""
/$$$$$$$ /$$ /$$$$$$$
| $$__ $$ /$$$$ | $$____/
| $$ \ $$|_ $$ /$$$$$$ | $$
| $$ | $$ | $$ /$$__ $$| $$$$$$$
| $$ | $$ | $$ | $$ \__/|_____ $$
| $$ | $$ | $$ | $$ /$$ \ $$
| $$$$$$$/ /$$$$$$| $$ | $$$$$$/
|_______/ |______/|__/ \______/... |
test_concurrent_futures.py | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant error
# message: "No module n... |
CGViewAdvancedServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
views.py |
import os
import json
import random
import sqlite3
import time
from datetime import datetime, timedelta
from multiprocessing import Process
from urllib.parse import quote, unquote
from django.core.mail import send_mail
from django.core import serializers
from django.http import HttpResponse
from django.template.loade... |
controlGUI.py | #! /usr/bin/python3
'''
This file contains GUI code for Controlling PiMecha
Developed by - SB Components
http://sb-components.co.uk
'''
import pimecha
import logging
import meter
import os
import threading
import shutil
import subprocess
import time
import re
import picamera
import tempfile
from tkinter import font
i... |
sysdig_handling.py | from contextlib import contextmanager
import subprocess
import collections
import threading
import time
import psutil
IN_DOCKER = False
class SysdigHandling:
"""
on initiation:
start two threads for reading syscalls
first reads syscalls with sysdig and writes them to deque
wi... |
__init__.py | import logging
import os
import queue
import threading
from distutils.version import LooseVersion
from typing import Any, Dict
from ludwig.callbacks import Callback
from ludwig.constants import TRAINER
from ludwig.data.dataset.base import Dataset
from ludwig.globals import MODEL_HYPERPARAMETERS_FILE_NAME, TRAIN_SET_ME... |
device_details_fetch.py | """
Module device_details
"""
# Library Import
import urllib#.request
import json
import logging
# Module Import
import memory
import threading
from netaddr import *
class fetchDeviceDetails:
def __init__(self, option="ieee"):
"""
Init
"""
self.target_oui_database = option
def... |
threading.py | import threading
from queue import Queue
import time
print_lock = threading.Lock()
def exempleJob(worker):
time.sleep(0.5)
with print_lock:
print(threading.current_thread().name, worker)
def threader():
while True:
worker=q.get()
exempleJob(worker)
q.task_done()
q... |
run.py | '''
Requirements:
Python: 3.6, 3.7, 3.8
Instructions:
To begin the program call in cmd:
python -m VisualGraphTheory
Feel free to manipulate the algorithms
used in the algorithm.py module.
Controls:
General Controls:
Scroll using the Middle Mouse Wheel to
change mod... |
xresconv_cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import platform
# ==================================================================================
import threading
import xml.etree.ElementTree as ET
from multiprocessing import cpu_count
from argparse import ArgumentParser
from subproces... |
manager.py | from dataclasses import dataclass
import logging
import threading
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element
from chiapos import DiskProver
from ... |
api.py | import asyncio
import concurrent.futures
import json
import os
from asgiref.sync import sync_to_async, async_to_sync
import boto3
import random
import threading
import EOSS
from django.conf import settings
from EOSS.models import EOSSContext
from EOSS.graphql.api import GraphqlClient
from EOSS.aws.utils import get_b... |
test_gateway.py | import functools
import time
from threading import Thread
import numpy as np
import pytest
from jina import Document
from jina.enums import CompressAlgo
from jina import Flow
from tests import random_docs
@pytest.mark.parametrize('compress_algo', list(CompressAlgo))
def test_compression(compress_algo, mocker):
... |
coqtail.py | # -*- coding: utf8 -*-
# Author: Wolf Honore
"""Classes and functions for managing auxiliary panels and Coqtop interfaces."""
from __future__ import absolute_import, division, print_function
import json
import re
import socket
import threading
import time
from collections import defaultdict as ddict
from collections ... |
sendrecv.py | import sys
import threading
from mpi4py import MPI
if MPI.Query_thread() < MPI.THREAD_MULTIPLE:
sys.stderr.write("MPI does not provide enough thread support\n")
sys.exit(0)
try:
import numpy
except ImportError:
sys.stderr.write("NumPy package not available\n")
sys.exit(0)
send_msg = numpy.arange(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.