source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
client4.py | import threading
from scapy.all import *
import os
import subprocess
import json
import argparse
import random
import socket
from struct import *
import datetime
import pcapy
import sys
import time
parser = argparse.ArgumentParser(description='Client')
parser.add_argument('-interface', dest='interface', action='store... |
main.py | from noise import pnoise2
from time import sleep
from threading import Thread
import os
import color
import platform
import socket
try: from pynput import keyboard
except ImportError: keyboard = None
# unused ports: 26490-26999
port = 26969
address = "192.168.50.172"
s = socket.socket(socket.AF_INET, socket.SOCK_STRE... |
__main__.py | # A basic Tello simulator for testing UDP commands
# This script is part of our course on Tello drone programming
# https://learn.droneblocks.io/p/tello-drone-programming-with-python/
import socket
import threading
import time
# Address of this computer and port simulating Tello
tello_address = ("127.0.0.1", 8889)
... |
screens.py | '''
The MIT License (MIT)
Copyright (c) 2020 Christian Meffert
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, m... |
AFroutines.py | '''
Created on 1 Sep 2013
@author: Nia Catlin
'''
import os, subprocess, multiprocessing, threading
from lockwatcher import fileconfig
from lockwatcher import hardwareconfig
dbusobj = None
shuttingDown = False
emailAlert = False
#if we found a screenlocker program then exec that
#some environments want it done with... |
AlignmentSetEditorServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
jobs.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
... |
testing_utils.py | #####################################################################
# #
# testing_utils.py #
# #
# Copyright 2017, Chris Billington ... |
turbsim.py | import os
import sys
turb_ctrl_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if turb_ctrl_path not in sys.path:
sys.path.append(turb_ctrl_path)
from turb_control import ParamEstTurbCtrlr
import numpy as np
import matplotlib.pyplot as plt
import random
import time
import threading... |
transfer.py | #!/usr/bin/env python
"""
Downloads files to temp locations. This script is invoked by the Transfer
Manager (galaxy.jobs.transfer_manager) and should not normally be invoked by
hand.
"""
import ConfigParser
import json
import logging
import optparse
import os
import random
import SocketServer
import sys
import tempfil... |
test_signals.py | import asyncio
import os
import signal
import threading
import time
import unittest.mock
import objc_asyncio
from . import utils
class TestSignal(utils.TestCase):
def test_signal_handler(self):
signal_list = []
def signal_callback(signo):
signal_list.append(signo)
def kille... |
serial_device.py | import serial
import sys
from threading import Thread
class SerialDevice:
def __init__(self, portname='', baudrate=0, stopbits=1, listen_callback=None):
self.portname = portname
self.baudrate = baudrate
self.stopbits = stopbits
self.timeout = None
self.listen_callback = Non... |
gcp_janitor.py | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# 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 appli... |
spammer.py | import getpass
import smtplib
import threading
import time
from datetime import datetime
class emailSpammer():
def configure_settings(self, my_emails, destination_email):
print('\n--> [Starting Configuration]')
self.my_emails = my_emails
self.to = destination_email
self.total_sent... |
log.py | ################################################################################
# Copyright (C) 2013-2014 by gempa GmbH
#
# Thread-safe file logger
#
# Author: Stephan Herrnkind
# Email: herrnkind@gempa.de
################################################################################
import os, Queue, sys, time,... |
TestSensorServer.py | import random
import time
import socket
import threading
import numpy as np
import sys
# constants
p_amb = 101325 # Pa
R = 8.314 # m^3 Pa/K/mol
nitrogen_molar_mass = 0.028 # kg/mol
air_molar_mass = 0.03 # kg/mol
def rand():
"""
Most of the time we want something evenly distributed about 0. This returns [... |
vfs_test.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for API client and VFS-related API calls."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import io
import threading
import time
import zipfile
from absl import app
from grr_response_proto.api ... |
gamepadClient.py | '''
Simple python script to get Asyncronous gamepad inputs
Thomas FLAYOLS - LAAS CNRS
From https://github.com/thomasfla/solopython
Use:
To display data, run "python gamepadClient.py"
'''
import inputs
import time
from multiprocessing import Process
from multiprocessing.sharedctypes import Value
from ctypes import c_do... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color ... |
misc.py | """
Misc module contains stateless functions that could be used during pytest execution,
or outside during setup/teardown of the integration tests environment.
"""
import contextlib
import errno
import multiprocessing
import os
import re
import shutil
import stat
import sys
import tempfile
import time
import warnings
... |
watcher.py | import multiprocessing
from multiprocessing import Queue
import os
from pathlib import Path
import queue
import sys
import time
import signal
from typing import *
from crosshair.auditwall import engage_auditwall
from crosshair.auditwall import opened_auditwall
from crosshair.core_and_libs import analyze_module
from cr... |
base.py | # -*- coding: utf-8 -*-
"""Internal module of protocols with abstract base classes.
Applications should not directly import this module, expect to make subclasses.
As a reminder: all internal strings, like identifier, should be
represented in UTF-8. Use pynt.xmlns.UTF8 if you need help converting."""
# builtin modul... |
test_dota_base.py | # -*- coding:utf-8 -*-
# Author: Xue Yang <yangxue-2019-sjtu@sjtu.edu.cn>, <yangxue0827@126.com>
# License: Apache-2.0 license
# Copyright (c) SJTU. ALL rights reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import math
import os
f... |
main.py | import os
import signal
import subprocess
import json
import time
from datetime import datetime
import threading
import logging
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gpu_tasker.settings")
django.setup()
from base.utils import get_admin_config
from task.models import GPUTask
from task.utils i... |
outdoor_cam_service.py | import io
import os
import sys
import picamera
import logging
import socketserver
import urllib
import json
import math
import time
import threading
import engineio
import socketio
import eventlet
import platform
from threading import Condition
from http import server
SOCKETIO_ROLE = "client"
SOCKETIO_SERVER_ADDRESS ... |
sofa_record.py | import argparse
import csv
import datetime
import glob
import json
import multiprocessing as mp
import os
import subprocess
from subprocess import DEVNULL
from subprocess import PIPE
import sys
import threading
import time
from functools import partial
from pwd import getpwuid
import pandas as pd
import numpy as np
imp... |
net (2).py | try:
import Tkinter as tk
except ImportError:
import tkinter as tk
import socket
import select
import threading
import time
class Toplevel1:
def __init__(self, top=None):
'''This class configures and populates the toplevel window.
top is the toplevel containing window.'''
_bgcol... |
app.py | from model import magic
from flask import Flask, request, Response
import sqlite3
import json
import threading
from constants import CURRENT_YEAR, DATABASE_PATH
import datetime
app = Flask(__name__)
database_path = DATABASE_PATH
@app.route('/')
def index():
response = Response({})
response.headers['Access-Co... |
datasets.py | # Dataset utils and dataloaders
import glob
import hashlib
import logging
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
import torch... |
armory.py | # Armory 3D Engine
# https://github.com/armory3d/armory
bl_info = {
"name": "Armory",
"category": "Render",
"location": "Properties -> Render -> Armory Player",
"description": "3D Game Engine for Blender",
"author": "Armory3D.org",
"version": (0, 6, 0),
"blender": (2, 80, 0),
"wiki_url":... |
download.py | import urllib.request
import threading
months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
prefix = 'https://s3.amazonaws.com/nyc-tlc/trip+data/'
body = '_tripdata_2015-'
suffix = '.csv'
taxi_types = ['yellow', 'green']
def download_file(file_name):
url = prefix + file_name
prin... |
FiveInRowClient_REC.py | #!/usr/bin/env python
"""This program is a five in row game, which is used for the coding
camp 2015 in WindRiver.com"""
import os
import sys, getopt
import pygame as pg
import threading
import json
from toolbox import button
from toolbox import tools
# Cloud API
from CloudAPI.node import Node
from CloudAPI.config im... |
askibot.py | #!/usr/bin/env python3
# -*- encoding: utf8 -*-
"""ASkiBot, cloned from IRC to TG because newfags can't even."""
import tgbot
import logging
import socket
import threading
import time
import random
import errno
import pickle
import collections
TOKEN_TXT = 'token.txt'
KEULII_TXT = 'keulii.txt'
QUOTES_DIR = 'quotes'
M... |
parapysam.py | import multiprocessing, threading, queue, platform
if platform.python_implementation() == 'PyPy':
import pypysam
else:
import pysam
class RecordPipe:
_flushRecordName = "___%!%DummyRecordShouldNotBeInOutput%!%___"
def __new__(cls, header):
r, w = multiprocessing.Pipe(False)
closeEvent =... |
opc_server.py | import selectors
import socket
import threading
from typing import List
from time import sleep
import numpy as np
import logging
logger = logging.getLogger(__name__)
class OPCMessage:
"""
Class for handling OPC messages (http://openpixelcontrol.org/).
Suppports multiple connections by using selectors.
... |
server.py | # -*- coding: iso-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
# Copyright (c) 2015 Angelos Tzotsos
#
# Permission is hereby granted, free of charge, to... |
main.py | import os
from threading import Thread
from .core.window_manager import WindowManager, get_window_manager, ignore_window, unignore_window, unload_window_manager, unload_window_managers
from .core.constants import PUBSPEC_YAML_FILE_NAME
from .core.file_analyzer import FileAnalyzer
from .commands import *
import sublime... |
core.py | # Copyright 2018 John Reese
# Licensed under the MIT license
import asyncio
import sys
import time
from unittest import TestCase
from unittest.mock import patch
import aiomultiprocess as amp
from .base import (
async_test,
do_nothing,
get_dummy_constant,
initializer,
raise_fn,
sleepy,
two,... |
test_unix_events.py | """Tests for unix_events.py."""
import collections
import contextlib
import errno
import io
import os
import pathlib
import signal
import socket
import stat
import sys
import tempfile
import threading
import unittest
from unittest import mock
from test import support
if sys.platform == 'win32':
raise unittest.Ski... |
cc.py | import json
import datetime
import subprocess
import os
import time
import shutil
import threading
python_path = "C:\\Users\\alex.dechaves\\AppData\\Local\\Continuum\\anaconda3\\python.exe"
def transcribe(audio_file):
subprocess.call(python_path + ' speechmatics.py -a ' + audio_file +
... |
listenServer.py | import socket, threading
from DB import receivedRequestsQueue, maxReceiveRequests
from handleReceive import handleReceive
def ListenServer():
global maxReceiveRequests
HOST = "0.0.0.0"
PORT = 8080
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET, socket... |
test_client.py | import asyncio
import gc
import logging
import os
import pickle
import random
import subprocess
import sys
import threading
import traceback
import warnings
import weakref
import zipfile
from collections import deque
from contextlib import suppress
from functools import partial
from operator import add
from threading i... |
eyeshot.py | #!/usr/bin/python3
import sys
import getopt
import os
import requests
import time
import threading
from selenium import webdriver
from bs4 import BeautifulSoup
import json
import re
import urllib3
from requests.adapters import HTTPAdapter
import random
urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequ... |
env.py | # Game board simulator
# can only run on Windows
from ctypes import *
import os
import numpy as np
import math
import threading
import time
# Load library
dllfile = 'IRL.dll'
if not os.path.exists(dllfile):
raise FileNotFoundError("Required dll not found.")
lib = cdll.LoadLibrary(dllfile)
lib.start_game.restype = ... |
vfs_test.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for API client and VFS-related API calls."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import io
import os
import threading
import time
import zipfile
from absl import app
import mock
from g... |
build_environment.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains all routines related to setting up the package
build environment. All of this is set up by packa... |
self2asist.py | # -*- coding: utf-8 -*-
#Chucky_Bot
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,... |
test_collect_types.py | """Tests for collect_types"""
from __future__ import (
absolute_import,
division,
print_function,
)
import contextlib
import json
import os
import sched
import time
import unittest
from collections import namedtuple
from threading import Thread
from six import PY2
from typing import (
Any,
Dict,
... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from decimal import D... |
test_utils.py | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
keylime_agent.py | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import asyncio
import http.server
import platform
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import threading
import base64
import configparser
i... |
notes_db.py | # nvPY: cross-platform note-taking app with simplenote syncing
# copyright 2012 by Charl P. Botha <cpbotha@vxlabs.com>
# new BSD license
import codecs
import copy
import glob
import os
import json
import logging
from Queue import Queue, Empty
import re
import simplenote
simplenote.NOTE_FETCH_LENGTH = 100
from simpleno... |
getter.py | import logging
import random
import threading
import time
import math
from datetime import datetime
from . import location
from .inventory import Inventory, items
from .pokedex import pokedex
from .util import set_interval, fprint, getJSTime
from .custom_exceptions import GeneralPogoException
RPC_ID = int(random.rando... |
tunnel.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_process.py | import functools
import io
import logging
import multiprocessing
import os
import signal
import sys
import tempfile
import threading
import time
import pytest
import salt._logging
import salt.utils.platform
import salt.utils.process
from tests.support.mock import patch
from tests.support.unit import TestCase, skipIf
... |
VESC.py | from pyvesc.protocol.interface import encode_request, encode, decode
from pyvesc.VESC.messages import *
import time
import threading
# because people may want to use this library for their own messaging, do not make this a required package
try:
import serial
except ImportError:
serial = None
class VESC(objec... |
btcproxy.py | """ A bitcoind proxy that allows instrumentation and canned responses
"""
from flask import Flask, request
from bitcoin.rpc import JSONRPCError
from bitcoin.rpc import RawProxy as BitcoinProxy
from cheroot.wsgi import Server
from cheroot.wsgi import PathInfoDispatcher
import decimal
import flask
import json
import log... |
dstimer_server.py | #!/usr/bin/env python3
#from dstimer import server
from dstimer import send_action, common, world_data, db, app
import logging
from logging import handlers
import os, sys
from pythonjsonlogger import jsonlogger
import argparse
import webbrowser
#import requests
#from version_parser import Version
common.create_folder... |
test_s3_storage_analyzer.py | """
Unit Tests
"""
from datetime import datetime
from io import StringIO
import sys
import os
from pprint import pprint
import threading
import http.client
from contextlib import redirect_stdout
from s3_storage_analyser import (
list_buckets, fold_metrics_data, convert_bytes, update_gauges,
main, list_metrics,... |
base_crash_reporter.py | # Electrum - lightweight Bitcoin client
#
# 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... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
serve.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import abc
import argparse
import importlib
import json
import logging
import multiprocessing
import os
import platform
import signal
import socket
import subprocess
import sys
import threading
import time
import traceback
import urllib
import uuid
from co... |
binary_test_old.py | import requests
import json
import base64
import time
import os
from queue import Queue
from threading import Thread
class ThreadPool:
"""Pool of threads consuming tasks from a queue"""
def __init__(self, num_threads):
self.tasks = Queue(num_threads)
for _ in range(num_threads):
... |
cache_test.py | from queue import Queue
import random
import threading
import unittest
import time
from coapclient import HelperClient
from coapforwardproxy import CoAPForwardProxy
from coapserver import CoAPServer
from coapthon import defines
from coapthon.messages.option import Option
from coapthon.messages.request import Request
f... |
test.py | ''' Evaluating Frustum PointNets.
Write evaluation results to KITTI format labels.
and [optionally] write results to pickle files.
Author: Charles R. Qi
Date: September 2017
'''
from __future__ import print_function
import os
import sys
import argparse
import importlib
import numpy as np
import tensorflow as tf
impor... |
xmlrpc.py |
import xmlrpc.client
from gsplines.interpolator import rand_interpolate
from gsplines.basis.basis0010 import cBasis0010
from gsplines.services.gsplinesjson import piecewise2json, json2piecewise
from gsplines.services.xmlrpc import cGplineXMLRPCServer
import numpy as np
import json
import unittest
import matplotlib.py... |
test_governor.py | # Copyright (c) 2013 Rackspace, 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 wr... |
test_threading.py | """
Tests for the threading module.
"""
import test.support
from test.support import verbose, strip_python_stderr, import_module, cpython_only
from test.script_helper import assert_python_ok
import random
import re
import sys
_thread = import_module('_thread')
threading = import_module('threading')
import time
import... |
test_sqlite.py | import threading
from sqlobject import *
from sqlobject.tests.dbtest import *
from sqlobject.tests.dbtest import setSQLiteConnectionFactory
from test_basic import TestSO1
class SQLiteFactoryTest(SQLObject):
name = StringCol()
def test_sqlite_factory():
setupClass(SQLiteFactoryTest)
if SQLiteFactoryTest._... |
test_threadworker.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted._threads._threadworker}.
"""
from __future__ import absolute_import, division, print_function
import gc
import weakref
from twisted.trial.unittest import SynchronousTestCase
from threading import ThreadError, local
from... |
manual_controller.py | from src.system.controller.python.controller_interface import ControllerInterface, Agent
from threading import Thread, Lock
import time
class ManualController(ControllerInterface):
def __init__(self):
ControllerInterface.__init__(self)
self._running = True
self._send_position_running = T... |
test_ptrace.py | # Copyright (C) 2017-present Pinterest Inc.
#
# This module is part of ptracer and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
import errno
import multiprocessing
import os
import signal
import time
import unittest
from ptracer import ptrace
class TestPtrace(unittest.Test... |
test_studio_5.py | """
test_studio_5.py : Test live streaming, recording and playback in Qt
Copyright 2017-2021 Sampsa Riikonen
Authors: Sampsa Riikonen
This file is part of the Valkka Python3 examples library
Valkka Python3 examples library is free software: you can redistribute it and/or modify it under the terms of the MIT License... |
visualize_raw.py | import numpy as np
import os, glob
from matplotlib import pyplot as plt
import camera as cam
import time, sys
import stat_tools as st
from scipy.ndimage import morphology,filters, measurements ####more efficient than skimage
from scipy import signal
from skimage.morphology import remove_small_objects
# from skimage im... |
cli.py | # -*- coding: utf-8 -*-
"""Console script for gitlabirced."""
import click
import copy
import logging
import signal
import sys
import threading
import yaml
from irc.client import is_channel
from .irc_client import connect_networks
from .http_server import MyHTTPServer, RequestHandler
cli_logger = logging.getLogger(... |
crank_client.py | import socket
import threading
import time
import traceback
import sys
import logging
logger = logging.getLogger('crank')
logging.basicConfig()
logger.setLevel(logging.INFO)
logger.info('start crank client.')
socket.setdefaulttimeout(10)
class CrankClient(object):
def __init__(self, server_address, local_addres... |
main.py | import argparse
from datetime import datetime, timedelta
from pathlib import Path
import cv2
import numpy as np
import depthai
import time
from tools import *
from imutils.video import FPS
import queue
import threading
parser = argparse.ArgumentParser()
parser.add_argument('-nd', '--no-debug', action="store_true", hel... |
socketserver_threaded.py | import threading
import socketserver
class ThreadEchoRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
data = self.request.recv(1024)
cur_thread = threading.currentThread()
response=b'%s: %s' % (cur_thread.getName().encode(),data)
self.request.send(response... |
ipy_repl.py | import os
import sys
import json
import socket
import threading
activate_this = os.environ.get("SUBLIMEREPL_ACTIVATE_THIS", None)
# turn off pager
os.environ['TERM'] = 'emacs'
if activate_this:
with open(activate_this, "r") as f:
exec(f.read(), {"__file__": activate_this})
try:
import IPython
IP... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Punchbox initialized!"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start() |
sensorserver.py | import argparse
import time
import socket
import struct
import threading
import Queue
from mpu6050 import mpu6050
def listenserver(port, queue_list, lock, stopped):
serversock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversock.bind(('0.0.0.0', port))
serversock.listen(3)
while True:
... |
guicli.py | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
import chardet
import subprocess
import shlex
import threading
def lauf_und_zeigt( textarea, com... |
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... |
wifijammer.py | #!/usr/bin/env python
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy
from scapy.all import *
conf.verb = 0 # Scapy I thought I told you to shut up
import os
import sys
import time
from threading import Thread, Lock
from subprocess import Popen, PIPE
from signal import SIGINT,... |
utils.py | import threading
from typing import Callable
def start_background(func: Callable, daemon=True):
thread = threading.Thread(target=func)
thread.daemon = daemon
thread.start() |
execution_scheduling.py | #!/usr/bin/env python3
""" Two threads chopping vegetables """
import threading
import time
chopping = True
def vegetable_chopper():
name = threading.current_thread().getName()
vegetable_count = 0
while chopping:
print(name, 'chopped a vegetable!')
vegetable_count += 1
p... |
pydoc.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
helper.py | import asyncio
import functools
import json
import math
import os
import random
import re
import sys
import threading
import time
import uuid
import warnings
from argparse import ArgumentParser, Namespace
from datetime import datetime
from itertools import islice
from types import SimpleNamespace
from typing import (
... |
client.py | """
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: Jun Zhu <jun.zhu@xfel.eu>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
from collections import namedtuple
from functools import part... |
sign.py | import time
import requests
import threading
class Sign:
def __init__(self, host, port):
self.host = host
self.port = port
self.messages = []
def clear(self):
# Should probably implement this on the other side
requests.post("http://{}:{}/clear".format(self.host, self.po... |
CVCDataset.py | # ----------------------------------------
# Written by Xiaoqing GUO
# ----------------------------------------
from __future__ import print_function, division
import os
import torch
import pandas as pd
import cv2
import multiprocessing
from skimage import io
from PIL import Image
import numpy as np
from torch.utils.d... |
AX25KISSInterface.py | from __future__ import print_function
from Interface import Interface
from time import sleep
import sys
import serial
import threading
import time
import RNS
class KISS():
FEND = chr(0xC0)
FESC = chr(0xDB)
TFEND = chr(0xDC)
TFESC = chr(0xDD)
CMD_UNKNOWN = chr(0xFE)
CMD_DATA = chr(0x00)
CMD... |
Main.py | # Patrick Lenis
# subgr.2
import threading
from Download import downloadFile
from Decrypt import decryptFile
from Combine import combineMessages
# console coloers
BLUE = "\033[0;36m"
DEFAULT = "\033[0m"
message_struct = [] # data structure to store decrypted messages
# prints result (saved in s_fina... |
run_TCP_depth2.py | import argparse
import logging
import time
import pyrealsense2 as rs
import cv2
import numpy as np
import math
from estimator import TfPoseEstimator
from networks import get_graph_path, model_wh
import common
#====================
from socket import socket, AF_INET, SOCK_STREAM
import threading
import time
from tkin... |
http_server.py | #!/usr/bin/env python
# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
# Many tests expect there to be an http server on port 4545 servering the deno
# root directory.
from collections import namedtuple
from contextlib import contextmanager
import os
import SimpleHTTPServer
import SocketServer
... |
__init__.py | import http.server as SimpleHTTPServer
import socketserver
from threading import Thread
httpd = socketserver.TCPServer(('', 0), SimpleHTTPServer.SimpleHTTPRequestHandler)
PORT = httpd.server_address[1]
def setup_module():
print("serving at port", PORT)
thread = Thread(target=lambda: httpd.serve_forever())
... |
main.py | # coding: utf8
import cv2
import numpy as np
import os, datetime, time
import threading
from cam_functions import *
from sender import Sender
from csv_work import read_as_dict
from config import *
if __name__ == '__main__':
send_email = Sender(receivers = read_as_dict(FILE_RECEIVERS))
# for allow to sa... |
zmq_driver.py | # Copyright 2018 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 in wri... |
myclient2.py | import socket
import os
import glob
import time
import threading
import tcp_client
inside = True
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientName=socket.gethostname()
print "Client name is: " + str(clientName)
Server = raw_input("Enter IP address of... |
server.py | import os
import sys
import threading
from collections import defaultdict
from enum import Enum
from itertools import groupby
import yaml
from dotenv import load_dotenv
from flask import Flask, jsonify, redirect, render_template, request, send_file
from werkzeug.utils import secure_filename
load_dotenv()
APP_ROOT = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.