source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
Calibrator.py | # The Leginon software is Copyright 2004
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import threading
import wx
from leginon.gui.wx.Choice import Choice
from leginon.gui.wx.Entry import FloatEntry
import leginon.gui.wx.Cam... |
mock_remote_server.py | """
An HTTP server that listens on localhost and returns a variety of responses for
mocking remote servers.
"""
from builtins import str
from builtins import range
from builtins import object
from contextlib import contextmanager
from threading import Thread
from time import sleep
from wsgiref.simple_server import make... |
application.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... |
test_cpu_usage.py | #!/usr/bin/env python3
import time
import threading
import _thread
import signal
import sys
import cereal.messaging as messaging
from common.params import Params
import selfdrive.manager as manager
from selfdrive.test.helpers import set_params_enabled
def cputime_total(ct):
return ct.cpuUser + ct.cpuSystem + ct.cpu... |
train.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import random
import signal
import time
import torch
from pytorch_pretrained_bert import BertConfig
from argparse import ArgumentParser
import distributed
from .models import data_loader, mod... |
main.py | import os
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'NitroGenerationCheck.txt')
file = open("NitroGenerationCheck.txt", "w")
file.write("")
file.close()
with open("NitroGenerationCheck.txt", "w") as file:
file.write("Nitro Generation = Unsuccesful. Ma... |
test_wikiqa_04_test.py | import sys
import tempfile
import unittest
sys.path.append("..")
WORK_DIR = "/tmp/wikiqa-tests"
class TestAll(unittest.TestCase):
def test_test(self):
import json
from src.wikiqa.wikiqa_test import wikiqa_test
shared_path = "/save/out/squad/basic-class/00/shared.json"
run_id =... |
sgsearch.py |
import shlex, os, sys
import numpy as np
import math as mathf
import re
from multiprocessing import Process, Queue
from operator import itemgetter
nProc = 1 #processor数定義(モジュールの外から値を設定する)
final_result = 0.
max_value = []
max_position = []
class Candidate():
def __init__(self,idnum,indx,value,maxindx... |
combat_standalone.py | # The intent of this test is to verify that a standalone combat bot works
# And then incorporate the working standalone back into the v3 test bot
from hsvfilter import grab_object_preset
from windowcapture import WindowCapture
from vision import Vision
import os
import combo
import threading
import time
import pydirect... |
cambot_server.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import pickle
import time
from queue import PriorityQueue
from threading import Thread
import tensorflow as tf
from convlab.modules.dst.multiwoz.mdbt import MDBTTracker, init_state
from convlab.modules.word_policy.multiwoz.m... |
ipc_tests.py | """
Tests related to inter-process communication (for services).
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import contextlib
import pickle
import random
import socket
import sys
import threading
import time
import psutil
import pytest
import retrying
from fiftyone.service.ip... |
custom_threadpool_executor.py | """
史上最强的python线程池。
最智能的可自动实时调节线程数量的线程池。此线程池和官方concurrent.futures的线程池 是鸭子类关系,所以可以一键替换类名 或者 import as来替换类名。
对比官方线程池,有4个创新功能或改进。
1、主要是不仅能扩大,还可自动缩小(官方内置的ThreadpoolExecutor不具备此功能,此概念是什么意思和目的,可以百度java ThreadpoolExecutor的KeepAliveTime参数的介绍),
例如实例化一个1000线程的线程池,上一分钟疯狂高频率的对线程池submit任务,线程池会扩张到最大线程数量火力全开运行,
但之后的七八个小时平均每分钟... |
lib.py | """
Test library.
"""
import difflib
import inspect
import json
import subprocess
import os
import posixpath
import shlex
import shutil
import string
import threading
import urllib
import pprint
import SocketServer
import SimpleHTTPServer
class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
... |
emails.py | """
Email module
"""
# Threading
import threading
from django.core.mail import message
# Email
from ....settings.base import EMAIL_HOST_USER
from django.core.mail.message import (
EmailMultiAlternatives,
)
from django.utils.module_loading import import_string
# Templates
from django.core.mail import send_mail, ... |
test_wrapper.py | import os
import time
import pytest
# from mock import patch
from time import sleep
from threading import Thread
from hkube_python_wrapper.communication.streaming.StreamingManager import StreamingManager
from hkube_python_wrapper import Algorunner
from tests.configs import config
from tests.mocks import mockdata
from... |
__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""StudioFileChooserThumbView
====================
The StudioFileChooserThumbView widget is similar to FileChooserIconView,
but if possible it shows a thumbnail instead of a normal icon.
Usage
-----
You can set some properties in order to control its performance:
* **s... |
hydrogenClient_surface.py | import sys
import socket
import select
import pygame
import time
import serial as s
import threading
from serial import SerialException
# import pyfirmata
########Below is superfluous code necessary only for receiving and sending controller input
pygame.init()
joystick1 = pygame.joystick.Joystick(0)
joystick2 = pyga... |
async_p2p.py | import os
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
"""Non-blocking point-to-point communication."""
def run(rank, size):
tensor = torch.zeros(1)
req = None
if rank == 0:
tensor += 1
# Send the tensor to process 1
req = dist.isend(tensor=tenso... |
sys_exc_info.py | #!/usr/bin/env python3
# encoding: utf-8
#end_pymotw_header
import sys
import threading
import time
def do_something_with_exception():
exc_type, exc_value = sys.exc_info()[:2]
print('Handling {} exception with message "{}" in {}'.format(
exc_type.__name__, exc_value,
threading.current_thread()... |
main.py | #coding:utf-8
from tkinter import *
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import threading
import random
class Automan(Frame):
def __init__(self,master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
def createWid... |
multithreading_deadlock.py | #coding=utf-8
'''
This example is for multithreading deadlock demo.
'''
import time
import threading
class Account:
def __init__(self, _id, money, lock):
self.id = _id
self.money = money
self.lock = lock
def withdraw(self, amount):
self.money -= amount
def de... |
evaluation_worker.py | """This module is responsible for launching evaluation jobs"""
import argparse
import json
import logging
import os
import time
from threading import Thread
import rospy
from markov import utils
from markov.agent_ctrl.constants import ConfigParams
from markov.agents.rollout_agent_factory import (
create_bot_cars_a... |
spanprocessor.py | # Copyright The OpenTelemetry 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 ... |
nicolive.py | import json
import logging
import re
import threading
import time
from urllib.parse import unquote_plus, urlparse
import websocket
from streamlink.plugin import Plugin, PluginArgument, PluginArguments
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
_log = logging.getLogger(__name... |
app_win.py | #!/usr/bin/env python3
import threading
import sys
import queue
from PyQt5 import QtWidgets
from app_win_frm import *
global mesg_q
mesg_q = queue.Queue()
global Quitting
Quitting = False
def worker(mesg_q=mesg_q):
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
ui = Ui_window()... |
test_debug.py | import importlib
import inspect
import os
import re
import sys
import tempfile
import threading
from io import StringIO
from pathlib import Path
from unittest import mock
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from djan... |
cmdline.py | import os
import sys
import time
import imp
import runpy
import traceback
import argparse
import logging
from multiprocessing import Process
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
def run_module(module, function=None):
if function is not None: # run it as a mo... |
lights.py | import itertools
import json
import threading
import time
import RPi.GPIO as GPIO
def on_message(ws, message):
mes = json.loads(message)
print(mes)
if mes['type'] == 'recognizer_loop:record_begin':
my_led.set_state(LED.ON)
if mes['type'] == 'recognizer_loop:audio_output_start':
my_led... |
updates.py | import logging
import time
import traceback
from threading import Thread
from typing import Dict, Set, List, Tuple, Iterable, Optional
from packaging.version import parse as parse_version
from bauh.api.abstract.controller import UpgradeRequirements, UpgradeRequirement
from bauh.api.abstract.handler import ProcessWatc... |
manager.py | #!/usr/bin/env python3
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.android im... |
test_thread.py | import concurrent.futures
import datetime
import random
import sys
import threading
import time
sys.path.append('.')
from factorys import time_it
from milvus import Milvus
dimension = 512
number = 100000
table_name = 'multi_task'
def add_vector_task(milvus, vector):
status, ids = milvus.insert(table_name=table_... |
util.py | #
# Copyright (c) 2017, Manfred Constapel
# This file is licensed under the terms of the MIT license.
#
import sys
import cv2 as cv
import numpy as np
try:
import pyximport; pyximport.install()
except:
pass
# ==========================================
def subcopy(A, B, afrom, bfrom, bto):
afrom, bfrom, ... |
cloudevents-receiver.py | #!/usr/bin/env python3
# copy to /usr/local/bin/cloudevents-receiver and use with cloudevents.service
import blinkt
import colorsys
import json
import random
import threading
import time
from flask import Flask, request
from cloudevents.http import from_http
app = Flask(__name__)
stop = threading.Event()
lock = thre... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
sample_error.py | import sys
import numpy as np
import random
import argparse
from operator import itemgetter
import multiprocessing as mp
from tqdm import tqdm
import os
import librosa
from transforms import scale_volume, shift
sys.path.append('..')
from util import str2bool, split, lmap # noqa: E402
sys.path.append('./GCommandsPytorc... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_deeponion.util import bfh, bh2u, UserCancelled
from electrum_deeponion.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
fr... |
test_output.py | import subprocess
import sys
import pytest
import re
import signal
import time
import os
import ray
from ray._private.test_utils import (run_string_as_driver_nonblocking,
run_string_as_driver)
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
def test_au... |
pyDubMod.py | #pydub imports
import os
from requests import Request
import requests
import json
import uuid
import string
from pydub import AudioSegment
import io, subprocess, wave, aifc, base64
import math, audioop, collections, threading
import platform, stat, random, uuid
# define exceptions
class TimeoutError(Exception): pass
... |
lfw_eval.py | import multiprocessing as mp
import os
import pickle
import queue
from multiprocessing import Process
from multiprocessing import Process
import cv2 as cv
import dlib
import numpy as np
from keras.applications.inception_resnet_v2 import preprocess_input
from tqdm import tqdm
from config import lfw_folder, img_size, c... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement, unicode_literals
import functools
import os
import sys
import copy
import time
import types
import signal
import random
import logging
import threading
import tracebac... |
utils.py | import threading
import contextlib
from flask import request, url_for
import requests
@contextlib.contextmanager
def serve_app(app, port, https=False):
opts = {'ssl_context': 'adhoc'} if https else {}
app.config['PREFERRED_URL_SCHEME'] = 'https' if https else 'http'
app.config['SERVER_NAME'] = 'localhos... |
epsig2_gui.py | # epsig2_gui.py
# Ported from R## L######'ss LUA script version to python.
#
## from R##'s original epsig2.lua
## Usage:
## lua epsig2.lua bnkfilename [seed [reverse] ]
##
## examples: lua epsig2.lua ARI\10163088_F23B_6040_1.bnk
## lua epsig2.lua ARI\10163088_F23B_6040_1.bnk 1234
## lua epsig2.lua... |
test_context.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... |
server.py | import base64
import cv2
import zmq
import numpy as np
import threading
def face_model_fit(id):
# todo 얼굴 학습되게 코드 넣기
print("fit :", id)
def process(recv_socket):
while True:
frame = recv_socket.recv_string()
data = frame.split(":")
header = data[0]
if hea... |
test_integration_input_app_output.py | import datetime
import threading
import pytest
import os
import time
from dotenv import load_dotenv
from agogosml.common.kafka_streaming_client import KafkaStreamingClient
from agogosml.reader.input_reader_factory import InputReaderFactory
from agogosml.writer.output_writer_factory import OutputWriterFactory
from tes... |
test_processor_service.py | # Copyright 2017 - Nokia
#
# 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... |
handlers.py | """
Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python.
Copyright (C) 2001-2016 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging.handlers' and log away!
"""
import logging, socket, os, pickle, struct, time, re
from stat... |
NWChemKbaseServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
host.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... |
Screen4.py | import os
import threading
import tkinter.messagebox
import webbrowser
from tkinter import *
from tkinter import ttk, filedialog
from PIL import ImageTk, Image
from pdf2image import convert_from_path
from threading import *
class Card:
def __init__(self, path, label):
self.label = label
self.sele... |
utils.py | import numpy as np
import torch
import torch.nn as nn
import torch.multiprocessing as mp
from torch.autograd import Variable
import gym
import argparse
import matplotlib.pyplot as plt
import seaborn as sns
import os
import datetime
import pickle
import time
from collections import deque
'''
@authors:
Nicklas Hansen,
P... |
Assigner.py | #!/usr/bin/env python3
"""Parsing raw pages into JSON data for snippet crawler"""
from BaseLogger import BaseLogger
from DatabaseAccessor import DatabaseAccessor
from config import config_crawl_date_min, config_assign_process, config_idle_sleep
from contextlib import closing
from json import loads
from multiprocessing... |
behaviors.py | # -*- coding: UTF-8 -*-
# NVDAObjects/behaviors.py
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2006-2019 NV Access Limited, Peter Vágner, Joseph Lee, Bill Dengler
"""Mix-in classes which provide co... |
child_process_executor.py | """Facilities for running arbitrary commands in child processes."""
import os
import queue
import sys
from abc import ABC, abstractmethod
from typing import NamedTuple
import dagster._check as check
from dagster.core.errors import DagsterExecutionInterruptedError
from dagster.utils.error import SerializableErrorInfo... |
test_fork1.py | """This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import threading
import time
import unittest
from test.fork_wait import ForkWait
from test.support import reap_children, get_attribute, verbose
# Skip test if fork does not exist.
get_attribute(os, 'fork')
if... |
manual_wallpaper_changer.py | from tkinter import *
from tkcalendar import DateEntry
from datetime import date
from datetime import timedelta
from win10toast import ToastNotifier
import apod_object_parser
import wallpaper_utility
import threading
def setWallpaperByDate(cal):
disableButtons()
response = apod_object_parser.get_data_by_date... |
controller.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import sys
from threading import Thread
from types import LambdaType
from apscheduler.schedulers.background import BackgroundScheduler
from typing import ... |
sunny_new_line_detect_simple_gazebo.py | #!/usr/bin/env python
from cv_bridge import CvBridge, CvBridgeError
from duckietown_utils.jpg import image_cv_from_jpg #location:f23-LED/led_detection/include
import threading
import rospy
import numpy as np
import cv2
import math
from sensor_msgs.msg import CompressedImage, Image
from ino_car.msg import LaneLine, Lan... |
instrument_protocol.py | #!/usr/bin/env python
"""
@package ion.services.mi.instrument_protocol Base instrument protocol structure
@file ion/services/mi/instrument_protocol.py
@author Steve Foley,
Bill Bollenbacher
@brief Instrument protocol classes that provide structure towards the
nitty-gritty interaction with individual instrument... |
VHT.py | from multiprocessing import Process,Semaphore
import multiprocessing as mp
import socket
import cmsisdsp.sdf.nodes.host.message as msg
HOST = '127.0.0.1' # The remote host
PORT = 50007
class ModelicaConnectionLost(Exception):
pass
def connectToServer(inputMode,theid):
s=socket.socket(socket.AF_INET, socke... |
cs_anomaly_detector.py | import numpy as np
import os
from algorithm.cluster import cluster
from algorithm.cvxpy import reconstruct
from algorithm.sampling import localized_sample
from cvxpy.error import SolverError
from multiprocessing import Process, Event, Queue
from threading import Thread
max_seed = 10 ** 9 + 7
class CycleFeatureProces... |
reconnecting_websocket.py | import logging
import random
import threading
import websocket
from pglet.utils import is_localhost_url
_REMOTE_CONNECT_TIMEOUT_SEC = 5
_LOCAL_CONNECT_TIMEOUT_SEC = 0.2
class ReconnectingWebSocket:
def __init__(self, url) -> None:
self._url = url
self._on_connect_handler = None
self._on... |
test_index.py | import pytest
from base.client_base import TestcaseBase
from base.index_wrapper import ApiIndexWrapper
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from common.code_mapping import CollectionErro... |
ArnoldRenderTest.py | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
app.py | from flask import Flask, render_template, flash, redirect, url_for, session, logging, request, jsonify
from wtforms import Form, StringField, PasswordField, validators, ValidationError
from passlib.hash import sha256_crypt
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
from werkzeug.security imp... |
fuzzer.py | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
conftest.py | import pytest
import time
from context import HGECtx, HGECtxError, ActionsWebhookServer, EvtsWebhookServer, HGECtxGQLServer, GQLWsClient, PytestConf
import threading
import random
from datetime import datetime
import sys
import os
from collections import OrderedDict
def pytest_addoption(parser):
parser.addoption(
... |
controller.py | #!/usr/bin/python
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
import time
import atexit
import threading
import random
import argparse
import math
import msgpackrpc
import socket
import RPi.GPIO as GPIO
PWM_PIN = 22
INCREASE = 1
DECREASE = -1
def stepper_worker(stepper, nu... |
main.py | INTERVAL = 5
MSG_TXT = '{{"device_id": {device_id}, "critical": {level}, "pressure": {pressure}, "power_state": {power_state}}}'
ERROR_TXT = '{{"device_id": {device_id}, "critical": {level}, "ERROR_0": {ERROR_0}, "ERROR_1": {ERROR_1}, "ERROR_2": {ERROR_2}}}'
RECEIVED_MESSAGES = 0
import logging
from agent import Agent... |
pydPiper.py | #!/usr/bin/python.pydPiper
# coding: UTF-8
# pydPiper service to display music data to LCD and OLED character displays
# Written by: Ron Ritchey
from __future__ import unicode_literals
import json, threading, logging, Queue, time, sys, getopt, moment, signal, commands, os, copy, datetime, math, requests
import pages
... |
testsuite.py | # Copyright (c) 2009 Jonathan M. Lange. See LICENSE for details.
"""Test suites and related things."""
__metaclass__ = type
__all__ = [
'ConcurrentTestSuite',
'iterate_tests',
]
try:
from Queue import Queue
except ImportError:
from queue import Queue
import threading
import unittest
import testtools
... |
main.py | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
# For guidance, see https://docs.microsoft.com/azure/iot-edge/tutorial-python-module
import sys
import time
import threading
from azure.iot.device import IoTHubModuleC... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
gdaltest_python3.py | # -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Python Library supporting GDAL/OGR Test Suite
# Author: Even Rouault, <even dot rouault at spatialys.com>
#
#####################################################... |
root_event_listener.py | import time
import random
import json
import threading
from web3 import Web3, HTTPProvider
from hashlib import sha256
from hexbytes import HexBytes
from web3.utils.datastructures import AttributeDict
import pickle
class RootEventListener(object):
"""Listens to events on the root chain.
We abstract the logic ... |
test_sqliteq.py | from functools import partial
import os
import sys
import threading
import time
import unittest
try:
import gevent
from gevent.event import Event as GreenEvent
except ImportError:
gevent = None
from peewee import *
from playhouse.sqliteq import ResultTimeout
from playhouse.sqliteq import SqliteQueueDataba... |
Grab_proxy_xundaili_zh.py | import requests
import json
import time
from threading import Thread
from .RedisClient import RedisClient
from logconfig import LogConfig
import logging
from logging.config import dictConfig
config = LogConfig(info_file=r'grabInfo.log', err_file=r'grabErr.log').log_config
logging.config.dictConfig(config)
info_logger ... |
SimplePortScanner.py | import optparse
import socket
from socket import *
from threading import *
def connScan(Host, tgtPort):
try:
#initiates TCP connection
connSkt = socket(AF_INET, SOCK_STREAM)
connSkt.connect((Host, tgtPort))
print('[+] Port %d: Open' % (tgtPort))
connSkt.close()
except:... |
__init__.py | import os
import zstandard
import ujson as json
import time
import tarfile
import codecs
from functools import reduce
import jsonlines
import io
from zipfile import ZipFile
import gzip
from math import ceil
import mmap
import multiprocessing as mp
def listdir_or_file(x):
if isinstance(x, list):
return red... |
DataLoader1_ReadAll.py | from DataLoader.Helper.Helper_Global2Local import Global2Local
import threading
from Common.CommonClasses import *
from DataLoader.DataLoader0_ReadAnns import DataLoader0_ReadAnns
from DataLoader.DataVis import *
from DataLoader.Helper.Helper_TargetUnpacker import *
from Common.Calculation import Calculation
import tim... |
photon_client.py | #!/usr/bin/env python3
import logging
import sys
import threading
import time
import os
from kik_unofficial.datatypes.peers import Group, User
from kik_unofficial.client import KikClient
from kik_unofficial.callbacks import KikClientCallback
from kik_unofficial.datatypes.xmpp.chatting import IncomingChatMessage, Incom... |
multiprocTest.py |
from time import sleep
def TestFunction( test1, test2 ):
print( 'these are the props', test1, test2)
while True:
print( 'we are looping' )
sleep(1)
return
if __name__ == "__main__":
import multiprocessing
proc = multiprocessing.Process(target=TestFunction, args=({'test':1, 't... |
cluster.py |
# Copyright IBM Corp, All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
import datetime
import logging
import os
import sys
import time
import copy
from threading import Thread
import requests
from pymongo.collection import ReturnDocument
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..... |
_channel.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... |
collect_logs.py | # Microsoft Azure Linux Agent
#
# Copyright 2020 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
zmq_driver.py | # Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
gui.py | #! /usr/bin/env python3
"""
Tapeimgr, automated reading of tape
Graphical user interface
Author: Johan van der Knijff
Research department, KB / National Library of the Netherlands
"""
import sys
import os
import time
import threading
import logging
import queue
import uuid
from pathlib import Path
import tkinter as ... |
robot.py | #
# COPYRIGHT:
# The Leginon software is Copyright 2003
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
from PIL import Image
import sys
import threading
import time
from leginon import leginondata
import emailnotifi... |
test_local_workflows.py | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
test_http_request.py | __author__ = 'wenjusun'
from httplib import HTTPConnection
from httplib import HTTPSConnection
import threading
import time
import sys
def download(host,path):
common_httpreq(HTTPConnection(host),path)
def https_download(host,path):
common_httpreq(HTTPSConnection(host),path)
def common_httpreq(httpcon,p... |
threshold.py | import os
import numpy as np
import json
from AFSD.common.anet_dataset import load_json
from AFSD.common.config import config
from test import get_basic_config, inference_thread
import multiprocessing as mp
import threading
def compute_threshold(result_dict, scoring='confidence'):
all_scores = []
for vid, p... |
__init__.py | #!/usr/bin/python3
# @todo logging
# @todo extra options for url like , verify=False etc.
# @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option?
# @todo option for interval day/6 hour/etc
# @todo on change detected, config for calling some API
# @todo fetch title into json
# https://di... |
multiUpload.py | Import('env')
from platformio import util
import threading
from threading import Thread
from base64 import b64decode
import sys
import glob
import time
# Based on https://github.com/platformio/platformio-core/issues/1383
upload_cmd = env.subst('$UPLOADCMD')
def getPorts():
simultaneous_upload_ports = ARGUMENTS.g... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_window... |
mp_workers.py | #
# Simple example which uses a pool of workers to carry out some tasks.
#
# Notice that the results will probably not come out of the output
# queue in the same in the same order as the corresponding tasks were
# put on the input queue. If it is important to get the results back
# in the original order then consider ... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "https://moneybrozbot.xyz"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
test_channel.py | from __future__ import absolute_import
import unittest
import stackless
try:
import threading
withThreads = True
except ImportError:
withThreads = False
import sys
import traceback
import contextlib
from support import test_main # @UnusedImport
from support import StacklessTestCase, require_one_thread
@c... |
test_process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import io
import os
import sys
import threading
import time
import signal
import multiprocessing
import functools
import datetime
import warnings
# Import Salt Testing libs
from tests.support.unit imp... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hello. I am Alfred!"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
test_opencypher_status_without_iam.py | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
import threading
import logging
import time
import requests
from test.integration.DataDrivenOpenCypherTest import DataDrivenOpenCypherTest
logger = logging.getLogger('TestOpenCypherStatusWithoutIam')
clas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.