source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
remoteloop.py | import array
import asyncio
import errno
import json
import os
import socket
import threading
from . import loop
__all__ = [
"LoopClient",
"LoopServer"
]
def load_fds(sock, msglen):
fds = array.array("i") # Array of ints
msg, ancdata, _, addr = sock.recvmsg(msglen, socket.CMSG_LEN(253 * fds.itemsi... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import commerciumelectro
from commerciumelectro.bitcoin import TYPE_ADDRESS
from commerciumelectro import WalletStorage, Wallet
from commerciumelectro_gui.kivy.i18n import _
from commerciumelectro.p... |
multi.py | import random
import multiprocessing
def list_append(count, id, out_list):
# appends the count of number of processes which takes place at a time
for i in range(count):
out_list.append(random.random())
if __name__ == "__main__":
size = 999
procs = 2
# Create a list of jobs... |
settings.py | __author__ = 'rcj1492'
__created__ = '2016.10'
__license__ = 'MIT'
def load_settings(file_path, module_name='', secret_key=''):
''' a method to load data from json valid files
:param file_path: string with path to settings file
:param module_name: [optional] string with name of module containing... |
train.py | #!/usr/bin/env python
"""
train.py is a training pipeline for training object detection
Created 6/15/17.
"""
__author__ = "Alexander Ponamarev"
__email__ = "alex.ponamaryov@gmail.com"
import tensorflow as tf
import threading
import numpy as np
import time
from os.path import join
from tqdm import trange
from tensorflo... |
chat.py | import websocket
import threading
# Represents connection to Twitch's chat server. Can join multiple channels at once.
# Obtain a Connection by calling connect() or connect_as_guest().
class Connection:
username = None
msg_callback = None
notice_callback = None
roomstate_callback = None
timeout_cal... |
bot.py | #!/usr/bin/env python
import config
import logging
import threading
from PIL import ImageGrab
from telegram import Update, ForceReply
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
logging.basicConfig(format='%(asctime)s %(levelname)s %(name)s: %(message)s', level=logging.I... |
MultiThreadExample.py | #!/usr/bin/env python
# --coding:utf-8--
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import sys
import time
import threading
sys.path.insert(0, '../')
from nebula2.gcl... |
__init__.py | import builtins
import contextlib
import errno
import glob
import importlib.util
from importlib._bootstrap_external import _get_sourcefile
import marshal
import os
import py_compile
import random
import shutil
import stat
import subprocess
import sys
import textwrap
import threading
import time
import unittest
from uni... |
flowboard.py | #!/usr/bin/python3
from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol, listenWS
import bson
import cgi
import cherrypy
import flowboard_auth
import flowboard_posts
import json
import os
import os.path
import pymongo
import pystache
import sys
import threading
from twisted.internet im... |
cnn_util.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... |
state_manager.py | import multiprocessing
import os
import sys
import time
import factom_core.blockchains as blockchains
import p2p_server
from rpc import server as api_server
inbox = multiprocessing.Queue()
def start(network: str):
p2p = multiprocessing.Process(name="p2p", target=p2p_server.run, args=(inbox,))
api = multip... |
gui.py | '''
All components of this library are licensed under the BSD 3-Clause
License.
Copyright (c) 2015-, Algorithmic Robotics and Control Group @Rutgers
(http://arc.cs.rutgers.edu). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided... |
test_failure_2.py | import logging
import os
import signal
import sys
import threading
import time
import numpy as np
import pytest
import ray
from ray.experimental.internal_kv import _internal_kv_get
from ray.ray_constants import DEBUG_AUTOSCALING_ERROR
import ray._private.utils
import ray.ray_constants as ray_constants
from ray.cluste... |
volume.py | import subprocess
from subprocess import PIPE
import threading
import time
import os, sys
class Volume:
def __init__(self, sb, sink = "0"):
self.sb = sb
self.sink = str(sink)
self.running = False
self.moving = False
def init(self):
# We check if we don't have a previo... |
gen_mask.py | #!/usr/bin/env python
# encoding: utf-8
'''
Generate image mask by trained model.
Tasks: Input an image file and output a mask image file.
@author: Cheng-Lin Li a.k.a. Clark
@copyright: 2018 Cheng-Lin Li@Insight AI. All rights reserved.
@license: Licensed under the Apache License v2.0. http://www.apache.org/lice... |
th05.py | import time
import sys
from threading import Thread
from multiprocessing import Process
Rx = 2
Ry = 10**7
def demo1():
print("demo 1")
a,b = [],[]
for i in range(Ry):
a.append(i*2)
b.append(i*2)
print("a[{}] = {}".format(Ry-1,b[Ry-1]))
print("b[{}] = {}".format(Ry-1,... |
base.py | # -*- coding: utf-8 -*-
# BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# 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 ... |
ProcPoka.py | #!/usr/bin/env /usr/bin/python3
# -*- coding: utf-8 -*-
# -----------------------------------------------
# ROS Node
# 棚ボタンの制御
#
# The MIT License (MIT)
# Copyright (C) 2019 myasu.
# -----------------------------------------------
import rclpy
import threading
import time
import datetime
from rclpy.node ... |
main.py | from trade_client import *
from store_order import *
from load_config import *
from new_listings_scraper import *
from collections import defaultdict
from datetime import datetime, time
import time
import threading
import json
import os.path
# loads local configuration
config = load_config('config.yml')
# load nec... |
ModuleDeauth.py | #The MIT License (MIT)
#Copyright (c) 2015-2016 mh4x0f P0cL4bs Team
#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, mo... |
publisher.py | # -*- coding: utf-8 -*-
'''
Listener worker process
'''
from __future__ import absolute_import
# Import pythond stdlib
import os
import signal
import logging
import threading
# Import third party libs
import zmq
import umsgpack
import nacl.utils
import nacl.secret
from prometheus_client import Counter
# Import napal... |
build.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 ... |
sslibev.py | import os
import time
import json
import logging
from subprocess import Popen, DEVNULL
from threading import Thread
from socket import socket, AF_UNIX, SOCK_DGRAM
from . import Server, _Manager
TIMEOUT = 90 # Must > 30
CHECK_PERIOD = 180
class Manager(_Manager):
def __init__(self, print_ss_log=True, manager_... |
websockets_stream.py | import tornado.httpserver
import tornado.websocket
import tornado.concurrent
import tornado.ioloop
import tornado.web
import tornado.gen
import threading
import asyncio
import socket
import numpy as np
import imutils
import copy
import time
import cv2
import os
bytes = b''
lock = threading.Lock()
connectedDevices = s... |
Log.py | import time
import sys
import glob,json
import os
from datetime import datetime
import threading
from Serial import Serialport
from Tkinter import *
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA
from hashlib ... |
ESP_server.py | #p2025845
#Chian ZhengHang
#DISM 1B/01
import sys#Library to exit code anytime
import socket#Library for socket
import threading#Library to do multi-threading
import datetime#for the data and time of
import time#Library to add delay
import smtplib#For sending invoice email
import ssl#For sending invoice emai... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
VIDMAP_train.py | import tensorflow as tf
import h5py
import skvideo.utils
import numpy as np
import sklearn.metrics
import sys
import hashlib
try:
import Queue
except:
import queue as Queue
import threading
import os
from sklearn.externals import joblib
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
sentinel = object()
def md5_f... |
dataloader.py | import os
import torch
from torch.autograd import Variable
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image, ImageDraw
from SPPE.src.utils.img import load_image, cropBox, im_to_torch, im_to_torch_cwd
from opt import opt
from yolo.preprocess import prep_image, pre... |
dispatcher_class.py | """
Central communication agent in the manageability framework responsible
for issuing commands and signals to other tools/agents
Copyright (C) 2017-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import datetime
import json
import platform
import signal
import sys
from logging.config i... |
interactive_shell.py | # -*- coding: UTF8 -*-
import sys
from subprocess import PIPE, Popen
from threading import Thread
from Queue import Queue, Empty
import time
import traceback
ON_POSIX = 'posix' in sys.builtin_module_names
def write_output(out, queue):
try:
for c in iter(lambda: out.read(1), b""):
queue.put(c)
out.close()
e... |
explorer.py | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
collection_replica.py | # -*- coding: utf-8 -*-
# Copyright CERN since 2014
#
# 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 ... |
control.py | # THIS SCRIPT DOES THE FOLLOWING:
# 1. RECEIVE PILOT MESSAGE.
# 2. SPLIT PILOT MESSAGE TO RIGHT MESSAGE AND LEFT MESSAGE (AND MAYBE SERVO MESSAGE).
# 3. OPEN TWO SERIAL PORTS : RIGHT ARDUINO , LEFT ARDUINO (AND MAYBE ARDUINO NANO).
# 4. SEND CORRESPONDING MESSAGES TO CORRESPONDING SERIAL PORTS.
# 5. RECEIVE S... |
resource_sharer.py | #
# We use a background thread for sharing fds on Unix, and for sharing sockets on
# Windows.
#
# A client which wants to pickle a resource registers it with the resource
# sharer and gets an identifier in return. The unpickling process will connect
# to the resource sharer, sends the identifier and its pid, and then ... |
pmt_rates.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et
"""
======================
Mean PMT Rates Monitor
======================
The following script calculates the mean PMT rates and updates the plot.
"""
# Author: Tamas Gal <tgal@km3net.de>
# License: MIT
from datetime import datetime
import io
from coll... |
simple_thread.py | import threading
def do_some_work(val):
print("doing some work in thread")
print("echo:{}".format(val))
return
val = "text"
t = threading.Thread(target=do_some_work, args=(val,))
t.start()
t.join() |
led_component.py | """This module contains the LedComponent type."""
import threading
from raspy.argument_null_exception import ArgumentNullException
from raspy.invalid_operation_exception import InvalidOperationException
from raspy.object_disposed_exception import ObjectDisposedException
from raspy.components.lights.led import Led
fro... |
proton_test.py | #!/usr/bin/env python
# Copyright (c) 2017 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
#
# Test Proton interface (provides AMQP 1.0 messaging support).
#
# Requirements:
# Python library for Qpid Proto... |
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
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
# Creates S3 ... |
test.py | #!/usr/bin/env python
import pysamprof
import threading
import os
import errno
import sys
import subprocess
def start_collection():
counter = 0
while True:
target_path = '%s/results/%s' % (os.getcwd(), counter)
if os.path.exists(target_path):
counter += 1
else:
b... |
arper.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 24 21:03:30 2020
@author: edoardottt
"""
from scapy.all import *
import os
import time
import sys
import threading
import signal
interface = "enp3s0"
target_ip = "192.168.1.2"
gateway_ip = "192.168.1.1"
packet_count = 1000
# set our interface
con... |
Renderer.py | ##########################################################################
#
# Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2011, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... |
async_util.py | # coding=utf-8
"""
@author: ltmit
"""
import sys as _sys
import time
import threading as _th
import traceback as _tb
if _sys.version[0] == '2':
import Queue as _que
else:
import queue as _que
class AsyncHandler(_th.Thread):
def __init__(self, que_size=0):
_th.Thread.__init__(self)
self._que... |
pingit.py | #--------------------------------------------------
# @author: Tran Duc Loi
# @email: loitranduc@gmail.com
# @version: 1.0
# @project: NMS - Jetpjng.com
# @community: Pythonvietnam
#--------------------------------------------------
from threading import Thread
from queue import Queue
import subprocess
import gevent... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
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 selfdrive.car.... |
test_pfin.py | import time
import queue
import threading
import client_wrapper
from socket import *
from pytun import *
'''
me = '192.168.77.2'
he = '192.168.77.10'
server = 'group-zzd.cs305.fun'
'''
addr = ('120.78.166.34', 53)
s = socket(AF_INET, SOCK_DGRAM)
s.settimeout(5)
tun = TunTapDevice(flags... |
main.py | # coding: utf8
import telebot
import func
import connector
from multiprocessing import Process
from message_templates import *
import re
import imgur
commands_validate_pattern = re.compile(r'/[A-Za-z_]+')
processes = {}
token = '655728040:AAFnhcwYKbkBUoWhDJLxaaR3aG4-NY9bQWE'
bot = telebot.TeleBot(token)
c... |
system_simulator.py | from system_executor import SysExecutor
from definition import SingletonType
from threading import Thread
class SystemSimulator(object):
__metaclass__ = SingletonType
_engine = {}
@staticmethod
def register_engine(sim_name, sim_mode='VIRTUAL_TIME', time_step=1):
SystemSimulator._engine[sim_nam... |
util.py | import asyncio
import io
import os
import random
import re
import socket
import subprocess
import tarfile
import threading
import time
from contextlib import contextmanager
from functools import partial as p
from io import BytesIO
from typing import Dict, List
import docker
import netifaces as ni
import yaml
from test... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import base64
import electrum
from electrum.plugins import BasePlugin, hook
from electrum.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, parent, config, name):
BasePlugin.__init__(self, parent, con... |
netcdf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test NetCDF driver support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
#############################################################... |
test_failure.py | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
from ray.experimental.internal_kv import _internal_kv_get
from ray.autoscaler._private.util import DEBUG_AUTOSCALING_ERROR
import ray._private.utils
from ... |
service.py | #!/usr/bin/env python3
# encoding=utf-8
#codeby 道长且阻
#email @ydhcui/QQ664284092
import os
import sys
import time
import datetime
import queue
import threading
import multiprocessing
from celery import Celery
import settings
import models
from core.log import logging
from core.plugin import PluginsManage,BaseH... |
utils.py | # -*- coding: utf-8 -*-
from __future__ import division
import os
import sys
import socket
import signal
import functools
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
from Queue import Queue, Empty
from time import sleep
try:
import simplejson as json
except ImportError:
import json
f... |
Client.py | #!/usr/bin/env python3
import socket
import threading
import time
import sys
from message import Message
import TorzelaUtils as TU
import queue
class Client:
# Configure the client with the IP and Port of the next server
def __init__(self, serverIP, serverPort, localPort, clientId):
# serverIP and serv... |
MSC-RL_3_7.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division
"""
ily
"""
import threading
import numpy as np
import os
import tensorflow as tf
import tensorflow.contrib.slim as slim
import gym
from atari_wrappers import wrap_deepmind
from time import sleep
import random
from replaymemory_1 import Rep... |
ping-pong.py | import sys, os, time
import Queue
import threading
from uMediaServer.uMediaClient import MediaPlayer
from uMediaServer.uMSTest import cmd_line
def proxy_thr(num, recv, send):
while True:
(ev, data) = recv.get()
print '!!! %02d -> %s = %s' % (num, ev, data)
send.put_nowait((ev, data))
def ... |
screen_server.py | import asyncio, threading, os, json
from aiohttp import web
from . import framebuf
class MonoScreenEmu(framebuf.FrameBuffer):
def __init__(self,width,height,name="main"):
# assert width <= 128 and width >= 2
# assert height <= 64 and height >= 2
self.width = width
self.height = heig... |
utils.py | from __future__ import absolute_import, division, print_function
from collections import OrderedDict, defaultdict
import contextlib
import fnmatch
import hashlib
import json
from locale import getpreferredencoding
import libarchive
import logging
import logging.config
import mmap
import operator
import os
from os.path... |
backup.py | import os
from shlex import quote
from colorama import Fore
import multiprocessing as mp
from pathlib import Path
from shutil import copyfile
from .utils import *
from .printing import *
from .compatibility import *
from .config import get_config
def backup_dotfiles(backup_dest_path: str, dry_run: bool = False, verbo... |
dpp-nfc.py | #!/usr/bin/python3
#
# Example nfcpy to wpa_supplicant wrapper for DPP NFC operations
# Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
# Copyright (c) 2019-2020, The Linux Foundation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import struct
import... |
coach.py | # Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
s2e_emulator.py | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import super
from builtins import str
from builtins import int
from future import standard_library
standard_library.install_aliases()
from avatar.emulators.s... |
dispatcher.py | import os
import re
import time
import socket
import argparse
import threading
import socketserver
import helpers
def dispatch_tests(server, commit_id):
while True:
print("trying to dispatch to runners")
for runner in server.runners:
response = helpers.communicate(runner["host"],
... |
Sounder.py | import os
import time
import threading
import tkinter.messagebox
import json
from mutagen.mp3 import MP3
from pygame import mixer
from tkinter import *
from tkinter import ttk
from tkinter.filedialog import askdirectory
# dir
sounderdir = os.getcwd()
# sounderdir = os.path.dirname(sys.executable)
userdir =... |
debbit.py | #!/usr/bin/env python3
import base64
import logging
import os
import platform
import random
import smtplib
import ssl
import sys
import time
import traceback
import urllib.request
import zipfile
from datetime import datetime
from datetime import timedelta
from email import encoders
from email.mime.base import MIMEBase
... |
web_server.py | """
寻找地图上湖泊,路径规划
"""
import threading
import time
import json
import numpy as np
import os
import sys
import copy
root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root_path)
sys.path.append(
os.path.join(
root_path,
'baiduMap'))
sys.path.append(
os.path.j... |
diskover_socket_server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) Chris Park 2017-2019
diskover is released unde... |
thread_property.py | """
A propery object to be used inside a class
Author: Friedrich Schotte
Date created: 2018-11-01
"""
from logging import debug,warn,info,error
__version__ = "1.0"
def thread_property(procedure_name):
"""A propery object to be used inside a class"""
def get(self):
thread = getattr(self,procedure_name+... |
main.py | '''from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
from datetime import datetime
import os
import random
import sys
import threading
import numpy as np
import tensorflow as tf
import tensorflow_io as... |
basic_threading_wo_race_conditions_and_locks.py | import threading
counter_lock = threading.Lock()
printer_lock = threading.Lock()
counter = 0
def worker():
# My job is to increment the counter and print the current count
global counter
with counter_lock:
counter += 1
with printer_lock:
print('The count is %d' % counter)
... |
multiprocessing_log_to_stderr.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
import multiprocessing
import logging
import sys
def worker():
print 'Doing some work'
sys.stdout.flush()
if __name__ == '__main__':
multiprocessing.log_to_stderr(logging.DEBUG)
... |
makedecades.py | import argparse
import collections
from multiprocessing import Process, Queue
from Queue import Empty
from representations.explicit import Explicit
from representations.sparse_io_ref import export_mat_from_dict
from ioutils import mkdir, write_pickle, load_pickle
def get_index(merged_index, year_list, index):
wo... |
scan_cache.py | import os
import threading
import logging
try:
from Queue import Queue, Empty as QueueEmptyException
except ImportError:
from queue import Queue, Empty as QueueEmptyException
from ms_deisotope.data_source import MSFileLoader, ScanBunch
from ms_deisotope.data_source.metadata.file_information import (
Sour... |
mumbleBot.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import threading
import time
import sys
import math
import signal
import configparser
import audioop
import subprocess as sp
import argparse
import os
import os.path
import pymumble_py3 as pymumble
import pymumble_py3.constants
import variables as var
import logg... |
usbBridge.py | #############################################
## usbBridge
#############################################
print('Load usbBridge')
from evdev import InputDevice, categorize, ecodes
import sys, time, json, threading, traceback, asyncio
import noteTool
_parent = sys.modules["__main__"]
#############... |
BaggingLR.py | import multiprocessing
from multiprocessing import Process
import pandas as pd
import numpy as np
import pickle
import math
import random
import time
class BaggingLR(object):
def __init__(self, bagCount, attNum):
self.bagIDs = set(range(bagCount))
self.estmGenerators = dict()
self.columns =... |
client.py | import socket #import socket module
import time
import inputs
import threading
import asyncore
import logging
import json
def receiveData(client):
while(True):
data = client.recv(1024).decode()
#print(data)
def sendData(client):
while(True):
try:
events = inputs.get_gamepa... |
scylla_node.py | # ccm node
from __future__ import with_statement
from datetime import datetime
import errno
import os
import signal
import shutil
import socket
import stat
import subprocess
import time
import threading
import psutil
import yaml
import glob
import re
from six import print_
from six.moves import xrange
from ccmlib i... |
basic03.py | """
主进程从队列中放入键盘输入的数据,紫禁城取出队列中的数据打印出来
"""
import multiprocessing
def proc_fun(queue):
while True:
data = queue.get()
print("\n从队列中取出的数据是: %s" % data)
def main():
queue = multiprocessing.Queue(3)
# 进程的参数是一个queue队列
proc = multiprocessing.Process(target=proc_fun, args=(queue,))
... |
perform.py | import json
import requests
import urllib3
import time
from itertools import islice
from datetime import datetime
from multiprocessing import Process, Lock, Semaphore
import settings
urllib3.disable_warnings()
def dummy_worker(data_chunk, mutex):
with mutex:
time.sleep(1)
class Perform():
def ... |
Demo.py | #!/usr/bin/env python
# license removed for brevity
import rospy
import cv2
import numpy as np
import time
import threading
from std_msgs.msg import String, Float32, Bool
from sensor_msgs.msg import CompressedImage, Imu
import sys
import config as cf
rospy.init_node('Demo', anonymous=True, disable_signals=True)
cf.t1 ... |
test_util_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
WsServer.py | # Some of the code is adapted from https://github.com/IRLL/HIPPO_Gym/
import asyncio, websockets, json, sys
import time
from multiprocessing import Process, Pipe
from coopihc.interactiontask import PipeTaskWrapper
from coopihc.bundle.wrappers import PipedTaskBundleWrapper
# like functools.partial, but with arguments... |
sublert.py | #!/usr/bin/env python
# coding: utf-8
# Announced and released during OWASP Seasides 2019 & NullCon.
# Huge shout out to the Indian bug bounty community for their hospitality.
import argparse
import dns.resolver
import sys
import requests
import json
import difflib
import os
import re
import psycopg2
from tld import g... |
git_rewrite_date.py | from PyQt5 import QtGui, QtWidgets, QtCore, uic
from my_git import *
from threading import Thread
import hashlib, urllib.request
class GitRewriteDate(QtWidgets.QMainWindow):
def __init__(self):
super(GitRewriteDate, self).__init__()
uic.loadUi('main.ui', self)
self.splitter.setStretchFactor(0, 1)
self.splitte... |
views.py | from django.shortcuts import render
from .models import User
from .models import Username
from .forms import Submit
import requests
import json
import threading
from django.shortcuts import redirect
def findUser(username, lis):
for user in lis:
if user['username'] == username:
return user
r... |
listener.py | import time
import uuid
from queue import Queue
from threading import Thread
from tools import logger
import json
from strategies import support_functions
class Listener:
def __init__(self, bot: dict, assets):
"""
The listener receives the data stream coming from the game trough the API. It maint... |
reader.py | import os
import numpy as np
from queue import Queue
from threading import Thread
class PipeReader:
def __init__(self, fd, block_shape, dtype=np.float32):
"""
Continuously reads pipe and saves blocks (with a certain block shape)
in a queue. You need to call pipe_reader.start() to start the... |
main.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import threading
import numpy as np
import signal
import random
import math
import os
import time
from environment.environment import Environment
from model.mod... |
usbcamvideostream.py | from threading import Thread
import cv2
import os
class USBCamVideoStream:
def __init__(self, src=0, name="USBThread"):
self.stream = cv2.VideoCapture(src) # cv2.CAP_DSHOW (для Windows)
cv2.waitKey(1000)
# self.stream.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
# self.stream.set(... |
index.py | """Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import threading
import posixpath
import pkg_resources
import random
import socket
import string
from pip.log import logger
from pip.util import Inf
from pip.util import normalize_name, splitext
from pip.exceptions i... |
main.py | from calendarmanager.calendar_manager import files_to_calendar, filter_events, create_ics_file
from calendarmanager.condition import create_condition
from calendarmanager.util import json_parser, event_printer
from threading import Thread
from calendarmanager import logger
from time import time
from calendarmanager imp... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from a2c.common.vec_env import VecEnv
def worker(remote, env_fn_wrapper):
env = env_fn_wrapper.x()
while True:
cmd, data = remote.recv()
if cmd == 'step':
ob, reward, done, info = env.step(data)
if done:
... |
proxies_generate.py | # -*- coding: utf-8 -*-
#TODO -
import requests
import subprocess as sp
import re
import threading
from bs4 import BeautifulSoup
from .utils import progress_bar
https_xici = "https://www.xicidaili.com/wn/"
http_xici = "https://www.xicidaili.com/wt/"
recv = re.compile(u"已接收 = (\d+)", re.IGNORECASE)
... |
core.py | # -*- coding: utf-8 -*-
#
# 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
... |
test_regrtest.py | """
Tests of regrtest.py.
Note: test_regrtest cannot be run twice in parallel.
"""
import contextlib
import glob
import io
import os.path
import platform
import re
import subprocess
import sys
import sysconfig
import tempfile
import textwrap
import time
import unittest
from test import libregrtest
from test import su... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.