source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
base_camera.py | import time
import threading
import numpy as np
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import pytesseract
import picamera
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from ... |
agent.py | #
# Copyright 2021 Mobvista
#
# 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, s... |
test_connection.py | #!/usr/bin/env python
# test_connection.py - unit test for connection attributes
#
# Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foun... |
sampler.py | import threading
import atexit
import time
try:
import Queue as queue
except ImportError:
import queue
from .scoreboard import Scoreboard
import mod_wsgi
class Sampler(object):
sample_interval = 1.0
report_interval = 60.0
def __init__(self):
self.running = False
self.lock = thr... |
thread_handler.py | # -*-: coding utf-8 -*-
""" Thread handler. """
import threading
import time
from .singleton import Singleton
class ThreadHandler(Singleton):
""" Thread handler. """
def __init__(self):
""" Initialisation. """
self.thread_pool = []
self.run_events = []
def run(self, target, arg... |
monitor.py | #!/usr/bin/env python
# Copyright (c) 2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
"""
-App for Resource Monitoring.
-Collects System CPU/Memory as well as AXON CPU/ Memory.
"""
import ... |
test_app.py | import json
import random
import threading
import tornado.websocket
import tornado.gen
from tornado.testing import AsyncHTTPTestCase
from tornado.httpclient import HTTPError
from tornado.options import options
from tests.sshserver import run_ssh_server, banner
from tests.utils import encode_multipart_formdata, read_fi... |
main.py | import redis
from sys import argv
from utils.modelmanager import ModelManager
from utils.phrasegenerator import PhraseGenerator
from threading import Thread
host = ('host', argv[argv.index('--redis-host') + 1]) if '--redis-host' in argv else None
port = ('port', int(argv[argv.index('--redis-port') + 1])) if '--redis-p... |
pos.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
This Document is Created by At 2018/7/9
in this document, we will implement pos(proof of stake) in python
"""
import time
import json
import threading
from hashlib import sha256
from datetime import datetime
from random import choice
from queue import Queue, Empty
fro... |
__init__.py | from socketserver import ThreadingUDPServer, DatagramRequestHandler
from socketserver import ThreadingTCPServer, BaseRequestHandler, StreamRequestHandler
from threading import Thread
from types import FunctionType
__name__ = 'PortableServers'
__version__ = '1.0.0'
__author__ = 'Ren'
__description__ = 'Portable... |
main.py | import sys
import threading
from Coach import Coach
from chessaz.ChessGame import ChessGame as Game
from chessaz.pytorch.NNet import NNetWrapper as nn
from utils import *
args = dotdict({
'numIters': 5,
'numEps': 2, # Number of complete self-play games to simulate during a new iteration.
'te... |
interpreter.py | # Copyright 2019 The Meson development team
# 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 ... |
testutils.py | from __future__ import print_function
import os
import sys
from types import TracebackType
import isodate
import datetime
import random
from contextlib import AbstractContextManager, contextmanager
from typing import (
Callable,
Iterable,
List,
Optional,
TYPE_CHECKING,
Type,
Iterator,
... |
__init__.py | # -*- encoding: utf-8 -*-
"""
@File : __init__.py.py
@Time : 2020/6/28 21:20
@Author : chise
@Email : chise123@live.com
@Software: PyCharm
@info :
"""
# -*- encoding: utf-8 -*-
import asyncio
import json
from multiprocessing import Process
from typing import List
import aiohttp
from settings import server_... |
test_server.py | # *****************************************
# |docname| - Tests using the web2py server
# *****************************************
# These tests start the web2py server then submit requests to it. All the fixtures are auto-imported by pytest from ``conftest.py``.
#
# .. contents::
#
# Imports
# =======
# These are lis... |
telepoints.py | import sys
import telepot
from telepot.delegate import per_chat_id_in, call, create_open
import settings
from peewee import *
"""
telepoints.py
"""
# Simulate a database to store unread messages
class UnreadStore(object):
def __init__(self):
self._db = {}
def put(self, msg):
chat_id = msg['ch... |
base_consumer.py | from multiprocessing import Process
from confluent_kafka import Consumer
from abc import ABC, abstractmethod, abstractproperty
import sys
import ast
import logging
from functools import wraps
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('consumer')
def multiprocess(fn):
@wraps(fn)
def c... |
daemon.py | import multiprocessing as mp
import os.path
import time
from logging import Logger
from os import walk
from typing import List
from watchdog.events import RegexMatchingEventHandler
from watchdog.observers import Observer
from monitor.config import DaemonConfig
from monitor.file_processor import file_processor
class ... |
messagebus_test.py | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
main.py | # Copyright 2020 Google Research. 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... |
filosofos_v1.py | # -*- coding: utf-8 -*-
import threading
num = 5
palillos = [threading.Semaphore(1) for i in range(num)]
def filosofo(id):
while True:
piensa(id)
levanta_palillos(id)
come(id)
suelta_palillos(id)
def piensa(id):
# (...)
print "%d - Tengo hambre..." % id
def levanta_palillo... |
test_miscell.py | from __future__ import absolute_import
# import common
import unittest
import stackless
import sys
import traceback
import weakref
import types
import contextlib
import time
import os
import struct
import gc
from stackless import _test_nostacklesscall as apply_not_stackless
import _teststackless
try:
import _thre... |
backends.py | import os
import random
import time
import tempfile
import threading
from django.core.cache.backends.filebased import pickle, FileBasedCache as DjangoFileBasedCache
class FileBasedCache(DjangoFileBasedCache):
"""Faile based backend with some improvements."""
_fs_transaction_suffix = '.__dj_cache'
def se... |
node.py | import logging
import threading
import time
from enum import Enum
from typing import Any, Callable, Dict, List, Tuple, Optional, Set
from utils import node_want_to_terminate
from .message import NormalMessage
class WsnNode(object):
"""无线传感网络中的一个节点
"""
# 日志配置
logger: logging.Logger = l... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines, fixme
# pylint: disable=too-few-public-methods
# pylint: disable=import-error
"""
Dask extensions for distributed training
----------------------------------... |
main.py | from evolutionarystrategy import EvolutionaryStrategy
from fitness import Fitness
from model import Model
import sys
import multiprocessing as mp
import numpy as np
import csv
import torch
def generate_epsilon(seed, model):
torch.manual_seed(seed)
epsilon = {}
for key, shape in model.shape().items():
if model.pa... |
io_test_view.py | # External Dependencies
from threading import Thread
from pyzbar import pyzbar
from pyzbar.pyzbar import ZBarSymbol
import time
# Internal file class dependencies
from . import View
from seedsigner.helpers import B
class IOTestView(View):
def __init__(self) -> None:
View.__init__(self)
self.redra... |
local_games.py | import logging as log
import os
import subprocess
import time
from pathlib import Path
from threading import Thread, Lock
from consts import Platform, SYSTEM, WINDOWS_UNINSTALL_LOCATION, LS_REGISTER
from definitions import BlizzardGame, ClassicGame, Blizzard
from pathfinder import PathFinder
from psutil import Process... |
fetchVioDetail.py | #!/usr/bin/env python
##
# Copyright (C) 2016 University of Southern California and
# Nan Hua
#
# Authors: Nan Hua and Hanjun Shin
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwar... |
progress.py | """Utilities for progress tracking and display to the user."""
from __future__ import absolute_import, division
from datetime import timedelta
import importlib
import os
import sys
import threading
import time
import uuid
import warnings
import numpy as np
from .compat import escape
from .stdlib import get_terminal... |
API.py | import json
import os
import threading
from datetime import date, datetime
import wx
from yandex_music.client import Client
from yandex_music.exceptions import Captcha
import events.events as events
from configs.configs import Configs
class YandexAPI(object):
def __init__(self):
self.conf = Configs()
... |
WebcamCapture.py | # import the necessary packages
from threading import Thread
import cv2
class WebcamVideoStream:
def __init__(self, cap):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cap
(self.grabbed, self.frame) = self.stream.read()
# ini... |
weather_station.py | import threading
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
import opcua
import logging
import open_weather
# todo: make server implementation of method work
# @uamethod
# def update_predictions_uamethod():
# """
# forces update of predictions in weather station
# """
# l... |
mcspm.py | # -*- coding:utf-8 -*-
from threading import Thread
import multiprocessing
import time
import sys
from core.mcservercore import MinecraftServer
from function.listener import EventListener
from function import console
class MinecraftServerProcessManager(multiprocessing.Process):
"""docstring for MinecraftServer... |
word2vec_optimized.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... |
monitored_session_test.py | # pylint: disable=g-bad-file-header
# Copyright 2016 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/LICENS... |
test_creator.py | from __future__ import absolute_import, unicode_literals
import difflib
import gc
import logging
import os
import stat
import subprocess
import sys
from itertools import product
from threading import Thread
import pytest
import six
from virtualenv.__main__ import run
from virtualenv.create.creator import DEBUG_SCRIP... |
MAC_Table_Cisco_Access_Layer_Threaded.py | #!/usr/bin/python3
import threading, os, time, sys ,socket, json
from multiprocessing import Queue
from getpass import getpass
from netmiko import ConnectHandler
from netmiko.ssh_exception import NetMikoTimeoutException
from paramiko.ssh_exception import SSHException
from netmiko.ssh_exception import AuthenticationExc... |
debug.py | # -*- coding: utf-8 -*-
"""
debug.py - Functions to aid in debugging
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from __future__ import print_function
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading
from . import pt... |
search_ip.py | # !/bin/sur/
# coding:utf-8
# author:Wisdom_Tree
# search alive ip address through threading
from threading import Thread,activeCount
import os
def cmd(ip,ip_live):
#print(ip)
cmd=os.popen("ping "+ip+' -n 1 -w 10')
#time.sleep(0.030)
re=cmd.read()
re=re.find('TTL')
if re!=(-1):
ip_live.append(i... |
image_app_core.py | """The flask/webserver part is slightly independent of the behavior,
allowing the user to "tune in" to see, but should not stop the
robot running"""
import time
from multiprocessing import Process, Queue
from flask import Flask, render_template, Response
app = Flask(__name__)
control_queue = Queue()
display_queue = ... |
thread_rlock.py | ###################################
# File Name : thread_rlock.py
###################################
# !/usr/bin/python3
import time
import logging
import threading
logging.basicConfig(level=logging.DEBUG, format="(%(threadName)s) %(message)s")
RESOURCE = 0
def set_reverse(lock):
logging.debug("Start batch")
... |
Client.py | # © 2021 Liran Smadja. All rights reserved.
import time
import socket
import threading
from Observable import Observable
from Crypto.Cipher import AES
from Protocol import *
# encryption key
SECRET_KEY = b'\xf8[\xd6\t<\xd8\x04a5siif\x93\xdc\xe0'
IV = b'\x8e;\xf21bB\x0c\x95\x93\xce\xe9J3,\x04\xdd'
class ClientTCP(O... |
trajectory_player.py | ################################################################################
# Copyright 2022 FZI Research Center for Information 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 ... |
jobs.py | # BSD 3-Clause License
#
# Copyright (c) 2017, Zackary Parsons
# 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
# ... |
pyusb_backend.py | # pyOCD debugger
# Copyright (c) 2006-2020 Arm Limited
# Copyright (c) 2020 Patrick Huesmann
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
imageops.py | # Copyright 2017 IBM Corp.
#
# 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 t... |
_client.py | from statefun_tasks import DefaultSerialiser, PipelineBuilder, TaskRequest, TaskResult, TaskException, TaskAction, \
TaskActionRequest, TaskActionResult, TaskActionException, TaskStatus as TaskStatusProto
from statefun_tasks.client import TaskError, TaskStatus
from google.protobuf.any_pb2 import Any
from kafka imp... |
servers.py | # Copyright 2014 The Oppia 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 applicable ... |
GUI.py | import pygame
import threading
import time
import dataGetter
import socket
import random
def calculateColour(fireRisk):
if fireRisk >= 90:
return (195, 0, 0) #dark red
elif fireRisk >= 80:
return (255, 0,0) #red
elif fireRisk >= 70:
return (255, 90, 0) #light red
... |
HiwinRA605_socket_ros_test_20190625191140.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
doom_multiagent_wrapper.py | import threading
import time
from enum import Enum
from multiprocessing import Process
from queue import Empty, Queue
import faster_fifo
import cv2
import filelock
import gym
from filelock import FileLock
from envs.doom.doom_gym import doom_lock_file
from envs.doom.doom_render import concat_grid, cvt_doom_obs
from en... |
test_socketserver.py | """
Test suite for socketserver.
"""
import contextlib
import io
import os
import select
import signal
import socket
import tempfile
import threading
import unittest
import socketserver
import test.support
from test.support import reap_children, reap_threads, verbose, os_helper
test.support.requires("network")
TES... |
watchdog.py | # -*- coding: utf-8 -*-
from kazoo.client import KazooClient
import os
import sys
import logging
import time
import signal
from multiprocessing import Process
main_dir = "obj"
signal_dir = '/signal/suning'
task_type = "suning"
def run_proc():
os.chdir(main_dir +"suning/suning/spiders")
#arg = ["HELLO","crawl",... |
kuJjikopalambhan.py | from keyboard import (
add_hotkey,
on_press,
on_release_key,
all_modifiers,
on_press_key,
write,
press_and_release,
add_hotkey,
unhook_all as key_unhook,
)
from mouse import on_click, on_middle_click, on_right_click, unhook_all as mouse_unhook
from time import time, sleep
from thread... |
main.py | import multiprocessing
import queue
import socketio
import sys
import signal
import argparse
import magcalibration
import cmdui
ap = argparse.ArgumentParser()
ap.add_argument("-f","--filename",required=False,help='Filename of csv mag data formatted as mx,my,mz',type=str,default='')
ap.add_argument("-s",'--server',re... |
freeciv_bot.py | #!/usr/bin/python3
# -*- coding: latin-1 -*-
'''
@package freeciv_bot
'''
import socket
import sys
import struct
import array
import zlib
import io
import re
import asyncio
import threading
import time
from argparse import ArgumentParser
from datetime import datetime
PJOIN_REQ = 4
PSTART = 0
JOINED = 333
JOIN_REPLY ... |
ultimate.py | # -*- coding: utf-8 -*-
import schedule
import time
import sys
import os
import random
import yaml #->added to make pics upload -> see job8
import glob #->added to make pics upload -> see job8
from tqdm import tqdm
import threading #->added to make multithreadening possible -> see fn run_... |
word2vec.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... |
test_local.py | import asyncio
import copy
import math
import operator
import sys
import time
from functools import partial
from threading import Thread
import pytest
from werkzeug import local
if sys.version_info < (3, 7):
def run_async(coro):
return asyncio.get_event_loop().run_until_complete(coro)
else:
def ru... |
repository.py | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import functools
import os
import re
import shutil
import subprocess
from argparse import ArgumentParser, _SubParsersAction
from contextlib import c... |
main.py | from quixstreaming import QuixStreamingClient
from quixstreaming.app import App
from quix_functions import QuixFunctions
import requests
import time
import traceback
from threading import Thread
import os
try:
# should the main loop run?
run = True
# Quix injects credentials automatically to the client.
... |
lro_track_2.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: /data2/captures/20200329/LRO_RHCP_2020-04-01T22:40:27Z
# GNU Radio version: 3.7.13.5
##################################################
if __name__ == '__main__':
import ctypes
... |
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 sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional
from PyQt5.QtCore i... |
main.py | import threading
from queue import Queue
from spider import Spider
from domain import *
from general import *
#This is the main part of the program that creates multithreading functionality. Multithreading allows the webscraper to run
#quicker and more efficiently.
PROJECT_NAME='tripadvisor'
HOMEPAGE= 'https://www.tr... |
test.py | import gzip
import json
import logging
import os
import io
import random
import threading
import time
import helpers.client
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir
from helpers.network import PartitionManager
from helpers.test_tools import exec_query_with_retr... |
utils.py | """Utilities shared by tests."""
import asyncio
import collections
import contextlib
import io
import logging
import os
import re
import selectors
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
import weakref
from unittest import mock
from http.server import... |
ui.py | __author__ = 'benoit'
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
import multiprocessing, time, threading
from .game import *
from .solver import *
class SolitaireUI:
def __init__(self, solitaire):
self.solitaire = solitaire
self.board = self.solitaire.board
self... |
jerk_agent_collect.py | #!/usr/bin/env python
"""
A scripted agent called "Just Enough Retained Knowledge".
"""
import argparse
import json
import multiprocessing
import os
import random
from uuid import uuid4
import cv2
import gym
import numpy as np
import retro
from tqdm import trange
from sonicrl.environments import get_environments
EXP... |
utils.py | # -*- coding: utf-8 -*-
import contextlib
import errno
import importlib
import itertools
import json
import os
import queue
import sys
from atomicwrites import atomic_write
import click
import click_threading
from . import cli_logger
from .. import BUGTRACKER_HOME, DOCS_HOME, exceptions
from ..sync.exceptions impo... |
api_chess.py | from multiprocessing import connection, Pipe
from threading import Thread
import numpy as np
from chess_zero.config import Config
class ChessModelAPI:
# noinspection PyUnusedLocal
def __init__(self, config: Config, agent_model): # ChessModel
self.agent_model = agent_model
self.pipes = []
... |
authenticator.py | """Module for authenticating devices connecting to a faucet network"""
import sys
import os
import collections
import argparse
import threading
import yaml
from forch.heartbeat_scheduler import HeartbeatScheduler
import forch.radius_query as radius_query
from forch.simple_auth_state_machine import AuthStateMachine
fr... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
import signal
from collections import namedtuple
import capnp
from tqdm import tqdm
import cereal.messaging as messaging
from cereal import car, log
from cereal.services import service_list
from common.params import Params
from ... |
maintenance.py | # Copyright 2019 Red Hat, 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... |
utils.py | import asyncio
from asyncio import TimeoutError
import atexit
import click
from collections import deque, OrderedDict, UserDict
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
import functools
from hashlib import md5
import html
import inspect
import json
import logging
import mu... |
test_response_cache.py | from ray.util.client.common import (_id_is_newer, ResponseCache,
OrderedResponseCache, INT32_MAX)
import threading
import time
import pytest
def test_id_is_newer():
"""
Sanity checks the logic for ID is newer. In general, we would expect
that higher IDs are newer than ... |
stats.py | import json
import platform
import subprocess
import threading
import time
from typing import Dict, List, Optional, Union
import psutil
import wandb
from wandb import util
from wandb.vendor.pynvml import pynvml
from . import tpu
from ..interface.interface_queue import InterfaceQueue
from ..lib import telemetry
GPUH... |
lifo_queues.py | import threading
import queue
import random
import time
def my_subscriber(queue_p):
while not queue_p.empty():
item = queue_p.get()
if item is None:
break
print("{} removed {} from the queue".format(threading.current_thread(), item))
queue_p.task_done()
myQueue = queu... |
async_plc.py | #!/usr/bin/env python
# SCADA Simulator
#
# Copyright 2018 Carnegie Mellon University. All Rights Reserved.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPL... |
misc_utils.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Miscellaneous utility functions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
import operator
from urllib.parse import quote... |
Spec.py | # -*- coding: utf-8 -*-
import glob
import io
import sys
import os
from collections import defaultdict, OrderedDict
from datetime import datetime
from . import biblio
from . import boilerplate
from . import caniuse
from . import mdnspeclinks
from . import config
from . import constants
from . import datablocks
from ... |
EnigmaStateManager.py | import threading
import time
from queue import Queue
class EnigmaStateManager:
def __init__(self,num_worker_threads=5):
self.machineStateTable={}
self.workRequestMap={}
self.workQueue=Queue()
self.num_worker_threads=num_worker_threads
self.finished=False
self.run()
... |
fsspec_utils.py | #
# Copyright (c) 2021, NVIDIA 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 ... |
cache.py | # ██╗ ██╗██████╗ ███╗ ███╗███████╗ █████╗ ██╗
# ██║ ██║██╔══██╗████╗ ████║██╔════╝██╔══██╗██║
# ███████║██║ ██║██╔████╔██║█████╗ ███████║██║
# ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ██╔══██║██║
# ██║ ██║██████╔╝██║ ╚═╝ ██║███████╗██║ ██║███████╗
# ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝
# Copyright 2019... |
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... |
asyncclientproxy.py | '''
@author: Deniz Altinbuken, Emin Gun Sirer
@note: ConCoord Client Proxy
@copyright: See LICENSE
'''
import socket, os, sys, time, random, threading, select
from threading import Thread, Condition, RLock, Lock
import pickle
from concoord.pack import *
from concoord.enums import *
from concoord.utils import *
from con... |
test_recreation.py | """InVEST Recreation model tests."""
import datetime
import glob
import zipfile
import socket
import threading
import unittest
import tempfile
import shutil
import os
import functools
import logging
import json
import queue
import Pyro4
import pygeoprocessing
import pygeoprocessing.testing
import num... |
test_shell_interactive.py | #!/usr/bin/env impala-python
# encoding=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 Apache Licen... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_ganja as electrum
from electrum_ganja.ganja import TYPE_ADDRESS
from electrum_ganja import WalletStorage, Wallet
from electrum_ganja_gui.kivy.i18n import _
from electrum_ganja.paymen... |
email.py | from flask_mail import Message
from app import mail
from flask import render_template
from app import app
from threading import Thread
def send_password_reset_email(user):
token = user.get_reset_password_token()
send_email('[InvestFly] Reset Your Password',
sender= 'investflycorporation@gmail.... |
tiendita.py | from threading import Semaphore, Thread
from time import sleep
from random import randint
#Constantes para controlar el numero de clientes que pueden estar en la tienda y el máximo de pedidos que puede hacer
maxClient = 3
maxPed = 5
#Variable para controlar el cerrado de la tiendita
n = 0
#Mecanismos... |
autodownloader.py | import tiktok
import database
from time import sleep
from threading import Thread
class AutoDownloader():
def __init__(self, window, downloadqueue):
self.window = window
self.autoDownloadQueue = downloadqueue
self.clipIndex = 0
self.auto = False
def startAutoMode(... |
naming.py | """
Name Server and helper functions.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
from __future__ import with_statement
import re, logging, socket, sys
from Pyro4 import constants, core, socketutil
from Pyro4.threadutil import RLock, Thread
from Pyro4.errors import PyroError, ... |
_DesyTrackerRunControl.py | import threading
import time
import click
import pyrogue
class DesyTrackerRunControl(pyrogue.RunControl):
def __init__(self, **kwargs):
rates = {1:'1 Hz', 0:'Auto'}
states = {0: 'Stopped', 1: 'Running', 2: 'Calibration'}
pyrogue.RunControl.__init__(self, rates=rates, states=states, **kwarg... |
main.py | '''
Herramientas necesarias para el experimento:
- OpenBCI
- Script en Python:
- Lanzar imágenes
- Capturar señales mediante LSL
Procedimiento a seguir:
- Iniciamos OpenBCI (para capturar del BCI)
- Empezamos a capturar con LSL ON
- Iniciamos script "main.py"
- Se lanz... |
sensor.py | # coding=utf-8
import subprocess
import re
import pdb
from util import *
from create_merge_topo import *
class sensor(object):
def __init__(self, id, nh, net, config_file, hosts=[], active = True, passive = True,
known_ips = [], max_fail = 5, simulation = False, readmit = True):
... |
MultiprocessingDropbox.py | # Tai Sakuma <tai.sakuma@gmail.com>
from __future__ import print_function
import logging
import multiprocessing
import threading
from operator import itemgetter
from collections import deque
from ..progressbar import NullProgressMonitor
from .TaskPackage import TaskPackage
from .Worker import Worker
##_____________... |
test_lib.py | #!/usr/bin/env python
"""A library for tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import datetime
import doctest
import email
import functools
import itertools
import logging
import os
import shutil
import threading
import time
import unitt... |
luntan.py | import requests
from bs4 import BeautifulSoup
import logging
import os
import queue
import threading
import time
import random
home = 'D:\\luntuan_girls_thread\\'
success_count = 0
count_lock = threading.Lock()
def save_img(url):
try:
global home, success_count
rsp = requests.get(url)
nam... |
progress_bar.py | import sys
import time
import math
from collections import deque
from datetime import timedelta
from typing import Optional
from ..logging.profile import TimeContext
from ..helper import colored, get_readable_size, get_readable_time
class ProgressBar(TimeContext):
"""
A simple progress bar.
Example:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.