source
stringlengths
3
86
python
stringlengths
75
1.04M
synall.py
#!/usr/bin/python import argparse import commands import os import shlex import subprocess import sys import threading GREP_COMMAND = "grep -irn tlat %s" MODULE_LIST = [ "ACCUM", "ADDB", "ADDC", "APRSC", "boot_mem128", "CFG_INT", "CLK_GEN", "dec", "DELAY", "enc", "FLOATA", ...
conftest.py
import copy import logging import os import random import time import tempfile import threading from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime from math import floor from shutil import copyfile from functools import partial from botocore.exceptions import ClientError import pyte...
qdb.py
#!/usr/bin/env python # coding:utf-8 "Queues(Pipe)-based independent remote client-server Python Debugger" __author__ = "Mariano Reingart (reingart@gmail.com)" __copyright__ = "Copyright (C) 2011 Mariano Reingart" __license__ = "LGPL 3.0" __version__ = "1.01b" # remote debugger queue-based (jsonrpc-like interface): ...
rollback_manager.py
""" Rollback manager will perform rollback when the flashless update is failed. Copyright (C) 2019-2021 Intel Corporation SPDX-License-Identifier: Apache-2.0 """ import logging import threading from time import sleep from typing import List, Optional import vision.flashless_utility from inbm_vision_lib.con...
server.py
import socket, threading import os from user import User, UserLogged from logger import Logger class UserContainer(object): def __init__(self): super().__init__() self.connections = [] self.UUIDs = set() def add(self, user: User): self.connections.append(user) user.uu...
5.py
# -*- coding: utf-8 -*- import KRIS from KRIS.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen import r...
test_watch.py
from tests.test_actions import * from ltk.watch import WatchAction from threading import Thread import unittest import os # @unittest.skip("skip testing watch for now") class TestWatch(unittest.TestCase): @classmethod def setUpClass(cls): create_config() @classmethod def tearDownClass(cls): ...
PluginSample.py
from Smartiome.Core.APIManager import * import threading import time """ You may need to change all PluginSample to your own plugin's name """ @APIManager.plugin_register("PluginSample") class PluginSample: def __init__(self, __queue, logger, eventManager=None): self.eventManager = eventManager # Allow...
fastboot_utils.py
#!/usr/bin/env python """ Copyright (C) 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 ag...
threading_demo2.py
import threading lock = threading.Lock() def job1(): global n for i in range(10): n += 1 print('job1', n) def job2(): global n for i in range(10): n += 10 print('job2', n) n = 0 t1 = threading.Thread(target=job1) t2 = threading.Thread(target=job2) t1.start() t2.sta...
webserver.py
from util import output import threading from util.tools import hrt import datetime import hashlib import os import functools from core.modules import load as reload from lib.bottle import TEMPLATE_PATH, route, get, post, run, request, response, redirect, static_file, jinja2_template as template host = '0.0.0.0' fmt =...
builddataset.py
import MySQLdb import sqlite3 import csv import os import datetime import time import re import string import operator import threading from HTMLParser import HTMLParser from badgesDict import badges def getUsersAnswersAcceptedQuery(user, date): return "SELECT ownerID AS UserID, count(postID) AS UsersAnswersAccepte...
io.py
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals from collections import defaultdict from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, Executor, Future, _base, as_c...
d_bike.py
from ctypes import * import math import random import os import cv2 import numpy as np import time import darknet # import threading import ini import datetime import json from Connserver import Connserver #### from time import sleep from threading import Thread ##from pynput import keyboard #wa """ def convertBack2(...
main.py
#!/usr/bin/env python # encoding: utf-8 """ Start the Robot and Webserver """ from threading import Thread from collections import deque from flask import Flask import signal, sys import asyncio from driver import Driver app = Flask(__name__) q = deque() def robot_thread(event_kill): asyncio.set_event_loop(asynci...
test_jobs.py
# -*- coding: utf-8 -*- # # 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 #...
multiprocessing_Manager.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Lyon import multiprocessing # 既然数据共享了,就需要像多线程那样,防止竞争 def run(d,lock): # lock.acquire() d['count'] -= 1 # lock.release() if __name__ == '__main__': lock = multiprocessing.Lock() with multiprocessing.Manager() as m: dic = m.dict({'count': 1...
test_atomic_dict.py
from threading import Thread from src.hw3.atomic_dict import AtomicDict def test_atomic_dict(): ad = AtomicDict() def modify_atomic_dict(ad: AtomicDict): with ad.acquire() as d: d["other_data"] = 69 t = Thread(target=modify_atomic_dict, args=(ad,)) t.start() with ad.acquire(...
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 urllib.request import threading import traceback import asyncore import weakref import platform import functools impor...
messaging.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """An implementation of the session and presentation layers as used in the D...
youtube-dl-server.py
import json import subprocess from queue import Queue import time from bottle import run, Bottle, request, static_file, response, redirect, template, get from threading import Thread from bottle_websocket import GeventWebSocketServer from bottle_websocket import websocket from socket import error class WSAddr: de...
dubbo_test.py
# -*- coding: utf-8 -*- """ /* * 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 ...
test_communicator.py
import sys import unittest import threading import time from websocket import create_connection try: from aceinna.framework.communicator import SerialPort except: # pylint: disable=bare-except sys.path.append('./src') from aceinna.framework.communicator import SerialPort # pylint: disable=missing-class-...
redis.py
import sys import threading from typing import Optional import boto3 import redis import ujson as json from asgiref.sync import sync_to_async from redis.client import Redis from consoleme.config import config from consoleme.lib.plugins import get_plugin_by_name region = config.region log = config.get_logger() stats ...
core.py
"""Ouster sensor Python client. This module contains more idiomatic wrappers around the lower-level module generated using pybind11. """ from contextlib import closing from typing import cast, Dict, Iterable, Iterator, List, Optional, Tuple, Union from threading import Thread import time from more_itertools import ta...
test_clients_streaming.py
import os import time, asyncio from typing import List from datetime import datetime from functools import partial from multiprocessing import Process, current_process import pytest from jina import Flow, Document, DocumentArray, Executor, requests, Client INPUT_LEN = 4 INPUT_GEN_SLEEP_TIME = 1 SLOW_EXECUTOR_SLEEP_TI...
Video_Send.py
# coding: UTF-8 from __future__ import print_function import time import cv2 import numpy as np import paho.mqtt.client as paho import threading import sys import wx import wx.lib.newevent import Video_Send_wx as wxMainFrame G_IS_CV3 = ( cv2.__version__[0] == '3' ) if( G_IS_CV3 ): G_IMREAD_COLOR = cv2.IMREAD_COLO...
base_use.py
import threading def loop(): n = 0 while n < 5: print('current thead name is {}'.format(threading.current_thread().name)) print('当前循环的数字是 : {}'.format(n)) n += 1 if __name__ == '__main__': print('current thead name is {}'.format(threading.current_thread().name)) t = threading...
tophat.py
#!/usr/bin/python3 """ Naming threads and pids || rzfeeser@alta3.com Helpful notes: - os.getpid() function will return ID of current process - threading.main_thread() returns the main thread object. Typically the main thread is the thread from which Python was started. - threading.current_thread() returns...
Hiwin_RT605_ArmCommand_Socket_20190627162447.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import numpy as np from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import math import enum pos_feedback_times = 0 mode_feedback_times = 0 msg_feedback = 1 #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 i...
main-overlay-game.py
# This only works if it is able to record your keypresses. This is unlikely to happen with the Genshin client. # Requirements: Python3, Tkinter, PIL, pynput # install PIL using pip3 install pillow # install pynput using pip3 install pynput import queue import random from multiprocessing import Process, Lock from...
plistdump-tcp-proxy.py
#!/usr/bin/python # This is a simple port-forward / proxy, written using only the default python # library. If you want to make a suggestion or fix something you can contact-me # at voorloop_at_gmail.com # Distributed over IDC(I Don't Care) license # Python3 # Modified: 2020/05/15 (Fri) shengxiang.ssx import argparse...
report-bot.py
from telegram.ext import Updater from threading import Thread import time updater = Updater(token='', use_context=True) dispatcher = updater.dispatcher import logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) def start(update, context):...
service_async.py
# Copyright (c) 2018 http://reportportal.io # # 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...
server.py
""" 阻塞式的服务端 """ __author__ = "spico1026@gmail.com" import socket import threading # import selectors # import select import time import datetime import re import logging from database.service import auth_login, data_insertion from database.dao import dao, mongo_dao logging.basicConfig(filename="routine-log.txt", ...
core.py
#AUTOGENERATED! DO NOT EDIT! File to edit: dev/30_text_core.ipynb (unless otherwise specified). __all__ = ['ProcessPoolExecutor', 'parallel', 'parallel_gen', 'UNK', 'PAD', 'BOS', 'EOS', 'FLD', 'TK_REP', 'TK_WREP', 'TK_UP', 'TK_MAJ', 'spec_add_spaces', 'rm_useless_spaces', 'replace_rep', 'replace_wrep', 'fix...
launcher.py
# Copyright 2011-2013 Colin Scott # Copyright 2012-2013 Andrew Or # # 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 ap...
test_data_node_scale.py
import threading import time import pytest from base.collection_wrapper import ApiCollectionWrapper from common.common_type import CaseLabel from common import common_func as cf from customize.milvus_operator import MilvusOperator from scale import constants from pymilvus import connections from utils.util_log import...
tools.py
import re import sys import time from subprocess import check_output, Popen, PIPE, CalledProcessError, call from threading import Thread from reachy.utils.discovery import discover_all def setup_new_wifi(ssid, password): config_file = '/etc/wpa_supplicant/wpa_supplicant.conf' # Generate psk using wpa_passp...
pinuz_(1).py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from io import StringIO from datetime import datetime import time,random,sys,json,codecs,threading,glob,sys import re,string,os import os.path,sys,urllib,shutil,subprocess cl = LINETCR.LINE() cl.login(token="ErxQUnJvtPB9Z2iAmI75.Cq2h8Jc15PC...
dispatcher.py
"""GRPC client. Implements loading and execution of Python workers. """ import asyncio import concurrent.futures import logging import queue import threading import traceback import grpc from . import bindings from . import functions from . import loader from . import protos from .logging import error_logger, logg...
ultimate.py
# -*- coding: utf-8 -*- import random import sys sys.path.insert(0,'/home/stefano/Documenti/insta-bot1/instabot') from glob import glob import schedule from instabot import Bot, utils import os import sys import threading import time import config_file from sys import argv sys.path.append(os.path.join(sys.path[0], '.....
test_weakref.py
import gc import sys import doctest import unittest import collections import weakref import operator import contextlib import copy import threading import time import random from test import support from test.support import script_helper, ALWAYS_EQ from test.support import gc_collect # Used in ReferencesTestCase.tes...
email.py
from threading import Thread from flask_mail import Message from flask import render_template from app import app, mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, re...
noetl.py
#!/usr/bin/python # # TITLE: noetl # AUTHORS: Alexey Kuksin, Casey Takahashi # DATE: 16-08-2015 # OBJECTIVE: Manage process execution # # Copyright 2015 ALEXEY KUXIN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
chat.py
import socket import threading import sys class Server(): # Using IPV4 and TCP sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connections = [] def __init__(self): self.sock.bind(('0.0.0.0', 10000)) self.sock.listen(1) def handler(self,c,a): while True: ...
scatter.py
import os import torch import torch.distributed as dist import torch.multiprocessing as mp def run(rank_id, size): tensor = torch.arange(2, dtype=torch.int64) + 1 + 2 * rank_id print('before scatter',' Rank ', rank_id, ' has data ', tensor) if rank_id == 0: scatter_list = [torch.tensor([0,0]), torc...
test_base_events.py
"""Tests for base_events.py""" import concurrent.futures import errno import math import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from test.test_asyncio import utils as test_utils from test imp...
sendmail.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- import time from multiprocessing import Process import email from email import encoders from email.header import Header from email.mime.text import MIMEText from email.utils import parseaddr, formataddr import smtplib from django.conf import settings class MailSender(ob...
test_connection.py
# coding=utf-8 from __future__ import unicode_literals import unittest from threading import Thread import datetime import time import math import lore.io.connection import sqlalchemy from sqlalchemy import event from sqlalchemy.engine import Engine import pandas import lore calls = 0 @event.listens_for(Engine, "af...
__init__.py
''' Docker Monitor component For more details about this component, please refer to the documentation at https://github.com/Sanderhuisman/home-assistant-custom-components ''' import logging import threading import time from datetime import timedelta import homeassistant.helpers.config_validation as cv import voluptuo...
common_cache_test.py
# Copyright 2018-2021 Streamlit 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 wr...
spider.py
#!/usr/bin/env python # coding=utf-8 import weakref import time import datetime import sys import traceback import functools import threading from threading import Thread from task import Workflows, CFG WORKNUM = 30 class SpiderOrigin(Workflows): def __init__(self, worknum=WORKNUM, queuetype=CFG.L, timeout=-1,...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil import cereal.messaging as messaging from cereal import log from common.dict_helpers import strip_d...
sensor_component.py
"""This module contains the SensorComponent type.""" import threading from raspy.invalid_operation_exception import InvalidOperationException from raspy.object_disposed_exception import ObjectDisposedException from raspy.components.sensors import sensor from raspy.components.sensors import sensor_state from raspy.com...
key_generation.py
# -*- coding: UTF-8 -*- # 本程序生成若干个客户私钥,只要下面的参数KEY和IV不丢失不泄露,理论上是安全的 # 本程序从自己启动,外部只能调用其方法 # 生成的私钥存储在sqlite数据库中 # 本程序的主入口程序为 main() # 请填写下面几个参数: # 第一个参数为生成的密钥对的数量 NUMBER=1000 # 第二个参数为AES加密类实例的key,必须为16位ascii字符,必须由 第一人 妥善保存 KEY='' # 第三个参数为AES加密类实例的iv,必须为16为数字,必须由 第二人 妥善保存 IV='' # 并发度,默认为单线程,单线程快38% CONCURRENCY=1 import...
asynchronousQtDemonstration.py
from PySide2.QtWidgets import QWidget, QApplication, QTextEdit, QVBoxLayout, QPushButton from PySide2.QtCore import QEventLoop import sys import threading import asyncio from concurrent import futures import multiprocessing import time # Checking which blocks UI activity class MainWindow(QWidget): def __init__(...
test_ssh_transport.py
import sys import uuid import xmlrpc.client from pathlib import Path from tempfile import NamedTemporaryFile, TemporaryDirectory from threading import Thread from time import sleep from unittest import mock import pytest from finorch.client.client import start_client from finorch.sessions import OzStarSession, SshSes...
sensor.py
"""Pushbullet platform for sensor component.""" import logging import threading from pushbullet import InvalidKeyError, Listener, PushBullet import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_API_KEY, CONF_MONITORED_CONDITIONS import...
logsclient.py
"""This file implements a threaded stream controller to return logs back from the ray clientserver. """ import sys import logging import queue import threading import grpc from typing import TYPE_CHECKING import ray.core.generated.ray_client_pb2 as ray_client_pb2 import ray.core.generated.ray_client_pb2_grpc as ray_c...
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...
utils.py
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch, glob, os, numpy as np, math from .sparseConvNetTensor import SparseConvNetTensor from .metadata import Metada...
JobManager.py
import logging import subprocess import threading from enum import Enum logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class JobStatus(Enum): RUNNING = 1 STOPPED = 2 COMPLETED = 3 def jobStatusAsString(status): if status == JobStatus.RUNNING: return "running" elif sta...
test_socketserver.py
""" Test suite for socketserver. """ import contextlib import io import os import select import signal import socket import tempfile import threading import unittest import socketserver import test.support from test.support import reap_children, verbose from test.support import socket_helper from test.support import ...
EventHandler.py
"""EventHandler for the Teamspeak3 Bot.""" import logging import threading import ts3API.Events as Events class EventHandler(object): """ EventHandler class responsible for delegating events to registered listeners. """ logger = logging.getLogger("eventhandler") logger.setLevel(loggin...
test.py
import queue, threading, time hist = queue.Queue() real = queue.Queue() def putData(): histStart = 0 realStart = 0 while True: time.sleep(1) hist.put(histStart) real.put(realStart) histStart = histStart - 1 realStart = realStart + 1 def getHist(): while True: ...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from lightning import RpcError from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE import queue import pytest import re import threading import unittest @unittest.skipIf(not DEVELOPER, "Too slow without ...
master_server.py
#!/usr/bin/env python # # Copyright 2013 Tanel Alumae """ Reads speech data via websocket requests, sends it to Redis, waits for results from Redis and forwards to client via websocket """ import sys import logging import json import codecs import os.path import uuid import time import threading import functools from ...
test_router.py
''' Copyright 2013 Cosnita Radu Viorel 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 without limitation the rights to use, copy, modify, merge, publish, distribute...
executor.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import division from builtins import next from builtins import object from builtins import str from future.utils import viewvalues, viewitems import argparse import logging import os import sys import thr...
async_sql_uploader.py
import socket import pymysql import cv2 import numpy as np import threading import time from PIL import Image from io import BytesIO from .sqlrequest import initDB class AsyncSQLUploader: def __init__(self, bufferSize, keepEvery=1, autoFlush=False): self.dbCredentials = initDB() self.buff...
thread_property_2.py
""" A propery object to be used inside a class Author: Friedrich Schotte Date created: 2018-11-01 Date last modified: 2019-03-06 """ from logging import debug,warn,info,error __version__ = "2.0.1" # debug messages def thread_property(method): """A property representing an task to be run in background""" name =...
SimConnect.py
from ctypes import * from ctypes.wintypes import * import logging import time from .Enum import * from .Constants import * from .Attributes import * import os import threading _library_path = os.path.abspath(__file__).replace(".py", ".dll") LOGGER = logging.getLogger(__name__) def millis(): return int(round(time.t...
example_demo.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_demo.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api # PyPI: https://pypi.org/pro...
execute.py
""" Once state information has been calculated, handle actually executing tools from various states, tracking results, and building implicit dataset collections from matched collections. """ import collections import itertools import logging from threading import Thread import six from six.moves.queue import Queue fr...
PrefetchingIter.py
# -------------------------------------------------------- # Accel # Copyright (c) 2019 # Licensed under the MIT License [see LICENSE for details] # Modified by Samvit Jain # -------------------------------------------------------- import mxnet as mx from mxnet.io import DataDesc, DataBatch import threading class P...
run_inference_mixed.py
#! /usr/bin/python3 import time import threading from cache.Cache import Cache from agents.CacheAgent import * from agents.DQNAgent import DQNAgent from agents.ReflexAgent import * from cache.DataLoader import * if __name__ == "__main__": # disk activities datafile1 = sys.argv[1] datafile2 = sys.argv[2] ...
preprocess_centauro.py
# coding=utf8 import argparse, os, json, string from collections import Counter from Queue import Queue from threading import Thread, Lock from math import floor import h5py import numpy as np import sys import yaml import os from scipy.misc import imread, imresize from scipy.cluster.vq import vq, kmeans, whiten OBJ...
main.py
# By Ethan # # Written on 4/8/2020 # #Define the imports import twitch import cocos from cocos.director import director import pyglet from pyglet.window import mouse import pymunk #from pymunk import Vec2d #from pymunk.pyglet_util import DrawOptions import threading import math import random #check if mouse is overla...
__init__.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import operator import os import re import string from typing import ( Any, Callable, ContextManager, List, Optional, Sequence, Tuple, Ty...
master.py
import json import requests import os import threading import time from Models.setting import Server session = requests.Session() def get_playernames(server): url = f"https://raw.githubusercontent.com/LoR-Master-Tracker/LoR-Player-Crawler/master/{server}.json" print('Loading: ', url) r = session.get(url) ...
test_memusage.py
import decimal import gc import itertools import multiprocessing import weakref import sqlalchemy as sa from sqlalchemy import ForeignKey from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import select from sqlalchemy import String from sqlalchemy import test...
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.op_params import opParams from common.basedir import ...
http_server_flask.py
# Copyright (c) 2019 Cable Television Laboratories, 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 ...
manualControl.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Benji Lee, Rishav Rajendra" __license__ = "MIT" __status__ = "Development" import serial import time import picamera import queue import threading from subprocess import call from motionPi import motionThread # connect to arduino ser = serial.Serial('/dev/tt...
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...
gdb_test.py
# pyOCD debugger # Copyright (c) 2015-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
dflow.py
import atexit import itertools import logging import os import pathlib import pickle import random import threading import inspect import sys import multiprocessing import time from getpass import getuser from uuid import uuid4 from socket import gethostname from concurrent.futures import Future from functools import ...
conftest.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import curses import logging import threading from functools import partial import pytest from vcr import VCR from six.moves.urllib.parse import urlparse, parse_qs from rtv.oauth import OAuthHelper, OAuthHandler, OAuthHTTPServer from rtv.conte...
env_wrappers.py
""" Modified from OpenAI Baselines code to work with multi-agent envs """ import numpy as np from multiprocessing import Process, Pipe from abc import ABC, abstractmethod from tmarl.utils.util import tile_images class CloudpickleWrapper(object): """ Uses cloudpickle to serialize contents (otherwise multiproc...
photon.py
import g4gen import multiprocessing import numpy as np import threading import zmq import uuid class G4GeneratorProcess(multiprocessing.Process): def __init__(self, idnum, material, vertex_socket_address, photon_socket_address, seed=None): multiprocessing.Process.__init__(self) self.idnum = idnum ...
executor_test.py
# Copyright 2019 Google LLC. 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...
v1_station_b_S30_magmax_200ulinput.py
from opentrons.types import Point import json import os import math import threading from time import sleep metadata = { 'protocolName': 'Version 2 S30 Station B MagMax (200µl sample input)', 'author': 'Nick <ndiehl@opentrons.com', 'apiLevel': '2.3' } NUM_SAMPLES = 28 # start with 8 samples, slowly incre...
_v5__sub_bgm.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import time import datetime import codecs import glob import queue impo...
communicate.py
# Date: 10/17/2017 # Author: Ethical-H4CK3R # Description: Communication Is Key import time import json import base64 import threading from file import File from ping import Ping from shell import Shell from valid import Valid class Bot(object): ''' Holds bot information ''' def __init__(self, session): self.sy...
build_docs.py
import glob import os import shutil import sys from pathlib import Path from subprocess import check_output from threading import Thread from typing import Dict, Union, Optional, Set, List, Sequence, Mapping from git import Git from ruamel.yaml import YAML # type: ignore from constants import ABS_PATH_OF_TOP_LEVEL_D...
main_thread_test.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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
automate_django.py
import os import threading import time import webbrowser import logging # global variables currentProject = '' currentApp = '' # an input function def get_input(type_value): return input("Enter your {} name \n".format(type_value)) # will run os commands def run_cmd(value): os.system(value) logging.warnin...
thread_utils.py
# # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: khmer-project@idyll.org # """ Utilities for dealing with multithreaded processing of short reads. """ import...
path.py
from __future__ import absolute_import, unicode_literals import logging import os import stat import string import threading from mopidy import compat, exceptions from mopidy.compat import queue, urllib from mopidy.internal import encoding, xdg logger = logging.getLogger(__name__) XDG_DIRS = xdg.get_dirs() def ...