source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
kuanShopApp_spider.py | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 25 04:26:09 2020
酷安应用商店应用数据爬取
@author: luohenyueji
"""
import requests
import queue
import threading
import re
from lxml import etree
import csv
from copy import deepcopy
class KuAn(object):
def __init__(self, category, page):
if category not in ['apk', 'ga... |
ircthread.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, m... |
face-back.py | #!/usr/bin/env python
import rospy
import cv2
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import CompressedImage, Image
from duckietown_msgs.msg import Segment, SegmentList, Vector2D
from geometry_msgs.msg import Point
import numpy as np
import threading
#from PIL import Image as pimg
#import jpe... |
runner.py | import queue, threading
import datetime
class Stats:
d = {}
def __repr__(self):
return str(self.d)
def __str__(self):
return '\n'.join(['\t{k}: {v}'.format(k=k, v=v) for k, v in self.d.items()])
def add(self, key):
if self.d.get(key) is None:
self.d[key] = 1
... |
run.py | import cli_app.run_agent as agent
import cli_app.run_server as server
import threading
import time
def run():
server.server_run()
agent.agent_run()
def main():
server_thread = threading.Thread(target=server.server_run)
server_thread.start()
agent_thread = threading.Thread(target=agent.agent_run)... |
rse.py | # -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# 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-... |
profileserver.py | #literal #!/usr/bin/python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import SimpleHTTPServer
import SocketServer
import socket
import threading
import os
import... |
2.051sshBrute.py | from pexpect import pxssh
from threading import *
import optparse
import time
'''
This code we need learning pxssh from pexpect
Docstring:
----------
1. first,we create maxConnection to set max number of threads. This example we set 5
2. we set global variable Found and Fails
Found: check any thread fi... |
blockchain.py | #!/usr/bin/python3.6
from miner import Miner
import ast
from multiprocessing import Process, Manager
import socket
HOST = '127.0.0.1' # Standard loopback interface address (localhost)
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)
DIFFICULTY = 1 # Number of zeroes at the beginning of... |
lambda_api.py | from __future__ import print_function
import os
import re
import sys
import json
import uuid
import time
import traceback
import logging
import base64
import threading
import imp
import glob
import subprocess
from io import BytesIO
from datetime import datetime
from multiprocessing import Process, Queue
from six impor... |
dnsbrute.py | #!/usr/bin/env python3
import sys
import dns.resolver
import dns.reversename
import dns.exception
import netaddr
import ipwhois
import threading
import queue
import time
THREAD_COUNT = 256 # Minimum number of threads.
BLOCK_SIZE = 1024 # Smallest netblock on which we will do reverse lookups.
LIFETIME = 10.0 # Tot... |
wsdump.py | #!/Users/weiyihu/StudioProjects/team-project-14-djno/backend/virt/bin/python
import argparse
import code
import sys
import threading
import time
import ssl
import gzip
import zlib
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_... |
DigitalInputReader.py | from typing import Callable, Dict, List, Optional
from vosekast_control.connectors import SMBusConnection
import threading
import logging
from vosekast_control.Log import LOGGER
from inspect import iscoroutinefunction
from asyncio import create_task, BaseEventLoop
from time import sleep
from vosekast_control.connector... |
py_queue.py | #!usr/bin/env python
# coding=utf-8
import time
import multiprocessing
def write(queue):
vals = [1, 2, 3, 4, 5, 6]
for v in vals:
print 'Put %s to queue...' % v
queue.put(v)
time.sleep(3)
def read(queue):
while 1:
value = queue.get(True)
print 'Get %s from queue.' ... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals
"""Dask extensions for distributed training. See
https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple
tutorial. Also xgboost/demo/dask for some examples.
There are two sets of APIs in this module, one is the functional API including
``train`` an... |
crop_synthtext.py | #encoding=utf8
# Copyright (c) 2021 PaddlePaddle 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 requi... |
scratch.py | import hashlib
import secrets
import string
import time
from multiprocessing import Process, Queue
import os
def random_str():
# Generate a random size string from 3 - 27 characters long
rand_str = ''
for i in range(0, 1 + secrets.randbelow(25)):
rand_str += string.ascii_lowercase[secrets.randbelow... |
transfer_learning.py | # coding: utf-8
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../'))
import numpy as np
import h5py
import argparse
import time
import logging
from sklearn import metrics
from utils import utilities, data_generator, agument
import tensorflow as tf
slim = tf.contrib.slim
import pandas as pd
impor... |
comfoconnect.py | import logging
import queue
import struct
import threading
import time
from .bridge import Bridge
from .error import *
from .message import Message
from .zehnder_pb2 import *
KEEPALIVE = 60
DEFAULT_LOCAL_UUID = bytes.fromhex('00000000000000000000000000001337')
DEFAULT_LOCAL_DEVICENAME = 'pycomfoconnect'
DEFAULT_PIN ... |
test_watch.py | """Test helpers module."""
import os
import shutil
import multiprocessing
import time
import pytest
import watch
fixtures_dir = os.path.join('tests', 'fixtures')
@pytest.fixture
def setup(request):
"""Remove files created."""
cwd = os.getcwd()
os.chdir(fixtures_dir)
os.mkdir('watch1')
os.mkdir('w... |
systematizing.py | """
Created on Oct 22, 2013
@author: rgeorgi
"""
import subprocess
import sys
import logging
from threading import Thread
from queue import Empty, Queue
from unittest.case import TestCase
import time
def enqueue_output(out, queue):
for line in iter(out.readline, b''):
queue.put(line)
out.close()
de... |
generate_clsim_table.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position, invalid-name, no-member, no-name-in-module
# pylint: disable=import-error
"""
Create a Retro table: Propagate light outwards from a DOM and tabulate the
photons. Uses CLSim (tabulator) to do the work of photon propagation.
"""
# TO... |
networking.py | import ast
import asyncio
import ipaddress
import socket
from abc import abstractmethod
from argparse import Namespace
from threading import Thread
from typing import Optional, TYPE_CHECKING
import grpc
from jina.logging.logger import JinaLogger
from jina.proto import jina_pb2_grpc
from jina.types.message import Mess... |
test_client.py | import asyncio
import concurrent.futures
import copy
import datetime
import functools
import os
import re
import threading
import warnings
from base64 import b64decode, b64encode
from queue import Empty
from unittest.mock import MagicMock, Mock
import nbformat
import pytest
import xmltodict
from jupyter_client import ... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
subproc.py | import gym
import time
import ctypes
import numpy as np
from collections import OrderedDict
from multiprocessing.context import Process
from multiprocessing import Array, Pipe, connection
from typing import Callable, Any, List, Tuple, Optional
from tianshou.env.worker import EnvWorker
from tianshou.env.utils import Cl... |
Project1 Image Processing Raw.py | ################################### - 권장1 : GrayScale 영상 처리 및 데이터 분석 툴 제작 ##################################
from tkinter import *; import os.path ;import math
from tkinter.filedialog import *
from tkinter.simpledialog import *
import operator
import threading
## 함수 선언부
def loadImage(fname) :
global window, canv... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from socketserver import ThreadingMixIn
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
import threading
import http.server
import json
import queue
import socket
import subprocess
import time
... |
import_dicom.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# models.import_dicom.py
"""
Classes for the DICOM import GUI and threading
"""
# Copyright (c) 2016-2019 Dan Cutright
# This file is part of DVH Analytics, released under a BSD license.
# See the file LICENSE included with this distribution, also
# available at http... |
scheduler.py | import logging
import multiprocessing as mp
import pandas as pd
from uuid import UUID
import emission.core.get_database as edb
import emission.net.usercache.abstract_usercache as enua
import emission.storage.timeseries.aggregate_timeseries as estag
import emission.storage.decorations.user_queries as esdu
import emissi... |
WebUI.py | import http.server
import logging
import os
import socket
import socketserver
import threading
import webbrowser
import asyncio
from functools import partial
from NetUtils import Node
from MultiClient import Context
import Utils
logger = logging.getLogger("WebUIRelay")
class WebUiClient(Node):
def __init__(self... |
arrow_dataset_ops.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... |
server.py | #!/usr/bin/env python
import threading
import io
import os
import sys
import json
import logging
import logging.handlers
try:
import argparse
except ImportError:
sys.exit("ImportError: You do not have the Python 'argparse' module installed. Please install the 'argparse' module and try again.")
from time impor... |
data_plane_utils.py | import pytest
from tests.common.dualtor.dual_tor_io import DualTorIO
from tests.common.helpers.assertions import pytest_assert
import threading
import logging
logger = logging.getLogger(__name__)
def arp_setup(ptfhost):
logger.info('Copy ARP responder to the PTF container {}'.format(ptfhost.hostname))
ptfho... |
k8.py |
import logging, coloredlogs
logger = logging.getLogger(__name__)
coloredlogs.install(level='DEBUG',logger=logger)
coloredlogs.install(level='DEBUG',logger=logging.getLogger('pbt'))
coloredlogs.install(level='DEBUG',logger=logging.getLogger('experiment'))
import requests
import json
import platform
import time
import... |
basic_motion.py | import ingenialink as il
import numpy as np
import argparse
from time import sleep
import threading
CSV_MODE = 35
CSP_MODE = 36
stop_thread = False
sampling_time = 0.1
def read_thread(servo, actual_val_reg_id):
global stop_thread
while not stop_thread:
print("Actual value: ", servo.read(actual_val_r... |
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 - 2021, ARM Limited. All rights res... |
test_multiprocessing.py | import os
import sys
import multiprocessing
import loguru
from loguru import logger
import time
import pytest
def do_something(i):
logger.info("#{}", i)
def set_logger(logger_):
global logger
logger = logger_
def subworker(logger_):
logger_.info("Child")
def subworker_inheritance():
logger.i... |
Tello3_video.py | # tello demo by Ryze Robotics, modified by Martin Piehslinger
# added video and gamepad support
# learned from (among others):
# https://learnopencv.com/read-write-and-display-a-video-using-opencv-cpp-python/
# https://docs.opencv.org/4.5.1/d7/d9e/tutorial_video_write.html
import threading
import socket
impo... |
streaming_secured_client.py | import socket
import cv2
import pickle
import struct
import threading
import argparse
import errno
import time
# For encryption
from cryptography.hazmat.primitives import hashes, hmac
from cryptography.hazmat.primitives.asymmetric import dh, padding, ec
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryp... |
camera_rpi_2.py | #!/usr/bin/env python
from __future__ import print_function
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import CompressedImage
from imutils.video.pivideostream import PiVideoStream
import argparse
import imutils
from... |
VirtualDevice.py | from __future__ import absolute_import
import sys
import time
import threading
import serial
import smbus2 as smbus
from mock import patch, Mock
from tinker_access_client.tinker_access_client.Client import Client
from tinker_access_client.tinker_access_client.ClientOption import ClientOption
from tests.integration.... |
test_eap_proto.py | # EAP protocol tests
# Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import hashlib
import hmac
import logging
logger = logging.getLogger()
import os
import select
import struct
import threading
i... |
dispatcher.py | import argparse
import os
import re
import socket
import socketserver
import threading
import time
import helpers
def dispatch_tests(server, commit_id):
while True:
print("trying to dispatch to runners")
for runner in server.runners:
response = helpers.communicate(runner['host'], int(... |
load_test.py | from threading import Thread
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
# Local imports
from yaksh.models import User, Profile, Course
from yaksh.code_server import ServerPool
from yaksh import settings
from .selenium_test import SeleniumTest
class YakshSeleniumTests(StaticLiveServerTest... |
test_state.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import glob
import logging
import os
import shutil
import threading
import time
import logging
# Import Salt Testing Libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.case impor... |
login1.py | from kivymd.app import MDApp
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivymd.uix.label import MDLabel
from kivy.properties import StringProperty
from kivy.prope... |
botai3.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
fr... |
sentiment_analysis.py | """Generate account statements.
This module will create statement records for each account.
"""
import os
import threading
import psycopg2
from transformers import pipeline
from api.services.transformers import overall_sentiment_transformers
from flask import Flask
import config
from utils.logger import setup_loggi... |
main.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
from os import path
import rospy
import threading
from typing import Dict, Any
from std_msgs.msg import String
import uvicorn
from pydantic import BaseModel
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.templatin... |
simpleMalwareSerPer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Tests persistence mechanism of malware component by creating an autostart service
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_log... |
zip_file_cracker.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019-04-26 1:01
# @Author : Zhang Bin
# @Site : home
# @File : zip_file_cracker.py
# @Software: PyCharm
import zipfile
import optparse
from threading import Thread
def extract_file(file, password):
"""测试密码是否能开启文件"""
try:
file.extracta... |
backend.py | from werkzeug.serving import make_server
from flask import Flask
from threading import Thread
import os
import toml
import json
from .interface import ServiceInterface
from .logger import debug
from .consts import DATA_SOURCES, NAME
HOST = '127.0.0.1'
PORT = 9006
class FlaskServer(object):
def __init__(self, ... |
hackrf.py | from scapy.all import *
from mirage.libs import wireless,io,utils
from mirage.libs.ble_utils.constants import *
from mirage.libs.common.sdr import sources,demodulators,decoders,sinks,modulators
from mirage.libs.ble_utils.decoders import BLEDecoder
from mirage.libs.ble_utils.encoders import BLEEncoder
from mirage.libs.b... |
surface_stats_collector.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import Queue
import datetime
import logging
import re
import threading
from pylib import perf_tests_helper
# Log marker containing SurfaceTexture time... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The worldwideweb Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test worldwidewebd shutdown."""
from test_framework.test_framework import worldwidewebTestFramewo... |
test_dgx.py | import multiprocessing as mp
import os
import subprocess
from enum import Enum, auto
from time import sleep
import numpy
import pytest
from tornado.ioloop import IOLoop
from dask import array as da
from distributed import Client
from distributed.utils import get_ip_interface
from dask_cuda import LocalCUDACluster
fr... |
manage1.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rules
import os
import re
import requests
import json
import jsonpath
import time
from functools import reduce
from defender import Defender
from flask import Flask, g, jsonify, make_response, request
from flask_cors import CORS
from flask_httpauth import HTTPBasicAu... |
menu.py | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import curses
import npyscreen
import time
from threading import Thread
from vent.api.actions import Action
from vent.api.plugins import Plugin
from vent.helpers.meta import Version
from vent.helpers.paths import PathDirs
from vent.menus.help import HelpForm
from vent... |
test_generator_runner.py | # Copyright 2021 Zilliz. 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 agree... |
saltbot.py | #!/usr/bin/env python
# This script is under GPL License v2
# (c) Jean-Michel LACROIX 2006 (jm-lacroix@savigny.org)
# (c) Tor Hveem 2008-2014
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol, threads
from twisted.python import log
from twisted.internet import threads
from twisted.... |
transfer.py | import socket
import threading
from .WebSocket.WebSocket import WebSocket
from Config import config
ADDRESS = config.Project.server_host
PORT = config.Project.port
ALLOW = config.Project.allow_host
def broadcast(message): # broadcast function declaration
for Receiver in receivers:
Receiver.send(message... |
umb_producer.py | #!/usr/bin/env python2
import base64
import json
import logging
import ssl
import subprocess
import sys
import threading
import click
import requests
from rhmsg.activemq.producer import AMQProducer
from rhmsg.activemq.consumer import AMQConsumer
# Expose errors during signing for debugging
logging.basicConfig(stream... |
__init__.py | from __future__ import print_function
from past.builtins import xrange
from builtins import input, bytes
import six
import os
import sys
import cmd
import time
import serial
import select
import struct
import threading
import math
import pickle
import binascii
from cancat import iso_tp
baud = 4000000
# command con... |
test.py | #! /usr/bin/env python3
#
# Copyright 2019 Garmin Ltd. or its subsidiaries
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
serial_thread.py | # encoding:UTF-8
import serial # 导入串口包
import time # 导入时间包
import threading
class Config:
# 端口号
serialPort = '/dev/ttyUSB0'
# 波特率
baudRate = 9600
class Serialthread:
def __init__(self):
self.port = serial.Serial(Config.serialPort, Config.baudRate,timeout = 0)
self.port.close(... |
XuleProcessor.py | """XuleProcessor
Xule is a rule processor for XBRL (X)brl r(ULE).
The XuleProcessor module is the main module for processing a rule set against an instance.
DOCSKIP
See https://xbrl.us/dqc-license for license information.
See https://xbrl.us/dqc-patent for patent infringement notice.
Copyright (c) 2017 - 2019 XBR... |
session.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... |
mmalobj.py | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python header conversion
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Original headers
# Copyright (c) 2012, Broadcom Europe Ltd
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted... |
_v5_proc_adintool.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... |
stats.py | from client import client
from datetime import datetime
import discord
import os
import socket
import threading
import time
try:
import psutil
except ModuleNotFoundError:
has_psutil = False
else:
has_psutil = True
cmd_name = "stats"
client.basic_help(title=cmd_name, desc=f"shows various running statistics of {c... |
pick_and_place_with_conveyor.py | #! /usr/bin/env python
'''
Controls a UR5 Robotic Arm to sort coloured boxes into bins from a conveyor.
'''
import rospy, geometry_msgs.msg, os, threading
from hrwros_gazebo.msg import LogicalCameraImage
from math import radians
from rospy.exceptions import ROSInterruptException
from lib import UR5MoveIt
Package_Pos... |
test_service.py | import re
import unittest
from xcube.webapi.service import Service
from xcube.webapi.service import new_default_config
from xcube.webapi.service import url_pattern
class ServerMock:
def stop(self):
pass
class ApplicationMock:
# noinspection PyMethodMayBeStatic,PyUnusedLocal
def listen(self, por... |
main.py | from threading import RLock, Thread #RLock usado en caso de usar .acquiare por segunda vez desde el mismo hilo
from time import sleep
# Modulos propios ->Carpeta modulo
from modulos.agencia import agencia
from modulos.compania import compania
from modulos.cliente import cliente
if __name__ == "__main__":
numClie... |
test_util.py | # Copyright 2015 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... |
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... |
Main.py | import threading
import sys
import time
import anki_vector
import numpy as np
from random import randint
from cv2 import cv2
from anki_vector.util import distance_mm, speed_mmps, degrees, Angle, Pose
from anki_vector.events import Events
import math
def handle_object_observed(robot, event_type, event):
"""whenever... |
avoidance.py | from src.motors_pwm import *
from src.distance import *
import threading
import time
class Avoidance():
def __init__(self, motors_obj):
self.motors_obj = motors_obj
distance_init()
self.speed = 30
self.near_threshold = 15
thread = threading.Thread(target=self._thread)
... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
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 selfdrive.car.... |
simple_http_server.py | import os
import urlparse
import datetime
import threading
import mimetools
import socket
import errno
import sys
import select
import time
import json
import xlog
logging = xlog.Logger()
class HttpServerHandler():
default_request_version = "HTTP/1.1"
MessageClass = mimetools.Message
rbufsize = -1
w... |
ssh.py | from __future__ import absolute_import
import inspect
import logging
import os
import re
import shutil
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from pwnlib import term
from pwnlib.context import context
from pwnlib.log import Logger
from pwnlib.log import getLo... |
run_parallel.py | import os
import sys
import time
import torch
import numpy as np
import multiprocessing as mp
from elegantrl.envs.Gym import build_env, build_eval_env
from elegantrl.train.replay_buffer import ReplayBufferMP
from elegantrl.train.evaluator import Evaluator
def train_and_evaluate_mp(args, agent_id=0):
args.init_bef... |
powell_torch.py | # /******************************************
# *MIT License
# *
# *Copyright (c) [2021] [Eleonora D'Arnese, Emanuele Del Sozzo, Davide Conficconi, Marco Domenico Santambrogio]
# *
# *Permission is hereby granted, free of charge, to any person obtaining a copy
# *of this software and associated documentation files (th... |
rplidar-save3.py | '''Simple and lightweight module for working with RPLidar rangefinder scanners.
Usage example:
>>> from rplidar import RPLidar
>>> lidar = RPLidar('/dev/ttyUSB0')
>>>
>>> info = lidar.get_info()
>>> print(info)
>>>
>>> health = lidar.get_health()
>>> print(health)
>>>
>>> for i, scan in enumerate(lidar.iter_scans()):... |
train_viewpose.py | import matplotlib
matplotlib.use('Agg')
import os
from os.path import join
import argparse
import torch
import numpy as np
import pickle
import sys
import datetime
sys.path.append('./utils')
from torch import optim
from torch import nn
from torch import multiprocessing
from torch.optim import lr_scheduler
from torch.a... |
admin.py | from .models import *
from django.contrib import admin
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from .views import *
from django import forms
#from django.contrib.admin.widgets import SelectWidget
from django.utils.safestring import mark_safe
from django.contrib import m... |
test_gluon_model_zoo.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... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet, InternalAddressCorruption
from electrum.paymentrequest import InvoiceStore
fr... |
mtprint4.py | import threading
class MyClass:
def __call__(self, a, b, c):
print('Hello', a, b, c)
if __name__ == '__main__':
for i in range(3):
t = threading.Thread(target=MyClass(), args=(10, 20, 30))
t.start() # target(*args)
|
agent.py | from abc import ABC, abstractmethod
import logging
from ROAR.utilities_module.vehicle_models import Vehicle
from ROAR.utilities_module.data_structures_models import SensorsData, IMUData, Transform
from ROAR.utilities_module.vehicle_models import VehicleControl
from typing import Optional, List
from pathlib import Path
... |
test_threading.py | """
Tests for the threading module.
"""
import test.support
from test.support import threading_helper
from test.support import verbose, cpython_only
from test.support.import_helper import import_module
from test.support.script_helper import assert_python_ok, assert_python_failure
import random
import sys
import _thre... |
WtMonSvr.py | from flask import Flask, session, redirect, request, make_response
from flask_compress import Compress
import json
import yaml
import datetime
import os
import hashlib
import sys
import chardet
import pytz
from .WtLogger import WtLogger
from .DataMgr import DataMgr, backup_file
from .PushSvr import PushS... |
stats.py | """
Simple and lightweight statistics collection module.
Logging is done in a separate process to minimize influence of logging on program execution.
"""
from multiprocessing import Process, Queue
from queue import Empty
import csv
from enum import Enum
import datetime
import logging
import time
import sys
import os
... |
PrimitiveTest.py | ##########################################################################
#
# Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
server.py | import os
import signal
import random
import time
import errno
import getpass
import shutil
import threading
from subprocess import Popen, PIPE
from . management import Manager
class Server(Manager):
def __init__(self, **kwargs):
super().__init__()
self._server_process = None
self._dns_proxy_port = random.ran... |
Feeder.py | import numpy as np
import json, os, time, pickle, librosa
from collections import deque
from threading import Thread
from random import shuffle
from Audio import melspectrogram
with open('Hyper_Parameters.json', 'r') as f:
hp_Dict = json.load(f)
class Feeder:
def __init__(self, is_Training= False):
s... |
gamecontroller.py | import os
import time
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
import threading
import uuid
import json
from multiprocessing import Queue, Event, Process
from .playercontroller import SandboxedPlayerController
from .exceptions import GameFinishedException, G... |
test_replication.py | """TestCases for distributed transactions.
"""
import os
import time
import unittest
from .test_all import db, test_support, have_threads, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class DBReplicationManager(unittest.T... |
stats_manager.py | # std
import logging
import re
from datetime import datetime, timedelta
from typing import cast, List, Union
from threading import Thread
from time import sleep
# project
from . import (
HarvesterActivityConsumer,
PartialConsumer,
BlockConsumer,
WalletAddedCoinConsumer,
FinishedSignageConsumer,
)
f... |
reconstruction_GA.py | # #########################################################################
# Copyright (c) , UChicago Argonne, LLC. All rights reserved. #
# #
# See LICENSE file. #
# ##############... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.