source
stringlengths
3
86
python
stringlengths
75
1.04M
process.py
import atexit import logging import os import shlex import subprocess import sys import threading import time import yaml from future.standard_library import install_aliases from pyngrok import conf from pyngrok.exception import PyngrokNgrokError, PyngrokSecurityError from pyngrok.installer import validate_config in...
operationsframe.py
import tkinter as tk import tkinter.filedialog from tkinter import ttk import os import webbrowser import threading from http.server import HTTPServer, SimpleHTTPRequestHandler import eosim.gui.helpwindow as helpwindow from eosim import config from eosim.gui.visualizeframe.visglobeframe import VisGlobeFrame from eosim...
object_storage_bulk_delete.py
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
test_sys.py
import unittest, test.support from test.support.script_helper import assert_python_ok, assert_python_failure import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import platform import locale # count the number of test runs, used to...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ from decimal import D...
caching_test.py
# Copyright 2018-2020 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...
chrome_test_server_spawner.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of ...
mqtt_sub.py
import json import logging import os import random import subprocess import threading import signal import time import toml import pickledb from forms import convert from paho.mqtt import client as mqtt_client data = toml.load("data.toml") PID = pickledb.load('pid.db', False, True) # db = pickledb.load('data.db', Fals...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
tello.py
# coding=utf-8 import logging import socket import time import threading import cv2 from threading import Thread from .decorators import accepts class Tello: """Python wrapper to interact with the Ryze Tello drone using the official Tello api. Tello API documentation: https://dl-cdn.ryzerobotics.com/downl...
termplay.py
# ------------------------------------------------------------ # TermPlay is licensed under the Apache License, Version 2.0. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # A copy of the "License" is also provided with the source # of this project. Unless required by applic...
http_server.py
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 """ This module defines util functions for testing offchain inbound request processor with http server Not recommended for production """ from http import server from .http_header import X_REQUEST_ID, X_REQUEST_SENDER_ADDRESS import lo...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Carboncoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib imp...
helper_all.py
""" :module: :synopsis: Module provide functions for easier testing communication. :author: Julian Sobott public classes --------------- .. autoclass:: XXX :members: public functions ----------------- .. autofunction:: XXX private classes ---------------- private functions ------------------ """ import...
test_multiprocessing_value.py
import logging from multiprocessing import Process, Value import os import sys import time logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class Monitor: def __init__(self): self.monitor_active = False def start(self, monitor_state, kill_monitor): M...
Server.py
#! /usr/bin/env python3 import socket, sqlite3 as lite from multiprocessing import Process class IP_To_Name_Control(object): def __init__(self): global con, cur, data con = lite.connect('itnc.db') cur = con.cursor() cur.execute("DROP TABLE CONTROL;") cur.execute("CREATE TABLE CONTROL (id INTEGER PRIMARY K...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including witho...
methods.py
import logging import multiprocessing import threading def add_process(name, function, *args): logging.info(f"Starting new process - {name}") process = multiprocessing.Process(target=function, args=args) process.start() return process def add_thread(name, function, *args): logging.info(f"Starting new thread - {n...
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 flash build target to rebuild and flash entire project (Ctrl-T Ctrl-F) # - Run app-flash build target to rebuild and f...
mp_demo8.py
from multiprocessing import Process, Value, Array def f(n, a): n.value = 3.1415927 for i in range(len(a)): a[i] = -a[i] if __name__ == '__main__': num = Value('d', 0.0) arr = Array('i', range(10)) p = Process(target=f, args=(num, arr)) p.start() p.join() print(num.value) ...
test_credentials.py
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
LibSync.py
from yaml import load, dump import requests import os import urllib import threading from queue import Queue import asyncio try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper class LibSync: def __init__(self, serverRootURL, localRootPath): self.se...
socket_server.py
import time import json from threading import Thread, Event import socket from data_stream import send_request """ SocketServer is a multithreaded socket server receiving n amount of connections and proxy the messages to flask """ class SocketServer(Thread): def __init__(self): super(SocketServer, self)._...
assistant_library_with_button_demo.py
#!/usr/bin/env python3 # Copyright 2017 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...
fork_wait.py
"""This test case provides support for checking forking and wait behavior. To test different wait behavior, override the wait_impl method. We want fork1() semantics -- only the forking thread survives in the child after a fork(). On some systems (e.g. Solaris without posix threads) we find that all active th...
test.py
import json import pytest import random import re import string import threading import time from multiprocessing.dummy import Pool from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV cluster = ClickHouseCluster(__file__) node1 = cluster.a...
multi_process.py
import multiprocessing import os # TODO This is pretty functionless for now. def __log__(title): """ Debug log. :param title: Debug title :return: """ print(f'{title}\nModule: {__name__}\nParent Process ID: {os.getppid()}\nProcess ID: {os.getpid()}') def f(name): """ Multiprocess ite...
autohibernate.py
#!/usr/bin/env python # # AutoPilot :: Sourav Badami :: http://www.souravbadami.me # Script: AutoHibernate # Description: This script automatically detects when theres no one nearby and # sends the system to hibernation mode. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
run.py
# ©GO-PC Build # This project is under a CC0-1.0 License # (View the license here: https://github.com/GO-PC-Build/DiscordBot/blob/master/LICENSE) from glob import glob from os import name, execv, system, environ from sys import argv, executable, stdout, exit from distutils.util import strtobool try: from utilsx.c...
resourcedirectory_test.py
import unittest import threading import socket import re import random from time import sleep from coapthon.resource_directory.resourceDirectory import ResourceDirectory from coapthon.messages.response import Response from coapthon.messages.request import Request from coapthon import defines from coapthon.serializer im...
email.py
from threading import Thread from flask import render_template from flask_mail import Message from app import mail def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, recipients=recipients) msg.body = text_body msg.html = html_body mail.send(msg) def send_passw...
base_build.py
from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.conf import settings from django.db import connection import datetime import logging from multiprocessing import Queue, Process, Value, Lock class Command(BaseCommand): help = 'Basic func...
trainer.py
# Copyright (c) 2020 Sarthak Mittal # # 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, dist...
__init__.py
import CCAPython.gov.cca import logging import time import collections # Configure Logging logger = logging.getLogger('root') def mape_k_loop(platform_component, reconfiguration_port): """ This is the method for the process running the monitoring loop. """ # Extract Contract Information if platform_co...
start - Copy.py
import threading import time import cv2,os,sys,socket,struct,pickle import numpy as np from tkinter import * #globals tempf=np.zeros((0,0)) start_time=time.time() endme=False #tkinter stufffffff angle=0.0 def assign_angle(val): global angle angle=val # print(val) root=Tk() root.geometry('600...
server.py
# NAME : MOHAMMED FURKHAN SHAIKH # Took base code from below link and started working on it ###https://medium.com/swlh/lets-write-a-chat-app-in-python-f6783a9ac170 from socket import AF_INET, socket, SOCK_STREAM from threading import Thread import tkinter import os import errno clients = {} # dictionary ...
pub_proxy.py
# -*- coding: utf-8 -*- ''' Listener worker process ''' from __future__ import absolute_import # Import pythond stdlib import os import signal import logging import threading # Import third party libs import zmq # Import napalm-logs pkgs from napalm_logs.config import PUB_IPC_URL from napalm_logs.config import PUB_P...
vm_util.py
# Copyright 2014 PerfKitBenchmarker 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...
2021-11-21-cmind-drawingcode.py
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import re import socket,threading import pyautogui from worrd import gud def recvMsg(soc): #좌표 받음 while True: data = soc.recv(15) #길이를 msg = data.decode() a=msg.split(',') ex.sok(a[0],a[1]...
bellamylib.py
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' The main library for running the IRC bot. The IRCBot class will be the bot itself. The settings can be done manually or read from a config file. The example config file shows some of the options. A simple implementation of the bot would be: ...
test_bz2.py
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import pickle import glob import pathlib import random import shutil import subprocess import threading from test.support import unlink import _compression import sys ...
color_picker.py
import math import time import win32api import win32gui from threading import Thread from PySide2.QtCore import QEvent, Signal from PySide2.QtWidgets import QHBoxLayout, QLabel, QVBoxLayout, QWidget from desktopmagic.screengrab_win32 import getRectAsImage class ColorModel: def __init__(self, r, g, b, h, s, v): ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
main.py
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
test_multiprocessing.py
import contextlib import multiprocessing import pytest import redis from redis.connection import Connection, ConnectionPool from redis.exceptions import ConnectionError from .conftest import _get_client @contextlib.contextmanager def exit_callback(callback, *args): try: yield finally: callb...
main.py
#! python3 # main.py - anata gui # GUI automation import pyautogui # file path and control import os # determine exe or script import sys # play sound file #import playsound # GUI import tkinter # image from PIL import ImageTk from PIL import Image # itertools import itertools # multiprocess import ...
sauce.py
import csv import os import subprocess import threading # Gather the packages to test. PREFIX = './packages/node_modules/' CISCOSPARK = os.path.join(PREFIX, '@ciscospark') WEBEX = os.path.join(PREFIX, '@webex') PROD_ENV_VARS = { 'CONVERSATION_SERVICE': 'https://conv-a.wbx2.com/conversation/api/v1', 'ENCRYPTION_S...
core.py
""" Core components of Home Assistant. Home Assistant is a Home Automation framework for observing the state of entities and react to changes. """ import enum import functools as ft import logging import os import signal import threading import time from types import MappingProxyType import voluptuous as vol import...
test_pubsub.py
import multiprocessing as mp import secrets import time import reth import perwez ENV_NAME = "QbertNoFrameskip-v4" WORKER_BATCH_SIZE = 64 WORKER_CNT = 8 def _trainer(server_url): data_recv = perwez.RecvSocket(server_url, "data", broadcast=False) weight_send = perwez.SendSocket(server_url, "weight", broadcas...
color-control.py
import numpy as np import cv2 as cv import paho.mqtt.client as mqtt import socket import sys import cv2 as cv import pickle import numpy as np import struct import zlib import multiprocessing from multiprocessing import Queue import queue import math import time ######################## DEFINICIONES PARA MQTT ########...
timing.py
"""Time related utilities.""" import pytz import sys import os import re import collections import functools import time import datetime import threading import traceback class TimeoutException(Exception): """Timeout exception error.""" pass class TimeoutExceptionInfo(object): """ Holds timeout ex...
starter.py
import sys import time from threading import Thread from crawler4py.dispatch.dispatch import Dispatch from crawler4py.dispatch.monitor import Monitor from crawler4py.download.downloader import Downloader from crawler4py.extractor.extractor import Extractor from crawler4py.log import Logger from crawler4py.storage_dup ...
udp_streaming.py
import base64 import pickle import socket import struct import wave import cv2, imutils, time import queue as pyqueue import os import threading import pyaudio fullpath = "/home/yagorezende/VSCodeProjects/TCC00314-Streaming/streaming_side/videos/" # os.path.abspath(os.getcwd()).replace("testing", "videos/") # fila...
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...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
traybar.py
import os from .win32_adapter import * import threading import uuid class SysTrayIcon(object): """ menu_options: tuple of tuples (menu text, menu icon path or None, function name) menu text and tray hover text should be Unicode hover_text length is limited to 128; longer text will be truncat...
dataset-stat.py
"""Analyze a text file""" from tqdm import * import nltk, sys import numpy as np from multiprocessing import Process, Manager, cpu_count import itertools from nltk.tokenize import ToktokTokenizer toktok = ToktokTokenizer().tokenize def get_stat(in_queue, out_list): while True: line_no, line = in_queue.g...
lights.py
from matrix_lite import led from time import sleep from math import pi, sin import threading def lightsOff(): everloop = ['black'] * led.length led.set(everloop) def flashLights(color, times, intensity): everloop = ['black'] * led.length led.set(everloop) for i in range(0,times): ...
local.py
import threading from random import randint local = threading.local() def run(local, barrier): local.my_value = randint(0, 10**2) t = threading.current_thread() print(f'Thread {t.name} has value {local.my_value}') barrier.wait() print(f'Thread {t.name} still has value {local.my_value}') count ...
tutorial_remotesensing.py
""" mss.tutorials.tutorial_remotesensing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This python script generates an automatic demonstration of how to work with remote sensing tool in topview. This file is part of mss. :copyright: Copyright 2021 Hrithik Kumar Verma :copyright: Copyright 2021-2022 by ...
client_socket.py
# TODO documentation from __future__ import print_function import sys import socket import threading import select from fprime_gds.common.handlers import DataHandler from fprime.constants import DATA_ENCODING # Constants for public use GUI_TAG = "GUI" FSW_TAG = "FSW" class ThreadedTCPSocketClient(DataHandler): ...
preview_utils.py
import os import re import threading import time import traceback import sublime if sublime.platform() == 'windows': import winreg import ctypes from ctypes import wintypes # wrapper for GetSystemDirectoryW def get_system_root(): buffer = ctypes.create_unicode_buffer(wintypes.MAX_PATH + 1...
example_userdata_stream.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_userdata_stream.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://p...
test_logging.py
# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
audiowrite.py
import io from distutils.command.config import config import numpy as np import threading from pathlib import Path import contextlib import soundfile from scipy.io.wavfile import write as wav_write from pb_chime5.mapping import Dispatcher from pb_chime5.io.audioread import normalize_path int16_max = np.iinfo(np.int...
wrappers.py
# Copyright 2019 The PlaNet Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
keylime_agent.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import asyncio import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn import threading from urllib.parse import urlparse import base64 imp...
_env_runner.py
"""Change based on yarr.runners._env_runner to choose between multiple GPUs for agent evaluation """ import copy from copy import deepcopy import logging import os import time import multiprocessing from multiprocessing import Process, Manager from typing import Any, List import numpy as np from yarr.agents.agent im...
ui_controller.py
import shelve import re import sys import threading import time import socket_temperature_connect import socket_oscilloscope_connect # import usb_connect import serial_connect from main_window import Ui_MainWindow from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidgetItem, QMessageBox from PyQt5.QtCore im...
test_statsd.py
# -*- coding: utf-8 -*- # pylint: disable=line-too-long,too-many-public-methods # Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2015-Present Datadog, Inc """ Te...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.skip_if_broken_multiprocessing_synchronize() from test.support.script_helper import assert_python_ok import contextlib import itertools imp...
dataloader.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
client_inside_server_test.py
import time from multiprocessing.context import Process import pytest from zero import AsyncZeroClient, ZeroClient from server1 import run as run1 from server2 import run as run2 @pytest.mark.asyncio async def test_client_inside_server(): try: from pytest_cov.embed import cleanup_on_sigterm except I...
samsungws.py
""" SamsungTVWS - Samsung Smart TV WS API wrapper Copyright (C) 2019 Xchwarze Copyright (C) 2020 Ollo69 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of t...
tamilgun_uniqueip.py
import sys import threading import time import socket import os try: from urllib import urlencode except ImportError: from urllib.parse import urlencode fo = open("thread.txt", "r+") fo.write("30"); # Close opend file fo.close() glob=1 def task(page,srcip): global glob while True: s = socket.socket(socket....
runtime_manager_dialog.py
#!/usr/bin/env python """ Copyright (c) 2015, Nagoya University 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 source code must retain the above copyright notice, this ...
test.py
import time from threading import Thread def run1(): time.sleep(2) print('run1') def run2(): time.sleep(2) print('run2') if __name__ == '__main__': t1 = Thread(target=run1) t2 = Thread(target=run2) t1.start() t2.start() t1.join() t2.join() print('main')
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. 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 source code must retain the above copyright # noti...
pc-client.py
''' Visualization for compressed image coefficients Program will obtain coefficient data from TCP and display the decompressed image Author: Brytni Richards Last modified: 2021-03-31 Required: pip install matplotlib python -m pip install windows-curses ''' # ==========================================================...
invoker.py
# # (C) Copyright IBM Corp. 2019 # # 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...
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing...
statistic.py
from multiprocessing import Process def send_statistic(token, uid, message, intent, user_type=None): try: # Сообщение от бота if user_type is not None: pass # Сообщение от пользователя else: if intent != 'unknown': pass else: ...
test_kudu.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...
showing_terminal.py
#!/usr/bin/python """ - read output from a subprocess in a background thread - show the output in the GUI """ import sys from itertools import islice from subprocess import Popen, PIPE from textwrap import dedent from threading import Thread try: import Tkinter as tk from Queue import Queue, Empty except Impor...
test_mysqlx_connection.py
# -*- coding: utf-8 -*- # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, as # published by the Free Software Foundation. # # This program is also d...
Test (1).py
#!/usr/bin/env python3 # coding:utf-8 import cv2 import math import numpy as np import threading import time import datetime import CMDcontrol robot_IP = "192.168.1.102" camera_out = "chest" stream_pic = True action_DEBUG = False #################################################初始化###################################...
whatsapp.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys; sys.dont_write_bytecode = True; import binascii; from whatsapp_defines import WAMetrics; from whatsapp_binary_writer import whatsappWriteBinary; import os; import signal; import base64; from threading import Thread, Timer import math; import time; import datet...
chrome_test_server_spawner.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of ...
xmlrpc_server_example.py
from __future__ import absolute_import, division, print_function # This is an example of how a 3rd-party program with Python embedded, such # as Coot or PyMOL, can be interfaced with CCTBX-based software. Something # much like this is used for the Phenix GUI extensions to those programs. # I haven't tried this with a...
tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation, Suspicio...
sim.py
def main(): import argparse import sys from collections import deque from queue import Queue import time from ev3sim.file_helper import find_abs parser = argparse.ArgumentParser(description='Run the simulation, include some robots.') parser.add_argument('--preset', type=str, help="Path...
test_user_secrets.py
import json import os import threading import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from test.support import EnvironmentVarGuard from urllib.parse import urlparse from google.auth.exceptions import DefaultCredentialsError from google.cloud import bigquery from kaggle_secrets import (_KAGG...
coap_payload_size_fuzzer.py
import logging import multiprocessing import random import signal import time import unittest from coapthon.client.helperclient import HelperClient from Entity.attack import Attack from Entity.input_format import InputFormat from protocols import CoAP as PeniotCoAP class CoAPPayloadSizeFuzzerAttack(Attack): """...
server.py
# coding: utf-8 import os import sys import socket import threading import buffer from time import sleep from scheduler import scheduler class Receiver : def __init__(self, host='0.0.0.0', port=6666): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket....
test_v2_0_0_container.py
import multiprocessing import queue import random import threading import unittest import requests import time from dateutil.parser import parse from .fixtures import APITestCase class ContainerTestCase(APITestCase): def test_list(self): r = requests.get(self.uri("/containers/json"), timeout=5) ...
TelloController3.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import threading import socket import time import sys from PyQt5.QtCore import * from PyQt5.QtWidgets import * class TelloController1(QWidget): def __init__(self): QWidget.__init__(self) self.initConnection() self.initUI() # 最初にcommandコ...
DateTime.py
import os, sys parentPath = os.path.abspath("..") if parentPath not in sys.path: sys.path.insert(0, parentPath) from widgets.Label import Label from widgets.Image import Image import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GObject, Gdk import datetime import psutil #from weather import ...
dataloader.py
import os import torch from torch.autograd import Variable import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image, ImageDraw from SPPE.src.utils.img import load_image, cropBox, im_to_torch from opt import opt from yolo.preprocess import prep_image, prep_frame, inp_to_image fro...
test_insert.py
import pytest from pymilvus import DataType, ParamError, BaseException from utils import * from constants import * ADD_TIMEOUT = 60 uid = "test_insert" field_name = default_float_vec_field_name binary_field_name = default_binary_vec_field_name default_single_query = { "bool": { "must": [ {"vect...
trainer_utils.py
# coding=utf-8 # Copyright 2020-present the HuggingFace Inc. team. # # 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...