source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
viewport_engine.py | #**********************************************************************
# Copyright 2020 Advanced Micro Devices, 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.o... |
camera.py | from mini_vstreamer.api.defaults import system
from mini_vstreamer.core.config import Configurable
from mini_vstreamer.core.thread import Runnable
from threading import Thread
from time import time, sleep
import cv2
import logging
import subprocess
def open_gst_rtsp(uri, width=None, height=None, latency=2000):
""... |
flow.py | # -*- coding: UTF-8 -*-
"""
Flow:
[load config]
|
[check undone job]
/ \
/ \
(do... |
test_main.py | """Test Main methods."""
import threading
from unittest import TestCase
from unittest.mock import MagicMock, patch
from uuid import uuid4
from napps.kytos.flow_manager.exceptions import (
InvalidCommandError,
SwitchNotConnectedError,
)
from napps.kytos.flow_manager.main import FlowEntryState
from kytos.core.h... |
test_sanity_sample.py | """
Copyright (c) 2019-2020 Intel 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.0
Unless required by applicable law or agreed to in w... |
threading_test.py | from __future__ import division, print_function
from threading import Thread, Lock
import numpy as np
import scipy.linalg as la
class aa(object):
def __init__(self, i):
self.i=i
def f(self, l, myarr):
myarr[self.i]=self.i
myarr[self.i+1]=self.i
l.acquire()
print('hello ... |
httplite.py | import socket,threading,os,time,json,hashlib
log = print
global STATIC_DIR
STATIC_DIR = ''
HEADER_CONTENT_TYPE = 'Content-Type:text/html; charset=UTF-8'
class Request():
def __init__(self, orign_request, addr):
self.path = None
self.method = None
self.signature = None
self.headers = ... |
multigeneblast-3.py | #!/usr/bin/env python
## Copyright (c) 2012 Marnix H. Medema
## Department of Microbial Physiology / Groningen Bioinformatics Centre
## University of Groningen
## License: GNU General Public License v3 or later
## A copy of GNU GPL v3 should have been included in this software package in LICENSE.txt.
##Imported... |
detect_motor_test3.py | #!/usr/bin/env python
#!coding=utf-8
import rospy
import numpy as np
import PIL.Image as pilimage
from sensor_msgs.msg import CompressedImage
from sensor_msgs.msg import Image
from std_msgs.msg import Float64
from cv_bridge import CvBridge, CvBridgeError
import cv2
import time
from yolo import YOLO
from sensor_msgs.ms... |
test_device.py | import re
import threading
import unittest
import pytest
import cupy
from cupy import cuda
from cupy.cuda import runtime
from cupy import testing
class TestDeviceComparison(unittest.TestCase):
def check_eq(self, result, obj1, obj2):
if result:
assert obj1 == obj2
assert obj2 == ... |
util.py | import collections
import hashlib
import json
import os
import subprocess
import threading
import time
from typing import Callable, Dict, Any
import requests
from anyscale.sdk.anyscale_client.sdk import AnyscaleSDK
from ray_release.logger import logger
ANYSCALE_HOST = os.environ.get("ANYSCALE_HOST", "https://console... |
graph_loader.py | # Copyright 2019-2020 the ProGraML authors.
#
# Contact Chris Cummins <chrisc.101@gmail.com>.
#
# 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... |
wrappers.py | # Copyright 2017 The TensorFlow Agents Authors.
#
# 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... |
connection_panel.py | #
# Copyright (C) 2020 Adam Meily
#
# This file is subject to the terms and conditions defined in the file 'LICENSE', which is part of
# this source code package.
#
import threading
import logging
import socket
from typing import List
from kivy.uix.boxlayout import BoxLayout
from kivy.clock import Clock
f... |
gitk.py | # coding: utf-8
import os
import subprocess
import threading
import sublime
from sublime_plugin import WindowCommand
from .util import get_executable
from .cmd import GitCmd
EXECUTABLE_ERROR = ("Executable '{bin}' was not found in PATH. Current PATH:\n\n"
"{path}")
class GitGitkCommand(WindowCo... |
conftest.py | import sys
import time
import random
import logging
import pytest
import threading
from functools import wraps
import weakref
import numpy as np
import numpy.testing
from ophyd import get_cl, set_cl
logger = logging.getLogger(__name__)
_FAKE_PV_LIST = []
class FakeEpicsPV(object):
_connect_delay = (0.05, 0.1)... |
box_client.py | from __future__ import print_function
from contextlib import contextmanager
from flask import Flask, request
from multiprocessing import Process, Queue
import os
import time
import subprocess
import json
from boxsdk import OAuth2
from boxsdk import Client
import logging
from StringIO import StringIO
# Remove logging f... |
build_imagenet_data.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
conftest.py | """Fixtures for testing."""
import socketserver
import threading
import time
import pytest
import charcoal
class ThreadedUDPServer(socketserver.ThreadingMixIn, socketserver.UDPServer):
"""Mixin for handling connections asynchronsly."""
class Listener(socketserver.BaseRequestHandler):
"""Simple UDP listene... |
test_integration.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Red Hat Inc.
#
# 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... |
benchmark_send_get_multiprocess_test.py | # stdlib
import socket
import time
from typing import Any
from typing import List
# syft absolute
from syft.lib.python import List as SyList
from syft.lib.python.string import String
# syft relative
from ...syft.grid.duet.process_test import SyftTestProcess
PORT = 21211
def do_send(data: Any) -> None:
# syft a... |
2_Manual_threading.py | # 2 Using Manual threading in python
# Import Threading & Time
import threading
import time
# Start counting
start = time.perf_counter()
# Create simple function that sleep in 1 second
def do_something():
print('Sleeping 1 second..')
time.sleep(1)
print('Done Sleeping..')
# Create threading, start and... |
get_web_urls.py | from codecs import open
from googlesearch import search
import json
import threading, queue
'''
Input:
Extracted Wikimedia dump txt of articles titles and ids:
ptwiki-20210320-pages-articles-multistream-index.txt
Output: csv file with (article_id, article_title, [url1, ..., urln])
'''
def check_restrictio... |
test_compaction.py | import threading
from time import time, sleep
import pytest
from pymilvus.grpc_gen.common_pb2 import SegmentState
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 utils.util_log import test_log... |
nord_client.py | from subprocess import Popen, PIPE
from threading import Thread
import webbrowser
import re
class NordClient(object):
def __init__(self, error_cb=None):
if error_cb:
self.error_cb = error_cb
else:
self.error_cb = self._base_error
self.account_information = ""
... |
NeewerLite-Python.py | #############################################################
## NeewerLite-Python
## by Zach Glenwright
#############################################################
## > https://github.com/taburineagle/NeewerLite-Python/ <
#############################################################
## A cross-platform Python scri... |
transcribe_streaming.py | #!/usr/bin/python
# Copyright (C) 2016 Google 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 ... |
integration_test.py | import functools
import os
import re
import sys
import tempfile
import warnings
from collections.abc import Callable
from contextlib import closing
from importlib.machinery import SourceFileLoader
from pathlib import Path
from threading import _shutdown_locks
import packaging.tags
import packaging.version
import pytes... |
test_pyradur.py | # MIT License
#
# Copyright (c) 2018-2019 Garmin International or its subsidiaries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the righ... |
_server.py | # Copyright 2016 gRPC authors.
#
# 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... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
aseqdump_test.py |
import aseqdump
import threading
data = 0
Ch =0
def Note():
midi = aseqdump.aseqdump("24:0")
while 1:
onoff,key,velocity = midi.Note_get()
if(onoff == ""):
continue
print("Note: %s , %s , %s" % (onoff,key,velocity))
def Control():
global Ch
midi = aseqdump.aseqdum... |
lol.py | import requests, threading
from discord.ext import commands
client = commands.Bot(command_prefix=".", self_bot= True)
token = "token.YXvmcw.yuh-qvd6bsDfyb4gY"
users = ['811042929040687177','903621585053835275','791835116980666418','903244322181361755'] #users aka the victims
gcs = ['904174831707250750','9041748326... |
echo-server-tcp.py |
from __future__ import print_function
import os
import sys
import signal
import threading
import pyuv
if sys.version_info >= (3, 0):
LINESEP = os.linesep.encode()
else:
LINESEP = os.linesep
def on_read(client, data, error):
if data is None:
client.close()
clients.remove(client)
... |
partial_converter.py | import json
import os
import sys
from multiprocessing import Process
import cv2
import matplotlib.pyplot as plt
import numpy as np
import py_midicsv as pm
sys.path.append('.')
from core import youtube2frames, frames2matrix, matrix2csv
def show_image(path):
image = cv2.imread(path)
image = cv2.cvtColor(imag... |
__main__.py | from multiprocessing import Process
import os
import zmq
import time
def subscriber(pub_sub_addr):
context = zmq.Context()
sub_socket = context.socket(zmq.SUB)
sub_socket.connect(pub_sub_addr)
# forgot to subscribe
sub_socket.setsockopt(zmq.SUBSCRIBE, b"")
try:
while True:
... |
ThreadNeologism.py | #!/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2018/2/28 10:58
# @Email : jtyoui@qq.com
# @Software: PyCharm
import math
import re
from threading import Thread
import queue
ALL_WORDS = dict()
All_LENS = 0
class Neologism(Thread):
def __init__(self, q, split_num=4):
Thread.__init__(self)
... |
VideoStream.py | # To make python 2 and python 3 compatible code
from __future__ import absolute_import
from threading import Thread
import time
import sys
if sys.version_info[0] < 3: # e.g python version <3
import cv2
else:
import cv2
# from cv2 import cv2
# import the Queue class from Python 3
if sys.version_info >= (3... |
prepare_data.py | import sys
sys.path.insert(0, '../')
import os
import errno
from collections import Counter
from setup.settings import preprocessing
from core.tokenizer import tokenize
from core.sentence import score_answers, replace_in_answers
from tqdm import tqdm
from itertools import zip_longest
from multiprocessing import Pool
f... |
bridge.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
import inject
import paho.mqtt.client as mqtt
import rospy
from .util import lookup_object, extract_values, populate_instance
from threading import Condition
from queue import Queue
from uuid import uuid4
from th... |
openwebrx.py | #!/usr/bin/python2.7
print "" # python2.7 is required to run OpenWebRX instead of python3. Please run me by: python2 openwebrx.py
"""
This file is part of OpenWebRX,
an open-source SDR receiver software with a web UI.
Copyright (c) 2013-2015 by Andras Retzler <randras@sdr.hu>
This program is free soft... |
plotting.py | """
vtki plotting module
"""
import collections
import ctypes
import logging
import os
import time
from threading import Thread
from subprocess import PIPE, Popen
import imageio
import numpy as np
import vtk
from vtk.util import numpy_support as VN
import vtki
from vtki.export import export_plotter_vtkjs
from vtki.ut... |
solution.py | # python3
from abc import ABC
from collections import namedtuple
from sys import setrecursionlimit, stdin
from threading import stack_size, Thread
from typing import AnyStr, IO, List
from unittest import TestCase
setrecursionlimit(10 ** 6)
stack_size(2 ** 27)
border = namedtuple('border', 'left right')
test = namedt... |
audio_reader.py | import fnmatch
import os
import random
import re
import threading
import librosa
import numpy as np
import tensorflow as tf
FILE_PATTERN = r'p([0-9]+)_([0-9]+)\.wav'
def get_category_cardinality(files):
id_reg_expression = re.compile(FILE_PATTERN)
min_id = None
max_id = None
for filename in files:
... |
virtualboard.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# ## #############################################################
# virtualboard.py
#
# Author: Mauricio Matamoros
# Licence: MIT
# Date:
#
# ## #############################################################
# Future imports (Python 2.7 compatibility)
from __future__ impo... |
main.py | import importlib
import logging
import os
import threading
import queue
import click
import requests
from webtoon_dl.providers import mapping, exceptions
from webtoon_dl.utils import parse_extension, sanitize_filename
_terminated = False
_total = 1
logger = logging.getLogger('logger')
formatter = logging.Formatter... |
lock.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""These tests ensure that our lock works correctly.
This can be run in two ways.
First, it can be run as a node-local t... |
usbportwatcher.py | ##Loops in thread looking for usb devices on serial ports. Maintains a list of connected ports.
import os
import threading
import json
from time import sleep
from eventsmanager import EventsManager
class USBPortWatcher():
def __init__(self):
self.em = EventsManager()
self.connectedUSBPorts = []
... |
__init__.py | from __future__ import unicode_literals, print_function
import json
import argparse
import threading
from awsshell import shellcomplete
from awsshell import autocomplete
from awsshell import app
from awsshell import docs
from awsshell import loaders
from awsshell.index import completion
from awsshell import utils
_... |
SimVM.py | #-------------------------------------------------------------------------------
# Name: SimVM
# Purpose: 实现一个线程安全仿真环境,其中包含多条自主航行船舶、观测者、环境数据
#
# Author: Youan
# Helper: Bruce
# Created: 27-01-2020
# Copyright: (c) Youan 2020
# Licence: <your licence>
#-------------------------------------... |
object_detection_app.py | import os,os.path,time,cv2,argparse,multiprocessing,threading,asyncio
import numpy as np
import tornado.ioloop
import tornado.web
import tornado.autoreload
from mvnc import mvncapi as mvnc
from skimage.transform import resize
from utils.app_utils import FPS, WebcamVideoStream
from multiprocessing import Queue, Pool
fro... |
benchmark03_string_operations.py | #!/usr/bin/python
import os
import threading
import time
from multiprocessing import Pool
NUM_ITERATIONS = 200000
NUM_TASKS = 50
my_list = []
def prepare_data():
for c in xrange(0x30, 0x79, 3):
my_list.append(chr(c) + chr(c+1) + chr(c+2))
def my_function1(index, out_value):
result = []
for ... |
TCMalloc_test.py | # Copyright 2015 Ufora 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 i... |
demo.py | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... |
log.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
shm_multiproc.py | import ctypes
import numpy as np
from multiprocessing import Pipe, Process
from multiprocessing.sharedctypes import RawArray
from . import Env, Space
START, STEP, RESET, STOP, DONE = range(5)
class ShmProcEnv(Env):
def __init__(self, env, idx, shm):
super().__init__(env.id)
self._env, self.idx, s... |
accumulators.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... |
main_yfinance.py | '''
Libraries
'''
# External libraries
import yfinance as yf #Librarie to connect to Yahoo Finance
#Edited : Add to line 286-292 in base.py of yfinance (https://github.com/ranaroussi/yfinance/issues/208)
#Edited: Comment line 319 in base.py of yfinance because of the error self._info['regularMarke... |
subprocess_server_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 us... |
tcp-hijacking.py | from scapy.all import ARP, TCP, send, sr, IP, Raw
import os
import sys
import threading
import time
from netfilterqueue import NetfilterQueue as NFQ
# constante si variabile globale -------------------------------------------------------------------------------------------
CLIENT_IP = '172.10.0.2'
SERVER_IP = '198.10.... |
sync.py | from click import command, argument, option
from cloudinary import uploader as _uploader, api, Search
from cloudinary.utils import cloudinary_url as cld_url
from os import walk, sep, remove, rmdir, listdir, mkdir
from os.path import splitext, split, join as path_join, abspath, isdir
from requests import get
from hashli... |
a2c.py | # Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group 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.0
#
# Unless requi... |
backupset.py | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, 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 a... |
test_data_access.py | import time
from datetime import timedelta
from threading import Thread
import pytest
from pgevents import data_access, constants
from pgevents.event import Event
from pgevents.utils import timestamps
from tests.integration import DSN
@pytest.fixture(autouse=True)
def clear_events():
connection = data_access.co... |
apps.py | import asyncio
import json
import logging
import multiprocessing
import time
import contextlib
from django.apps import AppConfig
from django.conf import settings
import glob
from hfc.fabric import Client
from hfc.fabric.peer import Peer
from hfc.fabric.user import create_user
from hfc.util.keyvaluestore import File... |
hcl.py | # -*- coding: utf-8 -*-
import xml.etree.ElementTree as elemTree
import os, uuid
from operator import methodcaller, itemgetter, mul
from cihai.core import Cihai
c = Cihai()
import hms.tex as tex
import hms.html as html
import multiprocessing as mp
from multiprocessing import Process, Lock, Queue, Value
def generateId... |
start.py | #!/usr/bin/python3
import jinja2
import os
import socket
import glob
import shutil
import tenacity
import multiprocessing
from tenacity import retry
from podop import run_server
def start_podop():
os.setuid(100)
run_server(3 if "DEBUG" in os.environ else 0, "postfix", "/tmp/podop.socket", [
("transport", ... |
TestAll.py | # coding=utf-8
import base64
import threading
import unittest
from collections import OrderedDict
import requests
from agency.agency_tools import proxy
from agency.cdn_utils import CDNProxy
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
from init.select_ticket_info import sele... |
lib.py | import subprocess
import threading
import os
import random
import zipfile
import sys
import importlib
import queue
import shutil
import logging
import contextlib
import json
import signal
import time
from .server import Server
from ..vendor.Qt import QtWidgets
from ..tools import workfiles
from ..toonboom import setup... |
manager.py | import os
import puzpy
import datetime
import json
import xml.etree.ElementTree as xml_tree
import threading
import time
import db
import downloaders
class Manager(object):
database = None
base_path = None
crossword_path = None
stopping = False
download_thread = None
def __init__(self, base_... |
test.py | import logging
import random
import string
import time
import threading
import os
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
# By default the exceptions that was throwed in threads will be ignored
# (... |
test.py | #!/usr/bin/env python
#
# Copyright 2008 the V8 project authors. 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
# noti... |
test_user.py | """User handler tests."""
import os
import threading
import time
import pytest
from docknv.tests.utils import using_temporary_directory
from docknv.user import UserSession, ProjectLocked, user_get_username
def test_real_ids():
"""Real IDs."""
os.environ.pop("DOCKNV_TEST_ID")
os.environ.pop("DOCKNV_TES... |
start-VNF-LISTENER_1_from_2.py | #---- Python VM startup for LISTENER_1_from_2 ---
import multiprocessing
import time
import LISTENER_1_from_2
import DECRYPT_1_from_2
import ENCRYPT_2_to_1
import WRITER_2_to_1
processes = []
if __name__ == '__main__':
p = multiprocessing.Process(target=LISTENER_1_from_2.startLISTENER_1_from_2)
processes.append(p)
... |
zlib_server.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""
"""
#__version__ = "$Id$"
#end_pymotw_header
import zlib
import logging
import SocketServer
import binascii
BLOCK_SIZE = 64
class ZlibRequestHandler(SocketServer.BaseRequestHandler):
logger = logging.getLogge... |
main.py | from urllib import request
from bs4 import BeautifulSoup
from multiprocessing import Process
from collections import deque
import json
import os
import sys
import pdfkit
import subprocess
import platform
import re
import time
def getPDF(filename = 'out'):
def _get_pdfkit_config():
"""wkhtmltopdf lives a... |
4chanlurker.py | #!/usr/bin/python3
# Released under apache license 2.0, no warranties
# included in this software and it's not meant for
# any production purpose. I decline any responsibility
# copyright 2016 Raffaele Di Campli
from postsifter import PostSifter, Post
import logging
import sys
import subprocess
import time
import threa... |
cfd-score-calculator.py | #Calculates the Cutting Frequency Determination score
#Requirements: 1. Pickle file with mismatch scores in working directory
# 2. Pickle file containing PAM scores in working directory
#Input: 1. 23mer WT sgRNA sequence
# 2. 23mer Off-target sgRNA sequence
#Output: CFD score
import pickle
import arg... |
Analysis.py | """
This module contains the ``analysis`` class.
It includes common classes for file management and messaging and all
calls to AEDT modules like the modeler, mesh, postprocessing, and setup.
"""
from __future__ import absolute_import
import os
import shutil
import threading
import warnings
from collections import Ord... |
Main.py | import queue
import time
from queue import Queue
from Consumer import Consumer
from Producer import Producer
from threading import Thread
if __name__ == '__main__':
workQueue = Queue()
finishQueue = Queue()
array1 = [1, 2, 3, 4]
array2 = [5, 6, 7, 8]
producerObj = Producer(array1, array2)
cons... |
CustomSkipIf.py | import multiprocessing
import yaml
import pytest
import logging
import os
import sys
from abc import ABCMeta, abstractmethod
logger = logging.getLogger()
CUSTOM_SKIP_IF_DICT = 'custom_skip_if_dict'
CUSTOM_TEST_SKIP_PLATFORM_TYPE = 'dynamic_tests_skip_platform_type'
PLATFORM = 'Platform'
def pytest_collection(sessi... |
test_concurrency.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for concurrency libraries."""
import glob
import os
import random
import re
import sys
import threading
import time
from flaky import flaky
import pytest... |
nb_inventory.py | # Copyright (c) 2018 Remy Leone
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
name: nb_inventory
plugin_type: inventory
author:
- Remy Leone (@s... |
app.py | #!/usr/bin/env python
from importlib import import_module
import os
from flask import Flask, render_template, Response
import time
import threading
from random import random
from events import door_event
import RPi.GPIO as GPIO
RECORD = False
open_time_stamp = 0
input_pin_no = 19
GPIO.setmode(GPIO.BOARD)
GPIO.set... |
fgoImageListener.py | import os,cv2,platform
from fgoLogging import getLogger
logger=getLogger('ImageListener')
if platform.system()=='Windows':
import threading,win32con,win32file
class DirListener:
def __init__(self,dir):
self.hDir=win32file.CreateFile(dir,win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32co... |
cmd.py | import click
import os
import tempfile
import requests
import zipfile
import sys
import glob
import re
import io
import shutil
import traceback
import threading
import bs4
import beautifultable
from .vpn import IpvanishVPN, IpvanishError
SETTINGS = {
"IPVANISH_PATH": os.path.expanduser("~/.config/ipvanish"),
... |
MainFile.py | from threading import Thread
from Display import Display
from time import sleep
from Sound import Sound
#from vr import AudioListener
from vr_no_over_lap import AudioListener
class Status(object):
def __init__(self):
#0- not started
#1- started
#2- Exploded
#3- Closing
self.s... |
workbench.py | # -*- coding: utf-8 -*-
import ast
import collections
import importlib
import logging
import os.path
import pkgutil
import platform
import queue
import re
import socket
import sys
import tkinter as tk
import tkinter.font as tk_font
import traceback
from threading import Thread
from tkinter import messagebox, ttk
from ... |
DataDownloader.py | # Download games from the Riot API from Challenger/Master players
import configparser
import multiprocessing
import os
import pickle
import random
import sys
import time
from Modes import Base_Mode
from multiprocessing import Manager
from InterfaceAPI import InterfaceAPI, ApiError, ApiError404, ApiError403
ATTEMPTS... |
datasets.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Dataloaders and dataset utils
"""
import glob
import hashlib
import json
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import Pool, ThreadPool
from pathlib import Path
from threading import Thread
fro... |
ThreadFileDownloader.py | import io
import threading
import urllib.request
from pathlib import Path
from typing import Union
class ThreadFileDownloader:
"""
FileDownloader using sub thread
url str
savepath(None) str,Path
Use .get_error() to check the error
"""
def __init__(self, url, savepath : Un... |
Webspoilt.py | #author : Sayyed Viquar Ahmed (DeadSHot0x7)
from tqdm import tqdm
import time
import pyfiglet
import os
import socket
import urllib.request
import logging
for i in tqdm (range (101),
desc="Loading…",
ascii=False, ncols=75):
time.sleep(0.01)
print("Complete.")
os .system("cls")
... |
application.py | # Copyright 2017 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... |
gui.py | # from functools import partial
from pathlib import Path
from importlib import resources
from threading import Event, Thread
import tkinter as tk
from tkinter import filedialog, ttk
import requests
from PIL import Image, ImageTk
from .about_window import AboutWindow
from utils.custom_paths import resource_... |
utils.py | from __future__ import division
import atexit
import functools
import os
import signal
import sys
import tempfile
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty
from time import sleep
try:
impor... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from vialectrum import Wallet, WalletStorage
from vialectrum.util import UserCancelled, InvalidPassword
from vialectrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET
fro... |
_UIAHandler.py | #_UIAHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2011-2019 NV Access Limited, Joseph Lee, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
from ctypes import *
from ctypes.wintypes import *
import comtypes.client
from comtyp... |
crashminimizer.py | #!/usr/bin/env python3
# Author: Casper
# Email: slei.casper@gmail.com
import re
import sys
import time
import argparse
import os
import random
import psutil
import pty
import multiprocessing
DEBUG = True
STACKTRACELEVEL = 3
report_fd = None
def print_red(aMsg):
global report_fd
if report_fd:
report... |
predict2.py | import time
import math
import threading
from collections import namedtuple
import cv2
import numpy as np
from scipy.stats import linregress
from camera import Camera
from detect_image import RFBNetDetector
from uart import Uart
class Memory():
def __init__(self, max_size=3):
self.max_size = max_size
... |
variable_scope_test.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.