source
stringlengths
3
86
python
stringlengths
75
1.04M
discord_handler.py
import time import os import signal import sys import threading import json import math import discordsdk as dsdk from firebase_handler import FirebaseHandler APP_ID = 799831774959763488 def dummy_callback(result, *args): if result != dsdk.Result.ok: raise Exception(result) class DiscordHandler: de...
aff4_test.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Tests for the flow.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import itertools import os import threading import time from absl import app from future.builtins import range from future.utils imp...
multicast_test.py
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version...
example_test.py
import re import os import socket import BaseHTTPServer import SimpleHTTPServer from threading import Thread import ssl from tiny_test_fw import DUT import ttfw_idf import random import subprocess server_cert = "-----BEGIN CERTIFICATE-----\n" \ "MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCz...
bmptk-ssc.py
# =========================================================================== # # BMPTK's Stack Size Calculator: # calculate the stack use from an .lss file # # (c) Wouter van Ooijen (wouter@voti.nl) # 2015-12-18 version 0.1 work-in-progress # license: Boost Software License - Version 1.0 # # =========================...
simulate.py
# -*- coding: utf-8 - import queue import random import networkx as nx from multiprocessing import Process import multiprocessing influence_sum=multiprocessing.Value("i",0) def process(): influence = 0 for i in range(0, 50): influence += simulate(set(seedset[:])) with influence_sum.get_lock(): ...
config.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: r""" A Python module to maintain unique, run-wide *fMRIPrep* settings. This module implements the memory structures to keep a consistent, singleton config. Settings are passed across processes via filesyst...
test.py
import json import logging import random import threading import os import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance import helpers.client logging.getLogger().setLevel(logging.INFO) logging.getLogger().addHandler(logging.StreamHandler()) # Creates S3 bucket for tests and allows anon...
nabucodonosor.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import sys import time import subprocess import signal import json import requests import datetime as dt import logging import logging.config import git from functools import wraps from Models import * sys.path.insert( 1, os.path.join(os.environ["BABILONIA_LIBS"...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import deserialize_xpub from electrum import constants from electrum.i18n import _ from electrum.transaction import deseriali...
trezor.py
import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path from electrum import constants...
test_base_events.py
"""Tests for base_events.py""" import concurrent.futures import errno import math import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from test.test_asyncio import utils as test_utils from test imp...
dbpond3.py
#!/usr/bin/python3 #-*-coding:utf-8-*- import os import sys import traceback import logging import threading import configparser import time import pymysql from DBUtils.PooledDB import PooledDB basedir = os.path.dirname(os.path.realpath(__file__)) locking = threading.Lock() #logging.basicConfig(level=logging.DEBUG...
2016Webcast3.py
#!/usr/bin/env python import sys, os, time, urllib, urllib.request, shutil, re, lxml, threading, queue, multiprocessing import hashlib, csv, subprocess def get_sha256(text): sha256 = hashlib.sha256() sha256.update(text.encode('utf-8')) return sha256.hexdigest() def check_list(list, url): # c...
webserver.py
# -- Importing Packages -- # from flask import Flask from threading import Thread from logging import getLogger, ERROR # -- Disables Flask App Logging -- # log = getLogger('werkzeug') log.setLevel(ERROR) # - Webserver Setup -- # app = Flask('') @app.route('/') def home(): return "<h1> Hosting Active ...
rovio_video.py
import cv2, time import urllib.request as urllib import base64 import numpy as np import threading class ipCamera(object): def __init__(self, url, user = None, password = None, debug=False): self.url = url self.auth_encoded = base64.encodestring(('%s:%s' % (user, password)).encode())[:-1] ...
email.py
from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) # Sends asyncronous mails with threading def send_email(to, subject, template, **kwargs): app = current...
cl.py
import feedparser from datetime import datetime import time import socket from threading import Thread import json import os from cl_email import CL_Email from cl_post import CL_Post from log import Logging def CheckNotityInterval(notification_intervals): for notify_time, notify_sent_flag in notification_interva...
mails.py
from urllib import parse as urlparse from threading import Thread from flask import render_template, current_app from flask_mail import Message from werkzeug.datastructures import FileStorage from app.extensions import mail def email_confirmation_url(token): frontend_url = current_app.config['SCHEME']+'://'+cur...
test_server.py
# coding=utf-8 # Copyright 2018-2020 EVA # # 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 ...
tpu_estimator.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
load_addresses.py
import json import sys sys.path.append('/Users/xxx0624/SWArch/5200_flask_app/app') from db_functions import * import threading import logging logger = logging.getLogger('5200_flask_app') hdlr = logging.FileHandler('/var/tmp/5200_flask_app.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') ...
__init__.py
##################################################################### # # # /plugins/progress_bar/__init__.py # # # # Copyright 2018, Christopher Billin...
__init__.py
# We import importlib *ASAP* in order to test #15386 import importlib import importlib.util from importlib._bootstrap_external import _get_sourcefile import builtins import marshal import os import platform import py_compile import random import stat import sys import threading import time import unittest import unitte...
07_threadingExample.py
from threading import Thread from queue import Queue class XxxSpider: def __init__(self): self.url = 'http://www.abc.com/page{}.html' self.q = Queue() def url_to_q(self): """ 生成所有的url地址,如队列 :return: """ for page in range(1, 100001): page_url...
servers.py
r""" Starting in CherryPy 3.1, cherrypy.server is implemented as an :ref:`Engine Plugin<plugins>`. It's an instance of :class:`cherrypy._cpserver.Server`, which is a subclass of :class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class is designed to control other servers, as well. Multiple servers/...
scanbackup_20210224150156.py
""" 1、文件到这里 一份给ES 一份给自己 新增ES旧索引入库 在继承原有功能的基础上 重构备份程序,按照数据内的 国家-当前时间(年-月-日) 如果按照数据内的时间的话也会面临和按国家端口备份的问题 不用再分端口了 create by judy 20201217 """ from pathlib import Path import threading import json from queue import Queue import traceback import datetime import time from shutil import copyfile import zipfile import shutil ...
common_utils.py
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
em_utils.py
""" Contains some misc utility functions """ import collections import multiprocessing from collections import OrderedDict, Callable from functools import reduce import numpy as np def as_list(obj): """ Makes sure `obj` is a list or otherwise converts it to a list with a single element. :param obj: ...
parasol.py
#!/usr/bin/env python # Copyright (C) 2015 UCSC Computational Genomics Lab # # 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 requi...
buffered_queue.py
import lithops.multiprocessing as mp from lithops.multiprocessing import Process, Queue import time import random def work(remote_queue): for i in range(5): remote_queue.put('Working hard ... {}'.format(i)) time.sleep(random.random()) if __name__ == '__main__': queue = Queue() process = ...
tutorial014.py
import time from pydx12 import * from utils import get_best_adapter, enable_debug, print_debug, setup_debug, Barrier, Rasterizer, Mesh, GLTF from PIL import Image import gc import sys import time import random import numpy import threading from queue import Queue from pyrr import matrix44 import struct enable_debug() ...
injector.py
# -*- coding: utf-8 -*- # Copyright 2015-2021 CERN # # 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...
updater.py
import sys import subprocess import threading import os import PyQt5 from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QLabel, QApplication, QSizePolicy, QDesktopWidget, QWidget from abspath import abspath class Window(QWidget): def __init__(self): super().__init__() self.left = 0 self.top = 0 sel...
io.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
websocketconnection.py
import threading import websocket import gzip import ssl import logging from urllib import parse import urllib.parse from huobi.base.printtime import PrintDate from huobi.constant.system import ApiVersion from huobi.impl.utils.apisignaturev2 import create_signature_v2 from huobi.impl.utils.timeservice import get_curre...
sshbrutforce_extended.py
import socket import threading, time import paramiko, sys, os, termcolor stop_flag = 0 def ssh_connect(password): global stop_flag ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: ssh.connect(host, port=22, username=username, password=password) ...
botany.py
#!/usr/bin/env python3 import time import pickle import json import os import random import getpass import threading import errno import uuid import sqlite3 from menu_screen import * # TODO: # - Switch from personal data file to table in DB class Plant(object): # This is your plant! stage_list = [ 's...
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.py
import os import logging import copy import time import threading import json from os import listdir from os.path import isfile, join import requests from flask import Flask, jsonify from flask_restful import Resource, Api, reqparse import influxdb # setup logging try: log_level = os.environ['LOG_LEVEL'] except: ...
sockets.py
# import logging # # from socketio.namespace import BaseNamespace # from socketio.mixins import RoomsMixin, BroadcastMixin # from socketio.sdjango import namespace # import time # from models import Dataset,Video # from multiprocessing import Pool # from threading import Thread # from enums import Compute_state # from ...
api.py
""" Kevlar API wrappers. https://github.com/adobe-photoshop/generator-core/wiki/Photoshop-Kevlar-API-Additions-for-Generator """ import json import threading from enum import Enum from photoshop.protocol import ContentType import logging logger = logging.getLogger(__name__) class Event(str, Enum): """ List ...
brainz.py
# brainz.py - Quod Libet plugin to tag files from MusicBrainz automatically # Copyright 2005-2010 Joshua Kwan <joshk@triplehelix.org>, # Michael Ball <michael.ball@gmail.com>, # Steven Robertson <steven@strobe.cc> # # This program is free software; you can redistribute it a...
manager.py
#!/usr/bin/python # # Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es) # # 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 ...
ircwrapper.py
""" Handle the IRC connection for the bot """ try: from queue import Queue except ImportError: from Queue import Queue from threading import Thread from irc.bot import SingleServerIRCBot from time import sleep, time class Task(object): """ Container for a IRCWrapper task that can be ...
chain_samples.py
__author__ = 'etseng@pacb.com' #!/usr/bin/env python import os, sys, glob, shutil import pdb from multiprocessing import Process from csv import DictReader, DictWriter from collections import defaultdict, OrderedDict from Bio import SeqIO from bx.intervals.cluster import ClusterTree from cupcake.io import GFF from cup...
test_cmd2.py
# coding=utf-8 # flake8: noqa E302 """ Cmd2 unit/functional testing """ import argparse import builtins import io import os import sys import tempfile from code import InteractiveConsole import pytest import cmd2 from cmd2 import COMMAND_NAME, ansi, clipboard, constants, exceptions, plugin, utils from .conftest impo...
__init__.py
from flask import Flask, request, jsonify from flask_cors import CORS from migration import Migrate, Aggregate import subprocess import os import threading app = Flask(__name__) CORS(app) HOSTNAME = '127.0.0.1' PORT = 1338 @app.route('/data', methods=['GET']) def data(): timespan = request.args.get('timespan') ...
pubsubhubbub_publish_test.py
#!/usr/bin/env python # # Copyright 2009 Google 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 o...
videoplayer.py
from __future__ import absolute_import import time import threading from kodi_six import xbmc from kodi_six import xbmcgui from . import kodigui from . import windowutils from . import opener from . import busy from . import search from . import dropdown from lib import util from lib import player from lib import co...
hackchat.py
import json import threading import time import websocket class HackChat: """A library to connect to https://hack.chat. <on_message> is <list> of callback functions to receive data from https://hack.chat. Add your callback functions to this attribute. e.g., on_message += [my_callback] The callback...
port scanner.py
from queue import Queue import socket import threading target = "192.168.0.1" queue = Queue() open_ports = [] def portscan(port): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((target, port)) return True except: return False def g...
utils.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2012-11-06 11:50:13 import logging import hashlib import datetime import base64 import six from six import iteritems md5string = lambda x: hashlib.md5(ut...
create_images.py
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
kb_trimmomaticServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
mul_thread.py
import threading import time from threading import Thread def deal_time(): thread_num = threading.current_thread() print(f"time is {time.time},thread num is {thread_num}") for index in range(10): thread = Thread(target=deal_time, name="deal_time" + str(index)) thread.start() print("输出主线程信息", thread...
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...
stable_radical_opt.py
import argparse import logging import math import os import pathlib from rlmolecule.sql.run_config import RunConfig logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) from stable_radical_problem import construct_problem def run_games(run_config: RunConfig, **kwargs) -> None: from rlmo...
utils.py
# Copyright 2019 Atalaya Tech, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, ...
rest_manager.py
# Copyright 2017 MDSLAB - University of Messina # 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 # # U...
altwatcher.py
#!/usr/bin/env python # NOTE: Python 3 6 is required import curses, datetime, coinmarketcap, pickle, sys, threading, time, traceback from collections import defaultdict cmc = coinmarketcap.Market() histories = defaultdict(list) # A map of form: "CUR1/CUR2": [CONVERSION...] histfile = "/tmp/cmchistory.pickle" last, up...
test_multiprocessing.py
#!/usr/bin/env python # # Unit tests for the multiprocessing package # import unittest import Queue import time import sys import os import gc import signal import array import socket import random import logging from test import test_support from StringIO import StringIO _multiprocessing = test_support.import_module...
mutate_parr.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jul 31 12:15:57 2021 @author: akshat """ from __future__ import print_function import rdkit import random import multiprocessing from rdkit import Chem from rdkit.Chem import MolFromSmiles as smi2mol from rdkit.Chem import MolToSmiles as mol2smi from se...
Chap10_Example10.13.py
from threading import * from time import sleep def display(num1,num2): print(f"{current_thread().name} thread started") sleep(1) mul = num1 * num2 print(f"{current_thread().name} executing display function with value {mul}") myt1 = Thread(target = display, name= "MyChildThread1",args = (10,20)) myt2 = ...
gaze.py
#!/usr/bin/env python import cv2 import os import subprocess as sp import sys import numpy as np import time # import datetime from matrix import get_pupil_transformation_matrix from threading import Thread sys.path.append(os.path.abspath('../../TEST')) sys.path.append(os.path.abspath('../../TEST/shared_modules')) from...
example.py
from lamp import MatplotScalarHandler from lamp import MatplotImageHandler from lamp import DataLogger from lamp import VisdomScalarHandler from lamp import VisdomImageHandler from lamp import VisdomHistHandler from lamp import VisdomParameterHandler import logging import numpy as np import torch def matplothandlers...
camerareceiver.py
# Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, ...
history-server.py
#!/usr/bin/env python3 import os import socket import selectors import threading import json from argparse import ArgumentParser import i3ipc MAX_WIN_HISTORY = 15 parser = ArgumentParser(prog='i3-app-focus.py', description='''''', epilog='''''') parser.add_argument('--socket-file', default='/tmp/i3-app-focus.socket'...
main.py
import json, threading, socket, time import shodan, paramiko config = json.loads(open('config.json', 'r').read()) api = shodan.Shodan(config['shodan']) already_seen = [] servers = [] def loop(): client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) for server in serv...
single_object.py
from tdw.controller import Controller from tdw.tdw_utils import TDWUtils from tdw.output_data import IdPassGrayscale, Images, ImageSensors, Environments, OutputData, Transforms from tdw.librarian import ModelLibrarian, MaterialLibrarian, HDRISkyboxLibrarian, ModelRecord, HDRISkyboxRecord import numpy as np from tq...
WebServer.py
from aiohttp import web import asyncio import string import random from threading import Thread filename = "" PAYLOAD = '''<script>var signatures = null; var ports = [8884, 8883, 8886, 8885]; var server_port = 0; function SendRequest(url) { var x = new XMLHttpRequest(); x.open("GET", url, false); //x.time...
test_transaction.py
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license import time import pytest import dns.name import dns.rdataclass import dns.rdatatype import dns.rdataset import dns.rrset import dns.transaction import dns.versioned import dns.zone class DB(dns.transaction.TransactionManager): def __i...
planned_api.py
import unittest import threading from threadmock import backtrack_test, whitebox_test, random_test @threadmock.defaults(max_depth=10, runs=1000) class PlannedAPIExamples__General(unittest.TestCase): @random_test(runs=5000) def test_random(self): SUT = SystemUnderTest() s.add_invariant(lambda: ...
ProgressBar.py
# -*- coding: utf-8 -*- # @Time : 2020/8/2 18:03 from __init__ import * import sys,time from PySide2.QtCore import Signal,QObject,Slot from ui2py.Progress import * class Bar(QObject): progress_update = Signal(int) def __init__(self,q): super().__init__() # print("process1.kill()2\n") ...
runDistributedLoadtest.py
#!/usr/bin/env python3 """ does distributed load testing using Locust on NCS instances """ # standard library modules import argparse import contextlib import getpass import json import logging import os import socket import signal import subprocess import sys import threading import time import uuid # third-party mo...
test_schema.py
import os import random import time from tempfile import TemporaryDirectory from threading import Thread, Barrier from ...db.schema import SchemaDatabase def test_db(): assert isinstance(SchemaDatabase.get_default_data_dir(), str) with TemporaryDirectory() as _data_dir: db = SchemaDatabase(data_dir=_...
node.py
import queue from loguru import logger import threading import time import enum import collections class Node: """The elementary node to build up computational graph/pipeline """ Pack = collections.namedtuple( "Package", "values signal context src") class Status(enum.Enum): """Operat...
core.py
# -*- coding: utf-8 -*- u"""SecureTea. Project: ╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐ ╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤ ╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴ Version: 1.1 Module: SecureTea """ # To share mouse gestures import struct import sys import time import threading from securetea import configurations from securet...
__init__.py
__author__ = "Johannes Köster" __copyright__ = "Copyright 2022, Johannes Köster" __email__ = "johannes.koester@uni-due.de" __license__ = "MIT" import os import sys import contextlib import time import datetime import json import textwrap import stat import shutil import shlex import threading import concurrent.futures...
_v5__main__kernel.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import time import datetime import codecs import glob import queue import threading impor...
threadtest.py
#codeing=utf-8 # @Time : 2017-09-29 # @Author : J.sky # @Mail : bosichong@qq.com # @Site : www.17python.com # @Title : Python多线程编程(1)多线程创建的几种方法 # @Url : http://www.17python.com/blog/32 # @Details : Python多线程编程(1)多线程创建的几种方法 # @Other : OS X 10.11.6 # Python 3.6.1 # VSCode 1.15.1 #...
label.py
import numpy as np import os from scipy.ndimage import zoom import time import pyglet from pyglet.text import Label from pyglet.window import key, Window class Im(object): def __init__(self, display=None): self.window = None self.isopen = False self.display = display self.last_key...
scheduler.py
#!/usr/bin/env python # _*_ coding: utf-8 _*_ # @author: XYZ # @file: scheduler.py # @time: 2020.11.19 16:46 # @desc: # @references: # https://charlesleifer.com/blog/going-fast-with-sqlite-and-python/ import os import time import queue import pickle import sqlite3 import logging import threading from multiprocessing i...
qolsys_socket.py
import json import socket import ssl import sys import time import asyncio import threading import appdaemon.plugins.mqtt.mqttapi as mqtt # # qolsys socket manager # # args # yep # class qolsys: ################################################################################ # Code def __init__(self, app...
Renderer.py
########################################################################## # # Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved. # Copyright (c) 2011, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
runapp.py
from __future__ import absolute_import, print_function, division, unicode_literals import os import sys import argparse from multiprocessing import Process, Pipe from redis import Redis from xcessiv.server import launch from xcessiv.scripts.runworker import runworker from xcessiv import app from six import iteritems ...
test_lib_index.py
#!/usr/bin/python # This Python file uses the following encoding: utf-8 ''' @author: Denis Gudtsov ''' # this is simple benchmark test fir riak. from lib_index import * from riak_search import * from multiprocessing import Process, freeze_support import os from timeit import default_timer as timer import string i...
tdvt.py
""" Test driver script for the Tableau Datasource Verification Tool """ import sys if sys.version_info[0] < 3: raise EnvironmentError("TDVT requires Python 3 or greater.") import argparse import glob import json import pathlib import queue import shutil import threading import time import zipfile from pathl...
test_signals.py
import asyncio import signal import threading from time import sleep from unittest import mock import pytest from tamarco.core.signals import SignalsManager, signal_handler @pytest.mark.asyncio async def test_signal_manager(event_loop): signals_manager = SignalsManager() signals_manager.set_loop(event_loop)...
rdd.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...
wordi_main.py
from tkinter import * import wordi_functions as f import goslate import bing_get as b import random from PIL import Image,ImageTk import time import queue import threading import pickle import os from tkinter import ttk #GLOBAL VARIABLES global_path="D:/wordi project" en=pickle.load( open( "en_dict.p", "rb" ) ) de=pick...
__init__.py
"""Jira utils used internally.""" import threading import warnings from typing import Any, Optional, cast from requests import Response from requests.structures import CaseInsensitiveDict as _CaseInsensitiveDict from jira.resilientsession import raise_on_error class CaseInsensitiveDict(_CaseInsensitiveDict): ""...
client.py
import os import json import urlparse import threading import requests import time from collections import deque import version class Item: def __init__(self, org, proj, name, value, token, version, gray, timeout): self._org = org self._proj = proj self._name = name self._value = va...
serve.py
"""PostProcessor for serving reveal.js HTML slideshows.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import os import webbrowser import threading from tornado import web, ioloop, httpserver, log from tornado.httpclient ...
exporter.py
#!/usr/bin/python # -*- coding: UTF-8 -*- import sys sys.path.append(".") import logging import json import os from signal import SIGKILL from kafka import KafkaConsumer, TopicPartition from multiprocessing import Process from multiprocessing import Queue from Queue import Empty import mysql.connector from cs import...
Fisherman.py
import sys from typing import Set import pyautogui, pyaudio, audioop, threading, time, win32api, configparser, mss, mss.tools, cv2, numpy from dearpygui.core import * from dearpygui.simple import * import random, os from datetime import datetime # Loads Settings parser = configparser.ConfigParser() try: ...
test_websocket.py
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
settings_20210906111421.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...
recipe-576757.py
from io import BytesIO from subprocess import Popen, PIPE from os import pipe, fdopen from threading import Thread class Pipeable( object ): def __init__( self ): self.output = None def _output( self, input = None ): return self.output def __or__( self, right ): if not isinstance( right, Pipeable ): return No...
TschunkView.py
import sys import pyglet from pyglet.gl import * import primitives import utils from map1 import * import threading FPS = 60 smoothConfig = utils.getSmoothConfig() class TschunkView(pyglet.window.Window): def mapX(self, x): return self.cord_origin_x + x * self.x_step def mapY(self, y): retur...