source
stringlengths
3
86
python
stringlengths
75
1.04M
ca_util.py
#!/usr/bin/python3 ''' DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions...
consumers.py
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug # Copyright: (c) <spug.dev@gmail.com> # Released under the MIT License. from channels.generic.websocket import WebsocketConsumer from django_redis import get_redis_connection from apps.setting.utils import AppSetting from apps.account.models impor...
mods_model.py
# -*- coding: utf-8 -*- # # 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, softwa...
config.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
multi_floor_manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2021 IBM Corporation # # 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 ri...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional from PyQt5.QtCore i...
disco.py
from __future__ import division, print_function import configparser import json import logging import os import sys import threading import time import traceback import Queue import numpy as np import pybursts from probeEnrichInfo import probeEnrichInfo from pprint import PrettyPrinter import gzip import collections f...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import hashlib import threading from c...
GUI.py
from Tkinter import * import os.path from chronoslib import * import time import threading import ctypes import os import operator addUser = None recognizeUser = None global_frame = None common_box = None v0 = Tk() class User(object): """A user from the user recognition system. Users have the following p...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from pyln.client import RpcError, Millisatoshi from shutil import copyfile from pyln.testing.utils import SLOW_MACHINE from utils import ( only_one, sync_blockheight, wait_for, TIMEOUT, account_balance, first_channel_id, closing_fee, TEST_NETWORK...
slack.py
import json import logging import random import re import requests import sys import time import traceback from websocket import WebSocketConnectionClosedException from markdownify import MarkdownConverter from will import settings from .base import IOBackend from will.utils import Bunch, UNSURE_REPLIES, clean_for_pi...
termination_criterion.py
import threading from abc import ABC, abstractmethod from jmetal.core.observer import Observer from jmetal.core.quality_indicator import QualityIndicator """ .. module:: termination_criterion :platform: Unix, Windows :synopsis: Implementation of stopping conditions. .. moduleauthor:: Antonio Benítez-Hidalgo <a...
windows.py
""" Tkinter frames that act as the apps windows.. """ import os from random import choice, shuffle from threading import Thread import tkinter as tk from PIL import Image, ImageTk from playsound import playsound, PlaysoundException import kana_teacher.widgets as kw # Path to app images and sounds. ASSET_PATH = os.p...
test_enum.py
import enum import doctest import inspect import os import pydoc import sys import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto from enum import STRICT, CONFORM, EJECT, KEEP, _simple_enum, _test_simple_enum from enum import ...
test_smtplib.py
import asyncore import email.utils import socket import smtpd import smtplib import StringIO import sys import time import select import unittest from test import test_support try: import threading except ImportError: threading = None HOST = test_support.HOST def server(evt, buf, serv): ...
xla_client_test.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...
control.py
#NAME: move.py #DATE: 08/02/2019 #AUTH: Ryan McCartney, EEE Undergraduate, Queen's University Belfast #DESC: A python class for moving the wheelchair in an intuative manner #COPY: Copyright 2019, All Rights Reserved, Ryan McCartney import numpy as np import threading import time import math import requests import pyg...
__init__.py
from threading import Thread import os import logging from flask import Flask, request, jsonify, render_template, send_from_directory from flask_socketio import SocketIO, emit from pokemongo_bot import logger from pokemongo_bot.event_manager import manager from api.json_encodable import JSONEncodable # pylint: disabl...
SocketServer_echo_simple.py
#!/usr/bin/env python """Echo server example for SocketServer """ #end_pymotw_header import SocketServer class EchoRequestHandler(SocketServer.BaseRequestHandler): def handle(self): # Echo the back to the client data = self.request.recv(1024) self.request.send(data) return if __n...
pyshell.py
#! /usr/bin/env python3 try: from tkinter import * except ImportError: print("** IDLE can't import Tkinter.\n" "Your Python may not be configured for Tk. **", file=sys.__stderr__) raise SystemExit(1) import tkinter.messagebox as tkMessageBox if TkVersion < 8.5: root = Tk() # otherwise create...
test_win32file.py
import unittest from pywin32_testutil import str2bytes, TestSkipped, testmain import win32api, win32file, win32pipe, pywintypes, winerror, win32event import win32con, ntsecuritycon import sys import os import tempfile import threading import time import shutil import socket import datetime import random try: impor...
test_sortedset.py
from purse.collections import RedisSortedSet from pydantic import BaseModel import pytest import aioredis import asyncio from threading import Thread class Context: def __init__(self): self.rc = aioredis.Redis(db=5) self.loop = asyncio.new_event_loop() def _loop_thread_target(): ...
server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging from logging.handlers import RotatingFileHandler import pickle import socket import threading class ThreadedServer(object): def __init__(self, host, port): self.host = host self.port = port self.sock = socket.socket(socket.AF_IN...
input_server.py
# first to start the nameserver start: python -m Pyro4.naming import Pyro4 from threading import Thread import time import numpy as np from rlkit.launchers import conf as config Pyro4.config.SERIALIZERS_ACCEPTED = set(['pickle','json', 'marshal', 'serpent']) Pyro4.config.SERIALIZER='pickle' device_state = None @Pyr...
AbstractBaseThread.py
import os import socket import sys import tempfile from queue import Queue, Empty from subprocess import Popen, PIPE from threading import Thread import time import zmq from PyQt5.QtCore import QThread, pyqtSignal from urh import constants from urh.util.Logger import logger ON_POSIX = 'posix' in sys.builtin_module_...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
__init__.py
# -*- coding: utf-8 -*- """ The top level interface used to translate configuration data back to the correct cloud modules """ # Import python libs from __future__ import absolute_import, generators, print_function, unicode_literals import copy import glob import logging import multiprocessing import os import signal...
QLabel_setText__in_thread__threading.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import threading import time from PyQt5.Qt import QMainWindow, QLabel, QFont, QApplication, Qt class MainWindow(QMainWindow): def __init__(self): super().__init__() self.label = QLabel() self.label.setAlignment(Qt....
listdirs.py
from pathlib import Path from pprint import pprint import time from multiprocessing import (Process, JoinableQueue as Queue, freeze_support) from time import sleep import sys from bripy.bllb.logging import get_dbg, setup_logging logger = setup_logging(True, "INFO", loguru_enqueue=True) DBG = get_dbg(logger) basepath...
emitters.py
""" emitters.py Copyright (c) 2013-2019 Snowplow Analytics Ltd. All rights reserved. This program is licensed to you under the Apache License Version 2.0, and you may not use this file except in compliance with the Apache License Version 2.0. You may obtain a copy of the Apache License Version 2.0...
Challenge18Service.py
# Challenge18Service.py # from app import Service # from ctparse import ctparemidrse # from datetime import datetime from bs4 import BeautifulSoup import requests from dateparser.search import search_dates import time import datetime import re import random import json import emoji from threading import Thread impo...
node.py
import socket import time import threading TCP_IP = "127.0.0.1" TCP_PORT = 5007 BUFFER_SIZE = 1024 session_end = False s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(3.0) s.connect((TCP_IP, TCP_PORT)) def handler(user_socket): while True: if (session_end == True): brea...
threadpool.py
""" threadpool.py Copyright 2006 Andres Riancho This file is part of w3af, http://w3af.org/ . w3af is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. w3af is distributed in the hope that ...
scheduler_job.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 #...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return "BOT IS ONLINE <br> SOURCE CODE BY https://github.com/staciax" def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): server = Thread(target=run) server.start()
wrapper.py
import os import subprocess import sys from threading import Thread from queue import Queue, Empty # https://stackoverflow.com/questions/375427/non-blocking-read-on-a-subprocess-pipe-in-python class server: def __init__(self, server_dir=os.path.join(os.getcwd(), "server")): self.server_dir = server_dir ...
brewSensor.py
import bme680 import adafruit_dht import board import threading import time from logger import logger class BrewSensor(): def __init__(self, location, interval=2): self.location = location self.interval = interval @staticmethod def getSensorByItsLocation(sensors, location): return...
labs_feeder_parallel.py
""" CSeq C Sequentialization Framework parallel backend feeder module: spanws multiple processes to invoke the backend using different options written by Omar Inverso. """ VERSION = 'labs-feeder_parallel-2018.10.23' # VERSION = 'labs-feeder_parallel-2018.05.31' #VERSION = 'feeder_parallel-2018.05.25' #VERSION = 'fe...
hdrcnn_train.py
""" " License: " ----------------------------------------------------------------------------- " Copyright (c) 2017, Gabriel Eilertsen. " All rights reserved. " " Redistribution and use in source and binary forms, with or without " modification, are permitted provided that the following conditions are met: " ...
threading1.py
import threading import time def func(): print("ran\n") time.sleep(1) print('done') time.sleep(1) print('Done Sleeping..') x = threading.Thread(target=func) x.start() print(threading.active_count()) time.sleep(1.2) print("Finally") print(threading.active_count())
reader.py
# Copyright (c) 2019 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...
run_job_core.py
""" This code belongs in run_job.py, but this is split out to avoid circular dependencies """ from __future__ import annotations import abc import asyncio import dataclasses import io import pickle import threading from typing import ( Any, Callable, Coroutine, Dict, Generic, List, Literal,...
test_client.py
"""Test suite for flashfocus.client.""" from __future__ import unicode_literals from threading import Thread from time import sleep from flashfocus.client import client_request_flash def test_client_request_flash(stub_server): p = Thread(target=stub_server.await_data) p.start() client_request_flash() ...
cron.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- class SchedulerService: def __init__(self,app,**kwargs): import sched import time self._jobs = [] self.sched = sched.scheduler(time.time, time.sleep) def schedule(self,when,what,*args,**kwargs): self....
task.py
""" Backend task management support """ import itertools import logging import os import sys import re from enum import Enum from tempfile import gettempdir from multiprocessing import RLock from threading import Thread from typing import Optional, Any, Sequence, Callable, Mapping, Union try: # noinspection PyComp...
make.py
import os import glob import time import shutil import bpy import json import stat from bpy.props import * import subprocess import threading import webbrowser import arm.utils import arm.write_data as write_data import arm.make_logic as make_logic import arm.make_renderpath as make_renderpath import arm.make_world as ...
driver.py
from tkinter import * from math import floor from quoridor import * from features import simple_policy, simple_value from threading import Thread from sys import argv from ai import monte_carlo_tree_search from copy import deepcopy class TkBoard(object): # CONSTANTS SQUARE_SIZE = 50 GOAL_SQUARE_SIZE = 8 ...
gdal2owl.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: houzhiwei # time: 2019/9/14 from owlready2 import * import json from JSON2OWL.OwlConvert.OwlUtils import OWLUtils from JSON2OWL.OwlConvert.Preprocessor import Preprocessor module_uri = 'http://www.egc.org/ont/process/gdal' onto = get_ontology(module_uri) onto, s...
ControlsWidget.py
from PySide2 import QtCore, QtGui from PySide2.QtCore import Qt from PySide2.QtWidgets import QApplication, QHBoxLayout, QVBoxLayout, QLabel, QWidget, QPushButton, QLineEdit, QToolBar, QToolButton, QMenu, QAction from binaryninja import execute_on_main_thread_and_wait, BinaryView from binaryninja.interaction import sho...
test_browser.py
# coding=utf-8 from __future__ import print_function import multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex from runner import BrowserCore, path_from_root, has_browser, get_browser from tools.shared import * try: from http.server import BaseHTTPRequestHandler, HTTPServer except Impo...
instance.py
"""CloudMan worker instance class""" import datetime as dt import json import logging import logging.config import threading import time from boto.exception import EC2ResponseError from cm.services import ServiceRole from cm.services import ServiceType from cm.util import instance_lifecycle, instance_states, misc, sp...
variationServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
stats.py
import json import re from threading import Thread import time import gzip from collections import defaultdict import logging import logging.config from uuid import uuid4 from itertools import cycle from lib.membase.api.exception import SetViewInfoNotFound, ServerUnavailableException from lib.membase.api.rest_client i...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.pool.impl import _AsyncConnDialect from sqlal...
HiwinRA605_socket_ros_test_20190626114016.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
tflex.py
import tensorflow as tf import numpy as np from glob import glob import os import re from tensorflow.python import pywrap_tensorflow import tqdm import h5py import shutil import tempfile import traceback import math from tensorflow.contrib import tpu from tensorflow.contrib.cluster_resolver import TPUClusterResolver f...
model.py
import pandas as pd from sachima import conf import os import importlib from sachima.params import set_sql_params from sachima.log import logger from sachima.wrappers import timer # from tqdm import tqdm import io import time import logging import sys import threading import itertools @timer def sql(sql, datatype): ...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum import Wallet, WalletStorage from electrum.util import UserCancelled, InvalidPassword from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET from elec...
ContextTest.py
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
condition.py
import time import threading def consumer(cond): t = threading.currentThread() with cond: cond.wait() print '{}: Resource is available to consumer'.format(t.name) def producer(cond): t = threading.currentThread() with cond: print '{}: Making resource available'.format(t.name)...
networking.py
""" Defines helper methods useful for setting up ports, launching servers, and handling `ngrok` """ import os import socket import threading from http.server import HTTPServer as BaseHTTPServer, SimpleHTTPRequestHandler import pkg_resources from distutils import dir_util from gradio import inputs, outputs import json ...
GenericsServiceServer.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...
server.py
import constants as const import utils as mu import socket import struct import settings from threading import Lock, Thread # for python2 compatibility try: from socketserver import BaseRequestHandler, ThreadingTCPServer except ImportError: from SocketServer import BaseRequestHandler, ThreadingTCPServer clas...
cosmoz_process_levels.py
#!/bin/python3 # -*- coding: utf-8 -*- """ Copyright 2019 CSIRO Land and Water 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 app...
test_indexes.py
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import datetime import time from threading import Thread from django.test import TestCase from six.moves import queue from test_haystack.core.models import ( AFifthMockModel, AnotherMockModel, AThirdMockM...
test_util.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...
base.py
import argparse import base64 import copy import itertools import json import multiprocessing import os import re import sys import threading import time import uuid from collections import OrderedDict from contextlib import ExitStack from typing import ( Optional, Union, Tuple, List, Set, Dict,...
saltmod.py
""" Control the Salt command interface ================================== This state is intended for use from the Salt Master. It provides access to sending commands down to minions as well as access to executing master-side modules. These state functions wrap Salt's :ref:`Python API <python-api>`. .. versionadde...
threads.py
import socket from threading import Thread from collections import defaultdict from datetime import datetime import os import time # from config import channels_dict, ip_server, ip_client, TIME_FORMAT, __version__ from config import channels_dict, TIME_FORMAT, __version__ from ftplib import FTP import pandas as pd impo...
dfu.py
#!/usr/bin/env python """ Tool for flashing .hex files to the ODrive via the STM built-in USB DFU mode. """ from __future__ import print_function import argparse import sys import time import threading import platform import struct import requests import re import io import os import usb.core import fibre import odriv...
__init__.py
from __future__ import with_statement import os import sys import unittest import doctest import random import time import threading2 from threading2 import * # Grab everything needed to run standard threading test function from threading import _test as std_threading_test from threading import _Verbose, _sleep fr...
main_test.py
# Copyright 2020 Google 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,...
wd.py
""" MDH backend containers healthcheck worker """ import threading from worker import elsa_docker_event_worker, elsa_health_check_worker if __name__ == '__main__': elsa_docker_worker = threading.Thread(target=elsa_docker_event_worker) elsa_docker_worker.start() elsa_health_check_worker()
exercise_2.py
import threading from exercises.utils import fuzzy rabbits_colony_size: int = 0 def rabbit_counter(number_of_rabbits: int): global rabbits_colony_size fuzzy() rabbits_colony_size += number_of_rabbits fuzzy() print(f'Now we have {rabbits_colony_size} rabbits') fuzzy() print('-------------...
test_data_join_worker.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...
sstvLauncher.py
import sys, signal, os, urllib, subprocess, json, logging, ntpath, platform, requests, shutil, threading, multiprocessing from PyQt4 import QtGui, QtCore if platform.system() == 'Linux': print("To run without terminal launch using 'nohup ./sstvLauncher &'") from logging.handlers import RotatingFileHandler # Setup log...
excelParserProcess.py
import functools from multiprocessing import Pool import multiprocessing import threading from threading import Thread import string import time import numpy as np import pandas as pd from pandas import DataFrame, Series from sqlalchemy.orm import scoped_session from sqlalchemy.exc import IntegrityError, ProgrammingEr...
__main__.py
from multiprocessing import Process, Value, Array from helper_modules.continuous_queue import ContinuousQueue as Queue from ctypes import c_bool from pexpect import pxssh import sys import numpy as np from audio._audio_routine import audio_routine from video._video_routine import video_routine from server._server_rou...
materialize_with_ddl.py
import time import pymysql.cursors import pytest from helpers.network import PartitionManager import logging from helpers.client import QueryRuntimeException from helpers.cluster import get_docker_compose_path, run_and_check import random import threading from multiprocessing.dummy import Pool from helpers.test_tools...
events_process.py
from . import user from . import db import multiprocessing as mp import threading as thr import time def init(instance_path): queue = mp.Queue() p = mp.Process(target=checkEvents, args=(instance_path, queue,)) p.daemon = True p.start() t = thr.Thread(target=checkQueue, args=(queue,)) t.daemon = True ...
test_performance.py
import gc import multiprocessing as mp import time import warnings from threading import Thread from typing import List, Optional import numpy as np import pandas as pd import psutil import scipy.sparse as sps import tabmat as tm from glum import GeneralizedLinearRegressor from glum_benchmarks.cli_run import get_all_...
diskover_worker_bot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """diskover - Elasticsearch file system crawler diskover is a file system crawler that index's your file metadata into Elasticsearch. See README.md or https://github.com/shirosaidev/diskover for more information. Copyright (C) Chris Park 2017-2018 diskover is released unde...
jarvis1.py
import speech_recognition as sr from time import ctime import time import threading import cv2 import sys import logging as log import datetime as dt import os import pyjokes import wikipedia import requests from pygame import mixer from gtts import gTTS mixer.init() os.system("jack_control start") os.system("arecord ...
evaluate.py
import time import statistics from timeit import default_timer as timer from multiprocessing import Process, Queue import os import datetime import subprocess import queue import csv import sys from energyusage.RAPLFile import RAPLFile sys.path.append('/root/energy_usage/energy-usage-master/energyusage') import ene...
Simulator.py
from Person import Person as person from DataPool import DataPool as DataPool import numpy as np import math as math import copy as copy import random import threading from File_handler import File_handler as Writer class Simulator: # ---- Constructor ----# def __init__(self, people, days): ...
start_api_integ_base.py
import shutil import uuid from typing import Optional, Dict from unittest import TestCase, skipIf import threading from subprocess import Popen import time import os import random from pathlib import Path from tests.testing_utils import SKIP_DOCKER_MESSAGE, SKIP_DOCKER_TESTS, run_command @skipIf(SKIP_DOCKER_TESTS, S...
b_qim_client.py
import orsoqs import json import signal import sys import threading import matplotlib.pyplot as plt import numpy as np import zmq try: from Queue import Queue except ImportError: from queue import Queue class qim_client: def sdc_encode_char(self, c): ''' Encode a character into SDC flags. ...
user.py
import socket import threading username = input("Choose your username: ") user = socket.socket(sokcet.AF_INET, socket.SOCK_STREAM) ip = '127.0.0.1' port = 55555 user.connect((ip, port)) # defining the function to receive the user's data def receive(): while True: try: msg = user.recv(2048).decode('ascii...
barq.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import boto3, json from clint.arguments import Args from clint.textui import puts, colored, indent, prompt, validators import time from prettytable import PrettyTable import string import os import random import subprocess import readline import sys import signal import re...
main.py
import argparse import ctypes import os import sys import tempfile import threading import time import webbrowser from typing import Dict, Optional from django.conf import ENVIRONMENT_VARIABLE from django.core.exceptions import ImproperlyConfigured from django.utils.crypto import get_random_string from mypy_extensions...
Input.py
import datetime import math import subprocess import sys import threading import Config import Event started = False position = None rotation = None speed = None rotation_speed = None lock = threading.Lock() def init(): args = [sys.argv[1]] if 'map' in Config.config: args.append('-map') arg...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
dataset.py
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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...
plugin_manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/windows/plugin_manager.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright...
bank_account_test.py
import sys import threading import time import unittest from bank_account import BankAccount class BankAccountTests(unittest.TestCase): def setUp(self): self.account = BankAccount() def test_newly_opened_account_has_zero_balance(self): self.account.open() self.assertEqual(self.accou...
carcontroller.py
from cereal import car import json import asyncio from threading import Thread import websockets from common.params import Params from common.numpy_fast import clip from selfdrive.car import apply_toyota_steer_torque_limits, create_gas_command, make_can_msg, gen_empty_fingerprint from selfdrive.car.toyota.toyotacan imp...
rpc.py
import inspect import logging from concurrent.futures import ThreadPoolExecutor from threading import Thread, RLock, Event from uuid import uuid4 from jsonschema import Draft4Validator from weavelib.messaging import Sender, Receiver from weavelib.messaging.messaging import raise_message_exception from weavelib.except...
dynamodb_conditional_update.py
import boto3,os from boto3.dynamodb.conditions import Key import argparse from datetime import datetime from botocore.exceptions import ClientError from boto3.dynamodb.conditions import Attr, AttributeNotExists datasource = 'flight-19096' partition_key = '20200428' table_name = 'ygpp-devl-ingestion-notification' def ...
aq_test.py
import serial import serial.tools.list_ports import threading import time from guizero import App, Text, PushButton, CheckBox, Slider, TextBox temp = 0 e_co2 = 0 ser = serial.Serial("/dev/ttyS0", 9600) def clear_console(): console.value = "" app = App(title="Raspberry Pi AQ", layout="grid") console = TextBox(app...
target_bigquery.py
#!/usr/bin/env python3 import argparse import collections import http.client import io import json import logging import sys import threading import urllib from tempfile import TemporaryFile from typing import List import pkg_resources import singer from google.api_core import exceptions from google.cloud import bigq...