source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
change_progress_size.py | # coding=utf-8
import sys
import threading
import api_server
import progress_data
import utilities
DEFAULT_PROGRESS_SIZE_CIRCULAR = 0.32
DEFAULT_PROGRESS_SIZE_LINEAR = 0.40
DEFAULT_PROGRESS_SIZE = DEFAULT_PROGRESS_SIZE_CIRCULAR
DEFAULT_PROGRESS_DEPTH = 1.6
server_thread = None
def start_server_threaded():
glo... |
client.py | """
Python 3
Usage: python3 TCPClient3.py localhost 12000
coding: utf-8
"""
from socket import *
from threading import Thread
import sys
import threading
import readline
import time
# This function takes the message which needs to be print, and safely prints out
# the message without bre... |
osc.py | import procgame.game
from procgame.game import Mode
import OSC
import socket
import threading
import pinproc
class OSC_Mode(Mode):
"""This is the awesome OSC interface. A few parameters:
game - game object
priority - game mode priority. It doesn't really matter for this mode.
serverIP - the IP address ... |
test_subprocess.py | import unittest
from test import test_support
import subprocess
import sys
import signal
import os
import errno
import tempfile
import time
import re
import sysconfig
try:
import resource
except ImportError:
resource = None
try:
import threading
except ImportError:
threading = None
mswindows = (sys.pl... |
lab13_b.py | from sys import setrecursionlimit
import threading
setrecursionlimit(10 ** 9)
threading.stack_size(3 * 67108864)
def main(): #Knuth_Morris_Pratt
file_input, file_output = open("search2.in", 'r'), open("search2.out", 'w')
def get_prefix(string : str) -> list:
prefix = [0] + [None for _ in range(len(stri... |
train.py | # -*- coding: utf-8 -*-
##############################################################
# train.py
# Copyright (C) 2018 Tsubasa Hirakawa. All rights reserved.
##############################################################
import os
import time
import math
import numpy as np
import multiprocessing as mp
from MaxEntIR... |
12_edf_wound_wait_gui.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import ping_code as pc
import socket
import struct
import subprocess as sp
from threading import Thread
import paramiko
import ast
import time
import os
import getpass as gp
import psutil
from drawnow import *
from matplotlib import py... |
test_util.py | # Copyright 2015 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... |
launchnotebook.py | """Base class for notebook tests."""
from __future__ import print_function
import os
import sys
import time
import requests
from contextlib import contextmanager
from threading import Thread, Event
from unittest import TestCase
pjoin = os.path.join
try:
from unittest.mock import patch
except ImportError:
fr... |
lock.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""These tests ensure that our lock works correctly.
This can be run in two ways.
First, it can be run as a node-local t... |
app.py | from distutils.version import LooseVersion
from logging import getLogger
import select
import sys
from threading import Thread
from time import sleep
import webbrowser
import wx
from wx.adv import TaskBarIcon, TBI_DOCK
from .._utils import IS_OSX, IS_WINDOWS
from ..plot._base import CONFIG
from .about import AboutFra... |
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... |
TelloDriver.py | #!/usr/bin/env python2
import socket
import struct
import threading
import time
class TelloDriver:
def __init__(self, tello_ip='192.168.10.1', tello_port=8889):
# Initialize state
self.alive = False # Set to False to terminate listeners
self.state = 0 # enum; 0=connecting, 1=connected
... |
git_post_receive.py | #!/usr/bin/env python
#
# This script is run after receive-pack has accepted a pack and the
# repository has been updated. It is passed arguments in through stdin
# in the form
# <oldrev> <newrev> <refname>
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/... |
report.py | from datetime import datetime
from os import makedirs, path, remove
from os.path import join, exists
from shutil import rmtree
from flask import Blueprint, Response, request
from flask.helpers import send_file
from threading import Thread
from modules.AI.classifier_trainer import ClassifierTrainer
from services.classif... |
directSummation.py | """
A Program to compute and plot N Body simulation for learning purposes (Following Prof. Barba's Group)
@author : Vijai Kumar
@email : vijai@vijaikumar.in
"""
# Import the necessary libraries
import numpy as np
import matplotlib.pylab as plt
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fr... |
concurrency.py | import codecs
from invoke.vendor.six.moves.queue import Queue
from invoke.vendor.six.moves import zip_longest
from invoke.util import ExceptionHandlingThread
from pytest import skip
from fabric import Connection
_words = "/usr/share/dict/words"
def _worker(queue, cxn, start, num_words, count, expec... |
main.py | import binascii
from romTables import ROMWithTables
import shlex
import randomizer
import logic
import spoilerLog
import re
from argparse import ArgumentParser, ArgumentTypeError
def goal(goal):
if goal == "random":
goal = "-1-8"
elif goal in [ "seashells", "raft" ]:
return goal
m = re.mat... |
nntrain.py | import tensorflow as tf
from utils.nn import linearND, linear
from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph_list as _s2g
from models import *
from ioutils import *
import math, sys, random
from collections import Counter
from optparse import OptionParser
from functools import partial
... |
__init__.py | import sys
import os
import traceback, linecache
import re
import objc
import time
import random
import EasyDialogs
from PyObjCTools import NibClassBuilder, AppHelper
from Foundation import *
from AppKit import *
from threading import Thread
from nodebox.gui.mac.ValueLadder import MAGICVAR
from nodebox.gui.mac import ... |
remote.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... |
Hiwin_RT605_ArmCommand_Socket_20190627173531.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
from std_msgs.msg import Int32MultiArray
import math
import enum
pos_feedback_times = 0
mode_feedback_times = 0
msg_feedback = 1
#接收策略端... |
session.py | # Copyright 2015 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... |
locators.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import thread... |
mp_crawler.py | #!/usr/bin/python
usage = "crawler.py [--options] config.ini"
description = "a script that lives persistently and forks off Omicron jobs periodically"
author = "R. Essick (reed.essick@ligo.org)"
#import lal
from lal import gpstime
from pylal import Fr
import os
import sys ### only needed if we touch sys.stdout?
impor... |
util.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 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... |
test_server.py | #!/usr/bin/env python
from multiprocessing import Process, Manager
def f(d, l):
d[1] = '1'
d['2'] = 2
d[0.25] = None
l.reverse()
if __name__ == '__main__':
manager = Manager()
d = manager.dict()
l = manager.list(range(10))
p = Process(target=f, args=(d, l))
p.start()
p.join(... |
info_api.py | import queue
import json
import os
import datetime
from threading import Thread
from flask import Response, request
from flask_restplus import Namespace, Resource
from flask.json import jsonify
from hti.server.state.events import subscribe_for_events, log_event
from hti.server.state.globals import (
get_catalog,... |
fib_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
from __future__ import print_function
from __future__ import unicode_literals
fro... |
measure_methods.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... |
data_reader.py | import numpy as np
import pandas as pd
import scipy.signal
import tensorflow as tf
pd.options.mode.chained_assignment = None
import logging
import os
import threading
import obspy
from scipy.interpolate import interp1d
tf.compat.v1.disable_eager_execution()
# from tensorflow.python.ops.linalg_ops import norm
# from ... |
pclassifier.py | import logging
from multiprocessing import get_context
from typing import List, Dict, Tuple, Union
import torch
from numpy import ndarray
from scipy.special import softmax
from torch import Tensor
from torch.nn.utils.rnn import pad_sequence
from transformers import BertTokenizerFast, BertForSequenceClassification
fro... |
login.py | # -*- coding: utf8 -*-
from threading import Thread
from activity.unicom.dailySign import SigninApp
from utils.unicomLogin import UnicomClient
import json
import time
import requests
from utils.config import account_json,account
class LoginAgain(UnicomClient):
"""
签到页积分任务
"""
def __init__(self, m... |
materialize_with_ddl.py | import time
import pymysql.cursors
import pytest
from helpers.network import PartitionManager
import logging
from helpers.client import QueryRuntimeException
from helpers.cluster import get_docker_compose_path, run_and_check
import random
import threading
from multiprocessing.dummy import Pool
from helpers.test_tools... |
email.py | # -*- coding: utf-8 -*-
from flask_mail import Message
from flask import render_template
from threading import Thread
from app import app, mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(receiver, subject, template, **kwargs):
msg = Message(app.config['FLA... |
test_threading.py | # Very rudimentary test of threading module
import test.test_support
from test.test_support import verbose
import random
import re
import sys
thread = test.test_support.import_module('thread')
threading = test.test_support.import_module('threading')
import time
import unittest
import weakref
import os
import subproces... |
app.py | #!/usr/bin/env python3
import configparser
import time
import threading
import mastodonTool
import os
import datetime
import markovify
import exportModel
import re
# 環境変数の読み込み
config_ini = configparser.ConfigParser()
config_ini.read('config.ini', encoding='utf-8')
def worker():
# 学習
domain = config_ini['read... |
test_ftp_file_download_manager.py | """ simple ftp tests """
# --------------------------------------------------
# Imports
# --------------------------------------------------
import filecmp
import os
import Queue
import shutil
import time
from threading import Thread
import ftplib
import unittest
from pyftpdlib.authorizers import DummyAuthorizer
fr... |
foggycam.py | """FoggyCam captures Nest camera images and generates a video."""
from urllib.request import urlopen
import pickle
import urllib
import json
from http.cookiejar import CookieJar
import os
from collections import defaultdict
import traceback
from subprocess import Popen, PIPE
import uuid
import threading
import time
fr... |
demo_subscription.py | #!/usr/bin/env python
# encoding: utf-8
from multiprocessing import Process
from time import sleep
from ringcentral.subscription import Events
from ringcentral import SDK
from config import USERNAME, EXTENSION, PASSWORD, APP_KEY, APP_SECRET, SERVER
def main():
sdk = SDK(APP_KEY, APP_SECRET, SERVER)
platform ... |
SMuRF.py | #!/usr/bin/python
# Import modules
import vcf as pyvcf
import pysam
import argparse
import multiprocessing as mp
import queue
import time
import sys
import collections
import subprocess
import os
import glob
import pandas as pd
#import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('pdf')
import matplotlib.... |
views.py | from django.shortcuts import render, HttpResponse, redirect
from SqlMaster.models import *
import hashlib
import datetime
import random
from django.views.decorators.csrf import csrf_exempt
import json
from threading import Thread
from queue import Queue
from django.db.models import F, Q
# 生成设备注册码
def createCode():
... |
test_events.py | """Tests for events.py."""
import collections.abc
import concurrent.futures
import functools
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import types
import errno
import unitte... |
h264_stream.py | import io
import os
import logging
import subprocess
import time
import sarge
import sys
import flask
from collections import deque
try:
import queue
except ImportError:
import Queue as queue
from threading import Thread, RLock
import requests
import yaml
from raven import breadcrumbs
import tempfile
from .utils... |
code.py | import sys
import json
import time
import requests
import threading
from .notifier import emailsend, dummySend
def User_check(user):
while True:
time.sleep(3)
api = "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin?pincode="+user.pincd+"&date="+user.date
headers = {
... |
connection_manager_old.py | import socket
import threading
import pickle
import signal
import codecs
import time
import os
from concurrent.futures import ThreadPoolExecutor
from .message_manager import (
MessageManager,
MSG_ADD,
MSG_REMOVE,
MSG_CORE_LIST,
MSG_REQUEST_CORE_LIST,
MSG_PING,
MSG_ADD_AS_EDGE,
MSG_REMOV... |
ingest-multi.py | #!/usr/bin/env python
# Licensed to Rackspace under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Rackspace licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use thi... |
thead_lock.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import threading
import time
num = 0
def run(n):
time.sleep(1)
global num
num +=1
print '%s\n' %num
for i in range(100):
t = threading.Thread(target=run,args=(i,))
t.start()
'''
总结:使用如上线程你会发现问题,并没有输出到100会出现数据丢失的问题
'''第二期 Y20170505 ... |
02_ThreadingEnum.py | import time
import threading
def sing():
for i in range(5):
print("Sing national song ...\n")
# time.sleep(1)
def dance():
for i in range(5):
print("Dance friend step ...\n")
# time.sleep(1)
def main():
t1 = threading.Thread(target=sing)
t2 = threading.Thread(target... |
app_test.py | from __future__ import print_function
from __future__ import unicode_literals
import re
import os
import socket
import select
import subprocess
from threading import Thread, Event
import ttfw_idf
import ssl
def _path(f):
return os.path.join(os.path.dirname(os.path.realpath(__file__)),f)
def set_server_cert_cn(i... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Version 3.2.3 is currently recommended when
SSL is enabled, since this version worked the best with SSL in
internal testing.... |
manager.py | # -*- coding: utf-8 -*-
"""
conpaas.core.manager
====================
ConPaaS core: service-independent manager code.
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
import time
import os.path
import libcloud
from conpaas.core.log import create_logger
from conpa... |
important_exercise.py | """
使用两个线程,
一个打印1-52 这52个数字
一个打印a-z这些字母
两个线程一起执行,要求打印出来的顺序为
12A34B...5152Z
多为面试题的笔试题
"""
from threading import Lock, Thread
import time
lock01 = Lock()
lock02 = Lock()
def print_int():
for i in range(1, 52, 2):
lock01.acquire()
print(i)
print(i + 1)
lock02.release()
def print_a... |
helpers.py | # -*- coding: utf-8 -*-
'''
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
'''
# pylint: disable=repr-flag-used-in-string,wrong-import-order
... |
Ex11_multiprocessing.py | """
기존의 파이썬은 여러 모듈에서 프로세스를 다루는 함수와 메소드를 따로 제공하여 중복성이 심했다고 한다.
파이썬은 multiprocessing 모듈이 thread 모듈보다 나중에 설계되었다고 한다.
파이썬은 병렬처리를 위해 쓰레드를 사용하지 않고 multiprocessing 모듈을 사용한다.
multiprocessing 모듈은 스레딩 모듈과 유사한 API를 사용한다.
또한 스레드 대신 하위 프로세스를 사용하여 전역 인터프리터 잠금을 효과적으로 처리한다.
유닉스 계열과 윈도우 모두 실행된다.
"""
import os
... |
mupen64plus_env.py | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import abc
import array
import inspect
import itertools
import json
import os
import subprocess
import threading
import time
from termcolor import cprint
import yaml
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import nump... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from decimal import D... |
k_means.py | import random
import time
from amr_categories.Animals import Animals
from amr_categories.CleanWater import CleanWater
from amr_categories.Environment import Environment
from amr_categories.FoodSafety import FoodSafety
from amr_categories.HumanConsumption import HumanConsumption
from amr_categories.HumanIPC import Huma... |
gateway.py |
#!/usr/bin/env python
from flask import Flask, render_template, Response, request
from flask_cors import CORS, cross_origin
from flask import json
import random
import serial_devices
import threading
import logging
# Raspberry Pi camera module (requires picamera package)
# from camera_pi import Camera
app = Flask(_... |
TCP_client.py | import socket
import time
import threading
import random
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 22244 # The port used by the server
server_addr = (HOST,PORT)
messages = [b'Message 1 from client.', b'Message 2 from client.',b'Message 3 from client.',b'KRAJ']
def spoji(tid):
print('start... |
client_message.py | import threading
import socket
host = '127.0.0.1'
port = 55554
receive = False
message = ''
def start_chat():
nickname = "Text Holder"
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((host, port))
def receive():
while True:
try:
global m... |
main.py | from __future__ import print_function
import argparse
import os
import torch
import torch.multiprocessing as mp
import my_optim
from envs import create_atari_env
from model import ActorCritic
from test import test
from train import train
# Based on
# https://github.com/pytorch/examples/tree/master/mnist_hogwild
# T... |
abstract_jacobian_unit_test.py | '''
Copyright 2022 Airbus SAS
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, software
dis... |
ddos_script.py | import socket
import threading as thr
# first the basic information
the_target = '127.0.0.1' # this is your local machine's ip(you can also put a domain name here) use only authorized servers to run this script
port = 80 # This is the http port, but you can also attack others like: smtp port 25, ftp port 21, ssh port... |
keras_test_ssp.py | from __future__ import print_function
import keras
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.applications.resnet50 i... |
speicherung.py | import mysql.connector #Modul, dass es ermöglicht mit MySQL-Servern zu kommunizieren.
import time #Modul, zum warten im Programmcode und abrufen der aktuellen Systemzeit.
from threading import Thread #Wird dazu verwendet, Funktionen asyncron aufzurufen.
from ledController import farbeAnzeigen #Wird für die Ansteuerung ... |
viewerwidgets.py | # -*- coding: utf-8 -*-
import os.path
import sys
import time
from threading import Thread, Lock
import pickle
#Eigene Imports
import eegpy
from eegpy.formats import f32
from eegpy.misc import FATALERROR
from eegpy.ui.icon import image_from_eegpy_stock, eegpy_logo
from eegpy.ui.widgets.dialogwidgets import show_info_d... |
KafkaCli.py | import time
from tkinter import Tk, Toplevel, Label, CENTER, Entry, Button, Text, Scrollbar, \
DISABLED, END, NORMAL, LEFT, RIGHT, StringVar, BOTTOM, IntVar
import paho.mqtt.client as paho
from pykafka import KafkaClient
import threading
# Variaveis relacionadas ao MQTT
client = ''
username = ''
topic = ... |
general.py | from flask import (
Blueprint,
render_template,
request,
jsonify,
make_response
)
# Templates folder and static_folder are for auth routes
general_bp = Blueprint('general_bp',
__name__,
template_folder='templates',
static_folder='static',)
from app import db
from dryFunction... |
live_graph_3.py | ###################################################################
# #
# PLOTTING A LIVE GRAPH #
# ---------------------------- #
# EMBED A MATPLOTLIB ANIMATION IN... |
fslinstaller.py | #!/usr/bin/python
# Handle unicode encoding
import csv
import errno
import getpass
import itertools
import locale
import os
import platform
import threading
import time
import shlex
import socket
import sys
import tempfile
import urllib2
from optparse import OptionParser, OptionGroup, SUPPRESS_HELP
from re import co... |
core.py | #!/usr/bin/env python2
# core.py
#
# This file contains the main class of the framework which
# includes the thread functions for the receive and send thread.
# It also implements methods to setup the TCP connection to the
# Android Bluetooth stack via ADB port forwarding
#
# Copyright (c) 2020 The InternalBlue Team. ... |
statsig_server.py | import asyncio
import threading
from .evaluator import _ConfigEvaluation, _Evaluator
from .statsig_network import _StatsigNetwork
from .statsig_logger import _StatsigLogger
from .dynamic_config import DynamicConfig
from .statsig_options import StatsigOptions
from .version import __version__
RULESETS_SYNC_INTERVAL = 10... |
abstract.py | """
Abstract Module
===============
This module defines the abstract classes used by the incremental modules.
The AbstractModules defines some methods that handle the general tasks of a
module (like the handling of Queues).
The IncrementalQueue defines the basic functionality of an incremental queue
like appending an ... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import _thread
import importlib.machinery
import importlib.util
import os
import pickle
import random
import re
import subprocess
impo... |
parse_machos.py | """
Copyright 2021 Kimo Bumanglag <kimo.bumanglag@trojans.dsu.edu>
"""
import argparse
import py7zr
import zipfile
import magic
import os
import json
import sys
import math
import subprocess
import vt-py
from macholibre import parse
from tqdm import tqdm
from threading import Thread
parser = argparse.ArgumentParser(
... |
button.py | import RPi.GPIO as GPIO
import time
import threading
from pygame import mixer
mixer.init()
GPIO.setmode(GPIO.BCM)
INPUT = 24
GPIO.setwarnings(False)
GPIO.setup([INPUT], GPIO.IN , pull_up_down=GPIO.PUD_DOWN)
isFirstPress = True
def music_thread():
mixer.music.load('./audio/Moose-Sound.wav')
mixer.music.play()
... |
subsync.py | import os
import time
import shlex
import shutil
import requests
import threading
import json
from watchdog.observers import Observer
from watchdog.events import FileSystemEvent, FileSystemEventHandler
from subprocess import check_call, DEVNULL, check_output, STDOUT, CalledProcessError
BAZARR_URL = os.environ.get('BA... |
tb_experiments.py | import argparse
import itertools
import multiprocessing
import stat
import time
import psutil
import os
import json
import uuid
import research_toolbox.tb_filesystem as tb_fs
import research_toolbox.tb_io as tb_io
import research_toolbox.tb_logging as tb_lg
import research_toolbox.tb_utils as tb_ut
import research_tool... |
main.py | #!/usr/bin/env python3
import signal
import threading
import readline
from cmd import Cmd
import d2agent
class Shell(Cmd):
agent = {}
prompt = "d2agent> "
intro = " _____ \n"
intro = intro + " / ____| \n"
intro = intr... |
ezbenchd.py | #!/usr/bin/env python3
"""
Copyright (c) 2015, Intel Corporation
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 conditions an... |
cli.py | import ast
import inspect
import os
import platform
import re
import sys
import traceback
import warnings
from functools import update_wrapper
from operator import attrgetter
from threading import Lock
from threading import Thread
import click
from werkzeug.utils import import_string
from .globals import current_app
... |
scan_run.py | import os
import multiprocessing
from multiprocessing import Process
try:
import nvidia_smi
except:
pass
os.environ["OBJC_DISABLE_INITIALIZE_FORK_SAFETY"] = "YES"
multiprocessing.set_start_method('fork')
def scan_run(self):
'''The high-level management of the scan procedures
onwards from preparat... |
vsphere-brute.py | import optparse
import time
from threading import *
from pysphere import VIServer, VIProperty, MORTypes, VIApiException
from pysphere.resources import VimService_services as VI
from pysphere.vi_task import VITask
import sys
maxConnections = 10
connection_lock = BoundedSemaphore(value=maxConnections)
Found = False
Fai... |
ar1.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re
#(qr=True)
cl = LINETCR.LINE()
#cl.login(qr=True)
cl.login(token="Enb2crNrFWoERzVn9oVc.b0v8ubUr/rhlN/vtCN3hJa.hGDAlZYQITl7Tsj1ijqDETJAYyoO00tI+MA08eNhTSE=")... |
test_wrappers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import os
from .common_test_data import *
from reusables import unique, lock_it, time_it, queue_it, setup_logger, \
log_exception, remove_file_handlers, retry_it, catch_it, ReusablesError
@unique(exception=OSError, error_text="WHY ME!")
def unique_functi... |
app.py | import sys
sys.path.insert(0,"./src/utilities/yolov5/utils")
from src.kafka_module.kf_service import block_segmenter_request_worker, process_block_segmenter_kf
from anuvaad_auditor.loghandler import log_info
from anuvaad_auditor.loghandler import log_error
from flask import Flask
from flask.blueprints import Bluepri... |
dod_gui.py | import subprocess
import threading
import PySimpleGUI as sg
# oriented this gui on the example at:
# https://raw.githubusercontent.com/PySimpleGUI/PySimpleGUI/069d1d08dc7ec19a8c59d5c13f3b8d60115c286b/UserCreatedPrograms/jumpcutter/jumpcutter_gui.py
def main():
layout = [
[sg.Text("Download OSCAR Corpus"... |
bsv-pbv-submitblock.py | #!/usr/bin/env python3
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
We will test the following situation where block 1 is the tip and three blocks
are sent for parallel validation:
1
/ | \
2 3 4
Blocks 2,4 are hard to valid... |
emails.py | #!/usr/bin/python3
"""
@Author : Zhaohui Mei(梅朝辉)
@Email : mzh.whut@gmail.com
@Time : 2018/12/1 10:37
@File : emails.py
@Version : 1.0
@Interpreter: Python3.6.2
@Software: PyCharm
@Description: 邮件通知设置
"""
from threading import Thread
from flask import url_for, current_app
from flask_mail impor... |
scheduler.py | import time
import traceback
from multiprocessing import Process
from cookiespool.api import app
from cookiespool.config import CYCLE, TESTER_MAP, API_PORT, API_HOST, API_PROCESS, GENERATOR_PROCESS, VALID_PROCESS
from cookiespool.config import GENERATOR_MAP
from cookiespool.tester import WeiboValidTester
from cookiesp... |
runblast.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from threading import Thread, Event
import time
# import threading
import psutil
import datetime
import os
import subprocess
# command = "blastn -db nt -evalue 1e-05 -query arquivo.fasta -out arquivoblast"
#monitor cpu and memory
# [1:09 PM, 3/14/2016] Mauro: Monitorar o ... |
test_runtimes.py | import asyncio
import json
import multiprocessing
import threading
import time
from collections import defaultdict
import pytest
from jina import Client, Document, Executor, requests
from jina.enums import PollingType
from jina.parsers import set_gateway_parser, set_pod_parser
from jina.serve.runtimes.asyncio import ... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
def unblock_stdout():
# get a non-blocking stdout
child_pid, child_pty = os.forkpty()
if ch... |
postproc.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... |
http.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2021 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... |
test_telnetlib.py | import socket
import selectors
import telnetlib
import threading
import contextlib
from test import support
import unittest
HOST = support.HOST
def server(evt, serv):
serv.listen()
evt.set()
try:
conn, addr = serv.accept()
conn.close()
except socket.timeout:
pass
finally:
... |
test_msgpackrpc.py | import threading
import unittest
import helper
import msgpackrpc
from msgpackrpc import inPy3k
from msgpackrpc import error
class TestMessagePackRPC(unittest.TestCase):
class TestServer(object):
def hello(self):
return "world"
def sum(self, x, y):
return x + y
def s... |
test_cinderjit.py | # Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
import _testcapi
import asyncio
import builtins
import dis
import gc
import sys
import tempfile
import threading
import types
import unittest
import warnings
import weakref
from compiler.consts import CO_SUPPRESS_JIT, CO_NORMAL_FRAME
from comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.