source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
capture.py | from picamera.array import PiRGBArray
from picamera import PiCamera
import numpy as np
from threading import Thread
class PiCameraStream(object):
"""
Continuously capture video frames, and optionally render with an overlay
Arguments
resolution - tuple (x, y) size
framerate - int
v... |
Client.py | #client.py
import socket
import json
import re
from threading import Thread
ADDRESS = ('127.0.0.1',12321)
USERNAME = ""
def init_connection():
connection = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
connection.connect(ADDRESS)
print(connection.recv(1024).decode('utf-8'))
send_msg(connection,'act... |
main.py | from app import client
from threading import Thread
import os
client_thread = Thread(target=client.start, args=())
client_thread.start() |
test_mp_plugin.py | import sys
from nose2 import session
from nose2.compat import unittest
from nose2.plugins.mp import MultiProcess, procserver
from nose2.plugins import buffer
from nose2.plugins.loader import discovery, testcases
from nose2.tests._common import FunctionalTestCase, support_file, Conn
from six.moves import queue
import m... |
mtTkinter.py | '''Thread-safe version of Tkinter.
Copyright (c) 2009, Allen B. Taylor
This module is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... |
acia65c51.py | import sys
import time
import threading
from py65816.utils import db_console
class ACIA():
# acia status register flags
INTERRUPT = 128 # interrupt has occured, read status register to clear
DSREADY = 64
DCDETECT = 32
TDREMPTY = 16
RDRFULL = 8 # receiver data register full
OVERRUN = 4
... |
capture.py | #!/usr/bin/env python
import yaml
import keyboard
import subprocess
import threading
from os import remove, path
from datetime import datetime
from tempfile import NamedTemporaryFile
from pywinauto.application import Application
with open('config.yml', 'r', encoding='utf-8') as file:
CONFIG = yaml.safe_load(file)['... |
alpacastore.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
from datetime import datetime, timedelta
import time as _time
import threading
import asyncio
import alpaca_trade_api as tradeapi
import requests
import pandas as pd
import backtrader as bt... |
mirage.py | import logging
try:
from Queue import Empty
except:
from queue import Empty
from redis import StrictRedis
from time import time, sleep
from threading import Thread
from collections import defaultdict
from multiprocessing import Process, Manager, Queue
from msgpack import packb
from os import kill, getpid
import... |
email.py | from flask import current_app
from flask_mail import Message
from threading import Thread
from app import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body,
attachments=None, sync=False):
msg = ... |
webcam.py | import struct
import six
import collections
import cv2
import datetime
from threading import Thread
from matplotlib import colors
class FPS:
def __init__(self):
# start time, end time, total number of frames
self._start = None
self._end = None
self._numFrames = 0
def start(self... |
play.py | from tkinter import Tk, Button, Label
from random import shuffle
from selenium import webdriver
from selenium.common.exceptions import WebDriverException, NoSuchWindowException
from time import sleep
from threading import Thread
root = Tk()
root.geometry("400x400")
driver = None
def start():
with open('likes_lin... |
stuff.py | #!/usr/bin/env python3
"""
Some useful multiprocessing utilities. Used by other package modules.
"""
__author__ = 'Boris Polyanskiy'
from multiprocessing import Process, Queue, cpu_count
CPU_COUNT = cpu_count()
def worker(queue, func):
"""Queue worker.
Polls the `queue`, if found element in queue - call `... |
getCmdbData.py | #!/usr/bin/python -u
#######################################################
#
# Remedy REST mediator for topology inclusion into ASM
#
# 02/09/21 - Jason Cress (jcress@us.ibm.com)
#
#######################################################
import sys
from httplib import IncompleteRead
import time
import datetime
impor... |
_crypto_collector.py | import time
import requests
from threading import Thread
import numpy as np
import pandas as pd
from mas_tools.api import Binance
api = Binance('', '')
symbols = ['BTCUSDT', 'ETHUSDT', 'BNBETH', 'BNBUSDT', 'BCCUSDT']
period = '1m'
limit = 20
ticks = 0
save_period = 1000
path = 'E:/Projects/market-analysis-system/da... |
test_enum.py | import enum
import doctest
import inspect
import os
import pydoc
import sys
import unittest
import threading
import builtins as bltns
from collections import OrderedDict
from datetime import date
from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto
from enum import STRICT, CONFORM, EJECT, KEEP... |
mqtt-example-test.py | #
# Copyright 2019 Games Creators Club
#
# MIT License
#
import threading
import time
from telemetry_server.telemetry_mqtt_server import MQTTLocalPipeTelemetryServer
from telemetry.telemetry_mqtt import MQTTLocalPipeTelemetryLogger, MQTTTelemetryClient
###############################################################... |
test_waiting_blocking_ring_buffer.py | import unittest
import typing
import threading
import time
from pyring import (
WaitingBlockingRingBuffer,
SequenceNotFound,
ReadCursorBlock,
)
class TestWaitingBlockingRingBuffer(unittest.TestCase):
def setUp(self):
self.ring_buffer = WaitingBlockingRingBuffer
def test_can_create_with_de... |
thread.py | """
membagi task secara manual ke 3 thread
masing-masing thread mengakses shared memory `data`
"""
import threading
import time
import random
data = range(1, 1001)
def worker(name, data):
for i in data:
time.sleep(random.random())
print(f"{name}: {i*10}")
threads = []
thread = threading.Thread(ta... |
EWSv2.py | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import sys
import traceback
import json
import os
import hashlib
from datetime import timedelta
from cStringIO import StringIO
import logging
import warnings
import subprocess
import email
from requests.exceptions import... |
joy_teleop.py | #!/usr/bin/env python
import importlib
import rospy
import genpy.message
from rospy import ROSException
import sensor_msgs.msg
import actionlib
import rostopic
import rosservice
from threading import Thread
from rosservice import ROSServiceException
import numpy as np
class JoyTeleopException(Exception):
pass
'... |
mic.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... |
remove_hair.py | from skimage import io
from hair_removal import remove_and_inpaint
import os
from multiprocessing import Process, Value
FOLDER = '/home/arthur/Programs/datasets/ISIC_2017_RESIZED/ISIC_2017_TRAINING'
counter = Value('i', 0)
def chunkIt(seq, num):
avg = len(seq) / float(num)
out = []
last = 0.0
while ... |
test_setup.py | """Test component/platform setup."""
# pylint: disable=protected-access
import asyncio
import os
from unittest import mock
import threading
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_COMPONENT_LOADED
import homeassis... |
task.py | """ Backend task management support """
import itertools
import logging
import os
import sys
import re
from enum import Enum
from tempfile import gettempdir
from multiprocessing import RLock
from threading import Thread
from typing import Optional, Any, Sequence, Callable, Mapping, Union, List
try:
# noinspection ... |
Press_multiprocess_NO-INTODB.py | #
# Copyright 2005-2018 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovern... |
downloader.py | import requests
import os
from bs4 import BeautifulSoup
from PIL import Image
import shutil
import time
import re
import threading
import sys
def progress():
global x
i=0
animation = "|/-\\"
while x==0:
sys.stdout.write("\rDowloading... %s" %animation[i % len(animation)])
sys.stdout.flush()
i+=1
time.sleep... |
tb.py |
import os
import sys
import argparse
import numpy as np
import tensorflow as tf
import threading
import time
import copy
import multiprocessing
from multiprocessing import Process
from multiprocessing import Pool
############
# NOTE: This has to come before any module that loads the c code
# before, this came after... |
server.py | import json
import multiprocessing
import os
import shutil
import time
from multiprocessing import Event, Process, Queue
from multiprocessing.synchronize import Event as Event_
from pathlib import Path
from pprint import pprint # pylint: disable=unused-import
from queue import Empty, Full
from queue import Queue as Qu... |
core.py | from __future__ import absolute_import, division, print_function
from collections import deque, defaultdict
from datetime import timedelta
import functools
import logging
import six
import sys
import threading
from time import time
from typing import Any, Callable, Hashable, Union
import weakref
import toolz
from tor... |
optimizer_tcp_manager.py | import yaml
import os
import subprocess
import socket
import json
import logging
import time
import math
from threading import Thread
from retry import retry
from .solver_response import SolverResponse
class OptimizerTcpManager:
"""Client for TCP interface of parametric optimizers
This class is used to start ... |
ion_optics_manager.py | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import platform
import os
import re
import sys
import copy
import json
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import ... |
Thread1.py | import threading, time
def afficheA():
i = 0
while i<10:
print('a')
time.sleep(0.3)
i+=1
def afficheB():
i = 0
while i<10:
print('b')
time.sleep(0.3)
i+=1
a = threading.Thread(target=afficheA, name="Thread A") #Sans les parenthèses.
b =... |
test_model.py | from collections import Counter
import pytest
import threading
import time
from thinc.api import Adam, CupyOps, Dropout, Linear, Model, Relu
from thinc.api import Shim, Softmax, chain, change_attr_values
from thinc.api import concatenate, prefer_gpu, set_dropout_rate
from thinc.api import with_debug, wrap_model_recursi... |
test_handlers.py | import re
import threading
import urllib
import pytest
import requests
from alexa_client.refreshtoken import handlers, helpers, http_server
@pytest.fixture(scope='session')
def server():
return http_server.AmazonLoginHttpServer(
server_address=('localhost', 9000),
RequestHandlerClass=handlers.Am... |
server.py | """Message service"""
import asyncio
import logging
import socket
import time
from collections import deque
from multiprocessing import Event, Lock, Process, synchronize
from typing import Deque, Dict, Set
from uuid import uuid4
from .client import Client, LOCALHOST
from .connection_wrapper import NoData, NotMessage,... |
core.py | from __future__ import absolute_import, division, print_function
from collections import deque, defaultdict
from datetime import timedelta
import functools
import logging
import six
import sys
import threading
from time import time
from typing import Any, Callable, Hashable, Union
import weakref
import toolz
from tor... |
example.py | from runner.hpc import hpc
from runner.manager import manager
from multiprocessing import Process
def func2(man):
procs = []
print ("func2 running")
p = hpc("lsf", cmd="./test 1400000000", mem=1000, out="test_c2.o", err="test_c2.e" )
procs.append(p)
man.start(procs)
def func1(man):
procs = []
... |
core.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PY4WEB - a web framework for rapid development of efficient database driven web applications"""
# Standard modules
import argparse
import cgitb
import code
import copy
import datetime
import functools
import importlib.util
import importlib.machinery
import inspect
impor... |
LaoMaoxsAPI.py | from API import HttpUtil, UrlConstants
from API.AesDecrypt import decrypt, example
from instance import *
import threading
# from rich.progress import DownloadColumn, TextColumn, Progress, BarColumn, TimeRemainingColumn
class Download:
def __init__(self):
self.bookid = ''
self.bookName = ""
... |
thread.py | from pebble import concurrent
def run_in_thread(fn):
def run(*k, **kw):
t = threading.Thread(target=fn, args=k, kwargs=kw)
t.start()
return t # <-- this is new!
return run
@concurrent.thread
def plus(input):
return input+1
print(plus(1).result())
print([0][1:])
|
server.py | import pickle
import random
import socket
import threading
import time
import os
from player import Player
from settings import *
HEADER = 64
FORMAT = 'utf-8'
DISCONNECT_MSG = "DISCONNECT"
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
IP = "0.0.0.0"
PORT = int(os.getenv("PORT", 48645))
ADDR = (IP, PORT... |
Network_3_0.py | import argparse
import socket
import threading
from time import sleep
import random
import RDT_3_0
## Provides an abstraction for the network layer
class NetworkLayer:
# configuration parameters
prob_pkt_loss = 0.2
prob_byte_corr = 0
prob_pkt_reorder = 0
# class variables
sock = None
conn... |
GUI.py | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 30 01:24:31 2019
@author: Gautam Pala
"""# -*- coding: utf-8 -*-
"""
Created on Sat Nov 30 00:51:11 2019
@author: Gautam Pala
"""
import tkinter as tk
import speech_recognition as sr
import requests
from bs4 import BeautifulSoup
from gtts import gTTS
i... |
core.py | #!/usr/bin/env python3
"""Core functions for Obozrenie Game Server Browser."""
import os
import threading
from obozrenie.global_settings import *
from obozrenie.global_strings import *
from obozrenie.option_lists import *
from obozrenie import i18n, helpers, adapters, launch
class GameTable:
"""
The Game ... |
test_server.py | # -*- coding: utf-8 -*-
import pytest
import requests
import os
from rasa_nlu.server import RasaNLUServer
from rasa_nlu.config import RasaNLUConfig
from multiprocessing import Process
import time
import json
import codecs
class ResponseTest():
def __init__(self, endpoint, expected_response, payload=None):
... |
utils.py | # Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import torch, glob, os, numpy as np, math
from .sparseConvNetTensor import SparseConvNetTensor
from .metadata import Metada... |
common.py | ###
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from datetime import datetime as dt
import functools
import os
import slash
import subprocess
import threading
import time
def sorted_by_resolution(cases):
size = lambda kv: kv[1]["width"] * kv[1]["height"]
return ... |
Violentpasscrack.py | # -*- coding:utf-8 -*-
"""
暴力破解zip压缩包的密码
"""
import itertools
import zipfile
import os
import shutil
from threading import Thread
def Mkdir(zipname,unzippath,unzipat,r):
"""
zipdir: 压缩包的存放路径
zipname: 压缩文件名
unzippath: 解压缩后的存放路径
"""
try:
if r:
if os.path.isdir(unzipat):
... |
Tornado_Websocket_Server.py |
import os
import sys
import socket
import ujson
import time
import json
import random as rnd
import datetime as dt
import pickle
from os import walk
import tornado.httpclient as httpClient
import tornado.httpserver
import tornado.websocket
import tornado.ioloop
import tornado.web
import tornado.websocket
import torn... |
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... |
heartbeat.py |
import os
import sys
import time
import signal
import threading as mt
# ------------------------------------------------------------------------------
#
class Heartbeat(object):
# --------------------------------------------------------------------------
#
def __init__(self, uid, timeout, frequency=1):... |
apps.py | import time
import logging
import multiprocessing
from django.apps import AppConfig
from django.conf import settings
from substrapp.ledger.api import invoke_ledger
logger = logging.getLogger(__name__)
def _register_node(channel_name):
# We try until success, if it fails the backend will not start
while True:... |
extensions.py | #
# Copyright 2014 Grupo de Sistemas Inteligentes (GSI) DIT, UPM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... |
custom_run_local.py | import asyncio
import json
import os
from collections import deque
from multiprocessing import Process
from pathlib import Path
from typing import List, Set
from arenaclient.proxy.frontend import GameRunner
from arenaclient.proxy.server import run_server
class RunLocal:
def __init__(self):
self.server_pr... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
client_test.py | # Copyright 2020 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 applicable ... |
test_driver.py | #!/usr/bin/env python
# Test driver loads test configurations and then lanuchs browsers to test.
import os, sys, logging, argparse, pprint, json, time
from chrome_loader import ChromeLoader
from firefox_loader import FirefoxLoader
from multiprocessing import Process, JoinableQueue
import threading, signal
from loader i... |
scripts_regression_tests.py | #!/usr/bin/env python
"""
Script containing CIME python regression test suite. This suite should be run
to confirm overall CIME correctness.
"""
import glob, os, re, shutil, signal, sys, tempfile, \
threading, time, logging, unittest, getpass, \
filecmp
from xml.etree.ElementTree import ParseError
LIB_DIR =... |
test_webhooks.py | import asyncio
import pytest
from urllib.parse import urlparse
from aiohttp import web
from aiotg.mock import MockBot
from threading import Thread, Event
# ⚠️ beware, this test is a total hack ⚠️
webhook_url = 'http://localhost:6666/webhook'
server_started = Event()
def bot_loop(bot):
url = urlparse(webhook_ur... |
generator.py | from __future__ import absolute_import
import argparse
import logging
import time
import threading
from fortrace.utility.logger_helper import create_logger
from fortrace.generator import Generator
from fortrace.core.vmm import Vmm
from fortrace.core.vmm import GuestListener
from six.moves import range
# Create logger... |
run_silent_if_successful.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import pty
import signal
import subprocess
import sys
import threading
master_pty_fd, slave_pty_fd = pty.op... |
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.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node
from electrum import constants
from electrum.i18n import... |
testrunner.py | #!/usr/bin/env python3
import base64
import gzip
from http.client import BadStatusLine
import os
import urllib.request, urllib.error, urllib.parse
import sys
import threading
from os.path import basename, splitext
from multiprocessing import Process
from pprint import pprint
sys.path = ["lib", "pytests", "pysystests"]... |
pyPeekTCP.py | # === Start Python 2/3 compatibility
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import * # noqa pylint: disable=W0401, W0614
from future.builtins.disabled import * # noqa pylint: disable=W0401, W0614
# === End Python 2/3 compatibility
from future import... |
getData.py | print("loading...")
import getInfo, getIpPort, time, socket, sys, json, tkinter, win32api, win32con, pywintypes, threading, os, watchdogLocal, keybindsLocal
from ctypes import *
config={
"config": {
"updateRate": 60,
"PfromTop": "1000",
"PfromSide": "1720",
"TextColour": "green",
"BGColour": "black"... |
n1ql_fts_integration_phase2.py | import json
import threading
from lib.membase.api.rest_client import RestConnection
from lib.remote.remote_util import RemoteMachineShellConnection
from membase.api.exception import CBQError
from pytests.fts.fts_base import CouchbaseCluster
from pytests.security.rbac_base import RbacBase
from .tuq import QueryTests
im... |
test_program_for_PhidgetBrushlessDCmotorDCC1100controller_ReubenPython2and3Class.py | # -*- coding: utf-8 -*-
'''
Reuben Brewer, Ph.D.
reuben.brewer@gmail.com,
www.reubotics.com
Apache 2 License
Software Revision D, 11/12/2021
Verified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet).
'''
__author__ = 'reuben.brewer'
from PhidgetBrus... |
server.py | #!/usr/bin/env python
import sys
import io
import os
import shutil
from subprocess import Popen, PIPE
from string import Template
from struct import Struct
from threading import Thread
from time import sleep, time
from http.server import HTTPServer, BaseHTTPRequestHandler
from wsgiref.simple_server import make_server
... |
main2.py | import numpy as np
from numpy import linalg as la
import time
import subprocess
from streaming import Oja
from streaming import BlockOrthogonal
import MovieLens
from multiprocessing import Process
from multiprocessing import Array
def runBOI(k,id,acc,allT):
boi=BlockOrthogonal(
k=k,
strea... |
standalone_test.py | """Tests for acme.standalone."""
import http.client as http_client
import socket
import socketserver
import threading
import unittest
from typing import Set
from unittest import mock
import josepy as jose
import requests
from acme import challenges
from acme import crypto_util
from acme import errors
import test_uti... |
sub_image.py | #!/usr/bin/env python
from threading import Thread
import cv2
import rospy
from std_msgs.msg import String, Empty
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Image
class CImageSubscriber:
def __init__(self, topic):
rospy.init_node('test_image_sub', anonymous=True)
rate = rosp... |
exp_milling.py | """Makes BlueBot around two vertically stacked lights
Contains generic vision based functions that can be used elsewhere including homing and depth control. Also contains depth control using the depth sensor and logger functions.
Attributes:
caudal (): Fin object for caudal fin
depth_ctrl (bool): Depth contro... |
process_replay.py | #!/usr/bin/env python3
import capnp
import os
import sys
import threading
import importlib
import time
if "CI" in os.environ:
def tqdm(x):
return x
else:
from tqdm import tqdm # type: ignore
from cereal import car, log
from selfdrive.car.car_helpers import get_car
import selfdrive.manager as manager
import ... |
my_youtube_dl.py | from __future__ import unicode_literals
import os
import traceback
import tempfile
import json
from glob import glob
from datetime import datetime
from threading import Thread
from enum import Enum
from framework.logger import get_logger
import framework.common.celery as celery_shutil
package_name = __name__.split('... |
basic.py | # Original work Copyright 2017 Palantir Technologies, Inc. (MIT)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file exc... |
extractor.py | # Copyright (c) 2020 Sarthak Mittal
#
# 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, dist... |
controller.py | import re
import time
import traceback
from threading import Thread
from typing import List, Set, Type
from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext
from bauh.api.abstract.disk import DiskCacheLoader
from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstrac... |
train.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import os
import random
import signal
import torch
import distributed
from transformers import BertTokenizer
from models import data_loader
from models.data_loader import load_dataset
from models.optimizers import... |
klee_sym_explorer.py | import ConfigParser
import multiprocessing
import subprocess
import os
import sys
import utils
import signal
from utils import bcolors
def se_info(s):
print bcolors.HEADER+"[KleeSym-Info]"+bcolors.ENDC," {0}".format(s)
class SymExplorer:
def __init__(self, config, target):
self.jobs = {}
self... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
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 test.support
import test.... |
motion.py | import io
import logging
import os
import threading
import uuid
import picamera
from PIL import Image
from PIL import ImageChops
from PIL import ImageDraw
from PIL import ImageOps
import config_service
import s3_service
log_level = config_service.get_config("log_level")
logging.basicConfig(level=getattr(logging, log... |
deamon.py | import time
import threading
def my_fun(name):
print(f'started {name}')
time.sleep(5)
print(f'ended {name}')
return True
if __name__ == '__main__':
print('main start')
t = threading.Thread(target=my_fun, args=['pythonista'], daemon=True)
t.start()
print(f'main end')
|
conn.py | from multiprocessing import Process
import time
import redis
def redis_process_no_tran(key):
server_ip = "192.168.64.4"
bunny_node1_port = 6379
pool1 = redis.ConnectionPool(host=server_ip,
port=bunny_node1_port,
db=0,
... |
runtests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import codecs
from datetime import datetime
import io
import json
import os
import shutil
import sys
from difflib import unified_diff # python's own diff library
from multiprocessing import Process, Queue, freeze_su... |
views.py | """Copyright 2008 Orbitz WorldWide
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, software... |
util.py | from typing import (
Any,
Callable,
cast,
Dict,
IO,
Iterable,
List,
Optional,
Tuple,
TypeVar,
Union,
)
import io
import json
import shutil
import time
import threading
from io import BytesIO, TextIOWrapper
import pandas as pd
from scipy import sparse
import torch
from accern_... |
kaldi_io.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014-2016 Brno University of Technology (author: Karel Vesely)
# Licensed under the Apache License, Version 2.0 (the "License")
import numpy as np
import sys, os, re, gzip, struct
#################################################
# Adding kaldi tools to shel... |
lambda_executors.py | import base64
import contextlib
import glob
import json
import logging
import os
import re
import subprocess
import sys
import threading
import time
import traceback
from multiprocessing import Process, Queue
from typing import Dict, Tuple, Union
from localstack import config
from localstack.constants import (
THU... |
m_client.py | from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
from encryption import *
from os import urandom
import rsa,os,shutil,time
KEY_LENGTH = 1024
BUFFER_SIZE = 4096
HOST = 5003
FILENAME = None
FOLDER = os.path.dirname(os.path.realpath(__file__)) + '\\files'
def receive(socket, aeskey):
'... |
serve.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import binascii
import os
import socket
import sys
import tempfile
import ... |
engine.py | # -*- coding: utf-8 -*-
#
# This file is part of the python-chess library.
# Copyright (C) 2012-2018 Niklas Fiekas <niklas.fiekas@backscattering.de>
#
# 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 Software Foundat... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific Python Development Environment
=====================================================
Developped and maintained by the Spyder Pro... |
x10d.py | #!/usr/bin/env python
from daemon import Daemon, SerialDispatcher
from serial import Serial
import api
from threading import Thread
import sys
def callback(event):
if event:
print(str(event))
def listen(daemon):
while True:
house, unit, act = input().split()
unit = int(unit)
i... |
__main__.py | import sys
if sys.version_info[0] != 3:
sys.exit( "[~] Only Version 3 Supported!" )
import optparse
import re
import os
import socket
import time
import ssl
import csv
import requests
import random
import signal
import threading
import string
from dns import resolver
from subrake.pull import PULLY
from subrake.parser ... |
main.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import nested_scopes
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import multiprocessing
import platfo... |
auto_test.py | """Tests for letsencrypt-auto"""
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from contextlib import contextmanager
from functools import partial
from json import dumps
from os import chmod, environ
from os.path import abspath, dirname, join
import re
from shutil import copy, rmtree
import socket
impo... |
plugs_test.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 agre... |
test_http.py | # -*- encoding: utf-8 -*-
import collections
import email.parser
import platform
import socket
import threading
import time
import pytest
import six
from six.moves import BaseHTTPServer
from six.moves import http_client
import ddtrace
from ddtrace.internal import compat
from ddtrace.profiling import exporter
from ddt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.