source
stringlengths
3
86
python
stringlengths
75
1.04M
test_recv_save_op.py
# Copyright (c) 2018 PaddlePaddle 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 app...
apps_deployments.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import time import itertools from threading import Thread, Event from jexia_cli.base import ProjectListCommand, ProjectShowCommand from jexia_cli.utils import with_authentication from jexia_sdk.http import HTTPClientError LOG = logging.getLogger(__name__)...
single_pipe.py
import multiprocessing def spawn_numbers(pipe): input_pipe, _ = pipe for i in range(10): input_pipe.send(i) input_pipe.close() if __name__ == "__main__": pipe = multiprocessing.Pipe(True) process = multiprocessing.Process(target=spawn_numbers, args=(pipe,)) process.start() proce...
tracker.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...
_server.py
# Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
test_tcp.py
# -*- coding: utf-8 -*- """ :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> """ # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import socket import threading import salt.config import salt.exceptions import salt.ext.tornado.concurrent import salt...
P2PServer.py
# This script hasn't been done yet.. from hashlib import new import socket import threading import asyncio import time from Blockchain import * from DataConverter import DataConverter class P2PServer(): blockchain = None address = '' PORT = 7500 socket = None continuousTransfer = True def __...
apps.py
import time import threading from django.apps import AppConfig class D2aConfig(AppConfig): name = 'd2a' def ready(self): import d2a if d2a.D2A_CONFIG.get("AUTOLOAD") in (False, None): return t = threading.Thread(target=d2a.autoload) t.start() t.join()
nhentai_downloader.py
import requests import os from tqdm import tqdm from bs4 import BeautifulSoup as bs from time import sleep import threading class NhentaiDownloader: _DOMAIN = 'https://nhentai.net/g/' def __init__(self, god_numbers, path='./', filename=''): self.god_numbers = god_numbers self.path = path ...
StringChannel_test.py
# Copyright 2015 Ufora 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 i...
test_signals.py
""" * 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 and the following disclaimer. * * - Redistributions in bina...
strategy_wrapper.py
import multiprocessing as mp from threading import Thread __author__ = 'keping.chu' class ProcessWrapper(object): def __init__(self, strategy): """ @:param strategy 策略 """ self.__strategy = strategy # 事件队列 self.__event_queue = mp.Queue(10000) # ...
online-processing.py
#!/usr/bin/env python ############################################################################### # The MIT License (MIT) # # Open3D: www.open3d.org # Copyright (c) 2021 www.open3d.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation f...
TProcessPoolServer.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...
post_movies.py
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # MovieLens indexing tool for generating Elasticsearch indices. # # Re-write of an original idea/script by Isabel Drost-Fromm. # Copyright 2014 © Thilo Fromm # # This file is licensed to you under the Apache License, Version 2.0 (the # "License"); you may not use ...
simple_plot_py27.py
import Tkinter as tk import ttk import tkMessageBox as messagebox import tkSimpleDialog as simpledialog import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from matplotlib.figure import Figure from matplotlib import style style.use('ggplot') ...
binance-balance.py
import tkinter as tk from tkinter import ttk from tkinter import Tk, Label, Button, messagebox from tkinter import * import time import threading import random import multiprocessing from multiprocessing import Pool, Process, Queue import time import pandas as pd from pandas import DataFrame from binance.client impor...
backgroundMatting (use depth not very well).py
import os import cv2 import uuid import glob import time import math import shutil import random import torch import darknet import shutil import datetime import argparse import torchvision import numpy as np import depthai as dai from tqdm import tqdm from PIL import Image from queue import Queue from shutil import c...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import copy import errno import signal import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth...
server.py
import socket import threading import sys import time # import Queue class server(): def __init__(self, name= "serv", port= 5678, connect=None, data_recd = None, ): self._connect = connect ...
load-data.py
#!/usr/bin/env impala-python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # This script is used to load the proper datasets for the specified workloads. It loads # all data via Hive except for parquet data which needs to be loaded via Impala. # Most ddl commands are executed by Impala. import collections ...
test_sslpsk.py
# Copyright 2017 David R. Bild # # 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 agree...
manager.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File: software/jetson/utils/manager.py # By: Samuel Duclos # For: Myself # Description: This file implements a multiprocessing manager for PID motor control with object detection. from multiprocessing import Value, Process, Manager from utils.pi...
QtPyPhotobooth.py
"""Qt & Python Based Photo Booth By: Scott McKittrick Features: Configurable and selectable templates Dependencies: PyQt5 PyYAML Classes Contained: QtPyPhotobooth - Main Application controller class. """ from enum import Enum import time import os import threading import yaml from PIL import ImageQt import PyQt5...
test_vedirect.py
import os, pty import threading from src.vedirect import VEDirect from src.vedirect import VEDirectDeviceEmulator import unittest def store_record(record, recordlist=None): recordlist.append(record) class TestVEDirect(unittest.TestCase): def cb_function(self, data): self.data = data def test_v...
main.py
import argparse import socket from colorama import init, Fore from threading import Thread, Lock from queue import Queue init() GREEN = Fore.GREEN RESET = Fore.RESET GRAY = Fore.LIGHTBLACK_EX N_THREADS = 200 q = Queue() print_lock = Lock() def port_scan(port): try: s = socket.socket() s.connect((...
test_cli.py
from __future__ import absolute_import, print_function, division import os import signal import tarfile import time from threading import Thread import pytest import conda_pack from conda_pack.cli import main from conda_pack.compat import on_win from .conftest import py36_path, py27_path def test_help(capsys): ...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import copy import io import os import re import shutil import tempfile import threading import time import unittest import warnings from django.conf import...
__init__.py
##################################################################### # # # /plugins/progress_bar/__init__.py # # # # Copyright 2018, Christopher Billington...
singleton.py
#! /usr/bin/env python # https://github.com/pycontribs/tendo/blob/master/tendo/singleton.py """ Python License, Version 2 (Python-2.0) PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -------------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individ...
grading-script.py
#!/usr/bin/python # ./grading-script.py <test-dir> import os,re,sys,shutil,random,subprocess,threading test_dir=sys.argv[1] # Set up scratch space for grading dir="grading" try: shutil.rmtree(dir) except: pass os.mkdir(dir) re_cp=re.compile('\.h$|\.cpp$|^SConstruct$|\.obj$') for f in os.listdir('.'): i...
run.py
#!/usr/bin/python3 import settings if __name__ == "__main__": import logSetup logSetup.initLogging() # Shut up fucking annoying psycopg2 vomit every exec. import warnings warnings.filterwarnings("ignore", category=UserWarning, module='psycopg2') from app import app import threading import time import calendar i...
package.py
import html, json, os, re, socket, sublime, sublime_plugin, threading, time from collections import defaultdict from .src import bencode from typing import Any, Dict, Tuple ns = 'sublime-clojure' def settings(): return sublime.load_settings("Sublime Clojure.sublime-settings") class Eval: # class next_id:...
COV-NUM TRACKER.py
import requests import json import pyttsx3 import speech_recognition as sr import re import threading import time API_KEY = "{PUT-YOURS-HERE}" PROJECT_TOKEN = "{PUT-YOURS-HERE}" RUN_TOKEN = "{PUT-YOURS-HERE}" class Data: def __init__(self, api_key, project_token): self.api_key = api_key self.pro...
__init__.py
#!/usr/bin/env python # # __init__.py - # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # import os import sys import time import gzip import shutil import tempfile import threading ...
batch_provider.py
import os import sys import threading import time import numpy as np import torch from ..utils.progbar import Progbar class BatchProvider(object): """BatchProvider class is a wrapper class to generate batches to train the network. """ def __init__( self, dataset, batch_size, ...
handlers.py
# Copyright 2001-2015 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
index.py
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread ex...
do_queue.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from multiprocessing import Process, Queue import os, time, random # 写数据进程执行的代码: def write(q): print('Process to write: %s' % os.getpid()) for value in ['A', 'B', 'C']: print('Put %s to queue...' % value) q.put(value) time.sleep(random.ra...
server_app.py
#!/usr/bin/env python """Main app""" import threading import locale import logging from importlib import import_module import os from flask import (Flask, render_template, Response, request, send_file, url_for, ...
nav_behavior_fsm.py
#!/usr/bin/env python import rospy as rp import rospkg import smach import smach_ros import threading import actionlib import abc #from tf.transformations import quaternion_from_euler from actionlib_msgs.msg import GoalStatus from move_base_msgs.msg import MoveBaseAction from geometry_msgs.msg import PoseStamped, Twis...
test_finetune_SdA.py
import numpy import cPickle import os, re, sys, time from numpy.linalg import norm from extract_datasets import extract_unlabeled_chunkrange from load_shared import load_data_unlabeled from tables import openFile from datetime import datetime from optparse import OptionParser from multiprocessing import Process, Ma...
taskqueue_stub.py
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
a1rmr.py
""" a1s rmr functionality """ # ================================================================================== # Copyright (c) 2019-2020 Nokia # Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except ...
hs.py
#!/usr/bin/python3 import sys import cgi import uuid import json import queue import socket import base64 import logging import argparse import threading import socketserver from http.server import HTTPServer from http.server import BaseHTTPRequestHandler _DEFAULT_LOG_FORMAT = "%(name)s : %(threadName)s : %(levelnam...
subproc.py
import os import sys import re import six from queue import Queue, Empty from subprocess import PIPE, check_call from psutil import Popen, NoSuchProcess from threading import Thread from mock import MagicMock from time import sleep from py_tools.common import replace_bad_chars from py_tools.concurrency import ExcToQu...
stand_IO_connection.py
# Author: Jimmy Huang (1902161621@qq.com) # License: WTFPL import subprocess import shlex import queue import threading import re import logging global g_logger g_logger = logging.getLogger('ECY_server') class ThreadOfJob(object): """keep connection with servers.""" def __init__(self, thread_id, sub_object,...
test_streaming_pull_manager.py
# Copyright 2018, Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
gallery.py
def gallery(*args, **kwargs): """Create a web-browsable gallery of plots (aka "PNG Walk"). Experimental code. Requires hapiplotserver. Use pip install 'git+https://github.com/hapi-server/plotserver-python' For additional documentation and demonstration, see hapi_demo.ipynb at <https://github.c...
modian.py
import threading import requests import csv import ujson import queue def load_data(): fn = "aa.csv" res = [] i = 0 count = 100000 tel_set = set() with open(fn, "r", encoding='utf8') as fh: cr = csv.reader(fh) for line in cr: tel = line[0].strip() tel_set...
test_two_GPUs_multiprocessing.py
""" Test script that uses two GPUs, one per sub-process, via the Python multiprocessing module. Each GPU fits a logistic regression model. """ # These imports will not trigger any theano GPU binding from multiprocessing import Process, Manager import numpy as np import os def f(shared_args,private_args): """ B...
debug.py
import xloil class _Handler_debugpy: def __init__(self): import debugpy debugpy.listen(5678) def call(self, type, value, trace): import debugpy # This doesn't actually do post-mortem debuggin so it fairly useless # It just breaks on a different python thread! ...
vslib.py
from threading import Thread, Lock import cv2 import datetime from loglib import loglib class vslib: """ The library for camera video stream. reference: https://gist.github.com/allskyee/7749b9318e914ca45eb0a1000a81bf56 """ def __init__(self, src=0, width: int = 0, height: int = 0): sel...
pants_daemon.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import sys import threading from contextlib import contextmanager from typing import IO, Iterator from setproctitle import setproctitle as set_process_title from...
__init__.py
############################################################################### # DO NOT MODIFY THIS FILE # ############################################################################### import inspect import logging import sys import textwrap import time from collections import namedtuple from enum impo...
main.py
# import os # os.environ["KIVY_WINDOW"] = "sdl2" # uncomment the above lines to run on raspberrypi like it runs on windows. import kivy kivy.require('1.9.1') from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.clock import Clock from time import sleep, time from random import randint from functo...
gradientSnake.py
""" Created on 3/5/20 Marquette Robotics Club Danny Hudetz Purpose: read from the hdf5 format and visualize the coordinates mapped nearest to user input in 3 dimensions """ from math import pi, sin, cos from numpy import deg2rad from random import random import vis from direct.showbase.ShowBase import ShowBas...
client.pyw
#!/usr/bin/env python3 # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COP...
test_local.py
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
DDos-Attack-Ultra.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # python 3.3.2+ Hammer Dos Script v.1 # by Can Yalçın # only for legal purpose from queue import Queue from optparse import OptionParser import time,sys,socket,threading,logging,urllib.request,random def user_agent(): global uagent uagent=[] uagent.append("Mozilla/5.0 (...
reporter.py
# -*- coding: utf-8 -*- # Adapted from a contribution of Johan Dahlin import collections import errno import re import sys try: import multiprocessing except ImportError: # Python 2.5 multiprocessing = None import pycodestyle as pep8 __all__ = ['multiprocessing', 'BaseQReport', 'QueueReport'] class Bas...
serverfrgui.py
#THIS PROGRAM IS USED TO CREATE MULTI-CHAT-ROOM SERVER #WHICH CAN ACCEPT COONECTIONS FROM CLIENTS AND CREATE MULTIPLE # PASSWORD PROTECTED ROOMS WHICH INDEPENDENTLY SERVE AS GROUP CHAT ###################THIS PROGRAM USES MULTITHREADING################## # NOTE:- THIS PROGRAM IS TO BE USED WITH INTEGRATED GUI # FOR ...
Run.py
import os import time import psutil import random import argparse import keyboard import threading from playsound import playsound import speech_recognition as sr from pynput.keyboard import Controller keyboard = Controller() # Create the controller def type_string_with_delay(string): for character in string: #...
model.py
import os import sys import logging import datetime import traceback import inspect import json import gevent import time from multiprocessing import Process from six import reraise from flask import Flask, request, jsonify from flask_cors import CORS from flask_sockets import Sockets from gevent.pywsgi import WSGIServ...
ssh.py
import os import time import paramiko import threading from stormer.logger import logger from stormer import base class SSHConnector(paramiko.SSHClient): def __init__(self, host): super(SSHConnector, self).__init__() self.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.connect(*...
utils.py
import os import datetime from multiprocessing import Process import time import yaml import streamlit as st import psutil import pandas as pd from typing import Callable, Union, Tuple from alphapept.paths import PROCESSED_PATH @st.cache(allow_output_mutation=True) def load_file(file:str) -> dict: """Cached stre...
test_seleniums.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import pytest import queue from codelib.automation_testing.selenium_automation.selenium_automation.browsers import DriverFactory # noqa from codelib.automation_testing.selenium_automation.selenium_automation.robots.google_robot import search_google, par...
main.py
# ============LICENSE_START=============================================== # Copyright (C) 2020 Nordix Foundation. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in...
client.py
# (C) Copyright 2020- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernme...
writing.py
import multiprocessing import io import os import queue import shutil import sys import threading import torch def open_wrapper(func): def wrapper(self, file_path, mode='rb', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, open...
multiprocessing_simple.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Creating and waiting for a process """ #end_pymotw_header import multiprocessing def worker(): """worker function""" print 'Worker' return if __name__ == '__main__': jobs = [] for i in range(5):...
threads.py
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import difflib import threading import time import traceback from thread import error as threadError from lib.core.data import conf from lib.core.data import kb from lib.cor...
test_sslsocket.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import ssl import threading import pytest from thriftpy._compat import MODERN_SSL from thriftpy.transport import TTransportException, create_thriftpy_context from thriftpy.transport.sslsocket import TSSLSocket, TSSLServerSocket def _echo_server(sock):...
example1.py
# ch14/example1.py import threading import random import time def update(): global counter current_counter = counter # reading in shared resource time.sleep(random.randint(0, 1)) # simulating heavy calculations counter = current_counter + 1 # updating shared resource counter = 0 threads = [threadin...
context.py
#!/usr/bin/env python3 from http import HTTPStatus from socketserver import ThreadingMixIn from urllib.parse import urlparse from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml import threading import http.server import json import queue import socket import subprocess import time ...
corefonts.py
""" Utilities for getting the ms corefonts for protonfixes """ import os import shutil import subprocess import urllib.request from threading import Thread from tempfile import NamedTemporaryFile as Temp from .logger import log #pylint: disable=W0106 COREFONTS_DIR = os.path.expanduser('~/.config/protonfixes/mscorefo...
tracker.py
# -*- coding: utf-8 -*- import datetime import logging import math import os import threading import time import cv2 import numpy as np #from face_track.mockdjitellopy import Tello from djitellopy import Tello from face_track.pid import PID # import mediapipe as mp class FaceTracker(object): HANDLER = logging...
skymorph.py
import math import os import re import urllib.request, urllib.parse, urllib.error import requests import json import skymorph.neat_binary from threading import Thread, Lock from util import md5_storage_hash from redis import StrictRedis from bs4 import BeautifulSoup from shove import Shove # Constants SEARCH_TARGET_U...
websocket_client.py
# gdax/WebsocketClient.py # original author: Daniel Paquin # mongo "support" added by Drew Rice # # # Template object to receive messages from the gdax Websocket Feed from __future__ import print_function import json import base64 import hmac import hashlib import time from threading import Thread from websocket impor...
kvm_ui.py
""" Copyright (c) 2012-2013 F-Secure See LICENSE for details """ from PySide.QtCore import Qt, QObject, Slot, QFile from PySide.QtGui import QApplication, QTreeWidgetItem, QMessageBox from PySide.QtUiTools import QUiLoader #from PySide import QtXml import random import time from threading import Thread, Event import Q...
openvino_tiny-yolov3_MultiStick_test.py
import sys, os, cv2, time, heapq, argparse import numpy as np, math try: from armv7l.openvino.inference_engine import IENetwork, IEPlugin except: from openvino.inference_engine import IENetwork, IEPlugin import multiprocessing as mp from time import sleep import threading yolo_scale_13 = 13 yolo_scale_26 = 26 ...
robot_state_runner.py
#!/usr/bin/env python3 import signal import json import pika import queue import rospy import threading import sys import numpy import base64 import io from cv_bridge import CvBridge from PIL import Image CV_BRIDGE = CvBridge() SET_GOAL = 0 MOVE = 1 SET_MAP = 2 RABBITMQ_CONNECTION_STRING = "amqp://admin:password@loca...
test_concurrent_futures.py
zaimportuj test.support # Skip tests jeżeli _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests jeżeli sem_open implementation jest broken. test.support.import_module('multiprocessing.synchronize') # zaimportuj threading after _multiprocessing to podnieś a more revelant error # m...
py_process_test.py
# Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
manager.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...
testSupCheckNoMult.py
from __future__ import division, print_function import os, sys import ROOT from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object from PhysicsTools.NanoAODTools.postprocessing.framework.event...
main.py
from playstore.worker_playstore import WorkerPlayStore from report.firebase_bucket import FirebaseBucket from report.platform import Platform from report.report import Report from db.db_manager import DBManager from notify.msteams import MSTeams import time import threading import logging from logger import setLogging ...
rfc2217_server.py
#!/usr/bin/env python # # redirect data from a TCP/IP connection to a serial port and vice versa # using RFC 2217 # # (C) 2009-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import logging import socket import sys import time import threading import serial import serial.rfc2217 cl...
engine.py
""" Main BZT classes Copyright 2015 BlazeMeter 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...
project_files_monitor_test.py
# Copyright (c) 2019-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. # pyre-unsafe import os import socket import tempfile import threading import unittest from unittest.mock import MagicMock, patch from .. import j...
util.py
#============================================================================== # Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
locusts.py
# encoding: utf-8 import io import multiprocessing import os import sys from httprunner.logger import color_print from httprunner import loader from locust.main import main def parse_locustfile(file_path): """ parse testcase file and return locustfile path. if file_path is a Python file, assume it is a ...
mainbot.py
# import the twython module import twythonaccess # import time and sys import time # import Thread to be able to run concurrently from threading import Thread # randint for the tweet interval from random import randint # import the streamers from tweet_streamer import TweetStreamer from mentions_streamer import Mention...
natural_es.py
import torch import argparse import torch.multiprocessing as mp from torch.multiprocessing import SimpleQueue import numpy as np from utils import * import pickle from config import * import time def parse_args(args=None): parser = argparse.ArgumentParser() parser.add_argument('--noise', default='mc', choices=...
run_dqn_atari.py
import argparse import gym from gym import wrappers import os.path as osp import random import numpy as np import tensorflow as tf import tensorflow.contrib.layers as layers from multiprocessing import Process from tensorflow.python import debug as tf_debug import dqn from dqn_utils import * from atari_wrappers import...
main.py
import imp from monaconft_bot import * from gen_address import * from faker import Faker import threading import random import string import sys # initialize chrome driver platform_system = platform.system() print(f'Current platform: {platform_system}') if platform_system == "Windows": chrome_driver = "./chromedr...
test_subprocess.py
import unittest from test import support import subprocess import sys import signal import io import os import errno import tempfile import time import selectors import sysconfig import select import shutil import gc import textwrap try: import threading except ImportError: threading = None mswindows = (sys.p...
log.py
#!/usr/bin/env python """ Copyright (c) 2014-2021 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from __future__ import print_function import datetime import json import os import re import signal import socket import sys import threading import time impo...
detect_mask_video_v4.py
# USAGE # python detect_mask_video.py # import the necessary packages from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.models import load_model from imutils.video import VideoStream from playsound import ...
status_api_demo.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...