source
stringlengths
3
86
python
stringlengths
75
1.04M
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
module.py
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
producer_consumer_semaphore.py
#semaphores_tut.py import random, time from threading import BoundedSemaphore, Thread max_items = 5 """ Consider 'container' as a container, of course, with a capacity of 5 items. Defaults to 1 item if 'max_items' is passed. """ container = BoundedSemaphore(max_items) def producer(nloops): #for i in range(nloop...
web.py
# -*- coding: UTF-8 -*- # # ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following cond...
wrapper_utils.py
# Copyright (c) 2016 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. """Helper functions for gcc_toolchain.gni wrappers.""" import gzip import os import re import subprocess import shlex import shutil import sys import th...
test-v2.py
import datetime import random import re import threading import time import requests from aiohttp import web from lxml import etree regex = re.compile('.{3,100}(吗|吧|啊|呢|还是|是什么|是不是).*$') regex2 = re.compile('.{5,100}?$') anser_questions = {} class Config: ACTION_PUT = datetime.datetime.now() # 避免因为重启程序太频繁 #...
http_visualizer.py
# # Copyright (c) 2022 Intel 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 i...
base.py
import queue import re import threading import time class _Getch(object): """ Gets a single character from standard input. Does not echo to the screen. """ def __init__(self, *args, **kwargs): super(_Getch, self).__init__(*args, **kwargs) try: self.impl = _GetchWindows(...
test.py
import time import os import threading import random from contextlib import contextmanager import pytest from helpers.cluster import ClickHouseCluster from helpers.network import PartitionManager from helpers.test_tools import TSV from helpers.client import CommandRequest cluster = ClickHouseCluster(__file__) node...
piui.py
#!/usr/bin/python from __future__ import unicode_literals import requests import os import sys import time import json #import pycurl #import pprint from time import* from threading import Thread from socketIO_client import SocketIO from datetime import datetime from io import BytesIO # Imports...
runner.py
import os import shutil import ctypes import sys import re import platform import subprocess import threading import queue import time import renderdoc as rd from . import util from . import testcase from .logging import log from pathlib import Path def get_tests(): testcases = [] for m in sys.modules.values...
streaming.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import logging import httplib from socket import timeout from threading import Thread from time import sleep import ssl from tweepy.models import Status from tweepy.api import API from tweepy.error import TweepError from tweepy.utils import i...
heater_manager.py
# =============================================================================== # Copyright 2021 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...
process_communication.py
import time from multiprocessing import Process, Queue # 向队列中写入数据 def write_task(q): try: n = 1 while n < 5: print("write, {}".format(n)) q.put(n) time.sleep(1) n += 1 except BaseException: print("write_task error") finally: p...
executorservodriver.py
import json import os import socket import threading import time import traceback from .base import (Protocol, RefTestExecutor, RefTestImplementation, TestharnessExecutor, strip_server) from ..testrunner import Stop webdriver = None here = o...
Broker.py
# Build container # docker build . -t alfa/component/image_broker # Run container # docker run --name image_broker alfa/component/image_broker "tcp://172.17.0.1:5565" "tcp://172.17.0.1:5575" # docker # This is the Broker component managing the communications among nodes # Run inside a Docker container # python3 ./...
tcp_test.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Thomas Jackson <jacksontj.89@gmail.com>` ''' # Import python libs from __future__ import absolute_import import os import threading import tornado.gen import tornado.ioloop from tornado.testing import AsyncTestCase import salt.config import salt.ext.six as six imp...
bak_ModulTest.py
# Modul Test # 11.11.2019 # Sahin MERSIN import os import sys import time import tkinter as tk from threading import Thread from tkinter.filedialog import askopenfilename, asksaveasfilename import psutil as psutil import requests version_info = ( 1, 5 ) def restart_program(): """Restarts the current pro...
main.py
import threading from tkinter import * from tkinter import ttk from tkinter.filedialog import askopenfilename from DataManager import DataManager from math import sqrt # author Andrzej Bisewski # andrzej.bisewski@gmail.com class App: # map loaded_map = [] # Loaded map. 2d array of numbers puzzle = [] #...
watcher.py
import os import json import time from . import models from threading import Thread, Lock from typing import Union, Dict import telegram from requests_html import HTML, HTMLSession from pytablewriter import MarkdownTableWriter from twitter_scraper import Profile class FileNotFound(Exception): pass class Watche...
prom_client.py
"""Implement Prometheus client.""" # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apac...
command.py
# 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 argparse import enum import json import logging import os import resource import signal import subprocess import threading from abc im...
test_flush.py
import time import pdb import threading import logging from multiprocessing import Pool, Process import pytest from utils import * dim = 128 segment_row_count = 5000 index_file_size = 10 collection_id = "test_flush" DELETE_TIMEOUT = 60 nprobe = 1 tag = "1970-01-01" top_k = 1 nb = 6000 tag = "partition_tag" field_name ...
test_autograd.py
# Owner(s): ["module: autograd"] import contextlib import gc import io import math import os import random import sys import tempfile import threading import time import unittest import uuid import warnings import operator import subprocess from copy import deepcopy from collections import OrderedDict from itertools i...
jupiter.py
# coding: utf-8 """Jupiter audio sequencer.""" import os import uuid import time import threading import audioop import math import struct import wave import numpy import pyaudio from boring import draw from boring.window import SubWindow, Window, import_tkinter, import_filedialog from boring.widgets import Label, E...
common.py
import datetime import openpyxl from django import db from django.db.models import Q, Count import numpy as np import traceback import os from multiprocessing import Process import pandas as pd from typing import FrozenSet, TYPE_CHECKING, List from pandas._typing import FilePathOrBuffer, Scalar from django.db import t...
build_polyvore_data.py
# Copyright 2017 Xintong Han. 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 law or ...
main.py
#!/usr/bin/env python3 """Implement a remote shell which talks to a MicroPython board. This program uses the raw-repl feature of the pyboard to send small programs to the pyboard to carry out the required tasks. """ # Take a look at https://repolinux.wordpress.com/2012/10/09/non-blocking-read-from-stdin-in-pyt...
integral_service.py
from ..ConsoleIO.console_porter import ConsolePorter from ..EMail.email_porter import MailPorter from ..QQbot.cq_server import CQHttpPorter from ...server_config import FLASK_PORTS import flask, threading, time app = flask.Flask(__name__) # app.debug = True FLASK_PORTS['Integral'] @app.route('/', methods=...
DartMain.py
import Components.OneCameraLoop as oneCamera import Components.TwoCameraLoop as dualCamera import Components.TwoCameraLoop_Soni as dualCamera1 import Components.TestingSkripts as test import Components.Webserver.websocket as websocket from Components.Calibration.VideoCapture import getVideoStream import threading impor...
__init__.py
import os import sys import subprocess import threading import time import wx import wx.aui from wx import FileConfig def check_for_bom_button(): # From Miles McCoo's blog # https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/ def find_pcbnew_window(): windows = w...
worker_manager.py
""" A manager for multiple workers. -- kandasamy@cs.cmu.edu """ # pylint: disable=abstract-class-little-used import os import shutil import time from sets import Set from multiprocessing import Process TIME_TOL = 1e-5 class WorkerManager(object): """ A Base class for a worker manager. """ def __init__(self, ...
rf_update.py
#! /usr/bin/python # Copyright Notice: # Copyright 2019-2020 DMTF. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Tacklebox/blob/master/LICENSE.md """ Redfish Update File : rf_update.py Brief : This script uses the redfish_utilities module to perform upd...
lib_gui.py
# -*- coding: utf-8 -*- # library to manage GUI # Author : Nicolas Lorenzon - www.lorenzon.ovh - nicolas@lorenzon.ovh from tkinter import * from tkinter.ttk import * from tkinter.messagebox import * import threading, socket import urllib.request from urllib.parse import urlparse from urllib.parse import urljoin impor...
frontendcomm.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ In addition to the remote_call mechanism implemented in CommBase: - Implements _wait_reply, so blocking calls can be made. """ import pickle import socket impor...
accumulators.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...
views.py
from django.shortcuts import render from django.views.decorators import gzip from django.conf import settings from django.http import StreamingHttpResponse import cv2 import threading from mtcnn import MTCNN import numpy as np import tensorflow as tf from tensorflow import keras import cv2 from PIL import Image glo...
TunServer.py
# Copyright 2020 by Roman Khuramshin <mr.linqu@gmail.com>. # All rights reserved. # This file is part of the Intsa Term Client - X2Go terminal client for Windows, # and is released under the "MIT License Agreement". Please see the LICENSE # file that should have been included as part of this package. import select imp...
player.py
#!/usr/bin/env python3 import json import threading import time from collections import namedtuple from os import path, walk from subprocess import PIPE, Popen import RPi.GPIO as GPIO from container import Container def filepath(filename): return path.abspath(path.join(path.dirname(path.abspath(__file__)), filena...
test__xxsubinterpreters.py
from collections import namedtuple import contextlib import itertools import os import pickle import sys from textwrap import dedent import threading import time import unittest from test import support from test.support import script_helper interpreters = support.import_module('_xxsubinterpreters') ##############...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.testing import assert_raises from sqlalchemy....
core_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...
tftp.py
# import click import io import os from socket import AF_INET, SOCK_DGRAM, socket from threading import Thread from zipfile import ZipFile import serializeme from piman import logger """ This code is modified following Prof. Reed suggestion """ """ The TFTPServer class encapsulates the methods required for running...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import platform import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading i...
editor_test.py
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT Simplified O3DE Editor test-writing utilities. Test writers should subclass a test suite from EditorTestSuite for ...
services.py
from flask import Flask from jenkinsapi.jenkins import Jenkins from jenkinsapi.utils.crumb_requester import CrumbRequester from flask import request import logging import configparser from threading import Thread logging.basicConfig(level=logging.DEBUG) jenkins_username = "" jenkins_token = "" jenkins_url = "" app = F...
AppGerberEditor.py
# ########################################################## # FlatCAM: 2D Post-processing for Manufacturing # # File Author: Marius Adrian Stanciu (c) # # Date: 8/17/2019 # # MIT Licence # # #############...
webserver.py
import asyncio import threading import traceback from contextlib import suppress from aiohttp import WSCloseCode, WSMsgType, web from rx import operators as ops from rxpipes import observable_to_async_queue from agents.message import Message from agents.utils import RxTxSubject class WebserverMixin: web_applic...
rx_test.py
''' Name: cmd_client.py Author: Marquez Jones Desc: TCP client threads/processes for sending commands to wheelson and receiving position updates ''' import wheelsonTCP as wTCP import time import sys import argparse import time import os import multiprocessing as mp import atexit PDU_START_BY...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading from electrum_axe.bitcoin import TYPE_ADDRESS from electrum_axe.storage import WalletStorage from electrum_axe.wallet import Wallet from electrum_axe.paymentrequest import InvoiceStore from electrum...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal from electrum.bitcoin import COIN from electrum.plugins import BasePlugin, hook from electrum.i18n import _ from electrum.util import PrintError, Thre...
controller.py
from server import LocalServer, RemoteServer from scheduler import Scheduler from client import Client from time import sleep from Queue import Queue import threading from threading import Thread from time import sleep import signal class Controller: def __init__(self, config): self.client_queue = Queue() self.vo...
start.py
# Copyright 2020, Guillermo Adrián Molina # # 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 ...
session_test.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...
main.py
from typing import Tuple, Dict, Any, List, Optional, Callable, Union, Sequence from dataclasses import dataclass, field from distutils.version import LooseVersion import functools import multiprocessing import os import pickle import time import threading import warnings import re import inspect import numpy as np im...
test.py
# import asyncio # import time # async def async_foo(): # print("async_foo started") # await asyncio.sleep(1) # print("async_foo done") # async def main(): # asyncio.create_task(async_foo()) # fire and forget async_foo() # # btw, you can also create tasks inside non-async funcs # print('Do...
server.py
import json import unittest from http.server import HTTPServer, SimpleHTTPRequestHandler from threading import Thread from typing import Any, Dict, List, Optional class ServerTestCase(unittest.TestCase): @classmethod def setUpClass(cls): cls.server = JIRAServer() @classmethod def tearDownClas...
decision5.py
#!/usr/bin/env python #-*- coding:UTF-8 -*- import math import pygame import time import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2 import rospy from geometry_msgs.msg import Twist import threading from nav_msgs.msg import Odometry # 定义全局变量:地图中节点的像素大小 CELL_WIDTH = 6 # 单元格宽度 CELL_HEIGHT = ...
echoServer.py
#!/usr/bin/env python3 import socket,os import time,signal,threading import logging # create logger logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) HOST = '127.0.0.1' # Standard loopback interface address (localh...
create_dataset.py
# Arda Mavi import os import sys import platform import numpy as np from time import sleep from PIL import ImageGrab from game_control import * from predict import predict from scipy.misc import imresize from game_control import get_id from get_dataset import save_img from multiprocessing import Process from keras.mode...
threads.py
import logging import threading import time def thread_function(name): logging.info("Thread %s: starting", name) time.sleep(5) logging.info("Thread %s: finishing", name) if __name__ == "__main__": format = "%(asctime)s: %(message)s" logging.basicConfig(format=format, level=logging.INFO, ...
down.py
#!/usr/bin/python3 # Import Modules try: import os,sys,time,random,urllib.request,itertools,threading,platform,readline,gzip except Exception as F: exit("\x1b[1;31m [!] \x1b[0;32m%s"%(F)+"\x1b[0;39m") # Color A = "\x1b[1;32m" B = "\x1b[1;31m" C = "\x1b[1;33m" D = "\x1b[1;36m" E = "\x1b[0;39m" rand = (A,B,C,D)...
threadtest3.py
# encoding: UTF-8 import threading import time # 商品 product = None # 条件变量 con = threading.Condition() # 生产者方法 def produce(): global product if con.acquire(): while True: if product is None: print('produce...') product = 'anything' # 通知消费者,...
produce.py
import os import requests import json import time import datetime import operator import threading from RobotActionLock import in_action, out_action, load_action, unload_action, update_assembly_action from utils import get_material_dict import logging from laser_client import client_send logger = logging.getLogger(_...
event_processor.py
""" Implementation details of the analytics event delivery component. """ # currently excluded from documentation - see docs/README.md from collections import namedtuple from email.utils import parsedate import errno import json from threading import Event, Lock, Thread import six import time import urllib3 import uui...
VideoRecorder.py
#!/usr/bin/env python3 import threading import random from picamera import PiCamera, Color import datetime from time import sleep class VideoRecorder: def __init__(self, res_x=640, res_y=480, framerate=25, rotation=0, timestamp=True, timestamp_bgcolor="blue", timestamp_fontcolor="yellow", timestamp_fontsize=20, t...
receive_c2d_message.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os...
test_util.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...
ezbenchd.py
#!/usr/bin/env python3 """ Copyright (c) 2015, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions an...
mock_web_api_server.py
import asyncio import json import logging import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from typing import Type, Optional from unittest import TestCase from urllib.parse import urlparse, parse_qs, ParseResult from multiprocessing import...
script.py
from __future__ import print_function import os import sys import json import threading THREADS_SUPPORTED = True if sys.version_info[0] == 2: import urllib2 as urllib_error import urllib as urllib_request # Avoid threads on py2/win32. This will lockup HexChat if sys.platform == 'win32': THREADS_SUPPORTED = Fal...
IPythonProxy.py
import subprocess import sys from ij import IJ from threading import Thread import time class IPythonProxy: def __init__(self): self.connectionFile = IJ.getProperty('jupter_connection_file') self.pythonExecutable = IJ.getProperty('python_executable') self.out = '' self.connect() self.createKernelClient...
run_batch_experiments.py
import os, sys, signal import random import numpy as np from multiprocessing import Process, Queue, current_process, freeze_support import argparse parser = argparse.ArgumentParser() parser.add_argument('--method', type=str, default='ours') parser.add_argument('--num-seeds', type=int, default=5) parser.add_argument('-...
Server.py
import os,sys,socket import threading,ssl import select, json from datetime import datetime import argparse class ProxyServer: BACKLOG = 50 BLOCKED = [""] auth=b"HTTP/1.1 200 Connection Established\r\n\r\n" block_response = b'HTTP/1.1 200 OK\r\nPragma: no-cache\r\nCache-Control: no-cache\r\nContent-Type:...
deploy.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import logging import os.path as osp from functools import partial import mmcv import torch.multiprocessing as mp from torch.multiprocessing import Process, set_start_method from mmdeploy.apis import (create_calib_table, extract_model, ...
recovery_2i.py
import logging from threading import Thread import time from .base_2i import BaseSecondaryIndexingTests from couchbase.n1ql import CONSISTENCY_REQUEST from couchbase_helper.query_definitions import QueryDefinition from lib.memcached.helper.data_helper import MemcachedClientHelper from membase.api.rest_client import Re...
Hiwin_RT605_ArmCommand_Socket_20190627180456.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd as TCP import HiwinRA605_socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv imp...
train.py
# Copyright (c) 2020 DeNA Co., Ltd. # Licensed under The MIT License [see LICENSE for details] # training import os import time import copy import threading import random import bz2 import pickle import warnings from collections import deque import numpy as np import torch import torch.nn as nn import torch.nn.funct...
test_regular.py
# -*- coding: utf-8 -*- """ logbook.testsuite.test_regular ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The logbook testsuite. :copyright: (c) 2010 by Armin Ronacher, Georg Brandl. :license: BSD, see LICENSE for more details. """ from __future__ import division import os import re import sys import time import...
async_client.py
#!/usr/bin/env python from __future__ import print_function import grpc import time import threading # import dronecore_pb2 as dc # import dronecore_pb2_grpc import action_pb2 as dc_action import action_pb2_grpc # import telemetry_pb2 as dc_telemetry import telemetry_pb2_grpc from google.protobuf import empty_pb2 c...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threading import time import traceback impo...
group.py
import sys import logging import traceback from typing import * from threading import Thread, Event from collections import deque, namedtuple __all__ = ("Group", "PostGroup") logger = logging.getLogger("instascrape") class Group: """An intermediate class that holds a group of Post/Profile objects. Responsible fo...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
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 gc import onnxruntime as onnxrt import threading import sys from helper import get_name from onnxruntime.capi.onnxruntime_pybind11_state import Fail...
data.py
import requests import threading import yaml import os MAX_THREADS = 5 jsonbin = {"bin-id": None, "secret-key": None} current_threads = 0 with open(os.path.join(os.path.dirname(__file__), "settings.yaml")) as file: settings = yaml.safe_load(file) jsonbin["bin-id"] = settings["jsonbin"]["bin-id"] jsonbin...
HiwinRA605_socket_ros_20190604111839.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
test.py
import time import colorsys from govee_btled import BluetoothLED from flask import Flask from flask import request from threading import Thread, Lock mutex = Lock() t = 0 init = [0,0,0,0,0,0,0] ledState = init ledBrightness = init hue = init saturation = init nextSend = init app = Flask(__name__) led = ['A4:C1:38:F0...
test_updater.py
from krbticket import KrbTicket, KrbCommand from krbticket import SimpleKrbTicketUpdater, SingleProcessKrbTicketUpdater, MultiProcessKrbTicketUpdater from helper import * import time import pytest from multiprocessing import Process from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor def teardown_f...
uhej_client.py
""" The MIT License (MIT) Copyright (c) 2017 Johan Kanflo (github.com/kanflo) 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 ...
version.py
import subprocess import sys import logging import re import threading import time import os import requests import importlib_metadata logger = logging.getLogger(__name__) class VersionChecker: def __init__(self, name="cryptoadvance.specter"): self.name = name self.current = "unknown" sel...
tf_util.py
import numpy as np import tensorflow as tf # pylint: ignore-module import copy import os import functools import collections import multiprocessing def switch(condition, then_expression, else_expression): """Switches between two operations depending on a scalar value (int or bool). Note that both `then_expres...
train_ac_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn """ import numpy as np import tensorflow as tf #import tensorflow_probability as tfp i...
test_integration_snapshots.py
# -*- coding: utf-8 -*- import multiprocessing import mock import pytest from ddtrace import Tracer from ddtrace.constants import MANUAL_DROP_KEY from ddtrace.constants import MANUAL_KEEP_KEY from ddtrace.internal.writer import AgentWriter from ddtrace.sampler import DatadogSampler from ddtrace.sampler import RateSam...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
test_mainwindow.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright © Spyder Project Contributors # # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) # ----------------------------------------------------------------------------- """ Te...
SimpleWebHook.py
#!/usr/bin/env python #encoding=utf-8 __author__ = 'Tim Liu' __date__ = '2017/12/10 3:03' import SimpleHTTPServer import SocketServer import json import threading import urlparse import os class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): @classmethod def setPassword(self, password=''): ...
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
twitter.py
import logging import re from datetime import datetime from multiprocessing import Queue, Event from threading import Thread from time import sleep from typing import List from typing import Optional import tweepy from spacy.tokens import Doc from config.twitter import * from connectors.connector_common import Connec...
macro_runner.py
import time from threading import Thread from typing import Union from pynput.keyboard import Key, KeyCode, Listener from core.actual_window import ActualWindow from core.tray import Tray from global_modules import logs from global_modules.macro_manager import MacroManager class MacroRunner(Thread): def __init_...
generic_loadgen.py
# Copyright 2018 The MLPerf 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 ...