source
stringlengths
3
86
python
stringlengths
75
1.04M
test_ClientSocket.py
import socket import threading import unittest from ev3dev2simulator.config.config import get_simulation_settings, load_config from ev3dev2simulator.connection.message.rotate_command import RotateCommand class TestClientSocket(unittest.TestCase): def setUp(self) -> None: load_config(None) def run_...
pykms_Misc.py
#!/usr/bin/env python3 import sys import logging import os import argparse from logging.handlers import RotatingFileHandler from pykms_Format import ColorExtraMap, ShellMessage, pretty_printer #---------------------------------------------------------------------------------------------------------------------------...
test_tracer.py
import time import opentracing from opentracing import ( child_of, Format, InvalidCarrierException, UnsupportedFormatException, SpanContextCorruptedException, ) import ddtrace from ddtrace.ext.priority import AUTO_KEEP from ddtrace.opentracer import Tracer, set_global_tracer from ddtrace.opentrace...
osr_basic.py
#!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Basic tests of OGRSpatialReference (OSR) operation, not including # support for actual reprojection or use of EPSG tables. # Author...
wsdump.py
#!/home/sahoo/Videos/venv/bin/python import argparse import code import sys import threading import time import ssl import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin, "encoding", "") ...
main.pyw
""" 主体文件,负责许多重要工作,如安装前置、为其它文件提供参数等 """ import random import os import subprocess from threading import Thread __version__ = "2.0.1" # 版本 __author__ = "Jerry" # 作者 try: import easy_functions as ef except ModuleNotFoundError: while True: if os.system("pip install easy_functions") == 0: ...
intensity_display.py
import sys import functools import signal import select import socket import numpy as np import pickle import matplotlib.pyplot as plt import time from multiprocessing import Process, Queue sys.path.append('../dhmsw/') import interface import struct PLOT = True headerStruct = struct.Struct('III') class guiclient(obje...
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): ...
test_localization.py
# -*- coding: utf-8 -*- import pytest import threading from .util import run_test, destroy_window def localization(): import webview def _localization(webview): assert webview.webview_ready(10) destroy_event.set() t = threading.Thread(target=_localization, args=(webview,)) t.start() ...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
test_cabsagent.py
#!/usr/bin/python2 #This is the test Agent for CABS for linux # Workaround until a bugfix in pyinstaller gets released on pypi. # See https://github.com/pyinstaller/pyinstaller/commit/f788dec36b8d55f4518881be9f4188ad865306ec import socket, ssl import sys import os import subprocess import re import signal import trace...
test__tkinter_in_thread.py
import queue import threading import time import tkinter as tk def prepare_refresh_screen(q): root = tk.Tk() root.overrideredirect(True) root.attributes('-alpha', 0.5) root.state('zoomed') root.withdraw() q.put(root) root.mainloop() def refresh_screen(q): root = q.get() root.stat...
vr_orientation.py
import socket import pygame from pygame.locals import * from threading import Thread import time def init_pygame(): pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption('Pygame Keyboard Test') pygame.mouse.set_visible(1) serversocket =socket.socket (socket.AF_INET,soc...
memory_test.py
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Tests for memory related flows.""" import copy import json import os import socket import threading from grr.client import vfs from grr.client.client_actions import grr_rekall_test from grr.lib import action_mocks from grr.lib import aff4 from grr.lib...
main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # main.py # # Copyright 2020 luckylai <luckylai1126@foxmail.com> # from src.view import Viewer from src.snake import Snake from src.deeplearning import LearningWeb, crossover import threading import copy import time import random import sys def viewThread(size,...
event_based_scheduler_job.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...
test_threaded_restapi.py
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.test_support import sys, os, cStringIO import struct import operator class SysModuleTest(unittest.TestCase): def tearDown(self): test.test_support.reap_children() def test_original_displayhook(self): import __builtin__ savestdout = sy...
stats_manager.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the...
multiprocessing_with_webservers__flask.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def go(port): from flask import Flask app = Flask(__name__) import logging logging.basicConfig(level=logging.DEBUG) @app.route("/") def index(): return "Hello World! (port={})".format(port) app.run(port=port...
MessageEvent.py
#!/usr/bin/env python3 """ 消息事件处理服务 :author Wang Weiwei <email>weiwei02@vip.qq.com / weiwei.wang@100credit.com</email> :sine 2017/8/11 :version 1.0 """ # coding=utf8 import itchat from itchat.content import * import queue import threading xiaobingQueue = queue.Queue(maxsize=100) msgQueue = queue.Que...
monero_archive.py
#!/usr/bin/python3 import sys import re import threading import os import queue import datetime from monero_archive_data import monitor_req import platform print(f'Python version: {platform.python_version()}') import plotly print(f"Plotly version: {plotly.__version__}") import networkx as nx print (nx.__version__) ...
soundhandler.py
# This file is part of the pyBinSim project. # # Copyright (c) 2017 A. Neidhardt, F. Klein, N. Knoop, T. Köllmer # # 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, includi...
main.py
#!/usr/bin/env python3 import datetime import ipaddress import json import logging import multiprocessing import multiprocessing.dummy import os import time import traceback import scapy import scapy.config import scapy.layers.l2 import scapy.sendrecv from wakeonlan import send_magic_packet from flask import Flask, r...
vwsfriend_base.py
import os import sys import re import argparse from datetime import datetime, timedelta, timezone import logging import logging.handlers import time import tempfile import netrc import threading from pyhap.accessory_driver import AccessoryDriver from weconnect import weconnect from weconnect.errors import APICompati...
test_server.py
import asyncio import json import os from http import HTTPStatus from multiprocessing.managers import DictProxy from pathlib import Path from unittest.mock import Mock, ANY import requests import time import uuid import urllib.parse from typing import List, Text, Type, Generator, NoReturn, Dict, Optional from contextl...
xair.py
import time import threading import socket from pythonosc.dispatcher import Dispatcher from pythonosc.osc_server import BlockingOSCUDPServer from pythonosc.osc_message import OscMessage from pythonosc.osc_message_builder import OscMessageBuilder from .mixerstate import MixerState class OSCClientServer(BlockingOSCUDPSe...
idownclient.py
""" Author: judy Date: 2020-10-29 17:39:19 LastEditTime: 2020-11-09 09:30:55 LastEditors: judy Description: 使用新的编译器 FilePath: \idown_new\idownclient\idownclient.py """ import threading import time import traceback from commonbaby.mslog import MsLogger, MsLogManager, MsLogLevel from datacontract import EClientBusines...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
relay_integration.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...
serial_transfer.py
#!/usr/bin/python -u """ test serial transfer between two devices This module assumes two devices (e.g. FT232R based) are connected to the host computer, with RX and TX of the two devices wired to each other so they can communicate. It launches threads to send and receive traffic and check that a random stream sent fr...
mp_scrimp_extractor.py
from pipeline.feature_engineering.feature_extraction.abstract_extractor import Extractor from overrides import overrides from matrixprofile import * from IPython.display import clear_output #from multiprocessing import Pool #import pathos.multiprocessing import gc import traceback import os import multiprocessing as mp...
ps5.py
# 6.0001/6.00 Problem Set 5 - RSS Feed Filter # Name: Daniel Guillermo # Collaborators: Daniel Guilermo # Time: about 10 hours import feedparser import string import time import threading from project_util import translate_html from mtTkinter import * from datetime import datetime import pytz #----------------------...
ssh.py
# Date: 07/27/2018 # Author: Pure-L0G1C # Description: Secure shell import os import ssl import socket from threading import Thread from lib.const import CERT_FILE, KEY_FILE from socket import timeout as TimeOutError class Communicate(object): def __init__(self, session): self.session_recv ...
ready_model.py
import sys import queue import struct import threading import importlib import torch import torch.multiprocessing as mp from task.helper import get_model from util.util import TcpServer, TcpAgent, timestamp def func_get_request(active_model_name, qout): # Listen connections server = TcpServer('localhost', 12...
win32.py
import platform import ctypes import threading from ctypes import windll from ctypes import byref from ctypes import Structure, Union from termpixels.color import Color from termpixels.color import color_to_16 from termpixels.observable import Observable from termpixels.keys import Key, Mouse from termpixels.win32_keys...
mainwindow_privision_multithread.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import datetime import pprint import importlib from multiprocessing import Process, Manager from pypr...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
new.py
import sys import threading import subprocess import time from subprocess import PIPE n = 0 #lock = threading.RLock() def my_counter(my_input): while(True): print(my_input) time.sleep(0.1) # for line in my_input: n = n+1 print('see a line') #if(n == 1000): # ...
test_multiple_exceptions.py
""" All tests should fail. """ from threading import Thread def test_reraise_first(reraise): def run(): with reraise: assert False t = Thread(target=run) t.start() t.join() assert "foo" == "bar" def test_reraise_last(reraise): def run(): with reraise: ...
utils.py
import os import subprocess import sys from datetime import datetime, timedelta from pathlib import Path from queue import Queue from subprocess import PIPE, Popen from threading import Thread from typing import Any, Dict, Iterable, List, Optional, Tuple, Union import pydantic from python_on_whales.exceptions import ...
app.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 # AWS X-ray support from aws_xray_sdk.core import xray_recorder from aws_xray_sdk.ext.flask.middleware import XRayMiddleware from aws_xray_sdk.core import patch_all patch_all() xray_recorder.begin_segment("Videos-in...
marathon_lb.py
#!/usr/bin/env python3 """# marathon-lb ### Overview The marathon-lb is a service discovery and load balancing tool for Marathon based on HAProxy. It reads the Marathon task information and dynamically generates HAProxy configuration details. To gather the task information, marathon-lb needs to know where to find Mar...
utils.py
# coding=utf-8 """Shared utility functions""" import argparse import collections import functools import glob import inspect import itertools import os import re import subprocess import sys import threading import unicodedata from enum import ( Enum, ) from typing import ( TYPE_CHECKING, Any, Callable,...
test_crt_sp_simultaneously.py
''' Test create 100 snapshots simultaneously @author: Mirabel ''' import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.operations.config_operations as con_ops import zstackwoodpecker.zstack_test.zstack_test_volume as zstack_volume_header import zstackwoodpecker.header.volume as vol...
client.py
import socket import threading class Client: """ Client class for my chat. """ def __init__(self, address=('', 10000)): """ Save desired address for connection. """ self._address = address self.sock = socket.socket() self.listener = threading.Thread(target=self.listen, args=(),...
run_experiments.py
#!/usr/bin/python import subprocess import threading import multiprocessing conf_str_template = '''init_cwnd: 12 max_cwnd: 15 retx_timeout: 45e-06 queue_size: 36864 propagation_delay: 0.0000002 bandwidth: 40000000000.0 queue_type: {0} flow_type: 2 num_flow: 100000 flow_trace: CDF_aditya.txt cut_through: 1 mean_flow_s...
client.py
import socket import select import threading # Defines localhost, Port number, and number of bytes for messages sent/received # Same values as server HOST = '127.0.0.1' #localhost PORT = 55555 NUM_BYTES = 1024 # Creates Socket for client # Uses Internet IPV4 socket/Streaming socket def create_socket(): r...
lib.py
import os import random import sys import queue import shutil import zipfile import signal import threading import subprocess import importlib import logging from .server import Server from ..tools import workfiles from ..vendor.Qt import QtWidgets self = sys.modules[__name__] self.server = None self.pid = None self....
threaded_file_downloader.py
import collections import queue import threading class ThreadedFileDownloader: def __init__(self, max_files, num_downloader_threads, num_trainer_threads, get_file_list_function, file_getter_function, file_processor_function, batches): self.downloaded_files = queue.Queue(maxsize=ma...
http_mapi.py
from __future__ import print_function from builtins import str from builtins import object import logging import base64 import random import os import ssl import time import copy import sys from pydispatch import dispatcher from flask import Flask, request, make_response # Empire imports from lib.common import helpers...
SentenceTransformer.py
import json import logging import os import shutil import stat from collections import OrderedDict from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional import requests import numpy as np from numpy import ndarray import transformers from huggingface_hub import HfApi, HfFolder, Repository, hf_...
vsphere.py
import collectd from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim, vmodl import requests from threading import Thread from datetime import timedelta, datetime import ssl VERBOSE_LOGGING = False INTERVAL = 60 DOMAIN = '' CONSOLIDATE= [] VCENTERS_INFO={} METRICS_INFO={} VCENTERS=[] METRICS={} ME...
test_general.py
"""Collection of tests for unified general functions.""" # global import einops import pytest from hypothesis import given, strategies as st import numpy as np from numbers import Number from collections.abc import Sequence import torch.multiprocessing as multiprocessing # local import ivy import ivy.functional.backe...
u2p2_evdev_speed.py
import sys import time import libevdev import spidev import threading is_on_raspberry_pi = False with open('/etc/os-release') as os_version_file: is_on_raspberry_pi = 'raspbian' in os_version_file.read().lower() spi = None if is_on_raspberry_pi: spi = spidev.SpiDev(0, 0) # rasp print("I'm on Raspberry Pi!...
merge_bigfile.py
import threading import time import time import collections import multiprocessing import threading import subprocess import os import queue root_path = 'D:/pro_test_data/hyyzx/52' src_file = 'all_name.txt' dict_file = 'dictionary0716' def time_it(fun): def inner(*argv, **argc): st = time.time() ...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM Limited 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 wr...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import queue as pyqueue 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 test.support import test.script_helper ...
voicegain_client.py
from usttc.asr_client.asr_client import AsrClient from usttc.config import Config from usttc.audio.audio_file import AudioFile from usttc.result.recognize_result import RecognizeResult from usttc.result.word import Word from usttc.exceptions.exceptions import AudioException from usttc.stream.stream import Stream from u...
timeout.py
from multiprocessing import Process, Queue import time def timeout(func, timeout=3600): """ Submit a function and its kwargs to a dask client. Wait for a number of seconds before cancelling the future and closing the client. Parameters ---------- func: function kw: dict key wo...
Login.py
import random import requests import cv2 import threading import time import numpy as np import json class Login(): LOGIN_URL = 'https://passport.jd.com/new/login.aspx' QRCODE_URL = 'http://qr.m.jd.com/show?appid=133&size=147&t=' CHECK_URL = 'https://qr.m.jd.com/check?callback=jQuery8392893&appid=133&toke...
spider.py
import asyncio import sys import time from asyncio import Semaphore, CancelledError from types import AsyncGeneratorType from typing import Optional, AsyncIterable, Callable, Coroutine, final from inspect import isasyncgenfunction, iscoroutinefunction from fly.utils.log import Logger from fly.downloader import Downloa...
threading_no_inheritance.py
#!/usr/bin/env python # # Author: Daniela Duricekova <daniela.duricekova@gmail.com> # import requests import threading import queue URLS = [ 'https://xkcd.com/138/', 'https://xkcd.com/149/', 'https://xkcd.com/285/', 'https://xkcd.com/303/', 'https://xkcd.com/327/', 'https://xkcd.com/387/', ...
03-thread.py
import time import threading def myfunc(name): print(f"myfunc started with {name}") time.sleep(10) print("myfunc ended") if __name__ == '__main__': print('main started') #myfunc('realpython') t=threading.Thread(target=myfunc, args=['realpython']) t.start() print('main ended')
demo_mp.py
# -*- coding: utf-8 -*- # ====================================================== # @Time : 21-1-16 下午1:30 # @Author : huang ha # @Email : 1286304229@qq.com # @File : demo_mp.py # @Comment: # ====================================================== from multiprocessing import Process from multiprocessing import...
tcpserve.py
""" .. module:: tcpserve :synopsis: TCP-based controller server and workers for POAP. .. moduleauthor:: David Bindel <bindel@cornell.edu> """ import time import socket import threading import pickle import logging try: import socketserver except ImportError: import SocketServer as socketserver from poap.c...
tcpscan1.py
# tcpscan1.py # -*- coding: utf-8 -*- """ 1.需求 1.1 用户需求 (1)系统应对指定IP范围内的主机进行TCP开放端口的检查; (2)主机可以以域名方式给出,也可以以IP方式给; 1.2 系统需求 (1)要求以python模块方式实现; (2)要求至少有交互式命令行来实现; $python3 tcpscan -h www.htsc.com.cn -p 1-65535 $python3 tcpscan -h www.htsc.com.cn -p 80,8080,21 $python3 tcpsc...
io.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...
jetson_infer_op.py
# Copyright (c) 2021 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 ap...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threading import time import traceback impo...
lisp-etr.py
#----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
burst.py
# -*- coding: utf-8 -*- """ Burst processing thread """ import re import json import time import xbmc import xbmcgui from Queue import Queue from threading import Thread from urlparse import urlparse from elementum.provider import append_headers, get_setting, set_setting, log from parser.ehp import Html from provide...
example_stream_everything.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_stream_everything.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api # PyPI: https:/...
http_server.py
# -*- coding: utf-8 -*- # version: python 3.5 import threading import re import os import sys from wsgiref.simple_server import make_server from file_util import * from pydict_cn_bing_com import get_definition_cn_bing_com from pydict_dict_youdao_com import get_definition_dict_youdao_com """ require lib(linux/mac): pi...
sync_routes.py
""" This management command script adds and syncs the routes, bus stops parsed from the html table. usage: ./manage.py sync_routes """ import os import threading import time from sys import stdout from datetime import datetime from django.core.management.base import BaseCommand from django.core.exceptions import Multi...
test_client.py
# -*- coding: utf-8 -*- from threading import Thread from unittest.case import TestCase from zmq import Context, REP, LINGER, Poller, POLLIN from translations_client import TranslationsClient, TranslationsServerError _KEY1 = "k1" _PLURAL1 = 1 _TRANSLATION1 = "t1" _KEY2 = "k2" _PLURAL2 = None _TRANSLATION2 = "t...
data_produce.py
import gc import os import re import time from zhon import hanzi import string import tqdm import utility import multiprocessing import datetime ARTICLE_DIR = './articles' FILEDIR = './result_files' DATA_TMP = './result_files/data_tmp' DATA_TXT_FILE = './result_files/data.txt' kGB18030 = 'gb18030' kEndProcess = '-=-=...
pythonOSC_buttons_GPIO.py
#!/usr/bin/python ####### Change settings in this section ####### # specify the output and input pins you will be using (in BCM style) outputs = [2, 3, 4, 17, 27, 22, 10, 9, 14, 15, 18, 23, 24, 25, 8, 7] inputs = [11] # uncomment the following line if you are not using any outputs #outputs = [] # uncomment the follow...
test_pool.py
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.pool.impl import _AsyncConnDialect from sqlal...
berkely.py
# coding: UTF-8 import subprocess import thulac import threading import os from nltk.tree import Tree BERKELEY_JAR = "berkeleyparser/BerkeleyParser-1.7.jar" BERKELEY_GRAMMAR = "berkeleyparser/chn_sm5.gr" class BerkeleyParser(object): def __init__(self): self.tokenizer = thulac.thulac() self.cmd ...
vox.py
""" core/sounds/vox/vox.py module that contains half-life vox announcement system sounds as .wav files in folder original if this file is run for the first time on your computer, it will autogenerate all the sound files -15 db (because they are loud by original) and they are ...
multiplecore_old.py
import multiprocessing as mp import threading from functools import partial, reduce import copy import numpy as np _process = None def _func_helper(res, func, args): try: result = func(*args) except: print('Error in: parameter: "', args, '"') result = None res.append(result) de...
show-png.py
#!/usr/bin/env python import time import threading from getch import getch from sys import exit try: from PIL import Image except ImportError: exit('This script requires the pillow module\nInstall with: sudo pip install pillow') import unicornhathd """Unicorn HAT HD: Show a PNG image! This basic example s...
account.py
#!/usr/bin/python3 import json import sys import threading import time from collections.abc import Iterator from getpass import getpass from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union import eth_account import eth_keys import rlp from eip712.messages import EIP712Message, _hash_eip...
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...
walt_agent.py
# Copyright 2017 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. # TODO(https://crbug.com/1262296): Update this after Python2 trybots retire. # pylint: disable=deprecated-module import optparse import threading import py_...
__init__.py
# coding=utf-8 # encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals from octoprint.util.version import get_octoprint_version_string from tempfile import mkstemp from datetime import timedelta from slacker import Slacker, IncomingWebhook from imgurpython import ImgurClient...
parallel_dl_gunsamerica.py
import sys import json import time import os import requests import shutil from Queue import * from threading import Thread #basepath="/srv/skaraman/weapons/" #website="gunsamerica" imagecat=json.load(open('imagecat_conf.json','rt')) nb_threads=16 def mkpath(outpath): pos_slash=[pos for pos,c in enumerate(outpath)...
syndicate.py
#!/usr/bin/python """ Syndicate configurator. """ import httplib import os import shutil import tools from threading import Thread import logger import tools def start(): logger.log('syndicate plugin starting up...') def syndicate_op(op, mountpoint, syndicate_ip): #op="GET" #syndicate_ip="www.vicci.or...
__init__.py
import sys import threading import time import itertools class Spinner(object): spinner_cycle = itertools.cycle(['-', '/', '|', '\\']) def __init__(self, beep=False, disable=False, force=False, stream=sys.stdout): self.disable = disable self.beep = beep self.force = force self...
FtpWriteFile.py
import wx import wx.lib.intctrl import io import os import sys import webbrowser import ftputil from urllib.parse import quote import datetime import threading import Utils import Model import HelpSearch from ExportGrid import getHeaderBitmap, drawQRCode from WebServer import WriteHtmlIndexPage import inspect def line...
models.py
# -*- coding: utf-8 -*- import json import logging import uuid from enum import Enum from typing import Union, List import multiprocessing import yaml from django.contrib.auth.models import Group, User from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import Cont...
watson.py
__author__ = 'rcj1492' __created__ = '2017.04' __license__ = 'MIT' ''' PLEASE NOTE: watson package requires watson-developer-cloud, moviepy and ffmpy module along with ffmpeg C dependency (install) pip install watson-developer-cloud pip install moviepy ...
request_connector.py
# Copyright 2020. ThingsBoard # # 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 applicabl...
interfaces.py
# vim:set ff=unix tabstop=4 shiftwidth=4 expandtab: # Author : Pavel Vitis "blackdaemon" # Email : blackdaemon@seznam.cz # # Copyright (c) 2010, Pavel Vitis <blackdaemon@seznam.cz> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that...
Baseball.py
#-*- coding: utf-8 -*- from gluon import * from gluon import current import urllib2 global g_myScore, g_otScore, g_playState g_Score_1 = 0 g_Score_2 = 0 g_playState = "init" def getBaseballinfo(): global g_myScore, g_otScore, g_playState baseballinfo = ["Baseball","Information"] try: page =...
socketClient.py
from tornado import escape from tornado import gen from tornado import httpclient from tornado import httputil from tornado import ioloop from tornado import websocket from collections import deque import threading import json APPLICATION_JSON = 'application/json' DEFAULT_CONNECT_TIMEOUT = 60 DEF...
__init__.py
import logging try: from Queue import Queue # PY2 except ImportError: from queue import Queue # PY3 from threading import Thread try: from urlparse import urljoin # PY2 except ImportError: from urllib.parse import urljoin # PY3 from bs4 import BeautifulSoup import requests from requests.exceptions ...
codelet.py
# ****************************************************************************# # Copyright (c) 2020 Wandemberg Gibaut # # All rights reserved. This program and the accompanying materials # # are made available under the terms of the MIT License # ...