source
stringlengths
3
86
python
stringlengths
75
1.04M
test_http_action.py
import json import threading import six if six.PY2: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler else: from http.server import HTTPServer, BaseHTTPRequestHandler from unittest_helper import ActionTestBase, capture_stream class HttpActionTest(ActionTestBase): def setUp(self): se...
views.py
# -*- coding: utf-8 -*- # Copyright 2014 Dev in Cachu 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 logging import threading import requests from django import http from django.conf import settings from django.core import m...
halo.py
# -*- coding: utf-8 -*- # pylint: disable=unsubscriptable-object """Beautiful terminal spinners in Python. """ from __future__ import absolute_import, unicode_literals import atexit import functools import sys import threading import time import halo.cursor as cursor from log_symbols.symbols import LogSymbols from s...
utils.py
# # Copyright (c) 2017 Intel Corporation # # 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...
thread_example.py
import threading import time import logging logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] (%(threadName)-10s) %(message)s', ) #concurrency example class Message_Passer(object): def __init__(self): self.lock = threading.Lock() se...
target.py
#!/usr/bin/env python3 ''' Visually-guided predation Copyright (C) 2020 Simon D. Levy MIT License ''' import gym import numpy as np import threading import time ALTITUDE_TARGET = 5 # meters def update(env): # Create and initialize copter environment env.reset() # Start with all m...
daemon_2.py
# System imports import threading, time, sys, os, traceback, plistlib from threading import Thread import platform WIN = platform.system() == "Windows" MAC = platform.system() == "Darwin" if WIN: import ctypes from win10toast import ToastNotifier DEBUG = True APPVERSION = "n/a" LOOPDURATION = 60 UPDATESE...
ark_client.py
''' An effort to build a proccess pool that tests ARKALOS TOOLS/DATA VERY EXPERIMENTAL! ''' import os import pty import sys import json import time import errno import shlex import traceback from select import select from multiprocessing import Queue as process_Queue from multiprocessing import Process from queue i...
cli.py
import collections import csv import multiprocessing as mp import os import datetime import sys from pprint import pprint import re import itertools import json import logging import ckan.logic as logic import ckan.model as model import ckan.include.rjsmin as rjsmin import ckan.include.rcssmin as rcssmin import ckan.li...
send_email.py
# -*- coding: utf-8 -*- """ @project : WechatTogether @Time : 2020/11/9 16:58 @Auth : AJay13 @File :send_email.py @IDE :PyCharm @Motto:ABC(Always Be Coding) """ from threading import Thread from flask import render_template from flask_mail import Message from exts import db from exts import mail from utils import fi...
dx_operations.py
#!/usr/bin/env python # Corey Brune - Oct 2016 # This script starts or stops a VDB # requirements # pip install docopt delphixpy # The below doc follows the POSIX compliant standards and allows us to use # this doc to also define our arguments for the script. """List all VDBs or Start, stop, enable, disable a VDB Usag...
ios_device.py
# Copyright 2019 WebPageTest LLC. # Copyright 2017 Google Inc. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Interface for iWptBrowser on iOS devices""" import base64 import logging import multiprocessing import os import platform import select import shutil...
importer.py
# Unefficient way to import metrics from Prometheus to InfluxDB. # TODO: need to refact to use less memory import sys import os import logging import json from datetime import datetime from influxdb import InfluxDBClient from argparse import ArgumentParser from multiprocessing import Queue, queues import queue from th...
submitData.py
from CRABClient.UserUtilities import config, ClientException, getUsernameFromCRIC from PhysicsTools.BParkingNano.skim_version import skim_version #from input_crab_data import dataset_files import yaml import datetime from fnmatch import fnmatch from argparse import ArgumentParser production_tag = datetime.date.today()...
main.py
import random import telebot import schedule from time import sleep from threading import Thread from telebot import types, custom_filters from settings import ADMINS, TELEGRAM_TOKEN, SMTP from messages import generate_password, is_correct_mail from orm import get_user, set_field, create_user, get_admins, get_users, g...
utils.py
# -*- coding: utf-8 -*- import threading _MAX_SEMAPHORE = 10 def call_api_with_multithread(api_method, target_lines): def worker(line, results, i, semaphore): with semaphore: results[i] = api_method(line) results = [("", "")] * len(target_lines) s = threading.Semaphore(_MAX_SEMAPHORE...
lp_mip_solver.py
######################################################################### ## This file is part of the alpha-beta-CROWN verifier ## ## ## ## Copyright (C) 2021, Huan Zhang <huan@huan-zhang.com> ## ## K...
util.py
# -*- coding: utf-8 -*- """ Miscellaneous utility functions. ------------------------------------------------------------------------------ This file is part of Skyperious - Skype chat history tool. Released under the MIT License. @author Erki Suurjaak @created 16.02.2012 @modified 01.08.2021 -...
cos_cmd.py
# -*- coding: utf-8 -*- from six.moves.configparser import SafeConfigParser from six import text_type from argparse import ArgumentParser from logging.handlers import RotatingFileHandler import sys import logging import os import json import requests from threading import Thread from coscmd import cos_global...
tweeviz.py
#!/usr/bin/env python import json import os import threading import time import flask from snakebite import client hdfs_address = os.getenv('TWEEVIZ_HDFS_ADDRESS', 'hdfs-namenode') hdfs_port = int(os.getenv('TWEEVIZ_HDFS_PORT', 8020)) results_dir = os.getenv('TWEEVIZ_HDFS_PATH', '/') min_popularity = int(os.getenv(...
queues_empty_full.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import time import queue def my_subscriber(my_queue): time.sleep(1) while not my_queue.full(): my_queue.put(1) print('{} Appended 1 to queue'.format(threading.current_thread().getName())) time.sleep(1) def main(): my...
DarkFB.py
# -*- coding: utf-8 -*- import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool try: import mechanize except ImportError: os.system('pip2 install mechanize') else: try: import requests except ImportEr...
mock.py
import contextlib import pytest import threading import logging import socket import time from esprima import parseScript from esprima.error_handler import Error as ParseError from socketserver import BaseRequestHandler, ThreadingTCPServer from photoshop.protocol import Protocol, ContentType, Pixmap logger = logging.g...
ssl-close-notify.py
# Scenario: # - TLS connection is set up successfully # - client sends close_notify then closes socket # - server receives the close_notify then attempts to send close_notify back # # On CPython, the last step raises BrokenPipeError. On PyPy, it raises # SSLEOFError. # # SSLEOFError seems a bit perverse given that it's...
world_info.py
#!/usr/bin/env python # # Copyright (c) 2018-2019 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # """ Class to handle the carla map """ #import rospy from carla_msgs.msg import CarlaWorldInfo from pseudo_actor import PseudoAct...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper from test.support import warnings_helper import sock...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """StudioFileChooserThumbView ==================== The StudioFileChooserThumbView widget is similar to FileChooserIconView, but if possible it shows a thumbnail instead of a normal icon. Usage ----- You can set some properties in order to control its performance: * **s...
node_server.py
#==============================================================================================# ###### 0_NODE_SERVER ###### ''' This is a level 0 node server. This node contains the entire software stack and can execute every network function. Gate keeper for private networks. Facilitates custom user functions. IPFS...
shared_memory.py
import multiprocessing import ctypes import numpy as np import mymodule from time import sleep lock = None def init(shared_array_base): global lock # shared_array = np.ctypeslib.as_array(shared_array_base.get_obj()) mymodule.toShare = np.frombuffer(shared_array_base.get_obj()) mymodule.toShare = mymod...
test_connection_ncs5500.py
# ============================================================================= # # Copyright (c) 2016, Cisco Systems # All rights reserved. # # # Author: Klaudiusz Staniek # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met...
main_module.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, os.path, platform, ctypes os.environ["PBR_VERSION"]='5.0.0' import logging from consoleTools import consoleDisplay as cd from PIL import ImageGrab # /capture_pc from shutil import copyfile, copyfileobj, rmtree, move # /ls, /pwd, /cd, /copy, /mv from sys ...
parallel_alphazero_chess.py
import os # os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' import math import numpy as np from typing import List from multiprocessing import Process, Manager, set_start_method from pettingzoo.classic import chess_v3 from pettingzoo.utils import wrappers from pettingzoo.classic.chess import chess_utils import chess from pet...
visualizer.py
import webcolors as wc import sys import os import fcntl from lib.learnmidi import LearnMIDI from lib.ledsettings import LedSettings from lib.ledstrip import LedStrip from lib.menulcd import MenuLCD from lib.midiports import MidiPorts from lib.savemidi import SaveMIDI from lib.usersettings import UserSettings from lib...
Polaris.py
# -*- coding: utf-8 -*- """ Created on Sun Jul 9 10:25:42 2017 @author: samuel """ import base64 import itertools import os import threading from tkinter import * from tkinter import filedialog from tkinter import messagebox from tkinter import simpledialog from tkinter import ttk import matplotlib.pyplot as plt im...
http_server.py
from .socket_server import SocketServer from sys import _getframe as _gf from urllib.parse import urlparse, unquote import threading import socket import os HTTP_VERSION = "HTTP/1.1" SUPPORTED_METHODS = ("GET", "POST") SUPPORTED_HEADERS = ("host",) ERROR_PAGES = { 400: "400.html", 404: "404.html", ...
docker_base.py
import json import logging import os import threading from multiprocessing import Process, Queue from queue import Empty from typing import Tuple, Union from docker import DockerClient from docker.models.containers import Container from casperlabs_local_net.errors import CommandTimeoutError, NonZeroExitCodeError from ...
cb-replay-pov.py
#!/usr/bin/env python """ CB POV / Poll communication verification tool Copyright (C) 2014 - Brian Caswell <bmc@lungetech.com> 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...
cameracontroller.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import io import os import picamera import threading from time import sleep from camera import Camera from eventsmanager import EventsManager class CameraController: def __init__(self): self.em = EventsManager() self.camera = Camera() self.ID =...
insertionSort.py
""" * Carmen Creswell * Group 2 * Insertion Sort """ import time import multiprocessing as mp numProc = 4 # Starting number of Processes # Serial Insertion Sort # Slightly modified from: http://interactivepython.org/courselib/static/pythonds/SortSearch/TheInsertionSort.html def serialInsertionSort(alist): for ...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
serial_gui.py
import tkinter as tk from tkinter import ttk from tkinter import scrolledtext import serial import serial.tools.list_ports import threading import time class SerialGUI: ser = serial.Serial() # 串口对象 ser_state = False # 用于指示串口是否打开 def __init__(self): # 创建界面 self.win = tk.Tk...
app.py
#!/bin/python import logging from logging.config import dictConfig from multiprocessing import Process from api.apis import ulca_dataset_publish from kafkawrapper.consumer import consume from kafkawrapper.searchconsumer import search_consume from kafkawrapper.deleteconsumer import delete_consume from configs.configs i...
experiment_head.py
import argparse import datetime import multiprocessing import time import matplotlib.pyplot as plt import numpy as np import bss from bss.head import HEADUpdate config = { "seed": 873009, "n_repeat": 1000, "n_chan": [4, 6, 8], "tol": -1.0, # i.e. ignore tolerance "maxiter": 100, "dtype": np....
player_thread.py
import json from utilities import LocationMapper as locationMapper import time from threading import Thread #Responsible for receiving player information and updating its player class PlayerThread: def __init__(self,socket,player): self.socket = socket self.player = player self.mapACK = True self.queue = [] ...
stable_topology_fts.py
# coding=utf-8 import copy import json import random import time from threading import Thread import Geohash from membase.helper.cluster_helper import ClusterOperationHelper from remote.remote_util import RemoteMachineShellConnection from TestInput import TestInputSingleton from tasks.task import ESRunQueryCompare f...
vnokcoin.py
# encoding: UTF-8 import hashlib import zlib import json from time import sleep from threading import Thread import websocket # OKCOIN网站 OKCOIN_CNY = 'wss://real.okcoin.cn:10440/websocket/okcoinapi' OKCOIN_USD = 'wss://real.okcoin.com:10440/websocket/okcoinapi' # 账户货币代码 CURRENCY_CNY = 'cny' CU...
harness.py
#!/usr/bin/env python ############################################################################## # Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ################################...
server.py
import socket import threading from rsmtpd.core.config_loader import ConfigLoader from rsmtpd.core.logger_factory import LoggerFactory from rsmtpd.core.tls import TLS from rsmtpd.core.worker import Worker class Server(object): __config_loader = None __logger_factory = None __logger = None __default_c...
remote.py
import re import sys import signal import logging import argparse import functools import ami.multiproc as mp from mpi4py import MPI from ami import LogConfig from ami.multiproc import check_mp_start_method from ami.comm import Ports from ami.worker import run_worker from ami.collector import run_node_collector logg...
app.py
from flask import Flask, request, render_template ,url_for,redirect from threading import Thread from main import autorec app = Flask(__name__) urls=[] subtakeover_urls=[] alive_urls=[] url='' @app.route('/',methods=['GET']) def myHome(): if request.method == 'GET': return render_template('index.html') ...
cancellable_task.py
from collections import Generator import threading import pypegraph.action class TaskProgress: def __init__(self, progress_value: float = 0, progress_state: str = ""): self._progress_value: float = progress_value self._progress_state: str = progress_state @property def progress_value(se...
util.py
import math import pathlib import platform import random import string import threading import time from io import BytesIO from itertools import product from urllib.parse import urljoin import execjs import progressbar import requests from imgcat import imgcat from openpyxl import Workbook from openpyxl.drawing.image ...
utils.py
# Copyright The PyTorch Lightning team. # # 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 i...
test_bz2.py
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import pickle import glob import pathlib import random import shutil import subprocess from test.support import unlink import _compression try: import threading except ImportErro...
mbase.py
""" mbase module This module contains the base model class from which all of the other models inherit from. """ import abc import os import shutil import threading import warnings import queue as Queue from datetime import datetime from shutil import which from subprocess import Popen, PIPE, STDOUT import copy im...
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...
ws_core.py
import threading, time, datetime, json, uuid from concurrent.futures.thread import ThreadPoolExecutor import traceback import tornado.ioloop import tornado.web import tornado.websocket import tornado.template import tornado.httpserver from tornado import gen import ssl,os import OmniDB_app.include.Spartacus as Sparta...
server.py
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ---------------------------------------------------...
experience.py
# -*- coding:utf8 -*- # File : experience.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 12/08/2017 # # This file is part of TensorArtist. from tartist.core import get_logger from tartist.core.utils.meta import map_exec from tartist.core.utils.concurrent_stat import TSCounterBasedEvent, TSCoor...
deck.py
import random from queue import Queue from threading import Thread, Timer from qwirk.game import GameObj class BadOptions(Exception): pass class BadDeck(Exception): pass class Deck(): def __init__(self, settings): self.game = GameObj.game self.deck = [] self.settings = settings ...
user_input_monitor.py
import subprocess import logging from adapter import Adapter class UserInputMonitor(Adapter): """ A connection with the target device through `getevent`. `getevent` is able to get raw user input from device. """ def __init__(self, device=None): """ initialize connection :p...
threadingProcess.py
# example of automatically starting a thread from time import sleep from threading import Thread # custom thread class that automatically starts threads when they are constructed class AutoStartThread(Thread): # constructor def __init__(self, *args, **kwargs): # call the the parent constructor...
main.py
#!/usr/bin/env python ######################################################################################### # Copyright 2017 SKA South Africa (http://ska.ac.za/) # # # # BSD license - see LICENSE....
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json from threading import Thread import time import csv import decimal from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob # See https://en.wikipedia.org/wiki/ISO_42...
app.py
from threading import Thread from xml.etree import ElementTree def sort(seq): quicksort(seq,0,len(seq)-1) return seq def quicksort(seq, low, high): if low<high: partn = partition(seq,low,high) t1 = Thread(target=quicksort,args=(seq,low,partn-1)) t1.start() t1.join() t2 = Thread(target=quicksort,args=(s...
streaming.py
""" Streaming Parallel Data Processing =================================================================== Neuraxle steps for streaming data in parallel in the pipeline .. Copyright 2019, Neuraxio Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in com...
main.py
#!/usr/bin/env python # encoding: utf8 # # Copyright © Burak Arslan <burak at arskom dot com dot tr>, # Arskom Ltd. http://www.arskom.com.tr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
program.py
from tkinter import * from tkinter import messagebox from report import excelReport from PIL import ImageTk from PIL import Image import threading from utils import * class Window(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.master = master self.initWindow() ...
bmv2.py
import json import multiprocessing import os import random import re import socket import threading import time import urllib2 from contextlib import closing from mininet.log import info, warn from mininet.node import Switch, Host SIMPLE_SWITCH_GRPC = 'simple_switch_grpc' PKT_BYTES_TO_DUMP = 80 VALGRIND_PREFIX = 'valg...
workserver.py
# workserver.py - simple HTTP server with a do_work / stop_work API # GET /do_work activates a worker thread which uses CPU # GET /stop_work signals worker thread to stop import math import socket import threading import time from bottle import route, run hostname = socket.gethostname() hostport = 9000 keepworking = ...
AsyncWorker.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # @author jsbxyyx # @since 1.0 import queue import threading import time from loguru import logger from seata.rm.datasource.undo.UndoLogManagerFactory import UndoLogManagerFactory class AsyncWorker: ASYNC_COMMIT_BUFFER_LIMIT = 10000 def __init__(self, data_sour...
cyberzic.py
# -*- coding: utf-8 -*- from LineAPI.linepy import * from thrift.unverting import * from thrift.TMultiplexedProcessor import * from thrift.TSerialization import * from thrift.TRecursive import * from thrift import transport, protocol, server from gtts import gTTS from bs4 import BeautifulSoup from datetime import date...
ws_client.py
# Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors # # SPDX-License-Identifier: Apache-2.0 # # 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.a...
email.py
from threading import Thread from flask_mail import Message from flask import current_app, render_template from . import mail, app def send_async_mail(message): with app.app_context(): mail.send(message) def welcome_mail(user): message = Message('Welcome', sender=current_app.c...
ros_monitor.py
#!/usr/bin/env python import rospy import socket import threading import pickle #truc rajouter import time from struct import * from tf.transformations import euler_from_quaternion from nav_msgs.msg import Odometry from sensor_msgs.msg import LaserScan class ROSMonitor: def __init__(self): # Add ...
dict_to_4lang.py
from __future__ import with_statement from collections import defaultdict import json import logging import os import sys import threading import time import traceback from collins_parser import CollinsParser from corenlp_wrapper import CoreNLPWrapper from dep_to_4lang import DepTo4lang from eksz_parser import EkszPar...
dos.py
import random import socket import threading times = 1000 threads = 1000 def dos(): data = random._urandom(16) i = random.choice(("[*]", "[!]", "[#]")) while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('127.0.0.1', 8888)) s.send(...
_stack.py
# Copyright 2016-2021, Pulumi Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
core.py
import multiprocessing from .messages import Central from .logger import Logger import logging import os class Core: def __init__(self, loglevel=logging.INFO): self._process_event = multiprocessing.Event() self._process_ids = [] self._shutdowns = [] self._process_count = 0 ...
TestPuppetExecutor.py
#!/usr/bin/env python2.6 ''' 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 "Licens...
pyPadWormbk2.py
# for monster data of puzzle and dragon 下载战友网图片和资料 # bug 多线程,最后更新列表的时候会有问题 import os import sys from queue import Queue import re import time import threading import urllib.request import urllib.error import bs4 import lxml #replace url to start your own download url = "http://pad.skyozora.com/pets/" typestr = ["龍","神...
test_operator.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...
connection_pool.py
# -*- coding: utf-8 -*- import logging import contextlib import random import threading import time import socket from collections import deque from .hooks import api_call_context, client_get_hook logger = logging.getLogger(__name__) SIGNAL_CLOSE_NAME = "close" def validate_host_port(host, port): if not all...
test_utility.py
import threading import pytest from base.client_base import TestcaseBase from base.utility_wrapper import ApiUtilityWrapper from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks prefix = "utility" defau...
train.py
import argparse import logging import os import random import time from pathlib import Path from threading import Thread from warnings import warn import math import numpy as np import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim.lr_sche...
main.py
""" An example demonstrating a stand-alone "filebrowser". Copyright (c) Jupyter Development Team. Distributed under the terms of the Modified BSD License. Example ------- To run the example, see the instructions in the README to build it. Then run ``python main.py`` and navigate your browser to ``localhost:8765``. ...
network.py
# Electrum - Lightweight Bitcoin Client # Copyright (c) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rig...
c3.py
import redis import time import threading conn = redis.Redis() """ simle redis code with subcrible and publish """ def publisher(n): time.sleep(1) for i in range(n): conn.publish('channel',i) time.sleep(1) def run_pubsub(): threading.Thread(target=publisher,args=(3,)).start() pubsub = conn.pubsub() pubsub...
trustedcoin.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
USDSceneTest.py
########################################################################## # # Copyright (c) 2017, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
WindowsDefender.py
# ░██████╗██████╗░██╗░░░██╗  ████████╗██████╗░░█████╗░░░░░░██╗░█████╗░███╗░░██╗ # ██╔════╝██╔══██╗╚██╗░██╔╝  ╚══██╔══╝██╔══██╗██╔══██╗░░░░░██║██╔══██╗████╗░██║ # ╚█████╗░██████╔╝░╚████╔╝░  ░░░██║░░░██████╔╝██║░░██║░░░░░██║███████║██╔██╗██║ # ░╚═══██╗██╔═══╝░░░╚██╔╝░░  ░░░██║░░░██╔══██╗██║░░██║██╗░░██║██╔══██║██║╚████║ ...
executors.py
# -*- coding: utf-8 -*- """ Single and multi-threaded executors.""" import datetime import logging import os import tempfile import threading from abc import ABCMeta, abstractmethod from threading import Lock from typing import ( Dict, Iterable, List, MutableSequence, Optional, Set, Tuple, ...
house.py
#!/usr/bin/python3 from my_house_settings import * from bs4 import BeautifulSoup # used in sunScraper function on line 673 for security lighting if dark outside or not. import RPi.GPIO as GPIO from PIL import Image # used in grabImg function on line 644 for resizing CCTV camera image to fit on screen. import tkinter as...
gDrive.py
import os import pickle import urllib.parse as urlparse from urllib.parse import parse_qs from bot import LOGGER import json import time import threading import logging import requests import socket from socket import timeout from google.auth.transport.requests import Request from google.oauth2 import service_account...
vk_bot.py
import os from multiprocessing import Process from urllib.request import urlopen import vk from .instagram import Instagram, Instagram404Error, InstagramLinkError VK_GROUP_TOKEN = os.environ.get('GROUP_TOKEN') VK_GROUP_ID = os.environ.get('GROUP_ID') MESSAGE_IF_NOT_MEMBERS = os.environ.get("MESSAGE_IF_NOT_MEMBERS") ...
core.py
# -*- coding: utf-8 -*- # # :copyright: (c) 2021 by Pavlo Dmytrenko. # :license: MIT, see LICENSE for more details. """ yaspin.yaspin ~~~~~~~~~~~~~ A lightweight terminal spinner. """ from __future__ import absolute_import import contextlib import datetime import functools import itertools import signal import sys ...
__init__.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
comms.py
################################################################################### # @file comms.py ################################################################################### # _ _____ ____ ____ _____ # | |/ /_ _/ ___|| _ \| ____| # | ' / | |\___ \| |_) | _| # | . \ | |___ ) | __/| |___ # |_|\_\__...
cli.py
import os import sys import tempfile import threading from contextlib import contextmanager from typing import Optional import click from dagster import check from dagster.cli.workspace import ( get_workspace_process_context_from_kwargs, workspace_target_argument, ) from dagster.cli.workspace.cli_target import...
setup.py
#!/usr/bin/env python #encoding: utf8 import os import re import sys from setuptools import setup from setuptools import find_packages from setuptools.command.test import test as TestCommand try: import colorama colorama.init() from colorama import Fore RESET = Fore.RESET GREEN = Fore.GREEN R...