source
stringlengths
3
86
python
stringlengths
75
1.04M
Tensorboard_reader.py
def launchTensorBoard(): import os #os.system('tensorboard --logdir=' + 'c:/tfoutput/Test') os.system('tensorboard --logdir=' + 'c:/tmp/tensorflow/mnist/logs/mnist_with_summaries/') return import threading t = threading.Thread(target=launchTensorBoard, args=([])) t.start() #In your browser, enter http...
file_explorer.py
import os import sys import subprocess import threading import shutil import queue import uuid from time import gmtime, strftime import datetime import numpy as np from pathlib import Path from urllib.parse import urlparse, unquote import tkinter as tk import tkinter.ttk as ttk from tkinter import messagebox from tkint...
test_001.py
from multiprocessing import Process import time class Timer: def __init__(self): self.p_time = time.process_time() self.t_time = time.perf_counter() def start(self): self.p_time = time.process_time() self.t_time = time.perf_counter() def stop(self, title): print(t...
recognizer.py
from asyncio.log import logger from vosk import Model, KaldiRecognizer import logging import threading from threading import Thread import config import wave import json class Recognizer: """ voice command recognizer using kaldi """ def __init__(self, model_path): self.model = Model(model_path)...
testremote.py
import os import time import tempfile import unittest import threading import multiprocessing as mp import vivisect import vivisect.const as v_const import vivisect.tests.helpers as helpers import vivisect.remote.server as v_r_server def runServer(name, port): dirn = os.path.dirname(name) testfile = helpers....
bot.py
from telegram import Update, ParseMode from telegram.ext import Updater, Dispatcher, Defaults from telegram.utils.request import Request from threading import Thread from config import NAME, TOKEN, PERSISTENCE from . import CoreQueueBot, CoreUpdater class UniversitasTerbukaBot(object): def __init__(self, TOKEN: ...
import_thread.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading import traceback import redis import ray from ray import ray_constants from ray import cloudpickle as pickle from ray import profiling from ray import utils class ImportThread(object): ...
subproc_vec_env.py
""" adapted from openai baselines https://github.com/openai/baselines/blob/9cb7ece3387c4cb680fd831f38400b356bd599a6/baselines/common/vec_env/subproc_vec_env.py """ import numpy as np from carla.agents.utils.vec_env import VecEnv, CloudpickleWrapper from multiprocessing import Process, Pipe def worker(remote, parent_...
hns.py
import threading import copy import json import socket from routing import transport def log(message): print("[HNS] {0}".format(message)) def info(message): log("[INFO] {0}".format(message)) def error(message): log("[ERROR] {0}".format(message)) class HNS: """Hostname Server A Hostname Serve...
views.py
import csv import os from multiprocessing import Process from django.conf import settings from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.sites.short...
tools.py
''' Author: Hans Erik Heggem Email: hans.erik.heggem@gmail.com Project: Master's Thesis - Autonomous Inspection Of Wind Blades Repository: Master's Thesis - CV (Computer Vision) ''' import os, threading, timeit, time, warnings from datetime import datetime def RemoveDir(directory): ''' @brief Delete everything ...
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 from test.support import collect_in_thread, gc_collect # Used in ReferencesTestCase...
compliancetest.py
import os import threading import shutil import lockfile class ComplianceTest(object): def __init__(self): self.saved_class = lockfile.LockFile def _testfile(self): """Return platform-appropriate file. Helper for tests.""" import tempfile return os.path.join(tempfile.gettempd...
caja-hash-tab.py
#!/usr/bin/python #coding: utf-8 import locale, os import hashlib import threading import re import io from os.path import basename try: from urllib import unquote except ImportError: from urllib.parse import unquote from gi.repository import Caja, GObject, Gtk # Locale foo lang = locale.getdefaultlocale()[...
handler.py
from psutil import Process,NoSuchProcess import sys from stalkoverflow.color import bcolors from stalkoverflow import parsers from stalkoverflow import ui import re from subprocess import PIPE, Popen from threading import Thread from queue import Queue def CheckErrorMessage(ErrorMessage): """Filters the ErrorMessa...
medassistant.py
import threading import subprocess import logging import sys import tkinter as tk import tkinter.simpledialog as sd import tkinter.filedialog as filedialog from tkinter import ttk from shutil import copyfile from google.assistant.library.event import EventType from aiy.voice import tts from aiy.assistant import auth_...
blue_node.py
""" This file contains the class which is used to connect to the bluetooth network in the area. """ import logging import pickle import sys import networkx as nx import select import json import time from queue import Queue from typing import List, Dict from threading import Thread, Lock from datetime import datetim...
tests.py
import json import ssl from random import randint from random import random from threading import Thread from time import sleep from django.conf import settings from django.test import TestCase from websocket import create_connection # class ModelTest(TestCase): # # def test_gender(self): # user = UserProfile(sex_...
test_browser.py
import BaseHTTPServer import Queue import logging import os import sys import threading import unittest import urllib2 from w3testrunner.browsers.browser import Browser, BrowserInfo from w3testrunner.browsers.manager import browsers_manager try: import utils except ImportError: sys.path.append(os.path.join(os...
grpc_radius_test.py
################################################################## # Copyright 2021 Lockheed Martin Corporation. # # Use of this software is subject to the BSD 3-Clause License. # ################################################################## ## This is based on the Boston missions import sy...
remind.py
# coding=utf-8 """ remind.py - Sopel Reminder Module Copyright 2011, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. https://sopel.chat """ from __future__ import unicode_literals, absolute_import, print_function, division import os import re import time import threading import collections imp...
mass_test_simple_ai.py
import argparse import sys import os from pong_testbench import PongTestbench from multiprocessing import Process from matplotlib import font_manager from time import sleep parser = argparse.ArgumentParser() parser.add_argument("dir", type=str, help="Directory with agents.") parser.add_argument("--render", "-r", actio...
server.py
import socket import threading sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(('0.0.0.0', 10000)) sock.listen(1) connections = [] def handler(): global connections while True: data = c.recv(1024) for connection in connections: connection.send(bytes(data)) ...
test_cmd_filter.py
import multiprocessing as mp import os import shutil from typing import Dict, List, Set import unittest from google.protobuf import json_format from mir.commands import filter as cmd_filter from mir.protos import mir_command_pb2 as mirpb from mir.tools import utils as mir_utils from mir.tools import class_ids from mi...
test_server_with_requests.py
import json import os from multiprocessing import Process from time import sleep from tempfile import gettempdir import requests from restful_functions import (ArgDefinition, ArgType, FunctionServer, TaskStoreSettings) from restful_functions.modules.task import TaskStatus def post_req...
monobeast.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
gdal2tiles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ****************************************************************************** # $Id$ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a raster into TMS (Tile Map Service) tiles in a di...
waiting.py
#!/usr/bin/env python3 """Minimal waiting animation for the terminal. Please refer to `__main__` for example usage. """ import functools import itertools import threading import time class Animation: """Provides start and stop methods for animated terminal output. Can be used in context managers. """ ...
recursive_url.py
import constants from Queue_Class import Queue from bs4 import BeautifulSoup import requests import multiprocessing q = Queue() file = open('output.txt', 'a') counter = 0 def extract_all_urls(): global counter if counter >= constants.LIMIT: return url = q.dequeue() try: html = request...
main.py
from helper.parser import * import random import torch.multiprocessing as mp import sys import subprocess from helper.utils import * import train import warnings if __name__ == '__main__': args = create_parser() if args.fix_seed is False: if args.parts_per_node < args.n_partitions: warning...
revocation_notifier.py
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import signal from multiprocessing import Process import threading import functools import time import os import sys from typing import Optional import requests import zmq from keylime import config from keylime import ...
testsuite.py
# Copyright (c) 2009-2011 testtools developers. See LICENSE for details. """Test suites and related things.""" __metaclass__ = type __all__ = [ 'ConcurrentTestSuite', 'ConcurrentStreamTestSuite', 'filter_by_ids', 'iterate_tests', 'sorted_tests', ] import sys import threading import unittest from extras ...
mp_extract.py
# JN 2015-02-13 refactoring from __future__ import absolute_import, print_function, division from collections import defaultdict from multiprocessing import Process, Queue, Value import numpy as np np.seterr(all='raise') import tables from .. import DefaultFilter from .tools import ExtractNcsFile, OutFile, read_matf...
utils.py
# Copyright 2013 Mario Graff Guerrero # 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 wri...
launcher.py
import json import logging import logging.config import os import shlex import socket import ssl import sys import threading from datetime import datetime from urllib.parse import urlencode from urllib.parse import urlparse import tornado.escape import tornado.httpserver as httpserver import tornado.ioloop import torn...
test_container.py
# global import os import queue import pytest import random import numpy as np import multiprocessing import pickle # local import ivy from ivy.container import Container import ivy_tests.test_ivy.helpers as helpers def test_container_list_join(device, call): container_0 = Container( { "a": [...
watchAlerts.py
#!/usr/bin/env python # coding: utf-8 import aprslib import bz2 from datetime import datetime, timedelta from dateutil.parser import parse import gc import shelve import logging import objgraph import pickle import pyproj import pytz import re import requests import sqlite3 import schedule import sys import telnetlib f...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import hashlib import threading from c...
mail.py
# -*- coding: utf-8 -*- from flask.ext.mail import Message from flask import current_app, url_for from flask.ext.login import current_user from enma.extensions import mail from flask.templating import render_template from threading import Thread import time from enma.activity.models import record_user def send_email(t...
run.py
import os import threading from screeninfo import get_monitors import webview width = 0 height = 0 for m in get_monitors(): width = m.width-20 height = m.height-20 def run_npm(): print("WELCOME TO MUSICK") print("Report Bugs Here: https://github.com/pythongiant/skrrt/issues") w = webview.WebView(width=width, h...
sample.py
# Sem criar uma classe from threading import * def show(): for i in range(6): print("Esta é uma Thread filha: ", current_thread().getName()) t = Thread(target = show) print(current_thread().getName()) t.start() t.join() print("Esta é uma Thread mãe: ", current_thread().getName())
test_text_messages.py
from utils import session, server def test_text_message_of_length_1(session): client, server = session server.send_message_to_all('$') assert client.recv() == '$' def test_text_message_of_length_125B(session): client, server = session msg = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'\...
direwatch.py
#!/usr/bin/python3 # direwatch """ Craig Lamparter KM6LYW, 2021, MIT Licnese modified by W4MHI February 2022 - see the init_display.py module for display settings """ import sys import argparse import time import subprocess import re import pyinotify import RPi.GPIO as GPIO import threading import signal import os ...
scheduler.py
import queue import os import sys import threading from queue import Queue, PriorityQueue from threading import Lock from time import time import pandas as pd import re import numpy as np import joblib as jb from sklearn.preprocessing import StandardScaler sys.path.append(os.path.abspath(os.path.join(__file__, "..", ...
helper.py
"""A library of helper functions for the CherryPy test suite.""" import datetime import io import logging import os import subprocess import sys import time import threading import nose import six import cheroot.server from cheroot._compat import HTTPSConnection, ntob from cheroot.test import webtest _testconfig = ...
helpers.py
import functools import os import re import sys import threading import time import traceback import typing as t from contextlib import contextmanager from http.server import HTTPServer from io import StringIO from threading import Thread from unittest.mock import Mock import flask import requests from aioresponses im...
do-th-subset-save.py
#! /usr/bin/env python # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. Contact: ctb@msu.edu # import khmer import sys import threading import Queue import gc import os...
test4.py
# program by server process from multiprocessing import Process, Manager def f(d, l): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() print(d) print(l) if __name__ == '__main__': manager = Manager() d = manager.dict() l = manager.list(range(10)) p = Process(target=f, args=(d...
main.pyw
##################################################################### # # # /main.pyw # # # # Copyright 2013, Monash University ...
plant.py
# pylint: disable=C0103 import gym import numpy as np import types from matplotlib import pyplot as plt from matplotlib.widgets import Cursor from matplotlib.colors import cnames from scipy.integrate import ode from time import time, sleep from threading import Thread from multiprocessing import Process, Pipe, Event f...
perf.py
#!/usr/bin/env python3 import argparse import clickhouse_driver import itertools import functools import math import os import pprint import random import re import statistics import string import sys import time import traceback import logging import xml.etree.ElementTree as et from threading import Thread from scipy...
video_server.py
import socket, time, sys, struct import string, time import subprocess import threading import numpy as np from flask import request, url_for from flask_api import FlaskAPI, status, exceptions HOST = '0.0.0.0' USER_PORT = 9002 REST_PORT = 10002 BUFFER_SIZE = 256 SOCKET_TIME_OUT = 10 VIDEO_PATH = '/' Default_HET = 200 ...
test_client.py
import asyncio import gc import logging import os import pickle import random import subprocess import sys import threading import traceback import warnings import weakref import zipfile from collections import deque from contextlib import suppress from functools import partial from operator import add from threading i...
mapd.py
#!/usr/bin/env python # Add phonelibs openblas to LD_LIBRARY_PATH if import fails from common.basedir import BASEDIR try: from scipy import spatial except ImportError as e: import os import sys openblas_path = os.path.join(BASEDIR, "phonelibs/openblas/") os.environ['LD_LIBRARY_PATH'] += ':' + openblas_path...
opencv_capture.py
import time import cv2 import logging import signal from threading import Thread, Lock, Condition import cv2 import numpy def exit_gracefully(sig, frame): global running running = False logger.info('Ctrl+C detected: exit procedure commenced!') class WebcamVideoStream: def __init__(self, logger, src=...
tasks.py
import functools import os import sys import threading import pkg_resources from .executor import Context, Tasks, TaskError from .paths import in_dir, paths_for_shell tasks = Tasks() @tasks.register('dependencies', 'additional_assets', 'bundles', 'collect_static_files', 'take_screenshots', 'compile...
steps.py
import logging import multiprocessing as mp import random import time from string import ascii_letters import tango.common.logging as common_logging from tango import Step from tango.common import Tqdm @Step.register("float") class FloatStep(Step): CACHEABLE = True DETERMINISTIC = True def run(self, res...
remoteapp.py
''' A utility for creating "remote applications" which are dcode enabled and cobra driven. All API arguments/returns *must* be serializable using msgpack. NOTE: enabling a dcode server means source for local python modules will be delivered directly to clients over the network! Running a remote application wil...
IRModule.py
#!/usr/bin/env python3 """IRModule, module to use with IR sensor created Apr 27, 2018 modified - Apr 30, 2018 """ """ Copyright 2018 Owain Martin This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, ei...
pox-pydoc.py
#! /usr/bin/python2.7 # -*- 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...
AdvancedHTTPServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # AdvancedHTTPServer.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 ...
events.py
import time, threading, json, sys from . import connection, config, pyi from queue import Queue from weakref import WeakValueDictionary class TaskState: def __init__(self): self.stopping = False self.sleep = self.wait def wait(self, sec): stopTime = time.time() + sec while tim...
mmachine.py
import sys sys.path.insert(0, '/export/nfs/xs/codes/lp-deepssl') import datetime import os import time from queue import Queue from threading import Thread from utils.ssh import SSH def get_remain_memory(mem_line): vals = mem_line.split() res = [] for v in vals: if v.endswith('MiB'): ...
quicksort.py
from xml.etree import ElementTree import sys from threading import Thread, current_thread class quick: def read_xml(self,file_path): data = ElementTree.parse(file_path) root = data.getroot() arr = [] for num in root.iter('integer'): arr.append(int(num.attrib.values()[0])) return ...
mp.py
import multiprocessing as mp import os import psutil import timeit import cProfile import re def g(x): return x*x def info(title): print(title) print('module name:', __name__) print('parent process:', os.getppid()) print('process id:', os.getpid()) def f(name): info('function f') print('h...
sniffer.py
import socket import threading import time import os import sys import mutex from struct import unpack #create an INET, raw socket s4 = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP) s6 = socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_TCP) s4.settimeout(1) s6.settimeout(1) shutdown_e...
rpc_agent.py
""" Python rpc agent Use for test rpc server """ import socket from threading import Thread import logging import json logger = logging.getLogger('Tester') class Agent: def __init__(self, device_id): self.device_id = device_id self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
util.py
from threading import Thread, Lock import numpy as np import quaternion def generate_mesh_slices(width, height, depth, center_w, center_x, center_y, center_z, zoom, rotation_theta, rotation_phi, rotation_gamma, rotation_beta, offset_x, offset_y, depth_dither=1): ct, st = np.cos(rotation_theta), np.sin(rotation_th...
page_working.py
from concurrent.futures.thread import ThreadPoolExecutor import contextlib import importlib import inspect import sys import time import threading from typing import Any from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from fastapi import FastAPI, Request from fastapi.respon...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading from electrum_sparks.bitcoin import TYPE_ADDRESS from electrum_sparks.storage import WalletStorage from electrum_sparks.wallet import Wallet from electrum_sparks.paymentrequest import InvoiceStore f...
jobs.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 #...
executor.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import division from builtins import next from builtins import object from builtins import str from future.utils import viewvalues, viewitems import argparse import logging import os import sys import thr...
python3-47.py
#Daemon threads #Quitting when we quit the app #Imports import logging import threading from threading import Thread, Timer import time #Test functions def test(): threadname = threading.current_thread().name logging.info(f'Starting: {threadname}') for x in range(60): logging.info(f'Working: {thre...
agent_a3c_ss2.py
#!/usr/bin/env python from __future__ import print_function import numpy as np import cv2 import tensorflow as tf import threading import sys import time import os def MakeDir(path): try: os.makedirs(path) except: pass lab = False load_model = False train = True test_display = False test...
mongo_server.py
import os import pymongo import time import pprint import http.server import socketserver import numpy as np import threading from collections import defaultdict from malib.rpc.ExperimentManager.mongo_client import DocType class ProfilingHtmlHandler(http.server.SimpleHTTPRequestHandler): def do_GET(self): ...
__init__.py
#!/usr/bin/python3 # @todo logging # @todo extra options for url like , verify=False etc. # @todo option for interval day/6 hour/etc # @todo on change detected, config for calling some API # @todo fetch title into json # https://distill.io/features # proxy per check # - flask_cors, itsdangerous,MarkupSafe import da...
test_transfer.py
# Copyright (c) 2019 - now, Eggroll 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 ...
build_imagenet_data.py
# Copyright 2016 Google Inc. 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 a...
Walrus1.py
#------------------------------------------------------------------------------- # Name: Walrus.py # Purpose: Walrus Hero II # Authors: Raymond, Thomas, & Donny # Created: In progress # Copyright: (c) Walrus Hero Group 2014 #------------------------------------------------------------------------------- #Draws backgr...
spanprocessor.py
# Copyright The OpenTelemetry 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 ...
surface_stats_collector.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. import Queue import datetime import logging import re import threading # Log marker containing SurfaceTexture timestamps. _SURFACE_TEXTURE_TIMESTAMPS_MESSA...
cleanup-service.py
""" Web service that is supposed to be started via JupyterHub. By this, the service has access to some information passed by JupyterHub. For more information check out https://jupyterhub.readthedocs.io/en/stable/reference/services.html Note: Logs probably don't appear in stdout, as the service is started as a subproce...
SMGui.py
import sys, os sys.path.append('..' + os.path.sep) import os.path as osp import atexit import socket import shutil import threading import errno # Test if IPython v0.13+ is installed to eventually switch to PyQt API #2 from SMlib.utils.programs import is_module_installed from SMlib.config import CONF, EDIT_...
OxygenX-0.8.py
from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta, timezone from multiprocessing.dummy import Pool as ThreadPool from os import mkdir, path, system, name from random import choice from re import compile from threading import Thread, Lock from time import sleep, strftime, ...
snpx_obj_detector.py
import cv2 import os import sys from time import time, sleep from datetime import datetime import argparse from imutils.video import FPS import utils from multiprocessing import pool from threading import Thread from queue import Queue from detector.ssd.ssd import SSDObjectDetector from detector.yolo.yolo import YoloO...
engine.py
# Copyright 2013: Mirantis Inc. # 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 b...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase, SkipTest, skipUnl...
plugin.py
import threading from binascii import hexlify, unhexlify from electrum.util import bfh, bh2u from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants) from electrum.i18n import _ from electrum.plugins import BasePlugin from elect...
server3.py
################################################################################ # # 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 # ...
miniterm.py
#!C:\Users\Yuki\Desktop\bug_collect\python\API_test\venv\Scripts\python.exe # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import thre...
threading_local.py
__author__ = 'July' import threading import logging import random logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-0s) %(message)s',) def show(d): try: val = d.val except AttributeError: logging.debug('No value yet') else: logging.debug('value=%s...
mock_web_api_server.py
import asyncio import json import logging import re import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing.context import Process from typing import Type from unittest import TestCase from urllib.parse import urlparse, parse_...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal from bitcoin import COIN from i18n import _ from util import PrintError, ThreadJob from util import format_satoshis # See https://en.wikipedia.org/w...
Userbot_personal.py
from telethon import TelegramClient, events, sync from telethon import * from datetime import datetime import os import asyncio import telethon API_ID = 1641545 API_HASH ="5e2f76a9ef8d04cb1386a9f9d246dd9f" userbot_personal = TelegramClient("userbot_personal", API_ID, API_HASH) async def usbot(): @userbot_...
scdlbot.py
# -*- coding: utf-8 -*- """Main module.""" import gc import pathlib import random import shelve import shutil from datetime import datetime from multiprocessing import Process, Queue from queue import Empty from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404 from urllib.parse import urljoin, urlparse from...
human_vs_eaplayer.py
import argparse from multiprocessing import JoinableQueue, Process, Value import numpy as np from game.Game import game_process from gui.Gui import gui_process from ai.EAPlayer import EAPlayer def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-c', '--config-path', default="./config.js...
ITunes.py
# Copyright L.P.Klyne 2013 # Licenced under 3 clause BSD licence # # import logging, threading, time, sys from Queue import Queue, Empty import pythoncom initFlags = pythoncom.COINIT_MULTITHREADED sys.coinit_flags = initFlags import win32com.client from EventLib.Event import Event from EventLib.Status im...
skeleton_reader_back.py
import fnmatch import os import re import threading import librosa import numpy as np import tensorflow as tf def find_files(directory, pattern='s*'): '''Recursively finds all files matching the pattern.''' files = [] for root, dirnames, filenames in os.walk(directory): for filename in fnmatch.fi...
support.py
import gc import time import thread import os import errno from pypy.interpreter.gateway import interp2app, unwrap_spec from rpython.rlib import rgil NORMAL_TIMEOUT = 300.0 # 5 minutes def waitfor(space, w_condition, delay=1): adaptivedelay = 0.04 limit = time.time() + delay * NORMAL_TIMEOUT while ti...
pput.py
"""Multipart parallel s3 upload. usage pput bucket_name/filename """ from Queue import Queue from cStringIO import StringIO from collections import namedtuple from threading import Thread import argparse import base64 import binascii import functools import hashlib import logging import json import os import sys imp...