source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
motion_udp.py | import bpy
import socket
import numpy as np
import time
#import matplotlib.pyplot as plt
import sys
dir = 'C:\\Users\\tom\\Desktop\\blSim'
sys.path.append(dir)
import struct
import threading
from gen_curve_2 import *
print('Initializing UDP socket...')
UDP_IP = "127.0.0.1"
UDP_PORT = 25000
sock = socket.socket(socket... |
polybeast_env.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
precompute_guides_msgpack_CFD.py | import msgpack
import json
import pickle
import os.path
from Queue import PriorityQueue
import re
import doench_score
import azimuth.model_comparison
import numpy as np
import pandas as pd
import csv
from intervaltree import IntervalTree
from multiprocessing import Process
import os
import time
start_time = time.time(... |
socketio.py | import json
import threading
from ws4py.client.threadedclient import WebSocketClient
from ws4py.exc import HandshakeError
from .config import Config
from enum import Enum
class SocketIO:
def __init__(this, config, on_connected = None, on_message = None,
on_closed = None, on_error = None):
if not isinstance(config... |
main.py | import cv2
import config
import controller_listener
import controls
import logging
import start_web
import time
import _thread as thread
import tensorflow as tf
import ujson as json
import websocket as ws
from cameras.camera import USBCam, Camera
from cameras import image_converter
from cameras.video_async import Vid... |
Vector_Addition.py | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 17 16:57:39 2017
@author: Usman
"""
import threading
import random,time,math,numpy as np
from matplotlib import pyplot as plt
def SeqAdd(vectorA,vectorB,vectorC):
for r in range(0, len(vectorA)):
vectorC[r]=int(vectorA[r])+int(vectorB[r]) #Add... |
camera.py | #This is not yet used and tested in my project
#/max
#https://github.com/Misterblue/ros2_raspicam_node/blob/master/src/ros2/ros2_raspicam_node/ros2_raspicam_node/ros2_raspicam_node.py
# Copyright 2018 Robert Adams
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... |
__init__.py | import os
import inspect
import functools
import threading
from timeit import default_timer
from flask import request, make_response, current_app
from flask import Flask, Response
from werkzeug.serving import is_running_from_reloader
from werkzeug.exceptions import HTTPException
from prometheus_client import Counter, ... |
gui.py | #!/usr/bin/env python
from __future__ import division
import sys,os, os.path, PyMC
import PyMC.database
try:
import pygtk
pygtk.require("2.0")
# Note for OS X: You can get pygtk from the MacPort py-gtk (Python 2.4) or py25-gtk (Python 2.5)...
# but the MacPorts py-gobject is buggy. I reported it on thei... |
UTMaster.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
#
################################################################################
"""
Authors: zhousongsong(doublesongsong@gmail.c... |
pilogee.py | import socket
import time
import threading
import traceback
from message_socket.message_socket import MessageSocket, MessageType, PiLogMsg
class PiLoggee():
def __init__(self):
""" """
self._client_lock = threading.Lock()
self._num_clients = 0
self._running = False
def star... |
__init__.py | '''
Polyglot HTTP server
| Public Functions:
| AbstractHandler Class
| register(handlers, subdomain=None, parent_dir=None)
:ivar AUTH_USER: The required HTTP user
:ivar AUTH_PASS: The required HTTP password
:ivar SERVER: The Tornado web server applicaiton.
'''
from basic_auth import basic_auth
import logging
import o... |
batching.py | # Copyright 2021 Cortex Labs, 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 wri... |
test_pool.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 os
import threading
import time
current_dir = os.path.dirname(os.pa... |
mplsmall_main.py | from PyQt5.QtWidgets import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from PyQt5 import QtCore
import threading
from PyQt5.Qt import QPoint, QRect
class mplsmall_main(QWidget):
def __init__(self,parent=None):
QWidget.__init__(self)
... |
socks5_server.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__created__ = '2018/03/09'
__author__ = 'aspiral'
import logging
import platform
import struct
from socket import *
from selectors import *
import select
import threading
SOCKS_VERSION_5 = b'\x05'
METHOD_NO_AUTH = b'\x00'
METHOD_GSSAPI = b'\x01'
METHOD_USERPWD = b'\x02... |
Hiwin_RT605_ArmCommand_Socket_20190627174605.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
make.py | import os
import glob
import time
import shutil
import bpy
import json
import stat
from bpy.props import *
import subprocess
import threading
import webbrowser
import arm.utils
import arm.write_data as write_data
import arm.make_logic as make_logic
import arm.make_renderpath as make_renderpath
import arm.make_world as ... |
tmqa34.py | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('autosave', '180')
get_ipython().run_line_magic('matplotlib', 'inline')
# In[2]:
import requests
import time
from datetime import datetime
import itertools as it
import re
#import numpy
from copy import copy
import matplotlib.pyplot as p... |
pytest_pyramid_server.py | '''
Created on 25 Apr 2012
@author: eeaston
'''
import os
from six.moves import configparser
import sys
import socket
import glob
import shutil
import threading
try:
from path import Path
except ImportError:
from path import path as Path
from wsgiref.simple_server import make_server
from paste.deploy.loadwsg... |
googlenet_processor.py | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# NPS
# processes images via googlenet
from mvnc import mvncapi as mvnc
import numpy as np
import cv2
import queue
import threading
class googlenet_processor:
# GoogLeNet assumes input images are t... |
scheduler_job.py | # pylint: disable=no-name-in-module
#
# 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, Versio... |
network.py | import logging
from binascii import crc32
from enum import IntEnum
from paramiko import Channel
from queue import Empty, Queue
from selectors import SelectSelector, EVENT_WRITE
from socket import socket, error as SocketError
from struct import pack, unpack
from threading import Event, Thread
from time import sleep
from... |
sstvProxy.py | #!/usr/bin/env python3
###
###Copyright (c) 2016 by Joel Kaaberg and contributors. See AUTHORS
###for more details.
###
###Some rights reserved.
###
###Redistribution and use in source and binary forms of the software as well
###as documentation, with or without modification, are permitted provided
###that the follow... |
systrace_controller.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import threading
import zlib
from profile_chrome import controllers
from profile_chrome import util
from pylib.constants import host_paths
with host_paths... |
agent.py | #!/usr/bin/env python
#
# AzureMonitoringLinuxAgent Extension
#
# Copyright 2019 Microsoft 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/L... |
test.py | from iUSBDAQ import iUSBDAQ
import numpy as np
import matplotlib.pyplot as plt
from threading import Thread, Lock, Event
import time
bufflen = 1000
buff = np.zeros((bufflen, NCHANNELS), np.float)
buffidx = 0
def read(lock, stop):
global buff, buffidx
dev = iUSBDAQ(0)
dev.AIStartStream()
while not st... |
utils.py | """Utilities shared by tests."""
import asyncio
import collections
import contextlib
import io
import logging
import os
import re
import selectors
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
import weakref
from unittest import mock
from http.server import... |
ros2_raspicam_node.py | # Copyright 2021 Robert Adams
#
# 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,... |
Main.py | from time import sleep
import json
import os
import psutil
import datetime
import subprocess
import threading
import shutil
from pysteamcmdwrapper import SteamCMD, SteamCMDException
# Clear Function for CMD
def clear(): return os.system('cls')
# This Loads the Config.json
f = open("config.json", 'r+')
config = json.l... |
collisionsViewerClient.py | from multiprocessing import Process, Lock
from multiprocessing.sharedctypes import Value, Array
from ctypes import c_double
import matplotlib.pyplot as plt
import pinocchio as pin
import numpy as np
import time
# Helper functions
def visualizeCollisionDist(gv, p1, p2, name, color, init=False):
### --- display witn... |
fifo_queue_test.py | # Copyright 2015 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... |
test_queues.py | import threading
import time
from dagster import ModeDefinition, default_executors
from dagster.core.test_utils import instance_for_test
from dagster_celery import celery_executor
from .utils import execute_on_thread, start_celery_worker
celery_mode_defs = [ModeDefinition(executor_defs=default_executors + [celery_ex... |
multiprocessing_namespaces_mutable.py | # Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# end_pymotw_header
import multiprocessing
def producer(ns, event):
# DOES NOT UPDATE GLOBAL VALUE!
ns.my_list.append("This is the value")
event.set()
def consumer(ns, event):
print("Before event:", ns.my_list)
event.wait()
p... |
unsplashed_wallpaper.py | #!/usr/bin/env python3
import os
import sys
import time
import threading
import signal
import requests
import configparser
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk, AppIndicator3, GObject
from requests.exceptions import ConnectionError, Timeout... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
pseudoscience_stereo2depth.py | # Josh Gladstone made this in 2018
# But a lot of it came from Timotheos Samartzidis
# http://timosam.com/python_opencv_depthimage
# Enjoy!
import numpy as np
import sys, os
import glob
import time
import unicodedata
from threading import *
from os.path import join
# Python 3
import cv2
import urllib.request
from que... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import absolute_import, unicode_literals
import datetime
from decimal import Decimal
import threading
import unittest
from django.conf import settings
from django.core.management.color import no_style
from django.db import (co... |
x.py | import argparse
import functools
import importlib.util
import logging
import signal
import sys
import os
import traceback
from multiprocessing import get_context
from typing import List, Text, Optional
import ruamel.yaml as yaml
from rasa.cli.utils import get_validated_path, print_warning, print_error
from rasa.cli.a... |
train_pg.py | import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
import inspect
from multiprocessing import Process
#============================================================================================#
# Utilities
#====================================================... |
autoCharger.py | #!/usr/bin/env python
from io import BytesIO
from time import sleep
from picamera import PiCamera
from PIL import Image
import zbar
import getpass
import requests
from requests_ntlm import HttpNtlmAuth
import untangle
import rospy
from std_msgs.msg import Float32
from std_msgs.msg import Float32MultiArray
from std_msgs... |
tests.py | import threading
from datetime import datetime, timedelta
from unittest import mock
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections, models
from django.db.models.manager import BaseManager
from django.db.models.query impo... |
test_socket_manager.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import time
import uuid
from unittest import mock
from parlai.mturk.core.socket_manager import Packet, S... |
testutils.py | from __future__ import print_function
import os
import sys
from types import TracebackType
import isodate
import datetime
import random
from contextlib import AbstractContextManager, contextmanager
from typing import (
Iterable,
List,
Optional,
TYPE_CHECKING,
Type,
Iterator,
Set,
Tuple... |
process_impl.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import atexit
import traceback
import multiprocessing
class Process(object):
"""
Wraps a `gym.Env` to host the environment in an external process.
Example:
```
env = Process(l... |
test_data_node_scale.py | import threading
import time
import pytest
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from common import common_func as cf
from customize.milvus_operator import MilvusOperator
from scale import constants
from pymilvus import connections
from utils.util_log import... |
console.py | '''
Created on 2015/12/29
:author: hubo
'''
from __future__ import print_function
from vlcp.utils.connector import async_processor, async_to_async, Connector,\
generator_to_async
from vlcp.event.event import withIndices, Event
from vlcp.config import defaultconfig
from vlcp.server.module import Module, api, callAP... |
test_cli.py | from __future__ import absolute_import, print_function, division
import os
import sys
import signal
import tarfile
import time
from threading import Thread
import pytest
import conda_pack
from conda_pack.cli import main
from conda_pack.compat import on_win
from .conftest import py36_path, py27_path
on_p2 = sys.ver... |
send_newsletter_continuous.py | """Command for sending the newsletter"""
from threading import Thread
import signal
import sys
from django.conf import settings
from django.utils.translation import activate
from django.core import signals
from django.core.management.base import NoArgsCommand
from emencia.django.newsletter.mailer import SMTPMailer
fr... |
btlejack.py | from threading import Lock
from queue import Queue
import time
from serial.tools.list_ports import comports
from serial import Serial,SerialException
from mirage.libs.ble_utils.constants import *
from mirage.libs.ble_utils.scapy_btlejack_layers import *
from mirage.libs import io,utils,wireless
class BTLEJackDevice(wi... |
measure_methods.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... |
AsynchExec_v2.py | """
Framework for setting up an experiment.
"""
import numpy as np
import gym
import gym_minigrid,gym_cap
import tensorflow as tf
import argparse
from urllib.parse import unquote
import os
from networks.network import Network
from utils.utils import InitializeVariables, CreatePath, interval_flag, GetFunction
from uti... |
algo_five.py | from functools import reduce
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.mqtt.client as mqtt... |
test_script.py | """
Tests for scripts don't yet support verification against redis-server.
"""
from hashlib import sha1
from unittest.case import SkipTest
import sys
import threading
from nose.tools import assert_raises, eq_, ok_
from mockredis import MockRedis
from mockredis.exceptions import RedisError
from mockredis.script import... |
server.py | import os
import sys
import time
import random
import socket
import threading
import datetime
from multiprocessing.pool import ThreadPool
sys.path.append('..')
from helpers import message
from helpers.filelock import FileLock
from player import Player
# Mostly just a struct to hold match information
class Match:
def... |
pants_daemon.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os
import sys
import threading
from contextlib import contextmanager
from dataclasses import dataclass
from typing import IO, Iterator, Optional, cast
from setprocti... |
socks5.py | #!/usr/bin/env python3
import argparse
import logging
import os
import platform
import signal
import struct
import sys
import threading
from socket import AF_INET, SOCK_STREAM, socket
from socketserver import BaseServer, StreamRequestHandler, ThreadingTCPServer
__author__ = 'Youchao Feng'
support_os = ('Darwin', 'Lin... |
test.py | # from aqt import mw
# from aqt import gui_hooks
# from aqt import utils
import threading
import socket
from PyQt5.QtCore import QObject, pyqtSignal, QThread
import tcp_pack_construct
# 信号对象
class QTypeSignal(QObject):
# 生成一个信号
sendmsg = pyqtSignal(object)
def __init__(self):
super().__init__()
... |
vc.py | # -*- coding: utf-8 -*-
"""Prompt formatter for simple version control branches"""
# pylint:disable=no-member, invalid-name
import os
import sys
import queue
import builtins
import threading
import subprocess
import re
import pathlib
import xonsh.tools as xt
from xonsh.lazyasd import LazyObject
RE_REMOVE_ANSI = Lazy... |
main.py | import tensorflow as tf
import cv2
import time
import os
import sys
from rtmp import server
import av
import queue
import threading
from recognition import detection, facenet, utils
from recognition import recognition
def mosic_and_show_method(share_que: queue.Queue, width, height):
r = server.RTMPSendServer()
... |
zdrun.py | #!python
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribut... |
frontend.py | #!/usr/bin/env python3
"""
@file tmtc_frontend.py
@date 01.11.2019
@brief This is part of the TMTC client developed by the SOURCE project by KSat
@description GUI is still work-in-progress
@manual
@author R. Mueller, P. Scheurenbrand, D. Nguyen
"""
import enum
import os
import sy... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
from selfdrive.dragonpilot.dragonconf import dragonpilot_set_params
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
sys.path.append(os.path.joi... |
client.py | import logging
import os, copy
import threading
import tkinter, tkinter.font
from time import sleep
from pynput.keyboard import Key, Listener
from src.util.connection import Client, Communication
__buffer = {
'clicked': False,
'accept': True,
'move': "None",
'note': "None",
'page': '',
}
___client... |
ipc.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Helper functions for inter-process communication via AddonSignals
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __futur... |
cli.py | # encoding: utf-8
import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import itertools
import json
import logging
import urlparse
from optparse import OptionConflictError
import traceback
import sqlalchemy as sa
import routes
import paste... |
pyunit_h2oshutdown_DEPRECATED.py | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
import threading
from h2o.utils.typechecks import assert_is_type
def h2oshutdown():
"""
Python API test: h2o.shutdown(prompt=False)
Deprecated, use h2o.cluster().shutdown()
"""
... |
multibot_testing.py | import template_tool_testing
import template_ghost_bot
from threading import Thread
"""
Each value in the bots dict is like so:
token: Discord token.
is_bot: If the token is for a bot account or user account.
client: Function to call to initialize our bot's client and execute its code
"""
bots = {
... |
kegdata.py | #!/usr/bin/python
# coding: UTF-8
# kegdata service to read about key status
# Written by: Ron Ritchey
import json, threading, logging, queue, time, getopt, sys, logging
import RPi.GPIO as GPIO
from .hx711 import HX711
# HOW TO CALCULATE THE REFFERENCE UNIT
# To set the reference unit to 1. Put 1kg on your sensor... |
compat.py | import inspect
import threading
import logging
import sys
from xml.etree import cElementTree as ET
import os
if sys.version_info < (3,):
# python 2
import Queue as queue
else:
# python 3
import queue
if sys.version_info < (3,):
# python 2
str_ = basestring
def clean_repr(x):
if i... |
lsbook.py | import json
import logging
import os
from concurrent.futures.process import ProcessPoolExecutor
from threading import Thread
from urllib import request
from LsBook.utils.fs import copytree, rmdir
from . import __version__
from .models.book import Book
from .output.generateBook import generateBook
from .utils.argument ... |
ble_scanner.py | #!/usr/bin/env python
import datetime
import requests
import sys
import time
from subprocess import PIPE, Popen
from threading import Thread
from Queue import Queue, Empty
SCANNER_NAME = 'SCANNER0';
ON_POSIX = 'posix' in sys.builtin_module_names
def enqueue_output(out, queue):
for line in iter(out.readline, b'... |
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... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
from weakref import proxy
import contextlib
imp... |
lock_test.py | # coding:utf-8
from threading import Lock, Thread
lock = Lock()
g = 0
def add_one():
global g
lock.acquire()
g += 1
lock.release()
def add_two():
global g
lock.acquire()
g += 2
lock.release()
threads = []
for func in [add_one, add_two]:
threads.append(Thread(target=func))
th... |
server.py | from multiprocessing import Process
from SocketServer import TCPServer, BaseRequestHandler as TCPHandler
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler as HTTPHandler
policy = """<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">... |
surface_stats_collector.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import Queue
import threading
# Log marker containing SurfaceTexture timestamps.
_SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps'
_... |
realtime_resampler_ext.py | #
from QAPUBSUB.consumer import subscriber, subscriber_routing
from QAPUBSUB.producer import publisher
from QUANTAXIS.QAEngine.QAThreadEngine import QA_Thread
from QUANTAXIS.QAData.data_resample import QA_data_futuremin_resample, QA_data_futuremin_resample_tb_kq
from QUANTAXIS.QAUtil.QADate_trade import QA_util_future_... |
external_api.py | import json
from urllib.request import urlopen, Request
from urllib import parse
import json
from time import time
from datetime import datetime
import threading
# Debug
from pprint import pprint as pp
class EXTERNAL_API(object):
_LastLoginDate = 0
_LastLoginThashold = 60*60*6 # 6h
# Placeholders
... |
server.py | # Python 3.6.2
import os
import sys
import random
import socket
import struct
import datetime
import threading
from hashlib import sha3_224
# Switch to the directory containing server.py
this_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(this_dir)
# Change to project root
os.chdir("../../")
# Add projec... |
BB.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This module contains the main interface to interact with BlackBoard.
Author: Adrián Revuelta Cuauhtli <adrianrc.89@gmail.com>
Workplace: Bio-Robotics Lab., UNAM <http://bio-robotics.fi-p-unam.mx>
'''
# STANDARD IMPORTS
import threading
import time
import types
import ... |
test_INLClient_live.py |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
astrometry.net.script.py | #============================================================
# astrometry.net script making program for ONE target
# 2018/08/29 G.Paek revision for skipping astrocrappy
# JUST RUN AND WRITE INPUT & REF IMAGE
# 2019.05.08 GREGORY S.H. PAEK
#============================================================
import numpy as np... |
winInputHook.py | #winInputHook.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import threading
import comtypes.client
import time
from ctypes import *
from ... |
FileScan.py | import datetime
import subprocess
import threading
from tkinter import Listbox, messagebox, ttk
from tkinter.filedialog import askopenfilename, asksaveasfilename
import xlwt
from PIL import Image, ImageTk
TITLE_FONT = ("Helvetica", 16, "bold")
FALSE = False
function = 'function'
# images
img_IPtest = Image.open('./I... |
03_motors.py | # -*- coding: utf-8 -*-
from threading import Thread
import WonderPy.core.wwMain
from WonderPy.core.wwConstants import WWRobotConstants
"""
This example shows connecting to the robot and sending commands each time sensors are received.
This builds on the "01_hello_world.py" example.
"""
class MyClass(object):
... |
launch.py | # Copyright 2018 Datawire. 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 agr... |
controller.py | # controller.py
# This script will launch instances and running avrora benchmark on them automatically
# To use, you need to setup your ec2_access_id and ec2_access_key in vm.py, the number
# of instance you want to run and traces, lb, es filename in the configuration field below
# This script will record the executio... |
ECCEG Server.py | from ECC import *
import math
import random
import socket
import threading
import pickle
MAX_CHUNK = 8*1024
sec_rand = random.SystemRandom()
class ECCEG:
def __init__(self):
self.host=socket.gethostbyname(socket.gethostname())
print(self.host)
self.port = 12345
... |
tunnel.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
master.py | import sys
import socket
import threading
import logging
import json
import time
import random
import os
# Docker requires loopback address to be 0.0.0.0 instead of localhost.
# 'localhost' is chosen if run manually without docker.
JOB_REQUESTS_HOST = os.getenv("LOOPBACK_ADDRESS", "localhost")
JOB_REQUESTS_PORT = 500... |
alexa_audio_bt.py | #!/usr/bin/env python3
import bluetooth
import logging
import time
import threading
import struct
import sys
import math
# from specs
SOL_BLUETOOTH = 274
SOL_SCO = 17
BT_VOICE = 11
BT_VOICE_TRANSPARENT = 0x0003
BT_VOICE_CVSD_16BIT = 0x0060
SCO_OPTIONS = 1
L2CAP_UUID = "0100"
SCO_HEADERS_SIZE = 16
class BluetoothAudi... |
process_handler.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import io
import multiprocessing
import subprocess
import sys
from abc import ABC, abstractmethod
from typing import Optional
class ProcessHandler(ABC):
"""An abstraction of process ... |
rank.py | from typing import List, Dict, Union, Optional, Tuple, Any, Callable, ClassVar
import numpy
import threading
from loguru import logger
import asyncio
import functools
import aiohttp
import asyncio
import pickle
import requests
def server_wrapper(func):
"""Checks for a server at http://localhost:22647/. If there i... |
selftest.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2010, 2021. All Rights Reserved.
import logging
import os
from threading import Thread
import time
from collections import defaultdict
import pkg_resources
from requests.exceptions import ConnectionError, SSLError
from resilient import constants a... |
monster_tel.py | import telegram as tl
from telegram.ext import *
import logging
from monster import *
import time
def main():
def stop_and_restart():
import os, sys
updater.stop()
os.execl(sys.executable, sys.executable, *sys.argv)
def restart(update, context):
from threading import Thread... |
MiddleServer.py | #!/usr/bin/env python3
import socket
import threading
import time
from message import Message
import TorzelaUtils as TU
class MiddleServer:
# Set the next server's IP and listening port
# also set listening port for this middle server
def __init__(self, nextServerIP, nextServerPort, localPort):
self.ne... |
tcp_server.py | #!/usr/bin/env python3
import socket
import threading
bind_ip = '0.0.0.0'
bind_port = 9000
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
# set maximum backlog connection to 5
server.listen(5)
print("[*] Listening on {0} : {1}".format(bind_ip, bind_ip))
# client hand... |
utilities.py | #!/usr/bin/env python3
# This file is part of the MIDAS system.
# Copyright 2014
# Andreas Henelius <andreas.henelius@ttl.fi>,
# Jari Torniainen <jari.torniainen@ttl.fi>
# Finnish Institute of Occupational Health
#
# This code is released under the MIT License
# http://opensource.org/licenses/mit-license.php
#
# Pleas... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
import csv
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.