source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_selenium.py | import threading
import traceback
from time import sleep
from pprint import pprint
import re
import subprocess
from api import mobile_api
#from config import load_django
from selenium import webdriver
from selenium.common.exceptions import (ElementNotVisibleException, WebDriverException,
... |
pccold.py | # coding: utf-8
"""
===================================================
__
_______ ______ ______ _____ | | ___
| __ || ___| | ___| / \ | | ___| |
| ___|| |____ | |____ | o || |... |
LeapRecord.py | import sys
import os
from collections import deque
from threading import Thread
from config.Configuration import env
from resources.LeapSDK.v41_python38 import Leap
from LeapData import LeapData
from resources.pymo.pymo.writers import BVHWriter as Pymo_BVHWriter
# from resources.b3d.bvh_reader import BVH as B3D_BVHRea... |
http_synced_dictionary.py | from threading import Thread
import requests
from queue import SimpleQueue, Empty
from time import sleep
class HttpSyncedDictionary:
"""
Contains a dictionary that can be updated and queried locally.
The updates are sent to a HTTP server, as reply, the current dictionary
known to the HTTP server is ex... |
libevreactor.py | # Copyright 2013-2014 DataStax, 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 writi... |
threaded.py | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
from threading import Thread, Lock, Event
from types import MethodType
from powerline.lib.monotonic import monotonic
from powerline.segments import Segment
class MultiRunnedThread(object):
daemon = Tr... |
multiprocess_oop_dynamic_source_web_server.py | #!/usr/bin/python3
# file: multiprocess_web_server.py
# Created by Guang at 19-7-19
# description:
# *-* coding:utf8 *-*
import multiprocessing
import socket
import re
import time
class WSGIServer(object):
def __init__(self, ip, port):
# 1.创建套接字
self.listen_server = socket.socket(socket.AF_INET,... |
logcat.py | import subprocess
import logging
from .adapter import Adapter
class Logcat(Adapter):
"""
A connection with the target device through logcat.
"""
def __init__(self, device=None):
"""
initialize logcat connection
:param device: a Device instance
"""
self.logger =... |
datasets.py | # Dataset utils and dataloaders
import glob
import logging
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
import torch.nn.functional ... |
loglib.py | import json
import os
import platform
import sys
import threading
import traceback
from copy import deepcopy
from datetime import datetime
from string import lower
class AbstractLog(object):
# AbstractLog provides an ABC for the creation of a concrete Log class
def __init__(self, ToolProjectName, ToolProject... |
analyzer.py | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
import json
import os
import queue
import threading
import time
from collections import defaultdict
from d... |
operator.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import os
import time
import threading
import traceback
import signal
import asyncio
from mephisto.operati... |
peripherals.py | import logging
import math
import traceback
from struct import pack, unpack
from threading import Thread
from pylgbst.messages import MsgHubProperties, MsgPortOutput, MsgPortInputFmtSetupSingle, MsgPortInfoRequest, \
MsgPortModeInfoRequest, MsgPortInfo, MsgPortModeInfo, MsgPortInputFmtSingle
from pylgbst.utilities... |
test_utils.py | from sqlalchemy.test.testing import assert_raises, assert_raises_message
import copy, threading
from sqlalchemy import util, sql, exc
from sqlalchemy.test import TestBase
from sqlalchemy.test.testing import eq_, is_, ne_
from sqlalchemy.test.util import gc_collect, picklers
class OrderedDictTest(TestBase):
def tes... |
tk_receiver.py | from tkinter import *
from basefunction import *
import tkinter.font as font
from tkinter.ttk import *
import threading
import tkinter.scrolledtext as tkst
root = Tk()
root.minsize(width=750,height=400)
root.maxsize(width=750,height=400)
root.title("Receiver Side")
#ser = serial_begin()
def PureText():
mf.pack_fo... |
RAT_Attack.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import ImageGrab # /capture_pc
from shutil import copyfile, copyfileobj, rmtree, move # /ls, /pwd, /cd, /copy, /mv
from sys import argv, path, stdout # console output
from json import loads # reading json from ipinfo.io
from winshell import ... |
sockettest.py | import ssl
import websocket
import random, string, json, threading, time
import login
def on_message(ws, message):
global first
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("socket closed")
def on_open(ws):
print("socket opened ok")
chat = None
def ke... |
test_exchange_types.py | import helper
import logging
import pika
import pytest
import threading
TIMEOUT = 1
class QueueConsumer():
"""
Consume the queue and store the message_number messages.
"""
def __init__(self, queue_name, message_number):
self.connection = helper.connect()
self.channel = self.connection.... |
upnp.py | import logging
import threading
from queue import Queue
from typing import Optional
try:
import miniupnpc
except ImportError:
pass
log = logging.getLogger(__name__)
class UPnP:
thread: Optional[threading.Thread] = None
queue: Queue = Queue()
def __init__(self):
def run():
t... |
assemble.py | '''
TACO: Multi-sample transcriptome assembly from RNA-Seq
'''
import os
import shutil
import logging
from operator import itemgetter
from multiprocessing import Process, JoinableQueue, Value, Lock
from collections import namedtuple
from taco.lib.gtf import GTF
from taco.lib.base import Strand, Results
from taco.lib.b... |
device.py | print("Loaded pi_control device module")
import adafruit_drv2605
import board
import boto3
import busio
import gpiozero
import json
import os
import random
import re
import threading
import time
import pi_control.__init__
"""
2021-12-30 Added debounce, timed checks after debounce, threading on output, canceling thre... |
complicated.py | #!/usr/bin/env python3
'''A lengthy example that shows some more complex uses of finplot:
- control panel in PyQt
- varying indicators, intervals and layout
- toggle dark mode
- price line
- real-time updates via websocket
This example includes dipping in to the internals of finplot and
the u... |
01-thumbnail_converter.py | # Code Listing #1
"""
Thumbnail converter using URLs
"""
import threading
import urllib.request
# Install PILL via Pillow
from PIL import Image
def thumbnail_image(url, size=(64, 64), format='.png'):
""" Convert image to a specific format """
im = Image.open(urllib.request.urlopen(url))
# filename is... |
test_opcua_connector.py | # Copyright 2022. ThingsBoard
# #
# 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 ... |
UI.py | from types import BuiltinMethodType, FunctionType, MethodType
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.anchorlayout import AnchorLayo... |
tkinter_module.py |
import os
import json
import random
import threading as th
from tkinter import *
import tkinter.ttk as ttk
import tkinter.font as tkfont
from utils import *
MAINDIR = os.getcwd()
_DBJSON = './resources/db.json'
_SETTINGSJSON = './resources/settings.json'
class Interface(Tk):
# refresh interface
def re... |
elevator.py | import time
from threading import Thread
from queue import Queue
from collections import deque
# =========
# Constants
# =========
# Directions
UP = 1
DOWN = -1
NONE = 0
# Priorities
INSIDE = 1
OUTSIDE = 0
# ==========
# Exceptions
# ==========
class WrongActionError(Exception):
"""
Исключение, поднимающее... |
process_based_workers.py | from datetime import datetime
from typing import Union
from multiprocessing import current_process, Process, Queue
from playground.parallel.fibonacci import fibonacci
WorkData = Union[int, str]
ResultData = str
_EXIT_FLAG = "__EXIT__"
# noinspection DuplicatedCode
def _main():
work_queue: Queue[WorkData] = Queu... |
android_data_analyzer_geodata.py | import os
import logging
from modules.andForensics.modules.utils.android_sqlite3 import SQLite3
from modules.andForensics.modules.analyzer.android_data_analyzer_utils import AnalyzerUtils
from multiprocessing import Process, Queue, Lock
import multiprocessing
import math
logger = logging.getLogger('andForensics')
#ANA... |
utils.py | # python3
# Copyright 2018 DeepMind Technologies 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.org/licenses/LICENSE-2.0
#
# Unless re... |
main.py | #!/usr/bin/env python
import requests
import tqdm
import jiosaavn
import os
from mutagen.mp4 import MP4, MP4Cover
import threading
download_path = "D:\Songs\Songs" #Provide download path here
def dwnld_sng(song_dwn_url, song_title):
with requests.get(song_dwn_url, stream=True) as r, open("{}/{}.m4a".format(downlo... |
test_data.py | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for coverage.data"""
import glob
import os
import os.path
import re
import sqlite3
import threading
import mock
import pytest
from coverage.data import ... |
Genetics.py | import pickle
from abc import ABC, abstractmethod
from random import randint, choices, choice
import multiprocessing
import sys
import os
# for macOS only
if sys.platform == 'darwin':
multiprocessing.set_start_method('fork')
from multiprocessing import Process, cpu_count, Manager
import click
import numpy as np
i... |
cli.py | import signal
from datetime import datetime
from threading import Thread
from typing import Any, Callable
from urllib.request import Request, urlopen
from wsgiref.simple_server import make_server
import click
from sqlalchemy import select
from sqlalchemy.exc import SQLAlchemyError
from offstream import db
from offstr... |
StoreHistoricalData.py | # Copyright (C) 2021 LYNX B.V. All rights reserved.
# Import ibapi deps
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import *
import threading
import time
import pandas
class App(EWrapper, EClient):
def __init__(self, ipaddress, portid, clientid):
EClient.__init... |
worker_K10CR1.py | from worker import Worker
import threading
from K10CR1.k10cr1 import K10CR1
class WK10CR1(Worker):
type = 'K10CR1'
def setup(self):
# setup motor
self.ser_num = self.config.get('CHANNEL{}'.format(self.channel), 'Address')
self.motor = K10CR1(self.ser_num)
# setup thread for ac... |
serialtowifi.py | import serial
import time
import threading
import requests
import json
class SerialPortManager:
def __init__(self):
self.port = serial.Serial('/dev/ttyMCC',115200,timeout=1)
def write(self, message):
print("Writing data to serial port: " + message)
self.port.write(message)
... |
test_cymj.py | import pytest
from numbers import Number
from io import BytesIO, StringIO
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from mujoco_py import (MjSim, MjSimPool, load_model_from_xml,
load_model_from_path, MjSimState,
ignore_mujoco... |
test_file_ats.py | import pytest
import os
import socket
import tftpy
import threading
import getpass
from pynetworking.Device import Device
def tftp_make_dir(tftp_client_dir, tftp_server_dir):
if (os.path.exists(tftp_client_dir) is False):
os.mkdir(tftp_client_dir)
if (os.path.exists(tftp_server_dir) is False):
... |
dataset.py | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""The :class:`StreamingDataset` class, used for building streaming iterable datasets.
"""
import math
import os
from threading import Lock, Thread
from time import sleep
from typing import Any, Callable, Dict, Iterator, Optional
import... |
x11.py | # Copyright (C) 2014-2016 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
"""Utility functions dealing with X servers.
"""
from __future__ import division, print_function, unicode_literals
import contextlib
import loggin... |
tradeLogger.py | import atexit
import time
import sqlite3
import logging
from alice_blue import *
import json
import datetime
from numpy.lib import utils
from src.systemutils import util
import os
from pathlib import Path
from threading import Thread
from sqlalchemy import create_engine, pool
import pandas as pd
from src.systemutils i... |
main.py | import tensorflow as tf
from data_generator import DataGenerator
from models import Model
import os,sys
import time
from mlperf_logging import mllog
from threading import Thread
###### npu ######
from npu_bridge.estimator import npu_ops
from tensorflow.core.protobuf.rewriter_config_pb2 import RewriterConfig
from npu_b... |
main.py | from pydub import AudioSegment
from pydub.playback import play
import sys
import time
from progress.bar import IncrementalBar
argv2 = sys.argv
argv2.pop(0)
if len(argv2) == 0:
print("Usage: " + "<command>" + " (file names)" + " [no-progressbar]")
sys.exit(1)
progressEnabled = True
if "--no-progress... |
test_parallel.py | """
Test the parallel module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2010-2011 Gael Varoquaux
# License: BSD Style, 3 clauses.
import os
import sys
import time
import mmap
import threading
from traceback import format_exception
from math import sqrt
from time import sl... |
timeout_iterator.py | import queue
import threading
class TimeoutIterator:
"""
Wrapper class to add timeout feature to synchronous iterators
- timeout: initial default timeout
- sentinel: the object returned by iterator when timeout happens
- reset_on_next: if set to True, timeout is reset to the value of ZERO_TIMEOUT o... |
standalone.py | """Standalone Authenticator."""
import argparse
import collections
import logging
import socket
import threading
import OpenSSL
import six
import zope.interface
from acme import challenges
from acme import standalone as acme_standalone
from letsencrypt import errors
from letsencrypt import interfaces
from letsencry... |
pre_commit_linter.py | # coding: utf-8
#
# Copyright 2014 The Oppia 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... |
helpers.py | """Supporting functions for polydata and grid objects."""
import collections.abc
import enum
import logging
import os
import signal
import sys
import threading
from threading import Thread
import traceback
from typing import Optional
import warnings
import numpy as np
import pyvista
from pyvista import _vtk
from pyv... |
torbenContigFilterServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
slp_graph_search.py | """
SLP Graph Search Client
Performs a background search and batch download of graph
transactions from a Graph Search server. For more information about
a Graph Search server see:
* gs++: https://github.com/blockparty-sh/cpp_slp_graph_search
* bchd: https://github.com/simpleledgerinc/bchd/tree/graphsearch
This class... |
test_gc.py | zaimportuj unittest
z test.support zaimportuj (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
temp_dir)
z test.support.script_helper zaimportuj assert_python_ok, make_script
zaimportuj sys
zaimportuj time
zaimportuj gc
zai... |
ssh.py | import socket
import datetime
import sys
import ipaddress
import threading
import os
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[1;94m', '\033[1;91m', '\33[1;97m', '\33[1;93m', '\033[1;35m', '\033[1;32m', '\033[0m'
class ThreadManager(object):
i = 0
def __init__(self, ipList):
self.allIps = ... |
__init__.py | from flask import Flask
from werkzeug.contrib.fixers import ProxyFix
from flask_cors import CORS
from watchdog.observers import Observer
from functools import wraps
from .image_folder import ImageFolderHandler
from .api import blueprint as api
from .config import Config
from .models import db, ImageModel
import threa... |
Timer.py | from threading import Thread
import time
def timer(name, delay, repeat):
print("Timer: " + name + " Started")
while repeat > 0:
time.sleep(delay)
print(name + ": " + str(time.ctime(time.time())))
repeat -= 1
print("Timer: " + name + " Completed")
def Main():
t1 = Thread(targe... |
functional_tests.py | #!/usr/bin/env python
import os
import sys
import shutil
import tempfile
import re
import string
import multiprocessing
import unittest
import time
import sys
import threading
import random
import httplib
import socket
import urllib
import atexit
import logging
import os
import sys
import tempfile
# Assume we are run... |
trezor.py | from binascii import hexlify, unhexlify
from typing import NamedTuple, Any
from electrum_smart.util import bfh, bh2u, versiontuple, print_error
from electrum_smart.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum_smart import constants
fro... |
spark_common.py | # Copyright 2019 Uber Technologies, 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 applica... |
scanner.py | import socket
import os
import struct
import threading
from netaddr import IPNetwork,IPAddress
from ctypes import *
# host to listen on
host = "192.168.0.187"
# subnet to target
subnet = "192.168.0.0/24"
# magic we'll check ICMP responses for
magic_message = "PYTHONRULES!"
def udp_sender(subnet,... |
interface.py | #Qt5
from PyQt5.QtWidgets import (QWidget, QSlider, QGridLayout, QLayout, QPushButton, QStackedWidget,
QLabel, QComboBox, QApplication, QTabWidget, QVBoxLayout, QLineEdit)
from PyQt5.Qt3DExtras import Qt3DWindow
from PyQt5 import QtCore, Qt, QtGui
from PyQt5.QtGui import QPixmap, QIcon
#system
import sys
import os... |
Interface.py | '''
Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com>
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,
m... |
announce.py | # Copyright 2019 The Cloud Robotics 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 applicable law or agreed... |
crawler_sample_thread.py | import threading
import Queue
import time
def get_page(page):
print 'downloading page %s' % page
time.sleep(0.5)
return g.get(page, [])
def get_all_links(content):
return content
def working():
while True:
page = q.get()
## if varLock.acquire():
if page not in crawled:
## ... |
lambda_executors.py | import os
import re
import json
import time
import logging
import threading
import subprocess
# from datetime import datetime
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
# for Python 2.7
from pipes import quote as cmd_quote
from localstack import ... |
cmdui_example.py | import sys
sys.path.insert(0,'..')
import threading
import time
import CMDUI as CMD
def counter():
btn_txt.set("Stop")
tt = time.time()
while running:
t = f"{time.time()-tt:.2f}"
txt.set(t)
time.sleep(0.01)
btn_txt.set("Reset")
def stopwatch():
if btn_txt.get() =... |
test_lowlevel.py | import datetime
import unittest
import threading
from opentracing.mocktracer import MockTracer
from mock import patch
from elasticsearch import Elasticsearch
from elasticsearch_opentracing import TracingTransport, init_tracing, \
enable_tracing, disable_tracing, set_active_span, get_active_span, _clear_tracing_st... |
bme280.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import smbus
import time
import datetime
import threading
ADDRESS = 0x76 # 7bit address (will be left shifted to add the read write bit)
READ_INT = 2 # [sec]
LOG_INT = 600 # [sec]
DEBUG = True
# Print a given message with the date
def print_date_msg(msg):
d = datetime.... |
all.py | from utlis.rank import setrank,isrank,remrank,remsudos,setsudo, GPranks,IDrank
from utlis.send import send_msg, BYusers, GetLink,Name,Glang,getAge
from utlis.locks import st,getOR
from utlis.tg import Bot
from config import *
from pyrogram.types import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardBut... |
VideoStream.py | # pylint: disable=F0401, E1101, E0611
import sys
import cv2
import logging
import time
import numpy as np
from threading import Thread
from queue import Queue
from config import CaptureDeviceState
#This class reads all the video frames in a separate thread and always has the keeps only the latest frame in its queue to... |
pretrained.py | import sparknlp.internal as _internal
import sys
import threading
import time
from pyspark.ml.wrapper import JavaModel
from pyspark.sql import DataFrame
from sparknlp.annotator import *
from sparknlp.base import LightPipeline
def printProgress(stop):
states = [' | ', ' / ', ' — ', ' \\ ']
nextc = 0
while ... |
ort_eps_test.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import unittest
import torch
import onnxruntime_pybind11_state as torch_ort
import os
import sys
def is_windows():
return sys.platform.startswith("win")
from io import StringIO
import sys
import threading
import time
c... |
cleanup.py | """
sentry.runner.commands.cleanup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import os
from datetime import timedelta
from uuid import uuid4
import click... |
lists_threading.py | from threading import Thread
import time
x = 0
nums = []
def adding():
x=0
while True:
nums.append(x)
x += 1
print nums
def checking(num):
if num > 99:
print 'yay', num
time.sleep(5)
def Main():
t1 = Thread(target=adding)
t1.daemon = True
t1.start()
... |
opencv.py | from Detection.MtcnnDetector import MtcnnDetector
from Detection.detector import Detector
from Detection.fcn_detector import FcnDetector
from train_models.mtcnn_model import P_Net, R_Net, O_Net
import numpy as np
import cv2
import scipy.misc
from scipy.stats.mstats import hmean
from sklearn.decomposition import PCA
fro... |
VNetSubsystem.py | #==================================================
import multiprocessing
from scapy.all import *
from sys import path
path.insert(0, 'VNSTools/')
from L2SocketTool import L2SocketTool
from L2SocketFNSHTool import L2SocketFNSHTool
#============== VNS SUBCLASS ==============
class VNSInstance:
vnsiTool = None
vns... |
test_collection.py | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from... |
visualizer.py | import math
import sys
import numpy as np
import threading
import open3d as o3d
from open3d.visualization import gui
from open3d.visualization import rendering
from collections import deque
from .boundingbox import *
from .colormap import *
from .labellut import *
import time
class Model:
"""The class that helps... |
pcap_dummy.py | import json
import urllib.request
import logging
import os.path
from collections import deque
from functools import partial
from time import sleep, time
from threading import Thread
from scapy.all import sniff, Packet, TCPSession, conf, load_layer
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, TCP
... |
controllers.py | from app.api import bp
from app import db
from app.api.errors import bad_request
from app.models import Video, Description, Comment, Caption, Server_Controller, Admin
from app.YouTubeAPICalls import search_videos_list, get_video_stats, get_comment_threads
from app.videoCaptions import get_video_captions
from app.api.au... |
conftest.py | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2011 Anshuman Bhaduri
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014-2015 Tycho Andersen
#
# 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 Soft... |
io.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... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
gen_pyxtal.py | '''
Random structure generation using PyXtal(https://github.com/qzhu2017/PyXtal)
'''
from multiprocessing import Process, Queue
import os
import random
import sys
import numpy as np
from pymatgen.core import Structure, Molecule
from pymatgen.core.periodic_table import DummySpecie
from pyxtal import pyxtal
from pyxtal... |
wsgi_example.py | #!/usr/bin/env python
# Copyright 2011 TellApart, 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 ... |
tracker.py | """RPC Tracker, tracks and distributes the TVM RPC resources.
This folder implemements the tracker server logic.
Note
----
Tracker is a TCP based rest api with the following protocol:
- Initial handshake to the peer
- RPC_TRACKER_MAGIC
- Normal message: [size(int32), json-data]
- Each message is initiated by the cl... |
test4.py | import tkinter as tk
from tkinter import filedialog
import tkinter.ttk as ttk
import vlc
import pafy
import re
import requests
import threading
import pprint
import time
import datetime
import sqlite3
class Application(tk.Frame):
def __init__(self):
super().__init__()
self.ini... |
harness.py | """
This is a test harness for profiling DNN training scripts
to answer what-if questions on data stalls during training.
**How does this framework work?:**
This framework profiles the workload and collects statistics such as
1. Avg per-iteration time ( MAX INGESTION RATE of the model)
2. Avg per-iteration p... |
linkcheck.py | # -*- coding: utf-8 -*-
"""
sphinx.builders.linkcheck
~~~~~~~~~~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import queue
import re
import socket
import threading
from html.parser ... |
hapod.py | # This file is part of the pyMOR project (https://www.pymor.org).
# Copyright 2013-2021 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import asyncio
from collections import defaultdict
from math import ceil
import numpy as np
from... |
dual_tor_io.py | import datetime
import threading
import time
import socket
import random
import struct
import ipaddress
import logging
import json
import scapy.all as scapyall
import ptf.testutils as testutils
from operator import itemgetter
from itertools import groupby
from tests.common.utilities import InterruptableThread
from nat... |
mullvad.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests, time, os, sys
from Queue import Queue
from authModule import auth
import threading
import click
from random import randint
queue = Queue()
print_lock = threading.Lock()
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings... |
test_streaming_pull_manager.py | # Copyright 2018, Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
system_class.py | import json
from multiprocessing import Process
from datetime import datetime
from system.using_database import ADD_IN_DATABASE_ROW_EMAIL
class MainData:
def add_in_db(self) -> dict:
p = Process(target=ADD_IN_DATABASE_ROW_EMAIL, args=(json.dumps(self.__dict__),))
p.start()
def count_time(sel... |
noasync.py | import asyncio
from .high_level.dataflow import run as high_level_run
from .high_level.source import save as high_level_save, load as high_level_load
from .high_level.ml import (
train as high_level_train,
score as high_level_score,
predict as high_level_predict,
)
def train(*args, **kwargs):
return ... |
TelloFramework.py | import threading
from .TelloAPI import Tello
class Subject(object):
def __init__(self):
self.observers = {}
def register_observer(self, key, observer):
if key not in self.observers:
self.observers[key] = []
self.observers[key].append(observer)
def notify_observes(sel... |
modified_pyhop.py | """
Pyhop, version 1.2.1 -- a simple SHOP-like planner written in Python.
Author: Dana S. Nau, 15 February 2013
Copyright 2013 Dana S. Nau - http://www.cs.umd.edu/~nau
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... |
square_it.py | from multiprocessing import Process, active_children
import shared_tuple_list as stl
from time import time
def slave(id, data, result, idx, steps):
print('slave ', id, ' started: ', idx, '->', steps)
data_in = stl.SharedTupleList.create_by_ref(data)
data_out = stl.SharedTupleList.create_by_ref(result)
... |
poll.py |
from __future__ import print_function
import os
import signal
import threading
import subprocess
import re
import traceback
import datetime
from ExpStat import *
"""
TODO: use pyinotify (a Python interface to the Linux inotify library), available
from github.com/seb-m/pyinotify to get asynchronous notification... |
fiduciary_follow.py | # Copyright (c) 2021 Boston Dynamics, Inc. All rights reserved.
#
# Downloading, reproducing, distributing or otherwise using the SDK Software
# is subject to the terms and conditions of the Boston Dynamics Software
# Development Kit License (20191101-BDSDK-SL).
# Git hub page -- https://github.com/boston-dynamics/spo... |
main.py | import httpserver
import task
import FifoQueue
import threading
import queue
taskqueue = FifoQueue.Queue()
workqueue = FifoQueue.Queue()
outqueue = FifoQueue.Queue(maxsize=10)
httpthread=threading.Thread(target=httpserver.runhttp, args=(taskqueue,workqueue,outqueue,))
httpthread.start()
taskthread=threading.Thread(t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.