source
stringlengths
3
86
python
stringlengths
75
1.04M
conftest.py
import logging import os import random import time import tempfile import threading from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime from math import floor from shutil import copyfile from functools import partial from botocore.exceptions import ClientError import pytest from coll...
ingest.py
import concurrent.futures import csv import datetime import json import logging import os import queue import threading import time from pathlib import Path import luigi from config import config from .scrape import Scrape logger = logging.getLogger(__name__) q = queue.Queue() def write_to_csv(today): try: ...
client-gunn-pi-v2.py
import socket from multiprocessing import Process, Manager import pygame import os from time import sleep ''' Writen by Gunnar Bjorkman for robot control over raspberrypi connection Current design: Send and recieve server data over socket connection that was gathered from a 'Logitech Extreme 3D Pro' ...
dynamodump.py
#!/usr/bin/env python """ Simple backup and restore script for Amazon DynamoDB using boto to work similarly to mysqldump. Suitable for DynamoDB usages of smaller data volume which do not warrant the usage of AWS Data Pipeline for backup/restores/empty. dynamodump supports local DynamoDB instances as w...
SQLiteTable.py
import csv import io import logging import sqlite3 import time import threading import wx from functools import lru_cache from hashlib import md5 import golumn from golumn.SQLiteImporter import SQLiteImporter from golumn.Utils import unique_array, detect_encoding import golumn.typer SNIFF_BYTES = 65535 # number of C...
interlocked_queue.py
#!/usr/bin/env python3 #-*- coding: iso-8859-1 -*- ################################################################################ # # Interlocked queues (FIFO and prioritized) for sending data between threads. # # Pythomnic3k project # (c) 2005-2014, Dmitry Dvoinikov <dmitry@targeted.org> # Distributed under BSD lice...
edit.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from threading import Thread from django.db import models from django.http import JsonResponse from django.contrib import messages from django.forms.models import model_to_dict, construct_instance from django.contrib.auth.mixins import Permi...
main.py
import graph_op as op from collections import defaultdict import copy import itertools import logging import time # from multiprocessing import Process, Manager, cpu_count import threading, Queue import example_graphs as ex import db_functions as dbfunc import draw_graph as dg import graph as g import bin_of_edges as b...
manage.py
# -*- coding: utf-8 -*- import argparse import sys import waitress from conf.version import version_ from Doctopus.web.app import get_app try: from queue import Queue except Exception: from Queue import Queue from logging import getLogger from threading import Thread from Doctopus.lib.logging_init import s...
test_threads.py
#!/usr/bin/env python from confluent_kafka import Producer import threading import time try: from queue import Queue, Empty except ImportError: from Queue import Queue, Empty class IntendedException (Exception): pass def thread_run(myid, p, q): def do_crash(err, msg): raise IntendedExceptio...
tesseract_viewer.py
# Copyright 2019 Wason Technology, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
blockimgdiff.py
# Copyright (C) 2015 The Android Open Source Project # # 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 ...
serial_connection.py
import serial from thonny.plugins.micropython.connection import MicroPythonConnection, ConnectionFailedException import threading import time from serial.serialutil import SerialException import logging import platform import sys from textwrap import dedent class SerialConnection(MicroPythonConnection): def __ini...
tests.py
# -*- coding: utf-8 -*- import unittest import imp import os import sys import threading import time import functools import sublime import sublime_plugin lock = threading.Event() def show_message(message): print(message) sublime.status_message(message) def safe_run(event_lock): def wrapper_factory(w...
server.py
from math import floor from world import World import Queue import SocketServer import datetime import random import re import requests import sqlite3 import sys import threading import time import traceback DEFAULT_HOST = '0.0.0.0' DEFAULT_PORT = 4080 DB_PATH = 'craft.db' LOG_PATH = '/var/log/craft.log' CHUNK_SIZE ...
test_main.py
from galera_node_health import GaleraNodeHealth from galera_node_health import scripts import threading from time import sleep import requests import pymysql from configparser import ConfigParser import os import subprocess import tempfile import pytest import py import re import traceback import psutil from enum impor...
tornado_test_server.py
import logging import threading import time from typing import Optional from tornado import ioloop from tornado.httpserver import HTTPServer from tornado.web import Application, RequestHandler from pyctuator.pyctuator import Pyctuator from tests.conftest import PyctuatorServer class TornadoPyctuatorServer(Pyctuator...
_server.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...
rplidar.py
import os from math import cos, sin, pi, floor from adafruit_rplidar import RPLidar import threading import random from datetime import datetime from .sensorbase import SensorBase class RPLidarSensor(SensorBase): def __init__(self, args): super(RPLidarSensor, self).__init__(args) self.lidar = ...
onnxruntime_test_python.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- import unittest import os import numpy as np import onnxruntime as onnxrt import threading import sys from helper import get_name from onnxruntime.capi.onnxruntime_pybind11_state import Fail class Te...
traybar.py
import os from .win32_adapter import * import threading import uuid class SysTrayIcon(object): """ menu_options: tuple of tuples (menu text, menu icon path or None, function name) menu text and tray hover text should be Unicode hover_text length is limited to 128; longer text will be truncated Ca...
AM_I_BOT.py
""" This is bot to check if contacting user is bot. User can check if other user is bot or not. If there is no data then you can request user to get validated """ import logging import json import time import threading from Model import (AddUser, CheckUser, AddQuery) from telegram.ext import Updater, CommandHandler, ...
crecord.py
from __future__ import unicode_literals import argparse import io import locale import os import subprocess import sys import threading def forward_stream(stream, out, log, prefix): """Forward stream to output stream prefixing lines with prefix.""" def forward(): while True: data = strea...
__init__ - Kopie (3).py
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2020- <AUTHOR> <EMAIL> ######################################################################### # ...
test_emr.py
import copy import gzip import io import threading import time import boto3 import pytest from dagster_aws.emr import EmrClusterState, EmrError, EmrJobRunner from dagster_aws.utils.mrjob.utils import _boto3_now from moto import mock_emr, mock_s3 from dagster.seven import mock from dagster.utils.test import create_tes...
main.py
import os import glob import pyaes import threading from pathlib import Path arquivos_extensoes = ["*.pl","*.7z","*.rar","*.m4a","*.py","*.cpp","*.cs","*.css","*.wma","*.avi","*.wmv","*.d3dbsp","*.sc2save","*.sie","*.sum","*.bkp","*.flv","*.js","*.raw","*.jpeg","*.tar","*.zip","*.tar*.gz","*.cmd","*.key","*.DOT"...
rdd.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...
test_mangle.py
import os import multiprocessing import re import signal from unittest.mock import patch from pkgdev.mangle import Mangler import pytest from snakeoil.cli.exceptions import UserException class TestMangler: def test_nonexistent_file(self, tmp_path): path = tmp_path / 'nonexistent' assert list(Man...
handle_file_s3.py
from django.conf import settings import boto3 from threading import Thread import os from .log import slogger import urllib3 from shutil import copyfile, rmtree import requests from io import BytesIO s3_cli = None if os.environ.get('WITH_OS') == 'True': s3_res = boto3.resource('s3', endpoin...
main.py
"""Main script for BFTList.""" # standard import asyncio import os import logging from threading import Thread # external from prometheus_client import start_http_server # local from communication.zeromq.sender import Sender from communication.zeromq.receiver import Receiver from communication.udp.sender import Send...
celery.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 use ...
app.py
""" A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app .. note:: This module is Experimental on Windows platforms and supports limited configurations: - doesn't support PAM authentication (i.e. external_auth: auto) - doesn't support SSL (i.e. disable_ssl: Tru...
__init__.py
# -*- coding: utf-8 -*- """ This file is covered by the LICENSING file in the root of this project. """ from werkzeug.exceptions import HTTPException __author__ = 'Junbo Wang' __version__ = '2.0' from flask import Flask from flask_restful import Api from flask_cors import CORS from datetime import timedelta from ha...
main.py
# main.py # author: Playinf # email: playinf@stu.xmu.edu.cn import os import ops import sys import copy import argparse import numpy as np import tensorflow as tf import multiprocessing from utils import parallel_model from utils.validation import validate from data.record_reader import get_input_fn from data.plain_t...
filemover.py
#!/usr/bin/env python """Filemover cli equivalent""" # system modules import os import re import sys import json import stat import time import thread import urllib import urllib2 import datetime from multiprocessing import Process # for DBS2 XML parsing import xml.etree.ElementTree as ET # cmssh modules from cmssh...
test_framework.py
from __future__ import print_function class AssertException(Exception): pass def format_message(message): return message.replace("\n", "<:LF:>") def display(type, message, label="", mode=""): print("\n<{0}:{1}:{2}>{3}".format( type.upper(), mode.upper(), label, format_message(message))) def ...
ip_responder.py
import select import socket import threading import time import ipaddress import secrets from xv_leak_tools.exception import XVEx from xv_leak_tools.helpers import TimeUp from xv_leak_tools.log import L from xv_leak_tools.test_components.component import Component class IPResponder(Component): def __init__(self,...
train.py
#! /usr/bin/env python import unittest import gym import sys import os import numpy as np import tensorflow as tf import itertools import shutil import threading import multiprocessing from inspect import getsourcefile current_path = os.path.dirname(os.path.abspath(getsourcefile(lambda:0))) import_path = os.path.absp...
data_plane.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...
OCR.py
import numpy as np import cv2 import string import sys import os import pytesseract from pytesseract import Output from threading import Thread, Event from time import sleep import struct # import redis import time import preprocess class OCR(): def __init__(self, threshold=None): self.DD = self.Del() ...
__init__.py
import os import subprocess import sys import threading import piquipe VERSION = '0.0.0' def run(args, *, env=None, shell=False, executable=None, timeout=None, check=False): with Popen(args, env=env, shell=shell, executable=executable) as process: try: stdout, stderr = process.communicate(ti...
opennlp_server.wsgi
import os import string import random import cgi import json import uuid import sys import traceback import bottle from datetime import datetime from bottle import get, post, request, run, route, Bottle import bottle from Pipeline.Training.OpenNLP import * from Pipeline.Training.CRFRunner import CRFRunner from Pipeline...
util.py
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. import subprocess import os import sys import logging import time import settings import re import uuid import requests_unixsocket import requests from threading import T...
bot.py
from queue import Queue from threading import Thread from typing import Any from .core.constants import Interval from .core.manager import Manager from .core.message import UserInput from .options import Options class Bot: def __init__(self, options: Options): self.options = options self._queue =...
main.py
from persistence import save, load_all from recipes import * from recognition import * from application import Application from pynput import keyboard import threading import numpy import win32con import win32gui import win32ui class Mode(Enum): CURRENT_MATERIALS = "current materials" CURRENT_MISSIONS = "cu...
firmware_update.py
# -*- coding: utf-8 -*- # # Copyright 2017-2021 AVSystem <avsystem@avsystem.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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
pysoda.py
# -*- coding: utf-8 -*- ### Import required python modules import logging from gevent import monkey; monkey.patch_all() import platform import os from os import listdir, stat, makedirs, mkdir, walk, remove, pardir from os.path import isdir, isfile, join, splitext, getmtime, basename, normpath, exists, expanduser, spl...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
run_package.py
# Copyright 2018 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. """Contains a helper function for deploying and executing a packaged executable on a Target.""" from __future__ import print_function import common import ...
sql_magic.py
# -*- coding: utf-8 -*- # Copyright (C) 2017-Present Pivotal Software, Inc. All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a ...
example_test.py
import re import os import socket import http.server from threading import Thread import ssl from tiny_test_fw import DUT import ttfw_idf server_cert = "-----BEGIN CERTIFICATE-----\n" \ "MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\ "BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0Y...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Ocvcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test ocvcoind shutdown.""" from test_framework.test_framework import OcvcoinTestFramework from test_fr...
irsdk.py
#!python3 import re import argparse import mmap import struct import ctypes import yaml from threading import Thread from urllib import request, error from yaml.reader import Reader as YamlReader try: from yaml.cyaml import CSafeLoader as YamlSafeLoader except ImportError: from yaml import SafeLoader as YamlS...
realtime-multicam.py
# -*- coding: utf-8 -*- import os import random from glob import glob import time import cv2, threading import numpy as np from numpy import expand_dims from threading import Thread, Lock from tensorflow.keras import preprocessing from tensorflow.keras.models import load_model import tensorflow as tf from tensorflo...
index.py
from __future__ import absolute_import import logging import multiprocessing import os import time from builtins import str from .proxies import db_session, current_repo, current_app from .models import ErrorLog, Post, IndexMetadata from .utils.emails import send_subscription_emails from .utils.time import time_since...
Display.py
# -*- coding: utf-8 -*- from models.digits import digits from sense_hat import SenseHat from threading import Thread from time import sleep BLINK_TRESHOLD = 30 # Celsius degrees when led panel starts blinking # RGB for pixels PIXEL_OFF = [0,0,0] RED = [255, 0, 0] ORANGE = [255, 128, 0] YELLOW = [255, 255, 0] GREEN =...
policy_worker.py
import multiprocessing import os import signal import time from collections import deque from queue import Empty import numpy as np import psutil import torch from torch.multiprocessing import Process as TorchProcess from multi_sample_factory.algorithms.appo.appo_utils import TaskType, memory_stats, cuda_envvars_for_...
tests.py
from __future__ import absolute_import import sys import time from django.conf import settings from django.db import transaction, connection, router from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) fr...
textualdevice.py
# -*- coding: utf-8 -*- """ Moler's device has 2 main responsibilities: - be the factory that returns commands of that device - be the state machine that controls which commands may run in given state """ __author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst' __copyright__ = 'Copyright (C) 2018-2021, Nokia' __...
py_utils.py
# Lint as: python3 # Copyright 2018 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 ...
_process_handler.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import io import multiprocessing import subprocess import sys from typing import Optional class SubprocessProcessHandler: """A `ProcessHandler` that delegates directly to a subproces...
test_dota_refine_retinanet.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process sys.path.append("....
ai_actions.py
__author__ = "Jerry Overton" __copyright__ = "Copyright (C) 2022 appliedAIstudio LLC" __version__ = "0.0.1" # AI, GOAP # needed to copy the intended effects into the actual effects import copy # needed to keep the action alive in its thread import time # defines action status from enum import Enum from threading impo...
keyvalue.py
import typing as _typing import uuid import threading as _threading import pickle import pickledb import zmq from pydistributed.shared import Proxy, Hub, Subscriber, Publisher, HubClient DEFAULT_PATH = "tmp/keyvalue.db" # ACTIONS class GetAction: def __init__(self, key: str, subscribe=False): self.key...
rbts_create_transposon_modelServer.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...
discord.py
from .ctx import ctx import requests import threading import time import json from .embed import Embed from .components import Components import config from datetime import datetime session = requests.Session() url = "https://discord.com/api/v9" headers = {"authorization": f"Bot {config.token}"} ratelimit = [] queue...
instagram.py
# Date: 06/10/2017 # Distro: Kali linux # Desc: Instagram Bruteforce # # import os import time import urllib import argparse import threading import subprocess from platform import platform from Core.tor import TorManager from Core.Browser import Browser class Instagram(TorManager,Browser): def __init__(self,usernam...
spawn_a_thread.py
import threading def thread_count(count): print("I am the thread number ",count,".") for i in range(1,6): t = threading.Thread(target = thread_count,args = (i,)) t.start() t.join() print("Main thread exiting now")
comms.py
import settings import socket import struct import threading import json import aes_crypt import rsa_encrypt import base64 import hashlib import time import sqlite3 import sys def initialize_db(): conn = sqlite3.connect(settings.DBdir + "UI.db") conn.row_factory = sqlite3.Row conn.cursor().execute("PRAGM...
interface.py
from tkinter import * from tkinter import ttk import time import re import os import string import tkinter as tk import webbrowser import random from threading import Thread from sender import SenderBroker from receiver import ReceiverBroker from Crypto.PublicKey import RSA from encryption_decryption import rsa_encrypt...
syntax.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals from os import path from threading import Thread from .file import File from .libraries import get_library_list from .tool...
test_tiler.py
import unittest import sys, os import shutil import time import psycopg2 import SocketServer import threading from handler import TestHandler sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Insanity for getting parent folder in path from tiler import get_config, tiles_from_config from sh...
camera_control_GUI.py
""" Camera Control Copyright M. Mathis Lab Written by Gary Kane - https://github.com/gkane26 post-doctoral fellow @ the Adaptive Motor Control Lab https://github.com/AdaptiveMotorControlLab GUI to record from imaging source cameras during experiments """ from Tkinter import Entry, Label, Button, StringVar, IntVar, T...
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...
metric_store_test.py
# Copyright 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 functools import operator import random import threading import time import unittest import mock from infra_libs.ts_mon.common import distribution f...
serve.py
# Most of this code is: # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # The server command includes the additional header: # For discussion of daemonizing: # http://aspn.activestate.com/ASPN/C...
file_helpers.py
import sys import codecs import re from functools import wraps from contextlib import contextmanager from collections import OrderedDict, defaultdict import json import multiprocessing as mp import threading import warnings import os from abc import ABCMeta try: basestring except NameError: basestring = (str, ...
dispatcher.py
from threading import Thread from typing import Callable def dispatch_async(fn): # type: (Callable) -> Callable def dispatch(*args, **kwargs): thread = Thread(target=fn, args=args, kwargs=kwargs) thread.start() return dispatch
night2.py
#!/usr/bin/python2 # The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # Modified by @JackMx on Telegram # # 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, includ...
tv.py
import os import random import sys import time from concurrent.futures import ThreadPoolExecutor from threading import Thread import yaml from executors.internet import vpn_checker from executors.logger import logger from modules.audio import speaker from modules.conditions import conversation from modules.exceptions...
Base.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # This file is part of MAVlinkplug. # MAVlinkplug is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
test_xmlrpc.py
import base64 import datetime import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import socket import os import re import io import contextlib from test import support try: import gzip except ImportError: gzip = None try: ...
bchn-rpc-getblocktemplate-timing.py
#!/usr/bin/env python3 # Copyright (c) 2019-2020 Jonathan Toomim # Copyright (c) 2020 The Bitcoin Cash Node developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' bchn-rpc-getblocktemplate-timing -- test that -maxgbttime an...
ctypes_ManualCirc_pyqt_demoCam.py
# -*- coding: utf-8 -*- """ Created on Mon May 17 16:32:10 2021 @author: sabbi """ #opens first PI Camera detected (if any) - if no camera, opens a ProEM 512x512 #takes full frame acquisition with either 100ms exposure (CCD, CMOS) #or 1ms gate (ICCD) with fastest possible ADC speed (for default quality) #us...
work.py
#!/usr/bin/env python from random import random, choice from threading import Thread from time import sleep from uuid import uuid4 from neo4j.v1 import GraphDatabase driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "password")) def get_random_name(): return uuid4().hex[0:8] def run_mat...
test_server.py
"""Tests for the HTTP server.""" # -*- coding: utf-8 -*- # vim: set fileencoding=utf-8 : from __future__ import absolute_import, division, print_function __metaclass__ = type import os import socket import tempfile import threading import time import pytest from .._compat import bton from ..server import Gateway, H...
test_httplib.py
import errno from http import client import io import itertools import os import array import socket import threading import unittest TestCase = unittest.TestCase from test import support here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' CERT_localhost = os.path.join(here, 'keycert.pem') # Sel...
transports.py
from .logging import exception_log, debug from .types import TCP_CONNECT_TIMEOUT from .types import TransportConfig from .typing import Dict, Any, Optional, IO, Protocol, Generic, List, Callable, Tuple, TypeVar, Union from contextlib import closing from functools import partial from queue import Queue import http impor...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
data_utils.py
""" Miscellaneous functions manage data. Date: November 2021 Authors: Miriam Cobo, Ignacio Heredia Email: cobocano@ifca.unican.es, iheredia@ifca.unican.es Github: miriammmc, ignacioheredia """ import os import threading from multiprocessing import Pool import queue import subprocess import warnings import base64 imp...
commands.py
# coding: utf-8 # # commands.py # Part of SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Ryan Hileman and Aparajita Fishman # # Project: https://github.com/SublimeLinter/SublimeLinter3 # License: MIT # """This module implements the Sublime Text commands provided by SublimeLinter.""" impor...
server.py
#!/usr/bin/env python # Copyright (c) 2013 clowwindy # # 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, me...
test_submit_1.py
import cv2 import numpy as np import pandas as pd import threading import Queue import tensorflow as tf from tensorflow.python.client import device_lib from tqdm import tqdm import params import os input_size = params.input_size batch_size = params.test_batch_size orig_width = params.orig_width orig_height = params.o...
tsharkConnector.py
import subprocess, io, struct, time, logging from queue import Queue from tempfile import NamedTemporaryFile from typing import Dict, Union class TsharkConnector(object): """ Class to manage a tshark process and encapsulate the communication with the process' input and output. ## Parsing PCAPs with tshar...
decoder.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # pyFLAC decoder # # Copyright (c) 2011-2021, Sonos, Inc. # All rights reserved. # # ------------------------------------------------------------------------------ from collections import deque from enum impo...
monitor_deployment.py
# 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 agreed to ...
Dashboard.py
import curses import datetime import threading ''' # 간단 사용법 0. 사용할 모니터.py에서 Dashbord.Dashbord()를 선언합니다. dashboard = Dashbord.Dashbord() 1. 사용할 모니터.py에서 self.LASTEST_CRASH_TIME, self.DCHECK_COUNT, self.CRSAH_COUNT에 대한 것을 수집 할 수 있는 코드들을 넣어줍니다. self.LASTEST_CRASH_TIME = 크래시가 수집된 시간 self.CRSAH_COUNT = 크래시 ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
server.py
#!/usr/bin/python3 import socket import sys import threading import signal import os import time import sqlite3 import hashlib import http.server import socketserver import shutil from settings import * threads = [] users = [] user_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) user_sock.bind((SERVER_IP,COM...
WebsocketClient.py
# # GDAX/WebsocketClient.py # Daniel Paquin # # Template object to receive messages from the GDAX Websocket Feed import json, time from threading import Thread from websocket import create_connection class WebsocketClient(object): def __init__(self, url="wss://ws-feed.gdax.com", products=[ "BTC-USD" ]): ...