source
stringlengths
3
86
python
stringlengths
75
1.04M
onsets_frames_transcription_realtime.py
# Copyright 2020 The Magenta 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 ...
test_utils.py
from __future__ import absolute_import import uuid import tempfile import threading import time import unittest import mock #import redis import requests from requests.exceptions import ConnectionError from tornado import ioloop #import zmq from bokeh.tests.test_utils import skipIfPy3 from ..models import user from ...
puyself.py
cl = GYE.LINE() cl.login(token="") cl.loginResult() print "\n[CIE LOGIN CIEEEE]" reload(sys) sys.setdefaultencoding('utf-8') helpmsg ="""╠═════════════════ ╠-> Restart ╠-> Mention ╠-> setpoint on/off ╠-> viewlastseen ╠-> Ulti @ ╠-> Speed ╠-> Time ╠-> Friendlist ╠-> id@en ╠-> en@id ╠-> id@jp\n 「+」\n╠->...
server.py
import socket from select import select from utils import send import pygame import sys import csv from time import time import os import json import threading import config as cfg class Server: def __init__(self, host: str, port: int): self._host = host self._port = port self._to_client_...
test_pool.py
import threading import time from sqlalchemy import pool, select, event import sqlalchemy as tsa from sqlalchemy import testing from sqlalchemy.testing.util import gc_collect, lazy_gc from sqlalchemy.testing import eq_, assert_raises, is_not_ from sqlalchemy.testing.engines import testing_engine from sqlalchemy.testing...
rebound.py
########## ## GLOBALS ########## import urwid import re import sys import os from bs4 import BeautifulSoup import requests from queue import Queue from subprocess import PIPE, Popen from threading import Thread import webbrowser import time from urwid.widget import (BOX, FLOW, FIXED) import random SO_URL = "https://...
osu_music_copier.py
import ctypes import platform import sys import tkinter import webbrowser from queue import Queue from threading import Thread from tkinter import Text, filedialog, ttk from copier_process import copy # osu! Music Copierのリポジトリを開く def openRepository(event): webbrowser.open("https://github.com/ReNeeter/osu-Music-C...
helper.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import lzma import threading import asyncio import websockets from aiohttp import web class MockInsServer(): def __init__(self, port): self.loop = asyncio.new_event_loop() self.port = port self.thread = threading.Thread(target=se...
worker.py
from multiprocessing import Process, Queue from urllib.parse import urlparse import requests import pandas as pd import sqlalchemy as s from sqlalchemy.ext.automap import automap_base from sqlalchemy import MetaData, and_ import statistics, logging, os, json, time import numpy as np import scipy.stats import datetime ...
text_client.py
# Copyright 2017 Mycroft AI 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 writin...
serve.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 appli...
receiver.py
from . animation import Animation from .. util import log import threading from enum import IntEnum class HOST_TYPE(IntEnum): STRIP = 1 MATRIX = 2 CIRCLE = 3 CUBE = 4 HOST_MAP = { 'Strip': HOST_TYPE.STRIP, 'Matrix': HOST_TYPE.MATRIX, 'Circle': HOST_TYPE.CIRCLE, 'Cube': HOST_TYPE.CUBE...
vnhuobi.py
# encoding: utf-8 import urllib import hmac import base64 import hashlib import requests import traceback from copy import copy from datetime import datetime from threading import Thread from queue import Queue, Empty from multiprocessing.dummy import Pool from time import sleep import json import zlib from websocke...
test_multiplexed.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import multiprocessing import time import pytest import thriftpy from thriftpy.protocol import ( TBinaryProtocolFactory, TMultiplexedProtocolFactory ) from thriftpy.rpc import client_context from thriftpy.server import TThreadedServer ...
run.py
from OnlineHeart import OnlineHeart from Silver import Silver from LotteryResult import LotteryResult from Tasks import Tasks from connect import connect from rafflehandler import Rafflehandler import asyncio from login import login import utils from printer import Printer from statistics import Statistics from bilibil...
OscData.py
import argparse import threading import platform from pythonosc import osc_server from pythonosc.dispatcher import Dispatcher from HostnameIp import HostnameIp PLATFORM = platform.machine() if "arm" in PLATFORM: from easygopigo3 import EasyGoPiGo3 # axisA = -255 and 255 # axisB = -255 and 255 # all the others ...
download_from_google_storage.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Download files from Google Storage based on SHA1 sums.""" import hashlib import optparse import os import Queue import re impo...
backend_base.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Cisco and/or its affiliates. # This software is licensed to you under the terms of the Apache License, Version 2.0 # (the "License"). # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # The code, technical ...
test_threads.py
import asyncio import sys import threading import time from concurrent.futures import CancelledError from contextlib import suppress import pytest from anyio import ( create_blocking_portal, create_capacity_limiter, create_event, create_task_group, run_async_from_thread, run_sync_in_worker_thread, sleep, star...
mock_datajson_source.py
from __future__ import print_function import json import logging import os import SimpleHTTPServer import SocketServer from threading import Thread import pkg_resources from ckanext import datajson log = logging.getLogger("harvester") class MockDataJSONHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_...
test_threads.py
import socket import threading import server from helpers import PlainRPCClient class TCPRPCServer(server.SimpleRPCServer): def __init__(self): super(TCPRPCServer, self).__init__(self.my_send) self.sock = None self.conn = None self.t = threading.Thread(target=self.run) self...
test_gauge.py
"""Unit tests for gauge""" from collections import namedtuple import random import re import shutil import tempfile import threading import time import os import unittest from unittest import mock from http.server import HTTPServer, BaseHTTPRequestHandler import yaml import requests from requests.exceptions import ...
test_ccallback.py
from __future__ import division, print_function, absolute_import from numpy.testing import assert_equal, assert_raises, assert_ import time import nose import ctypes import threading from scipy._lib import _ccallback_c as _test_ccallback_cython from scipy._lib import _test_ccallback from scipy._lib._ccallback import ...
train_sampling_unsupervised.py
import dgl import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.multiprocessing as mp import dgl.function as fn import dgl.nn.pytorch as dglnn import time import argparse from dgl.data import RedditDataset from torch.nn.parallel import Dist...
client.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Description: Tirion client ''' import numpy import os import socket import sys import threading from __init__ import __version__ class Client: """Tirion client""" __LOG_PREFIX = "[client]" __TIRION_BUFFER_SIZE = 4096 __TIRION_TAG_SIZE = 513 def __init__(self, soc...
test_tinyurl_link.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import ecstasy import pyperclip import pytest import requests import threading from collections import namedtuple import tests.paths import lnk.tinyurl.link def shorten(url): response = requests.get('http://tiny-url.info/api/v1/create', params=dict(apikey='0BFA4...
saver_tendaac15_httpd.py
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # # 1. Download AC15 Firmware from https://down.tenda.com.cn/uploadfile/AC15/US_AC15V1.0BR_V15.03.05.19_multi_TD01.zip # 2. unzip # 3. binwalk -e US_AC15V1.0BR_V15.03.05.19_multi_TD01.bin # 4. locate squashfs-root # ...
vifi.py
#!/usr/bin/env python3 import logging import os.path import re import time from multiprocessing import Process, JoinableQueue, cpu_count from sys import argv from os import nice import pdb from py2neo import remote from py2neo.database import Graph, Node, Relationship from scapy.all import * from scapy_http.http impo...
mod_modPackInformer.py
# -*- coding: utf-8 -*- import json import os import threading import urllib import urllib2 import BigWorld import ResMgr from gui.Scaleform.daapi.view.dialogs import DIALOG_BUTTON_ID, ConfirmDialogButtons, SimpleDialogMeta from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView from gui import DialogsInterface...
test_legacy.py
'''cping.layouts.legacy tests''' import contextlib import io import re import threading import unittest import cping.layouts.legacy import cping.protocols class TestLayout(unittest.TestCase): '''cping.layouts.legacy.Layout tests.''' def test___call__(self): '''Ensure calling layout properly enters a...
performance_monitor1.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: leeyoshinari import os import re import time import json import copy import queue import traceback import threading from concurrent.futures import ThreadPoolExecutor import requests import influxdb from common import handle_exception, get_ip from l...
threading_2.py
### Create thread instance passing in callable class instance ### import threading from time import sleep, ctime loops = [4,2] class ThreadFunc(object): def __init__(self, func, args, name=""): self.name = name self.func = func self.args = args def __call__(self): self.func(...
__init__.py
import functools import io import logging import mimetypes import os import os.path import posixpath import re import socketserver import threading import time import warnings import wsgiref.simple_server import watchdog.events import watchdog.observers.polling class _LoggerAdapter(logging.LoggerAdapter): def pr...
launchPad.py
# from Device_Level.Framework.Base_Classes import dataPipe # from Device_Level.Framework.Base_Classes import managementPipe # from Device_Level.Framework.Managers.deviceManager import deviceManager # from Device_Level.Framework.Controllers.commandController import CommandController # from Device_Level.Framework.Control...
test_build_api.py
"""Test the kernels service API.""" import threading import time from jupyterlab.tests.utils import LabTestBase, APITester from notebook.tests.launchnotebook import assert_http_error class BuildAPITester(APITester): """Wrapper for build REST API requests""" url = 'lab/api/build' def getStatus(self): ...
serve.py
# -*- coding: utf-8 -*- from __future__ import print_function import abc import argparse import json import logging import os import platform import signal import socket import subprocess import sys import threading import time import traceback from six.moves import urllib import uuid from collections import defaultd...
train_in_thought_game_add_bn.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function USED_DEVICES = "0,1" import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = USED_DEVICES import sys import threading import time import tensorflow as tf import multiproc...
test_runner.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs perf tests. Our buildbot infrastructure requires each slave to run steps serially. This is sub-optimal for android, where these steps can run indepe...
xtp_gateway.py
from typing import Any, Sequence from datetime import datetime from threading import Thread from vnpy.api.xtp.vnxtp import ( XTP, set_async_callback_exception_handler, AsyncDispatchException, OrderBookStruct, XTPMarketDataStruct, XTPQuoteStaticInfo, XTPRspInfoStruct, XTPSpecificTickerSt...
pglet.py
import os import platform import subprocess import re import signal from threading import Thread from time import sleep from .utils import is_windows, which, encode_attr from .connection import Connection from .page import Page pglet_exe = "" def page(name=None, local=False, server=None, token=None, permissions=None,...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 import electrum_rby as electrum from electrum_rby.plugins import BasePlugin, hook from electrum_rby.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin.__...
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 - ...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # 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 restriction, # including witho...
vmrunner.py
""" Terminal Runner class """ __author__ = "Bruno Chianca Ferreira" __license__ = "MIT" __version__ = "0.5" __maintainer__ = "Bruno Chianca Ferreira" __email__ = "brunobcf@gmail.com" import traceback, os, logging, time, subprocess, threading from classes.runner.runner import Runner from core.nodes.base import Core...
review_server.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from flask import Flask, Blueprint, send_file, jsonify, request import os import atexit import signal import csv import ...
bluetooth_server_module.py
import queue import time import threading import bluetooth import math import random import socket import subprocess # for Raspberry Pi shutdown import os class BluetoothServer: # run = True # Argument for shuting down all loops at the same time with input from one device. def __init__(self, list_of_v...
instrument.py
""" Implements some of the functionality of the DATAQ DI-2008 data acquisition module. """ from datetime import datetime, timedelta from enum import Enum import logging import threading from time import sleep from typing import List from serial import Serial from serial.tools import list_ports from serial.serialutil ...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # 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 restriction, # including witho...
RPFrameworkDevice.py
#! /usr/bin/env python # -*- coding: utf-8 -*- #///////////////////////////////////////////////////////////////////////////////////////// #///////////////////////////////////////////////////////////////////////////////////////// # RPFrameworkDevice by RogueProeliator <adam.d.ashe@gmail.com> # Base class for all RogueP...
applications_test.py
import pytest import numpy as np import time import random import os from multiprocessing import Process, Queue from keras.utils.test_utils import keras_test from keras.utils.test_utils import layer_test from keras.utils.generic_utils import CustomObjectScope from keras.models import Sequential from keras import applic...
Chap10_Example10.19.py
from threading import Thread daemonchk = False def disp(): if daemonchk: print('Display function only if it is daemon thread') else: print("Non-daemon thread") threadobj = Thread(target = disp) print("Before setting thread as daemon: ", threadobj.daemon) threadobj.daemon = True if threadobj.dae...
crypto_stream.py
import polygon from polygon import StreamClient, enums import datetime from datetime import datetime import time import threading import config import traceback import requests import redis import json print("starting stream...") key = config.polygon_key def connections(): # redis_pool = redis.C...
line.py
from pysmore.libs import graph, optimizer, embedding, util import multiprocessing as mp ### global variables ### globalVariables = { 'graph': None, 'optimizer': optimizer.get_loglikelihood_loss, 'updater': embedding.update_l2_embedding, 'progress': util.print_progress, 'init_alph...
runbot.py
#!/usr/bin/python import logging import argparse import threading from server import ServerMessageTypes, ServerComms from statemachine import StateMachine import time # Parse command line args parser = argparse.ArgumentParser() parser.add_argument('-d', '--debug', action='store_true', help='Enable ...
utilities.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import socket import time import signal import io import uuid import logging import http.server import socketserver from os import path, chdir from unittest.mock import patch from multiprocessing import Process import contextlib from mockintosh.constants import PR...
relay.py
''' Copyright (c) 2016-2017 Wind River Systems, 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 a...
multi_ps_async_part2.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sys import cPickle as pickle import socket from multiprocessing import Process, Queue, Value, Manager from ctypes import c_char_p from datetime import datetime import time import te...
example_1.py
import time from multiprocessing import Process from threading import Thread import requests def calculate() -> None: for _ in range(50): previous_value = 0 pre_previous_value = 1 current_value = None for _ in range(50_000): current_value = previous_value + pre_previou...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
Runner.py
import threading import time import SpotiAuth import ChordScraper from tkinter import * import codecs def backend_script(): retrieved_song = "none" while True: token = SpotiAuth.token_response2 song, artist, is_playing = SpotiAuth.SpotiAuth.currently_playing(token) if is_playing: ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The CICcoin 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...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest from math import sqrt from torch.multiprocessing import Process from torch....
robot.py
from transport import Transport from protocol import * import threading from config import* from messages import* from time import time as now, sleep import yaml class RobotStatus: def __init__(self, num_joints): self.current_joint_positions = JointPos().resize(num_joints) class Robot: def __init__(se...
__main__.py
# -*- coding: utf-8 -*- # # king_phisher/server/__main__.py # # 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 condition...
decode.py
# fmt: off import os import socket import threading import warnings from collections import UserDict from datetime import datetime, timedelta, timezone from operator import itemgetter from pathlib import Path import pkg_resources import pandas as pd import pyModeS as pms from tqdm.autonotebook import tqdm from typin...
ag_result_server.py
import BaseHTTPServer import SocketServer import cgi import json import threading import logging logger = logging.getLogger('ag_result_server'); from . import config, jprint from db.schema import connection as conn, Assignment, Member, Grade import emailer from redis import Redis from rq import Queue work_queue = Qu...
Client.py
import socket from threading import Thread from tkinter import * client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ip_address = '127.0.0.1' port = 8000 client.connect((ip_address, port)) print("Connected with the server...") class GUI: def __init__(self): self.Window = Tk() self.Window.withdraw() ...
spinner.py
import sys import threading import itertools import time class Spinner: def __init__(self, message, delay=0.1): self.spinner = itertools.cycle(['-', '/', '|', '\\']) self.delay = delay self.busy = False self.spinner_visible = False sys.stdout.write(message) def write_...
instance.py
import atexit import boto3 import time import logging import os import socket import io import sys import threading from botocore.exceptions import ClientError import paramiko from .resources import resources # The ARN of an IAM policy that allows full access to S3. S3_FULL_ACCESS_ARN = "arn:aws:iam::aws:policy/Amazo...
test_setup.py
"""Test component/platform setup.""" # pylint: disable=protected-access import asyncio import logging import os import threading from unittest import mock import voluptuous as vol from homeassistant import setup import homeassistant.config as config_util from homeassistant.const import EVENT_COMPONENT_LOADED, EVENT_H...
__init__.py
# # Unit tests for the multiprocess package # import unittest import queue as pyqueue import contextlib import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import struct import operator import weakref from test import ...
action.py
from threading import Thread from uiautomator import device as d from ctx.generators.util import Adb class Actuator: def execute_in_background(self, recipe): thread = Thread(target=self.execute, args=(recipe,)) thread.start() def execute(self, recipe): for action in recipe['action']:...
test-html.py
from seamless.highlevel import Context ctx = Context() ctx.a = "<b>Hello world!</b>" ctx.a.celltype = "text" ctx.a.mimetype = "html" ctx.a.mount("/tmp/a.html") ctx.a.share() ctx.translate() import asyncio import requests loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.sleep(1)) def thread(func, *arg...
offline_tracking.py
import mmcv import numpy as np import os.path as osp import cv2 import matplotlib.pyplot as plt import random import argparse import cv2 import torch from torch.utils.data import Dataset import numpy as np # from tensorboardX import SummaryWritter from pysot.core.config import cfg from pysot.models.model_builder impor...
pump_ui.py
import logging import threading import ipywidgets as ipw logger = logging.getLogger(__name__) class PumpUI(object): def __init__(self, proxy): self.proxy = proxy def _pump_frequency(message): proxy.pump_frequency_set(message['new']) pump_frequency = ipw.FloatSlider(descrip...
settings_20210906111618.py
""" Django settings for First_Wish project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathli...
distributed.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Distributed helpers.""" import multiprocessing import os import random import signal import threading import trace...
cron.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of...
cq_api.py
"""Main Flask code handling REST API""" import json import nltk import os import re import rq import saml2 import threading import time import uuid import crackq from crackq.db import db from crackq.logger import logger from crackq.models import User from crackq import crackqueue, hash_modes, auth from crackq.validato...
test_mainloop.py
from unittest import TestCase, main as ut_main, skip import logging from threading import Thread from multiprocessing import Process from time import sleep from mutils.system import is_py3 from mayloop.mainloop import MainLoop from mayloop.config import Config from mayloop.imported.twisted.internet_protocol import Fa...
tests.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...
test_enum.py
import enum import doctest import inspect import os import pydoc import sys import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto from enum import STRICT, CONFORM, EJECT, KEEP, _simple_enum, _test_simple_enum from enum import ...
worker.py
import logging.config import time import os import sys import argparse import signal from multiprocessing import Process import six from nmtwizard import configuration as config, task, workeradmin from nmtwizard.worker import Worker from nmtwizard.worker_butler import WorkerButler from utils.database_utils import Data...
example_test.py
from __future__ import print_function from __future__ import unicode_literals import re import os import socket import select import hashlib import base64 import queue import random import string from threading import Thread, Event import ttfw_idf def get_my_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGR...
input_server.py
# Copyright 2021 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, ...
common.py
"""Test the helper method for writing tests.""" import asyncio import collections from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta import functools as ft from io import StringIO import json import logging import os import sys import threading import time import uu...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import multiprocessing as mp import os import random import shutil import sys import tarfile import threading import time import traceback import zi...
tkinter_fonts_viewer.py
"""tkinter_fonts_viewer version, date, author: 0.1.1, 31.05.2020, streanger version, date, author: 0.1.2, 07.01.2022, streanger useful: https://stackoverflow.com/questions/5286093/display-listbox-with-columns-using-tkinter https://fsymbols.com/emoticons/ https://stackoverflow.com/questions/70538010/distributing-python...
system.py
import logging import os import subprocess import sys import threading import time import traceback import re logger = logging.getLogger(__name__) def read_file(filename, ignore_error=False): output = [] try: fh = open(filename, "r") for line in fh: output.append(line.strip()) ...
generic_websocket.py
""" Module used as a interfeace to describe a generick websocket client """ import asyncio import websockets import socket import json import time from threading import Thread, Lock from pyee import AsyncIOEventEmitter from ..utils.custom_logger import CustomLogger # websocket exceptions from websockets.exceptions i...
executor.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...
Ship.py
import logging from multiprocessing import Process, Manager from threading import Thread import traceback class Ship(object): """ A Ship is used to process a function that would otherwise stall a User Interface or is okay to work in the background. The process is ran and then stored within t...
Project-L7.py
# -*- coding: utf-8 -*- #!/usr/bin/python3 import requests import socket import socks import time import random import threading import sys import ssl import datetime print(''' ▄███████▄ ▄████████ ▄████████ ▄███████▄ ▄████████ ▄████████ ▄████████ ███▄▄▄▄ ████████▄ ▄██████▄ ...
demo.py
# Copyright 2020-2022 OpenDR European Project # # 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 agree...
http_server.py
#!/usr/bin/env python # Copyright 2018 the Deno authors. All rights reserved. MIT license. # Many tests expect there to be an http server on port 4545 servering the deno # root directory. import os import sys from threading import Thread import SimpleHTTPServer import SocketServer from util import root_path from time i...
plotSplitter.py
#!/usr/bin/python3 import os import _thread from util import Semaphore, diskFree, SCOOP_SIZE, NUM_SCOOPS, NONCE_SIZE MAX_READ = 4 * NONCE_SIZE MB = 1024 * 1024 def readerThread(buf, sem, lock): groupCnt = nonces // stagger groupSize = stagger * NONCE_SIZE groupScoopSize = stagger * SCOOP_SIZE try: ...
test.py
import unittest import os import subprocess import signal import multiprocessing import time import requests import argparse TSV_ZIP_PATH = 'test_files/test_opt.zip' MODEL_DIR = 'test_files/model/' TSV_DIR = 'test_files/tsv/' URL_BASE = 'http://127.0.0.1:8000/' OUTPUTRES = False OUTPUTJSN = False def http_request_op...
test_fx.py
# Owner(s): ["oncall: fx"] import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest from math import sqrt from torch.multiprocessin...
test_auth.py
# -*- coding: utf-8 -*- ''' Test the auth process. ''' from __future__ import absolute_import from __future__ import unicode_literals # Import pythond stdlib import time import logging from multiprocessing import Process # Import third party libs import pytest import nacl.utils import nacl.secret import nacl.signing ...
util.py
import os import re import shutil import sys import ctypes from pathlib import Path from colorama import Fore, Back, Style from .settings import * if sys.version_info[0] < 3 or sys.version_info[1] <= 5: print("\nPlease restart with Python 3.6+\n") print("Current Python version:", sys.version_info) exit(-1)...