source
stringlengths
3
86
python
stringlengths
75
1.04M
speedtest_cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2012-2015 Matt Martz # 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.or...
segmentation.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################### # Copyright (C) 2022, Chen Jianqu, Shanghai University # # This file is part of is_slam. # # Licensed under the MIT License; # you may not use this file except in compliance with the License. #######################...
Driver.py
#!/usr/bin/env python # Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
run_necleus_decomposition.py
import socket from exec_utilities import time_out_util from config import * from exec_utilities.exec_utils import * from multiprocessing import Process def run_exp(env_tag=knl_tag, with_c_group=True, data_path_tag=necleus_decomp_exec_path_tag): hostname = socket.gethostname() with open('config.json') as ifs...
GUI.py
import Tkinter as tk import tkFileDialog import Tkconstants from matplotlib import pyplot as plt import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import gc import plotGBTMap as gPlot import sys import matplotlib.animation as manimation import Queue import threading import time def fin...
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 from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.co...
MCHandle.py
from tkinter import * from tkinter import messagebox from host.BaseComm import BaseComm import threading from keras.models import load_model import time from host.BaseCtrl import BaseCtrl as ctrl from host.codemap import VirtualKeyCode from host.ui_logger import UiLogger import numpy as np from PIL import ImageTk, Imag...
testing.py
############################################################################# # # Copyright (c) 2004-2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS...
mySerial.py
import serial import time import threading from myUtil import serialBaud, serialPort from myUtil import MHz, kHz, minUkw, maxUkw, minKw, maxKw, minMw, maxMw, minLw, maxLw from myUtil import minCap, maxCap from myUtil import capToLw, capToMw, capToKw, capToUkw from myLog import log, elog, slog import myRadios import myN...
web.py
#!/usr/bin/env python import re import worker import logging import config as CFG import sqlite3 as sql import multiprocessing from flask import Flask, render_template, request app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def home(): if request.method == 'POST': username = request.form[...
gen_dataset.py
import re import os import argparse import queue import subprocess import clang.cindex as cind import multiprocessing as mp from cxxfilt import demangle, InvalidName from random import sample from itertools import product from tempfile import TemporaryDirectory from threading import Thread def prepare_cpp(f_txt_path,...
parallel.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except jin 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...
trainer.py
# Lint as: python3 # 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 ...
cnn_util.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...
send_request.py
import requests from threading import Thread with open('image.jpeg', 'rb') as f: FILE = f.read() # send request to http://127.0.0.1:8000 def send_request(host, port): for _ in range(100): r = requests.post(f"http://{host}:{port}", data={'file': FILE}) print(f"Receive response: '{r.text}' fro...
process.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tempfile import subprocess import tensorflow as tf import numpy as np import tfimage as im import threading import time import multipro...
getchu_grab_info.py
''' getchu 角色图爬虫 数据集布局: datset/ company.html dataset/id2name.json dataset/list.html dataset/company_id/ dataset/company_id/id2name.json dataset/company_id/product_id/ dataset/company_id/product_id/角色主图.jpg dataset/company_id/product_id/角色全身图.jpg dataset/company_id/product_id/data.json dataset/company_id/product_id/s...
circle_detection_with_websocket_server.py
import cv2 import numpy as np import threading import json from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket server = None clients = [] class SimpleWSServer(WebSocket): def handleConnected(self): clients.append(self) def handleClose(self): clients.remove(self) def run_ser...
Broto_force_protcol.py
from colored import fg, bg, attr import colored import socket as sock from Modules import intro import ftplib from threading import Thread import queue import logging import paramiko logging.disable(logging.CRITICAL) class Brute_Force: global q q = queue.Queue() def __init__(self): ...
wrappers.py
# Copyright 2017 The TensorFlow Agents 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 ag...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import platform import signal import io import os import errno import tempfile import time import selectors import sysconfig import select import shutil import threading import gc import textwrap try: import ctypes exce...
main.py
__all__ = ( 'Manifolder', ) import numpy as np from numpy.linalg import inv from numpy.linalg import pinv from sklearn.cluster import KMeans from manifolder import helper as mh try: from multiprocessing import Pool, TimeoutError, Lock#, Process, Manager from manifolder.parallel import workers enabl...
mdns_advertiser.py
#!/usr/bin/env python import logging import socket import time import threading import netifaces as ni from zeroconf import ServiceInfo, Zeroconf logger = logging.getLogger(__name__) class MDNSAdvertiser(object): def __init__(self, type_, name, port, properties, server, interface): self.type = type_ ...
__main__.py
import argparse import asyncio import os import signal import sys import threading import websockets from websockets.exceptions import format_close def win_enable_vt100(): """ Enable VT-100 for console output on Windows. See also https://bugs.python.org/issue29059. """ import ctypes STD_OU...
player.py
# # MythBox for XBMC - http://mythbox.googlecode.com # Copyright (C) 2011 analogue@yahoo.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at yo...
server.py
"""RPC server implementation. Note ---- Server is TCP based with the following protocol: - Initial handshake to the peer - [RPC_MAGIC, keysize(int32), key-bytes] - The key is in format - {server|client}:device-type[:random-key] [-timeout=timeout] """ from __future__ import absolute_import import os import ctypes...
skeleton.py
import threading from copy import copy from helpers import setup_logger logger = setup_logger(__name__, "warning") class InputSkeleton(object): """Base class for input devices. Expectations from children: * ``self.default_mapping`` variable to be set unless you're always going to pass mapping as argument...
cli.py
# -*- coding: utf-8 -*- import argparse import glob import logging import multiprocessing import os import shutil import time import psutil from daemon import DaemonContext from lockfile.pidlockfile import PIDLockFile from atm.api import create_app from atm.config import AWSConfig, DatasetConfig, LogConfig, RunConfi...
snapchat_demo.py
from tkinter import * from PIL import Image from PIL import ImageTk import cv2 import threading import os import time from threading import Thread from os import listdir from os.path import isfile, join import dlib from imutils import face_utils, rotate_bound import math # body part IDs for retrieving face landmark ...
app.py
import cv2, json, os import requests import numpy as np import configparser from threading import Thread import tensorflow as tf from flask import Flask, jsonify, request, render_template, redirect, url_for, send_from_directory from keras.layers import Input from keras.models import Sequential, Model, load_model from ...
ca_util.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. Tools for creating a CA cert and signed server certs. Divined from http://svn.osafoundation.org/m2crypto/trunk/tests/test_x509.py The mk_temporary_xxx calls return a NamedTemporaryFile with certs. Usage ; ...
process.py
# -*- coding: utf-8 -*- # Copyright (c) 2014-2019 Dontnod Entertainment # 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,...
test_linsolve.py
from __future__ import division, print_function, absolute_import import sys import threading import numpy as np from numpy import array, finfo, arange, eye, all, unique, ones, dot import numpy.random as random from numpy.testing import ( assert_array_almost_equal, assert_almost_equal, assert_equal, as...
client.py
import logging try: import queue except ImportError: # pragma: no cover import Queue as queue import signal import threading import time import six from six.moves import urllib try: import requests except ImportError: # pragma: no cover requests = None try: import websocket except ImportError: #...
ccl_ContigFilterServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
client.py
import socket import threading import platform import os from better_profanity import profanity import colorgb from time import sleep class Client: """A class that implements the server side. ----------- Parameters : - username: `str` | set your username to connect to server. - username_color: `str...
process.py
import logging import multiprocessing import multiprocessing.managers import os import socket import stat import subprocess import time from queue import Queue import numpy from .util import substitute_file, create_scratch_directory, CalcItJobCreateError # delays in seconds to different processes MANAGER_SHUTDOWN_DE...
init.py
import multiprocessing import threading import sys from time import sleep import os # Some import "magic" to import from other directories; (see issue #1) this_dir = os.path.dirname(os.path.realpath(__file__)) os.chdir(this_dir) sys.path.insert(0, '../server/') sys.path.insert(0, '../client') # TODO: Directory restru...
test_libsosplugin.py
from __future__ import print_function import unittest import argparse import re import tempfile import subprocess import threading import os import sys import inspect lldb = '' clrdir = '' workdir = '' corerun = '' sosplugin = '' assembly = '' fail_flag = '' fail_flag_lldb = '' summary_file = '' timeout = 0 regex = ''...
preprocessing.py
import re import os from urllib.parse import urlparse import dns.resolver import dns.rdtypes.IN.A from IPy import IP from itertools import chain from concurrent.futures import ThreadPoolExecutor from redisqueue.scheduler import DupeFilterScheduler import importlib import six import time from redisqueue import connectio...
native.py
#!/usr/bin/python3 # Disclaimer! # This code is not an optimal HTTP reverse shell! # It is created to introduce as many aspects of 'covertutils' as possible. # There are muuuuuch better ways to implement a reverse HTTP shell using this package, # using many Python helpers like SimpleHTTPServer. # In this file the ...
app.py
######################## # made by ResupinePuma # for bf4 community ######################## import json, requests, re, random import socket from threading import Thread from bf_anticrasher.frostbite_rcon_utils import * from bf_anticrasher.config import * import datetime class RCon(): def __init__(self, address...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_axe.wallet import Wallet from electrum_axe.storage import WalletStorage from electrum_axe.util import UserCancelled, InvalidPassword from electrum_axe.base_wizard im...
task_queue.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 """TaskQueue.""" import queue import threading from typing import Callable, Optional from .loghandler import _logger class TaskQueue: """A TaskQueue class. Uses a first-in, first-out queue of tasks executed on...
scheduler_job.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...
__init__.py
import json import os import copy import threading import time import pkg_resources from sqlalchemy.exc import IntegrityError # anchore modules import anchore_engine.clients.anchoreio import anchore_engine.common.helpers import anchore_engine.common.images from anchore_engine.clients.services import internal_client_f...
seizure-boost-0-6-lb.py
# coding: utf-8 __author__ = 'ZFTurbo: https://kaggle.com/zfturbo' import datetime import pandas as pd import numpy as np import xgboost as xgb from sklearn.cross_validation import KFold from sklearn.metrics import roc_auc_score from scipy.io import loadmat from operator import itemgetter import random import os impor...
remote_laser_manager.py
# =============================================================================== # Copyright 2019 ross # # 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...
xcvrd.py
#!/usr/bin/env python2 """ xcvrd Transceiver information update daemon for SONiC """ try: import ast import json import multiprocessing import os import signal import sys import threading import time from enum import Enum from sonic_py_common import daemon_base, device...
test_athenad.py
#!/usr/bin/env python3 import json import os import requests import shutil import tempfile import time import threading import queue import unittest from datetime import datetime, timedelta from multiprocessing import Process from pathlib import Path from unittest import mock from websocket import ABNF from websocket....
addTwoTimes.py
import threading import time def add(r): res = 0 for i in r: res += i tid = threading.current_thread().name print("Result in {} = {}".format(tid, res)) ################################################# # Sequential Processing: ################################################# t = time.time() result = 0 ...
multicast.py
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Pelix remote services: Multicast discovery and event notification A discovery packet contains the access to the dispatcher servlet, which can be used to get the end points descriptions. An event notification packet contain an end point UID, a kind of event and ...
test_server.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import threading import time import pytest import os from ssdpy import SSDPServer def test_server_ipv4(): server = SSDPServer("test-server", proto="ipv4") server.sock.settimeout(5) server_thread = th...
Entity_Product_Clean cluster tables & Allocation.py
### This python script is used to perform the keyword search in several steps, allocate the remaining rows to the specified domains & perform a post-processing task based on manually selected similarity scores. ### import pandas as pd import os import progressbar from urllib.request import urlopen, Request from bs4 im...
test_ftp.py
"""Unit tests for cutty.repositories.adapters.fetchers.ftp.""" import os from collections.abc import Iterator from pathlib import Path from threading import Event from threading import Thread import pytest from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler from pyftpdlib.server...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import http.client import logging import os import random import re import shlex import shutil import signal import string import subprocess import sys import tempfile import threading import time from urllib.parse import urlparse import nose.config import nose.co...
pzip.py
#!/usr/bin/python # -*- coding:utf-8 -*- import argparse from zipfile import ZipFile from multiprocessing import Process, Value, Semaphore, Array from ctypes import c_char_p import signal import time import os import sys import datetime import struct totalFiles = Value('i', 0) totalFilesSem = Semaphore(1) errorChecke...
execution_context.py
import abc import threading import six @six.add_metaclass(abc.ABCMeta) class ExecutionContext(object): """Base abstract execution context class.""" @abc.abstractmethod def run(self, func, *args, **kwargs): pass class GeventExecutionContext(ExecutionContext): """Execution context that run b...
test_query.py
import time from multiprocessing import Process from unittest import TestCase import pytest from gdc_client.parcel.const import HTTP_CHUNK_SIZE import mock_server from conftest import uuids from gdc_client.query.index import GDCIndexClient from gdc_client.query.versions import _chunk_list, get_latest_versions # defa...
day9.py
#https://adventofcode.com/2021/day/1 import copy from bisect import bisect_left import re, os, sys from itertools import chain import math from typing import DefaultDict, final import time from collections import Counter, defaultdict from threading import Thread, Lock input2="""989765678986546789569876546989998867213...
tests.py
import asyncio import threading import pytest from .checker import DNSBLChecker, DNSBLIpChecker, DNSBLDomainChecker from .providers import Provider # IP TESTS def test_checker(): checker = DNSBLIpChecker() res = checker.check('68.128.212.240') assert res.blacklisted assert res.categories assert re...
workspace.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
__init__.py
#!/usr/bin/env python # Implement cwl-runner interface for submitting and running work on Arvados, using # either the Crunch jobs API or Crunch containers API. import argparse import logging import os import sys import threading import hashlib import copy import json from functools import partial import pkg_resources...
proxy_usage.py
import socket import socks socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) socket.socket = socks.socksocket # from tornado import ioloop, httpclient from urllib.request import Request, urlopen # req = Request('http://127.0.0.1:8000', # headers={ # 'User-Agent': 'Mo...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform import functools impor...
test_host_connection_pool.py
# Copyright 2013-2015 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 writi...
packet_filter_tcp_udp_icmp.py
import socket,sys,threading,time from struct import * s1=socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_TCP) s2=socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_UDP) s3=socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_ICMP) count=0 tcp=0 icmp=0 udp=0 def printvalues(): global ...
train_extractive.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch import distributed from models import data_loader, model_builder from models.data_loader import load_dataset from models.model_builder im...
ImageNodeTest.py
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
batch_process.py
from typing import List, Dict, Union, Callable from math import ceil from threading import Thread from multiprocessing import Manager from joblib import Parallel, delayed from .progress_bar import progress_bar from .task_wrapper import task_wrapper def batch_process( items: list, function: Callable, n_...
model.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import threading import random import tensorflow as tf import torch import torchvision as tv import numpy as np import skeleton from architectures.resnet import ResNet9, ResNet18 from skeleton.projects import LogicModel, get_logger from skeleton...
tree_height.py
# python3 import sys import threading from collections import deque class Node: def __init__(self, value): self.val = value self.childs = [] def addChild(self, child): self.childs.append(child) def cal(arr, i): if len(arr[i].childs) == 0: return 1 val = -1 for j i...
application.py
''' Created on Jul 24, 2014 @author: gigemjt ''' import time from src.connection import server import BaseHTTPServer from src.utilities import system import webbrowser import threading HOST_NAME = 'localhost' # !!!REMEMBER TO CHANGE THIS FOR REMOTE CONNECTION!!! PORT_NUMBER = 9000 # Maybe set this to 9000. CONST_R...
LpmsME.py
import time import serial import threading import struct import sys from datetime import datetime, timedelta from LpmsConfig import * from lputils import * from LpmsConfigurationSettings import LpmsConfigurationSettings #TODO: # check serial port opened before executing commands # add wait for ack routine class LpmsM...
smtio.py
# # yosys -- Yosys Open SYnthesis Suite # # Copyright (C) 2012 Clifford Wolf <clifford@clifford.at> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. #...
plex_missing_metadata_refresher.py
#!/usr/bin/env python3 # This needs a specific fork+branch of plexapi till it's merged upstream: # pip3 install --force -U --user # git+git://github.com/darthShadow/python-plexapi@temp-guids-split import time import logging import multiprocessing import plexapi import plexapi.server import plexapi.exceptions BATC...
supreme_app.py
#!/usr/bin/python3 # Zachary Weeden 2018 import sys import threading from PyQt4 import QtGui from supreme_3 import SupremeProduct class SupremeWidget(QtGui.QWidget): def __init__(self, user_config_dict): """ Constructor for GUI widget """ super(SupremeWidget, self).__init__() ...
test.py
import json import os.path as p import random import subprocess import threading import logging import time from random import randrange import math import redis import pytest from google.protobuf.internal.encoder import _VarintBytes from helpers.client import QueryRuntimeException from helpers.cluster import ClickHou...
Node.py
import json import socket import time from hashlib import sha1 import random import threading from queue import Queue from copy import copy # project files from src import utils from src.utils import log from src.Finger import Finger from src.rpc_handlers import REQUEST_MAP, STATUS_CONFLICT from src.Storage import Stor...
help_utils.py
import threading import time from queue import Queue INTEGRATION_TEST_ACCOUNT_ID = "519630429520" MY_PROFILING_GROUP_NAME_FOR_INTEG_TESTS = "MyProfilingGroupForIntegrationTests" DUMMY_TEST_PROFILING_GROUP_NAME = "DummyNameThatWillNotBeUsed" FILE_PREFIX = "pytest-CodeGuruPythonAgent" class HelperThreadRunner: de...
lifx-poly.py
#!/usr/bin/env python3 ##!/home/e42/dev/py3_envs/udi-lifx-poly-venv/bin/python """ LiFX NodeServer for UDI Polyglot v2 by Einstein.42 (James Milne) milne.james@gmail.com """ import polyinterface import time import sys import lifxlan from copy import deepcopy import json import yaml from threading import Thread from pa...
test_c10d_nccl.py
import copy import math import os import random import signal import sys import tempfile import threading import time from contextlib import contextmanager from datetime import timedelta from itertools import product from unittest import mock import torch import torch.distributed as c10d if not c10d.is_available(): ...
utils.py
import asyncio import socket import time from contextlib import closing from functools import wraps from importlib import import_module from pathlib import Path from threading import Event, Thread from typing import Any, Callable, List, Optional from typing_extensions import ParamSpec import idom from .proto import ...
connection.py
import logging import json import threading from six.moves.urllib import request from six import b from .utils import StringReprJSONEncoder logger = logging.getLogger(__name__) def send_notice(config, payload): request_object = request.Request(url="{}/v1/notices/".format(config.endpoint), ...
僵尸进程处理.py
""" 僵尸进程演示 """ from multiprocessing import Process from time import sleep import os from signal import * signal(SIGCHLD, SIG_IGN) # 断绝父子关系 def fun(): print("开始第一个任务", os.getpid()) sleep(1) print("任务结束了") # 每一次start之前都会清理之前已经出现的僵尸 p1 = Process(target=fun) p1.start() sleep(3) p2 = Process(target=fun) p2...
managed_window.py
from pyglet.window import Window from pyglet.clock import Clock from threading import Thread, Lock gl_lock = Lock() class ManagedWindow(Window): """ A pyglet window with an event loop which executes automatically in a separate thread. Behavior is added by creating a subclass which overrides setup, u...
app.py
import numpy as np import cv2 from PIL import Image, ImageTk import keyboard import pytesseract import re import pyWinhook import threading from time import sleep, perf_counter import math import tkinter as tk import mss digit_regex = r'\d+' offset = 0.05 # km/h to go above (or below if negative) the speed limit st...
client.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import uuid import websocket import time import threading from parlai.core.params import ParlaiParser def ...
server.py
import json from robot import config, utils, logging, constants, Updater import base64 import requests import tornado.web import tornado.ioloop from tornado import gen import tornado.httpserver import tornado.options import hashlib import threading import asyncio import subprocess import os import time import yaml impo...
default_models.py
import urllib.request from pathlib import Path from threading import Thread from tqdm import tqdm default_models = { "encoder": ("https://drive.google.com/uc?export=download&id=1q8mEGwCkFy23KZsinbuvdKAQLqNKbYf1", 17090379), # Too large to put on google drive with a direct link... "synthesizer": ("https:/...
synchronized_lights.py
#!/usr/bin/env python # # Licensed under the BSD license. See full license in LICENSE file. # http://www.lightshowpi.org/ # # Author: Todd Giles (todd@lightshowpi.org) # Author: Chris Usey (chris.usey@gmail.com) # Author: Ryan Jennings # Author: Paul Dunn (dunnsept@gmail.com) # Author: Tom Enos (tomslick.ca@gmail.com)...
server.py
import socket import threading HEADER = 64 PORT = 5050 SERVER = socket.gethostbyname(socket.gethostname()) ADDR = (SERVER, PORT) FORMAT = 'utf-8' DISCONECT_MESSAGE = "!DISCONNECT" server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(ADDR) def handle_cli...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through 3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use ...
gui.py
from Tkinter import * import ttk import tkMessageBox import sys import main import os import speech_recognition as sr from PIL import ImageTk, Image import recording import time import threading class Application(Frame): def create_widgets(self): self.image = Image.open('pictures/Backgrounds_bird.jpg') self.img_...
rhcdebug.py
#!/usr/bin/env python3 # Copyright (c) 2019, The Personal Robotics Lab, The MuSHR Team, The Contributors of MuSHR # License: BSD 3-Clause. See LICENSE.md file in root directory. import threading import matplotlib.cm as cm import matplotlib.colors as mplcolors import rospy import torch from geometry_msgs.msg import P...
util.py
# # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl...
dummygatekeeper.py
# Copyright (c) 2015 SONATA-NFV and Paderborn University # 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 re...
test_start_vms_simultaneously.py
''' Test stop 4 vms, then start them simultaneously @author: Youyk ''' import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.operations.config_operations as con_ops import zstackwoodpecker.operations.vm_operations as vm_ops import zstackwoodpecker.operations.net_operations as net_op...
client.py
import pickle import time import socket import threading import tkinter import sys import os def cls(): os.system('cls' if os.name=='nt' else 'clear') class Message: def __init__(self,author,content,date): self.author = author self.content = content self.date = date class...
_server_test.py
# -*- coding: utf-8 - # # Copyright (c) 2008 (c) Benoit Chesneau <benoitc@e-engura.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE...