source
stringlengths
3
86
python
stringlengths
75
1.04M
test_kernel.py
"""test the IPython Kernel""" #------------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #-------------------...
tc_plugins.py
from .tc_wallet import Wallet_TC from .tc_requests import tc_requests from .tools import ErrorConnectingServer, TrustedCoinException, get_user_id, make_billing_address, Decrypt import socket from electrum import keystore from electrum.bitcoin import TYPE_ADDRESS from electrum.base_wizard import BaseWizard from electr...
parsing.py
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* Copyright (c) Schrodinger, LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* -------...
test.py
#!/usr/bin/python3 from pathlib import Path import subprocess import os import string import sys import threading SOURCE_DIR: str = './tests' BUILD_DIR: str = "./build" C_COMPILER: str = "gcc" def task(filename: Path): output_name = f"{Path(filename).stem}_test" final_output_file = f"{BUILD_DIR}/{output_na...
fixtures.py
import sys import os import logging from pony.py23compat import PY2 from ponytest import with_cli_args, pony_fixtures, provider_validators, provider, Fixture, \ ValidationError from functools import wraps, partial import click from contextlib import contextmanager, closing from pony.utils import cached_prope...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import hashlib import multiprocessing as mp import os import random import shutil import sys import tarfile import threading import time import warnings import zip...
twitter+gui_backup_oct12.py
#Titter + gui from Tkinter import * from time import sleep import os import tweepy import requests import json from pydora import player from pandora import clientbuilder import sys import termios import getpass import subprocess import time #import for gui import Tkinter #import for processes using rabbitmq import ...
test_config.py
import asyncio import copy import pytest import random import yaml from taco.util.config import create_default_taco_config, initial_config_file, load_config, save_config from taco.util.path import mkdir from multiprocessing import Pool from pathlib import Path from threading import Thread from time import sleep from t...
SquidNet.py
import random, socket, time, sys, threading, random, os, hashlib, datetime, sqlite3 try: """This Module comes with Paramiko.""" from cryptography.fernet import Fernet except: pass from optparse import OptionParser """This script is NOT Perfected(Still a WIP)! Notify me if there are any issues with ...
object_storage_service_benchmark.py
# Copyright 2016 PerfKitBenchmarker 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...
store.py
from os import unlink, path, mkdir import json import uuid as uuid_builder from threading import Lock from copy import deepcopy import logging import time import threading import os from changedetectionio.notification import default_notification_format, default_notification_body, default_notification_title # Is ther...
parallelhttp.py
import requests from testsbase import testsbase import threading from queue import Queue from time import sleep, time class parallelhttp(testsbase): def __init__(self, config): super().__init__(config) self.q = Queue() def run(self, vh=None): test_list = [self.test1, self.test2] ...
python_os_and_time.py
def write_date(): import time now = time.time() str = time.ctime(now) fout = open('save_time.txt','wt') print(str,file=fout) fout.close() def list_dir(): import os print("ๅฝ“ๅ‰็›ฎๅฝ•ไธ‹็š„ๆ–‡ไปถ๏ผš ",os.listdir('.'), "\n็ˆถ็›ฎๅฝ•ไธ‹็š„ๆ–‡ไปถ๏ผš ",os.listdir('../')) os.chdir('../') print("็ˆถ็›ฎๅฝ•ไธ‹็š„ๆ–‡ไปถ๏ผš ",...
local_assembly.py
#!/usr/bin/env python import os import sys import time import multiprocessing try: from scripts import my_utils except ImportError: import my_utils tab = '\t' endl = '\n' arg = sys.argv[1:] usage = 'python ' + __file__ + ' ' + '<input_bam_file> <out_dir> <out_del_call_file> <n_threads> <ref_fasta> <fermiki...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import (verbose, import_module, cpython_only, requires_type_collecting) from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import...
InputHandlerThread.py
from Queue import Queue, Empty from threading import Thread import sys import time class InputHandlerThread(Thread): def __init__(self, device): Thread.__init__(self) self.queue = Queue() self.device = device self.daemon = True t = Thread(target=self.enqueue_input, args=(s...
ca_util.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. Tools for creating a CA cert and signed server certs. Divined from http://svn.osafoundation.org/m2crypto/trunk/tests/test_x509.py The mk_temporary_xxx calls return a NamedTemporaryFile with certs. Usage ; ...
multi_process_runner.py
# Lint as: python3 # Copyright 2019 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 ...
analyse_video.py
#!/usr/bin/env python import argparse, math, atexit import requests, hmac, hashlib import subprocess,re,time,glob,os,shutil,configparser from multiprocessing import Process, Queue, SimpleQueue, Pool DEBUG = False DIAGNOS = False # le dossier oรน รงa se passe DIR = "_streams/" # dossier des morts trouvรฉes DIRFOUND = DI...
mouse_handler.py
import datetime import random import sys import threading import time import win32api import win32con SCREEN_WIDTH = win32api.GetSystemMetrics(0) SCREEN_HEIGHT = win32api.GetSystemMetrics(1) class Mouse_Handler: def __init__(self): # thread self.active_thread = None self.timer_handler_th...
run.py
# 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, software # distrib...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet import Wallet, InternalAddressCorrup...
device_controller.py
''' Created on 2013.09.21. ''' import RPi.GPIO as GPIO import time import os from threading import Thread from config.config import SensorConfig class RelayController(object): relayGpio = None talkThread = None motoFwThread = None motoBwThread = None runMoto = False w...
plugs_test.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 agre...
bot.py
# coding=utf-8 # Copyright 2008, Sean B. Palmer, inamidst.com # Copyright ยฉ 2012, Elad Alfassa <elad@fedoraproject.org> # Copyright 2012-2015, Elsie Powell, http://embolalia.com # # Licensed under the Eiffel Forum License 2. from __future__ import unicode_literals, absolute_import, print_function, division from ast i...
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...
player.py
from time import sleep from flask import Flask, jsonify from flask_restful import Resource, Api from multiprocessing import Process from player_auxilliary import generate_and_compile, run_smpc_computation import json import argparse parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argu...
provider.py
import web3 import time import eth_account.messages import web3.contract import sys import socket from threading import Thread, Lock from lib import * from Simple import * from SimpleValidator import * import json from lib import w3 import traceback HOST = '127.0.0.1' # Standard loopback interface address (localhost)...
Dhipublik.py
# -*- coding: utf-8 -*- import Adhi from Adhi.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen import r...
whois_worker.py
from PyQt5.QtCore import QThread, pyqtSignal from tqdm import tqdm from time import sleep import os import whois # pip install whois import multiprocessing as mp from domainhelper import DomainHelper class WhoisWorker(QThread): def __init__(self, mail_objects): super().__init__() self.progress_r...
oplog_manager.py
# Copyright 2013-2014 MongoDB, 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...
periodic.py
import logging import os import time from multiprocessing import Process from django.conf import settings from django.db import connections from schedule import Scheduler from awx.main.dispatch.worker import TaskWorker logger = logging.getLogger('awx.main.dispatch.periodic') class Scheduler(Scheduler): def ru...
pydoc.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
test_utility.py
import shlex import subprocess from multiprocessing import Process from time import sleep from src.raspberry_pi_driver.utility import ( hash_prefix, terminate_cmd, terminate_proc, ) def test_hash_prefix(): res = hash_prefix("rokku") expected = ( "320bda34a3c7f8dc49e5c976792f20ef5ec6f400b9...
data.py
#!/usr/bin/env python # Flirble DNS Server # RethinkDB handler # # Copyright 2016 Chris Luke # # 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/...
gunicorn_conf.py
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
video_stage_manager.py
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
mongodb_log.py
#!/usr/bin/python ########################################################################### # mongodb_log.py - Python based ROS to MongoDB logger (multi-process) # # Created: Sun Dec 05 19:45:51 2010 # Copyright 2010-2012 Tim Niemueller [www.niemueller.de] # 2010-2011 Carnegie Mellon University # ...
base.py
import json import copy import threading import array import struct import time import csv import os import subprocess import paho.mqtt.client as paho import ssl # FILL THIS WITH YOU CREDENTIALS AND CERTS FOLDER EndPoint = "xxxxxxxxxxxxxx.iot.us-east-1.amazonaws.com" topic = 'birds-detected' caPath = "Certs/ca.cert" ...
wx_lib.py
""" ๅ‚ๆ•ฐ l็ฑปๅž‹ Text ้”ฎๅ€ผ TEXT ๆ–‡ๆœฌ ๆ–‡ๆœฌๅ†…ๅฎน(ๆ–‡ๅญ—ๆถˆๆฏ) MAP ๅœฐๅ›พ ไฝ็ฝฎๆ–‡ๆœฌ(ไฝ็ฝฎๅˆ†ไบซ) CARD ๅ็‰‡ ๆŽจ่ไบบๅญ—ๅ…ธ(ๆŽจ่ไบบ็š„ๅ็‰‡) SHARING ๅˆ†ไบซ ๅˆ†ไบซๅ็งฐ(ๅˆ†ไบซ็š„้Ÿณไนๆˆ–่€…ๆ–‡็ซ ็ญ‰) PICTURE ไธ‹่ฝฝๆ–นๆณ• ๅ›พ็‰‡/่กจๆƒ… RECORDING ่ฏญ้Ÿณ ไธ‹่ฝฝๆ–นๆณ• ATTACHMENT ้™„ไปถ ไธ‹่ฝฝๆ–นๆณ• VIDEO ๅฐ่ง†้ข‘ ไธ‹่ฝฝๆ–นๆณ• FRIENDS ๅฅฝๅ‹้‚€่ฏท ๆทปๅŠ ๅฅฝๅ‹ๆ‰€้œ€ๅ‚ๆ•ฐ SYSTEM ็ณป็ปŸๆถˆๆฏ ๆ›ดๆ–ฐๅ†…ๅฎน็š„็”จๆˆทๆˆ–็พค่Š็š„UserName็ป„ๆˆ็š„ๅˆ—่กจ NOTE ้€š็Ÿฅ ้€š็Ÿฅๆ–‡ๆœฌ(ๆถˆๆฏๆ’คๅ›ž...
datasets.py
from __future__ import absolute_import, print_function, division import logging import os import tornado.web import yaml from tornado import gen from threading import Thread from .common import BaseHandler from ..web_datasets import DATASETS class RefreshHandler(BaseHandler): @tornado.web.authenticated def get(s...
export.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from datetime import datetime, timedelta import gc import logging from multiprocessing import get_context import os from pathlib import Path import queue import sys import traceback from urllib.parse import urlparse import uuid import pandas as pd import pyarrow as pa i...
image.py
# Copyright (c) Niall Asher 2022 import datetime import re from base64 import urlsafe_b64decode from math import gcd from os import makedirs, mkdir, path from types import SimpleNamespace from base64 import b64encode import PIL from PIL import Image, ImageOps from pony.orm import commit, db_session, select from socia...
test_high_level.py
#!/usr/bin/env python # source - https://github.com/whoenig/crazyflie_ros/commit/b048c1f2fd3ee34f899fa0e2f6c58a4885a39405#diff-970be3522034ff436332d391db26982a from __future__ import absolute_import, division, unicode_literals, print_function import rospy import crazyflie import time import tf #from crazyflie_driver....
03-้™ๆ€webๆœๅŠกๅ™จ-ๅคšไปปๅŠก.py
import socket import os import threading # ๅค„็†ๅฎขๆˆท็ซฏ่ฏทๆฑ‚ def handle_client_request(new_socket): # ๆŽฅๅ—ๅฎขๆˆท็ซฏ่ฏทๆฑ‚ไฟกๆฏ recv_data = new_socket.recv(4096) # ๅˆคๆ–ญ่ฏทๆฑ‚ๆ•ฐๆฎๆ˜ฏๅฆไธบ็ฉบ๏ผŒไธบ็ฉบ้€€ๅ‡บๅ‡ฝๆ•ฐ if len(recv_data) == 0: new_socket.close() return # ๅฏนๆŽฅๅ—ๆ•ฐๆฎ่ฟ›่กŒไบŒ่ฟ›ๅˆถ่งฃ็  recv_content = recv_data.decode("utf-8") # ๅฏนๆ•ฐๆฎ่ฟ›่กŒๅˆ†ๅ‰ฒ ...
logger.py
import os import json import time from threading import Event, Thread from pynput.mouse import Listener, Button from sentry_sdk import capture_exception from utils.directions import Direction from consts import CLICK_PATH, GB_TO_B, MOVE_PATH, MS_TO_NS, NS_TO_MS, SAVE_INTERVAL_IN_S, RECORD_INTERVAL_IN_MS, SCROLL_PATH ...
supervisor.py
# Copyright 2016 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...
caching.py
import json import threading import time from collections import OrderedDict from typing import Any, Callable, Dict, List, Optional from hexbytes import HexBytes from web3 import Web3 from brownie._config import CONFIG, _get_data_folder from brownie.network.middlewares import BrownieMiddlewareABC from brownie.utils.s...
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...
pi_rc522_helper.py
#coding=utf-8 from pirc522 import RFID import time import struct from threading import Thread import inspect import ctypes """ A class is based on pirc522 lib. You can install pirc522 with pip what the command is ' pip install pi-rc522 '. @auth - xuwh @date - 2018-9-9 @git - https://github.com/imaxu """ class PI_...
demo.py
import sys from threading import Thread from mypkg.a import absolute, relative if __name__ == "__main__": from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("method", choices=["absolute", "relative"], help="Import type for mypkg.b") parser.add_arg...
threads_program.py
import datetime import colorama import random import time import threading def main(): t0 = datetime.datetime.now() print(colorama.Fore.WHITE + "App started.", flush=True) data = [] threads = [ threading.Thread(target=generate_data, args=(20, data), daemon=True), threading.Thread(tar...
CameraStoneDetection.py
#!/usr/bin/env python # ############################# # # GO stone camera detection # # ############################# # # Licensed under MIT License (MIT) # # Copyright (c) 2018 Daniel Springwald | daniel@springwald.de # # Permission is hereby granted, free of charge, to any person obtaining #...
proxy.py
#!/usr/bin/env python2 # coding:utf-8 # Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com> # Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com> # Contributor: # Phus Lu <phus.lu@gmail.com> # Hewig Xu <hewigovens@gmail.com> # Ayanamist Yang <ayanamist@gmail.com>...
main_widget.py
# -*- coding: utf-8 -*- import sys import os import time import torch if hasattr(sys, 'frozen'): os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH'] from PyQt5 import QtWidgets from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui, uic from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5...
cert_scrape.py
#!/usr/bin/python3 # x509-cert-testcorpus - X.509 certificate test corpus # Copyright (C) 2018-2019 Johannes Bauer # License: CC-0 import sys import sqlite3 import contextlib import subprocess import multiprocessing import hashlib import time import collections import random import re from CertDatabase import CertDa...
test_threading.py
from threading import Thread import time import unittest import rasterio as rio from rasterio.env import get_gdal_config class TestThreading(unittest.TestCase): def test_multiopen(self): """ Open a file from different threads. Regression test for issue #986 """ def func(...
ICOM_P.py
#!/usr/bin/python # -*- coding= utf-8 -*- import multiprocessing import os import sys from datetime import datetime from multiprocessing.queues import Queue from threading import current_thread import icom_win_msg import win_instance import time from multiprocessing.dummy import Process as dummyProcess ...
joystick.py
# # Copyright 2016-2017 Games Creators Club # # MIT License # import time import array import struct import threading from fcntl import ioctl disabled = False # We'll store the states here. axis_states = {} button_states = {} # These constants were borrowed from linux/input.h axis_names = { 0x00: 'x', 0x0...
main.py
import os import random import multiprocessing as mp import numpy import time from job3 import * P_COUNT = os.cpu_count() PRINT_EACH_ITERATION = True PRINT_COST_CALCULATION = False class AP: def __init__(self, path: str): with open(path) as f: self.costs = list(map(lambda line: list(map(int...
capture.py
#!/usr/bin/env python import os import sys import time import string import sqlite3 import subprocess from multiprocessing import Process import psutil as ps db1_host = "localhost" db_files = {"monitor": { "db_filename": "/opt/sys_monitor/db/monitor.db", "schema_filename": "/opt/sys_monitor...
audio.py
""" Audio Module ============ This module defines basic incremental units and incremental modules to handle audio input (via a standard microphone) and output. """ import threading import queue import time import wave try: import pyaudio except ImportError: pass from retico_core import * CHANNELS = 1 """Nu...
object_detector.py
# -*- coding: utf-8 -*- # Copyright ยฉ 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause """ Class definition and utilities for the object detection toolkit. """ from __futu...
iot_mode.py
# -*- coding: utf-8 -*- u"""IoT Mode for SecureTea. Project: โ•”โ•โ•—โ”Œโ”€โ”โ”Œโ”€โ”โ”ฌ โ”ฌโ”ฌโ”€โ”โ”Œโ”€โ”โ•”โ•ฆโ•—โ”Œโ”€โ”โ”Œโ”€โ” โ•šโ•โ•—โ”œโ”ค โ”‚ โ”‚ โ”‚โ”œโ”ฌโ”˜โ”œโ”ค โ•‘ โ”œโ”ค โ”œโ”€โ”ค โ•šโ•โ•โ””โ”€โ”˜โ””โ”€โ”˜โ””โ”€โ”˜โ”ดโ””โ”€โ””โ”€โ”˜ โ•ฉ โ””โ”€โ”˜โ”ด โ”ด Author: Abhishek Sharma <abhishek_official@hotmail.com> , Jul 31 2019 Version: 1.5.1 Module: SecureTea """ # Import all the modules necessary for Io...
iteration_test.py
import os import pickle import tempfile import time from threading import Thread import pytest from numpy.random import RandomState from rlai.agents.mdp import StochasticMdpAgent from rlai.environments.gridworld import Gridworld, GridworldFeatureExtractor from rlai.environments.mdp import TrajectorySamplingMdpPlannin...
observers.py
# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU. # # 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...
main.py
from ros.processor.inventory_events_consumer import InventoryEventsConsumer from ros.processor.insights_engine_result_consumer import InsightsEngineResultConsumer from ros.processor.garbage_collector import GarbageCollector from prometheus_client import start_http_server import threading from ros.lib.config import METR...
main.py
# / โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” \ # # |==โ”‚ By BitExpo3 โ”‚==| # # \ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ / # import socket import threading import sys import json import curses from curses import wrapper import yaml import os wmain = None wside = None wbar = None winy, winx = None, None state = "" # Official server IP & PORT coming soon! SERVER =...
test_celery.py
import threading import pytest pytest.importorskip("celery") from sentry_sdk import Hub, configure_scope from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk._compat import text_type from celery import Celery, VERSION from celery.bin import worker @pytest.fixture def connect_signal(request...
test_csv.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...
wsdump.py
#!/Users/josephbell/Desktop/reddit-scraping/reddit-env/bin/python3 import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding()...
monitor.py
import sys import docker import logging import threading import os import subprocess import boto3 logging.basicConfig(filename='/var/log/docker_start.log', level=logging.INFO) threads = [] sc = [] def cleanup(container): container.stop() _ = subprocess.call(["/usr/local/bin/honey-clean.sh", container.n...
iTrader.py
from tkinter import * from tkinter import Menu from tkinter import ttk from tkinter.ttk import Combobox from tkinter import messagebox import tkinter.font as font from binance_api import Binance import threading import time import datetime import os import os.path #ะžัะฝะพะฒะฝั‹ะต ะณะปะพะฑะฐะปัŒะฝั‹ะต ะฟะตั€ะตะผะตะฝะฝั‹ะต ep...
long-short.py
import os import sys import datetime import threading import pandas as pd import alpaca_trade_api as tradeapi import time from alpaca_trade_api.rest import TimeFrame API_KEY = os.getenv('PAPER_KEY') API_SECRET = os.getenv('PAPER_SECRET') APCA_API_BASE_URL = "https://paper-api.alpaca.markets" class LongShort: def ...
PlexAPI.py
#!/usr/bin/env python """ Collection of "connector functions" to Plex Media Server/MyPlex PlexGDM: loosely based on hippojay's plexGDM: https://github.com/hippojay/script.plexbmc.helper... /resources/lib/plexgdm.py Plex Media Server communication: source (somewhat): https://github.com/hippojay/plugin.video.plexbmc...
reservation_status_update_thread.py
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2020 FABRIC Testbed # # 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 ...
executors.py
# -*- coding: utf-8 -*- """ Single and multi-threaded executors.""" import datetime import os import tempfile import threading from abc import ABCMeta, abstractmethod from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union import psutil from six import string_types, with_metaclass from typing_extensi...
BuildReport.py
## @file # Routines for generating build report. # # This module contains the functionality to generate build report after # build all target completes successfully. # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made a...
test_solr.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import threading import time from types import ListType import unittest import mock import os from nose.plugins.attrib import attr import logging from aggregator import MetricsAggregator LOG_INFO = { 'log_t...
PAMDroid.py
import os import instrumentation import Monkey from multiprocessing import Process import pexpect import sys app = 'com.texty.sms' analyticService = 'Crashlytics' testPath = '/home/xueling/git/rose6icse/submissions/available/XuelingZhang/testAPP/' # #decode the apk file into smali code decodeCmd = "apktool d %s -o %...
multi_sensors.py
#!/usr/bin/env python # # Copyright AlertAvert.com (c) 2013. 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 req...
test_cp.py
# -*- coding: utf-8 -*- # Copyright 2013 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 require...
build_imagenet_data.py
#!/usr/bin/python # 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 a...
wrapper.py
""" The module containing the `Robot` class Mainly provides init routine for the brain and binds attributes of the `Robot` class to their respecitve classes """ import json import sys import optparse import os import logging import time import threading import random from datetime import datetime from smbus2 import S...
Wallet.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Tkinter GUI Wallet (v2.52) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # ยฉ Duino-Coin Community 2019-2021 ########################################## import sys from base64 import b64decode, b64encode fr...
market_price_rdpgw_service_discovery.py
#!/usr/bin/env python # |----------------------------------------------------------------------------- # | This source code is provided under the Apache 2.0 license -- # | and is provided AS IS with no warranty or guarantee of fit for purpose. -- # | See the project's LICENSE.md for det...
app.py
#!/usr/bin/env python import socket import serial import sys,time import signal from time import ctime,sleep import glob,struct from multiprocessing import Process,Manager,Array import threading def get_my_ip(): try: csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) csock.connect(('8.8.8.8', ...
threaded_game.py
"""Threaded Game module for py-conway. This module contains the core functionality for running Conway's Game of Life on a background thread. Unlike the main game, which must be advanced manually, a threaded game will run automatically until stopped. """ from . import Game, GameState from threading import Thread clas...
ars.py
# AI 2018 import os import inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0,parentdir) # Importing the libraries import os import numpy as np import gym from gym import wrappers import pybullet_...
tflex.py
import tensorflow as tf import numpy as np from glob import glob import os import re from tensorflow.python import pywrap_tensorflow import tqdm import h5py import shutil import tempfile import traceback import time import threading from tensorflow.python.framework import dtypes from tensorflow.python.distribute.clust...
cometalib.py
""" Author: Emile Camus """ __license__ = """ Copyright 2015 Visible Energy 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 U...
test_cli.py
import json import os import signal import threading import time import heal OK_OUTPUT = """ watching: {0}, {1} tests directory has changed reading configuration validating tests exiting: loop-ending signal """.lstrip() def test_ok(tmp_path, capsys): tests_directory = tmp_path.joinpath("conf") tests_directo...
cool-device.py
import json from connection import * import connection from datetime import datetime state = 0 def getIncomingCommands(): global state sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(("0.0.0.0", 5006)) ...
test_udp_protocol.py
from django.test import TestCase from data_reader.models import ModbusRTU, UdpProtocol, BrokenTransductorException, TransportProtocol from transductor.models import EnergyTransductor, TransductorModel import threading import mock import socket import SocketServer class UDPHandler(SocketServer.BaseRequestHandler): ...
runners.py
# -*- coding: utf-8 -*- import locale import os import struct from subprocess import Popen, PIPE import sys import threading import time import signal from .util import six # Import some platform-specific things at top level so they can be mocked for # tests. try: import pty except ImportError: pty = None tr...
artifacts.py
import hashlib import json import mimetypes import os import pickle from six.moves.urllib.parse import quote from copy import deepcopy from datetime import datetime from multiprocessing import RLock, Event from multiprocessing.pool import ThreadPool from tempfile import mkdtemp, mkstemp from threading import Thread fro...
main.py
from __future__ import absolute_import, print_function import argparse import os import sys import threading import time from os import listdir from os.path import isfile, join from sys import platform as _platform from threading import Thread import cv2 import pyfakewebcam from PIL import Image, ImageTk if sys.vers...
test.py
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function from traceback import format_exc, print_stack from re import compile as re_compile, IGNORECASE as re_IGNORECASE, sub as re_sub from os import path as os_path, getuid as os_getuid, urandom as os_urandom, remove as os_remove, makedirs as os_make...
plotter_window.py
import re import sys from threading import Thread import matplotlib as mpl import numpy as np import serial from PyQt5 import QtGui from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QFileDialog, QTextEdit, \ QComboBox, QMainWindow, QGridLayout, QLabel from matplotlib.backends.backend_qt5agg import Fi...
UR_Monitoring_CSV.py
# This script creates a thread to monitor the position and other variables from a real UR robot and stores the data to a CSV file # With this script running, RoboDK will save a CSV file of the robot status # # Press F5 to run the script # Or visit: http://www.robodk.com/doc/en/PythonAPI/ from robolink import * # API...