source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_frontend_connection_limit.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
7_can_loopback.py | import os
import time
import random
import threading
from panda import Panda
from nose.tools import assert_equal, assert_less, assert_greater
from .helpers import panda_jungle, start_heartbeat_thread, reset_pandas, time_many_sends, test_all_pandas, test_all_gen2_pandas, clear_can_buffers, panda_connect_and_init
# Rese... |
registry.py | import logging
import math
import sys
import threading
from spectator.clock import SystemClock
from spectator.counter import Counter, NoopCounter
from spectator.distsummary import DistributionSummary, NoopDistributionSummary
from spectator.gauge import Gauge, NoopGauge
from spectator.http import HttpClient
from specta... |
async_rl.py |
import time
import multiprocessing as mp
import psutil
import torch
from collections import deque
import math
from rlpyt.runners.base import BaseRunner
from rlpyt.utils.quick_args import save__init__args
from rlpyt.utils.logging import logger
from rlpyt.utils.collections import AttrDict
from rlpyt.utils.seed import s... |
RemoteManager.py | from . import default_address, headers
from ..managers import get_python_manager
from ..settings import is_progress_enabled
import requests, time, logging, json
from requests_toolbelt.multipart.encoder import MultipartEncoderMonitor, MultipartEncoder
import pandas as pd
from ..dataset.GDataframe import GDataframe
from ... |
print_process_info.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from multiprocessing import Process
import os
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def f(name):
info('function f')
print... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
import csv
f... |
Time_Network.py | import argparse
import numpy as np
import tensorflow as tf
#from reader_frozen import plot_prediction, convert_time, read_data, read_mesh, read_soln
import os
import sys
import time
import multiprocessing
import threading
import csv
# Import flags specifying dataset parameters
from timer_flags import getFlags
DATA_... |
test__makefile_ref.py | from __future__ import print_function
import os
from gevent import monkey; monkey.patch_all()
import re
import socket
import ssl
import threading
import unittest
import errno
dirname = os.path.dirname(os.path.abspath(__file__))
certfile = os.path.join(dirname, '2.7/keycert.pem')
pid = os.getpid()
import sys
PY3 = sys... |
etcd_rendezvous.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import datetime
import json
import logging
import random
import sys
import threading
impo... |
hashdump_sam.py | import core.implant
class HashDumpSAMImplant(core.implant.Implant):
NAME = "SAM Hash Dump"
DESCRIPTION = "Dumps the SAM hive off the target system."
AUTHORS = ["zerosum0x0"]
def load(self):
self.options.register("LPATH", "/tmp/", "local file save path")
self.options.register("RPATH", ... |
main.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 in writin... |
train_net_pth.py | import time, os, sys
import os.path as osp
import numpy as np
from Queue import Queue
from threading import Thread
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
sys.path.append("lib/model")
from average_distance_loss.modules.average_distance_loss import AverageDistanc... |
test_etcd3.py | """
Tests for `etcd3` module.
----------------------------------
"""
import base64
import contextlib
import json
import os
import signal
import string
import subprocess
import tempfile
import threading
import time
import grpc
from hypothesis import given, settings
from hypothesis.strategies import characters
impor... |
kprun.py | from obstacle_tower_env import ObstacleTowerEnv
# 參數設定檔
# from keepitpossible.common import gcp_parameters
from keepitpossible.common import pc_parameters
# RL模型
from keepitpossible.model import dppo_model
from keepitpossible.model import ex_dppo_model
# 多工
from keepitpossible import dppo_worker
import numpy a... |
dbt_integration_test.py | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, merge, pu... |
webpage_check.py | from telegram.ext import Updater, CommandHandler
import threading
import requests
import logging
import time
logging.basicConfig(level=logging.INFO)
token = ""
target_url = ""
chat_ids = set()
updater = Updater(token)
def page_updated():
interval = 5
older = requests.get(target_url).text
while True:
... |
parser_pipeline.py | import logging
import multiprocessing
PARSER_PROCESS_JOIN_TIMEOUT = 3
logger = logging.getLogger('grab.spider.parser_pipeline')
class ParserPipeline(object):
def __init__(self, bot, mp_mode, pool_size, shutdown_event,
network_result_queue, parser_result_queue,
requests_per_proce... |
cli_shell.py |
from cmd import Cmd
import socket
import logging
import threading
import time
import signal
import threading
import time
import select
import socket
import logging
import threading
import time
import signal
import threading
import time
import select
import sys
argi = len(sys.argv) - 1
assert(argi == 2)
sock = socke... |
agent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Dusan Klinec, ph4r05, 2018
#
# Note pickling is used for message serialization.
# This is just for the prototyping & fast PoC, pickling wont be used in the production.
# Instead, protobuf messages will be defined and parsed to avoid malicious pickling.
#
import ... |
test_distributed_sampling.py | import dgl
import unittest
import os
from dgl.data import CitationGraphDataset
from dgl.distributed import sample_neighbors, find_edges
from dgl.distributed import partition_graph, load_partition, load_partition_book
import sys
import multiprocessing as mp
import numpy as np
import backend as F
import time
from utils i... |
SWHear.py | """
this is a stripped down version of the SWHear class.
It's designed to hold only a single audio sample in memory.
check my githib for a more complete version:
http://github.com/swharden
"""
import pyaudio
import time
import numpy as np
import threading
def getFFT(data,rate):
"""Given some data... |
remote_capture.py | import renderdoc as rd
import threading
import time
# This sample is intended as an example of how to do remote capture and replay
# as well as using device protocols to automatically enumerate remote targets.
#
# It is not complete since it requires filling in with custom logic to select
# the executable and trigger ... |
ndvi.py | import datetime
import time
import cv2
import numpy as np
import multiprocessing as mp
# set up matplotlib in such a way that it does not require an X server
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from imageio import imwrite
from astroplant_camera_... |
transport.py | import threading
import sounddevice as sd
import numpy as np
class NodeHandler:
"""
:param nodes: An array of nodes that should be played
:type nodes: array
:param fs: sample frequency of the handler, used to calculate a value of time
:type fs: float
"""
def __init__(self, nodes=[], fs=4800... |
launchnotebook.py | """Base class for notebook tests."""
from __future__ import print_function
from binascii import hexlify
from contextlib import contextmanager
import errno
import os
import sys
from threading import Thread, Event
import time
from unittest import TestCase
pjoin = os.path.join
try:
from unittest.mock import patch
... |
Simulation.py | """Simulation System for PiCN. The PiCN Simulation System consists of a Simulation Bus and Simulation Interfaces
The Simulation Bus is the dispatcher for different Simulation Interfaces. Each Simulation Interface has a unique address
which can be used as identify for a Face in the LinkLayer.
"""
import multiprocessing... |
Light.py | from GarageBackend.Constants import *
from GarageBackend.ConfigManager import *
from nanpy import ArduinoApi, SerialManager
from time import sleep
from threading import Thread
import time
import datetime
import os, sys, traceback
log = logging.getLogger('Garage.Light')
class Light():
def __init__(self,lid,board_... |
server.py | import json
from datetime import timedelta
from robot import config, utils, logging, constants, Updater
import base64
import requests
import tornado.web
import tornado.ioloop
from tornado import gen
import tornado.httpserver
import tornado.options
import hashlib
import threading
import asyncio
import subprocess
import ... |
rulegen.py | #!/usr/bin/env python3
# Rulegen.py - Advanced automated password rule and wordlist generator for the
# Hashcat password cracker using the Levenshtein Reverse Path
# algorithm and Enchant spell checking library.
#
# This tool is part of PACK (Password Analysis and Cracking Kit)
#
# VERSION 0.0... |
server.py | import os
import yaml
import json
import time
import base64
import random
import hashlib
import asyncio
import requests
import markdown
import threading
import subprocess
import tornado.web
import tornado.ioloop
import tornado.options
import tornado.httpserver
from tools import make_json, solr_tools
from robot import c... |
test_xla_profiler.py | # Copyright The PyTorch Lightning 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 applicable law or agreed to i... |
explorerphat.py |
import time
from threading import Thread
from explorerphatdashboard.api.explorerphat.analog import Analog as ApiAnalog
from explorerphatdashboard.api.explorerphat.connection import Connection
from explorerphatdashboard.api.explorerphat.input import Input as ApiInput
from explorerphatdashboard.api.explorerphat.motor im... |
meshConvertT.py | import os
from threading import Thread
def f(name):
if os.path.isdir(name) and name != "blank_foamcase":
oldDir = os.getcwd()
os.system('cd ~/OpenFOAM/tjc2017-7/run')
os.chdir(oldDir)
os.chdir(name)
os.system('gmshToFoam busemann.msh')
os.chdir(oldDir)
... |
SDK.py | #Decompiled by MR.K7C8NG
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
from requests.exceptions import ConnectionError
from mechanize import Browser
reload(sys)
sys.setdefaultencoding('utf8')
br = mechanize.Browser... |
worker.py | import socket
import json
import time
import sys
import random
import numpy as np
import threading
import logging
#intializing the logging and setting up the logger
def init_log(id,port):
filen1="Worker_"+str(id)+".log"
filen2="log_from_worker"
logging.basicConfig(filename=filen1, format='%(... |
test_signal.py | import enum
import errno
import inspect
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import threading
import time
import unittest
from test import support
from test.support import os_helper
from test.support.script_helper import assert_python_ok, spawn_python
try:
... |
UdpBroadcaster.py | import os
import sys
import logging
import socket
import threading
import time
import datetime
import logging
import psutil
#import netifaces
import Controller
class UdpBroadcaster(Controller.Controller):
DEBUG_INTERVAL = 5 * 60 # 5 minutes
def __init__(self, name, port, delay, log_level):
self.name =... |
Nhentai.py | import requests
from bs4 import BeautifulSoup
import sys
from Site import Common
from time import sleep
import threading
import queue
class Nhentai:
def __init__(self, url):
self.title=''#
self.chapters=['']
#initial author only for title page
self.author=''#
#the h1 t... |
collectionPoint.py | """
BTLE iBeacon collection module
WIP
RegisteredClientRegistery manages the list of clients that are in rage
event manager controllers and handles events and figures out if the event needs to be handled and put in the list of registered clients
"""
import sys
sys.path.append('./collection_modules/btleCollectionPoin... |
app.py | import logging
from threading import Thread
from flask import Blueprint
from mini_vstreamer.api.defaults import app, api, system
from mini_vstreamer.api.endpoints.configs import ns as config_ns
from mini_vstreamer.core.config import ConfigIO
from mini_vstreamer.core.stream.queue import mutate_system as load_queues
from... |
server.py | import sys
try:
sys.dont_write_bytecode = True
except:
pass
import os
FINISH = False
manager = None
zeLock = None
def checkPsUtil():
try:
import psutil
except:
raise Exception("Python package psutil could not be imported!! Aborting.")
def periodicRefresh():
""" Periodic refresh la... |
aggregate.py | # @file aggregate.py
# @brief One script to rule them all.
#
# Downloads schedule data for a specific semester, including course
# meeting times, course descriptions, pre/corequisites, FCEs, and so on.
# @author Justin Gallagher (jrgallag@andrew.cmu.edu)
# @since 2015-04-07
import json
import os.path
fro... |
test_connection.py | # Copyright 2009-2012 10gen, 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 writing,... |
test_postgresql.py | import datetime
import mock # for the mock.call method, importing it without a namespace breaks python3
import os
import psycopg2
import shutil
import subprocess
import unittest
from mock import Mock, MagicMock, PropertyMock, patch, mock_open
from patroni.async_executor import CriticalTask
from patroni.dcs import Clu... |
api.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program 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 Software Foundation; either version 2
# of the License, or (at your option) any late... |
base_worker.py | # -*- coding: utf-8 -*-
# @Author: Macsnow
# @Date: 2017-05-15 14:03:39
# @Last Modified by: Macsnow
# @Last Modified time: 2017-05-19 17:01:33
from queue import Queue
from threading import Thread, Event
class WorkerExit(Exception):
pass
class BaseWorker(object):
def __init__(self):
... |
monitor.py | #!/usr/bin/env python
import sys
import os
import hashlib
import md5
import mmap
import datetime
import time
import threading
import Queue
import logging
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler
import watchdog
from libs.comictaggerlib.comicarchive import *
from libs.com... |
watcher.py | from queue import Queue
from threading import Thread
from collections import OrderedDict
from readerwriterlock import rwlock
from teos.logger import get_logger
import common.receipts as receipts
from common.appointment import AppointmentStatus
from common.tools import compute_locator
from common.exceptions import Basi... |
main.py | from threading import Thread
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
import logging
from time import sleep
from classes.MediaPlayer import MediaPlayer
from classes.MediaPlayerConfig import MediaPlayerConfig
import pyudev
config = MediaPlayerConfig('media_player.conf')
cad = ... |
t3.py | import threading
# global variable x
x = 0
def plus():
global x
x += 1
def thread_task(lock):
for _ in range(100000):
lock.acquire()
plus()
lock.release()
def main_task():
global x
x = 0
# creating a lock
lock = threading.Lock()
# creating threads
t1 ... |
test.py | import json
import logging
import random
import threading
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance
import helpers.client
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
# Creates S3 bucket for tests and allows anonymous rea... |
shell.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
bosi.py | # Copyright 2018 Big Switch Networks, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
Spec.py | # -*- coding: utf-8 -*-
import glob
import io
import sys
import os
from collections import defaultdict, OrderedDict
from datetime import datetime
from . import biblio
from . import boilerplate
from . import caniuse
from . import mdnspeclinks
from . import config
from . import constants
from . import datablocks
from ... |
collection.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 t... |
test_api.py | #!/usr/bin/python
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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 ... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import ast
import inspect
import os
import platform
import re
import... |
sshslot.py | from utility import *
import subprocess
import sys
import os
import threading
import time
ssh_privkey_file = os.getenv("SSH_PRIVKEY_FILE", "daala.pem")
binaries = {
'daala':['examples/encoder_example','examples/dump_video'],
'x264': ['x264'],
'x264-rt': ['x264'],
'x265': ['build/linux/x265'],
'x26... |
__init__.py | # -*- coding: utf-8 -*-
# vim: set expandtab shiftwidth=4:
__import__('gevent.monkey').monkey.patch_all()
import time
import logging
import threading
from tornado.ioloop import IOLoop
from tornado.tcpserver import TCPServer
from daemon.simpledaemon import SimpleDaemon
from utils.server.tornado import TornadoDaemonB... |
CasesSolver_mapRanking.py | import os
import cv2
import sys
import time
import yaml
import random
import signal
import argparse
import itertools
import subprocess
import numpy as np
import matplotlib.cm as cm
import drawSvg as draw
import scipy.io as sio
from PIL import Image
from multiprocessing import Queue, Pool, Lock, Manager, Process
from o... |
s3.py | """
Object Store plugin for the Amazon Simple Storage Service (S3)
"""
import logging
import multiprocessing
import os
import shutil
import subprocess
import threading
import time
from datetime import datetime
from galaxy.exceptions import ObjectNotFound
from galaxy.util import string_as_bool, umask_fix_perms
from g... |
LiDAR.py | import serial
import serial.tools.list_ports
import math
import threading
import os
import sys
import time
import matplotlib.pyplot as plt
import rplidar
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
data_path = os... |
mm_util.py | import keyring
import os
import yaml
import json
import re
import config
import shutil
import tempfile
import string
import random
import base64
import zipfile
import time
import datetime
import threading
import sys
import re
import xmltodict
import codecs
import traceback
import plistlib
import platform
import iterto... |
zerodeploy.py | """
.. versionadded:: 3.3
Requires [plumbum](http://plumbum.readthedocs.org/)
"""
from __future__ import with_statement
import rpyc
import socket
from rpyc.core.service import VoidService
from rpyc.core.stream import SocketStream
try:
from plumbum import local, ProcessExecutionError
from plumbum.path import co... |
test.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import coco80_to_coco91_class, check_dataset, check... |
okta.py | """
Copyright 2016-present Nike, 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 writing, softw... |
connection_test.py | import demistomock as demisto
from Active_Directory_Query import main
import socket
import ssl
from threading import Thread
import time
import os
import pytest
BASE_TEST_PARAMS = {
'server_ip': '127.0.0.1',
'secure_connection': 'None',
'page_size': '500',
'credentials': {'identifier': 'bad', 'password'... |
client.py | """This module implements the SlowLoris client."""
import threading
import time
from .connection import LorisConnection
from .user_agent import get_random_user_agent
class LorisClient:
"""SlowLoris attack client."""
def __init__(self):
self.targets = []
self.keepalive_thread = threading.Thre... |
volume.py | from threading import Thread
import threading
from lib.testconstants import STANDARD_BUCKET_PORT
from couchbase_helper.document import DesignDocument, View
from basetestcase import BaseTestCase
from rebalance.rebalance_base import RebalanceBaseTest
from membase.api.rest_client import RestConnection, RestHelper
class ... |
test_socketblocker.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
import time
from threading import Thread
import pytest
from ..disable_internet import no_internet
from ...extern.six.moves import BaseHTTPServer, SimpleHTTPServer
from ...extern.six.moves.urllib.r... |
potplayer.py | # Copyright (c) 2021 by xfangfang. All Rights Reserved.
#
# Using potplayer as DLNA media renderer
#
# Macast Metadata
# <macast.title>PotPlayer Renderer</macast.title>
# <macast.renderer>PotplayerRenderer</macast.title>
# <macast.platform>win32</macast.title>
# <macast.version>0.4</macast.version>
# <macast.host_versi... |
test_base.py | """
switchboard.tests.test_base
~~~~~~~~~~~~~~~
:copyright: (c) 2015 Kyle Adams.
:license: Apache License 2.0, see LICENSE for more details.
"""
import time
import threading
import pytest
import pytest as pytest
from unittest.mock import Mock, patch
from blinker import Signal
from ..base import MongoModelDict, Cach... |
producerconsumer.py | '''
Created on 21 Aug 2015
@author: up45
'''
import os, logging
from threading import Thread
import binascii
import zmq
import numpy as np
#import zmq.PAIR, zmq.DEALER, zmq.ROUTER, zmq.ETERM
logging.basicConfig(level=logging.DEBUG)
PIPELINE = 2
def zpipe(ctx):
"""build inproc pipe for talking to threads
... |
server.py | #!/usr/bin/env python
import socket
from threading import Thread
import numpy as np
import os
import argparse
import config
import util
import joblib
import traceback
from keras.applications.imagenet_utils import preprocess_input
import time
util.set_img_format()
parser = argparse.ArgumentParser()
parser.add_argument... |
repairer.py | # -*- coding: utf-8 -*-
# Copyright 2013-2020 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
replserver.py | """
socat - UNIX-CONNECT:repl.sock
import sys, threading, pdb, functools
def _attach(repl):
frame = sys._current_frames()[threading.enumerate()[0].ident]
debugger = pdb.Pdb(
stdin=repl.conn.makefile('r'),
stdout=repl.conn.makefile('w'),
)
debugger.reset()
while frame:
frame... |
C16_tcpserver.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'TCP网络编程的练习'
__author__ = 'Jacklee'
# socket模块
# 网络编程的基础是Internet协议族
# 协议族中最长用的是HTTP协议
# HTTP协议的网络层是TCP协议
# TCP协议是一种面向连接的通讯协议
# 由一个Server端和多个Client端组成
# 客户端与服务端建立连接后,可以双向进行数据的传输
# TCP协议实现
import socket
import threading, time
# socket对象
# socket(family=AF_INET, type=S... |
evaluate_mcd.py | #!/usr/bin/env python3
# Copyright 2020 Wen-Chin Huang and Tomoki Hayashi
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Evaluate MCD between generated and groundtruth audios with SPTK-based mcep."""
import argparse
import fnmatch
import logging
import multiprocessing as mp
import os
from typing impo... |
Alert_Area1.py | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import pygame
import pymysql
from PyQt5.QtCore import QTimer
import time
import smtplib
import os
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
import multiprocess... |
usercog.py | import io
from datetime import datetime, timedelta
from threading import Thread
import discord
import jikanpy
import timeago
from discord.ext import tasks, commands
from jikanpy import Jikan
from tqdm import tqdm
from naotomori.util import jikanCall
class UserCog(commands.Cog):
"""
UserCog: handles all the ... |
main.py | import threading
from queue import Queue
from spider import Spider
from domain import *
from storage import *
PROJECT_NAME = 'Musketeer'
HOMEPAGE = 'http://www.musketeer-liu.info'
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QUEUE_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '/crawled.txt'
THREAD_N... |
maintenance.py | # Copyright 2017 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
runme.py | import time
import os
import threading
def runPy(name):
os.system("start cmd /c python " + name)
authServer = threading.Thread(target=runPy, args=("server.py",), name="auth_server")
client = threading.Thread(target=runPy, args=("client.py",), name="client")
authServer.start()
client.start()
|
runner.py | import threading
from rlrunner.agents.base_agent import BaseAgent
from rlrunner.envs.base_env import BaseEnv
from rlrunner.stats.base_stat_saver import BaseStatSaver
from rlrunner.termination.base_termination_condition import BaseTerminationCondition
class Runner:
"""
# This is the main class and the class you sho... |
A3C_discrete_action.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning.
The Cartpole example.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
tensorflow 1.8.0
gym 0.10.5
"""
import multiprocessing
import threading
imp... |
example_test.py | import http.server
import os
import random
import re
import socket
import ssl
import struct
import subprocess
from threading import Thread
import ttfw_idf
from RangeHTTPServer import RangeRequestHandler
from tiny_test_fw import DUT, Utility
server_cert = '-----BEGIN CERTIFICATE-----\n' \
'MIIDXTCCAkWgAw... |
test_load.py | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 21:20:40 2019
@author: GaurangPrasadML
"""
import psycopg2
from sqlalchemy import create_engine
import pandas as pd
import threading;
import pymongo;
import json;
conn = psycopg2.connect("host=localhost dbname=test5 user=test5 password=test5")
print("Con... |
dispatcher.py | import logging
import os
import socket
import time
import typing as T
from threading import Thread
from traceback import format_exc
import stopit
import websocket
from rembrain_robot_framework.ws import WsCommandType, WsRequest
class WsDispatcher:
CONNECTION_RETRIES = 3
def __init__(self, propagate_log=Tru... |
PokemonTournament_StreamlabsSystem.py | #---------------------------------------
# Import Libraries
#---------------------------------------
import clr
import sys
import json
import os
import random
import ctypes
import threading
import time
import codecs
from datetime import datetime
from datetime import timedelta
#---------------------------------------
#... |
am2320.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Todo: ログ出力用のバッファを実装
import smbus
import time
import datetime
import threading
address = 0x5c # 1011100(7bit,0x5c) + 0(1bit,R/W bit) = 0xb8
READ_INT = 5 # [sec], each reading interval is to be grater than 2 sec
LOG_INT = 600 # [sec]
DEBUG_MODE = True
# 日時付きでメッセージ表示
def ... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_router.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import unittest, threading, time, datetime
from rapidsms.router import Router
from rapidsms.connection import Connection
from rapidsms.message import Message
from rapidsms.backends.backend import Backend
from rapidsms.tests.harness import MockApp, MockLogger
class Te... |
test_functools.py | import abc
import collections
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import unittest
from weakref import proxy
try:
import threading
except ImportError:
threading = None
import functools
py_functools = support.import_fresh_mod... |
coordinate_script.py | #!/usr/bin/python
"""
"""
import os
#import sys
import ConfigParser
# import subprocess
import logging
import logging.handlers
import socket
import time
# import glob
import threading
# ####################################### Start of Classes ##########################################
class getProps(object):
# ... |
blockchain_processor.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, ... |
test_mainwindow.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
# -----------------------------------------------------------------------------
"""
Te... |
test_async_websockets.py | import asyncio
from threading import Thread
import pytest
from slack_sdk.web.async_client import AsyncWebClient
from slack_bolt.adapter.socket_mode.websockets import AsyncSocketModeHandler
from slack_bolt.app.async_app import AsyncApp
from tests.mock_web_api_server import (
setup_mock_web_api_server,
cleanup_... |
driver.py | from typing import Dict, List, Union
import threading
import asyncio
import json
from aiocqhttp import CQHttp, MessageSegment
from unified_message_relay.Core.UMRType import UnifiedMessage, MessageEntity, ChatType, EntityType
from unified_message_relay.Core import UMRDriver
from unified_message_relay.Core import UMRLogg... |
build_image_data.py | #!/usr/bin/python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.