source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
__init__.py | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
test_pulsepicker.py | import time
import threading
import logging
import pytest
from unittest.mock import Mock
from ophyd.status import wait as status_wait
from ophyd.sim import make_fake_device
from pcdsdevices.inout import InOutRecordPositioner
from pcdsdevices.pulsepicker import PulsePickerInOut
from conftest import HotfixFakeEpicsSig... |
DiscoveryServerService.py | from logging import getLogger
from socket import AF_INET, IPPROTO_UDP, SO_BROADCAST, SOCK_DGRAM, SOL_SOCKET
try:
from socket import SO_REUSEPORT
socket_can_reuse_port = True
except ImportError:
SO_REUSEPORT = 0
socket_can_reuse_port = False
from threading import Thread
from typing import Optional
from ... |
__init__.py | from __future__ import print_function
import argparse
import itertools
import os
import random
import re
import shlex
import string
import sys
import traceback
import warnings
from collections import OrderedDict
from fnmatch import fnmatchcase
from subprocess import list2cmdline
from threading import Thread
import pl... |
bootstrap_test.py | import os
import random
import re
import shutil
import tempfile
import threading
import time
import logging
import signal
from cassandra import ConsistencyLevel
from cassandra.concurrent import execute_concurrent_with_args
from ccmlib.node import NodeError
import pytest
from dtest import Tester, create_ks, create_cf... |
keep_alive.py | import os
import logging
try:
import requests
except ModuleNotFoundError:
os.system('pip3 install requests')
import requests
try:
from flask import Flask
except ModuleNotFoundError:
os.system('pip3 install flask')
from flask import Flask
from threading import Thread
# =======================... |
telaDeLogin.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'telaDeLogin.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSlot
from datetime import datetime
from time im... |
test_misc.py | from __future__ import with_statement
import os, threading, time
from whoosh.compat import u
from whoosh.util.filelock import try_for
from whoosh.util.numeric import length_to_byte, byte_to_length
from whoosh.util.testing import TempStorage
def test_now():
from whoosh.util import now
t1 = now()
t2 = now... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
firebase.py | try:
import urlparse
except ImportError:
# py3k
from urllib import parse as urlparse
import json
import threading
import Queue
from requests import Session
from requests.exceptions import ReadTimeout, ConnectionError
from .firebase_authenticator import Authenticator, FireAuth
from .firebase_listener impo... |
bot.py | import asyncPipe
import os
import random
import re
import subprocess
import threading
import Queue
import logging
class Stats(object):
def __init__(self):
self.frags = 0
self.suicides = 0
self.deaths = 0
def update(self,dict):
self.__dict__.update(dict)
def deathFactor(self):
return (self.deaths ... |
bazelci.py | #!/usr/bin/env python3
#
# Copyright 2018 The Bazel 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 ... |
create_amt_test_folder.py | import os
import shutil
import json
import sys
from multiprocessing import Process
import numpy as np
from tqdm import tqdm
from moviepy.editor import VideoFileClip
from feature_extraction.demo_utils import extract_melspectrogram
TEST_FOLDER = 'data/AMT_test/'
os.makedirs(TEST_FOLDER, exist_ok=True)
match_dict = json.... |
better_haptic_player.py | import json
import socket
from websocket import create_connection, WebSocket
import threading
ws = None
active_keys = set([])
connected_positions = set([])
class WebSocketReceiver(WebSocket):
def recv_frame(self):
global active_keys
global connected_positions
frame = super().recv_frame()... |
label.py | """An offline label visualizer for Scalable file.
Works for 2D / 3D bounding box, segmentation masks, etc.
"""
import argparse
import concurrent.futures
import io
import threading
from dataclasses import dataclass
from queue import Queue
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
import matplotlib... |
MultiProcessing.py | #!/usr/bin/env python
# Roobert - home robot project
# ________ ______ _____
# ___ __ \______________ /_______________ /_
# __ /_/ / __ \ __ \_ __ \ _ \_ ___/ __/
# _ _, _// /_/ / /_/ / /_/ / __/ / / /_
# /_/ |_| \____/\____//_.___/\___//_/ \__... |
scheduler.py | #!/usr/bin/env python
from __future__ import absolute_import
import os
import sys
import time
import pickle
import random
import signal
import socket
import logging
import threading
import subprocess
import json
import zmq
import six
from six.moves import range
from six.moves import zip
ctx = zmq.Context()
from addi... |
network.py | from threading import Thread
import socket
import select
import time
import os
import clingo
from PyQt5.QtCore import *
class VisualizerSocket(object):
def __init__(self, default_host = '127.0.0.1', default_port = 5000, socket_name = 'socket'):
self._host = default_host
self._port = defau... |
client.py | import Snake
import pygame as pg
import sys
import renderer as gui
import time
import threading
import socket
import pickle
import json
print("Starting...")
with open('configs.json','r') as f:
cfgs = json.load(f)
print("Configs loaded.")
s = socket.socket()
print("Socket created.")
chunksize = c... |
asyncTools.py | #!/usr/bin/python3
# -*- coding:utf-8 –*-
import time
import threading
thCount = 0
def thrLimit(name='default', limit=1):
def decorator(f):
def wrapper(*args, **kwargs):
while True:
thList = threading.enumerate()
count = 0
for thr in thList:
... |
amazon.py | #!/usr/bin/env python
import base64
import logging
import boto3
import os
import re
import json
from datetime import datetime
from threading import Thread
from botocore.exceptions import ClientError, ProfileNotFound
import botocore
import botocore.client
from lxml import etree
class ExpectedAmazonException(Except... |
enviroplus_exporter.py | #!/usr/bin/env python3
import os
import random
import requests
import time
import logging
import argparse
import subprocess
from threading import Thread
from prometheus_client import start_http_server, Gauge, Histogram
from bme280 import BME280
from enviroplus import gas
from enviroplus.noise import Noise
from pms500... |
client.py | import json
import base64
import aiohttp
import threading
from uuid import uuid4
from time import timezone, sleep
from typing import BinaryIO, Union
from time import time as timestamp
from locale import getdefaultlocale as locale
import asyncio
from .lib.util import exceptions, headers, device, objects, helpers
from ... |
secs.py | import socket
import re
import threading
import inspect
import datetime
import importlib
import os
import struct
class Secs2BodyParseError(Exception):
def __init__(self, msg):
super(Secs2BodyParseError, self).__init__(msg)
class Secs2BodyBytesParseError(Secs2BodyParseError):
def __init__(self, msg... |
serve.py | """PostProcessor for serving reveal.js HTML slideshows."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import webbrowser
import threading
from tornado import web, ioloop, httpserver, log, gen
from tornado.httpcl... |
test_telnetlib.py | import socket
import selectors
import telnetlib
import contextlib
from test import support
import unittest
threading = support.import_module('threading')
HOST = support.HOST
def server(evt, serv):
serv.listen()
evt.set()
try:
conn, addr = serv.accept()
conn.close()
except socket.timeo... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import threading
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import Test... |
hedset.py | #! /usr/bin/env python
###################################################################################
# hedset.py
# Perform HED on all images in a dataset
# 9/13/2019
#
# EXAMPLE
# ./hedset.py --datadir /data/data/sketch_data/sketchydb/sketchydb_2x --mode train --side B --procs 5
# ./hedset.py --d... |
worker.py | import logging
import queue
import threading
from abc import ABC, abstractmethod
from typing import Callable, Any
logger = logging.getLogger(__name__)
class WorkerInfo(ABC):
def __init__(self):
self.data = dict()
self.name = None
self.id = 0
self.wrk_done = 0
self.wrk_swit... |
Install.py | import sys
import subprocess
import threading
import shlex
try:
from Queue import Queue, Empty
except:
from queue import Queue, Empty
ON_POSIX = 'posix' in sys.builtin_module_names
class Run:
def __init__(self):
return
def _read_output(self, pipe, q):
while True:
try:
... |
gui.py | # -*- coding: utf-8 -*-
"""
Graphical User interface for the SNN conversion toolbox.
Features
--------
- Allows setting parameters and what tools to use during an experiment.
- Performs basic checks that specified parameters are valid.
- Preferences can be saved and reloaded.
- Tooltips explain the fu... |
multi_process_demo.py | from random import randint
import time
from multiprocessing import Process
from os import getpid
def download_task(filename, sleepTime):
print("%s %s" % (filename, time.strftime("download start at: %Y-%m %d %H:%M:%S", time.localtime())))
print("进程号 [%s] " % getpid())
time_to_download = randint(5, 15)
... |
carla_manual_control.py | #!/usr/bin/env python
#
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Welcome to CARLA ROS manual contro... |
e2e_test_import_interface_and_emulator.py | # Copyright PA Knowledge Ltd 2021
# For licence terms see LICENCE.md file
import copy
import unittest
import subprocess
import threading
import pysisl
import requests
import socket
import json
from test_helpers import TestHelpers, TestSender, TestReceiver
class EndToEndEmulatorTests(unittest.TestCase):
interfac... |
actor_factory.py | #!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
import itertools
try:
import queue
except ImportError:
import Queue as queue
import time
from enum import Enum
from threading i... |
dir_watch.py | import os
import os
import threading
import time
import pandas as pd
from pydicom import FileDataset
from pydicom.errors import InvalidDicomError
from pydicom.filereader import dcmread
from watchdog.events import PatternMatchingEventHandler
from watchdog.observers import Observer
# local imports, namely the dicom in... |
test_sqs_work_dispatcher.py | import inspect
import boto3
import logging
import multiprocessing as mp
import os
import signal
import psutil as ps
from unittest import TestCase
from random import randint
import pytest
from botocore.config import Config
from botocore.exceptions import EndpointConnectionError, ClientError, NoCredentialsError, NoRegi... |
dynamodump.py | #!/usr/bin/env python
"""
Simple backup and restore script for Amazon DynamoDB using boto to work similarly to mysqldump.
Suitable for DynamoDB usages of smaller data volume which do not warrant the usage of AWS
Data Pipeline for backup/restores/empty.
dynamodump supports local DynamoDB instances as w... |
Tarea1RezaSergio.py | """
Ejercicio de sincronización
Alumnos y Asesor
"""
from threading import Thread,Semaphore
from random import random, randrange
import time
lugar=Semaphore(5)#Lugares disponibles
mutex=Semaphore(1)#Mutex para realizar preguntas
alumnos=0#Cantidad de alumnos actuales en la sala
def sesionAsesor(id, lugar, preguntas,h... |
WebsocketServer.py | import logging, json, math, asyncio, websockets, threading
from remote_params.server import Server, Remote
from remote_params.schema import schema_list
DEFAULT_PORT = 8081
logger = logging.getLogger(__name__)
class WebsocketServer:
"""
Connect a private Remote instance on a given params.Server instance
Accept... |
googlenet_processor.py | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# NPS
# processes images via googlenet
from mvnc import mvncapi as mvnc
import numpy as np
import cv2
import queue
import threading
class googlenet_processor:
# GoogLeNet assumes input images are t... |
server.py | from socket import *
from threading import Thread
import time
import sys
import logging
from redis import StrictRedis
from data import ChannelInfo, ClientInfo
from utils import get_code_from_str
RECV_BUFFER_LIMIT = 2048
if len(sys.argv) <= 2:
print "Usage ./start.sh <port> <server_name>"
sys.exit(1)
ser... |
utils.py | import sys
import time
import os, re, math
import numpy as np
import pyqtgraph as pg
from PyQt5 import QtCore, QtGui
from multiprocessing import Process, Queue
from subprocess import Popen, PIPE, STDOUT, call
class Runner(QtCore.QObject):
'''
Runs a job in a separate process and forwards messages from the job... |
genvals.py | from os import path
import torch.multiprocessing as mp
import bokego.go as go
from bokego.nnet import policy_sample, PolicyNet
from selfplay import legal_sample
import torch
from tqdm import trange
import numpy as np
import argparse
DEV = torch.device("cuda" if torch.cuda.is_available() else "cpu")
MAX_TURNS = 90
ENC... |
loader.py | from typing import Any, Callable, Iterable, Union
import queue
import sys
import threading
import numpy as np
import torch
from torch.utils.data import DataLoader
class ILoaderWrapper:
def __init__(self, loader: DataLoader):
"""Loader wrapper interface.
Args:
loader: torch dataloader... |
controller.py | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import tempfile
import os
import sys
import zmq
import time
import threading
import uuid
from collections import defaultdict
from .utils import env, ProcessKi... |
detect_drowsiness.py | import cv2
import numpy as np
from keras.models import load_model
from keras.preprocessing.image import img_to_array
from playsound import playsound
from threading import Thread
def start_alarm(sound):
"""Play the alarm sound"""
playsound(sound)
classes = ['Closed', 'Open']
face_cascade = cv... |
midi_interaction.py | """A module for implementing interaction between MIDI and SequenceGenerators."""
import abc
import threading
import time
import pretty_midi
import signal
import subprocess
import random
import os
import time
import numpy as np
# internal imports
import tensorflow as tf
import magenta
from magenta.protobuf import gene... |
build_homology_database.py | #!/usr/bin/python3
import glob
import pickle
import pandas as pd
import numpy as np
from Bio import SeqIO
import subprocess
import time
import parasail
from queue import Queue
import threading
import os
#Parameters and filenames:
num_threads=8
req_match_fraction = 0.50 #This fraction of query length must match to any... |
BNN_FI_SEMUTestMan.py | #!/usr/bin/env python3
import sys
import os
import time
from threading import Thread, Lock, Event
import requests
from BitstreamMan import BitstreamMan, load_ll_file
import sqlite3
import shutil
import random
server_lst = ['http://pynq1:5200',
'http://pynq2:5200',
'http://pynq3:5200',
... |
test_bridge.py | # Copyright 2020 The FedLearner 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... |
pipeline.py | # Copyright 2006-2012 Mark Diekhans
"""
Process pipelines constructed as a DAG.
"""
import os, sys, fcntl, signal, errno, threading, traceback, pickle, time
import fifo, trace, strOps
from tools import PycbioException
try:
MAXFD = os.sysconf("SC_OPEN_MAX")
except OSError:
MAXFD = 256
def _getSigName(num):
... |
gtest_parallel_tests.py | #!/usr/bin/env python
# Copyright 2017 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 ... |
test_itertools.py | import unittest
from test import support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import operator
import random
import copy
import pickle
from functools import reduce
import sys
import struct
import threading
maxsize = support.MAX_Py_ssize_t
minsize = -maxsize-1
... |
tspmt.py | # Mishukov Konstantin
# 2021
import os
import getopt
from multiprocessing import *
import sys
import time
from typing import Optional
import multiprocessing
from myQueue import Queue
import numpy as np
# tspmt.py -i m.txt
path = ''
testing = False
try:
opts, args = getopt.getopt(sys.argv[1:], "hi:t", ["ifile="]... |
main.py | import argparse
import threading
from os import system
# Internal Imports
from utils.RandNetParamsGen import *
from ReplayGenerator import *
def main():
'''
Main entry point of the packet-generator-bot.
Arguments:
None
Returns:
None
'''
# Prepare arguments
parser =... |
throttling.py | """
"An example of a threaded application" section example
showing how throttling / rate limiting can be implemented
in multithreaded application
"""
import time
from queue import Queue, Empty
from threading import Thread, Lock
import requests
SYMBOLS = ("USD", "EUR", "PLN", "NOK", "CZK")
BASES = ("USD", "EUR", "PL... |
call_variants.py | import argparse
import sys
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader
from torchvision import transforms
import multiprocessing
from torch.autograd import Variable
from modules.models.Seq2Seq_atn import EncoderCRNN, AttnDecoderRNN
from modules.core.dataloader_test impo... |
dist.py | import zmq
import time
import multiprocessing as mp
import pystreaming.video.interface as intf
from pystreaming.listlib.circularlist import CircularList, Empty
from pystreaming.video import TRACKMISS, FRAMEMISS
TIMESTEP = 0.001
def dist_ps(shutdown, infd, endpt, rcvhwm, tracks):
context = zmq.Context()
coll... |
sshkey.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
desc: ssh-copy-id to other servers
更简单的方式使用:pip install pexpect
ssh-keygen和ssh-copy-id这些命令都直接作用于terminal
也就是你的tty设备,不会感知stdin,所以这里就不能使用Popen的stdin=PIPE来输入指令
:copyright: (c) 2017 by Xiong Neng.
:license: MIT, see LICENSE for more details.
"""
import shlex
from threadin... |
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... |
pydoc.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
chat_room_page.py | from typing import final
from Login_page import FORMAT
import tkinter as tk
from tkinter.constants import BUTT, LEFT, NSEW, TOP
from tkinter import Button, Message, font as tkfont
import threading
import socket
import json
import ast
# chat room frame
class ChatRoomPage(tk.Frame):
def __init__(self, parent, contr... |
api.py | from flask import Flask, render_template, request, redirect
from threading import Thread
import sqlite3 as sql
import csv
from Helpers.Helpers import server_begin
from SlaveContainer import SlaveContainer
import logging
app = Flask(__name__)
stop_run = False
test_false = True
socket_usage = False
def socket_functio... |
pinchsensor_3_20180216.py | from PyQt5 import QtCore, QtGui, QtWidgets
import pyqtgraph as pg
import time
import datetime
import serial
import threading
import os
import configparser
default_time = 5 # 3 <= default_time <= 20
default_ymin = 2.0
default_ymax = 3.5
default_port = 'COM3'
default_baudrate = 2000000
... |
views.py | from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import ListView, TemplateView, DetailView
from django.views.generic.edit import CreateView
from .models import Country, Total, Name
from django.urls import reverse_lazy
from django.template.loader import render_to_string
from django.htt... |
BrokerActions.py | import sys
import io
import subprocess
import threading
import time
import uuid
import os.path
import requests
import json
from random import randint
from UniqueConfiguration import UniqueConfiguration
from CommonConfiguration import CommonConfiguration
from printer import console_out
class BrokerActions:
def __in... |
training.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .... |
maskdetection.py | import threading
import argparse
import filetype
import base64
import cv2
import numpy as np
from PIL import Image
from io import BytesIO
from datetime import datetime
from flask import Flask, Response, make_response, send_file
from flask import flash, request, redirect, jsonify
from flask import render_template
fro... |
utils.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... |
ib_gateway.py | """
Please install ibapi from Interactive Brokers github page.
"""
from copy import copy
from datetime import datetime
from queue import Empty
from threading import Thread, Condition
from ibapi import comm
from ibapi.client import EClient
from ibapi.common import MAX_MSG_LEN, NO_VALID_ID, OrderId, TickAttrib, TickerId... |
converter.py | #!/usr/bin/env python3.7
from enum import Enum, auto
from glob import glob
import threading
from recordclass import dataobject
from xml.etree import ElementTree
import traceback
import random
import math
import shutil
import time
import configparser
import sys, os
import argparse
from os.path import splitext as spli... |
master.py | import boto3
import multiprocessing
from threading import Thread
import os, datetime
from time import sleep
import threading
import subprocess
# continuosly polls the output_queue and looks for signal to terminate master
def signal_fetcher(shared):
global sqs_resource
input_queue = sqs_resource.get_queue_by_name(Qu... |
periodic_executor.py | # Copyright 2014-present MongoDB, 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... |
worker_run_state.py | import docker
import glob
import logging
import os
import threading
import time
import traceback
import codalab.worker.docker_utils as docker_utils
from collections import namedtuple
from pathlib import Path
from codalab.lib.formatting import size_str, duration_str
from codalab.worker.file_util import remove_path, g... |
test_poplib.py | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import asyncore
import asynchat
import socket
import os
import errno
import threading
from unittest import TestCase, skipUnless
from test import support as test_support
HOST... |
threadpool.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Cached thread pool, inspired from Pelix/iPOPO Thread Pool
:author: Thomas Calmant
:copyright: Copyright 2021, Thomas Calmant
:license: Apache License 2.0
:version: 0.4.3.1
..
Copyright 2021 Thomas Calmant
Licensed under the Apache License, Version 2.... |
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": ... |
configure_and_test_integration_instances.py | from __future__ import print_function
import argparse
import logging
import os
import uuid
import json
import ast
import subprocess
import sys
import zipfile
from datetime import datetime
from enum import IntEnum
from time import sleep
from threading import Thread
from distutils.version import LooseVersion
from demis... |
_UIAHandler.py | from ctypes import *
from ctypes.wintypes import *
import comtypes.client
from comtypes.automation import VT_EMPTY
from comtypes import *
import weakref
import threading
import time
import api
import appModuleHandler
import queueHandler
import controlTypes
import NVDAHelper
import winKernel
import winUser... |
paralelo.py | import multiprocessing
from random import randint
from ploxys import main,populacao
from collections import OrderedDict
initial_ploxys = []
num_rounds = 1
#prototype, ignore it
if __name__ == '__main__':
#main loop
for i in range(0,num_rounds):
saida = multiprocessing.Queue()
procs = []
... |
__main__.py | import os
import labscript_utils.excepthook
# Associate app windows with OS menu shortcuts:
import desktop_app
desktop_app.set_process_appid('lyse')
# Splash screen
from labscript_utils.splash import Splash
splash = Splash(os.path.join(os.path.dirname(__file__), 'lyse.svg'))
splash.show()
splash.update_text('importi... |
dbapi.py | # pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of t... |
main.py | from GUI import *
import sys
import Cam
import threading
from connect import *
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
newWin = NewWindow()
MyConnection = connection("0.0.0.0", 0)
t2 = threading.Thread(target=Cam.function_cam)
t2.start()
wind... |
TouchListener.py | # TouchListener by Axel Vanraes
import Adafruit_MPR121.MPR121 as MPR121
import time
import pykka
# TODO: refactor this code with threading. Make subclass Listener from threading.Thread that plays the role of a button.
import sys
from collections import namedtuple
Listener = namedtuple('Listener', ['mode','call... |
mgr.py | #!/usr/bin/python
import argparse
import logging
import time
import sys
import json
import configparser
import thread
import subprocess
import os
import sys
import atexit
import random
import os.path
import threading
from pogo.custom_exceptions import GeneralPogoException
from pogo.api import PokeAuthSession
from pogo... |
TestUnderProcessMode.py | from unittest import TestCase
import unittest
from multiprocessing import Process
import time
import _pinpointPy
import random
class TestUnderProcessMode(TestCase):
def tearDown(self):
_pinpointPy.force_flush_trace(4)
def _test_api_flow(self):
self.assertTrue(_pinpointPy.set_agent(collector_... |
scenario_runner_with_thread.py | #!/usr/bin/env python
# Copyright (c) 2018-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Welcome to CARLA scenario_runner
This is the main script to be executed when running a scenario.
It loads the scenario configura... |
build.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... |
TMA_Patch_Extractor.py | from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
import collections
import time
from skimage import io
import sys, os, getopt
import pandas as pd
import threading
from skimage import exposure
import argparse
parser = argparse.ArgumentParser(description='TMA ... |
__init__.py | #### PATTERN | WEB #################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... |
hyperiond.py | import threading
from getopt import getopt
from sys import argv
from hyperion import *
from hyperion.net import manage_connections, manage_peers_metadata
from hyperion.api import manage_api
from hyperion import shared
if __name__ == '__main__':
avoid_port = None
debug = False
opts, _ = getopt(argv[1:], 'mt... |
__init__.py | #### PATTERN | WEB ###################################################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
##################################... |
buffered_queue.py | from lithops.multiprocessing import Process, Queue, getpid
import time
def f(q):
print("I'm process", getpid())
q.put([42, None, 'hello'])
time.sleep(5)
if __name__ == '__main__':
q = Queue()
p = Process(target=f, args=(q,))
p.start()
print(q.get()) # prints "[42, None, 'hello']"
... |
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... |
hello.py | from flask import Flask, render_template, session, redirect, url_for, flash
from flask_bootstrap import Bootstrap
from flask_moment import Moment
# from datetime import datetime
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
from flask_sql... |
MinecraftAPI.py | import json
import threading
import time
from datetime import datetime
import requests
from mcrcon import MCRcon
from apps.bot.classes.bots.Bot import get_bot_by_platform
from apps.bot.classes.consts.Consts import Role
from apps.bot.classes.consts.Exceptions import PWarning
from apps.bot.models import Profile
from ap... |
ble_task_win.py | import time
import json
import base64
import asyncio
from typing import Optional
from queue import Queue
from threading import Thread
from bleak import discover, BleakClient, BleakError
from modi.task.conn_task import ConnTask
from modi.util.connection_util import MODIConnectionError
class BleTask(ConnTask):
... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_window... |
gui.py | import tkinter as tk
import tktools
from algs.astar import astar
from algs.dijkstra import dijkstra
import numpy as np
import threading
from tkinter import filedialog
import random
from grid import Grid
class Frame(tk.Frame):
def __init__(self, *args):
tk.Frame.__init__(self, *args)
def get_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.