source
stringlengths
3
86
python
stringlengths
75
1.04M
ux.py
import sys import logging import time from PyQt5 import QtCore, Qt, QtGui from PyQt5.QtCore import QThread from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QMainWindow from emoji import emojize from sugaroid.brain.constants import emotion_mapping as emotion from sugaroid.brain.ooo import Emotion from sugaro...
health_check_service.py
#!/usr/bin/env python # # Copyright 2007 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 o...
test_shjchanServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- 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, Inva...
GuiWindowDocks.py
""" Standard imports """ """ Author: Shameer Sathar Description: Provide Gui Interface. """ import numpy as np from multiprocessing import Process # Main GUI support import pyqtgraph as pg from pyqtgraph.Qt import QtGui from pyqtgraph.dockarea import * import cPickle as pickle # Locally-developed modules fro...
main.py
#!/usr/bin/env python3 import paho.mqtt.client as mqtt import json import time import os, sys import datetime as dt from influxdb_client import InfluxDBClient, Point from influxdb_client.client.write_api import SYNCHRONOUS from config.config import parse import logging import threading logging.basicConfig(format='%(a...
crossindex.py
import os import queue import time import sys import traceback from threading import Thread sys.path.extend(['/home/xty/pj/CrossIndex/crossindex']) import pandas as pd from common import util from crossindex_main import CrossIndex from crossindex_main import Query class IDEBenchDriver: def init(self, options, ...
greenie.py
""" Configuration and launch of greenie GUI """ from glob import glob import wx import threading import gui import subprocess import time from os import path # # REQUIRED configuration # # list of directories containing foreground photos photoDirs = ["/Users/someuser/Pictures/Eye-Fi"] # directory containing backgro...
env_wrappers.py
""" Modified from OpenAI Baselines code to work with multi-agent envs """ import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv, CloudpickleWrapper def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = env_fn_wrapper.x() while Tru...
_preprocess.py
from __future__ import division, unicode_literals, absolute_import from builtins import int, range, dict, map, zip import io import os import re import sys import queue # Future warning from cython in h5py import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import h5py from tqdm import tq...
actor.py
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2020 FABRIC Testbed # # 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 ...
execution_handler.py
import copy import math import time from collections import Counter from concurrent.futures.process import BrokenProcessPool from queue import Empty, Queue from threading import Lock, Thread from typing import Dict, List, Union import logger import psutil import qiskit.providers.ibmq.job.exceptions import qiskit.tools...
together.py
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University # ServerlessBench is licensed under the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1. # You may obtain a copy of Mulan PSL v1 at: # http://license.coscl.org.cn/M...
Keithley2450.py
from math import copysign from threading import Thread from time import sleep from typing import List, Tuple import pyvisa from IVTracerVlockin import BiasGenerator class Driver: """Keithley 2450 as bias generator.""" def __init__(self, address): self._rm = rm = pyvisa.ResourceManager() self...
trezor.py
from binascii import hexlify, unhexlify from collections import defaultdict import traceback import sys from electroncash.util import bfh, bh2u, versiontuple, UserCancelled from electroncash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub, TYPE_ADDRESS, TYPE...
test_runner.py
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into ind...
ECMWFDataServer.py
# # (C) Copyright 2012-2013 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergove...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
resource_api.py
from flask import Blueprint, request from flask_jwt_extended import jwt_required, get_jwt_identity from models.node_tags import NodeTags from models.scheduler import Scheduler from models.container_image_registry import RegistryCredential from models.user import User, Role from flask import current_app from utils.respo...
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, ...
thread_ex.py
import threading import time import sys def background(): while True: time.sleep(3) print ('disarm me by typing disarm') def other_function(): print ('You disarmed me! Dying now.') # now threading1 runs regardless of user input threading1 = threading.Thread(target=background) thr...
common_func.py
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function, unicode_literals, division, absolute_import import sys import time import binascii import struct import collections import logging import socket import functools import threading import traceback import warnings try: import selectors f...
untls.py
#!/usr/bin/env python3 import logging import argparse import socket, struct, random import ssl, threading, socks, ctypes from socksproxy import SocksProxy, ThreadingTCPServer, pipe_sockets, str2ipport, setprocname from tempfile import TemporaryFile from OpenSSL import crypto from contextlib import contextmanager from ...
cli.py
# -*- coding: utf-8 -*- import configparser import random import sys import time from pathlib import Path from threading import Thread from urllib.parse import urlparse import click from . import __codename__ from . import __version__ from .controllers import CastState from .controllers import setup_cast from .contro...
CustomRunner.py
import tensorflow as tf import time import threading import numpy as np from tqdm import tqdm import random # load data entirely into memory 🙁 name_list = list() print("Populating name_list") for i in tqdm(range(25000)): name_list.append("/home/david/Documents/gameFiles/CSV-19x19/data"+str(i)+".csv") filename_qu...
camera.py
from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread class Camera(object): def __init__(self, resolution=(512, 304), framerate=24): self.camera = PiCamera() self.camera.resolution = resolution self.camera.framerate = framerate self.rawCa...
hist.py
import collections.abc import copy import logging import threading import typing import warnings from os import cpu_count from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Mapping, NewType, Optional, Set, Tuple, Type, TypeVar, Union, ) impo...
states.py
from __future__ import print_function import threading import sys, time import numpy as np import scipy.stats from six.moves import range, queue from pyqtgraph import ptime, disconnect from acq4.util.future import Future from collections import deque from acq4.util.debug import printExc class PatchPipetteState(Future...
PolicyManager.py
import os import pika import json import time import logging as log from threading import Thread from db.Models import Policy class PolicyManager(): def __init__(self): self.reload_policies() self.needs_reloading = False def use_policy(self, data_collector_id): try: if s...
main.py
import json import socketserver import threading import time from http.server import BaseHTTPRequestHandler, HTTPServer from io import BytesIO from pathlib import Path import sys from socketserver import ThreadingMixIn from time import sleep import depthai as dai import numpy as np import cv2 from PIL import Image impo...
sshserver_p3.py
# -*- coding:utf-8 -*- # 模块仅支持python3 import socket,paramiko,random from binascii import hexlify from paramiko.py3compat import u, decodebytes # pip3 install tests utils from tests.utils import make_tests_data_path from gsiot.v3 import * from gsiot.v3.net.server import Server as gsServer # setup logging paramiko.util.l...
03-locking_restaurant.py
import time import sys from threading import Thread, Lock from kitchen import Kitchen, Grill, CuttingBoard, Pantry from burgers import Burger from utils import ( ingredients_list_from_recipe, prepare_ingerdient, flat_generator, select_ingredients, gather_ingredients, ) RECIPES = { "cheeseburge...
run.py
#!/usr/bin/env python3 import sys import argparse import multiprocessing import random from dataclasses import dataclass from threading import Thread, Lock from typing import List, Set, Optional import simanneal import myio lock = Lock() photos = [] vertical_photos = [] horizontal_photos = [] best = -1 def delta_f...
server.py
import asyncio import websockets import threading import queue import glob import json import time import sys import os SOCKETS = [] PORT = 8765 async def handle_conn(websocket, path): data = json.loads(await websocket.recv()) sys_info = data.copy() sys_info["id"] = len(SOCKETS) sys_info["alive"] = ...
qsatype.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import datetime, weakref from PyQt4 import QtCore, QtGui # Cargar toda la API de Qt para que sea visible. from PyQt4.QtGui import * from PyQt4.QtCore import * from pineboolib import qsaglobals from pineboolib import flcontrols from pineboolib...
ng.py
#!/usr/bin/env python # # Copyright 2004-2015, Martian Software, Inc. # Copyright 2017-Present Facebook, 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/license...
communication.py
""" The server communication module. Stores the server communication functionality for Wappsto as well as the sending and receiving threads. """ import os import socket import threading import time import queue import ssl import logging from . import message_data from . import receive_data from . import send_data fro...
main.py
# import required libraries from tkinter import ttk from pycricbuzz import Cricbuzz from win10toast import ToastNotifier from tkinter.messagebox import * from tkinter.filedialog import * import json import pytesseract import os from mutagen.mp3 import MP3 import threading from PIL import Image,ImageTk impor...
exsample.py
# -*- coding: utf-8 -*- from concurrent.futures import ThreadPoolExecutor, as_completed from io import BytesIO import os from pathlib import Path from threading import Thread from time import sleep #おまじない import urllib #URLエンコード用 import bs4 #HTMl解析 import requests #URlアクセス? import re #正規表現(URL抽出) import tkinter as tk #...
multitester.py
""" Certbot Integration Test Tool - Configures (canned) boulder server - Launches EC2 instances with a given list of AMIs for different distros - Copies certbot repo and puts it on the instances - Runs certbot tests (bash scripts) on all of these - Logs execution and success/fail for debugging Notes: - Some AWS ima...
resource_monitor.py
import logging import os import warnings from time import time from threading import Thread, Event import psutil from pathlib2 import Path from typing import Text from ..binding.frameworks.tensorflow_bind import IsTensorboardInit try: from .gpu import gpustat except ImportError: gpustat = None class Resourc...
test_traceback.py
import contextlib import gc import re import sys import threading import types from contextlib import ExitStack, contextmanager from functools import partial from typing import List, Callable, Any, cast import attr import pytest from .. import FrameInfo, Traceback, customize, register_get_target def remove_address_...
xresconv-cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import glob import io import locale import os import platform import re import shutil import string import sys import tempfile # ================================================================================== import threading import xml.etree.ElementTree as ET from mult...
receptor.py
import threading import time from socket import * import checksum_udp # Socket serverPort = 12000 serverSocket = socket(AF_INET, SOCK_DGRAM) serverSocket.bind(('', serverPort)) # Go-back-N delim = '_' expectedseqnum = 0 corrupted_packet = False lost_packet = False delayed_packet = False errors = True def spawn(): ...
helper.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import lzma import threading import asyncio import websockets from aiohttp import web class MockInsServer(): def __init__(self, port): self.loop = asyncio.new_event_loop() self.port = port self.thread = threading.Thread(target=se...
app.py
from PyQt5 import QtCore, QtGui, QtWidgets from multiprocessing import Pipe from threading import Thread import sys, random, math, json, time, requests, subprocess class laclef_window(QtWidgets.QMainWindow): clicked = QtCore.pyqtSignal() scanned = QtCore.pyqtSignal(int) def __init__(self): super(...
test_sync.py
# test_sync.py # # Different test scenarios designed to run under management of a kernel from collections import deque from curio import * import pytest import threading import time import asyncio # ---- Synchronization primitives class TestEvent: def test_event_get_wait(self, kernel): results = [] ...
test_run_tracker.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import http.server import json import threading from urllib.parse import parse_qs from pants.auth.cookies import Cookies from pants.goal.run_tracker import RunTracker from pants.testutil....
googlesearch.py
""" Created on May 5, 2017 @author: anthony """ import math import tempfile import urllib from collections import deque from threading import Thread from time import sleep from urllib.request import urlopen from urllib.request import urlretrieve import numpy as np import requests from PIL.PpmImagePlugin import PpmIma...
fault_tolerance_test.py
# Copyright 2020 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...
utils.py
# pylint: disable=redefined-outer-name from contextlib import contextmanager import logging import os import subprocess import sys import threading import time import urllib import docker import bentoml from bentoml.utils import cached_contextmanager logger = logging.getLogger("bentoml.tests") def wait_until_conta...
pc_miner.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Python PC Miner (v2.5.6) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2019-2021 ########################################## # Import libraries import sys from configparser import ...
process.py
import multiprocessing import os import signal import sys import time from pyramid.paster import get_appsettings from threading import Thread from .http import create_server from ..models import ( get_engine, get_session_factory, Camera, ) from .video import VideoStream class ExitException(Exception): ...
payment_server.py
"""This module implements the server side of payment channels.""" import os import time import codecs import threading import contextlib from two1.bitcoin.utils import pack_u32 from two1.bitcoin import Transaction, Hash, Signature, Script from two1.channels.statemachine import PaymentChannelRedeemScript from two1.chan...
server.py
import socket import threading import time header = 64 port = 5000 disconnect_msg = b'quit' SERVER = '10.0.0.3' Address = (SERVER, port) server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(Address) server.setblocking(True) def handle(con, adr): print(f"[New Connection] {adr} connected.") c...
robot_controller.py
''' This manages the active state of the robot ''' import sys import threading import time from ..wpilib import _wpilib from .sim_manager import SimManager class RobotController(object): mode_map = { SimManager.MODE_AUTONOMOUS: "Autonomous", SimManager.MODE_DISABLED: "Disabled", ...
gui.py
from pathlib import Path import tkinter as tk import tkinter.messagebox import tkinter.filedialog from tkinter.scrolledtext import ScrolledText import _tkinter import time import logging import threading import queue import tkinter.font as font from stitch_MAPS_annotations import Stitcher from sites_of_interest_parser...
trustedcoin.py
#!/usr/bin/env python3 # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including withou...
LogsDownloader.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Doron Lehmann, Incapsula, Inc. # Date: 2015 # Description: Logs Downloader Client # # ************************************************************************************ # Copyright (c) 2015, Incapsula, Inc. # All rights reserved. # # Redistributi...
Number_Detect.py
# -*- coding: utf-8 -*- # @Time : 2021/1/29 17:22 # @Author : BINGO # @School: 浙江大学 # @Campany: 竺星 # @FileName: Number_Detect.py import threading, queue, time from queue import Queue from threading import Thread, currentThread import os from CalibrateTransfer.img_operation import ScreenSHot_batch from CalibrateTra...
NmakeSubdirs.py
# @file NmakeSubdirs.py # This script support parallel build for nmake in windows environment. # It supports Python2.x and Python3.x both. # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # # # Import Modules # from __future__ import print_function...
crawler.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse import json import sys from io import open from threading import Thread from elasticsearch_dsl import connections from inscrawler import InsCrawler from inscrawler.elastic import get_unchecked_profiles, get_unchecked_targets from inscraw...
frontend.py
#!/usr/bin/python3 """ User Client """ import json import socketserver import sys import Pyro4 # TODO: work out what is throwing errors # TODO: get server polling code to change server status if there is an outage. class FrontEnd(object): def __init__(self): ns = Pyro4.locateNS() self.server_uri...
op_util.py
# Copyright 2017-2019 TensorHub, 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 writ...
bot.py
# coding: utf-8 import logging import schedule import time import threading import settings from telegram.ext import Updater, CommandHandler, CallbackQueryHandler from storage import connect_to_database from models import User from template_helper import render from keyboards import KeyboardBuilder from commands.questi...
requestform.py
from threading import Thread import requests from requests.auth import HTTPBasicAuth import time cSetReady = 0 chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' filtered = chars passwd = '' url = 'http://natas16.natas.labs.overthewire.org/index.php?needle=' usr = 'natas16' pwd = 'WaIHEacj63wnNI...
base.py
import argparse import base64 import copy import itertools import json import os import re import sys import threading import time import uuid import warnings from collections import OrderedDict from contextlib import ExitStack from typing import Optional, Union, Tuple, List, Set, Dict, overload, Type from .builder im...
Time_Network.py
import argparse import numpy as np import tensorflow as tf #from reader_frozen import plot_prediction, convert_time, read_data, read_mesh, read_soln import os import sys import time import multiprocessing import threading import csv # Import flags specifying dataset parameters from timer_flags import getFlags DATA_...
utils_for_tests.py
# Python imports import sys import calendar import socket import os import time import threading import datetime from wsgiref.handlers import format_date_time as format_as_rfc1123 PY_MAJOR_VERSION = sys.version_info[0] PY_MINOR_VERSION = sys.version_info[1] if PY_MAJOR_VERSION < 3: from BaseHTTPServer import Base...
main_detection.py
from tflite_runtime.interpreter import Interpreter from slacker import Slacker import picamera import numpy as np import cv2 import io import time import datetime import threading def wait_input(): global key_flag input() key_flag = False def set_interpreter(interpreter): interpreter.set_num_threads(4...
test_logserver.py
#from resc.resclog.logserver.server import start_server #from multiprocessing import Process #import time #import requests #import pytest #import asyncio # #_IP="http://localhost:55555" #class TestServer: # def setup_server(self): # self.process = Process(target=start_server,daemon=True) # self.process.start() # def ...
scraper3.py
import timeit import threading import requests from bs4 import BeautifulSoup from news.models import News # checking if that news link exists on database def checkIfExist(newsLink): numOfNews = News.objects.filter(newslink=newsLink).count() return numOfNews # Main news page to bring more news def mainNewsPa...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from multiprocessing import Process from typing import Dict from common.basedir import BASEDIR from common.spinner import Sp...
Server.py
''' Module for using jyserver standalone. This module uses the built-in http.server module. It serves as a framework for integration into other servers. Example ------------- ```python from jserver import Client, Server class App(Client): def __init__(self): self.html = """ <p id="time">TIME</p...
webpagetest.py
# Copyright 2017 Google Inc. All rights reserved. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Main entry point for interfacing with WebPageTest server""" from datetime import datetime import gzip import logging import multiprocessing import os import platf...
fn_api_runner.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 us...
error_handling.py
# Copyright 2018 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...
lavaPlatformer.py
from tkinter import * from tkinter import messagebox import tkinter.simpledialog as s import time, sys, random, os, sqlite3, json, threading, requests, shutil import shop, statistics, settings from soundplayer import SoundPlayer filept = os.path.abspath(os.listdir()[0]) class Game: def __init__(self, st=False, ktc=...
server_combined.py
#!/usr/bin/env python3 import cv2, imutils, socket, base64 from threading import Thread tcp_server_address = ("127.0.0.1", 10001) udp_server_address = ("127.0.0.1", 10002) tcp_buff_size = 1024 udp_buff_size = 65536 # max buffer size tcp_server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) udp_server_sock...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
endpoint_binder.py
import zmq import time import sys, json from random import randrange, randint import random import queue, threading, multiprocessing import binascii import gzip import pprint from .exchange import BinanceDriver from .endpoint import SocketEndppoint, PushPub class Feeder(threading.Thread): output = queue.Que...
Network.py
import argparse import socket import threading from time import sleep import random import RDT ## Provides an abstraction for the network layer class NetworkLayer: #configuration parameters prob_pkt_loss = 0 prob_byte_corr = .3 prob_pkt_reorder = 0 #class variables sock = None conn =...
go_tool.py
from __future__ import absolute_import, unicode_literals import argparse import codecs import copy import json import os import re import shutil import subprocess import sys import tarfile import tempfile import threading import six from functools import reduce import process_command_files as pcf import process_whole_...
Search.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import webbrowser from Da import ResZmz from Da import ResVhao from View import ResultView import urllib class Search : def __init__ (self, master) : self.master = master self.ResWindow = ResultView.GUI(self.master) def showResult (self, key) : s...
dip_switch_2bit.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 NXEZ.COM. # http://www.nxez.com # # Licensed under the GNU General Public 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.gnu.org/licen...
kafka_interface.py
import asyncio import threading from abc import ABC, abstractmethod from copy import copy class KafkaInterface(ABC): def __init__(self): self._loop = asyncio.get_event_loop() self._cancelled = False self._poll_thread = threading.Thread(target=self._poll_loop) self._is_connected = F...
default.py
import xbmc, xbmcaddon import json import time import re import requests #SERVER CUSTOM SCRIPT import socket import threading HEADER = 64 PORT = 5050 SERVER = "" #Host IP example 192.168.0.22 ADDR = (SERVER, PORT) FORMAT = 'utf-8' DISCONNECT_MESSAGE = "!DISCONNECT" server = socket.socket(socket.AF_INET, socket.SOC...
process_replay.py
#!/usr/bin/env python3 import os import sys import threading import importlib if "CI" in os.environ: tqdm = lambda x: x else: from tqdm import tqdm from cereal import car, log from selfdrive.car.car_helpers import get_car import selfdrive.manager as manager import cereal.messaging as messaging from common.params ...
store_at_provider.py
# # Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. # # Licensed under the Universal Permissive License v 1.0 as shown at # https://oss.oracle.com/licenses/upl/ # import unittest from requests import codes from socket import error from threading import Thread from time import sleep, time t...
test_fsm.py
"""Unit tests for fsm.py""" import datetime import logging import select import socket from struct import pack import sys import threading import time import pytest from pynetdicom import AE, build_context, evt, debug_logger from pynetdicom.association import Association from pynetdicom import fsm as FINITE_STATE fr...
p2p_stress.py
import testUtils import p2p_test_peers import random import time import copy import threading from core_symbol import CORE_SYMBOL class StressNetwork: speeds=[1,5,10,30,60,100,500] sec=10 maxthreads=100 trList=[] def maxIndex(self): return len(self.speeds) def randAcctName(self): ...
main.py
import atexit import operator import select import socket import sys import threading import Server_Functions server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def Connection_Management(): try: try: connection, port = server_socket.accept() received_...
OffSystem_v81.py
__date__ = '5/29/14' __author__ = 'ABREZNIC' import os, arcpy, xlwt, datetime, math, multiprocessing, shutil, smtplib, base64 # date now = datetime.datetime.now() curMonth = now.strftime("%m") curDay = now.strftime("%d") curYear = now.strftime("%Y") today = curYear + "_" + curMonth + "_" + curDay runday = now.strftim...
http_server.py
# This code is part of Qiskit. # # (C) Copyright IBM 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 derivative wo...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development 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 ...
test_multiprocessing.py
#!/usr/bin/env python # # Unit tests for the multiprocessing package # import unittest import Queue import time import sys import os import gc import signal import array import socket import random import logging import errno from test import test_support from StringIO import StringIO _multiprocessing = test_support....
download_manager_test.py
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets 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 appl...
server.py
import socket import threading import board_game as bg s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #serv = socket.gethostbyname(socket.gethostname()) serv = '0.0.0.0' port = 5959 addr = (serv, 5959) s.bind(addr) player_count = 1 gameboard = bg.Board() playerList = [0] actionDict = {"move n...
ProjE_softmax_noweight.py
import argparse import math import os.path import timeit from multiprocessing import JoinableQueue, Queue, Process import numpy as np import tensorflow as tf class ProjE: @property def n_entity(self): return self.__n_entity @property def n_train(self): return self.__train_triple.shap...
workbench.py
# -*- coding: utf-8 -*- import ast import collections import importlib import logging import os.path import pkgutil import platform import queue import re import socket import sys import tkinter as tk import tkinter.font as tk_font import traceback from threading import Thread from tkinter import messagebox, ttk from ...
ocg.py
#-------------------------------------------------------- #File Name: ocg.py #Purpose: App router for the Ozark Creek Gauges Web App #Author: Capstone Group 1 #Date: January 31, 2021 #Includes Templates from templated.co #-------------------------------------------------------- from flask import Flask, request, render_...