source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_web.py | # test_web.py -- Compatibility tests for the git web server.
# Copyright (C) 2010 Google, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License or (at your option) an... |
manual_performance.py | #!/usr/bin/env python
import angr
import argparse
import sys
import time
import os
import math
import random
import resource
import multiprocessing
from tabulate import tabulate
from os.path import join, dirname, realpath
from progressbar import ProgressBar, Percentage, Bar
test_location = str(join(dirname(realpat... |
t265_to_mavlink.py | #!/usr/bin/env python3
#####################################################
## librealsense T265 to MAVLink ##
#####################################################
# This script assumes pyrealsense2.[].so file is found under the same directory as this script
# Install required packages:
# pip3 ... |
wsdump.py | #!/Users/erres/Desktop/venv/bin/python3
import argparse
import code
import six
import sys
import threading
import time
import websocket
from six.moves.urllib.parse import urlparse
try:
import readline
except:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encoding", "")
if not encoding:
... |
main.py | #!/usr/bin/env python
# encoding: utf8
#
# Copyright © Burak Arslan <burak at arskom dot com dot tr>,
# Arskom Ltd. http://www.arskom.com.tr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... |
example_03_threading.py | #!/usr/bin/env python
# Tai Sakuma <tai.sakuma@gmail.com>
import time, random
import threading
from atpbar import atpbar, flush
##__________________________________________________________________||
def task(n, name):
for i in atpbar(range(n), name=name):
time.sleep(0.0001)
##____________________________... |
slurm-sidecar.py | #!/usr/bin/env python3
"""Run a Snakemake v7+ sidecar process for Slurm
This sidecar process will poll ``squeue --me --format='%i,%T'`` every 60
seconds by default (use environment variable ``SNAKEMAKE_SLURM_SQUEUE_WAIT``
for adjusting this).
Note that you have to adjust the value to fit to your ``MinJobAge`` Slurm
c... |
core.py | import logging
import re
import sys
import os
import time
from threading import Thread, Event
from datetime import datetime, timedelta
from collections import deque
try:
from Queue import Queue
except ImportError:
from queue import Queue
import boto3
from botocore.compat import total_seconds
from termcolor im... |
autocast_variable_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... |
master_server.py | #!/usr/bin/env python
#
# Copyright 2013 Tanel Alumae
"""
Reads speech data via websocket requests, sends it to Redis, waits for results from Redis and
forwards to client via websocket
"""
import sys
import logging
import json
import codecs
import os.path
import uuid
import time
import threading
import functools
from ... |
base_test.py | # -*- coding: utf-8 -*-
import contextlib
import copy
import datetime
import json
import threading
import elasticsearch
import mock
import pytest
from elasticsearch.exceptions import ElasticsearchException
from elastalert.enhancements import BaseEnhancement
from elastalert.enhancements import DropMatchException
from ... |
server.py | import socket
import json
from threading import Thread
from chat.models import *
from django.utils import timezone
import logging
import os
import queue
# 设置日志等级和格式
logger = logging.getLogger(__name__)
logging.basicConfig(format='[%(asctime)s] %(message)s', datefmt='%m/%d/%Y %H:%M:%S %p')
# 客户端连接池
client_pool = {}
vo... |
stats_scaled.py | import logging
import logging
import multiprocessing
import abc
import math
import re
import nibabel as nib
import numpy as np
import os
import pandas
from kerosene.metrics.gauges import AverageGauge
from samitorch.inputs.patch import Patch, CenterCoordinate
from samitorch.inputs.transformers import ToNumpyArray, Appl... |
testutils.py | #!/usr/bin/python
# Authors:
# 2020: Wolfgang Fahl https://github.com/WolfgangFahl
# 2021: Lin Gao https://github.com/gaol
#
# This test starter borrows lots from https://github.com/rc-dukes/vertx-eventbus-python, thanks to Wolfgang Fahl
#
from datetime import datetime
from hashlib import md5
import os
import time
fro... |
server.py | #-----------------------------------------------
#Libraries
#-----------------------------------------------
#Libraries used:
#sys - System
#BaseHTTPRequestHandler - A request handler for the HTTP protocol
#HTTPServer - Server implementation for the HTTP protocol
#threading - Concurrent thread implementation
#time - S... |
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... |
test_notification_manager.py | import sys
import threading
import time
import warnings
from typing import List
import pytest
from napari.utils.notifications import (
Notification,
notification_manager,
show_error,
show_info,
show_warning,
)
# capsys fixture comes from pytest
# https://docs.pytest.org/en/stable/logging.html#ca... |
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... |
application_runners.py | from __future__ import print_function
import sys
import os
import uuid
import shlex
import threading
import shutil
import subprocess
import logging
import inspect
import runpy
import future.utils as utils
import flask
import requests
from dash.testing.errors import (
NoAppFoundError,
TestingTimeoutError,
... |
forward_enumerator.py | from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import MolFromSmiles as Mol
from rdkit.Chem import MolToSmiles as Smiles
from rdkit.Chem.AllChem import ReactionFromSmarts as Rxn
#from rdkit.Chem.FragmentMatcher import FragmentMatcher
#from scripts.retrosynAnalysis.utils import reactant_frags_gener... |
test_threading.py | # expected: fail
# Very rudimentary test of threading module
import test.test_support
from test.test_support import verbose, cpython_only
from test.script_helper import assert_python_ok
import random
import re
import sys
thread = test.test_support.import_module('thread')
threading = test.test_support.import_module('t... |
mp_benchmarks.py | #
# Simple benchmarks for the multiprocessing package
#
import time, sys, multiprocessing, threading, Queue, gc
if sys.platform == 'win32':
_timer = time.clock
else:
_timer = time.time
delta = 1
#### TEST_QUEUESPEED
def queuespeed_func(q, c, iterations):
a = '0' * 256
c.acquire()
c.notify()
... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import os
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, List, Optional, Type, Union, cast
import warnings
import zipfile
imp... |
rpdb2.py | #! /usr/bin/env python
"""
rpdb2.py - version 2.4.8
A remote Python debugger for CPython
Copyright (C) 2005-2009 Nir Aides
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation;... |
serviceSkeleton.py | import socket
import threading
# Starts a server in a specified port and host.
# Loops forever, waiting for connections.
# When it receives a connection, it calls serverFunc in a separate thread.
# serverFunc has to receive as arguments the connection socket and address object.
def startService(port,serviceFunc,host="... |
service.py | # -*- coding: utf-8 -*-
from datetime import datetime
import io
import time
import threading
from wsgiref.validate import validator
from wsgiref.simple_server import make_server
EXCHANGE_FILE = "./exchange.dat"
def update_exchange_file():
"""
Writes the current date and time every 10 seconds into the exchang... |
main.py | # -*- coding: utf-8 -*-
# Created by HRex on 2020/12/22
import re
import sys
import threading
import time
from time import sleep
from PyQt5.QtCore import QTime
from PyQt5.QtWidgets import QApplication, QMainWindow
import serial
import SmartFan
# Global Variable
portx = 0 #端口号
bps = 0 #波特率
num_... |
__init__.py | __all__ = ['ToastNotifier']
# standard library
import logging
from os import path, remove
from time import sleep
from threading import Thread
from pkg_resources import Requirement
from pkg_resources import resource_filename
from time import sleep
# 3rd party modules
from win32api import GetModuleHandle
from win32api ... |
test_smbserver.py | #!/usr/bin/env python
# Impacket - Collection of Python classes for working with network protocols.
#
# SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# f... |
tempobj.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
foozzer.py | #!/usr/bin/env python3
"""
A cross platform fuzzing framework primarily targeting GUI applications.
usage: foozzer.py [-h] [--verbose] [-L] -i I -o O -D D -m MUTATOR -r RUNNER -- RUNNER_ARGS
runner_args
Options:
-h
--help show help message and exit
-v
--verbose increase output verbo... |
rst.py | """Read ANSYS binary result files *.rst
Used:
/usr/ansys_inc/v150/ansys/customize/include/fdresu.inc
"""
import time
import warnings
import logging
import ctypes
from threading import Thread
import vtk
import numpy as np
import pyvista as pv
from pyansys import _binary_reader, _parser, _reader
from pyansys.elements ... |
base_camera_rtmp.py | import time
import threading
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 frame is
... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from decimal import D... |
archive.py | """archive.py - Wrapper around 7z binary for extraction of individual files.
Note:
Every call to ``extract()`` must be followed by a call to ``join()``
"""
import os
import re
import subprocess
import tempfile
import threading
from .utils import which, is_exe
DEFAULT_BIN = "7z"
"""str: Default binary name for 7z... |
reader.py | import argparse
import json
import logging
import multiprocessing
import os
import re
LOGGER_FORMAT = '%(asctime)s %(message)s'
logging.basicConfig(format=LOGGER_FORMAT, datefmt='[%H:%M:%S]')
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
arg_parser = argparse.ArgumentParser(
description='Aggregate ... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
import sys
import string
import threading
import time
import re
import ... |
test_httpchunked.py | from http import HTTPStatus
from http.client import HTTPConnection
from http.server import BaseHTTPRequestHandler, HTTPServer
from io import BytesIO
from threading import Thread
from unittest import TestCase
from httpchunked import decode, encode
class TestHTTPChunked(TestCase):
_connection: HTTPConnection
_... |
lock_example.py | import threading
worker_lock = threading.Lock()
def do_some_work():
with worker_lock:
print('I have lock when I am writing it!')
workers = []
for _ in range(10):
thread = threading.Thread(target=do_some_work)
workers.append(thread)
thread.start()
for worker in workers:
worker.join()
p... |
web_server.py | import logging
from http.server import BaseHTTPRequestHandler
from pathlib import Path
import threading
def html_encode_file(name, directory: str = 'html', replace_dict: dict = None):
html = Path(Path(__file__).parent.parent.resolve(), directory, name).read_text()
if replace_dict:
html_str = str(html... |
sunny.py | #! /usr/bin/python
# -*- coding: UTF-8 -*-
import getopt
import socket
import ssl
import json
import struct
import random
import sys
import time
import logging
import threading
python_version = sys.version_info >= (3, 0)
if not python_version:
reload(sys)
sys.setdefaultencoding('utf8')
options = {
'clien... |
test_BaseClient_live.py |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
test2.py | #!/usr/bin/env python
from __future__ import division, print_function
import time
import random
from subprocess import call
from multiprocessing import Process
try:
from linuxLED import LEDTurtle
except ImportError:
from linuxLED import LED
def say(msg):
call(msg, shell=True)
class TTS(object):
"""
Apple - sa... |
parallel_percrank_train.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Parallel training for Perceptron ranker (using Qsub & RPyC).
When run as main, this file will start a worker and register with the address given
in command-line parameters.
Usage: ./parallel_percrank_train.py <head-address> <head-port>
@todo: Local training on multi... |
ChorusNGSfilter.py | import argparse
import sys
from Choruslib import jellyfish
import os
from multiprocessing import Pool, Process
from pyfasta import Fasta
import pyBigWig
import math
def main():
args = check_options(get_options())
# jfgeneratorscount(jfpath, mer, output, generators,threads=1, size='100M'):
# make genera... |
test_queue.py | # AMZ-Driverless
# Copyright (c) 2019 Authors:
# - Huub Hendrikx <hhendrik@ethz.ch>
#
# 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 ... |
test_cost_time.py | from funboost.concurrent_pool.custom_threadpool_executor import CustomThreadpoolExecutor
import time
import threading
from concurrent.futures import ThreadPoolExecutor
pool = CustomThreadpoolExecutor(10)
pool2 = ThreadPoolExecutor(10)
t1 = time.time()
lock = threading.Lock()
def f(x):
with lock:
print(... |
gopro.py | # gopro.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:47 PM
"""Implements top level interface to GoPro module."""
from __future__ import annotations
import time
import enum
import queue
import logging
import threa... |
game.py | from threading import Thread
import sys
from pymuse.signal import SignalData
from datetime import datetime
import numpy as np
from enum import Enum
from queue import Empty
from mindpong.model.player import Player, SIGNAL_NAMES, PlayerName
from mindpong.model.mathexercise import MathExercise
DEFAULT_PORT_PLAYER_ONE =... |
server.py | import rclpy
from rclpy.node import Node
import threading
from threading import Lock
import uuid
import camera.overlay_lib as overlay_lib
# import board
from std_msgs.msg import String
from std_msgs.msg import Int32MultiArray, Int16
from sensor_msgs.msg import Joy, Imu, FluidPressure, Temperature
import argparse
i... |
test_setup.py | """Test component/platform setup."""
# pylint: disable=protected-access
import asyncio
import datetime
import os
import threading
from unittest.mock import AsyncMock, Mock, patch
import pytest
import voluptuous as vol
from homeassistant import config_entries, setup
import homeassistant.config as config_util
from home... |
threading_names_log.py | #
"""Using thread names in logs
"""
# end_pymotw_header
import logging
import threading
import time
def worker():
logging.debug("Starting")
time.sleep(0.2)
logging.debug("Exiting")
def my_service():
logging.debug("Starting")
time.sleep(0.3)
logging.debug("Exiting")
logging.basicConfig(
... |
test_wraith.py | """Use wraith to compare current version against published docs.
"""
import unittest
import os
import copy
import re
import yaml
import subprocess
import contextlib
from distutils.version import LooseVersion
import http.server
import socketserver
import threading
REFERENCE_URL = "https://www.cgat.org/downloads/public... |
test_node.py | import os
import sys
import logging
import requests
import time
import traceback
import random
import pytest
import ray
import threading
from datetime import datetime, timedelta
from ray.cluster_utils import Cluster
from ray.dashboard.modules.node.node_consts import (LOG_PRUNE_THREASHOLD,
... |
parallel_unittest.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for parallel library."""
from __future__ import print_function
import contextlib
import multiprocessing
import ... |
__init__.py | """
This package holds communication aspects
"""
import binascii
import json
import logging
import socket
import traceback
from abc import abstractmethod
from binascii import unhexlify
from threading import Thread
from pylgbst.constants import MSG_DEVICE_SHUTDOWN, ENABLE_NOTIFICATIONS_HANDLE, ENABLE_NOTIFICATIONS_VALU... |
test_local_task_job.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
#... |
mcedit.py | # !/usr/bin/env python2.7
# -*- coding: utf_8 -*-
# import resource_packs # not the right place, moving it a bit further
#-# Modified by D.C.-G. for translation purpose
#.# Marks the layout modifications. -- D.C.-G.
"""
mcedit.py
Startup, main menu, keyboard configuration, automatic updating.
"""
import splash
import... |
__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its
own dedicated window. Works on Windows, OS X and Linux and compatible with Python 2 and 3.
(C) 2014-2019 Roman Sirokov and contributors
Licensed under B... |
ssh.py | #!/usr/bin/env python
"""
DMLC submission script by ssh
One need to make sure all slaves machines are ssh-able.
"""
from __future__ import absolute_import
from multiprocessing import Pool, Process
import os, subprocess, logging
from threading import Thread
from . import tracker
def sync_dir(local_dir, slave_node, sl... |
__init__.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
output.py | import cv2
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import Circle
import os
import time
from skimage.io import imread, imshow, concatenate_images
from skimage.transform import resize
from PIL import Image,ImageDraw
import time
#from skimage.io import imread_collection
import argparse
i... |
merlin_flow_start_new.py | # (C) Copyright 2016-2021 Xilinx, Inc.
# All Rights Reserved.
#
# 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 ... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2017, 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... |
dag_processing.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... |
mod_autoaim_extended308.py | # -*- coding: utf-8 -*-
import os
import re
import json
import codecs
import datetime
import threading
import urllib
import urllib2
import math
import BigWorld
import GUI
import Vehicle
import Math
from constants import AUTH_REALM
from Avatar import PlayerAvatar
from AvatarInputHandler import cameras
from BattleReplay... |
can_replay.py | #!/usr/bin/env python3
import os
import time
import threading
from tqdm import tqdm
os.environ['FILEREADER_CACHE'] = '1'
from common.basedir import BASEDIR
from common.realtime import config_realtime_process, Ratekeeper, DT_CTRL
from selfdrive.boardd.boardd import can_capnp_to_can_list
from tools.lib.logreader import... |
IntegrationTests.py | import multiprocessing
import sys
import time
import unittest
import percy
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
TIMEOUT = 20
class IntegrationTests(unittest.... |
k8s.py | from __future__ import print_function, division, unicode_literals
import base64
import functools
import json
import logging
import os
import re
import subprocess
import tempfile
from copy import deepcopy
from pathlib import Path
from threading import Thread
from time import sleep
from typing import Text, List
import ... |
server_setup.py | from socket import socket,AF_INET,SOCK_STREAM
from threading import Thread
from tkinter import END
class ServerSocket:
def __init__(self,receive_block_tk):
self.socket=None
self.connection_status=False
self.receive_block=receive_block_tk
self.thread=None
def init... |
main.py | from kivymd.app import MDApp
from kivymd.uix.screen import MDScreen
from kivy.clock import mainthread
from kivy.properties import NumericProperty
from android.permissions import Permission, request_permissions
import sync
import threading
import math
import time
# thread constants
DOWNLOAD_THREAD_COUNT = 6
THREAD_SPA... |
Receive_MainEnvironmentSimulator.py | #Receive_MainEnvironmentSimulator.py
#Environment simulator + REST-Server + AdvantEDGE
#Version:1
#Date:2020-03-03
#Author: Jaime Burbano
#Description: This set of files are used to run the first simulation of the system using AdvantEDGE
#runs with python 3
#python3 MainEnvironmentSimulator v002
import argparse
imp... |
algorunner.py | from __future__ import print_function, division, absolute_import
import time
from hkube_python_wrapper.util.DaemonThread import DaemonThread
from .statelessAlgoWrapper import statelessAlgoWrapper
from ..config import config
from .wc import WebsocketClient
from .data_adapter import DataAdapter
from .job import Job
fro... |
reporting_server.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import multiprocessi... |
tincam.py | from dropbox import Dropbox
from picamera import PiCamera as Camera
from gpiozero import Button
from datetime import datetime
import os
import time
import threading
button = Button(4)
camera = Camera()
upload_queue = []
queue_lock = threading.Lock()
DBX_API_KEY = 'YOUR_DROPBOX_API_KEY_HERE'
dbx = Dropbox(DBX_API_KEY... |
manager.py | #!/usr/bin/env python
import os
# check if NEOS update is required
while 1:
if ((not os.path.isfile("/VERSION")
or int(open("/VERSION").read()) < 3)
and not os.path.isfile("/data/media/0/noupdate")):
os.system("curl -o /tmp/updater https://openpilot.comma.ai/updater && chmod +x /tmp/updater && /tmp/u... |
Hiwin_RT605_ArmCommand_Socket_20190627191856.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
origami.py | from __future__ import division
import sublime, sublime_plugin
import time
import threading
import copy
from functools import partial
XMIN, YMIN, XMAX, YMAX = list(range(4))
try:
# Do not import State directly to not break us in case the MaxPane.max_pane module is reloaded
import MaxPane
except ImportError a... |
tester.py | import torch
from torch.autograd import Variable
import sys
import time
from datetime import datetime
import numpy as np
import scipy as sp
import scipy.linalg as linalg
import torch.multiprocessing
import matplotlib.pyplot as plt
def test_speed_inverse_gesv(ndim=10):
A = torch.randn(ndim, ndim)
A = A.mm(A.t())
ei... |
video_downloade.py | import sys
import youtube_dl
from threading import Thread
from PyQt5.QtWidgets import QApplication, QWidget\
,QPushButton, QLabel, QLineEdit, QComboBox
class MyLogger(object):
def __init__(self, msgLabel):
self._msgLabel = msgLabel
def debug(self, msg):
msg = msg.replace('\n', '')
self._msgLabel.setText(ms... |
acs_client.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
_asyncio.py | import array
import asyncio
import concurrent.futures
import math
import socket
import sys
from asyncio.base_events import _run_until_complete_cb # type: ignore
from collections import OrderedDict, deque
from concurrent.futures import Future
from dataclasses import dataclass
from functools import partial, wraps
from i... |
dmc.py | import os
import threading
import time
import timeit
import pprint
from collections import deque
import torch
from torch import multiprocessing as mp
from torch import nn
from .file_writer import FileWriter
from .models import Model
from .utils import get_batch, log, create_env, create_buffers, create_optimizers, act... |
Spreadsheet_Energy_System_Model_Generator.py | # -*- coding: utf-8 -*-
"""
Spreadsheet-Energy-System-Model-Generator.
creates an energy system from a given spreadsheet data file, solves it
for the purpose of least cost optimization, and returns the optimal
scenario results.
The scenario.xlsx-file must contain the following elements:
+-------------+--------------... |
sound_utils.py | #!/usr/bin/env python
import rospy
from Queue import Queue
from threading import Thread
from sound_play.msg import SoundRequest
from sound_play.libsoundplay import SoundClient
class SoundUtils():
INSTANCE = None
@classmethod
def get_instance(cls):
if cls.INSTANCE is None:
cls.INSTANCE... |
lambda_executors.py | import os
import re
import json
import time
import logging
import threading
import subprocess
# from datetime import datetime
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
# for Python 2.7
from pipes import quote as cmd_quote
from localstack import ... |
tests.py | # coding=utf-8
import random
import time
import threading
import unittest
from lru_cache import LruCache
class TesLruCache(unittest.TestCase):
def test_cache_normal(self):
a = []
@LruCache(maxsize=2, timeout=1)
def bar(num):
a.append(num)
return num
bar(1)... |
tomostream3d.py |
'''
Adaptation of Tomostream orthoslice code for doing full 3d reconstructions apply DL-based image processing or computer vision steps.
Authors:
Viktor Nikitin, ANL
Aniket Tekawade, ANL
'''
import pvaccess as pva
import numpy as np
import queue
import time
import h5py
import threading
import signal
from to... |
store.py | import datetime
import json
import threading
import uuid
from collections import defaultdict
from copy import deepcopy
from dictdiffer import diff
from inspect import signature
from threading import Lock
from pathlib import Path
from tzlocal import get_localzone
from .logger import logger
from .settings import CACHE_... |
ngrok.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/jofpin/trape
#
# Copyright 2018 by Jose Pino (@jofpin) / <jofpin@gmail.com>
#**
import sys
import os, platform
import subprocess
import socket
... |
sphero.py | #!/usr/bin/python3
import sys
import time
import binascii
import os
import threading
import bluepy
import yaml
from .util import *
#should it be in a different format?
RobotControlService = "22bb746f2ba075542d6f726568705327"
BLEService = "22bb746f2bb075542d6f726568705327"
AntiDosCharacteristic = "22bb746f2bbd75542d6... |
demo.py | #!/usr/bin/env python
# coding=utf-8
import tensorflow as tf
import bottle
from bottle import route, run
import threading
import json
import numpy as np
from time import sleep
from Bert_model import BERT_model
'''
This file is taken and modified from R-Net by Minsangkim142
https://github.com/minsangkim142/R-net
'''
... |
testboxtasks.py | # -*- coding: utf-8 -*-
# $Id: testboxtasks.py 70566 2018-01-12 18:25:48Z vboxsync $
"""
TestBox Script - Async Tasks.
"""
__copyright__ = \
"""
Copyright (C) 2012-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free softwar... |
webcam_video_stream.py | import cv2
import threading
class WebcamVideoStream:
# with modifications from https://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/
def __init__(self, src, width, height):
# initialize the video camera stream and read the first frame
# from the stream
self.... |
log_fatigue_plugin.py | import asyncio
import math
import threading
import time
from time import sleep
from typing import Optional
from PySide2.QtCore import QEvent, QObject
from PySide2.QtWidgets import QDialog, QLabel, QLineEdit, QPushButton, QVBoxLayout
try:
from slacrs import Slacrs
from slacrs.model import HumanFatigue
except ... |
machine.py | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 12:05:14 2015
@author: ktritz
"""
from __future__ import print_function
from builtins import str, map, range
from collections import Sized, Iterable, Container, deque
import os
from warnings import warn
import numpy as np
import MDSplus as mds
import threading
from .l... |
timer.py | """Timer"""
import time
import functools
from threading import Thread
class Chronometer:
"""Simple chronometer with context manager support
# Properties
partial: float, current couting in seconds
running: boolean, chronometer current state
# Example
```python
import time
ch... |
dmlc_mpi.py | #!/usr/bin/env python
"""
DMLC submission script, MPI version
"""
import argparse
import sys
import os
import subprocess
import tracker
from threading import Thread
parser = argparse.ArgumentParser(description='DMLC script to submit dmlc job using MPI')
parser.add_argument('-n', '--nworker', required=True, type=int,
... |
bridge.py |
import threading as mt
from ..logger import Logger
from ..profile import Profiler
from ..config import Config
from ..json_io import read_json, write_json
# ------------------------------------------------------------------------------
#
class Bridge(object):
'''
A bridge can be configured to have a fini... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.