source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
RaspDacDisplay.py | import Winstar_GraphicOLED
import moment
import time
import json
import logging
import subprocess
import os
from mpd import MPDClient
import pylms
from pylms import server
import telnetlib
from socket import error as socket_error
try:
import RPi.GPIO as GPIO
DISPLAY_INSTALLED = True
print("Gpio module inst... |
drone_control_ui.py | # This source code is create UI with Tkinter, glue a some components.
import sys
import numpy as np
from PIL import Image
from PIL import ImageTk
import Tkinter as tki
from Tkinter import Toplevel, Scale
import threading
import pytz
import datetime
import cv2
import os
import time
from drone_ar_flight import Drone_AR_... |
latry.py | import numpy as np
import os
import sys
from mininet.net import Mininet
import threading
from threading import Thread
import time
from datetime import datetime
h1 = net.get('h1')
h2 = net.get('h2')
h3 = net.get('h3')
h4 = net.get('h4')
h5 = net.get('h5')
h6 = net.get('h6')
stop = False
#latency_log = open("latlog.t... |
keep_online.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hello. I am online!"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_online():
t = Thread(target=run)
t.start()
|
utils.py | from os.path import dirname, join
from httplib import HTTPConnection
from threading import Thread
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from StringIO import StringIO
from socket import error
from sys import stderr
from re import search
from collective.solr.local import getLocal, setLocal
from c... |
bot.py | import pyautogui
import time
from tkinter import *
import threading
#project code dala3
#zone where take to screenshot to detect the cactus
detectionZone = (476,176, 20, 150)
#enable variable for the loop
BotEnable = False
exitLoop = False
def levelFilter(x):
return 255 if x > 126 else 0
def checkLoop():
global... |
test_run_tracker.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import http.server
import json
import threading
from builtins import open
from future.mo... |
WifeClass.py | import string
import linecache
import random
import sched
import threading
import time
import chardet
import nonebot
import requests
from zhon.hanzi import punctuation
from bot_plugins.Get_girl.random_config_index import *
GOD = 1149558764
LoveTalkList = list()
YanDereList = list()
MarryTalkList = lis... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
test_thread.py | import sys
import pytest
from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
only_pypy ="config.option.runappdirect and '__pypy__' not in sys.builtin_module_names"
class AppTestThread(AppTestCpythonExtensionBase):
@pytest.mark.skipif(only_pypy, reason='pypy only test')
def test_get_... |
utils.py | # -*- coding: utf-8 -*-
import logging
import os
import re
import requests
import time
import zipfile
from datetime import datetime
from getpass import getpass
from threading import Thread, Event
from tqdm import tqdm
from plexapi import compat
from plexapi.exceptions import NotFound
# Search Types - Plex uses these t... |
ping1_basic.py | #! /usr/bin/env python3
# -*-coding:utf-8 -*-
# @Time : 2019/06/16 16:45:29
# @Author : che
# @Email : ch1huizong@gmail.com
from threading import Thread
import subprocess
from queue import Queue
num_threads = 3
queue = Queue()
ips = ["192.168.1.%d" % ip for ip in range(1, 255)]
def pinger(i, q): # 实际工作
w... |
detection.py | '''
COPYRIGHT @ Grebtsew 2019
A simple object detection implementation
'''
import sys
sys.path.insert(0,'..')
import tensorflow as tf
from utils import label_map_util
import numpy as np
from threading import Thread
import os
import screen_overlay_handler
class Obj_Detection(Thread):
result = None
MODEL_NAME... |
parallel_runner.py | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
from multiprocessing import Pipe, Process
import numpy as np
import torch as th
# Based (very) heavily on SubprocVecEnv from OpenAI Baselines
# https://github.com/openai/baselines/blob/master/bas... |
data_updater.py | from apitizer import db_controller
from apitizer import img_parser
import threading
import time
import cv2
class Updater:
def __init__(self, parser_config):
self.parser = img_parser.ImageParser(parser_config)
self.db_controller = db_controller.DatabaseController()
self.runner_thread = thre... |
data.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import math
import random
import cv2
import numpy as np
from queue import Queue
from threading import Thread as Process
#from multiprocessing import Process,Queue
import time
from .util... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
docker_agent.py | import json
import time
import os
import threading
import requests
import docker
from . import BaseAgent
from .. import utility
from .. import characters
class DockerAgent(BaseAgent):
"""The Docker Agent that Connects to a Docker container where the character runs."""
def __init__(self,
... |
with_multiprocess.py | from time import time
from multiprocessing import Process
def factorize(number):
for i in range(1, number + 1):
if number % i == 0:
yield i
def main():
numbers = [8402868, 2295738, 5938342, 7925426]
start = time()
processes = []
for number in numbers:
process = Proces... |
mprocess.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 多线程示例程序
Desc :
"""
from multiprocessing import Process
import os
# 子进程要执行的代码
def run_proc(name):
print('Run child process %s (%s)...' % (name, os.getpid()))
if __name__=='__main__':
print('Parent process %s.' % os.getpid())
p = Process(target=ru... |
frontend.py | #!/usr/bin/python3
""" User Client """
import json
import socketserver
import sys
import threading
import Pyro4
# TODO: work out what is throwing errors
# TODO: get server polling code to change server status if there is an outage.
import order_server
from Pyro4.errors import CommunicationError, PyroError
class Fro... |
main.py | import binascii
from romTables import ROMWithTables
import shlex
import randomizer
import logic
import patches.dungeonEntrances
import explorer
import spoilerLog
def main(mainargs=None):
import argparse
import sys
parser = argparse.ArgumentParser(description='Randomize!')
parser.add_argument('input_f... |
cos_cmd.py | # -*- coding: utf-8 -*-
from six.moves.configparser import SafeConfigParser
from six import text_type
from argparse import ArgumentParser
from logging.handlers import RotatingFileHandler
import sys
import logging
import os
import json
import requests
import qcloud_cos
from threading import Thread
from coscm... |
process_communication.py | # -*- coding: UTF8 -*-
# !/usr/bin/env python
from multiprocessing import Process, Queue
import os, time, random
# 写数据进程执行的代码:
def write(q):
print('Process to write: %s' % os.getpid())
for value in ['A', 'B', 'C']:
print('Put %s to queue...' % value)
q.put(value)
time.sleep(random.rand... |
emails.py | # -*- coding: utf-8 -*-
"""
:author: Grey Li (李辉)
:url: http://greyli.com
:copyright: © 2018 Grey Li <withlihui@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from albumy.extensions ... |
vision_dlib.py | #!/usr/bin/env python
import json
from threading import Thread
from imutils import face_utils
import numpy as np
import cv2
from skimage import measure
from scipy import ndimage
import dlib
import rospkg
import rospy
import roslib.packages
from std_msgs.msg import String
import tf
"""Detect motion and publish point of... |
test_channel.py | #!/usr/bin/env python
#
# Server that will accept connections from a Vim channel.
# Used by test_channel.vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import time
import threading
try:
# Python 3
import socketserver
except ImportError:
... |
normalization.py | # Copyright 2020-2021 Jonas Schulte-Coerne and the CYSTINET-Africa project
#
# 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 requir... |
subscan.py | #!/usr/bin/env python
# coding: utf-8
import argparse
import dns.resolver
import sys
import requests
import json
import difflib
import os
import re
import psycopg2
from tld import get_fld
from tld.utils import update_tld_names
from termcolor import colored
import threading
is_py2 = sys.version[0] == "2" #checks if pyth... |
dosep.py | """
Run the test suite using a separate process for each test file.
Each test will run with a time limit of 10 minutes by default.
Override the default time limit of 10 minutes by setting
the environment variable LLDB_TEST_TIMEOUT.
E.g., export LLDB_TEST_TIMEOUT=10m
Override the time limit for individual tests by s... |
frontend.py | import logging
import traceback
import pykka
import time
import threading
from mopidy import core
from .gpio_manager import GPIOManager
from humanfriendly import format_timespan
from RPi import GPIO
from time import sleep
from mpd import MPDClient
logger = logging.getLogger(__name__)
class GpioFrontend(pykka.Threadin... |
classify_tpu_standlone.py |
# Copyright (c) HP-NTU Digital Manufacturing Corporate Lab, Nanyang Technological University, Singapore.
#
# This source code is licensed under the Apache-2.0 license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from edgetpu.classification.engine import ClassificationEngine
f... |
mp_experiments.py | import ctypes, multiprocessing, multiprocessing.sharedctypes, time
from multiprocessing.managers import BaseManager
class MathsClass:
def __init__(self, i):
self.i = i
def add(self, x, y):
return x + y + self.i
def mul(self, x, y):
return x * y + self.i
def set_i(self, i):
... |
unicorn_binance_websocket_api_manager.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/uni... |
solver_interfaces.py | import threading
import os
import socket
import sys
try:
from SimpleXMLRPCServer import (SimpleXMLRPCServer,
SimpleXMLRPCRequestHandler)
from SimpleHTTPServer import SimpleHTTPRequestHandler
except ImportError:
# Python 3.x
from xmlrpc.server import SimpleXMLRPCServer... |
simple_subprocess.py | import subprocess as sys_subprocess
import threading
import io
import sys
class SubprocessFailed(RuntimeError):
def __init__(self, command, returncode):
self.command = command
self.returncode = returncode
def __str__(self):
return (
f"Encoder failed with return code {self.... |
test_startup.py | import os
import signal
import threading
import time
from pathlib import Path
import ambianic
import pytest
from ambianic import __main__, config, load_config
from ambianic.server import AmbianicServer
from ambianic.util import ManagedService, ServiceExit
@pytest.fixture
def my_dir():
return os.path.dirname(os.p... |
plugin_mixin.py | # Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
streamRecorder.py | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 16 22:07:08 2018
@author: Alexis
A variation from streamListener better for recording and asynchronous protocol
"""
from pylsl import StreamInlet, resolve_streams
import streamError
import threading as th
import numpy as np
import time
import math
from collections impo... |
keep_alive.py | # Converts the repl into a web server
# Which allows the bot to stay alive
# CREDITS TO BEAU FROM FREECODECAMP FOR THIS ONE
# https://www.youtube.com/watch?v=SPTfmiYiuok
from flask import Flask
from threading import Thread
app = Flask("")
@app.route("/")
def home():
return "<h1>Cosette Bot is alive</h1>"
def ru... |
test_functools.py | # import abc
# import builtins
# import collections
# import collections.abc
import copy
from itertools import permutations, chain
# import pickle
from random import choice
import sys
# from test import support
# import threading
import time
# import typing
import unittest
# import unittest.mock
# import os
# from weak... |
server.py | #!/usr/bin/env python3
import sys
import socket
import selectors
import traceback
from tools import registerDeviceOnIotHub,startClient
from config import GatewayConfig
import multiprocessing
def serverStarter(COORDINATOR_NAME):
print("starting client")
startClient(COORDINATOR_NAME)
print("Client Start... |
multiple_pipelines_test.py | # -*- coding: utf-8 -*-
#
# ventilatorA-------------+
# | |
# +--------+-------+ |
# | | | |
# workerA workerA workerA ... |
# | | | |
# +--------+-------+ |
# | |
# si... |
pi_master.py | """Simulate the shutdown sequence on the master pi."""
import socket
import threading
import time
from pathlib import Path
def talk_to_train():
with socket.socket() as sock:
# TODO: replace localhost with static ip of train pi
# port number has to match the socket.bind() of the other progr... |
pc2obs.py | # ECSC on the opencv image to quit
import numpy as np
import cv2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
import time
import sys
import rospy
import sensor_msgs.point_cloud2 as pc2
from sensor_msgs.msg import PointCloud2, CompressedImage, PointField
from nav_msgs.msg import ... |
diskover_socket_server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) Chris Park 2017-2018
diskover is released unde... |
test_zmq_pubsub.py | #!/usr/bin/env python
__author__ = 'Radical.Utils Development Team'
__copyright__ = 'Copyright 2019, RADICAL@Rutgers'
__license__ = 'MIT'
import time
import threading as mt
import radical.utils as ru
# ------------------------------------------------------------------------------
#
def test_zmq_pubsub():... |
configure_and_test_integration_instances.py | from __future__ import print_function
import argparse
import ast
import json
import os
import subprocess
import sys
import uuid
import zipfile
from datetime import datetime
from distutils.version import LooseVersion
from enum import IntEnum
from pprint import pformat
from threading import Thread
from time import sleep... |
java.py | import json
import socketserver
import socket
import sys
import re
from threading import Thread
import py4j
import hail
class FatalError(Exception):
""":class:`.FatalError` is an error thrown by Hail method failures"""
class Env:
_jvm = None
_gateway = None
_hail_package = None
_jutils = None
... |
testWordSending.py | import websocket
import time
import threading
try:
import thread
except ImportError:
import _thread as thread
num = 10
msg = ""
def worker():
global msg
global num
if msg == "end":
print("")
time.sleep(8)
else:
print(num)
ws.send(str(num))
num += 1
... |
local_server.py | import os.path
import threading
from flask import Flask
from code_runner import CodeRunner
from config import INDEX_HTML_PATH, FLASK_PORT
server = Flask(__name__)
def start():
thr = threading.Thread(target=server.run, kwargs={'port': FLASK_PORT})
thr.daemon = True # local server will exit automatically af... |
test_state.py | # -*- coding: utf-8 -*-
'''
Tests for the state runner
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
import os
import shutil
import signal
import tempfile
import textwrap
import threading
from salt.ext.six.moves import queue
# Import Salt Testing Libs
f... |
cli.py | import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import ckan.logic as logic
import ckan.model as model
import ckan.include.rjsmin as rjsmin
import ckan.include.rcssmin as rcssmin
import ckan.lib.fanstatic_resources as fanstatic_resources... |
main.py | # codeing=UTF-8
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import threading
import time
def join_game(num):
browser = webdriver.Chrome()
browser.implicitly_w... |
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
parser = ar... |
UnitTestCommon.py | # Copyright 2015 Ufora 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 i... |
openpose.py | #!/usr/bin/env python
# necesita el paquete https://github.com/ildoonet/tf-pose-estimation
# ./openpose.py --dev=dir:../images/madelman.png
# ./openpose.py --size=400x300
import cv2 as cv
import numpy as np
from threading import Thread
import time
from umucv.util import putText
from umucv.stream import autoStream... |
qmemmand.py | import configparser
import socketserver
import logging
import logging.handlers
import os
import socket
import sys
import threading
import xen.lowlevel.xs
import vanir.qmemman
import vanir.qmemman.algo
import vanir.utils
SOCK_PATH = '/var/run/vanir/qmemman.sock'
LOG_PATH = '/var/log/vanir/qmemman.log'... |
pubsub.py |
import cmd
from queue import Queue
from threading import Thread
class Pub1(cmd.Cmd):
intro = 'pub-sub example'
prompt = '>>> '
file = None
def __init__(self, dispatch: Queue):
super().__init__()
self.dispatch = dispatch
def do_f1(self, arg):
self.dispatch.put(('f1', 'pub... |
vis_stretch.py | # -*- coding: UTF-8 -*-
'''=================================================
@Author :zhenyu.yang
@Date :2020/11/5 11:37 AM
=================================================='''
import sys
sys.path.append('./')
sys.path.insert(0,'/data/zhenyu.yang/modules')
import cv2
import json
import numpy as np
import random
i... |
firmware_manager.py | # Copyright 2019 Jetperch 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 agreed to in writing,... |
__init__.py | #!/usr/bin/env python
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import functools
import logging
import os
import re
import signal
import sys
import threading
import boto3
import fabric
try:
import queue
except ImportError:
import Queue as queue
__version__ = "... |
nanny.py | import asyncio
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
import uuid
import warnings
import weakref
import dask
from dask.system import CPU_COUNT
from tornado.ioloop import IOLoop
from tornado.locks import Event
from tornado import gen
from .comm im... |
jpush_client.py | #/usr/bin/env python
#-*- coding:utf-8 -*-
from threading import Thread
import requests
import json
appkey = '5a0fe3d99d1d89a25d73b0a4'
master_secret = '8cc1233226324ee29af559d2'
url = 'https://api.jpush.cn/v3/push'
payload = {"platform":["android"],"audience":"all", "options":{"time_to_live":"0", "sendno":0}, "noti... |
_algorithm.py | '''
Copyright (c) 2018 by Tobias Houska
This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY).
:author: Tobias Houska
This file holds the standards for every algorithm.
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __futu... |
factory.py | """A module for Split.io Factories."""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import threading
from collections import Counter
from enum import Enum
import six
from splitio.client.client import Client
from splitio.client import input_validator
from splitio.... |
example.py | """
An example of how logging can be added to a Dask/Dask Distributed system where
workers are in different threads or processes.
"""
from dask import compute, delayed
from dask.distributed import Client
import logging
from logging.config import fileConfig
import logging.handlers
import multiprocessing
from random i... |
utils.py | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2017, Battelle Memorial Institute.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... |
tatamiracer_test.py | # TatamiRacer Test for Steering Servo and Motor
import pigpio
import tkinter as tk
from tkinter import messagebox
import numpy as np
import os
import re
import time
import threading
pi = pigpio.pi()
gpio_pin0 = 13 #Motor1
gpio_pin1 = 19 #Motor2
gpio_pin2 = 14 #Servo
fname = os.getcwd()+r'/myconfig.py' #for Donkey Car... |
bot.py | from discord.ext import commands
import subprocess
import threading
import aiofiles
import discord
import asyncio
import aiohttp
import random
import ctypes
import re
import os
ctypes.windll.kernel32.SetConsoleTitleW('zoom')
token = ''
prefix = '/'
intents = discord.Intents().all()
bot = commands.Bot... |
client.py | import os
import socket
import threading
import sys
from time import sleep
# Const variables
if len(sys.argv) == 3:
HOST: str = str(sys.argv[1])
PORT: int = int(sys.argv[2])
else:
HOST: str = "127.0.0.1"
PORT: int = 6666
# Ask a nickname
nickname = input("Enter your nickname for the chat : ")
# Creat... |
kernel.py | from __future__ import print_function
from ipykernel.kernelbase import Kernel
from subprocess import check_output
import pkg_resources
import atexit
import os
import io
import re
import yaml
import threading
from subprocess import Popen, STDOUT, PIPE
import logging
import json
import traceback
import tempfile
import ... |
kaldi_io_distill.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014-2016 Brno University of Technology (author: Karel Vesely)
# Licensed under the Apache License, Version 2.0 (the "License")
#
# Modified:
# 2018 Yi Liu
import numpy as np
import sys, os, re, gzip, struct
import random
from six.moves import range
###... |
operators.py | # standart modules
import threading
import struct
import os
# blender modules
import bpy
import bmesh
# addon modules
import taichi as ti
import numpy as np
from .engine import mpm_solver
from . import types
from . import particles_io
from . import nodes
WARN_SIM_NODE = 'Node tree must not contain more than 1 "Simu... |
node_provider.py | import random
import copy
import threading
from collections import defaultdict
import logging
import boto3
import botocore
from botocore.config import Config
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.aws.config import bootstrap_aws
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, ... |
reqAttack.py | import requests
import random
import threading
import sys
VERSION='2.0'
url=sys.argv[0]
socket_ip=[]
user_agent=[]
request_counters=0
def user_agents():
user_agent.append('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1')
user_agent.append... |
websocket.py | from pdb import set_trace as T
import numpy as np
from signal import signal, SIGINT
import sys, os, json, pickle, time
import threading
import ray
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from twisted.python import log
from twisted.web.server import Site
from twisted.web.stat... |
collective_ops_test.py | # Copyright 2020 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 applicab... |
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... |
test_failure.py | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.utils
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_uti... |
main.py | #!/usr/sbin/env python
import click
import ipaddress
import json
import netaddr
import netifaces
import os
import re
import subprocess
import sys
import threading
import time
from socket import AF_INET, AF_INET6
from minigraph import parse_device_desc_xml
from portconfig import get_child_ports
from sonic_py_common im... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import threading
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import Test... |
cluster.py | ################################################################################
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix eleme... |
__init__.py | import os
import sys
import subprocess
import threading
import time
import wx
import wx.aui
from wx import FileConfig
import pcbnew
from dialog import Dialog
def check_for_bom_button():
# From Miles McCoo's blog
# https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/
def ... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
standalone_test.py | """Tests for acme.standalone."""
import multiprocessing
import os
import shutil
import socket
import threading
import tempfile
import unittest
import time
from contextlib import closing
from six.moves import http_client # pylint: disable=import-error
from six.moves import socketserver # type: ignore # pylint: disab... |
runtest.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import random
import re
import setproctitle
import string
import subprocess
import sys
import threading
import time
from collections import defaultdict, namedtuple, OrderedD... |
core.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
test_runner.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.
"""Runs perf tests.
Our buildbot infrastructure requires each slave to run steps serially.
This is sub-optimal for android, where these steps can run indepe... |
bot_status.py | from flask import Flask
from threading import Thread
from waitress import serve
app = Flask('')
@app.route('/')
def home():
return "Bot is online!"
def run():
serve(app, host="0.0.0.0", port=8080) # production server using waitress
# app.run(host='0.0.0.0',port=8080) #development server
def keep_ali... |
melody.py | import random
import pyaudio
from comp_osc import SineOsc
import multiprocessing as mp
import time
sine_osc = SineOsc()
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32,
channels=1,
rate=44100,
output=1,
)
def func1():
print ('func1')... |
Navigator.py | #encoding=utf-8
'''
project overview:
Subscribe:
1.slam pose(global/local pose) *
2.octomap_server/global map
3.local pointcloud/local octomap
4.target input(semantic target/visual pose target/gps target)
Publish:
1.Mavros(amo) Command
2.Navigator status
Algorithms:
1.D*
2.state transfer
... |
Pumabus_Paw_Luis.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#Hecho por Brenda Paola Lara Moreno | Luis Arvizu
#Sistop-2019-2| FI-UNAM |
#Ejercicio Implementado: Pumabus
#Lenguaje: Python
#Este trabajo se desarrollo en la version 2.7.10
#Para ejecutarlo requiere de Python, y ejecutarlo desde la terminal posisionandose en
#el directorio ... |
decode.py | # fmt: off
import logging
import os
import signal
import socket
import threading
from collections import UserDict
from datetime import datetime, timedelta, timezone
from operator import itemgetter
from pathlib import Path
from typing import (
Any, Callable, Dict, Iterable, Iterator,
List, Optional, TextIO, Tup... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The EvolveChain developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
im... |
interSubs.py | #! /usr/bin/env python
# v. 2.10
# Interactive subtitles for `mpv` for language learners.
import os, subprocess, sys
import random, re, time
import requests
import threading, queue
import calendar, math, base64
import numpy
import ast
from bs4 import BeautifulSoup
from urllib.parse import quote
from json import loa... |
runner.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... |
Server.py | import socket
from threading import Thread
import time
data = open("../assets/version.txt", "r").read()
print("Chat Room 101 | " + data)
time.sleep(1)
clients = {}
addresses = {}
host = socket.gethostname()
ip = socket.gethostbyname(host)
port = 8080
s = socket.socket()
s.bind((host, port))
print(host, ip)
print("As... |
core.py | import inspect
import logging
import sys
import time
from typing import Callable
from threading import Thread
import dill
from clint.textui import puts, indent, colored
from slack import RTMClient
from machine.vendor import bottle
from machine.dispatch import EventDispatcher
from machine.plugins.base import MachineB... |
t.py | import logging
import threading
import time
def thread_function(name):
logging.info("Thread %s: starting", name)
time.sleep(20)
logging.info("Thread %s: finishing", name)
if __name__ == "__main__":
format = "%(asctime)s: %(message)s"
logging.basicConfig(format=format, level=logging.INFO,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.