source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
FingerprintServer.py | #!/usr/bin/python
"""CherryPy server that loads and visualizes GB XML data"""
import os
import datetime, threading, random
import zipfile, shutil, re, time
import pickle
import xml
import cherrypy
import urlparse
import mimetypes
from cherrypy.lib.static import serve_file
from cherrypy.lib.static import serve_downloa... |
bili-pendant.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-01-22 09:56:52
# @Author : Lewis Tian (taeikyo@gmail.com)
# @Link : https://taseikyo.github.io
# @Version : Python3.7
"""
get the pendant from the reply below the video
write video link to bili-pendant.txt before run the script
api:https://api.bilibi... |
reporting_server.py | # Copyright (c) 2011 - 2017, Intel 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/LICENSE-2.0
#
# Unless required by applicable law or agre... |
casseroleCapture.py | #!/usr/bin/env python3
#----------------------------------------------------------------------------
# Copyright (c) 2018 FIRST. All Rights Reserved.
# Open Source Software - may be modified and shared by FRC teams. The code
# must be accompanied by the FIRST BSD license file in the root directory of
# the project.
#--... |
monitor.py | '''
Author: daoyi
Date: 2021-08-05 15:30:25
LastEditTime: 2021-10-05 17:32:39
Description: Quant Strategy monitor trade time.
'''
import datetime, time
from interval import Interval
import pandas as pd
import pysnooper as snp
import trading_calendars as tc
from pysnooper.utils import shitcode
from win10to... |
sideinputs.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... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from Queue import Queue, Empty
from threading import Thread
from time import sleep
from collections import defaultdict
# 第三方模块
from PyQt5.QtCore import QTimer
# 自己开发的模块
from eventType import *
########################################################################
class EventEngine(object... |
__init__.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
sqlite_web.py | #!/usr/bin/env python
import datetime
import math
import operator
import optparse
import os
import re
import sys
import threading
import time
import webbrowser
from collections import namedtuple, OrderedDict
from functools import wraps
from getpass import getpass
# Py3k compat.
if sys.version_info[0] == 3:
binary... |
html_cleaner.py | '''
Creator: Li Jingxiang
Description:
A multi thread HTML Cleaner.
Used to extract the text of the title attribute of the html file,
and also remove the marks of the html files.
'''
from bs4 import BeautifulSoup
import os
import re
import threading
import queue
import sys
def cleane... |
discord.py | # coding: utf-8
# Simple module to send messages through a Discord WebHook
# post a message to discord api via a bot
# bot must be added to the server and have write access to the channel
from __future__ import unicode_literals
import json
from threading import Thread, Event
import time
import requests
import websock... |
process.py | #
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# 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... |
webserver.py | #!/usr/bin/python
# Author: Hafez Farazi <farazi@ais.uni-bonn.de>
import os
import commands
import threading
import copy
import web
import shutil
from web import form
import time
import re
import base64
from threading import Thread
import subprocess
import pexpect
import roslib
import rospy
import re
from gait_msgs.msg... |
decorators.py | # -*- coding: utf-8 -*-
"""Custom decorator functions."""
import atexit
from contextlib import redirect_stderr, redirect_stdout
from functools import wraps
from threading import Thread
from typing import Callable
from engineering_diplomats.settings import emails_log_file
def thread_task(f: Callable) -> Callable:
... |
test_fork1.py | """This test checks for correct fork() behavior.
"""
import errno
import imp
import os
import signal
import sys
import time
import threading
from test.fork_wait import ForkWait
from test.test_support import TestSkipped, run_unittest, reap_children
try:
os.fork
except AttributeError:
raise TestSkipped, "os.fo... |
engine.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author = i@cdxy.me
# project = https://github.com/Xyntax/POC-T
import sys
from lib.core.data import th, conf, logger
try:
from gevent import monkey
monkey.patch_all()
import gevent
# TODO use monkey patch in script/*.py
except ImportError, e:
logger.err... |
spin.py | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import functools
import os
import signal
import sys
import threading
import time
from io import StringIO
import colorama
import six
from .compat import to_native_string
from .cursor import hide_cursor, show_cursor
from .misc import decode_... |
worker.py | import logging
import os
import shutil
from subprocess import PIPE, Popen
import threading
import time
import traceback
import socket
import http.client
import sys
from typing import Optional, Set, Dict
import psutil
import docker
from codalab.lib.telemetry_util import capture_exception, using_sentry
import codalab.w... |
DatabaseMigrator.py | from pymongo import MongoClient
import json
from common.logger import get_logger
from .CollectionMigrator import CollectionMigrator
import threading
logger = get_logger(__name__)
class DatabaseMigrator:
def __init__(self, client, cluster_name, database_name):
self.__client = client
self.__cluster... |
test_concurrent_clients.py | import pytest
from jina import Flow, Executor, Client, requests, DocumentArray, Document
import threading
import random
import time
from functools import partial
from jina.types.request.data import Response
class MyExecutor(Executor):
@requests(on='/ping')
def ping(self, docs: DocumentArray, **kwargs):
... |
test_watcher.py | import time
import queue
import pytest
from uuid import uuid4
from copy import deepcopy
from threading import Thread
from coincurve import PrivateKey
from teos.carrier import Receipt
from teos.gatekeeper import UserInfo, AuthenticationFailure, NotEnoughSlots, SubscriptionExpired
from teos.watcher import (
Watcher,... |
interpunction.py | import queue
from multiprocessing import Process, Queue
import threading
import time
from gtts import gTTS
import pyttsx3
from playsound import playsound
import time
import threading
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup as bs
import tkinter a... |
httpserver_mobile.py | # -*- coding: utf8 -*-
''' Автор ArtyLa '''
import typing, os, sys, io, re, time, json, threading, logging, importlib, queue, argparse, subprocess, glob, base64, collections
import wsgiref.simple_server, socketserver, socket, urllib.parse, urllib.request
import requests, psutil, bs4, uuid, PIL.Image, schedule
impo... |
AVR_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official AVR Miner 2.73 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from os import _exit, execl, mkdir
from os import name as osname
from os import path
from os import system as ossystem
from platform impor... |
pin.py | from tkinter import *
import menu
import utils
import uid as mainpage
import gc
import capture
import threading
import speech_recognition as sr
from pygame import*
sample_rate = 48000
chunk_size = 2048
r = sr.Recognizer()
device_id =1
operator=""
txt =""
result=0
def main(usrid):
glo... |
tableExtraction_names_shapes_mp.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 21:33:48 2020
@author: T1Sousan
"""
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import os
import sys
sys.path.insert(0, 'H:/GitHub/Extract-Tables-With-Titles')
import functions_names_shapes_mp as mf
import multiprocessing
import time
import camelot
#
de... |
client.py |
from email import message
import socket
from threading import Thread
#configurasi client dan server
connectionSocket = socket.socket()
serverIP = "127.0.0.1"
serverPort = 2222
def kirim_pesan(handlerSocket : socket.socket):
while True:
message = input()
handlerSocket.send(message.encode())
... |
test_s3_addon.py | # -*- coding: utf8 -*-
from tempfile import mkdtemp
from shutil import rmtree
from os import makedirs, environ
from os.path import join
from unittest.case import SkipTest
from tests.functional_tests import run_tuttle_file
from s3server import start, stop
from tuttle.project_parser import ProjectParser
from tuttle.addo... |
processandthread.py |
from multiprocessing import Process, Pool, Queue
import os, time, random, subprocess
def run_proc(name):
print('Run process %s in %s of parent %s' % (name, os.getpid(), os.getppid()))
def long_time_task(name):
print('Run task %s in %s' % (name, os.getpid()))
start = time.time()
time.sleep... |
batcher.py | # Copyright 2022 Hoshea Jiang
#
# 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, sof... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from config import Config
from app import mail, app
def send_async_mail(app, msg):
with app.app_context():
mail.send(msg)
def send_reset_password_mail(user, token):
msg = Message("[Flask Ap... |
controller.py | from __init__ import QMainWindow
from .view import View
from .module import Module
from threading import Thread
class Controller:
def __init__(self, parent_window: QMainWindow):
super().__init__()
self.parent_window = parent_window
self.config = Module.get_config()
self.view = Vie... |
demoReadSensorsAndMove.py | import Navigator
import time
import json
from threading import Thread
import random
nav = Navigator.Navigator()
nav.startSafe()
def readSensors(param):
while True:
sensorData = nav.readSensorsData()
print json.dumps(sensorData, indent=4, sort_keys=False)
time.sleep(0.5)
def move(x, y):
... |
manager.py | from typing import Dict
import graph_db.engine.types as types
from graph_db.fs.record import Record
from time import *
from .worker import start_worker_service
from multiprocessing import Process
import rpyc
from rpyc.utils.server import ThreadedServer
import json
class ManagerService(rpyc.SlaveService):
class... |
test_cooplock.py | import os
import pytest
from pathlib import Path
from multiprocessing import Process
from app.models import Experiment, ResourceLock
from utils.common import DbEngine
ENV = os.environ["CS_ENV"] = "test"
CONFIG_PATH = Path(__file__) / ".." / ".." / "config" / ("%s.json" % ENV)
CONFIG_PATH = str(CONFIG_PATH.resolve())
... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
qt5scales.py | #!/usr/bin/python
"""scalesgui.py
"""
import sys, random
import select
from threading import Thread
import threading
import mysql
import time
import users
from functools import partial
try:
from PyQt5 import QtGui, QtCore, QtWidgets
except:
print "Sorry, I can't seem to import PyQt5 for some reason."
sys.exit(... |
gui.py | # -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import messagebox
import asyncio
import threading
from analyzeGTFS import *
from observer import Publisher, Subscriber
import datetime as dt
import time
delimiter = " "
# not in use
class Navbar(tk.Frame):
def __init__(self, root, **kw):
super()._... |
concurrency8.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
import random
counter = 0
lock = threading.Lock()
def worker_a():
global counter
lock.acquire()
try:
while counter < 10:
counter += 1
print("Worker A is incrementing counter to {}".format(counter))... |
shotbot.py | """The main entry point for using Shotbot."""
import datetime
import logging
import os
import random
import time
from threading import Event, Thread
import dataset
from .bots import CommentContextRenderer, QuoteCommenter, Watcher
from .utils import ensure_schema
from .version import SHOTBOT_VERSION
USER_AGENT_TMPL =... |
test_index_20.py | import pytest
from base.client_base import TestcaseBase
from base.index_wrapper import ApiIndexWrapper
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from common.code_mapping import CollectionErro... |
meat.py | #!/usr/bin/env python
"""
NOTES:
- Session.msg
borrowed from statistics/msg/Session.msg
it's possible to introduce this dependency (or leave it as is)
- check statistics/StatsD.msg
Will need to define association between source topics and type of
result statistical data (whether it's event based or time-... |
db_tests.py | from itertools import permutations
try:
from Queue import Queue
except ImportError:
from queue import Queue
import re
import threading
from peewee import *
from peewee import Database
from peewee import FIELD
from peewee import attrdict
from peewee import sort_models
from .base import BaseTestCase
from .base ... |
decorators.py | import threading
import time
from functools import wraps
import statsd
import strgen
from flask import make_response
from flask import request
from flask_login import current_user
from flask_login import login_user
import config as base_config
import database.user
import util.cache
import util.response
from linkr imp... |
__init__.py | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 20 11:41:43 2020
@author: Ampofo
"""
import os
from time import sleep, time
import threading
import wave
import numpy as np
import struct
import pyaudio
from ffmpeg import Ffmpeg
class Audio:
"""
"""
def __init__(self):
self.file = ''
self... |
server.py | import threading
import traceback
import logging
from flask import Flask, render_template, request, jsonify, send_file
from werkzeug.exceptions import BadRequest
from sacnn.app import QueryController, ClassifierController, TrainController
logging.basicConfig(
format='%(asctime)s %(message)s',
datefmt='%d/%m/... |
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... |
change_type_batch.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import time
from PIL import Image
from queue import Queue
from threading import Thread
import hashlib
def change_type(q):
while True:
if q.empty():
print("done")
break
file = q.get()
try:
# print(file)
... |
TWCManager.py | #! /usr/bin/python3
################################################################################
# Code and TWC protocol reverse engineering by Chris Dragon.
#
# Additional logs and hints provided by Teslamotorsclub.com users:
# TheNoOne, IanAmber, and twc.
# Thank you!
#
# For support and information, please re... |
mount_test.py | # -*- coding: utf-8 -*-
import datetime
import fuse
import os
import stat
import tempfile
import threading
import time
import unittest.mock
from girder.cli import mount
from girder.exceptions import ValidationException
from girder.models.file import File
from girder.models.setting import Setting
from girder.models.use... |
sunny_new_line_detect_simple.py | #!/usr/bin/env python
from cv_bridge import CvBridge, CvBridgeError
from duckietown_utils.jpg import image_cv_from_jpg #location:f23-LED/led_detection/include
import threading
import rospy
import numpy as np
import cv2
import math
from sensor_msgs.msg import CompressedImage, Image
from ino_car.msg import LaneLine, Lan... |
composed_writer.py | #!/usr/bin/env python3
import logging
import sys
import threading
from os.path import dirname, realpath; sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
from logger.transforms.transform import Transform
from logger.writers.writer import Writer
from logger.utils import formats
########################... |
coref_model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import util
import coref_ops
import conll
im... |
transplant_master.py | from subprocess import Popen, DEVNULL, PIPE
from signal import SIGINT
import sys
import re
import os
import tempfile
from glob import glob
import zmq
import numpy as np
import base64
from threading import Thread
import msgpack
import ctypes.util
try:
from scipy.sparse import spmatrix as sparse_matrix
except Import... |
ws.py | #!/usr/bin/env python3
# requires https://pypi.python.org/pypi/websocket-client/
from excepthook import uncaught_exception, install_thread_excepthook
import sys
sys.excepthook = uncaught_exception
install_thread_excepthook()
# !! Important! Be careful when adding code/imports before this point.
# Our except hook is i... |
dummy_drone.py | import time
from threading import Thread, Lock
import random
import math
def clip(val, min_val, max_val):
return min(max(val, min_val), max_val)
class DummyRCDrone:
def __init__(self,
mass=1.0,
friction=1.0,
communication_delay_min=0.02,
co... |
marshal_server.py | # Copyright 2019 Atalaya Tech, 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, ... |
extract_tagme_entities.py | """
Lang: Py3
"""
import os
import sys
import csv
import time
import spacy
import queue
import random
import datetime
import tagme_API
import tagme_config
from threading import Thread
#List where all results are stored and later written to file
lst = []
#Number of worker threads
NUM_THREADS = 10
#Link probability
L... |
main.py | import numpy as np
import tools as tl
import tensorflow as tf
from scipy.interpolate import UnivariateSpline
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from PIL import Image
from threading import Thread
import time
def _bytes_feature(value):
"""Returns a bytes_list from a string... |
testarSerial.py | import serial # para instalar digite pip install pyserial
import threading
# Coloque a porta Serial de acordo com seu computador
porta = 'COM4' # no windows escolher a COMX e no linux ou mac em geral -> '/dev/ttyS0'
velocidadeBaud = 115200
try:
SerialArduino = serial.Serial(porta,velocidadeBaud, timeout = 0.2)
... |
RATAttack.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from PIL import ImageGrab # /capture_pc
from shutil import copyfile, copyfileobj, rmtree, move # /ls, /pwd, /cd, /copy, /mv
from sys import argv, path, stdout # console output
from json import loads # reading json from ipinfo.io
from w... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
source_ftp.py | """
This file provides functions to download the baseline XML files containing the PubMed data.
"""
import os.path
import re
import sys
import threading
import time
from ftplib import FTP
from pathlib import Path
from typing import Final
from app.pubmed.progress_analytics import DownloadAnalytics
from app.pubmed.downlo... |
eventing_rqg.py | import os,re
import zipfile
import datetime
import logging
from threading import Thread
from lib.membase.api.rest_client import RestConnection
from lib.testconstants import STANDARD_BUCKET_PORT
from pytests.eventing.eventing_constants import HANDLER_CODE, HANDLER_CODE_ERROR
from pytests.eventing.eventing_base import Ev... |
ChipBluezMgr.py | #
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2019-2020 Google LLC.
# Copyright (c) 2015-2018 Nest Labs, 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 ... |
03Generate_OD.py | import os, arcpy, datetime, ast, sys
from multiprocessing import Process
arcpy.env.overwriteOutput = True
def add_zero (num, digit):
string = str(num)
while len(string) < digit:
string = '0' + string
return string
def file_search (folder, ext):
result = []
all_file = os.listdir(folder)
for file in all_file:... |
mic.py | # Copyright 2017 Mycroft AI 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 writin... |
main_dist.py | import copy
import glob
import os
import time
from collections import deque
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from a2c_ppo_acktr import algo, utils
from a2c_ppo_acktr.algo import gail
from a2c_ppo_acktr.arguments import get_arg... |
centerline.py | from __future__ import print_function
from multiprocessing import Process
import sys
import os
import re
import pickle
import more_itertools as mit
from tqdm.auto import tqdm
from p_tqdm import p_map, p_umap, p_imap, p_uimap
from shapely.geometry import Polygon
from centerline.geometry import Centerline
import time
im... |
memcache.py | #! /usr/bin/env python
"""Creates an OData in-memory cache of key value pairs"""
import logging
import threading
import time
from wsgiref.simple_server import make_server
from pyslet import iso8601 as iso
from pyslet.odata2 import metadata as edmx
from pyslet.odata2 import core as core
from pyslet.odata2 import csdl... |
launch.py | ############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# #
# Licensed u... |
nn_base.py | # -*-coding:utf-8 -*-
import math
import random
#import os; os.chdir('./exp_4')
random.seed(0)
import multiprocessing,time
def rand(a, b):
return (b - a) * random.random() + a
def make_matrix(m, n, fill=0.0):
mat = []
for i in range(m):
mat.append([fill] * n)
return mat
def sigmoid(x):
... |
train.py | """Train a YOLOv5 model on a custom dataset
Usage:
$ python path/to/train.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import logging
import os
import random
import sys
import time
import warnings
from copy import deepcopy
from pathlib import Path
from threading import Thread
import ... |
prefix_mgr_client_tests.py | #!/usr/bin/env python3
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from builtins import... |
controller_arrow_test.py | #!/usr/bin/env python
import rospy
import geometry_msgs.msg
import mavros_msgs.srv
import mavros_msgs.msg
import ursa.srv
import tf2_ros
import tf2_geometry_msgs
import threading
import nav_msgs.msg
import tf_conversions
setpoint = geometry_msgs.msg.TransformStamped()
takeOff=False
tf_buffer = tf2_ros.Buffer(rospy.Dura... |
scrape.py | import threading
import os, errno
import datetime
import time
import random
import sys
import csv
import urllib.request
from datetime import date
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else: ra... |
web.py | """
Websocket server entry
"""
import os
import sys
#import asyncio
import json
import time
import traceback
import threading
import tornado.websocket
import tornado.ioloop
import tornado.httpserver
import tornado.web
from tornado import gen
from .. import VERSION
from ..devices.base.event_base import EventBase
from ..... |
seisDataLogger.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# seisDataLogger.py
#
# Connects to educational seismometer and gathers data.
# Make save to current trace every user-defined interval of seconds
# Reads a config file for parameters, but runs as a process.
#
from obspy.core import Stream, Trace, UTCDateTime
from seisDat... |
behavior_cloning.py | """Author: Brandon Trabucco, Copyright 2019, MIT License"""
import multiprocessing
from cs285.baselines.imitate.behavior_cloning import BehaviorCloning
from gym.envs.mujoco.humanoid import HumanoidEnv
def run_experiment(experiment_id):
BehaviorCloning(
HumanoidEnv,
logging_dir="./humanoid/behavi... |
faterwin.py | #!/usr/bin/env python2.7
# coding=utf-8
'''
@date = '17/4/7'
@author = 'chenliang'
@email = 'chenliang2380@cvte.cn'
'''
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from . import ui_fatermainwin
from . import editwidget
import os
import threading
from . import settingdlg
from . import statistic... |
database.py | import requests
from threading import Thread
from smartscheduler.exceptions import CommonDatabaseError
__all__ = ["SmartSchedulerDB"]
class SmartSchedulerDB:
"""Manages the database for the Smart Scheduler application."""
TAB_ACCOUNTS = "Accounts"
COL_STU_ID = "Student_ID"
COL_PSWRD_HASH = "Pswrd_ha... |
benchmark_utils.py | # This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
# Copyright by the AllenNLP authors.
"""
Utilities for working with the local dataset cache.
"""
import copy
import csv
import linecache
import os
import platform
import sys
from abc import ABC, abstractmethod
from col... |
run_agents.py | from multiprocessing import Process, JoinableQueue
import sys
from glob import glob
from os import path
from src.run import main
import json
agent_configs = sys.argv[1]
q = JoinableQueue()
NUM_THREADS = 24
def run_single_config(queue):
while True:
conf_path = queue.get()
params = json.load(open(co... |
scheduler.py | #!/usr/bin/env python
# encoding=utf-8
"""
Copyright (c) 2021 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFT... |
io_utils.py | # Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from pyln.client import RpcError
from shutil import copyfile
from utils import (
only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT,
account_balance, first_channel_id, basic_fee
)
import os
import queue
import pytest
import re
import threa... |
dev_server.py | import os.path
import sys
import atexit
import select
from multiprocessing import Process
try:
import subprocess32 as subprocess
except ImportError:
import subprocess
def start_elasticsearch(datadir='/tmp/genomic-server', host='127.0.0.1', port=9201, prefix='', conf='./utils/dev_server/conf', echo=False):
... |
worker.py | from dataclasses import dataclass, field
from typing import Callable, Dict, Tuple, List
import inspect
import threading
import logging
import time
from cadence.constants import DEFAULT_SOCKET_TIMEOUT_SECONDS
from cadence.conversions import camel_to_snake, snake_to_camel
from cadence.workflow import WorkflowMethod, Sig... |
Host.py | #! /usr/bin/python3.9
#
# MIT License
#
# Copyright (c) 2022 Adrian F. Hoefflin [srccircumflex]
#
# 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 limita... |
skipper.py | #!/usr/bin/python3
import logging
import time
from resources.settings import Settings
from resources.customEntries import CustomEntries
from resources.sslAlertListener import SSLAlertListener
from resources.mediaWrapper import Media, MediaWrapper
from resources.log import getLogger
from xml.etree.ElementTree import Pa... |
harlow.py | # Copyright 2016 Google Inc.
#
# 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 later version.
#
# This program is distributed in the ho... |
Sim_swarm.py | import os
import sys
import threading
from time import sleep
N = int(sys.argv[1])
k=0
string = "mavproxy.py"
def Launch_SITL_instances(i):
os.chdir("/home/aniket/ardupilot/ArduCopter/")
os.system("sim_vehicle.py -I"+str(i)+" --out=127.0.0.1:"+ str(14552 + i*10) +" --sysid "+str(i+1)+" -L L"+str(i+1))
for i in ran... |
intercom-automation-hat.py | #!/usr/bin/env python3
import time
import automationhat
import sys
import queue
import threading
import logging
logging.basicConfig(level=logging.INFO)
voltageLowLimit = float(sys.argv[1])
def main():
command_queue = queue.LifoQueue()
read_thread = threading.Thread(target=read_loop, args=[command_queue])
... |
galaxy_loggers.py | #!/usr/bin/python
#-*- coding: UTF-8 -*-
#
# galaxy_loggers-2.0.0.py
#
# 生成测试数据文件
#
# see: $APPHELP
#
# ZhangLiang, 350137278@qq.com
#
# LOGS:
# -- 2017-12-08: first created
# -- 2018-03-02: last updated and released
########################################################################
import os, sys, signal... |
text_input.py | #!/usr/bin/env python
"""
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 limitat... |
flask.py | """
Flask backend
"""
import json
import logging
import threading
from flask import Flask, request, send_from_directory, Response
from . import utils
from .httpbased import HttpContext, HttpHandler, run_event_loop
from .remote_access import start_remote_access_service
from .utils import make_applications, cdn_validat... |
Cloud_BPOW.py | #!/usr/bin/env python
import boto3
import paramiko
import sys
import time
import threading
ec2_client = boto3.client('ec2')
d = int(input("Enter d: "))
print (d)
N = input("Enter N:")
print (N)
#d = int(sys.argv[2])
input_number = min(int(N), 20)
response_123 = ec2_client.describe_instances()
#print(response_123)
I... |
concurrentCalc.py | import time
import random
from multiprocessing import Process
def calculate_prime(n):
primfac = []
d = 2
while d*d <= n:
while n % d == 0:
primfac.append(d)
n //= d
d += 1
if n > 1:
primfac.append(n)
return primfac
def execute_process():
for i in... |
server.py | from _socket import SHUT_RD, SHUT_RDWR
import logging
import socket
import threading
import select
from atavism.http11.objects import HttpRequest
class HttpServerError(Exception):
pass
class HttpServer(object):
""" Class that serves an HLSVideo via HTTP.
"""
def __init__(self, host=None, port=80, h... |
rpi.py | #!/usr/bin/env python3.6
"""Module for Raspberry-Pi-specific features, which are not available on other
systems."""
__author__ = 'Philipp Engel'
__copyright__ = 'Copyright (c) 2018 Hochschule Neubrandenburg'
__license__ = 'BSD-2-Clause'
import logging
import time
import threading
import arrow
try:
import RPi.G... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.