source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_shell_interactive.py | #!/usr/bin/env impala-python
# -*- coding: utf-8 -*-
#
# 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 Apach... |
rpc_ops_test.py | # Copyright 2021 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... |
test_curves.py | from multiprocessing import Process
from repro.cli.hpop import main
from tempfile import mkdtemp
from repro.utils.tests.compare import compare_dict
import json
import math
import time
import os
tmp_dir = mkdtemp()
def make_arguments(experience, workers=1, max_trials=10, more_args=None, version='0',
... |
_meta.py | # -*- coding: utf-8 -*-
#
# This file is part of python-gnupg, a Python interface to GnuPG.
# Copyright © 2013 Isis Lovecruft, <isis@leap.se> 0xA3ADB67A2CDB8B35
# © 2013 Andrej B.
# © 2013 LEAP Encryption Access Project
# © 2008-2012 Vinay Sajip
# © 2005 Steve Traugott
# ... |
main.py | from selenium import webdriver
import time
import threading
def xuanke(button):
print(str(button) + " 创建成功")
opt = webdriver.ChromeOptions() # 创建浏览器
opt.set_headless() # 无窗口模式
driver = webdriver.Chrome(options=opt) # 创建浏览器对象
driver.get('https://sso.dlut.edu.cn/cas/login?service=http://2... |
monitoring_manager.py | import logging
import pandas
import threading
import grpc
import s3fs
from drift_report.config import CONFIG
from drift_report.domain.model import Model
from drift_report.domain.model_repository import ModelRepository
from drift_report.domain.report_repository import ReportRepository
from drift_report.domain.statisti... |
server.py | import sys
import os
import socket
import time
import base64
import tabulate
import signal
import subprocess
import argparse
import shutil
import threading
import platform
import PyInstaller.__main__
from datetime import datetime
__LOGO__ = """
____ _ _ _ ____ _ _____
/ ___|(_) | |_ _| _ \\ / \\|_... |
server.py | '''
Program name: ChatRoom/server.py
Server: provides a common chat room
Usage: Run python server.py (default port = '8765')
'''
import socket
import threading
import argparse
import sys
# Broadcast all the message to all the clients
def broadcast(clients, msg, name=""):
for client in clients:
message = ... |
sensor.py | import logging
import socket
import threading
import time
import onionGpio
from temperatureSensor import TemperatureSensor
import oneWire
gpioMode = False
gpioNum = 1 # set the relay GPIO
gpioObj = None
sensor = None
oneWireGpio = 0 # set the sensor GPIO
relayAddr = 7
relayMode = True
try:
from OmegaExpansion im... |
sippingmethods.py | #!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import combinetargets, GenObject, make_path, logstr, \
write_to_logfile, run_subprocess
from olctools.accessoryFunctions.metadataprinter import MetadataPrinter
from genemethods.sipprCommon.bowtie import Bowtie2CommandLine, Bowtie2BuildComman... |
guess.py | import queue
import threading
import time
rateLimit = []
rateLimitQueue = queue.Queue()
def cooldown_add(user, cooldown_amount=5):
rateLimitQueue.put((user, time.time()+cooldown_amount))
rateLimit.append(user)
def deleteLimit():
while True:
if rateLimitQueue.empty == True:
time.sleep(1)
... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_blk.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_blk.bip32 import BIP32Node
from electrum_blk import constants
from electrum... |
webstreaming.py | # USAGE
# python webstreaming.py --ip 0.0.0.0 --port 8000
from flask import Response
from flask import Flask
from flask import render_template,redirect,url_for
import threading
import datetime
import time
from keras.models import load_model
import cv2
import numpy as np
import time
import datetime
import os
model = l... |
mbhandler.py | import serial
import serial.tools.list_ports
import threading
import warnings
import queue as q
class NoMicrobitError(Exception):
def __init__(self, message):
# Call the base class constructor with the parameters it needs
super(Exception, self).__init__(message)
BAUD = 11520... |
gcsio.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... |
mcmc_tacc.py | ### last major change (excludes testing): 09/26/2018
### generic initial model (no prior fit)
### fitting PA from the beginning
### fitting m=2 mode (bar mode) after 20 swap iterations
### fitting inclination angle after 40 swap iterations (03/20/2018; previously 100)
### (11/27/2017) adapt file for gas kinematic data
... |
test_batch_processor.py | import unittest
import multiprocessing
from threading import Thread
from batch_processor import BatchProcessor
class TestBatchProcessor(unittest.TestCase):
def batch_func(self, batch):
return [v + v for v in batch]
def setUp(self):
# multiprocessing.set_start_method('spawn') # spawn doesn't... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet
from electrum.paymentrequest import InvoiceStore
from electrum.util import pro... |
test_locks.py | import queue
from threading import Thread
import django
import pytest
from django.db import OperationalError, connection, connections
from django.db.transaction import TransactionManagementError, atomic
from django.test import TestCase, TransactionTestCase
from django_mysql.exceptions import TimeoutError
from django_... |
test_utils.py | # coding=utf-8
# Copyright 2020 The TF-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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
main.py | #!/usr/bin/python3
import multiprocessing
def worker():
while True:
pass
for i in range(12):
p = multiprocessing.Process(target=worker)
p.start()
p.join()
print("Main processing exit")
|
test_http.py | import asyncio
import contextlib
import os
import sys
import threading
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
import pytest
import fsspec.asyn
import fsspec.utils
fsspec.utils.setup_logging(logger_name="fsspec.http")
requests = pytest.importorskip("requests")
port = 9898
data = b"\n"... |
dataset.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... |
exploit.py | # Exploits a pre-authentication memcpy based stack buffer overflow vulnerability
# in httpd on several devices and versions:
#
# Device Version httpd md5sum Exploit status
# AC1450 V1.0.0.36_10.0.17 c105a629d55d3f7b29d6b88e2cc6ff3a Untested
# AC1450 V1.0.0.34... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
process.py | # -*- coding: utf-8 -*-
"""
Functions for daemonizing and otherwise modifying running processes
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals, with_statement
import contextlib
import copy
import errno
import functools
import io
import logging
import multiprocessing
... |
client.py | # Copyright (c) 2019 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 app... |
test.py | import logging
import random
import string
import time
import threading
import os
import pytest
from helpers.cluster import ClickHouseCluster, get_instances_dir
# By default the exceptions that was throwed in threads will be ignored
# (they will not mark the test as failed, only printed to stderr).
#
# Wrap thrading... |
test_api.py | """
mbed SDK
Copyright (c) 2011-2014 ARM Limited
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 wr... |
serverpFedMe.py | import os
import copy
import h5py
from flcore.clients.clientpFedMe import clientpFedMe
from flcore.servers.serverbase import Server
from threading import Thread
class pFedMe(Server):
def __init__(self, args, times):
super().__init__(args, times)
# select slow clients
self.set_slow_clients... |
apkleaks.py | #!/usr/bin/env python3
from apkleaks.colors import clr
from contextlib import closing
from distutils.spawn import find_executable
from pipes import quote
from pyaxmlparser import APK
from urllib.request import urlopen
from zipfile import ZipFile
import io
import json
import logging.config
import mimetypes
import os
imp... |
jit-latency-lookuptable.py | import os; os.environ['CUDA_VISIBLE_DEVICES'] = ''
import yaml
from multiprocessing import Process
import torch.nn as nn
import torch
class View(nn.Module):
def __init__(self, shape):
super(View, self).__init__()
self.shape = shape
def forward(self, x):
return x.view(*self.shape)
def ... |
agent_m.py |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
import threading
from future.builtins import range # pylint: disable=redefined-builtin
from pysc2 import maps
from pysc2.env import available_actions_printer
from pysc2.env import sc2_env
f... |
bluetooth_receive.py | import json
import bluetooth
import threading
import timed_LEDs
server_socket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
port = 1
server_socket.bind(("", port))
server_socket.listen(1)
client_socket, address = server_socket.accept()
print("Accepted connection from ", address)
threads = []
while True:
data =... |
api.py | __author__ = 'faner'
def check_callable(target):
if not (target and callable(target)):
raise TypeError('target is not callable!')
class PromiseRunner(object):
def __init__(self, promiseObj, run):
self._promiseObj = promiseObj
from threading import Thread
def _run_wrap():
... |
BaseSpider.py | import datetime
import requests
from src.threadPool.ImageThreadPool import ImageThreadPool
from src.util import util
from copy import deepcopy
import json
from src.util.constant import BASE_DIR, EXPIRE_TIME_IN_SECONDS, BASE_PATH, QR_CODE_MAP_KEY
import re
import logging
from src.web.entity.UserInfo import UserInfo
fr... |
update_from_github.py | import os
import sys
import time
import subprocess
import threading
import re
import zipfile
import shutil
import stat
import glob
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.join(current_path, os.pardir))
top_path = os.path.abspath(os.path.join(root_path, os.pardir, o... |
file.py | import sublime
import threading
import yaml
import os
from contextlib import contextmanager
if 'syntax_file_map' not in globals():
syntax_file_map = {}
if 'determine_syntax_thread' not in globals():
determine_syntax_thread = None
def determine_syntax_files():
global determine_syntax_thread
if not s... |
startup-test-handler.py | # ------------------------------------------------------------------------
#
# Copyright 2005-2015 WSO2, Inc. (http://wso2.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.... |
copyutil.py | # cython: profile=True
# 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
# "... |
build_dataset_mask.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... |
CTFManager.py | import os
import multiprocessing as m
try:
import docker as d
except Exception as e:
print("[!]",str(e))
import time as t
import sys
from getpass import getpass
threads=[]
try:
client=d.from_env()
except:
pass
settupinfo={'ip':'0.0.0.0','cport':8000,'bport':31337,'time':300,'username':None,'password':No... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
socket_tests.py | #!/usr/bin/env python3
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from multiprocessing... |
diff_press_logger_o.py | import diff_p_D6F_PH0505 as D6F_PH0505
from polling_timer import PollingTimer
from move_ave import MovingAverage
from collections import deque
from wave_save import WavSave
from buzz_pipi_r import PiPi
from print_with_DP_EH600 import PrintWithDpEh600
import datetime
import multiprocessing as mp
import time
'''
- 2021/... |
test_errno.py | import unittest, os, errno
import threading
from ctypes import *
from ctypes.util import find_library
class Test(unittest.TestCase):
def test_open(self):
libc_name = find_library("c")
if libc_name is None:
raise unittest.SkipTest("Unable to find C library")
libc = CDLL(libc_nam... |
backend.py | import threading
import time
from pathlib import Path
from flask import Flask
from flask_cors import CORS
from flask_restful import Api, Resource, reqparse
from werkzeug.utils import secure_filename
from markdown_to_pdf import PdfGenerator
# URL_BASE = "https://openleaf-backend.herokuapp.com"
URL_BASE = "http://loca... |
ui_tests.py | # -*- coding: utf-8 -*-
"""Tests for the user interface."""
#
# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
# NOTE FOR RUNNING WINDOWS UI TESTS
#
# Windows UI tests have to be run using the tests\ui_tests.bat helper script.
# This will set PYTHONPATH and PYWIKIBOT2_DIR, and then ... |
marco.py | #!/usr/bin/env python3
#! python
import argparse
import atexit
import copy
import multiprocessing
import os
import select
import signal
import sys
import threading
import utils
import mapsolvers
import CNFsolvers
from MCSEnumerator import MCSEnumerator
from MarcoPolo import MarcoPolo
def parse_args():
parser = ... |
timeout_guard.py | ## @package timeout_guard
# Module caffe2.python.timeout_guard
import contextlib
import threading
import os
import time
import signal
import logging
from future.utils import viewitems
'''
Sometimes CUDA devices can get stuck, 'deadlock'. In this case it is often
better just the kill the process automatically. Us... |
mandelbrot.py | import numpy as np
from _routines import ffi, lib
from threading import Thread, Lock
def mandelbrot(width, height, x, y, zoom, exponent, max_iter, color_map, inside_cutoff=2048, clip_outside=False, anti_aliasing=2):
lock = Lock()
num_color_channels = 3
result = np.zeros((num_color_channels, height, width)... |
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... |
python_code.py | from constraint import Problem, Domain, AllDifferentConstraint
import matplotlib.pyplot as plt
import numpy as np
def _get_pairs(variables):
work = list(variables)
pairs = [ (work[i], work[i+1]) for i in range(len(work)-1) ]
return pairs
def n_queens(n=8):
def not_in_diagonal... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
test_clients.py | # pylint: disable=too-many-lines
# Copyright 2013 Pieter Rautenbach
#
# 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 appli... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import weakref
import warn... |
metaNODE2.py |
#pip install websocket-client
import websocket
from random import random, shuffle, randint
from ast import literal_eval as literal
from multiprocessing import Process
from threading import Thread
from datetime import datetime
from statistics import mode
import logging
import time
import json
# Solid State Drive (SS... |
server.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
bot.py | import os
import youtube_dl
import telepotpro
from random import randint
from multiprocessing import Process
from youtubesearchpython import VideosSearch
from dotenv import load_dotenv
from os.path import join, dirname
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
TOKEN = os.environ.get("TOKE... |
livestyle-plugin.py | import sys
import os.path
import logging
import imp
import threading
import traceback
import re
import sublime
import sublime_plugin
base_path = os.path.abspath(os.path.dirname(__file__))
for p in ['', 'livestyle', 'certifi', 'tornado.zip']:
p = os.path.join(base_path, p)
if p not in sys.path:
sys.path.append(p)
... |
04_cartpole_pg_main.py | #!/usr/bin/env python3
import time
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from torch import optim
import os
import numpy as np
from codes.f_utils.common_utils import make_gym_env, smooth
from common.fast_rl.rl_agent import float32_preprocessor
from config.names import PROJECT_H... |
logger_manager.py | #! /usr/bin/env python3
"""
"""
import datetime
import getpass # to get username
import logging
import multiprocessing
import os
import signal
import socket # to get hostname
import sys
import threading
import time
from importlib import reload
from os.path import dirname, realpath
# Add the openrvdas components ont... |
tree-orders.py | # python3
import sys, threading
sys.setrecursionlimit(10**6) # max depth of recursion
threading.stack_size(2**27) # new thread will get stack of such size
class TreeOrders:
def read(self):
self.n = int(sys.stdin.readline())
self.key = [0 for i in range(self.n)]
self.left = [0 for i in range(self.n)]
... |
map_stage_op_test.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... |
motosim.py | # Copyright 2020 Norwegian University of Science and Technology.
#
# 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 appl... |
tests.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... |
tuner.py | import threading
import datetime
from fHDHR.exceptions import TunerError
from fHDHR.tools import humanized_time
from .stream import Stream
class Tuner():
def __init__(self, fhdhr, inum, epg):
self.fhdhr = fhdhr
self.number = inum
self.epg = epg
self.tuner_lock = threading.Lock(... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet, InternalAddressCorruption
from electrum.paymentrequest import InvoiceStore
fr... |
event_tests.py |
import os
import time
import unittest
import threading
import classad
import htcondor
SAMPLE_EVENT_TEXT = """\
006 (23515.000.000) 04/09 17:55:39 Image size of job updated: 260
1 - MemoryUsage of job (MB)
252 - ResidentSetSize of job (KB)
...
"""
class TestEventReader(unittest.TestCase):
de... |
__init__.py | #!/usr/bin/env python
# encoding: utf-8
"""
@author:nikan
@file: __init__.py.py
@time: 22/01/2018 2:59 PM
"""
import inspect
import logging
import pkgutil
import sys
import time
import traceback
from datetime import datetime
from importlib import import_module, reload
from os.path import join
from urllib.parse imp... |
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... |
utils.py | # -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
"""
import json
import logging
from threading import Thread
import requests
try:
from packaging.version import parse
except ImportError:
from pip._vendor.packaging.version import parse
import tensorflow as tf
from tensorflow.python.ke... |
worker.py | # worker.py - master-slave parallelism support
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import errno, os, signal, sys, threading
import util
def countcpus():
'''try ... |
ws.py | import os
import sys
import shutil
import distutils.dir_util
import logging
import json
import yaml
import types
import werkzeug
import codecs
import csv
import multiprocessing
import subprocess
import thread
import threading
import requests
import gzip
import tarfile
import re
import hashlib
import traceback
import ti... |
synced_enforcer.py | import threading
import time
from casbin.enforcer import Enforcer
from casbin.util.rwlock import RWLockWrite
class AtomicBool():
def __init__(self, value):
self._lock = threading.Lock()
self._value = value
@property
def value(self):
with self._lock:
return self._valu... |
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... |
MultiProcessTest.py | """
Testing playing a song while visualizing the song on a separate thread synchronously
"""
import pydub
import audiosegment
from pydub.playback import play
import matplotlib.pyplot as plt
import time
import threading
seconds = 333 #PyDub uses miliseconds
def play_song(song):
play(song)
def count_somethin... |
decode.py | #!/usr/bin/env python
# pylint: disable-msg=C0103,E501
import copy
import dshell
import glob
import gzip
import logging
import optparse
import os
import output
import sys
import tempfile
import traceback
import util
import zipfile
try:
import pcap
except ImportError:
pcap = None
print 'pcap not available:... |
athenad.py | #!/usr/bin/env python3
import base64
import hashlib
import io
import json
import os
import sys
import queue
import random
import select
import socket
import threading
import time
from collections import namedtuple
from functools import partial
from typing import Any
import requests
from jsonrpc import JSONRPCResponseM... |
TestThread.py | import time
from threading import Thread
li = [1, 2, 3, 4]
def printer():
for m in range(0, 100):
time.sleep(1.2)
print(len(li))
thread_gm = Thread(target=printer)
thread_gm.start()
for i in range(1, 100):
li.append(i)
time.sleep(1)
|
window.py | import psutil
import logging
from chartItem import *
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from PyQt5.QtGui import QIcon, QPixmap, QPalette
from multiprocessing import Process, Queue
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.static import *
class Window(Q... |
Controlador_Hilo.py | # -*- encoding: utf-8 -*-
'''
Created on: 2016
Author: Mizael Martinez
'''
from base_datos import *
import threading
from time import sleep
import time
from Controlador import *
def main():
t = Test()
t.go()
try:
join_threads(t.threads)
except KeyboardInterrupt:
print "\nKeyb... |
mbed_greentea_cli.py | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited
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... |
app1.py | import json
import multiprocessing as mp
import os
import time
import cv2
import numpy as np
import pyvirtualcam
import zmq
from scipy import ndimage
from zmq.eventloop import ioloop, zmqstream
from utils import imresize
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf # noqa: E402
import logging #... |
multi-threads-DL.py | # Python program to illustrate the concept
# of threading
# importing the threading module
import threading
import youtube_dl
import sys
import os
def task(string, ID):
#print("download: {}".format(string))
print("downloading file {}: {}".format(count, string.strip()))
stringCommand = "youtubeDL.py http... |
test_synchronize.py | import os
import sys
import time
import pytest
import signal
import threading
from loky.backend import get_context
from .utils import TimingWrapper
loky_context = get_context("loky")
DELTA = 0.1
TIMEOUT1 = .1
TIMEOUT2 = .3
@pytest.mark.skipif(sys.platform == "win32", reason="UNIX test")
def test_semlock_failure()... |
graphic_user_interface.py | import importlib
import inspect
import sys
import threading
import tkinter as tk
import tkinter.filedialog as fdg
import tkinter.font as tkfont
import tkinter.scrolledtext as tkst
import traceback
from os import path, listdir
from typing import Sequence, Union
import mmd_scripting.core.nuthouse01_core as core
import m... |
eeg.py | # -*- coding: utf8 -*-
#
# CyKIT v2 - 2018.Jan.29
# ========================
# Emokit Written by Cody Brocious
# Emokit Written by Kyle Machulis
# CyKIT Written by Warren
# Contributions by Severin Lemaignan
# Contributions by Sharif Olorin
# Contributions by Bill Schumacher
# Contributions by CaptainSmiley
#
imp... |
remote_drive_server.py | import logging
import threading
import time
import socket
from drive.teleop.controller import Gamepad
# Drive Computer
# Teleop Server
#
# Part of the GSSM Autonomous Golf Cart
# Written by: Joseph Telaak, class of 2022
class Remote_Drive_Server:
def __init__(self, gamepad=Gamepad(), establish_port=42070, comma... |
problem10.py | # This problem was asked by Apple.
# Implement a job scheduler which takes in a function f and an integer n, and calls f after n milliseconds.
import datetime as dt
import threading
def set_interval(f, n):
# Perform some basic validations
if f is None:
raise Exception("parameter f cannot be None")
... |
oledui.py | #!/usr/bin/python
from __future__ import unicode_literals
"""
Volumio User Interface: OLED 256x64 + 2x rotary encoder with pushbutton
DiehardSK 2020
Inspired by Volumio HandsOn script
"""
import requests
import os
import sys
import json
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
from time import time, sleep
fr... |
test_basic.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import os
import random
import re
import setproctitle
import shutil
import six
import socket
impor... |
yara_scanner.py | #!/usr/bin/env python3
# vim: sw=4:ts=4:et:cc=120
__version__ = "1.1.8"
__doc__ = """
Yara Scanner
============
A wrapper around the yara library for Python. ::
scanner = YaraScanner()
# start tracking this yara file
scanner.track_yara_file('/path/to/yara_file.yar')
scanner.load_rules()
scanner.sc... |
impinj.py | from interrogator import *
import threading
import json
import sys
import queue
import os
from httplib2 import Http
from llrp_proto import *
from time import sleep
class Impinj(Interrogator):
def __init__(self, _ip_address, _db_host, _db_password, _cert_path, _debug, _dispatchsleep=0):
Interrogator.__init_... |
cryptSocket_cliente.py | #!/bin/python
#CLIENTE
from simplecrypt import encrypt, decrypt #import da biblioteca para encriptar
import socket #import da biblioteca para o socket
import threading #import da biblioteca para thread
import time #import da biblioteca utilizada para fazer uma pausa com o sleep
tLock = threading.Lock() #cria thread... |
bot.py | #!/usr/bin/python3
from time import sleep
import irc.connection
import irc.buffer
import irc.client
import threading
import thingdb
import glob
import time
import imp
import ssl
import sys
import os
from log import log
import config
import utils
mtimes = {}
def reload_handlers(init=False):
handlers = set(glob.gl... |
dbt_integration_test.py | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
ModuleSystem.py |
from utils import *
import appinfo
import os
from threading import currentThread, Thread
class Module:
def __init__(self, name, filename):
self.name = name
self.filename = filename
self.thread = None
self.module = None
@property
def mainFuncName(self): return self.name + "Main"
@property
def moduleNam... |
test_bz2.py | #!/usr/bin/env python3
from test import support
from test.support import bigmemtest, _4G
import unittest
from io import BytesIO
import os
import random
import subprocess
import sys
try:
import threading
except ImportError:
threading = None
# Skip tests if the bz2 module doesn't exist.
bz2 = support.import_mo... |
main_client.py | import json
import socket
import sys
import threading
import time
import cv2
import imagehash
import numpy as np
import pygame
from PIL import Image
from gui import Gui, Commands
from image_processing.distance import DistanceCalculator2
from image_processing.object_detection import ObjectDetector, DetectionResult
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.