source
stringlengths
3
86
python
stringlengths
75
1.04M
app.py
""" Main Kivy application """ import asyncio import os from logging import getLogger from threading import Thread from sys import platform as _platform from tesseractXplore.settings import read_settings # Set GL backend before any kivy modules are imported os.environ['KIVY_GL_BACKEND'] = 'sdl2' # Set Textprovider bac...
experiment.py
import atexit import logging from pathlib import Path import socket from subprocess import Popen from threading import Thread import time from typing import Optional, Union, List, overload, Any import colorama import psutil import nni.runtime.log from nni.runtime.msg_dispatcher import MsgDispatcher from nni.tuner imp...
test_controller.py
from threading import Thread, Event from unittest.mock import Mock import queue import pytest from mitmproxy.exceptions import Kill, ControlException from mitmproxy import controller from mitmproxy import master from mitmproxy import proxy from mitmproxy.test import taddons class TMsg: pass class TestMaster: ...
logger.py
from datetime import datetime import threading class Logger: _instance = None def __init__(self): self.commands = { '17': 'Alternar Lâmpada 01', '18': 'Alternar Lâmpada 02', 'Register': 'Cadastrar cliente', 'ToggleAlarm': 'Alternar alarme' } ...
ops_test.py
# https://github.com/tensorflow/tensorflow/issues/27023 import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("ignore", category=FutureWarning) import random import string import tempfile import os import contextlib import json import urllib.request import...
test_runner.py
""" This is the test runner. It registers itself with the dispatcher when it first starts up, and then waits for notification from the dispatcher. When the dispatcher sends it a 'runtest' command with a commit id, it updates its repository clone and checks out the given commit. It will then run tests against this vers...
watch.py
#!/usr/bin/env python3 import glob import os import datetime import time from subprocess import run, PIPE, STDOUT, TimeoutExpired import sys import threading from collections import deque from utils import * import re WIDTH = 30 def solve(test_input, timeout=3): """Run sol.py on the input and return the output (or...
scExecute.py
#!/bin/env python3 import sys import os import os.path import glob import copy import traceback import re import csv import tempfile import urllib.request, urllib.parse, urllib.error import shutil import atexit import subprocess import time import math from collections import defaultdict, Counter from os.path import jo...
ffmpeg_module.py
import os from . import constant as const import threading from . import util def split_media_section(code:str): os.system(code) def split_media(name:str, sections:list): head_frame_list = [1] + sections tail_frame_list = sections + [None] codes = [] util.append_log('\n\n==========split_times=====...
Audio_server.py
import socket import threading class Server: def __init__(self): self.ip = input('Enter IP to run the server on: ') print('IP to connect: '+self.ip) while 1: try: self.port = 20000 self.s = socket.socket(socket.AF_INET, socket.SOCK_STR...
multiprocessing_utils.py
''' Copyright 2017, Fujitsu Network Communications, 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 w...
email.py
from flask import current_app as app import flask from flask_mail import Message from flask_mail import Mail from threading import Thread def send_email(subject, sender, recipients, body): def send_async_email(msg, app): with app.app_context(): mail = Mail(app) mail.send(msg) m...
reflector.py
# specifically use concurrent.futures for threadsafety # asyncio Futures cannot be used across threads from concurrent.futures import Future from functools import partial import json import time import threading from traitlets.config import LoggingConfigurable from traitlets import Any, Dict, Int, Unicode from kubern...
ultimate_test.py
# -*- coding: utf-8 -*- import random import sys import sys sys.path.insert(0, "/home/stefanopoma97/bot//insta-bot1") print(sys) from glob import glob import schedule from instabot import Bot, utils import os import sys import threading import time import config_file from sys import argv sys.path.append(os.path.join(s...
__main__.py
#!/usr/bin/env python3 # Thanks to # https://gist.github.com/rambabusaravanan/a0811f8c9bff440f06ca04d06abdd363#file-client-py-L4 # https://stackoverflow.com/questions/35344649/reading-input-sound-signal-using-python import os import socket import pyaudio import wave import speech_recognition as sr from threading imp...
test_threading.py
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose, cpython_only from test.script_helper import assert_python_ok import random import re import sys thread = test.test_support.import_module('thread') threading = test.test_support.import_module('threading') import...
wsdump.py
#!e:\pycharmprojects\pythonrotatingdonut\venv\scripts\python.exe """ websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the...
test.py
import argparse import json import os from pathlib import Path from threading import Thread import numpy as np import torch import yaml from tqdm import tqdm from models.experimental import attempt_load from utils.datasets import create_dataloader from utils.general import coco80_to_coco91_class, check_dataset, check...
http_listener.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import json import os import sys from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Event, Thread # Demonstrates code to set up an HTTP listener and receive log events RECEIVER_NAME = "...
UPS_Main.py
# Universal Power System Controller # USAID Middle East Water Security Initiative # # Developed by: Nathan Webster # Primary Investigator: Nathan Johnson # # Version History (mm_dd_yyyy) # 1.00 07_13_2018_NW # ###################################################### # Import Libraries from threading import Thread from PW...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
test_backend.py
import pytest from threading import Thread from time import sleep from tempfile import NamedTemporaryFile import os from test.files import file_utils from src.backend import backend from src.gui import icons, widgets def test_(): pass class Contexts: class JobsContext: def __init__(self): ...
server.py
#!/usr/bin/env python """ Dummy server used for unit testing. """ from __future__ import print_function import logging import os import random import string import sys import threading import socket import warnings import ssl from datetime import datetime from urllib3.exceptions import HTTPWarning import tornado.ht...
v2.5.py
#!/usr/bin/env python #version: 2.5 beta import threading import argparse import random import atexit import socket import socks import time import ssl import sys import os start_time = 0 active_connections = 0 connection_limit = 0 active_threads = 0 max_threads = 100 delay = 1 ups = 0 total_ups = 0 dps = 0 total_dps...
oper.py
#!/usr/bin/python # -*- coding: utf-8 -* # Copyright: [CUP] - See LICENSE for details. # Authors: Zhao Minghao, Guannan Ma """ :description: shell operations related module """ import os import time import sys import shutil import signal import random import hashlib import platform import warnings import datetime ...
whatsapp.py
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from os import system import datetime from selenium import webdriver import time import threading class Ui_MainWindow(QMainWindow): def se...
minimizer.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
unipolarDirect.py
#!/usr/bin/env python3 """ base module for driving unipolar stepper via simple darlington drivers. For example the el cheapo box of 10 28BYJ-48 steppers with little ULN2003A based driver boards """ import pigpio import threading, queue import time import treedict import appregs def StartMotor(**kwargs): t=Simpl...
pricesListing.py
print('Importing sources ...') from typing import Type from sniffer import protocol from colorama import Fore from win32 import win32gui import win32com.client as client import pyautogui as ag import pyperclip import json import locale, sys, os import threading from time import sleep from math import pow,...
__init__.py
""" Create ssh executor system """ import base64 import binascii import copy import datetime import getpass import hashlib import logging import multiprocessing import os import queue import re import subprocess import sys import tarfile import tempfile import time import uuid import salt.client.ssh.shell import salt...
main.py
#!/usr/bin/env python3 import threading import netifaces as ni import numpy as np import math import time import serial import socket import fcntl import struct import threading as th ############## # PWM Declarations (PWM occurs on Arduino)# ############## #General configs maxTurnAngle=31 #in degrees stopTurnPWM=1500...
tello.py
import threading import socket import time import datetime import struct import sys import os 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 log = logger.Logger('Tello...
benchmark-gym.py
# Copyright (c) 2017-present, Facebook, Inc. # 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. An additional grant # of patent rights can be found in the PATENTS file in the same directory. #!/usr/bin/env python # ...
server_test.py
import os from datetime import timedelta import signal import threading import timeit import unittest from python.service.server import Server class ServerTestCase(unittest.TestCase): def test_timely_shutdown(self): server = Server(address="127.0.0.1:0") server.start() start = timeit.def...
test_io.py
import sys import gc import gzip import os import threading import time import warnings import io import re import pytest from pathlib import Path from tempfile import NamedTemporaryFile from io import BytesIO, StringIO from datetime import datetime import locale from multiprocessing import Process, Value from ctypes i...
__init__.py
import io import os import pathlib import socket import threading import time from abc import ABC, abstractmethod from contextlib import contextmanager from datetime import datetime from multiprocessing import Process from queue import Queue from typing import Optional, Union, Dict, Tuple, IO from platypush.config im...
deploy.py
import sys import subprocess from docker_honey.util import * from docker_honey.collector_actions import * from docker_honey.commands import * from docker_honey.consts import GLOBAL_NOTIFIER as NOTIFIER from docker_honey.consts import * from docker_honey.notify import * from docker_honey.simple_commands.app import Hyper...
kb_ReportMetricsServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
controllers.py
import cherrypy, os, threading from mako.template import Template from util import htmlparser from util import naivebayes prediction_data = None def getTemplatePath(template_name): return os.path.join(template_name) class Index: @cherrypy.expose def index(self): return "Index page. Nothing to ...
online.py
#!/usr/bin/env python # coding=utf-8 # -- flask -- import flask from flask import Flask from flask import url_for, make_response, redirect, render_template, request from werkzeug.routing import BaseConverter class RegexConverter(BaseConverter): def __init__(self, map, *args): self.map = map self....
test_multiprocess.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt import os import sys import multiprocessing import platform import unittest from .cmdline_tmpl import CmdlineTmpl file_parent = """ import subprocess subpr...
server.py
import socket import select import threading import json import time from ast import literal_eval as make_tuple from chatRoom import ChatRoom import random import sys class Server(): def __init__(self, header_len, ip, port, broadcast_port) -> None: self.HEADER_LENGTH = header_len self.IP = ip ...
test_kudu.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
utils_test.py
#!/usr/bin/env python # Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. # Disable 'Access to a protected member ...'. NDB uses '_' for other purposes. # pylint: disable=W0212 import datetime impo...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import threading_helper from test.support import verbose, cpython_only, os_helper from test.support.import_helper import import_module from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys i...
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...
server_utils_test.py
# Lint as: python3 # Copyright 2020, The TensorFlow Federated 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 ...
__init__.py
from __future__ import annotations import collections from datetime import datetime from functools import wraps import operator import os import re import string from typing import ( TYPE_CHECKING, Callable, ContextManager, Counter, Iterable, List, Type, ) import warnings import numpy as n...
transfer.py
#!/usr/bin/env python """ Downloads files to temp locations. This script is invoked by the Transfer Manager (galaxy.jobs.transfer_manager) and should not normally be invoked by hand. """ import ConfigParser import json import logging import optparse import os import random import SocketServer import sys import tempfil...
report.py
# some calculations about corona values # start date somewhen in 3/2020 # added multiprocessing in 6/2020 import pandas as pd import matplotlib.pyplot as plt from multiprocessing import Process # process files with these suffixes localSuffixes = ["BW", "BY", "GER", "WORLD", "US"] # flexinterval flexInt = 7 def p...
fixtures.py
import sys import os import logging from pony.py23compat import PY2 from ponytest import with_cli_args, pony_fixtures, provider_validators, provider, Fixture, \ ValidationError from functools import wraps, partial import click from contextlib import contextmanager, closing from pony.utils import ...
multiThreadingRaceCondition.py
import threading # global variable x x = 0 def increment(): """ function to increment global variable x """ global x x += 1 def thread_task(): """ task for thread calls increment function 100000 times. """ for _ in range(100000): increment() def main_task(): g...
server.py
import socket import threading from functools import reduce def string2hex(s): List=[] for ch in s: st2hx = hex(ord(ch)).replace('0x','') if(len(st2hx)==1): st2hx = '0' + st2hx List.append(st2hx) return reduce(lambda i, j: i+j, List) def xor(a: str, b: str) -> str: return bin(...
server_constructor.py
import socket,random,os,sys,time sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname("server_constructor")))) from urllib import parse from itertools import cycle from queue import Queue from threading import Lock, Thread from typing import List, Tuple, Callable, NoReturn from korean_name_generator import n...
wfarm.py
#!/bin/python3 import requests import argparse from html.parser import HTMLParser from queue import Queue import threading class WFarm(): class CustomHTMLParser(HTMLParser): def __init__(self, nextUrls, url, args, wordsFound): HTMLParser.__init__(self) self.nextUrls = nextUrls ...
client.py
import json import os import tempfile import threading import time import fedn.common.net.grpc.fedn_pb2 as fedn import fedn.common.net.grpc.fedn_pb2_grpc as rpc import grpc # TODO Remove from this level. Abstract to unified non implementation specific client. from fedn.utils.dispatcher import Dispatcher CHUNK_SIZE = ...
retropie_SafeShutdown_gpi2.py
import RPi.GPIO as GPIO import os import time from multiprocessing import Process #initialize pins powerPin = 26 #pin 5 #ledPin = 14 #TXD #resetPin = 2 #pin 13 powerenPin = 27 #pin 5 #initialize GPIO settings def init(): GPIO.setmode(GPIO.BCM) GPIO.setup(powerPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) #GPIO.setup(res...
test_callbacks.py
import os import multiprocessing import numpy as np import pytest from numpy.testing import assert_allclose from csv import reader from csv import Sniffer import shutil from keras import optimizers from keras import initializers from keras import callbacks from keras.models import Sequential, Model from keras.layers i...
RtaExtractor.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This script: 1 - starts dcm4che to receive images from remote PACS. 2 - reads txt files containing feature list to identify research profiles consisting of the interesting attributes. 3 - grabs one instance per series and extract the metadata for the ident...
Urlscan_test.py
import time from threading import Thread import pytest import demistomock as demisto import json RETURN_ERROR_TARGET = 'UrlScan.return_error' SCAN_URL = 'https://urlscan.io/api/v1/scan/' RESULT_URL = 'https://urlscan.io/api/v1/result/' @pytest.mark.parametrize('continue_on_blacklisted_urls', [(True), (False)]) def ...
app_state.py
# Electrum SV - lightweight Bitcoin SV client # Copyright (C) 2019 The Electrum SV Developers # Copyright (C) 2012 thomasv@gitorious # # 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 ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
http_server.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
keylib.py
# === keylib.py === # * Function: contains keyboard event related functions. # * # * This is part of Christian D'Abrera's engineering final # * year project titled "EMG Bio-feedback for rehabilitation". # * # * Christian D'Abrera # * Curtin University 2017 # * christian.dabrera@student.curtin.edu.au # * chrisdabrera@gm...
device.py
# Copyright 2018 Jetperch LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
test_issue209.py
import rdflib import unittest import threading def makeNode(): i = 0 while i < 9999: i += 1 rdflib.term.BNode() class TestRandomSeedInThread(unittest.TestCase): def test_bnode_id_gen_in_thread(self): """ """ th = threading.Thread(target=makeNode) th.daemon = True ...
test_local_lambda_invoke.py
import threading import shutil import random from mock import Mock import time from unittest import TestCase import os import requests from samcli.local.lambda_service.local_lambda_invoke_service import LocalLambdaInvokeService from tests.functional.function_code import nodejs_lambda, HELLO_FROM_LAMBDA, ECHO_CODE, TH...
dance.py
import time from pydub import AudioSegment from pydub.playback import play from threading import Thread import sched from agility.main import Agility from cerebral.pack1.hippocampus import Android song = AudioSegment.from_mp3('tiger.mp3') song = song[570:] # 570 agility = Agility(Android.robot) s = sched.scheduler() ...
python_queue.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '进程间通讯' __author__ = "garyhu" import time,os,random; from multiprocessing import Process,Queue; # 写进程执行的代码 def write(q): print('Process(%s) is writing. ' % os.getpid()); for value in ['A','B','C','D']: print("Put %s to queue." % value) q.pu...
myBlockChain.py
import hashlib import time import csv import random from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn import json import re from urllib.parse import parse_qs from urllib.parse import urlparse import threading import cgi import uuid from tempfile import NamedTemporaryFile...
sqlite_manager_server.py
# coding=utf-8 # 解决py2.7中文出现write错误的问题 import sys import threading import time reload(sys) sys.setdefaultencoding('utf-8') # 解决py2.7中文出现write错误的问题 # from multiprocessing.managers import BaseManager from multiprocessing import Pipe import Queue import sqlite3 pipe_notify_map = {} def get_callback_pipe(transaction...
main.py
# HTFTP v0.1.1 import http.server import socketserver import os import sys import socket import threading import logging import threading from datetime import datetime from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import FTPServer from pyftpdlib.authorizers import WindowsAuthorizer c...
single_http.py
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from SocketServer import ThreadingMixIn import threading import argparse import re import cgi import sample_func class LocalData(object): records = {} class HTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self): if None != re.search('/gets...
service.py
# -*- coding: utf-8 -*- import sys, json, binascii import xbmc from lib.yd_private_libs import util, servicecontrol, jsonqueue sys.path.insert(0,util.MODULE_PATH) import YDStreamExtractor import threading class Service(xbmc.Monitor): def __init__(self): self.downloadCount = 0 self.controller = serv...
bucket-size-report.py
import boto3 import json import os from multiprocessing import Process, Pipe from botocore.exceptions import ClientError class BucketsParallel(object): """Finds total object size for all buckets""" def __init__(self, creds=''): if creds: self.s3 = boto3.client('s3', region_name='us-east-1', a...
update.py
#!/usr/bin/env python # Copyright (C) 2012-2015, Code for America # This is open source software, released under a standard 3-clause # BSD-style license; see the file LICENSE for details. import os import math import datetime import smtplib from email.mime.text import MIMEText from threading import Thread from optpar...
engine.py
import pyaudio import threading import time import argparse import wave import torchaudio import torch import numpy as np from neuralnet.dataset import get_featurizer from threading import Event class Listener: def __init__(self, sample_rate=8000, record_seconds=2): self.chunk = 1024 self.sample_...
TCPServer.py
# encoding:UTF-8 import socket import threading import time __author__ = 'Hope6537' # Server # 定义基于TCP和IPV4的协议 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 监听端口: s.bind(('127.0.0.1', 9999)) # 等待连接的最大数量 s.listen(5) # 连接建立后,服务器首先发一条欢迎消息,然后等待客户端数据,并加上Hello再发送给客户端。 # 如果客户端发送了exit字符串,就直接关闭连接。 def tcplink(sock...
parallel.py
""" sphinx.util.parallel ~~~~~~~~~~~~~~~~~~~~ Parallel building utilities. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import time import traceback from math import sqrt from typing import Any, Callable, Dict, List, Option...
setting.py
import LED_display as LED import threading import keyboard import time import numpy as np import random import copy import os iScreen = [[0 for x in range(32)] for x in range(16)] #X = pygcurse.PygcurseWindow(32,16, fullscreen=False) class Card: coord = None color = None count = None ...
trustedcoin.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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...
test_eventdispatcher_multithread.py
# eventpy library # Copyright (C) 2020 Wang Qi (wqking) # Github: https://github.com/wqking/eventpy # 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....
predict_.py
import pymongo from concurrent.futures import ThreadPoolExecutor from sklearn.externals import joblib import logging import time,datetime import pandas as pd import numpy as np from scipy import stats import threading """ 预测器,主要是用来预测,目前线上就是这个版本。 """ logger = logging.getLogger(__name__) logger.setLevel(level=logging....
installwizard.py
# Copyright (C) 2018 The ElectrumSys developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE...
twitterbattlegame.py
from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json import threading import sys import pygame import os if len(sys.argv) == 3: search_strings = [sys.argv[1],sys.argv[2]] else: print("Usage: twitterbattlegame.py [TREND1_STRING] [TREND2_STRING]") sys.exit...
mpc.py
import os.path import re import time import threading import _thread from functools import wraps import win32con, win32api, win32gui, ctypes, ctypes.wintypes #@UnresolvedImport @UnusedImport from syncplay import constants from syncplay.messages import getMessage from syncplay.players.basePlayer import BasePlayer fr...
configuration_handler.py
# Copyright 2021 IBM 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 agreed t...
test_index.py
import logging import time import pdb import threading from multiprocessing import Pool, Process import numpy import pytest import sklearn.preprocessing from .utils import * from .constants import * uid = "test_index" BUILD_TIMEOUT = 300 field_name = default_float_vec_field_name binary_field_name = default_binary_vec_...
test_issue209.py
import threading import unittest import rdflib def makeNode(): i = 0 while i < 9999: i += 1 rdflib.term.BNode() class TestRandomSeedInThread(unittest.TestCase): def test_bnode_id_gen_in_thread(self): """ """ th = threading.Thread(target=makeNode) th.daemon = True...
socket_utils_tests.py
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework # All trademark and other rights reserved by their respective owners # Copyright 2008-2022 Neongecko.com Inc. # Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds, # Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kiril...
common.py
#! /usr/bin/env python # -*- coding: UTF-8 -*- import hashlib import subprocess import zipfile import requests from util.decorator import * from util.tool.file import File import threading def delay(secs): """和sleep类似,多一个显示剩余sleep时间 :param secs: :return: """ secs = int(secs) for i in reversed...
__init__.py
""" The top level interface used to translate configuration data back to the correct cloud modules """ import copy import glob import logging import multiprocessing import os import signal import sys import time import traceback from itertools import groupby import salt.client import salt.config import salt.loader im...
unify.py
import webbrowser, http.server, os, multiprocessing from jasy.core import Project if "getProjectByName" in dir(Project): projectSource = Project else: projectSource = session appcache_project = projectSource.getProjectByName("appcache") exec(compile(open(os.path.realpath(os.path.abspath(appcache_project.getPa...
zedge_worker.py
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # (c) 2013-2015 Zedge Inc. # # Author: Muhammad A. Norozi # (ali@zedge.net) import os import sys import random import urllib2 import logging import numpy as np from threading import Thread, Lock from Queue import Queue #import zhdfs from zedge_common impo...
tests.py
#! /usr/bin/env python3 import hashlib import http.server import os import shutil import socket import subprocess import tempfile import threading import unittest class WrapperScriptTests(unittest.TestCase): http_port = 8080 minimum_script_dependencies = [ "/usr/bin/bash", "/usr/bin/basename...
delete_loadbalancer_backends.py
#!/usr/bin/env python #coding:utf-8 ''' Created on 2019-03-05 @author: yunify ''' import qingcloud.iaas import threading import time from optparse import OptionParser import sys import os import qingcloud.iaas.constants as const import common.common as Common def delete_loadbalancer_backends(conn,user_id,loadbalance...
view_audio.py
#!/usr/bin/env python3 ################################################################################################### # # Project: Embedded Learning Library (ELL) # File: view_audio.py # Authors: Chris Lovett, Chuck Jacobs # # Requires: Python 3.x, numpy, tkinter, matplotlib # ###########################...
rtest.py
#!/usr/bin/python3 """Copyright (C) 2021 Advanced Micro Devices, Inc. All rights reserved. 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 t...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
player_core.py
# -*- coding:utf8 -*- import time import threading import subprocess class player(object): def __init__(self): print 'init' self.playlist = [] self.handle = None self._start() pass def __del__(self): del self.t pass def _player_thread(self): ...