source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
modulewatcher.py | #####################################################################
# #
# modulewatcher.py #
# #
# Copyright 2013, Monash University ... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
main.py | import os
import itertools
import json
import random
import socket
import time
from datetime import datetime
from threading import Thread
from typing import Dict, List
import pytz
import schedule
from quart import Quart, request, make_response
from dotenv import load_dotenv
from pg import PostgresDB
from service imp... |
wandb_run.py | # File is generated by: tox -e codemod
# -*- coding: utf-8 -*-
from __future__ import print_function
import atexit
from datetime import timedelta
import glob
import json
import logging
import numbers
import os
import platform
import sys
import threading
import time
import traceback
import click
from six import iteri... |
smtio.py | #
# yosys -- Yosys Open SYnthesis Suite
#
# Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#... |
bridge.py | """
bridge-like integrator for amuse
the bridge class provides a bridge like coupling between different
gravitational integrators. In this way a system composed of multiple
components can be evolved taking account of the self gravity of the whole
system self consistently, while choosing the most appropiate i... |
UDP_Broadcast_server.py | import socket
import time
import json
import threading
Thread_Flag=1 #死锁计时进程
qian_Flag=0 #五次签到统计一次成员个数,五次签到一次都算
New_table=[] #新的成员列表,签到的就放里面
def sever():
global Thread_Flag,qian_Flag,New_table
HOST = '<broadcast>'
#HOST = "192.168.31.255"
ADDR = (HOST, 8884)
s = socket.socket(family=socket.AF_I... |
app.py | # encoding: utf-8
'''
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.... |
recommendationSystem.py | import cloudserver
from threading import Thread
import time
import datetime
import numpy as np
import cvxopt
from cvxopt import glpk
import random
from spaceNames import S
from spaceNames import NS
from spaceNames import realS
from personal import P
from personal import PO
from IDs import Jgroup
from IDs import Tgroup
... |
__main__.py | import logging.handlers
import os
import sys
from pathlib import Path
### Libraries for threading functions
import threading
from queue import Queue
### Libraries for the mouse and speech recognition
import mouse
import sounddevice as sd
import vosk
import argparse
import json
if getattr(sys, "fro... |
remote_scp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-12-13 16:35:33
# @Author : Zhongyi Qiao
# @Link : ${link}
# @Version : $Id$
import sys,os,getopt
import paramiko
import threading
import configparser
from scp import SCPClient
def getConnection(ip,username,password,command,port=22,local_filename="",r... |
test_etcd_mod.py | import logging
import threading
import time
import pytest
import salt.modules.etcd_mod as etcd_mod
from salt.utils.etcd_util import get_conn
from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import
docker = pytest.importorskip("docker")
log = logging.getLogger(__name__)
pyte... |
video_stage_manager.py | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... |
__init__.py | from PyQt4 import QtCore, QtGui
from pluginmgr import Tool
import multiprocessing
import queue
import sys, os
class Plugin(Tool):
_proc = None
_action = None
def action(self):
if self._action is None:
self._action = QtGui.QAction("Publish Catalog", None)
self._action.s... |
model_logging.py | import tensorflow as tf
import numpy as np
import scipy.misc
import threading
try:
from StringIO import StringIO # Python 2.7
except ImportError:
from io import BytesIO # Python 3.x
class Logger:
def __init__(self,
log_interval=50,
validation_interval=200,
... |
async_policy_saver.py | # coding=utf-8
# Copyright 2018 The TF-Agents 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... |
Tello3.py | #
# Tello Python3 Control Demo
#
# http://www.ryzerobotics.com/
#
# 1/1/2018
import threading
import socket
import sys
import time
from datetime import datetime
host = ''
port = 9000
locaddr = (host,port)
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
tello_add... |
general.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
General utils
"""
import contextlib
import glob
import inspect
import logging
import math
import os
import platform
import random
import re
import shutil
import signal
import threading
import time
import urllib
from datetime import datetime
from itertools import repeat
f... |
utils.py | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
# Copyright 2018 The AnPyLar Team. All Rights Reserved.
# Use of this source code is governed by an MIT-style license that
# can be found in the LICENSE file at http://anpyla... |
test_bz2.py | from test import support
from test.support import bigmemtest, _4G
import unittest
from io import BytesIO, DEFAULT_BUFFER_SIZE
import os
import pickle
import glob
import tempfile
import pathlib
import random
import shutil
import subprocess
import threading
from test.support import unlink
import _compression
import sys
... |
Assembly.py | from __future__ import print_function
import gc, os, sys
from copy import deepcopy
from warnings import warn
from time import time
import numpy as np
from scipy.sparse import coo_matrix, csc_matrix, csr_matrix
from ._LowLevelAssembly_ import _LowLevelAssembly_, _LowLevelAssemblyExplicit_, _LowLevelAssemblyLaplacian_
f... |
test_asynciothreadsafescheduler.py | import unittest
import asyncio
import threading
from datetime import datetime, timedelta
from rx.scheduler.eventloop import AsyncIOThreadSafeScheduler
class TestAsyncIOThreadSafeScheduler(unittest.TestCase):
def test_asyncio_threadsafe_schedule_now(self):
loop = asyncio.get_event_loop()
schedul... |
app.py | from flask import Flask, request, jsonify
app = Flask(__name__)
def success(msg):
return jsonify({"code": 200, "msg": msg})
def data(json_data):
return jsonify({"code": 200, "data": json_data})
def error(msg):
return jsonify({"code": 500, "msg": msg})
@app.route('/', methods=['GET'])
def get_status... |
worker_agent.py | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
VasoTracker.py | ##################################################
## VasoTracker Pressure Myograph Software
##
## This software provides diameter measurements (inner and outer) of pressurised blood vessels
## Designed to work with Thorlabs DCC1545M
## For additional info see www.vasostracker.com and https://github.com/kaelome/VasoTr... |
solver.py | import time
from copy import deepcopy
from multiprocessing import Process
import numpy as np
import libs.arg_parse_config as APC
import libs.astar as ASTAR
import libs.bfs as BFS
import libs.gfs as GFS
import libs.hc as HC
import libs.ids as IDS
import libs.puzzle as PUZZLE
import libs.state_node as STTREE
import lib... |
rboxdriver.py | import threading, sys, midi_driver, threading, json, pyautogui
from main import resource_path
from time import sleep
from textwrap import wrap
from debug import printd
from ahk import AHK
#Class called from main
class RBoxTask:
def __init__(self, port:str, midiout:int, midiin:int):
self.__running... |
datasets.py | import glob
# import cv2
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import numpy as np
import torch
from PIL import ExifTags, Image, ImageOps
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.general import torch_distributed_... |
localhost.py | #
# (C) Copyright Cloudlab URV 2021
#
# 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 wr... |
main.py | """爬虫模块"""
import re
import threading
import time
import pymongo
import requests
import config
import support.HDU
import support.POJ
import support.SDUT
# Database
db = pymongo.MongoClient(config.dbhost)[config.dbname]
def crawl(oj, sid):
"""爬取一道题目并返回该题目的dict"""
# 下载题目页面
r = requests.get(oj.problem_ur... |
create_synthtext_nori.py | import os
import math
import argparse
import pickle
from PIL import Image
from multiprocessing import Process
import numpy as np
import cv2
import nori2 as nori
import scipy.io as sio
from tqdm import tqdm
def get_file_list(dir_path):
print('Getting file list: ')
file_list = []
for dir_1 in os.listdir(dir_pa... |
monitor_domains.py |
from collections import defaultdict
ip2queryShort=defaultdict(lambda: {})
ip2query=defaultdict(lambda: {})
def getIPQueryMappingShort():
return ip2queryShort
def getIPQueryMapping():
return ip2query
def sortDomainsByLastResolved(domains,reverse=False):
now=time.time()
domains.sort(reverse=reverse, key=lambda d: ... |
ipython_server.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 ... |
manager.py | from recorder import recorder
from threading import Thread
from trackable import trackable
from fileIO import fileInputOutput
import os
import time
class manager:
__isRecording = False
__toBeTracked = []
__myReader = None
__myRecorder = None
# might put it in a primer
def __init__(self,proces... |
ConnectionHostVerification.py | #Created by Damian Krzemiński, contact: krzemodam2@gmail.com
_debug_ = False
import sys
sys.path.append(_app_path_ + "\\PythonScripts")
sys.path.append(_app_path_ + "\\PythonScripts\\Lib")
from MainForm import MainForm
import threading
import time
import rvt
import clr
clr.AddReference("System.Collections")
import S... |
__init__.py | '''
Set up the Salt integration test suite
'''
# Import Python libs
import re
import os
import sys
import time
import shutil
import pprint
import logging
import tempfile
import subprocess
import multiprocessing
from hashlib import md5
from datetime import datetime, timedelta
try:
import pwd
except ImportError:
... |
threadingScript.py | #!/usr/bin/env python
import os, sys
import threading
from Processor import Processor
from multiprocessing import Process, Queue
from view import getUser
def ThreadsSongs(user):
pro = Processor()
path = sys.argv[1]
q = Queue()
if not (path.endswith("/")):
path = path + "/"
imgPath = path + "img/"
if not os.pa... |
qt.py | #!/usr/bin/env python3
#
# Cash Shuffle - CoinJoin for Ergon
# Copyright (C) 2018-2019 Oregano LLC
#
# 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 l... |
test_flask_threads.py | from unittest.mock import Mock
import pytest
from flask import g
from flask import jsonify
from flaskthreads import AppContextThread
from flaskthreads import ThreadPoolWithAppContextExecutor
TEST_URL = '/test'
TEST_G = 'TEST'
TEST_RESULT = {'ok': True}
def test_app_context_thread(flask_app):
"""Test accessing ... |
test_utils.py | """Unit tests for the pynetdicom.utils module."""
from io import BytesIO
from threading import Thread
import logging
import sys
import pytest
from pydicom.uid import UID
from pynetdicom import _config, debug_logger
from pynetdicom.utils import (
pretty_bytes, validate_uid, make_target, set_uid, decode_bytes
)
f... |
needswx.py |
import sys, os, os.path, fnmatch, types, threading, time
import re, copy, io, csv, math, json
from optparse_gui import OptionParser, UserCancelledError, Progress
import optparse
from configparser import ConfigParser
import wx
from wx.lib.filebrowsebutton import FileBrowseButton
def quotedifnec(f):
if ' ' in f:
... |
rpc_video_h264_streaming.py | import time
from queue import Queue
from data_sender import send
import argparse
from threading import Thread, Event
import cv2
import numpy as np
from redis import Redis
import pickle
import torch
from models import TSN
from baseline_rpc_rgb import make_ucf, make_infer, make_hmdb
from sklearn.metrics import confusion_... |
test_immediatescheduler.py | import pytest
import unittest
import threading
from datetime import timedelta
from time import sleep
from rx.disposable import Disposable
from rx.scheduler import ImmediateScheduler
from rx.internal.basic import default_now
from rx.internal.constants import DELTA_ZERO
from rx.internal.exceptions import WouldBlockExce... |
test_pye_performance.py | #!/usr/bin/env python
#
# Copyright 2015 Falldog Hsieh <falldog7@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
sensor.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2022 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function # Requires: Python >= 2.6
import sys
sys.dont_write_bytecode = True
import cProfile
import inspect
import math
impor... |
echoBenchmarks_py.py | # -*- coding: utf-8 -*-
"""
Created on Mon May 11 09:59:05 2020
Performs echoBenchmark of the current HELICS Version. It provides some
performacne results of HELICS for a single core and multiple cores for a
variety of core types.
The command line arguments for the function can be found in the code
following the lin... |
DyStockBackTestingStrategyEngineProxy.py | import multiprocessing
import threading
import queue
from .DyStockBackTestingStrategyEngineProcess import *
class DyStockBackTestingStrategyEngineProxy(threading.Thread):
""" 以进程方式启动一个周期的策略回测 """
def __init__(self, eventEngine):
super().__init__()
self._eventEngine = eventEngine
se... |
rpc_test.py | import concurrent.futures
import contextlib
import json
import os
import sys
import threading
import time
from collections import namedtuple
from functools import partial
from threading import Event
from threading import Lock
from unittest import mock
import torch
import torch.nn as nn
import torch.distributed as dis... |
mp_multifile.py | import sys
# import mss
sys.path.append('../')
from mss import mssmain as msm
from mss import align
import multiprocessing
from timeit import default_timer as timer
import glob
import pandas as pd
def main():
start = timer()
input_path = str(input('file path (folder): \n'))
print(glob.glob(input_path + '... |
stepRunXFOILSimulationWithSearch.py | import json
import os.path
import posixpath
import platform
import sys
import time
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
ON_POSIX = 'posix' in sys.builtin_module_names
def e... |
test_clock.py | # Copyright 2018 Open Source Robotics Foundation, 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... |
ModelTest.py | import os
import signal
import sys
import time
from abc import ABCMeta, abstractmethod
from subprocess import Popen, PIPE
from threading import Thread
import json
import psutil
class ModelTest(object):
@abstractmethod
def prepare(self, h, soma, mechanism):
pass
@abstractmethod... |
timeitTest.py | # timeitTest.py
import threading
import random
import time
def myWorker():
for i in range(5):
print("Starting wait time")
time.sleep(random.randint(1, 5))
print("Completed Wait")
thread1 = threading.Thread(target=myWorker)
thread2 = threading.Thread(target=myWorker)
thread3 = threading.T... |
QualisysTab.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
test_threading.py | # Very rudimentary test of threading module
print("GEVENT: Begin import")
import test.test_support
from test.test_support import verbose, cpython_only
from test.script_helper import assert_python_ok
import random
import re
import sys
thread = test.test_support.import_module('thread')
threading = test.test_support.impo... |
core.py | import os
import random
import requests
import json
import re
import time
import threading
import subprocess
from Utils import ReadConfig
import command
regex_ip = re.compile(r'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
regex_site = re.compile(r'^[0-9a-zA-Z\-]{1,16}\.[0-9a-zA-Z\-]{1,16}\.[0-9a-zA-Z\-... |
translator.py |
import re
import threading
def parse_text(session, args):
bytes_list = args[0].split(',')
bytes_array = bytearray([int(i) for i in bytes_list]).decode()
sentences = bytes_array.split('\n')
var_dict = dict()
executable_file = ''
for i in range(3):
try:result_apis = re.fin... |
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... |
pershom_exp_signatures.py | import os
import numpy as np
import random as rand
import pylab as py
import matplotlib.pyplot as plt
import scipy.interpolate
from matplotlib import cm
from lib import helper as hp
from lib.tda import sim_homology
from scipy.interpolate import Rbf, interp1d, interp2d
from typing import List, Set, Dict, Tuple, Optiona... |
gui.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import threading
from collections import deque
from math import ceil
from random import shuffle
import qdarkstyle
import requests
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QSize, pyqtSignal, QRectF, Qt, QPoint, QTimer
from PyQt5.QtGui i... |
chisel.py | """
A simple client that uses the Python ACME library to run a test issuance against
a local Boulder server. Usage:
$ virtualenv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python chisel.py foo.com bar.com
"""
import json
import logging
import os
import sys
import threading
import time
import urllib... |
Minhacarteira.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.5.6)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ... |
interactive_debugger_plugin.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
helpers.py | # -*- coding: utf-8 -*-
"""
Random user endpoint.
Using Mimesis example for this: https://bit.ly/37KUAlo
"""
import emoji
from mimesis import Generic
from mimesis.enums import Gender
from mimesis.schema import Field, Schema
import pytube
from google.cloud import storage
import os
import random
import string
import j... |
test_pysnooper.py | # Copyright 2019 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
import io
import textwrap
import threading
import types
import os
import sys
from pysnooper.utils import truncate
import pytest
import pysnooper
from pysnooper.variables import needs_parentheses
from .utils import (as... |
test_stream_xep_0092.py | import threading
import unittest
from sleekxmpp.test import SleekTest
class TestStreamSet(SleekTest):
def tearDown(self):
self.stream_close()
def testHandleSoftwareVersionRequest(self):
self.stream_start(mode='client', plugins=['xep_0030', 'xep_0092'])
self.xmpp['xep_0092'].name = ... |
pc.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.5.6)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ... |
healthCheck.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2020-06-05
# @Author : lework
# @Desc : 针对supervisor的应用进行健康检查
# @Version : 1.5
import os
import sys
import time
import json
import yaml
import base64
import socket
import signal
import smtplib
import datetime
import platform
import threading
import subproces... |
httpserver.py | ###
# Copyright (c) 2011, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import print_function
import copy
import errno
import fnmatch
import hashlib
import logging
import multiprocessing
import os
import re
import salt
import signal
import sys
import threading
import time
import traceback
impo... |
animehive.py | import os
import json
import datetime
import threading
from multiprocessing import Pool
import pymongo
import telegram
from telegram import KeyboardButton, ReplyKeyboardMarkup
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import CallbackQueryHandler
from telegram.ext import ... |
manager.py | import os
import sched
import threading
import time
from flask import request, current_app
from .response_methods import make_response_content
from ..conf.config import HttpMethod, Constant
from ..exceptions import ErrorResponse
from ..exceptions.error_code import MsgCode
from ..exceptions.log_msg import ErrorMsg, In... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
collective_ops_test.py | # 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 required by applicab... |
test_multiprocessing.py | import os
import logging
from multiprocessing import Process
from enverus_direct_access import DirectAccessV2
from tests.utils import set_token
set_token()
LOG_LEVEL = logging.DEBUG
if os.environ.get("GITHUB_SHA"):
LOG_LEVEL = logging.ERROR
DIRECTACCESS_API_KEY = os.environ.get("DIRECTACCESS_API_KEY")
DIRECTACC... |
jecretz.py | #!/usr/bin/env python3
import argparse
import requests
import re
import os
import sys
import json
import itertools
from rules import custom_rules
from keywords import search_keywords
from textwrap3 import wrap
from queue import Queue
from threading import Thread
from terminaltables import AsciiTable
from urllib3.util.... |
trainer_utils.py | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. 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 ap... |
wsgi.py | import os
import sys
import logging
import threading
import gevent.monkey
import mongoengine
from app import app
import db
import worker
app.config['MONGODB_SETTINGS'] = {
'db': db.DATABASE_NAME,
'alias': db.DATABASE_ALIAS
}
@app.before_first_request
def setup_application():
mongoengine.connect(db.DATA... |
batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
plugin.py | import threading, time
def agent():
while True:
print("running agent in thread")
time.sleep(1)
print("done")
threading.Thread( target = agent ).start()
|
pruebas_canvas.py | from tkinter import *
from reportlab import *
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from reportlab.lib.colors import tan, black, green
from reportlab.lib.units import inch
from reportlab.lib.units import mm
import tkinter.colorchooser as colorchooser
import math
import time
impo... |
facs_client.py | import socket
import threading
import logging
logger = logging.getLogger(__name__)
LOCAL_BIND_ADDR = ('127.0.0.1', 8000)
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.connect(LOCAL_BIND_ADDR)
logger.warning('[NEW CONNECTION] Connected to the server')
def send_data():
threadi... |
Flooder.py | #!/usr/bin/python3
import requests, string, socket, socks, time, random, threading, sys, datetime, argparse, os, multiprocessing
mode = "Flood"
parser = argparse.ArgumentParser(description=("PacketFlooder"))
parser.add_argument("-host", type=str,
help="• Victim [HOST]")
parser.add_argument("-p", "--port", type=i... |
emanemanager.py | """
emane.py: definition of an Emane class for implementing configuration control of an EMANE emulation.
"""
import logging
import os
import threading
from core import CoreCommandError
from core import constants
from core.api import coreapi
from core.api import dataconversion
from core.conf import ConfigGroup
from co... |
client.py | from socket import *
import sys
import select
import math
import string
import threading
import argparse
import os.path
import time
#Argument parsing
parser = argparse.ArgumentParser(description = 'Get file from the web')
parser.add_argument('-n' , '--nthreads', type = int, required=True , help='Number of threads for ... |
__init__.py | from cryptography.fernet import Fernet
import http.server
import requests
from socket import *
import threading
import time
import base64
import json
import typing
import copy
import traceback
from peerbase.peer_utils import *
import random
import hashlib
from concurrent.futures import ThreadPoolExecutor
def process_... |
server.py | #!/usr/bin/env python3
import socket
import threading
from .connection import MCConnection
from .crypto import generate_keys
from .world import MCWorld
class MCServer:
PROTOCOL = 107
PROTOCOL_NAME = "1.9"
closed = False
def __init__(self, config):
self.config = config
af = socket.AF_... |
httpserver.py | ###
# Copyright (c) 2011, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... |
recipe-577028.py | import multiprocessing as MP
from sys import exc_info
from time import clock
DEFAULT_TIMEOUT = 60
################################################################################
def timeout(limit=None):
if limit is None:
limit = DEFAULT_TIMEOUT
if limit <= 0:
raise ValueError()
def wrapp... |
test_random.py | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, assert_, assert_raises, assert_equal, assert_warns,
assert_no_warnings, assert_array_equal, assert_array_almost_equal,
suppress_warnings
)
fr... |
server.py | import math
import os
import queue
import sys
import threading
import time
import uuid
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from threading import Event as ThreadingEventType
from time import sleep
import grpc
from dagster import check, seven
from dagster.core.code_pointe... |
test_base.py | import asyncio
import aiounittest
import threading
import time
from rtcbot.base import (
SubscriptionConsumer,
SubscriptionProducer,
ThreadedSubscriptionConsumer,
ThreadedSubscriptionProducer,
)
class TestBaseClasses(aiounittest.AsyncTestCase):
async def test_SubscriptionConsumer(self):
c ... |
car_helpers.py | import os
import threading
import json
import requests
from common.params import Params
from common.basedir import BASEDIR
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars
from selfdrive.car.vin import get_vin, VIN_UNKNOWN
from selfdrive.car.fw_versions import get_fw_versions, match_fw... |
test_read_parsers.py | # This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2013-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
nbsp.py | # _*_ coding:UTF-8 _*_
import time
from threading import Thread, Event
from six.moves import queue
from .logger import get_logger
LOGGING = get_logger(__name__)
class NonBlockingStreamReader:
def __init__(self, stream, raise_EOF=False, print_output=True, print_new_line=True, name=None):
'''
strea... |
Decoradores.py | from time import time
import threading
from multiprocessing import Process
from apps.Util_apps.LogProject import logging
def count_elapsed_time(f):
"""
Decorator.
Execute the function and calculate the elapsed time.
Print the result to the standard output.
"""
def wrapper(*args, **kwargs):
... |
clientgui.py | from PyQt5.QtWidgets import QLabel ,QWidget, QMainWindow,QApplication,QMessageBox
from PyQt5.QtCore import QStringListModel
from PyQt5.QtWidgets import QFileDialog,QListView #必须导入,否则会出错 -1073740791 (0xC0000409)
from UI import Ui_MainWindow # 【UI】指的是UI文件的文件名
from os import path,listdir
from server import Node, UNHAND... |
HiwinRA605_socket_ros_20190614135358.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
book_scraper_multithreading.py | from bs4 import BeautifulSoup
from urllib.request import urlopen
import threading
from multiprocessing.pool import ThreadPool
import queue
import csv
# Get the next page url from the current page url
def get_next_page_url(url):
page = urlopen(url)
soup_page = BeautifulSoup(page, 'lxml')
page.close()
# ... |
dataset_utils.py | #!/usr/bin/env python
# coding=utf8
"""Contains utilities for downloading and converting datasets."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import gzip
import os
import shutil
import ssl
import sys
import tarfile
import threading
im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.