source
stringlengths
3
86
python
stringlengths
75
1.04M
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import platform import signal import io import itertools import os import errno import tempfile import time import selectors import sysconfig import select import shutil import threading import gc import textwrap from test.s...
server.py
# MIT License # # Copyright (c) 2019 iagocq # # 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 rights # to use, copy, modify, merge, publi...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Tokyocoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a tokyocoind node can load multiple wallet files """ from decimal impo...
__init__.py
#### PATTERN | WEB ################################################################################# # -*- coding: utf-8 -*- # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ############...
slycat-parameter-image-plus-model.py
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract # DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government # retains certain rights in this software. def register_slycat_plugin(context): """Called during ...
audio.py
# (c) 2021 Simleek # This code is licensed under MIT license (see LICENSE for details) import multiprocessing import pathlib import sys from typing import Union import librosa import numpy as np import pyaudio ourpath = pathlib.Path(__file__).parent class InputConfig(object): min_seconds = 2 sampling_rate ...
oscar-multilingual-to-jsonl.py
#!/usr/bin/env python # # generate jsonl version of dataset that can be fed to megatron-lm pre-processor # # see various notes in the scripts for different options # # full dataset: # ./oscar-multilingual-to-jsonl.py # cat oscar-[0-4].jsonl > oscar.jsonl # # small dataset (0.1%): # ./oscar-multilingual-to-jsonl.py -s #...
stress.py
# -*- coding: utf-8 -*- ''' Created on 2018. 9. 20. @author: jason96 ''' from sputil.base import SplunkBase from threading import Lock import requests import threading import time import signal import sys class StressTest(SplunkBase): ''' classdocs ''' def __init__(self): super(StressTest, ...
GUIEventBinder.py
import wx import gui import threading _user_pool_ = None def init(Pool): global _user_pool_ _user_pool_ = Pool Main_MenuBar_File_Handler.bindEvent() Main_MenuBar_Edit_Handler.bindEvent() Main_MenuBar_Operation_Handler.bindEvent() Main_MenuBar_Help_Handler.bindEvent() Main_Member_Menu_H...
ImageProcessor.py
import cv2 import numpy as np import os import random import math import multiprocessing import sys import time class ImageProcessor: def __init__(self, tileSizes): # frames are 1080x2340 (ONEPLUS 7T) # define ROI, height between pixel 470 and 1950 # so cut away 470 top and 390 (2340-1950)...
test_worker.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import os import shutil import signal import subprocess import sys import time import zlib from datetime import datetime, timedelta from multiprocessing import Process from time import ...
spark_backend.py
import pkg_resources import sys import os import json import socket import socketserver from threading import Thread import py4j import pyspark from typing import List import hail as hl from hail.utils.java import Env, scala_package_object, scala_object from hail.expr.types import dtype from hail.expr.table_type impo...
train_abstractive.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_transformers import BertTokenizer import distributed from models import data_loader, model_builder from models.data_loader i...
test_thread_file_handler.py
"""Test Module""" # standard library import os import threading import time from typing import TYPE_CHECKING # third-party import pytest if TYPE_CHECKING: # first-party from tcex import TcEx @pytest.mark.run(order=1) class TestThreadFileHandler: """Test Module""" @staticmethod def logging_threa...
fiscrape_gui.py
from FiScrape.search import search_win from tkinter import * from tkinter import filedialog from tkinter import messagebox import os import sys if sys.platform == 'darwin': from tkmacosx import Button # python fiscrape_gui.py from scrapy.utils import project from scrapy.spiderloader import SpiderLoader from scra...
launch_function_helper.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
patcher_test.py
import os import shutil import sys import tempfile from eventlet.support import six import tests base_module_contents = """ import socket import urllib print("base {0} {1}".format(socket, urllib)) """ patching_module_contents = """ from eventlet.green import socket from eventlet.green import urllib from eventlet im...
cache.py
# # Copyright (C) 2019 UAVCAN Development Team <info@zubax.com>. # Author: Pavel Kirienko <pavel.kirienko@zubax.com> # import time import urllib.request import threading from . import expiring_storage from .. import app def get(url, background_update_interval, cache_expiration_timeout, header...
glue.py
from flask import abort, request from inspect import getargspec from bson.json_util import dumps from bson.objectid import ObjectId from good import Invalid import sys import time import threading def lexic_join(expressions): *most, last = expressions if most: return ', '.join(str(e) for e in most) + '...
foo.py
# Python 3.3.3 and 2.7.6 # python foo.py from threading import Thread, Lock # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 lock = Lock() def incrementing...
__init__.py
import traceback import time import random import string import io import socket import warnings import struct import threading import requests class PeerApplication(object): def receive(self, server, client, message): pass def on_registered(self, server): pass def connec...
forker.py
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ COHORTE forker shell commands Provides commands to the Pelix shell to work with the forker :author: Thomas Calmant :license: Apache Software License 2.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); ...
test_ipc_provider.py
import os import pathlib import pytest import socket import sys import tempfile from threading import ( Thread, ) import time import uuid from client_sdk_python.auto.gethdev import ( w3, ) from client_sdk_python.middleware import ( construct_fixture_middleware, ) from client_sdk_python.providers.ipc import...
buffer_store.py
from interface import * from plasma import save_data, load_data, save_meta, load_meta, save_both, load_both import pyarrow as pa import numpy as np import pyarrow.plasma as plasma import multiprocessing as mp import time import copy class UniqueID: _id = 0 @staticmethod def Gen(): UniqueID._id +=...
twitch_bot.py
#!/usr/bin/env python3 import os # for importing env vars for the bot to use import socket import select import time from threading import Thread import sqlite3 import tkinter as tk import sys class Command_DB(): def __init__(self): pass def make_connection(self,DBname): try: conn =...
Connect4.py
from dearpygui.core import * import time import math import socket import threading import numpy ADDR = ('dpg-games.duckdns.org', 6543) running = True s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) inGame = False staringTurn = 0 class NonNegativeNumpyIndex: def __init__(self, numpyArray): self.array...
ps5.py
# 6.0001/6.00 Problem Set 5 - RSS Feed Filter # Name: Palash Sharma # Collaborators: # Time: -> [30 min for NewsStory] + [FOREVER!] import feedparser import string import time import threading from project_util import translate_html from mtTkinter import * from datetime import datetime import pytz #-----------------...
models.py
import logging import os import threading from django.db import models from common import models as common_models # Create your models here. from ansible_api.models import Project, Group, Playbook from kubeoperator.settings import KUBEEASZ_DIR from kubeops_api.models.node import Node from kubeops_api.models.host impo...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
server.py
#!/usr/bin/env python from yolov3 import YoloRunner import sys import io import os import shutil from subprocess import Popen, PIPE from string import Template from struct import Struct from threading import Thread from time import sleep, time from http.server import HTTPServer, BaseHTTPRequestHandler from wsgiref.si...
interactive.py
from builtins import exit as _exit import random from threading import Thread from core.world import World from core.actor.terminal import Terminal """ start like this: >>> python -i interactive.py """ while True: mos = input("load from 'map' or 'save': ") if mos in ('map', 'save'): break else:...
api.py
import asyncio import sys import weakref import copy import os import random import datetime import json import inspect from threading import Thread import newrelic.agent from aiohttp import web, streams from pony import orm from api.settings import CODE_DATABASE, APP_NAME, TRANSACTION_HEADER, RESPONSE_CODE_NAMES, RB...
server.py
import socket import threading def server(sock, addr): print('connection from %s:%s' %addr) buffer = [] while True: d = sock.recv(4096) if not d: break buffer.append(d) data = b''.join(buffer) print(data.decode('utf-8')) with open('server.py', 'r') as f: ...
server_startup.py
from epics import caget, PV, camonitor, caput, ca import time import threading def update_pv(pvname, value, char_value, **kws): print(pvname) print("Updating " + pvname[:-5]) status = char_value[-2:] if status == "OK": print(pvname[:-5] + " online!") caput(pvname[:-5], 1, wait=True, timeout=5.0) return else...
rlx_port.py
from __future__ import absolute_import from builtins import object import errno import socket import logging import multiprocessing as mp import sys import os from .rlx_worker import RLXWorker log = logging.getLogger(__name__) class RLXPort(object): @classmethod def handler_event(cls, dwCtrlType): ...
models.py
from django.db import models from django.utils import timezone from django.urls import reverse import uuid from pathlib import Path import json import time from django.contrib.auth.models import User, Permission from django.conf import settings import uuid import subprocess import os from ipaddress import ip_network, I...
Tcp.py
import socket import threading from time import sleep from PyQt5.QtCore import pyqtSignal from Network import StopThreading class TcpLogic: tcp_signal_write_info = pyqtSignal(str, int) tcp_signal_write_msg = pyqtSignal(str) def __init__(self): self.tcp_socket = None self.sever_th = None...
main.py
# created by 4evr.#8353 import os import sys import time import socket import random import clipboard import threading from requests_futures.sessions import FuturesSession session = FuturesSession() tokens = [] if sys.platform == "linux": clear = lambda: os.system("clear") else: clear = lamb...
processing.py
from __future__ import absolute_import import shlex import subprocess import threading from django.conf import settings class Shared(object): pass def _target(obj, cmd): obj.stars_process = subprocess.Popen(cmd) obj.stars_process.communicate() def activate(winpath): commandline = shlex.split( ...
hypertag.py
import os import re from typing import Set from shutil import rmtree, move import sqlite3 import json from multiprocessing import Pool from pathlib import Path import fire # type: ignore from tqdm import tqdm # type: ignore import rpyc # type: ignore from pywebcopy import WebPage, config # type: ignore from .persis...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, is_segwit_address) from electrum import c...
test_basic.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from concurrent.futures import ThreadPoolExecutor import json import logging from multiprocessing import Process import os import random import re import setproctitle import s...
test_zeromq.py
# -*- coding: utf-8 -*- ''' :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import time import threading # linux_distribution deprecated in py3.7 try: from platform import linux_distribution except...
Thread_definition_studikasus.py
from random import randint import threading import time def waktu(thread_number): count = 0 while count < 5: time.sleep(randint(0,7)) count += 1 return print(thread_number, "Processing", time.ctime(time.time())) def main(): threads = [] for i in range(5): t = threading.Thre...
experience.py
# coding: utf-8 import numpy as np from chainer import cuda from threading import Thread from ml.vae import VAE class Experience: def __init__(self, use_gpu=0, data_size=10**5, replay_size=32, hist_size=1, initial_exploration=10**3, dim=10240): self.use_gpu = use_gpu self.data_size = data_size ...
sensorenController.py
import board #Modul, zur Kennzeichnung von Pins. import busio #Modul, zur Kommunikation über das IO. import adafruit_bmp280 #Modul, zum Kommunizieren mit dem BMP280 Sensor. from threading import Thread #Wird dazu verwendet, Funktionen asyncron aufzurufen. from ledController import farbeAnzeigen #Wird für die Ansteuerun...
windows_host_agent.py
# key in the command below is generated with `openssl rand -hex 32` # NOTE: PACK WITH: pyinstaller --key 8b54663ad18123f7533e392965b9e83792d33793e8df6b47ec906c5e8c9b8477 -F --noconsole --noupx --add-data "binaries_for_windows_host_agent/nmap_utils;nmap_utils" --add-data "binaries_for_windows_host_agent/winPEASany.exe;....
models.py
from threading import Thread from django.core.urlresolvers import reverse from django.db import models from django.contrib.auth.models import User from django.utils.timezone import now from django.forms import ModelForm from socket import create_connection from contest.models import Slave from json import loads, dumps ...
gym_gazeboros_ac.py
#!/usr/bin/env python <<<<<<< HEAD from datetime import datetime import copy import traceback import os, subprocess, time, signal #from cv_bridge import CvBridge import gym import math import random # u import numpy as np import cv2 as cv import rospy ======= # import dynamic_window_approach as dwa from datetime...
test_rpc.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import multiprocessing import socket import time import pytest import thriftpy thriftpy.install_import_hook() # noqa from thriftpy.rpc import make_server, client_context addressbook = thriftpy.load(os.path.join(os.path.dirname(__file__), ...
added_thread.py
import threading def thread_job(): print('This is an added Thread, number is %s ' % threading.current_thread()) def main(): added_thread = threading.Thread(target=thread_job) added_thread.start() if __name__ == '__main__': main()
chimera_server.py
import queue import subprocess import time import threading import requests import logging logger = logging.getLogger(__name__) def load_model_from_source(model_file, volume_id, commands): commands.append("open #%d %s" % (volume_id, model_file)) return volume_id def run_commands(commands, port, server_lock...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum_but.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_but.bip32 import BIP32Node from electrum_but import constants from electrum...
test_sql_sqlite.py
# This file is Public Domain and may be used without restrictions, # because noone should have to waste their lives typing this again. import _jpype import jpype from jpype.types import * from jpype import java import jpype.dbapi2 as dbapi2 import common import time import datetime import decimal import threading java...
example_stream_buffer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_stream_buffer.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://pyp...
local_setup.py
# -*- coding: utf-8 -*- import os import sys import click import random import subprocess import time import threading import simpleflock from . import config from . import log LOCK_FILE_DIR = os.path.expanduser('~/.cache/ubup') LOCK_FILE_PATH = '{}/lock'.format(LOCK_FILE_DIR) def perform(setup_filename: str, no_...
pyminer.py
# Aim Interactive # # Copyright 2011 - 2022 Jeff Garzik and Rodney Thomas # # License information in the "COPYING" file. import time import json import pprint import hashlib import struct import re import base64 import httplib import sys from multiprocessing import Process ERR_SLEEP = 15 MAX_NONCE = 1000000L settin...
http_reporter.py
import httplib import logging import Queue import threading import urllib2 from testify import test_reporter try: import simplejson as json _hush_pyflakes = [json] del _hush_pyflakes except ImportError: import json class HTTPReporter(test_reporter.TestReporter): def report_results(self): ...
mirroring.py
import math,random,time,multiprocessing,copy,pickle from roboball2d.physics import B2World from roboball2d.robot import DefaultRobotConfig from roboball2d.robot import DefaultRobotState from roboball2d.ball import BallConfig from roboball2d.ball_gun import DefaultBallGun def _parallel_world(data,lock): # robot ...
visual.py
import cv2 import base64 from socketIO_client import SocketIO, BaseNamespace import numpy as np from PIL import Image from threading import Thread, ThreadError import io import time img_np = None socketIO = SocketIO('http://192.168.0.1', 8020) live_namespace = socketIO.define(BaseNamespace, '/live') def receive_even...
run.py
# -*- coding: utf-8 -*- """ Author : Jason Github : https://github.com/yuquant Description : """ from threading import Thread from dcmtks.back_process import back_server from datacenter import create_app from dcmtks.log import get_logger app = create_app(config_name='development') if __name__ == "__main__": log...
system.py
import argparse import signal import socket import subprocess import gi gi.require_version('Gtk', '3.0') from gi.repository import GLib, Gtk from queue import Queue, Empty import time import threading import os import json from flask import Flask, request, jsonify, abort, make_response USB_ROOT = "./DATA/" USE_GPI...
client3.py
import socket from threading import Thread sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('127.0.0.1', 8888)) def send_message(): while True: sock.send(input().encode('utf-8')) def receive_message(): while True: data = sock.recv(1024) print(data.decode('utf-8...
P2pServer.py
import json import os import socket import threading from pynat import * from constants import * from FileUtilities import * class P2pServer: def __init__(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.bind((P2P_SERVER_HOST, P2P_SERVER_PORT)) self.dire...
ResultsFrontEnd.py
from flask import Flask import sqlite3 import datetime import os import time import threading from DiscogsSellerFinder import DiscogsSellerFinder app = Flask(__name__) dateToday = datetime.datetime.today().date() connection = sqlite3.connect("../listings.db") cursor = connection.cursor() class FlaskServer(Flask): ...
pixels.py
import apa102 import time import threading from gpiozero import LED try: import queue as Queue except ImportError: import Queue as Queue from alexa_led_pattern import AlexaLedPattern from google_home_led_pattern import GoogleHomeLedPattern class Pixels: PIXELS_N = 12 def __init__(self, pattern=Alexa...
stream.py
# -*- coding: utf-8 -*- """ Contains the Stream class ========================= """ from .file_converter import FileConverter from ..app.log import get_logger from threading import Thread from threading import Lock as ThreadLock from queue import Queue as ThreadQueue import pandas as pd import time import os from typin...
feature_generation.py
__author__ = 'ZeqiuWu' import sys import os import math from multiprocessing import Process, Lock from nlp_parse import parse from ner_feature import pipeline, filter, pipeline_test def get_number(filename): with open(filename) as f: count = 0 for line in f: count += 1 return co...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core Developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test funexcoind shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_...
futures_executor.py
from __future__ import absolute_import import logging import multiprocessing import signal import time import threading from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand from django import db from futures.futures import ( Fu...
notes3.py
browsers = [ {“platform”: “Windows 7 64-bit”, “browserName”: “Internet Explorer”,”version”: “10”, “name”: “Python Parallel”}, {“platform”: “Windows 8.1”, “browserName”: “Chrome”, “version”: “50”, “name”: “Python Parallel”}, ] browsers_waiting = [ ] def get_browser_and_wait(browser_data): print ("starting %s\...
processes_barrier.py
import multiprocessing from multiprocessing import Barrier, Lock, Process from time import time from datetime import datetime def test_with_barrier(synchronizer, serializer): name = multiprocessing.current_process().name synchronizer.wait() now = time() with serializer: print("process %s ---->...
nc3.py
# -*- coding: utf-8 -*- # 中文 import sys import socket import getopt import threading import subprocess listen = False command = False upload = False execute = '' target = '' upload_destination = '' filename = '' port = 0 def usage(): print("NetCat Tools for Python3") print("Usage: python nc3 -t target_host ...
console.py
from io import TextIOBase import sys import threading if sys.version_info[0] < 3: from Queue import Queue else: from queue import Queue def start_thread(runnable): threading.Thread(target=lambda: runnable.run()).start() class ConsoleInputStream(TextIOBase): """Receives input in on_input in one thre...
tests.py
"""Tests related to django.db.backends that haven't been organized.""" import datetime import threading import unittest import warnings from django.core.management.color import no_style from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, IntegrityError, connection, connections, reset_queries, transaction,...
test_http.py
import pytest from http.server import BaseHTTPRequestHandler, HTTPServer import threading import pickle import fsspec requests = pytest.importorskip("requests") port = 9898 data = b"\n".join([b"some test data"] * 1000) realfile = "http://localhost:%i/index/realfile" % port index = b'<a href="%s">Link</a>' % realfile.e...
streaming.py
#21datalabplugin from abc import ABC, abstractmethod import utils from utils import Profiling from system import __functioncontrolfolder import dates import numpy import numpy as np import copy import time from model import getRandomId import threading class Interface(ABC): @abstractmethod def flush(self,da...
app_plotly.py
import datetime as dt import os import pathlib import threading from collections import defaultdict, deque from datetime import datetime from json import loads import dash import numpy as np import pandas as pd import plotly.express as px # import dash_core_components as dcc # import dash_html_components as html # im...
cluster.py
import json import os from threading import Lock, Thread from traceback import format_exc from bson.objectid import ObjectId from cc_server.commons.states import state_to_index, end_states from cc_server.commons.notification import notify class Cluster: def __init__(self, config, tee, mongo, state_handler, clust...
storage.py
import base64 import datetime import json import requests import sys import threading import time import utils global _bc,_fs,_fs_d,_fs_s,_fs_u REPO_NAME="_app_data" with open("server/token.dt","r") as f: GITHUB_TOKEN=f.read().strip() GITHUB_HEADERS="application/vnd.github.v3+json,application/vnd.github.mercy-previ...
controller.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : controller.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 01/22/2018 # # This file is part of Jacinle. # Distributed under terms of the MIT license. import collections import contextlib import os import queue import random import threadin...
app.py
# ElectrumSV - lightweight Bitcoin client # Copyright (C) 2019 ElectrumSV developers # # 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 ...
camera.py
import cv2 import time import threading class Camera: last_frame = None last_ready = None def __init__(self, rtsp_link): vcap = cv2.VideoCapture(rtsp_link) thread = threading.Thread(target=self.rtsp_cam_buffer, args=(vcap,), name="rtsp_thread") thread.daemon = True thread....
topics.py
__author__ = ['Enis Simsar'] from threading import Thread import tweepy from decouple import config from requests import get import numpy as np from logic.helper import add_facebook_pages_and_subreddits from logic.users import set_user_topics_limit, set_current_topic import delete_community from application.Conne...
installwizard.py
from functools import partial import threading import os from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.utils import platform...
Vodacom Data Usage.py
#!/usr/bin/python # Copyright 2013 Pieter Rautenbach # # 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 ...
get_ins.py
""" Script to make insertion track @author: Alicia Schep """ ##### IMPORT MODULES ##### # import necessary for python import os import multiprocessing as mp import itertools import numpy as np import pysam import traceback import pyximport; pyximport.install(setup_args={"include_dirs":np.get_include()}) from pyatac.t...
gui.py
import logging import multiprocessing import os from functools import lru_cache import pygame import pygame.gfxdraw from config import Config from data_structures.sparsemap import Map from data_structures.vector import Pos from helper.timer import repeat_every from visual.colors import COLORS from visual.font import ...
session_connect.py
import os, sys, inspect import requests import json import time import threading import base64 import array import urllib.parse def error(err_no, err_desc, end, printErr=True): import datetime if printErr: print("Error: "+str(err_no)+' - ',err_desc) error_dec = "Time: "+str(datetime.datetime.now())+" Error...
main.py
# coding: utf-8 import os import threading import requests import time from utils import parse_lambda_event_str, bring_slack_id_from_slack_name, bring_slack_name_from_slack_id, calc_nas_ranking_this_week from nas import Nas from send_message import post_public_message_to_slack, post_private_message_to_slack from confi...
thread_utils.py
import logging import pathlib import re import threading from secrets import token_hex import requests from rest.api.constants.api_constants import ApiCode from rest.api.responsehelpers.error_codes import ErrorMessage from rest.api.responsehelpers.http_response import HttpResponse from rest.utils.io_utils import IOUt...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from multiprocessing import Process from typing import Dict from common.basedir import BASEDIR from common.spinner import Sp...
test_server.py
# Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
cli.py
#!/usr/bin/env python from functools import partial from http.server import ( BaseHTTPRequestHandler, HTTPServer, ) import base64 import json import logging import pprint import threading import urllib from urllib.parse import urlparse import webbrowser from requests_oauthlib import oauth2_session class Re...
lifebox-test2.py
import pygame import sys import random import threading import time datafromfile = [0] * 21 def readdatafromfile(stop): global datafromfile while not stop: file = open("/var/www/html/lifeboxdata", "r") datafromfile = file.read().split("|") #print (datafromfile[2]) time.sleep(2) # run thread stop = False t ...
user_io.py
import os import sys import time import numpy as np import pybullet as p from collections import namedtuple from pybullet_planning.utils import INF, CLIENT, CLIENTS from pybullet_planning.utils import is_darwin # from future_builtins import map, filter # from builtins import input # TODO - use future try: user_in...
__init__.py
import builtins import contextlib import errno import glob import importlib.util from importlib._bootstrap_external import _get_sourcefile import marshal import os import py_compile import random import shutil import stat import subprocess import sys import textwrap import threading import time import unittest from uni...
binary_sensor.py
"""Support to use flic buttons as a binary sensor.""" import logging import threading from pyflic import ( ButtonConnectionChannel, ClickType, ConnectionStatus, FlicClient, ScanWizard, ScanWizardResult, ) import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHE...
thread_daemon.py
# encoding=utf-8 import time import threading def child(): time.sleep(5) print('child thread sleep 5 sec') if __name__ == '__main__': print(time.time()) print('main thread daemonic is ', threading.current_thread().isDaemon()) # ch = threading.Thread(target=child, daemon=False) ch = threading.T...
LockerManager.py
import serial import time import csv import threading from datetime import datetime from threading import Timer from collections import defaultdict from heapq import * from Queue import * from Locker import Locker class LockerManager: def __init__(self,serialLED): self.locker1 = Locker(1,serialLED) ...