source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
iopoll.py | #!/usr/bin/env python
#
# Copyright 2011-2013 Matteo Bertozzi
#
# 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 require... |
PiVideoStream.py | # import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
from threading import Thread
import cv2
class PiVideoStream:
def __init__(self):
# initialize the camera and stream
camera = PiCamera()
camera.resolution = (1280, 720)
camera.framera... |
drone.py | import numpy as np
import math
import scipy.integrate
import time
import datetime
import threading
import multiprocessing as mp
import logging
import json
import sys
# Local files
import message
# Constants
TIME_SCALING = 1.0 # Any positive number(Smaller is faster). 1.0->Real Time, 0.0->Run as fast as possible
QUAD_D... |
pyboard.py | #!/usr/bin/env python
"""
pyboard interface
This module provides the Pyboard class, used to communicate with and
control the pyboard over a serial USB connection.
Example usage:
1. first import this file with:
import pyboard
2. Then create a conection:
in case of a serial port:
pyb = pyboard.Pyboa... |
application_logic.py | import PySimpleGUI as sg
import layout as layout
import os.path
import time
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import scipy.signal as sig
import matplotlib
from dataset import Dat... |
base_service.py | import os
import time
import threading
import traceback
from _socket import gaierror
from typing import Union, List
import json
import configparser
from datetime import datetime
from pika.exceptions import AMQPError
import pika_utils
from state import State
class ConfigurationManager:
def __init__(self, config_... |
Scheduler.py | import sched
import threading
import time
from datetime import datetime, timedelta
import pytz
from croniter import croniter
from .Output import output
class Scheduler:
def __init__(self, config=None, timezone='US/Eastern'):
"""
Maintains the scheduled tasks for the bot
Args:
... |
runner.py | #!/usr/bin/env python3
# Copyright 2010 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This is the Emscripten test runner. To run ... |
debug_events_writer_test.py | # Copyright 2019 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... |
chef.py | import os
import subprocess
from threading import Thread
from domain.cluster import Cluster
from domain.deploy import Deploy
from environment import Environment
from helper_functions import *
from openstack import Openstack
from redstack.exceptions import ChefException, ShellException
logger = logging.getLogger("root... |
optimization_checks.py | # Copyright 2019 WebPageTest LLC.
# Copyright 2017 Google Inc.
# Use of this source code is governed by the Apache 2.0 license that can be
# found in the LICENSE file.
"""Run the various optimization checks"""
import binascii
import gzip
import logging
import multiprocessing
import os
import re
import shutil
import str... |
test_http.py | #!/usr/bin/env python3
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import ssl
import threading
from test.helper import http_server_port
from yt_dlp import YoutubeDL
from yt_dlp.compat import compat_http_server, compat_u... |
camera.py | """camera.py
This code is a tiny and custom version of https://github.com/jkjung-avt/tensorrt_demos#yolov4
"""
import cv2
import numpy as np
import threading
USB_GSTREAMER = True
def add_camera_args(parser):
"""Add parser augment for camera options."""
parser.add_argument("--video_path",
... |
server.py | """Basic http server for tests to simulate PyPI or custom indexes
"""
import urllib.request, urllib.error, urllib.parse
import sys
import time
import threading
import http.server
from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler
class IndexServer(HTTPServer):
"""Basic single-threa... |
menulcd.py | import os
from subprocess import call
from xml.dom import minidom
import webcolors as wc
from PIL import ImageFont, Image, ImageDraw
import LCD_1in3
import LCD_1in44
import LCD_Config
from lib.functions import *
import RPi.GPIO as GPIO
class MenuLCD:
def __init__(self, xml_file_name, args, usersettings, ledse... |
Rerequester.py | # Written by Bram Cohen
# modified for multitracker operation by John Hoffman
# see LICENSE.txt for license information
from BitTornado.zurllib import urlopen, quote
from urlparse import urlparse, urlunparse
from socket import gethostbyname
from btformats import check_peers
from BitTornado.bencode import bdecode
from ... |
train.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
import threading
import numpy as np
import signal
import random
import os
from network import ActorCriticFFNetwork
from training_thread import A3CTrainingThread
from utils.ops import log_uniform
from utils.rmsprop_applier import RMSPropApplier
fr... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the lic... |
ui.py | # Import Module
from tkinter import *
from download import Wallpaper
from set_wallpaper import download_path, set
from tkinter import ttk
import random
import time
import threading
# create root window
root = Tk()
root.resizable(width=False, height=False)
# root window title and dimension
root.title("Wallsy")
# Set g... |
idf_monitor.py | #!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run flash build target to rebuild and flash entire project (Ctrl-T Ctrl-F)
# - Run app-flash build target to rebuild and f... |
BoundedSemaphoreDemo.py | import threading
from time import sleep
th_names = []
def task(s):
global th_names
t_name = threading.current_thread().getName()
print("Waiting to start execution : ", t_name)
s.acquire()
print("Started execution : ", t_name)
th_names.append(t_name)
sleep(1)
print("Finished Execution ... |
outlier_generate.py | import gzip, requests, io
from flask_api import status
from flask import Blueprint, request
from multiprocessing import Process, Manager
from models.main import *
from models.appendix import *
from models.prescription import *
from flask_jwt_extended import (jwt_required, get_jwt_identity, create_access_token)
from con... |
burst.py | # -*- coding: utf-8 -*-
"""
Burst processing thread
"""
from __future__ import unicode_literals
from future.utils import PY3, iteritems
import re
import json
import time
from threading import Thread
from elementum.provider import append_headers, get_setting, log
if PY3:
from queue import Queue
from urllib.pa... |
ssh.py | import paramiko
from threading import Thread
from django_webssh.tools.tools import get_key_obj
import socket
import json
class SSH:
def __init__(self, websocker, message):
self.websocker = websocker
self.message = message
def connect(self, host, user, password, pkey=None, port=22, timeout=30,... |
manager_queue.py | import multiprocessing
def task(queue):
value = queue.get()
print(
f'Process {multiprocessing.current_process().pid} popped {value} from the shared Queue')
queue.task_done()
def main():
manager = multiprocessing.Manager()
q = manager.Queue()
q.put(2)
q.put(3)
q.put(4)
pr... |
gesture_recognition.py | #!/usr/bin/env python
import pdb
from .models import Frame, User
from . import db
from flask import Blueprint, Response, current_app
import os
import threading
import time
from . import monitoring
from . import events
from config import config
main = Blueprint('main', __name__)
dir_path = os.path.dirname(os.path.realp... |
screens.py | from kivy.uix.screenmanager import (
ScreenManager,
Screen,
RiseInTransition,
SwapTransition,
)
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.textinput import TextInput
from kivy.metrics import dp, sp
from kivy.animation import Animation
from kivy.clock import Clock
from kivy.core.window ... |
piparty.py | import psmove
import common, colors, joust, webui
import yaml
import time, random, json, os, os.path, sys, glob
from piaudio import Music, DummyMusic, Audio, InitAudio
from enum import Enum
from multiprocessing import Process, Value, Array, Queue, Manager, freeze_support
from games import ffa, zombie, commander, swappe... |
email.py | """
This file email.py contains functions for sending
text and html rendered emails asynchronously
"""
from threading import Thread
from flask import current_app
from flask import render_template
from flask_mailman import EmailMultiAlternatives
def _send_email_helper(app, msg):
"""
Helper function used for s... |
startProgram.py | """
Starting point for running the program.
"""
from multiprocessing import Process
from MainWindow import start_main_win
from Utilities.IO.IOHelper import create_config_file
if __name__ == '__main__':
create_config_file()
p = Process(target=start_main_win)
p.start()
p.join()
|
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... |
test_cuda.py | from itertools import repeat, chain, product
from typing import NamedTuple
import collections
import gc
import io
import pickle
import queue
import sys
import tempfile
import threading
import unittest
import torch
import torch.cuda
import torch.cuda.comm as comm
from torch.nn.parallel import scatter_gather
from torch.... |
GUI.py | #coding=utf-8
import tkinter as tk
import os
import threading
import time
from tkinter import ttk
from tkinter.filedialog import askdirectory,askopenfilename
from codecounter import CodeCounter
from noval import GetApp
import noval.consts as consts
import noval.syntax.syntax as syntax
import easyplug... |
multitester.py | """
Letsencrypt Integration Test Tool
- Configures (canned) boulder server
- Launches EC2 instances with a given list of AMIs for different distros
- Copies letsencrypt repo and puts it on the instances
- Runs letsencrypt tests (bash scripts) on all of these
- Logs execution and success/fail for debugging
Notes:
- ... |
tracts_multiprocess_2.py | import time
import os
import Trekker
import vtk
import numpy as np
import multiprocessing as mp
import threading
from itertools import repeat
def cpu_bound(number):
return sum(i * i for i in range(number))
def find_sums(tracker_init, seed):
with mp.Pool(5) as pool:
# pool.map(cpu_bound, numbers)
... |
c-realV2.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 - 2021
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... |
IconsDL.py | """MIT License
Copyright (c) 2019 Zdravko Georgiev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... |
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
help_url =... |
subproc_vec_env.py | import multiprocessing as mp
import numpy as np
from .vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars
def worker(remote, parent_remote, env_fn_wrappers):
def step_env(env, action):
ob, reward, done, info = env.step(action)
if done:
ob = env.reset()
return ob, rew... |
node.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... |
state.py | """
The State Compiler is used to execute states in Salt. A state is unlike
an execution module in that instead of just executing a command, it
ensures that a certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state function name... |
bokehspec2.py | import json
from threading import Thread, RLock
import flask
from flask import send_from_directory
import pyaudio
import numpy as np
import scipy as sp
from scipy.integrate import simps
from bokeh.embed import components
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.re... |
hue.py | from config import Config
import flask
import json
import os
from ssdp import SSDP
from threading import Thread
import urllib3
config = None
config_file_paths = [
os.path.dirname(os.path.realpath(__file__)) + "/config/default.cfg.local",
"/etc/hue-adapter/default.cfg.local",
]
for config_file_path in config_... |
filter_dagger_data.py | """
Script to sample critical states from the on-policy data (Sampling Methods - AE(brake), AE(all)), Rank, IT (task-based)
Usage: python filter_dagger_data.py <source_dir> <target_dir> <start_episode_num> <end_episode_num>
"""
import os
import sys
import time
import json
import shutil
import argparse
import multipro... |
client.py | # Copyright (c) 2020 Luca Gioacchini
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, di... |
01_multithreading.py | import datetime
import threading
def busy_wait(n):
while n > 0:
n -= 1
if __name__ == '__main__':
n = 10000000
start = datetime.datetime.now()
for _ in range(4):
busy_wait(n)
end = datetime.datetime.now()
print('The single threaded loops took: %s' % (end - start))
start ... |
keep_alive.py | # keeping bot alive on repl.it https://www.codementor.io/@garethdwyer/building-a-discord-bot-with-python-and-repl-it-miblcwejz
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
... |
worker.py | import atexit
import multiprocessing as mp
import os
import reth
import perwez
ENV_NAME = "QbertNoFrameskip-v4"
WORKER_BATCH_SIZE = 512
WORKER_CNT = 20
DATA_COMPRESSION = "lz4"
PARENT_IP = os.environ.get("PAI_HOST_IP_trainer_0")
def _worker(worker_idx):
pwz = perwez.connect("default")
weight_watcher = pwz.s... |
Job_Handler_SGE_deprecated.py | import matplotlib.pyplot as plt
#plt.style.use('ggplot')
import ipywidgets as widgets
import sys, os, io, string, shutil, math
import numpy as np
import re
import time
import threading
from threading import Thread
from io import StringIO
from ipywidgets import Layout, Box, Label, Output
from IPython.display import disp... |
football_env_test.py | # coding=utf-8
# Copyright 2019 Google 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 ... |
Realtime.py | #!/usr/bin/env python
#Author=@arunodhayan
print "HANDLING IMPORTS..."
import matplotlib.animation as animation
import json
import time
import operator
import argparse
import Tkinter as tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import traceback
import numpy as np
import pickle
import numpy as... |
event_log.py | import multiprocessing
import threading
import time
import warnings
from collections import namedtuple
from dagster_postgres.utils import get_conn
from six.moves.queue import Empty
from dagster import check
from dagster.core.definitions.environment_configs import SystemNamedDict
from dagster.core.events.log import Ev... |
plugin.py | """
Copyright 2015-2017 Paderborn University
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
raputil.py | #!/usr/bin/python
from __future__ import division
import numpy as np
import math
import os
import time
import numpy.linalg as la
from . import tfinterp
#from tfinterp import interp1d_
sqrt=np.sqrt
pi = math.pi
def hexagonal_uniform(N,as_complex=False):
'returns uniformly distributed points of shape=(2,N) within a ... |
DummyAtom.py | #!/opt/anaconda3/bin/python
'''
Created on Apr 03, 2014
@author: nathan
'''
import sys
import os
import shutil
import random
import subprocess
from multiprocessing import Process as Process
from time import sleep as sleep
from time import time as time
import glob
import logging
from optparse import OptionParser
fro... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
import threading
from test import support
from io import BytesIO
if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")
TIMEOUT = 3
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX'... |
brutepwn.py | """BrutePwn
A utility for trying something in remote many times.
This function is useful when, for example:
- leak canary/libc/stack/pie in forked server
- guess little entropy of address (i.e. main_arena --> global_max_fast)
- SQLi to leak something byte by byte (i.e. blind sqli)
"""
import queue
import threading
i... |
device_proxy.py | """
Device Proxy Module which tunnels a TCP Socket through WebSocket to a C8Y Tenant.
Raises:
WebSocketFailureException: Is raised when something is wrong with the Web Socket Connection
TCPSocketFailureException: Is raised when something is wrong with the TCP Connection
"""
import logging
import socket
import t... |
test_networking.py |
import contextlib
import enum
import json
import logging
import subprocess
import threading
import uuid
from collections import deque
import pytest
import requests
import retrying
import test_helpers
from dcos_test_utils import marathon
from dcos_test_utils.helpers import assert_response_ok
__maintainer__ = 'urban... |
util.py | #!/usr/bin/env python
#
# 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... |
run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
QSI workflow
=====
"""
import warnings
import os
import re
import os.path as op
from pathlib import Path
import logging
import sys
import gc
import uuid
from argparse import ArgumentParser
from argparse import ArgumentDefaultsHelpFormatter
from multiprocessing import cp... |
language.py | # coding: utf8
from __future__ import absolute_import, unicode_literals
import random
import itertools
from spacy.util import minibatch
import weakref
import functools
from collections import OrderedDict
from contextlib import contextmanager
from copy import copy, deepcopy
from thinc.neural import Model
import srsly
i... |
observer.py | # Copyright 2015-2016 F-Secure
# 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, ... |
ImageCompare.py | #!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: ImageCompare.py
# Purpose: Tool for comparing tiff files.
#
# Author: Varun Patial
#
# Created: 19-Mar-2018
#
# Copyright: Copyright (C) 2018 Varun Patial
# Licence: MI... |
test_parallel_ray.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 00:38:19 2020
@author: s150127
"""
# import sys
import numpy as np
from pims import ND2_Reader # reader of ND2 files
from pims import Frame # for converting ND2 generator to one numpy array
import time
import multiprocessing as mp
import sys
sys.path.append('../')
... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
__init__.py | # -*- coding: utf-8 -*-
# Three possible modes:
# 'cli': running from "wandb" command
# 'run': we're a script launched by "wandb run"
# 'dryrun': we're a script not launched by "wandb run"
from __future__ import absolute_import, print_function
__author__ = """Chris Van Pelt"""
__email__ = 'vanpelt@wandb.... |
test_wsgi.py | import os
import threading
import uuid
import wsgiref.simple_server
import pytest
import requests
from rump import wsgi, __version__
@pytest.fixture
def settings():
return {
'id_header': 'X-Test-Id',
'health_file': os.path.abspath(__file__),
'routers': [
{
'na... |
managed_event_loop.py | # Copyright 2020 Google 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, s... |
VideoCapture.py | # import the necessary packages
from threading import Thread
import cv2
import time
class VideoStream:
"""create new VideoStream Thread with helper functions.
Paramter
-------
src: int
cam index.
Attributes
----------
grabbed : bool
... |
console.py | # Copyright (c) 2008-2018 LG Electronics, 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 t... |
torture.py | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, Arm Limited and contributors.
#
# 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
#
# ... |
conftest.py | import logging
import os
import random
import time
import tempfile
import threading
from concurrent.futures.thread import ThreadPoolExecutor
from datetime import datetime
from math import floor
from shutil import copyfile
from functools import partial
from botocore.exceptions import ClientError
import pytest
from coll... |
test_bench.py | import os
import signal
import socket
from subprocess import PIPE, STDOUT, Popen
from threading import Thread
import tenacity
from utils import consume_lines, run_command_and_get_output
@tenacity.retry(stop=tenacity.stop_after_delay(15), wait=tenacity.wait_fixed(1))
def wait_for_connect():
socket.create_connecti... |
multi_process_runner_test.py | # Copyright 2019 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... |
turtlebot3_controller.py | #!/usr/bin/env python
import rospy
import geometry_msgs.msg
from geometry_msgs.msg import Twist, Pose
import sys, select, os
import math
from gazebo_msgs.msg import ModelStates, ModelState, LinkState
import time
import numpy as np
from AStarSearch import search
import tf
from matplotlib import pyplot as plt
import thre... |
demo.py | from experience import load_experience, combine_experience
from multiprocessing import Process
from play import get_exp, train
from tiaocan import ker_num, learning_rate
import os
if __name__ == '__main__':
gener = 0
while True:
gener += 1
print(f"=======gener:{gener}===========")
... |
logo.py | import sys
sys.path.append('../../src')
from NeoViki_UI_Python import *
from tkinter import filedialog
import time
import threading
FILE_TYPES=[('PDF files', '.pdf'),
('JPG files', '.jpg'),
('PNG files', '.png'),
('Py files', '*.py'),
('all files', '.*')]
cb_thread=N... |
test_curves.py | import struct
import time
import zmq
import threading
from functools import reduce
NUM_J = 6
ctx = zmq.Context()
# Follow default bind/connect behavior in http://czmq.zeromq.org/czmq4-0:zsock
push = ctx.socket(zmq.PUSH)
push.connect("tcp://0.0.0.0:5559")
pull = ctx.socket(zmq.PULL)
pull.bind("tcp://0.0.0.0:5558")
sim ... |
donkey_sim.py | '''
file: donkey_sim.py
author: Tawn Kramer
date: 2018-08-31
'''
import os
import json
import shutil
import base64
import random
import time
from io import BytesIO
import math
from threading import Thread
import numpy as np
from PIL import Image
from io import BytesIO
import base64
import datetime... |
server.py | import socket
from threading import Thread
DISCONNECT_MESSAGE = "DISCONNECT !"
PORT = 8080
SERVER = "localhost"
ADDRESS = (SERVER, PORT)
FORMAT = 'utf-8'
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(ADDRESS)
def client(conn, addr):
print("[NEW CONNECTION] {} {} Connected"... |
test_networking.py |
import contextlib
import enum
import json
import logging
import subprocess
import threading
import time
import uuid
from collections import deque
import pytest
import requests
import retrying
import test_helpers
from dcos_test_utils import marathon
from dcos_test_utils.helpers import assert_response_ok
__maintaine... |
recorder.py | """Recorder."""
import datetime
import logging
import os
from threading import Thread
import cv2
import viseron.mqtt
from viseron import helpers
from viseron.cleanup import SegmentCleanup
from viseron.mqtt.camera import MQTTCamera
from viseron.segments import Segments
LOGGER = logging.getLogger(__name__)
class FFM... |
sensor.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function # Requires: Python >= 2.6
import sys
sys.dont_write_bytecode = True
import core.versioncheck
import inspect
import math
import mmap
import optpars... |
tester.py | # Native Libs
import argparse as argp
import multiprocessing as mp
import os
import time
import uuid
# Custom Funcs
import Find_Nth_Prime
import Find_Nth_Prime1
import Find_Nth_Prime2
import Find_Nth_Prime_LRU
import Find_Nth_Prime1_LRU
import Find_Nth_Prime2_LRU
def time_function(func, argoos, name, sema, rlock):
... |
GUI.py | import json, os
import sys
from threading import Thread
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup
from kivy.uix.scrollview import ScrollView
from kivymd.app import MDApp
from kivymd.uix.button import MDFlatButton, MDFloatingActionButton, MDFillRoundFlatButton
from kivy.uix.floatl... |
upgrade_test.py | #!/usr/bin/env python3
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import glob
import os
from pathlib import Path
import platform
import random
import shutil
import stat
import subprocess
import sys
from threading import Thread, Event
import traceback
import time
from urllib import request
import ... |
easyprocess.py | """Easy to use python subprocess interface."""
from seleniumbase.virtual_display.unicodeutil import (split_command,
unidecode,
uniencode)
import logging
import os.path
import platform
import signal
import subpro... |
irc.py | #-*- coding:utf-8 -*-
import re, time
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.python import log
from twisted.words.protocols.irc import IRCClient
from werkzeug import url_quote_plus
import os.path
from vlasisku import database
from vlasisku.utils import jbofihe, jvocuhadju, compo... |
connection_ubuntu.py | import sys
import pexpect
import re
import time
class UbuntuSession():
def __init__(self, ubuntu_ip="8.8.8.8", ubuntu_port=22, username='xiaojian', password='letmein', logfile="linux_session.log", prompt=None):
self.ip = ubuntu_ip
self.interact_mode = False
if logfile is not None:
... |
jobs.py | import logging
import multiprocessing as mp
import os
import sys
from functools import partial
import dill
from autogluon.core.scheduler.managers import TaskManagers
from autogluon.core.scheduler.reporter import Communicator, LocalStatusReporter
from autogluon.core.utils import CustomProcess, AutoGluonEarlyStop
from ... |
main.py | __version__ = 'v4 Visual Vector'
# from DATA.extensions import extmgr <- experimental, making extensions that modify this code
# <ordinary> imports
import re
import os
import sys
import zlib
import data
import time
import yaml
import shutil
import urllib
import widgets
import zipfile
import getpass
import zipfile
impo... |
translator.py | import argparse
import concurrent.futures as cf
import ipaddress
import random
import socket
import threading
import requests
import constants
import utils
class Translator:
"""
Translates unicast UDP to multicast UDP.
"""
def __init__(self, ucast_srv_ip, ucast_srv_port, mcast_addr_space, mcast_por... |
__init__.py | #! /usr/bin/env python
# ####! -*- coding: utf-8 -*-
import gtk
import os
import xlwt
import threading
from datetime import datetime, date
from serial import Serial
import subprocess
import time
class ThreadGtk(threading.Thread):
"""Hilo para actualizar etiqueta"""
def __init__(self, label):
super(Th... |
ingest_aws_json.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 use ... |
app.py | #!/usr/bin/env python3
#
# WebStreaming + Motion detector algorithm will detect motion by form of background subtraction
#
# Prerequisites:
# ---------------
# - pip install flask
# - pip install numpy
# - pip install opencv-contrib-python
# - pip install imutils
#
# Usage Examples:
# ---------------
# Live streaming f... |
stargate.py | # -*- coding: utf-8 -*-
import time
from threading import Thread
from typing import Generic, TypeVar, Optional, List
from startrek.fsm import Runnable
from udp.ba import Data
from udp.mtp import DataType, Package
from udp import Connection, ConnectionState, ActiveConnection
from udp import Hub
from udp import GateDel... |
test_rest_v1_0_0.py | import json
import os
import shlex
import signal
import string
import subprocess
import sys
import time
import unittest
from collections.abc import Iterable
from multiprocessing import Process
import requests
from dateutil.parser import parse
PODMAN_URL = "http://localhost:8080"
def _url(path):
return PODMAN_UR... |
joy_node.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array, time
from fcntl import ioctl
# from ackermann_msgs.msg import AckermannDriveStamped
from sensor_m... |
queuet.py | import unittest
from moderate import queue
import time
import threading
from thread import get_ident
class ZmqQueueTest(object):
def setUp(self):
self.q = queue.queue('zmq')
self.pull_q = queue.queue('zmq', push=False)
def tearDown(self):
self.q.close()
def t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.