source
stringlengths
3
86
python
stringlengths
75
1.04M
networkcmd.py
#!/usr/bin/env python """ Copyright 2018 Allan Brand 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...
dmm.py
# -*- coding: utf-8 -*- import re, os import threading import time from jinja2 import PackageLoader,Environment from bs4 import BeautifulSoup from queue import Queue #from lxml import etree from app.utils.func_requests import get_html_jp from app.utils import Loadconfig from selenium import webdriver from app.utils.fu...
test_tcp.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Thomas Jackson <jacksontj.89@gmail.com>` ''' # Import python libs from __future__ import absolute_import import os import threading import tornado.gen import tornado.ioloop from tornado.testing import AsyncTestCase import salt.config import salt.ext.six as six imp...
worker_command.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...
mainProducer.py
import threading from socketProducer import SocketProducer from rabbitPublishFromFile import RabbitPublishFromFile from socketPublishFromFile import SocketPublishFromFile from folderListener import Listener from pika.exchange_type import ExchangeType from serverSocket import Server import sys from rabbitProducer import...
job_manager.py
import threading as th import time, logging, importlib, os, time import inspect import os import sqlite3 from datetime import datetime logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] (%(threadName)-10s) %(message)s',) def mk_thread(function): def wrapper(*args, **kwargs): ...
import_thread.py
from collections import defaultdict import threading import traceback import redis import grpc import ray from ray import ray_constants from ray import cloudpickle as pickle import ray._private.profiling as profiling import logging logger = logging.getLogger(__name__) class ImportThread: """A thread used to im...
template_03.py
__author__ = "Wenjie Chen" __email__ = "wc2685@columbia.edu" import os import time from multiprocessing import Process from phonenumbers.phonenumberutil import region_code_for_country_code from pyspark import SparkConf, SparkContext from pyspark.sql import SparkSession from pyspark.streaming import StreamingContext ...
game.py
import random as rd from time import sleep, time from threading import Thread, Lock import pygame from load_image import load_image from run_with_fps import run_with_fps, ExitLoop from fatal_exceptions import fatal_exceptions from enemy import Enemy from player import Player from health_osd import HealthOSD from game...
hub.py
# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------...
__init__.py
"""Client API for Camect.""" import asyncio import base64 import json import logging import ssl import sys from threading import Thread import time from typing import Callable, Dict, List import urllib3 import requests import websockets EMBEDDED_BUNDLE_JS = "js/embedded_bundle.min.js" _LOGGER = logging.getLogger(__...
RUNThread.py
from NIC_package_get import NICRUN from threading import Thread from ScanapiCookie import RUN_COOKIE import os import requests from flask import Flask, jsonify from scanapi.v5.RepeterByRequests import RUNRepeter import time class spider(): def __init__(self): self.WEBSITE=os.environ.get('WEBSITE') ...
test_sampler.py
import multiprocessing import random from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import Union from unittest.mock import Mock from unittest.mock import patch import warnings import _pytest.capture import numpy as np import pytest import optuna fro...
main.py
from werkzeug.exceptions import BadRequestKeyError from flask import Flask, request import dataclasses import json from typing import Any import urllib.parse import requests import mwparserfromhell from mwparserfromhell.nodes import Wikilink, Text, Template import time import threading default_chest_costs = dict( ...
background_helper.py
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2018 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ------------------------------------...
main.py
#!/bin/python3 from __future__ import annotations # because raspberry pi is on Python 3.7 and annotations are 3.9 import datetime from enum import IntEnum # https://github.com/danielorf/pyhubitat from pyhubitat import MakerAPI import logging from pathlib import Path import pytz # timezones import re import thread...
smart_explainer.py
""" Smart explainer module """ import logging import copy import pandas as pd from shapash.webapp.smart_app import SmartApp from shapash.utils.io import save_pickle from shapash.utils.io import load_pickle from shapash.utils.transform import inverse_transform, apply_postprocessing from shapash.utils.transform import ad...
crypto_partial_book_fetch.py
import asyncio from mimetypes import init import time import traceback from datetime import datetime from binance.client import Client from binance import ThreadedDepthCacheManager from binance import ThreadedWebsocketManager from binance import AsyncClient, BinanceSocketManager from multiprocessing import ProcessError...
mail.py
# 如果将本代码命名为 email.py,会与系统包文件冲突 from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): app = current_app._get_...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
discovery.py
""" Copyright 2019 InfAI (CC SES) 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...
server.py
import socket import threading import struct class Server(object): def __init__(self): self.host = "0.0.0.0" self.port = 9001 self.server_name = (self.host, self.port) self.recv_size = 11 def start_server(self): # 创建socket的工具对象 sock = socket.socket(socket.AF_IN...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import verbose, import_module, cpython_only from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import time import unittest import weakref import os import ...
avnet_face_detection_mt.py
''' Copyright 2020 Avnet 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, software dis...
movementControl.py
import time from threading import Thread from templates.workerprocess import WorkerProcess class MovementControl(WorkerProcess): # ===================================== Worker process ========================================= def __init__(self, inPs, outPs): """Controls the speed and steering of the ...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
test_logging.py
# Copyright 2001-2019 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...
command_line.py
import sklearn # to load libgomp early to solve problems with static TLS on some systems like bioconda mulled tests import matplotlib.pyplot as plt # also to solve import ordering problems in bioconda mulled tests from deepaclive.receiver import Receiver from deepaclive.sender import Sender from deepaclive.refilter imp...
controller.py
import argparse import os import time import re from multiprocessing import cpu_count, Pool from multiprocessing.pool import ThreadPool from threading import Thread, Lock, Event import socket from io import BytesIO import math import ast import traceback import chainer import chainer.functions as F try: import cu...
main.py
from threading import Thread from dl import Downloader from utils.query import download_state, print_download_state if __name__ == '__main__': while True: pass # download = Downloader(url, args.output if args.output else url.split('/')[-1]) # Thread(target=download.download).start() ...
Server.py
from random import randint import sys, traceback, threading, socket from RtpPacket import RtpPacket # server state STATE = { 'INIT': 0, 'OK': 1, 'PLAYING': 2, } # process vided stream class Streaming: count = 1 def __init__(self, path): self.path = path try: self.fil...
app_test.py
from __future__ import unicode_literals import os import threading import time import pexpect import serial from tiny_test_fw import Utility import ttfw_idf class SerialThread(object): def run(self, log_path, exit_event): with serial.Serial('/dev/ttyUSB1', 115200) as ser, open(log_path, 'wb') as f: ...
rabbit.py
from __future__ import annotations import logging import os import time from contextlib import contextmanager from dataclasses import dataclass from ssl import SSLContext from threading import Thread from typing import Callable, Type, Iterator import pika from pika import PlainCredentials, BasicProperties from pika.a...
helper.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
subproc_vec_env.py
import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while True: cmd, data = remote.recv() if cmd == 'step': ob, reward, done, i...
subproc_vec_env.py
import numpy as np from multiprocessing import Process, Pipe from .vec_env import VecEnv, CloudpickleWrapper def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() try: while True: cmd, data = remote.recv() if cmd == 'step': ...
supervisor.py
# Copyright 2016 Google Inc. 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 a...
main.py
import background import threading import show def main(): background_ = threading.Thread(target=background.main) show_ = threading.Thread(target=show.main) background_.start() show_.start() if __name__ == '__main__': main()
build.py
# Copyright 2014 The Oppia 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 applicable ...
main.py
"""Main loop for bridge subsystem.""" from shared import config from shared.controller import Controller from bridge.bridge import Bridge from flask import Flask, request, jsonify from flask_htpasswd import HtPasswdAuth from flask_cors import CORS import threading from shared.streamtologger import StreamToLogger impor...
kanilogServer.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...
test_logging.py
# Copyright 2001-2017 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...
option_picker.py
import traceback from Tkinter import * from multiprocessing import Queue from tkColorChooser import askcolor import json from string import maketrans, lower import re import ttk import pygame.sysfont from options import Options import logging import urllib2 import webbrowser import platform import threading from error_...
futu_broker_hk.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Futu, 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 requi...
planificador_merge_threading.py
import Sensor_merge_threading import random import time import numpy import sys import threading def alarmas(lista, lista_tiempos_promedios, num_process): tiempo_inicio = time.time() while (time.time()-tiempo_inicio < 5): for i in range (0,num_process): if(lista[i] > 0): tie...
dataengine_configure.py
#!/usr/bin/python3 # ***************************************************************************** # # 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 ...
simulation.py
from itertools import count from collections import namedtuple from queue import Empty from time import sleep import multiprocessing as mp import numpy as np import cloudpickle # For pickling lambda functions and more from huskarl.memory import Transition from huskarl.core import HkException # Packet used to transm...
reconnect_test.py
from threading import Thread from time import sleep from hazelcast import ClientConfig from hazelcast.exception import HazelcastError from hazelcast.lifecycle import LIFECYCLE_STATE_DISCONNECTED, LIFECYCLE_STATE_CONNECTED from hazelcast.util import AtomicInteger from tests.base import HazelcastTestCase from tests.util...
datarecorderfactory.py
""" DataRecorder factory """ import time import utils.remote as rmt import optotrak.optotrakfactory as otf def connect(datarecorderinstancetype=None, optotrakinstancetype=None): if datarecorderinstancetype is None: datarecorderinstancetype = create_default_instance_type(...
ftpserver.py
#!/usr/bin/python3 from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler from pyftpdlib.handlers import ThrottledDTPHandler from pyftpdlib.servers import FTPServer # import additions import sys import os import errno import socket import threading import subprocess import time im...
main.py
import db from twitch import ( get_OAuth, is_streamer_live, name_changed, get_stream_title, get_streamer_id, ) from tt import * from utils import * import time import schedule import threading from dotenv import load_dotenv load_dotenv() def main(): # Variável que control...
brenbot.py
#!/usr/bin/env python3 import sys sys.path.append('/usr/local/lib/python3.5/site-packages') import logging import logging.handlers import os import time import random import threading import subprocess from slackclient import SlackClient __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirn...
car_client.py
""" 此模块做停车管理系统的客户端 Author:Recall Date: 2018-10-19 module: socket、multiprocessing、sys、os、time、signal Email: """ from socket import * from setting import * from messageAff import user_message from multiprocessing import Process import sys,os,time,signal class carClient(object): def __init__(self): self.so...
testworkflow.py
""" Workflow API module tests """ import json import os import tempfile import unittest from http.server import HTTPServer, BaseHTTPRequestHandler from threading import Thread from unittest.mock import patch from fastapi.testclient import TestClient from txtai.api import app, start # Configuration for workflows WO...
main.py
import argparse from threading import Thread import time from socket import * from os.path import * import os import struct import hashlib import math def _argparse(): parser = argparse.ArgumentParser(description="This is description!") parser.add_argument('--ip', action='store', required=True, dest='ip', hel...
selective_search_multiprocess.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import sys from multiprocessing import Process import os import mmcv import cv2 import selectivesearch import matplotlib.pyplot as plt import pprint import matplotlib.patches as mpatches import skimage.io import selective_search def wo...
context_test.py
"""Tests for context.py.""" import logging import random import socket import threading import time from .google_imports import apiproxy_errors from .google_imports import datastore from .google_imports import datastore_errors from .google_imports import datastore_pbs from .google_imports import datastore_rpc from .g...
manager.py
# Copyright (c) 2021 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 appli...
client.py
import ssl import json import time import socket import logging import random import Queue import threading RECV_SIZE = 2 ** 16 CLIENT_VERSION = "0.0" PROTO_VERSION = "1.0" DEFAULT_HOST = "ecdsa.net" DEFAULT_PORT = 50001 TIMEOUT = 5 logging.basicConfig(level=logging.DEBUG) log = logging.getLogger("stratum-client") ...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
ev_farmer.py
from pokeAPI import * import time from threading import Thread from prompt_toolkit import HTML, print_formatted_text from prompt_toolkit.styles import Style import sys import os import random driver = pokeAPI().register_window(name="PokeММO") wx, wy = driver.get_window_rect()[:2] ROUND_COUNT = 0 print = print_format...
RID_2.0.2.py
''' This is a script for scrapping pseudo-random images from Imgur. Implemented is the addition of threading and functions for a GUI ''' import random import string import urllib import os import imghdr import threading length = 6 directory = 'test10' name = 'threads' def swap_dir(user_dir): if ...
dark_reaper.py
# Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
map_reduce.py
r""" Parallel computations using RecursivelyEnumeratedSet and Map-Reduce There is an efficient way to distribute computations on a set `S` of objects defined by :func:`RecursivelyEnumeratedSet` (see :mod:`sage.sets.recursively_enumerated_set` for more details) over which one would like to perform the following kind of...
numpipe.py
""" Defines the scheduler class, which does the following: * keeps track of all cached functions * parse arguments when program is run * execute functions (possibly in parallel) * cache results as they come in """ import h5py import os import sys import pathlib import logging from inspect import signat...
WebServer.py
import re import socket import threading from time import sleep from typing import Tuple from PyQt5.QtCore import pyqtSignal from Network import StopThreading class WebLogic: signal_write_msg = pyqtSignal(str) def __init__(self): self.tcp_socket = None self.sever_th = None self.dir ...
checkpoint_utils.py
"""Implements similar functionality as tf.train.Checkpoint and tf.train.CheckpointManager. https://gist.github.com/kevinzakka/5d345421f7abefd5dbaf6a77f829e70a. """ import logging import os import os.path as osp import queue import re import signal import threading from glob import glob import numpy as np import torch...
main.py
#!/usr/bin/env python2.7 import argparse # new in Python2.7 import os import time import string import atexit import threading import logging import sys import subprocess from yapsy.PluginManager import PluginManager # OPENBCI FUNCTIONS------------------------------------------------------------- # Load the plugins ...
test_local_catalog.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...
GraphGadgetTest.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
Melee Code Manager.py
#!/usr/bin/python # This Python file uses the following encoding: utf-8 # ------------------------------------------------------------------- # # ~ ~ Written by DRGN of SmashBoards (Daniel R. Cappel); June, 2015 ~ ~ # # - - [Python v2.7.9 & 2.7.12] - - # ...
main.py
# -*- coding:utf-8 -*- """ Xi Gua video Million Heroes """ import logging.handlers import multiprocessing import os import threading import time from argparse import ArgumentParser from datetime import datetime from functools import partial from multiprocessing import Event, Pipe, Queue from config import api_...
pose_camera.py
# Copyright 2019 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, ...
Bullet.py
from tkinter import Label import threading class Bullet(Label): def __init__(self, x, y, space): self.space = space self.bullet_timer = 0.01 self.bullet_indicator = "'" self.damage = -100 Label.__init__(self, text=self.bullet_indicator) self.pack() self._x =...
agent.py
def goAirportAgent(parent=None, communication_line=None): import os import sys import signal import ctypes import multiprocessing from time import sleep from threading import Thread from time import sleep from random import random import speech_recognition as sr import resp...
hnsentiment.py
#/usr/bin/python3 import asyncio import concurrent.futures import requests import json import threading from nltk.sentiment.vader import SentimentIntensityAnalyzer HN_TOP_STORIES_URL = "https://hacker-news.firebaseio.com/v0/topstories.json" HN_ITEM_QUERY_BASE_URL = "https://hacker-news.firebaseio.com/v0/item/" stori...
test_nanny.py
import asyncio import gc import logging import multiprocessing as mp import os import random import sys from contextlib import suppress import pytest from tlz import first, valmap from tornado.ioloop import IOLoop import dask from distributed import Client, Nanny, Scheduler, Worker, rpc, wait, worker from distribute...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import tempfile import urllib.request import traceback import asyncore import weakref import platform import functools from u...
dqn_train.py
""" Copyright (c) College of Mechatronics and Control Engineering, Shenzhen University. All rights reserved. Description : dqn algorithm used for controling the steer to make a vehicle keep lane. Author:Team Li """ import tensorflow as tf import cv2, math, sys, random, threading from keep_lane.basic_net.dqn_utils im...
httpstream.py
from queue import Queue from collections import namedtuple from tornado.platform.asyncio import AnyThreadEventLoopPolicy import asyncio import aiohttp import itertools import threading # todo remove import simplestopwatch as sw # todo check out aiodns resolver # https://stackoverflow.com/a/45169094/1102470 Response...
tvhProxy.py
#!/usr/bin/env python from gevent import monkey monkey.patch_all() from dotenv import load_dotenv from ssdp import SSDPServer from flask import Flask, Response, request, jsonify, abort, render_template from gevent.pywsgi import WSGIServer import xml.etree.ElementTree as ElementTree from datetime import timedelta, date...
app.py
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import sys, glob, os sys.path.insert(0, glob.glob(os.environ.get('LUCIDAROOT') + '/../tools/thrift-0.9.3/lib/py/build/lib*')[0]) from controllers import * from flask import * from threading import Threa...
main.py
# Librerias Necesarias from tkinter import * from tkinter import ttk from PIL import ImageTk, Image import numpy as np import sys sys.path.insert(1, 'config/') import languaje as lang import setting as stt import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.p...
spi_handler.py
#!/usr/bin/env python import sys sys.path.append("../../") import rospy from std_msgs.msg import String import numpy as np from sensor_msgs.msg import PointCloud2, PointField from sensor_msgs.msg import CompressedImage from std_msgs.msg import Header from nav_msgs.msg import Odometry import cv2 import threading from...
offline_worker.py
import os import time import json import copy import cv2 import threading import numpy as np from shapely.geometry import Point, Polygon from typing import Dict, List, Tuple from dataclasses import dataclass from concurrent.futures.thread import ThreadPoolExecutor from nxs_libs.db import NxsDbFactory, NxsDbType from nx...
run.py
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University # ServerlessBench is licensed under the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1. # You may obtain a copy of Mulan PSL v1 at: # http://license.coscl.org.cn/M...
ftp.py
""" import & globals """ import ftplib import os import threading """ test connection """ def test_ftpconnection(server, port, user, password, path, log): try: """ login to ftp server """ ftp = ftplib.FTP() ftp.connect(server, port) ftp.login(user=user, passwd=pass...
ws.py
import threading import time from channels.generic.websocket import JsonWebsocketConsumer from kubeops_api.models.deploy import DeployExecution class F2OWebsocket(JsonWebsocketConsumer): disconnected = False execution_id = None def connect(self): self.execution_id = self.scope['url_route']['kwar...
dvrk_move_wait_test.py
#!/usr/bin/env python # Author: Anton Deguet # Date: 2021-01-29 # (C) Copyright 2021 Johns Hopkins University (JHU), All Rights Reserved. # --- begin cisst license - do not edit --- # This software is provided "as is" under an open source license, with # no warranty. The complete license can be found in license.tx...
motors.py
import os import logging import time from threading import Thread from navio.pwm import PWM pi = os.getenv('PI', False) logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) T100 = 't100' SERVO = 'servo' # map of duty cycle settings in milliseconds which is the # units expected by the navio PWM module...
index.py
from utils import thread_delay import threading import _thread import time def start_and_wait_thread_finish(*args): for thr in args: thr.start() for thr in args: # wait thread finish to execute the next lines thr.join() def volume_cube(a): print('Volume of cube: ', a**3) def volu...
galaxy_loggers-2.0.0.py
#!/usr/bin/python #-*- coding: UTF-8 -*- # # galaxy_loggers-2.0.0.py # # 生成测试数据文件 # # see: $APPHELP # # ZhangLiang, 350137278@qq.com # # LOGS: # -- 2017-12-08: first created # -- 2018-03-02: last updated and released ######################################################################## import os, sys, signal...
role_handler.py
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ---------------------------------------------...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
test_api.py
import mock import errno import re import socket import threading import time import warnings from unittest import TestCase import pytest from ddtrace.api import API, Response from ddtrace.compat import iteritems, httplib, PY3 from ddtrace.internal.runtime.container import CGroupInfo from ddtrace.vendor.six.moves im...
server.py
import asyncio try: import ujson as json except ImportError: import json import os import threading import traceback import rethinkdb as r from flask import Flask, render_template, request, g, jsonify, make_response from dashboard import dash from utils.db import get_db, get_redis from utils...
run_robot_library.py
import os from tempfile import mkdtemp, mkstemp from robot import run from multiprocessing import Process from allure_commons_test.report import AllureReport def run_robot_with_allure(*args, **kwargs): root = os.path.abspath(os.path.join(__file__, "..", "..")) targets = map(lambda target: os.path.join(root, t...
fifo_queue_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
main_window.py
#!/usr/bin/env python3 # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including with...