source
stringlengths
3
86
python
stringlengths
75
1.04M
tab_base_classes.py
##################################################################### # # # /tab_base_classes.py # # # # Copyright 2013, Monash University ...
server.py
from __future__ import print_function, division __import__('sys').dont_write_bytecode = True # prevent stupid pyc files import socket as s import time import threading from boltons.socketutils import BufferedSocket import cv2 import json from imageprocessor import process from camera import Camera from manualcontrol im...
runner.py
import configparser import datetime import glob import h5py import json import os import requests import smtplib import subprocess import sys import time import threading from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage config = configparser.Co...
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing...
shell.py
# Date: 06/04/2018 # Author: Pure-L0G1C # Description: Communicate with server import sys import subprocess from os import chdir from time import sleep from queue import Queue from threading import Thread, RLock from . import ssh, sftp, screen, sscreenshare, keylogger class Shell(object): def __init__(self, ses...
diskover_s3.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """diskover - Elasticsearch file system crawler diskover is a file system crawler that index's your file metadata into Elasticsearch. See README.md or https://github.com/shirosaidev/diskover for more information. Amazon S3 inventory module for diskover Copyright (C) Chris...
potterclock.py
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHET...
wifijammer.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy from scapy.all import * conf.verb = 0 # Scapy I thought I told you to shut up import os import sys import time from threading import Thread, Lock from subprocess import Popen, PIPE fr...
io.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
main.py
#NAME: main.py #DATE: Wednesday 5th August 2019 #AUTH: Ryan McCartney, EEE Undergraduate, Queen's University Belfast #DESC: A python script for running a cherrpi API as a serial passthrough #COPY: Copyright 2018, All Rights Reserved, Ryan McCartney import threading import cherrypy import serial import time import...
peopleinfolist.py
# !/user/bin/python # -*- coding:utf-8 -*- import random,threading class peopleinfolist(): def __init__(self, num): self.num = num self.pl = [] self.idl = [] self.namel = [] self.phonel = [] self.peoil = [] #创建多线程,完成身份证、手机号、姓名、预约门店信息的随机生成...
drydock.py
# Copyright 2017 AT&T Intellectual Property. All other 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...
generate_subject_webpages.py
#!/usr/bin/env python3 import sys import os import re import yaml import threading from pathlib import Path def gen_files_list(files, prefix=""): files_link_content="" template_link_content= \ """\t<a href=\"<url>\"><name></a> \t<p>(<description>)</p>""" for file in files: print(" f...
aggregator_client.py
import json import threading import requests import websocket from .exceptions import RequestFailedException class AggregatorClient(object): def __init__(self, base_url, ws_url, verify=False, timeout=5): self.base_url = base_url self.verify = verify self.timeout = timeout # sel...
pmbuild.py
import collections import sys import os.path import json import fnmatch import util import subprocess import platform import shutil import time import dependencies import glob import threading import jsn.jsn as jsn import cgu.cgu as cgu # returns tool to run from cmdline with .exe def tool_to_platform(tool): tool...
spinner.py
#!/usr/bin/env python import itertools import sys import time import threading import platform class Spinner(object): spinner_cycle = [ " [🥞 ]", " [ 🥞 ]", " [ 🥞 ]", " [ 🥞]", " [ 🥞 ]", " [ 🥞 ]", " [🥞 ]", ] if platform.system() == "Darwi...
Statistik.py
# -*- coding: utf-8 -*- import Tools import sensor_temperature_control as TempSensor import math import time import threading runStatistik=True def setStatistik(): global runStatistik runStatistik=True #starte Thread für das warten bis Statistik beendet wird thread_temp = threading.Thread(target=__sto...
velocities.py
import requests import itertools import threading import time import sys def animate(): for c in itertools.cycle(['|', '/', '-', '\\']): if done: break sys.stdout.write('\rloading ' + c) sys.stdout.flush() time.sleep(0.1) print(chr(27) + "[2J") sys.stdout.write('...
infolog.py
import atexit from datetime import datetime import json from threading import Thread from urllib.request import Request, urlopen _format = '%Y-%m-%d %H:%M:%S.%f' _file = None _run_name = None _slack_url = None def init(filename, run_name, slack_url=None): global _file, _run_name, _slack_url _close_logfile() _...
singleton.py
#! /usr/bin/env python import logging from multiprocessing import Process import os import sys import tempfile import unittest class SingleInstanceException(BaseException): pass class SingleInstance(object): """Class that can be instantiated only once per machine. If you want to prevent your script f...
kernel.py
from __future__ import print_function from ipykernel.kernelbase import Kernel from ipykernel.comm import CommManager from ipykernel.zmqshell import ZMQInteractiveShell from IPython.core.display_trap import DisplayTrap from subprocess import check_output from traitlets import Instance, Type import pkg_resources impo...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ...
master.py
# -*- coding: utf-8 -*- ''' This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. ''' # Import python libs from __future__ import absolute_import, with_statement, print_function, unicode_literals import copy import c...
all_to_utf8.py
""" Many subtitle files have weird ass encodings like SHIFT-JIS. This python script replaces every file it's piped with good 'ole UTF-8 . The biggest problem with this script is that chardetect can't === EXAMPLE USAGE: recursively converts everything in given directory: find ~/Dir/with/files/ -type f | python all_...
pfs.py
import logging import threading import time from dataclasses import dataclass from enum import Enum from typing import Dict, Iterable, List, Literal, Optional, Set, Union, cast from urllib.parse import urlparse from eth_typing import Address from eth_utils import encode_hex, to_canonical_address, to_checksum_address f...
ics.py
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import sys import threading import time import socket import xmltodict import json # from lib.payload.scanner.service.engine import recv_all COMMANDS = [ { "\x01I30100\n": ["9999FF1B"] }, { "\x01I20100\n": ["I20100", "IN-TANK INVEN...
multiprocessing_import_main.py
import multiprocessing import multiprocessing_import_worker if __name__ == "__main__": jobs = [] for i in range(5): p = multiprocessing.Process(target=multiprocessing_import_worker.worker) jobs.append(p) p.start()
service.py
import falcon import scrapy import settings import logging import threading import subprocess import crawlthread import urllib2 from multiprocessing import Process, Queue from elasticsearch import Elasticsearch, helpers from scrapy.crawler import CrawlerRunner from scrapy.utils.log import configure_logging from twiste...
dal_ros_aml.py
#!/usr/bin/env python from __future__ import print_function import rospy import actionlib from move_base_msgs.msg import * from utils import * from random_box_map import * from sensor_msgs.msg import LaserScan from nav_msgs.msg import Odometry from geometry_msgs.msg import PoseStamped, Twist from tf.transformations i...
orphan_process_monitor.py
# Copyright 2016 Splunk, 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 ...
wrappers.py
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
my_shell.py
from cmd import Cmd from threading import Thread import time import os import re class RingPrompt(Cmd): prompt = '' intro = 'Benvenuto nel ring. Usa ? per accedere all\'help' def do_exit(self, inp): print('Ciao, alla prossima!') return True def do_send(self, inp): #Prototipo...
test_udf_concurrency.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...
person.py
from .agent import * from .agent import _crop, _nd2file from .kcftracker import KCFTracker from .record import Record from .worker import Consumer from utils.action import cut, frames2data from time import time from datetime import datetime PAR = True DEBUG = False SIMILARITY_THRESHOLD = .85 DISTANCE_THRESHOLD = 200 ...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
http_server.py
# Copyright 2019 Google LLC # # 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, ...
main.py
#!/usr/bin/python # "tail" based on http://stackoverflow.com/a/12523302 # "2>/dev/null" based on http://stackoverflow.com/a/11269627 import threading, Queue, subprocess, re, os, signal, sys tailq = Queue.Queue(maxsize=10) state = [] class Subnet(object): cidr = '0.0.0.0/0' binary = '0' * 32 size = 0 ...
LazyManage.py
#!/usr/bin/python #encoding:utf8 #LzayManage.py #config file: serverlist.conf #By:peter.li #2014-01-07 #LazyManage.py version update address: #http://pan.baidu.com/s/1sjsFrmX #https://github.com/liquanzhou/ops_doc import paramiko import multiprocessing import sys,os,time,socket,re def Ssh_Cmd(host_ip,Cmd,user_name,u...
workplace_preparation.py
import math import deepdish as dd import shutil import subprocess from os import path, makedirs, remove, listdir from argparse import ArgumentParser from threading import Thread import numpy as np from matplotlib import pyplot as plt number_of_images_in_temp_model = 10 def parse_args() -> str: """ Function t...
proxy.py
""" Copyright (c) 2006 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later ...
tcp_client.py
""" tcp连接接收数据 """ # TCPclient.py import socket class TcpClient: def __init__(self): self.target_host = "116.62.44.118" # 服务器端地址 self.target_port = 3389 # 必须与服务器的端口号一致 def start(self): while True: client = socket.socket(socket.AF_INET,socket.SOCK_STREAM) cl...
SocketClient.py
# -*- coding: utf-8 -*- """ Created on Mon Jul 9 20:41:03 2018 @author: 康文洋 kangwenyangde@163.com、陈祚松、夏萍萍、艾美珍、陈兰兰、张梦丽、易传佳 """ import socket import threading class SocketClient: #构造函数 def __init__(self,host,port,mainpanel): self.Host=host self.Port=port self.Mainpanel=mainpanel ...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') # import threading after _multiprocessing to raise a more revelant error # message: "No module n...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
common.py
# http://inamidst.com/saxo/ # Created by Sean B. Palmer # You know your code is good when you don't have a generic module import base64 import collections import os import pickle import signal import socket import sys import threading # Usage as of 534f8c68: # b64pickle: client # b64unpickle: client, scheduler # err...
external_tools.py
import logging import multiprocessing import os from subprocess import run from Bio import SeqIO, AlignIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from constants import CD_HIT_CLUSTER_REPS_OUTPUT_FILE, CLUSTERS_NT_SEQS_DIR, CLUSTERS_ALIGNMENTS_DIR, \ NUMBER_OF_PROCESSES, FASTA_FILE_TYPE, ALIGNM...
testThread.py
import threading import time def threadf(name): print("Thread %s: starting thread",name) x = 0 while(1): time.sleep(1) s = "Thread " + str(x) print(s) x = x + 1 if __name__ == "__main__": print("Starting Program") x = threading.Thread(target=threadf, args=(1,)) x.start() y = 0 while(1): time.sleep(...
psutil_monitor.py
# licensed under the apache license: http://www.apache.org/licenses/license-2.0 # for details: https://github.com/gaogaotiantian/vizplugins/blob/master/notice.txt import multiprocessing as mp import os from viztracer.vizplugin import VizPluginBase from .monitor_process import MonitorProcess class PsutilMonitor(VizPl...
main.py
from game import Game import sys import threading from signalrcore.hub_connection_builder import HubConnectionBuilder def main(game_token=''): game = None user_token = None if game_token == '': game = Game('user1', game_token) user_token, game_token = game.start() game.game_token =...
tpu_survival.py
# Adapted from https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/tpu/utils/survival import json import logging from multiprocessing import Process import os import shlex import signal from subprocess import PIPE from subprocess import Popen import time from googleapiclient import discovery from oauth...
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...
wsdump.py
#!d:\github\reddit-stonk-scrape\rsc\scripts\python.exe 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(): encodi...
testcode.py
import logging import threading import time def worker(arg, i): while not arg['stop']: logging.debug('Hi from myfunc {0}'.format(i)) time.sleep(0.5) def main(): logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d %(threadName)s %(message)s') #info = {'stop': False} fo...
main.py
import asyncio import logging import os import threading from time import sleep from unittest.mock import MagicMock from dotenv import load_dotenv from Collectors.EdgeOS.Collector import EdgeOSCollector from Collectors.Environment.Collector import EnvironmentCollector from DB.InfluxDBCloud import InfluxDBCloud _loop...
app_utils.py
# From http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/ import struct import six import collections import cv2 import datetime import subprocess as sp import json import numpy import time from threading import Thread from matplotlib import colors class FPS: def ...
words2ids.py
from utils.vector_manager import VectorManager from time import time import multiprocessing as mp import argparse import numpy as np import os import sys def word2Id(filename, w2id, debug=False): if debug: print("Translating %s" % filename) unk_id = 0 file_out = "%s_num" % filename.split("_clean")...
testTcpLogic.py
from PyQt5 import QtWidgets import testTcpUi import socket import threading import json import sys #import stopThreading class TcpLogic(testTcpUi.ToolsUi): def __init__(self, num): super(TcpLogic, self).__init__(num) self.tcp_socket = None self.sever_th = None self....
minolovec.py
from tkinter import * from tkinter import messagebox from PIL import Image, ImageTk from polje import * import racunalnik import random import threading # array barv za stevilke na polju BARVE = {1: '#8B00FF', 2: '#4B0082', 3: '#0000FF', 4: '#20A106', 5: '#F2CB1D', 6: '#FF7...
run.py
import os import sys import time import torch import numpy as np import numpy.random as rd import multiprocessing as mp from elegantrl.env import build_env, build_eval_env from elegantrl.replay import ReplayBuffer, ReplayBufferMP from elegantrl.evaluator import Evaluator """[ElegantRL.2021.10.21](https://github.com/...
qPyMultiThread.py
# -*- coding=iso-8859-1 -*- # Copyright 2019 Qualys 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 re...
main.py
import requests import pytz import time import xml.etree.ElementTree as elementTree import os import threading from datetime import datetime from io import StringIO from html.parser import HTMLParser operators = [] class MLStripper(HTMLParser): def __init__(self): super().__init__() self.reset() ...
wpahandler.py
# -*- coding: utf-8 -*- # vim: ts=2 sw=2 et ai ############################################################################### # Copyright (c) 2012,2021 Andreas Vogel andreas@wellenvogel.net # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentatio...
obtaining_domain_ns_realtime.py
# encoding:utf-8 """ 分别向顶级域名的权威和DNS递归服务器查询域名的NS记录,并且批量更新 注意:使用两种方法获取域名的NS记录,因为不同方法都无法获取完整的NS记录 """ import sys reload(sys) sys.setdefaultencoding('utf-8') sys.path.append('../') import threading import time import random import datetime import hashlib from Queue import Queue from threading import Thread from collect...
router.py
# -*- encoding: utf-8 -*- import json import importlib import os import builtins from multiprocessing import Process from importlib.util import find_spec __all__=['run'] def run(): from utils.RedisHelper import RedisHelper _redis=RedisHelper() _redis.pubsub=_redis.conn.pubsub() _redi...
tm1637.py
"""Manipulate a TM1637 7-segment display.""" import math import threading from time import localtime, sleep from . import config as cg from .context import IO IO.setwarnings(False) IO.setmode(IO.BCM) HexDigits = [0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, ...
UT_HTMLReportAnalysisAndReportPreparation_GUI.py
from tkinter import Label, Button, Entry import tkinter as tk from tkinter import messagebox, filedialog, StringVar, SUNKEN, W, X, BOTTOM from os import path import threading, sys import os import UT_HTMLReportAnalysisAndReportPreparation class GUI_COntroller: ''' This class initialize the required controls...
common.py
"""Test the helper method for writing tests.""" from __future__ import annotations import asyncio from collections import OrderedDict from collections.abc import Awaitable, Callable, Collection from contextlib import contextmanager from datetime import datetime, timedelta import functools as ft from io import StringIO...
parse_awesome_lists.py
import html.parser import requests import markdown2 import json import re import queue from urllib.parse import urlparse from multiprocessing import Process# Going parallel! from urllib.parse import urlparse from bs4 import BeautifulSoup number_of_processes = 3 def examine_each_awesome(awesome_urls): prefix = 'h...
master_monitor.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code mus...
exampleApp12.py
import time import threading import random from pyhtmlgui import PyHtmlGui, PyHtmlView, Observable class App(Observable): def __init__(self): super().__init__() self.app_identifier = random.randint(0,100000) self.app_value = self.app_identifier self.connected_view_feedback = {} ...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node from electrum import constants from electr...
example6.py
from threading import Thread import threading import time class BankAccount: def __init__(self): self.lock = threading.Lock() self.sufficientBalanceCondition = threading.Condition(self.lock) self.balance = 0 def deposit(self, amount): self.lock.acquire() try: ...
test.py
# Load the trained model # Test it on the seen and unseen environment # # Seen environment - (X, Y) = (143.5, 207.0) # Unseen envioronment - (X, Y) = from keras.models import load_model import glob import os import sys import random import time import numpy as np import cv2 import math from collections import...
testclient.py
import asyncio import http import inspect import io import json import queue import threading import types import typing from urllib.parse import unquote, urljoin, urlsplit import requests from starlette.types import Message, Receive, Scope, Send from starlette.websockets import WebSocketDisconnect # Annotations for...
functions.py
import threading from neopixel import * import mido import datetime import psutil import time import socket import RPi.GPIO as GPIO def get_ip_address(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) local_ip = s.getsockname()[0] s.close() return local_ip def fin...
test_model.py
# encoding: utf8 from __future__ import unicode_literals import tempfile import os import pytest import threading import time from thinc.neural._classes import model as base from thinc.neural.ops import NumpyOps @pytest.fixture def model_with_no_args(): model = base.Model() return model def test_Model_def...
__init__.py
# MIT License # Copyright (c) 2020 Filip Kofron # 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, m...
executor.py
from concurrent.futures import Future import typeguard import logging import threading import queue import pickle from multiprocessing import Process, Queue from typing import Dict, List, Optional, Tuple, Union import math from ipyparallel.serialize import pack_apply_message from ipyparallel.serialize import deseriali...
semaphores.py
import threading class Queue(): def __init__(self, n): self.available_spots = threading.Semaphore(n) self.content = [] def add(self, x): self.available_spots.acquire() self.content.append(x) def pop(self): x = self.content.pop(0) self.available_spots.relea...
target.py
"""The target command.""" import os import re import socket import sys import threading from urllib.parse import urlsplit from anubis.scanners.anubis_db import search_anubisdb, send_to_anubisdb from anubis.scanners.crt import search_crtsh from anubis.scanners.dnsdumpster import search_dnsdumpster from anubis.scanners....
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable from PyQt5.QtCore import QRect, QEventLoo...
exp_LJpot.py
import RPi.GPIO as GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) import os import time import threading import numpy as np from picamera import PiCamera from lib_utils import * from lib_photodiode import Photodiode from lib_depthsensor import DepthSensor from lib_fin import Fin from lib_leds import LEDS from ...
net_test.py
# Copyright (C) 2019-2020, Therapixel SA. # All rights reserved. # This file is subject to the terms and conditions described in the # LICENSE file distributed in this package. """Test that the config functionalities of the pacsanini package can be correctly accessed from the command line. """ import socket from threa...
vngate.py
# encoding: utf-8 import urllib import sys import json from time import time, sleep from threading import Thread import urllib.parse as urlparse from datetime import datetime import base64 import hmac import hashlib import json import gzip, binascii, os import http.client as httplib import traceback from vnpy.trader....
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
callbacks_test.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...
local_backend.py
import json import os import socket import socketserver import sys from threading import Thread import pkg_resources import py4j from py4j.java_gateway import JavaGateway, GatewayParameters, launch_gateway from hail.expr.blockmatrix_type import tblockmatrix from hail.expr.matrix_type import tmatrix from hail.expr.tab...
dark.v1.9.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...
multi_start.py
# -*- coding: utf-8 -*- """ # @Time : 2019/7/4 18:27 # @Author : 王诚坤 # @File : multi_start.py # @des : 多线程启动函数 """ from multi_haodf import getContent import threading from tools import ConnectDatabase as conn def main(): # 查询数据库连接 select_conn = conn.MySQLCommand() select_conn.connectMysql(tabl...
api.py
# -*- coding: utf-8 -*- """ api ~~~ Implements API Server and Interface :author: Feei <feei@feei.cn> :homepage: https://github.com/WhaleShark-Team/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2018 Feei. All rights reserved """ import datetime import e...
news.py
import time from .spider.coldspider import datablogspider, collegespider, govspider, gongyispider, mediaspider from .spider.hotspider import hotspider, spider, rankspider, photospider from .spider.db import write_to_sys, db_img, pic_to_sys import threading # 部署爬虫唯一出入口main()方法 if __name__ == '__main__': # 定义break条...
notify_mtr.py
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ import base64 import hashlib import hmac import os import re import threading import time import urllib.parse from json import JSONDecodeError import json5 as json import requests from utils_env import get_file_path # 原先的 print 函数和主线程的锁 _print = print mutex = threading.L...
bgapi.py
from __future__ import print_function # for Python 2/3 compatibility import logging try: import queue except: import Queue as queue import serial import time import threading from binascii import hexlify, unhexlify from uuid import UUID from enum import Enum from collections import defaultdict from pygatt.exc...
git_common.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. # Derived from https://gist.github.com/aljungberg/626518 from __future__ import prin...
SClient.py
""" Circadia Theme Editor - socket client communicates with a remote server over sockets Author: fhu """ import threading import socket import json import pygame # # todo: implement remote sound. sound is currently played back locally # class CircadiaSocketClient: def __init__(self): s...
naufalbot.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re cl = LINETCR.LINE() cl.login(qr=True) cl.loginResult() print "login success" reload(sys) sys.setdefaultencoding('utf-8') helpMessage =""" Naufal Bot ¤ Id︎ ...
test_admission_controller.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.py
# Copyright DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
armory.py
# Armory 3D Engine # https://github.com/armory3d/armory bl_info = { "name": "Armory", "category": "Render", "location": "Properties -> Render -> Armory Player", "description": "3D Game Engine for Blender", "author": "Armory3D.org", "version": (0, 6, 0), "blender": (2, 80, 0), "wiki_url":...
timeout.py
import time from multiprocessing import Process # Note: this does not return any return values of the function, just the exit status INTERVAL = 0.1 def run_with_timeout(timeout, fn, *kwargs): def runner(fn, kwargs): try: fn(*kwargs) except Exception as e: print(e) raise e process = Pro...