source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
client.py | from socket import socket, AF_INET, SOCK_STREAM
from threading import Thread, Lock
import time
class Client:
"""
Server ile iletişimi sağlar.
"""
# GLOBAL CONSTANTS
HOST = "localhost"
PORT = 5500
BUFSIZE = 512
ADDR = (HOST, PORT)
def __init__(self, name):
"... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import test_support
import asyncore
import socket
import select
import time
import gc
import os
import errno
import pprint
import urllib, urlparse
import traceback
import weakref
import functools
import platform
from BaseHTTPServer import HTT... |
__init__.py | from threading import Thread
try:
# Python 3 modules
from http.server import SimpleHTTPRequestHandler, HTTPServer
from urllib.parse import urlencode
import urllib.parse as urlparse
except ImportError:
# Python 2 modules
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServe... |
quantize_pvalite-CLN3.py | #!/usr/bin/env python
# --------------------------------------------------------
# Quantize Fast R-CNN based Network
# Written by Chia-Chi Tsai
# --------------------------------------------------------
"""Quantize a Fast R-CNN network on an image database."""
import os
os.environ['GLOG_minloglevel'] = '2'
import _... |
regular_interface_update.py | from common_tasks import Grab_device_interfaces_snmp, get_data, set_data_mysql
from SNMPPoll import SnmpPoll as snmppoll
from Classes import ToolLog
def Device_interfaces_update():
"""
Author - Jonathan Steward
Function - Workflow function
Inputs - n/a
returns -
int - updates - ... |
atrace_agent.py | # Copyright (c) 2015 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 re
import py_utils
import subprocess
import sys
import threading
import zlib
from devil.android import device_utils
from py_trace_event import tr... |
simpleattt.py | #!/usr/bin/env python3
import subprocess
import os.path
import sys
import fnmatch
import filecmp
import argparse
import textwrap
import signal
import tigergui
from multiprocessing import Pool
from multiprocessing import Process
class bcolors :
INFO = '\033[95m'
INFO_LOW = '\033[94m'
SUCCES = '\033[92m'
WARNING = ... |
iterators.py | import multiprocessing
import random
import sys
import queue
import threading
import traceback
from typing import Any, TypeVar, Iterable, Iterator, List, Callable, Optional, Union, Tuple
T = TypeVar('T')
__all__ = ['ThreadedIterator', 'MultiWorkerCallableIterator', 'BufferedIterator', 'DoubleBufferedIterato... |
calsoft.py | import os
import time
import sys
import subprocess
import threading
import json
CALSOFT_BIN_PATH = "/usr/local/calsoft/iscsi-pcts-v1.5/bin"
'''
11/26/2015 disable tc_login_11_2 and tc_login_11_4
RFC 7143 6.3
Neither the initiator nor the target should attempt to declare or
negotiate a parameter more than once during ... |
keys.py | # Code by Daniel Kukiela (https://twitter.com/daniel_kukiela)
# downloaded from https://github.com/Sentdex/pygta5/blob/master/keys.py
import ctypes
from threading import Thread
from time import time, sleep
from queue import Queue
# main keys class
class Keys(object):
common = None
standalone = False
# ... |
demo_mp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import _init_paths
import caffe
import cv2
import numpy as np
from python_wrapper import *
import os
from multiprocessing import Process, Queue
from timeit import default_timer as timer
from time import sleep
def bbreg(boundingbox, reg):
reg = reg.T
# calibr... |
client.py | import collections
import json
import logging
import time
import typing
import weakref
from enum import Enum
from threading import Thread
from typing import Dict, Iterable, Optional, Tuple, Union
from .credentials import CertificateCredentials, Credentials
from .errors import ConnectionFailed, exception_class_for_reas... |
example_um7_latest_measurement_share_uart.py | #!/usr/bin/env python3
# Author: Dr. Konstantin Selyunin
# License: MIT
# Date: 28 March 2021
# NOTE: this only works with python3.8+ !
# Modified: 08 December 2021
import json
import logging
from pathlib import Path
import sys
from rsl_comm_py.um7_serial import UM7Serial
from rsl_comm_py.um7_broadcast_packets import... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import http.client
import logging
import os
import random
import re
import shlex
import shutil
import signal
import socket
import string
import subprocess
import sys
import tempfile
import threading
import time
from typing import Optional
from urllib.parse import u... |
test_collection_count.py | import pdb
import pytest
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
from milvus import IndexType, MetricType
from utils import *
dim = 128
index_file_size = 10
add_time_interval = 3
tag = "1970-01-01"
nb = 6000
class TestCollectionCount:
"""
par... |
main.py | from time import sleep
import ingestion
import snowflake.connector
import os
import json
from ddlgenerator.ddlgenerator import Table
import re
import multiprocessing
environmentVariables='config/envVar.json'
ev={"controlTable":"","cur":""}
def executeMultiQuery(queries):
cur=ev["cur"]
dbObjCur=cur
for i in... |
__init__.py | import contextlib
import datetime
import errno
import functools
import inspect
import os
import re
import signal
import socket
import subprocess
import sys
import tempfile
import threading
from collections import namedtuple
from enum import Enum
from warnings import warn
import six
import yaml
from six.moves import co... |
serve.py | import socket
import re
import threading
from k_load.extractors import Bilibili
class DownloadSite:
'''
A website for downloading Bilibili videos.
'''
def _establish_socket(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM,0)
self.sock.bind(('0.0.0.0', 80))
... |
nightcrawler.py | #!/usr/bin/env python
# Nightcrawler - a web site offensive crawler
# https://www.freecodecamp.org/news/how-to-build-a-url-crawler-to-map-a-website-using-python-6a287be1da11/
# https://github.com/ahadsheriff/map-website/blob/master/map_website.py
import warnings
import requests.exceptions
import requests
import argp... |
asymmetric.py | #!/usr/bin/python3
#
# run iperf to measure the effective throughput between two nodes when
# n nodes are connected to a virtual wlan; run test for testsec
# and repeat for minnodes <= n <= maxnodes with a step size of
# nodestep
import threading, sys, time, random, os, traceback, playsound,json
import rest, socket
im... |
sim-axelrod-parallel.py | #!/usr/bin/env python
# Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
"""
Description here
"""
import logging as log
import ming
import argparse
import time
import itertools
import co... |
porn.py | import threading
import requests
from queue import Queue
from threading import Thread,Lock
import re
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
}
lock = Lock()
def get_pic(in_q):
while in_q.empty() is not True:
... |
learn.py | #!/usr/bin/python3
import io
import csv
import json
import warnings
import pickle
import operator
import time
import logging
import math
import functools
import numpy
from sklearn.preprocessing import MinMaxScaler
from threading import Thread
from random import shuffle
from sklearn.neural_network import MLPClassifier
... |
__init__.py | '''
Set up the Salt integration test suite
'''
# Import Python libs
import optparse
import multiprocessing
import os
import sys
import shutil
import pprint
import tempfile
import logging
import time
import signal
import subprocess
from hashlib import md5
from subprocess import PIPE, Popen
from datetime import datetime... |
telemetry.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... |
__init__.py | from abc import ABC, abstractmethod
from hashlib import md5
import io
from itertools import chain
import logging as lg
from pathlib import Path
import re
from subprocess import run, PIPE, STDOUT, Popen
from threading import Lock, Thread
from typing import * # noqa
from IPython.display import display
from ipywidgets i... |
_speech_a3__allinone.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import queue
import threading
import subprocess
import datetime
import time
import codecs
import glob
import platform
qOS = platform.system().lower() #windows,darwin,linux
print(os.path.dirname(__file__))
print(os.path.basename(__file__... |
queue_process.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# Author: He Ye (Alex)
# Date: 2019-11-13
import argparse
import cv2
import time
from multiprocessing import Process, Queue
VDEV = "/dev/video0"
def showVideoInfo(vhandle):
try:
fps = vhandle.get(cv2.CAP_PROP_FPS)
#count = vhandle.get(cv2.CAP_PROP_FRAM... |
screen_diff.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
_channel.py | # Copyright 2016 gRPC 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 to in writing... |
server.py | """RPC server implementation.
Note
----
Server is TCP based with the following protocol:
- Initial handshake to the peer
- [RPC_MAGIC, keysize(int32), key-bytes]
- The key is in format
- {server|client}:device-type[:random-key] [-timeout=timeout]
"""
# pylint: disable=invalid-name
from __future__ import absolute... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
hotswap.py | #!/usr/bin/env python
"""Automatic replacement of imported Python modules.
The hotswap module watches the source files of imported modules which are
replaced by its new version when the respective source files change.
The need for a program restart during development of long-running programs
like GUI applicati... |
build_imagenet_data.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
like_hashtag.py | # -*- coding: utf-8 -*-
import random
import sys
import sys
sys.path.insert(0, "/home/stefanopoma97/bot//insta-bot1")
from glob import glob
import schedule
from instabot import Bot, utils
import os
import sys
import threading
import time
import config_file
from sys import argv
sys.path.append(os.path.join(sys.path[0],... |
test_ipc.py | import abc
import itertools
import multiprocessing
import sys
import textwrap
import time
import traceback
from typing import Any, List, Optional, cast
import pytest
import determined as det
from determined import core, ipc
from tests import parallel
class Subproc(multiprocessing.Process):
"""
Subproc execu... |
standalone.py | """Support for standalone client challenge solvers. """
import collections
import functools
import http.client as http_client
import http.server as BaseHTTPServer
import logging
import socket
import socketserver
import threading
from typing import Any
from typing import cast
from typing import List
from typing import M... |
test_channels.py | """Tests for payment channel functionality."""
import time
import codecs
import pytest
import collections
import multiprocessing
import two1.bitcoin.utils as utils
from two1.bitcoin import Script, Hash
from two1.bitcoin import PrivateKey
from two1.bitcoin import Transaction, TransactionInput, TransactionOutput
from tw... |
test_logging.py | from __future__ import division
import errno
import logging
import threading
import av.error
import av.logging
from .common import TestCase
def do_log(message):
av.logging.log(av.logging.INFO, 'test', message)
class TestLogging(TestCase):
def test_adapt_level(self):
self.assertEqual(
... |
test_aws_quantum_task.py | # Copyright Amazon.com Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompany... |
PC_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin PC Miner (v1.5)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © revox, MrKris7100 2020
##########################################
import socket, statistics, threading, time, random, re, subprocess, hash... |
FfmEncoder.py | import hashlib, math, os, subprocess
from multiprocessing import Process
def hashstr(str, nr_bins=1e+6):
return int(hashlib.md5(str.encode('utf8')).hexdigest(), 16) % (int(nr_bins) - 1) + 1
class FfmEncoder():
def __init__(self, field_names, nthread=1):
self.field_names = field_names
self.nt... |
keys.py | # Code by Daniel Kukiela (https://twitter.com/daniel_kukiela)
import ctypes
from threading import Thread
from time import time, sleep
from queue import Queue
# main keys class
class Keys(object):
common = None
standalone = False
# instance of worker class
keys_worker = None
keys_process = None
... |
smb.py | import socket
import struct
import sys
import util
from threading import Thread
from service import Service
class smb(Service):
def __init__(self):
super(smb, self).__init__('SMB Service')
self.config['port'].value = 445
self.captured_hashes = {}
self.info = """
... |
player.py | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz 2021-present CuzImSyntax
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 u... |
app.py | from flask import Flask, render_template, request, jsonify
from datetime import datetime
from pytz import timezone
from connector import facebook
import my_crypto
import atexit
import cf_deployment_tracker
import os
import json
import threading
# Emit Bluemix deployment event
cf_deployment_tracker.track()
app = Flask... |
chord_node.py | """
CPSC 5520, Seattle University
:Authors: Fariha Zainab
:Version: f19-02
:Assignment: Lab4 - DHT-CHORD
"""
"""
Start the chord_node by giving the port no. 0 to start the network
The node will print it's finger table, its address and predecessor.
When the next node joins the network, it can take the port no. ... |
api_server.py | # ------------------------------------------------------------------------------
# name : api_server.js
# author : Noe Flatreaud (Retr0)
# description:
# simple API server for the IHC-controller project
# it provide an API url as well as a basic dashboard so you can
# use it every were by using the web browser.
#... |
request_manager.py | """
This module implements the request manager functionality.
Job Queue and Processing
^^^^^^^^^^^^^^^^^^^^^^^^
As requests are issued via http to the API a process queue will store all
active jobs. Processes will be created and assume one of the following
states throughout their existence: ::... |
neo.py | import contextlib
import os
import queue
import sublime
import sys
import threading
import time
import traceback
from .lib import neovim
from .lib import util
from . import settings
from .screen import Screen
# os.environ['NVIM_LOG_FILE'] = '/Users/aegis/.nvimlog'
if not '_loaded' in globals():
NEOVIM_PATH = Non... |
serialcommunication.py | __author__ = 'OSAMA'
# This file tests serial communication with Arduino UNO
# when sending a message of data very quickly; Also,
# examine the initialization flag.
# Imports
import serial
import time
import threading
import socket
def main():
# All the main code resides here.
def read():
try:
... |
usb_camera_demo.py | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... |
main.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import json
import logging
import os
import threading
import time
from queue import Queue
import mlperf_loadgen as lg
import numpy as np
import dat... |
httpd.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2017 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import BaseHTTPServer
import cStringIO
import datetime
import httplib
import glob
import gzip
import hashlib
import io
import json
import mimetypes
import os
import re
import socket
import ... |
camera_opencv.py | import os
import cv2
from base_camera import BaseCamera
import face_recognition
import numpy as np
import glob
import time
import threading
from os.path import basename, splitext
from base64 import b64decode, b64encode
class Camera(BaseCamera):
video_source = "0"
known_face_encodings = []
known_face_names... |
jobs.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
main.py | import argparse
import copy
import random
import sys
import threading
import time
import numpy as np
import tensorflow.keras as ks
import loguru
import json
import pygame
from pygame import K_DOWN, K_LEFT, K_UP, K_RIGHT, K_KP_ENTER
import colors
from piece import Piece
from board import Board, PIECE_FACTORIES
from da... |
process_demo.py | from multiprocessing import Process
import os
def factorial(n):
if n == 0 or n == 1:
return 1
else:
return n * factorial(n-1)
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def f(name):
... |
Confirm.py | from binascii import Error as b64Error
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from base64 import urlsafe_b64decode, urlsafe_b64encode
from smtplib import SMTP
from threading import Thread
from django.conf import settings
from django.template.loader import render_to_string
f... |
troubleshooting.py | #
# Copyright 2020 by 0x7c2, Simon Brecht.
# All rights reserved.
# This file is part of the Report/Analytic Tool - CPme,
# and is released under the "Apache License 2.0". Please see the LICENSE
# file that should have been included as part of this package.
#
from subprocess import Popen, PIPE, STDOUT
import logme
imp... |
stress.py | from multiprocessing import Queue, Process
#from Queue import Queue
#from threading import Thread as Process
from cattle import from_env
import time
URL = 'http://mgmt1:8080/v1/schemas'
queue = Queue()
client = from_env(url=URL)
start = time.time()
def progress():
done_count = 0
error_count = 0
while T... |
ethernet_provider.py | import os
import struct
import time
import json
import datetime
import threading
import math
import re
import struct
from ..widgets import (NTRIPClient, EthernetDataLogger,
EthernetDebugDataLogger, EthernetRTCMDataLogger)
from ...framework.utils import (helper, resource)
from ...framework.context... |
bullet.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define the Bullet Simulator API.
This is the main interface that communicates with the PyBullet simulator [1]. By defining this interface, it allows to
decouple the PyRoboLearn framework from the simulator. It also converts some data types to the ones required by
PyBull... |
ChessMonitorClient.py | import threading
from client.UDPClient import UDPClient
from client.msg_parser import parse_cmd
class ChessMonitorClient(UDPClient):
def __init__(self, chess_board, server_addr=("localhost", 9998)):
super().__init__()
self.client_thread = threading.Thread(target=self.__recv_loop)
self.cli... |
m_client.py | '''
## MESSAGING CLIENT 1.0
##
## This is a simple client side app that connects to the messaging server and provides End to End Encryption
## All messages tranfered between clients is indecipherable to all except communicating parties
## Users can register for accounts with the chosen server.
## You can also tr... |
rebuild_future.py | # encoding: UTF-8
import os
import copy
import csv
import signal
import traceback
from datetime import datetime, timedelta
from queue import Queue
from time import sleep
from threading import Thread
from vnpy.data.mongo.mongo_data import MongoData
from vnpy.data.tdx.tdx_common import FakeStrategy, get_future_contrac... |
prune.py | import gym
from model import DQNPacman, PacmanTargetNet, StudentPacman
from configs import DensePacmanAgentConfig as dense_config
from configs import PrunePacmanAgentConfig as prune_config
from configs import StudentPacmanConfig as student_config
from Pacman.evaluate import evaluate
from utils.Memory import ExperienceR... |
mutipleprocessing.py | import os
print('process (%s) start...' % os.getpid())
pid = os.fork() # fork 子进程永远返回0,而父进程返回子进程的ID。
if pid == 0:
print('I am child process (%s) and my parent is %s.' % (os.getpid(), os.getppid()))
else:
print('I (%s) just created a child process (%s).' % (os.getpid(), pid))
# 如果你打算编写多进程的服务程序,Unix/Linux无疑是正确的选择... |
figshareSubmission.py | __author__ = 'felix.shaw@tgac.ac.uk - 03/05/2016'
import json
import requests
import os
from web.apps.web_copo.lookup.lookup import FIGSHARE_API_URLS
from chunked_upload.models import ChunkedUpload
from django.conf import settings
from dal.copo_da import DataFile, Submission
import threading
import datetime
from dal.co... |
controller.py | # Copyright (c) 2016-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
import psutil
import shutil
import signal
import time
im... |
extract_features.py | from __future__ import absolute_import
import argparse
import multiprocessing
import os
import sys
import time
import traceback
import numpy as np
from progressbar import ProgressBar
import h5py
from src.data import VideoGenerator
def extract_features(videos_dir, output_dir, batch_size, num_threads,
... |
multiwii.py | #/!usr/bin/env python
import time
import logging
import serial
import threading
import struct # for decoding data strings
class drone:
def __init__(self, port):
self.started = True
self.ATT = 0 # Ask and save the attitude of the multicopter
self.ALT = 0 # Ask and save the altitude of the multicopter... |
test8.py | # import os
# import multiprocessing
#
#
# def foo(i):
# # 同样的参数传递方法
# print("这里是 ", multiprocessing.current_process().name)
# print('模块名称:', __name__)
# print('父进程 id:', os.getppid()) # 获取父进程id
# print('当前子进程 id:', os.getpid()) # 获取自己的进程id
# print('------------------------')
#
#
# if __name__... |
token_grabber.py | import os
if os.name != "nt":
exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from datetime import datetime
from threading import Thread
from time import sleep
from sys import argv
LOC... |
runner.py | import time
from train import main
from datetime import datetime, timedelta
from threading import Thread
def run():
print("Sleeping for 2 minutes now.")
time.sleep(120)
main()
def run_on_different_thread(fn):
def wrapper(*args, **kwargs):
thread = Thread(target=fn, args=arg... |
enzh_jp.py | import time
import pymysql
from fuzzywuzzy import process
from pymysql.cursors import DictCursor
from multiprocessing import Process
n = 1
animate_id = 100000
db1 = pymysql.connect("localhost", "root", "", "bidscore")
db2 = pymysql.connect("localhost", "root", "", "miraihyoka")
cursor_en = db1.cursor(DictCursor)
c... |
midi_hub.py | """A module for interfacing with the MIDI environment."""
import abc
from collections import defaultdict
from collections import deque
import Queue
import re
import threading
import time
# internal imports
import mido
import tensorflow as tf
# TODO(adarob): Use flattened imports.
from magenta.common import concurren... |
y_cable_helper.py | """
y_cable_helper.py
helper utlities configuring y_cable for xcvrd daemon
"""
import copy
import datetime
import os
import re
import threading
import time
from importlib import import_module
from sonic_py_common import daemon_base, logger
from sonic_py_common import multi_asic
from sonic_y_cable import y_ca... |
probe.py | #!/usr/bin/env python3
"""Plugin that probes the network for failed channels.
This plugin regularly performs a random probe of the network by sending a
payment to a random node in the network, with a random `payment_hash`, and
observing how the network reacts. The random `payment_hash` results in the
payments being re... |
test_fifo_queue.py | # Copyright 2018/2019 The RLgraph 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 appli... |
dnsOverTlsProxy.py | from dnsOverTlsApp import dot
import socket
import threading
from logger import logger
class DnsProxyServer(object):
def __init__(self, host, port):
""" Initialization of each socket attributes"""
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOC... |
evaluate_therm_daemon.py | from django.core.management.base import BaseCommand, CommandError
from django_thermostat.rules import evaluate
from time import localtime, strftime, sleep
#import threading
import multiprocessing
import logging
from django.conf import settings
logger = logging.getLogger("thermostat.rules")
logger.setLevel(settings.LO... |
dashboard.py | #!/usr/bin/python3
"""
n1mm_view dashboard
This program displays QSO statistics collected by the collector.
"""
from datetime import datetime
import logging
import os
import gc
import multiprocessing
import pygame
import sqlite3
import sys
import time
import config
import dataaccess
import graphics
__author__ = 'Jef... |
MongoRepository.py | import cPickle as pickle
import logging
import os
import time
from threading import Lock, Thread
from pymongo import MongoClient
class MongoRepository(object):
def __init__(self, connection_string, database, collection, resume_token_path='resume_token.bin', logger_name=None, *time_fields):
"""
Mo... |
ssh.py | from __future__ import absolute_import
from __future__ import division
import inspect
import logging
import os
import re
import shutil
import six
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... |
health_manager.py | from template_finder import TemplateFinder
from ui import UiManager
from ui import BeltManager
from pather import Location
import cv2
import time
import keyboard
from utils.custom_mouse import mouse
from utils.misc import cut_roi, color_filter, wait
from logger import Logger
from screen import Screen
import numpy as np... |
producers.py | import asyncio
import threading
from abc import ABC, abstractmethod
from confluent_kafka import SerializingProducer, Producer, KafkaException
from confluent_kafka.schema_registry import SchemaRegistryClient
from confluent_kafka.schema_registry.json_schema import JSONSerializer
from confluent_kafka.serialization import... |
bang.py | from kivy import graphics
from kivy.uix.label import Label
import threading
import time
STATES = 'normal', 'down'
class Bang(Label):
def __init__(self, text, delay=0.25, **kwds):
super().__init__(text=text, **kwds)
self.delay = delay
self.lock = threading.RLock()
self._state = Fal... |
vectorized_env_executor.py | import numpy as np
import pickle as pickle
from multiprocessing import Process, Pipe
import copy
class IterativeEnvExecutor(object):
"""
Wraps multiple environments of the same kind and provides functionality to reset / step the environments
in a vectorized manner. Internally, the environments are execute... |
webmonitoring.py | import logging
from threading import Thread
import datetime as dt
from datetime import datetime
import dateutil.parser as dp
from plot import plotMeteoStuff
from shellchecks import *
import time
import cherrypy
import signal
import socket
import sys
import os
import meteo
import plot
plots_path = 'plots/'
daq_path = ... |
server.py | #!/usr/bin/env python3
import threading
import socket
from time import gmtime, strftime, sleep
import os
connectionDictionary = {} # dicrionary where to put all connection threads in
currentTime = '' # variable for displaying the current time in logs
halt = False # indicator variable for program shutdown
# building s... |
api.py | import socket
import json
import time
import logging
import threading
def logger(name, loglevel="ERROR"):
log = logging.getLogger(name)
log.setLevel(loglevel)
if len(log.handlers) < 1:
ch = logging.StreamHandler()
ch.setLevel(loglevel)
formatter = logging.Formatter(
"%... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_safecoin
from electrum_safecoin.bitcoin import TYPE_ADDRESS
from electrum_safecoin import WalletStorage, Wallet
from electrum_safecoin_gui.kivy.i18n import _
from electrum_safecoin.p... |
installApp.py | # -*- coding: utf-8 -*-
__author__ = 'joko'
"""
@author:joko
@time: 16/11/11 上午10:52
"""
import lib.adbUtils
import xml.etree.cElementTree as ET
import re
import lib.Utils as U
import threading
from multiprocessing import Queue
import os
class Ia:
def __init__(self, all_result_path, device):
"""
... |
__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import logging
import os
import random
import re
import sys
import time
import Queue
import threading
from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i, get_cell_ids
import cell_w... |
updater.py | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as publish... |
cPlotBayesactSim.py | # Plots bayesactsim by parsing it
import subprocess
import os
import re
import time
import signal
import threading
import wx
from cBayesactSimBuffer import cBayesactSimBuffer
from cEnum import eAxes, eTurn, eEPA
from cConstants import cPlotConstants, cEPAConstants
class cPlotBayesactSim(object):
# The axis items a... |
server.py | import asyncio
import multiprocessing
import os
import sys
import traceback
from collections import deque
from functools import partial
from inspect import isawaitable
from signal import SIG_IGN, SIGINT, SIGTERM, Signals
from signal import signal as signal_func
from socket import SO_REUSEADDR, SOL_SOCKET, socket
from ... |
scraper.py | from requests import get
from bs4 import BeautifulSoup as BS
import tabulate
from pprint import pprint
import os,json
from threading import Thread
url = 'https://www.timeshighereducation.com/student/best-universities/top-50-universities-reputation-2018#survey-answer'
raw = get(url)
soup = BS(raw.text,'html.parser')
t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.