source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
import malddal import tkinter as tk from threading import Thread, Semaphore from tkinter import messagebox global version version = "v0.8.5" global directory directory = r'%systemdrive%\user\%username%\desktop' if __name__ == '__main__': flag = False mymalddal = malddal.malddal() flagSem = mymalddal.g...
test_logging.py
# Copyright 2001-2021 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.general import xyxy2xywh, xywh2xyxy, torch_di...
opening.py
#!/usr/bin/python import paho.mqtt.client as paho import time import pyupm_grove as grove from threading import Thread button = grove.GroveButton(8) def functionDataSensor(): return button.value() def functionDataSensorMqttPublish(): mqttclient = paho.Client() mqttclient.connect("iot.eclipse.org", 1883,...
voicemail.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # messenger.py # # Copyright 2018 <pi@rhombus1> # # 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 ...
bigiq_regkey_pool_cleaner_neutron_port.py
#!/usr/bin/env python # coding=utf-8 # pylint: disable=broad-except,unused-argument,line-too-long, unused-variable # Copyright (c) 2016-2018, F5 Networks, 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 ...
tumblr.py
#!/usr/bin/env python2 # vim: set fileencoding=utf8 import os import sys import re import json import requests import argparse import random import multiprocessing import time api_key = 'fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4' ############################################################ # wget exit statu...
tunnel.py
"""Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections. Authors ------- * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 IPython Development Team, Min Ragan-Kelley # # Redistributed from IPython under the terms ...
core.py
# -*- coding: utf-8 -*- import logging import time from requests.exceptions import ConnectionError from threading import Thread import pymongo import requests import json import sys import socketIO_client from . import masks from . import customized_methods from six import iteritems from six import string_types as...
cloud_verifier_tornado.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import signal import traceback import sys import functools import asyncio import os from multiprocessing import Process from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.orm.exc import NoResul...
__init__.py
import itertools import platform import threading import time from xml.etree import ElementTree import serial from emu_power import response_entities if platform.system() == 'Darwin': _DEFAULT_DEVICE = '/dev/tty.usbmodem11' elif platform.system() == 'Linux': _DEFAULT_DEVICE = '/dev/ttyACM0' else: _DEFAU...
wsdump.py
#!/Users/nimblesixthousand/Desktop/apps/raiden/raiden_project/bin/python import argparse import code import sys import threading import time import ssl import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = g...
test_autograd.py
import gc import sys import io import math import random import tempfile import time import threading import unittest import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, partial import torch fro...
conversion_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
gate_tagging.py
import threading import requests import time import json import pandas as pd import time import unidecode spanish_path = "./datasets/es.json" english_path = "./datasets/all_data_en.json" file = open(english_path, "r") data = [] for index, line in enumerate(file): data.append(json.loads(line)) if index == 1000...
plugin.py
import datetime import json import re import sys import threading import time import traceback import urllib.request, urllib.parse, urllib.error hasWebsockets=False try: import websocket hasWebsockets=True except: pass from avnav_api import AVNApi class Config(object): def __init__(self,api): self.port = ...
k-scale.py
# Lapse-Pi timelapse controller for Raspberry Pi # This must run as root (sudo python lapse.py) due to framebuffer, etc. # # http://www.adafruit.com/products/998 (Raspberry Pi Model B) # http://www.adafruit.com/products/1601 (PiTFT Mini Kit) # # Prerequisite tutorials: aside from the basic Raspbian setup and PiTFT set...
test_logutil.py
import errno import logging import os import subprocess32 import threading import unittest from pykit import logutil logger = logging.getLogger(__name__) def subproc(script, cwd=None): subproc = subprocess32.Popen(['sh'], close_fds=True, cwd=cwd, ...
test_acceptance.py
import unittest import threading import queue import tempfile import pathlib from todo.app import TODOApp from todo.db import BasicDB class TestTODOAcceptance(unittest.TestCase): def setUp(self): self.inputs = queue.Queue() self.outputs = queue.Queue() self.fake_output = lambda txt: self...
blast_ex1.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from threading import Thread, Event import time # import threading import psutil import datetime import os import subprocess # sizes = [0.015625, 0.03125, 0.0625, 0.125, 0.25, 0.5] size = 0.015625 # command = "blastn -db nt -evalue 1e-05 -query arquivo.fasta -out arqui...
multipleprocess.py
# Copyright 2019 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, ...
test_tracer.py
# -*- coding: utf-8 -*- """ tests for Tracer and utilities. """ import contextlib import multiprocessing import os from os import getpid import threading from unittest.case import SkipTest import mock import pytest import six import ddtrace from ddtrace.constants import ENV_KEY from ddtrace.constants import HOSTNAME_...
command.py
import signal import subprocess import threading SIGNALS = dict((k, v) for v, k in reversed(sorted(signal.__dict__.items())) if v.startswith('SIG') and not v.startswith('SIG_')) class Command: DEFAULT_ENV = {} DEFAULT_TIMEOUT = 600. DEFAULT_STDIN = subprocess.PIPE DEFAULT_STDOUT =...
gil_demo.py
""" @file: gil_demo.py @author: magician @date: 2019/7/23 """ import dis import sys import threading from threading import Thread from python_core.decorator_demo import log_execution_time def count_down(n): """ count_down :param n: :return: """ while n > 0: n -= 1 @log_execution_tim...
demo.py
# -*- coding: utf-8 -*- # Copyright 2018 The Blueoil 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 # # Unles...
pocas.py
#포스코 청년 AI Bigdata 아카데미 A반 4조 #온라인 시험 부정 행위 방지 시스템 ############POSCAS############ #https://github.com/JoyLeeA # 자세한 설명 수록 #### FOR FACE IDENTIFY #### import numpy as np from keras.models import load_model from mtcnn.mtcnn import MTCNN from PIL import Image from sklearn.svm import SVC from faceidentify.SVMclassifier ...
tui.py
# MIT License # Copyright (C) Michael Tao-Yi Lee (taoyil AT UCI EDU) from multiprocessing import Process, Pipe def tui_main(addr=None, ch1=True, ch2=True): from uci_cbp_demo.ui.terminal import TerminalManager from uci_cbp_demo.backend import SensorBoard pipe_1, pipe_2 = Pipe() tm = TerminalManager(...
ansible_handler_processor.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 ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
arduino_uploader.py
#!/usr/bin/env python #-*- coding: utf-8 -*- # 1. Copyright # 2. Lisence # 3. Author """ Documents """ from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals import threading import time from . import base from . import a...
TServer.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Ui_SimavlinkUi.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\Administrator.2013-20160524CL\Desktop\Simavlink\SimavlinkUi.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from src import freq...
DataProcess.py
# -*- coding: utf-8 -*- """ Created on Sun Aug 30 14:40:05 2020 Goal: After getting the api_response from the trigger_api module process the data into a dataframe, and write it into a csv file. @author: Zhiyue June Wei """ import pandas as pd import threading from CrunchbaseAPI.trigger_api import trigger...
__main__.py
import argparse from ctypes import ArgumentError import asyncio import yaml from typing import NamedTuple, List from enum import Enum import threading import traceback import appdirs from pathlib import Path import sys from datetime import datetime import os import time import signal from . import subprocess_impl from ...
multi_test.py
import multiprocessing from multiprocessing.managers import BaseManager, BaseProxy, NamespaceProxy from sharedClass import SharedClass class Test2(object): def __init__(self, x, y, z): self.__setattr__('x', x+10) self.__setattr__('y', y+10) self.__setattr__('z', z+10) def __setattr__...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
stdbroker.py
# coding=utf-8 import json import threading from poco.utils.net.transport.ws import WsSocket from poco.utils.net.transport.tcp import TcpSocket from poco.utils import six if six.PY3: from urllib.parse import urlparse else: from urlparse import urlparse class StdBroker(object): def __init__(self, ep1, e...
http.py
# -*- coding: utf-8 -*- import http.server import socketserver import rssit.path import rssit.persistent import threading try: port except NameError: port = 0 def do_GET_real(self): self.protocol_version = "HTTP/1.1" rssit.path.process(self, self.path) class handler(http.server.SimpleHTTPReques...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import codecs import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testin...
import_wikidata.py
""" Import an wikidata file into KGTK file TODO: references TODO: qualifiers-order TODO: incorporate calendar into the KGTK data model. TODO: Incorporate geographic precision into the KGTK data model. TODO: Incorporate URLs into the KGTK data model. TODO: Node type needs to be optional in the edge file. See: htt...
test_orca.py
#!/usr/bin/env python import rvo2 import matplotlib.pyplot as plt import numpy as np import random import rospy import time import threading import math from utils import * from nav_msgs.msg import Odometry import A1easyGo as easyGo import sys sys.path.append("..") import A1scan2obs as pc2obs rospy.init_node('A1_mv...
__init__.py
import linecache from threading import Thread import sys from logging import Handler, Formatter from logging import CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET import time try: from Queue import Queue except: from queue import Queue import requests import json _levelToName = { CRITICAL: 'FATAL', ERR...
thermo.py
import logging from logging import handlers from flask import Flask,render_template, request, g from flask import Flask, request, flash, url_for, redirect, \ render_template, jsonify, Response from flask_sqlalchemy import SQLAlchemy from datetime import datetime from flask_socketio import SocketIO, send, emit from...
app.py
import time from pathlib import Path from regionSelector import RegionSelector from CrawlData import CrawlData from multiprocessing import Process import sys, os, traceback, types import cv2 import imutils import numpy as np import sqlite3 # from detect.bikeDetect import BikeDetect from detect.carDetect import CarDet...
viewport_engine_2.py
#********************************************************************** # Copyright 2020 Advanced Micro Devices, 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.or...
helpers.py
import colorsys # for get_N_HexCol import os import json import csv import sys import subprocess from multiprocessing import Process, Queue import subprocess # copy text to clipboard import time def pd(what, start_time): time_in_min = (time.time() - start_time) / 60.0 time_in_h = time_in_min / 60.0 print("...
Weld_Path_Embedded.py
# This example shows how to create a small UI window embedded in RoboDK # Type help("robolink") or help("robodk") for more information # Press F5 to run the script # Documentation: https://robodk.com/doc/en/RoboDK-API.html # Reference: https://robodk.com/doc/en/PythonAPI/index.html # Note: It is not required to ke...
test_pooling_base.py
# Copyright 2012 10gen, 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, soft...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import multiprocessing as mp import os import random import shutil import sys import tarfile import threading import time import warnings import zip...
05lock_solveerror.py
from threading import Lock from threading import Thread import time # 定义全局变量 num = 100 # 创建锁 lock = Lock() def run(n): print('子线程开始执行') global num global lock for i in range(1000000): # 100 = 100 + 6 # 100 = 100 - 9 # num = 91 # 获取锁 # try: # lock.a...
onnxruntime_test_python.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- import unittest import os import numpy as np import onnxruntime as onnxrt import threading class TestInferenceSession(unittest.TestCase): def get_name(self, name): if os.path.exists(name...
chat.py
# ██╗ ██╗██████╗ ███╗ ███╗███████╗ █████╗ ██╗ # ██║ ██║██╔══██╗████╗ ████║██╔════╝██╔══██╗██║ # ███████║██║ ██║██╔████╔██║█████╗ ███████║██║ # ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ██╔══██║██║ # ██║ ██║██████╔╝██║ ╚═╝ ██║███████╗██║ ██║███████╗ # ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝ # Copyright 2019...
Battery_notification.py
# use terminal to install """pip install psutil pip install pyttsx3 pip install win10toast""" import psutil import time import pyttsx3 from win10toast import ToastNotifier # also need to install win32api import threading toaster = ToastNotifier() x=pyttsx3.init() x.setProperty('rate',110) x.setProperty('volume',...
system_controller.py
import alsaaudio import pulsectl import threading from config import TEST_ENV import pydbus import time from config import logger class SystemController(): def __init__(self): self.system_volume = alsaaudio.Mixer().getvolume()[0] def get_volume(self): return self.system_volume def set_vol...
xvfb.py
#!/usr/bin/env vpython # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs tests with Xvfb and Openbox or Weston on Linux and normally on other platforms.""" from __future__ import print_functi...
MPtest.py
import multiprocessing import time import matplotlib.pyplot as plt import random a=[] def fuuc(a,q): for i in range(1,5): time.sleep(1) j = random.gauss(4,2) a = a + [i] q.put(a) if __name__ == '__main__': q1 = multiprocessing.Queue() p1 = multiprocessing.Process(target = fuuc, args = (a,q1)) q2 = multiproc...
context.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...
main.py
# 7th draft of reset countdown timer. # By: KraftyKraken - octonink@gmail.com # Created: 4/7/2021 import _tkinter import dateutil.relativedelta as rel import datetime import winsound import time import threading from tkinter import * from tkinter import messagebox # creating window and name it. root =...
signal_processing_module.py
import numpy as np from scipy import signal # Det här kanske behöver importeras på något annat sätt. import matplotlib.pyplot as plt # TODO: ta bort sen import time # TODO: Ta bort sen from scipy.fftpack import fft from scipy.signal import spectrogram # To plot spectrogram of FFT. import threading import queue impo...
PagesController.py
import csv from operator import contains import random import string import threading import uuid from datetime import datetime as date from flask import redirect, render_template, url_for from models import ContractsModel, ImportModel class Pages: def __init__(self): self.imports = ImportModel.Imports() ...
aggregator_handler.py
import json import logging import threading from datetime import datetime, timedelta from time import sleep import pandas as pd import utils from constants import * from sql_writer import SqlWriter class MessageHandler: """ Class that handles the messages """ def handle_message(self, ts_reception:...
api.py
from flask import Blueprint, session, request, send_file, url_for, Response, abort from flask_login import login_user, current_user from io import BytesIO from uuid import UUID, uuid1 from utilities import SQL, APIResponse from pyprobe import FFProbe import threading import os import subprocess import json import shuti...
catalog_collections.py
""" catalog collections """ import argparse import hashlib import json import multiprocessing import os import re import subprocess import sys from collections import Counter from collections import OrderedDict from datetime import datetime from glob import glob from json.decoder import JSONDecodeError from typing im...
sensor.py
# coding=utf-8 import subprocess import re, os, sys, pdb, time topo_path = os.path.abspath(os.path.join('..', '..', 'Topology')) sys.path.insert(0, topo_path) from util import * from create_merge_topo import * from build_virtual_topo import * import logging from threading import Lock from datetime import da...
reader.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
22.thread_locks_as_contextManagers.py
import logging import threading import time logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s', ) def worker_with(lock): with lock: logging.debug("lock acquired") def worker_nowith_lock(lock): try: lock.acquire() exc...
FederationService.py
#! /usr/local/bin/python2.7 # -*- coding: utf-8 -*- # #This software was developed by employees of the National Institute of #Standards and Technology (NIST), and others. #This software has been contributed to the public domain. #Pursuant to title 15 Untied States Code Section 105, works of NIST #employees are not subj...
monitored_session_test.py
# pylint: disable=g-bad-file-header # Copyright 2016 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/LICENS...
download_manager_test.py
# coding=utf-8 # Copyright 2018 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...
test_main_loop.py
import os import signal import time from itertools import count from multiprocessing import Process from fuel.datasets import IterableDataset from mock import MagicMock from numpy.testing import assert_raises from six.moves import cPickle from blocks.main_loop import MainLoop from blocks.extensions import TrainingExt...
handlers.py
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
timer.py
import time import threading import ipywidgets as ipw class Timer(): """Class for scheduling periodic callbacks. Timer class for periodically passing new data from a generator to a callback function. Useful for passing data from DMA transfers back to a visualisation function. """ def __init__(...
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. from __future__ import print_function import argparse ...
mesh_pool.py
import torch import torch.nn as nn from threading import Thread from models.layers.mesh_union import MeshUnion import numpy as np from heapq import heappop, heapify from models.layers.mesh_prepare import get_edge_faces import math class MeshPool(nn.Module): def __init__(self, target, multi_thread=False): ...
test_callbacks.py
import os import sys import multiprocessing import numpy as np import pytest from keras import optimizers np.random.seed(1337) from keras import callbacks from keras.models import Sequential from keras.layers.core import Dense from keras.utils.test_utils import get_test_data from keras import backend as K from keras...
voiceassistant.py
# Text-to-Speech from gtts import gTTS from io import BytesIO from pydub import AudioSegment from pydub.playback import play # Speech recognition import speech_recognition as sr # Hotword detection import snowboy.snowboydecoder as snowboydecoder from definitions import SNOWBOY_MODEL_PATH import threading # Fuzzy log...
hyperlink_preview.py
""" Parse an url preview data (base on Open Graph protocol, but not only) Instantiate a HyperLinkPreview object. """ import logging import queue from threading import Thread, Lock, Event from typing import Dict, Optional from urllib.parse import urlparse import requests from bs4 import BeautifulSoup from . import util...
spark_monitor.py
from ..utils import filter_dict, load_json, join_url, merge_dict, subtract_dicts from threading import Thread, Lock from requests import post from socket import gethostname, gethostbyname from time import sleep from json import dumps class SparkMonitor: def __init__(self, addr, port, url="spark-master:40...
manager.py
#!/usr/bin/env python3 import os import time import sys import fcntl import errno import signal import shutil import subprocess import datetime import textwrap from typing import Dict, List from selfdrive.swaglog import cloudlog, add_logentries_handler from common.basedir import BASEDIR from common.hardware import HA...
tutorial_mscolab.py
""" mss.tutorials.tutorial_mscolab ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This python script generates an automatic demonstration of how to use Mission Support System Collaboration for users to collaborate in flight planning and thereby explain how to use it's various functionalities. This file is part of ...
cluster_coordinator_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 applicable ...
vnhuobi.py
# encoding: utf-8 import urllib import hashlib import json import requests from time import time, sleep from Queue import Queue, Empty from threading import Thread # 常量定义 COINTYPE_BTC = 1 COINTYPE_LTC = 2 ACCOUNTTYPE_CNY = 1 ACCOUNTTYPE_USD = 2 LOANTYPE_CNY = 1 LOANTYPE_BTC = 2 LOANTYPE_LTC = 3 LOANTYPE_USD = 4 ...
base_container.py
import threading import time import socket import struct import select import utils from xlog import getLogger xlog = getLogger("x_tunnel") class WriteBuffer(object): def __init__(self, s=None): if isinstance(s, str): self.string_len = len(s) self.buffer_list = [s] else: ...
02_cheetah_es.py
#!/usr/bin/env python3 import gym import roboschool import ptan import time import argparse import numpy as np import collections import torch import torch.nn as nn from torch import multiprocessing as mp from torch import optim from tensorboardX import SummaryWriter NOISE_STD = 0.05 LEARNING_RATE = 0.01 PROCESSES_C...
zuul_swift_upload.py
#!/usr/bin/env python3 # # Copyright 2014 Rackspace Australia # Copyright 2018 Red Hat, 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 # # ...
testing.py
import cv2 import numpy as np from threading import Event, Thread import time import tensorflow.keras from PIL import Image, ImageOps import json from tensorflow.keras.models import load_model p = 0 prediction = ['1 Finger', '2 Fingers', '3 Fingers', '4 Fingers', '5 Fingers'] # Camera camera = cv2.Vid...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Askalcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import J...
ssh_interactive_commnds.py
import sys import os import select import socket import paramiko import threading import multiprocessing import time import commands import subprocess from fabric.api import * from fabric.state import connections as fab_connections from tcutils.commands import ssh, execute_cmd, execute_cmd_out from tcutils.util import ...
main.py
import json import time import threading import base64 import cv2 import numpy as np import onnxruntime from flask import Flask, request, Response import requests from azure.iot.device import IoTHubModuleClient from object_detection import ObjectDetection from onnxruntime_predict import ONNXRuntimeObjectDetection fr...
__init__.py
#!/usr/bin/python import base64 from binascii import hexlify from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from distutils.spawn import find_executable from kvirt import common from kvirt.common import error, pprint from kvirt.de...
client.py
import socket from tkinter import * from threading import Thread import random from PIL import ImageTk, Image screen_width = None screen_height = None SERVER = None PORT = None IP_ADDRESS = None playerName = None canvas1 = None nameEntry = None nameWindow = None def saveName(): global SERVER global pl...
mock_ms_client.py
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
handler.py
import threading import weakref import paramiko import tornado from tornado import gen import tornado.web import tornado.websocket from concurrent.futures import Future from tornado.ioloop import IOLoop from tornado.iostream import _ERRNO_CONNRESET from tornado.util import errno_from_exception BUF_SIZE = 1024 worker_d...
run.py
#!/usr/bin/python from Adafruit_PWM_Servo_Driver import PWM import time import requests import threading pwm = PWM(0x40) servoMin = 160 # Min pulse length out of 4096 servoMax = 600 # Max pulse length out of 4096 citation_min = 0 citation_max = 360 value = servoMin current_value = servoMin step = 10 def setServo...
Gpc.py
import re from os import system, path from threading import Thread import pandas as pd import numpy as np from traceback import format_exc from datetime import datetime import pickle from transformers import BertTokenizer, BertForSequenceClassification import torch from torch.utils.data import TensorDataset, DataLoad...
traffic_generator_client.py
#!/usr/bin/env python3 import os import threading from time import sleep class TrafficGeneratorClient: BLOCK_SIZE = 4096 PATH_FICHERO_OBSERVACIONES = '/home/observacion' # Constructor def __init__(self, block_size=BLOCK_SIZE): self.tiempo_anterior = 0 self.block_size = block_size ...
process_task.py
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: process_task for a task(ProcessMode) Created: 2016/12/12 """ import unittest import time import multiprocessing import threading import sys import types import warnings from multiprocessing import Pipe from pprint import pprint...
test_config.py
# -*- coding: utf-8 -*- # # Copyright 2017-2021 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
scan.py
############################################################################### # Name : Scan - Image scanner # Author : Alexander Parent # # Copyright 2020 BlackBerry Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
spanprocessor.py
# Copyright The OpenTelemetry 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 agreed to in ...