source
stringlengths
3
86
python
stringlengths
75
1.04M
Power_main.py
# -*- coding: utf-8 -*- """ Module implementing controller_main. """ from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import * from Ui_power_main import Ui_MainWindow import pyvisa,time,threading from PyQt5 import QtWidgets from PyQt5.QtWidgets import * import matplotlib.pyplot as plt from PyQt5 import QtWidgets, Q...
test_capture.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import io import os import pickle import subprocess import sys import textwrap from io import UnsupportedOperation import py from six import text_type import pytest f...
pystreamout.py
"""Main module.""" from threading import Event, Thread from typing import BinaryIO import time class Streamer: """ Streams output from a target process' stream to stdout (non-blocking). ``` # Usage 1 target_process = subprocess.Popen( ["watch", "-n", "2", "ls"], stdout=subprocess....
backtester2m.py
import os import sys import sqlite3 import pandas as pd from matplotlib import pyplot as plt from multiprocessing import Process, Queue sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import db_tick, db_backtest from utility.static import now, strf_time, timedelta_day ...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread from zipfile im...
managers_decorators.py
""" on_start --------- Resources --------- """ from multiprocessing.connection import Listener from threading import Thread from functools import wraps import logging import atexit logging.basicConfig(format='%(message)s', level=logging.INFO) def on_start(cls): """ Starts shared_memory multiprocessing insta...
test_cassandra.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import threading import time from types import ListType import unittest import os import mock # 3p from nose.plugins.attrib import attr # project from aggregator import MetricsAggregator import logging...
application.py
# -*- coding: utf-8 -*- # ====================================================================================================================== # Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. # = # CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement in the roo...
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...
portable_runner.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
test.py
import threading def doIt(): A = [] def addToList(test): A.append(test) threads = [threading.Thread(target=addToList, args=("command",)) for i in range(20)] for thread in threads: thread.start() for thread in threads: thread.join() return A testing = doIt() print testing
game.py
""" --- title: Atari wrapper with multi-processing summary: This implements the Atari games with multi-processing. --- # Atari wrapper with multi-processing """ import multiprocessing import multiprocessing.connection import cv2 import gym import numpy as np class Game: """ ## <a name="game-environment"></a...
process_vs_thread.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading from multiprocessing import Process import time def worker(): time.sleep(0.5) def main(): t0 = time.time() threads = [] i = 50 for i in range(i): thread = threading.Thread(target=worker) thread.start() threa...
aq-sensor.py
from connection import * import connection, threading, socket from datetime import datetime value = -1 airQualityTimes = {} with open(SOURCE_FILE, mode='r+') as csv_file: for row in csv_file: if (row.split(',')[3] == '\n'): airQualityTimes[row.split(',')[1]] = 'error' continue ...
benchmarker.py
from setup.linux import setup_util from benchmark import framework_test from benchmark.test_types import * from utils import header from utils import gather_tests from utils import gather_frameworks from utils import verify_database_connections import os import shutil import stat import json import subprocess import ...
robot_server.py
import socket from PIL import Image import io import tkinter as tk import struct from threading import Thread import time from matplotlib import pyplot as plt import matplotlib.animation as animation from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk) import sys import time impo...
test_mlt_base.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process from utils import...
startup.py
import os, threading, ctypes, time from valclient.client import Client from InquirerPy.utils import color_print from .utility.config_manager import Config from .utility.onboarding import Onboarder from .flair_loader.skin_loader import Skin_Loader from .flair_loader.buddy_loader import Buddy_Loader from .asynchronous.a...
Music.py
""" Basic music functionality """ import os import threading import shutil import functools from ctypes import util import discord import youtube_dl from discord.ext import commands from discord.utils import get from _Util import Checks, GREEN, RED queue = {} np = {} if os.name != "nt": discord.opus.load_opus(ut...
downloadclient.py
# -*- coding: utf-8 -*- # Copyright 2018-2021 CERN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
clang-tidy-diff.py
#!/usr/bin/env python3 # #===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===# # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===--------...
disdown_server.py
# -*- coding: utf-8 -*- import socket,os,re import json,threading import gc class partner: def __init__(self,NAME,n): self.name = '' self.connet = None self.addr = None self.taskList = [] self.complete = [] self.uncomplete = [] self.processing = '' se...
runtests.py
#!/usr/bin/env python from __future__ import print_function import atexit import base64 import os import sys import re import gc import heapq import locale import shutil import time import unittest import doctest import operator import subprocess import tempfile import traceback import warnings import zlib import glo...
datasets.py
# Dataset utils and dataloaders import glob import hashlib import json import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool, Pool from pathlib import Path from threading import Thread import cv2 import numpy as np import ...
background_task.py
# -*- coding: utf-8 -*- # # This file is part of the PstBeam project # # Swinburne University of Technology # # Distributed under the terms of the none license. # See LICENSE.txt for more info. """This module is to abstract background task processes.""" from __future__ import annotations import functools import logg...
util.py
# Copyright 2013-2014 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 ...
producer.py
# encoding: UTF-8 # 消息生产者类(集合) import json import pika import traceback from threading import Thread from uuid import uuid1 from vnpy.amqp.base import base_broker # 模式1:发送者 class sender(base_broker): def __init__(self, host='localhost', port=5672, user='admin', password='admin', exchange='x', q...
dataset.py
# *************************************************************** # Copyright (c) 2021 Jittor. All Rights Reserved. # Maintainers: # Meng-Hao Guo <guomenghao1997@gmail.com> # Dun Liang <randonlang@gmail.com>. # # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part...
sounddetected.py
# DOCUMENTATION # http://doc.aldebaran.com/2-5/naoqi/peopleperception/alengagementzones-api.html#alengagementzones-api import qi import argparse import sys import os import time import threading import math import almath from naoqi import ALProxy import conditions from conditions import set_condition def rhMonitorT...
google.py
from .util import Envoy, is_valid from concurrent.futures import ThreadPoolExecutor import threading import multiprocessing class GoogleAssistant(Envoy): def __init__(self, debug=False, token=None, base_url='https://api.botanalytics.co/v1/', callback=None, is_async=False): """ :pa...
bilibili.py
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- """Bilibili Toolkit 哔哩哔哩工具箱 https://github.com/Hsury/Bilibili-Toolkit""" banner = r""" \\ // \\ // ##################### ________ ___ ___ ___ ________ ___ ___ ___ ## ## |\ ...
model.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
magic.py
""" Magiclist is an awesome data type ! Magiclist has the ability to release memory on a per element basis rather than the object itself! This way magiclist can store a large amount of data inside it without running out of memory. When magiclist runs out of memory, then purge() function can be called and all the inacti...
gamepad.py
from __future__ import division import inputs import threading mappings = { 'ABS_Z' :'left_trigger', 'ABS_RZ' :'right_trigger', 'BTN_TL' :'left_bumper', 'BTN_TR' :'right_bumper', 'ABS_X' :'left_stick_x', 'ABS_Y' :'left_stick_y', 'ABS_RX' :'right_stick_x', ...
four-threads.py
""" four different ways to run an action in a thread; all print 4294967296, but prints should be synchronized with a mutex here to avoid overlap """ import threading, _thread def action(i): print(i ** 32) # subclass with state class Mythread(threading.Thread): def __init__(self, i): self....
test_github.py
import contextlib import datetime import logging import sys import time import unittest from multiprocessing import Process from typing import Union, Tuple, Optional import github.GithubException import mock import requests.exceptions from flask import Flask, Response from publish_unit_test_results import get_github ...
cluster.py
# Standard import ast import importlib import signal import socket import traceback import uuid from multiprocessing import Event, Process, Value, current_process from time import sleep # External import arrow # Django from django import db, core from django.apps.registry import apps try: apps.check_apps_ready()...
srilankamirror.py
import tweepy import os import time import threading from elasticsearch import Elasticsearch, helpers from datetime import datetime from dotenv import load_dotenv load_dotenv() consumer_key = os.getenv('consumer_key') consumer_secret = os.getenv('consumer_secret') access_key = os.getenv('access_key') access_secret = ...
acq400.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ acq400.py interface to one acq400 appliance instance - enumerates all site services, available as uut.sX.knob - simple property interface allows natural "script-like" usage - eg:: uut1.s0.set_arm = 1 - equivalent to running this on a logged in shell session ...
continuousP1.py
#!/usr/bin/env python import datetime import serial import time from multiprocessing import Process from rebooter import reboot class P1: FAIL_THRESHOLD = 100 ELECTRICITY_1_WITHDRAWAL_CUMULATIVE = '1.8.1' ELECTRICITY_2_WITHDRAWAL_CUMULATIVE = '1.8.2' ELECTRICITY_1_SUPPLY_CUMULATIVE = '2.8.1' ELE...
write_tfrecord.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 19-11-20 0:25 # @Author : Miao Wenqiang # @Reference : https://github.com/MaybeShewill-CV/CRNN_Tensorflow # https://github.com/bai-shang/crnn_ctc_ocr.Tensorflow # @File : write_tfrecord.py # @IDE: PyCharm """ Efficient tfrecords writer...
main.py
import curses, time, threading from splinter.scenes.menu import MainMenu from splinter import __v__ def main(): global win, stdscr, options, scene try: stdscr = curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(True) curses.curs_set(0) win = curses...
transformer.py
from threading import Thread import numpy as np from anytree import PreOrderIter from rigid_body_motion.core import _resolve_rf from rigid_body_motion.reference_frames import ReferenceFrame class Transformer: """ Wrapper class for tf2_ros.Buffer. Can be constructed from a ReferenceFrame instance. """ ...
metaNODE.py
raise ValueError('WARNING: DEPRECATED VERSION use metaNODE.py from extinction-event/EV folder') ' metaNODE ' # Curates data from all known public API's in the Bitshares network ' litepresence 2018 ' def WTFPL_v0_March_1765(): if any([stamps, licenses, taxation, regulation, fiat, etat]): try: ...
bot.py
from pyrogram import Client, MessageHandler, Filters from utlis.rank import setrank ,isrank ,remrank ,setsudos ,remsudos ,setsudo from handlers.callback import updateCallback from handlers.msg import updateHandlers from handlers.inline import updateInline from handlers.delete import delete from utlis.tg import Bot,Del...
PC_Miner.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Python PC Miner (v2.6) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2019-2021 ########################################## # Import libraries import sys from configparser import Co...
utils.py
''' .. Created on: 2/12/15 Common functions and data .. Copyright (c) 2015-2016 Richard Plevin See the https://opensource.org/licenses/MIT for license details. ''' import argparse import io import os from lxml import etree as ET import pkgutil import re import shutil import subprocess import sys from contextlib ...
test_protocol_cybinary.py
# -*- coding: utf-8 -*- import collections import multiprocessing import os import time import pytest from thriftpy._compat import u from thriftpy.thrift import TType, TPayload, TDecodeException from thriftpy.transport import TSocket, TServerSocket from thriftpy.utils import hexlify from thriftpy._compat import PYP...
translator.py
# -*- coding: utf-8 -*- import re import threading import socket import sys import time import os import random import copy import json import argparse import codecs if sys.version_info[0] < 3: is_py3 = False reload(sys) sys.setdefaultencoding("utf-8") sys.stdout = codecs.getwriter("utf-8")(sys.stdout)...
DiscoveryClientService.py
from logging import getLogger from socket import AF_INET, IPPROTO_UDP, SO_BROADCAST, SOCK_DGRAM, SOL_SOCKET, timeout try: from socket import SO_REUSEPORT socket_can_reuse_port = True except ImportError: SO_REUSEPORT = 0 socket_can_reuse_port = False from threading import Thread from typing import Optio...
main.pyde
# vim: ft=python from threading import Thread from time import sleep from player import Player from maze import Maze from cell import * maze = Maze() you = Player(1, maze) me = Player(2, maze) x = m*scl + 2*border y = n*scl + 2*border toggles = {'f': False, 'c': False, 'p': False} def setup(): size(x, y) text...
workflow.py
''' /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Orange * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance wit...
webServer.py
#!/usr/bin/env/python # File name : server.py # Production : GWR # Website : www.adeept.com # Author : William # Date : 2020/03/17 import time import threading import move import Adafruit_PCA9685 import os import info import RPIservo import ultra import functions import robotLight i...
main.py
from flask import Flask, render_template from flask_socketio import SocketIO, emit import threading app = Flask(__name__) socketio = SocketIO(app) @app.route('/') def index(): return render_template('index.html') @socketio.on('connect') def connect(): print ('Client Connected') @socketio.on('update') def up...
lemna_simple_model.py
import sys from multiprocessing import Manager, Pool, Process import numpy as np import pandas as pd from sklearn.cluster import KMeans from sklearn.decomposition import PCA from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from sklearn.utils import check_r...
fast_sync_GUI.py
#!/usr/bin/env python3 from email.mime import image import tkinter as tk from tkinter import ttk from tkinter import messagebox import tkinter.font as tkFont from PIL import Image, ImageTk import threading import ipaddress import socket import os, sys import ssh_comms class heliumUpdateGUI(tk.Tk): colors = { ...
test_periodics.py
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
xla_client_test.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...
__main__.py
""" Shodan CLI Note: Always run "shodan init <api key>" before trying to execute any other command! A simple interface to search Shodan, download data and parse compressed JSON files. The following commands are currently supported: alert convert count data download honeyscore host inf...
server.py
#coding=utf-8 from dos_cmd import DosCmd from port import Port import threading import time from write_user_command import WriteUserCommand class Server: def __init__(self): self.dos = DosCmd() self.device_list = self.get_devices() self.write_file = WriteUserCommand() def get_devices(self): ''' 获取设备信息 '''...
kernel.py
from queue import Queue from threading import Thread from ipykernel.kernelbase import Kernel import subprocess import tempfile import os import os.path as path from shlex import split as shsplit from shutil import copyfile class RealTimeSubprocess(subprocess.Popen): """ A subprocess that allows...
test_dag_serialization.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...
pixels.py
from . import apa102 import time import threading from gpiozero import LED try: import queue as Queue except ImportError: import Queue as Queue #from alexa_led_pattern import AlexaLedPattern #from google_home_led_pattern import GoogleHomeLedPattern from . import berta_led_pattern class Pixels: PIXELS_N =...
main.py
import SocketServer import socket import json from random import random import threading from .actions.dispatch import dispatch from .nodes.base import Node from .selection import Selection import signal from time import sleep TCP_IP = '127.0.0.1' TCP_PORT_SERVER = 7998 TCP_PORT_CLIENT = 7999 BUFFER_SIZE = 1024 clas...
mp_distributing.py
# # Module to allow spawning of processes on foreign host # # Depends on `multiprocessing` package -- tested with `processing-0.60` # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # __all__ = ['Cluster', 'Host', 'get_logger', 'current_process'] # # Imports # import sys import os import tarfile import s...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock from weakref import proxy import...
plotFeatures.py
# plotFeatures.py ####################################################### # # Plot the three main features: # - Percentage of MS/FL, Cell classification # - Percentage of Fat/non-fat cell # - Intensity of nuclei in the Hoescht channel # ####################################################### import os imp...
test_setup.py
import multiprocessing import socket import time from contextlib import closing import pytest import tornado.httpclient import tornado.ioloop import tornado.web from tornado_swagger.setup import export_swagger from tornado_swagger.setup import setup_swagger SERVER_START_TIMEOUT = 3 SWAGGER_URL = "/api/doc" def fi...
test_metadata.py
import signal from multiprocessing import Process import time from condu import Condu, TaskDef, WorkflowDef, JoinTaskDef, ForkTaskDef, WorkflowTaskDef, DecisionTaskDef, \ DynamicForkTaskDef from tests.metadata_testing.test_utils import task_definitions_for_svm, svm_workflow, svm_model_workflow_with_eval, \ cr...
main_loop.py
import time from robot import Robot from servertest import Server import threading as th def main_loop(robot): cat = 0 dog = 1 while True: if robot.CheckMovement(): # 如果检测到位移 cat_pot_status, dog_pot_status = robot.CheckFood() # cat_time_status, dog_time_status =...
buck.py
# Copyright 2004-present Facebook. All rights reserved. import functools import glob import json import logging import os import subprocess import sys import tempfile import threading from collections import namedtuple from json.decoder import JSONDecodeError from logging import Logger from typing import Dict, Iterab...
deccheck.py
# # Copyright (c) 2008-2012 Stefan Krah. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions ...
task.py
# -*- coding: utf-8 -*- __author__ = "苦叶子" __modifier__ = "mawentao119@gmail.com" """ """ from flask import current_app, session from flask_restful import Resource, reqparse import os import time from utils.mylogger import getlogger import multiprocessing from utils.file import remove_dir, get_splitext from utils....
weibo_output.py
# Version : 2.5 import re import timelib import Threadinglib import json import os from collections import deque import requests import threading import sys from queue import Queue def handle_url(url: str): return "https://m.weibo.cn/status"+url[url.rindex("/"):] def download_beta(path="", iter=""): while i...
HandTracking.py
import time, cv2, pyautogui, mediapipe as mp import UDPDataSender, GeneralAttribute, time, threading def start_webcam(): #thread_sender = threading.Thread(target=HandPositionSender.SendPosition) #thread_sender.start() widthScreen, heightScreen= pyautogui.size() winName = 'NumberPedia-HandTracking' ...
fetchcore.py
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. # # This file is part of ewm-cloud-robotics # (see https://github.com/SAP/ewm-cloud-robotics). # # This file is licensed under the Apache Software License, v. 2 except as noted # otherwise in the LIC...
Server.py
from socket import * from threading import * clients = set() def clientThread(clientSocket, clientAddress): while True: message = clientSocket.recv(1024).decode("utf-8") print(clientAddress[0] + ":" + str(clientAddress[1]) +" says: "+ message) for client in clients: if client i...
test.py
#!/usr/bin/python #coding:utf-8 #Author: import sys import os import threading import time threads = int(sys.argv[1]) rounds = int(sys.argv[2]) testcmd = "./client 155.246.89.102 1234 1>./log 2>&1" lock = threading.Lock() success_counts = 0 fail_counts = 0 total_time = 0.0 def test_routine(): global success_co...
triggers.py
from functools import partial import multiprocessing import os import re import setproctitle import signal import time from shakenfist import baseobject from shakenfist.config import config from shakenfist.daemons import daemon from shakenfist import db from shakenfist import etcd from shakenfist import logutil from s...
test_subprocess.py
import unittest from unittest import mock from test import support from test.support import import_helper from test.support import os_helper from test.support import warnings_helper import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback ...
main.py
from fingerprint import FingerPrintReader, Privilege, Ack from dbController import DBController import threading import requests import json import sys import os sysDriver = {'win32': 'COM3', 'darwin':'/dev/cu.SLAB_USBtoUART', 'linux':'/dev/ttyUSB0'} port = sysDriver[sys.platform] fpr = FingerPrintReader(port, 19200) ...
ModelConnectionServer.py
""" [ModelConnectionServer.py] Program that hosts a UDP server to host the models. """ import socket import socketserver import threading import time from typing import Tuple import numpy import tensorflow from scripts import Log, Constants, Warnings, Parameters, General, InputConstraints from scripts.Genera...
monitored_session_test.py
# pylint: disable=g-bad-file-header # Copyright 2016 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/LICENS...
control.py
__all__ = ['Interface'] # FIXME:如果您是项目开发者,请在项目调试中注释掉以下的monkey插件 exec("from gevent import monkey\nmonkey.patch_all()") import csv import os import threading import multiprocessing from BusinessCentralLayer.coroutine_engine import vsu, PuppetCore from BusinessCentralLayer.middleware.subscribe_io import FlexibleDistrib...
manager.py
# -*- coding: utf-8 -*- """ :copyright: (C) 2010-2013 by Contrail Consortium. """ from threading import Thread, Timer import os import tempfile import string from random import choice import collections from conpaas.core.manager import BaseManager from conpaas.core.manager import ManagerException from conpaas.co...
ramps.py
import random from Queue import Queue import json from threading import Thread, Lock, Semaphore import time import uuid import datetime from boto.dynamodb2.exceptions import ItemNotFound, ConditionalCheckFailedException, \ ProvisionedThroughputExceededException, LimitExceededException from boto.dynamodb2.fields im...
bkp_mod.py
# Copyright 2013-2014 James P Goodwin bkp@jlgoodwin.com """ module to implement shared functions for the bkp tool """ import sys import os import re import traceback import queue import threading import platform import time import subprocess import smtplib import datetime import io import urllib.request, urllib.parse, ...
rpc.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
runners.py
# Lint as: python3 # 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 ...
challenge32.py
#! /usr/bin/python # https://www.cryptopals.com/sets/4/challenges/32 # Break HMAC-SHA1 with a slightly less artificial timing leak # SHA-1 implementation taken from https://github.com/ajalt/python-sha1/blob/master/sha1.py # HMAC: https://en.wikipedia.org/wiki/HMAC ###################################################...
web.py
from __future__ import absolute_import, print_function, division, unicode_literals import nbformat from nbconvert import HTMLExporter import tornado from tornado.httpserver import HTTPServer import tornado.web from tornado import web, gen import tornado.websocket import tornado.locks import ruamel.yaml import jinja2...
interactive_hosted.py
#!/usr/bin/env python3 -u # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Host the demo. Launch with `python -m metaseq_cli.interactive_hosted` to run locally. Se...
ella_coverage.py
# Copyright (c) 2016-present, Ke Mao. 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 conditio...
test_serializable_sees_snapshot.py
############## # Setup Django import django django.setup() ############# # Test proper import threading import time import pytest from django.db import connection, transaction from django.db.models import F, Subquery from app.models import Sock @pytest.mark.django_db def test_serializable_sees_snapshot(): de...
scanner.py
#!usr/bin/env python # coding=utf-8 import socket import os import struct import threading import time import sys from netaddr import IPNetwork, IPAddress from ctypes import * # 监听主机,即监听网络接口,这里设置为我的Windows主机上的的ip host = "192.168.31.18" # 扫描目标子网 # subnet = "192.168.31.0/24" # 没有命令行参数,默认192.168.1.0/24 if len(sys.argv)...
client.py
import pika import multiprocessing import os import signal import sys import json import socket from time import sleep from connection import manage_connection from database_management import manage_database, manage_local_ids from interface_package.interface import init_gui from interface_package.login_interface impor...
test_modelcontext.py
# Copyright 2020 The PyMC Developers # # 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 ag...
main.py
import nanolib import requests import websockets import json import os import asyncio import multiprocessing import sys import decimal import random import time def api_request(post_data, server): r = requests.post(server, json=post_data) return r.json() def account_info(account_id, server): data = api...
bot.py
#!/usr/bin/env python """ bot.py - jenni IRC Bot Copyright 2009-2013, yano (yanovich.net) Copyright 2008-2013, Sean B. Palmer (inamidst.com) Licensed under the Eiffel Forum License 2. More info: * jenni: https://github.com/myano/jenni/ * Phenny: http://inamidst.com/phenny/ """ import time, sys, os, re, threading, i...
test_connection_pool.py
from __future__ import with_statement import os import pytest import redis import time import re from threading import Thread from redis.connection import ssl_available from .conftest import skip_if_server_version_lt class DummyConnection(object): description_format = "DummyConnection<>" def __init__(self, ...