source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
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 gc
import onnxruntime as onnxrt
import threading
import sys
from helper import get_name
from onnxruntime.capi.onnxruntime_pybind11_state import Fail... |
dataset.py | import queue
import time
from multiprocessing import Queue, Process
import scipy.signal
import cv2 # pytype:disable=import-error
import numpy as np
from joblib import Parallel, delayed
from stable_baselines import logger
class ExpertDataset(object):
"""
Dataset for using behavior cloning or GAIL.
The ... |
__main__.py | # coding: UTF-8
""" Telco Benchmark for measuring the performance of decimal calculations
- http://speleotrove.com/decimal/telco.html
- http://speleotrove.com/decimal/telcoSpec.html
A call type indicator, c, is set from the bottom (least significant) bit of the duration (hence c is 0 or 1).
A rate, r, is determined f... |
test_debugger.py | import pytest
import textwrap
import ctypes
import os
import windows
import windows.debug
import windows.generated_def as gdef
import windows.native_exec.simple_x86 as x86
import windows.native_exec.simple_x64 as x64
from .conftest import generate_pop_and_exit_fixtures, pop_proc_32, pop_proc_64
from .pfwtest import *... |
__init__.py | """
Support to check for available updates.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/updater/
"""
import asyncio
from distutils.version import StrictVersion
import json
import logging
import os
import platform
import subprocess
import sys
import ... |
test_framed_transport.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import socket
import threading
import time
from os import path
from unittest import TestCase
from tornado import ioloop
import thriftpy
from thriftpy.tornado import make_server
from thriftpy.rpc import make_client
from thriftpy.transport... |
GraphComponentTest.py | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
osmedeus.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, glob, socket, time
import argparse
from multiprocessing import Process
from pprint import pprint
from core import routine
from core import config
from core import execute
from core import slack
from core import utils
# Console colors
W = '\033[1;0m' # w... |
transport_state.py | """
Read in files transport_lines.txt.
Handle these cases carefully:
More or less than 8 lines
"""
import blinkt
import colours
import multiprocessing
import requests
import time
REFRESH_TIME = 5 * 60
def typo_correct(input):
subs = {
'hamm': 'hammersmith-city',
'over': 'london-overgroun... |
pod.py | """
Pod related functionalities and context info
Each pod in the openshift cluster will have a corresponding pod object
"""
import logging
import os
import re
import yaml
import tempfile
import time
import calendar
from threading import Thread
import base64
from semantic_version import Version
from ocs_ci.ocs.bucket_... |
rlock.py | __author__ = "JJ.sven"
'''递归锁, Lock & RLock
如果一个锁的状态是unlocked,调用acquire()方法改变它的状态为locked
如果一个锁的状态是locked,acquire()方法将会阻塞,直到另一个线程调用release()方法释放了锁;
如果一个锁的状态是unlocked调用release()会抛出RuntimeError异常;
如果一个锁的状态是locked,调用release()方法改变它的状态为unlocked。
Lock 一个acquire后接着再acquire就会死锁
我的理解 lock.acquire=>lock.acquire(这里会等待前面锁解锁,但前面那... |
gui_final.py | from tkinter import*
import pickle
from PIL import ImageTk,Image
import socket
import cv2
import numpy as np
import time
import datetime
import sys
import threading
import os
#Global variables
ipr='192.168.0.106' #enter IP of this laptop
ipc='192.168.0.106' #enter IP of other laptop
filter_flag=0 #filter flag
stop... |
Product_Hunt_bot.py | import telebot
import gspread
import requests
import threading
import time
import schedule
import datetime
from telebot.types import KeyboardButton, ReplyKeyboardMarkup
from telebot import custom_filters
from oauth2client.service_account import ServiceAccountCredentials
dotenv.load_dotenv()
# your Token from @Botfath... |
raincheck.py | from blist import sortedlist
from functools import wraps
from multiprocessing import Process, Lock, Condition, Event, Semaphore
from multiprocessing.managers import BaseManager
from flask import abort, make_response, request, render_template, session
from base64 import b64encode
from random import uniform
from pyhashxx... |
ServoControl.py | from time import sleep
import RPi.GPIO as GPIO
from threading import Thread
class ServoKontrol:
def __init__(self, pin=35, GPIOSetup = GPIO.BOARD):
GPIO.setmode(GPIOSetup)
GPIO.setup(pin, GPIO.OUT)
self.pwm = GPIO.PWM(pin, 50)
self.pwm.start(0)
self.pin = pin
... |
imapd.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... |
download_from_google_storage.py | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Download files from Google Storage based on SHA1 sums."""
import hashlib
import optparse
import os
import Queue
import re
impo... |
server_lifecycle.py | # Copyright (c) 2019 Alliance for Sustainable Energy, LLC
# 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
# li... |
fifo.py | import threading
import tensorflow as tf
# create a FIFOQueue that produces a range of numbers several times and register an associated QueueRunner
number_queue = tf.train.input_producer([i for i in range(20)], num_epochs=5, name='number_queue')
# manually build a FIFOQueue, and a QueueRunner
queue = tf.FIFOQueue(ca... |
jail.py | """
Linuxイメージを利用した軽量コンテナ
予めLinuxのroot以下を任意のディレクトリに用意して、実行したいアプリケーションを
指定すると任意のディレクトリ以下をchroot軽量コンテナとして起動してその中で
アプリケーションを実行する。
"""
import pathlib
import os
import shutil
import subprocess
from multiprocessing import Process
class Jail:
"""
隔離実行環境のLinuxイメージに関するデータを格納する.
"""
def __init__(self, jail_path... |
client.py | """
Echticka
A Basic CLI-Based Communications App, Client Code
"""
import getpass
import pickle
import socket
import sys
import time
from threading import Thread
GIVEN_USERNAME = None
GIVEN_HOST = None
GIVEN_PORT = None
try:
GIVEN_USERNAME = input("Enter your Username: ")
GIVEN_HOST = input("Server Host: "... |
assistant.py | # Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
leak.py | from bs4 import BeautifulSoup
from threading import Thread
import requests
APPLE_URL = 'https://idmsa.apple.com/IDMSWebAuth/login.html?' \
'appIdKey=af1139274f266b22b68c2a3e7ad932cb3c0bbe854e13a79af78dcc73136882c3&path=/signin/'
HEADERS = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100... |
start.py | # Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import logging
import setproctitle
from abci import TmVersion, ABCI
import multichaindb
from multichaindb.lib imp... |
send_block.py | import logging
import os
import sys
import time
from threading import Thread
# append project dir to python path
from labchain.network import networking
from labchain.datastructure.block import Block
from labchain.datastructure.transaction import Transaction
from tests.test_account import MockCryptoHelper
f... |
__init__.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Logging utils
"""
import warnings
from threading import Thread
import torch
from torch.utils.tensorboard import SummaryWriter
from utils.general import colorstr, emojis
from utils.loggers.wandb.wandb_utils import WandbLogger
from utils.plots import plot_images, plot_re... |
against_computer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
" The code for the actor (only play against the inner computer) in the actor-learner mode in the IMPALA architecture "
# modified from AlphaStar pseudo-code
import traceback
from time import time, sleep, strftime, localtime
import threading
import os
USED_DEVICES = "0"
... |
record_multiplayer.py | #!/usr/bin/python3
#####################################################################
# This script presents how to use Doom's native demo mechanism to
# record multiplayer game and replay it with perfect accuracy.
#####################################################################
# WARNING:
# Due to the bug in... |
bcp_server.py | """BCP Server interface for the MPF Media Controller"""
import logging
import queue
import socket
import sys
import threading
import time
import traceback
import select
import mpf.core.bcp.bcp_socket_client as bcp
from mpf.exceptions.runtime_error import MpfRuntimeError
class BCPServer(threading.Thread):
"""Pa... |
jointcontroller_host.py | #!/usr/bin/env python
import roslib
roslib.load_manifest('sawyer_rr_bridge')
import rospy
import intera_interface
from std_msgs.msg import Empty
import sys, argparse
import struct
import time
import RobotRaconteur as RR
import thread
import threading
import numpy
from geometry_msgs.msg import (
PoseStamped,
P... |
test_dataloader.py | import math
import sys
import errno
import os
import ctypes
import faulthandler
import torch
import gc
import time
import signal
import unittest
import itertools
import warnings
import tempfile
from torch import multiprocessing as mp
from torch.utils.data import _utils, Dataset, IterableDataset, TensorDataset, DataLoad... |
main.py | #!/usr/bin/python2
import argparse
import threading
import os
import sys
import json
import random
import time
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
# Get path to locally installed phantomjs
MAINPYPATH = os.path.dirname(os.path.realpath(__file__))
PHANTOMJSBINAR... |
poll.py | # -*- coding: utf-8 -*-
import os, sys, threading, time, traceback
class Poll(object):
def __init__(self):
pass
def __fetchOps(self, count=100):
fetchOps = self.fetchOps
if self.DEVICE_TYPE in self.SYNC_SUPPORT:
fetchOps = self.sync
ops = fetchOps(self.revision, co... |
serial_plane_thread.py | """
执行系统调用时,Python 会释放 GIL 完成调用后 再获取 GIL
所以可以将模块使用 C 重写 用 Python 调用
"""
import select
import socket
import time
from threading import Thread
def slow_system_call():
select.select([socket.socket()], [], [], 0.1)
start = time.time()
threads = []
for _ in range(5):
thread = Thread(target=slow_system_... |
detector.py | import sys
if sys.version_info.major < 3 or sys.version_info.minor < 4:
print("Please using python3.4 or greater!")
sys.exit(1)
import numpy as np
import cv2, io, time, argparse, re
from os import system
from os.path import isfile, join
from time import sleep
import multiprocessing as mp
from openvino.inference... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color ... |
cruiseControl.py | """
PIPELINE:
Ricavo due frame successivi dalla camera RGB di CARLA.
Rimuovo le distorsioni all'immagine.
Ricavo la [R | t] dai sensori di CARLA.
Calcolo le features nei frame e faccio un match
Uso la funzione triangulatePoints() per ricavare i punti nelle coordinate spaziali, con riferimento al primo frame.
Uso l'alg... |
test_get_collection_info.py | import pdb
import pytest
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
from utils import *
nb = 1000
collection_id = "info"
default_fields = gen_default_fields()
segment_row_count = 5000
field_name = "float_vector"
class TestInfoBase:
@pytest.fixtur... |
tb_device_mqtt.py | # Copyright 2020. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
multiflash.py | import Adafruit_BBIO.GPIO as GPIO
import time
import signal
import sys
import multiprocessing
import random
pins = [7, 8, 9, 10, 11, 12, 14, 16]
processes = []
for pin in pins:
GPIO.setup("P8_%s" % pin, GPIO.OUT)
GPIO.output("P8_%s" % pin, GPIO.HIGH)
def signal_handler(signal, frame):
print '\nCaught int... |
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... |
data_utils.py | from collections import defaultdict, OrderedDict
import pickle as pickle
from multiprocessing import Process
from collections import Counter
from multiprocessing import cpu_count
from torch.utils.data import Dataset, DataLoader
from helpers.graph import _reverse_relation
import numpy as np
from torch_geometric.data imp... |
__init__.py | #####################################################################
# #
# /__init__.py #
# #
# Copyright 2013, Monash University ... |
handlers.py | #!/usr/bin/env python
#Request handlers for Pystore.
import os
import shutil
import time
import subprocess
import json
import sqlite3
from multiprocessing import Process
import tornado.web
from tornado.log import access_log
from helpers import *
class myApp(tornado.web.Application):
def __init__(self, *args, ... |
agent.py | #!/usr/bin/env python
#
# AzureMonitoringLinuxAgent Extension
#
# Copyright 2021 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... |
client.py | import socket
import threading
import pyaudio
import tkinter as tk
import time
import sys
from tkinter import messagebox
class Client(tk.Frame):
def __init__(self, parent, *args, **kwargs):
self.parent = parent
self.s = None
self.connection_active=False
self.chunk_size = 1024 # 51... |
es_api.py | """
Serve the elasticsearch API as a threaded Flask app.
"""
import json
import logging
import threading
import time
from random import randint
from typing import Dict, Optional
from flask import Flask, jsonify, make_response, request
from localstack import config, constants
from localstack.constants import TEST_AWS_... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
TOTAL_SCONS_... |
manager.py | import logging
import uuid
from copy import deepcopy
from time import sleep
from typing import Optional
import ssl
from django.conf import settings
from atlas.messaging.consumer import Listener
from atlas.messaging.consumer import Payload, build_listener
from django.utils.module_loading import import_string
from stomp ... |
styleui.py | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import argparse
import os
import tempfile
import json
import xml.etree.ElementTree as ET
import subprocess
from... |
import_thread.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
import traceback
import ray
from ray import ray_constants
from ray import cloudpickle as pickle
from ray import profiling
from ray import utils
class ImportThread(object):
"""A thread us... |
youtube_dl_gui.py | from __future__ import unicode_literals
import threading
import tkinter
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
#import youtube_dl
import yt_dlp as youtube_dl
import option_dict
OPTION_DICT = option_dict.OPTION_DICT
class App(tkinter.Frame):
def __init__(self, mast... |
thingsGate.py | import os, sys, time # pylint: disable=import-error
from crontab.crontabSetup import minuteTrigger
from rpi.rpiSetup import setHostname
from internet.internet import ensureInternet
#from odoo.gate import gateInit
from multiprocessing import Process, Manager
#import logging, logging.config
from launcher import launcher... |
scheduler.py | """
Copyright 2018, Oath Inc.
Licensed under the terms of the Apache 2.0 license. See LICENSE file in project root for terms.
This module implements classes that can be used by any Plugin Scheduler to setup a Celery App and Celery Beat
"""
from __future__ import print_function
from builtins import object
import signal... |
agent.py | import struct
import base64
import subprocess
import random
import time
import datetime
import os
import sys
import zlib
import threading
import http.server
import zipfile
import io
import imp
import re
import shutil
import pwd
import socket
import math
import stat
import grp
import numbers
from os.path import expandus... |
views.py | from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render
from django.http import HttpResponse
from tse_demo.settings import BASE_DIR
import os
from importcrdata.models import PatronElectoral,Distelec
from . import forms
import re
# Create your views here.
import loggi... |
test_http.py | # -*- encoding: utf-8 -*-
import collections
import email.parser
import platform
import socket
import threading
import time
import pytest
from ddtrace import compat
from ddtrace.vendor import six
from ddtrace.vendor.six.moves import BaseHTTPServer
from ddtrace.vendor.six.moves import http_client
import ddtrace
from ... |
__init__.py | import datetime
import copy
import json
import os
import threading
import time
import pkg_resources
from sqlalchemy.exc import IntegrityError
import anchore_engine.clients.services.common
import anchore_engine.common
# anchore modules
import anchore_engine.common.helpers
import anchore_engine.common.images
import an... |
remote_operations.py | import os
import time
import threading
import subprocess
import plistlib
from ..utils.constants import Constants
from ..utils.utils import Utils
class RemoteOperations(object):
# ==================================================================================================================
# I... |
test_lock.py | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import threading
import time
import pytest
from datadog_checks.process.lock import ReadWriteLock
READER_SLEEP = 0.005
@pytest.mark.unit
def test_read_lock():
lock = ReadWriteLock()
with lock.... |
results_spider.py | from os import environ
import base64
from multiprocessing import Process, Queue
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
from scrapy_splash import SplashRequest
import scrapy.crawler as crawler
from twisted.internet import reactor
from misbot.mis_utils import solve_captc... |
misc.py | """Module for miscellaneous functions and methods"""
import sys
import tempfile
import inspect
import platform
import os
from threading import Thread
import random
import string
from functools import wraps
import scooby
import numpy as np
# path of this module
MODULE_PATH = os.path.dirname(inspect.getfile(inspect.cu... |
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... |
socks5_server.py | # -*- coding: utf-8 -*-
""" socks5_server
Supports both python 2 and 3.
"""
__author__ = "Caleb Madrigal"
__date__ = '2016-10-17'
import sys
import argparse
import logging
import socket
import select
import threading
PY3 = sys.version_info[0] == 3
if PY3:
chr_to_int = lambda x: x
encode_str = lambda x: x.en... |
api.py | """
Greynir: Natural language processing for Icelandic
Copyright (C) 2021 Miðeind ehf.
This software is licensed under the MIT License:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"... |
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... |
TestSmartCacheWithRemoteOptimizerV3.py | #
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
import logging
import math
from threading import Thread
import grpc
import pandas as pd
import mlos.global_values as global_values
from mlos.Grpc.OptimizerServicesServer import OptimizerServicesServer
from mlos.Optimizers.Bayesi... |
srve.py | import os
import subprocess
from threading import Thread
from time import sleep
from pymodbus.datastore import ModbusSlaveContext, ModbusSequentialDataBlock, ModbusServerContext
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.server.asynchronous import StartTcpServer
from constants import Constan... |
analyzer.py | # -*- coding: utf-8 -*-
import pyaudio, wave
import os, sys, gc, time, threading, math
import numpy as np
from lib.record import *
from engine import *
import warnings
warnings.simplefilter("ignore", DeprecationWarning)
class Detecation(Recording):
def __init__(self):
## -----*----- コンストラクタ -----*----- ##... |
messenger.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... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import unittest
import subprocess
import textwrap
from contextlib import ExitStack
from io import StringIO
from test import support
# This little helper class is essential for testing pdb under do... |
MultiProcessingLog.py | # Copyright 2021 The Fraud Detection Framework 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 requ... |
eye.py | import numpy
from imutils.video import VideoStream
from imutils.video import FPS
import face_recognition
import argparse
import imutils
import pickle
import time
import cv2
from threading import Thread
from queue import Queue
from screeninfo import get_monitors
class FileVideoStream():
def __init__(self... |
gen_protos.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_fs.py | # Test fs.FS compatibility
import contextlib
import multiprocessing as mp
import os
import tempfile
import pytest
from moto import mock_s3
from parameterized import parameterized
from pfio.testing import ZipForTest, randstring
from pfio.v2 import S3, Local, Zip, from_url, open_url
from pfio.v2.fs import ForkedError
... |
app.py | from flask import Flask, jsonify, request
from flask import render_template
#from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from collections import deque
from threading import Thread
from time import sleep
import os
app = Flask(__name__)
#load_dotenv(find_dotenv())
directions = ['forward', 'b... |
carla_test_3.py | # Load the trained model
# Test it on the seen and unseen environment
#
# Seen environment - (X, Y) = (143.5, 207.0)
# Unseen envioronment - (X, Y) =
from keras.models import load_model
import glob
import os
import sys
import random
import time
import numpy as np
import cv2
import math
from collections import... |
main.py | import psutil
import os
import math
import subprocess
import threading
import time
import pathlib
class GenericObj(object):
pass
def generic_command(command):
print("Running generic system call")
def get_password():
with open(script_path + "/" + "password.txt") as f:
password = f.readline().rstri... |
mbase.py | """
mbase module
This module contains the base model class from which
all of the other models inherit from.
"""
import abc
import os
import shutil
import threading
import warnings
import queue as Queue
from datetime import datetime
from shutil import which
from subprocess import Popen, PIPE, STDOUT
import copy
im... |
loading.py | from sys import stdout
from random import choice
from threading import Thread
from time import sleep
from socket import create_connection
#import setup
def init():
try:
create_connection(("www.google.com", 80))
isconnected = True
except:
isconnected = False
return isconnected
def... |
gerenciador_de_contas.py | import time
import mysql.connector
import sys
import itertools
import threading
from colorama import Fore, Style, init
init(convert=True)
# https://youtu.be/umPfQvDyb-w
done = False
# here is the animation
class MyConverter(mysql.connector.conversion.MySQLConverter):
def row_to_python(self, row, fields):
... |
test_io.py | import sys
import gc
import gzip
import os
import threading
import time
import warnings
import io
import re
import pytest
from pathlib import Path
from tempfile import NamedTemporaryFile
from io import BytesIO, StringIO
from datetime import datetime
import locale
from multiprocessing import Process, Value
from ctypes i... |
helps_timer_monitor.py | from tkinter import *
import simpleaudio as sa
import time
import threading
import random
import queue
import socket
import select
import os
import subprocess
HOST = "192.168.1.3"
PORT = 60000
codes = ["AF369HYUZ", "DW327KOLI", "KU789MNIL", "ST672FRGH", "WS741ESFG", "SW309LIJU"]
count = 0
hint_sound = sa.WaveObject... |
parameter_server_reservation.py | from __future__ import absolute_import
from __future__ import division
from __future__ import nested_scopes
from __future__ import print_function
import logging
import pickle
import select
import socket
import struct
import threading
import time
from hops import util
MAX_RETRIES = 3
BUFSIZE = 1024*2
class Reservati... |
test_environments.py | # Copyright 2018 Tensorforce Team. 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 la... |
thread_lock_ex2.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# http://www.bogotobogo.com/python/Multithread/python_multithreading_Synchronization_Lock_Objects_Acquire_Release.php
import threading
import time
import logging
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-9s) %(message)s',)
... |
runtime_manager_dialog.py | #!/usr/bin/env python
"""
Copyright (c) 2015, Nagoya University
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
... |
test.py | from threading import Thread
from time import sleep
from client import Client
from server import Server
import unittest # The test framework
class Test_TestIncrementDecrement(unittest.TestCase):
def test_main(self):
def test_client(self):
conn = Client('127.0.0.1')
self.assertE... |
d.py | #!/usr/bin/env python
# encoding: utf-8
#if you See This Comment ... I wanna Say ... Yfz :)
#Copyright For All Coders Love YoU
import sys,os,re,socket,binascii,json,random,base64,Queue
import threading,Queue,pprint,urlparse,smtplib,telnetlib,os.path
import datetime,ssl,imaplib
import hashlib,string,urllib2,glob,... |
wsdump.py | #!/Users/brendan/Desktop/python-slackbot/venv/bin/python
import argparse
import code
import six
import sys
import threading
import time
import websocket
from six.moves.urllib.parse import urlparse
try:
import readline
except:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encoding", "")
if n... |
Watcher.py | # This is the live version
import time
import json
import threading
import sqlite3
from sopel import module
from sopel import tools
from sseclient import SSEClient as EventSource
class watcher():
reports = []
logReports = []
class wiki():
db = sqlite3.connect("/home/ubuntu/.sopel/modul... |
ota_interface.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
redis.py | import os
import sys
import threading
from typing import Optional
import boto3
import redis
import ujson as json
from asgiref.sync import sync_to_async
from redis.client import Redis
from consoleme.config import config
from consoleme.lib.plugins import get_plugin_by_name
if config.get("redis.use_redislite"):
imp... |
dos.py | # Date: 09/25/2018
# Author: Pure-L0G1C
# Description: Dos Attack
import socket
from time import sleep
from threading import Thread
from random import randint, choice
from string import ascii_lowercase
class Useragent(object):
@property
def get_win_version(self):
versions = []
... |
jobqueue.py | #!/usr/bin/env python
# flake8: noqa E501
#
# 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 Publ... |
getmetric.py | from __future__ import print_function
import time
import requests
from threading import Thread, Lock
from datetime import datetime
class Getmetric:
def __init__(self, async_dump=True, max_queue_len=25000, send_period_sec=60, batch_max_size=250, send_debug=False):
self.__is_async = async_dump
self... |
car_control.py | import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from threading import Thread
import time
import argparse
try:
from geometry_msgs.msg import PoseStamped
except ImportError:
pass
try:
from car.sensors import Sensors
except ImportError:
from sensors import Sensors
PUBLISHER_WAIT = 0.0... |
ai_flow_client.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... |
display.py | import time
import random
from flask import Blueprint, Response
from apps import WidgetBlueprint
from threading import Thread
blueprint = WidgetBlueprint(blueprint=Blueprint('HelloWorldTestWidgetPage', __name__))
blueprint2 = WidgetBlueprint(blueprint=Blueprint('HelloWorldTestWidgetPage2', __name__), rule='/<string:ac... |
test_pipeline.py | import threading
import time
from typing import List, Tuple
import actfw_core
from actfw_core.task import Consumer, Join, Pipe, Producer, Tee
class Counter(Producer[int]):
def __init__(self) -> None:
super().__init__()
self.n = 0
def proc(self) -> int:
time.sleep(0.01)
n = se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.