source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
network_utils.py | #!/usr/bin/env python
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
from collections import defaultdict
import logging
import multiprocessing
import platform
import re
i... |
test_bus.py | import unittest
import threading
import time
from unittest.mock import MagicMock
from datetime import timedelta
from osgar.bus import (Bus, BusShutdownException,
LogBusHandler, LogBusHandlerInputsOnly,
almost_equal)
from osgar.lib.serialize import serialize
class BusHa... |
39-2.py | from queue import Queue
from threading import Thread
import time
# queue = Queue(1)
#
# def consumer():
#
# print('Consumer waiting')
# time.sleep(0.1)
# queue.get()
# print('comsumer got 1')
# queue.get()
# print('comsumer got 2')
# print('Consumer done')
#
# thread = Thread(target=consumer)
#
# thread.start(... |
Attendance_Camera_Module.py | """
Date : 06 May 2019
Author : Shiyaz T
Reference : https://www.pyimagesearch.com/2018/09/24/opencv-face-recognition/
"""
import pickle
import cv2
import os
import numpy as np
import imutils
import time
import threading
import json
import paho.mqtt.client as mqtt
from collections import Counter
import schedule
#Thing... |
test_currentthreadscheduler.py | import threading
import unittest
from datetime import timedelta
from time import sleep
import pytest
from reactivex.internal.basic import default_now
from reactivex.scheduler import CurrentThreadScheduler
class TestCurrentThreadScheduler(unittest.TestCase):
def test_currentthread_singleton(self):
schedu... |
bitmex_websocket.py | import websocket
import threading
import traceback
from time import sleep
import json
import logging
import urllib
import math
import time, urllib, hmac, hashlib
def generate_nonce():
return int(round(time.time() + 3600))
# Generates an API signature.
# A signature is HMAC_SHA256(secret, verb + path + nonce + d... |
flask_mail_send.py | from threading import Thread
from flask import Flask
from flask_mail import Mail, Message
from email_config import Config
gmail_credentials = Config()
app = Flask(__name__)
mail_settings = {
"MAIL_SERVER": 'smtp.gmail.com',
"MAIL_PORT": 465,
"MAIL_USE_TLS": False,
"MAIL_USE_SSL": T... |
Blinker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
import time as _time
import socket
import threading
from Blinker.BlinkerConfig import *
from Blinker.BlinkerDebug import *
from BlinkerUtility.BlinkerUtility import *
# from BlinkerAdapters.BlinkerBLE import *
# from BlinkerAdapters.Blink... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import importlib.machinery
import importlib.util
import os
import pickle
import random
import re
import subprocess
import sys
import t... |
websocket_socket.py | from .socket_abc import Socket_ABC
from abc import abstractmethod
import asyncio
import websocket
import typing
import logging
import threading
from rsockets2.frames import Frame_ABC
class RWebsocketSocket(Socket_ABC):
def __init__(self, url: str, resume_support: bool):
super().__init__(resume_support)
... |
createListView.py | from PySide6.QtWidgets import QWidget, QMessageBox
from PySide6.QtGui import QStandardItemModel, QStandardItem, QRegularExpressionValidator
from PySide6.QtCore import Qt, QRegularExpression
from src.createList import Ui_CreateListPage
from src.databaseHandler import Database
import threading
class CreateList(QWidge... |
miniserver.py | import logging
import os
import select
import SimpleHTTPServer
import socket
import SocketServer
import threading
HERE = os.path.dirname(__file__)
logger = logging.getLogger(__name__)
class ThisDirHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def translate_path(self, path):
path = path.split('?', 1... |
task.py | """ Backend task management support """
import itertools
import json
import logging
import os
import sys
import re
from copy import copy
from enum import Enum
from tempfile import gettempdir
from multiprocessing import RLock
from pathlib2 import Path
from threading import Thread
from typing import Optional, Any, Sequen... |
statreload.py | import multiprocessing
import os
import signal
import sys
import time
HANDLED_SIGNALS = (
signal.SIGINT, # Unix signal 2. Sent by Ctrl+C.
signal.SIGTERM, # Unix signal 15. Sent by `kill <pid>`.
)
class StatReload:
def __init__(self, logger):
self.logger = logger
self.should_exit = False... |
example_4_application.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 17:13:08 2019
@author: Carlos
"""
import time
import matplotlib.pyplot as plt
import numpy as np
import threading # Enable threading of processes
from galdinoFunctions_gpib_V1.py import *
# %% Functions
def update_line(hl, ax, new_dataX, new_dataY):
hl.set_xdat... |
example.py | import threading
import time
from class_decorator_with_inheritance import throttle
class Example:
@throttle(limit=2)
def do_work(self):
pass
@throttle(limit=5)
def do_work():
pass
@throttle # disabled
def do_fast_work():
pass
def run_example(label, target, times, limit):
print(f'--... |
runner.py | # MIT License
#
# Copyright (c) 2016 Olivier Bachem
#
# 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, merg... |
1.py | #!/usr/bin/env python3
import intcode
import threading
import queue
class Network(object):
def __init__(self):
self.devices = {}
def connect(self, address, ingress, egress):
self.devices[address] = (ingress, egress)
def packet_switch(self):
while True:
for adr, ch i... |
zoomrec.py | import csv
import logging
import os
import psutil
import pyautogui
import random
import schedule
import signal
import subprocess
import threading
import time
import atexit
from datetime import datetime, timedelta
global ONGOING_MEETING
global VIDEO_PANEL_HIDED
logging.basicConfig(
format='%(asctime)s %(levelname)... |
geneticClock.py | # -*- coding: utf-8 -*-
import re
import random
import math
import copy
import os
from operator import itemgetter
from collections import deque
import wx
import wx.richtext as rt
import threading
# print wx.version()
TimePatternsDEre = {
1 : [
re.compile(u"(.*)(ein)(.+)(uhr)(.*)"),
re.compile(u"(.... |
__init__.py | # coding: utf-8
import random
import uuid
from flask import Flask, jsonify, request as reqq
from urllib import request, parse
import socket, hashlib, re, time, threading
import urllib3
from dophon import logger
logger.inject_logger(globals())
class micro_cell():
'''
远程请求调用封装类,用urllib处理请求发送和响应处理
'''
... |
HiwinRA605_socket_ros_20190619170820.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
blender.py | import threading
import bpy
import math
import grpc
from concurrent import futures
import sys
from os import path
print(path.dirname( path.dirname( path.abspath(__file__) ) ))
sys.path.append(path.dirname( path.dirname( path.abspath(__file__) ) ))
packages_path = "c:\\users\\wlckd\\appdata\\roaming\\python\\python39\\... |
server.py | #!/usr/bin/env python3
## Stdlib imports ##
import random
import os
import atexit
from threading import Thread
from time import sleep
from functools import partial
# Want to see a ghetto database? _This_ is a ghetto database
import shelve
# For url quoting
import urllib
# For request validation
import re
## Externa... |
model.py | import json
from threading import Thread
import time
from typing import Any, Dict, List, FrozenSet, Set, Union, Optional
import urwid
from zulipterminal.helper import (
asynch,
classify_unread_counts,
index_messages,
set_count
)
from zulipterminal.ui_tools.utils import create_msg_box_list
class Mode... |
multiple_instances_advance.py | #!/usr/bin/env python3
from __future__ import print_function
from random import choice, random
from time import sleep, time
from vizdoom import *
# For multiplayer game use process (ZDoom's multiplayer sync mechanism prevents threads to work as expected).
from multiprocessing import cpu_count, Process
# For singlep... |
main.py | import queue
from threading import Thread
import time
import gui
import tts
import voice_recognition
import input_page
def get_input_list():
input_list = []
def get(name, type_, default=None):
if default is None:
return input_page.InputForm(label=name, input_type=type_)
if type_ is... |
smoke.py | # Copyright 2018 John Reese
# Licensed under the MIT license
import asyncio
import sqlite3
import sys
from pathlib import Path
from sqlite3 import OperationalError
from threading import Thread
from unittest import SkipTest, skipIf, skipUnless
import aiounittest
import aiosqlite
from .helpers import setup_logger
TEST... |
coref_model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import util
import coref_ops
import conll
im... |
test_async.py | ################################################################################
#
# Copyright (c) 2019, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
import six
import tornado.iol... |
zipo.py |
import zipfile
import time
import threading
startTime = time.time()
# 判断线程是否需要终止
flag = True
def extract(password, file):
try:
password = str(password)
file.extractall(path='.', pwd=password.encode('utf-8'))
print("The Passwd is: {}".format(password))
nowTime = time.time()
... |
duco_api.py | ##########################################
# Duino-Coin Transactions Module
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# Creator: Connor2
# © Duino-Coin Community 2021
##########################################
import ast
from requests import get
import requests
import socket
import json
... |
main.py | #!/usr/bin/env python3
import argparse
import json
import sys
import threading
import time
from functools import cache
import requests
# Max values
MAX_THREADS = 100
# Session
SESSION = requests.Session()
SESSION.mount("https", requests.adapters.HTTPAdapter(max_retries=5))
# Semaphores
THREADS_SEM = threading.Bound... |
mixins.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
=============
Class Mix-Ins
=============
Some reusable class Mixins
'''
# pylint: disable=repr-flag-used-in-string
# Import python libs
from __future__ import absolute_import, print_function
import os
import sys... |
mimic_tts.py | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
experiment.py | import threading
from datetime import datetime
import numpy as np
import os
from time import sleep
import yaml
from PythonForTheLab import ur
class Experiment:
def __init__(self, config_file):
self.config_file = config_file
self.is_running = False # Variable to check if the scan is running
... |
device.py | # -*- coding: utf-8 -*-
import os
import sys
import json
import time
import logging
import threading
import logging.config
import numpy as np
from datetime import datetime
from collections import defaultdict
from .io import discover_hosts, io_from_host, Ws
from .services import name2mod
from anytree import AnyNode, ... |
test_application.py | # GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... |
libinstruction.py | import modular_core.fundamental as lfu
import time
from threading import Timer
from threading import Thread
if __name__ == '__main__':pass
if __name__ == 'modular_dt.libinstruction':
lfu.check_gui_pack()
lgm = lfu.gui_pack.lgm
lgd = lfu.gui_pack.lgd
lgb = lfu.gui_pack.lgb
class timer_event(lfu.mobjec... |
plotting.py | #!/usr/bin/env python
#
# plotting.py
# Author: Zex <top_zlynch@yahoo.com>
#
# rcParams {
# 'axes.formatter.use_locale': False,
# 'figure.subplot.right': 0.9,
# 'mathtext.cal': 'cursive',
# 'font.fantasy': ['Comic Sans MS',
# 'Chicago',
# 'Charcoal',
# 'ImpactWestern',
# 'fantasy'],
# '... |
tcp_receiver.py | import sys
import logging
import socket
import threading
from queue import SimpleQueue
def thread_entry(obj):
obj.thread_entry()
class TcpReceiver:
def __init__(self, conn, addr, header_size):
self.conn = conn
self.addr = addr
self.queue = SimpleQueue()
self.header_size = hea... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.utils import xyxy2xywh, xywh2xyxy
import dat... |
main.py | '''
Created on 15.03.2020
@author: Yao Zhang
'''
import PyQt4.QtGui as QtGui
import PyQt4.QtCore as QtCore
import sys
import ui_main # import the ui
import numpy as np
import time
import pyqtgraph
import serial
import threading
class HeatmapVisApp(QtGui.QMainWindow, ui_main.Ui_MainWindow):
# draw the gui
def... |
base.py | import json
import threading
from typing import Dict
from src import config
from src.libs import utils, app_logger
from src.libs.cache import redis_cache
from src.viz_models import pb_reader
class BaseModel:
def __init__(self, user_id: str, repo_id: str, branch_id: str):
self.user_id = user_id
se... |
A3C_RNN.py | """
Asynchronous Advantage Actor Critic (A3C) + RNN with continuous action space, Reinforcement Learning.
The Pendulum example.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
tensorflow r1.3
gym 0.8.0
"""
import multiprocessing
import threading
import tensorflow as tf
import numpy as ... |
test_ntp.py | import ntplib
import time
strNtpAddress = 'europe.pool.ntp.org'
def ntpCurTime(strNtpAddress) :
c = ntplib.NTPClient()
response = c.request(strNtpAddress)
print (time.ctime(response.tx_time))
print (time.time())
print (time.localtime())
#return time.time(response.tx_time)
from sock... |
task.py | ##############################################################################
#
# 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 distribution.
# TH... |
receiver.py | import logging
import multiprocessing
from datetime import datetime
from proton.handlers import MessagingHandler
from proton.reactor import Container
import common
"""
This AMQP receiver application, receives messages, with an expected
body and properties sizes (if not met a message will be logged).
After `reconnect... |
amplification.py | import itertools
import queue
from threading import Thread
class Amplifier:
def __init__(self, name, input_queue, output_queue):
self.name = name
self.input_queue = input_queue
self.output_queue = output_queue
self.stop_thread = False
def process_op(self, opcode, position):
... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
try:
... |
command.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... |
map_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
DemoMultiprocessing.py | # -*- coding: utf-8 -*-
"""Simple demo of multiprocessing module using.
The main idea, seems, that all spawned childrens evoked in a order, but the main thread stops before
all spawned children stopped.
@author: ssklykov
"""
# %% Import section
import os
# import multiprocessing as mp
from multiprocessing import Proces... |
test_ssl.py | """Tests for TLS support."""
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import functools
import json
import os
import ssl
import subprocess
import sys
import threading
import time
import OpenSSL.SSL
import pytest
impor... |
ip_lib.py | # Copyright 2012 OpenStack Foundation
# 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 requ... |
health_manager.py | from inventory import belt
from pather import Location
import cv2
import time
import keyboard
from utils.custom_mouse import mouse
from utils.misc import wait
from logger import Logger
from screen import grab
import time
from config import Config
from inventory import common
from ui import view, meters
from ui_manager ... |
message_executors.py | from .redis_manager import RedisManager
from .user_instance import UserInstance
from .consts import WAITING_CHANNEL, SERVER_CODES, USER_RCODES, USER_SCODES
from . import api_requests
from queue import Queue
import threading
def build_dict(data_type, data):
to_return = {
't': data_type,
'd': data
... |
multi_ps_async_part1.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import sys
import cPickle as pickle
import socket
from multiprocessing import Process, Queue, Value, Manager
from ctypes import c_char_p
from datetime import datetime
import time
import te... |
install.py | from core.config import Settings
from core.providers.aws import BaseAction
from core.log import SysLog
from core import constants as K
from core.terraform import PyTerraform
from core.terraform.utils import get_terraform_scripts_and_files_dir
from time import sleep
from distutils.dir_util import copy_tree
from threadin... |
test_threading.py | from __future__ import annotations
import queue
import threading
import unittest
from scru128 import scru128, Scru128Id
class TestThreading(unittest.TestCase):
def test_threading(self) -> None:
"""Generates no IDs sharing same timestamp and counters under multithreading"""
def producer(q: queue... |
widgets.py | """A Jupyter Notebook interface to Klampt.
Examples:
Basic usage::
from klampt import *
from klampt.vis.ipython import KlamptWidget
from IPython.display import display
world = WorldModel()
... #set up the world...
kvis = KlamptWidget(world,width=800,height=640)
... |
getValue.py | import time
from multiprocessing import Process, Lock
mutex = Lock()
some_data_global = "This is the data global"
def processData(data):
with mutex:
print(some_data_global)
if __name__ == '__main__':
jobs = []
for i in range(5):
som... |
tello_drone.py | """
@title
@description
"""
import json
import math
import os
import queue
import socket
import threading
import time
from datetime import datetime
from enum import Enum
import cv2
from auto_drone import DATA_DIR
class FlipDirection(Enum):
"""
"""
LEFT = 'l'
RIGHT = 'r'
FORWARDS = 'f'
BACK ... |
MyBot.py | import pyautogui
import threading
import time
from pynput.keyboard import Listener, Key, Controller
__version__ = 1.0
def press1():
while True:
pyautogui.press("1")
time.sleep(0.05)
pyautogui.press("1")
time.sleep(3)
def press2():
while True:
pyauto... |
testMultip.py | from multiprocessing import Process
from multiprocessing import Pool
import scipy
import random
def workerFunction(arg):
scipy.random.seed()
print arg
a = []
for i in xrange(10):
a.append(random.randint(0,20))
print a
if __name__ == '__main__':
p = Pool(5)
a = 'a'
b = 'b'
... |
pack.py | # -*- coding:utf-8 -*-
# @author : cbingcan
# @time : 2021/8/24/024 9:53
from threading import Thread
import sophon.sail as sail
from capture.Capture import Capture
from detection.YoloX import YOLOX
import time
import signal
import os
import threading
from threading import Thread
from upload import UploadProce... |
node_provider.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import threading
from collections import defaultdict
import boto3
from botocore.config import Config
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.tags import TAG_RAY... |
installwizard.py |
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.uix.togglebutton impo... |
test_CatalogIndexing.py | from threading import Thread
from threading import currentThread
from time import sleep
from unittest import TestCase
from Acquisition import Implicit
from transaction import abort
from transaction import commit
from transaction import savepoint
from zope.component import provideUtility
from zope.interface import impl... |
__init__.py | # Name: Charles R. Whealton
# Project: Physical Programming Emulator (Bridge)
#
# Description: This is the bridge code that students import into their Python programs
# in order to work with the Physical Programming Simulator. This rewrite uses a dictionary
# to keep track of states, and there are startup states... |
test_processfamily.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import *
from future.utils import... |
worker.py | # worker.py - master-slave parallelism support
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import errno, os, signal, sys, threading, util
def countcpus():
'''try to cou... |
Chat.py | # -*- coding: utf-8 -*-
# chat.py
# A python p2p chat.
# Copyright 2015 Max Thor
#
# 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
#
... |
manager_server.py | """
Copyright 2021 Cartesi Pte. Ltd.
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 d... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
from __future__ import absolute_import, with_statement, print_function, unicode_literals
import copy
import c... |
utilities.py | import inspect
import signal
import random
import time
import traceback
import sys
import os
import subprocess
import math
import pickle as pickle
from itertools import chain
import heapq
class Thunk(object):
# A class for lazy evaluation
def __init__(self, thing):
self.thing = thing
self.evalu... |
fileServer.py | import socket
import threading
import os
def RetrFile(name, sock):
filename = sock.recv(1024)
if os.path.isfile(filename):
sock.send("Exists" + str(os.path.getsize(filename)))
print "requesting <" + filename + ">"
userResponse = sock.recv(1024)
if userResponse[:2] == "OK":
... |
manager.py | """Local development server manager."""
import logging
import os
import socket
import sys
import threading
from grow.common import colors
from grow.common import timer
from grow.preprocessors import file_watchers
from grow.sdk import updater
from grow.server import main as main_lib
from werkzeug import serving
loggin... |
client.py | import json
import multiprocessing as mp
from threading import Thread
import grpc
from dominion_object_model import object_model
from dominion_grpc_proto import dominion_pb2_grpc
from dominion_grpc_proto.dominion_pb2 import PlayerInfo, Card, ActionResponse
class Client(object_model.GameClient):
def __init__(se... |
copter.py | import logging
import geopy
import os
import time
import queue
import signal
#
from geopy.distance import distance as geopy_distance
from pymavlink import mavutil
from threading import Thread
#
import utils
from param_protocol import Params
from heartbeat_protocol import HeartBeat
from command_protocol import CommandIn... |
svenzva_driver.py | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2017 Svenzva Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... |
test_serve_logs.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... |
md_server.py | import grpc
import md_server_pb2 as ms
import md_server_pb2_grpc as ms_grpc
from concurrent import futures
import time
import threading
import ms_conf
# count in each second, remove servers that aren't responding.
def timeout(targetList, lock, idSet):
while True:
time.sleep(1)
rmList = [... |
miselbo_eval.py | # ---------------------------------------------------------------
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the NVIDIA Source Code License
# for NVAE. To view a copy of this license, see the LICENSE file.
# ------------------------------------------------------------... |
utkhashmir.py | # The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... |
client.py | # -*- coding:utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Client widget for the IPython Console
This is the widget used on all its tabs
"""
# Standard library imports
from __future__ import absolute_import ... |
hello_threads.py | from threading import Thread
from time import sleep
from time import time
from fib import timed_fib
def print_hello():
while True:
print("{} - Hello world!".format(int(time())))
sleep(3)
def read_and_process_input():
while True:
n = int(input())
print('fib({}) = {}'.format(n... |
configure_and_test_integration_instances.py | from __future__ import print_function
import argparse
import os
import uuid
import json
import ast
import subprocess
import sys
import zipfile
from datetime import datetime
from enum import IntEnum
from pprint import pformat
from time import sleep
from threading import Thread
from distutils.version import LooseVersion... |
scoringExecutor.py | # vim: set encoding=utf-8
#
# Copyright (c) 2016 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 requi... |
app.py | from flask import Flask
import threading
from surprise_menu_client import SurpriseMenuClient
app = Flask(__name__)
threading.Thread(target=SurpriseMenuClient).start()
@app.route('/')
def welcome():
return "Welcome to Camunda Python Client"
if __name__ == '__main__':
app.run()
|
tinyshell.py | ## Title: tinyshell.py
## Author: Joe Vest
## Description: Command console framework that control webshells
"""
___________ __ _________ __ __ __
\__ ___/|__| ____ ___ __ / _____/| |__ ____ | | | |
| | | |/ \ | |\_____ \ | | \_/ __ \| | | |
| ... |
ToDoWidget.py | #region Imports
# HTTP requests and url parsing
import requests
import aiohttp
import webbrowser
import http.server
from urllib.parse import urlparse, parse_qs
# Data formats
import json
import yaml
from helpers.ArgHandler import Get_Args
# Logging
from logger.AppLogger import build_logger
# Build the logger object... |
threadedtcpserver.py | #############################################################################
#
#
# Threaded TCP Server network Module to BFA Master
#
#
#############################################################################
""" This module provides a threaded tcp server for answering requests coming in from bfa clients using ... |
server_manager.py | from config.configs import MCPropertiesParser, ObsidiaConfigParser
from server.server import ServerRunner
from datetime import datetime
from typing import List
import threading
import asyncio
import shutil
import time
import os
class ServerManager:
'''
Create and run a server given the directory.
Paramet... |
test_rest_v2_0_0.py | import json
import subprocess
import sys
import time
import unittest
from multiprocessing import Process
import requests
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" + path
def ctnr(path):
... |
fake_swarming.py | # Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import BaseHTTPServer
import json
import logging
import os
import SocketServer
import sys
import threading
BOT_DIR = os.path.dirname(os.path.absp... |
main_server.py | import socket
import threading
import time
import sys
class user_data:
def __init__(self):
self.sending_socket = None
self.receiving_socket = None
class Server:
def __init__(self, ip_addr , port_num):
self.server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
... |
server.py | from flask import Flask, redirect, url_for, render_template
from threading import Thread
app = Flask(__name__)
result = ""
@app.route('/')
def main():
return render_template('index.html')
@app.route('/query-example')
def query_example():
# if key doesn't exist, returns None
language = request.args.get('lang... |
abds.py |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import copy
import stat
import time
import Queue
import tempfile
import threading
import traceback
import subprocess
import radical.utils as ru
from ... import utils as rpu
from ... import states as rps
from ..... |
SniffAir.py | #!/usr/bin/python
import sys, os, signal, readline, time, threading, subprocess
sys.path.insert(0, 'module/')
sys.path.insert(0, 'lib/')
from Sniffer import *
from Connect2DB import *
from Queries import *
import Discover_Hidden_SSID
from Discover_Hidden_SSID import *
import SSID_stat
import export
class colors:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.