source
stringlengths
3
86
python
stringlengths
75
1.04M
bmv2stf.py
#!/usr/bin/env python # Copyright 2013-present Barefoot 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 of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
tommy.py
#!/usr/bin/python # -*- coding: UTF-8 -*- from os import system, name import itertools import threading import time import sys import datetime from base64 import b64decode,b64encode from datetime import date expirydate = datetime.date(2022, 1, 12 ) #expirydate = datetime.date(2021, 12, 30) today=date.today() def he...
cache_server.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import re ...
etcd_rendezvous.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import datetime import json import logging import random import sys import threading impo...
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 ...
parallel_runner.py
from envs import REGISTRY as env_REGISTRY from functools import partial from components.episode_buffer import EpisodeBatch from multiprocessing import Pipe, Process import numpy as np import torch as th # Based (very) heavily on SubprocVecEnv from OpenAI Baselines # https://github.com/openai/baselines/blob/master/bas...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import logging import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread ...
tcr.py
# -*- coding: utf-8 -*- print("You can generate token Here") print("http://101.255.95.249:6969") print("CREATED BY TCR AND FIXED BY RIOBITHUB") import SOURCE from SOURCE.libapi.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re cl = SOURCE.LINE() #cl.login(qr=False) cl...
webserver.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "auto dank is alive made by aditya codez 🔥" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
manager.py
"""插件管理器类""" import logging from threading import Thread from types import ModuleType from typing import NoReturn, Dict, Iterable, Optional from collections import namedtuple from importlib import reload as pyreload from . import error from . import settings from ..core.tools import file from ..core.abstract.plugin i...
sigprotect.py
#!/usr/bin/python # # Copyright (c) SAS Institute 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...
recognition_picture_20190422.py
import sys import os from random import randint from collections import OrderedDict import time import multiprocessing import threading import zmq import params from zmq.utils.monitor import recv_monitor_message sys.path.append(os.getcwd()) import torch from torch.autograd import Variable import util...
handlers.py
# Copyright 2001-2016 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...
awsrepo.py
import threading from threading import Thread import logging from utilities.response import post_error import boto3 from config import aws_access_key, aws_secret_key, aws_bucket_name,aws_link_prefix,download_folder import os log = logging.getLogger('file') class AwsFileRepo(): #uploading file to S3 bucket d...
saltmod.py
# -*- coding: utf-8 -*- ''' Control the Salt command interface ================================== This state is intended for use from the Salt Master. It provides access to sending commands down to minions as well as access to executing master-side modules. These state functions wrap Salt's :ref:`Python API <python-ap...
latch_roundtrip.py
""" Measure latency of IPC between two local threads. """ import threading import time import mitogen import mitogen.core import mitogen.utils import ansible_mitogen.affinity mitogen.utils.setup_gil() ansible_mitogen.affinity.policy.assign_worker() X = 20000 def flip_flop(ready, inp, out): ready.put(None) ...
massreport.py
import json, requests, time, threading, os, ctypes from tkinter.constants import W from colorama import Fore class massreport: def __init__(self): os.system('cls') massreporttitle() print(f"""{y}[{w}+{y}]{w} Enter the ID of the server where the message to be reported is located: """...
test_poll.py
# Test case for the os.poll() function import os import subprocess import random import select import threading import time import unittest from test.support import ( cpython_only, requires_subprocess, requires_working_socket ) from test.support import threading_helper from test.support.os_helper import TESTFN t...
cluster_train.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...
test_context.py
# Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import gc import sys import time from threading import Thread, Event import zmq from zmq.tests import ( BaseZMQTestCase, have_gevent, GreenTest, skip_green, PYPY, SkipTest, ) class TestContext(BaseZMQTestCase): def ...
shr.py
from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.label import Label from kivy.config import Config from kivy.uix.textinput import TextInput from kivy.uix.switch import Switch import threading import os ...
reducer.py
import os import threading from fedn.clients.reducer.control import ReducerControl from fedn.clients.reducer.interfaces import ReducerInferenceInterface from fedn.clients.reducer.restservice import ReducerRestService from fedn.clients.reducer.state import ReducerStateToString from fedn.common.security.certificatemanag...
startDask.py
import os import argparse import time from dask.distributed import Client import sys, uuid import threading import subprocess import socket import mlflow from notebook.notebookapp import list_running_servers def flush(proc, proc_log): while True: proc_out = proc.stdout.readline() if proc_out == "...
mmalobj.py
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Python header conversion # Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk> # # Original headers # Copyright (c) 2012, Broadcom Europe Ltd # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted...
availability.py
import time import threading from metrics.metric import Metric from datetime import datetime import numpy as np METRIC_NAME = 'Availability' VALUE_FIELD = 'value' UNIT_FIELD = 'unit' class Availability(Metric): def __init__(self, conf_path='conf/conf.json'): super().__init__(conf_path) def compute_...
bbox_regression.py
""" This file has functions about generating bounding box regression targets """ from ..pycocotools.mask import encode import numpy as np from ..logger import logger from .bbox_transform import bbox_overlaps, bbox_transform from rcnn.config import config import math import cv2 import PIL.Image as Image import threadi...
welcome.py
import tkinter as tk import menu from utils import _getFont, colors from ui import create_rounded_rectangle from threading import Thread from time import sleep class Welcome(tk.Canvas): def __init__(self, root): tk.Canvas.__init__(self, root, width=700, height=600, bd=0, highlightthickness=0, bg=colors.DBLUE) ...
human_ros.py
#!/usr/bin/env python3 from enum import IntEnum import time import rospy from threading import Thread from dorna_enums import HumanResponse, DornaMovement from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint from moveit_msgs.msg import RobotState, RobotTrajectory, DisplayTrajectory, CollisionObject ...
threading.py
# Copyright (C) 2015-2021 Regents of the University of California # # 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 app...
monitor.py
# -*- coding: utf-8 -*- # File: monitor.py import json import numpy as np import operator import os import re import shutil import time from collections import defaultdict from datetime import datetime import six import threading from ..compat import tfv1 as tf from ..libinfo import __git_version__ from ..tfutils.su...
wrappers.py
# Copyright 2019 The PlaNet Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
dokku-installer.py
#!/usr/bin/env python3 import cgi import json import os import re import shutil try: import SimpleHTTPServer import SocketServer except ImportError: import http.server as SimpleHTTPServer import socketserver as SocketServer import subprocess import sys import threading VERSION = 'v0.23.3' def bytes_t...
oase_apply.py
# Copyright 2019 NEC Corporation # # 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...
conftest.py
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2020 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
board.py
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
prepro_feats.py
""" Preprocess a raw json dataset into features files for use in data_loader.py Input: json file that has the form [{ file_path: 'path/img.jpg', captions: ['a caption', ...] }, ...] example element in this list would look like {'captions': [u'A man with a red helmet on a small moped on a dirt road. ', u'Man riding a m...
download_worker.py
"""A utility for downloading multiple granules simultaneously""" from copy import deepcopy from multiprocessing import Manager, Process from os import cpu_count from pathlib import Path import queue import re from urllib.parse import urlparse from harmony.logging import build_logger from harmony.util import download ...
swaprebalance.py
import time import datetime import unittest from TestInput import TestInputSingleton import logger from couchbase_helper.cluster import Cluster from membase.api.rest_client import RestConnection, RestHelper from membase.helper.bucket_helper import BucketOperationHelper from membase.helper.cluster_helper import ClusterO...
commands.py
import logging import setproctitle import bigchaindb from bigchaindb.tendermint.lib import BigchainDB from bigchaindb.tendermint.core import App from bigchaindb.web import server, websocket_server from bigchaindb.tendermint import event_stream from bigchaindb.events import Exchange, EventTypes from bigchaindb.utils i...
sample_random.py
from rlpyt.envs.dm_control_env import DMControlEnv import math import time import os from os.path import join, exists import itertools from tqdm import tqdm import numpy as np import imageio import multiprocessing as mp def worker(worker_id, start, end): np.random.seed(worker_id) # Initialize environment ...
PoolModule.py
from Config import proxypool_config import ProxyPool from bs4 import BeautifulSoup import threading import aiohttp import asyncio import ToolBox import time import re default_check_interval = proxypool_config.check_interval default_spider_interval = proxypool_config.spider_interval default_print_interval = proxypool...
test_socket_manager.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 unittest import time import uuid import os from unittest import mock from parlai.mturk.core.socket_manager import...
sync_blocking.py
#!usr/bin/env python3 # -*- coding: utf-8 -*- """ Test module to implement synchronous blocking to address race condition among threads, using threading.Lock and threading.Semaphore/threading.BoundedSemaphore. """ __author__ = 'Ziang Lu' import time from threading import BoundedSemaphore, Lock, Semaphore, Thread, cu...
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json import pkgutil from threading import Thread import time import csv import decimal from decimal import Decimal as PyDecimal # Qt 5.12 also exports Decimal from collections import defaultdict from .bitcoin import COIN from .i1...
ballisticacore_server.py
#!/usr/bin/env python3.9 # Released under the MIT License. See LICENSE for details. # """BallisticaCore server manager.""" from __future__ import annotations import json import os import signal import subprocess import sys import time from pathlib import Path from threading import Lock, Thread, current_thread from typ...
thread.py
#!/usr/bin/python3 # Name: chrome.py # Version: R2 # Date: July 2019 # Function: Parses original chrome Bookmarks file # Tries to reach each URL and removes it on error # Accepts return codes as parameters. chrome.py must be called as executable: # $ ./chrome.py --help # $ ./chro...
main.py
import threading from queue import Queue from spider import Spider from domain import * from general import * PROJECT_NAME = 'viper-seo' HOMEPAGE = 'http://viper-seo.com/' DOMAIN_NAME = get_domain_name(HOMEPAGE) QUEUE_FILE = PROJECT_NAME + '/queue.txt' CRAWLED_FILE = PROJECT_NAME + '/crawled.txt' NUMBER_OF_THREADS = 8...
test_ssl.py
# -*- coding: utf-8 -*- # Test the support for SSL and sockets import sys import unittest from test import test_support as support from test.script_helper import assert_python_ok import asyncore import socket import select import time import datetime import gc import os import errno import pprint import shutil import ...
WorkerService.py
from __future__ import absolute_import from functools import wraps __author__ = 'patrizio' import celery.bin.worker from multiprocessing import Process from celery import Celery from celery.signals import task_success, task_failure, task_revoked from kombu import Queue, Exchange from ssl import CERT_REQUIRED from t...
__init__.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 required by ap...
examplecricketstream.py
import logging import queue import threading import betfairlightweight # setup logging logging.basicConfig(level=logging.INFO) # change to DEBUG to see log all updates # create trading instance (app key must be activated for cricket stream) trading = betfairlightweight.APIClient("username", "password", app_key="app...
alpaca_discovery.py
#!/usr/bin/env python3 """Provides the ability to find IPv4 ASCOM Alpaca servers on the local networks. Uses the netifaces library to find the broadcast IPs that can be used for sending the UDP discovery message. Some functions accept **kwargs (i.e. unspecified keyword arguments) so that they can be passed arguments ...
main.py
from lib.appController import Controller, device_name_queue from appCase.test_qq import QQDemo from lib.logger import logger from lib.result import Result from lib import HTMLTestAppRunner from lib.path import APPREPORT import threading import unittest local = threading.local() class App(object): def __init__(se...
benchmark_runner.py
import csv import multiprocessing import pathlib import time from typing import Callable, List import benchmark import start_webserver from helpers import constants OUTPUT_DIR = "./output" RESULT_PREFIX = "results_" WEBSERVERS = [ ("Flask", start_webserver.start_flask), ("FastAPI_sync", start_webserver.start...
display.py
import time import cv2 from multiprocessing import Process, Queue def _display_loop(camera_number: int, request_queue: Queue): my_cam = cv2.VideoCapture(camera_number) current_text = None while True: ret_val, img = my_cam.read() new_text = None if not request_queue.empty(): ...
__init__.py
# coding: utf-8 """ 画面操作の制御を行う __init__.pyファイルはこのディレクトリ以下をインポートされると必ず呼び出されるのでここに書く。 もちろん、コードが増えてきた場合は別途ファイルに書いてここでインポートする構成でも構いません。 ここでは画面に何を表示するかの管理を行う。 このライブラリはMQTTと画面表示での並列動作が必要なので、 threadingライブラリを使用してそれを実現しています。 https://docs.python.jp/3/library/threading.html """ from logging import ...
plugin.py
#! /usr/bin/env python # -*- coding: utf-8 -*- #################### # Copyright (c) 2013, Richard Perlman All rights reserved. # with much credit to Rob Smith (kormoc) -- https://github.com/BrightcoveOS/Diamond/blob/master/src/collectors/apcupsd/apcupsd.py # # Starting with 0.5.0, revised by Marty Skinner (https://gith...
pyshell.py
#! /usr/bin/env python3 import sys if __name__ == "__main__": sys.modules['idlelib.pyshell'] = sys.modules['__main__'] try: from tkinter import * except ImportError: print("** IDLE can't import Tkinter.\n" "Your Python may not be configured for Tk. **", file=sys.__stderr__) raise SystemExit(...
main.py
import logging import time import sys from gui import App from mower import Mower from parser import Parser from threading import Thread from environment import Environment from PyQt5.QtWidgets import QApplication DEFAULT_INPUT_FILE_PATH = "input.txt" class Simulation: """ Simple class used to organized th...
tb_gateway_service.py
# Copyright 2022. ThingsBoard # # 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 ...
ur3e_rtqhe_x.py
import math from robot_con.ur.robotiq import rtq_eseries_gripper as r2f from robot_con.ur.robotiq import rtq_ft300 as rft from basis import robot_math as rm import drivers.urx.ur_robot as urrobot import robot_con.ur.program_builder as pb import numpy as np import threading import socket import struct import os import m...
server.py
import socket from threading import Thread def func(conn): conn.send('线程server'.encode('utf-8')) msg = conn.recv(1024).decode('utf-8') print(msg) sk = socket.socket() sk.bind(('127.0.0.1',8080)) sk.listen() while True: conn,addr = sk.accept() t = Thread(target=func,args=(conn,)) t.start()
expiry_maxttl.py
from random import randint from threading import Thread from BucketLib.bucket import Bucket from Cb_constants import DocLoading from cb_tools.cbepctl import Cbepctl from cb_tools.cbstats import Cbstats from couchbase_helper.documentgenerator import doc_generator from basetestcase import ClusterSetup from BucketLib.Buc...
n1ql_window_functions_syntax_check.py
from .tuq import QueryTests import random import string from random import randint from membase.api.exception import CBQError import threading import copy class WindowFunctionsSyntaxTest(QueryTests): def setUp(self): super(WindowFunctionsSyntaxTest, self).setUp() self.log_config_info() se...
stream.py
from urllib.parse import urlencode from collections import defaultdict from datetime import datetime import threading import websocket import queue import time import json from pymeritrade.errors import TDAPermissionsError, check_assert from pymeritrade.stream.schemas import SUB_ID_TO_NAME, SUB_TYPES class StreamDat...
tofino-model.py
# coding=utf-8 # Copyright 2018-present Open Networking Foundation # SPDX-License-Identifier: Apache-2.0 ''' This module contains a switch class for Mininet: StratumTofinoModel Usage ----- From withing the Docker container, you can run Mininet using the following: $ mn --custom tools/mininet/tofino-model.py --switch ...
test_urllib.py
"""Regresssion tests for urllib""" import urllib import httplib import unittest import os import sys import mimetools import tempfile import StringIO from test import test_support from base64 import b64encode def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() ...
basic.py
# -*- coding: utf-8 -*- """ flask.testsuite.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import flask import pickle import unittest from datetime import datetime from threading import Thre...
scheduler.py
# -*- coding: utf-8 -*- """ sleekxmpp.xmlstream.scheduler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a task scheduler that works better with SleekXMPP's threading usage than the stock version. Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :licen...
__init__.py
"""Hermes MQTT server for Rhasspy wakeword with pocketsphinx""" import asyncio import io import logging import queue import socket import tempfile import threading import typing import wave from dataclasses import dataclass, field from pathlib import Path import pocketsphinx from rhasspyhermes.audioserver import Audio...
threaded.py
"""QwikSwitch USB Modem threaded library for Python.""" import logging from queue import Queue import threading from time import sleep import requests from .qwikswitch import ( QSDevices, QS_CMD, CMD_UPDATE, URL_DEVICES, URL_LISTEN, URL_SET, URL_VERSION) # pylint: disable=W0614 _LOGGER = logging.getLogger(...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir MINIO_INTERNAL_PORT = 9001 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) CONFIG_PA...
imagetweet.py
# -*- coding: utf-8 -*- from collections import OrderedDict from utils import printf as print from configobj import ConfigObj from threading import Thread import pathlib import tweepy import time import sys import os sys.path.append('plugins/') account_list = OrderedDict() api_objects = OrderedDict() __version__ = '0....
mtimes.py
import pathlib import queue import stat import threading from mopidy import exceptions class FindError(exceptions.MopidyException): def __init__(self, message, errno=None): super().__init__(message, errno) self.errno = errno def find_mtimes(root, follow=False): results, errors = _find(root,...
auto_annotation.py
from .data import * import imgui from .projects import Project from yolov5 import detect import os import threading from . import annotation from .file_selector import file_selector from custom_utils import save_img_annotations def start_inference(frame_data, exp: Experiment): predictions = detect.run(weight...
snowball_uploader_27-success-prod.py
''' status: completed version: v27 way: using multi-part uploading ref: https://gist.github.com/teasherm/bb73f21ed2f3b46bc1c2ca48ec2c1cf5 changelog: - 2022.01.19 - added no_extract variable and test to allow not setting the auto-extract metadata flag - 2021.06.10 - v27 - eliminate "renaming filename" fe...
celeste_timer.py
#!/usr/bin/env python3 # copyright 2021 rhelmot. redistribution is permitted for any purpose provided this copyright notice is kept intact. # this program comes with absolutely no warranty including fitness for blah blah blah import struct import pickle import sys import threading import time import collections impor...
run_dispatcher.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. import os import logging from multiprocessing import Process from django.conf import settings from django.core.cache import cache as django_cache from django.core.management.base import BaseCommand from django.db import connection as django_connection, connecti...
send.py
#!/usr/bin/env python3 """ @summary: submit many contract.set(arg) transactions to the example contract @version: v06 (24/April/2018) @since: 17/April/2018 @author: https://github.com/drandreaskrueger """ from config import RPCaddress, ROUTE, PRIVATE_FOR, ABI ################ ## Dependencies: from web3 import W...
activity.py
#!/usr/bin/python # coding: utf8 import pigpio import time import kdate import logging import threading import os import ctypes #import docopt #import sys #import subprocess log = logging.getLogger("Foosball") class Activity: def __init__(self, pi, gpio, power=False, config=False, onVacant=None, onOccupied=None):...
tello.py
import threading import socket import time import datetime import struct import sys import os from scapy.all import * from . import crc from . import logger from . import event from . import state from . import error from . import video_stream from . utils import * from . protocol import * from . import dispatcher lo...
subconsole.py
# special import os, datetime import threading import subprocess import platform from .salesforce.myconsole import MyConsole from . import logging IS_WINDOWS = platform.system() == "Windows" IS_MAC = platform.system() == "Darwin" IS_Linux = platform.system() == "Linux" def xstr(s): if s is None: return '...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import sys import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseM...
skype_connector.py
import configparser import os import queue import uuid import logging from threading import Thread, Timer from datetime import datetime from time import sleep from skpy import ( Skype, SkypeAuthException, SkypeEventLoop) from hub import outgoing_sk_msg_queue from common import incoming_msg_queue...
wsdump.py
#!/Users/Lavender/Desktop/accel.ai/flask-aws/bin/python import argparse import code import sys import threading import time import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin, "encoding"...
test_client.py
import asyncio import gc import inspect import logging import os import pickle import random import subprocess import sys import threading import traceback import warnings import weakref import zipfile from collections import deque from contextlib import suppress from functools import partial from operator import add f...
datastore.py
# Copyright 2021 The Feast 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
test_user_secrets.py
import json import os import threading import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from test.support import EnvironmentVarGuard from urllib.parse import urlparse from datetime import datetime, timedelta import mock from google.auth.exceptions import DefaultCredentialsError from google.cl...
dev_test_cex_full.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: dev_test_cex_full.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api # PyP...
word2vec.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
servo_ball_nosocket.py
#!/usr/bin/env python # coding=utf-8 from __future__ import division import cv2 import Adafruit_PCA9685 import time import numpy as np import threading pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) pwm.set_pwm(14, 0, 580) pwm.set_pwm(15, 0, 580) time.sleep(1) cap = cv2.VideoCapture(0) hsv_...
gpsnap.py
#!/usr/bin/env python ''' gpsnap -- snapshot a gpdb array Usage: gpsnap [-Vvlfz?] [-u user] {-crdiI} snapshot_name -c: create a snapshot -r: restore a snapshot -d: delete a snapshot -i: show information on snapshot -I: show detailed info on snapshot -z: use zfs snapshot mec...
server.py
from waitress import serve from flask import Flask, request, jsonify import logging import threading import http import base64 import json import opentracing class DriverServer(object): trace_context = None trace_context_dict = None final_error = None output_completed = False def __init__(self,...
network_monitor.py
#!c:\\python\\python.exe import threading import getopt import time import sys import os # noinspection PyUnresolvedReferences import pcapy import impacket import impacket.ImpactDecoder from boofuzz import pedrpc from boofuzz import helpers MAX_PACKET_LENGTH = 65535 # Max packet length for IP capture def log_error(...
acrobot_a3c.py
'''Example of A3C running on Acrobot environment ''' import argparse import time import threading import tensorflow as tf import gym # import multiprocessing import ac_net import worker PARSER = argparse.ArgumentParser(description=None) PARSER.add_argument('-d', '--device', default='cpu', type=str, help='choose devic...
cron_dispatch.py
from flask import Blueprint from multiprocessing.process import Process from backend.incoming.entry_points import every_hour from database.analytics.system_load import EveryHourOTP from requests import post from socket import gethostname cron_dispatch = Blueprint("cron_dispatch", __name__) def start_every_hour(): ...
train.py
from __future__ import print_function import numpy as np from tqdm import tqdm import multiprocessing as mp import math import datetime from absl import app from absl import flags from env import Environment from game import Game from model_mine import Network from config import get_config import os os.environ['TF_CP...
twitch-indicator.py
#!/usr/bin/env python3 import threading import webbrowser import json import urllib.request import gi gi.require_version('AppIndicator3', '0.1') gi.require_version('Notify', '0.7') gi.require_version('Gtk', '3.0') from gi.repository import AppIndicator3 as appindicator # noqa: E402 from gi.repository import GLib, Gi...
history_sample(TICKS).py
import time from tcoreapi_mq import * import tcoreapi_mq import threading g_QuoteZMQ = None g_QuoteSession = "" #實時行情回補 def OnRealTimeQuote(symbol): print("商品:", symbol["Symbol"], "成交價:",symbol["TradingPrice"], "開:", symbol["OpeningPrice"], "高:", symbol["HighPrice"], "低:", symbol["LowPrice"]) #行情消息接收 def quote_...
script4.py
from multiprocessing import Process, Lock def f(lk, i): lk.acquire() try: print('hello world', i) finally: lk.release() if __name__ == '__main__': lock = Lock() for num in range(10): Process(target=f, args=(lock, num)).start()