source
stringlengths
3
86
python
stringlengths
75
1.04M
scheduler_test.py
import datetime from http.server import HTTPServer, BaseHTTPRequestHandler import json import pdb import sqlite3 import threading import time import unittest import myDevices.schedule as schedule from myDevices.cloud.dbmanager import DbManager from myDevices.cloud.scheduler import SchedulerEngine from myDevices.utils....
backend.py
import time import pandas as pd import multiprocessing from task_queue import TaskQueue import autoshape.autoshape as autoshape import fixed_ratio.fixed_ratio as fixed_ratio import fixed_interval.fixed_interval as fixed_interval from re import sub # TODO: import other tasks class Backend: """ backend functions"...
batch_ops_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...
DataBaseModule.py
import tushare as ts #import os import pandas as pd #import time #import threading import datetime as dtime class DataBase: updateAllShareHistoryDataSum = 0 updateAllShareHistoryDataCount = 0 indexNameMap = {'hs300':399300} store = None """===============================公有函数==================...
resources.py
from datetime import datetime, timedelta import time import random import subprocess import os import os.path import time from collections import defaultdict import json import logging import numbers import yaml from django.db import models from django.contrib.auth.models import AbstractUser import pexpect, getpass i...
randomizer.py
import spotipy import os import spotipy.util as util from http.server import HTTPServer, BaseHTTPRequestHandler from threading import Thread import requests os.environ["SPOTIPY_CLIENT_ID"] = "" os.environ["SPOTIPY_CLIENT_SECRET"] = "" os.environ["USER"] = "" SERVER_PORT = 14523 os.environ["SPOTIPY_REDIRECT_URI"] = "ht...
test_common.py
from __future__ import annotations import socket from typing import TYPE_CHECKING from unittest.mock import Mock, patch import pytest from amqp import RecoverableConnectionError from kombu import common from kombu.common import (PREFETCH_COUNT_MAX, Broadcast, QoS, collect_replies, declarati...
server.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ...
__init__.py
from .app.webserver.app import app from .app.tgbot.server import run import os import time import threading import sys print(r""" __ ____ / /___ __ __/ __ \__ __ __ / / __ `/ | / / /_/ / / / / / /_/ / /_/ /| |/ / ____/...
jarvis_server.py
from multiprocessing import Process from plugin import Platform, require, plugin @require(network=True, platform=Platform.MACOS) @plugin("server start") def server_start(jarvis, s): jarvis_server = jarvis.get_server() if s != "": if ":" in s: jarvis_server.server_host, jarvis_server.port ...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
ssh.py
import paramiko from threading import Thread from .tools import get_key_obj from asgiref.sync import async_to_sync import socket from django.conf import settings import json import time import sys import os import traceback from util.tool import gen_rand_char, res as save_res from util.control import remove_control_cha...
main.py
from threading import Lock, Thread from time import sleep class SingletonMeta(type): __instances: dict = {} __lock: Lock = Lock() def __call__(cls, *args, **kwargs): with cls.__lock: if cls not in cls.__instances: sleep(2) instance = super().__call__(*ar...
main.py
import argparse import queue import threading import signal from pathlib import Path import cv2 import depthai import numpy as np from imutils.video import FPS from math import cos, sin parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent debug output") parse...
threads.py
import errno import sys from difflib import unified_diff from threading import Thread sys.path.append("../../common") from env_indigo import * ext = "svg" thread_count = 100 a = {} if not os.path.exists(joinPathPy("out/threads", __file__)): try: os.makedirs(joinPathPy("out/threads", __file__)) except...
test_exec_timeout.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
crawler.py
#!/usr/bin/python3 ## -------------------------------------------------------------------------------------------------------------------- import logging # for log import os # for file handling, exit import sys # for exit import multiprocessing # for multiprocessing purpose import re...
render.py
# Copyright (c) 2021-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # import atexit import io import logging import tempfile from base64 import b64encode from typing import List, Optional import imageio import matpl...
bot_server.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import sys sys.path.append('../../') from convlab.agent import Body from convlab.agent import DialogAgent from convlab.spec import spec_util from convlab.env import make_env import numpy as np import copy from flask import Flask, reque...
main.py
# -*- coding: utf-8 -*- import keyboard import os import threading import time from adjacent import is_adjacent, adjacent_rate from tkinter import * from queue import Queue from predict import predict from functools import partial import numpy as np global keyboard_stream ''' [keyname, event, time] ''' keyboard_stream...
master_duel_auto_scan_version.py
import os from re import M import sys from threading import Thread import time from PIL import Image, ImageFile import dhash import sqlite3 import win32api import win32process import win32gui import win32ui import win32con import win32print from ctypes import windll import keyboard ImageFile.LOAD_TRUN...
exoscale.py
import json from cs import CloudStack, read_config import argparse import os import paramiko import base64 import multiprocessing from collections import OrderedDict from scp import SCPClient import time def print_pretty(json_data): print(json.dumps(json_data, indent=4, sort_keys=True)) cs = CloudStack(**read_c...
segment.py
#!/shared/xudongliu/anaconda3/envs/f_torch04/bin/python import argparse import json import logging import os import threading from os.path import exists, join, split, dirname import time import numpy as np import shutil import sys from PIL import Image import torch import torch.utils.data from torch import nn impor...
basher.py
from subprocess import Popen, PIPE from threading import Thread SHELL = False CMD = ['/bin/bash', '-i'] # CMD = ['/usr/local/bin/python3.7', '-i'] def main(): sub = Popen(CMD, stdin=PIPE, stdout=PIPE, stderr=PIPE, encoding='utf8') def new_thread(stream, prefix): def read(): line = '.' ...
acs_client.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
debug_publisher.py
#!/usr/bin/env python3 import threading import rospy from std_msgs.msg import Float64, Int32 from sensor_msgs.msg import JointState class Control: n = 0 def get_keyboard_input(self): while(True): inp = input("type something ") #print("key: " + inp) if(inp == "quit"): ...
task_queue.py
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import logging import queue import sys import threading import time from sqlalchemy.exc import ProgrammingError, OperationalError from flexget.task import TaskAbort log = log...
dijk_inner_mp.py
import random import time import sys import multiprocessing from multiprocessing import Lock,Process,Semaphore,Barrier,Array,Queue INT_MAX = multiprocessing.Value('i',1000000000) #N=multiprocessing.Value('i',16384) #DEG=multiprocessing.Value('i',16) #P=multiprocessing.Value('i',2) q = multiprocessing.Queue() N1=int(s...
client.py
import json import base64 import requests import threading from uuid import UUID from os import urandom from time import timezone, sleep from typing import BinaryIO from binascii import hexlify from time import time as timestamp from locale import getdefaultlocale as locale from .lib.util import exceptions, headers, ...
test_persistent_invoker.py
import datetime import threading import time import pytest from edera import routine from edera.exceptions import ExcusableError from edera.invokers import PersistentInvoker def test_invoker_runs_action_with_given_delay(): @routine def append_current_timestamp(): counter[0] += 1 yield ...
Hiwin_RT605_ArmCommand_Socket_20190627164039.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import numpy as np from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * from std_msgs.msg import Int32MultiArray import math import enum pos_feedback_times = 0 mode_feedback_times = 0 msg_feedback = 1 #接收策略端...
test_server.py
import asyncio import json import os import time import urllib.parse import uuid import sys from http import HTTPStatus from multiprocessing import Process, Manager from multiprocessing.managers import DictProxy from pathlib import Path from typing import List, Text, Type, Generator, NoReturn, Dict, Optional from unitt...
unnamed.py
""" this class is the base class for all things like enemies, and characters. """ import pygame as pg import threading class IDontKnowWhatToCallItYet: def start_thread(self, **kwargs): self.mainthread = threading.Thread( target=self.mainloop, daemon=True, **kwargs) self.mainthread.sta...
__init__.py
from __future__ import absolute_import from __future__ import with_statement import socket import sys from collections import deque from datetime import datetime, timedelta from Queue import Empty from kombu.transport.base import Message from kombu.connection import BrokerConnection from mock import Mock, patch from...
test_utils.py
from __future__ import print_function, division, absolute_import from collections import Iterator from functools import partial import io import logging import socket from time import sleep from threading import Thread import threading import traceback import pytest from tornado import gen from tornado.ioloop import ...
test_api_client_factory.py
import unittest from collections import UserString from datetime import datetime from unittest.mock import patch from urllib3 import PoolManager, ProxyManager from parameterized import parameterized from threading import Thread from lusid import (InstrumentsApi, ResourceListOfInstrumentIdTypeDescriptor, ...
dataRecord.py
# 用户取消了更新数据库操作 import logging.config import os import queue import sqlite3 import sys import threading from datetime import datetime import cv2 from PyQt5.QtCore import pyqtSignal, QTimer, QRegExp from PyQt5.QtGui import QIcon, QImage, QPixmap, QTextCursor, QRegExpValidator from PyQt5.QtWidgets import QWidget, QApplic...
pydoc.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
test_logging.py
# Copyright 2001-2017 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...
sniffer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import pwd import sys # import curses import random import signal from loguru import logger from functools import wraps from scapy.all import * import pyric.pyw as pyw from boop.lib import * from boop.lib.types import * from boop.lib.channels import * from bo...
core.py
import logging from threading import Thread import gym from gym.wrappers import Monitor import chi import tensortools as tt from chi_rl import get_wrapper from tensortools.util import output_redirect from time import time import numpy as np class Agent: def __init__(self, generator, name=None, logdir=None): ...
EnvSetup.py
#!/usr/bin/env python import os import paramiko import argparse import subprocess import time import threading #Constants RemoteHomeDir = "/users/nigo9731/" RemoteDir = "/users/nigo9731/Test/" RemoteUser = "nigo9731" LibPath = "/usr/local/lib/" def scp(direction, localFile, user, server, path): if direction == True...
run_mnemonic.py
# Plutus Bitcoin Brute Forcer # Made by Isaac Delly # https://github.com/Isaacdelly/Plutus import multiprocessing import bitcoinlib import plutus import oldKeyGen import newKeyGen def main(database): print('Working...') while True: # Mnemonic words = bitcoinlib.mnemonic.Mnemonic().generate() key = bitco...
server_request_header.py
''' A HTTP server 1. create a socket 2. bind & reuse addr 3. listen 4. while True: 4.1 accept 4.2 new client comes=> create a new process to handle it ''' import socket import multiprocessing def handle_client(client_socket,client_addr): ''' A function that handles the c...
kernel.py
from queue import Queue from threading import Thread from ipykernel.kernelbase import Kernel import subprocess import tempfile import os import os.path as path class RealTimeSubprocess(subprocess.Popen): """ A subprocess that allows to read its stdout and stderr in real time """ def __init__(self, c...
baiduimagedownload.py
# coding:utf-8 # python 2.7.5 # # 获取一些百度图片 # 1.指定标签 # 2. # http://image.baidu.com/channel/listjson?pn=0&rn=1000&tag1=%E6%98%8E%E6%98%9F&tag2=%E5%BC%A0%E5%AD%A6%E5%8F%8B&ftags=&sorttype=0&ie=utf8&oe=utf-8&image_id=692147105 # 这是获取列表的方式 # pn 分页标识 # rn 页面内图片数量 # tag1 主标签 # tag2 分标签 # 其他字段暂时不管 # # 3.返回的内容json 转字典 # 4.取dow...
manager_godbless.py
""" This is the client file for part1. You can input texts to send to the server and then the server will echo the message back. author: Yuhang Sun assignment: PA1 """ # !pip install torch import socket from threading import Thread from PIL import Image import torchvision.transforms as transforms g_so...
scheduler_job.py
# -*- coding: utf-8 -*- # # 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 #...
test_examples.py
# Copyright 2017 MongoDB, 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, so...
ipu_multi_worker_strategy_test.py
# Copyright 2019 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...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developed and maintained by the Spyder Proj...
main.py
# ============================================================================== # run this file to run the bot # ============================================================================== from commands_help import * ''' # uncomment if you want to run in cloud app = Flask('') @app.route('/') def home(): return ...
convert_long.py
import os, csv, threading, subprocess, sys tempo = 96 * 4 def write_music(music1, length): return '''0, 0, Header, 1, 2, 480 1, 0, Start_track 1, 0, Title_t, "Test" 1, 0, Time_signature, 3, 3, 96, 8 1, 0, Tempo, 300000 1, 0, End_track 2, 0, Start_track 2, 0, Instrument_name_t, "Church Organ" 2, 0, Program_c, 1, ...
TTNv3Collector.py
import os import threading import json import pycurl from datetime import datetime from time import sleep import dateutil.parser import auditing.datacollectors.utils.PhyParser as phy_parser from auditing.datacollectors.BaseCollector import BaseCollector from auditing.datacollectors.utils.PacketPersistence import save, ...
_helper.py
# Copyright 2016-2019 IBM Corp. 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...
_poller.py
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), ...
irc.py
import logging log = logging.getLogger(__name__) import signal import socket import ssl import threading import botologist.util import botologist.protocol def get_client(config): nick = config.get('nick', 'botologist') def _make_server_obj(cfg): if isinstance(cfg, dict): return Server(**cfg) elif isinstan...
scheduler.py
import schedule import time import threading from random import randrange import json from flask import Flask,request,jsonify import random import json import requests import argparse from datetime import datetime import pickle app = Flask(__name__) service_life_cycle_ip = "127.0.0.1" service_life_cycle_port = 8080...
runner.py
import argparse import datetime import colors import docker import json import multiprocessing import numpy import os import psutil import requests import sys import threading import time import traceback from ann_benchmarks.datasets import get_dataset, DATASETS from ann_benchmarks.algorithms.definitions import (Defi...
text.py
#!/usr/bin/python # (c) 2018 Jim Hawkins. MIT licensed, see https://opensource.org/licenses/MIT # Part of Blender Driver, see https://github.com/sjjhsjjh/blender-driver """Python module for Blender Driver demonstration application. This module can only be used from within the Blender Game Engine.""" # Exit if run othe...
download_arxiv_daily.py
import requests import time import pandas as pd from bs4 import BeautifulSoup import os import random import numpy as np from tqdm import tqdm from utils.multi_download import download import multiprocessing as mp from downloader.gather_info import create_markdown # AOverview from paperparse import std_parse_doc as sp...
_common.py
# Copyright 2017 gRPC 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 writing...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
vipfile_test.py
"""Unit test for vipfile. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import io import os import shutil import tempfile import threading import unittest # Disable W0611: Unused import import tests.treadmill_t...
face_recognition.py
# # Face Recognition authorisation # An OpenCV based Local Binary Pattern Histogram (LBPH) face Recognition # authorisation system with arduino support for door locks. # # created by Rajas Chavadekar on 03.08.2020, Pune, India # github.com/rvcgeeks linkedin.com/in/rvchavadekar # import cv2, os from sys import argv...
helpers.py
""" This file contains various helpers and basic variables for the test suite. Defining them here rather than in conftest.py avoids issues with circular imports between test/conftest.py and test/backend/<backend>/conftest.py files. """ import functools import logging import multiprocessing import os import subprocess...
server.py
#!/usr/bin/python3 import os import time import queue import eventlet import threading from flask import Flask, render_template, request, send_from_directory, Response, send_file from flask_socketio import SocketIO statusQueue = eventlet.Queue() app = Flask(__name__, static_url_path="") socketio = SocketIO(a...
robot.py
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. # # This file is part of ewm-cloud-robotics # (see https://github.com/SAP/ewm-cloud-robotics). # # This file is licensed under the Apache Software License, v. 2 except as noted # otherwise in the LIC...
bsl2.py
#!/usr/bin/python3 # C:\Work\Python\HID_Util\src\HID_recorder.py from binascii import hexlify import sys import argparse import threading from time import perf_counter as timer # import include_dll_path import hid # import os # BOARD_TYPE_MAIN = 0, # BOARD_TYPE_JOYSTICKS = 1, # BOARD_TYPE_TOOLS_MASTER = 2, # BOARD_TY...
wk8.py
import os, re, threading import bs4, requests as R from bs4 import BeautifulSoup as Soup from lib import epub from lib.logger import getLogger from lib.constants import * def req(method : str, url : str, headers : dict = {}, payload : dict = {}, cookies = None): return R.request(method, url, headers = headers | US...
test_system.py
# Copyright 2016 Google LLC 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 ag...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import threading import time import random from test import support from test.support import script_helper, ALWAYS_EQ # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None #...
tests.py
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import absolute_import import datetime import threading from django.conf import settings from django.core.management.color import no_style from django.core.exceptions import ImproperlyConfigured from django.db import (backend,...
qlogtable.py
#!/usr/bin/env python ############################################################################# ## # This file is part of Taurus ## # http://taurus-scada.org ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Taurus is free software: you can redistribute it and/or modify # it under the terms of t...
vnokex.py
# encoding: UTF-8 import hashlib import zlib import json from time import sleep from threading import Thread import websocket from HttpMD5Util import buildMySign, httpGet, httpPost # OKEX网站 OKEX_USD_SPOT = 'wss://real.okex.com:10441/websocket' # OKEX 现货地址 #OKEX_USD_SPOT = 'wss://47.90.109.236:10441...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform i...
keepalived_state_change.py
# Copyright (c) 2015 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 # # Unless required by applicable law or a...
__init__.py
import threading from fastapi import FastAPI from fastapi.responses import FileResponse import uvicorn import os from PIL import Image app = FastAPI() @app.get('/tictactoe/{gameID}') async def getGameImage(gameID: str): folderPath = './modules/tic_tac_toe/src/tictactoe_images' image = f'{folderPath}/{gameID}.png'...
configuration.py
import copy import multiprocessing as mp import os import re import shutil import stat import time from io import StringIO from ipaddress import ip_network as str2ip from typing import Dict from typing import List from typing import NoReturn from typing import Optional from typing import Text from typing import TextIO ...
variable_scope.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...
simulation.py
''' Created on Oct 12, 2016 @author: mwittie ''' import network import link import threading from time import sleep ##configuration parameters router_queue_size = 0 #0 means unlimited simulation_time = 1 #give the network sufficient time to transfer all packets before quitting if __name__ == '__main__': object_L...
helpers.py
# -*- coding: utf-8 -*- ''' :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers ''' # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
_test_cli_main.py
from kthread import KThread from os.path import join, dirname, abspath from os import remove from unittest import TestCase from click.testing import CliRunner from ariesk.cli import main from ariesk.search_server import ( SearchServer, SearchClient, ) GRID_COVER = abspath(join(dirname(__file__), 'small_grid...
benchmarker.py
from setup.linux.installer import Installer from benchmark import framework_test import os import json import subprocess import time import textwrap import pprint import csv import sys import logging import socket import glob from multiprocessing import Process from datetime import datetime class Benchmarker: ####...
multi_group.py
# -*-coding:utf-8-*- # Copyright (c) 2020 DJI. # # 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
R1.py
import socket import threading import time import sys # Define constant parameters ALL_CONN = [8080,8181,8282,8383] SERVER_PORT = 8080 IP_ADDR = "127.0.10.1" ADDR = (IP_ADDR,SERVER_PORT) CLIENT_ADDR = list(IP_ADDR) CLIENT_ADDR[-1] = str(int(CLIENT_ADDR[-1]) + 1) CLIENT_ADDR = "".join(CLIENT_ADDR) CONFIG_PATH = "con...
kv.py
import textwrap as _textwrap import threading as _threading import weakref as _weakref from collections import (namedtuple as _namedtuple, deque as _deque, OrderedDict as _OrderedDict) from collections.abc import (Mapping as _Mapping, Mutabl...
cli_main.py
from threading import Thread, Event from copy import copy import json import queue from Macro import SetNext, Elements, Bases, get_working_area # Run only in cli mode, not for gui. # Will refactor UI to CLI once complete. test_loc = 'Sequence_Sample/discoveryI.json' def loadJson(location: str): if location is N...
main.py
import binascii from romTables import ROMWithTables import shlex import randomizer import logic import spoilerLog import re from argparse import ArgumentParser, ArgumentTypeError def goal(goal): if goal == "random": goal = "-1-8" elif goal in ["seashells", "raft", "bingo", "bingo-full"]: retur...
file_server.py
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
license_plate_service.py
# license plate service class from threading import Thread from get_system_uptime import get_system_uptime import copy class licensePlateService: def __init__(self, detection_box_reference, db_reference): self.detection_box_reference = detection_box_reference self.db_reference = db_reference self.stopped = F...
__init__.py
from __future__ import print_function from builtins import input import sys import time import cancat import struct import threading import cancat.iso_tp as cisotp # In 11-bit CAN, an OBD2 tester typically sends requests with an ID of 7DF, and # can accept response messages on IDs 7E8 to 7EF, requests to a specific...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage from electrum.wallet import Wallet, InternalAddressCorruption from electrum.paymentrequest import ...
reader.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: AGPL-3.0 import arvados import itertools import queue import threading from crunchstat_summary import logger class CollectionReader(object): def __init__(self, collection_id): self._collection_id = collection_id ...
FlappyBird - Windows [3.0.5].py
''' FlappyBird Version 2.9.3 on Windows ''' #Program for python 3.5 try: from tkinter import * #needed tkinter module from tkinter import messagebox, filedialog import tkinter.ttk as t except ImportError: raise ImportError("You need to install tkinter module for python3.5") from random import randint im...
word2vec.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Deep learning via word2vec's "skip-gram and CBOW models", using either hierarchical softmax or negative sampling [1]_ [2]_. The train...
virustotal_scan.py
from virustotal_python import Virustotal from tkinter import ( Tk, Label, Button, Menu, Canvas, PanedWindow, Frame, Scrollbar, Listbox, Checkbutton, ) from tkinter.filedialog import ( askdirectory, askopenfilename, askopenfilenames, asksaveasfilename, ) from tk...
main.py
import asyncio import sys import threading from monkey_patched.game import Game # Init components game = Game() def start_server(loop): from backend.server import main threading.Thread(target=main, args=(loop,)).start() def test_server(loop, rand_sleep=False): from api_tester import ApiTester th...
SquidNetBot.py
#-----SquidNet-Bot-Script-----# import socket, time, os, threading, urllib.request, shutil, sys, random, base64, sqlite3, json, subprocess, re, shutil, ctypes from datetime import datetime, timedelta try: from pynput.keyboard import Listener # pip install pynput except: pass try: import win32crypt...