source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
plant_view.py |
from remi.gui import *
import threading, random, time
class Container( Container ): #cheak:Maybe change class name to name of root container
def __init__(self, AppInst=None, *args, **kwargs):
super().... |
MangatownClass.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# Import required modules
import requests
from bs4 import BeautifulSoup
import re
import threading
class Mangatown:
def __init__(self,):
self.lock = threading.Lock()
self.Mangalink = ''
self.manga_name = 'No Name'
def... |
server.py | from multiprocessing import Process
from fastapi import FastAPI, WebSocket
from listenerImplementation import rabbitMQ_Implementation as Listener
import data_handler as d_handler
import query_handler as q_handler
from models import *
from constants import *
# ----------- App initialisation ----------------------------... |
test_nachi_robot.py | from mock import patch
import socket
import rospy
import sys
from struct import pack, unpack
import time
import math
from threading import Thread, currentThread
from sensor_msgs.msg import JointState
import src.drivers.nachi_robot
from std_srvs.srv import EmptyRequest
from rosweld_drivers.msg import Move, RobotState
fr... |
data_loader.py | # Original code from https://github.com/araffin/robotics-rl-srl
# Authors: Antonin Raffin, René Traoré, Ashley Hill
from __future__ import absolute_import, division, print_function
import random
import time
from multiprocessing import Process, Queue
import cv2 # pytype: disable=import-error
import imgaug
import nump... |
codec.py | #
# Copyright (c) 2016-2017, The OpenThread 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 re... |
rkclusterlock_sample.py | import time
from threading import Thread, current_thread
from rkclusterlock import RKClusterLock
def runClient():
#rlock = RKClusterLock('localhost', 9191,'FKAPP')
rlock = RKClusterLock('13.251.32.176', 9191,'FKAPP')
cur_thread = current_thread()
while 1:
data = ""
resp, data = rlock.... |
mupen64plus_env.py | import sys
PY3_OR_LATER = sys.version_info[0] >= 3
if PY3_OR_LATER:
# Python 3 specific definitions
from http.server import BaseHTTPRequestHandler, HTTPServer
else:
# Python 2 specific definitions
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import abc
import array
from contextlib im... |
load14yidata.py | """
加载14亿数据并存入数据库
by judy 2020/06/17
email和pwd设置为长字符串
"""
import queue
import threading
import time
import traceback
from pathlib import Path
import pymysql
class MailSecret(object):
def __init__(self):
self.datafile_queue = queue.Queue()
self.res_queue = queue.Queue()
self.data_path = P... |
connection.py | # Copyright (c) 2020 DeNA Co., Ltd.
# Licensed under The MIT License [see LICENSE for details]
import io
import struct
import socket
import pickle
import threading
import queue
import multiprocessing as mp
import multiprocessing.connection as connection
def send_recv(conn, sdata):
conn.send(sdata)
rdata = co... |
run.py | import threading
import os
def process():
os.sys('conda activate py3.7')
os.sys('G:\code\Projects\AI\Competation\Kaggle\003_MNIST> & D:/ProgramData/Anaconda3/envs/py3.7/python.exe g:/code/Projects/AI/Competation/Kaggle/003_MNIST/tf_MNIST.py')
for i in range(3):
t1 = threading.Thread(target=process, args... |
cashacct.py | ##!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Electron Cash - A Bitcoin Cash SPV Wallet
# This file Copyright (c) 2019 Calin Culianu <calin.culianu@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to... |
caffe_mnist_client.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
python_lang.py | """
**Source** Kevin Markham https://github.com/justmarkham/python-reference
"""
###############################################################################
# Import libraries
# ----------------
#
# 'generic import' of math module
import math
math.sqrt(25)
# import a function
from math import sqrt
sqrt(25) ... |
bot.py | import socket
import time
import threading
from lib.evil import bitcoin_mine, harvest_user_pass
from lib.p2p import find_bot, bot_server
from lib.files import download_from_pastebot, filestore, p2p_upload_file, save_valuable, upload_valuables_to_pastebot, valuables
def p2p_upload(fn):
sconn = find_bot()
sconn.sen... |
Chap10_Example10.28.py | from threading import *
class abc:
def __init__(self,seat_available):
self.seat_available = seat_available
self.mylock = Lock()# LO1
print(type(self.mylock))
def abc_reserveseat(self, seat_required):
self.mylock.acquire()# LO2
print("Number of seats remaining : ", self.se... |
parasol.py | # Copyright (C) 2015-2021 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... |
lam_helper.py | import threading
import collections
from rplidar import RPLidar
try:
import Queue
except ImportError:
import queue as Queue
class AsynchronousGenerator:
"""
The AsynchronousGenerator class is used to buffer output of a
generator between iterable.__next__ or iterable.next calls. This
allows the... |
chameleon.py | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans, see LICENSE.rst.
import RPi.GPIO as GPIO
import base64
import json
import random
import time
import urllib2
from datetime import datetime
from threading import Thread
BASE_URL = 'https://jenkins.lizard.net/job/nens/job'
USERNAME = 'sa_stoplicht_jenk'
PASSWORD = 'A9T... |
wxTerminal.py | #!/usr/bin/env python
#
# A simple terminal application with wxPython.
#
# (C) 2001-2020 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
from serial.tools.miniterm import unichr
import serial
import threading
import wx
import wx.lib.newevent
import wxSerialConfigDialog
impor... |
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 *nibabies* settings.
This module implements the memory structures to keep a consistent, singleton config.
Settings are passed across processes via filesyst... |
scanner1.py | import socket
import sys
import threading
import queue
import time
from datetime import datetime
print("""
*************************************************************
* ____ ____ ____ ___ ____ ____ ____ _ _ _ _ ____ ____ *
* |__] | | |__/ | [__ | |__| |\ | |\ | |___ |__/ *
* | |__| | \ | _... |
main .py | import threading
import tkinter as tk
from tkinter import messagebox
import time
import queue
def running(queue):
for x in range(5):
text = 'message ' + str(x)
print('PUT:', text)
queue.put(text)
time.sleep(4)
queue.put('last')
def check_queue():
global t
tex... |
setup_window.py | #
# Copyright (C) 2016 UAVCAN Development Team <uavcan.org>
#
# This software is distributed under the terms of the MIT License.
#
# Author: Pavel Kirienko <pavel.kirienko@zubax.com>
#
import sys
import glob
import time
import threading
import copy
from .widgets import show_error, get_monospace_font
from PyQt5.QtWid... |
test_cuda.py | from itertools import repeat, chain, product
from typing import NamedTuple
import collections
import contextlib
import ctypes
import gc
import io
import pickle
import queue
import sys
import tempfile
import threading
import unittest
import torch
import torch.cuda
import torch.cuda.comm as comm
from torch.nn.parallel i... |
BlinkCount.py | import threading as thread;
import time;
import Project.OpenCV.mysql as db;
def StartThreading():
global second, flag;
flag = True;
second =0;
t = thread.Thread(target=Timer)
t.start();
def Timer ():
global second ,flag;
check5min, sum, avg = 0, 0, 0.0;
while True :
while flag... |
server.py | import select
import socket
import threading
import copy
import uuid
from ceptic.network import SocketCeptic
from ceptic.common import CepticRequest, CepticResponse, CepticStatusCode
from ceptic.common import command_settings
from ceptic.endpointmanager import EndpointManager, EndpointManagerException
from ceptic.cert... |
__init__.py | """
Cobra RMI Framework
Cobra is a remote method invocation interface that is very "pythony". It is
MUCH like its inspiration pyro, but slimmer and safer for things like threading
and object de-registration. Essentially, cobra allows you to call methods from
and get/set attributes on objects that exist on a remote s... |
test_file2k.py | import sys
import os
import unittest
import itertools
import time
from array import array
from weakref import proxy
try:
import threading
except ImportError:
threading = None
from test import test_support
from test.test_support import TESTFN, run_unittest
from UserList import UserList
class AutoFileTests(unit... |
socketTestServer.py | #!/usr/bin/env python
#-*- encoding:utf-8 -*-
import sys
import socket
import threading
import time
def tcplink(sock, addr):
print 'Accept new connection from %s:%s...' % addr
sock.send('Welcome!')
while True:
data = sock.recv(1024)
time.sleep(1)
if data == 'exit' or not data:
... |
gui.py | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Raspberry Pi Sense HAT Emulator library for the Raspberry Pi
# Copyright (c) 2016 Raspberry Pi Foundation <info@raspberrypi.org>
#
# This package is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published b... |
server_ping_pong_task.py | import csv
import json
import os
import threading
from time import time
import pygame
from common import record_metadata, request_clients_end
from config import CLIENT_WINDOW_HEIGHT, CLIENT_WINDOW_WIDTH, UPDATE_RATE
from network import receive, send
from .config_ping_pong_task import (COUNT_DOWN_MESSAGE, SECONDS_COUN... |
utils.py | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2017, Battelle Memorial Institute.
#
# 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... |
test_rest_v2_0_0.py | import json
import random
import string
import subprocess
import unittest
from multiprocessing import Process
import requests
import sys
import time
from dateutil.parser import parse
from test.apiv2.rest_api import Podman
PODMAN_URL = "http://localhost:8080"
def _url(path):
return PODMAN_URL + "/v2.0.0/libpod"... |
thread_pool.py | # SPDX-FileCopyrightText: 2020 Splunk Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""
A simple thread pool implementation
"""
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import object
import threading
import queue
im... |
start.py | # Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import logging
import setproctitle
import bigchaindb
from bigchaindb.lib import BigchainDB
from bigchaindb.core import App
from bigchaindb.web import server, websoc... |
main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import json
import telegram.ext
import telegram
import sys
import datetime
import os
import logging
import threading
# reload(sys)
# sys.setdefaultencoding('utf8')
Version_Code = 'v1.0.0'
logging.basicConfig(level=logging.INFO,
format='%(asct... |
util.py | import webbrowser
from threading import Thread
from time import sleep
import os
def open_browser_tab(url):
def _open_tab():
sleep(1)
webbrowser.open_new_tab(url)
thread = Thread(target=_open_tab)
thread.daemon = True
thread.start()
def list_pdf(path):
for (dirpath, dirnames, fil... |
web_app_mapper.py | import Queue
import threading
import os
import urllib2
threads = 10
target = "http://xperblueray.com"
directory = "/usr/blueray/Downloads"
filters = [".jpg",".gif","png",".css"]
os.chdir(directory)
web_paths = Queue.Queue()
for r,d,f in os.walk("."):
for files in f:
remote_path = "%s/%s" % (r,files)
... |
server.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
tk_zzc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = 'AJay'
__mtime__ = '2019/6/22 0022'
"""
import psutil
from tkinter import messagebox
from time import sleep
import threading
import tkinter as tk
import os
from queue import Queue
from tkinter import *
from tkinter import scrolledtext
from tkinter imp... |
sawyer_host_RMH.py | #!/usr/bin/env python
import roslib
roslib.load_manifest('sawyer_rr_bridge')
import rospy
import intera_interface
from std_msgs.msg import Empty
import sys, argparse
import struct
import time
import RobotRaconteur as RR
import thread
import threading
import numpy
from geometry_msgs.msg import (
PoseStamped,
P... |
runtests.py | #!/usr/bin/env python
#
# Copyright (c) 2009, 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. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
impor... |
main.py | #!/usr/bin/python
import paho.mqtt.client as paho
import psutil
import pywapi
import dweepy
import signal
import sys
import time
import pyupm_grove as grove
from TH02 import *
from flask import Flask
from flask_restful import Api, Resource
from threading import Thread
DeviceID = "90b68610b05b"
#RESTFull support cla... |
client.py | # built in
import socket
import os.path
from time import sleep
import logging
import zlib
from queue import deque
import threading
from typing import List
# my own
from src.utilities import rsa_utility
from src.utilities import AESCipher
from src.utilities.config_utility import network_configuration_loader
# dependen... |
train.py | from dataloader import EvalDataset, TrainDataset, NewBidirectionalOneShotIterator
from dataloader import get_dataset
import argparse
import os
import logging
import time
backend = os.environ.get('DGLBACKEND')
if backend.lower() == 'mxnet':
import multiprocessing as mp
from train_mxnet import load_model
fr... |
callbacks_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
main.py | from drivebuildclient.AIExchangeService import AIExchangeService
from drivebuildclient.aiExchangeMessages_pb2 import SimulationID, VehicleID
service = AIExchangeService("defender.fim.uni-passau.de", 8383)
ego = VehicleID()
ego.vid = "ego"
non_ego = VehicleID()
non_ego.vid = "nonEgo"
def start(sid: SimulationID, vid:... |
processes.py | from subprocess import PIPE, STDOUT, CalledProcessError, Popen
from threading import Thread
class ProcessesContextManager:
"""A context manager that kills any processes given to it on exit from its context."""
def __init__(self, processes):
self.processes = processes
def __enter__(self):
... |
ui.py | import wx
import cv2
import numpy as np
import core
import matplotlib.pyplot as plt
from multiprocessing import Process
IMAGE = None
IMAGE_BUFFER = None
ANALYSIS = None
class AppFrame(wx.Frame):
def __init__(self, parent, title):
super().__init__(parent, title=title, size=(1400, 900))
self.ini... |
main.py | # DIY Async
# Examples of Async use network service(i.e., reading a web API), database retrieve
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
# def countdown(n):
# while n > 0:
# print('Dow... |
driver 4-4-2019.py | import tkinter as tk, threading
from tkinter import *
import tkinter.font
from tkinter import filedialog
from tkinter.font import *
import imageio
from imageio import *
from PIL import *
import cv2
from cv2 import *
import PIL
from PIL import Image, ImageTk
from PIL import *
import os, sys
import time
fr... |
livelock.py | #!/usr/bin/env python3
""" Three philosophers, thinking and eating sushi """
import threading
chopstick_a = threading.Lock()
chopstick_b = threading.Lock()
chopstick_c = threading.Lock()
sushi_count = 500
def philosopher(name, first_chopstick, second_chopstick):
global sushi_count
while sushi_cou... |
bench.py | import sys
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
import queue, threading, time
if len(sys.argv) != 5:
print('Usage: python3 bench.py load_file_path run_file_path endpoints nthread')
sys.exit(1)
alice, bob = generate_keypair(), generate_keypair()
metadat... |
OSINTData.py | import json
import requests
import threading
import time
class OSINTData:
def __init__(self):
self.headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
#'From': '@gmail.com'
def reader(self, URLs):
... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import base64
import vialectrum as electrum
from vialectrum.plugins import BasePlugin, hook
from vialectrum.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, parent, config, name):
BasePlugin.__init__... |
qzContigFilterServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... |
botakw2.py | # -*- coding: utf-8 -*-
from linepy import *
from datetime import datetime
from time import sleep
from bs4 import BeautifulSoup
from gtts import gTTS
from humanfriendly import format_timespan, format_size, format_number, format_length
import time, random, sys, json, codecs, threading, glob, re, string, os, requests, s... |
main.py | try:
from auth import auth
except:
with open("auth.py","w") as a:
a.write("auth = ('<username>','<password>')")
print("Add login info to auth.py!")
quit()
import trainInfomation
import pygame
import datetime
import threading
import time
def firstLetterVowelDetect(string):
... |
cross_device_ops_test.py | # Copyright 2018 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... |
ncbidownload.py | #!/usr/bin/env python 3
import pandas
from Bio import Entrez
from accessoryfunctions.accessoryFunctions import *
__author__ = 'adamkoziol'
Entrez.email = 'adam.koziol@inspection.gc.ca'
class Download(object):
def excelparse(self):
"""
Parses input excel file, and creates objects with headers as ... |
host_state.py | """
Global shared state about the host.
"""
import threading
import utils
import time
import sys
CLIENT_VERSION = '1.0.3'
class HostState(object):
def __init__(self):
self.host_ip = None
self.host_mac = None
self.gateway_ip = None
self.packet_processor = None
self.user... |
condition.py | import threading
import time
class AsyncTaskManager:
def __init__(self, target, args=(), kwargs={}):
self.target = target
self.args = args
self.kwargs = kwargs
self.condition = threading.Condition()
self.result = None
self.thread = threading.Thread(target=self.worker)
self.... |
helpers.py | """
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
"""
import base64
import errno
import fnmatch
import functools
import inspect
import loggi... |
submitty_autograding_shipper.py | #!/usr/bin/env python3
import os
import time
import signal
import json
import shutil
import contextlib
import datetime
import multiprocessing
from pathlib import Path
from submitty_utils import dateutils
import operator
import paramiko
import tempfile
import socket
import traceback
import subprocess
from autograder ... |
ioloop_test.py | from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
import contextlib
import datetime
import functools
import socket
import subprocess
import sys
import threading
import time
import types
from unittest import mock
import unittest
from tornado.escape import native_str
from tornado import ge... |
client.py | import socket
# from thread import *
import sys
import threading
from thread import start_new_thread
from threading import Thread
import pickle
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
print 'Socket is not created. Due to error : ' + str(msg[0]) + ' ,Saying : ' + msg... |
email.py | from threading import Thread
from flask import current_app
from flask_mail import Message
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):
msg = Message(subject, sender=sender, recipients=reci... |
openshiftworkarounds.py | import os
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import SocketServer
import requests
import threading
from datetime import datetime
class S(BaseHTTPRequestHandler):
def _set_headers(self):
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.en... |
tcpserver.py | import socket
import threading
bind_ip = '0.0.0.0'
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print('[*] Listening on %s:%d' % (bind_ip, bind_port))
# this is our client-handling thread
def handle_client(client_socket):
# prin... |
ksl.py | import time
import json
import requests
import urllib3
from random import randint
from bs4 import BeautifulSoup
from threading import Thread
urllib3.disable_warnings()
BASE_URL = "https://jobs.ksl.com/search/posted/last-7-days"
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/... |
color_detector_node.py | #!/usr/bin/env python
from anti_instagram.AntiInstagram import *
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment,
SegmentList, Vector2D, Twist2DStamped)
from duckietown_utils.instantiate_utils import instantiate
from duckietown_utils.jpg im... |
dsr_service_motion_simple.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ##
# @brief [py example simple] motion basic test for doosan robot
# @author Kab Kyoum Kim (kabkyoum.kim@doosan.com)
import rospy
import os
import threading, time
import sys
sys.dont_write_bytecode = True
sys.path.append( os.path.abspath(os.path.join(os.path.dirn... |
new_jumpcutter.py | import argparse
import misc_func
import playlist_list
import threading
import multiprocessing
import neverland
from pytube import Playlist
from tqdm import tqdm
from time import sleep
import os
import gc
import sys
from colorama import init, Fore, Style
init(autoreset=True)
gc.enable()
parser = argparse.ArgumentParse... |
dag_processing.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
#... |
test_operator_gpu.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
listen.py | # Script baseado no modelo proposto na página Black Hat Python
# http://bt3gl.github.io/black-hat-python-networking-the-socket-module.html
import socket
import threading
BIND_IP = '0.0.0.0'
BIND_PORT = 80
def handle_client(client_socket):
request = client_socket.recv(1024)
print "[*] Received: " + request
... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
led_master.py | #!/usr/bin/env python 2.7
from time import strftime
from blinkybase import BlinkyBase
from rgbmatrix import graphics
import time
from multiprocessing import Process, Lock
from multiprocessing.sharedctypes import Value, Array
import datetime
# import feedparser, bitly_api
import urllib2
import json
import os
import thre... |
test_dynamic_routing.py | import logging
import threading
import time
import pytest
from google.protobuf import json_format
from jina.helper import random_identity
from jina.parsers import set_pea_parser
from jina.peapods.zmq import Zmqlet, AsyncZmqlet, ZmqStreamlet
from jina.proto import jina_pb2
from jina.types.message import Message
from j... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
test_text_messages.py | def test_text_message_of_length_1(session):
conn, server = session
server.send_message_to_all('$')
assert conn.recv() == '$'
def test_text_message_of_length_125B(session):
conn, server = session
msg = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'\
'abcdefghijklmnopqrstuvwxyzabcd... |
util.py | import os
import shutil
import sys
import ctypes
from pathlib import Path
if sys.version_info[0] < 3 or sys.version_info[1] <= 5:
print("\nPlease restart with Python 3.6+\n")
print("Current Python version:", sys.version_info)
exit(-1)
tc_core = None
def in_docker():
if os.environ.get("TI_IN_DOCKER", "") == ... |
threaded.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import sys
import time
import os.path
import math
import re
import argparse
import traceback
import json
import bz2
import gzip
from nltk.tokenize import TweetTokenizer
from flashtext import Keywo... |
run_status.py | from __future__ import print_function
__docformat__ = "restructuredtext en"
import glob
import re
import os
import sys
import time
import threading
s_comment = re.compile('^#')
s_general_read_len = re.compile('^READ_LENGTH ')
s_read_len = re.compile('^[1-8]+:READ_LENGTH ')
s_firecrest = None
# FIRECREST PATTERNS
#... |
tests.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
view_script.pyw | #Konstantinos Routsis
import socket, threading, sys, os, time
import tkinter as tk
from tkinter import ttk
from PIL import ImageTk, Image
# office rooms image filenames
ROOM_FILES = os.listdir('./rooms')
ROOMS = [i[:-4] for i in ROOM_FILES]
connections = {}
client_list = []
input_window = None
room_cho... |
example_stream_buffer_extended.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_stream_buffer_extended.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: ht... |
client.py | import pygame
from game import Game
import constants as c
import socket
import time
import pickle
from sprite import Sprite
import threading
def network_data_handle():
""" The method handles the in/out data when playing over a network or internet
It is used as a thread to decouple the pygame loop from t... |
simulation_master_heat_datamanager.py | import HEAT as heat
import elinkmanager
from datamanager import DataManager
from counterdown import CounterDown
import threading
from logger import InfoLogger, DataLogger, AdcsLogger
from time import sleep
import sys
#import RPi.GPIO as GPIO
import json
import Paths as paths
import Pins as pins
class Master:
__i... |
exporter.py | #!/usr/bin/python
# vim: tabstop=4 expandtab shiftwidth=4
import argparse
import requests
import re
import time
import threading
from datetime import datetime
from os import environ
from . import lib
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
ex... |
milvus_bootcamp.py | # -*- coding: UTF-8 -*-
import datetime
import time
import os
import sys, getopt
import random
from collections import defaultdict
import numpy as np
from milvus import Milvus, Prepare, IndexType, Status
from multiprocessing import Process
from functools import reduce
import struct
import psycopg2
from enum import Enu... |
connection.py | import sched
from threading import Thread
from collections import defaultdict
import logging
import time
import json
from liquidtap import websocket
class Connection(Thread):
def __init__(self, event_handler, url, reconnect_handler=None, log_level=None,
daemon=True, reconnect_interval=10, socket... |
profiling_executor.py | #!/usr/bin/python3
"""
profExecutor ensapsulates the complexity of leveraging the profiler tool
execution
"""
import os
import subprocess
import sys
import time
from threading import Thread
class profException(Exception):
pass
class profExecutor:
_NAME = "nvprof"
def __init__(self, nvprofpath=None):
self.n... |
test_oddball.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Oddball cases for testing coverage.py"""
import os.path
import re
import sys
from flaky import flaky
import pytest
import coverage
from coverage import env
fr... |
connection_manager.py | import socket
import threading
import pickle
import codecs
from concurrent.futures import ThreadPoolExecutor
from .core_node_list import CoreNodeList
from .edge_node_list import EdgeNodeList
from .message_manager import (
MessageManager,
MSG_ADD,
MSG_REMOVE,
MSG_CORE_LIST,
MSG_REQUEST_CORE_LIST,
... |
__init__.py | from threading import Thread
from platypush.backend import Backend
from platypush.context import get_plugin
from platypush.message.event.light import LightStatusChangeEvent
class LightHueBackend(Backend):
"""
This backend will periodically check for the status of your configured
Philips Hue light devices... |
mission_test.py | #!/usr/bin/env python2
#***************************************************************************
#
# Copyright (c) 2015-2016 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... |
MainGui.py | import traceback
from threading import Thread
import wx
from compress import runCompressionRound, saveBlobsInformation, saveJustBlobs
from decompress import loadBlobsInformation, loadBlobsPixels
from image_manipulation import show_image_from_numpy_array, save_image_from_numpy_array
from structure.Blobs import... |
substructure_search.py |
import os
import sys
import time, datetime
import json
import flask
import atexit
import hashlib
import ConfigParser
import multiprocessing, Queue
import pygly.alignment
from pygly.GlycanFormatter import WURCS20Format, GlycoCTFormat
# Default Configuration
flask_API_port = 10980
flask_API_host = "localhost" # "0.0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.