source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
server.py | import sys
import socket
import threading
class Server:
def __init__(self, hostname='localhost', port=8080):
self.host = hostname
self.port = port
self.clients = []
# crea un socket TCP
self.socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
... |
sources.py | import asyncio
import copy
import csv
import math
import queue
import threading
import uuid
import warnings
from datetime import datetime
from typing import List, Optional, Union, Callable, Coroutine, Iterable
import pyarrow.parquet as pq
import pandas
import pytz
from .dtypes import _termination_obj, Event, legal_ti... |
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... |
BluetoothHCI.py | #!/usr/bin/python
# Bluetooth HCI Python library (Experimental)
#
# Pure Python and standard library based module for interacting with the Bluetooth HCI.
# There is no dependency on the PyBluez Python/Native libraries, bluetoothd service or D-Bus.
# This can be considered to be a Pythonisation of the NodeJS NoBLE/ B... |
gdalutils.py | # -*- coding: utf-8 -*-
import json
import logging
import math
import multiprocessing
import os
import time
from functools import wraps
from itertools import repeat
from statistics import mean
from tempfile import NamedTemporaryFile
from typing import List, Tuple, TypedDict
from django.conf import settings
from django... |
test_creator.py | from __future__ import absolute_import, unicode_literals
import difflib
import gc
import json
import logging
import os
import shutil
import stat
import subprocess
import sys
from collections import OrderedDict
from itertools import product
from stat import S_IREAD, S_IRGRP, S_IROTH
from textwrap import dedent
from thr... |
outputServer.py | from multiprocessing.connection import Listener
from threading import Thread
from collections import deque
from plugins.nvda.src.commConstants import _address, _authkey
_MAX_NUM_UNSENT_MESSAGES = 100
class _OutputServer:
def __init__(self):
self.__connectToClient()
def __connectToClient(self):
... |
rpc_server.py | from socketserver import ThreadingTCPServer, StreamRequestHandler
import json
from threading import Thread
import logging
import queue
import traceback
logger = logging.getLogger('Tester')
Timeout = 120
Port = 11800
class RPCServer(ThreadingTCPServer):
def __init__(self, server_address, RequestHandlerClass, b... |
cellsites.py | import threading
import logging
import numpy as np
from sklearn.cluster import KMeans
class CellSites:
'''
CellSites considers each cluster from the Settlements class and performs K-Means clustering
to identify the appropriate location for each cell site
'''
settlements = np.array([])
def __in... |
client.py | import socket
import threading
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1', 54545))
username = input("Choose your username: ")
# listening to server and sending username
def receive():
while True:
try:
# receive message from the server
... |
server.py | import logging
logging.basicConfig(level=logging.INFO)
import socket
import threading
import pickle
from classes import User, Message
server_user = User('SERVER', '#0d006e')
HEADER = 64
PORT = 5000
#IP = socket.gethostbyname(socket.gethostname()) # prevents hard coding ip address
IP = '192.168.0.11'
ADDR = (IP, PO... |
training.py | # Copyright 2018-2019 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' fil... |
plugin.py | # -*- coding: utf-8 -*-
import time
import logging
import traceback
import sys
import json
from threading import Thread
from mamonsu.lib.const import Template
class PluginDisableException(Exception):
pass
class Plugin(object):
# can be 'mamonsu' or 'agent'
# type depends on run command
Type = 'ma... |
dataengine-service_configure.py | #!/usr/bin/python
# *****************************************************************************
#
# 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 A... |
wsdump.py | #!c:\users\15148\ideaprojects\seeking_order_in_chaos\venv\scripts\python.exe
import argparse
import code
import sys
import threading
import time
import ssl
import gzip
import zlib
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_... |
iostream.py | # coding: utf-8
"""Wrappers for forwarding stdout/stderr over zmq"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
from binascii import b2a_hex
from collections import deque
try:
from importlib import lock_h... |
ping_C.py | #!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
copyright (c) 1989 by The Regents of the University of California.
That code is in turn derived from c... |
client.py | # -*- coding=utf-8 -*-
import base64
import hashlib
import logging
import socket
import json
import platform
import time
import hmac
try:
import ssl
except ImportError:
ssl = None
from multiprocessing import Process, Manager, Queue, pool
from threading import RLock, Thread
try:
# python3.6
from http ... |
commands.py | # This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2021 Drakkar-Software, All rights reserved.
#
# OctoBot is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either
... |
esp_rfc2217_server.py | #!/usr/bin/env python
#
# Redirect data from a TCP/IP connection to a serial port and vice versa using RFC 2217.
#
# This is a modified version of rfc2217_server.py provided by the pyserial package
# (https://pythonhosted.org/pyserial/examples.html#single-port-tcp-ip-serial-bridge-rfc-2217).
# It uses a custom PortMana... |
putobject.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 ... |
streaming_logger.py | from multiprocessing import Process, Queue
import time
import datetime
import serial
import pandas as pd
import math
def sync_to_uq(ser):
"""
Aligns the serial port read to the next 'UQ' header at the start of a data frame.
:type ser: pySerial Serial object
:param ser: The opened pySerial port bound ... |
dumping_callback_test.py | # Copyright 2019 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... |
tangorin.py | import re
from threading import Thread
from typing import Optional
from bs4 import BeautifulSoup as Soup
from bs4.element import Tag
import requests
from custom_types.alternative_string_types import HTMLString, Kaki, URL
from custom_types.exception_types import APIError
from custom_types.response_types import Context... |
test.py | from multiprocessing import Process
server = Process(target=app.run)# ...
server.terminate()
|
train_dist_onnx.py | import time
import argparse
import sys
import os
import threading
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.onnx
from math import ceil
from random import Random
from torch.multiprocessing import Process
from torch.autogr... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
job_worker.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
#
# https://www.apache.org/l... |
HiwinRA605_socket_ros_20190530112005.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
main.py | #!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybricks.tools import wait, St... |
D_main.py | import cv2 # OpenCV
import numpy as np # Tabalha com a parte cientifica (Vetores e Matrizes)
import time
import dlib
import time
import threading
import math
tempoGB = 0
statusSemaforo = 'null'
extent = False
count = 0
semaforoAberto = True
def thread_delay(null):
global tempoGB
global count
global sema... |
run_nvmf.py | #!/usr/bin/env python3
from json.decoder import JSONDecodeError
import os
import re
import sys
import argparse
import json
import zipfile
import threading
import subprocess
import itertools
import configparser
import time
import uuid
from collections import OrderedDict
import paramiko
import pandas as pd
import rpc
... |
parent.py | import os
from flask_testing import LiveServerTestCase
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.firefox.options import Options
from test.support import EnvironmentVarGuard
import threading
import time
from moto.server import create_backend_app
fro... |
object_storage_bulk_restore.py | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
0.py | from multiprocessing import Process, Queue
def f(q):
q.put('X' * 1000000)
if __name__ == '__main__':
queue = Queue()
p = Process(target=f, args=(queue,))
p.start()
p.join() # this deadlocks
obj = queue.get()
|
FTPPasswordScanner.py | import threading
import queue
import ftplib
import json
import socket
import time
def info():
info = {
'name': 'ftp',
'path': 'FTPPasswordScanner',
'fullname': 'SWEP FTP PASSWORD SCANNER',
'description': 'FTP weak password scanner',
'parameters':{
'Url': 'Target... |
musca.py | # based upon @jamessynge's astrohave.py code in POCS
import threading
import time
from pocs.dome.abstract_serial_dome import AbstractSerialDome
from pocs.utils import CountdownTimer
class Protocol:
# device names
SHUTTER = 'Shutter'
DOOR = 'Door'
BATTERY = 'Battery'
SOLAR_ARRAY = 'Solar_A'
S... |
bot.py | # -*- coding: utf-8 -*-
# ##################################
# ZigZag v2 !! #
# Based on The ZigZag Project v2 ! #
# Author: WebShark25 #
# (Mohammad Arshia Seyyed Shakeri) #
####################################
# Author's Website: #
# www.webshark25.ir #... |
proxy_pool.py | import urllib.request
import urllib
import time
from bs4 import BeautifulSoup
import socket
import gzip
import threading
class Proxy_pool():
def __init__(self):
socket.setdefaulttimeout(3) #设置全局超时时间
self.ip_lst=[]
self.lock=threading.Lock()
self.threads=[]
self.doc = open('... |
main.py | import spark
import motion
import commands.camera as camera
import commands.event as event
from bot import process_command
from config import config
from flask import Flask
from flask import request
from flask import jsonify
from threading import Thread
import time
import sys
app = Flask(__name__)
def on_motion_detec... |
server.py | #!/usr/bin/python3
import socket
import threading
import logging
import events
class Server:
def __init__(self):
logging.basicConfig(level=logging.ERROR)
self.ip = "localhost"#socket.gethostbyname(socket.gethostname())
# nicknames support
self.nicknames = set()
self.client... |
bilibili_video_download_v3-linux.py | # !/usr/bin/python
# -*- coding:utf-8 -*-
# time: 2019/07/02--08:12
__author__ = 'Henry'
'''
项目: B站视频下载 - 多线程下载
版本1: 加密API版,不需要加入cookie,直接即可下载1080p视频
20190422 - 增加多P视频单独下载其中一集的功能
20190702 - 增加视频多线程下载 速度大幅提升
'''
import requests, time, hashlib, urllib.request, re, json
from moviepy.editor import *
i... |
test_WxPythonFromInit.py | import sys
import threading
from time import sleep
from unittest import TestCase
import wx
import asn1editor
def delay():
sleep(1)
wx.GetApp().GetTopWindow().Close(True)
wx.GetApp().ExitMainLoop()
class WxPythonFromInit(TestCase):
@staticmethod
def test_open():
action_thread = threadi... |
serve.py | # Most of this code is:
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# The server command includes the additional header:
# For discussion of daemonizing:
# http://aspn.activestate.com/ASPN/C... |
multi_add_password.py | #!/usr/bin/env python
import sys
import math
import json
import multiprocessing
import add_password
import argparse
import utils.database_helper as dbh
import utils.password_handling as ph
import utils.file_handling as fh
import utils.mail_handling as mh
def worker(passwords, args):
config = json.loads(fh.get_c... |
WebBrowserMessengerPy2.py | from __future__ import absolute_import, division, print_function
import traceback
from libtbx.utils import Sorry, to_str
import threading
import time
from websocket_server import WebsocketServer
class WBmessenger(object):
def __init__(self, viewerparent ):
self.parent = viewerparent
self.ProcessMessage = se... |
example_ctypes.py | #!/usr/bin/env python3
"""Simple example with ctypes.Structures."""
import ctypes
import multiprocessing
import os
import random
import time
import ringbuffer
class Record(ctypes.Structure):
_fields_ = [
('write_number', ctypes.c_uint),
('timestamp_microseconds', ctypes.c_ulonglong),
('l... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_mail(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Messag... |
ai_player.py | # coding: UTF-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import random
import sys
import time
from os import path
import threading
from collections import Counter
from time import sleep
from consts.moves import (
CHECKMATE, STALEMATE
)
from consts... |
main_multi_process_version.py | '''
@author Mr Dk.
@version 2020/01/08
'''
import os
import time
import random
import pickle
import pandas as pd
from multiprocessing import Process
from sklearn import tree
# Sort the CSV file by columns ["matchType", "matchId", "groupId"]
# Easier for model training
def pre_process_sort(train_data):
s... |
cvVideoRecorder.py | #!/usr/bin/env python3
import threading
import random
import cv2
import datetime
from time import sleep
class VideoRecorder:
def __init__(self, res_x=640, res_y=480, framerate=25, timestamp=True, timestamp_pos=(50,50), timestamp_fontcolor=(255, 255, 255), timestamp_fontsize=1, timestamp_fontthickness=1, timestamp... |
processmngr.py | # _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... |
03_parallel.py | #!/usr/bin/env python3
import gym
import ptan
import argparse
import torch
import torch.optim as optim
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
from lib import dqn_model, common
PLAY_STEPS = 4
def play_func(params, net, cuda, exp_queue):
env = gym.make(params['env_name'])
... |
gui.py | from threading import Thread
from tkinter import Tk, StringVar, Label, Frame, Entry, Button, Scrollbar, Text, END, LabelFrame, IntVar
from tkinter.messagebox import showerror
from api import API
from execptions import InvalidLogin, InvalidURL, InvalidServerState
from time import sleep
api = None
destroy = False
def ... |
injector.py | # -*- coding: utf-8 -*-
# Copyright 2015-2020 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... |
experiment_tx_push_b.py | """
Transmission script of the range test.
author Jonathan Munoz (jonathan.munoz@inria.fr), January 2017
"""
import time
import logging
import threading
import sys
import sched
import Queue
import json
from datetime import datetime as dt
import datetime
import socket
from threading import Timer
import at86rf215_defs... |
test_time.py | from test import support
import decimal
import enum
import locale
import math
import platform
import sys
import sysconfig
import time
import threading
import unittest
import warnings
try:
import _testcapi
except ImportError:
_testcapi = None
# Max year is only limited by the size of C int.
... |
test_ipc_provider.py | import os
import pathlib
import pytest
import socket
import tempfile
from threading import (
Thread,
)
import time
import uuid
from web3.auto.gethdev import (
w3,
)
from web3.middleware import (
construct_fixture_middleware,
)
from web3.providers.ipc import (
IPCProvider,
)
@pytest.fixture
def jsonrp... |
main.py | # # =================== IMPORTS ======================
import json
import numpy as np
from sklearn.model_selection import train_test_split
import tensorflow.keras as keras
from tensorflow.python.keras.backend import sparse_categorical_crossentropy
from tensorflow.python.keras.engine import input_layer, input_spec
imp... |
regrtest.py | #! /usr/bin/env python3
"""
Script to run Python regression tests.
Run this script with -h or --help for documentation.
"""
USAGE = """\
python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
"""
DESCRIPTION = """\
Run Python regression tes... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines
"""Dask extensions for distributed training. See
https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple
tutorial. Also xgboost/demo/dask for some examples.
Th... |
kegman_conf.py | import json
import copy
import os
import threading
import time
from selfdrive.swaglog import cloudlog
from common.basedir import BASEDIR
def read_config():
default_config = {"cameraOffset": 0.06, "lastTrMode": 1, "battChargeMin": 90, "battChargeMax": 95,
"wheelTouchSeconds": 1800, "battPercOff": ... |
config.py | #!/usr/bin/env python
# coding: utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from glob import glob
from random import choice
from time import sleep
import os
import subprocess
from libqtile import layout, widget, bar, hook
from libqtile.widget import base
from libqtile.manager import Screen, Drag, Cl... |
main_server.py | #!/usr/bin/env python3
import rospy
from flask import Flask, render_template
from flask_socketio import SocketIO, send, emit
from sensor_msgs.msg import Image, CompressedImage
from std_msgs.msg import Int16, Empty
import threading
from geometry_msgs.msg import Wrench
import image_server
import Move_Server
import script... |
category_reshaper.py | #!/usr/bin/env
__author__ = 'Florian Hase'
#========================================================================
import time
import numpy as np
from multiprocessing import Process, Manager
from gryffin.utilities import Logger
from .kernel_prob_reshaping import KernelReshaper
#=================================... |
acceptor.py | import socket
from threading import Thread
from messages import greeting
from session import Session
sessions = []
def _sendall(msg, ses):
for session in sessions:
if session.mark_disconn:
session.send(f"<server> {session.username} has left.")
del session
continue
... |
capture.py | import argparse
import cv2
import threading
import time
import rw_lock
class VideoStream(object):
def __init__(self, camera_index=0):
parser = argparse.ArgumentParser()
parser.add_argument('--camera', type=int, default=0, help='Camera index')
parser.add_argument('--movie', help='Movie filename')
pa... |
main.py | import sys
import time
import keyboard_tool
import win32api
import win32con
from threading import Thread, Event
from PySide6.QtWidgets import QApplication, QMainWindow
from main_form import Ui_MainWindow
class Mainwindow(QMainWindow, Ui_MainWindow):
def __init__(self):
super(Mainwindow, self).__init__()
... |
Resize.py | import argparse
import multiprocessing
from multiprocessing.queues import Queue
from queue import Empty
from PIL.Image import Image
from src.base import IO
def repeat(queue: Queue, resize):
try:
while True:
load_resize_save(queue.get(True, 5), resize)
except Empty:
return
def l... |
env.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... |
test_window_runner.py | # Copyright 2021 Zilliz. 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 applicable law or agree... |
mplog.py | import colorama
import logging
import multiprocessing
import threading
colorama.init()
"""
http://plumberjack.blogspot.com/2010/09/using-logging-with-multiprocessing.html
def _proc_wrapper(queue, func, *args, **kwargs):
# set default logging class or other things here
func(*args, **kwargs)
def logged_proces... |
zergling_collector.py | from typing import Dict, Any, List
import time
import uuid
from collections import namedtuple
from threading import Thread
from functools import partial
import numpy as np
import torch
from easydict import EasyDict
from ding.policy import create_policy, Policy
from ding.envs import get_vec_env_setting, create_env_man... |
bakkes.py | # Wraps bakkes_repl in a subprocess and exposes it via the rcon() function
from subprocess import Popen, PIPE, TimeoutExpired
import threading
import os
import sys
import atexit
###### Public interface ######
def rcon(command):
""" Sends the given command to BakkesMod via bakkes_repl websocket """
global rep... |
app.py | from json import dumps, loads
from os import environ
from threading import Thread
from flask import Flask, request
from pika import BlockingConnection, ConnectionParameters
from helpers import json_respone
from lofar import stage_entrypoint, status_entrypoint
### Config
amqp_host = environ['AMQP_HOST']
amqp_exchang... |
cluster.py | import threading, time, random
from collections import deque
from debug_utils import *
from msg import *
from controller import *
class Cluster():
def __init__(self, _id, fc_server, fc_client, handle_result, max_delay):
self._id = _id
self.fc_server = fc_server
self.fc_client = fc_client
self.handle_result =... |
db_handler_tests.py | import unittest
import sys
import os
import gc
from time import sleep
from cStringIO import StringIO
import shutil
import xmlrunner
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from common.share import Share
from services import dbhandler
from services.logger_service import set_log_level
import lo... |
traffic_light.py | #!/usr/bin/env python3
# Copyright 2020 Open Source Robotics Foundation, 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 re... |
_backends.py | # This software was developed by employees of the National Institute of
# Standards and Technology (NIST), an agency of the Federal Government.
# Pursuant to title 17 United States Code Section 105, works of NIST employees
# are not subject to copyright protection in the United States and are
# considered to be in the ... |
taskTimerClass.py | import datetime
import time
from threading import Thread
from time import sleep
class TaskTimer:
__instance = None
def __new__(cls, *args, **kwargs):
"""
单例模式
"""
if not cls.__instance:
cls.__instance = object.__new__(cls)
return cls.__instance
def __init__(self):
if not ... |
test_client.py | # Copyright 2009-2012 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
test_list_jy.py | import unittest
import random
import threading
import time
from test import test_support
import test_list
if test_support.is_jython:
from java.util import ArrayList
from java.lang import String
class ListTestCase(unittest.TestCase):
def test_recursive_list_slices(self):
x = [1,2,3,4,5]
x[... |
cp.py | try :
import os
import subprocess
import json
from termcolor import colored as clr , cprint
import time
from itertools import zip_longest
from tqdm import tqdm
import threading
import socket
from settings.compiler import competitive_companion_port, parse_problem_with_template
... |
SocketHandler.py | import socket
import threading
import json
import time
from queue import Queue
from Helper.JsonHandler import JsonHandler
from Pipeline.Producer import Producer
from Manager.TwopcManager import TwoPhaseCommitManager
from Handler.LogHandler import LogHandler
'''
The receive manager handles two types of messages
1 - con... |
__init__.py | """Websocket API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import errno
import fnmatch
import glob
import heapq
import io
import json
import logging
import os
import re
import sqlite3
imp... |
test_backend_tk.py | import functools
import inspect
import os
import platform
import re
import subprocess
import sys
import pytest
_test_timeout = 60 # A reasonably safe value for slower architectures.
def _isolated_tk_test(success_count, func=None):
"""
A decorator to run *func* in a subprocess and assert that... |
_config.py | """
Copyright (C) 2021 Intel Corporation
SPDX-License-Identifier: BSD-3-Clause
"""
import os
import logging
from envparse import Env
from zmq_integration_lib import InputPortWithEvents, get_outpad
from threading import Thread, RLock
def display_help():
print("The application needs the following environment var... |
lock.py | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""These tests ensure that our lock works correctly.
This can be run in two ways.
First, it can be run as a node-local t... |
emails.py | # -*- coding: utf-8 -*-
"""
Author: Tyou
"""
from threading import Thread
from flask import url_for, current_app
from flask_mail import Message
from bluelog.extensions import mail
def _send_async_mail(app, message):
with app.app_context():
mail.send(message)
def send_mail(subject, to, html):
a... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
onboarding_api.py | import tornado.web
import threading
from app.service import token_service
from app.service import umm_client_async
from app.service import onboarding_service
from app.utils.file_tools import *
from app.domain.task import Task
import logging
class OnboardingApi(tornado.web.RequestHandler):
async def post(self, ta... |
mask_test.py | import os
from core.detection_module import DetModule
from core.detection_input import Loader
from utils.load_model import load_checkpoint
from six.moves import reduce
from six.moves.queue import Queue
from threading import Thread
import argparse
import importlib
import mxnet as mx
import numpy as np
import six.moves... |
rdd.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... |
frame_processor.py | import cv2
import time
import argparse
import readchar
from datetime import datetime
from threading import Thread
from src.frame_buffer import FrameBuffer
from src.util.log_utils import get_default_logger
from src.util.general import filename_timestamp
logger = get_default_logger()
class FrameProcessor:
"""
... |
__init__.py | import math
import threading
import time
import arrow
import click
import pydash
import jesse.helpers as jh
from jesse.exceptions import CandleNotFoundInExchange
from jesse.models import Candle
from jesse.modes.import_candles_mode.drivers import drivers
from jesse.modes.import_candles_mode.drivers.interface import Ca... |
omsagent_ff.py | #!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 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.... |
igls.py | #
# Copyright 2012, the py-lightstreamer 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 agr... |
managers.py | #
# Module providing manager classes for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token',
'SharedMemoryManager' ]
#
# Imports
#
import sys... |
ALL_IN_ONE_LANDING.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Импорт библиотек
import math
import rospy
import time
from sensor_msgs.msg import Image
from sensor_msgs.msg import CameraInfo
from std_msgs.msg import Int32, Header, Float32
from cv_bridge import CvBridge, CvBridgeError
import cv2
import numpy as np
from threading impo... |
MapReduce2.py | '''
Created on Apr 13, 2017
@author: dj
'''
import os
from threading import Thread
class GenericInputData(object):
def read(self):
raise NotImplementedError
@classmethod
def generate_inputs(cls, config):
raise NotImplementedError
class PathInputData(GenericInputData... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.