source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
discovery.py | """This module contains methods for discovering Sonos devices on the
network."""
import logging
import socket
import select
from textwrap import dedent
import time
import struct
import ipaddress
import threading
import ifaddr
from . import config
from .utils import really_utf8
_LOG = logging.getLogger(__name__)
# ... |
window_title_change.py | import webview
import threading
'''
This example demonstrates how to change a window title.
'''
def change_url():
webview.set_title('New title')
if __name__ == '__main__':
t = threading.Thread(target=change_url)
t.start()
webview.create_window('Simple browser', 'http://www.flowrl.com', width=800, h... |
grpc_util_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... |
utility.py | import os
import secrets
from PIL import Image
from functools import wraps
from threading import Thread
from flask_mail import Message
from flask_wtf import FlaskForm
from articlee.models import Users
from wtforms.widgets import TextArea
from wtforms.validators import ValidationError
from flask_wtf.file import FileFiel... |
test1.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from multiprocessing import Process
import time
import threading
import os
def thread_test():
print('this is thread')
print(threading.get_ident())
def run(name):
time.sleep(2)
print(name)
print('============%s============' )
print('parent pid:%s' ... |
googlesearch.py | '''
Created on May 5, 2017
@author: anthony
'''
import urllib2
import math
import re
from bs4 import BeautifulSoup
from pprint import pprint
from threading import Thread
from collections import deque
from time import sleep
class GoogleSearch:
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/5... |
HTTPControl.py | import mimetypes
import os
import pathlib
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from termcolor import colored
from datetime import datetime, timedelta
import jinja2
import json
import re
import threading
import time
import urllib.parse
import math
from ww imp... |
dockable.py | #!/usr/bin/env python3
import finplot as fplt
from functools import lru_cache
from PyQt5.QtWidgets import QGraphicsView, QComboBox, QLabel
from PyQt5.QtGui import QApplication, QGridLayout
from PyQt5 import QtGui
from pyqtgraph.dockarea import DockArea, Dock
from threading import Thread
import yfinance as yf
app = QA... |
bgapi.py | from __future__ import print_function
# for Python 2/3 compatibility
try:
import queue
except ImportError:
import Queue as queue
import logging
import serial
import time
import threading
from binascii import hexlify, unhexlify
from uuid import UUID
from enum import Enum
from collections import defaultdict
f... |
test.py | #!/usr/bin/env python
#
# 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
# "L... |
test.py | # -*- coding: utf-8 -*-
# @Time : 2020/4/21 17:16
# @Author : Python自动化办公社区
# @File : local_code.py
# @Software: PyCharm
# @Description:
import codecs
import csv
import random
import threading
import time
import requests
import os
import json
class eastmoneyspider_new():
page_num = 1
page_size = 1000
t... |
trt_yolo_final.py | """trt_yolo.py
This script demonstrates how to do real-time object detection with
TensorRT optimized YOLO engine.
"""
import os
import time
import argparse
import cv2
import pycuda.autoinit # This is needed for initializing CUDA driver
import mysql.connector
from mysql.connector import pooling
from mysql.connector... |
roomba.py | from os import kill
from redis import StrictRedis, WatchError
from multiprocessing import Process
from threading import Thread
from msgpack import Unpacker, packb
from types import TupleType
from time import time, sleep
import logging
import settings
logger = logging.getLogger("HorizonLog")
class Roomba(Thread):
... |
fcnet.py | """TensorFlow implementation of fully connected networks.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import time
import numpy as np
import tensorflow as tf
import threading
import deepchem as dc
from deepchem.nn import model_ops
from deepchem.uti... |
test_compressed.py | # /*******************************************************************************
# Copyright (C) 2021 Xilinx, 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://... |
test_advanced.py | # coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import numpy as np
import pytest
import ray.cluster_utils
import ray.test_utils
from ray.test_utils import client_test_enabled
from ray.test_utils import RayTestTimeoutEx... |
ThreadCommunicationUsingAFlag.py | from threading import *;
from time import *;
class Producer:
def __init__(self):
self.products = []
self.c = Condition()
def produce(self):
self.c.acquire()
for i in range(1,5):
self.products.append("Product"+str(i))
sleep(1)
... |
social_torrent.py | import socket
import os
from _thread import *
import threading
import time
import sys
import datetime
# Credentials
PORT=12345
HOST=''
packetonAir = 0
SendThreads = list()
packetsendSize = 0
Ipandnames = dict()
AcknowledgedPacketNum = 0
def clear():
os.system('clear')
# Gets the IP of user
def get_ip():
cle... |
common.py | # Copyright 2016 Vijayaditya Peddinti.
# 2016 Vimal Manohar
# 2017 Johns Hopkins University (author: Daniel Povey)
# Apache 2.0
""" This module contains several utility functions and classes that are
commonly used in many kaldi python scripts.
"""
from __future__ import print_function
from __futur... |
recordtest.py | import pynput
import threading
import time
tm = time.time()
times = []
pressedList = []
n = 4
tmvectors = []
tm = time.time()
def on_click(x, y, button, pressed):
if time.time() - tm <= n:
if pressed:
tmvectors.append(time.time() - tm)
try:
newvector = (tmvectors[-2] - tmvectors[-1]) * -1
... |
Image2Text.py | import os
import threading
from multiprocessing.pool import ThreadPool
from PyQt5.QtCore import pyqtSlot, QFileInfo, pyqtSignal, QBuffer, QByteArray, QIODevice, QSize, Qt
from PyQt5.QtGui import QMovie, QPixmap, QIcon
from PyQt5.QtWidgets import QWidget, QFileDialog, QLabel
from QCandyUi.CandyWindow import colorful
i... |
dispatcher.py | import threading
import logging
import queue
import time
import Pyro4
class Job(object):
def __init__(self, id, **kwargs):
self.id = id
self.kwargs = kwargs
self.timestamps = {}
self.result = None
self.exception = None
self.worker_name = None
def time_it(self, which_time):
self.t... |
volume.py | import logging, json
from threading import Thread
from django.conf import settings
from backend.models import Volume
from backend.kubernetes.k8sclient import KubeClient
from backend.utils import get_volume_nfs_dir
from backend.nfs import NFSRemoteClient, NFSLocalClient
logger = logging.getLogger('hummer')
class Vo... |
ssh.py | import os
import sys
import subprocess
import threading
import base64
import bz2
try:
import cPickle as pickle
except ImportError:
import pickle
from . import Protocol
run_cmd_code = """result=None
try:
import cPickle as pickle
except ImportError:
import pickle
def run_cmd(command):
try:
global resu... |
dev_test_dex_subscribe.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: dev_test_dex_subscribe.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://py... |
resize_image.py | import argparse
import cv2
import os
from tqdm import tqdm
from queue import Queue
from threading import Thread
# from models.darknet_utils import darknet_resize
def replace_path(path):
return path.replace('images', 'images_resize')
def resize_image(path_queue, image_queue, resize_width, resize_height):
wh... |
algo_three.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.m... |
simulator.py | import config as con
import gates as gt
import construct_circuit as cc
import read_code as rc
import plot_data as pd
import error_handle as eh
import arducom as ad
import subcircuit_definition as sd
import functional_node_sort as fns
import analysis_data as analyd
import time
import thread
import threading
... |
Urban_Pong_Controller.py | #! /usr/bin/python3
# -*- coding: utf-8 -*-
import array
from time import sleep
import datetime
import threading
import Lighting_Controllers
import math
from vector import Vector
import random
import copy
from Resources import Colors, Urban_Pong_Effects
from enum import Enum
from Lighting_Controllers import LIFX
from... |
TCP_server.py | import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print("[*] Listening on %s:%d" % (bind_ip, bind_port))
# this is our client-handling thread
def handle_client(client_socket):
#print... |
test_consumer_group.py | import collections
import logging
import threading
import time
import pytest
import six
from kafka import SimpleClient
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.coordinator.base import MemberState, Generation
from kafka.structs import TopicPartition
from test.c... |
meshposition.py | import serial_topic_json as ser
from time import sleep, perf_counter
import utils as utl
import threading, queue
import logging as log
import sys
import json
import math
from mqtt import mqtt_start
class mpError(Exception):
pass
class UwbTwrArgumentError(mpError):
pass
class UwbNoResponse(mpError):
pass
m... |
tmqa24.py | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('autosave', '180')
get_ipython().run_line_magic('matplotlib', 'inline')
# In[2]:
#import convex as cx
import requests
import time
import itertools as it
import re
#import numpy
from copy import copy
import matplotlib.pyplot as plt
import... |
test_repo_server.py | #!/usr/bin/env python3
import email
import hashlib
import os
import socket
import requests
import tempfile
import threading
import unittest
from contextlib import contextmanager
from typing import Mapping, Tuple
from . import temp_repos
from ..common import Checksum, Path
from ..repo_objects import Repodata, RepoMet... |
case6.py | from __future__ import division
import numpy as np
import math # for math.ceil
import matplotlib.pyplot as plt
from numpy.linalg import norm
from numpy.random import uniform
from scipy.stats import multivariate_normal # for bivariate gaussian -> brownian motion ( normal with mu x(t-1), and variance sigma )
from fil... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
interact.py | from multiprocessing import Process
from sys import flags
import faiss
import sqlite3
import csv
import random
import copy
import numpy as np
import pickle
from Large_Scale_Retriever.retrieve import retrive
import Utils.functions as utils
from Ranker.rank import rank_and_choose
from Generator.generator import generate... |
telegram.py | import json
import requests
from time import sleep
from threading import Thread, Lock
global config
config = {'url': 'https://...............', 'lock': Lock(), 'url_file': 'https://...............'}
def del_update(data):
global config
config['lock'].acquire()
requests.post(config['url'] + 'getUpdate... |
SteamEngines.py | import json
import wptools
import urllib.request
import urllib.parse
import csv
import time
import datetime
import threading
import SteamEngine
### FUNCTIONS
def chunkIt(seq, num):
avg = len(seq) / float(num)
out = []
last = 0.0
while last < len(seq):
out.append(seq[int(last):int(last + avg)]... |
test_connection.py | import unittest
from unittest.mock import Mock, patch
from pika.exceptions import (
ConnectionClosedByBroker,
StreamLostError,
ConnectionWrongStateError
)
from rabbitmq_client import (
RMQConnection,
QueueParams,
ExchangeParams,
QueueBindParams,
ConsumeParams,
DEFAULT_EXCHANGE,
... |
views.py | from django.views.generic import TemplateView
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
#Class Base Demo. Serve home.html
class HomeServe(TemplateView):
template_name = 'home.html'
def get_context... |
broker.py | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
Main.py | # importing main modules
import os, requests, re, threading
import Tags, methods, File_IO as fio
import tkinter as tk, pytube as pt, youtube_dl
# importing needed Objects from Modules
from tkinter import ttk
from PIL import ImageTk, Image
from tkinter.filedialog import askopenfilename
# Defining Window Cons... |
test_events.py | """Tests for events.py."""
import collections.abc
import concurrent.futures
import functools
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
from unitt... |
rpc.py | """ an XML-RPC server to allow remote control of PyMol
Author: Greg Landrum (glandrum@users.sourceforge.net)
Created: January 2002
$LastChangedDate$
License: PyMol
Requires:
- a python xmlrpclib distribution containing the SimpleXMLRPCServer
module (1.0 or greater should be ... |
main.py | from requests import get
from random import choice
import pytesseract as tess
from PIL import Image
from user_agent import generate_navigator
from string import ascii_lowercase
from json import dump, dumps, loads
from os import remove, getcwd
from datetime import datetime
import face_recognition
from time import sleep
... |
perception.py | # USAGE
# python hearing/perception.py __trainingData/audio_name.wav
import pyaudio # Provides Python bindings for PortAudio, the cross platform audio API
import wave # Provides a convenient interface to the WAV sound format
import datetime # Supplies classes for manipulating dates and times in both simple and complex... |
test_dbdict.py | #!/usr/bin/env python
import unittest
from threading import Thread
from requests_cache.backends.storage.dbdict import DbDict, DbPickleDict
from tests.test_custom_dict import BaseCustomDictTestCase
class DbdictTestCase(BaseCustomDictTestCase, unittest.TestCase):
def test_bulk_commit(self):
d = DbDict(self... |
test_process_4.py | from multiprocessing import Process, Lock
def f(l, i):
l.acquire()
try:
print('hello world', i)
finally:
l.release()
if __name__ == '__main__':
lock = Lock()
for num in range(10):
Process(target=f, args=(lock, num)).start() |
test_debug.py | import importlib
import inspect
import os
import re
import sys
import tempfile
import threading
from io import StringIO
from pathlib import Path
from unittest import mock
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from djan... |
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 pickle
import arr... |
HiwinRA605_socket_ros_test_20190626120341.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
led.py | import RPi.GPIO as GPIO
import time
import threading
RED_LED_PIN = 20
YELLOW_LED_PIN = 16
GREEN_LED_PIN = 19
BLUE_LED_PIN = 5
WHITE_LED_PIN = 6
EMITTER_LED_PIN = 26
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
LED_COLLECTION = [RED_LED_PIN, YELLOW_LED_PIN, GREEN_LED_PIN, BLUE_LED_PIN, WHITE_LED_PIN, EMITTER_LED_PIN]... |
run_tests.py | #!/usr/bin/env python
# Copyright 2013 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# -*- coding: utf-8 -*-
import argparse
import sys
import unittest
import os
from multiprocessing import Process
try:
from urllib i... |
dirbustEVERYTHING.py | #!/usr/bin/python
import sys
import os
import subprocess
import errno
import multiprocessing
from multiprocessing import Process
import time
import argparse
#makedir function from https://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
#Compatible with Python >2.5, but there is a more advanced func... |
helpers.py | # -*- coding: utf-8 -*-
'''
: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
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
MailingList.py | #!/usr/bin/env python3
from datetime import datetime
from datetime import timedelta
from os.path import isfile
from queue import Queue
from sys import stderr
from threading import Thread
from time import sleep
from lxml import etree
from Sympal.MailingList_Meta import MailingList_Meta
from Sympal.Subscriber import Su... |
test_consumer_group.py | import collections
import logging
import threading
import time
import pytest
from kafka.vendor import six
from kafka import SimpleClient
from kafka.conn import ConnectionStates
from kafka.consumer.group import KafkaConsumer
from kafka.coordinator.base import MemberState, Generation
from kafka.structs import TopicPart... |
base.py | from threading import Thread
class Renderer:
default_interval = 1/48
def __init__(self, canvas, interval=None, halt=None, **kw):
if halt is not None:
self.is_halted = halt.is_set
self.stop = halt.set
self._thread = Thread(target=self._run)
self.canvas = canv... |
leech_settings.py | # Implement By - @anasty17 (https://github.com/SlamDevs/slam-mirrorbot/commit/d888a1e7237f4633c066f7c2bbfba030b83ad616)
# (c) https://github.com/SlamDevs/slam-mirrorbot
# All rights reserved
import os
import threading
from PIL import Image
from telegram.ext import CommandHandler, CallbackQueryHandler
from telegram im... |
logger_base.py | import logging
import time
import threading
from flask import Response, json, jsonify
from base import python_logging as pl
from base.settings import Settings
from base.exceptions import InvalidUsage
from base.utils import get_real_logger_level
settings = Settings()
class LoggerBase(logging.Logger):
def __init_... |
test_tune_restore.py | # coding: utf-8
import signal
from collections import Counter
import multiprocessing
import os
import shutil
import tempfile
import threading
import time
from typing import List
import unittest
import ray
from ray import tune
from ray._private.test_utils import recursive_fnmatch
from ray.exceptions import RayTaskError... |
buildslave.py | """ A build slave for the program. """
import os.path
import shutil
import subprocess
import threading
import re
import datetime
from distutils.dir_util import remove_tree
from flask import flash
from Anemone import app
PROG_ERROR = re.compile("[Ee]rror")
PROG_SUCCESS = re.compile("Exiting batchmode successfully now!... |
SerialAnalyzerThread.py | """
Copyright (C) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
softw... |
test_etcd3gw.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
sound.py | import os
import pygame
from app.utilities import utils
from app.resources.resources import RESOURCES
from app.engine import engine
import logging
class Song():
def __init__(self, prefab):
self.nid = prefab.nid
self.song = pygame.mixer.Sound(prefab.full_path)
self.battle = pygame.mixer.So... |
oase_apply.py | # Copyright 2019 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
gatt-server.py | #!/usr/bin/env python3
import requests
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service
import uuid
import json
from gatt import *
from helper import Helper
from advertisement import *
from gi.repository import GLib
import sys
import threading
from random import randint
mainloop = None
BLUEZ_SER... |
server.py | import socket
import threading
import time
import subprocess
import sys
class server():
def __init__(self, address, port, n_readers, n_writers, access):
self.address = address
self.port = int(port)
self.n_clients = int(n_readers) + int(n_writers)
self.n_access = ... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "BOT IS ONLINE"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start() |
print_to_sg.py | #!/usr/bin/env python3
# Copyright (c) 2021 Burak Can
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
"""Print to sg Multiline and the terminal"""
import threading
import time
from io import StringIO
import PySimpleGUI as sg
# https://stackoverflow.com/a/6798042/6077951
c... |
parallel_multiple_clients.py | __author__ = 'mpetyx (Michael Petychakis)'
__version__ = "1.0.0"
__maintainer__ = "Michael Petychakis"
__email__ = "hello@apilama.com"
__status__ = "Production"
from client import Client
import threading
from random import randint
from time import sleep
# def print_number(number):
# # Sleeps a random 1 to 10 se... |
WorkloadPatch.py | #!/usr/bin/python
#
# Copyright 2015 Microsoft Corporation
#
# 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... |
main.py | import communication
import threading
import time
import ssl
import base64
import face_recon
import sqlite3
from sqlite3 import Error
from typing import Dict
debug = True
ws = None
report_num = ""
database = "faceStudent.db"
def convertTuple(tup):
str = ''.join(tup)
return str
def create_connection(db_file)... |
ControlsWidget.py | from PySide2 import QtCore, QtGui
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QApplication, QHBoxLayout, QVBoxLayout, QLabel, QWidget, QPushButton, QLineEdit, QToolBar, QToolButton, QMenu, QAction
from binaryninja import execute_on_main_thread_and_wait, BinaryView
from binaryninja.interaction import sho... |
endpoints.py | from flask import jsonify
from . import api, app
import registry
import subprocess
import os
from tempfile import NamedTemporaryFile
import threading
CONSUL_ENDPOINT = app.config.get('CONSUL_ENDPOINT')
registry.connect(CONSUL_ENDPOINT)
@api.route('/clusters/<clusterid>', methods=['POST'])
#@asynchronous
def run_orch... |
client.py | """A semi-synchronous Client for IPython parallel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import collections
from concurrent.futures import Future
import os
import json
from threading import Thread, Event, current_t... |
test_waitable.py | # Copyright 2018 Open Source Robotics Foundation, 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... |
viewsets.py | import threading
import unittest
import uuid
from io import StringIO
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import viewsets, filters
from rest_framework.exceptions import NotFound
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
# L... |
Test.py | from telethon.sync import TelegramClient
from multiprocessing import Process
from binance_listing import BinanceListing
from supertrend import SuperTrend
import local
def run_in_parallel(*fns):
proc = []
for fn in fns:
p = Process(target=fn)
p.start()
proc.append(p)
for p in proc:
... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
from typing import List, Tuple, Union
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASEDIR
from common.params import Params... |
build_pretraining_dataset.py | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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... |
test_app.py | from path import Path
import os, sys
from multiprocessing import Process
import pytest
import pytestqt
import cadquery as cq
from PyQt5.QtCore import Qt, QSettings
from PyQt5.QtWidgets import QFileDialog, QMessageBox, QApplication
from cq_editor.__main__ import MainWindow
from cq_editor.widgets.editor import Editor... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
from typing import List, Tuple, Union
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASEDIR
from common.params import Params... |
test_utils.py | # Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
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... |
tasks.py | import os
import sys
import datetime
import json
import zipfile
import threading
import hashlib
import shutil
import subprocess
import pprint
from invoke import task
import boto3
import platform
import ai2thor.build
from ai2thor.build import PUBLIC_S3_BUCKET, PRIVATE_S3_BUCKET
UNITY_VERSION = "2019.4.2f1"
def add_f... |
bgs_infer_mt.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from pathlib import Path
import os
import sys
import time
from queue import Queue
from threading import Thread
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm
from cova.dnn import infer, metrics
from cova.motion import object_cro... |
thread_timeout.py | import ctypes
import inspect
import threading
from functools import partial
from typing import Any, Callable
from tortfunc.exceptions import FunctionTimeOut
def threaded_timeout(function: Callable[..., Any], timeout: float) -> Callable[..., Any]:
def thread_kill_func(*args, **kwargs):
# First param is gi... |
module_init.py | import subprocess
import threading
from instances import xlog
import os
import sys
import config
import web_control
import time
proc_handler = {}
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath( os.path.join(current_path, os.pardir))
if root_path not in sys.path:
sys.path.ap... |
msg.py | from utlis.rank import setrank ,isrank ,remrank ,setsudos ,remsudos ,setsudo,IDrank,GPranks
from utlis.send import send_msg, BYusers, sendM,Glang,GetLink
from handlers.delete import delete
from utlis.tg import Bot, Ckuser
from handlers.ranks import ranks
from handlers.locks import locks
from handlers.gpcmd import... |
dirfinder.py | from bhp3_class.web import getwords
import queue
import requests
import threading
AGENT = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0"
EXTENSIONS = ['.php', '.bak', '.orig', '.inc']
TARGET = "http://testphp.vulnweb.com"
THREADS = 50
WORDLIST = "/mydownloads/all.txt" # See SVNDIGGER
def exten... |
PythonExecutor.py | #!/usr/bin/env python
"""
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")... |
mitm_attack.py | import sys
import os
import time
import threading
from scapy.all import *
def script_path():
'''set current path, to script path'''
current_path = os.path.realpath(os.path.dirname(sys.argv[0]))
os.chdir(current_path)
return current_path
def get_mac(ip_address):
'''get mac for specified i... |
multithread_dataiter_for_cross_entropy_v1.py | # -*- coding: utf-8 -*-
import random
import math
import threading
import time
import logging
import queue
import cv2
import numpy
from ChasingTrainFramework_GeneralOneClassDetection.image_augmentation.augmentor import Augmentor
from ChasingTrainFramework_GeneralOneClassDetection.data_iterator_base.data_batch import D... |
client.py | from typing import Dict, Optional, Union
import http.client
import logging
import os
import re
import requests
import random
import socket
import ssl
import threading
import time
import webbrowser
from cryptography import x509
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import... |
test_one_day.py | import os
import datetime
import threading
import time
'''
loop对内存的占用率,
1. 进来之后判断hour时间
时间符合,开启
时间符合,已经开启,就不再执行开启动作
2 时间符合关闭,则调用关闭
3 以此循环
day_set 达到24 个 后,要清空数组
'''
cmd_start = './start_mining.sh'
cmd_stop = './stop_mining.sh'
day_set = []
clear_day_set = 0 # 24小时为0
hour = 0
while True:
time.sleep... |
wsdump.py | #!/Users/yalonglee/Documents/GitHub/kubernetes-install/venv/bin/python
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = get... |
mp_tile.py | #!/usr/bin/env python
'''
access satellite map tile database
some functions are based on code from mapUtils.py in gmapcatcher
Andrew Tridgell
May 2012
released under GNU GPL v3 or later
'''
import collections
import errno
import hashlib
import urllib2
import math
import threading
import os
import sys
import string
i... |
progress_tracker.py | # -*- coding: utf-8 -*- #
# Copyright 2013 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 requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.