source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
build.py | ## @file
# build a platform or a module
#
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
# Copyright (c) 2020, ARM Limited. All rights reserved.<... |
ssh3-tunnel.py | #!/usr/bin/env python
# Copyright (C) 2008 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of ... |
serachFile.py | import pickle
import re
import os, time
import optparse
from threading import Thread
class FileSearcher:
def __init__(self, filelist, searchstr):
self.filelist = filelist
self.searchstr = searchstr
self.curfile = 0
self.curline = 0
self.file = open(self.filelist[self.curfil... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import math
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
try:
import _testbuffer
except Impo... |
process.py | import os
import re
import sys
import json
import time
import math
import errno
import random
import select
import signal
import socket
import logging
from six import reraise
from six.moves import _thread as thread
from six.moves.http_client import OK, TEMPORARY_REDIRECT, SERVICE_UNAVAILABLE
from six.moves.urllib.parse... |
broadcast_scheduler.py | # Copyright 2018 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
dd750d782d59ed0421c0fc96ddaf17fcd79631be__main__.py | #!python
"""
VMController Host - a general purpose host-side virtual machine controller via exposed hypervisors apis.
"""
try:
import os
import sys
import logging
import warnings
import multiprocessing
import time
import inject
from twisted.internet import reactor
from pkg_resource... |
common.py | """Test the helper method for writing tests."""
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import pathlib
import threading
import time
from ... |
mic.py | # -*- coding: utf-8-*-
"""
The Mic class handles all interactions with the microphone and speaker.
"""
import logging
import tempfile
import wave
import audioop
import pyaudio
import alteration
import jasperpath
import os
import subprocess
import threading
import time
import yaml
import phone
# import local_phone ... |
cam.py | # built upon: https://github.com/jrosebr1/imutils/blob/master/imutils/video/pivideostream.py
from threading import Thread
import cv2
import json
import time
# function to parse bool value from config file
from utils.boolcheck import boolcheck
class VideoStream:
def __init__(self, src=0, name="VideoStream"):
... |
Server.py | import socket
import threading
import argparse
import time
buffer_size = 1024
class Server:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clients = []
nicknames = []
def __init__(self, address, port, connections):
self.sock.bind((address, port))
self.sock.listen(con... |
loader.py | import datetime
import functools
import importlib
import io
import json
import os
import shutil
import sys
import tempfile
import types
from threading import Thread
import requests
import yaml
from bs4 import BeautifulSoup
from httprunner import HttpRunner, logger
from requests.cookies import RequestsCookieJar
from re... |
gbfraidcopier.pyw | version = "2.43" # raidfinder version
#######################################################################
# import
import json
import queue
import configparser
import threading
import datetime
import time
from time import strftime
import html
import re
import base64
import platform
import subprocess
import os
impo... |
Hiwin_RT605_ArmCommand_Socket_20190627170557.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
from std_msgs.msg import Int32MultiArray
import math
import enum
pos_feedback_times = 0
mode_feedback_times = 0
msg_feedback = 1
#接收策略端... |
platforms.py | import threading
import time
from automation.geo.import_adf import import_geo_platform
from automation.geo.import_series import import_geo_series
from dal.oracle.ae2.plat_design import is_array_design_exists
from dal.oracle.ae2.study import is_study_exists
from resources.eutils import esearch, esummary
from utils.ema... |
stream.py | import time
from multiprocessing import Process
from flask import Blueprint, current_app
from fastlane.models.job import Job, JobExecution
bp = Blueprint("stream", __name__)
def stream_log(executor, task_id, job, ex, ws):
if not ws.closed and ex.status == JobExecution.Status.done:
ws.send("EXIT CODE: %... |
_reloader.py | import fnmatch
import os
import subprocess
import sys
import threading
import time
import typing as t
from itertools import chain
from pathlib import PurePath
from ._internal import _log
# The various system prefixes where imports are found. Base values are
# different when running in a virtualenv. The stat reloader ... |
generals.py | """
@ Harris Christiansen (code@HarrisChristiansen.com)
Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot
Generals.io Web Socket Communication
"""
import logging
import json
import threading
import time
from websocket import create_connection, WebSocketConnectionClosedException
from... |
parse.py | import multiprocessing,time,socket,httpx as x,json
from dataclasses import dataclass
class using:
def create_process(target,args):
p = multiprocessing.Process(target=target,args=args)
return p
def start_process(Process):
global _mp_tkt_process
Process.start()
_mp... |
file_processor.py | import os
import time
import requests
import pandas as pd
from . import breezy
from . import google_drive
from . import mail
from threading import Thread
from bs4 import BeautifulSoup
county_zip_dict = dict()
def get_county_zip_online(location_name):
if len(str(location_name)) > 0:
print("Checking Loca... |
executor.py | import json
import subprocess
import sys
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
from cricket.events import EventSource
from cricket.model import TestMethod
from cricket.pipes import PipedTestResult, PipedTestRunner
de... |
test_basic_4.py | # coding: utf-8
import logging
import sys
import time
import subprocess
import numpy as np
import pytest
import ray.cluster_utils
from ray._private.gcs_pubsub import gcs_pubsub_enabled, \
GcsFunctionKeySubscriber
from ray._private.test_utils import wait_for_condition
from ray.autoscaler._private.constants import ... |
classifier.py | #import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
#import time
#from datetime import timedelta
import os
import pandas as pd
import cv2
import urllib
#import multiprocessing
#import gc
# Functions and classes for loading and using the Inception model.
from rnk.inception import inception
def... |
queueProjectsToBuildByType.py | #!/usr/bin/python
##
## Copyright (c) 2014-2017 Leidos.
##
## License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
##
##
## Developed under contract #FA8750-14-C-0241
##
from __future__ import print_function
import datetime
import getopt
import json
import multiprocessing
import os
import re
import... |
equationConnector.py | """
Created on Sep 19 15:32 2019
@author: nishit
"""
import json
import threading
from senml import senml
from IO.summationPub import SummationPub
from utils_intern.messageLogger import MessageLogger
logger = MessageLogger.get_logger_parent()
class EquationConnector(SummationPub):
def __init__(self, meta_eq, c... |
auth.py | try:
import bcrypt
import gevent
import yaml
from eve.auth import BasicAuth
from notification import MAIL_LOG_FROM_DEFAULT, Notification, TEMPLATES_DIR
import requests
from jinja2 import Environment, FileSystemLoader
except ImportError as e:
print('Needed pip modules not found. Please ma... |
cache.py | '''Caching utilities'''
import io
import os
import re
import sys
import json
import time
import atexit
import inspect
import requests
import tempfile
import mimetypes
import subprocess # nosec
import pandas as pd
import tornado.template
from lxml import etree
from threading import Thread
from queue import Queue
f... |
autoreload.py | import functools
import itertools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from zipimport import zipimporter
from django.apps import apps
fro... |
imu.py | import serial
import serial.tools.list_ports as list_ports
import json
from threading import Thread
from threading import Event
import logging
logger = logging.getLogger(__name__)
class IMU():
def __init__(self):
self.last_data = dict()
self.ser_port = serial.Serial(baudrate=115200)
self... |
conftest.py | import subprocess
import threading
import pytest
from pynput.mouse import Controller
from systa.events.constants import win_events
from systa.events.store import callback_store
from systa.events.types import CallbackReturn, EventData
from systa.utils import wait_for_it
from systa.windows import Window, current_window... |
PythonApplication3.py | import sys
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import (QWidget, QToolTip, QPushButton, QApplication, QVBoxLayout, QTabWidget, QLineEdit, QColorDialog,
QSlider, QInputDialog, QFileDialog)
from PyQt5.QtGui import QFont, QColor
from PyQt5.QtCore import ... |
testcases.py | """
Subclasses of unittest.TestCase.
"""
from __future__ import absolute_import
import os
import os.path
import shutil
import threading
import unittest
from .. import config
from .. import core
from .. import logging
from .. import utils
def make_test_case(test_kind, *args, **kwargs):
"""
Factory function ... |
temp.py | import os
import time
import paramiko
import threading
import _thread
from multiprocessing import Process, Manager
from subprocess import Popen, PIPE
import time
def get_config():
config = dict()
config["turtlebot_config"] = dict()
config["turtlebot_config"]["using_list"] = ['1', '2']
config["turtlebot... |
app.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
test_urllib.py | """Regression tests for urllib"""
import collections
import urllib
import httplib
import io
import unittest
import os
import sys
import mimetools
import tempfile
from test import test_support
from base64 import b64encode
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[... |
main.py | import os
import threading
import PIL
import PIL.Image
import base64
try:
import tkinter as tk
import tkinter.filedialog
import tkinter.messagebox
except:
import Tkinter as tk
import tkinter.ttk as ttk
icon = """AAABAAEAAAAAAAEAIAB8BwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgEAAAA9ntg7QAA... |
jenkinstray.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Andreas Pakulat <apaku@gmx.de>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright n... |
progress.py | from threading import Thread
from .dashboard import Dashboard
class Progress():
def __init__(self, metrics={}, displays={}):
super().__init__()
self.metrics = metrics
self.displays = displays
self.dashboard = Dashboard(self)
self.thread = Thread(target=self.dashboard.star... |
network.py | #from selenium import webdriver
import webbrowser
from threading import Thread
import SimpleHTTPServer
import SocketServer
import json
import time
from pyzotero import zotero
import sys
import os
datapath=os.path.dirname(os.path.realpath(__file__))+"/../data/"
graphnumber=0
while 1==1:
if os.path.isdir('./zgraph'+st... |
WebsocketClient.py | # encoding: UTF-8
########################################################################
import json
import ssl
import sys
import time
import traceback
from datetime import datetime
from threading import Lock, Thread
import websocket
class WebsocketClient(object):
"""
Websocket API
实例化之后,应调用star... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I am alive, No need to worry about me."
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
test_client.py | # Remofile - Quick and easy-to-use alternative to FTP
#
# This file is distributed under the MIT License. See the LICENSE file
# in the root of this project for more information.
#
# Written by Jonathan De Wachter <dewachter.jonathan@gmail.com>, March 2018
import os
import shutil
from multiprocessing import Process
fr... |
keys.py | # Code by Daniel Kukiela (https://twitter.com/daniel_kukiela)
import ctypes
from threading import Thread
from time import time, sleep
from queue import Queue
# main keys class
class Keys(object):
common = None
standalone = False
# instance of worker class
keys_worker = None
keys_p... |
log_printer.py | from __future__ import absolute_import
from __future__ import unicode_literals
import sys
from collections import namedtuple
from itertools import cycle
from threading import Thread
from docker.errors import APIError
from six.moves import _thread as thread
from six.moves.queue import Empty
from six.moves.queue import... |
manual.py | """
Manual driving control model.
"""
from multiprocessing import Process
from inputs import InputEvent
from .model import ControlModel
from .common import normalise
from ..constants.control import GAME_PAD, DEAD_ZONE, CONTROL_NORM_IDLE, CONTROL_NORM_MIN, CONTROL_NORM_MAX
from ..constants.control import HARDWARE_AXIS_M... |
MainFrame.py | # -*- coding: utf-8 -*-
#
import os
import sys
import wx
import threading
from form.panel.FilePanel import FilePanel
from utils import MFormUtils, MFileUtils # noqa
from utils.MLogger import MLogger # noqa
from form.worker.ExportWorkerThread import ExportWorkerThread
from form.worker.LoadWorkerThread import LoadWorker... |
test_xmlrpc.py | import base64
import datetime
import decimal
import sys
import time
import unittest
from unittest import mock
import xmlrpc.client as xmlrpclib
import xmlrpc.server
import http.client
import http, http.server
import socket
import threading
import re
import io
import contextlib
from test import support
... |
installwizard.py |
from functools import partial
import threading
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.utils import platform
from kivy... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
multiprocess.py | """
This package contains classes and function for processing ExportInstances using
multiple processes.
To rebuild an export run the following:
rebuild_export_mutiprocess(export_instance_id, num_processes, page_size)
You can also use the MultiprocessExporter class to have more control over the process.
See the '... |
tasks.py | import json
import socket
import subprocess
import threading
from asgiref.sync import async_to_sync
from celery import shared_task
from channels.layers import get_channel_layer
from django.utils import timezone
from wol.models import Device, Websocket
from wol.wake import wake
channel_layer = get_channel_layer()
c... |
tester.py | import os
import os.path as osp
import cv2
import numpy as np
import time
from tqdm import tqdm
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from engine.logger import get_logger
from utils.pyt_utils import load_model, link_file, ensure_dir
from utils.img_utils import pad_image_to_sh... |
conftest.py | import functools
import http.server
import logging
import sys
import threading
import pytest
import testfixtures
@pytest.fixture(autouse=True)
def cap_log():
with testfixtures.LogCapture(
"mkdocs.plugins.mkdocs_section_index",
attributes=("levelname", "getMessage"),
ensure_checks_above=lo... |
load_test.py | #!/usr/bin/python
# coding:utf-8
import time
import urllib2
import threading
from Queue import Queue
from time import sleep
import sys
# 性能测试页面
#PERF_TEST_URL = "http://10.2.66.38/?yyid=-1&suv=1309231700203264&callback=xxxxx"
URLS = [line for line in open("../test/testdata/load_test.urls", "r")]
# 配置:压力测试
THREAD_NUM ... |
recipe-573444.py | #! /usr/bin/env python
"""
*******************************************************************************
*
* $Id: SecureDocXMLRPCServer.py 4 2008-06-04 18:44:13Z yingera $
* $URL: https://xxxxxx/repos/utils/trunk/tools/SVNRPCServer.py $
*
* $Date: 2008-06-04 13:44:13 -0500 (Wed, 04 Jun 2008) $
* $Author: yin... |
queryMongoDB.py | from api.GIS.database.mongoDB import MGO
from api.GIS.database.postGIS import PGO
from api.GIS.config import GIS_mgdb_config
from threading import Thread
import json
class QueryMGO():
def __init__(self):
pass
def getConfigs(self,Type):
DBConfig = []
dataBaseConfig = GIS_mgdb_config.dat... |
SavedPositionsPanel_2_scrollable.py | #!/usr/bin/env python
"""Control panel to save and recall motor positions.
Author: Friedrich Schotte
Date created: 2010-12-13
Date last modified: 2018-02-01
"""
__version__ = "3.6.1" # Scrolled panel
from logging import debug,info,warn,error
import traceback
import wx
from numpy import ndarray,isnan
# Turn off IEEE-75... |
main.py | import os
import sys
import time
import pdb
import argparse
import logging
import traceback
from multiprocessing import Process
from queue import Queue
from logging import handlers
from yaml import full_load, dump
from local_runner import LocalRunner
from docker_runner import DockerRunner
from k8s_runner import K8sRunn... |
pyMPExample.py | from time import sleep
import multiprocessing as mp
count = mp.Value('i', 0)
def counter(count):
print("Starting counter func")
while True:
count.value += 1
sleep(2)
print("Waking up for the {} time".format(count.value))
def printCounter(count):
print("Printing function")
whil... |
simpleMalwareWithBrowser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Tests the execution of the malware component by downloading it via Firefox
import sys
import time
import logging
import subprocess
import threading
import paramiko
try:
from fortrace.core.vmm import Vmm
from fortrace.utility.logger_helper import create_logger
... |
minutes.py | """ This module allows you to retrieve artcles from the 20minutes website """
#!/usr/bin/env python3
import sys
import os
import getopt
import urllib.request
from html.parser import HTMLParser
from threading import Thread
from threading import Lock
import html2text
RAWURL = "http://www.20minutes.fr"
RAWURLARCHIVE = ... |
pislide.py | # Pi-Slide timelapse controller for Raspberry Pi
# This must run as root (sudo python pislide.py) due to framebuffer, etc.
#
# http://www.adafruit.com/products/998 (Raspberry Pi Model B)
# http://www.adafruit.com/products/1601 (PiTFT Mini Kit)
#
# Prerequisite tutorials: aside from the basic Raspbian setup and PiTFT s... |
retropie_SafeShutdown_gpi2.py | import RPi.GPIO as GPIO
import os
import time
from multiprocessing import Process
#initialize pins
powerPin = 26 #pin 5
#ledPin = 14 #TXD
#resetPin = 2 #pin 13
powerenPin = 27 #pin 5
#initialize GPIO settings
def init():
GPIO.setmode(GPIO.BCM)
GPIO.setup(powerPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(res... |
runtests.py | #!/usr/bin/python2.7
#
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# ... |
test_agent.py | import logging
import socket
import time
from unittest.mock import MagicMock
import pytest
from prefect.agent import Agent
from prefect.engine.state import Scheduled
from prefect.utilities.configuration import set_temporary_config
from prefect.utilities.exceptions import AuthorizationError
from prefect.utilities.grap... |
__init__.py | """
Copyright (c) 2015 SONATA-NFV and Paderborn University
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 ap... |
_debugpy.py | """Tools to enable debugpy attachment to a process."""
import sys
import threading
import time
import debugpy
from google.colab import _debugpy_repr
from google.colab import _variable_inspector
import IPython
import portpicker
_dap_port = None
def enable_attach_async(enable_inspector=False):
"""Enable a debugger... |
inference_sequence.py | import os
import sys
import cv2
import torch
import argparse
import numpy as np
from tqdm import tqdm
from torch.nn import functional as F
import warnings
import _thread
import threading
from queue import Queue, Empty
warnings.filterwarnings("ignore")
from pprint import pprint, pformat
import time
import psutil
impor... |
host_test_default.py | """
mbed SDK
Copyright (c) 2011-2016 ARM Limited
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... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob, make_dir
# See https://en.wikipedia.org/w... |
master-secondary-if-watcher.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import socket
import struct
import ipaddr
import argparse
import re
import threading
import gobject
import dbus
import dbus.service
import dbus.mainloop.glib
import logging
import logging.handlers
import subpr... |
log.py | import errno
import logging
import os
import subprocess
import sys
import threading
from copy import deepcopy
from io import TextIOWrapper
from time import sleep
from typing import AnyStr, BinaryIO, List, Union
import pexpect.fdpexpect
from pexpect import EOF, TIMEOUT
from pexpect.utils import poll_ignore_interrupts, ... |
app.py | # coding:utf-8
import os
import sys
from threading import Thread
from time import sleep
from typing import Text, AnyStr
from werkzeug.datastructures import ImmutableDict
from ctpbee import __version__
from ctpbee.config import Config
from ctpbee.constant import OrderRequest, CancelRequest
from ctpbee.context import _... |
common_cache_test.py | # Copyright 2018-2022 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
multiproc_vec.py | from .utils.shared_array import SharedArray
from .utils.space_wrapper import SpaceWrapper
import multiprocessing as mp
import numpy as np
import traceback
import gym.vector
def compress_info(infos):
non_empty_infs = [(i, info) for i, info in enumerate(infos) if info]
return non_empty_infs
def decompress_inf... |
utils.py | # Copyright 2012-2014 MongoDB, 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... |
visualizer.py | import numpy as np
import threading
import open3d as o3d
from open3d.visualization import gui
from open3d.visualization import rendering
from collections import deque
from .colormap import *
from .labellut import *
import time
class Model:
"""Attributes, data, and methods of visulization models."""
def __in... |
xyolo.py | #!/usr/bin/env python
#
# // SPDX-License-Identifier: BSD-3-CLAUSE
#
# (C) Copyright 2018, Xilinx, Inc.
#
import os,sys,timeit,json
from multiprocessing import Process, Queue
# To control print verbosity
import logging as log
# Bring in some utility functions from local file
from yolo_utils import darknet_style_xywh... |
client.py | """
SDClient
A base class for interacting with the sdsim simulator as server.
The server will create on vehicle per client connection. The client
will then interact by createing json message to send to the server.
The server will reply with telemetry and other status messages in an
asynchronous manner.
Author: Tawn Kra... |
threaded_benchmark.py | import time
import threading
from threading import Thread, Timer
from divvy import DivvyClient, Response
from divvy.benchmark import Benchmark
class ThreadedBenchmark(Benchmark):
def __init__(self, args):
super(ThreadedBenchmark, self).__init__(args)
self.reconnect_rate = args.reconnect_rate
... |
app.py | from __future__ import unicode_literals
import queue
import threading
import logging
from flask import Flask, request
import youtube_dl
import os
from config import Config
from response import SuccessResponse
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(... |
_a4c_create.py |
from cloudify import ctx
from cloudify import utils
from cloudify.exceptions import NonRecoverableError
from StringIO import StringIO
import base64
import os
import platform
import re
import subprocess
import sys
import time
import threading
import platform
import json
def convert_env_value_to_string(envDict):
... |
sql_workflow.py | # -*- coding: UTF-8 -*-
import datetime
import logging
import re
import traceback
from threading import Thread
import simplejson as json
import sqlparse
from django.contrib.auth.decorators import permission_required
from django.core.exceptions import PermissionDenied
from django.db import transaction, connection
from ... |
inference_webcam.py | """
Inference on webcams: Use a model on webcam input.
Once launched, the script is in background collection mode.
Press B to toggle between background capture mode and matting mode. The frame shown when B is pressed is used as background for matting.
Press Q to exit.
Example:
python inference_webcam.py \
... |
app_Main.py | # ###########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Lice... |
distributed.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Distributed helpers."""
import multiprocessing
import os
import random
import signal
import threading
import trace... |
find_spots_server.py | import http.server as server_base
import json
import logging
import multiprocessing
import sys
import time
import urllib.parse
import libtbx.phil
from cctbx import uctbx
from dxtbx.model.experiment_list import ExperimentListFactory
from libtbx.introspection import number_of_processors
from dials.algorithms.indexing i... |
scheduled_executor.py | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... |
Transport.py | import os
import RNS
import time
import math
import struct
import threading
import traceback
from time import sleep
from .vendor import umsgpack as umsgpack
class Transport:
# Constants
BROADCAST = 0x00;
TRANSPORT = 0x01;
RELAY = 0x02;
TUNNEL = 0x03;
types = [BROADCAST... |
apt.py | # pylint: disable=C0111,R0903
"""Displays APT package update information (<toupgrade>/<security>)
Requires the following debian packages:
* update-notifier-common
"""
import threading
import bumblebee.util
import bumblebee.input
import bumblebee.output
import bumblebee.engine
APT_CHECK_PATH = "/usr/lib/update-... |
base_camera.py | import time
import threading
import cv2
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a new... |
tf_util.py | import joblib
import numpy as np
import tensorflow as tf # pylint: ignore-module
import copy
import os
import functools
import collections
import multiprocessing
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
Note that bot... |
PARRoT.py | from Positioning.GNSSReceiver import GNSSReceiver
from Routing.UDPManager import UDPManager
from Routing.RoutingTable import RoutingTable
from Messages.MultiHopChirp import MultiHopChirp
from Prediction.Predictors import SlopePredictor, NaivePredictor, BATMobilePredictor, InterpolatedBatman
from Positioning.WaypointPro... |
generate_train_6.py | import json
import os
from multiprocessing import Process
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
def cut_videos(cmds, i):
for i in range(len(cmds)):
cmd = cmds[i]
print(i, cmd)
os.system(cmd)
... |
__init__.py | import re
import argparse
__all__ = ["GlasgowAppletError", "GlasgowApplet", "GlasgowAppletTool"]
class GlasgowAppletError(Exception):
"""An exception raised when an applet encounters an error."""
class GlasgowApplet:
all_applets = {}
def __init_subclass__(cls, name, **kwargs):
super().__init_... |
generator.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module is for generating the batch data for training and testing.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from multiprocessing import Process, Queue, Value
def get_label_... |
event_writer.py | from future import standard_library
standard_library.install_aliases()
from six import string_types
from builtins import object
import queue
import multiprocessing
import threading
import sys
from collections import Iterable
from .common import log
class EventWriter(object):
def __init__(self, process_safe=False... |
util.py | import os
import re
import sys
import json
import threading
from requests import codes
from tabulate import tabulate
from urllib.parse import urlparse, parse_qs
from moodle_automate.operations import play_video, download_resource
from moodle_automate.context import RequestURL, PostToURL, UserChoiceError
from moodle_au... |
tensorflow_serving_client_workload.py | """Tensorflow Serving client workload.
Performs image classification requests against a Tensorflow Model Server.
Inspired by
https://github.com/tensorflow/serving/blob/master/tensorflow_serving/example/inception_client.py
This client-side load generator does the following:
* launches a specified number of worker th... |
client_picamera.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ____________developed by paco andres____________________
# _________collaboration with cristian vazquez____________
import threading
from ._client_robot import ClientRobot
import time
import cv2
import numpy as np
import io
import socket
import struct
import sys
class... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.