source
stringlengths
3
86
python
stringlengths
75
1.04M
run.py
import time import playsound from turtle import * from random import randint from threading import Thread def play_bg_music(): playsound.playsound("system-files//bg-sound.mp3") def finish_music(): playsound.playsound("system-files//finish-sound.mp3") thread1 = Thread(target = play_bg_music) thread1.start()...
asgi.py
import asyncio import collections import threading from http import HTTPStatus from itertools import chain from typing import Any, Deque, Iterable from .types import ASGIApp, Environ, Message, Scope, StartResponse __all__ = ("ASGIMiddleware",) class AsyncEvent: def __init__(self, loop: asyncio.AbstractEventLoop...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app .. note:: This module is Experimental on Windows platforms, and supports limited configurations: - doesn't support PAM authentication (i.e. external_auth: auto) - doesn't support SSL (i....
multithreading_test.py
# Copyright 2019 Nativepython Authors # # 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...
lxconsole.py
#!/usr/bin/python # lxconsole.py # # by Claude Heintz # copyright 2014-15 by Claude Heintz Design # # see license included with this distribution or # https://www.claudeheintzdesign.com/lx/opensource.html ################################################################# # # This file contains the main interf...
GUI.py
import queue import PySimpleGUI as sg from threading import Thread sg.theme('Dark Amber') downloader = None scraper = None def execute(downloader, scraper, start_epi, end_epi) : scraper.main(start_epi, end_epi, downloader.token) downloader.download() class Anime_GUI() : def __init__(self, gui_queue, dow...
carla_data_provider.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>. """ This module provides all frequently used data from CARLA via local buffers to avoid blocking calls to CARLA """ from __future__ ...
logger.py
#!/usr/bin/python # logger.py # # Accelerometer server helper code import socketserver import socket import time from threading import Thread, Lock import sys from IPython.display import display import socket import ipywidgets as widgets import matplotlib.pyplot as plt # Configuration options HOST = None PORT = 9999...
clean.py
#Python 3.7.4 #Make by: Lonely Dark #Import modules: import requests from time import sleep, strftime from random import randint import threading #Your token: token='Token here:' def post(token,fr_list_id): #Post in your wall message='This is auto message. Cleared friends: \n '+ str(fr_list_id[::]) + '\n \n Script...
server.py
from flask import Flask, request, Response import requests import time from datetime import datetime from threading import Thread app = Flask(__name__) app.debug = True GREETINGS = ["HI", "HELLO", "HEY"] @app.route("/bot", methods=["POST"]) def message_received(): request_data = request.form event_type = r...
benchmark.py
#!/usr/bin/env python3 import os import sys import psutil import pathlib import subprocess import numpy as np import scipy.stats as stats from popper.split import runner, prog_to_code from popper.utils import Settings from pyswip import Prolog from multiprocessing.pool import Pool, ThreadPool from multiprocessing i...
eventloop.py
import torch import threading import pickle from torch.utils.data import IterDataPipe, communication, MapDataPipe def DataPipeToQueuesLoop(source_datapipe, req_queue, res_queue): if isinstance(source_datapipe, IterDataPipe): pipe_type = communication.iter protocol_type = communication.protocol.It...
event_processor.py
""" Implementation details of the analytics event delivery component. """ # currently excluded from documentation - see docs/README.md from calendar import timegm from collections import namedtuple from email.utils import parsedate import errno import json from threading import Event, Lock, Thread import time import u...
app.py
import sys import os from flask import Flask, request, render_template, url_for, redirect, session, Response import json import requests import traceback import time from threading import Thread import uuid import pd # import http.client as http_client # http_client.HTTPConnection.debuglevel = 1 app = Flask(__name__...
ctagsplugin.py
""" A ctags plugin for Sublime Text 2/3. """ import functools from functools import reduce import codecs import locale import sys import os import pprint import re import string import threading import subprocess from itertools import chain from operator import itemgetter as iget from collections import defaultdict, ...
java.py
import json import socketserver import socket import sys import re from threading import Thread import py4j import hail class FatalError(Exception): """:class:`.FatalError` is an error thrown by Hail method failures""" class Env: _jvm = None _gateway = None _hail_package = None _jutils = None ...
DataCollection.py
''' Created on 21 Feb 2017 @author: jkiesele ''' from DeepJetCore.TrainData import TrainData from DeepJetCore.dataPipeline import TrainDataGenerator import tempfile import pickle import shutil import os import copy import time import logging from DeepJetCore.stopwatch import stopwatch logger = logging.getLogger(__na...
test.py
from tensorflow import keras import numpy as np import cv2, requests from threading import Thread from config import * def notify(): # Token to be inserted here token = None # token = "32e07-df8-47b-800-e1ab85df7" data = {"token": token} url = "http://localhost:8000/notify/" # url = "https://tr...
interop.py
import json import logging import os import random import re import shutil import statistics import string import subprocess import sys import tempfile from datetime import datetime from typing import Callable, List, Tuple import prettytable from termcolor import colored import testcases from result import TestResult...
launchAgents.py
#!/usr/bin/env python3 '''launches new NCS instances and starts the NeoLoad LoadGenerator agent on them''' import argparse from concurrent import futures import datetime import json import logging import os import subprocess import sys import time # third-party module(s) import requests # neocortix modules import ncscl...
CronTools.py
# coding: utf-8 from src.orm.SqlStrunct import Monitor import multiprocessing from src.orm.SqlUtil import SqlUtil from src.orm.SqlStrunct import Cluster import threading from Config import Config import time import telnetlib from datetime import datetime from src.tools.DateTools import DateTools import random conf = ...
__init__.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Logging utils """ import os import warnings from threading import Thread import pkg_resources as pkg import torch from torch.utils.tensorboard import SummaryWriter from utils.general import colorstr, emojis from utils.loggers.wandb.wandb_utils import WandbLogger from u...
getwiotpdata.py
# ***************************************************************************** # Copyright (c) 2018 IBM Corporation and other Contributors. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution,...
Admit.py
"""**Project** --- ADMIT project. ------------------------------ This module defines the Admit project class. """ # system imports import time import xml.etree.cElementTree as et import fnmatch, os, os.path import zipfile import copy import numpy as np import threading import sys import errno import datetime i...
Hiwin_RT605_ArmCommand_Socket_20190628090524.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcm_2d as TCP import HiwinRA605_socket_Taskcmd_2 as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv...
server-tcp.py
import socket import threading bind_ip = "" bind_port = 60007 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip, bind_port)) server.listen(5) print("[*] Listening on %s:%d" % (bind_ip, bind_port)) def handle_client(client_socket): request = client_socket.recv(1024).decode() p...
wifi_setup.py
import os import imp import sys import time import threading # usb or sd card user_dir = os.getenv("USER_DIR", "/usbdrive") # imports current_dir = os.path.dirname(os.path.abspath(__file__)) og = imp.load_source('og', current_dir + '/og.py') wifi = imp.load_source('wifi_control', current_dir + '/wifi_control.py') wi...
prefix_mgr_client_tests.py
#!/usr/bin/env python # # Copyright (c) 2014-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from...
threaded.py
# -*- coding: utf-8 -*- import logging import time from threading import Condition from threading import Thread logging.getLogger(__name__).setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, CRITICAL class Threaded(object): """Provides a _thread which executes the _run() method at regular intervals. Fe...
bazel_build.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2016 The Tulsi 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/LICE...
test_crud.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
scriptinfo.py
import os import sys from copy import copy from functools import partial from tempfile import mkstemp import attr import logging import json from pathlib2 import Path from threading import Thread, Event from .util import get_command_output, remove_user_pass_from_url from ....backend_api import Session from ....debugg...
multicore.py
from multiprocessing import Process, Queue from .singlecore import SingleCoreSampler import numpy as np import random import logging import cloudpickle as pickle from jabbar import jabbar from .multicorebase import MultiCoreSampler, get_if_worker_healthy logger = logging.getLogger("MulticoreSampler") SENTINEL = None...
test_set_jy.py
import unittest from test import test_support import threading if test_support.is_jython: from java.io import (ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream) from java.util import Random from javatests import PySetInJavaTest class SetTestCase(...
contestNoti_Bot.py
#-*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') import os import pickle from ContestParser import * from MyScheduler import * # import Scheduler from SupportMysql import * # import SQL support class import threading # Telegram interface import telebot from telebot import types, apihelp...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum_ltc.storage import WalletStorage, StorageReadWriteError from electrum_ltc.wallet_db import WalletDB...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import argparse import json import multiprocessing imp...
pseudo-server-dw-mt.py
#!/usr/bin/python ''' This is a pseudo-server that sends predefined pattern to any connected client. It is used to test transport behaviour and throughput. If you want to use it with a sketch, connect your PC and Blynk-enabled device into the same network and configure Blynk to connect to this pseudo-server: I...
i3_focus_last.py
#!/usr/bin/env python3 import os import socket import selectors import threading from argparse import ArgumentParser import i3ipc SOCKET_FILE = '/tmp/.i3_focus_last' MAX_WIN_HISTORY = 15 class FocusWatcher: def __init__(self): self.i3 = i3ipc.Connection() self.i3.on('window::focus', self.on_win...
libevreactor.py
# Copyright DataStax, 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, softwa...
kernel.py
from queue import Queue from threading import Thread from ipykernel.kernelbase import Kernel import re import subprocess import tempfile import os import os.path as path class RealTimeSubprocess(subprocess.Popen): """ A subprocess that allows to read its stdout and stderr in real time """ def __init...
jobs.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, software ...
byMaterialThickness.py
from __future__ import division import numpy as np import math # for math.ceil import matplotlib.pyplot as plt from numpy.linalg import norm from numpy.random import uniform from scipy.stats import multivariate_normal # for bivariate gaussian -> brownian motion ( normal with mu x(t-1), and variance sigma ) from fil...
testQueue.py
from context import * import time import random def consumer(queue): print 'Received queue' for i in range(1000): queue.push('Elem %d' % i) def producer(queue): print 'Received queue' while(True): time.sleep(random.randint(0,2)) print 'Found: %s' % queue.pop() pass def mai...
tests.py
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import copy import datetime from decimal import Decimal import re import threading import unittest import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigure...
port_status_update.py
# Copyright (c) 2017 OpenStack Foundation # 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 ...
process_replay.py
#!/usr/bin/env python3 import importlib import os import sys import threading import time from collections import namedtuple import capnp from tqdm import tqdm import cereal.messaging as messaging from cereal import car, log from cereal.services import service_list from common.params import Params from selfdrive.car....
functional_tests.py
import unittest import threading from selenium import webdriver from app import db from app import create_app from app.models import LanguageTest class FavProgLangTestCase(unittest.TestCase): ''' Things to test: x All the flows in wiki/app-flow-chart.svg x Can't go to any other pages without...
service.py
import sys import threading import os import signal import argparse import random import time import logging logger = logging.getLogger(__name__) # Hide requests from the logs import requests requests_log = logging.getLogger("requests.packages.urllib3") requests_log.setLevel(logging.ERROR) from clint.textui import c...
ntlmrelayx.py
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Generic NTLM Relay Module # # Authors: # Alberto Sol...
player.py
""" """ import threading import types import wave import pyaudio CHUNK_SIZE = 1024 class Player: def __init__(self, pyaudio_instance=None): self.pyaudio_instance = pyaudio_instance if pyaudio_instance else pyaudio.PyAudio() self.stop_event = threading.Event() self.device_index = None ...
application_runners.py
import sys import os import uuid import shlex import threading import shutil import subprocess import logging import inspect import runpy import flask import requests from dash.testing.errors import NoAppFoundError, TestingTimeoutError, ServerCloseError from dash.testing import wait logger = logging.getLogger(__nam...
mic.py
# Copyright 2017 Mycroft AI 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 writin...
ProcessObj.py
from PyFlow.Core import NodeBase from PyFlow.Core.NodeBase import NodePinsSuggestionsHelper from PyFlow.Core.Common import * import threading class AnObject(NodeBase): def __init__(self, name): super(AnObject, self).__init__(name) self.inExec = self.createInputPin("Start", 'ExecPin', None, self.st...
buck.py
#!/usr/bin/env python from __future__ import print_function import errno import logging import os import re import signal import subprocess import sys import threading import time import uuid import zipfile from multiprocessing import Queue from subprocess import check_output from buck_logging import setup_logging f...
lite_http.py
import socket, threading, os """ A simple lite static web server based Python with **less 200 line** """ log = print STATIC_DIR = 'static' PAGE_404 = '404.html' PAGE_METHOD_NOT_SUPPORT = 'method_not_support.html' REQUEST_MAX_LENGTH = 1024 * 1024 HEADER_CONTENT_TYPE = ('Content-Type', 'text/html; charset=UTF-8') R...
executeDemo.py
#This is a version of execute.py intended for demo purposes. #Normally, when running the program there are 3 file transfers: #1. User task file to provider (1.2GB image.zip) #2. Provider result file to validator (already ran image) #3. Provider result file to user #This version of execute will skip the first two file t...
multi_threading_class.py
#-*- coding: utf-8 -*- from threading import Thread import time class ThreadFunc(object): def __init__(self, func, args, name=''): self.name = name self.func = func self.args = args def __call__(self): apply(self.func, self.args) def loop(idx, nsec): print("start loop", id...
sfn_message_test.py
# sfn_message_test.py """A script designed to test http request between the sfn_service and SCRAL""" import json import requests from threading import Thread import time import argparse import arrow import os import socket from pathlib import Path import random import sys sys.path.append(str(Path(__file__).absolute().p...
Executor.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from lib.Util.util import * from lib import * from lib.Metasploit import Metasploit from lib.parameter_server import Server as ParameterServer from lib.CreateReport import CreateReport from Worker import Worker_thread def show_banner(util, delay_time=2.0): banner = u"...
bulkscan.py
#!/usr/bin/python3 # bulkscan - Document scanning and maintenance solution # Copyright (C) 2019-2019 Johannes Bauer # # This file is part of bulkscan. # # bulkscan 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 Foundatio...
ec_utils.py
#!/usr/bin/python """ (C) Copyright 2020-2022 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import re import threading import queue import time from nvme_utils import ServerFillUp from daos_utils import DaosCommand from test_utils_container import TestContainer from apricot import TestWithSe...
run-server.py
import multiprocessing as mp import socket import subprocess import sys import time from typing import Callable, List, Optional # While we could use something like requests (or any other 3rd-party module), # this script aims to work with the default Python 3.6+. CLEAR = "\033[39m" MAGENTA = "\033[95m" BLUE = "\033[94...
p_bfgs.py
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
test_debugger.py
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
tpu_estimator.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...
_device_authentication.py
import _hardware import usb.core import usb.util import socket import time import sys import threading class DeviceAuthentication: def __init__(self, vid, pid): self.auth_url = "auth.projectsantacruz.azure.net" self.vid = vid self.pid = pid self.write_endpoint = 0x01 self.r...
test_docxmlrpc.py
from DocXMLRPCServer import DocXMLRPCServer import httplib from test import test_support import threading import time import unittest import xmlrpclib PORT = None def server(evt, numrequests): serv = DocXMLRPCServer(("localhost", 0), logRequests=False) try: global PORT PORT = serv.socket.gets...
__init__.py
import re from threading import Thread from time import sleep import pexpect from pyomxplayer.parser import OMXPlayerParser class OMXPlayer(object): _STATUS_REGEX = re.compile(r'M:\s*([\d.]+).*') _DONE_REGEX = re.compile(r'have a nice day.*') _DURATION_REGEX = re.compile(r'Duration: (.+?):(.+?):(.+?),')...
mouse_detection_node.py
################################################################################# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Modifications Copyright Martin Paradesi. All Rights Reserved. # # ...
run_ogusa.py
import os import sys import uuid from multiprocessing import Process import time OGUSA_PATH = os.environ.get("OGUSA_PATH", "../../ospc-dynamic/dynamic/Python") sys.path.append(OGUSA_PATH) import ogusa from ogusa.scripts import postprocess from ogusa.scripts.execute import runner def run_micro_macro(reform, user_pa...
test_ISLO.py
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "Thieu" at 16:11, 14/08/2021 % # ...
listen.py
import numpy as np from config.config import * from lib.machinelearning import feature_engineering, feature_engineering_raw, get_label_for_directory, get_highest_intensity_of_wav_file, get_recording_power import pyaudio import wave import time import scipy import scipy.io.wavfile import hashlib import os import operato...
server.py
#!/usr/bin/env python import sys import io import os import shutil from subprocess import Popen, PIPE from string import Template from struct import Struct from threading import Thread from time import sleep, time from http.server import HTTPServer, BaseHTTPRequestHandler from wsgiref.simple_server import make_server ...
utils.py
# Copyright 2015, Yahoo Inc. # Licensed under the terms of the Apache License, Version 2.0. See the LICENSE file associated with the project for terms. import numpy as np import multiprocessing from itertools import chain def iterate_splits(x, splits): """ A helper to iterate subvectors. :param ndarray x...
extensions.py
from time import sleep as slp from threading import Thread # from concurrent.futures import ThreadPoolExecutor from contextlib import suppress from unicodedata import normalize from string import punctuation from .local_amino import objects from .Bot import Bot class TimeOut: users_dict = {} def time_user(s...
test_service.py
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
client.py
#!/usr/bin/python import socket import threading import time import hashlib import local_network_attack import attack_list import DDOSAttack #confugure cnc_ip = "your cnc ip" cnc_port = 8080 #your cnc ip port, default is 8080 executable = "executable to infect with" ##################################################...
newfile.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # python 3.3.2+ Hammer Dos Script v.1 # by Can Yalçın # only for legal purpose from queue import Queue from optparse import OptionParser import time,sys,socket,threading,logging,urllib.request,random def user_agent(): global uagent uagent=[] uagent.append("Mozilla/5.0 (...
run-tests.py
#!/usr/bin/env python import argparse import collections import errno import glob import imp import os import posixpath import re import shlex import SimpleHTTPServer import socket import SocketServer import ssl import string import cStringIO as StringIO import subprocess import sys import threading import time import...
sserver.py
import socket import threading import socketserver import datetime import sys import errno global_lock = threading.Lock() filename = "registro_clientes.txt" class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): def handle(self): self.obtiene_y_registra_datos() def obtiene_y_registra_datos(...
httpd.py
import hashlib import os import threading try: from http.server import HTTPServer, SimpleHTTPRequestHandler except ImportError: from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler class ETagHandler(SimpleHTTPRequestHandler): def end_headers(self): file ...
train_develop_memory_leak.py
""" End to end training of my neural network model. The training routine has three key phases - Evaluation through MCTS - Data generation through MCTS - Neural network training """ import numpy as np from collections import defaultdict, deque, Counter, namedtuple import itertools import warnings import os, psutil # u...
turret-server.py
# # Copyright 2019 University of Technology, Sydney # # 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,...
test_index.py
""" For testing index operations, including `create_index`, `describe_index` and `drop_index` interfaces """ import logging import pytest import time import pdb import threading from multiprocessing import Pool, Process import numpy import sklearn.preprocessing from milvus import IndexType, MetricType from utils imp...
streamingClient.py
import threading import cv2 import pickle import struct import numpy as np import socket from PIL import ImageGrab class StreamingClient: """ Abstract class for the generic streaming client. Attributes ---------- Private: __host : str host address to connect to __port :...
test_fx.py
# Owner(s): ["oncall: fx"] import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest from math import sqrt from torch.multiprocessin...
websocket_client.py
import json import sys import traceback from datetime import datetime from types import coroutine from threading import Thread from asyncio import ( get_event_loop, set_event_loop, run_coroutine_threadsafe, AbstractEventLoop ) from aiohttp import ClientSession, ClientWebSocketResponse class Websocket...
part2.py
#!/usr/bin/env python3 import sys from program import Program from game import Game import threading import os from time import sleep SLEEP_DURATION = 0.01 def play(game): while True: game.update_state() os.system("clear") game.display() if not game.is_running(): bre...
optimize.py
import argparse import importlib.util import os.path import configparser import optuna from threading import Thread from train.instantiate import * from train.train import train from multiprocessing import Process from train.metrics import Accuracy from dataset.mnist import get_mnist import torch 1/0 parser = argpars...
analysis.py
import math import os import sys import time from multiprocessing import Queue, Process, freeze_support from predictor import Predictor, SingleSimPredictor """ Class responsible for simulation start over list of input files. """ class Analysis: """ args - collection of input arguments by argparse """ ...
server.py
import math import os import queue import sys import threading import time import uuid from collections import namedtuple from concurrent.futures import ThreadPoolExecutor import grpc from dagster import check, seven from dagster.core.code_pointer import CodePointer from dagster.core.definitions.reconstructable import...
parameters.py
"""Thread-safe global parameters""" from .cache import clear_cache from contextlib import contextmanager from threading import local class _global_parameters(local): """ Thread-local global parameters. Explanation =========== This class generates thread-local container for SymPy's global paramet...
hongmeng.py
# coding=utf-8 """ 每天定时给多个女友发给微信暖心话 核心代码。 """ import os import time import threading from apscheduler.schedulers.blocking import BlockingScheduler import itchat from itchat.content import TEXT from main.common import ( get_yaml ) from main.utils import ( get_bot_info, get_weather_info, get_dictum_info,...
mail.py
#!/usr/bin/env python # -*- coding=UTF-8 -*- # ************************************************************************* # Copyright © 2015 JiangLin. All rights reserved. # File Name: email.py # Author:JiangLin # Mail:xiyang0807@gmail.com # Created Time: 2015-11-27 21:59:02 # *********************************...
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 ...
server.py
# [PROGRAM] # # Selftos Server by therenaydin. # Windows 10 ve Linux ile test edildi. Diğer windows sürümleri veya işletim sistemleri ile düzgün çalışmayabilir! # Gerekli kütüphaneleri pip ile indirmeniz gerekmektedir. Yoksa program başlamaz. # SSH sunucusunda screen komutu ile çalıştırmanızı öneririz. Aksi taktirde...
test_hand_tracking.py
import threading import grpc from proto.mediapipe.framework.formats import landmark_pb2 from proto.qoin.proto import hand_tracking_pb2_grpc, hand_tracking_pb2 from tests import ServerTestCase class TestHandTracking(ServerTestCase): def test_bypass(self): stub = hand_tracking_pb2_grpc.HandTrackingStub(se...
UdpService.py
from __future__ import annotations from logging import getLogger from math import inf from socket import AF_INET, SOCK_DGRAM from threading import Thread from typing import Optional, Tuple from ..clock import IClock from ..constants import buffer_size from ..log.util import log_method_call from ..receive import IReceiv...
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...