source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
config.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
r"""
A Python module to maintain unique, run-wide *aslprep* settings.
This module implements the memory structures to keep a consistent, singleton config.
Settings are passed across processes via filesyste... |
system_call_tracer.py | from collections import deque
from datetime import datetime
import psutil
import re
import subprocess
from subprocess import PIPE
import sys
import threading
import time
class SystemCallTracer:
"""System Call Tracer class.
Traces the system calls being made by a process defined by a given
pid. The run() m... |
__main__.py | import subprocess
import sys
import threading
FILES = {
"ca-langs.py": "wikidict/lang/ca/langs.py",
"de-abk.py": "wikidict/lang/de/abk.py",
"de-langs.py": "wikidict/lang/de/langs.py",
"de-lang_adjs.py": "wikidict/lang/de/lang_adjs.py",
"en-form-of.py": "wikidict/lang/en/form_of.py",
"el-langs.p... |
test.py | import cv2
import time
import threading
from class_CNN import NeuralNetwork
from class_PlateDetection import PlateDetector
from utils.average_plate import *
from utils.find_best_quality_images import get_best_images
########### INIT ###########
# Initialize the plate detector
plateDetector = PlateDetector(type_of_plat... |
websock.py | """The WebSocket Feed provides real-time market data updates for orders and
trades.
Find more here: `<https://docs.exchange.coinbase.com/#websocket-feed>`_
.. module:: websock
:synopsis: WebSocket Feed
.. moduleauthor:: Alexander Simeonov <agsimeon@buffalo.edu>
"""
from json import dumps, loads
from threadin... |
trading.py | import copy
from decimal import Decimal, getcontext
import logging
import logging.config
import queue
import threading
import time
from qsforex.execution.execution import OANDAExecutionHandler
from qsforex.portfolio.portfolio import Portfolio
from qsforex import settings
from qsforex.strategy.strategy import TestStra... |
wsdump.py | #!/Users/Nish/Dropbox/SlackBot-SS/starterbot/bin/python2.7
import argparse
import code
import sys
import threading
import time
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encodi... |
uexpect.py | # Copyright (c) 2019 Vitaliy Zakaznikov
#
# 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... |
test_pvc_creation_deletion_performance.py | """
Test to verify performance of PVC creation and deletion
for RBD, CephFS and RBD-Thick interfaces
"""
import time
import logging
import datetime
import pytest
import ocs_ci.ocs.exceptions as ex
import threading
import statistics
from concurrent.futures import ThreadPoolExecutor
from uuid import uuid4
from ocs_ci.fr... |
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... |
test_core.py | "Test diskcache.core.Cache."
import collections as co
import errno
import functools as ft
import hashlib
import io
import os
import os.path as op
import pickle
import pytest
import random
import shutil
import sqlite3
import subprocess as sp
import sys
import tempfile
import threading
import time
import unittest
import... |
test_numexpr.py |
###################################################################
# Numexpr - Fast numerical array expression evaluator for NumPy.
#
# License: MIT
# Author: See AUTHORS.txt
#
# See LICENSE.txt and LICENSES/*.txt for details about copyright and
# rights to use.
################################... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.ravencoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import con... |
main.py | import discord
import os
import random
import requests
import sys
import threading
import time
import yaml
sys.path.append("./objection_engine")
from deletion import Deletion
from discord.ext import commands, tasks
from message import Message
from objection_engine.beans.comment import Comment
from objection_engine.re... |
ledhat.py | #!/usr/bin/env python3
# coding=utf8
import os
import time
import colorsys
import threading
import _thread
from sys import exit, argv
try:
from PIL import Image, ImageDraw, ImageFont
except ImportError:
exit('Lemon requires the pillow module\nInstall with: sudo pip3 install pillow')
try:
import unicornha... |
Lending.py | # coding=utf-8
from decimal import Decimal
import sched
import time
import threading
Config = None
api = None
log = None
Data = None
MaxToLend = None
Analysis = None
SATOSHI = Decimal(10) ** -8
sleep_time_active = 0
sleep_time_inactive = 0
sleep_time = 0
min_daily_rate = 0
max_daily_rate = 0
spread_lend = 0
gap_botto... |
mock.py | # vim: set fileencoding=utf-8:
#
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
#
# Copyright (c) 2016-2021 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2016 Andrew Scheller <github@loowis.durge.org>
#
# SPDX-License-Identifier: BSD-3-Clause
import os
from collections import namedtuple
from t... |
index.py | #!/usr/bin/pypy3
#!/usr/bin/python3
import cgi
import mysql.connector
from datetime import datetime, timedelta
from threading import Thread
from urllib.request import Request, urlopen
import json
def commit(company_name, results, cursor, cnx):
sql1 = "DELETE FROM yahoofinancessearch WHERE company_name='{}';".forma... |
__main__.py | # main code for the agent
import sys
from utilz import utils_capture
import threading
from time import time, sleep
from agents import sis
from app import client
import os
import config
config = config.Config()
cwd = os.getcwd()
recording_folder = cwd+'/datasets/recording/'
test_folder = recording_folder+'/test/'
train... |
test_credentials.py | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
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... |
clone_two_eval_mini_srcgame_add_map_bn.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
USED_DEVICES = "6,7"
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = USED_DEVICES
import sys
import threading
import time
import tensorflow as tf
from absl import... |
eval_variability.py | import sys
import os
import multiprocessing as mp
import ctypes
import numpy as np
import util
import util_morphology
import util_meta
import util_feature_IO
import util_geometry
import constants
def createMorphologyFile(networkDir, morphologyFile):
graphset = util_morphology.loadGraphset(networkDir)
neurons... |
burst.py | # -*- coding: utf-8 -*-
"""
Burst processing thread
"""
from __future__ import unicode_literals
from future.utils import PY3, iteritems
import re
import json
import time
from threading import Thread
from elementum.provider import append_headers, get_setting, log
if PY3:
from queue import Queue
from urllib.pa... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Messag... |
tests.py | # -*- coding: utf-8 -*-
import os
import shutil
import sys
import tempfile
import time
from datetime import datetime, timedelta
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
import threading
except ImportError:
import dummy_threading as threading
from djang... |
handler.py | import shelve
import socket
import subprocess
import time
from threading import Thread
import requests
from codesync.auth.server import start_server
from codesync.constants import CACHE_FILE_PATH
from codesync.settings import IS_DEV
class AuthServerHandler(object):
@staticmethod
def get_open_port():
... |
analyzer_batch.py | from __future__ import division
import logging
try:
from Queue import Empty
except:
from queue import Empty
from time import time, sleep
from threading import Thread
from collections import defaultdict
# @modified 20190522 - Task #3034: Reduce multiprocessing Manager list usage
# Use Redis sets in place of Mana... |
port_scanner.py | import threading, socket, sys
import tld # Top Level Domain
from queue import Queue
user_inputs = sys.argv # It's a LIST of STRING
print_lock = threading.Lock()
# Can be a Domain name or IP Address
# Note: user_inputs[0] it's a script's path so you don't need it
target = user_inputs[1]
q = Queue()
def portscan(p... |
no_thread.py | from time import time, ctime
import hashlib
import threading
def main():
with open("smalldict.txt", "r")as f:
list = f.readlines()
with open("sha_1_no.txt", "a")as s:
start_time = time()
for i in list:
word = i.strip("\n")
t = threading.Thread(target=threads, arg... |
util_threading.py | # coding: UTF-8
import threading
import _thread # ๅ
ผๅฎนpy2.0็ๅค็บฟ็จ
import time
import queue
# ไธบ็บฟ็จๅฎไนไธไธชๅฝๆฐ
def print_time(thread_name, delay, counter):
while counter:
time.sleep(delay)
print("%s: %s" % (thread_name, time.ctime(time.time())))
counter -= 1
def print_time_return(thread_name, del... |
multiThreading.py | from time import sleep
from threading import Thread
class Hello(Thread):
def run():
for i in ramge(5):
print("Hello")
sleep(1)
class Hi(Thread)
def run():
for i in range(5):
print("Hi")
sleep(1)
hello = Hello()
hi = Hi()
hello.start()
sleep(0.2)
hi.start()
hello.... |
cachingFileStore.py | # Copyright (C) 2015-2018 Regents of the University of California
#
# 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... |
httpserver.py | # Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import logging
import threading
from six.moves import BaseHTTPServer
from six.moves import http_client
_STOP_EVENT = '/fakeserver/__... |
sensor.py | """Sensor to monitor incoming/outgoing phone calls on a Fritz!Box router."""
from datetime import datetime, timedelta
import logging
import queue
from threading import Event as ThreadingEvent, Thread
from time import sleep
from fritzconnection.core.fritzmonitor import FritzMonitor
import voluptuous as vol
from homeas... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import unittest
import tempfile
import time
import faulthandler
import random
import copy
from collections import deque
from threading import Thread, Event
from inspect import getdoc, isclass
from traceback import ... |
predict.py | from keras.models import load_model
from vis.utils import utils
import os
import numpy as np
import json
import tensorflow as tf
import time
import socket
import threading
import uuid
from sqldb import inserst
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.2
session ... |
tests.py | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import os
import re
import copy
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... |
chaindb.py | # 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, publish, distribute, sublicense, and/or sell
# copi... |
nest.py | #!/usr/bin/python3
import subprocess
import sys
import signal
import time
import threading
import socket
from xmlrpc.server import SimpleXMLRPCServer
from node import Node
import socketserver
class ThreadedXMLRPCServer(socketserver.ThreadingMixIn, SimpleXMLRPCServer):
pass
# GET IP ADDRESS AND PORT
def get_addr... |
test_MParser.py | from unittest import TestCase
from manifestparser import MParser
import http.server
import socketserver
from threading import Thread
class TestMParser(TestCase):
_httpd = None
_httpdthread = None
_port = 8000
@classmethod
def setUpClass(cls):
handler = http.server.SimpleHTTPRequestHandler... |
dbx.py | import base64
import random
import os
import time
import copy
import json
import dropbox
# from dropbox.exceptions import ApiError, AuthError
# from dropbox.files import FileMetadata, FolderMetadata, CreateFolderError
from pydispatch import dispatcher
# Empire imports
from lib.common import helpers
from lib.common imp... |
client.py | # Copyright (c) 2012-2014 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
... |
client.py | import json
import os
import threading
import uuid
import weakref
from urllib.parse import urljoin
import msgpack
import portpicker
import socketio
import zmq
from loguru import logger
from .pack import serialize_data
from .watcher import Watcher
from ..utils import (
DEFAULT_HWM,
DEFAULT_ZMQ_IO_THREADS,
... |
base.py | # Copyright (c) 2014 OpenStack Foundation.
# 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... |
test_windows_events.py | import os
import signal
import socket
import sys
import time
import threading
import unittest
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _overlapped
import _winapi
import asyncio
from asyncio import windows_events
from asyncio.streams import _StreamProtoc... |
pyusb_v2_backend.py | # pyOCD debugger
# Copyright (c) 2019 Arm Limited
# 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://www.apache.org/licenses/LICENSE-2.0
#
# ... |
engine.py | # -*- coding: utf-8 -*-
"""The multi-process processing engine."""
import abc
import ctypes
import os
import signal
import sys
import threading
import time
from plaso.engine import engine
from plaso.engine import process_info
from plaso.lib import definitions
from plaso.multi_process import logger
from plaso.multi_pr... |
object_storage_bulk_delete.py | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
server.py | #!/usr/bin/env python3
"""Server for multithreaded (asynchronous) chat application."""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accep... |
core.py | # -*- 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 Apache License, Version 2.0 (the
#... |
agentspace.py | import threading
import time
class Block:
def __init__(self):
self.value = None
self.validity = 0.0
self.priority = 0.0
self.registered = []
def valid(self):
if self.value is None:
return False
return self.validity == 0.0 or self.validit... |
test_dispatcher.py | import errno
import multiprocessing
import os
import platform
import shutil
import subprocess
import sys
import threading
import warnings
import inspect
import pickle
import weakref
from itertools import chain
from io import StringIO
import numpy as np
from numba import njit, jit, generated_jit, typeof
from numba.cor... |
web_async.py | from . import web
import asyncio
import threading
global_event_loop = asyncio.new_event_loop()
event_loop_executor = threading.Thread(target = lambda: global_event_loop.run_forever())
event_loop_executor.daemon = True
event_loop_executor.start()
class AsyncDispatchInfo(web.DispatchInfo):
def call(self, req):
... |
StatusThread.py | import threading
import time
from PyQt5 import QtCore
class StatusThread(QtCore.QObject):
UpdateProgressSignal = QtCore.pyqtSignal()
def __init__(self, HashThreadOne, HashThreadTwo):
super().__init__()
self.HashThreadOne = HashThreadOne
self.HashThreadTwo = HashThreadTwo
self... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import platform
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
impo... |
server.py | #
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# 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 a... |
TextIO.py | from .IOModule import IOModule
from ..priv.Exceptions import InstructionAccessFault
from ..helpers import int_from_bytes
from threading import Thread
import time
def _window_loop(textIO: 'TextIO'):
try:
import PySimpleGUI as sg
logs = sg.Text(font="monospace")
col = sg.Column([[logs]], si... |
pipe_socks.py | import threading
import select
import time
import ssl
import socket
import utils
import global_var as g
from xlog import getLogger
xlog = getLogger("smart_router")
class PipeSocks(object):
def __init__(self, buf_size=16*1024):
self.buf_size = buf_size
self.sock_dict = {}
self.read_set =... |
train_ac_exploration_f18.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn
Adapted for CS294-112 Fall 2018 with <3 by Michael Chang, some experiments by Greg Kah... |
decorators.py | """
decorators.py: Custom decorators
__author__ = "Fernando P. Lopes"
__email__ = "fpedrosa@gmail.com"
"""
from threading import Thread
def async_decorator(f):
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kwargs=kwargs)
thr.start()
return wrapper
|
aligner.py | # Copyright (c) 2020 Ed Harry, Wellcome Sanger Institute
#
# 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,... |
test.py | """
Copyright (c) College of Mechatronics and Control Engineering, Shenzhen University.
All rights reserved.
Description :
train a imitaor using the carla standard control data.
Author๏ผTeam Li
"""
import tensorflow as tf
import numpy as np
import sys, glob, os
try:
sys.path.append(glob.glob('**/carla-*%d.%d-%s.e... |
report_server.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... |
client_runner.py | import json
import multiprocessing
import os
import platform
import re
import shutil
import signal
import stat
import subprocess
import time
import traceback
import urllib
import uuid
import zipfile
from os.path import expanduser
import psutil
import requests
import yaml
from fedml.cli.edge_deployment.mqtt_manager i... |
pubSubListener.py | import json
import random
import re
import threading
import time
from datetime import datetime
import websocket
from bts import codes # py file containing secret keys and ID info
from bts import settings
from bts.dataBaseClass import Sub
from bts.frontPanel import LED_Blue
#to get user id: https://api.twitch.tv/kra... |
nsgamepad_dragonrise.py | #!/usr/bin/python3
"""
Read from Dragon Rise Arcade Joystick and write to NSGadget.
DRAJ -> Raspberry Pi -> NSGadget -> Nintendo Switch
"""
import os
import time
from sys import exit
from struct import unpack
import threading
import array
from fcntl import ioctl
import serial
from nsgpadserial import NSGamepadSerial, ... |
wordnet_app.py | # Natural Language Toolkit: WordNet Browser Application
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Jussi Salmela <jtsalmela@users.sourceforge.net>
# Paul Bone <pbone@students.csse.unimelb.edu.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A WordNet Browser application whic... |
global_metrics_unittest.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2016 Twitter. 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... |
service.py | # Copyright (c) 2010-2013 OpenStack, LLC.
#
# 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 ... |
alerta_client.py | import logging
import os
import threading
import time
from datetime import datetime, timedelta
from alertaclient.api import Client
from alertanio.config.static_config import AlertaConfiguration, topic_map
from alertanio.database import DBHelper
from alertanio.zulip_client import ZulipClient
LOGGER = logging.getLogge... |
test_remotenotificationlog.py | import json
import threading
from abc import abstractmethod
from http.client import HTTPConnection
from http.server import BaseHTTPRequestHandler, HTTPServer
from threading import Event, Thread
from typing import Callable, List, Sequence
from unittest.case import TestCase
from uuid import UUID
from eventsourcing.inter... |
freetests.py | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2013 Abram Hindle
#
# 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 ... |
test_utils.py | """Utilities shared by tests."""
import collections
import contextlib
import io
import logging
import os
import re
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
import weakref
from unittest import mock
from http.server import HTTPServer
from wsgiref.simple_... |
VoiceActivityDetection.py | import wave
import threading
import numpy as np
import torch
torch.set_num_threads(1)
import torchaudio
import matplotlib.pylab as plt
torchaudio.set_audio_backend("soundfile")
import pyaudio
import time
from io import BytesIO
# import globalVAR
plt.rcParams["figure.figsize"]=(12,3)
model, utils = torch.hub.load(rep... |
Xwars.py | from wariors import Xbots
import json, threading, codecs
def login(name, auth):
bot = Xbots(name, auth)
threading.Thread(target=login, args=('b1','TOKEN_BOT')).start()
print("""
โโโ โโโโ โโโ โโโ โโโโ โโโโ โโโโโ โโโ
โโโ โโโโ โโโ โโโ โโโโ โโโโ โโโโโ โโโ
โโโ โโโโ โโโ โโโ โโโโ โโโโ โโโโโ โโโ
โโโ โโโโโ โ โโโโ โโโโ... |
matrix.py | #
# This is part of "python-cluster". A library to group similar items together.
# Copyright (C) 2006 Michel Albert
#
# This library 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 Foundation; either versi... |
autoreloader.py | import os
import time
import traceback
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler, FileSystemEvent
import subprocess
import shlex
import threading
from plbuilder.paths import SOURCE_PATH
def autobuild():
"""
Starts a process which watches for file system events... |
multithread2.py | """
ไฝฟ็จๅค็บฟ็จ็ๆ
ๅต - ๆจกๆๅคไธชไธ่ฝฝไปปๅก
Version: 0.1
Author: BDFD
Date: 2018-03-20
"""
from random import randint
from threading import Thread
from time import time, sleep
def download_task(filename):
print('ๅผๅงไธ่ฝฝ%s...' % filename)
time_to_download = randint(5, 10)
sleep(time_to_download)
print('%sไธ่ฝฝๅฎๆ! ่่ดนไบ%d็ง' % (f... |
feature_extract.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020 Patrick Lumban Tobing (Nagoya University)
# based on PyTorch implementation for WaveNet vocoder by Tomoki Hayashi (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from __future__ import division
from __future__ import print_... |
process.py | from .logging import debug, exception_log, server_log
import subprocess
import os
import shutil
import threading
try:
from typing import Any, List, Dict, Tuple, Callable, Optional, Union, IO
assert Any and List and Dict and Tuple and Callable and Optional and Union and IO
except ImportError:
pass
def add... |
crawler.py | import logging
import time
import re
import urllib.parse
from queue import Empty
from multiprocessing import Process, Event
from queue import Queue as Queue
from multiprocessing import Queue as MPQueue
from threading import Thread
from enum import Enum
# Used to enable launch as a main
import os.path, sys
sys.path.in... |
caching.py | import datetime
import threading
import time
import cherrypy
from cherrypy.lib import cptools, httputil
class Cache(object):
def get(self):
raise NotImplemented
def put(self, obj, size):
raise NotImplemented
def delete(self):
raise NotImplemented
def clear(... |
upnp.py | import logging
import threading
from queue import Queue
from typing import Optional
try:
import miniupnpc
except ImportError:
pass
log = logging.getLogger(__name__)
class UPnP:
thread: Optional[threading.Thread] = None
queue: Queue = Queue()
def __init__(self):
def run():
t... |
viewing.py | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* --------... |
run_tracker.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import m... |
receiver.py | import serial
import asyncio
import multiprocessing
import subprocess
import sys
import glob
import json
import applescript
def setVolume(v):
subprocess.call(["osascript", "-e set volume output volume "+ str(v)])
return v
def inc_SC(n=1):
applescript.tell.app('System Events', 'tell process "SoundSource" t... |
main.py | import random
import threading
import time
import winsound
import keyboard
def task():
t = threading.currentThread()
while getattr(t, 'do_run', True):
keyboard.press('space')
time.sleep(random.uniform(0.05, 0.1))
keyboard.release('space')
def main():
global thre... |
functors.py | import sys
import subprocess
import utils
import struct
import signal
import os
import time
import threading
# Functors used for evaluation purposes
class EvalFunctors:
def __init__(self, ProbabilityMap, noEdgeProbability, Mapping, entryTemplate, tracerProcess):
self.ProbabilityMap = Probabili... |
io.py | # Copyright (c) 2018 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... |
__init__.py | """
Create ssh executor system
"""
# Import python libs
import base64
import binascii
import copy
import datetime
import getpass
import hashlib
import logging
import multiprocessing
import os
import re
import subprocess
import sys
import tarfile
import tempfile
import time
import uuid
import salt.client.ssh.shell
imp... |
conversion_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... |
test_thread.py | from __future__ import absolute_import
# import common
import unittest
import stackless
import sys
import time
import struct
import _teststackless
from _stackless import _test_nostacklesscall as apply_not_stackless
from support import test_main # @UnusedImport
from support import StacklessTestCase, AsTaskletTestCase... |
Keylogger.py | # Import modules
import os
import win32gui
try:
from threading import Thread
from pynput.keyboard import Key, Listener
except ImportError:
raise SystemExit('Please run โบ pip install pynput')
# Define variables for keylogger
Count = 0
Keys = []
WindowsTitle = ''
# Detected Button Definition
... |
run_model_improved.py | import sys
import threading as threading
from multiprocessing import Process, Queue
import numpy as numpy
import PySide2.QtCharts
from os.path import basename
from PySide2.QtCore import QPoint, Qt, QRect, QTimer
from PySide2.QtWidgets import QAction, QMainWindow, QApplication, QPushButton, QMenu, QFileDialog
from PySi... |
test.py | #!/usr/bin/env python3
#
# unit tests for debugger
import os
import re
import sys
import time
import platform
import threading
import traceback
import subprocess
from struct import unpack
import colorama
sys.path.append('..')
import debugger.lldb as lldb
import debugger.dbgeng as dbgeng
import debugger.DebugAdapter... |
cv2capture.py | ###############################################################################
# OpenCV video capture
# Uses opencv video capture to capture system's camera
# Adapts to operating system and allows configuation of codec
# Urs Utzinger
#
# 2021 Initialize, Remove Frame acces (use only queue)
# 2019 Initial release, bas... |
ssh_com.py |
import logging
import signal
import platform
import paramiko
import json
import os
from pathlib import Path
import subprocess
import threading
import zmq.ssh
class SSHCom:
def __init__(self, worker_exec=None, local_server_id=None, remote_server_id=None,
ssh_local_ip=None, ssh_loca... |
lightcomics.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import time
import datetime
import json
import zipfile
import struct
import imghdr
import platform
import logging
import chardet
import flask
import re
import socket
import threading
import requests
from flask import request
from PIL import Image
from ... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.