source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
multithread_spider_dianying.py | import requests
from lxml import etree
import json
from queue import Queue
import threading
class DianyingtiantangSpider:
def __init__(self):
self.start_url = "https://www.dy2018.com/html/gndy/dyzz/index.html"
self.url_temp = "https://www.dy2018.com/html/gndy/dyzz/index_{}.html"
self.heade... |
driver.py | from motors import *
from lightsensor import *
from serverpi import *
import threading
def drive(motors, lightsensors):
direction = lightsensors.getAdjDirection()
threading.Thread(target=motors.move, args=(direction,))
t.start()
#any other work we need to do in the foreground
#end foreground work
t.join()
de... |
eva_locker.py | import threading
from .eva_errors import EvaLockError
# TODO improve timing accuracy by taking into account lock_renew() API call duration in the __renewal_timer() loop
# TODO properly handle exceptions thrown in the renewal thread
# TODO properly handle unlock on program exit
class EvaWithLocker:
"""
The E... |
test_mysqlx_crud.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also d... |
server.py | import client
import load_data
import logging
import numpy as np
import pickle
import random
import sys
from threading import Thread
import torch
import utils.dists as dists # pylint: disable=no-name-in-module
class Server(object):
"""Basic federated learning server."""
def __init__(self, config):
s... |
test_user_agent.py | """
Tests for the pandas custom headers in http(s) requests
"""
import gzip
import http.server
from io import BytesIO
import threading
import pytest
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
class BaseUserAgentResponder(http.server.BaseHTTPRequestHandler):
"""
... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from queue import Queue, Empty
from threading import Thread
from time import sleep
from collections import defaultdict
# 第三方模块
from qtpy.QtCore import QTimer
# 自己开发的模块
from .eventType import *
########################################################################
class EventEngine(object... |
_display.py | """
Copyright (c) 2019 The Cereja Project
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, distrib... |
test_stdout.py | from __future__ import print_function
import os
import random
import string
import sys
import time
import pytest
from dagster import (
DagsterEventType,
ExecutionTargetHandle,
InputDefinition,
ModeDefinition,
execute_pipeline,
pipeline,
resource,
solid,
)
from dagster.core.execution.c... |
feed.py | # PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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... |
core.py | import logging as log
from multiprocessing import Process
from change_detector.file_syncer import RsFileSyncer
class FileObserver:
""" The FileObserver detect changes based on the modified time of a file
and performs a given action. Example usage:
if __name__ == '__main__':
log.basicConfig(level=... |
manage.py | # coding=utf-8
# author: Zeng YueTian
# manage script of hera system
# how to use it: nohup python manage.py runserver --host 0.0.0.0 >/dev/null 2>&1 &
# please see run.sh
import os
import threading
from flask import Flask, render_template
from flask_script import Manager
from flask_script import Shell
from app import... |
build_imagenet_data.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
ttt_client_gui.py |
#! /usr/bin/python3
# Import the GUI library Tkinter
import tkinter
# Import the messagebox module explicitly
from tkinter import messagebox
# Import the webbroswer module for opening a link
import webbrowser
# Import the client module
from ttt_client import TTTClientGame
# Import multi-threading module
import thread... |
player.py | # -*- coding: utf-8 -*-
import subprocess
import threading
import os
import random
import logging
from os.path import expanduser
from sys import platform, version_info, platform
from sys import exit
from time import sleep
import collections
import json
import socket
try:
from urllib import unquote
except ImportErr... |
qgis.py | """QGIS specific tools."""
import collections, os, urllib, time, threading, re
import xml.etree.ElementTree as ElementTree
from xml.sax.saxutils import escape
import requests
from gbd.core import config, log, gis, util, shell, debug
from gbd.core.util import inline_format as _f
def _asdict(node):
return dict((... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
TOTAL_SCONS_... |
networks_tensorflow.py | import tensorflow as tf
import numpy as np
import argparse
import os
import sys
import json
import glob
import random
import collections
import math
import time
import threading
import scipy
from PIL import Image
import time
from .revnet import ReversibleNet
# from selu_utils import selu, dropout_selu
EPS = 1e-12
LR_R... |
threaded_crawler.py | import time
import threading
import urlparse
from downloader import Downloader
SLEEP_TIME = 1
def threaded_crawler(seed_url, delay=5, cache=None, scrape_callback=None, user_agent='wswp', proxies=None, num_retries=1, max_threads=10, timeout=60):
"""Crawl this website in multiple threads
"""
# the queue o... |
artifact_service.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 ... |
tpu_estimator.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
housekeeper.py | #SPDX-License-Identifier: MIT
"""
Keeps data up to date
"""
import coloredlogs
from copy import deepcopy
import logging, os, time, requests
import logging.config
from multiprocessing import Process, get_start_method
from sqlalchemy.ext.automap import automap_base
import sqlalchemy as s
import pandas as pd
from sqlalche... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
test_localshare.py | # -*- coding: utf-8 -*-
from click.testing import CliRunner
import threading
import localshare
def test_non_existent_file():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(localshare.share, ['nonexistent'])
assert result.exit_code == 2
assert 'Path "no... |
restore.py | import time
from collections import defaultdict
from threading import Thread
from fabric import state
from fabric.api import run, settings
from logger import logger
from perfrunner.helpers.cluster import ClusterManager
from perfrunner.helpers.remote import RemoteHelper
from perfrunner.helpers.rest import RestHelper
... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
if __name__ == "__main__":
if os.path.isfile("/init.qcom.rc") \
and (not os.path.isfile("... |
impala.py | # # https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial s... |
proc.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
engine.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import time
import random
import csv
import json
import string
import os
import copy
from types import SimpleNamespace
from database.db import create_connection, get_logs_by_scan_unique_id
from database.models import Report
from flask import Flask
f... |
final.py | import cv2
import numpy as np
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
import time
import imaplib
import email
import datetime
import pyttsx
import threading
import thread
EMAIL_ACCOU... |
tests.py | """
Unit tests for reverse URL lookups.
"""
import sys
import threading
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.http import (
HttpRequest, ... |
run.py | import threading
import httpServer
import server
tcpServerThread = threading.Thread(target = server.startup, args = (), daemon=True)
tcpServerThread.start()
httpServerThread= threading.Thread(target = httpServer.startup, args = (), daemon=True)
httpServerThread.start()
tcpServerThread.join()
httpServerThread.join()
|
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import sys
import time
import random
import unittest
from test import test_support as support
try:
import thread
import thre... |
EmailUtil.py | from project.administration.utils import UsersUtil
import threading
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
from django.conf import settings
def send_email_thread(email_obj):
email_obj.send()
def send_e... |
bilibili.py | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
"""Bilibili Toolkit 哔哩哔哩工具箱
https://github.com/Hsury/Bilibili-Toolkit"""
banner = r"""
\\ //
\\ //
##################### ________ ___ ___ ___ ________ ___ ___ ___
## ## |\ ... |
onto_align.py | # Copyright 2021 Yuan He (KRR-Oxford). All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable l... |
zeromq.py | # -*- coding: utf-8 -*-
'''
Zeromq transport classes
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys
import copy
import errno
import signal
import socket
import hashlib
import logging
import weakref
import threading
from random import randint
# Im... |
test_logging.py | #!/usr/bin/env python
#
# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... |
importexport.py | #!/usr/bin/env python
# encoding=utf-8
"""
Author:zcyuefan
Topic:django-import-export plugin for xadmin to help importing and exporting data using .csv/.xls/.../.json files
Use:
+++ settings.py +++
INSTALLED_APPS = (
...
'import_export',
)
+++ model.py +++
from django.db import models
class Foo(models.Model)... |
QueueManager.py | #!/usr/bin/env python
# encoding: utf-8
# AUTHOR: XIANWU LIN
# EMAIL: linxianwusx@gmail.com
# TIME: 2016/3/4 14:30
'''
这个模块提供了一个OriginQueue类,扩展原生队列Queue。
提供了一个QueueManager类,管理队列,并提供http接口。
'''
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import urlparse
import threading
from PythonQueue... |
daily_update_stock_download.py | #coding:utf-8
#2016-4-29 日线数据下载
#更改数据源 从tushare的源下载包含MA5等均线
import urllib2,socket,threading,time,random,re,MySQLdb
import tushare
import config.Globaldata as G
#每一步
def get_stock(stock_list,start,end,type):
while len(stock_list)>0:
stock_code=stock_list.pop()
df = tushare.get_hist_data(code=stock_code,start=star... |
daemon_manager.py | import threading
from queue import Queue, Empty
from threading import Thread
from PyQt5.QtCore import QCoreApplication
from flask import Flask, request
import json
from src.gui.input_manager import InputManager
from src.gui.ui_manager import UIManager
class Order:
def __init__(self, command, args=[]):
s... |
player.py | import vlc
import tkinter as tk
from os import listdir
from threading import Thread
from urllib.parse import unquote
class Player:
def __init__(self):
# Window set up
self.window = tk.Tk()
self.window.title("Spot-A-Fly")
self.window.wm_iconbitmap("icon.ico")
self.window.res... |
process_one.py | from __future__ import absolute_import, division, print_function
import logging; _L = logging.getLogger('openaddr.process_one')
from urllib.parse import urlparse
from os.path import join, basename, dirname, exists, splitext, relpath
from shutil import copy, move, rmtree
from argparse import ArgumentParser
from os impo... |
runner.py | import os
from shutil import copyfile
from multiprocessing import Process
import numpy as np
from environment import MyEnv
from genetics import Genetics
from pysc2.maps.lib import Map
from pysc2.maps.mini_games import mini_games
class Runner(object):
def __init__(self, args):
# TODO: По-хорошему, save... |
_v5_proc_cvreader.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# COPYRIGHT (C) 2014-2020 Mitsuo KONDOU.
# This software is released under the MIT License.
# https://github.com/konsan1101
# Thank you for keeping the rules.
import sys
import os
import time
import datetime
import codecs
import glob
import queue
impo... |
workers.py | #!/usr/bin/env python3
from multiprocessing import Manager, Pool, Queue, Process
import os
import time
import random
import signal
import itertools
def dispatcher(task, req):
print(f"dispatcher start")
for t in task:
try:
req.put(t)
print(f"dispatcher put new task: {t}")
... |
checkers.py | from __future__ import (print_function, unicode_literals, division,
absolute_import)
import io
import os
import sys
import time
import threading
from common import vprint, exe_check, ff, get_os, check_load, exe
from common import check, wf
from common import ASSETS, SUPPORTED_OS_TYPES
from com... |
test_gc.py | import unittest
from test.support import (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
temp_dir, requires_type_collecting)
from test.support.script_helper import assert_python_ok, make_script
import sys
import time
import gc... |
VGG16.py | import tensorflow as tf
#import tensorflow.contrib.eager as tfe
#from tensorflow.contrib.layers.python.layers import initializers
#from tensorflow.contrib.layers.python.layers import regularizers
import tensorflow.keras.initializers as initializers
import tensorflow.keras.regularizers as regularizers
from tensorflo... |
server.py | #!/usr/bin/env python
import sys
import numpy as np
import cv2
from pylepton.Lepton3 import Lepton3
import sys
import io
import os
import shutil
from subprocess import Popen, PIPE
from string import Template
from struct import Struct
from threading import Thread
from time import sleep, time
# from http.server import H... |
check_os.py | #!/usr/bin/python
#coding:utf-8
import os
import sys
import string
import time
import datetime
import MySQLdb
import winrm
import logging
import logging.config
logging.config.fileConfig("etc/logger.ini")
logger = logging.getLogger("check_os")
path='./include'
sys.path.insert(0,path)
import functions as func
import aler... |
plugin.py | #!/usr/bin/env python3
#
# Electron Cash - a lightweight Bitcoin Cash client
# CashFusion - an advanced coin anonymizer
#
# Copyright (C) 2020 Mark B. Lundeberg
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to d... |
utils.py | #================================================================
#
# File name : utils.py
# Author : PyLessons
# Created date: 2020-09-27
# Website : https://pylessons.com/
# GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3
# Description : additional yolov3 and yolov4 functio... |
specification_drawer.py | """
A specification drawer is for visualizing combinatorial specification object
"""
import json
import os
import tempfile
import threading
import time
import webbrowser
from copy import copy
from typing import TYPE_CHECKING, ClassVar, Dict, List, Tuple
from logzero import logger
from typing_extensions import TypedDic... |
PlaneSniffer.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Jonathan Cheseaux"
__copyright__ = "Copyright 2014"
__credits__ = ["Jonathan Cheseaux", "Stefano Rosati", "Karol Kruzelecki"]
__license__ = "MIT"
__email__ = "cheseauxjonathan@gmail.com"
import os
from scapy.all import *
from threading import *
import math
impo... |
run-p4-sample.py | #!/usr/bin/env python3
# Copyright 2013-present Barefoot Networks, 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 b... |
PySC2_A3C_AtariNet.py | """
PySC2_A3C_AtariNet.py
A script for training and running an A3C agent on the PySC2 environment, with reference to DeepMind's paper:
[1] Vinyals, Oriol, et al. "Starcraft II: A new challenge for reinforcement learning." arXiv preprint arXiv:1708.04782 (2017).
Advantage estimation uses generalized advantage estimation... |
test_lightningd.py | from concurrent import futures
from decimal import Decimal
from ephemeral_port_reserve import reserve as reserve_port
from flaky import flaky
from utils import wait_for
import copy
import json
import logging
import queue
import os
import random
import re
import shutil
import socket
import sqlite3
import stat
import st... |
datasets.py | # YOLOv5 dataset utils and dataloaders
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool, Pool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch... |
realtimeLogger.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
import unittest.mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
import sock... |
test_app.py | import threading
import cio
from cio import get_version
from cio.conf import settings, default_settings
from cio.pipeline import pipeline
from tests import BaseTest
class AppTest(BaseTest):
def test_version(self):
self.assertEqual(get_version((1, 2, 3, 'alpha', 1)), '1.2.3a1')
self.assertEqual(ge... |
averager.py | """ A background process that averages your tensors with peers """
from __future__ import annotations
import asyncio
import contextlib
import ctypes
import multiprocessing as mp
import os
import random
import threading
import weakref
from dataclasses import asdict
from typing import Any, AsyncIterator, Dict, Optional... |
g_CXR_Net.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 10 14:11:59 2021
@author: dgatti
"""
# ### Calculate lung masks and Covid vs non-Covid scores
#
# To launch from the command line:
# /Path to python executable inside virtual env/python g_CXR_Net.py --xdir 'directory where this script resides'
... |
skeletonMultiTesterSelenium.py | ####################################################################
# Skeleton for Multi Testing Selenium tests on Sauce Labs
####################################################################
###################################################################
# Imports that are good to use
#######################... |
callbacks_test.py | # Copyright 2016 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... |
sadpanda.py | from urllib.parse import quote, unquote
from bs4 import BeautifulSoup
import time
import threading
import requests
class Sadpanda():
def __init__(self, server):
self.server = server
self.notification = None
self.running = False
self.cache = {}
self.cookies = self... |
helpers.py | """
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
"""
import base64
import builtins
import errno
import fnmatch
import functools
import insp... |
interseccion_de_caminos.py | #!/usr/bin/python3
from threading import Semaphore, Thread
from random import randint
from time import sleep
s12 = Semaphore(1)
s24 = Semaphore(1)
s13 = Semaphore(1)
s34 = Semaphore(1)
# Definiciones:
# ¿De dónde y hacia dónde vamos?
#
# 1
# | | |
# | | |
# -----+---+---+---
# 2 | |... |
socket.py | import socket
import threading
import time
PORT=5060
FORMAT='utf-8'
SERVER_NAME=socket.gethostname()
IP_ADRESS=socket.gethostbyname(SERVER_NAME)
ADRESS_DEF=(IP_ADRESS,PORT)
DISCONNECT_MESSAGE='!DISCONECT'
CLIENT_LIST=set()
server=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setsockopt(socket.SOL_SOCKET,s... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The TNGC 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 tngcd node can load multiple wallet files
"""
from decimal import Decimal... |
environment.py | # Copyright 2020 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from __future__ import print_function
import ast
import inspect
import os
import platform
import re
import sys
import traceback
from functools i... |
base_camera.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
... |
queryBTR.py | # -*- coding=utf-8 -*-
from urllib import request
import random
import json
import threading
import time
from subprocess import call
# import win32gui
# from win_notify import TestTaskbarIcon
# 需要python3环境
HEADER = {
'Content-Type': 'application/json'
}
# taskbar = TestTaskbarIcon()
def request_data():
u... |
formats.py | from __future__ import print_function, division, absolute_import
import os
import stat
import struct
import sys
import tarfile
import threading
import time
import zipfile
import zlib
from contextlib import closing
from io import BytesIO
from multiprocessing.pool import ThreadPool
from .compat import Queue
from .core... |
test_runtimes.py | import asyncio
import json
import multiprocessing
import threading
import time
import pytest
from jina import Client, Document, Executor, requests
from jina.enums import PollingType
from jina.parsers import set_gateway_parser, set_pod_parser
from jina.serve.networking import GrpcConnectionPool
from jina.serve.runtime... |
Hiwin_RT605_ArmCommand_Socket_20190627193209.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... |
_localhost_open_browser.py | import os
import time
import urllib
import warnings
import threading
import webbrowser
from .._is_reload_process import is_reload_process
from .._user_preferences import get_user_preference
from . import terminal_colors
class LocalhostOpenBrowser:
# pylint: disable=too-few-public-methods
def __init__(self, ... |
tracking_old.py | import cv2
print(cv2.__version__)
from threading import Thread
from people import Tracking
import copy
import time
frames = []
def readframes_(caps):
global frames
ind = 0
while True:
t1 = time.time()
cam_no = ind%3
ind += 1
for i, cap in enumerate(caps):
cap.gra... |
ir_sender.py | # ir_sender.py
"""This is the definition of the IRSender class. This class creates the necessary additional
processes to execute the commands. This class implements the use of the lircd library.
"""
import os
import time
import threading
from remote_controller.errors import InvalidCompositeCommandError
class IRSende... |
main.py | from threading import Timer, Thread
import time
import os
import sys
def kill():
print("TLE")
exit(1)
testCases = int(sys.argv[1])
timeLimit = int(sys.argv[2])
def runCode(timeout):
if os.system("g++ -std=c++17 -O2 /source/code.cpp -o /source/code > /source/out/compile_out.txt 2> /source/out/compile_erro... |
main.py | #!/usr/bin/python
#
# Author: leogps
#
import sys
import dbus
from utils import playerutils
from event import deviceConnectedEvent
from event import mediaChangedEvent
from delegate import adapterRetriever
from . import device, mediaPlayer
from dbus.mainloop.glib import DBusGMainLoop
import glib
from ui import blue... |
study.py | import concurrent.futures
import itertools
import math
import uuid
from collections.abc import Sequence as SequenceType
from threading import Thread
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
from google.protobuf.timestamp_pb2 import Timestamp
from optur.errors import PrunedE... |
threadloop.py | from __future__ import absolute_import
import sys
from concurrent.futures import Future
from threading import Event, Thread
from tornado import ioloop
from tornado import gen
from .exceptions import ThreadNotStartedError
# Python3's concurrent.futures.Future doesn't allow
# setting exc_info... but exc_info works w/... |
worker.py | import base64
import logging
import os
import re
import sys
import json
import time
from abc import ABC
from datetime import datetime
from multiprocessing import Process, Queue
from urllib.parse import urlparse
import pandas as pd
import requests
import sqlalchemy as s
from github import Github
from sqlalchemy import ... |
_project.py | import logging
import time
import uuid
import openpnm
import numpy as np
from copy import deepcopy
from openpnm.utils import HealthDict, Workspace
from ._grid import Tableist
from auto_all import start_all, end_all
logger = logging.getLogger(__name__)
ws = Workspace()
start_all()
class Project(list):
r"""
Th... |
debug_publisher_mv_angle.py | #!/usr/bin/env python3
import threading
import rospy
from std_msgs.msg import Float64, Int32
from sensor_msgs.msg import JointState
class Control:
speed= 521
kp=5
kd=1
prev_err=0
n = 10
def get_angle_from_mv(self):
return 45
def PD_control(self, angle):
err=90-a... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
command.py | import logging
import sys
import itertools
import time
import os
import math
import click
import click_log
import tqdm
import ssw
import pysam
import multiprocessing as mp
from ..utils import bam_utils
from ..utils.model import LibraryModel
import longbow.utils.constants
logging.basicConfig(stream=sys.stderr)
log... |
test_log.py | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
manage_cqhttp.py | import os
import re
import subprocess
import sys
from loguru import logger
from nonebot import on_startup
from .. import _version
from .. import config
from ..utils import download_file
__plugin_name__ = '[I]manage_cqhttp'
__plugin_usage__ = r"""
[Internal plugin]
Configure and start go_cqhttp on setup.
Please DO NO... |
tests.py | # Copyright 2021 Cortex Labs, 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 wri... |
simulate_serial.py | #!/usr/bin/env python3
import logging
import os.path
import subprocess
import sys
import threading
import time
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
from logger.readers.logfile_reader import LogfileReader # noqa: E402
from logger.transforms.slice_transform imp... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
import signal
from collections import namedtuple
import capnp
from tqdm import tqdm
import cereal.messaging as messaging
from cereal import car, log
from cereal.services import service_list
from common.params import Params
from ... |
client.py | from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_BROADCAST, SO_REUSEPORT, gethostname, gethostbyname
from threading import Thread
import pyaudio
class Client:
def __init__(self, host='', port=37020, buffer_size=4096, format=pyaudio.paInt16, channels=2, rate=44100, chunk=1024):
self._host = ... |
test_logging.py | # Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
hook.py | # Copyright 2016: Mirantis Inc.
# 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 b... |
TProcessPoolServer.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.